Monitor bindings
Tweakpane also has a feature for monitoring value changes.
To monitor primitive value changes, use addBinding()
with the option {readonly: true}
.
const pane = new Pane();
pane.addBinding(PARAMS, 'wave', {
readonly: true,
});
Multiline
multiline
option provides a multiline log component. rows
can change the display height.
const pane = new Pane();
pane.addBinding(PARAMS, 'wave', {
readonly: true,
multiline: true,
rows: 5,
});
Buffer size
You can use bufferSize
option to change the buffer size.
const pane = new Pane();
pane.addBinding(PARAMS, 'wave', {
readonly: true,
bufferSize: 10,
});
Interval
To change an interval of monitors, set interval
option in milliseconds. The default value is 200(ms).
const pane = new Pane();
pane.addBinding(PARAMS, 'time', {
readonly: true,
interval: 1000,
});
Graph
{view: 'graph'}
option for number parameters provides a graph component. Pass min
and max
for value range.
const pane = new Pane();
pane.addBinding(PARAMS, 'wave', {
readonly: true,
view: 'graph',
min: -1,
max: +1,
});