Home Manual Reference Source Repository
import TimelineTimeContext from 'waves-ui/src/core/timeline-time-context.js'
public class | source

TimelineTimeContext

Defines and maintains global aspects of the visualization concerning the relations between time and pixels.

The TimelineTimeContext instance (unique across a visualization) keeps the main reference on how many pixels should be used to represent one second though its timeToPixel method. The attributes zoom, offset (i.e. from origin) and visibleWidth allow for navigating in time and for maintaining view consistency upon the DOM structure (<svg> and <g> tags) created by the registered tracks.

It also maintain an array of all references to LayerTimeContext instances to propagate to layers, changes made on the time to pixel representation.

example usage

Constructor Summary

Public Constructor
public

constructor(pixelsPerSecond: Number, visibleWidth: Number)

Member Summary

Public Members
public get

Returns the number of pixels per seconds including the current zoom value.

public set

Defines if the duration displayed by tracks should be maintained when their width is updated.

public get

Returns if the duration displayed by tracks should be maintained when their width is updated.

public get

Returns the current offset applied to the registered Track instances from origin (in seconds).

public set

Sets the offset to apply to the registered Track instances from origin (in seconds).

public get

Returns the number of pixels per seconds ignoring the current zoom value.

public set

Updates all the caracteristics of this object according to the new given value of pixels per seconds.

public get

Returns the time to pixel trasfert function.

public get

Returns the duration displayed by Track instances.

public set

Sets the visible width of the Track instances.

public get

Returns the visible width of the Track instances.

public get

Returns the current zoom level applied to the whole visualization.

public set

Sets the zoom ratio for the whole visualization.

Public Constructors

public constructor(pixelsPerSecond: Number, visibleWidth: Number) source

Params:

NameTypeAttributeDescription
pixelsPerSecond Number

The number of pixels that should be used to display one second.

visibleWidth Number

The default with of the visible area displayed in tracks (in pixels).

Public Members

public get computedPixelsPerSecond: Number source

Returns the number of pixels per seconds including the current zoom value.

public set maintainVisibleDuration: Boolean source

Defines if the duration displayed by tracks should be maintained when their width is updated.

public get maintainVisibleDuration: Number source

Returns if the duration displayed by tracks should be maintained when their width is updated.

public get offset: Number source

Returns the current offset applied to the registered Track instances from origin (in seconds).

public set offset: Number source

Sets the offset to apply to the registered Track instances from origin (in seconds).

public get pixelsPerSecond: Number source

Returns the number of pixels per seconds ignoring the current zoom value.

public set pixelsPerSecond: Number source

Updates all the caracteristics of this object according to the new given value of pixels per seconds. Propagates the changes to the LayerTimeContext children.

public get timeToPixel: Function source

Returns the time to pixel trasfert function.

public get visibleDuration: Number source

Returns the duration displayed by Track instances.

public set visibleWidth: Number source

Sets the visible width of the Track instances.

public get visibleWidth: Number source

Returns the visible width of the Track instances.

public get zoom: Number source

Returns the current zoom level applied to the whole visualization.

public set zoom: Number source

Sets the zoom ratio for the whole visualization.