Skip to content

Conversation

@teunbrand
Copy link
Collaborator

@teunbrand teunbrand commented Sep 30, 2025

This PR fixes a pet peeve of mine: the build method(s) don't read very nicely.

First off, ggplot_build() and ggplot_gtable() are in the same file, which is messy because they are both user-facing functions, they do things independently and are also documented separately.

Secondly, I understand why ggplot_build() is hard to read: it is complicated.
However, ggplot_gtable() has a lot of gtable operation complexity, which can be easily hidden away in some choice helper functions. It becomes a lot simpler to understand what ggplot_gtable() is doing if the steps are separate functions.

@teunbrand teunbrand requested a review from thomasp85 November 18, 2025 10:28
Copy link
Member

@thomasp85 thomasp85 left a comment

Choose a reason for hiding this comment

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

I'll trust the tests to ensure you haven't messed up during copy-paste :-)

@teunbrand
Copy link
Collaborator Author

That's what tests are for!

@teunbrand teunbrand merged commit 3112348 into tidyverse:main Nov 18, 2025
13 checks passed
@teunbrand teunbrand deleted the reorganise_plot_render branch November 18, 2025 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants