Skip to content

Fix data ordering in PositionStack #3401

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

Closed
wants to merge 5 commits into from

Conversation

karawoo
Copy link
Member

@karawoo karawoo commented Jul 8, 2019

Fixes #3390 by resetting the data order in PositionStack after positive and negative values have been collided. I looked into this and I don't think that it causes downstream problems with plot appearance, but I don't think we can completely avoid messing with ordering in the position without causing breaking changes, as this is where we ensure that stacking order matches the default legend order, and users also have the option to alter stacking order from position_stack(reverse = TRUE). So instead I have PositionStack() resetting the order after collide(). @thomasp85 does this seem ok to you?

It did cause some test failures that all appear to be false negatives: some regular tests expected the results of layer_data() to be in a different order (but the plots look the same), and one visual test failed because the rows in the SVG were in a different order (again, the plot itself looked the same). I fixed these and added a couple extra visual tests as well. I removed the test for "negative and positive values are handled separately" as I can't think of a way to test for that after we've sorted the combined data.

@lock
Copy link

lock bot commented Feb 1, 2020

This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/

@lock lock bot locked and limited conversation to collaborators Feb 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

geom_area with negative y not working in ggplot2 3.2.0
1 participant