DigitalWaveformGraph¶
Logic timing diagram with bus grouping (CHART-102).

Graphs, time · Widget catalog · API reference ·
schema digitalgraph.schema.json
Example¶
The traits of the picture above:
ai.DigitalWaveformGraph(
label="DigitalWaveformGraph",
lines=["D0", "D1", "D2", "D3", "CLK"],
buses=[{"name": "DATA", "lines": [3, 2, 1, 0]}],
show_lines_in_bus=False,
cursors=[{"x": 11.5, "name": "C1", "color": ""}],
x_unit="µs",
size=(420, 150),
)
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 |
|---|---|---|---|---|
value |
object | {} |
host | Size of the data {n_samples, n_lines}, written by the host with each data message. |
lines |
array of string | [] |
host | Line names; a missing name is shown as D |
buses |
array of object | [] |
host | Groups of lines {name, lines} shown as one hexadecimal value (first listed line = MSB). Python rejects buses naming a missing line; the front end ignores such lines. |
dt |
number | 1 |
host | Sample interval in x-axis units; 0 is shown as 1. |
x0 |
number | 0 |
host | x-axis position of the first sample. |
show_lines_in_bus |
boolean | true |
host | Also draw the lines of each bus under it. |
Common traits (15), shared with other widgets
| Trait | Type | Default | Set by | Description |
|---|---|---|---|---|
mode |
"control", "indicator" |
"indicator" |
host | "control": the user sets the value; "indicator": display only. |
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. |
size |
array | [480,240] |
host | [width, height] in CSS pixels. |
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). |
cursors |
array of object | [] |
host, widget | Cursors {x, name, color} (CHART-104). Dragged or typed by the operator, also on indicators; a host may complete a missing name as C |
cursor_values |
array of object | [] |
host | Readout of the cursors for the host program, {name, x, values}, computed by the host from its data. The front end draws its own readout and does not read this trait. |
annotations |
array of object | [] |
host | Text annotations {x, y, text, color} in data coordinates (CHART-105). |
export |
boolean | true |
host | Offer CSV, PNG and SVG downloads in the toolbar (CHART-107). |
x_unit |
string | "" |
host | |
unit |
string | "" |
host |
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.