I am trying to create a state machine diagram using graphviz and I am having trouble making it display nicely.
This is the diagram described in dot language:
digraph finite_state_machine {
node [shape = point];
PWRON
node [shape=circle];
PWROFF [fontsize=10]
PWRON -> BOOT [label="start_boot_timer"]
BOOT -> HOME [label="boot_timer_expires"]
HOME -> HOME [label="home to home 1"]
HOME -> HOME [label="home to home 2"]
HOME -> HOME [label="home to home 3"]
HOME -> BLEADV [label="short_button_press"]
BLEADV -> BLECON [label="ble_conn_event"]
BLECON -> HOME [label="ble_conn_close"]
HOME -> PWROFF [label="power off"]
}
The drawn diagram looks like:
I am a complete newbie in dot/graphviz, can you help me present it better?
The main problems currently are:
* the self loops from home to home all overlapping
* the placement of BLEADV and BLECON is not very good (lesser priority)
To improve the loops on HOME, you may use compass points:
Not sure what you'd like to improve about the placement of the nodes, but if you'd like to have a straight vertical edge between
HOME
andPWROFF
, just assign them to the same group (before defining edges involving them):All together: