使用graphviz时如何避免边和节点重叠?
如标题,我想画一个ELF文件格式的图像。ELF头有程序头表和节头表的偏移,所以我想用两个箭头指针来指出关系。但是边与节点重叠(记录)即使在我设置了overlap=false和splines=true之后。我搜索了一段时间,但我的情况是箭头在某种程度上指向其自身的一部分。
以下是我用来生成 png 文件的点文件。
digraph g {
//margin="1"
overlap='scale'
graph [rankdir="LR"]
"ELF File" [
label="<f0> ELF Header\n e_shoff=0x118| <f1> Program Headers Table | <f2> .text | <f3> .data | <f4> .rodata| <f5> .comment | <f6> .shstrtab | <f8> .symtab | <f9> .rel.text | <f7> Section Table"
shape="record"
];
"ELF File":f0 -> "ELF File":f1 [label="e_phoffset"]
"ELF File":f0 -> "ELF File":f7 [label="e_shoff"]
}
As title,I want to draw an image of ELF file format.The ELF Header has offset of program headers table and section headers table,so I want to use two arrows pointer to point out the relationship.But the edges overlap the node(record) even after I have overlap=false and splines=true set.I have search for a while,but my situation is that the arrows somewhat point to parts of itself.
Following is the dot file I am using to generate the png file.
digraph g {
//margin="1"
overlap='scale'
graph [rankdir="LR"]
"ELF File" [
label="<f0> ELF Header\n e_shoff=0x118| <f1> Program Headers Table | <f2> .text | <f3> .data | <f4> .rodata| <f5> .comment | <f6> .shstrtab | <f8> .symtab | <f9> .rel.text | <f7> Section Table"
shape="record"
];
"ELF File":f0 -> "ELF File":f1 [label="e_phoffset"]
"ELF File":f0 -> "ELF File":f7 [label="e_shoff"]
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
一种可能的解决方案是在其中一条边上使用“东”节点端口,以便该边出现在记录的另一侧。您可以通过将
:e
附加到节点名称来完成此操作。例如:One possible solution is to use "east" node ports on one of the edges, so that this edge appears on opposite side of the record. You do this by appending
:e
to the node name. For example: