Class: RangeColorLegend

Represents a range color legend component that displays a color gradient and labels for the minimum and maximum values.

The RangeColorLegend class is responsible for creating and managing the visual elements of the range color legend, including the color gradient, minimum and maximum value labels, and optional event handlers.

The legend can be configured with various options, such as the color extent, label formatting, and event callbacks. The legend also provides methods to show, hide, and update the configuration of the legend.

Extends

Constructors

Constructor

new RangeColorLegend(containerNode, config?): RangeColorLegend

Constructs a new RangeColorLegend instance with the provided container node and optional configuration.

The RangeColorLegend is responsible for creating and managing the visual elements of the range color legend, including the color gradient, minimum and maximum value labels, and optional event handlers.

Parameters

ParameterTypeDescription
containerNodeHTMLElementThe HTML element that will contain the range color legend.
config?RangeColorLegendConfigInterfaceAn optional configuration object that can be used to customize the behavior and appearance of the legend.

Returns

RangeColorLegend

Overrides

DisplayStateManager.constructor

Accessors

extentElements

Get Signature

get extentElements(): null | { min: HTMLElement; max: HTMLElement; }

Gets the minimum and maximum extent elements of the range color legend.

Returns

null | { min: HTMLElement; max: HTMLElement; }

The minimum and maximum extent elements, or null if they have not been created yet.


config

Get Signature

get config(): RangeColorLegendConfigInterface

Gets the current configuration for the range color legend.

Returns

RangeColorLegendConfigInterface

The current configuration object for the range color legend.

Methods

extractConfig()

static extractConfig(config, defaultConfig): DisplayStateConfigInterface

Parameters

ParameterType
configDisplayStateConfigInterface
defaultConfigDisplayStateConfigInterface

Returns

DisplayStateConfigInterface

Inherited from

DisplayStateManager.extractConfig


showState()

showState(text?): void

Shows the DisplayState element with the specified text

Parameters

ParameterTypeDescription
text?stringOptional text to display, defaults to noDataMessage

Returns

void

Inherited from

DisplayStateManager.showState


hideState()

hideState(): void

Hides the DisplayState element

Returns

void

Inherited from

DisplayStateManager.hideState


setDisplayStateConfig()

setDisplayStateConfig(config): void

Updates the DisplayState configuration

Parameters

ParameterType
configDisplayStateConfigInterface

Returns

void

Inherited from

DisplayStateManager.setDisplayStateConfig


hide()

hide(): void

Hides the range color legend by removing the ā€˜enabled’ class and adding the ā€˜disabled’ class to the legend element.

Returns

void


show()

show(): void

Shows the range color legend by removing the ā€˜disabled’ class and adding the ā€˜enabled’ class to the legend element.

Returns

void


setConfig()

setConfig(config?): void

Sets the configuration for the range color legend.

Parameters

ParameterTypeDescription
config?RangeColorLegendConfigInterfaceAn optional configuration object that can be used to customize the behavior and appearance of the legend.

Returns

void


destroy()

destroy(): void

Destroys the range color legend by removing event listeners and removing the legend and fallback elements from the container node.

Returns

void

Overrides

DisplayStateManager.destroy


setLoadingState()

setLoadingState(): void

Sets the text content of the fallback div to ā€˜Data loading…’ to indicate that data is currently being loaded.

Returns

void

Overrides

DisplayStateManager.setLoadingState