TLX.Emitter.Dot (TLX v0.5.2)

Copy Markdown

Emits a GraphViz DOT digraph from a compiled TLX.Spec module.

Visualizes the state machine as a directed graph with states as nodes and actions as labeled edges. Works best for specs with a clear atom-valued state variable.

Usage

TLX.Emitter.Dot.emit(MySpec)
TLX.Emitter.Dot.emit(MySpec, state_var: :status)

How States Are Detected

The emitter picks the "state variable" — the variable whose values are all atoms. If multiple candidates exist, pass state_var: :name to select one explicitly.

Source states are extracted from guard expressions (guard(e(state == :x))). Target states are extracted from next :state, :y transitions.

Summary

Functions

Generate a DOT digraph string from a compiled spec module.

Functions

emit(module, opts \\ [])

Generate a DOT digraph string from a compiled spec module.

Options:

  • :state_var — name of the state variable (auto-detected if omitted)