I am using a Redux store to push graph changes to the Model. I am going with brute force approach of replacing all of the elements (nodes and links) of the model instead of detecting and pushing just the changes (ie: replacing / adding / deleting nodes and links).
The following code does not seem to work correctly. I have looked at the objects and they check out pre and post copy.
diagram.startTransaction(‘replace nodes and links’);
diagram.model.nodeDataArray = [];
diagram.model.linkDataArray = [];
diagram.commitTransaction(‘replace nodes and links’);
diagram.startTransaction(‘replace nodes’);
diagram.model.addNodeDataCollection(copyArrayOfObjects(getStore().getState().objects))
diagram.model.addLinkDataCollection(copyArrayOfObjects(getStore().getState().connections))
diagram.commitTransaction(‘replace nodes’);
Is there a different way I am supposed to do this? The graph updates when i add notes but not when I add links.