【问题标题】:How can I get bidirectional connections concentrated between clusters?如何获得集中在集群之间的双向连接?
【发布时间】:2021-02-20 05:31:02
【问题描述】:

取以下有向图:

digraph "all"{

  subgraph "cluster cluster 1" {
    node [label="1"] "1"
    node [label="2"] "2"
  }

  subgraph "cluster cluster 2" {
    node [label="3"] "3"
    node [label="4"] "4"
  }

  1 -> 2
  2 -> 1

  3 -> 4
  4 -> 3

}

为了将双向连接变成单箭头,
我必须使用concentrate=true;

digraph "all"{

  subgraph "cluster cluster 1" {
    node [label="1"] "1"
    node [label="2"] "2"
  }

  subgraph "cluster cluster 2" {
    node [label="3"] "3"
    node [label="4"] "4"
  }

  1 -> 2
  2 -> 1

  3 -> 4
  4 -> 3

  concentrate=true;

}

这适用于单个集群,但不适用于跨集群。
我也尝试在其他地方喷洒concentrate=true,但没有奏效。

digraph "all"{

  subgraph "cluster cluster 1" {
    node [label="1"] "1"
    node [label="2"] "2"
    concentrate=true;
  }

  subgraph "cluster cluster 2" {
    node [label="3"] "3"
    node [label="4"] "4"
    concentrate=true;
  }

  1 -> 2
  2 -> 1

  3 -> 4
  4 -> 3

  2 -> 3
  3 -> 2

  concentrate=true;

}


如何集中有向图簇之间的连接?

【问题讨论】:

    标签: graph graphviz image-graphviz


    【解决方案1】:

    使用连接修饰符 [dir=both]

    2 -> 3 [dir=both]
    

    然后您可以从 3 -> 2 中删除链接

    【讨论】:

    • 您也可以对其他链接执行此操作并删除 'concentrate=true'
    【解决方案2】:

    对于不需要显示箭头的双向图,除了“concentrate=true”,还可以添加“edge[arrowhead=none]”。

    【讨论】:

      猜你喜欢
      • 2013-04-26
      • 1970-01-01
      • 2015-03-05
      • 2020-10-10
      • 2021-12-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-02-08
      相关资源
      最近更新 更多