gpt4 book ai didi

Graphviz:如何在 HTML 表格单元格之间创建边?

转载 作者:行者123 更新时间:2023-12-04 16:32:00 31 4
gpt4 key购买 nike

请考虑以下代码:

digraph G {
node [shape=plaintext]

a [label=<<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0">
<TR><TD ID="first" BGCOLOR="gray">first</TD></TR>
<TR><TD ID="second" PORT="f1">second</TD></TR>
<TR><TD ID="third" PORT="f2">third</TD></TR>
</TABLE>>];

b [label=<<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0">
<TR><TD ID="first" BGCOLOR="gray">first</TD></TR>
<TR><TD ID="second" PORT="f1">second</TD></TR>
<TR><TD ID="third" PORT="f2">third</TD></TR>
</TABLE>>];

a:first -> b:first;
}

我收到了相当多的警告:
laci@nitehawk ~ $ dot records.gv -T pdf > records.pdf
Warning: Illegal attribute ID in <TD> - ignored
Warning: Illegal attribute ID in <TD> - ignored
Warning: Illegal attribute ID in <TD> - ignored
in label of node a
Warning: Illegal attribute ID in <TD> - ignored
Warning: Illegal attribute ID in <TD> - ignored
Warning: Illegal attribute ID in <TD> - ignored
in label of node b
Warning: node a, port first unrecognized
Warning: node b, port first unrecognized
  • 根据documentation TD的ID属性应该是合法的。我错过了什么?
  • 如何引用单个单元格并在它们之间创建边缘?
  • 最佳答案

    为了完整起见,这里是实际工作的完整源代码:

    digraph G {
    node [shape=plaintext]

    a [label=<<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0">
    <TR><TD PORT="c" BGCOLOR="gray">first</TD></TR>
    <TR><TD PORT="d">second</TD></TR>
    <TR><TD PORT="e">third</TD></TR>
    </TABLE>>];

    b [label=<<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0">
    <TR><TD PORT="c" BGCOLOR="gray">first</TD></TR>
    <TR><TD PORT="d">second</TD></TR>
    <TR><TD PORT="e">third</TD></TR>
    </TABLE>>];

    a:c -> b:c;
    }

    关于Graphviz:如何在 HTML 表格单元格之间创建边?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13369992/

    31 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com