Finite state machines, rendered straight from Ruby.

Graphomaton validates, analyzes, lays out, and exports automata without making you leave your codebase.

Release
v1.2.0
Ruby
3.2+
License
MIT
runtime.ymldiagram.svg
A runtime finite state machine Idle transitions to running, then to done or failed, with recovery returning to idle. startfinisherrorrecover idle running done failed
A readable SVG generated from the same model you validate and analyze.

One model. Eight useful destinations.

Keep the source of truth in Ruby, JSON, or YAML. Pick the output that fits the next place your diagram needs to live.

Graphomaton
model
  • SVG
  • PNG
  • PDF
  • WebP
  • Mermaid
  • DOT
  • PlantUML
  • HTML

The diagram is an output. The model does more.

Validate before export

Catch broken references and hierarchy errors, or fail CI when diagnostics include a warning.

Inspect real behavior

Find reachable, dead, trap, and strongly connected states from the same automaton.

Choose the right layout

Use layered, force, manual, or Graphviz layouts with themes and semantic diagnostics.

From install to SVG in a few lines.

Add the gem, define the states and transitions, then save the format you need.

gem install graphomaton
Read the full documentation
quick_start.rb
require 'graphomaton'

machine = Graphomaton.new
machine.add_state('idle')
machine.add_state('done')
machine.set_initial('idle')
machine.add_final('done')
machine.add_transition('idle', 'done', 'finish')
machine.save_svg('diagram.svg')

Keep the logic in Ruby. Put the diagram everywhere.

Graphomaton is open source, MIT licensed, and ready for the command line or your application.

Get Graphomaton on RubyGems