DOT (Graphviz) rendering for Choreo.FSM state-machine diagrams.
Produces classic state-machine visualisation:
- Normal states — filled circles
- Initial states — filled circles with a black entry-point dot
- Final states — double circles
- Transitions — labeled arrows
- Layout is left-to-right by default
Themes
:default— light grey states, dark text, left-to-right:dark— dark background, neon accents:minimal,:warm,:forest,:ocean— additional built-in palettesChoreo.Themestruct — full custom control
Summary
Functions
Renders an FSM to a DOT string.
Functions
@spec to_dot(Choreo.FSM.t(), keyword()) :: String.t()
Renders an FSM to a DOT string.
Options
:theme—:default,:dark,:minimal,:warm,:forest,:ocean, or aChoreo.Themestruct:highlighted_nodes— list of state IDs to highlight:highlighted_edges— list of edge IDs or{from, to}tuples to highlight- Any other option accepted by
Yog.Multi.DOT.to_dot/2, such as:rankdir
Examples
iex> fsm = Choreo.FSM.new() |> Choreo.FSM.add_state(:a)
iex> dot = Choreo.FSM.Render.DOT.to_dot(fsm)
iex> String.contains?(dot, "digraph")
true
iex> String.contains?(dot, "rankdir=LR")
true
iex> String.contains?(dot, "a")
true