如何用Graphviz输出Plone庞大的依赖关系图?
我编写了一个工具来查找 Python 项目背后的依赖关系。这是暴食。我在 Plone 上运行它,结果令人印象深刻。我用 Networkx 输出图表,它看起来像这样:
(来源:googlecode.com)
(哎呀看起来就像粘粘世界!)
一团糟!我没有使用 Networkx 处理布局。这就是为什么它是一团糟。该工具可以输出Graphviz格式的文件。我尝试用点命令渲染图表。我使用这样的命令:
dot -Kdot -Tpng -oplone plone.dot
长时间运行后我得到了一个巨大的图像,但结果似乎是错误的。我在结果图像上看不到任何东西。看起来就像一张白纸,上面什么也没有。怎么了?图表太大而无法渲染吗?渲染这么大的复杂图应该怎么做?
我可以从其他小图表中得到正确的结果,如下所示:
googlecode.com)
(来源: 的 TurboGears2 的图表
可以正确渲染更大的图表,让我们看看我认为 看到像 Plone 这样的怪物项目的依赖关系应该很有趣。对于研究也很有用。不幸的是,我无法正确输出图表。冷啊有人帮帮我吗?谢谢。
这是Plone的Graphviz格式文件: plone.dot
I wrote a tool for find dependency relationships behind a Python project. It is Gluttony. I run it on Plone, the result is impressive. I output the diagram with Networkx, and it looks like this:
(source: googlecode.com)
(Gee! It looks like World of Goo!)
A mess! I didn't handle layout with Networkx. That's why it is a mess. The tool can output Graphviz format file. I tried to render the diagram with dot command. I use command like this:
dot -Kdot -Tpng -oplone plone.dot
I got a huge image after long running, but the result seems wrong. I can't see anything on the result image. It looks like a white paper, nothing on it. What's wrong? Is the diagram too big to render? What should I do for rendering such a huge complex diagram?
I can get correct result from other small diagram, like this one:
(source: googlecode.com)
Even a much bigger diagram can be rendered correctly, let's see the diagram of TurboGears2
I think it should be fun to see the dependency relationship of such monster project like Plone. Also it is useful for researching. Unfortunately, I can't output diagram correctly. Cold someone help me out? Thanks.
Here is the Graphviz format file of Plone:
plone.dot
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
命令
dot plone.dot -Tsvg > plone.svg
渲染此可缩放矢量图形:alt text http://dl .dropbox.com/u/138632/plone.svg
我可以打开 .svg 文件 在 Inkscape 中精细并放大至 100%。
The command
dot plone.dot -Tsvg > plone.svg
renders this scalable vecor graphic:alt text http://dl.dropbox.com/u/138632/plone.svg
I can open the .svg file fine in Inkscape and zoom in till 100%.
如果您可以生成图像:Graphviz 往往会创建巨大文件。放大。
对我来说,graphviz 经常会在你的文件上崩溃。它似乎每侧最大为 32 kPixels,并且您的文件会更大,从而导致整数溢出。
尝试将文件拆分为多个子图(使用图算法查找良好分离点的附加点)。
更新:
我提出了一个快速脚本来分割点文件。它并不完美,但它的工作原理是合理的。
If you can produce an image: Graphviz tends to create huge files. Zoom in.
For me graphviz regularly crashes on your file. It seems to max out on 32 kPixels per side and your file would be larger, resulting in an integer overflow.
Try splitting the file up into multiple sub-graphs (Additional points for using graph algorithms for finding good separation points).
Update:
I threw up a quick script to split dot files. It's not perfect, but it works reasonable.