Skip to content

KPITile

Key performance indicator tile: value, target, difference to the target, optional sparkline (IND-103).

KPITile, light theme KPITile, dark theme

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

Example

The traits of the picture above:

ai.KPITile(value=84.6, label="KPITile (OEE)", target=85, unit="%")

The data of the picture (samples, history or drawing) is sent with the widget's methods, not as traits: see the widget catalog.

Traits

Trait Type Default Set by Description
mode "control", "indicator" "indicator" host "control": the user sets the value; "indicator": display only.
size array [190,96] host [width, height] in CSS pixels.
value number "nan" host Current value of the indicator.
target number or null null host Target; null: no difference shown.
higher_is_better boolean true host Which side of the target is good (shown with ✓ / ✗).
unit string "" host
format string "%.1f" host
show_sparkline boolean true host Draw the history as a sparkline.
history integer 30 host Number of values kept for the sparkline.
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.