# Filtering and interactivity

Your application now uses [deck.gl layers](https://github.com/CartoDB/gitbook-documentation/blob/master/carto-for-developers/key-concepts/carto-for-deck.gl) and [charts/widgets](https://docs.carto.com/carto-for-developers/key-concepts/charts-and-widgets), powered by your [CARTO data sources.](https://docs.carto.com/carto-for-developers/key-concepts/data-sources) 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.

## Styles and map interactivity

For all interactions with the map, we recommend taking a look at the deck.gl documentation.

## Column-based filters

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 [CARTO Filters](https://docs.carto.com/carto-for-developers/reference/filters).

## Spatial filters

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 [`@deck.gl-community/editable-layers`](https://www.npmjs.com/package/@deck.gl-community/editable-layers), a community module maintained by CARTO.

Once you've defined your spatial filter, with the utilities available in [CARTO Filters](https://docs.carto.com/carto-for-developers/reference/filters), and if needed, the [mask extension](https://deck.gl/docs/api-reference/extensions/mask-extension) in deck.gl, you can filter all the CARTO layers and widgets in your app.
