3

So I look onto docs and see that they use Graphviz, yet do not use any files... And I have a 4mil+ .dot (70mb) graph file I want to render. How to open and render GraphViz Dot file via holoviz and NetworkX?

##Update: Tested @GijsWobben sample: shows nada on even small 6kb file enter image description here

Something similar was expected for the small file: enter image description here

DuckQueen
  • 772
  • 10
  • 62
  • 134
  • I would guess you'd read the file using something from https://networkx.org/documentation/stable/reference/readwrite/index.html and then follow the docs you linked once you've got your graph as a NetworkX object. – James A. Bednar Dec 09 '20 at 22:38

1 Answers1

1

How about this:

import hvplot.networkx as hvnx

import networkx as nx
import holoviews as hv

# Read the file
G = nx.drawing.nx_agraph.read_dot("./figure.dot")

# Rest of the tutorial...
spring = hvnx.draw(G, with_labels=True)

# Show the plot
spring
Gijs Wobben
  • 1,974
  • 1
  • 10
  • 13
  • Dear Gijs: Seems to not draw anything at all silently, updated my question with screenshots. – DuckQueen Dec 19 '20 at 12:28
  • The example says "rest of tutorial ...". This code assigns a plot to `spring`. To show the plot you'll have to state the `spring` variable at the end of a cell (just like in the tutorial) – Gijs Wobben Dec 19 '20 at 13:16
  • Fine, I've updated my answer. But something not showing in Jupiter or whatever environment you are using is not related to the code. – Gijs Wobben Dec 21 '20 at 08:40