diff --git a/docs/interface/dashboards.md b/docs/interface/dashboards.md index b75f731..922052e 100644 --- a/docs/interface/dashboards.md +++ b/docs/interface/dashboards.md @@ -48,7 +48,7 @@ still names the widget for accessibility and published values. | **Button** | fixed value | one-shot action | | **Buttons** | a value per button | grid of actions | | **Switch** | `bool` | on/off | -| **Slider** | `float`, `int` | min, max, step; horizontal or vertical | +| **Slider** | `float`, `int` | min, max, step; horizontal or vertical; a reading beside it | | **Input** | text or number | free entry | | **Selector** | selected value | menu or row of choices | | **Colour** | list or string | HSV, RGB or hex | @@ -63,6 +63,27 @@ endpoints feeding the nodes that consume those messages. Bindings are checked in the editor and on the server. See [Payload types](../reference/payload-types.md). +### A slider's reading + +A Slider can also show what it sets against, such as the room's temperature +beside a setpoint: **Beside it** binds `reading: {message, dtype, label}` to a +`float` or `int`. The reading is only shown, never published. It is written in +the slider's unit and to its step's decimals (a step of 0.5 writes 21 as +`21.0`); `—` stands in for the value until one arrives. On a round face it +takes the middle (see [Round dashboards](#round-dashboards)); in a tile it is a +line under the slider's value. + +Sizes are CSS pixels of the canvas, as in the round geometry below. The +slider's own value is at the tile's text size (14; 16 on a touch-friendly +panel), centred on a line as tall as the control (32; 48 touch-friendly). + +| Part | Value | +|---|---| +| Line | 16 high, text 12: the label (muted, at most 96 wide, cut with an ellipsis), 6, the value (text colour), 6, the unit (muted). Without a label, the value and unit alone | +| Row | directly under the slider's value, right-aligned with it, in the column right of the track (12 apart). With ticks the line shares the ticks' row, so the tile grows no taller; without them it adds 16 | +| Row width | the value column is as wide as its wider line, but at most half the row; the track takes the rest. What does not fit is cut from the label; the value and unit never are | +| Fader | directly under the slider's value, both centred under the track, 8 below it; the line no wider than the tile inside its padding, cut from the label first | + ## Charts Choose the chart's data source: @@ -188,11 +209,8 @@ at once and is published once, 300 ms after the last notch or when the pointer is released. A Gauge only shows. On any other face, turning a knob only wakes the screen. -A Slider can also show what it sets against, such as the room's temperature -beside a setpoint: **Beside it** binds `reading: {message, dtype, label}` to a -`float` or `int`. That reading is written large in the middle, in the slider's -unit and to its step's decimals, under its label; the slider's own title and -value move to the line in the ring's gap. +A Slider's reading (**Beside it**) is written large in the middle, under its +label; the slider's own title and value move to the line in the ring's gap. Value, Switch, Button, Clock, Icon, Notification and Text have faces of their own. Every other type is drawn as its rectangular body in the middle of the diff --git a/frontend/src/components/Dashboard/panels.tsx b/frontend/src/components/Dashboard/panels.tsx index a7cebcc..871dcfd 100644 --- a/frontend/src/components/Dashboard/panels.tsx +++ b/frontend/src/components/Dashboard/panels.tsx @@ -511,7 +511,7 @@ export function WidgetPanel({ onChange({ config: { ...cfg, ...changes } }) const series = seriesOf(widget) - // What a slider on a round face reads beside its own value. + // What a slider reads beside its own value. const reading = (cfg.reading ?? {}) as Series const runsPick = (cfg.runs ?? {}) as RunsPick const setSeries = (next: Series[]) => set({ series: next }) @@ -1133,9 +1133,9 @@ export function WidgetPanel({ ) : null} - {widget.type === "slider" && round ? ( + {widget.type === "slider" ? (