title: Deleting d3 svg elements for redraw
body: <p>I hope you can help me, because this is driving me nuts!</p>
  
  <p>So i was trying to redraw a svg using d3. In my code i add the svg using:</p>
  
  <pre><code>d3.xml("Images/vertical_line.svg", "image/svg+xml", function(xml) {
  
    var importedNode = document.importNode(xml.documentElement, true);
    var svg = d3.select('#'+id+'_verticallinecontainer').node().appendChild(importedNode);
  
    });
  </code></pre>
  
  <p>When my update function is called i then proceed to remove the element:</p>
  
  <pre><code>d3.select("#"+id+'_verticallinecontainer').remove();
  </code></pre>
  
  <p>This removes the container and the element. I then proceed with redrawing the svg again using the above code.</p>
  
  <p>My problem is that when it appends the svg again it does it twice and i do not understand why! It seems that d3 somehow caches the svg, adding it again.</p>
  
  <p>Hope you can help to clear out what is wrong, any help would be appreciated!</p>