-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Plotly relayout issue when changing height on histograms #2020
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
It's a bit difficult to understand the problem. I've cleaned up your input for readability, but could you fork and modify this codepen to demonstrate the issue? Thanks! https://codepen.io/rsreusser/pen/ZXWLxy?editors=1010 (Also, |
Ah, thanks for cleaning up the issue a bit! I can now reproduce the issue here: https://codepen.io/rsreusser/pen/ZXWLxy?editors=1010 |
@rreusser Thank you for the very prompt response! I have updated the Original Post with a working example (which is identical to the non-working but has the 2nd trace removed) |
No problem. Here's a much more minimal reproduction that shows the same issue: Plotly.plot('graph', [{
"type": "histogram",
"x": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4],
}, {
"type": "histogram",
"x": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4],
}]).then(function () {
return Plotly.relayout('graph', {width: 500});
}); Stack trace:
The issue seems to be with the lines: var nMax = size.length;
// bin the data
for(i = 0; i < pos0.length; i++) {
n = Lib.findBin(pos0[i], bins);
if(n >= 0 && n < nMax) total += binFunc(n, i, size, rawCounterData, counts);
} Though I'm having trouble figuring out exactly what the problem is via the chrome debugger alone. Seems to happen only when two histogram traces are present, not just one. Thoughts, @alexcjohnson? Source of the error seems like this neighborhood in |
@popepay The cause isn't 100% clear yet, but hopefully it's at least fairly easy to solve at this point. Thanks for helping clarify! Definitely seems like something's not quite right though. Probably won't get resolved in the next couple hours, but hopefully should be able to get it fixed pretty quickly and released pretty soon. |
Is there anything I should do to update https://cdn.plot.ly/plotly-latest.js / plotly-min.js ? thanks again for finding the glitch! |
Wait until |
Hello,
I noticed a strange issue when changing the height of that particular plot.
Link to example (working & non-working):
https://codepen.io/cariacou/pen/VMapvo
Source of the error seems to be that pos0 is undefined
Thanks to @rreusser for helping me through the bug reporting. Now the post should be a lot more readable.
I have updated this post with the work he did in order to have all the information in one place
The text was updated successfully, but these errors were encountered: