Skip to main content

Interface: CategoricalColorBy

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

Categorical color mapping from a discrete feature property. Explicit color assignment is defined by mapping. Other fields such as colors and palette are adapter-specific hints and are not guaranteed to participate in categorical value resolution. Values not covered by mapping may fall back to defaultColor, depending on the consumer.

Properties​

colors?​

optional colors?: string[]

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

Explicit color list available for adapter-specific categorical handling.


defaultColor?​

optional defaultColor?: string

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

Fallback color for values not covered by mapping.


mapping?​

optional mapping?: Record<string, string>

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

Explicit value-to-color overrides.


palette?​

optional palette?: string

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

Named palette key available for adapter-specific categorical handling.


property?​

optional property?: string

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

Has no effect. The colour always comes from the layer's mapData dataset, read from feature-state under its stateKey (default 'value'), never from a GeoJSON property named here. Accepted for compatibility with specs that still declare it; leave it out of new specs.

Deprecated​

The colour reads the layer's mapData; this field is ignored.


type​

type: "categorical"

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