JSON¶
JSON data¶
Generate and parse JSON serializable data for NetworkX graphs.
These formats are suitable for use with the d3.js examples https://d3js.org/
The three formats that you can generate with NetworkX are:
- node-link like in the d3.js example https://bl.ocks.org/mbostock/4062045
- tree like in the d3.js example https://bl.ocks.org/mbostock/4063550
- adjacency like in the d3.js example https://bost.ocks.org/mike/miserables/
node_link_data (G[, attrs]) |
Return data in node-link format that is suitable for JSON serialization and use in Javascript documents. |
node_link_graph (data[, directed, …]) |
Return graph from node-link data format. |
adjacency_data (G[, attrs]) |
Return data in adjacency format that is suitable for JSON serialization and use in Javascript documents. |
adjacency_graph (data[, directed, …]) |
Return graph from adjacency data format. |
tree_data (G, root[, attrs]) |
Return data in tree format that is suitable for JSON serialization and use in Javascript documents. |
tree_graph (data[, attrs]) |
Return graph from tree data format. |
jit_data (G[, indent]) |
Return data in JIT JSON format. |
jit_graph (data) |
Read a graph from JIT JSON. |