Skip to content

xkr47/rust-fsm-graph

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rust-fsm-graph

Statemachine graph generator for state machines defined using the DSL of the rust-fsm-dsl crate.

Howto

Assuming you have a rust source code file containing the example state machine from the rust-fsm documentation in a file called example.rs, run:

$ cargo run example.rs
Wrote CircuitBreaker.dot

This produces a graphviz .dot file which can be rendered to images in a plethora of formats - png, svg, ps, pdf etc. In this example, it produces a CircuitBreaker.dot file. The file is named is based on the name of the state machine in the source code.

Then run the dot command from the graphviz package:

$ dot -Tpng CircuitBreaker.dot > CircuitBreaker.png

.. which generates the following image:

statemachine diagram

N.B. The different line styles do not indicate anything. They just aid the reader to visually track different lines along state graphs, especially bigger ones.

Ideas

  • allow hiding edges with same start & end