Filtering and interactivity
Last updated
Was this helpful?
Last updated
Was this helpful?
Your application now uses and , powered by your A potential next step is to add interactivity and filters in your application. For example:
Letting your users modify styles in your application
A dropdown that exposes different parameters for your users
Clicking on a bar chart to filter by that specific category
Letting users draw a custom polygon to filter the widgets
CARTO and deck.gl provide different tools for developers to implement this and other filtering/interactivity scenarios.
For all interactions with the map, we recommend taking a look at the deck.gl documentation.
Filters based on columns (for example, a specific dropdown value or filtering by a specific category) can be applied easily using the utilities available in .
We typically distinguish two types of spatial filters
The deck.gl map viewport: the current viewState of the deck.gl map. In other words, what the user is viewing.
A custom polygon mask: a state boundary, a circle, or a custom polygon drawn by the user. For custom polygons we recommend using , a community module maintained by CARTO.
Once you've defined your spatial filter, with the utilities available in , and if needed, the in deck.gl, you can filter all the CARTO layers and widgets in your app.