Thought I'd share.
I wanted to make visual modifications to the graphs, this is a working example of what I came up with. Probably this can be added to an example.
def create_graph():
class Model:
pass
m = Model()
CustomGraphMachine.machine_attributes['ratio'] = '0.471'
machine = CustomGraphMachine(m, states=session_states, transitions=session_trans, initial='INITIAL',
show_conditions=True, show_state_attributes=True)
machine.style_attributes['node']['fail'] = {'fillcolor': 'brown1'}
machine.style_attributes['node']['transient'] = {'fillcolor': 'gold'}
machine.style_attributes['node']['target'] = {'fillcolor': 'chartreuse'}
for s in transient_states:
machine.model_graphs[m].set_node_style(s['name'], 'transient')
for s in target_states:
machine.model_graphs[m].set_node_style(s['name'], 'target')
for s in fail_states:
machine.model_graphs[m].set_node_style(s['name'], 'fail')
# draw the whole graph ...
m.get_graph().draw('state_diagram.png', prog='dot')
it surely can. I added it to the example GraphMachine notebook here (unfortunately, anchor links don't work on Github). Thanks for the input. Much appreciated!
Thought I'd share. I wanted to make visual modifications to the graphs, this is a working example of what I came up with. Probably this can be added to an example.