I am trying to add text label to nodes in d3 Force Directed Graph, there seems to be an issue. This is my Fiddle:
When I add the node name like this:
node.append("text")
.attr("class", "word")
.attr("dy", ".35em")
.text(function(d) {
console.log(d.name);
return d.name;
});
There's no change but the names are getting logged.
When i tried using bounding box , the node labels appeared but the nodes are stacked up on the top-left corner of box while the node links are fine.This fiddle is the outcome of that effort i put in. Can anyone tell me what am i doing wrong?