Skip to main content
Version: 4.x

Class: TimelineTool

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

Extends

Constructors

new TimelineTool()

new TimelineTool(cadModel): TimelineTool

Parameters

cadModel: CogniteCadModel

Returns

TimelineTool

Overrides

Cognite3DViewerToolBase . constructor

Defined in

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

Methods

createKeyframe()

createKeyframe(date): Keyframe

Create Key frame for the Timeline

Parameters

date: Date

date 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): undefined | Keyframe

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

Parameters

date: Date

Returns

undefined | Keyframe

Defined in

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


off()

off(event, handler): void

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

Parameters

event: "disposed"

handler

Returns

void

Inherited from

Cognite3DViewerToolBase . off

Defined in

packages/tools/src/Cognite3DViewerToolBase.ts:38


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

startDate: Date

Keyframe date to start the Playback of Keyframes

endDate: Date

Keyframe date to stop the Playback of Keyframes

totalDurationInMilliSeconds: number

Number 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

keyframe: Keyframe

Keyframe 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

date: Date

Date 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

event: "dateChanged"

dateChanged event

listener: TimelineDateUpdateDelegate

Listen 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

event: "dateChanged"

dateChanged event

listener: TimelineDateUpdateDelegate

Remove Listen to Timeline date Update

Returns

void

Defined in

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