Skip to content

RecipeTable

Table of typed columns whose rows the operator edits: recipes, setpoint tables (IND-113, IND-114).

RecipeTable, light theme RecipeTable, dark theme

Recipes and plant structure · Widget catalog · API reference · schema recipetable.schema.json

Example

The traits of the picture above:

ai.RecipeTable(
    value=[
        {"step": "Heat", "temp": 65, "time": 30, "agitator": "slow", "vacuum": False},
        {
            "step": "React",
            "temp": 82.5,
            "time": 120,
            "agitator": "fast",
            "vacuum": True,
        },
        {"step": "Cool", "temp": 30, "time": 45, "agitator": "slow", "vacuum": False},
    ],
    label="RecipeTable",
    row_edit=True,
    max_rows=20,
    columns=[
        {"name": "step", "type": "text"},
        {
            "name": "temp",
            "title": "Temperature",
            "unit": "°C",
            "min": 20,
            "max": 90,
            "step": 0.5,
            "format": "%.1f",
        },
        {
            "name": "time",
            "title": "Hold",
            "unit": "min",
            "min": 0,
            "max": 240,
            "step": 1,
            "format": "%.0f",
        },
        {"name": "agitator", "type": "choice", "choices": ["off", "slow", "fast"]},
        {"name": "vacuum", "type": "bool"},
    ],
    size=(560, 150),
)

Traits

Trait Type Default Set by Description
size array [560,220] host [width, height] in CSS pixels.
columns array of object [] host Columns {name, title, type, unit, min, max, step, format, choices, readonly, default}. Python normalizes them (a string is a number column of that name, missing keys get their defaults) and rejects duplicate names, unknown keys, max < min and choice columns without choices.
value array of object [] host, widget Rows, each a dict keyed by column name, every cell valid for its column. Written by the host (Python checks every row); operator edits arrive as messages and are applied by the host, or by the front end when no host owns the state (HOST-012).
row_edit boolean false host Let the operator add and delete rows (IND-114).
max_rows integer 100 host Most rows the table may hold.
Common traits (8), shared with other widgets
Trait Type Default Set by Description
mode "control", "indicator" "control" 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.
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.