d3-quadtree icon indicating copy to clipboard operation
d3-quadtree copied to clipboard

Allow filters on quadtree.find

Open bmschmidt opened this issue 8 years ago • 1 comments

I like to use an optional filter argument with the find method so that the search can return only the nearest relevant point (e.g.: the nearest red point if blue points have been temporarily hidden by a user interaction). The basic fork that works for my purposes is extremely simple; it would take slightly more work to properly handle coincident points.

Something like this is referenced in an existing pull discussion. Happy to file a pull request for just this if desired.

bmschmidt avatar Jun 13 '17 17:06 bmschmidt

Implemented by https://github.com/d3/d3-quadtree/pull/28 ; please test & comment!

demo @ https://observablehq.com/d/07d5853f05318fb2

Fil avatar Jun 05 '20 14:06 Fil