点图形语言 - 如何制作双向边界? [英] Dot graph language - how to make bidirectional edges?
问题描述
strict digraph graphName {
A-> B
B-> A
}
这会创建
alt text http://grab.by/grabs/a7a5a41268955d2a62b6aa2b8b131e03.png
相反,我想要在A和B之间显示一条边,但带有双箭头。我知道如何让双箭头作为一个全局选项:
严格digraph graphName {
edge [dir = both]
A-> B
B-> A
}
但是这看起来非常丑陋,并不是所有的边缘都应该是双头的。
替代文字http://grab.by/grabs/c370bc807079b0e6c0e5f63d5624b211.png
如果我对图进行更多处理并且自己检测双引用,并用单个边替换两个边,它看起来OK。但是我宁愿不必做这个额外的步骤
strict digraph graphName {
A-> B [ dir =both]
}
替代文字http://grab.by/grabs/424d58700292a274eea833ff8956c696.png
有什么更好的解决方案? p>
'concentrate = true'如何?:
strict digraph graphName {
concentrate = true
A-> B
B-> A
}
with concentrate = true http: //i38.tinypic.com/290ugk6.png
从 documentation :
如果属实,请使用边缘集中器。这
将多边形合并成单边
,并导致部分并行边到
共享它们路径的一部分。后者的
功能尚未在
点以外获得。
Here is a very simplified example of my Dot graph:
strict digraph graphName {
A->B
B->A
}
This creates alt text http://grab.by/grabs/a7a5a41268955d2a62b6aa2b8b131e03.png
Instead I want a single edge shown between A and B but with a double arrow head. I know how to get the double arrowhead as a global option:
strict digraph graphName {
edge [dir="both"]
A->B
B->A
}
But that looks very ugly, and not all of my edges should be dual headed.
alt text http://grab.by/grabs/c370bc807079b0e6c0e5f63d5624b211.png
If I do more processing of the graph and detect the double reference myself and replace the two edges with a single edge, it looks OK. But I'd rather not have to do this extra step
strict digraph graphName {
A->B [dir="both"]
}
alt text http://grab.by/grabs/424d58700292a274eea833ff8956c696.png
Any better solutions?
How about 'concentrate=true'?:
strict digraph graphName {
concentrate=true
A->B
B->A
}
with concentrate=true http://i38.tinypic.com/290ugk6.png
From the documentation:
If true, use edge concentrators. This merges multiedges into a single edge and causes partially parallel edges to share part of their paths. The latter feature is not yet available outside of dot.
这篇关于点图形语言 - 如何制作双向边界?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!