Skip to content
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 errorbars for Plotly.react and for uneven data arrays #2360

Merged
merged 1 commit into from
Feb 12, 2018

Conversation

alexcjohnson
Copy link
Collaborator

Noticed this morning during a discussion with @VeraZab - error bars still filled in [] during supplyDefaults. When fixing that I also noticed that we weren't allowing uneven array/arrayminus, not a big deal but if you're doing manual data entry it would be nice to see the two halves of the errorbar show up independently. Ideally this would also remove the cap from the missing end of the bar, as I have it here it just sets the missing end to zero length so that the cap shows up on top of the data point; if anyone can think of a use case for this as a final state of the plot (as opposed to an intermediate state while you're typing the rest of the data) I'd be happy to extend it to omit that cap but if not it seemed like unnecessary extra complexity.


if(symmetric || arrayminus === undefined) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this (removing || arrayminus === undefined) isn't actually a change in behavior, since we were filling in [] at the supplyDefaults step anyway

"type": "data",
"symmetric": false,
"visible": true
},
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added x errorbars with no data so that the image wouldn't change, but it would have failed before this fix in plot_api_test

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the comment 📚

@@ -105,7 +104,9 @@ module.exports = function plot(traces, plotinfo, transitionOpts) {

yerror.attr('d', path);
}
else yerror.remove();
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

another bug fixed here (and tested below) - if you deleted some data from your errorbar data arrays, the corresponding errorbar was not removed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch 🎣

@etpinard
Copy link
Contributor

Nicely done 💃

@alexcjohnson alexcjohnson merged commit cd79f0d into master Feb 12, 2018
@alexcjohnson alexcjohnson deleted the react-errorbars branch February 12, 2018 23:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants