rebuildParts method
Remove all of the Parts created from model data and then create them again. This must be called after modifying or replacing any of the template maps such as #nodeTemplateMap. This re-selects all of the new Parts that were created from data of the original selected Parts.
If you modify a template Map, there is no notification that the map has changed. You will need to call rebuildParts explicitly. If you are replacing the #nodeTemplate or the #nodeTemplateMap or the corresponding properties for Groups or Links, the Diagram property setters will automatically call rebuildParts.
It is extremely wasteful to call this method after making some model data changes that you want to be reflected in the diagram. Instead, it is better call Model#setDataProperty, Model#addNodeData, Model#removeNodeData, or other model methods. Not only do those methods update efficiently, they also preserve unbound state and support undo/redo.
Implementation
void rebuildParts() {
_i4.callMethod(
this,
'rebuildParts',
[],
);
}