Skip to content

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

Merged
merged 2 commits into from
May 23, 2019

Conversation

archmoj
Copy link
Contributor

@archmoj archmoj commented Mar 18, 2019

Fix #3630.
Codepens:
Before.
After.
@plotly/plotly_js

@archmoj archmoj added bug something broken status: reviewable labels Mar 18, 2019
@@ -71,6 +71,8 @@ function styleOnSelect(gd, cd) {
stylePointsInSelectionMode(s, trace, gd);
} else {
stylePoints(s, trace, gd);

Registry.getComponentMethod('errorbars', 'style')(s);
Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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?

Copy link
Contributor

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.

Copy link
Contributor Author

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.

@etpinard
Copy link
Contributor

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!

@archmoj archmoj merged commit 1b607c3 into master May 23, 2019
@archmoj archmoj deleted the fix3630-errorbars-disappear-after-double-click branch May 23, 2019 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken regression this used to work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error lines disappear on bar plots after box select and double click on the white space
2 participants