By Miguel Vaz, July 2014
This is inspired by the work from
Jake Vanderplas:
Jonathan Frederic
http://nbviewer.ipython.org/github/jdfreder/ipython-d3/tree/master/
as well as
http://stackoverflow.com/questions/9539294/adding-new-nodes-to-force-directed-layout?rq=1
It requires a Python kernel to run; that is, if you're looking at this on nbviewer it won't work!
TODO:
In [5]:
from ipywidgets import widgets
from IPython.display import display
from ipygraphwidgets.widgetforcelayout import GraphWidget
In [ ]:
!ls
In [2]:
import networkx as nx
mygraph = nx.random_graphs.binomial_graph(20, 0.15, directed=False)
In [3]:
g = GraphWidget(width=500, height=500, charge=-250)
display(g)
In [4]:
g.set_graph(mygraph)