从Graphviz中记录元素的中心开始绘制出边

Her*_*ann 3 graphviz

在Graphviz中,是否可以从子记录的中心(而不是边界)开始绘制出记录边?

该图原始文章)看起来很像,但是示例代码是错误的,我在Graphviz 2.29中测试了清单1中的代码(绘制了这个,但是我twopi改用了),结果是不同的(边缘从记录边界开始) 。

有任何想法吗?

提前致谢。

mar*_*pet 5

链接文章来自2004年,此后对graphviz进行了一些更改。

这是如何适应列表°1来显示源自记录形状单元格中心的边的方法:

在定义边之前添加以下行:

edge[headclip=false, tailclip=false];
Run Code Online (Sandbox Code Playgroud)

这告诉graphviz将边缘绘制到末端,而不是在边界节点处修剪边缘。

但是在这种情况下,这还不够,因为边缘已经使用了端口-我们可以添加罗盘点以指示边缘的末端/开始位置。例如,为了使第一个边缘从的中心J到的边界E

        "node0":f1:c -> "node1":f1;
Run Code Online (Sandbox Code Playgroud)

或者只是省去端口和罗盘点以使用节点的中心:

        "node0" -> "node1":f1;
Run Code Online (Sandbox Code Playgroud)

为了使所有边都起源并在记录节点的中心终止:

digraph G
{
    node [shape = record];
    edge[headclip=false, tailclip=false];

    node0 [ label ="<f0> | <f1> J | <f2> "];
    node1 [ label ="<f0> | <f1> E | <f2> "];
    node4 [ label ="<f0> | <f1> C | <f2> "];
    node6 [ label ="<f0> | <f1> I | <f2> "];
    node2 [ label ="<f0> | <f1> U | <f2> "];
    node5 [ label ="<f0> | <f1> N | <f2> "];
    node9 [ label ="<f0> | <f1> Y | <f2> "];
    node8 [ label ="<f0> | <f1> W | <f2> "];
    node10 [ label ="<f0> | <f1> Z | <f2> "];
    node7 [ label ="<f0> | <f1> A | <f2> "];
    node3 [ label ="<f0> | <f1> G | <f2> "];

    // identical result: "node0" -> "node1";
    "node0":f1:c -> "node1":f1:c;
    "node0":f1:c -> "node2":f1:c;

    "node1":f1:c -> "node4":f1:c;
    "node1":f1:c -> "node6":f1:c;
    "node4":f1:c -> "node7":f1:c;
    "node4":f1:c -> "node3":f1:c;

    "node2":f1:c -> "node5":f1:c;
    "node2":f1:c -> "node9":f1:c;

    "node9":f1:c -> "node8":f1:c;
    "node9":f1:c -> "node10":f1:c;
}
Run Code Online (Sandbox Code Playgroud)

记录节点居中