This demonstrates finding the closest point to the mouse by searching a quadtree. As you descend into the quadtree, you track the closest point yet found and avoid searching cells that cannot contain closer points. Importantly, you must descend preferentially into closer cells so as to restrict the search more quickly.
Patrick Surry implemented a similar solution months earlier!
point.each(function(d) { d.scanned = false; }); => so for each datum, scanned is false
How can point.classed("scanned", function(d) { return d.scanned; }); return something else than false.
I see orange points, so obviously I'm missing something. Thanks for your help.
.attr("width", function(d) { return d.y1 - d.y0; }) // and not x
.attr("height", function(d) { return d.x1 - d.x0; }); // and not y