将节点定位到 graphviz 中 DOT 中边的左侧和右侧
Position node to the left and right of an edge in DOT in graphviz
我写了下面的点来生成图表。除了定义和布局的节点外,我想在标记为L的边缘的左侧和右侧放置一个节点,它们应该靠近L并且在NODE3和NODE6之间。
我尝试了一些不可见的节点。新节点要么转到第一行,要么转到第二行,但我希望它们位于第一行和第二行之间的新行中。
digraph g {
ranksep=0.5
graph [rankdir = "TB"];
graph [splines=ortho];
node [fontsize = "8"];
edge [];
node0 [label = "{NODE0}" shape = "record" ];
node1 [label = "{NODE1}" shape = "record" ];
node2 [label = "{NODE2}" shape = "record" ];
node3 [label = "{NODE3}" shape = "record" ];
node4 [label = "{NODE4}" shape = "record" ];
node5 [label = "{NODE5}" shape = "record" ];
node6 [label = "{NODE6}" shape = "record" ];
node7 [label = "{NODE7}" shape = "record" ];
node8 [label = "{NODE8}" shape = "record" ];
node9 [label = "{NODE9}" shape = "record" ];
node10 [label = "{NODE10}" shape = "record" ];
node11 [label = "{NODE11}" shape = "record" ];
node12 [label = "{NODE12}" shape = "record" ];
{rank=same; node0 -> node1 -> node2 -> node3 -> node4};
{rank=same; node5 -> node6 -> node7 -> node8 -> node9};
{rank=same; node10 -> node11 -> node12};
node1 -> node5;
node5 -> node3;
node3 -> node6[label="L"];
node7 -> node10;
node11 -> node8;
node9 -> node12;
}
这样的事情怎么样?我为新节点创建了一个 "point" 节点,以便在他们的等级内连接。还摆弄了箭头,让您了解那里的可能性。
digraph g {
ranksep=0.5
graph [rankdir = "TB"];
graph [splines=ortho];
node [fontsize = "8"];
edge [];
node0 [label = "{NODE0}" shape = "record" ];
node1 [label = "{NODE1}" shape = "record" ];
node2 [label = "{NODE2}" shape = "record" ];
node3 [label = "{NODE3}" shape = "record" ];
node4 [label = "{NODE4}" shape = "record" ];
node5 [label = "{NODE5}" shape = "record" ];
node6 [label = "{NODE6}" shape = "record" ];
node7 [label = "{NODE7}" shape = "record" ];
node8 [label = "{NODE8}" shape = "record" ];
node9 [label = "{NODE9}" shape = "record" ];
node10 [label = "{NODE10}" shape = "record" ];
node11 [label = "{NODE11}" shape = "record" ];
node12 [label = "{NODE12}" shape = "record" ];
nodenew1 [label="new1" shape=record];
nodenew2 [label="new2" shape=record];
{rank=same; node0 -> node1 -> node2 -> node3 -> node4};
{rank=same; node5 -> node6 -> node7 -> node8 -> node9};
{rank=same; node10 -> node11 -> node12};
node1 -> node5;
node5 -> node3;
{
rank = same;
nodenew1 -> nodepoint -> nodenew2 [ arrowhead=none]
}
nodepoint [shape=point]
node3 -> nodepoint [label="L" arrowhead=none];
nodepoint -> node6[label="L"];
node7 -> node10;
node11 -> node8;
node9 -> node12;
}
我写了下面的点来生成图表。除了定义和布局的节点外,我想在标记为L的边缘的左侧和右侧放置一个节点,它们应该靠近L并且在NODE3和NODE6之间。
我尝试了一些不可见的节点。新节点要么转到第一行,要么转到第二行,但我希望它们位于第一行和第二行之间的新行中。
digraph g {
ranksep=0.5
graph [rankdir = "TB"];
graph [splines=ortho];
node [fontsize = "8"];
edge [];
node0 [label = "{NODE0}" shape = "record" ];
node1 [label = "{NODE1}" shape = "record" ];
node2 [label = "{NODE2}" shape = "record" ];
node3 [label = "{NODE3}" shape = "record" ];
node4 [label = "{NODE4}" shape = "record" ];
node5 [label = "{NODE5}" shape = "record" ];
node6 [label = "{NODE6}" shape = "record" ];
node7 [label = "{NODE7}" shape = "record" ];
node8 [label = "{NODE8}" shape = "record" ];
node9 [label = "{NODE9}" shape = "record" ];
node10 [label = "{NODE10}" shape = "record" ];
node11 [label = "{NODE11}" shape = "record" ];
node12 [label = "{NODE12}" shape = "record" ];
{rank=same; node0 -> node1 -> node2 -> node3 -> node4};
{rank=same; node5 -> node6 -> node7 -> node8 -> node9};
{rank=same; node10 -> node11 -> node12};
node1 -> node5;
node5 -> node3;
node3 -> node6[label="L"];
node7 -> node10;
node11 -> node8;
node9 -> node12;
}
这样的事情怎么样?我为新节点创建了一个 "point" 节点,以便在他们的等级内连接。还摆弄了箭头,让您了解那里的可能性。
digraph g {
ranksep=0.5
graph [rankdir = "TB"];
graph [splines=ortho];
node [fontsize = "8"];
edge [];
node0 [label = "{NODE0}" shape = "record" ];
node1 [label = "{NODE1}" shape = "record" ];
node2 [label = "{NODE2}" shape = "record" ];
node3 [label = "{NODE3}" shape = "record" ];
node4 [label = "{NODE4}" shape = "record" ];
node5 [label = "{NODE5}" shape = "record" ];
node6 [label = "{NODE6}" shape = "record" ];
node7 [label = "{NODE7}" shape = "record" ];
node8 [label = "{NODE8}" shape = "record" ];
node9 [label = "{NODE9}" shape = "record" ];
node10 [label = "{NODE10}" shape = "record" ];
node11 [label = "{NODE11}" shape = "record" ];
node12 [label = "{NODE12}" shape = "record" ];
nodenew1 [label="new1" shape=record];
nodenew2 [label="new2" shape=record];
{rank=same; node0 -> node1 -> node2 -> node3 -> node4};
{rank=same; node5 -> node6 -> node7 -> node8 -> node9};
{rank=same; node10 -> node11 -> node12};
node1 -> node5;
node5 -> node3;
{
rank = same;
nodenew1 -> nodepoint -> nodenew2 [ arrowhead=none]
}
nodepoint [shape=point]
node3 -> nodepoint [label="L" arrowhead=none];
nodepoint -> node6[label="L"];
node7 -> node10;
node11 -> node8;
node9 -> node12;
}