ViewportController
Controls visible time and frequency coordinates across synchronized viewers.
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ViewportController(options?: ViewportControllerOptions): ViewportController;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options | ViewportControllerOptions |
Returns
Section titled “Returns”ViewportController
Methods
Section titled “Methods”attachNavigation()
Section titled “attachNavigation()”attachNavigation(container: HTMLElement, options?: NavigationOptions): () => void;Attaches drag, wheel, and pinch gestures on an element.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
container | HTMLElement | DOM element to attach listeners to. |
options? | NavigationOptions | Gesture configuration. |
Returns
Section titled “Returns”Cleanup function that removes listeners.
() => void
Implementation of
Section titled “Implementation of”IViewportController.attachNavigation
destroy()
Section titled “destroy()”destroy(): void;Disposes listeners and event emitters.
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”getTimeBounds()
Section titled “getTimeBounds()”getTimeBounds(): object;Returns active outer time limits in seconds.
Returns
Section titled “Returns”object
maxTime
Section titled “maxTime”maxTime: number;minTime
Section titled “minTime”minTime: number;Implementation of
Section titled “Implementation of”IViewportController.getTimeBounds
getViewport()
Section titled “getViewport()”getViewport(): ViewportState;Returns the current viewport state.
Returns
Section titled “Returns”Implementation of
Section titled “Implementation of”IViewportController.getViewport
on<K>(event: K, handler: (e: ViewportEvents[K]) => void): () => void;Subscribes to viewport change and destruction events.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
K extends keyof ViewportEvents |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
event | K |
handler | (e: ViewportEvents[K]) => void |
Returns
Section titled “Returns”() => void
Implementation of
Section titled “Implementation of”pan(deltaSeconds: number, source?: string): void;Shifts visible start and end times by a delta in seconds.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
deltaSeconds | number |
source? | string |
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”panFrequency()
Section titled “panFrequency()”panFrequency(deltaHz: number, source?: string): void;Shifts visible frequency range by a delta in Hz.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
deltaHz | number |
source? | string |
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”IViewportController.panFrequency
panTime()
Section titled “panTime()”panTime(deltaSeconds: number, source?: string): void;Shifts visible start and end times by a delta in seconds.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
deltaSeconds | number |
source? | string |
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”panTo()
Section titled “panTo()”panTo(startTime: number, source?: string): void;Moves the viewport start to a specific timestamp in seconds.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
startTime | number |
source? | string |
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”reset()
Section titled “reset()”reset(): void;Resets viewport to default time and frequency limits.
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”setBaseFrequencyBounds()
Section titled “setBaseFrequencyBounds()”setBaseFrequencyBounds(minFrequency: number, maxFrequency: number): void;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
minFrequency | number |
maxFrequency | number |
Returns
Section titled “Returns”void
setTimeBounds()
Section titled “setTimeBounds()”setTimeBounds(minTime: number, maxTime: number): void;Sets outer time limits in seconds for panning and zooming.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
minTime | number |
maxTime | number |
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”IViewportController.setTimeBounds
setTotalDuration()
Section titled “setTotalDuration()”setTotalDuration(totalDuration: number): void;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
totalDuration | number |
Returns
Section titled “Returns”void
setViewport()
Section titled “setViewport()”setViewport(patch: Partial<ViewportConfig>, source?: string): void;Updates viewport coordinates and notifies listeners.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
patch | Partial<ViewportConfig> |
source? | string |
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”IViewportController.setViewport
updateViewport()
Section titled “updateViewport()”updateViewport(patch: Partial<ViewportConfig>, source?: string): void;Alias for setViewport.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
patch | Partial<ViewportConfig> |
source? | string |
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”IViewportController.updateViewport
zoom()
Section titled “zoom()”zoom( factor: number, centerTime?: number, source?: string): void;Zooms the time axis around an optional center time in seconds.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
factor | number |
centerTime? | number |
source? | string |
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”zoomBoth()
Section titled “zoomBoth()”zoomBoth( factor: | number | { frequency: number; time: number;}, center?: object, source?: string): void;Zooms both time and frequency axes simultaneously.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
factor | | number | { frequency: number; time: number; } |
center? | { frequency?: number; time?: number; } |
center.frequency? | number |
center.time? | number |
source? | string |
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”zoomFreq()
Section titled “zoomFreq()”zoomFreq( factor: number, centerFrequency?: number, source?: string): void;Alias for zoomFrequency.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
factor | number |
centerFrequency? | number |
source? | string |
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”zoomFrequency()
Section titled “zoomFrequency()”zoomFrequency( factor: number, centerFrequency?: number, source?: string): void;Zooms the frequency axis around an optional center frequency in Hz.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
factor | number |
centerFrequency? | number |
source? | string |
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”IViewportController.zoomFrequency
zoomTime()
Section titled “zoomTime()”zoomTime( factor: number, centerTime?: number, source?: string): void;Zooms the time axis around an optional center time in seconds.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
factor | number |
centerTime? | number |
source? | string |
Returns
Section titled “Returns”void