43 self, graph_type=
'digraph', rank=
'same',
44 simplify=
True, rankdir=
'TB', ranksep=0.2, compound=
True):
45 graph = pygraphviz.AGraph(
46 directed=(graph_type ==
'digraph'), ranksep=ranksep, rankdir=rankdir,
47 rank=rank, compound=
True, simplify=simplify)
59 Create a node item for this factory, adds it to the graph. 61 Node name can vary from label but must always be same for the same node label 63 if nodename
is None or nodename ==
'':
64 raise ValueError(
'Empty Node name')
69 if tooltip
is not None:
70 kwargs[
'tooltip'] = tooltip
72 kwargs[
'color'] = color
74 graph.add_node(nodename, label=str(nodelabel), shape=shape, url=url, **kwargs)
88 Create a cluster subgraph item for this factory, adds it to the graph. 90 Cluster name can vary from label but must always be same for the same node label. 91 Most layouters require cluster names to start with cluster. 93 if subgraphlabel
is None or subgraphlabel ==
'':
94 raise ValueError(
'Empty subgraph label')
96 sg = graph.add_subgraph(
97 name=
'cluster_%s' % subgraphlabel, ranksep=ranksep, rankdir=rankdir,
98 rank=rank, compound=compound, label=str(subgraphlabel), style=style, color=color)
103 self, graph, nodename1, nodename2, label=
None, url=
None, simplify=
True, style=
None):
104 kwargs = {
'url': url}
105 if label
is not None:
106 kwargs[
'label'] = label
107 if style
is not None:
108 kwargs[
'style'] = style
109 graph.add_edge(nodename1, nodename2, **kwargs)
114 return graph.string().replace(
'\\\n',
'')
def add_edge_to_graph(self, graph, nodename1, nodename2, label=None, url=None, simplify=True, style=None)
def create_dot(self, graph)
def add_node_to_graph(self, graph, nodename, nodelabel=None, shape='box', color=None, url=None, tooltip=None)
def get_graph(self, graph_type='digraph', rank='same', simplify=True, rankdir='TB', ranksep=0.2, compound=True)
def add_subgraph_to_graph(self, graph, subgraphlabel, rank='same', simplify=True, rankdir='TB', ranksep=0.2, compound=True, color=None, shape='box', style='bold')