From d4c20eddee1ca9e31b4e83789272b7f3956ff34d Mon Sep 17 00:00:00 2001
From: jos
end
- Date | number | string | Moment
+ Date or number or string or Moment
no
The end date of the item. The end date is optional, and can be left null
.
If end date is provided, the item is displayed as a range.
@@ -281,7 +281,7 @@ var items = [
id
- String | Number
+ String or Number
no
An id for the item. Using an id is not required but highly
recommended. An id is needed when dynamically adding, updating,
@@ -289,7 +289,7 @@ var items = [
@@ -304,7 +304,7 @@ var items = [
start
- Date | number | string | Moment
+ Date or number or string or Moment
yes
The start date of the item, for example
new Date(2010,9,23)
.
subgroup
- String | Number
+ String or Number
none
The id of a subgroup.
Groups all items within a group per subgroup, and positions them on the
@@ -391,7 +391,7 @@ var groups = [
id
- String | Number
+ String or Number
yes
An id for the group. The group will display all items having a
property group
which matches the id
@@ -408,7 +408,7 @@ var groups = [
subgroupOrder
- String | Function
+ String or Function
none
Order the subgroups by a field name or custom sort function.
By default, groups are ordered by first-come, first-show.
@@ -479,7 +479,7 @@ var options = {
dataAttributes
- string[] | 'all'
+ string[] or 'all'
false
An array of fields optionally defined on the timeline items that will be appended as
@@ -487,7 +487,7 @@ var options = {
data-
attributes to the DOM element of the items.
If value is 'all'
then each field defined on the timeline item will become a data-
attribute.
editable
- boolean | Object
+ boolean or Object
false
If true, the items in the timeline can be manipulated. Only applicable when option selectable
is
. See also the callbacks true
onAdd
, onUpdate
, onMove
, and onRemove
. When editable
is an object, one can enable or disable individual manipulation actions.
See section Editing Items for a detailed explanation.
@@ -520,7 +520,7 @@ var options = {
end
- Date | Number | String | Moment
+ Date or Number or String or Moment
none
The initial end date for the axis of the timeline.
If not provided, the latest date present in the items set is taken as
@@ -562,7 +562,7 @@ var options = {
groupOrder
- String | Function
+ String or Function
none
Order the groups by a field name or custom sort function.
By default, groups are not ordered.
@@ -571,7 +571,7 @@ var options = {
height
- number | String
+ number or String
none
The height of the timeline in pixels or as a percentage.
When height is undefined or null, the height of the timeline is automatically
@@ -608,7 +608,7 @@ var options = {
@@ -639,7 +639,7 @@ var options = {
margin
- number | Object
+ number or Object
Object
When a number, applies the margin to
margin.axis
, margin.item.horizontal
, and margin.item.vertical
.
max
- Date | Number | String | Moment
+ Date or Number or String or Moment
none
Set a maximum Date for the visible range.
It will not be possible to move beyond this maximum.
@@ -648,14 +648,14 @@ var options = {
maxHeight
- number | String
+ number or String
none
Specifies the maximum height for the Timeline. Can be a number in pixels or a string like "300px".
min
- Date | Number | String | Moment
+ Date or Number or String or Moment
none
Set a minimum Date for the visible range.
It will not be possible to move beyond this minimum.
@@ -664,7 +664,7 @@ var options = {
@@ -745,7 +745,7 @@ var options = {
minHeight
- number | String
+ number or String
none
Specifies the minimum height for the Timeline. Can be a number in pixels or a string like "300px".
@@ -811,17 +811,17 @@ var options = {
orientation
- String | Object
+ String or Object
'bottom'
Orientation of the timelines axis and items. When orientation is a string, the value is applied to both items and axis. Can be 'top', 'bottom' (default), or 'both'.
snap
- function | null
+ function or null
function
When moving items on the Timeline, they will be snapped to nice dates like full hours or days, depending on the current scale. The
snap
function can be replaced with a custom function, or can be set to null
to disable snapping. The signature of the snap function is:
- function snap(date: Date, scale: string, step: number) : Date | number
+ function snap(date: Date, scale: string, step: number) : Date or number
The parameter scale
can be can be 'millisecond', 'second', 'minute', 'hour', 'weekday, 'day, 'month, or 'year'. The parameter step
is a number like 1, 2, 4, 5.
start
- Date | Number | String | Moment
+ Date or Number or String or Moment
none
The initial start date for the axis of the timeline.
If not provided, the earliest date present in the events is taken as start date.
@@ -869,7 +869,7 @@ var options = {
@@ -920,7 +920,7 @@ var options = {
width
- String
+ String or Number
'100%'
The width of the timeline in pixels or as a percentage.
addCustomTime([time] [, id])
- number | String
+ number or String
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.
@@ -942,18 +942,18 @@ var options = {
Adjust the visible window such that it fits all items. See also function
focus(id)
.
Available options:
-
animation: boolean | {duration: number, easingFunction: string}
If true (default) or an Object, the range is animated smoothly to the new window. An object can be provided to specify duration and easing function. Default duration is 500 ms, and default easing function is 'easeInOutQuad'
. Available easing functions: "linear"
, "easeInQuad"
, "easeOutQuad"
, "easeInOutQuad"
, "easeInCubic"
, "easeOutCubic"
, "easeInOutCubic"
, "easeInQuart"
, "easeOutQuart"
, "easeInOutQuart"
, "easeInQuint"
, "easeOutQuint"
, "easeInOutQuint"
.
+ animation: boolean or {duration: number, easingFunction: string}
If true (default) or an Object, the range is animated smoothly to the new window. An object can be provided to specify duration and easing function. Default duration is 500 ms, and default easing function is 'easeInOutQuad'
. Available easing functions: "linear"
, "easeInQuad"
, "easeOutQuad"
, "easeInOutQuad"
, "easeInCubic"
, "easeOutCubic"
, "easeInOutCubic"
, "easeInQuart"
, "easeOutQuart"
, "easeInOutQuart"
, "easeInQuint"
, "easeOutQuint"
, "easeInOutQuint"
.
-
@@ -978,15 +978,15 @@ var options = {
focus(id | ids [, options])
+ focus(id or ids [, options])
none
Adjust the visible window such that the selected item (or multiple items) are centered on screen. See also function
fit()
. Available options:
-
animation: boolean | {duration: number, easingFunction: string}
If true (default) or an Object, the range is animated smoothly to the new window. An object can be provided to specify duration and easing function. Default duration is 500 ms, and default easing function is 'easeInOutQuad'
. Available easing functions: "linear"
, "easeInQuad"
, "easeOutQuad"
, "easeInOutQuad"
, "easeInCubic"
, "easeOutCubic"
, "easeInOutCubic"
, "easeInQuart"
, "easeOutQuart"
, "easeInOutQuart"
, "easeInQuint"
, "easeOutQuint"
, "easeInOutQuint"
.animation: boolean or {duration: number, easingFunction: string}
If true (default) or an Object, the range is animated smoothly to the new window. An object can be provided to specify duration and easing function. Default duration is 500 ms, and default easing function is 'easeInOutQuad'
. Available easing functions: "linear"
, "easeInQuad"
, "easeOutQuad"
, "easeInOutQuad"
, "easeInCubic"
, "easeOutCubic"
, "easeInOutCubic"
, "easeInQuart"
, "easeOutQuart"
, "easeInOutQuart"
, "easeInQuint"
, "easeOutQuint"
, "easeInOutQuint"
.
Returns an Object with relevant properties from an event:
@@ -1015,7 +1015,7 @@ var options = {
-
group
(Number | null): the id of the clicked group.item
(Number | null): the id of the clicked item.group
(Number or null): the id of the clicked group.item
(Number or null): the id of the clicked item.pageX
(Number): absolute horizontal position of the click event.pageY
(Number): absolute vertical position of the click event.x
(Number): relative horizontal position of the click event.y
(Number): relative vertical position of the click event.time
(Date): Date of the clicked event.snappedTime
(Date): Date of the clicked event, snapped to a nice value.what
(String | null): name of the clicked thing: item
, background
, axis
, group-label
, custom-time
, or current-time
.what
(String or null): name of the clicked thing: item
, background
, axis
, group-label
, custom-time
, or current-time
.event
(Object): the original click event.none
Move the window such that given time is centered on screen. Parameter
@@ -1105,12 +1105,12 @@ var options = {
time
can be a Date
, Number
, or String
. Available options:
-
animation: boolean | {duration: number, easingFunction: string}
If true (default) or an Object, the range is animated smoothly to the new window. An object can be provided to specify duration and easing function. Default duration is 500 ms, and default easing function is 'easeInOutQuad'
. Available easing functions: "linear"
, "easeInQuad"
, "easeOutQuad"
, "easeInOutQuad"
, "easeInCubic"
, "easeOutCubic"
, "easeInOutCubic"
, "easeInQuart"
, "easeOutQuart"
, "easeInOutQuart"
, "easeInQuint"
, "easeOutQuint"
, "easeInOutQuint"
.animation: boolean or {duration: number, easingFunction: string}
If true (default) or an Object, the range is animated smoothly to the new window. An object can be provided to specify duration and easing function. Default duration is 500 ms, and default easing function is 'easeInOutQuad'
. Available easing functions: "linear"
, "easeInQuad"
, "easeOutQuad"
, "easeInOutQuad"
, "easeInCubic"
, "easeOutCubic"
, "easeInOutCubic"
, "easeInQuart"
, "easeOutQuart"
, "easeInOutQuart"
, "easeInQuint"
, "easeOutQuint"
, "easeInOutQuint"
.
-
@@ -1120,7 +1120,7 @@ var options = {
setSelection(id | ids [, options])
+ setSelection(id or ids [, options])
none
Select one or multiple items by their id. The currently selected items will be unselected. To unselect all selected items, call `setSelection([])`. Available options:
focus: boolean
If true, focus will be set to the selected item(s)animation: boolean | {duration: number, easingFunction: string}
If true (default) or an Object, the range is animated smoothly to the new window. An object can be provided to specify duration and easing function. Default duration is 500 ms, and default easing function is 'easeInOutQuad'
. Only applicable when option focus is true. Available easing functions: "linear"
, "easeInQuad"
, "easeOutQuad"
, "easeInOutQuad"
, "easeInCubic"
, "easeOutCubic"
, "easeInOutCubic"
, "easeInQuart"
, "easeOutQuart"
, "easeInOutQuart"
, "easeInQuint"
, "easeOutQuint"
, "easeInOutQuint"
.animation: boolean or {duration: number, easingFunction: string}
If true (default) or an Object, the range is animated smoothly to the new window. An object can be provided to specify duration and easing function. Default duration is 500 ms, and default easing function is 'easeInOutQuad'
. Only applicable when option focus is true. Available easing functions: "linear"
, "easeInQuad"
, "easeOutQuad"
, "easeInOutQuad"
, "easeInCubic"
, "easeOutCubic"
, "easeInOutCubic"
, "easeInQuart"
, "easeOutQuart"
, "easeInOutQuart"
, "easeInQuint"
, "easeOutQuint"
, "easeInOutQuint"
.none
Set the current visible window. The parameters
@@ -1259,7 +1259,7 @@ timeline.off('select', onSelect);
start
and end
can be a Date
, Number
, or String
. If the parameter value of start
or end
is null, the parameter will be left unchanged. Available options:
-
animation: boolean | {duration: number, easingFunction: string}
If true (default) or an Object, the range is animated smoothly to the new window. An object can be provided to specify duration and easing function. Default duration is 500 ms, and default easing function is 'easeInOutQuad'
. Available easing functions: "linear"
, "easeInQuad"
, "easeOutQuad"
, "easeInOutQuad"
, "easeInCubic"
, "easeOutCubic"
, "easeInOutCubic"
, "easeInQuart"
, "easeOutQuart"
, "easeInOutQuart"
, "easeInQuint"
, "easeOutQuint"
, "easeInOutQuint"
.animation: boolean or {duration: number, easingFunction: string}
If true (default) or an Object, the range is animated smoothly to the new window. An object can be provided to specify duration and easing function. Default duration is 500 ms, and default easing function is 'easeInOutQuad'
. Available easing functions: "linear"
, "easeInQuad"
, "easeOutQuad"
, "easeInOutQuad"
, "easeInCubic"
, "easeOutCubic"
, "easeInOutCubic"
, "easeInQuart"
, "easeOutQuart"
, "easeInOutQuart"
, "easeInQuint"
, "easeOutQuint"
, "easeInOutQuint"
.
@@ -1272,7 +1272,7 @@ timeline.off('select', onSelect);
-
id
(Number | String): custom time bar id.id
(Number or String): custom time bar id.time
(Date): the custom time.
@@ -1328,7 +1328,7 @@ var options = {
-
id
(Number | String): custom time bar id.id
(Number or String): custom time bar id.time
(Date): the custom time.
item
: the item being manipulatedcallback
: a callback function which must be invoked to report back. The callback must be invoked as callback(item | null)
. Here, item
can contain changes to the passed item. Parameter `item` typically contains fields `content`, `start`, and optionally `end`. The type of `start` and `end` is determined by the DataSet type configuration and is `Date` by default. When invoked as callback(null)
, the action will be cancelled.callback
: a callback function which must be invoked to report back. The callback must be invoked as callback(item or null)
. Here, item
can contain changes to the passed item. Parameter `item` typically contains fields `content`, `start`, and optionally `end`. The type of `start` and `end` is determined by the DataSet type configuration and is `Date` by default. When invoked as callback(null)
, the action will be cancelled.