SVG
<svg width="200" height="200">
<g id="group">
<rect x="10" y="10" width="50" height="20" fill="teal"></rect>
<circle cx="35" cy="40" r="20" fill="red"></circle>
</g>
<circle id="ref_cycle" cx="135" cy="140" r="2" fill="green"></circle>
</svg>
I have been using the code below to create a copy of <g id="group">
and display it on the page:
var copy = d3.select("#group").clone(true).attr("transform", "translate(20,00)");
Now, I would like the cloned group's center align red "circle" with the center of the "ref_cycle" in the SVG without losing the shape of the group. Can anyone provide guidance on how to achieve this through code?
Thank you in advance.