Skip to content

Commit f9746c1

Browse files
committed
chore: Add a (internal) method to get a sm graph sm._graph()
1 parent 233d25f commit f9746c1

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

statemachine/statemachine.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,11 @@ def _repr_html_(self):
9898
return '<div class="statemachine">{}</div>'.format(self._repr_svg_())
9999

100100
def _repr_svg_(self):
101-
from .contrib.diagram import DotGraphMachine
101+
return self._graph().create_svg().decode()
102102

103-
return DotGraphMachine(self).get_graph().create_svg().decode()
103+
def _graph(self):
104+
from .contrib.diagram import DotGraphMachine
105+
return DotGraphMachine(self).get_graph()
104106

105107
@property
106108
def current_state_value(self):

0 commit comments

Comments
 (0)