score:0

Try this.

Method 1:

var node = element.find('circle.nodeCircle')[0];
var left = node.getBBox().x;    
var top = node.getBBox().y;

Read about getBBox method

Method 2:

var node = element.find('circle.nodeCircle');
var rad = node.attr('r');
var data = d3.select(node[0]).data();
var left  = data.x-rad;
var top  = data.y-rad;

Hope this helps.


Related Query

More Query from same tag