I have a graph that I would like to visualize using d3.js. Specifically, I have an adjacency matrix that looks as follows (selection of data, not the full set):
Node 1 Node 2 Weight
A B 1.0
A C 1.0
A D 1.5
B D 1.0
...
I would like to be able to use a Force-Directed Graph to display my network, specifically.
I know how to create a NetworkX graph, but I would like to be able to try this in d3.js, as I want to be able to add mouseover displays of node properties later on, which I think is possible using d3 but not possible using matplotlib.
I have tried using d3py, but I can't even get the basic example to work, and I read that the NetworkX example is broken and the repo hasn't been updated for a while. Does anybody else know if there's something else I could try, or if someone could point me in a first step direction?
There is a NetworkX example here that uses d3.js force layout :http://networkx.github.io/documentation/latest/examples/javascript/force.html
It just writes a JSON format graph object from networkx that d3.js can load in a web browser to get an interactive drawing. That code is a little fancier since it will also do the web browser part for you.
All of the code (including the d3 parts) you need to run it are in the repository https://github.com/networkx/networkx/tree/master/examples/javascript
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments