JavaScript & React libraryAPIClassesCosmographHistogram

Class: CosmographHistogram

The CosmographHistogram class manages histogram visualization within Cosmograph. It handles creation, configuration, and interaction with the histogram component, as well as integration with Cosmograph data and filtering mechanisms.

Extends

Constructors

Constructor

new CosmographHistogram(cosmograph, targetElement, config): CosmographHistogram

Constructs a filtering component that connects Cosmograph data to a UI component.

Parameters

ParameterTypeDescription
cosmographCosmographThe Cosmograph instance to connect to
targetElementHTMLElementHTML element for rendering the UI component
configCosmographHistogramConfigConfiguration for the filtering component

Returns

CosmographHistogram

Inherited from

CosmographInclusiveSelectionComponent.constructor

Accessors

defaultConfig

Get Signature

get defaultConfig(): CosmographHistogramConfig

Returns

CosmographHistogramConfig

Overrides

CosmographInclusiveSelectionComponent.defaultConfig


accessor

Get Signature

get accessor(): string

Returns

string

Overrides

CosmographInclusiveSelectionComponent.accessor

Methods

remove()

remove(): void

Removes the component and cleans up event listeners

Returns

void

Inherited from

CosmographInclusiveSelectionComponent.remove


setConfig()

setConfig(config): Promise<void>

Parameters

ParameterType
configPartial<TConfig>

Returns

Promise<void>

Inherited from

CosmographInclusiveSelectionComponent.setConfig


getCurrentSelection()

getCurrentSelection(): undefined | number[]

Returns the current selection of the histogram in data values.

Returns

undefined | number[]

The current selection or undefined if no selection is active.


getCurrentSelectionInPixels()

getCurrentSelectionInPixels(): undefined | number[]

Returns the current selection of the histogram in pixel coordinates.

Returns

undefined | number[]

The current selection in pixel coordinates.


getBarWidth()

getBarWidth(): undefined | number

Returns the current width of the histogram bars.

Returns

undefined | number

The current width of the histogram bars.


setSelection()

setSelection(selection?): void

Sets the selection of the histogram in pixel coordinates.

Parameters

ParameterTypeDescription
selection?[number, number]The new selection in pixel coordinates, or undefined to clear the selection.

Returns

void