Hi,
We are saving nodes location on server and binding them to nodes on time of load. This the the binding code:-
new go.Binding(“location”, “location”, go.Point.parse).makeTwoWay(go.Point.stringify),
The location field is successfully bound to the nodes at load time but as soon as we make a transaction on diagram’s model, the node are arranged according to auto allign functionality – (myDiagram.layoutDiagram(true);)
and custom locations are lost. This can be seen on –
- myDiagram.model.nodeDataArray
- myDiagram.nodes.each(function(x){if(x.data.category == "CommandSectionGroup"){console.log(x.data.location)}})
for (var it = myDiagram.nodes.iterator; it.next() ;) {
if (it.value.category == “CommandSectionGroup”){
it.value.visible = !isHidden;
// To set the flag, so that current state of the chart can be saved in DB
myDiagram.startTransaction(“Set the isHidden flag to false”);
var data = it.value.data;
myDiagram.model.setDataProperty(data, “isHidden”, isHidden);
myDiagram.commitTransaction(“Set the isHidden flag to false”);
}
}
Images :-
Expected Behaviour
Actual behaviour :-
Regards