【发布时间】:2016-08-16 23:53:09
【问题描述】:
我正在使用 dot-graphviz 创建几个 UML 活动图,只要目标形状是窄矩形(H=0.5,W=0.05),边/箭头 (2+) 就会收敛在同一点。如果目标形状是正方形(H=0.5,W=0.5),则不会出现此问题。
这是一个减少点的例子:
digraph G {
graph [ ranksep = 0.5, rankdir = LR ]
A4 [ shape = "record", height = 0.5, fontsize = 10, margin = "0.20,0.05", label = "Output\ to\rPreviewer", style = "rounded" ]
A5 [ shape = "rectangle", height = 0.5, width = 0.05, margin = "0,0", style = "filled", label = "" ]
A4 -> A5 [ shape = "edge", dir = "both", style = "solid", arrowtail = "none", arrowhead = "vee", labeldistance = 1, fontsize = 10 ]
A6 [ shape = "diamond", height = 0.5, width = 0.5, margin = "0,0", label = "" ]
A6 -> A5 [ shape = "edge", dir = "both", style = "solid", arrowtail = "none", arrowhead = "vee", labeldistance = 1, fontsize = 10, label = "[generate: false]" ]
A7 [ shape = "record", height = 0.5, fontsize = 10, margin = "0.20,0.05", label = "Output\ to\rFile", style = "rounded" ]
A6 -> A7 [ shape = "edge", dir = "both", style = "solid", arrowtail = "none", arrowhead = "vee", labeldistance = 1, fontsize = 10, label = "[generate: true]" ]
A8 [ shape = "doublecircle", height = 0.3, width = 0.3, margin = "0,0", label = "" ]
A7 -> A5 [ shape = "edge", dir = "both", style = "solid", arrowtail = "none", arrowhead = "vee", labeldistance = 1, fontsize = 10 ]
A5 -> A8 [ shape = "edge", dir = "both", style = "solid", arrowtail = "none", arrowhead = "vee", labeldistance = 1, fontsize = 10 ]
}
以上文字在http://webgraphviz.com中生成如下图
理想的输出如下
【问题讨论】:
-
你可以试试
A6 -> A5:nw和A7 -> A5:sw。不能准确地给您想要的输出,但至少可以分离边缘。 -
@vaettchen,这听起来不像是一个通用的解决方案,而且对于提供的示例来说非常具体。如果有 4 个边也没有用。
-
正确 - 我尝试了针对该特定问题的解决方案。也许您编辑您的帖子说您正在寻找更多边缘/箭头的通用解决方案。