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
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
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
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
def _n2c(n): qn = str(n._qname) return Cluster(qn, id=qn, label=str(n._name))