You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The internal function calc_element() assumes that parent and child elements always have exactly the same set of member variables. In the general case, this is not going to be the case, in particular if we want to enable new elements such as element_markdown() or element_textbox().
Reprex:
library(ggplot2)
# like element_rect but with a meaningless dummy argumentelement_dummyrect<-function(fill=NULL, colour=NULL, dummy=NULL, size=NULL,
linetype=NULL) {
structure(
list(
fill=fill, colour=colour, dummy=dummy, size=size,
linetype=linetype, inherit.blank=FALSE
),
class= c("element_dummyrect", "element_rect", "element")
)
}
ggplot2:::calc_element(
"panel.background",
theme(
rect= element_rect(fill="white", colour="black", size=0.5, linetype=1),
panel.background= element_dummyrect(dummy=5))
)
#> Warning in e1[n] <- e2[n]: number of items to replace is not a multiple of#> replacement length#> List of 6#> $ fill : chr "white"#> $ colour : chr "black"#> $ dummy : num 0.5#> $ size : num 1#> $ linetype : NULL#> $ inherit.blank: chr "white"#> - attr(*, "class")= chr [1:3] "element_dummyrect" "element_rect" "element"
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/
lockbot
locked and limited conversation to collaborators
Apr 15, 2020
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The internal function
calc_element()
assumes that parent and child elements always have exactly the same set of member variables. In the general case, this is not going to be the case, in particular if we want to enable new elements such aselement_markdown()
orelement_textbox()
.Reprex:
Created on 2019-10-04 by the reprex package (v0.3.0)
Session info
The offending code is here:
ggplot2/R/theme.r
Lines 657 to 659 in 047b528
Because it uses logical indexing instead of name indexing, it breaks if the two elements have different named components. I will prepare a fix.
The text was updated successfully, but these errors were encountered: