k-d trees are space-partitioning data structures for organizing points in k-dimensional space. They are a useful data structure for finding, for example, the n nearest neighbors of a point in k-dimensional space.
This block provides a visualization of k-d tree creation which connects the intuition of binary trees with the concept of space partitioning.
Click on the left square to add points in a 2D projection of RGB
space.
Forked from ludwigschubert's block: kD-tree explorations in D3.js
https://code.jquery.com/jquery-3.3.1.min.js
https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.17/d3.min.js
https://cdnjs.cloudflare.com/ajax/libs/tinycolor/1.4.1/tinycolor.min.js