Search

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

entityIds
required
string | string[]

The id or ids of the selected entities.

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

mode
required
boolean

True to allow entities to be selected, otherwise false.

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

eventIds
required
string | string[]

The id or ids of the events to be selected.

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

mode
required
boolean

True to put the timeline in event selection mode, otherwise false.

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.
string | string[]

If mode is 'manual', the ids of the entities whose rows are to be expanded.

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

options
required

Options related to producing an export of the current view.

boolean default: true

Whether to include annotations in the output.

type

required
'png'

The file type of the output.

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

focusIds
required
string | string[]

The id or ids of the entities or events to focus on.

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

string

The id of the annotation.

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

entityId
required
string

The id of the entity to be retrieved.

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

entityId
required
string

The id of the entity.

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

eventId
required
string

The id of the event to be retrieved.

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

eventId
required
string

The id of the event.

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

object

Specifies which items are included.

boolean default: true

If there is an entity that is focused, then this option defines whether to include just the focused entity and its neighbors. Otherwise all events and entities in the current range are included.

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

rowId
required
string

The id of the row.

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

string | string[]

The ids of the highlighted rows and entities.

Returns string[]

The ids of highlighted rows and entities.

Determines whether a time or event is within the timeline's visible range.

Parameters

item
required
Date | number | TimeRange | string

A Date in local time, a millisecond number in UTC, a TimeRange object, or the id of an event.

number

The number of nanoseconds to add to the Date or number.

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.
number

The width of the entity label area.

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

entityId
required
string | null

The id of the entity.

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

Returns void

Gets a copy of the timeline markers.

Returns Marker[]

A copy of the current markers.

Sets the timeline markers.

Parameters

markers
required
Marker[]

An array of markers to add.

Returns Marker[]

A copy of the current markers.

Detaches an event handler from an event fired by the timeline. See Handled Events.

Parameters

name
required
string

The name of the event.

handler
required
Function

The handler for the event.

Returns void

Attaches an event handler to an event fired by the timeline. See Handled Events.

Parameters

name
required
string

The name of the event.

handler
required
Function

The handler for the event.

Returns void

Gets the current timeline options.

Returns TimelineOptions

The currently specified options.

Sets the timeline options.

Parameters

options
required

Specifies the options to set.

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

direction
required
'left' | 'right'

Specifies the direction to pan the timeline in.

number
default: 0.3

How far to pan the timeline. The distance is measured as a proportion of space across the visible timeline range.

Returns void

Pins or unpins the specified entities. Pinned entities are always shown separately from entity groups.

Parameters

entityId
required
string | string[]

The id or ids of the entities to set the pin state for.

boolean
default: true

Controls if the entities should be pinned or unpinned.

Returns void

Adds an animated effect to a specified event or events, and then removes it again.

Parameters

id
required
string | string[]

The id or ids of the events to ping.

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:

  • start the start of the visible time range, as a Date object.
  • end the end of the visible time range, as a Date object.
  • startNanoseconds the number of nanoseconds to add to start.
  • endNanoseconds the number of nanoseconds to add to end.

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

start
required
Date | number

The start of the range as a Date in local time, or a millisecond number in UTC.

end
required
Date | number

The end of the range as a Date in local time, or a millisecond number in UTC.

number

The number of nanoseconds to add to start.

number

The number of nanoseconds to add to end.

Returns object

An object containing the range of visible times:

  • start the start of the visible time range, as a Date object.
  • end the end of the visible time range, as a Date object.
  • startNanoseconds the number of nanoseconds to add to start.
  • endNanoseconds the number of nanoseconds to add to end.

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

revealIds
required
string | string[]

The id or ids of the events to reveal.

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.

Replaces the timeline data with the new data specified. Any existing items in the timeline will be removed. See Data Formats.

Parameters

data
required

The data to load into the timeline.

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

'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

direction
required
'in' | 'out'

Specifies how to zoom the timeline.

Returns void

Terms of use

These terms do not alter or supersede any existing agreements between you (or your employer) and us.

By accessing or using any Content you agree to be bound by these Terms of Use. Please review these terms carefully before using the website.

The contents of this website, including but not limited to any text, code samples, API references, schemas, interactive tools, and other materials (collectively, the 'Content'), are made available for informational and internal evaluation purposes only. All intellectual property rights in the Content are reserved. No licence is granted to use the Content for any commercial purpose, or to copy, distribute, modify, reverse-engineer, or incorporate any part of the Content into any product or service, without our prior written consent.

This Content is provided “as is” and “as available,” without any representations, warranties, or guarantees of any kind, whether express or implied, including but not limited to implied warranties of merchantability, fitness for a particular purpose, non-infringement, or accuracy. To the fullest extent permitted by applicable law, we expressly exclude and disclaim all implied warranties, conditions, and other terms that might otherwise be implied.

We disclaim all liability for any loss or damage, whether direct, indirect, incidental, consequential, or otherwise, arising from any reliance placed on the Content or from your use of it, to the fullest extent permitted by applicable law. By continuing to access or use the Content, you acknowledge and agree to these terms.