Esempio n. 1
0
 def make_subgraph(path, parent_graph):
     subgraph = Cluster(path,
                        label=split(path)[1],
                        style='rounded, filled',
                        fillcolor='#77777744')
     parent_graph.add_subgraph(subgraph)
     return subgraph
Esempio n. 2
0
 def __missing__(self, path):
     parent, label = split(path)
     subgraph = Cluster(path,
                        label=label,
                        style='rounded, filled',
                        fillcolor='#77777744')
     self[parent].add_subgraph(subgraph)
     return subgraph
Esempio n. 3
0
 def bipartite_cluster(cls, cluster_name, cluster_label, cluster_nodes,
                       cluster_nlabels, node_color):
     cluster = Cluster(cluster_name)
     cluster.set_label(cluster_label)
     cluster.set_fillcolor('lightgrey')
     cluster.set_style('filled')
     cluster.set_rank('same')
     for n, label in zip(cluster_nodes, cluster_nlabels):
         cluster.add_node(cls.bipartite_node(n, label, node_color))
     for first, second in zip(cluster_nodes, cluster_nodes[1:]):
         cluster.add_edge(cls.bipartite_edge(first, second))
     return cluster
Esempio n. 4
0
 def __missing__(self, path):
     *parent, label = path
     subgraph = Cluster(sep.join(path), label=label, style='rounded, filled', fillcolor='#77777744')
     self[tuple(parent)].add_subgraph(subgraph)
     return subgraph
Esempio n. 5
0
def _n2c(n):
    qn = str(n._qname)
    return Cluster(qn, id=qn, label=str(n._name))