DocsJavaScript / React libraryAPIInterfacesCosmographTypeColorLegendConfig

Interface: CosmographTypeColorLegendConfig

Extends

Properties

useLinksData?

optional useLinksData: boolean

Whether to use the data from the links instead of the points for the type legend.

Default

false

Inherited from

CosmographTypeColorLegendConfigInterface.useLinksData


selectOnClick?

optional selectOnClick: boolean

Whether to select the points/links with the corresponding values when clicking on the legend items.

Default

true

Inherited from

CosmographTypeColorLegendConfigInterface.selectOnClick


overrideItems?

optional overrideItems: TypeColorLegendItem[]

An optional array of TypeColorLegendItem objects that will override the default legend items.

Inherited from

CosmographTypeColorLegendConfigInterface.overrideItems


sortBy?

optional sortBy: string

The field to sort the legend items by. Should be from the same table. If not provided, the items will not be sorted.

Inherited from

CosmographTypeColorLegendConfigInterface.sortBy


sortOrder?

optional sortOrder: "desc" | "asc"

The order to sort the legend items in. Can be either ‘asc’ for ascending order or ‘desc’ for descending order. If not provided, the items will not be sorted.

Inherited from

CosmographTypeColorLegendConfigInterface.sortOrder


hideUnknown?

optional hideUnknown: boolean

Whether to hide legend items for unknown values.

Default

true

Inherited from

CosmographTypeColorLegendConfigInterface.hideUnknown


resetSelectionOnCollapse?

optional resetSelectionOnCollapse: boolean

When the legend collapses (“show less” is clicked), determines whether to deselect an item if it was selected from the expanded list but is now hidden.

Remarks

Has no effect if selectOnClick is false.

Default

true

Inherited from

CosmographTypeColorLegendConfigInterface.resetSelectionOnCollapse


hidden?

optional hidden: boolean

Whether to hide the legend. Default: false

Inherited from

CosmographTypeColorLegendConfigInterface.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


alignRight?

optional alignRight: boolean

Whether to align the color legend items to the right. When true, the legend items will be right-aligned within their container.

Default

false

Inherited from

Omit.alignRight


maxDisplayedItems?

optional maxDisplayedItems: number

The maximum number of color legend items to display. When exceeded, a “show more” button will appear to display additional items.

Default

15

Inherited from

Omit.maxDisplayedItems


labelFormatter()?

optional labelFormatter: (n) => string

The label formatter function to format the legend labels.

Parameters

ParameterTypeDescription
nstringThe label string to format

Returns

string

The formatted label string

Inherited from

Omit.labelFormatter


enableEvents?

optional enableEvents: boolean

Whether to enable event handling for the color legend. When true, click and hover events will be active on legend items.

Default

true

Inherited from

Omit.enableEvents


expanded?

optional expanded: boolean

Whether the color legend list (if “show more” is active) is expanded or not.

Default

false

Inherited from

Omit.expanded


onClick()?

optional onClick: (e, item?) => void

Callback function that is called when a color legend item is clicked.

Parameters

ParameterTypeDescription
eEventThe click event object
item?TypeColorLegendItemThe color legend item that was clicked, or undefined if no item was clicked

Returns

void

Inherited from

Omit.onClick


onHover()?

optional onHover: (e, item?) => void

Callback function that is called when the mouse hovers over a color legend item.

Parameters

ParameterTypeDescription
eEventThe hover event object
item?TypeColorLegendItemThe color legend item that was hovered over, or undefined if no item is being hovered

Returns

void

Inherited from

Omit.onHover


onShowMoreClick()?

optional onShowMoreClick: (expanded) => void

Callback function that is called when the “show more” button is clicked.

Parameters

ParameterTypeDescription
expandedbooleanWhether the list is expanded or collapsed

Returns

void

Inherited from

Omit.onShowMoreClick