如何强制Graphviz中同一列中的所有节点? [英] How to force all nodes in the same column in graphviz?

查看:169
本文介绍了如何强制Graphviz中同一列中的所有节点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图用graphviz建模一个特定的流程,但我无法弄清楚如何建模下图来共享同一个水平中心

I'm trying to model a certain flow using graphviz, and I can't figure out how to model the following graph to share the same horizontal center

digraph exmp {
   A -> B -> C -> D
   C -> E [constraint=false]
   A -> C [style="dotted", constraint=false]
   A -> D [style="dotted",  constraint=false]
   B -> D [constraint=false]
   D -> A [style="dashed", constraint=false]
   C -> A [style="dashed", constraint=false]


   subgraph cluster_hackToSinkIt { E -> F }
   { rank="sink" E F }
}

如下图所示:

我的问题是,我怎样才能让E - > F位于D的下方,使其位于同一列?

My question is, how can I get the E -> F to be positioned under D such that is lies in the same column?

推荐答案

至少截至2007年5月,您无法强制列本身 ,但 可以 应该有助于协调一致。但实际上,在这种情况下,如果您只是添加了一个从D到E的不可见边缘,那么您将获得垂直对齐。

At least as of May 2007, you can't force "columns" per se, but you can apply weight to edges which should help force alignment. But actually, in this case, if you just add an invisible edge from D to E, you've got vertical alignment.

digraph exmp {
    A -> B -> C -> D
    C -> E [constraint=false]
    A -> C [style="dotted", constraint=false]
    A -> D [style="dotted",  constraint=false]
    B -> D [constraint=false]
    D -> A [style="dashed", constraint=false]
    C -> A [style="dashed", constraint=false]
    D -> E [style="invis"] // <---- important new line


    subgraph cluster_hackToSinkIt { E -> F }
    { rank="sink" E F }
}

我不知道有什么办法强制边到一边或另一边。

I'm not aware of any way to force edges to one side or another.

这篇关于如何强制Graphviz中同一列中的所有节点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆