添加边缘中断图形viz点布局

问题描述 投票:0回答:1

我想用graphviz dot制作一个垂直方向的流程图。 我是新来的,所以请你别着急。 我的布局是99%正确的,但是当我添加一个最后的边(data -> h)它就坏了。 我注意到,如果我添加最后的边缘,但去掉 "是 "的标签,格式也是正确的。 我把它归纳为一个简单的例子,但仍然显示出不希望看到的行为。

我的问题是:我怎样才能保持我所希望的垂直格式,并保持 "Yes "标签。data -> h 边缘,并保留 "是 "标签。

理想,但缺少最后的边缘。

ideal_missing_edge

破损的,有最后的 data -> h 边缘。

enter image description here

理想的,有最后的 data -> h 边缘,但去掉了 "yes "标签。

enter image description here

digraph G {

a [
label = "a";
shape = diamond;
];

b [
label = "b";
shape = rect;
];

makedata [
label = "makedata";
shape = rect;
];

data [
label = "data";
shape = box3d;
]

filldata [
label = "filldata";
shape = rect;
]

num [
label = "num"
shape = box3d;
]

num2 [
label = "num2"
shape = box3d;
]

prepdata [
label="prepdata"
shape=rect;
]

prepdata2 [
label="prepdata2"
shape=rect;
]

lorem [
label="lorem_ipsum_dolor_sit"
shape="rect"
]

lorem2 [
label="lorem_ipsum_dolor_sit"
shape="rect"
]

h [
label="h"
shape="rect"
]

{
rank=same;
filldata;data
}

{
rank=same;
num2;prepdata2
}

// if data -> h is included, and this label is removed, formatting is also correct
a:s -> b [label="Yes"]
b -> makedata
makedata:e -> data:w
makedata -> filldata [weight=99]
filldata:e -> data:w
filldata->prepdata  [weight=99]
data -> prepdata
data -> prepdata2
data -> lorem:ne
prepdata -> lorem:n  [weight=99]
lorem -> prepdata2  [weight=99]
num:e->prepdata:w 
num2:e->prepdata2:w [weight=99]
prepdata2:s -> lorem2:n [weight=99]
data -> lorem2
lorem2 -> h  [weight=99]
// data -> h  # the problem

}
graphviz dot
1个回答
1
投票

纠缠边缘有时是一个命中或失败的命题。 将你的边缘改为以h:ne(h的东北角)为终点,像这样。

data -> h:ne

然后你就会得到:enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.