Couple issues:
1.) You have a couple blank lines at the end of your tsv file, this is introducing bogus data into your plot.
2.) You've wrapped your circles in a g
element. The g
group is an "empty" container and doesn't receive mouse events. One trick here it to fill your empty space with an element that does, like a rect
.
var svg = d3.select("body").append("svg")
.attr("width", width + margin.left + margin.right)
.attr("height", height + margin.top + margin.bottom)
.append("g")
.attr("transform", "translate(" + margin.left + "," + margin.top + ")");
svg.append("rect")
.attr('fill','none')
.attr('pointer-events', 'all')
.attr("width", width + margin.left + margin.right)
.attr("height", height + margin.top + margin.bottom)
.attr("class","chartArea");
Then mouseover becomes:
d3.select(".chartArea").on("mousemove", function() {
fisheye.focus(d3.mouse(this));
...
Updated example.