I've been experimenting with the HierarchicalGraphMachine class to help visualise the machine structures as I edit them.
from transitions.extensions import HierarchicalGraphMachine as Machine
count_states = ['1', '2', '3', 'done']
count_trans = [
['increase', '1', '2'],
['increase', '2', '3'],
['decrease', '3', '2'],
['decrease', '2', '1'],
['done', '3', 'done'],
['reset', '*', '1']
]
counter = Machine(states=count_states, transitions=count_trans, initial='1')
states = ['waiting', 'collecting', {'name': 'counting', 'children': counter, 'initial': '1'}]
transitions = [
['collect', '*', 'collecting'],
['wait', '*', 'waiting'],
['count', 'collecting', 'counting']
]
collector = Machine(states=states, transitions=transitions, initial='waiting')
collector.get_graph(show_roi=False).draw('count1.png', prog='dot')
This generates the expected graphic showing both the parent and nested states in full (I'm not yet authorised to upload the graphics). Is there a way to generate a the full parent state machine graphic without expanding the nested states? For example reducing the nested states to an empty box.
I've tried "show_roi=True", but this only shows the current transition event, and removes all other states.