#!/usr/bin/env python # coding: utf-8 # ## Category widget # # Category widgets group features from string columns into aggregated categories based on their occurence in your current map view and displayed with their associated counts. You can filter on a particular category by selecting it and by default, as you zoom or pan the map, the values in the widget update to the current viewport. # # To see available parameters run `help(category_widget)`. # # In the example below, the category widget summarizes the types of collisions in Seattle. # In[1]: from cartoframes.auth import set_default_credentials set_default_credentials('cartoframes') # In[2]: from cartoframes.viz import Layer, category_widget Layer( 'seattle_collisions', widgets=[ category_widget( 'collisiontype', title='Type of Collision', description='Select a category to filter' ) ] )