I\'m trying to create a tree using D3 and am having trouble changing the text of my nodes after changing dataset. My code for updating/creating the tree is pasted below:
You are not updating the text in the update selection. To do that, use something like the following code:
nodeUpdate.select("text") .text(function(d) { console.log(d.name); return d.name; }) .style("fill-opacity", 1);