Skip to content
Monitor Components

WaveformMonitor

Visualize multiple numeric values as a waveform.

Integrates Simon SchΓΆdler's tweakpane-plugin-waveform.

See <Monitor> component if you want to graph a single value's change over time.

Usage outside of a <Pane> component will implicitly wrap the waveform monitor in <Pane position="inline">.

Note that Svelte Tweakpane UI embeds a functionally identical fork of the plugin with build optimizations.


Example

πŸ”—
WaveformMonitorExample.svelte
<script lang="ts">
import { WaveformMonitor } from 'svelte-tweakpane-ui';
let waveData = [5, 6, 7, 8, 9, 3, 9, 8, 7, 6, 5];
setInterval(() => {
waveData = waveData.map((v) =>
Math.max(0, Math.min(10, v + (Math.random() * 2 - 1) * 0.5))
);
}, 10);
</script>
<WaveformMonitor value={waveData} min={-1} max={11} lineStyle={'bezier'} />

bindablerequired
Description

Waveform values. The value to control.

TypeWaveformMonitorValue
optional
Description

Minimum graph bound.

Typenumber
Default0
optional
Description

Maximum graph bound.

Typenumber
Default100

lineStyle

πŸ”—
optional
Description

Line style.

Type'bezier' | 'linear'
Default'linear''

disabled

πŸ”—
optional
Description

Prevent interactivity and gray out the control.

Typeboolean
Defaultfalse
optional
Description

Text displayed next to control.

Typestring
Defaultundefined
optional
Description

Custom color scheme.

TypeTheme
Defaultundefined
Inherits default Tweakpane theme equivalent to ThemeUtils.presets.standard, or the theme set with setGlobalDefaultTheme().
optional
Description

Number of visible rows of state history.

If bufferSize is larger, then the value window will scroll once state history exceeds row count.

Typenumber
Default1
Or 3 if value is string and multiline is true.

bufferSize

πŸ”—
optional
Description

Number of past states to retain.

Typenumber
Default1
Or 64 if value is number and graph is true.

interval

πŸ”—
optional
Description

Time between value samples in milliseconds.

Useful when graph is true. Defaults to reactive value updates only (interval={0}).

Typenumber
Default0