@@ -383,44 +383,40 @@ rel <- function(x) {
383
383
structure(x , class = " rel" )
384
384
}
385
385
386
- # ' @export
387
- `$.ggplot2::element` <- function (x , i ) {
388
- # deprecate_soft0("4.1.0", I("`<ggplot2::element>$i`"), I("`<ggplot2::element>@i`"))
389
- `[[`(S7 :: props(x ), i )
390
- }
391
-
392
- # ' @export
393
- `[.ggplot2::element` <- function (x , i ) {
394
- # deprecate_soft0("4.1.0", I("`<gglot2::element>[i]`"), I("`S7::props(<ggplot2::element>, i)`"))
395
- `[`(S7 :: props(x ), i )
396
- }
397
-
398
- # ' @export
399
- `[[.ggplot2::element` <- function (x , i ) {
400
- # deprecate_soft0("4.1.0", I("`<ggplot2::element>[[i]]`"), I("`S7::prop(<ggplot2::element>, i)`"))
401
- `[[`(S7 :: props(x ), i )
402
- }
403
-
404
- # ' @export
405
- `$<-.ggplot2::element` <- function (x , i , value ) {
406
- # deprecate_soft0("4.1.0", I("`<ggplot2::element>$i <- value`"), I("`<ggplot2::element>@i <- value`"))
407
- S7 :: props(x ) <- `[[<-`(S7 :: props(x ), i , value )
408
- x
409
- }
410
-
411
- # ' @export
412
- `[<-.ggplot2::element` <- function (x , i , value ) {
413
- # deprecate_soft0("4.1.0", I("`<ggplot2::element>[i] <- value`"), I("`S7::props(<ggplot2::element>)[i] <- value`"))
414
- S7 :: props(x ) <- `[<-`(S7 :: props(x ), i , value )
415
- x
416
- }
386
+ # Element getter methods
387
+ local({
388
+ S7 :: method(`$` , element ) <- function (x , i ) {
389
+ # deprecate_soft0("4.1.0", I("`<ggplot2::element>$i`"), I("`<ggplot2::element>@i`"))
390
+ `[[`(S7 :: props(x ), i )
391
+ }
392
+ S7 :: method(`[` , element ) <- function (x , i ) {
393
+ # deprecate_soft0("4.1.0", I("`<gglot2::element>[i]`"), I("`S7::props(<ggplot2::element>, i)`"))
394
+ `[`(S7 :: props(x ), i )
395
+ }
396
+ S7 :: method(`[[` , element ) <- function (x , i ) {
397
+ # deprecate_soft0("4.1.0", I("`<ggplot2::element>[[i]]`"), I("`S7::prop(<ggplot2::element>, i)`"))
398
+ `[[`(S7 :: props(x ), i )
399
+ }
400
+ })
417
401
418
- # ' @export
419
- `[[<-.ggplot2::element` <- function (x , i , value ) {
420
- # deprecate_soft0("4.1.0", I("`<ggplot2::element>[[i]] <- value`"), I("S7::prop(<ggplot2::element>, i) <- value"))
421
- S7 :: props(x ) <- `[[<-`(S7 :: props(x ), i , value )
422
- x
423
- }
402
+ # Element setter methods
403
+ local({
404
+ S7 :: method(`$<-` , element ) <- function (x , i , value ) {
405
+ # deprecate_soft0("4.1.0", I("`<ggplot2::element>$i <- value`"), I("`<ggplot2::element>@i <- value`"))
406
+ S7 :: props(x ) <- `[[<-`(S7 :: props(x ), i , value )
407
+ x
408
+ }
409
+ S7 :: method(`[<-` , element ) <- function (x , i , value ) {
410
+ # deprecate_soft0("4.1.0", I("`<ggplot2::element>[i] <- value`"), I("`S7::props(<ggplot2::element>)[i] <- value`"))
411
+ S7 :: props(x ) <- `[<-`(S7 :: props(x ), i , value )
412
+ x
413
+ }
414
+ S7 :: method(`[[<-` , element ) <- function (x , i , value ) {
415
+ # deprecate_soft0("4.1.0", I("`<ggplot2::element>[[i]] <- value`"), I("S7::prop(<ggplot2::element>, i) <- value"))
416
+ S7 :: props(x ) <- `[[<-`(S7 :: props(x ), i , value )
417
+ x
418
+ }
419
+ })
424
420
425
421
# ' @export
426
422
print.rel <- function (x , ... ) print(noquote(paste(x , " *" , sep = " " )))
0 commit comments