Adding text to d3 circle
<p>I am using this example <a href="http://bl.ocks.org/danielatkin/57ea2f55b79ae686dfc7" rel="nofollow noreferrer">http://bl.ocks.org/danielatkin/57ea2f55b79ae686dfc7</a> and I am trying to add some text in the circle.</p>

<p>This is how the circles are created and placed</p>

<pre><code>    var nodes = svg.selectAll("circle")
       .data(data);

    nodes.enter().append("circle")
      .attr("class", function (d, i) { return "circle_"+d.sentiment+" circle_"+i})
      .attr("cx", function (d) { return d.x; })
      .attr("cy", function (d) { return d.x; })
      .attr("r", function (d) { return d.radius; })
      .style("fill", function (d, i) { return colors['default']; })
      .on("mouseover", function (d) { showPopover.call(this, d); })
          .on("mouseout", function (d) { removePopovers(this, true); })
          .call(pulse, function(d){ return d.radius+4; }, function(d){return d.radius; });
</code></pre>

<p>But I am getting no clue on how to add text to these circles.</p>

<p>I have already reffered <a href="https://stackoverflow.com/a/11865807/1496715">this</a> and <a href="https://stackoverflow.com/a/13627065/1496715">this</a> answer but couldn't succeed. The issue is that after following the above answers my circles stuck in a diagonal line. </p>

<p>Can someone tell me how to do this?</p>