Metakit / @doeixd/metakit/machine

diagram

function · packages/metakit/src/machinePhaseGraph.ts:100

function diagram<State, Transitions extends Readonly<Record<string, unknown>>>(
  machine: Machine<State, Transitions>,
): string

The state diagram of machine, as Mermaid stateDiagram-v2 text: its start (where it has one), every phase, and one line per edge labelled by its message and, for an alternative of choose, its condition. A transition not built with from moves no phase and draws nothing.