为了加倍,我如何在不同方向上有排名的布局?

发布于 2025-01-27 17:55:22 字数 806 浏览 2 评论 0原文

我有一个具有“出站”阶段和“返回”阶段的过程的图。我希望返回阶段可以朝另一个方向朗姆酒。

strict digraph {
rankdir="TB"
code 
PO 
SLP_out
{rank="same" code PO SLP_out}

translators
{rank="same" translators}

SLP_Back
POTs
merged_POs
MOs
{rank="same"  SLP_Back POTs merged_POs MOs}

code -> PO [fillcolor="#a6cee3" color="#1f78b4" label="makemesseges"]
PO -> SLP_out [fillcolor="#a6cee3" color="#1f78b4" label="slmake.exe"]
SLP_out -> translators [fillcolor="#a6cee3" color="#1f78b4" style=dashed ]
translators -> SLP_Back [fillcolor="#a6cee3" color="#1f78b4"]
SLP_Back -> POTs [fillcolor="#a6cee3" color="#1f78b4"]
POTs -> merged_POs [fillcolor="#a6cee3" color="#1f78b4"]
merged_POs -> MOs [fillcolor="#a6cee3" color="#1f78b4"]   

}

现在,这是从左到右团聚,掉下来,然后从左到右运行。我希望底部梯级右至左。我该如何将其重新回到自我上?

I have a graph of a process that has an "outbound" phase and a "return" phase. I want the return phase to rum back in the other direction.

strict digraph {
rankdir="TB"
code 
PO 
SLP_out
{rank="same" code PO SLP_out}

translators
{rank="same" translators}

SLP_Back
POTs
merged_POs
MOs
{rank="same"  SLP_Back POTs merged_POs MOs}

code -> PO [fillcolor="#a6cee3" color="#1f78b4" label="makemesseges"]
PO -> SLP_out [fillcolor="#a6cee3" color="#1f78b4" label="slmake.exe"]
SLP_out -> translators [fillcolor="#a6cee3" color="#1f78b4" style=dashed ]
translators -> SLP_Back [fillcolor="#a6cee3" color="#1f78b4"]
SLP_Back -> POTs [fillcolor="#a6cee3" color="#1f78b4"]
POTs -> merged_POs [fillcolor="#a6cee3" color="#1f78b4"]
merged_POs -> MOs [fillcolor="#a6cee3" color="#1f78b4"]   

}

Right now this reuns left-to-right, drops down, then keeps running left-to-right. I want bottom rung to come back right-to-left. How can I make it double back on it self?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

故人如初 2025-02-03 17:55:23

交换头&您要走到左右的边缘的尾巴,然后添加dir = back https://graphviz.org/docs/attrs/dir/ )要正确放置箭头

// https://stackoverflow.com/questions/72193265/how-can-i-have-ranks-layout-in-different-directions-in-order-to-to-double-back
strict digraph {
rankdir="TB"
code 
PO 
SLP_out
{rank="same" code PO SLP_out}

translators
{rank="same" translators}

SLP_Back
POTs
merged_POs
MOs
{rank="same"  SLP_Back POTs merged_POs MOs}

code -> PO [fillcolor="#a6cee3" color="#1f78b4" label="makemesseges"]
PO -> SLP_out [fillcolor="#a6cee3" color="#1f78b4" label="slmake.exe"]
SLP_out -> translators [fillcolor="#a6cee3" color="#1f78b4" style=dashed ]
translators -> SLP_Back [fillcolor="#a6cee3" color="#1f78b4"]
// reverse edge directions
//SLP_Back -> POTs [fillcolor="#a6cee3" color="#1f78b4"]
POTs -> SLP_Back [dir=back fillcolor="#a6cee3" color="#1f78b4"]
//POTs -> merged_POs [fillcolor="#a6cee3" color="#1f78b4"]
 merged_POs -> POTs [dir=back fillcolor="#a6cee3" color="#1f78b4"]
//merged_POs -> MOs [fillcolor="#a6cee3" color="#1f78b4"]
MOs -> merged_POs [dir=back fillcolor="#a6cee3" color="#1f78b4"]   
}


Swap head & tail of the edges you want to go right-to-left then add dir=back (https://graphviz.org/docs/attrs/dir/) to get the arrowheads placed correctly

// https://stackoverflow.com/questions/72193265/how-can-i-have-ranks-layout-in-different-directions-in-order-to-to-double-back
strict digraph {
rankdir="TB"
code 
PO 
SLP_out
{rank="same" code PO SLP_out}

translators
{rank="same" translators}

SLP_Back
POTs
merged_POs
MOs
{rank="same"  SLP_Back POTs merged_POs MOs}

code -> PO [fillcolor="#a6cee3" color="#1f78b4" label="makemesseges"]
PO -> SLP_out [fillcolor="#a6cee3" color="#1f78b4" label="slmake.exe"]
SLP_out -> translators [fillcolor="#a6cee3" color="#1f78b4" style=dashed ]
translators -> SLP_Back [fillcolor="#a6cee3" color="#1f78b4"]
// reverse edge directions
//SLP_Back -> POTs [fillcolor="#a6cee3" color="#1f78b4"]
POTs -> SLP_Back [dir=back fillcolor="#a6cee3" color="#1f78b4"]
//POTs -> merged_POs [fillcolor="#a6cee3" color="#1f78b4"]
 merged_POs -> POTs [dir=back fillcolor="#a6cee3" color="#1f78b4"]
//merged_POs -> MOs [fillcolor="#a6cee3" color="#1f78b4"]
MOs -> merged_POs [dir=back fillcolor="#a6cee3" color="#1f78b4"]   
}

Giving:
enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文