Charts and widgets
Last updated
Last updated
With CARTO for Developers you can easily build customizable and interactive data widgets, using live data from your cloud data warehouse, on top of your CARTO + deck.gl map.
Widgets in CARTO are a series of flexible data models from the same data sources you can use in your maps.
For example, the Formula widget represents a single numerical statistic, such as an average or a count out of the column you define. And the Categories widget allows you to group and aggregate based on columns of your choice.
You can then turn those data models into interactive charts, filters and other HTML elements.
Adding widgets is easy. You just need to define your data sources from carto-api-client
just like you do in the CARTO module in deck.gl, and then use any of their widgetSource
data models, such as yourSource.widgetSource.getCategories()
:
A widget is a purposefully ample concept because it can be transformed into pretty much anything. A widget in CARTO can turn into
Custom HTML data representations: such as scorecards, tables or natural text.
Charts and other visualizations: you can use your favorite JS charting library to build bar charts, pie charts, radar charts and other charts.
Inputs and other interactive elements: some data models work great to build interactive inputs (such as range sliders) or you can easily build cross-filtering when users click in your charts.
We have prepared a set of examples showcasing charts and widgets
Our community in Slack is a great place to ask questions, share your work with other CARTO users, and get help from CARTO experts. Join here ⬇️