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

Sort ribbon/area in setup_data #3023

Merged
merged 3 commits into from Dec 4, 2018
Merged

Sort ribbon/area in setup_data #3023

merged 3 commits into from Dec 4, 2018

Conversation

@thomasp85
Copy link
Member

@thomasp85 thomasp85 commented Dec 4, 2018

This PR streamlines the handling of data in line-like gloms where an implicit sorting of data along the x-axis is happening. Previously GeomLine had the sorting happening in setup_data while GeomRibbon (and by extension GeomArea) had it inside draw_group.

The motivation is that it solves some issues in gganimate that couldn't be fixed outside of ggplot2, but I also think that conceptually this is the right approach, and we should be consistent in how we treat data operations across kindred geoms/stats

Copy link
Member

@clauswilke clauswilke left a comment

Looks good to me. It might cause some downstream effects though for any third-party geoms that inherit from GeomArea and expect the old behavior, so maybe make a note of this change in NEWS.md.

@thomasp85
Copy link
Member Author

@thomasp85 thomasp85 commented Dec 4, 2018

Yeah, maybe... I think in the worst case they just do an additional sort on an already sorted data.frame, but who knows... I'll add a note

@thomasp85 thomasp85 merged commit a8e9668 into tidyverse:master Dec 4, 2018
0 of 2 checks passed
@clauswilke
Copy link
Member

@clauswilke clauswilke commented Dec 4, 2018

Actually, if they implement their own setup_data() function but use the draw_group() function provided by GeomRibbon then they'll draw unsorted data. Just like you had to fix setup_data() for GeomArea.

@thomasp85
Copy link
Member Author

@thomasp85 thomasp85 commented Dec 4, 2018

That is true. The note is there anyway, but I don’t expect any problems

@lock
Copy link

@lock lock bot commented Jun 2, 2019

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 Jun 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants