After finding a solution to the issue in this question Insert text inside Circle in D3 chart
I have encountered an unexpected behavior where my nodes are not positioned correctly. I am unsure about which property is controlling the x and y coordinates of my nodes. Recently, I made changes to my code to include a g
layer to the circles so that text can also be appended along with shapes.
DATA
UPDATED CODE
// Updated code snippet will go here
UPDATED OUTPUT https://i.sstatic.net/9GSlw.png
EXPECTED OUTPUT https://i.sstatic.net/zF1Ti.png
UPDATED HTML
<g stroke="#fff" stroke-width="1.5">
<g class="circle" cx="-35.89111508769784" cy="131.13965804447696">
<circle class="circle" r="5" fill="#1b9e77"></circle>
<text class="circleText" dy="0.35em" dx="5">Node: 0</text>
<title>Node: 0</title>
</g>
<g class="circle" cx="70.97799024729613" cy="-195.71408429254427">
<circle class="circle" r="5" fill="#d95f02"></circle>
<text class="circleText" dy="0.35em" dx="5">Node: 3</text>
<title>Node: 3</title>
</g>
[....]
</g>