TimelineView

Labels: :IA_Function:IA_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 at visjs.org
groups.{group_id}.content Group label String
groups.{group_id}.{...} Other (optional) group properties Group properties as documented at visjs.org

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.

More info on context menus.