我正在尝试使用graphviz创建数据结构拓扑,我使用windows平台的graphviz,版本2.38.0。当我发出命令行来生成布局时,我收到以下错误::
d:\Profiles\Administrator>dot -v -Tpng d:\graph1.gv > graph.png
dot - graphviz version 2.38.0 (20140413.2041)
libpath/.\shortest.c:324: triangulation failed
libpath/.\shortest.c:207: cannot find triangle path
in checkpath, end port not in last box
2 boxes:
0 (-51, -68), (51, 32)
1 (-51, -148), (-51, 353)
start port: (0, 31), tangent angle: -1.5708, not constrained
end port: (0, -147), tangent angle: -3.1416, not constrained
libpath/.\shortest.c:324: triangulation failed
libpath/.\shortest.c:192: source point not in any triangle
Error: in routesplines, Pshortestpath failed
这是我的代码:
digraph vfs {
node [shape = "record" fontsize = 10 style = filled];
color = lightgray;
subgraph cluster_mnt_namespace {
graph [fontsize = 10];
label = "mnt_namespace";
namespace1 [shape = "record",label = "{
<f0>struct vfsmount * root\
|{<f1>struct list_head list|{<f2>*next|<f3>*prev}}}
"];
}
subgraph cluster_vfsmount {
graph [fontsize = 10];
label = "struct vfsmount";
subgraph cluster_mount1 {
"vfsmount1" [shape = "record",label ="{
{<f0>struct list_head\nmnt_hash|{<f1>*next|<f2>*prev}} \
|<f3>struct vfsmount *mnt_parent \
|<f4>struct dentry * mnt_mountpoint\
|<f5>struct dentry * mnt_root \
|<f6>struct super_block * mnt_sb \
|{<f7>struct list_head\nmnt_mounts|{<f8>*next|<f9>*prev}} \
|{<f10>struct list_head\nmnt_child|{<f11>*next|<f12>*prev}} \
|{<f13>struct list_head\nmnt_list|{<f14>*next|<f15>*prev}} \
|<f16>struct namespace * mnt_namespace}
"];
}
subgraph cluster_mount2 {
"vfsmount2" [shape = "record",label ="{
{<f0>struct list_head\nmnt_hash|{<f1>*next|<f2>*prev}} \
|<f3>struct vfsmount *mnt_parent \
|<f4>struct dentry * mnt_mountpoint\
|<f5>struct dentry * mnt_root \
|<f6>struct super_block * mnt_sb \
|{<f7>struct list_head\nmnt_mounts|{<f8>*next|<f9>*prev}} \
|{<f10>struct list_head\nmnt_child|{<f11>*next|<f12>*prev}} \
|{<f13>struct list_head\nmnt_list|{<f14>*next|<f15>*prev}} \
|<f16>struct namespace * mnt_namespace}
"];
}
}
vfsmount1:f8 -> vfsmount2:f10 [color = "blue"];
vfsmount2:f12 -> vfsmount1:f7 [color = "green"];
vfsmount2:f11 -> vfsmount1:f7 [color = "green"];
vfsmount1:f9 -> vfsmount2:f10 [color = "blue"];
vfsmount2:f3 -> vfsmount1:f0;
namespace1:f0 -> vfsmount1:f0;
namespace1:f2 -> vfsmount1:f13;
vfsmount1:f14 -> vfsmount2:f13;
vfsmount2:f14 -> namespace1:f1;
namespace1:f3 -> vfsmount2:f13;
vfsmount2:f15 -> vfsmount1:f13; //if delete this row,it can generate layout sucessly
}
有人能告诉我它有什么问题吗?有什么想法我为什么会看到这个错误?
答案 0 :(得分:1)
我不完全确定导致错误的原因,但我怀疑路由算法会被图表中的多层聚类弄糊涂。
我可以通过设置图表属性newrank=true
来渲染图表。设置为true时,newrank attribute会激活忽略群集的全局排名算法。
您可以通过以下命令行执行此操作:
dot -v -Tpng -Gnewrank=true d:\graph1.gv > graph.png
或将其添加到点输入文件中:
digraph vfs {
newrank = true;
node [shape = "record" fontsize = 10 style = filled];
color = lightgray;
...
这是我得到的结果: