Enum Viz
pub enum Viz {
Show 15 variants
Spark,
Gauge,
Dial,
Bar,
Thermometer,
Droplet,
Battery,
Wind,
Sun,
Wave,
Switch,
Valve,
Chain,
Mesh,
Count,
}Expand description
The graphic a reading is drawn with on the dashboard.
The names are the instrument, not the quantity, so a profile chooses the shape that
reads best for its data: a 270-degree arch Gauge for a fraction, a
Bar for a tank, a Switch for an on/off state. Each
maps to one of the dashboard’s hand-drawn visualizations through
kind.
Variants§
Spark
A rolling sparkline of recent values. The default for an unfamiliar quantity.
Gauge
A 270-degree arch gauge, for a fraction or percentage.
Dial
A half-dial with a needle, for a pressure or flow reading.
Bar
A horizontal bar with a safe-band tick, for a level or stock.
Thermometer
A thermometer, for a temperature.
Droplet
A liquid-filled droplet, for humidity or moisture.
Battery
A segmented battery cell, for a state of charge or voltage.
Wind
An anemometer, for wind speed.
Sun
A sun whose corona grows with the reading, for illuminance.
Wave
An acoustic waveform, for sound level or an acoustic event.
Switch
A labelled state chip, lit when the state reads as “on”. For a discrete state.
Valve
A pipe valve, open along the flow or closed across it. For a controllable valve.
Chain
A row of hash-chained blocks, for a tamper-evident record count.
Mesh
A neighbour-mesh topology map, for a mesh node’s peers.
Count
A plain numeric counter, for a node or network stat.
Implementations§
§impl Viz
impl Viz
pub const ALL: [Viz; 15]
pub const ALL: [Viz; 15]
Every graphic, in a stable order, so a caller can enumerate the available visualizations (and a build can check each one still renders).
pub fn kind(self) -> &'static str
pub fn kind(self) -> &'static str
Returns the dashboard visualization kind this graphic renders as.
The dashboard’s renderer dispatches on a small set of internal kind strings; a
few friendly names differ from them (Gauge draws the radial
arch, Thermometer the therm instrument,
Switch the chip). This is the value carried on the wire so the
page needs no lookup of its own.
§Returns
The stable visualization kind, such as "radial" or "bar".