Constructor
new Timeframe(options)
Create a TimeFrame.
Parameters:
| Name | Type | Description |
|---|---|---|
options |
Object | Configuration options. |
Methods
addPane(pane)
Add the specified pane to this TimeFrame.
Parameters:
| Name | Type | Description |
|---|---|---|
pane |
pane | The pane to add. |
callTimeAxis()
Generate the time time axis for this TimeFrame.
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. |
draw()
Draw this TimeFrame if it has been initialized.
drawLoader()
Draw the loader and animate it until eraseLoader() is called.
drawLoaderLine()
Draw the individual lines in the loader animation.
erase()
Erase this TimeFrame.
eraseLoader()
Stop and erase the loader animation.
formatSeconds(s) → {string}
Take the specified seconds and format them.
Parameters:
| Name | Type | Description |
|---|---|---|
s |
number | Seconds to be formatted. |
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. |
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. |
resetSize()
Reset the width and height of this Timeframe back to whatever those values were when setBaseSize() was last called.
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. |
resetTimeRange()
Reset the time in this TimeFrame to a range from 0 to the end time set for this TimeFrame.
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. |
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. |
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.
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. |
setBaseSize()
Takes the current width and height (set with initialize()) and sets them as a base size for resetSize() and resetSizeAndZoom().
stopAnimation()
Stop the animation from running.
zeroPad(n) → {string}
Add a zero to the specified number.
Parameters:
| Name | Type | Description |
|---|---|---|
n |
number | A number to be padded. |
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. |