Interface: Monitor¶
Imperative controller for a WebGPU signal monitor canvas.
Remarks¶
The controller owns its renderer resources, but borrows both the device and canvas supplied to createMonitor. Call Monitor.destroy before releasing either borrowed resource.
Methods¶
clear()¶
clear():
void
Clear the loaded series and blank the monitor.
Returns¶
void
destroy()¶
destroy():
void
Release event handlers, canvas configuration, and renderer resources.
Returns¶
void
extend()¶
extend(
validFrames,values?):void
Advance the committed frame frontier.
Pass values to replace the loaded sample buffer; otherwise mutate the
existing buffer in place before calling.
Parameters¶
Parameter |
Type |
Description |
|---|---|---|
|
|
Number of frames ready to draw, clamped to the series length. |
|
|
Optional replacement buffer with the same length as the loaded series. |
Returns¶
void
Throws¶
Error when no series is loaded or the replacement buffer length differs.
load()¶
load(
series,signal?):void
Bind a series and schedule its committed frames for painting.
Parameters¶
Parameter |
Type |
Description |
|---|---|---|
|
Packed monitor samples and time coordinates. |
|
|
|
Initial signal index. Default: |
Returns¶
void
Throws¶
Error when the series shape or signal index is invalid.
on()¶
on<
K>(event,handler): () =>void
Subscribe to a monitor event and receive an unsubscribe callback.
Type Parameters¶
Type Parameter |
|---|
|
Parameters¶
Parameter |
Type |
Description |
|---|---|---|
|
|
Event name to observe. |
|
( |
Callback invoked with the event payload. |
Returns¶
A function that removes the handler.
() => void
pause()¶
pause():
void
Pause painting and pointer hover work until resumed.
Returns¶
void
resume()¶
resume():
void
Resume painting after a consumer pause.
Returns¶
void
setColormap()¶
setColormap(
fn):void
Replace the transfer function used for trace color.
Parameters¶
Parameter |
Type |
Description |
|---|---|---|
|
( |
Function mapping normalized values in |
Returns¶
void
setFocus()¶
setFocus(
element):void
Highlight one element with a foreground trace, or pass null to clear focus.
Parameters¶
Parameter |
Type |
Description |
|---|---|---|
|
|
Element index to focus, or |
Returns¶
void
setSignal()¶
setSignal(
signal):void
Switch the displayed signal.
Parameters¶
Parameter |
Type |
Description |
|---|---|---|
|
|
Signal index in |
Returns¶
void
Throws¶
Error when no series is loaded or the signal index is invalid.
setValueRange()¶
setValueRange(
range):void
Override the value domain, or pass null to return to auto-fit.
Parameters¶
Parameter |
Type |
Description |
|---|---|---|
|
readonly [ |
Fixed |
Returns¶
void