TimelineView

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

The TimelineView Function renders a Timeline with events.

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
options Settings for the timeline (see official documentation)
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: 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: 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: 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: 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.

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

More info on context menus.