LogoLogo
Sign upHelp CenterContactSocial
Home
Home
  • Overview
  • REST API
    • Getting started
    • Navigating maps and workspaces
    • Uploading files and URLs
    • Styling layers
    • Refreshing live data layers
    • Working with elements
    • Listening to updates using webhooks
    • API Reference
      • Authentication
      • Maps
      • Layers
      • Elements
      • Users
      • Comments
      • Embed Tokens
      • Sources
      • Projects
  • JS SDK
    • Getting started
    • General concepts
    • Controlling maps
    • Working with selection
    • Reading entities
    • Drawing elements
    • Working with layers
    • Layer filters
    • Building custom charts
    • Map interactions and viewport
    • Hiding and showing
    • Integrating with React
    • Sample application
    • Examples
    • API Reference
  • Felt Style Language
    • Getting started
    • Style definition blocks
      • The config block
      • The paint block
      • The label block
      • The legend block
      • The popup block
      • The attributes block
      • The filters block
    • Types of visualizations
      • Simple visualizations
      • Categorical visualizations
      • Numeric visualizations (color & size)
      • Heatmaps
      • Hillshade
    • Zoom-based Styling
      • Interpolators
    • Legends
    • Errors
    • Examples
Powered by GitBook
On this page

Was this helpful?

Export as PDF
  1. Felt Style Language
  2. Style definition blocks

The legend block

PreviousThe label blockNextThe popup block

Last updated 1 year ago

Was this helpful?

The legend block contains information on how the legend will be displayed for this visualization.

Take a look at to see how it works.

These are the fields that each legend block can contain:

Field name
Description

displayName

Optional. In categorical visualizations, a dictionary that maps from each category to what will be displayed on the legend. In or visualizations, a dictionary that maps from the index of each class to what will be displayed on the legend.

Example of a categorical legend
"legend": {
  "displayName": {
    "category-1": "Category 1",
    "category-2": "Category 2"
  }
}
Example of a numerical legend
"legend": {
  "displayName": {
    "0": "-0.5", 
    "1": "0.5"
  }
}
the legends section
numeric
heatmap