MachineryDisplay
Turns Machinery state machines into easy-to-digest graphics from an easy-to-call mix task.
As simple as $ mix machinery_display <project_name>
Example
defmodule Example.SimpleTestStateMachine do
use Machinery,
field: :state,
states: ["initial", "middle", "complete"],
transitions: %{
"initial" => ["middle", "complete"],
"middle" => ["complete"],
"complete" => "initial"
}
endTurns into
System-level Dependencies
For generating Graphviz/Dot diagrams, you will need a Graphviz compiler. Most major operating systems have one available in their package repo.
Ubuntu
$ apt install graphviz
Fedora
$ yum install graphviz
Mac
$ brew install graphviz
Installation
The package can be installed by adding machinery_display to your list of dependencies in mix.exs:
def deps do
[
{:machinery_display, "~> 0.2.0"}
]
end