控制 Graphviz 箭头方向
Control Graphviz arrows direction
我要画IDEF0 diagram example using Graphviz
digraph UDEF0 {
"Plan New Information Program" [shape=box]
"Issues" [shape=none]
"Operation Data" [shape=none]
"Program Charter" [shape=none]
"Program Team" [shape=none]
"Program Plan" [shape=none]
"Issues" -> "Plan New Information Program"
"Operation Data" -> "Plan New Information Program"
"Program Charter" -> "Plan New Information Program"
"Program Team" -> "Plan New Information Program"
"Plan New Information Program" -> "Program Plan"
}
问题是我找不到控制中心框周围箭头方向的方法。
我尝试使用由不可见的南、北、东和西节点组成的隐藏 "frame" 将箭头连接到它们。不幸的是 "frame" 只有在它为空时才能正常工作,当我将我的 "payload" 节点连接到它时,结构会中断:
digraph UDEF0 {
rankdir=LR
"Plan New Information Program" [shape=box]
"Issues" [shape=none]
"Operation Data" [shape=none]
"Program Charter" [shape=none]
"Program Team" [shape=none]
"Program Plan" [shape=none]
"Program Plan" [shape=none]
"West" [shape=none]
"North" [shape=none]
"South" [shape=none]
"East" [shape=none]
"West" -> "North" -> "East"
"West" -> "South" -> "East"
"West" -> "Issues" -> "Plan New Information Program"
"West" -> "Operation Data" -> "Plan New Information Program"
"North" -> "Program Charter" -> "Plan New Information Program"
"South" -> "Program Team" -> "Plan New Information Program"
"East" -> "Plan New Information Program" -> "Program Plan"
}
是否有任何正确的方法来实现这种图表样式?
使用shape = record
让你接近你想要的 - 这是我重写的尝试:
digraph UDEF0
{
A[ label = "Plan New\nInformation\nProgram", shape=box, style = filled, fillcolor = grey ]
B[ shape = record, color = white, label = "{ Operation Data | Issues }" ]
node[ shape = none ]
c[ label = "Program Charter" ]
d[ label = "Program Team" ]
e[ label = "Program Plan" ]
{ rank = same; A B e }
c -> A;
A -> d[ dir = back ];
edge[ minlen = 3]
B -> A;
B -> A;
A -> e;
}
产量
编辑 2018-11-29
为了避免@McKay 在他的评论中显示的问题,我使用 HTML 之类的标签重新编码了示例:
digraph UDEF0
{
A[ label = "Plan New\nInformation\nProgram", shape=box, style = filled, fillcolor = grey ]
B[ shape = plaintext, label =<
<TABLE BORDER="0" CELLBORDER="0" CELLSPACING="15">
<TR>
<TD PORT = "p1">Issues</TD>
</TR>
<TR>
<TD PORT = "p2">Operation Data</TD>
</TR>
</TABLE>>];
node[ shape = none ]
c[ label = "Program Charter" ]
d[ label = "Program Team" ]
e[ label = "Program Plan" ]
{ rank = same; A B e }
c -> A;
A -> d[ dir = back ];
edge[ minlen = 3]
B:p1 -> A;
B:p2 -> A;
A -> e;
}
这给了我们
我的 Linux 盒子上 graphviz version 2.38.0 (20140413.2041)
没有警告或错误消息。
我要画IDEF0 diagram example using Graphviz
digraph UDEF0 {
"Plan New Information Program" [shape=box]
"Issues" [shape=none]
"Operation Data" [shape=none]
"Program Charter" [shape=none]
"Program Team" [shape=none]
"Program Plan" [shape=none]
"Issues" -> "Plan New Information Program"
"Operation Data" -> "Plan New Information Program"
"Program Charter" -> "Plan New Information Program"
"Program Team" -> "Plan New Information Program"
"Plan New Information Program" -> "Program Plan"
}
问题是我找不到控制中心框周围箭头方向的方法。
我尝试使用由不可见的南、北、东和西节点组成的隐藏 "frame" 将箭头连接到它们。不幸的是 "frame" 只有在它为空时才能正常工作,当我将我的 "payload" 节点连接到它时,结构会中断:
digraph UDEF0 {
rankdir=LR
"Plan New Information Program" [shape=box]
"Issues" [shape=none]
"Operation Data" [shape=none]
"Program Charter" [shape=none]
"Program Team" [shape=none]
"Program Plan" [shape=none]
"Program Plan" [shape=none]
"West" [shape=none]
"North" [shape=none]
"South" [shape=none]
"East" [shape=none]
"West" -> "North" -> "East"
"West" -> "South" -> "East"
"West" -> "Issues" -> "Plan New Information Program"
"West" -> "Operation Data" -> "Plan New Information Program"
"North" -> "Program Charter" -> "Plan New Information Program"
"South" -> "Program Team" -> "Plan New Information Program"
"East" -> "Plan New Information Program" -> "Program Plan"
}
是否有任何正确的方法来实现这种图表样式?
使用shape = record
让你接近你想要的 - 这是我重写的尝试:
digraph UDEF0
{
A[ label = "Plan New\nInformation\nProgram", shape=box, style = filled, fillcolor = grey ]
B[ shape = record, color = white, label = "{ Operation Data | Issues }" ]
node[ shape = none ]
c[ label = "Program Charter" ]
d[ label = "Program Team" ]
e[ label = "Program Plan" ]
{ rank = same; A B e }
c -> A;
A -> d[ dir = back ];
edge[ minlen = 3]
B -> A;
B -> A;
A -> e;
}
产量
编辑 2018-11-29
为了避免@McKay 在他的评论中显示的问题,我使用 HTML 之类的标签重新编码了示例:
digraph UDEF0
{
A[ label = "Plan New\nInformation\nProgram", shape=box, style = filled, fillcolor = grey ]
B[ shape = plaintext, label =<
<TABLE BORDER="0" CELLBORDER="0" CELLSPACING="15">
<TR>
<TD PORT = "p1">Issues</TD>
</TR>
<TR>
<TD PORT = "p2">Operation Data</TD>
</TR>
</TABLE>>];
node[ shape = none ]
c[ label = "Program Charter" ]
d[ label = "Program Team" ]
e[ label = "Program Plan" ]
{ rank = same; A B e }
c -> A;
A -> d[ dir = back ];
edge[ minlen = 3]
B:p1 -> A;
B:p2 -> A;
A -> e;
}
这给了我们
我的 Linux 盒子上 graphviz version 2.38.0 (20140413.2041)
没有警告或错误消息。