Tree Mapping :: Need to replace the whole Diagram model

How to replace the whole Diagram.model . I have the nodeDataArray structure thats is displaying in the tree format. I need to replace the whole nodeDataArray format with the new values otherwise need to change the entrie diagram model.

How to change and make the tree with new nodeDataArray. Could you please explain?

Any code ?

Just set Model.nodeDataArray with your new Array of node data objects.

If you want to replace the Model.nodeDataArray, you may want to consider calling UndoManager.clear, if you don’t want to retain any of the Nodes that may have been modified from before. (But this doesn’t apply if you haven’t enabled the UndoManager.)

If you want to replace all of the nodes, you probably also want to replace the GraphLinksModel.linkDataArray, yes? That’s why I was suggesting that it would be easier to replace the whole model, in exactly the same manner that you did when setting up the diagram – whatever you did to set Diagram.model.