Skip to content

Commit 58200dd

Browse files
committed
express optional aesthetics as NULL-aesthetics in default_aes
1 parent 4fafb96 commit 58200dd

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

R/geom-rug.R

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ geom_rug <- function(mapping = NULL, data = NULL,
8686
#' @usage NULL
8787
#' @export
8888
GeomRug <- ggproto("GeomRug", Geom,
89-
optional_aes = c("x", "y"),
9089

9190
draw_panel = function(self, data, panel_params, coord, lineend = "butt",
9291
sides = "bl", outside = FALSE, length = unit(0.03, "npc")) {
@@ -153,7 +152,7 @@ GeomRug <- ggproto("GeomRug", Geom,
153152
gTree(children = inject(gList(!!!rugs)))
154153
},
155154

156-
default_aes = GeomPath$default_aes,
155+
default_aes = aes(x = NULL, y = NULL, !!!GeomPath$default_aes),
157156

158157
draw_key = draw_key_path,
159158

R/geom-smooth.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,9 @@ GeomSmooth <- ggproto("GeomSmooth", Geom,
166166
draw_key = draw_key_smooth,
167167

168168
required_aes = c("x", "y"),
169-
optional_aes = c("ymin", "ymax"),
170169

171170
default_aes = aes(
171+
ymin = NULL, ymax = NULL,
172172
colour = from_theme(colour %||% accent),
173173
fill = from_theme(fill %||% col_mix(ink, paper, 0.6)),
174174
linewidth = from_theme(2 * linewidth),

R/stat-ellipse.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ stat_ellipse <- function(mapping = NULL, data = NULL,
7777
#' @export
7878
StatEllipse <- ggproto("StatEllipse", Stat,
7979
required_aes = c("x", "y"),
80-
optional_aes = "weight",
80+
default_aes = aes(weight = NULL),
8181
dropped_aes = "weight",
8282

8383
setup_params = function(data, params) {

0 commit comments

Comments
 (0)