下面的graphviz代碼生成梯形圖,但flow3是曲線。這隻發生在邊緣穿過垂直線時。我怎樣才能使flow3平直和水平?我試着用splines屬性試驗沒有成功。如何改變代碼以強制通過其他對象的直線?如何使GraphViz梯形圖流向直線
digraph ladder { ranksep=".1"; nodesep=".1";
# Define the defaults
node [shape=point fontsize=10]
edge [dir=none fontsize=10]
# Column labels
a [shape=none]
b [shape=none]
c [shape=none]
d [shape=none]
# Draw the 4 column headings, no line
{ rank=same; edge[style=invis] a -> b -> c -> d }
# Draw the columns
a -> a1 [style=invis]
b -> b1 [style=invis]
c -> c1 [style=invis]
d -> d1 [style=invis]
a1 -> a2 -> a3 -> a4 [weight=1000 label=" "]
b1 -> b2 -> b3 -> b4 [weight=1000 label=" "]
c1 -> c2 -> c3 -> c4 [weight=1000 label=" "]
d1 -> d2 -> d3 -> d4 [weight=1000 label=" "]
# Now each step in the ladder
{ rank=same; a1 -> b1 [dir=forward label="Flow1"] }
{ rank=same; b2 -> c2 [dir=forward label="Flow2"] }
{ rank=same; b3 -> d3 [dir=forward label="Flow3"] }
{ rank=same; c4 -> d4 [dir=back label="Flow4"] }
}
編輯每評論更新。
運行GraphViz版本2.38.0。
樣條線屬性稍微改變了結果。只有第一行代碼被改變,這樣的:
digraph ladder { ranksep=".1"; nodesep=".1"; splines=false;
有了這個結果時花鍵被禁用:
什麼GraphViz的版本是您使用?你還可以添加「樣條」屬性的實驗嗎?從文檔中,我假設你必須將它設置爲「false」的圖形。 – Insac
感謝評論Insac。我相應地更新了這個問題。 – Steve
我可以建議你向Graphwiz團隊發佈問題嗎?有一個關於「迂迴路線」的相關問題(我的回答中的鏈接),但它們指的是邊緣的標籤會影響其他邊緣(在這種情況下,受影響的邊緣是帶有標籤的邊緣) – Insac