Replay widget¶
Requires the replay extra (pip install "longeron[replay]").
The timeline recorders this widget animates live in longeron.replay.
The replay widget: animate a recorded Timeline over its baked diagram.
replay_widget() simulates an element (or takes a prebuilt
Timeline), bakes the matching diagram to SVG
(longeron.render), and animates the run over it in the notebook
front-end (anywidget, optional – install with pip install
"longeron[replay]"): active states light up green, fired transitions
pulse orange, with play/pause, speed, and scrubbing controls, plus a
scalar-env readout that follows the playhead. Pure event cascades (no
clock advance) replay in step mode, scrubbing over the step index
instead of sim time.
The timeline recorders themselves (record_timeline(),
record_action_timeline()) live in
longeron.replay: recording is simulation, not presentation, and
needs no widget toolkit.
- longeron.widgets.replay.ReplayKind¶
which view and recorder
replay_widget()uses: the state diagram withrecord_timeline(), or the action diagram withrecord_action_timeline()alias of
Literal[‘state’, ‘action’]
- longeron.widgets.replay.replay_widget(interpreter, element, events=None, *, inputs=None, width_px=760, kind=None, timeline=None)[source]¶
Simulate
elementand replay it over its diagram.kindpicks the view and recorder:"state"(record_timeline()over the state diagram) or"action"(record_action_timeline()over the action diagram). The default (None) auto-detects: elements whosekindis"action"replay as actions, everything else as a state machine.timelineskips the recording and replays a PREBUILTTimelineinstead, so one recording can feed this widget, the mission globe, and the time seam’s scrubber (seelongeron.widgets.time); it excludesevents/inputs. The widget’s bidirectionaltimetrait is its seam surface: a kernel-side write seeks the playhead (stopping any front-end playback first), and the front-end reports the playhead at ~4 Hz while playing –longeron.widgets.link_time()subscribes it to a shared clock.Needs the
replayextra (anywidget) plus the diagram toolchain (vendored ipyelk and anodeexecutable, as forrender.to_svg).- Return type:
AnyWidget