I have a problem with D3, if I add an element a second time, I will get duplicate elements in the parent node.
node.enter().insert("svg:g") .attr("class", 'test') .attr("width", '63px') .attr("height", '68px') .call(force.drag); node.append("svg:circle") .attr("class", "bg-circle") .attr("r", "30px");
For example, I get:
<g class="test"> <circle class="bg-circle" /> <circle class="bg-circle" /> </g>
But I want:
<g class="test"> <circle class="bg-circle" /> </g>
Even when I call my function to set the nodes a second time.
source share