点图语言-如何自动制作双向边线? [英] Dot graph language - how to make bidirectional edges automatically?
问题描述
这是我的点图的非常简化的示例:
Here is a very simplified example of my Dot graph:
strict digraph graphName {
A->B
B->A
}
这将创建
相反,我希望在A和B之间显示一条单边,但要有一个双箭头.我知道如何将双箭头作为全局选项:
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.
如果我对图形进行更多处理并自己检测到双重引用,并用一条边替换了两条边,则看起来不错.但我宁愿不必执行此额外步骤
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"]
}
有更好的解决方案吗?
推荐答案
'concentrate = true'怎么样?:
How about 'concentrate=true'?:
strict digraph graphName {
concentrate=true
A->B
B->A
}
从文档:
如果为true,请使用边缘集中器.这 将多边合并为一条边 并导致部分平行的边缘 分享他们的部分路径.后者 外部尚不可用 点.
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屋!