Class: Timeframe

Timeframe(options)

TimeFrame is the main container for panes.

Constructor

new Timeframe(options)

Create a TimeFrame.
Parameters:
Name Type Description
options Object Configuration options.
Author:
  • Lawrence Fyfe
Source:

Methods

addPane(pane)

Add the specified pane to this TimeFrame.
Parameters:
Name Type Description
pane pane The pane to add.
Source:

callTimeAxis()

Generate the time time axis for this TimeFrame.
Source:

deleteTime(baseTime, deltaTime)

Deletes time based on the specified time range but only if no elements are in that time range.
Parameters:
Name Type Description
baseTime number The start of the selection.
deltaTime number The end of the selection.
Source:

draw()

Draw this TimeFrame if it has been initialized.
Source:

drawLoader()

Draw the loader and animate it until eraseLoader() is called.
Source:

drawLoaderLine()

Draw the individual lines in the loader animation.
Source:

erase()

Erase this TimeFrame.
Source:

eraseLoader()

Stop and erase the loader animation.
Source:

formatSeconds(s) → {string}

Take the specified seconds and format them.
Parameters:
Name Type Description
s number Seconds to be formatted.
Source:
Returns:
The formatted seconds as a string.
Type
string

initialize(parentElement, width, height, endTime)

Initialize this TimeFrame.
Parameters:
Name Type Description
parentElement Element The parent element.
width number The width in pixels of this TimeFrame.
height number The height in pixels of this TimeFrame.
endTime number The end time for this TimeFrame.
Source:

insertTime(baseTime, deltaTime)

Inserts time based on the specified time range.
Parameters:
Name Type Description
baseTime number The start of the selection.
deltaTime number The end of the selection.
Source:

resetSize()

Reset the width and height of this Timeframe back to whatever those values were when setBaseSize() was last called.
Source:

resetSizeAndZoom(startTime, endTime)

Reset the width and height of this Timeframe back to whatever those values were when setBaseSize() was last called and zoom to the specified time range.
Parameters:
Name Type Description
startTime number The start time to zoom to.
endTime number The end time to zoom to.
Source:

resetTimeRange()

Reset the time in this TimeFrame to a range from 0 to the end time set for this TimeFrame.
Source:

resize(width, height)

Resize this Timeframe immediately.
Parameters:
Name Type Description
width number The width in pixels to use for this TimeFrame.
height number The height in pixels to use for this TimeFrame.
Source:

resizeAndZoom(width, height, startTime, endTime)

Resize this Timeframe and zoom to the specified time range immediately.
Parameters:
Name Type Description
width number The width in pixels to use for this TimeFrame.
height number The height in pixels to use for this TimeFrame.
startTime number The start time to zoom to.
endTime number The end time to zoom to.
Source:

runAnimation()

Start running an animation. The animation task depends on the onAnimate() callback. The animation is stopped by a boolean set outside of this method though it can also be stopped by the stopAnimation() method. Note that the frame rate is normally the refresh rate of the screen.
Source:

setActivePane(pane)

Set the specified pane to be the active pane. This both activates the pane and raises it to the top of the pane list for this TimeFrame. All other panes are deactivated.
Parameters:
Name Type Description
pane pane The pane to add.
Source:

setBaseSize()

Takes the current width and height (set with initialize()) and sets them as a base size for resetSize() and resetSizeAndZoom().
Source:

stopAnimation()

Stop the animation from running.
Source:

zeroPad(n) → {string}

Add a zero to the specified number.
Parameters:
Name Type Description
n number A number to be padded.
Source:
Returns:
The padded number as a string.
Type
string

zoomTimeRange(start, stop)

Zoom the time in this TimeFrame to the specified range. This will change the time range for all panes contained in this TimeFrame, including an audio pane.
Parameters:
Name Type Description
start number The start time.
stop number The stop time.
Source: