dagrejs / dagre

Directed graph layout for JavaScript
MIT License
4.63k stars 600 forks source link

Control of cluster positioning #196

Open withnale opened 8 years ago

withnale commented 8 years ago

I know that clustering support is experimental but I thought I'd write to the list to see if there are any hints to get my examples working.

I have a complex graph of dependencies - a screenshot of which is below. However, I would really like to have the clusters/parent nodes in columns left-to-right. However, as you can see the 4th and 5th clusters (in purple) always seem to be ranked/laid-out on an additional level below the original three clusters.

I've tried experimenting through the various options available, be it setting rank, minrank, maxrank, etc from the dagre test examples but these do not seem to be helping. I believe most of these params are being filtered out during the dagre 'buildLayoutGraph' call anyway.

Is there any way to influence the existing dagre to get a layout closer to the one I'm after? Alternatively, is there an alternate JS library which might be more suited to this?

screen shot 2016-02-16 at 13 31 45

sanmaopep commented 5 years ago

looking forward to this feature too, I hope to assign clusters into different horizontal layers