Methods
(protected) checkAndNormalizeConf(conf) → {object}
Check if the configuration is valid, reorder or remove empty elements if needed
Parameters:
Name | Type | Description |
---|---|---|
conf |
object | Configuration to check and normalize |
- Source:
Throws:
-
-
If dateRange, data or intervals are not arrays
- Type
- TypeError
-
-
-
If intervals overlaps
- Type
- Error
-
-
-
If dateRange does not have 2 dates
- Type
- Error
-
Returns:
Normalized conf
- Type
- object
destroy()
Destroy the timeline, remove the svg node
- Source:
(protected) getPivots(dateRange, intervals) → {array}
Compute pivots for intervals from date A to B based on `dateRange`
Parameters:
Name | Type | Description |
---|---|---|
dateRange |
array | List of date A and date B |
intervals |
array | List of [date A, date B, width (in pixel)] |
- Source:
Returns:
List of pivots on the x axis (in pixel)
- Type
- array
(protected) init()
Initialize timeline
Create the svg node, the axis and calculate the margins & positions
- Source:
render()
Render the entire timeline
- Source:
(protected) renderAxis(pivots)
Render x axis
Render the polylinear x axis with ticks and pivots and registered events callbacks
Parameters:
Name | Type | Default | Description |
---|---|---|---|
pivots |
array | null | (optional) List of pivots, if empty, pivots will be calculated from the `intervals` option |
- Source:
renderData(data)
Render data events as circles or clusters on the timeline and register events callbacks
Parameters:
Name | Type | Description |
---|---|---|
data |
array | Array of data events objects (`{date: ..., label: ...}`) |
- Source:
(protected) setConf(conf)
Set timeline configuration
Parameters:
Name | Type | Description |
---|---|---|
conf |
object | Configuration |
- Source:
update(newConf)
Update the timeline with the new configuration
Parameters:
Name | Type | Description |
---|---|---|
newConf |
object | New configuration with new data or options |
- Source: