updateAllRelationshipsFromData method
Add or remove any nodes or links according to additional or missing data objects in the model and update all of the references to nodes, in case they had been modified in the model without properly notifying the model by calling Model#addNodeData or GraphLinksModel#removeLinkData or GraphLinksModel#setGroupKeyForNodeData or GraphLinksModel#setToKeyForLinkData or other similar methods. This method does not conduct a transaction, so you need to start and commit one yourself.
It is better to call Model#addNodeData, Model#removeNodeData, GraphLinksModel#addLinkData, GraphLinksModel#removeLinkData, Model#setDataProperty, and other model methods to add/remove/modify data, because those methods will both record changes for undo/redo and will update all bindings that make depend on that property. Simply modifying the data and calling an "update..." method will not be able to record the previous value(s) of properties in the model data to support undo.
This only adds, removes, or updates the relationships between nodes and links, to have them reflect what is now declared in the model data. If you know which model data objects have been modified, it will be more efficient to update only the Parts that need it by calling Part#updateRelationshipsFromData.
To update GraphObject properties that are data bound, call #updateAllTargetBindings. @see #updateAllTargetBindings @since 1.5
Implementation
void updateAllRelationshipsFromData() {
_i4.callMethod(
this,
'updateAllRelationshipsFromData',
[],
);
}