Choreo.FSM.Render.DOT (Choreo v0.7.0)

Copy Markdown View Source

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
  • Choreo.Theme struct — full custom control

Summary

Functions

Renders an FSM to a DOT string.

Functions

to_dot(fsm, opts \\ [])

@spec to_dot(
  Choreo.FSM.t(),
  keyword()
) :: String.t()

Renders an FSM to a DOT string.

Options

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