Interface: CosmographRangeColorLegendConfig
Extends
Properties
useLinksData?
optionaluseLinksData:boolean
Whether to use the data from the links instead of the points for the size legend.
Default: false
Inherited from
CosmographRangeColorLegendConfigInterface.useLinksData
selectOnClick?
optionalselectOnClick:boolean
Whether to select the points/links with the corresponding values when clicking on the legend elements.
Default: true
Inherited from
CosmographRangeColorLegendConfigInterface.selectOnClick
steps?
optionalsteps:number
Specifies the number of color gradations in the range legend.
The CosmographRangeColorLegend divides the current accessorās extent into this many discrete steps.
Each step corresponds to a color value derived from the current pointColorByFn or linkColorByFn.
Overridden if overrideColors is provided by overrideColors length.
Default: 10
Inherited from
CosmographRangeColorLegendConfigInterface.steps
overrideColors?
optionaloverrideColors:RangeLegendColor[]
The color scheme for the color range legend, specified as an array of colors.
The first color represents the start of the range, and the last color represents the end of the range.
Can be an array of [number, number, number, number] or string.
The colors can be specified as a 4-element array of [r, g, b, a] values (where each component is between 0 and 255),
or as a CSS color string (e.g. ā#ff0000ā for red).
Inherited from
CosmographRangeColorLegendConfigInterface.overrideColors
useDiscreteColors?
optionaluseDiscreteColors:boolean
When true and overrideColors is provided, displays the legend colors as discrete bands
instead of a continuous gradient. This creates clear separation between color categories.
Has no effect if overrideColors is not provided.
Default: false
Inherited from
CosmographRangeColorLegendConfigInterface.useDiscreteColors
useQuantiles?
optionaluseQuantiles:boolean
Whether to use quantiles to get size legend min/max.
Inherited from
CosmographRangeColorLegendConfigInterface.useQuantiles
hidden?
optionalhidden:boolean
Whether to hide the legend.
Default: false
Inherited from
CosmographRangeColorLegendConfigInterface.hidden
noDataMessage?
optionalnoDataMessage:string|false
Text to display when there is no data. When set to false, this message will not be displayed.
Default
'No data'Inherited from
Omit.noDataMessage
loadingMessage?
optionalloadingMessage:string|false
Text to display when data is loading. When set to false, this message will not be displayed.
Default
'Data loading...'Inherited from
Omit.loadingMessage
disableStateMessages?
optionaldisableStateMessages:boolean
Whether to disable all messages in the DisplayState element.
Default
falseInherited from
Omit.disableStateMessages
allowPointerEvents?
optionalallowPointerEvents:boolean
Whether to allow pointer events on the DisplayState element when message is visible.
Default
falseInherited from
Omit.allowPointerEvents
label?
optionallabel:string| (accessor?) =>string
The label for the color legend. Can be a string or a function that returns a string based on an accessor.
Default
''Inherited from
Omit.label
labelFormatter()?
optionallabelFormatter: (n) =>string
The label formatter function to format the color legend label.
Parameters
| Parameter | Type | Description |
|---|---|---|
n | number | The value to format. |
Returns
string
The formatted label string.
Default
undefinedInherited from
Omit.labelFormatter
extentLabels?
optionalextentLabels: [string|number,string|number]
The labels to use for the minimum and maximum values of the color legend.
Default
undefinedInherited from
Omit.extentLabels
enableEvents?
optionalenableEvents:boolean
Whether to enable event handling for the color legend.
Default
trueInherited from
Omit.enableEvents
showSublabels?
optionalshowSublabels:boolean
Whether to show sublabels for the minimum and maximum values of the color legend.
Default
falseInherited from
Omit.showSublabels
minSubLabel?
optionalminSubLabel:string
The label to use for the minimum value of the color legend.
Default
'min'Inherited from
Omit.minSubLabel
maxSubLabel?
optionalmaxSubLabel:string
The label to use for the maximum value of the color legend.
Default
'max'Inherited from
Omit.maxSubLabel
discreteColors?
optionaldiscreteColors:boolean
Whether to use display colors extent as discrete segments or continuous gradient.
Default
falseInherited from
Omit.discreteColors
onClick()?
optionalonClick: (e) =>void
Callback function that is called when the color legend is clicked.
Parameters
| Parameter | Type | Description |
|---|---|---|
e | Event | The click event object. |
Returns
void
Inherited from
Omit.onClick
onMinClick()?
optionalonMinClick: (color,value,e) =>void
Callback function that is called when the minimum value of the color legend is clicked.
Parameters
| Parameter | Type | Description |
|---|---|---|
color | undefined | RangeLegendColor | The color of the minimum value, or undefined if no color is associated. |
value | undefined | string | number | The value of the minimum, or undefined if no value is associated. |
e | Event | The click event object. |
Returns
void
Inherited from
Omit.onMinClick
onMaxClick()?
optionalonMaxClick: (color,value,e) =>void
Callback function that is called when the maximum value of the color legend is clicked.
Parameters
| Parameter | Type | Description |
|---|---|---|
color | undefined | RangeLegendColor | The color of the maximum value, or undefined if no color is associated. |
value | undefined | string | number | The value of the maximum, or undefined if no value is associated. |
e | Event | The click event object. |
Returns
void
Inherited from
Omit.onMaxClick
onHover()?
optionalonHover: (e) =>void
Callback function that is called when the color legend is hovered over.
Parameters
| Parameter | Type | Description |
|---|---|---|
e | Event | The hover event object. |
Returns
void
Inherited from
Omit.onHover