# Widgets

In Builder, widgets empower users to dynamically explore data, leading to rich visualizations. They also serve to filter data based on the map viewport and interconnected widgets.

Below are the current type of Widgets available to customize your visualization and enable a richer interaction with your data:

* [**Formula Widget**](https://docs.carto.com/carto-user-manual/maps/widgets/formula-widget): Shows aggregated numerical data as a single metric.
* [**Category Widget**](https://docs.carto.com/carto-user-manual/maps/widgets/category-widget): Segments data into distinct categories displaying aggregated metrics.
* [**Pie Widget**](https://docs.carto.com/carto-user-manual/maps/widgets/pie-widget): Visualizes categorical data by displaying the proportion of each category relative to the whole data set.
* [**Histogram Widget**](https://docs.carto.com/carto-user-manual/maps/widgets/histogram-widget): Shows the frequency distribution across equal bins in the data range.
* [**Range Widget**](https://docs.carto.com/carto-user-manual/maps/widgets/range-widget): Shows a specific range of numerical data adjustable via slider or input values.
* [**Time Series Widget**](https://docs.carto.com/carto-user-manual/maps/widgets/time-series-widget)**:** Shows the frequency distribution aggregated by a temporal period. It also allows to create animated maps.
* [**Table Widget**](https://docs.carto.com/carto-user-manual/maps/widgets/table-widget): Displays tabular data for easy viewing and interaction.

{% hint style="info" %}
Time Series Widget is not supported for raster or pre-generated tilesets sources.

Table Widget is not supported for raster sources.
{% endhint %}

### Adding a Widget

Add a widget to Builder by clicking "New Widget" and select your data source.

<figure><img src="https://3029946802-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FybPdpmLltPkzGFvz7m8A%2Fuploads%2Fgit-blob-1812fe73640f65bfe957e5c8495d709412795c92%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

Then, select a widget type from the menu: *Formula,* *Category*, *Histogram*, *Range*, *Time Series* or *Table*.

<figure><img src="https://3029946802-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FybPdpmLltPkzGFvz7m8A%2Fuploads%2Fgit-blob-83e868e979592d9ff0e3720287024e7e691fbbc0%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

### Configuring a Widget

Once you have selected the widget type of your preference, you are ready to configure your Widget.

### Widget Data

In the Data section of the Widget configuration, choose an aggregation operation `COUNT`, `AVG`, `MAX`, `MIN` or `SUM` and, if relevant, specify the column on which to perform the aggregation.

<figure><img src="https://3029946802-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FybPdpmLltPkzGFvz7m8A%2Fuploads%2Fgit-blob-9d669845e34ae9007965c4db404b978139918a58%2Fimage.png?alt=media" alt=""><figcaption><p><em>Selecting an operation</em></p></figcaption></figure>

{% hint style="info" %}
When working with **pre-generated tilesets**, please ensure your data have a unique identifier named *`geoid`* for correct Widgets calculations.
{% endhint %}

### Widget Display

Using the **Formatting** option, you can auto-format data, ensuring enhanced clarity. For instance, you can apply automatic rounding, comma-separations, or percentage displays.

<figure><img src="https://3029946802-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FybPdpmLltPkzGFvz7m8A%2Fuploads%2Fgit-blob-adec928f4f8e43721a00787468cbd7ce210103d7%2Fimage.png?alt=media" alt=""><figcaption><p><em>Formatting selector on Widget configuration</em></p></figcaption></figure>

You can use **Notes** to supplement your Widgets with descriptive annotations which support [Markdown syntax](https://www.markdownguide.org/basic-syntax/), allowing to add text formatting, ordered lists, links, etc.

<figure><img src="https://3029946802-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FybPdpmLltPkzGFvz7m8A%2Fuploads%2Fgit-blob-12c798746eeabca05f7a5f68ebf47e64bc0dfa43%2Fimage.png?alt=media" alt=""><figcaption><p><em>Adding a rich note using markdown</em></p></figcaption></figure>

### Widget Behavior

Widgets offer two distinct modes of operation: "Global" and "Viewport".

**Global Mode**

By default widgets are calculated in global mode where information is displayed for the full data source. This option does not take into account the viewport extent of the data.

**Viewport Mode**

You can configure widgets to work in viewport mode, meaning the data gets updated when the viewport extent changes.

For dynamic tiling sources, viewport widgets get the data by performing a SQL query to the data warehouse; whereas, if you are working with pre-generated tilesets, viewport widgets work with the data that has been downloaded for visualization which is available locally in the browser.

{% hint style="info" %}
Please be aware that **global mode is not supported for pre-generated** **tileset** sources. In such scenarios, the functionality defaults to viewport mode. This means that all calculations are based on the extent of the map's current viewport.
{% endhint %}

**Cross-filtering**

Some widgets support **cross-filtering**, allowing them to filter not only themselves but also other components on the map. When enabled, the widget can apply filters across:

* A **single source** (default behavior), affecting all layers and widgets connected to that source.
* **Multiple sources**, as long as they share the same filtering property (e.g., region, category, or timestamp).

When **cross-filtering is disabled** for a widget, it becomes read-only: it still displays aggregated data but cannot trigger any filtering actions on the widget itself or related components. This behavior can be toggled on or off per widget using the **cross-filtering toggle** in the widget configuration panel.

<figure><img src="https://3029946802-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FybPdpmLltPkzGFvz7m8A%2Fuploads%2Fgit-blob-22ae821bbc9029273e56fe98e7e739a6d0be1da7%2Fcross-filtering.gif?alt=media" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
**Limitations**

The **Time Series widget** supports cross-filtering across multiple sources **only over the temporal property**. Split by property is not supported.

Only **one Range widget per map** using a specific property can be configured to cross-filter across multiple sources.
{% endhint %}

**Collapsing widgets**

In the Behavior section of Builder, you have the option to make Widgets **collapsible**, allowing them to be hidden when needed. Additionally, widgets can be set to **automatically collapse** when their associated layers are not visible.

{% hint style="info" %}
As Widget settings differ between widget types, please visit the individual widget's documentation page for more detailed information.
{% endhint %}
