I have a simple angular and D3js app that draws svg's. Now I want the user to have multiple tabs. The problem is I am using DOM selection to draw and change the svg so changing it in one tab will change it in every tab. I tried looking at draw.io how they do it but switching tabs only changes the g elements inside the svg when inspecting it in developer tool. What is the best way to do this?