Skip to main content

Interface: LegendSpec

Defined in: spec/types.legend.ts:181

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?

optional colorBy?: ColorBy

Defined in: spec/types.legend.ts:225

Declarative color-by configuration for a layer. When omitted, mergeLegends fills it from the auto-generated legend.


id

id: string

Defined in: spec/types.legend.ts:183

Unique identifier used to resolve this legend from GeoVisLegend.


labelFormat?

optional labelFormat?: LabelFormatSpec

Defined in: spec/types.legend.ts:192

Controls how quantitative bin labels are generated. When omitted the default range style is used.


noDataLabel?

optional noDataLabel?: string

Defined in: spec/types.legend.ts:210

Label for the "no data" swatch rendered at the bottom of the legend. When omitted no "no data" entry is shown.


normalization?

optional normalization?: NormalizationSpec

Defined in: spec/types.legend.ts:197

Normalisation metadata for the mapped values. Used to append semantic suffixes when labelFormat.extended is true.


position?

optional position?: LegendPosition

Defined in: spec/types.legend.ts:205

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?

optional reference?: string

Defined in: spec/types.legend.ts:220

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?

optional subtitle?: string

Defined in: spec/types.legend.ts:187

Secondary description rendered below the title.


title?

optional title?: string

Defined in: spec/types.legend.ts:185

Short heading rendered above the legend swatches.