[英]How to prevent Graphviz from moving nodes to accomodate an edge
我正在尝试使用 Graphviz 重现下图:
到目前为止,这是我想出的:
digraph
{
rankdir="LR";
splines=polyline;
b [shape=circle, label="", style=filled, color=gray, width=0.2, height=0.2];
c [shape=box, label="C(s)", style=filled, color=gray, xlabel=controller];
d [shape=box, label="P(s)", style=filled, color=gray, xlabel=plant];
a [shape=point, color=transparent, label="a"];
e [shape=point, color=transparent, label="e"];
f [shape=point, color=transparent, label="f"];
c -> d [label="u"]
b -> c [label="e"]
a -> b [label="r"]
d -> e [dir=none]
e -> f [label="y"]
e -> b
}
这让我接近但还没有完全到达那里,因为dot
似乎移动节点以适应从e
到b
的边缘,而不是相反:
我如何得到它,以便从e
到b
的边缘围绕节点弯曲而不是移动它们?
(大量的试验和错误)
digraph {
// lines were rearranged just to simplify my comprehension
rankdir="LR";
splines=polyline;
//splines=ortho; // might work, if edges use xlabels
a [shape=point, color=transparent, label="a"];
b [shape=circle, label="", style=filled, fillcolor=gray, width=0.2, height=0.2];
// c & d use html tables to better position exterior labels
c [shape=plaintext label=<<TABLE BORDER="0" >
<TR> <TD>controller</TD> </TR>
<TR> <TD border="1" port="p0" bgcolor="grey">C(s)</TD> </TR>
</TABLE>>];
d [shape=plaintext label=<<TABLE BORDER="0">
<TR> <TD>plant</TD> </TR>
<TR> <TD border="1" port="p0" bgcolor="grey">C(s)</TD> </TR>
</TABLE>>];
e [shape=point width=.01 label=""];
f [shape=point width=.00 label="" color=white];
a -> b [label="r"]
b -> c:p0 [label="e"]
c:p0:e -> d:p0:w [label="u"]
d:p0 -> e [dir=none headclip=false]
e -> f [label="y" tailclip=false headclip=false]
b -> e [dir=back constraint=false]
}
基于以上,不会改变:
e -> b
进入
e -> b [dir=none constraint=false]
IE
digraph
{
rankdir="LR";
splines=polyline;
b [shape=circle, label="", style=filled, color=gray, width=0.2, height=0.2];
c [shape=box, label="C(s)", style=filled, color=gray, xlabel=controller];
d [shape=box, label="P(s)", style=filled, color=gray, xlabel=plant];
a [shape=point, color=transparent, label="a"];
e [shape=point, color=transparent, label="e"];
f [shape=point, color=transparent, label="f"];
c -> d [label="u"]
b -> c [label="e"]
a -> b [label="r"]
d -> e [dir=none]
e -> f [label="y"]
e -> b [dir=none constraint=false]
}
如上: http://www.webgraphviz.com/
我得到:
(缺点是我们在标记为y
的行处仍然有一个小间隙)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.