forked from enviPath/enviPy
clean up d3_json
This commit is contained in:
@ -1573,14 +1573,12 @@ class Pathway(EnviPathModel, AliasMixin, ScenarioMixin):
|
|||||||
while len(queue):
|
while len(queue):
|
||||||
current = queue.pop()
|
current = queue.pop()
|
||||||
processed.add(current)
|
processed.add(current)
|
||||||
|
|
||||||
nodes.append(current.d3_json())
|
nodes.append(current.d3_json())
|
||||||
|
|
||||||
for e in self.edges:
|
for e in self.edges.filter(start_nodes=current).distinct():
|
||||||
if current in e.start_nodes.all():
|
for prod in e.end_nodes.all():
|
||||||
for prod in e.end_nodes.all():
|
if prod not in queue and prod not in processed:
|
||||||
if prod not in queue and prod not in processed:
|
queue.append(prod)
|
||||||
queue.append(prod)
|
|
||||||
|
|
||||||
# We shouldn't lose or make up nodes...
|
# We shouldn't lose or make up nodes...
|
||||||
assert len(nodes) == len(self.nodes)
|
assert len(nodes) == len(self.nodes)
|
||||||
|
|||||||
Reference in New Issue
Block a user