Legends
Adding a legend block to a visualization makes a legend entry appear for this visualization.
Each legend entry is shown with the geometry type and color defined by the dataset and the visualization block.
While simple visualizations will generate a single legend entry, categorical visualizations will generate a legend entry per category.
The legend block
The only field is displayName. For categorical visualizations it maps each category to its label; for numeric/heatmap visualizations it maps the index of each class ("0", "1", …) to its label. Set "displayName": "auto" to let Felt generate the labels for you — from the computed breaks for numeric classes, or from the category names for categorical visualizations ("auto" requires steps or categories to be set in config). An empty legend: {} still produces a legend entry using the dataset's geometry and color.
For continuous (non-stepped) color-by and heatmap legends keyed by index, "0" labels the lowest value and the highest index labels the highest value. Continuous size legends are the historical exception: their indices run inverted, with "0" labeling the maximum, "1" the midpoint, and "2" the minimum.
Simple legend
The Biodiversity Hotspots layer in Felt has a simple visualization with a legend defined as follows:
"legend": {}
Categorical legend
The Plant Hardiness Zones layer in Felt has a categorical visualization with a legend defined as follows:

Numeric legends
The visual display of numeric legends varies based on the style method (stepped or continuous) and the geometry type (point, line, polygon).
The displayName can be modified in the legend block similar to simple and categorical style types.
Stepped

Continuous

Heatmap legends
Heatmap legends are defined as follows:

Notice that the displayName mapping goes from 0 (left value) to 1 (right value)
Last updated
Was this helpful?