i have diagrams where the some parts of the business logic can only be performed on the server side.
therefore, editing cannot be fully solved on the client-side.
example of drawing new links:
- i have a diagram based on a standard GraphLinksModel
- i draw a new link between two nodes using the built-in LinkingTool
- during the drag and drop operation, i’m perfectly satisfied with the default client side behavior of LinkingTool
but once the LinkingTool drag and drop operation completes, i don’t want to rely on GoJS adding a new link data object to the linkDataArray of the model. at this point i’d rather like to:
- catch the information of the newly drawn link
- perform an async client-server roundtrip (client sends info of the new link to the server)
- receive the resulting graph model data (nodes and links) from the server
- re-bind GoJS to the newly received model data (there is a possibility that changes other than the creation of the new link will be received from the server)
similarly, i might need to do such client-server roundtrips during other editing events such as deleting nodes and links, moving nodes, applying a new layout, etc.
i’m interested which approach would be considered as the best practice for such scenarios, at which point of the GoJS API the necessary server-client roundtrips should be weaved into the cycle of editing events.
(note: i’m not using the undoManager as it is not necessary to make the edits undoable in my case)