Skip to content

Commit 3bc0d63

Browse files
committed
Revert "implement $.element for backward compatibility"
This reverts commit b038e8f.
1 parent 27cdb73 commit 3bc0d63

File tree

4 files changed

+6
-16
lines changed

4 files changed

+6
-16
lines changed

NAMESPACE

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Generated by roxygen2: do not edit by hand
22

3+
S3method("$",ggproto)
4+
S3method("$",ggproto_parent)
5+
S3method("$",theme)
36
S3method("$<-",uneval)
47
S3method("+",gg)
58
S3method("[",mapped_discrete)
@@ -13,9 +16,6 @@ S3method(as.data.frame,mapped_discrete)
1316
S3method(as.list,ggproto)
1417
S3method(autolayer,default)
1518
S3method(autoplot,default)
16-
S3method(base::`$`, ggproto)
17-
S3method(base::`$`, ggproto_parent)
18-
S3method(base::`$`, theme)
1919
S3method(c,mapped_discrete)
2020
S3method(drawDetails,zeroGrob)
2121
S3method(format,ggproto)

R/ggproto.R

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,7 @@ fetch_ggproto <- function(x, name) {
152152

153153
}
154154

155-
# Prevents bug described in S7/#390
156-
#' @rawNamespace S3method(base::`$`, ggproto)
155+
#' @export
157156
`$.ggproto` <- function(x, name) {
158157
res <- fetch_ggproto(x, name)
159158
if (!is.function(res)) {
@@ -163,7 +162,7 @@ fetch_ggproto <- function(x, name) {
163162
make_proto_method(x, res, name)
164163
}
165164

166-
#' @rawNamespace S3method(base::`$`, ggproto_parent)
165+
#' @export
167166
`$.ggproto_parent` <- function(x, name) {
168167
res <- fetch_ggproto(.subset2(x, "parent"), name)
169168
if (!is.function(res)) {

R/theme-elements.R

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,6 @@ NULL
8383
#' @rdname element
8484
element <- S7::new_class("element", abstract = TRUE)
8585

86-
S7::method(`$`, element) <-
87-
function(x, i) {
88-
if (!S7::prop_exists(x, i)) {
89-
return(NULL)
90-
}
91-
S7::prop(x, i)
92-
}
93-
9486
#' @export
9587
#' @rdname element
9688
element_blank <- S7::new_class("element_blank", parent = element)

R/theme.R

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -958,8 +958,7 @@ combine_elements <- function(e1, e2) {
958958
e1
959959
}
960960

961-
# Prevents bug described in S7/#390
962-
#' @rawNamespace S3method(base::`$`, theme)
961+
#' @export
963962
`$.theme` <- function(x, ...) {
964963
.subset2(x, ...)
965964
}

0 commit comments

Comments
 (0)