TimelineZoomable

Configs

6

The maximum zoom level to which zoomIn will work. Defaults to the number of ViewPresets available, see presets for information. Unless you have modified the collection of available presets, the max zoom level is milliseconds.

The minimum zoom level to which zoomOut will work. Defaults to 0 (year ticks)

Integer number indicating the size of timespan during zooming. When zooming, the timespan is adjusted to make the scrolling area visibleZoomFactor times wider than the timeline area itself. Used in zoomToSpan and zoomToLevel functions.

Whether the originally rendered timespan should be preserved while zooming. By default, it is set to false, meaning the timeline panel will adjust the currently rendered timespan to limit the amount of HTML content to render. When setting this option to true, be careful not to allow to zoom a big timespan in seconds resolution for example. That will cause a lot of HTML content to be rendered and affect performance. You can use minZoomLevel and maxZoomLevel config options for that.

zoomOnMouseWheel: Boolean= true

If true, you can zoom in and out on the time axis using CTRL-key + mouse wheel.

True to zoom to time span when double-clicking a time axis cell.

Properties

5

Class hierarchy

isTimelineZoomable: Boolean= truereadonly
Identifies an object as an instance of TimelineZoomable class, or subclass thereof.
isTimelineZoomable: Boolean= truereadonlystatic
Identifies an object as an instance of TimelineZoomable class, or subclass thereof.

Zoom

Get/set the maxZoomLevel value

zoomLevel: Number

Current zoom level, which is equal to the ViewPreset index in the provided array of zoom levels.

Functions

11

Other

Moves the time axis by the passed amount and unit.

NOTE: If using a filtered time axis, see shift for more information.

ParameterTypeDescription
amountNumber

The number of units to jump

unitDurationUnitShort

The unit (Day, Week etc.)

Moves the time axis forward in time in units specified by the view preset shiftUnit, and by the amount specified by the shiftIncrement config of the current view preset.

NOTE: If using a filtered time axis, see shiftNext for more information.

ParameterTypeDescription
amountNumber

The number of units to jump forward

Moves the time axis backward in time in units specified by the view preset shiftUnit, and by the amount specified by the shiftIncrement config of the current view preset.

NOTE: If using a filtered time axis, see shiftPrevious for more information.

ParameterTypeDescription
amountNumber

The number of units to jump backward

Changes the range of the scheduling chart to fit all the events in its event store.

ParameterTypeDescription
optionsObject

Options object for the zooming operation.

options.leftMarginNumber

Defines margin in pixel between the first event start date and first visible date

options.rightMarginNumber

Defines margin in pixel between the last event end date and last visible date

Zoom

Zooms in the timeline according to the array of zoom levels. If the amount of levels to zoom is given, the view will zoom in by this value. Otherwise, a value of 1 will be used.

ParameterTypeDescription
levelsNumber

(optional) amount of levels to zoom in

optionsChangePresetOptions

Object containing options which affect how the new preset is applied.

Returns: Number | null -

currentLevel New zoom level of the panel or null if level hasn't changed.

Zooms in the timeline to the maxZoomLevel according to the array of zoom levels.

ParameterTypeDescription
optionsChangePresetOptions

Object containing options which affect how the new preset is applied.

Returns: Number | null -

currentLevel New zoom level of the panel or null if level hasn't changed.

Zooms out the timeline according to the array of zoom levels. If the amount of levels to zoom is given, the view will zoom out by this value. Otherwise, a value of 1 will be used.

ParameterTypeDescription
levelsNumber

(optional) amount of levels to zoom out

optionsChangePresetOptions

Object containing options which affect how the new preset is applied.

Returns: Number | null -

currentLevel New zoom level of the panel or null if level hasn't changed.

Zooms out the timeline to the minZoomLevel according to the array of zoom levels.

ParameterTypeDescription
optionsChangePresetOptions

Object containing options which affect how the new preset is applied.

Returns: Number | null -

currentLevel New zoom level of the panel or null if level hasn't changed.

Zooms to passed view preset, saving center date. Method accepts config object as a first argument, which can be reduced to primitive type (string,number) when no additional options required. e.g.:

// zooming to preset
scheduler.zoomTo({ preset : 'hourAndDay' })
// shorthand
scheduler.zoomTo('hourAndDay')

// zooming to level
scheduler.zoomTo({ level : 0 })
// shorthand
scheduler.zoomTo(0)

It is also possible to zoom to a time span by omitting preset and level configs, in which case scheduler sets the time frame to a specified range and applies zoom level which allows to fit all columns to this range. The given time span will be centered in the scheduling view (unless centerDate config provided). In the same time, the start/end date of the whole time axis will be extended to allow scrolling for user.

// zooming to time span
scheduler.zoomTo({
    startDate : new Date(..),
    endDate : new Date(...)
});
ParameterTypeDescription
configViewPresetConfig | Object | String | Number

Config object, preset name or zoom level index.

config.presetString

Preset name to zoom to. Ignores level config in this case

config.levelNumber

Zoom level to zoom to. Is ignored, if preset config is provided

config.visibleDateVisibleDate

A visibleDate specification to bring into view after the zoom.

config.startDateDate

New time frame start. If provided along with end, view will be centered in this time interval (unless centerDate is present)

config.endDateDate

New time frame end

config.centerDateDate

Date that should be kept in the center. Has priority over start and end params

config.zoomDateDate

The date that should be positioned at the passed datePosition client offset.

config.zoomPositionNumber

The client offset at which the passed date should be positioned.

config.widthNumber

Lowest tick width. Might be increased automatically

config.leftMarginNumber

Amount of pixels to extend span start on (used, when zooming to span)

config.rightMarginNumber

Amount of pixels to extend span end on (used, when zooming to span)

config.adjustStartNumber

Amount of units to extend span start on (used, when zooming to span)

config.adjustEndNumber

Amount of units to extend span end on (used, when zooming to span)

Allows zooming to certain level of presets array. Automatically limits zooming between maxZoomLevel and minZoomLevel. Can also set time axis timespan to the supplied start and end dates.

ParameterTypeDescription
presetNumber

Level to zoom to.

optionsChangePresetOptions

Object containing options which affect how the new preset is applied.

Returns: Number | null -

level Current zoom level or null if it hasn't changed.

Sets time frame to specified range and applies zoom level which allows to fit all columns to this range.

The given time span will be centered in the scheduling view, in the same time, the start/end date of the whole time axis will be extended in the same way as zoomToLevel method does, to allow scrolling for user.

ParameterTypeDescription
configObject

The time frame.

config.startDateDate

The time frame start.

config.endDateDate

The time frame end.

config.centerDateDate

Date that should be kept in the center. Has priority over start and end params

config.leftMarginNumber

Amount of pixels to extend span start on

config.rightMarginNumber

Amount of pixels to extend span end on

config.adjustStartNumber

Amount of units to extend span start on

config.adjustEndNumber

Amount of units to extend span end on

Returns: Number | null -

level Current zoom level or null if it hasn't changed.

Events

1

Fires when the requested date range cannot fit into any zoom level higher than the current level.

// Adding a listener using the "on" method
timelineZoomable.on('noZoomChange', ({ currentZoomLevel, startDate, endDate }) => {

});
ParameterTypeDescription
currentZoomLevelNumber

The current zoom level

startDateDate

The requested start date

endDateDate

The requested end date

Event handlers

1

Called when the requested date range cannot fit into any zoom level higher than the current level.

new TimelineZoomable({
    onNoZoomChange({ currentZoomLevel, startDate, endDate }) {

    }
});
ParameterTypeDescription
currentZoomLevelNumber

The current zoom level

startDateDate

The requested start date

endDateDate

The requested end date

Typedefs

1

Options which may be used when changing the viewPreset property.

ParameterTypeDescription
visibleDateVisibleDate

A visibleDate specification to bring into view after the new ViewPreset is applied.

startDateDate

New time frame start. If provided along with end, view will be centered in this time interval, ignoring centerDate config. Ignored if infiniteScroll is used.

endDateDate

New time frame end. Ignored if infiniteScroll is used.

centerDateDate

Date to keep in center. Is ignored when start and end are provided.

zoomDateDate

The date that should be positioned at the passed datePosition client offset.

zoomPositionNumber

The client offset at which the passed zoomDate should be positioned.

widthNumber

Lowest tick width. Might be increased automatically