177
177
if node in distances:
178
label.append('%d' % distances[node])
179
return Node("n%d" % num, color=color, label=label, rev_id=node,
178
label.append('d%d' % distances[node])
179
return Node("n%d" % num, color=color, label="\\n".join(label),
180
rev_id=node, cluster=cluster)
183
183
for num,node in enumerate(descendants):
184
184
dot_nodes[node] = dot_node(node, num)
186
186
node_relations = []
187
for ancestor, children in ancestors.iteritems():
188
if ancestor not in dot_nodes:
189
dot_nodes[ancestor] = dot_node(node, 100000)
190
for child in children:
191
if None in (dot_nodes[ancestor], dot_nodes[child]):
192
print (dot_nodes[ancestor], dot_nodes[child])
193
node_relations.append((dot_nodes[ancestor], dot_nodes[child]))
187
for node, parents in ancestors.iteritems():
188
if node not in dot_nodes:
189
dot_nodes[node] = dot_node(node, 100000)
190
for parent in parents:
191
node_relations.append((dot_nodes[parent], dot_nodes[node]))
194
192
return node_relations