-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[charts] Store voronoi graph in the data space not the rendering one #15737
Comments
I was taking a look at this issue and a couple of questions came up. The goal seems to be avoiding re-creating the From there, for each X, Y axes combination, we'll find the closest point using Finally, we check if the closest point, in pixels, is within the Voronoi max radius as we do now. Does this sound good? Do you see any potential for improvement? I don't love that we're creating a new Another point is the type of scales. It seems we support a set of D3 scales. Band scales are part of this set, but they don't have an invert function. However, there seems to be a way of implementing an invert-like function for band scales. Nevertheless, this raises a couple of questions:
|
I was surprised I took such a weird decision as doing all the compûtation in the px dimensions and not the value, but not having to handle those edge cases of band, points (but also Date) scale migth be the reasons. From the various points you mentioned, I end up thinking about the following issue: If we have multiple y-axis and zoom on one of them, the result will need to be updated. Since it looks complex, we might reconsider the goal. We could investigate following points
Depending on those results, maybe the solution is not to revert the space of commputation, but block the voronoid update while the zoom is active. Having an update when zoom end instead of one at each step coudl already be an improvement. |
Yeah, I just checked. We're creating an instance of the |
Currently, the voronoi is computed in the rendering space. Which means each time a user zoom, the scale is updated and we need to compute back the voronoi graph.
Instead we should compute in the data space and call the
scale.invert()
to map mouse coordinates to data values.Search keywords:
The text was updated successfully, but these errors were encountered: