FrameAPI¶
Interface FrameAPI
interface FrameAPI {
registerFrameListener(listener: FrameListener): void;
unregisterFrameListener(listener: FrameListener): void;
}
registerFrameListener(listener: FrameListener): void;
unregisterFrameListener(listener: FrameListener): void;
}
Hierarchy (View Summary)
- FrameAPI
Index
Methods
register Frame Listener
Registers a frame listener which is executed on every tick of the internal update loop of the webvis context.
Parameters
- listener: FrameListener
The listener to register.
Returns void
- listener: FrameListener
unregister Frame Listener
Unregisters a frame listener which has previously been registered via registerFrameListener.
Parameters
- listener: FrameListener
The listener to unregister.
Returns void
- listener: FrameListener
Was this page helpful? Please leave a thumbs up or down.
FrameAPI
Overview
The FrameAPI provides functions for registering and unregistering frame listeners which are executed on every tick of the internal update loop of the webvis context.
The FrameAPI might be used to:
Quick Start
To get started with the FrameAPI, you can register a listener via the webvis context:
Execution Behavior
The execution frequency of a frame listener will usually match the refresh rate of the display, which is typically around 60 Hz. Frame listener execution might be throttled when the document is not visible (e.g., when the browser tab is in the background).
When executed, a listener receives the timestamp of the current tick of the internal update loop and the elapsed time since the last tick. Custom logic should never assume a specific update rate, but instead be based on the provided timing information.
See