同一节点的连接器之间的线

时间:2017-12-03 11:39:42

标签: graphviz

如何绘制箭头

A1:Port1 ->   A1:Port2 [dir=both]

更好

因此,至少与另一个连接器在同一点上的相同连接点。见图。

Line between connectors of the same node

Round line between connecoors of the same node

digraph G {
    graph [rankdir = LR];

    node[shape=record];

    A1[label="{A1|{<Port1>Port 1|<Port2>Port 2 }}"];
    A2[label="{{<Port1>Port 1|<Port2>Port 2 }|A2}"];

   A1:Port1 ->   A1:Port2 [dir=both] 
   A1:Port1 -> A2:Port1 [dir=both] 


}

2 个答案:

答案 0 :(得分:0)

我将介绍一个中间节点:

digraph G {
    graph [rankdir = LR];

    node[shape=record];

    A1[label="{A1|{<Port1>Port 1|<Port2>Port 2 }}"];
    A2[label="{{<Port1>Port 1|<Port2>Port 2 }|A2}"];

   C[shape=point];
   A1:Port1 -> C;
   C -> A1:Port2;
   C -> A2:Port1;
}

所以你得到:

enter image description here

答案 1 :(得分:0)

将其作为答案发布,以便生成的图表清晰:

digraph G 
{
    graph[ rankdir = LR, splines=line] ;
    node[ shape=record ];

    A1[ label= "{A1|{<Port1>Port 1|<Port2>Port 2 }}" ];
    A2[ label= "{{<Port1>Port 1|<Port2>Port 2 }|A2}" ];

    A1:Port1:e ->   A1:Port2:e [ dir=both ]
    A1:Port1   ->   A2:Port1   [ dir=both, minlen = 2 ]
}
制造

enter image description here