Skip to content
This repository has been archived by the owner on Dec 14, 2019. It is now read-only.

Compute data hover using voronoi diagram #126

Open
billyjanitsch opened this issue Jun 7, 2018 · 0 comments
Open

Compute data hover using voronoi diagram #126

billyjanitsch opened this issue Jun 7, 2018 · 0 comments

Comments

@billyjanitsch
Copy link
Collaborator

Profiling the stress test in #123, I noticed that 40% of each frame is spent calling isPointInStroke to compute which datum the mouse is hovering over. (This use of isPointInStroke is also the only reason that orama requires a polyfill to support IE 11, AFAIK.)

screen shot 2018-06-06 at 7 44 58 pm

Instead of this canvas-based approach, we could collapse all data into a voronoi diagram, and use it to determine the closest datum to a given mouse position, which would be relatively instantaneous. Here's an example of that approach.

(This would change the existing hover behavior, arguably for the better.)

@billyjanitsch billyjanitsch changed the title Improve data hover performance Compute data hover using voronoi diagram Jun 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant