Hi have a D3 SVG object:
d3.select("#chart").append("svg")
.attr('id', 'chartId' + idx)
To which I append rects to create a bar chart.
I would like to be able to add and remove it from the DOM.
I am able to remove it easily with:
d3.select('svg#chartId' + j).remove();
How can I re-append the entire SVG chart I just removed?
Use
detach()instead ofremove()OR
Later..