【问题标题】:how to avoid overlapping edge and node when using graphviz?使用graphviz时如何避免边缘和节点重叠?
【发布时间】:2023-04-02 09:13:01
【问题描述】:

作为标题,我想画一张ELF文件格式的图像。ELF Header有program headers table和section headers table的偏移量,所以我想用两个箭头指针来指出关系。但是边缘重叠node(record) 即使在我设置了重叠 = 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"]
}

【问题讨论】:

    标签: graphviz dot


    【解决方案1】:

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

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

    【讨论】:

    • 这很有帮助!谢谢!
    猜你喜欢
    • 2012-10-10
    • 2015-04-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-07-23
    • 1970-01-01
    • 2017-06-17
    • 1970-01-01
    相关资源
    最近更新 更多