(G, path)
| 27 | |
| 28 | |
| 29 | def _graph_to_json(G, path): |
| 30 | from networkx.readwrite import json_graph as jg |
| 31 | try: |
| 32 | data = jg.node_link_data(G, edges="links") |
| 33 | except TypeError: |
| 34 | data = jg.node_link_data(G) |
| 35 | path.write_text(json.dumps(data), encoding="utf-8") |
| 36 | |
| 37 | |
| 38 | # ── build.py helpers ────────────────────────────────────────────────────────── |
no outgoing calls
no test coverage detected