Interface: LegendSpec
Defined in: spec/types.legend.ts:177
Alternative color/legend configuration exposed by a layer. Consumers MAY
present these as toggles; the active one is selected via activeLegendId.
Labels are always derived from the class breaks calculated by the
application's classification pipeline — not from manually provided text.
Use labelFormat to control how those breaks are formatted for display.
Properties
colorBy?
optionalcolorBy?:ColorBy
Defined in: spec/types.legend.ts:245
Declarative color-by configuration for a layer.
When omitted, mergeLegends fills it from the auto-generated legend.
footerValue?
optionalfooterValue?:string
Defined in: spec/types.legend.ts:198
Short value shown at the far right of the legend footer, e.g. a reference
year ('2024'). Rendered beside the reference text.
icon?
optionalicon?:string
Defined in: spec/types.legend.ts:188
Icon rendered in a tinted chip beside the title, as a @ttoss/react-icons
name (e.g. 'lucide:tractor'). When omitted no icon chip is shown.
iconColor?
optionaliconColor?:string
Defined in: spec/types.legend.ts:193
Accent color for the icon chip — tints both the glyph and (at low alpha)
the chip background. Defaults to the legend's first swatch color.
id
id:
string
Defined in: spec/types.legend.ts:179
Unique identifier used to resolve this legend from GeoVisLegend.
labelFormat?
optionallabelFormat?:LabelFormatSpec
Defined in: spec/types.legend.ts:203
Controls how quantitative bin labels are generated.
When omitted the default range style is used.
noDataLabel?
optionalnoDataLabel?:string
Defined in: spec/types.legend.ts:230
Label for the "no data" swatch rendered at the bottom of the legend. When omitted no "no data" entry is shown.
normalization?
optionalnormalization?:NormalizationSpec
Defined in: spec/types.legend.ts:208
Normalisation metadata for the mapped values.
Used to append semantic suffixes when labelFormat.extended is true.
offset?
optionaloffset?:number| {x?:number;y?:number; }
Defined in: spec/types.legend.ts:225
Distance in pixels from the anchored map edges (only applies with
position). Defaults to 24. A single number applies to both edges; pass
{ x, y } to offset each axis independently — e.g. push the legend clear
of a side panel horizontally without lifting it off the bottom edge. The
anchored distance animates when it changes, so a shifting offset slides the
legend across instead of teleporting.
position?
optionalposition?:LegendPosition
Defined in: spec/types.legend.ts:216
Corner position for an absolutely-positioned legend overlay.
When provided, GeoVisLegend applies CSS absolute positioning so the
legend can be overlaid on the map without coupling to the map engine.
When omitted the component renders in normal document flow and the caller
is responsible for positioning.
reference?
optionalreference?:string
Defined in: spec/types.legend.ts:240
Bibliographic or institutional attribution displayed below the swatches.
Supports plain text and an inline link syntax:
{link:visible text|https://example.com}
Example
reference: 'Source: {link:IBGE Censo 2022|https://ibge.gov.br}'
subtitle?
optionalsubtitle?:string
Defined in: spec/types.legend.ts:183
Secondary description rendered below the title.
title?
optionaltitle?:string
Defined in: spec/types.legend.ts:181
Short heading rendered above the legend swatches.