Well, I know that the question of arranging nodes in GraphViz was almost ready for death, but I did not see anyone addressing the issue of arranging clusters. I tried all the tricks in the book:
The order of the nodes in the file is from left to right. If I do not add clusters, the dot just does the right thing and shows them in the correct order without any hints. However, when adding clusters, the point shuffles (randomizes?) The Order.
I added invisible edges to try to clean up the subgroups; but it seems that as soon as the clusters are located inside the cluster, the point selects a specific order and will not be shy that the edges go around the entire map in order to save it.
Since the order of the nodes and invisible edges did not suit me, I turned to an attempt to force the position of the nodes. This fails again, because only the dot makes clusters, and it ignores the entry positions. Starting even unchanged point output via fdp (with generated positions) caused a failure, so I also refused this direction.
Here is an example of a dots file that creates the image below. The green lines are the โinvisibleโ edges that I unsuccessfully added, trying to get the dot to put everything in order from left to right. If this were successful, the green lines would pass from the anchor to the left through the nodes, to the right, without crossing itself. For example, each be.0 will be to the left of its native element be.1, and similarly for tg-s). As you can see, the point shuffled the order of the subclusters (by placing the sibling .1 to the left of one .0). It is as if he did it on purpose, due to some restrictions, regardless of any edges. I cannot find any way to convince him to do otherwise. This is very frustrating because the generated charts are perfect for my needs.

(source: ben-kiki.org )
So. Is there any way to get a point to observe some order of clusters within a cluster?
Change: If you look further, it seems that the order of the clusters is by default inverse to the order of the nodes. Thus, usually (in the TB column) the node that appears first in the text will tend to appear to the left of the node that appears later in the text; but it seems that the subcluster that appears first in the text will tend to appear to the right of the subcluster that appears later in the text. Now, if this were a strict rule, life would be magnificent; however, the dot still sometimes (but less frequently) insists on regrouping the subgroups, regardless of any resulting crossed edges, apparently "just because." So the question remains.
source share