This guide describes how use category widgets to filter by selected string columns from your data. Like all widgets, category widgets are data-driven. Only the most relevant categories of data are displayed, based on your Map View. As you zoom or pan the map, the category widget filters change.
When creating a category widget, you configure the widget values by an aggregated data column and define the operation of how the columns are selected. This groups data into "categories".
You can select one or more values from a category widget to highlight particular columns of interest.
Import the template .carto file packaged from the "Download resources" of this guide and create the map. Builder opens with US Counties as the first map layer and Railroad Accidents as the second map layer.
Ensure that your Map View is zoomed to level 4, and that auto style is applied to the Railroad Companies widget.
Click on the top two railroad companies, UP (Union Pacific) and BNSF (Burlington North Santa Fe).
Only the selected filters appear styled on your dashboard, and the rest of the categories are temporarily removed from your visualization.
Click on the same filters again to deselect them, or click ALL to show all relevant categories from the widget again.
The OTHER filter (from a category widget) groups together the less relevant values that may not be visible from your Map View. You can manually search for values from the OTHER category, which can help you re-evaluate how your Map View should appear.
For example, supposed that I am doing a risk analysis of New Jersey Transit (NJTR) and Metro-North Railroad Company (MNCW) but they are not visible in my category widget. I can manually search for these values and apply them to my category widget.
Since Auto style only styles the most relevant values of your visualization, remove it and use the default styling applied to the map instead.
To filter by a less relevant value, click the SEARCH IN # CATEGORIES.
Click the box next to the other value(s) to be included. You can type a value, or search through the list of available values.
Click APPLY to filter the category widget by the selected values.
You can zoom or pan your map to the filtered location, or click UNLOCK from the Railroad Companies widget to view the default categories again.
Optionally, apply Auto style to help visualize the difference between the two railroad companies.
We would love to hear from you! Was it easy to understand? Do you need more information? Let us know.