Extending LayeredDigraphLayout

Hi,
LayeredDigraphLayout is a good fit for a diagram I am currently working on. One requirement I need to meet is handling expansion of a node (when it is a group). It has to stay in the same “layer”, centered, while other “layers” appropriately move away and order of nodes there is not changing.
For testing I just submit size change for a single node like:
myDiagram.model.setDataProperty(nodeModelObject, “size”, newSize);

LayeredDigraphLayout does most of it, but may reorganize node sequence in any “layer” as it finds appropriate. This behavior I want to avoid by extending this layout.
While debugging my custom code I found that original layout always goes through doLayout -> makeNetwork -> createNetwork -> assignLayers -> updateParts -> commitLayout -> commitNodes -> commitLayers process flow, does not reuse previously calculated network/vertexes. I can preserve initially created network, modify vertexes which belong to a particular “layer” and in custom doLayout method assign: this.network = initialNetwork; then call updateParts(). But this way I do not get properly realigned links.
What would be your suggestion for customization of this layout?
BTW, I have one more requirement related to handling individual “layers”: if user drops a new node in a “layer”, existing nodes below it should move down (assuming left-to-right direction of diagram) leaving space for new member.

One of the primary purposes of LayeredDigraphLayout is to re-order the nodes in a layer to reduce the number of link crossings. So it isn’t easy to try to maintain a particular order for the nodes within a layer.

Yes, it’s true that LayeredDigraphLayout, like the other predefined Layouts that use LayoutNetworks, does not keep the old LayoutNetwork of LayoutVertexes and LayoutEdges around between calls to DoLayout. I guess you have figured out how to keep it. This is also demonstrated by the Interactve Force sample, http://gojs.net/latest/samples/interactiveForce.html.

But unfortunately I do not have any good suggestions for how to get the incremental layout that you want. It really wasn’t designed that way. It might be possible to override some methods in order to disable the automatic re-ordering it does to try to reduce the number of link crossings, so that the rest of the doLayout can operate normally.