d3-quadtree
d3-quadtree copied to clipboard
Allow filters on quadtree.find
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.
Implemented by https://github.com/d3/d3-quadtree/pull/28 ; please test & comment!
demo @ https://observablehq.com/d/07d5853f05318fb2