Accepted answer

You can try the following plan:

As far as I understand, you want to put labels at specific arcs, based on some criteria or manually select them. So you get a subset of nodes like this:

var nodesForLabels = nodes.filter(d => d.value > 1)

After that you need to put text labels in centroids of arcs:

  .attr('x', d => arc.centroid(d)[0])
  .attr('y', d => arc.centroid(d)[1])
  .attr('text-anchor', 'middle')
  .text(d => Math.round(d.value / partition.value * 100) + '%')

More Query from same tag