我怎样才能在不同的方向进行排列布局,以便双回?
How can I have ranks layout in different directions, in order to to double back?
我有一个过程图,它有一个“出站”阶段和一个“return”阶段。我希望 return 阶段向另一个方向恢复。
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-to-left然后添加dir=back
(https://graphviz.org/docs/attrs/dir/)以获得正确放置的箭头
//
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"]
}
给予:
我有一个过程图,它有一个“出站”阶段和一个“return”阶段。我希望 return 阶段向另一个方向恢复。
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-to-left然后添加dir=back
(https://graphviz.org/docs/attrs/dir/)以获得正确放置的箭头
//
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"]
}
给予: