JavaScript & React libraryAPI

Interface: CosmographTypeColorLegendConfigInterface

Extended by

Properties

useLinksData?

optional useLinksData: boolean

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

Default

false


selectOnClick?

optional selectOnClick: boolean

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

Default

true


overrideItems?

optional overrideItems: TypeColorLegendItem[]

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


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.


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.


hideUnknown?

optional hideUnknown: boolean

Whether to hide legend items for unknown values.

Default

true


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


preserveSelectionOnUnmount?

optional preserveSelectionOnUnmount: boolean

Preserves the selection on unmount.

Default

false

showLabel?

optional showLabel: boolean

Controls the visibility of the legend items’ labels.

Default

false


labelResolver?

optional labelResolver: string | (accessor?) => string

The label for the legend. Can be a string or a function that returns a string based on an accessor.