-
-
Notifications
You must be signed in to change notification settings - Fork 517
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add examples of Graph/Network rendering #89
Labels
Comments
nxpd seems like a pretty niche library to consider here. I'd just draw the networkx graph using pygraphviz:
|
A.draw? |
Fixed. |
philippjfr
changed the title
Graph/network plotting support
Add examples of Graph/Network rendering
Jul 25, 2019
Using Panel 0.12.1 The above example does not work for me. The output of This works from graphviz import Graph
import panel as pn
import networkx as nx
graphviz_graph = Graph('hello', format='svg')
graphviz_graph.edge('Hello', 'World')
graph = nx.complete_graph(5)
pyviz_graph = nx.nx_agraph.to_agraph(graph)
def clean_svg(svg):
svg.find("<svg")
svg_start = svg.find("<svg")
return svg[svg_start:]
networkx_svg = clean_svg(pyviz_graph.draw(prog='dot', format='svg').decode('utf-8'))
pn.Row(
graphviz_graph,
"Text",
networkx_svg,
"Text").servable() |
#2732 Should close this one. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
As of PRs #85 and #88, dot-based graph plots are now supported in Panel, either as SVG representations of GraphViz Graph/DiGraph objects, or as PNG representations of NetworkX objects created by
nxpd.draw()
:Remaining issues:
The text was updated successfully, but these errors were encountered: