-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Fix - hide empty bars in interactive mode #4522
Conversation
Thanks @archmoj for the quick fix. After some testing, looks like the behaviour is now correct. I am a little worried though about how complex the logic in At the very least, we should add two new variables to make the logic easier to digest:
which could be in // display zeros if line.width > 0
if(isBlank && shouldDisplayZeros && helpers.getLineWidth(trace, di) && (isHorizontal ? x1 - x0 === 0 : y1 - y0 === 0)) {
isBlank = false;
} and below in if(!gd._context.staticPlot) {
// ...
if(spansHorizontal) {
x0 = fixpx(x0, x1);
x1 = fixpx(x1, x0);
}
if(spansVertical) {
y0 = fixpx(y0, y1);
y1 = fixpx(y1, y0);
}
} instead of monkey-patching the Does that sound ok to you @archmoj ? |
@etpinard that makes sense. if(v === vc) return v; to |
Hmm. Wouldn't that defeat the purpose of |
... and unfortunately we can't rely on the image tests here as this piece of logic in inside a |
OK. Addressing your #4522 (comment) sounds the safest fix. |
Yep, that's a step in the right direction - thanks 💃 |
Fixes #4499
before vs after
@plotly/plotly_js