Using Graphviz's dot or neato to layout clusters

6.2k views Asked by At

I'm trying to draw a deployment diagram of services and servers in our enterprise using dot. For the first iteration, I used neato to draw each service as a box and Prevent overlapping records using graphviz and neato , plus allowing splines, allowed me to get a decent layout with the edges as dependencies.

Now I need to place physical servers inside each of these boxes. First I made each service a subgraph with a name beginning with cluster and then placed the nodes representing the physical servers inside each box. Again, with the help of GraphViz - How to connect subgraphs? I faked out the edges to connect the clusters rather than the nodes. The problem is, that only works in dot. When I use neato to do the layout, it doesn't understand the edges are between clusters, so it moves only the node of the cluster I used to anchor the edge. The result is the cluster boxes are enormous and overlapping.

I hope that makes sense. Is there any way to force neato to keep the nodes in a cluster grouped?

1

There are 1 answers

4
Chris Nash On BEST ANSWER

I rethought what I was doing, and instead of using a subgraph for each service with subnodes for each server, I used a record format instead. Each node now looks like

+------------------------------+
|         Service name         |
+------------------------------+
| server1 | server2 | server 3 |
+------------------------------+

and it's much easier to lay those out :)