I've been attempting to include labels within my node, but for some reason it's not working as expected.
//creating circles for the nodes
var node = g.append("g")
.attr("class", "nodes")
.selectAll("circle")
.data(nodes_data)
.enter()
.append("circle")
.attr("r", radius)
.attr("fill", circleColour);
node.append("text")
.attr("dx", 12)
.attr("dy", ".35em")
.text(function (d) { return d.name });
Upon inspecting the elements of the node, I can see that the text is indeed inside the node:
<circle r="15" fill="blue" style="touch-action: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);" cx="421.4930863434973" cy="221.26393165638473"><text dx="12" dy=".35em">some name</text></circle>
Despite this, the text is not displaying in the chart. Can anyone offer assistance with this issue? Here is the link to the full plunkr: