JSON#

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_data(G[, attrs])

Returns data in node-link format that is suitable for JSON serialization and use in Javascript documents.

node_link_graph(data[, directed, ...])

Returns graph from node-link data format.

adjacency_data(G[, attrs])

Returns data in adjacency format that is suitable for JSON serialization and use in Javascript documents.

adjacency_graph(data[, directed, ...])

Returns graph from adjacency data format.

cytoscape_data(G[, name, ident])

Returns data in Cytoscape JSON format (cyjs).

cytoscape_graph(data[, name, ident])

Create a NetworkX graph from a dictionary in cytoscape JSON format.

tree_data(G, root[, ident, children])

Returns data in tree format that is suitable for JSON serialization and use in Javascript documents.

tree_graph(data[, ident, children])

Returns graph from tree data format.