Class: CosmographTimeline

CosmographTimeline provides a timeline visualization component for the Cosmograph application and methods for interacting with the timeline, such as handling selection updates, and controlling animation.

Extends

Constructors

Constructor

new CosmographTimeline(cosmograph, targetElement, config): CosmographTimeline

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
configCosmographTimelineConfigConfiguration for the filtering component

Returns

CosmographTimeline

Inherited from

CosmographInclusiveSelectionComponent.constructor

Accessors

defaultConfig

Get Signature

get defaultConfig(): CosmographTimelineConfig

Returns

CosmographTimelineConfig

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 | [Date, Date] | [number, number]

Returns the current selection on the timeline, which can be either a date range or a pixel range.

Returns

undefined | [Date, Date] | [number, number]

The current selection as either a [start, end] date tuple or a [start, end] pixel tuple, or undefined if no selection is set.


getCurrentSelectionInPixels()

getCurrentSelectionInPixels(): undefined | [number, number]

Returns the current selection on the timeline in pixel coordinates.

Returns

undefined | [number, number]

The current selection as a [start, end] pixel tuple, or undefined if no selection is set.


getBarWidth()

getBarWidth(): undefined | number

Returns the width of the bars in the timeline visualization.

Returns

undefined | number

The width of the bars in pixels.


setSelection()

setSelection(selection?): void

Sets the selection on the timeline visualization.

Parameters

ParameterTypeDescription
selection?[Date, Date] | [number, number]The new selection, either as a [start, end] date tuple or a [start, end] pixel tuple. If not provided, the selection will be cleared.

Returns

void


getIsAnimationRunning()

getIsAnimationRunning(): boolean

Returns whether the timeline animation is currently running.

Returns

boolean

true if the timeline animation is running, false otherwise.


playAnimation()

playAnimation(): void

Plays the timeline animation.

Returns

void


pauseAnimation()

pauseAnimation(): void

Pauses the timeline animation.

Returns

void


stopAnimation()

stopAnimation(): void

Stops the timeline animation.

Returns

void