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
Parameter | Type | Description |
---|---|---|
containerNode | HTMLElement | The HTML element that will contain the range color legend. |
config? | RangeColorLegendConfigInterface | An 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
Parameter | Type |
---|---|
config | DisplayStateConfigInterface |
defaultConfig | DisplayStateConfigInterface |
Returns
Inherited from
DisplayStateManager
.extractConfig
showState()
showState(
text?
):void
Shows the DisplayState element with the specified text
Parameters
Parameter | Type | Description |
---|---|---|
text? | string | Optional text to display, defaults to noDataMessage |
Returns
void
Inherited from
hideState()
hideState():
void
Hides the DisplayState element
Returns
void
Inherited from
setDisplayStateConfig()
setDisplayStateConfig(
config
):void
Updates the DisplayState configuration
Parameters
Parameter | Type |
---|---|
config | DisplayStateConfigInterface |
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
Parameter | Type | Description |
---|---|---|
config? | RangeColorLegendConfigInterface | An 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
setLoadingState()
setLoadingState():
void
Sets the text content of the fallback div to āData loadingā¦ā to indicate that data is currently being loaded.
Returns
void