Skip to content

Commit

Permalink
Merge pull request chebee7i#6 from rainwoodman/master
Browse files Browse the repository at this point in the history
python notebook support via from nxpd import ipythonsupport
  • Loading branch information
chebee7i committed Apr 25, 2015
2 parents c962ee5 + 80ea1b0 commit 4db9420
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions nxpd/ipythonsupport.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from nxpd.nx_pydot import to_pydot
def install_repr_png():
import networkx as nx
import StringIO
def getsvg(graph):
G2 = to_pydot(graph)
buf = StringIO.StringIO()
G2.write(buf, prog='dot', format='png')
return buf.getvalue()
nx.Graph._repr_png_ = getsvg

install_repr_png()

0 comments on commit 4db9420

Please sign in to comment.