View Control API
setZoomLevel
setZoomLevel(zoomLevel: number)
Set the zoom level.
zoom
zoom(factor: number)
Zoom by a factor.
setTimeIndicator
setTimeIndicator(seconds: number, applySnap?: boolean)
Set the time indicator position (seconds).
setCanvasSize
setCanvasSize(width: number, height: number)
Set canvas size.
adjustCanvasSize
adjustCanvasSize()
Automatically adjust the canvas size based on the container.
getCanvas
getCanvas(): HTMLCanvasElement
Get the canvas element.
markDirty
markDirty(layerIds?: string[])
Mark layers as dirty to trigger a redraw. If no layers are provided, all layers will be redrawn.
notifyChange
notifyChange(change: ChangeType)
Notify a state change. The scheduler will handle dirty-layer marking, derived state computation, and callbacks.
beginChangeBatch
beginChangeBatch()
Begin a batch change session. Changes will not trigger redraws immediately until endChangeBatch is called.
endChangeBatch
endChangeBatch()
End a batch change session.
getLastLayerTimes
getLastLayerTimes(): Record<string, number>
Get the last render timestamp for each layer.
getContentWidthForZoom
getContentWidthForZoom(zoomLevel: number): number
Get content width for a given zoom level.
hasHorizontalScrollbar
hasHorizontalScrollbar(): boolean
Check whether the horizontal scrollbar is shown.
getAvailableHeight
getAvailableHeight(): number
Get available height (minus scrollbars and other reserved space).