Interface: LegendSpec
Defined in: spec/types.legend.ts:205
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:273
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:226
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:216
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:221
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:207
Unique identifier used to resolve this legend from GeoVisLegend.
labelFormat?
optionallabelFormat?:LabelFormatSpec
Defined in: spec/types.legend.ts:231
Controls how quantitative bin labels are generated.
When omitted the default range style is used.
noDataLabel?
optionalnoDataLabel?:string
Defined in: spec/types.legend.ts:258
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:236
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:253
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:244
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:268
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:211
Secondary description rendered below the title.
title?
optionaltitle?:string
Defined in: spec/types.legend.ts:209
Short heading rendered above the legend swatches.