GraphViz,聚类时固定布局

发布于 2024-08-22 21:15:41 字数 135 浏览 2 评论 0原文

我有点(graphviz)文件,其中包含给定的图形,其中包含多个节点和边。
我想创建该图的副本并将几个节点聚集在一起。
然而,每当我这样做时,图形的布局就会发生变化(采用集群)。

有什么方法可以固定图形的位置然后添加聚类吗?

I have dot (graphviz) file with given graph which consist several nodes and edges.
I would like to create a copy of that graph and cluster cluster (group) few nodes together.
However whenever I am doing that the layout of the graph is changing (adopting to the cluster).

Is there any way I could fix the position of the graph and then add clustering?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

东走西顾 2024-08-29 21:15:41

例如,如果您想显示“之前和之后”(一张没有集群的图,一张带有集群的图),最初使用集群创建两个图可能是最简单的(以便它们看起来相同)。然后,对于您想要“非聚类”的图形,设置所有子图参数,以便聚类注释不可见,即没有聚类标签,并且颜色与图形的背景颜色相同。该簇将显得不可见。

例如,在下面的代码中,集群将显示为不可见:

subgraph cluster_inv {
  node [style=filled];
  N1 -> N2 -> N3;
  label="";
  color="#FFFFFF";
}

If for instance, you want to show a "before and after" (one graph w/out the cluster and one with), it might be easiest to initially create both graphs with the clusters (so that they look identical). Then for the graph that you want "unclustered", set all of the subgraph parameters so that the cluster annotations are invisible--i.e., with no cluster label and with a color that is the same as the background color of your graph. the cluster will appear invisible.

So for instance, in the code below, the cluster will appear invisible:

subgraph cluster_inv {
  node [style=filled];
  N1 -> N2 -> N3;
  label="";
  color="#FFFFFF";
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文