Hi,
Could anyone please help me in achieving the following, I am not able to get that using go.js.
I have a Diagram with layout set to LayeredDigraphLayout with GraphicLinkModel, in which whenever I add a node and it’s link, the nodes are placed automatically to certain position as per the layout properties.
But what I want is whenever user manually changes the position of node, then further addition or deletion of the nodes should be set according to the layout properly.
In my case initial layout is coming fine (as per the layout set) input, output and operation are nodes:
Once I move any node manually(Operation node to upward), I am setting isLayoutPositioned to false for that particular node (location values is binded for the moved node):
After the manual change of the position of Operation node(for which isLayoutPositioned is set to false), when I add any other node (let’s say another output node) then I want it to be added in the same layer as of other output nodes but the actual behavior is something else:
Desired view:
Actual View:
Please help me in understanding the problem and the possible fix for the same.
Layout properties set:
myDiagram.layout = self.GOMake(go.LayeredDigraphLayout);
myDiagram.layout.direction = 0;
myDiagram.layout.nodeSpacing = 5;
myDiagram.layout.layerSpacing = 20;
myDiagram.layout.isInitial = false;
myDiagram.layout.layeringOption = go.LayeredDigraphLayout.LayerOptimalLinkLength;
myDiagram.layout.aggressiveOption = go.LayeredDigraphLayout.AggressiveLess;
Link Template (Please ignore self object) :
self.myDiagram.linkTemplateMap.add("",
self.GOMake(go.Link, {
curve: go.Link.Bezier,
fromShortLength: -2,
toShortLength: -2,
selectable: false,
relinkableFrom: false,
relinkableTo: false,
reshapable: false
},
self.GOMake(go.Shape, {
strokeWidth: 3
}
)));
Thanks
Rakesh Sharma