Skip to content

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

Closed
wants to merge 16 commits into from
Closed

Conversation

Katiedaisey
Copy link
Contributor

@Katiedaisey Katiedaisey commented Mar 10, 2016

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 an element_blank() element such as panel.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))
rplot01

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)))
rplot02

p + theme_classic() + theme(panel.grid.major = element_line(colour = "pink", size = rel(4)))
rplot03

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.

@Katiedaisey
Copy link
Contributor Author

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.

@hadley
Copy link
Member

hadley commented Jul 29, 2016

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.

@hadley
Copy link
Member

hadley commented Sep 20, 2016

@Katiedaisey thanks for your work on this! We've decided to go a slightly different route though (as you've seen)

@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.

3 participants