Cluster Layout


I'm working on an application that maintains landscapes of applications and integration components like services, adapters, interfaces etc. So far, prototype results are very satisfactory, with the exeption of the following issue (see fig and txt (dot-program) example attachments):

How can I force the layout in such a way that the three clusters always will be lined from top to bottom ?

Note, all the nodes and edges (of various types) are based on data in a database and I have no way to influence the order of individual nodes of the same "type". I generate the dot program based on a template. It is filled in with data from the database. In reality the data in the database changes every day.

Any suggestion or example is appreciated.

example.gif52 KB
example.txt7.17 KB

Cluster Layout

Dot is always going to try to compact the number of levels used, so the only way to make sure that the clusters are lined up is to make sure there is an edge from the lowest node in an upper cluster to a highest node in a lower cluster. How to do this depends on what assumptions you can make about your clusters. For example, if you know that the Frontend cluster will always be at the top above the Integratie cluster, and that there are no cycles, you can find a lowest node in Frontend and add an invisible edge to a highest node in Integratie. In your example, adding the edge

Frontend_Interface_App3 -> Frontend_Service1 [style=invis]

would do it. In the worst case, where you can not determine the necessary edges beforehand, you can run dot -Gsplines=none to get relative node positions, followed by a gvpr script to find the relevant nodes and add the invisible edges.
If you want more details about such a gvpr script, let me know.

Cluster Layout

This is the kind of hint I hoped for.
Thanks a lot.


Recent comments