TimelineView

Label: :IA_Function
Property: type: TimelineView
Inherits from: Function and View

The TimelineView Function renders a Timeline with events. It is based on vis-timeline.

Function parameters

Key Description Default value Possible values
events.id IDs of all events Array of strings/numbers
events.type Types of all events Array of strings: box(default) /point/range/background
events.title Titles of all events Array of strings
events.content Contents of all events Array of strings
events.start [Required] Start date/times of all events Array of strings
events.end [Required for type range/background] End date/times of all events Array of strings
events.group ID of the group this event belongs to undefined string
events.{...} Other (optional) event properties Event properties as documented here
groups.{group_id}.content Group label String
groups.{group_id}.{...} Other (optional) group properties Group properties as documented here
timeMarkers Collection of time markers shown on the timeline Collection (object) of time markers
timeMarkers.{marker_id}.datetime Position of time marker as date/time string string
timeMarkers.{marker_id}.title Label that appear on the top-right of the marker string
timeMarkers.{marker_id}.editable Allow the user to edit the title of the marker false true / false
options Settings for the timeline (see official documentation)
state.selected.events List with events that are selected [] Array of events
visibleRange Time interval that is currently visible (displayed) on the screen (not the total range that is visible by scrolling) Object
visibleRange.start Timestamp (Date instance) of the left-most (currently) visible point in the view Date instance / Epoch time as Number / date as String
visibleRange.end Timestamp (Date instance) of the right-most (currently) visible point in the view Date instance / Epoch time as Number / date as String

Note: Both events and groups can be passed either as:

An array of property objects, e.g.:

events: [
	{id:'event1', title:'My Event'}, 
	{id:'event2', title: 'Other Event'}
]

An object of id-object pairs, e.g.:

events: { 
	event1: {title: 'My Event'}, 
	event2: {title: 'Other Event'}
}

A transposed object of property arrays, e.g.:

events: {
	id: ['event1','event2'], 
	title: ['My Event', 'Other Event']
}

Outgoing triggers

Type: context

The following context menus are available from the NetworkView:

Menu Occurs when Target value
event User right-clicks an event Right-clicked event data.
timeline User right-clicks the timeline Right-clicked moment as object with date and time properties.

More info on context menus.


Type: eventClick

Occurrence: When the user clicks an event.

Additional event properties (besides the inherited properties):

Key Description Possible values
data The clicked event Any

Type: eventDoubleClick

Occurrence: When the user double-clicks an event.

Additional event properties (besides the inherited properties):

Key Description Possible values
data The double-clicked event Any

Type: selectionChanged

Occurrence: When the user selects/unselects one (or multiple) events.

Additional event properties (besides the inherited properties):

Key Description Possible values
events Array with selected events Array of events

Note: by default vis-timeline allows only one selected event at a time. To allow multiple events to be selected set $options.multiselect to true


Type: timelineClick

Occurrence: When the user clicks anywhere on the timeline.

Additional event properties (besides the inherited properties):

Key Description Possible values
time The clicked time Time string
date The clicked date Date string

Type: timelineDoubleClick

Occurrence: When the user double-clicks anywhere on the timeline.

Additional event properties (besides the inherited properties):

Key Description Possible values
time The double-clicked Time string
date The double-clicked date Date string

Type: timeMarkerChange

Occurrence: When the user drags a time marker to a new date/time.

Additional event properties (besides the inherited properties):

Key Description Possible values
data New state of the time marker timeMarker object
key key of the dragged time marker string
old Initial (old) state of the changed time marker timeMarker object

Type: timeMarkerTitleChange

Occurrence: When the user edits a time marker's title

Additional event properties (besides the inherited properties):

Key Description Possible values
data New state of the edited time marker timeMarker object
key key of the edited time marker string
old Initial (old) state of the edited time marker timeMarker object

Type: visibleRangeChange

Occurrence: When the user drags the timeline horizontally.

Additional event properties (besides the inherited properties):

Key Description Possible values
start The start date/time of the visible interval Date instance
end The end date/time of the visible interval Date instance