[英]Graph visualization (boost graph)
I have C++ program using boost graph library. 我有使用boost图库的C ++程序。 I wonder if there is any way to visualize the graph (nodes and optionally edges) following a certain position values contained in nodes. 我想知道是否有任何方法可以在节点中包含的某个位置值之后可视化图形(节点和可选边)。 Please look the examples of the image bellow to understand what I want to visualise: http://img11.hostingpics.net/pics/647608graphViz.png 请查看下面的图像示例,以了解我想要想象的内容: http : //img11.hostingpics.net/pics/647608graphViz.png
Thanks. 谢谢。
You're in luck. 你很幸运。
Boost graph can serialize to and deserialize from the dot
language (which is the language used by GraphViz ). Boost图可以从dot
语言( GraphViz使用的语言)序列化和反序列化。 There are several examples in the (free) Boost Graph Library book and on the site. (免费)Boost Graph Library书和网站上有几个例子。
See eg: http://www.boost.org/doc/libs/release/libs/graph/doc/write-graphviz.html 参见例如: http : //www.boost.org/doc/libs/release/libs/graph/doc/write-graphviz.html
If you take the output of the sample on the previous webpage and run 如果您在上一个网页上获取样本的输出并运行
dot -Tpng dot > test.png
You'll get something like the following picture: 你会得到类似下面的图片:
Here is a direct link to an example using dynamic properties 以下是使用动态属性的示例的直接链接
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.