Interface: CosmographRangeColorLegendConfig
Extends
Properties
useLinksData?
optional
useLinksData:boolean
Whether to use the data from the links instead of the points for the size legend.
Default: false
Inherited from
CosmographRangeColorLegendConfigInterface
.useLinksData
selectOnClick?
optional
selectOnClick:boolean
Whether to select the points/links with the corresponding values when clicking on the legend elements.
Default: true
Inherited from
CosmographRangeColorLegendConfigInterface
.selectOnClick
steps?
optional
steps: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?
optional
overrideColors: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?
optional
useDiscreteColors: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?
optional
useQuantiles:boolean
Whether to use quantiles to get size legend min/max.
Inherited from
CosmographRangeColorLegendConfigInterface
.useQuantiles
hidden?
optional
hidden:boolean
Whether to hide the legend.
Default: false
Inherited from
CosmographRangeColorLegendConfigInterface
.hidden
noDataMessage?
optional
noDataMessage: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?
optional
loadingMessage: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?
optional
disableStateMessages:boolean
Whether to disable all messages in the DisplayState element.
Default
false
Inherited from
Omit.disableStateMessages
allowPointerEvents?
optional
allowPointerEvents:boolean
Whether to allow pointer events on the DisplayState element when message is visible.
Default
false
Inherited from
Omit.allowPointerEvents
label?
optional
label: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()?
optional
labelFormatter: (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
undefined
Inherited from
Omit.labelFormatter
extentLabels?
optional
extentLabels: [string
|number
,string
|number
]
The labels to use for the minimum and maximum values of the color legend.
Default
undefined
Inherited from
Omit.extentLabels
enableEvents?
optional
enableEvents:boolean
Whether to enable event handling for the color legend.
Default
true
Inherited from
Omit.enableEvents
showSublabels?
optional
showSublabels:boolean
Whether to show sublabels for the minimum and maximum values of the color legend.
Default
false
Inherited from
Omit.showSublabels
minSubLabel?
optional
minSubLabel:string
The label to use for the minimum value of the color legend.
Default
'min'
Inherited from
Omit.minSubLabel
maxSubLabel?
optional
maxSubLabel:string
The label to use for the maximum value of the color legend.
Default
'max'
Inherited from
Omit.maxSubLabel
discreteColors?
optional
discreteColors:boolean
Whether to use display colors extent
as discrete segments or continuous gradient.
Default
false
Inherited from
Omit.discreteColors
onClick()?
optional
onClick: (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()?
optional
onMinClick: (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()?
optional
onMaxClick: (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()?
optional
onHover: (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