GraphViz-定义簇的顺序
我正在GraphViz/dot中生成群集节点。简化示例:
digraph G {
rankdir=LR
n2a->n3
n1->n2b
n2b->n2a
n2b->n3
n3->n1
subgraph cluster_1 { label="cluster_1" n1 }
subgraph cluster_2 { label="cluster_2" n2a n2b }
subgraph cluster_3 { label="cluster_3" n3 }
}
我想强迫点始终以从右到左的升序将簇放置(左侧的群集1,接下来是群集2等),但是按DOT指示,将每个群集内的节点排列在每个群集中自动地。
我尝试使用clusterRank
,等级
,newrank
,benteraind = false
发生。怎么办?
I'm generating clustered nodes in graphviz/dot. Simplified example:
digraph G {
rankdir=LR
n2a->n3
n1->n2b
n2b->n2a
n2b->n3
n3->n1
subgraph cluster_1 { label="cluster_1" n1 }
subgraph cluster_2 { label="cluster_2" n2a n2b }
subgraph cluster_3 { label="cluster_3" n3 }
}
I want to force dot to always put the clusters in ascending order from right to left (cluster 1 in the left, next is cluster 2 etc.), but to arrange the nodes inside each cluster as dot dictates automatically.
I tried to play with clusterrank
, rank
, newrank
, constraint=false
and couldn't manage to make it happen. How can it be done?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以通过添加边缘来建立每个群集中每个节点的等级来“强制”这一情况。 排名都比cluster_2中的每个节点较低。
cluster_1中的每个节点的

You can "force" this to happen by adding edges to establish rank of every node in every cluster. Every node in cluster_1 has a lesser rank than every node in cluster_2, etc. Like so:
Giving:
