TimeRulerViewer
Time ruler viewer canvas controller and coordinate tick renderer.
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new TimeRulerViewer( canvas: HTMLCanvasElement, viewport: IViewportController, options?: Partial<TimeRulerConfig>): TimeRulerViewer;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
canvas | HTMLCanvasElement |
viewport | IViewportController |
options? | Partial<TimeRulerConfig> |
Returns
Section titled “Returns”TimeRulerViewer
Methods
Section titled “Methods”canvasToTime()
Section titled “canvasToTime()”canvasToTime(x: number): number;Converts canvas X pixel position to time in seconds.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
x | number |
Returns
Section titled “Returns”number
Implementation of
Section titled “Implementation of”destroy()
Section titled “destroy()”destroy(): void;Disposes the ruler renderer and event listeners.
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”getCanvas()
Section titled “getCanvas()”getCanvas(): HTMLCanvasElement;Returns the bound HTML canvas element.
Returns
Section titled “Returns”HTMLCanvasElement
Implementation of
Section titled “Implementation of”getConfig()
Section titled “getConfig()”getConfig(): ResolvedTimeRulerConfig;Returns the resolved time ruler configuration options.
Returns
Section titled “Returns”Implementation of
Section titled “Implementation of”getStatus()
Section titled “getStatus()”getStatus(): TimeRulerStatus;Returns the current render status.
Returns
Section titled “Returns”Implementation of
Section titled “Implementation of”getViewport()
Section titled “getViewport()”getViewport(): TimeRulerViewport;Returns the visible time viewport.
Returns
Section titled “Returns”Implementation of
Section titled “Implementation of”getViewportController()
Section titled “getViewportController()”getViewportController(): IViewportController;Returns the bound viewport controller.
Returns
Section titled “Returns”Implementation of
Section titled “Implementation of”ITimeRulerViewer.getViewportController
on<Name>(name: Name, handler: (event: TimeRulerEvents[Name]) => void): () => void;Subscribes to time ruler events.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
Name extends keyof TimeRulerEvents |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
name | Name |
handler | (event: TimeRulerEvents[Name]) => void |
Returns
Section titled “Returns”() => void
Implementation of
Section titled “Implementation of”render()
Section titled “render()”render(): Promise<void>;Renders the current time ruler viewport asynchronously.
Returns
Section titled “Returns”Promise<void>
Implementation of
Section titled “Implementation of”requestRender()
Section titled “requestRender()”requestRender(): void;Schedules a render on the next animation frame.
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”ITimeRulerViewer.requestRender
setConfig()
Section titled “setConfig()”setConfig(input: Partial<TimeRulerOptions>): void;Alias for updateConfig.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
input | Partial<TimeRulerOptions> |
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”setViewport()
Section titled “setViewport()”setViewport(vp: Partial<ViewportConfig>): void;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
vp | Partial<ViewportConfig> |
Returns
Section titled “Returns”void
timeToCanvas()
Section titled “timeToCanvas()”timeToCanvas(time: number): number;Converts time in seconds to canvas X pixel position.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
time | number |
Returns
Section titled “Returns”number
Implementation of
Section titled “Implementation of”updateConfig()
Section titled “updateConfig()”updateConfig(input: Partial<TimeRulerOptions>): void;Updates configuration options and triggers a re-render.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
input | Partial<TimeRulerOptions> |
Returns
Section titled “Returns”void