Skip to content

IViewportController

Controls visible time and frequency coordinates across synchronized viewers.

attachNavigation(container: HTMLElement, options?: NavigationOptions): () => void;

Attaches drag, wheel, and pinch gestures on an element.

ParameterTypeDescription
containerHTMLElementDOM element to attach listeners to.
options?NavigationOptionsGesture configuration.

Cleanup function that removes listeners.

() => void


destroy(): void;

Disposes listeners and event emitters.

void


getTimeBounds(): object;

Returns active outer time limits in seconds.

object

maxTime: number;
minTime: number;

getViewport(): ViewportState;

Returns the current viewport state.

ViewportState


on<K>(event: K, handler: (e: ViewportEvents[K]) => void): () => void;

Subscribes to viewport change and destruction events.

Type Parameter
K extends keyof ViewportEvents
ParameterType
eventK
handler(e: ViewportEvents[K]) => void

() => void


pan(deltaSeconds: number, source?: string): void;

Shifts visible start and end times by a delta in seconds.

ParameterType
deltaSecondsnumber
source?string

void


panFrequency(deltaHz: number, source?: string): void;

Shifts visible frequency range by a delta in Hz.

ParameterType
deltaHznumber
source?string

void


panTime(deltaSeconds: number, source?: string): void;

Shifts visible start and end times by a delta in seconds.

ParameterType
deltaSecondsnumber
source?string

void


panTo(startTime: number, source?: string): void;

Moves the viewport start to a specific timestamp in seconds.

ParameterType
startTimenumber
source?string

void


reset(): void;

Resets viewport to default time and frequency limits.

void


setTimeBounds(minTime: number, maxTime: number): void;

Sets outer time limits in seconds for panning and zooming.

ParameterType
minTimenumber
maxTimenumber

void


setViewport(patch: Partial<ViewportConfig>, source?: string): void;

Updates viewport coordinates and notifies listeners.

ParameterType
patchPartial<ViewportConfig>
source?string

void


updateViewport(patch: Partial<ViewportConfig>, source?: string): void;

Alias for setViewport.

ParameterType
patchPartial<ViewportConfig>
source?string

void


zoom(
factor: number,
centerTime?: number,
source?: string): void;

Zooms the time axis around an optional center time in seconds.

ParameterType
factornumber
centerTime?number
source?string

void


zoomBoth(
factor:
| number
| {
frequency: number;
time: number;
},
center?: object,
source?: string): void;

Zooms both time and frequency axes simultaneously.

ParameterType
factor| number | { frequency: number; time: number; }
center?{ frequency?: number; time?: number; }
center.frequency?number
center.time?number
source?string

void


zoomFreq(
factor: number,
centerFrequency?: number,
source?: string): void;

Alias for zoomFrequency.

ParameterType
factornumber
centerFrequency?number
source?string

void


zoomFrequency(
factor: number,
centerFrequency?: number,
source?: string): void;

Zooms the frequency axis around an optional center frequency in Hz.

ParameterType
factornumber
centerFrequency?number
source?string

void


zoomTime(
factor: number,
centerTime?: number,
source?: string): void;

Zooms the time axis around an optional center time in seconds.

ParameterType
factornumber
centerTime?number
source?string

void