tl;dr
How to make Radial Tidy Tree work with JSON tree data from networkx's
node_link_data(G[, attrs])ortree_data(G, root[, attrs])?How to make D3 Cluster Dendrogram work with JSON tree data from networkx's
node_link_data(G[, attrs])ortree_data(G, root[, attrs])?How to make D3 Tidy Tree work with JSON tree data from networkx's
node_link_data(G[, attrs])ortree_data(G, root[, attrs])?
The examples don't use the JSON format, but a CSV-style input.
The long version
Hi,
I am using Python and networkx to generate graph data (which is mostly tree-like). I can export the data to JSON using the networkx functions mentioned on their page:
node_link_data(G[, attrs]): Return data in node-link format that is suitable for JSON serialization and use in Javascript documents.adjacency_data(G[, attrs]): Return data in adjacency format that is suitable for JSON serialization and use in Javascript documents.tree_data(G, root[, attrs]): Return data in tree format that is suitable for JSON serialization and use in Javascript documents.
The documentation of networkx explicitly mentions:
tree like in the d3.js example https://bl.ocks.org/mbostock/4063550
However, the linked example doesn't seem to make use of the JSON tree format, but uses a csv type of input. As my javascript-skilz are essentially zero, I do not understand how to make Mike Bostock's example work with the JSON data I have. Can you help?
Example JSON
{
"issueid": "3295658",
"issuetype": "Portfolio-Epic",
"status": "In Progress",
"pirank": 24,
"id": "ATROB-2523",
"children": [
{
"issueid": "3288189",
"issuetype": "Epic",
"status": "Implementation",
"id": "ATTDATA-233",
"children": [
{
"issueid": "3305730",
"issuetype": "Task",
"status": "Implementation",
"id": "ATTDATA-363"
},
{
"issueid": "3305723",
"issuetype": "Task",
"status": "Open",
"id": "ATTDATA-361"
},
{
"issueid": "3301728",
"issuetype": "Task",
"status": "Open",
"id": "ATTDATA-336"
},
{
"issueid": "3297381",
"issuetype": "Task",
"status": "Closed",
"id": "ATTDATA-300"
},
{
"issueid": "3295913",
"issuetype": "Task",
"status": "Review",
"id": "ATTDATA-290"
},
{
"issueid": "3295893",
"issuetype": "Task",
"status": "Open",
"id": "ATTDATA-289"
},
{
"issueid": "3291658",
"issuetype": "Task",
"status": "Closed",
"id": "ATTDATA-256"
},
{
"issueid": "3291653",
"issuetype": "Task",
"status": "Closed",
"id": "ATTDATA-255"
},
{
"issueid": "3291530",
"issuetype": "Task",
"status": "Open",
"id": "ATTDATA-253"
},
{
"issueid": "3290232",
"issuetype": "Task",
"status": "Open",
"id": "ATTDATA-247"
},
{
"issueid": "3287061",
"issuetype": "Task",
"status": "Resolved",
"id": "ATTDATA-226"
}
]
},
{
"issueid": "3300899",
"issuetype": "Request",
"status": "REJECTED",
"id": "ATI-1478"
}
]
}