Well, our current approach towards this is pretty trivial. What we are actually doing is we post full “nodeDataArray” of our tree layout diagram whenever there is any change (e.g. node creation, deletion, node-text editing etc). These changes are detected by watching the “nodeDataArray” using angular “$.watch” function (as used here in this example Minimal GoJS Sample with AngularJS).
Initially, we tried implementing light API calls by sending each change separately for every event. This approach, sometimes, resulted in inconsistent data in diagram when the operations were performed at a very fast pace.
Using the approach of sending whole of “nodeDataArray” to the server on each change resulted in no inconsistencies of diagram’s data but it has actually messed up our architecture (Insertion and Deletion on every POST call in the back-end).
Ideally, we would like to use all of our API methods (GET, POST, PUT, DELETE), and asynchronously update the nodes on success response from server (without blocking the UI) to update Ids of the nodes. But, we couldn’t find any suitable example for this. If you could point us in right direction, or show us some examples for achieving what we’re are tying to do, it’ll be highly appreciated.
Many Regards.