Skip to content

DeviationIndicator

Centre-zero bar of the deviation between a value and its setpoint (IND-100).

DeviationIndicator, light theme DeviationIndicator, dark theme

Compact indicators · Widget catalog · API reference · schema deviation.schema.json

Example

The traits of the picture above:

ai.DeviationIndicator(
    value=52.3,
    label="Deviation",
    setpoint=50,
    tolerance=1.5,
    span=5,
    unit="°C",
    format="%.1f",
)

Traits

Trait Type Default Set by Description
format string "%.2f" host printf-like spec of the deviation (NUM-004).
mode "control", "indicator" "indicator" host "control": the user sets the value; "indicator": display only.
setpoint number 0 host Setpoint; the bar shows value - setpoint.
size array [220,44] host [width, height] in CSS pixels.
span number 10 host Half-range of the bar (must be > 0).
tolerance number 1 host Half-width of the tolerance band; outside it the bar takes the alarm color and reads HIGH or LOW.
unit string "" host Unit shown with the deviation.
value number "nan" host Measured value.
Common traits (7), shared with other widgets
Trait Type Default Set by Description
label string "" host Plain text, never interpreted as HTML (SEC-002).
disabled boolean false host Greyed out, input rejected.
visible boolean true host
tooltip string "" host Plain text shown on hover.
style "modern", "classic", "system" "modern" host
theme "auto", "light", "dark", "system" "auto" host "auto": the style decides; "system": the host page or the operating system (STYLE-007).
skin object {} host Replaceable drawing parts: part name -> SVG source, sanitized (STYLE-005, STYLE-006).

Set by: host, the program (Python, Julia, ...); widget, the user through the widget; derived, computed from other traits by the host that owns the state, or by the widget. See the trait contract.