How to control node order within layers in LayeredDigraphLayout?

Hi, I implemented custom layout extending LayeredDigraphLayout, which addresses a range of my business requirements. One requirement I am not done yet is: if new nodes are added, keep existing nodes together in the same layer where they have been, and in the same order (while new layers might be created in-between existing ones and new nodes might appear between old nodes). First part of it I implemented by calling a custom method after parent “AssignLayer” method and assigning previously known nodes to specific layers. Second part of this requirement I tried to implement by setting “index” attribute of LayeredDigraphVertex before calling “comminNodes”, but it has no effect. Any suggestions?

The point of LayeredDigraphLayout is to re-order the nodes in a “layer” in order to try to reduce the number of link crossings. So trying to impose some other ordering of the nodes in a layer runs counter to what the layout is trying to do.

So, aside from documented effect of setting “layer” attribute of LayeredDigraphVertex, attempt to set other attributes will have no impact layout logic, correct?

Well, it might – it depends on the circumstances.

If you really want to put a bunch of nodes in a single layer in a particular order, maybe you could put them into a Group with a Group.layout being a GridLayout whose comparer is set to do what you want. Presumably the Group would consist only of a Placeholder – i.e. no visible Shapes or TextBlocks or whatever.

I’m not sure whether I have tried that before or not.