-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Inheritance of elements #1581
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
Inheritance of elements #1581
Conversation
necessary to solve inheritance problem
changes add_theme, combine_elements adds base_class
# Conflicts: # NEWS.md
Error catching for legend.position and legend.justification
passes all test_that checks except one
If all inherited elements are blank, the final subelement will be reassign element_blank. If any inherited elements are not blank, all subelements will retain original element_text, element_line, or element_rect and thus retain the ability to be set independently. |
I'd like to hold off on this until we have the new visual testing setup complete so that we can ensure we don't introduce any regressions. |
@Katiedaisey thanks for your work on this! We've decided to go a slightly different route though (as you've seen) |
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/ |
Fixes #1567
addresses issues #1555, #1557, #1565, #1567, inheritance in elements
previously subelements such as
panel.grid.major.x
were unable to be changed when inheriting from anelement_blank()
element such aspanel.grid.major
. Update #1557 addressed this, but left the higher element unable to be changed.p <- ggplot(mtcars) + geom_point(aes(x = wt, y = mpg, colour=factor(gear))) + theme(axis.line = element_line(colour = "pink", size = 3))
This update allows access to both subelements and higher elements:
p + theme_classic() + theme(panel.grid.major.x = element_line(colour = "pink", size = rel(4)))
p + theme_classic() + theme(panel.grid.major = element_line(colour = "pink", size = rel(4)))
and addresses the loss of axes in some themes.
The inheritance scheme necessary for this functionally causes this update to fail one test, however graphical output is as expected.