Alaneuler
Alaneuler

Reputation: 216

Can I have this cluster shape in Graphviz?

Layered two rectangles like Cluster1 or Cluster2 in the following image:

illustration of cluster shape

Upvotes: 1

Views: 175

Answers (1)

sroush
sroush

Reputation: 6773

The closest you can get without hassle is nested clusters, like so:

digraph N {
  rankdir=LR
  labelloc=b

  subgraph clusterA1 {  // outer cluster
    subgraph clusterA { // inner cluster
      graph [bgcolor=white]
      label=Cluster1
      Node1
    }
  }
  subgraph clusterB1 {
    subgraph clusterB {
      label=Cluster2
      Node2
    }
  }
  Node1 -> Node2 [minlen=2]
}

Giving:
enter image description here
It may be possible to get the look you are after by post-processing (with Python, gvpr, or the like) a similar input and creating or repositioning a cluster or node to give the look you want. Not sure.

Upvotes: 2

Related Questions