(self, title=None)
return self.fsm_graph
Generate a DOT graph with pygraphviz, returns an AGraph object
Generate a DOT graph with pygraphviz, returns an AGraph object
Generate a DOT graph with pygraphviz returns an AGraph object
def generate(self, title=None):
        """ Generate a DOT graph with pygraphviz, returns an AGraph object """
        if not pgv:  # pragma: no cover
            raise Exception('AGraph diagram requires pygraphviz')

        title = '' if not title else title

        self.fsm_graph = pgv.AGraph(label=title, **self.machine.machine_attributes)
        self.fsm_graph.node_attr.update(self.machine.style_attributes['node']['default'])
        self.fsm_graph.edge_attr.update(self.machine.style_attributes['edge']['default'])
        states, transitions = self._get_elements()
        self._add_nodes(states, self.fsm_graph)
        self._add_edges(transitions, self.fsm_graph)
        setattr(self.fsm_graph, 'style_attributes', self.machine.style_attributes)

        return self.fsm_graph
def generate ( self , title = None ) : if not pgv : # pragma: no cover raise Exception ( 'AGraph diagram requires pygraphviz' ) title = '' if not title else title self . fsm_graph = pgv . AGraph ( label = title , * * self . machine . machine_attributes ) self . fsm_graph . node_attr . update ( self . machine . style_attributes [ 'node' ] [ 'default' ] ) self . fsm_graph . edge_attr . update ( self . machine . style_attributes [ 'edge' ] [ 'default' ] ) states , transitions = self . _get_elements ( ) self . _add_nodes ( states , self . fsm_graph ) self . _add_edges ( transitions , self . fsm_graph ) setattr ( self . fsm_graph , 'style_attributes' , self . machine . style_attributes ) return self . fsm_graph