Hi Admins.
I use GoJS with react. After I copy object (Ctrl+C - Ctrl+V or Press Ctrl and drag object) if I try to call myDiagram.updateAllTargetBindings(), then the location of the initial object is change to location of the copied one.
After testing I found that If I change any object property (f.i. font) then problem is lost. What could be the problem?
Why are you calling Diagram.updateAllTargetBindings? That should not be necessary after any operation implemented by GoJS, including the CommandHandler.copySelection command.
How are you making changes to the data? All changes should be performed in a transaction. Normally modifications to data must be performed by calling methods on Model or setting its properties.
I cannot use GoJS methods to update store. For example: I input any property value, then I found object in store and update property (diagram.model is already update because it is part of the state) and then I call Diagram.updateAllTargetBindings to update graph
To use Model.mergeNodeDataArray do I need update Store and then update diagram.model by Model.mergeNodeDataArray or only update diagram.model and store updated automaticly?
Diagram.updateAllTargetBindings can be used in situations where the node data array has been modified/mutated without calling Model.set or other Model methods. But it comes at the cost of losing the ability to support undo.
Model.mergeNodeDataArray can be used when a copy of the node data array has been modified. This includes immutable data designs.