Timeline API Overview
Timeline is the runtime core of Timeline Canvas. It ties together data, interaction handling, rendering, and plugins.
Constructor
Parameters
canvasId: theidof the target<canvas>options: constructor options, typed asTimelineOptions
Public properties
config: normalized runtime configcallbacks: the current callback setstate: the current runtime state
If you mutate
timeline.configortimeline.statedirectly, callnotifyChange()afterward. When a public method exists, prefer the method over mutating internals.
API map
Data Management
loadDataaddEventupdateEventupdateEventDatadeleteEventaddTrack/removeTrackautoRemoveEmptyLastTracksetEndTime/getEndTimebeginIndexBatch/endIndexBatchinvalidateIndexTrack/invalidateIndexAll
View, Interaction, and State
setZoomLevel/zoom/getZoomLevelsetTimeIndicator/setTimeIndicatorDuringDragsetCanvasSize/adjustCanvasSize/drawmarkDirty/notifyChangebeginChangeBatch/endChangeBatchgetInteractionTarget/getEventAtPosition/getResizeHandlecalculateGuideLines/snapToGuideLines/snapEdgeToGuideLinescanMoveEventshowSplitLine/hideSplitLine/splitEventsetReadOnly/isReadOnlyhighlightEvent/clearHighlight/getHighlightedEventsetDebug/setEnableTimeIndicatorsetStatus/getStatus
Plugin Management
usePluginremovePluginsetThemegetLoadedPluginsisPluginLoaded
Event Callbacks
onEventAddonEventUpdateonEventDeleteonEventMoveonEventClickonEventHighlightonTimeIndicatorHighlightonStatusChange
Type Definitions
TimelineOptionsTimelineConfigTimelineEventInteractionTargetLoadDataFormat
Destroying an instance
Call destroy() when the canvas is going away, such as during component unmount or page teardown.