KQ-2075 · RUN/CELL

Run Cell

A code execution tool call drawn as a notebook cell and fed by props as the call streams: new lines of code slide in on springs.glide, an execution cursor glides down the gutter as each line runs and every executed line is marked on springs.flick, and stdout rises line by line below. When a figure first arrives the Figure tab opens and the plot develops out of a blank frame, a soft blur clearing as it settles from 1.02 on springs.glide while its lines draw left to right behind a sweeping clip and the tolerance band fades in last, with its data one tab away as a real table. Failing and timed-out lines are marked in place; Tab moves from the code to the tabs to the panel, and Enter on the code re-runs it.

KQ-2075 · RUN/CELL

In [*]

pythonGaugeworks runtime · py 3.12
0.0 sQueued
from gaugeworks import sensors, plot
readings = sensors.load("line-4", days=7)

Waiting to run.

writing the code · 3 of 18 lines · gaugeworks · line-4 drift

Install

One command — the source lands in your repo. Or copy it from the Code tab.

$ pnpm dlx shadcn@latest add @kinetiq/run-cell

Props

code
string
default defaultRunCode
The code, in full or as far as it has arrived; appended lines slide in, replaced code starts fresh.
language
string
default "python"
Shown on the chip; the colouring reads Python keywords, strings, numbers, comments and calls.
executedLine
number
default every line once done
How many lines have run; the line at this index is running now.
outputs
RunOutput[]
default defaultRunOutputs
What it printed so far: { id, stream, text } with stream stdout or stderr.
figures
RunFigure[]
default defaultRunFigures
What it returned: { id, title, xTicks, yUnit, series, band?, summary }. A new one develops in the Figure tab.
status
"queued" | "running" | "done" | "error" | "timed-out" | "stopped"
default "done"
Where the call is.
error
RunError
default —
The failure: { line, name, message, trace }, line 1-based as a traceback counts.
elapsed
number
default 2380
Run time so far, in ms.
timeout
number
default 30000
The run's time limit in ms, shown when it is hit.
runtime
string
default "Gaugeworks runtime · py 3.12"
The machine that ran it.
count
number
default 7
The execution count shown as In [7]; a star while it runs.
tab / defaultTab
"output" | "figure" | "data"
default — / figure when a figure exists, else output
The open result tab, controlled or initial; a new figure selects Figure when uncontrolled.
onTabChange
(tab) => void
default —
Fires from the click or key that changed the tab.
onRerun
() => void
default —
Re-run was pressed, or Enter on the code.
onStop
() => void
default —
Stop was pressed while it ran.
onCopy
(code) => void
default —
Copy was pressed; the code is also written to the clipboard when it allows.
onOpenFigure
(figure) => void
default —
Open was pressed on a figure.
foldLines
number
default 4
Below 30rem the code folds to this many lines until opened.
codeTheme
"paper" | "ink" | "tint"
default "paper"
The code's surface: the page's paper, a deep ink panel in both themes, or a tint of the accent.
gutterStyle
"ticks" | "bar" | "dots"
default "ticks"
How executed lines are marked: a tick each, one bar filling down, or dots that fill.
accent
"cobalt" | "plum" | "mint" | "ink" | string
default "cobalt"
The cursor, keywords, ticks and the running state: a named pigment or any CSS colour.
disabled
boolean
default false
Read only: nothing can be re-run, stopped or copied.
className
string
default —
Classes for the cell; it caps at 36rem tall and its code and panels scroll inside.