-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Bug fix errorbars on bar trace may disappear after switch modebar to select and double click #3644
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
Bug fix errorbars on bar trace may disappear after switch modebar to select and double click #3644
Conversation
@@ -71,6 +71,8 @@ function styleOnSelect(gd, cd) { | |||
stylePointsInSelectionMode(s, trace, gd); | |||
} else { | |||
stylePoints(s, trace, gd); | |||
|
|||
Registry.getComponentMethod('errorbars', 'style')(s); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm. I'm not sure this is the correct fix. Look at https://codepen.io/etpinard/pen/gEKqgj?editors=1010 (the same as your before example, but with scatter traces). Selection doesn't dim the error bars.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Back in 1.36.0, selecting bars didn't dim the associated error bars: https://codepen.io/etpinard/pen/jJKdYN?editors=1000
We should probably eventually add a way to dim the error bars on selections (by adding a [un]selected.error_(x|y).color
or by adding a trace-wide [un]selected.opacity
), but that's for another day.
To fix this bug, I think we should make sure error bars on bar traces don't get dimmed on selection by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The bar version is different from scatter
possibly because in bar
the select deals with both bar points and errorbar points. So I still think it may be a good patch to solve the regression.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.... and why should scatter and bar error bars behave differently?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... but yeah you're right that the regression is way worse than the inconsistency this fix brings up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.... and why should scatter and bar error bars behave differently?
In scatter
within stylePoint
function selectAll('path.point')
is applied; whereas in bar
within stylePoint
function selectAll('path')
is applied which resulted in errorbars being selected after click.
Like you said #3630 is a (pretty bad) regression, so I'll give you a 💃 to get this in the next release. That said, please open a new issue describing the selected/unselected inconsistency between bar and scatter. Thanks! |
Fix #3630.
Codepens:
Before.
After.
@plotly/plotly_js