Skip to content

Commit 58a677d

Browse files
committed
Remove expr() and update aes names
1 parent 9e1305f commit 58a677d

34 files changed

+261
-183
lines changed

R/annotation-logticks.r

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,10 +200,12 @@ GeomLogticks <- ggproto("GeomLogticks", Geom,
200200
gTree(children = do.call("gList", ticks))
201201
},
202202

203-
default_aes = expr(aes(
204-
colour = theme$geom$colour, size = 0.5, linetype = 1,
205-
alpha = theme$geom$alpha
206-
))
203+
default_aes = aes(
204+
colour = theme$geom$col,
205+
size = 0.5,
206+
linetype = 1,
207+
alpha = NA
208+
)
207209
)
208210

209211

R/geom-abline.r

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,12 @@ GeomAbline <- ggproto("GeomAbline", Geom,
121121
GeomSegment$draw_panel(unique(data), panel_params, coord)
122122
},
123123

124-
default_aes = expr(aes(
125-
colour = theme$geom$colour,
126-
size = 0.5, linetype = 1,
127-
alpha = theme$geom$alpha
128-
)),
124+
default_aes = aes(
125+
colour = theme$geom$col,
126+
size = 0.5,
127+
linetype = 1,
128+
alpha = NA
129+
),
129130

130131
required_aes = c("slope", "intercept"),
131132

R/geom-boxplot.r

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -255,11 +255,15 @@ GeomBoxplot <- ggproto("GeomBoxplot", Geom,
255255

256256
draw_key = draw_key_boxplot,
257257

258-
default_aes = expr(aes(
259-
weight = 1, colour = theme$geom$colour.accent1 ,
260-
fill = theme$geom$fill.accent, size = 0.5,
261-
alpha = theme$geom$alpha, shape = 19, linetype = "solid"
262-
)),
258+
default_aes = aes(
259+
weight = 1,
260+
colour = theme$geom$col_1 ,
261+
fill = theme$geom$fill_1,
262+
size = 0.5,
263+
alpha = NA,
264+
shape = 19,
265+
linetype = "solid"
266+
),
263267

264268
required_aes = c("x", "lower", "upper", "middle", "ymin", "ymax")
265269
)

R/geom-contour.r

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,11 @@ geom_contour <- function(mapping = NULL, data = NULL,
7373
#' @export
7474
#' @include geom-path.r
7575
GeomContour <- ggproto("GeomContour", GeomPath,
76-
default_aes = expr(aes(
77-
weight = 1, colour = theme$geom$colour.accent2,
78-
size = 0.5, linetype = 1, alpha = theme$geom$alpha
79-
))
76+
default_aes = aes(
77+
weight = 1,
78+
colour = theme$geom$col_2,
79+
size = 0.5,
80+
linetype = 1,
81+
alpha = NA
82+
)
8083
)

R/geom-crossbar.r

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,13 @@ GeomCrossbar <- ggproto("GeomCrossbar", Geom,
3232
GeomErrorbar$setup_data(data, params)
3333
},
3434

35-
default_aes = expr(aes(
36-
colour = theme$geom$colour, fill = NA, size = 0.5,
37-
linetype = 1, alpha = theme$geom$alpha
38-
)),
35+
default_aes = aes(
36+
colour = theme$geom$col,
37+
fill = NA,
38+
size = 0.5,
39+
linetype = 1,
40+
alpha = NA
41+
),
3942

4043
required_aes = c("x", "y", "ymin", "ymax"),
4144

R/geom-curve.r

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,13 @@ geom_curve <- function(mapping = NULL, data = NULL,
4040
#' @usage NULL
4141
#' @export
4242
GeomCurve <- ggproto("GeomCurve", GeomSegment,
43-
default_aes = expr(aes(
44-
colour = theme$geom$colour, size = 0.5, linetype = 1,
45-
alpha = theme$geom$alpha
46-
)),
43+
default_aes = aes(
44+
colour = theme$geom$col,
45+
size = 0.5,
46+
linetype = 1,
47+
alpha = NA
48+
),
49+
4750
draw_panel = function(data, panel_params, coord, curvature = 0.5, angle = 90,
4851
ncp = 5, arrow = NULL, arrow.fill = NULL, lineend = "butt", na.rm = FALSE) {
4952

R/geom-density.r

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,12 @@ geom_density <- function(mapping = NULL, data = NULL,
7373
#' @export
7474
#' @include geom-ribbon.r
7575
GeomDensity <- ggproto("GeomDensity", GeomArea,
76-
default_aes = expr(aes(
77-
fill = NA, weight = 1, colour = theme$geom$colour,
78-
alpha = theme$geom$alpha, size = 0.5, linetype = 1
79-
))
76+
default_aes = aes(
77+
fill = NA,
78+
weight = 1,
79+
colour = theme$geom$col,
80+
alpha = NA,
81+
size = 0.5,
82+
linetype = 1
83+
)
8084
)

R/geom-density2d.r

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,10 @@ geom_density2d <- geom_density_2d
8282
#' @usage NULL
8383
#' @export
8484
GeomDensity2d <- ggproto("GeomDensity2d", GeomPath,
85-
default_aes = expr(aes(
86-
colour = theme$geom$colour.accent2,
87-
size = 0.5, linetype = 1, alpha = theme$geom$alpha
88-
))
85+
default_aes = aes(
86+
colour = theme$geom$col_2,
87+
size = 0.5,
88+
linetype = 1,
89+
alpha = NA
90+
)
8991
)

R/geom-dotplot.r

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -175,11 +175,11 @@ GeomDotplot <- ggproto("GeomDotplot", Geom,
175175
required_aes = c("x", "y"),
176176
non_missing_aes = c("size", "shape"),
177177

178-
default_aes = expr(aes(
179-
colour = theme$geom$colour,
180-
fill = theme$geom$colour,
181-
alpha = theme$geom$alpha
182-
)),
178+
default_aes = aes(
179+
colour = theme$geom$col,
180+
fill = theme$geom$col,
181+
alpha = NA
182+
),
183183

184184
setup_data = function(data, params) {
185185
data$width <- data$width %||%

R/geom-errorbar.r

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,13 @@ geom_errorbar <- function(mapping = NULL, data = NULL,
2626
#' @usage NULL
2727
#' @export
2828
GeomErrorbar <- ggproto("GeomErrorbar", Geom,
29-
default_aes = expr(aes(
30-
colour = theme$geom$colour,
31-
size = 0.5, linetype = 1, width = 0.5,
32-
alpha = theme$geom$alpha
33-
)),
29+
default_aes = aes(
30+
colour = theme$geom$col,
31+
size = 0.5,
32+
linetype = 1,
33+
width = 0.5,
34+
alpha = NA
35+
),
3436

3537
draw_key = draw_key_path,
3638

R/geom-errorbarh.r

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,13 @@ geom_errorbarh <- function(mapping = NULL, data = NULL,
4848
#' @usage NULL
4949
#' @export
5050
GeomErrorbarh <- ggproto("GeomErrorbarh", Geom,
51-
default_aes = expr(aes(
52-
colour = theme$geom$colour,
53-
size = 0.5, linetype = 1, height = 0.5,
54-
alpha = theme$geom$alpha
55-
)),
51+
default_aes = aes(
52+
colour = theme$geom$col,
53+
size = 0.5,
54+
linetype = 1,
55+
height = 0.5,
56+
alpha = NA
57+
),
5658

5759
draw_key = draw_key_path,
5860

R/geom-hex.r

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,13 @@ GeomHex <- ggproto("GeomHex", Geom,
7373

7474
required_aes = c("x", "y"),
7575

76-
default_aes = expr(aes(
76+
default_aes = aes(
7777
colour = NA,
7878
fill = theme$geom$fill,
7979
size = 0.5,
8080
linetype = 1,
81-
alpha = theme$geom$alpha
82-
)),
81+
alpha = NA
82+
),
8383

8484
draw_key = draw_key_polygon
8585
)

R/geom-hline.r

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,13 @@ GeomHline <- ggproto("GeomHline", Geom,
4747
GeomSegment$draw_panel(unique(data), panel_params, coord)
4848
},
4949

50-
default_aes = expr(aes(
51-
colour = theme$geom$colour,
52-
size = 0.5, linetype = 1,
53-
alpha = theme$geom$alpha
54-
)),
50+
default_aes = aes(
51+
colour = theme$geom$col,
52+
size = 0.5,
53+
linetype = 1,
54+
alpha = NA
55+
),
56+
5557
required_aes = "yintercept",
5658

5759
draw_key = draw_key_path

R/geom-label.R

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,18 @@ geom_label <- function(mapping = NULL, data = NULL,
5050
GeomLabel <- ggproto("GeomLabel", Geom,
5151
required_aes = c("x", "y", "label"),
5252

53-
default_aes = expr(aes(
54-
colour = theme$text$colour, fill = theme$geom$fill.accent,
55-
size = 3.88, angle = 0, hjust = 0.5, vjust = 0.5,
56-
alpha = theme$geom$alpha, family = theme$text$family,
57-
fontface = theme$text$face, lineheight = theme$text$lineheight
58-
)),
53+
default_aes = aes(
54+
colour = theme$text$colour,
55+
fill = theme$geom$fill_1,
56+
size = 3.88,
57+
angle = 0,
58+
hjust = 0.5,
59+
vjust = 0.5,
60+
alpha = NA,
61+
family = theme$text$family,
62+
fontface = theme$text$face,
63+
lineheight = theme$text$lineheight
64+
),
5965

6066
draw_panel = function(self, data, panel_params, coord, parse = FALSE,
6167
na.rm = FALSE,

R/geom-linerange.r

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,12 @@ geom_linerange <- function(mapping = NULL, data = NULL,
8383
#' @usage NULL
8484
#' @export
8585
GeomLinerange <- ggproto("GeomLinerange", Geom,
86-
default_aes = expr(aes(
87-
colour = theme$geom$colour,
88-
size = 0.5, linetype = 1,
89-
alpha = theme$geom$alpha
90-
)),
86+
default_aes = aes(
87+
colour = theme$geom$col,
88+
size = 0.5,
89+
linetype = 1,
90+
alpha = NA
91+
),
9192

9293
draw_key = draw_key_vpath,
9394

R/geom-path.r

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,12 @@ geom_path <- function(mapping = NULL, data = NULL,
123123
GeomPath <- ggproto("GeomPath", Geom,
124124
required_aes = c("x", "y"),
125125

126-
default_aes = expr(aes(
127-
colour = theme$geom$colour, size = 0.5, linetype = 1,
128-
alpha = theme$geom$alpha
129-
)),
126+
default_aes = aes(
127+
colour = theme$geom$col,
128+
size = 0.5,
129+
linetype = 1,
130+
alpha = NA
131+
),
130132

131133
handle_na = function(data, params) {
132134
# Drop missing values at the start or end of a line - can't drop in the

R/geom-point.r

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,14 @@ geom_point <- function(mapping = NULL, data = NULL,
108108
GeomPoint <- ggproto("GeomPoint", Geom,
109109
required_aes = c("x", "y"),
110110
non_missing_aes = c("size", "shape", "colour"),
111-
default_aes = expr(aes(
112-
shape = 19, colour = theme$geom$colour, size = 1.5,
113-
fill = NA, alpha = theme$geom$alpha, stroke = 0.5
114-
)),
111+
default_aes = aes(
112+
shape = 19,
113+
colour = theme_aes("col", theme),
114+
size = 1.5,
115+
fill = NA,
116+
alpha = NA,
117+
stroke = 0.5
118+
),
115119

116120
draw_panel = function(data, panel_params, coord, na.rm = FALSE) {
117121
if (is.character(data$shape)) {

R/geom-pointrange.r

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,15 @@ geom_pointrange <- function(mapping = NULL, data = NULL,
2828
#' @usage NULL
2929
#' @export
3030
GeomPointrange <- ggproto("GeomPointrange", Geom,
31-
default_aes = expr(aes(
32-
colour = theme$geom$colour,
33-
size = 0.5, linetype = 1,
34-
shape = 19, fill = NA,
35-
alpha = theme$geom$alpha,
31+
default_aes = aes(
32+
colour = theme$geom$col,
33+
size = 0.5,
34+
linetype = 1,
35+
shape = 19,
36+
fill = NA,
37+
alpha = NA,
3638
stroke = 1
37-
)),
39+
),
3840

3941
draw_key = draw_key_pointrange,
4042

R/geom-polygon.r

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,13 @@ GeomPolygon <- ggproto("GeomPolygon", Geom,
105105
)
106106
},
107107

108-
default_aes = expr(aes(
108+
default_aes = aes(
109109
colour = NA,
110110
fill = theme$geom$fill,
111-
size = 0.5, linetype = 1,
112-
alpha = theme$geom$alpha
113-
)),
111+
size = 0.5,
112+
linetype = 1,
113+
alpha = NA
114+
),
114115

115116
handle_na = function(data, params) {
116117
data

R/geom-quantile.r

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,11 @@ geom_quantile <- function(mapping = NULL, data = NULL,
6161
#' @export
6262
#' @include geom-path.r
6363
GeomQuantile <- ggproto("GeomQuantile", GeomPath,
64-
default_aes = expr(aes(
65-
weight = 1, colour = theme$geom$colour.accent2, size = 0.5, linetype = 1,
66-
alpha = theme$geom$alpha
67-
))
64+
default_aes = aes(
65+
weight = 1,
66+
colour = theme$geom$col_2,
67+
size = 0.5,
68+
linetype = 1,
69+
alpha = NA
70+
)
6871
)

R/geom-raster.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ geom_raster <- function(mapping = NULL, data = NULL,
4444
#' @usage NULL
4545
#' @export
4646
GeomRaster <- ggproto("GeomRaster", Geom,
47-
default_aes = expr(aes(fill = theme$geom$fill, alpha = theme$geom$alpha)),
47+
default_aes = aes(fill = theme$geom$fill, alpha = NA),
4848
non_missing_aes = "fill",
4949
required_aes = c("x", "y"),
5050

R/geom-rect.r

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ geom_rect <- function(mapping = NULL, data = NULL,
2626
#' @usage NULL
2727
#' @export
2828
GeomRect <- ggproto("GeomRect", Geom,
29-
default_aes = expr(aes(
29+
default_aes = aes(
3030
colour = NA,
3131
fill = theme$geom$fill,
3232
size = 0.5,
3333
linetype = 1,
34-
alpha = theme$geom$alpha
35-
)),
34+
alpha = NA
35+
),
3636

3737
required_aes = c("xmin", "xmax", "ymin", "ymax"),
3838

0 commit comments

Comments
 (0)