I have a problem with inserting new siblings to existing elements.
I have this structure
<svg>
<g>
<path class="data"></path>
<path class="data"></path>
</g>
</svg>
and want this structure
<svg>
<g>
<path class="data"></path>
<text></text>
<path class="data"></path>
<text></text>
</g>
</svg>
but if I use the d3.js insert function
d3.select("g").insert("text", "path.data");
i get the following (despite selecting by class name)
<svg>
<g>
<text></text>
<path class="data"></path>
<path class="data"></path>
</g>
</svg>
any ideas?
See Question&Answers more detail:os