Skip to content

SynopticCanvas

Widgets and pipe runs placed at absolute coordinates on a background image (SCADA-010).

SynopticCanvas, light theme SynopticCanvas, dark theme

Layout and session · Widget catalog · API reference · schema synoptic.schema.json

Example

The traits of the picture above:

ai.SynopticCanvas(
    label="SynopticCanvas (pipes only in preview)",
    pipes=[
        {
            "points": [[20, 60], [200, 60], [200, 120], [300, 120]],
            "flow": True,
            "direction": "forward",
            "color": "",
            "thickness": 10,
        },
    ],
    size=(320, 150),
)

Traits

Trait Type Default Set by Description
mode "control", "indicator" "indicator" host "control": the user sets the value; "indicator": display only.
size array [640,360] host [width, height] in CSS pixels.
items array of object [] host Widgets placed on the canvas {widget, x, y}. The children are rendered through the host widget manager (Jupyter, marimo); a host without one gets a placeholder per child, while the pipes and the background still render (HOST-009).
pipes array of object [] host Pipe runs {points, flow, direction, color, thickness} drawn by the canvas, with an optional flow animation.
background bytes "" host PNG, JPEG or SVG image bytes; empty: none. A binary buffer in Jupyter; a host that only sends JSON may send base64 text. An SVG is shown through an image element: its scripts and external loads are disabled.
background_mime string "" host Type of the background: "image/png", "image/jpeg" or "image/svg+xml", set by Python from the bytes. When empty or another value, the front end detects the type from the bytes the same way.
value object {} host Unused (always empty).
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.