Timeline
Extends:
Is the main entry point to create a temporal visualization.
A timeline
instance mainly provides the context for any visualization of
temporal data and maintains the hierarchy of Track
, Layer
and Shape
over the entiere visualisation.
Its main responsabilites are:
- maintaining the temporal consistency accross the visualisation through
its
timeContext
property (instance ofTimelineTimeContext
). - handling interactions to its current state (acting here as a simple state machine).
Constructor Summary
Public Constructor | ||
public |
constructor(pixelsPerSecond: Number, visibleWidth: Number) |
Member Summary
Public Members | ||
public get |
Object maintaining arrays of |
|
public get |
Returns the list of all registered layers. |
|
public get |
Returns |
|
public set |
Updates the |
|
public set |
Updates |
|
public get |
Returns |
|
public get |
Returns the |
|
public set |
Updates the |
|
public get |
Returns the current state of the timeline. |
|
public set |
Updates the state of the timeline. |
|
public |
|
|
public get |
Returns |
|
public get |
Returns the |
|
public get |
Returns |
|
public set |
Updates the |
|
public get |
Returns the |
|
public set |
Updates the |
|
public get |
Returns the |
Method Summary
Public Methods | ||
public |
Iterates through the added tracks. |
|
public |
Adds a new track to the timeline. |
|
public |
Helper to add a |
|
public |
configureSurface(ctor: EventSource) Overrides the default |
|
public |
createInteraction(ctor: EventSource, $el: Element, options: Object) Factory method to add interaction modules the timeline should listen to. |
|
public |
createTrack($el: Element, trackHeight: Number, trackId: String): Track Helper to create a new |
|
public |
getHitLayers(e: WavesEvent): Array Returns a list of the layers situated under the position of a |
|
public |
getLayersByGroup(groupId: String): Array | undefined Returns an array of layers from their given group id. |
|
public |
getTrackById(trackId: String): Track Returns a |
|
public |
getTrackFromDOMElement($el: Element): Track Returns the track containing a given DOM Element, returns null if no match found. |
|
public |
Removes a track from the timeline. |
|
public |
removeLayer(layer: Layer) Removes a layer from its track. |
Public Constructors
Public Members
public get groupedLayers: Object source
Object maintaining arrays of Layer
instances ordered by their groupId
.
Is used internally by the TrackCollection
instance.
public get maintainVisibleDuration: Boolean source
Returns TimelineTimeContext
's maintainVisibleDuration
current value.
public set maintainVisibleDuration: Boolean source
Updates the TimelineTimeContext
's maintainVisibleDuration
value.
Defines if the duration of the visible area should be maintain when
the visibleWidth
attribute is updated.
public timeContext: TimelineTimeContext source
public get timeToPixel: Function source
Returns TimelineTimeContext
's timeToPixel
transfert function.
public get visibleDuration: Number source
Returns TimelineTimeContext
's visibleDuration
helper value.
public set visibleWidth: Number source
Updates the TimelineTimeContext
's visibleWidth
pixel domain value.
Public Methods
public addLayer(layer: Layer, trackOrTrackId: Track | String, groupId: String, isAxis: Boolean) source
Helper to add a Layer
instance into a given Track
. Is designed to be
used in conjonction with the Timeline~getLayersByGroup
method. The
layer is internally rendered and updated.
Params:
Name | Type | Attribute | Description |
layer | Layer | The |
|
trackOrTrackId | Track | String | The |
|
groupId | String |
|
An optionnal group id in which the
|
isAxis | Boolean |
|
Set to |
public configureSurface(ctor: EventSource) source
Overrides the default Surface
that is instanciated on each Track
instance. This methos should be called before adding any Track
instance
to the current timeline
.
Params:
Name | Type | Attribute | Description |
ctor | EventSource | The constructor to use in order to catch mouse
events on each |
public createInteraction(ctor: EventSource, $el: Element, options: Object) source
Factory method to add interaction modules the timeline should listen to.
By default, the timeline instanciate a global Keyboard
instance and a
Surface
instance on each container.
Should be used to install new interactions implementing the EventSource
interface.
Params:
Name | Type | Attribute | Description |
ctor | EventSource | The contructor of the interaction module to instanciate. |
|
$el | Element | The DOM element which will be binded to the |
|
options | Object |
|
Options to be applied to the |
public createTrack($el: Element, trackHeight: Number, trackId: String): Track source
Helper to create a new Track
instance. The track
is added,
rendered and updated before being returned.
Params:
Name | Type | Attribute | Description |
$el | Element | The DOM element where the track should be inserted. |
|
trackHeight | Number | The height of the newly created track. |
|
trackId | String |
|
Optionnal unique id to associate with
the track, this id only exists in timeline's context and should be used in
conjonction with |
public getHitLayers(e: WavesEvent): Array source
Returns a list of the layers situated under the position of a WaveEvent
.
Params:
Name | Type | Attribute | Description |
e | WavesEvent | An event triggered by a |
public getLayersByGroup(groupId: String): Array | undefined source
Returns an array of layers from their given group id.
Params:
Name | Type | Attribute | Description |
groupId | String | The id of the group as defined in |
public getTrackById(trackId: String): Track source
Returns a Track
instance from it's given id.
Params:
Name | Type | Attribute | Description |
trackId | String |
public getTrackFromDOMElement($el: Element): Track source
Returns the track containing a given DOM Element, returns null if no match found.
Params:
Name | Type | Attribute | Description |
$el | Element | The DOM Element to be tested. |