Skip to content

Playback, sharing and the step list

Everything a reader does with a scenario happens in the player under the diagram and in the step list below it.

Everything in one picture. Letters on the edges match the interfaces table underneath.

Scenario

The shopper pays. The order is stored first, charged second, and announced to the rest of the system last.

HTTP request / responseData accessPersistent channel (websocket, gRPC)Queue / brokerDashed: planned
Loading diagram…
ISubmit
1
Shopper browser→order-servicevia CDN, API gatewayPOST /orders

The gateway has already checked the token, so the order service trusts the user id header.

2
order-service→PostgreSQLINSERT order (pending)
IICharge
3
order-service→Stripecreate payment intent
4
Stripeauthorise card
5
Stripe→order-servicesucceeded
IIIFinish
6
order-service→PostgreSQLmark paid
7
order-service→RabbitMQorder.created
8
order-service→Shopper browservia API gateway, CDN201 Created
9
RabbitMQ→notification-workerorder.createdplanned

Planned. Confirmation emails are not sent yet.

KeyFrom → ToKindAuthWhat travels
AShopper browser → CDNhttp—HTTPS
BCDN → API gatewayhttp——
CAPI gateway → Keycloakdataclient credentialssigning keys
DAPI gateway → catalog-servicehttp—/products
EAPI gateway → cart-servicehttp—/cart
FAPI gateway → order-servicehttp—/orders
Gcatalog-service → Redisdata—cache
Hcatalog-service → PostgreSQLdata——
Icart-service → Redisdata——
Jorder-service → PostgreSQLdata——
Korder-service → StripechannelAPI keypayment intent
Lorder-service → RabbitMQqueue—order.created
MRabbitMQ → notification-workerqueue——
Control What it does
Play, Pause, Resume, Replay Runs the scenario. The button’s label says what it will do next.
Previous step, Next step Moves one step at a time. If a step is half played, Next finishes it first.
Scrubber Drag to any moment. Playback pauses while you scrub.
Speed 0.5×, 1× or 2×.
Flow, Sequence, Story Switches how the scenario is drawn. See story and sequence.

The player also shows where you are: step 3/9 · 0:04.

Every step is listed under the player, grouped by phase. The step in progress is highlighted, finished steps are marked, and notes appear under their step. A multi-hop step names the nodes it passes through (“via CDN, API gateway”).

Click a step to play it. The path already travelled stays lit, so a reader can jump to the middle of a story and still see how it got there. The list is also keyboard-friendly: Tab to a step and press Enter or Space.

On a large diagram the whole picture is small, so the camera can follow the action. A Follow button appears while a scenario is selected. Following starts on automatically when the diagram is wider than 1500 px or taller than 950 px, and stops as soon as the reader pans or zooms. Press it again to bring it back.

The address bar follows the scenario and step, so readers can share exactly what they are looking at:

https://example.com/examples/checkout/#checkout=place-order.4

The format is #<diagram>=<scenario>[.<step>], where the step is the number shown in the step list. A page with several diagrams joins them with &:

#checkout=place-order.4&payments=pay.2

Opening such a link selects the scenario, switches to its view, and shows the step already played, paused, so the reader decides when to continue.

A scenario a reader clicks starts playing. One that a page selects with scenario="..." waits, unless the page also passes autoplay:

<Diagram name="checkout" scenario="place-order" autoplay />

Readers who ask their system for reduced motion are never autoplayed, and clicking a scenario selects it without playing. They can still press Play, step through, or scrub.

A scenario compiles to a timeline: for every step, when it starts and ends, and for every hop, when the packet is on which edge. frameAt(t) is a pure function that turns a time into a picture: which packets are where, which nodes are lit. The player is only a clock that advances t. That is why scrubbing, stepping, deep links and the tests are all exact. See how it works inside.