mirror of
https://github.com/safishamsi/graphify.git
synced 2026-11-07 14:34:45 +00:00
fix merge-graphs to accept both edges and links key in graph.json (#738)
This commit is contained in:
1 parent
21e096fd88
commit
69d2cc84e2
1 file changed
+4
@@ -1720,6 +1720,10 @@ def main() -> None:
|
||||
print(f"error: not found: {gp}", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
data = json.loads(gp.read_text(encoding="utf-8"))
|
||||
# Normalize edges/links key before loading — graphify writes "links"
|
||||
# via node_link_data but older runs may have used "edges" (#738).
|
||||
if "links" not in data and "edges" in data:
|
||||
data = dict(data, links=data["edges"])
|
||||
try:
|
||||
G = _jg.node_link_graph(data, edges="links")
|
||||
except TypeError:
|
||||
|
||||
Reference in new issue
Block a user