S7 theme elements#6355
Closed
teunbrand wants to merge 65 commits intotidyverse:mainfrom
Closed
Conversation
This reverts commit b038e8f.
yjunechoe
pushed a commit
to yjunechoe/ggplot2
that referenced
this pull request
Mar 8, 2025
…6335) * Document vector passing to position_nudge * Put nudge_y into aes call As discussed in tidyverse#6355. * Update documentation * redocument --------- Co-authored-by: Teun van den Brand <[email protected]>
Collaborator
Author
|
A few things to consider:
|
Merge branch 'main' into S7_elements # Conflicts: # R/geom-label.R # R/guide-.R # R/margins.R # R/theme-elements.R # R/theme.R # man/is_tests.Rd # tests/testthat/test-theme.R
Collaborator
Author
|
An update:
With that, I think 90% of the worries are gone. Packages that implement their own elements will still need to update, but that should be a manageable number of packages. As such, this PR is ready for review. |
Merge branch 'main' into S7_objects # Conflicts: # R/aes.R # R/plot-construction.R # R/plot.R # R/theme.R
thomasp85
approved these changes
May 14, 2025
Merge branch 'main' into S7_elements # Conflicts: # DESCRIPTION
Merge branch 'main' into S7_objects # Conflicts: # DESCRIPTION
Merge branch 'S7_objects' into S7_elements # Conflicts: # NAMESPACE # R/plot-construction.R # R/theme.R # R/zzz.R # man/ggplot_add.Rd # tests/testthat/test-theme.R
Collaborator
Author
|
Closing, because merged with #6364 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR aims to fix part of #6352.
In essence it converts all S3
element_*()functions andmargin()to S7 classes.As it stands, there are some backwards compatibility issues for extensions:
inherits(x, "element_blank")will no longer work. From 4.3.0 onwards, usinginherits(x, element_blank)will work, andS7::S7_inherits(x, element_blank)should work. Alternatively, one could in theory useinherits(x, c("element_blank", "ggplot2::element_blank"))for backward compatibility, but it'd require a change in the extension.$,[or[[of properties will no longer work and extensions will have to use@. On ggplot2's end, we can provide methods for the typical generics, but we'd run into Weird S7/S3 interaction RConsortium/S7#390.marquee::element_marquee()orggtext::element_markdown()will also have to write their elements as S7 classes. I cannot see a good solution to have this be backwards compatible.