使用graphviz时如何避免边和节点重叠?

发布于 2024-09-17 20:55:30 字数 655 浏览 2 评论 0原文

如标题,我想画一个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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

相思故 2024-09-24 20:55:30

一种可能的解决方案是在其中一条边上使用“东”节点端口,以便该边出现在记录的另一侧。您可以通过将 :e 附加到节点名称来完成此操作。例如:

"ELF File":f0:e -> "ELF File":f7:e [label="e_shoff"]

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:

"ELF File":f0:e -> "ELF File":f7:e [label="e_shoff"]
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文