Skip to content

Change behaviour of theme_update to be more like an update #1519

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 7 commits into from
Feb 4, 2016

Conversation

oneillkza
Copy link

Per discussion in #1489, this changes theme_update() to use the + operator, so that unspecified attributes of the element being set are taken from the current theme, rather than NULLing them out. I've added theme_replace() with the same behaviour as the current theme_update(), in case that behaviour is desired (though I'm hard-pressed to think of a use case).

I've also added some verbiage to the documentation clarifying what these do, along with examples.

koneill added 3 commits January 25, 2016 14:16
…g theme_replace that has the same behaviour as the old theme_update. Also expanded and clarified the documentation for these.
@hadley
Copy link
Member

hadley commented Jan 26, 2016

@wch do you remember the motivation for using %+replace% here?

#' @export

theme_replace <- function(...) {
# Make a call to theme, then add to theme
Copy link
Member

Choose a reason for hiding this comment

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

Can you please remove this comment? (and in the previous fun)

@hadley
Copy link
Member

hadley commented Jan 31, 2016

Looks good. Just a few minor tweaks and can you please add a bullet point to NEWS?

@hadley hadley modified the milestone: v2.1.0 Jan 31, 2016
@oneillkza
Copy link
Author

Done!

@@ -1,5 +1,9 @@
# ggplot2 2.0.0.9000

* `theme_update()` now uses the `+` operator instead of `%+replace%`, so that
unspecified values will no longer be `NULL`ed out. `theme_replace()`
preserves the old behaviour if desired (#1519).
Copy link
Member

Choose a reason for hiding this comment

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

Could you please cite your github user name in the brackets?

@oneillkza
Copy link
Author

Done!

@hadley hadley merged commit 4b7fcbd into tidyverse:master Feb 4, 2016
@hadley
Copy link
Member

hadley commented Feb 4, 2016

Thanks!

@lock
Copy link

lock bot commented Jan 18, 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 Jan 18, 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