microsoft / automatic-graph-layout

A set of tools for graph layout and viewing
Other
1.34k stars 301 forks source link

Specify layers? #356

Open bforlgreen opened 11 months ago

bforlgreen commented 11 months ago

I was wondering if there was a way to explicitly specify the layer that a node should be on?

For example, given the following :

image

Can I instead, specify something like the following pseudo code?

SetLayer(0, [E, D, B A]); SetLayer(1, [F, C]); SetLayer(2, [G]); SetLayer(3, [Z]); SetLayer(4, [H]);

So I get something like this ? image

Basically, what I want is to be able to say that [E, D, B A] should be on one layer, [F, C] on another layer, G another, Z another and H another. I hope that makes sense.

I've tried using PinNodesToSameLayer, but I cant get the result I want for G, Z and H

Thank you

bforlgreen commented 10 months ago

Any help with this please?

levnach commented 10 months ago

I think you might use LayerConstraints.AddUpDownConstraint