var svg = d3.select('body').append('svg') .attr('width', width) .attr('height', height) .on('mousemove', function() { console.log( d3.event.clientX, d3.event.clientY ) // log the mouse x,y position });