into a separate cell, I think youâll find that you get a list of several SVGPathElements. On the other hand,
d3.selectAll("g#valLine>path").clone(true).node()
yields just a single SVGPathElement.
Unfortunately, you canât just change your node() to nodes(), because itâs a list, rather than any type of SVG element. Perhaps you could do something like:
let nodes = d3.selectAll("g#valLine>path").clone(true).nodes();
nodes.forEach(node => append_the_node)
Even simpler, you could select g#valLine and just clone and append that.
I gotta say that a selector like 'body > svg > g.bound > g.textLabel' seems amazingly specific. Unless thereâs a highly detailed structure for your SVG that must be preserved, it seems like the code could be easier.