score:1

Accepted answer

I've just come across the same issue elsewhere. It is because the text wrap function cannot act on a transition, it requires a selection. To fix your code, just move the text addition and wrap calls to prior to the transition:

node
  .selectAll("text.nodeText")
  .text(function(d) {
    return d.name;
  })
  .call(wrap, 130);

var nodeUpdate = node
  .transition()
  .duration(duration)
  .attr("transform", function(d) {
    return "translate(" + d.y + "," + d.x + ")";
  });

nodeUpdate
  .selectAll("text.nodeText")
  .style("fill-opacity", 1)

Related Query

More Query from same tag