Skip to content
This repository has been archived by the owner on Feb 23, 2022. It is now read-only.

Commit

Permalink
Merge branch 'master' into waxlamp/apidocs-link
Browse files Browse the repository at this point in the history
  • Loading branch information
waxlamp committed Feb 21, 2020
2 parents c9997f9 + 2bde3a1 commit 164410f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions multinet/downloaders/d3_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@

def node_generator(loaded_graph: Graph) -> Generator[str, None, None]:
"""Generate the JSON list of nodes."""

comma = ""
node_tables = loaded_graph.vertex_collections()
for node_table in node_tables:
table_nodes = loaded_graph.vertex_collection(node_table).all()

comma = ""
for node in table_nodes:
node["id"] = node["_key"]
del node["_key"]
Expand All @@ -41,10 +42,10 @@ def link_generator(loaded_graph: Graph) -> Generator[str, None, None]:
table_nodes_pattern = re.compile(r"^([^\d_]\w+)_nodes(/.+)")
edge_tables = [edef["edge_collection"] for edef in loaded_graph.edge_definitions()]

comma = ""
for edge_table in edge_tables:
edges = loaded_graph.edge_collection(edge_table).all()

comma = ""
for edge in edges:
source = edge["_from"]
target = edge["_to"]
Expand Down

0 comments on commit 164410f

Please sign in to comment.