When I immediately go the Mapping it shows empty. even I set the diagram.div = null. But nodedataarray and linkdata also generated
myDiagram.div = null;
I do not understand your situation. Please explain to someone who does not know what you have built here exactly what HTML DOM there is and what happens when the user clicks on a “tab”. How many Diagrams are there supposed to be at any one instant?
OK, if there is only one HTML DIV for your diagrams, then I recommend that you just reuse the single Diagram instance that you first setup for that DIV element.
Showing a new “diagram” in that one Diagram instance is just a matter of replacing its Diagram.model. You never have to set Diagram.div.
If for some reason you want that DIV to be blank you can just replace the model with an empty one. Or change the DIV to be display:none.
I think due to this the code has run then nodeData & LinkData are created but its not assigned to the DIV. It shows empty. How to clear the entire diagram and assign back the new one ? Code Please…