Skip to content

Sort ribbon/area in setup_data #3023

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 3 commits into from
Dec 4, 2018
Merged

Conversation

thomasp85
Copy link
Member

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

Choose a reason for hiding this comment

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

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

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
@clauswilke
Copy link
Member

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

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

@lock
Copy link

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
Development

Successfully merging this pull request may close these issues.

2 participants