Skip to main content
Version: 3.x

Class: TimelineTool

@cognite/reveal/tools.TimelineTool

Tool to applying styles to nodes based on date to play them over in Timeline

Hierarchy

Constructors

constructor

new TimelineTool(cadModel)

Parameters

NameType
cadModelCognite3DModel

Overrides

Cognite3DViewerToolBase.constructor

Defined in

packages/tools/src/Timeline/TimelineTool.ts:22

Methods

createKeyframe

createKeyframe(date): Keyframe

Create Key frame for the Timeline

Parameters

NameTypeDescription
dateDatedate value by Date.now() since January 1, 1970

Returns

Keyframe

Defined in

packages/tools/src/Timeline/TimelineTool.ts:63


dispose

dispose(): void

Disposes the element and triggeres the 'disposed' event before clearing the list of dipose-listeners.

Returns

void

Overrides

Cognite3DViewerToolBase.dispose

Defined in

packages/tools/src/Timeline/TimelineTool.ts:184


getAllKeyframes

getAllKeyframes(): Keyframe[]

Provides all Keyframes in the Timeline

Returns

Keyframe[]

All Keyframes in Timeline

Defined in

packages/tools/src/Timeline/TimelineTool.ts:180


getKeyframeByDate

getKeyframeByDate(date): Keyframe

Returns the keyframe at the date given, or undefined if not found.

Parameters

NameType
dateDate

Returns

Keyframe

Defined in

packages/tools/src/Timeline/TimelineTool.ts:76


off

off(event, handler): void

Unregisters an event handler for the 'disposed'-event.

Parameters

NameType
event"disposed"
handler() => void

Returns

void

Inherited from

Cognite3DViewerToolBase.off

Defined in

packages/tools/src/Cognite3DViewerToolBase.ts:37


pause

pause(): void

Pause any ongoing playback

Returns

void

Defined in

packages/tools/src/Timeline/TimelineTool.ts:161


play

play(startDate, endDate, totalDurationInMilliSeconds): void

Starts playback of Timeline

Parameters

NameTypeDescription
startDateDateKeyframe date to start the Playback of Keyframes
endDateDateKeyframe date to stop the Playback of Keyframes
totalDurationInMilliSecondsnumberNumber of milliseconds for all Keyframe within startDate & endDate to be rendered

Returns

void

Defined in

packages/tools/src/Timeline/TimelineTool.ts:110


removeKeyframe

removeKeyframe(keyframe): void

Removes the Keyframe from the timeline. Does nothing if the keyframe isn't part of the timeline.

Parameters

NameTypeDescription
keyframeKeyframeKeyframe to be removed from the timeline

Returns

void

Defined in

packages/tools/src/Timeline/TimelineTool.ts:84


removeKeyframeByDate

removeKeyframeByDate(date): void

Removes the Keyframe from the Timeline

Parameters

NameTypeDescription
dateDateDate of the Keyframe to be removed from the Timeline

Returns

void

Defined in

packages/tools/src/Timeline/TimelineTool.ts:96


resume

resume(): void

Resume any paused playback

Returns

void

Defined in

packages/tools/src/Timeline/TimelineTool.ts:170


stop

stop(): void

Stops any ongoing playback

Returns

void

Defined in

packages/tools/src/Timeline/TimelineTool.ts:151


subscribe

subscribe(event, listener): void

Subscribe to the Date changed event

Parameters

NameTypeDescription
event"dateChanged"dateChanged event
listenerTimelineDateUpdateDelegateListen to Timeline date Update during Playback

Returns

void

Defined in

packages/tools/src/Timeline/TimelineTool.ts:34


unsubscribe

unsubscribe(event, listener): void

Unsubscribe to the Date changed event

Parameters

NameTypeDescription
event"dateChanged"dateChanged event
listenerTimelineDateUpdateDelegateRemove Listen to Timeline date Update

Returns

void

Defined in

packages/tools/src/Timeline/TimelineTool.ts:49