- API
- KronoGraph
- Timeline
JavaScript
Timeline
The Timeline component draws items passed to the set() function.
When new or updated data is passed in, it will redraw with the new items.
Gets a copy of an object describing the timeline annotations.
Returns
{ [id: string]: Annotation }
A copy of the current annotations, in a dictionary object indexed by id.
Sets the timeline annotations, replacing any existing annotations.
Parameters
- annotations required
-
{ [id: string]: Annotation } A dictionary object of the annotations, indexed by annotation id.
Returns
{ [id: string]: Annotation }
A copy of the current annotations, in a dictionary object indexed by id.
Destroys the current instance of the timeline, freeing any allocated resources.
Returns
void
Gets the ids of all the selected entities.
Returns
string[]
The ids of all the selected entities.
Sets the ids of the entities to be displayed as being selected.
Parameters
Returns
string[]
The ids of the selected entities.
Gets the flag indicating whether users are able to select entities by interacting with the timeline.
Returns
boolean
True indicates users can select entities by interacting with the timeline, otherwise false.
Sets the flag determining whether users are able to select entities by interacting with the timeline. See Select entities in the Interactions section.
Parameters
Returns
boolean
True to enable entity selection, otherwise false.
Gets the ids of the selected events.
Returns
string[]
The ids of the selected events.
Sets the ids of the selected events, which are drawn with a highlight.
Parameters
Returns
string[]
The ids of the selected events.
Gets the flag indicating whether the timeline is in event selection mode, which allows users to select events.
Returns
boolean
True if the timeline is in event selection mode, otherwise false.
Sets the flag determining whether users are able to select events by interacting with the timeline.
Parameters
Returns
boolean
True if the timeline is in event selection mode, otherwise false.
Expands entities by adding sub-rows to vertically space out events as specified by the expandedRows options. See also Expanded Rows.
Parameters
- mode required
-
'auto' | 'manual' How KronoGraph determines which entity rows to expand, if space allows:
- 'auto' - Expand all entity rows, as needed.
- 'manual' - Expand just the rows of entities specified in the list of ids.
Returns
ExpandedRows
An object containing the ids of the entities whose rows are to be expanded, and the expansion mode being used.
Expands entities by adding sub-rows to vertically space out events as specified by the expandedRows options. See also Expanded Rows.
Returns
ExpandedRows
An object containing the ids of the entities whose rows are to be expanded, and the expansion mode being used.
Exports a static image of the timeline. The exported image is encoded in a blob URL.
Parameters
Returns
Promise
A promise that will resolve with an object containing the blob URL of the exported image or reject with an error.
Fits all the events and time series chart data points into the viewport. If Scale Wrapping is used, fits the wrapped time range into the viewport.
Returns
void
Sets the timeline focus to the specified entities or events. When the timeline is focused , only focused items and their connections are shown. Focused events will keep the entities they are linked to in focus. Focusing does not affect time series charts.
Parameters
Returns
string[]
The ids of the focused items.
Gets the ids of the focused entities or events. When focus items are set, only those items and their connections are shown.
Returns
string[]
The ids of the focused items.
Gets an object describing the position of an annotation's body.
Parameters
Returns
AnnotationBodyPosition | null
An AnnotationBodyPosition object, or null if the annotation is not shown in the timeline.
Returns a copy of the entity with the specified id.
Parameters
Returns
object | null
A copy of the Entity object, or null if there is no entity with the specified id.
Gets an object describing the position of an entity.
Parameters
Returns
EntityPosition | null
An EntityPosition object, or null if the entity is not shown in the timeline.
Returns a copy of the event with the specified id.
Parameters
Returns
object | null
A copy of the Event object, or null if there is no event with the specified id.
Gets an object describing the position of an event.
Parameters
Returns
EventPosition | null
An EventPosition object, or null if the event is not in the current timeline range.
Returns an object detailing the ids of events and entities that are in the current range.
Parameters
Returns
{ entities: Object, events: Object }
Objects whose keys are the ids of entities and events in the current range.
Returns the ids of entities that are pinned.
Returns
string[]
The ids of the pinned items.
Returns the ids of the entities in the specified row.
Parameters
Returns
string[] | null
An array of the entity ids, or null if there is no entity row with the specified id.
Gets the ids of highlighted rows and entities.
Returns
string[]
The ids of highlighted rows and entities.
Sets the highlighted rows and entities. Highlighted rows and entities are drawn using highlightColor.
Parameters
Returns
string[]
The ids of highlighted rows and entities.
Determines whether a time or event is within the timeline's visible range.
Parameters
Returns
boolean
Whether the specified item is within the timeline's visible range.
Determines whether the heatmap is currently shown.
Returns
boolean
True if the heatmap is currently shown, otherwise false.
Gets the mode of calculation for the width of the entity label area and its width. Before the first render, the returned width will be 0.
Returns
LabelAreaWidth
An object containing the mode of calculation for the width of the entity label area and its width.
Sets the mode of calculation for the width of the entity label area and, if 'fixed', its width.
Parameters
- mode required
-
'auto' | 'fixed' The mode of calculation for the width of the entity label area:
- 'auto' - The width is calculated automatically based on the visible entities.
- 'fixed' - The width is fixed, but draggable.
Returns
LabelAreaWidth
An object containing the mode of calculation for the width of the entity label area and its width.
Gets the id of the entity at the center of the lens view.
Returns
string | null
The id of the entity at the center of the lens view, or null if lens view isn't open.
Sets the entity at the center of the lens view. Set it to null to close lens view.
Parameters
Returns
string | null
The id of the entity at the center of the lens, or null if lens view isn't open.
Loads a snapshot previously created using serialize().
Parameters
- snapshot required
Returns
void
Gets a copy of the timeline markers.
Returns
Marker[]
A copy of the current markers.
Sets the timeline markers.
Returns
Marker[]
A copy of the current markers.
Detaches an event handler from an event fired by the timeline. See Handled Events.
Parameters
Returns
void
Attaches an event handler to an event fired by the timeline. See Handled Events.
Parameters
Returns
void
Gets the current timeline options.
Returns
TimelineOptions
The currently specified options.
Sets the timeline options.
Parameters
Returns
TimelineOptions
The currently specified options.
Gets a copy of an array of objects describing the current overrideStyles.
Returns
{ids: string | string[], style: EntityStyle | EventStyle}[]
Returns a copy of an array of objects describing any applied overrideStyles.
Overrides the style properties set for an Entity or Event with EntityStyle or EventStyle , see Override Styles.
Parameters
- styles required
-
{ ids: string | string[], style: EventStyle | EntityStyle }[] The ids of the entities or events whose style properties will be overridden and the style properties to apply.
Returns
{ids: string | string[], style: EventStyle | EntityStyle}[]
Returns a copy of an array of objects describing any applied overrideStyles.
Pans the timeline in the specified direction. The panning range is limited and depends on the timeline data.
Parameters
-
number
default: How far to pan the timeline. The distance is measured as a proportion of space across the visible timeline range.
0.3
Returns
void
Pins or unpins the specified entities. Pinned entities are always shown separately from entity groups.
Parameters
Returns
void
Adds an animated effect to a specified event or events, and then removes it again.
Parameters
-
object Options to control the animation.
string
default: '#909090' The color to use for the animated effect.
'individual' | 'grouped'
default: 'individual' Whether the specified events should each have their own ping animation, or all events have a single outer ping animation.
number
default: 1 The number of times the animation should be repeated.
number
default: 42 The distance between the start and the end of the ping stroke, in pixels.
number
default: 12 The width of the ping stroke at the end of the animation, in pixels.
number
default: 800 The time the animation should take, in milliseconds.
Returns
void
Gets the range of time currently shown in the timeline. When the scale is wrapped, this is relative to the base range - see Scale Wrapping.
Returns
object
An object containing the range of visible times:
startthe start of the visible time range, as a Date object.endthe end of the visible time range, as a Date object.startNanosecondsthe number of nanoseconds to add tostart.endNanosecondsthe number of nanoseconds to add toend.
Sets the range of times currently shown by the timeline. When the scale is wrapped, this is relative to the base range - see Scale Wrapping. There are limits to the range that can be set, which depend on the timeline data.
Parameters
Returns
object
An object containing the range of visible times:
startthe start of the visible time range, as a Date object.endthe end of the visible time range, as a Date object.startNanosecondsthe number of nanoseconds to add tostart.endNanosecondsthe number of nanoseconds to add toend.
Gets the event ids of all revealed events.
Returns
string[]
The ids of the revealed events.
Sets the underlying events to be revealed when the heatmap view is shown.
Parameters
Returns
string[]
The ids of the revealed events.
Returns a snapshot of the current timeline component. You can then use this to restore the timeline to this state using load(). See also Using Snapshots.
Returns
TimelineSnapshot
Replaces the timeline data with the new data specified. Any existing items in the timeline will be removed. See Data Formats.
Parameters
Returns
void
Sets the location of the timeline in the DOM. Set to null to temporarily remove the timeline.
Parameters
-
string | HTMLElement | null The DOM element that the chart should be appended to, or null to detach it.
Returns
void
Sets the type of entity ordering to use in the timeline.
Parameters
- orderingName required
-
'firstevent' | 'lastevent' | 'keyorder' | 'alphabetical' | 'shorteneventlines' The name of the ordering to use.
Returns
void
Zoom the timeline in the manner specified. The zooming range is limited and depends on the timeline data.
Parameters
Returns
void