- API
- KronoGraph
- Timeline Options
JavaScript
Timeline Options
You can set various options and defaults on the timeline by passing an object to the options() function.
The options() function accepts an object with the following properties:
object Options relating to annotations.
'auto' | 'off'
default: 'auto' Whether annotations are automatically arranged in rails to reduce overlaps.
number
default: 120 The height of the bottom annotation rail.
number
default: 160 The maximum height of the annotation body.
number
default: 280 The maximum width of the annotation body.
'always' | 'auto'
default: 'auto' Whether rails are always shown, or appear automatically when there are annotations.
number
default: 120 The height of the top annotation rail.
string
default: '#242c32' The color of the timeline background.
object Options relating to row controls.
object Options for the delete control on annotations.
string
default: '#3e414b' The background color for the annotation control.
string
default: '#afafaf' The color for the annotation control.
string
default: '#787c8e' The background color for the annotation control when hovered.
string
default: '#ffffff' The color for the annotation control when hovered.
boolean
default: true Whether to show the annotation control.
object Options for the edit control on annotations.
string
default: '#3e414b' The background color for the annotation control.
string
default: '#afafaf' The color for the annotation control.
string
default: '#787c8e' The background color for the annotation control when hovered.
string
default: '#ffffff' The color for the annotation control when hovered.
boolean
default: false Whether to show the annotation control.
object Options for the event fold controls.
object Options for the focus control on entity rows.
boolean
default: true Whether to show the control.
object Options for the pin control on entity rows.
boolean
default: true Whether to show the control.
object Options relating to entities.
'left' | 'right'
default: 'left' The position of the glyph.
string | null
default: null The color to use for the background of entity labels. If null, backgroundColor is used.
'always' | 'individualEvents' | 'never'
default: 'individualEvents' Controls when to show entity lines :
- 'always' - Always show entity lines.
- 'individualEvents' - Show entity lines with individual events only, not with the heatmap.
- 'never' - Never show entity lines.
number
default: 24 Standard height of entity rows in px, with a minimum value of 14. Font icons are only displayed on events if this height is set to 20 or more.
number
default: 40 When entity label area width mode is set to 'auto', specifies the number of characters at which the labels are truncated - using Intl.Segmenter. To disable truncation, set to 0.
'centered' | 'justified'
default: 'centered' Controls how entity rows are spaced vertically in the timeline:
- 'centered' - Vertically clustered and centered along the timeline. Space above and below once a maximum separation is reached.
- 'justified' - Spread vertically across the height of the timeline, providing more space for event labels and font icons.
See Timeline Options for more information.
object Options relating to events.
null | string | string[] | HeatmapColorStep[] | HeatmapEventTypePriority[]
default: null The color to apply to the heatmap:
- null - Cells use the average color of their underlying events, with an alpha applied based on the cell's value.
- string - All cells will use the color specified, with an alpha applied based on the cell's value.
- string[] - The array of colors specified will be used to assign colors based on each cell's value within the distribution of the cells in the visible range.
- heatmapColorStep[] - Colors are assigned to cells based on the step values provided.
- heatmapEventTypePriority[] - Colors are assigned to cells if they include an event of the specified event type. Event types are prioritised by the index values of the array; the first index is given the highest priority.
See the Heatmap Colors docs for details.
'any' | 'from' | 'to'
default: 'any' The direction of the joins at each entity row for the underlying events that the heatmap will show:
- 'any' - Shows a heatmap for all underlying event directions.
- 'from' - Only shows a heatmap for entity rows that are the source of their underlying events.
- 'to' - Only shows a heatmap for entity rows that are the target of their underlying events.
boolean
default: true Whether to apply padding to heatmap cells.
number
default: 100 The number of visible events when the heatmap starts fading in.
string | null
default: null If a string, the value of the corresponding property on the event's data object is used for the heatmap. If null, the underlying event count is used.
'auto' | 'horizontal'
default: 'auto' Controls how events are drawn:
- 'auto' - Automatically chooses the clearest way of drawing each event. Multi-directional events are drawn as a vertical line with horizontal arrowheads indicating the source/target role of each entity row, whereas uni-directional events are drawn as a single vertical arrow.
- 'horizontal' - All events are drawn as a vertical line with horizontal arrowheads indicating the source/target role of each entity row.
number
default: 1 Alpha applied to fade out rows that have no revealed events.
'all' | 'focus'
default: 'all' Controls when to show event lines :
- 'all' - Show event lines for all individual events.
- 'focus' - Only show event lines for focused entities.
object Options relating to expanding entity rows, see Expanded Rows.
boolean
default: true Only entity rows with overlapping duration events are expanded.
boolean
default: false When entities are expanded, show lines for their sub-rows.
object Options relating to focus behavior.
string
default: '#8b041b' The background color to use for focused items.
boolean
default: true Whether to reorder the entities on focus when the ordering is set to 'shorteneventlines'.
boolean
default: true Whether to rescale the events on focus when scaleMode is set to 'nonlinear'.
boolean
default: false Controls if all events on neighbors of focused entities should be shown. For example, if entity A is focused and is linked to entity B via an event, this option controls if all events involving entity B should be shown.
string
default: 'sans-serif' The name of the font family to use across the timeline.
string
default: '#515f6c' The color to use for the background of highlighted entities, highlighted scale intervals and the marquee drag area. A translucent version of this color will be applied.
number
default: 150 The number of milliseconds delay before the hover event is triggered.
number
default: 500 The time, in milliseconds, between triggering range events. Note that adjusting this delay may interact with your application's flow rate and so cause unexpected changes in behavior.
object Options relating to the scale guide.
string
default: '#e5e8eb' The color of the line.
boolean
default: false Controls if the bottom time readout and scale guide line is shown.
boolean
default: false Controls if the top time readout and scale guide line is shown.
number
default: 10 The distance in pixels to snap the line to events. Set to 0 to disable snapping.
string
default: '#e5e8eb' The color of the text.
string
default: 'auto' The date and time format. Set to auto to have the scale precision adapt to the current visible range. See Localization for more details.
number
default: 1 The width of the line in pixels.
object Options relating to the timeline scales.
string | null
default: null The color of the background of the scale. If null, backgroundColor is used.
string | null
default: '#e5e8eb' The color of the scale borders. If null, backgroundColor is used.
'dmy' | 'mdy'
default: 'mdy' The order of dates:
- 'dmy' - For day-month-year.
- 'mdy' - For month-day-year.
object Specifies the formats for displaying dates and times in the scale. See Localization for more details.
string One hundredth of a second, or 0.01 of a second.
string Year, month, and day of month.
string Month, and day of month.
string Month, day of month, hour, and minutes.
string Month, day of month, hour, minutes, and seconds.
string Year, month, day of month, hour, minutes, and seconds.
string Day of month.
string Day of month, hour, and minutes.
string Day of month, hour, minutes, and seconds.
string Full day of week.
string Full day of week, hour and minutes.
string Full day of week, hour, minutes, and seconds.
string Full month.
string Year and full month.
string One tenth of a millisecond, or 0.0001 of a second.
string One tenth of a microsecond, or 0.0000001 of a second.
string One millionth of a second, or 0.000001 of a second.
string One thousandth of a second, or 0.001 of a second.
string One billionth of a second, or 0.000000001 of a second.
string Short day of week.
string Short month.
string One hundredth of a millisecond, or 0.00001 of a second.
string One hundredth of a microsecond, or 0.00000001 of a second.
string Hours and minutes.
string Hour, minutes, and seconds.
string Hour, minutes, seconds, and tenths of a second.
string Hour, minutes, seconds, and thousandths of a second.
string Hour, minutes, seconds, and millionths of a second.
string Hour, minutes, seconds, and billionths of a second.
string Full year.
object Specifies names to use when displaying dates and times in the scale. See Localization for more details.
string[] The names of the AM and PM symbols.
string[] The full names of days of the week, starting with Sunday.
string[] The full names of months, starting with January.
string[] The full names of months as part of a date, starting with January.
string[] The short names of days of the week, starting with Sunday.
string[] The short names of months, starting with January.
boolean
default: true Controls whether the scale fades at the left.
'auto' | 'off'
default: 'auto' Controls how far the user can pan.
- 'auto' - Limits the range the user can pan so data is always in view.
- 'off' - Allows the user to pan to anywhere on the timeline. Use this option for lazy loading content.
For 'nonlinear' scaleMode, the panLimit cannot be 'off'; it will always revert to the 'auto' behavior.
'linear' | 'nonlinear'
default: 'linear' Controls the spacing between events on the timeline.
boolean
default: true Controls if the scale at the bottom of the timeline is shown.
boolean
default: true Controls if the scale at the top of the timeline is shown.
string
default: '#e5e8eb' The color of the scale's text. Also changes the color of the markers and their labels.
number
default: 14 The text size of the scale.
boolean
default: true Whether a 12-hour clock should be used. False specifies a 24-hour clock.
'off' | 'day' | 'week' | 'month' | 'year'
default: 'off' Controls Scale Wrapping, i.e. the way time is wrapped in the scale:
- 'off' - No wrapping, the scale shows time in a linear way.
- 'day' - The scale shows the time since the start of the day.
- 'week' - The scale shows the time since the start of the week.
- 'month' - The scale shows the time since the start of the month.
- 'year' - The scale shows the time since the start of the year.
'auto' | object
default: 'auto' Sets a limit for how far a user can zoom out.
- 'auto' - The limit is set by KronoGraph
Use the parameters to specify the limit. Can be used for lazy loading content to improve performance and loading times for large datasets. For 'nonlinear' scaleMode, the zoomOutLimit is always the 'auto' behavior; any specified limits will be ignored.
string
default: '#f5f7fa' The color to use to highlight selected events and entities. A translucent version of this color is applied.
boolean
default: true Controls whether the lens highlight is shown, see Show Lens Highlight.
boolean
default: true Controls if timeline warning messages are displayed in the console.
object Options relating to time series charts.
'top' | 'bottom'
default: 'top' Position of time series charts in relation to the timeline.
number
default: 25 Percentage of the view height allocated to time series charts.