如何通过holoviz和NetworkX渲染GraphViz Dot文件? [英] How to render a GraphViz Dot file via holoviz and NetworkX?

查看:86
本文介绍了如何通过holoviz和NetworkX渲染GraphViz Dot文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我查看了

对于小文件,可能会有类似的情况:

解决方案

这是怎么回事:

 <代码>将hvplot.networkx导入为hvnx将networkx导入为nx将hloviews导入为hv#读取文件G = nx.drawing.nx_agraph.read_dot("./figure.dot")#本教程的其余部分...春天= hvnx.draw(G,with_labels = True)#显示情节春天 

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

Something similar was expected for the small file:

解决方案

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

这篇关于如何通过holoviz和NetworkX渲染GraphViz Dot文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆