Skip to content

IOP Level Diagram Layout

notebooks/diagrams/iop/core/iop_graphviz_level.py supports two action layouts through LevelVizConfig.action_layout.

Modes

  • horizontal keeps the original paper-preview layout with the state card on the left and the action cards in a right-hand column.
  • vertical moves the action cards below the state card so exported figures trade width for height.

Why

The level-action renderer is now the only maintained IOP Graphviz surface. It covers the useful export cases without a second state-diagram codepath to keep in sync, and the vertical mode remains the paper-friendly option when width is tighter than height.

Notebook Control

notebooks/diagrams/iop/graphviz_level_mo.py exposes this as an Action layout radio control so preview and export use the same configuration path.

Transition Preview Interaction

The level-action renderer uses fixed neato positions instead of dot, so its vertical mode is implemented as a top-to-bottom composition:

  • the state card stays on the top row
  • the action cards move to a single row below the state card
  • that action row is centered under the state card using dx_action
  • for multi-action views, the renderer inserts an invisible-point connector bus:
  • a short vertical trunk drops from the state card to y_action_bus
  • a visible horizontal bus runs across the action row
  • each action card gets a short vertical drop from that bus
  • if an action is centered directly under the state card, its drop reuses the bus root instead of creating a second tap at the same x position
  • single-action views still use a direct vertical edge because a bus adds no value

This avoids the large diagonal fan-out from the first vertical implementation, so the action row can sit closer to the state card without wasting space on long slanted arrows.

For the level-action marimo notebook, the default "Below state" layout uses a tighter bus-based placement (y_action_bus ~= -0.78, y_actions_top ~= -1.15, dx_action ~= 1.1) so the action cards sit closer to the state card while the connectors remain mostly orthogonal. The default export format for this notebook is now PNG, while the notebook preview remains inline SVG.