Destroy the Timeline. The timeline is removed from memory. all DOM elements and event listeners are cleaned up.
Adjust the visible window such that it fits all items. See also focus(id).
Adjust the visible window such that the selected item (or multiple items) are centered on screen. See also function fit()
Get the current time. Only applicable when option showCurrentTime is true.
Get an array with the ids of the currently selected items
Get an array with the ids of the currently visible items.
Get the current visible window.
Move the window such that given time is centered on screen.
Remove an event listener created before via function on(event[, callback]).
Create an event listener. The callback function is invoked every time the event is triggered.
Force a redraw of the Timeline. The size of all items will be recalculated. Can be useful to manually redraw when option autoResize=false and the window has been resized, or when the items CSS has been changed.
Remove vertical bars previously added to the timeline via addCustomTime method.
ID of the custom vertical bar returned by addCustomTime method.
Set a current time. This can be used for example to ensure that a client's time is synchronized with a shared server time. Only applicable when option showCurrentTime is true.
Adjust the title attribute of a custom time bar.
The title shown when hover over time bar
Id of the custom time bar, and is undefined by default.
Set both groups and items at once. Both properties are optional. This is a convenience method for individually calling both setItems(items) and setGroups(groups). Both items and groups can be an Array with Objects, a DataSet (offering 2 way data binding), or a DataView (offering 1 way data binding).
Set a data set with groups for the Timeline.
Set a data set with items for the Timeline.
Set or update options. It is possible to change any option of the timeline at any time. You can for example switch orientation on the fly.
Select one or multiple items by their id. The currently selected items will be unselected.
To unselect all selected items, call setSelection([])
.
Set the current visible window.
If the parameter value of start is null, the parameter will be left unchanged.
If the parameter value of end is null, the parameter will be left unchanged.
Timeline animation options. See TimelineAnimationOptions
The callback function
Toggle rollingMode.
Zoom in the current visible window.
A number and must be between 0 and 1. If null, the window will be left unchanged.
Timeline animation options. See TimelineAnimationOptions
The callback function
Zoom out the current visible window.
A number and must be between 0 and 1. If null, the window will be left unchanged.
Timeline animation options. See TimelineAnimationOptions
The callback function
Generated using TypeDoc
Add new vertical bar representing a custom time that can be dragged by the user. Parameter time can be a Date, Number, or String, and is new Date() by default. Parameter id can be Number or String and is undefined by default. The id is added as CSS class name of the custom time bar, allowing to style multiple time bars differently. The method returns id of the created bar.