Meter
The dashboard dial: an arc gauge with a big amount in the middle — CPU load,
disk usage, a score. Built accessible: the value lives in a real variable,
the accessible role is progressbar, and value changes are announced to
screen readers (debounced, so animations don't spam).
Live preview
Live preview. In the Player's built-in docs viewer (
scriptweaver --help), this rendersMeteras a live, theme-aware widget you can interact with.
Example
const mem = app.Meter({
value: 68,
suffix: '%',
subtext: 'Memory',
color: 'info',
});
mem.pack.configure();
mem.value = 75; // moves the dial (clamped into 0..maximum)
Bind it to a DoubleVar and the dial follows every
write — handy when one value drives several widgets:
const load = new DoubleVar({ value: 0 });
app.Meter({ variable: load, subtext: 'CPU' });
load.value = 42; // the dial moves
Set interactive: true to let the user turn the dial — a click or drag on
the arc, or the arrow keys, set the value, flowing back through the same
variable:
const vol = new DoubleVar({ value: 30 });
app.Meter({ variable: vol, interactive: true, subtext: 'Volume', suffix: '%' });
// vol.value now follows the user's drag / keyboard input
Options
| Option | Type | Description |
|---|---|---|
value |
number | The amount; clamped into 0..maximum. |
maximum |
number | Scale end (default 100; must be > 0). |
variable |
DoubleVar |
The backing variable (one is created internally otherwise). |
color |
string | Semantic color of the arc and amount: primary (default), success, info, … |
subtext |
string | The caption under the amount (also used for announcements). |
suffix |
string | Appended to the displayed amount, e.g. '%' or ' GB'. |
meterSize |
number | The dial's pixel size (square; default ~200). Text scales with it. |
thickness |
number | Arc width in pixels. |
arcRange |
number | Sweep in degrees, 10..360 (default 270, gap at the bottom; 360 is a full ring). |
interactive |
boolean | When true, the dial becomes an input: click/drag on the arc and arrow keys set the value through the same variable. Default false (an output gauge). |
stepSize |
number | Keyboard increment when interactive (default 1). |
By default the dial is display-only (it takes no keyboard focus). Set
interactive: true to make it an input control: a click or drag on the arc sets
the value, the arrow keys adjust by stepSize, and Home/End jump to the ends.
The change flows through the same value / variable, so a bound DoubleVar
updates and any handler tracing it fires — exactly like a Scale —
and the accessible role becomes slider. It redraws on theme switches. Invalid
options error immediately with the valid choices.
See also
Floodgauge— a bar with the amount written insideProgressbar— the plain bar- Accessibility — announcements