score:3

Accepted answer

You can assign mousedown event to the text element with d3.event.stopPropagation(). Would be something like that:

  generateBubbleNames(nodes){
    var maxCharacters = 10;
    var labels = nodes.selectAll("text.label")
    .data(function(d) { return [d]; });

    labels.enter().append("text")
      .attr({
      "class": "label",
      dy: "0.35em"
    })
    .style("text-anchor", "middle")
    .style("font-size", function(d) { return d.r / 3; })
    .text(function(d) {
      return d[0]
    })
    .on("mousedown", function(){
      d3.event.stopPropagation();
    })
  }

Here's a working example:

JsFiddle


Related Query