I have also setup an inspector like in the gojs-basic-react example for which I am adding event listener to the diagram using addDiagramListener
event.subject.first() for ChangedSelection event seems to have the right values for the two way bound attributes like loc and others.
But in case of PartResized event the attributes seem to be missing.
In the model I have setup two-way binding for the shape size as such new go.Binding('desiredSize', 'size', go.Size.parse).makeTwoWay(go.Size.stringify).
Any tips on how I should keep my React state updated with the resizing? I also need to keep the selectedData bit in sync.
`
If that TwoWay Binding is there, then I would expect that the node’s data.size property would have the updated string. But the e.subject.desiredSize will be available regardless of any binding.
Also, once serialized and saved - next time when I reload the diagram into canvas. The resize adornment works weirdly instead of resizing the rectangle it resizes the node or something exterior to it.
The problem is that you are resizing a Shape that is the main element of an “Auto” Panel – the border. That’s not what you want to do. I think you just want to do what the first sample does in GoJS Tools -- Northwoods Software. Because the user will be modifying the desiredSize of the whole Node, you will want to put the TwoWay Binding of “desiredSize” on the whole Node.