-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
stacked histograms have different start/end values on hover #4648
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
Comments
@alexcjohnson is this a bug? |
Yes, bug. I forget how that calculation works but whatever it does should be shared by all traces in a group or stack. |
The test added in ee1a6ba showcases the problem at hand. The problem comes from the fact that each trace has its own rounding function plotly.js/src/traces/histogram/calc.js Lines 112 to 131 in 9a75ef0
which then sets the hover values that end up being different: plotly.js/src/traces/histogram/calc.js Lines 176 to 177 in 9a75ef0
|
One possible solution is to defer the evaluation of cc @alexcjohnson @archmoj can you have a look at it? |
Ideally things like this belong in |
I forgot that
I understand that we may not want to add latency to something interactive. Computing everything in advance is probably a better approach considering we don't usually have a lot of bars. Thanks for the review @alexcjohnson |
Another solution using |
The https://codepen.io/nicolaskruchten/pen/BaNxYzM is fixed in your branch |
Actually using the bundle from |
@antoinerg the approach in |
You were exactly right @alexcjohnson! Fixed in 374941b |
That'll work! I believe the index is simply offset between traces, so it might be more efficient just to store it once, something like |
Sounds good. In the end, I think I will use my first approach of preparing functions in |
When deferring the evaluation of @alexcjohnson I think you wrote |
https://codepen.io/nicolaskruchten/pen/BaNxYzM
This is weird:
The text was updated successfully, but these errors were encountered: