vega-lite icon indicating copy to clipboard operation
vega-lite copied to clipboard

Projected nearest should not need a Voronoi transform

Open domoritz opened this issue 2 years ago • 1 comments

A common interaction is to show a line chat with a line for a tooltip at the x-location of some data. https://vega.github.io/vega-lite/examples/interactive_multi_line_pivot_tooltip.html is an example of such a chart and it uses a projected nearest selection. Since we only need to find the closest point on x, we don't really need a full Voronoi tessellation of the space. We could find the closest point with just a binary search (assuming the data is sorted) for example.

domoritz avatar Dec 21 '21 20:12 domoritz

@arvind am I missing something here? Voronoi seems overkill for the simple case of finding the nearest point along an axis.

domoritz avatar Dec 21 '21 20:12 domoritz