Can Graphviz render State Transition Diagrams exactly like this?
http://upload.wikimedia.org/wikipedia/commons/c/cf/Finite_state_machine_example_with_comments.svg
=== Edit ===
Marapet's code comes really close (see: http://i.imgur.com/ElzSl.png ). I am accepting his answer.
I'd create nodes for the transition conditions :
digraph g{
Opened[label="1\nOpened\nE: open door"];
Closed[label="2\nClosed\nE: closed door"];
node[shape=plaintext];
Opened -> close_door[arrowhead=none];
close_door -> Closed;
Opened -> open_door[dir=back];
open_door -> Closed[arrowhead=none];
}
I would use label on the arrow instead of creating a node for the close_door:
Opened -> Closed [label=close_door];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With