|
1 | 1 | #' @include utilities.r
|
2 | 2 | NULL
|
3 | 3 |
|
4 |
| -.all_aesthetics <- c("adj", "alpha", "angle", "bg", "cex", "col", "color", |
5 |
| - "colour", "fg", "fill", "group", "hjust", "label", "linetype", "lower", |
6 |
| - "lty", "lwd", "max", "middle", "min", "pch", "radius", "sample", "shape", |
7 |
| - "size", "srt", "upper", "vjust", "weight", "width", "x", "xend", "xmax", |
8 |
| - "xmin", "xintercept", "y", "yend", "ymax", "ymin", "yintercept", "z") |
9 |
| - |
10 |
| -.base_to_ggplot <- c( |
11 |
| - "col" = "colour", |
12 |
| - "color" = "colour", |
13 |
| - "pch" = "shape", |
14 |
| - "cex" = "size", |
15 |
| - "lty" = "linetype", |
16 |
| - "lwd" = "size", |
17 |
| - "srt" = "angle", |
18 |
| - "adj" = "hjust", |
19 |
| - "bg" = "fill", |
20 |
| - "fg" = "colour", |
21 |
| - "min" = "ymin", |
22 |
| - "max" = "ymax" |
23 |
| -) |
24 |
| - |
25 | 4 | #' Construct aesthetic mappings
|
26 | 5 | #'
|
27 | 6 | #' Aesthetic mappings describe how variables in the data are mapped to visual
|
@@ -167,10 +146,10 @@ print.uneval <- function(x, ...) {
|
167 | 146 | # Rename American or old-style aesthetics name
|
168 | 147 | rename_aes <- function(x) {
|
169 | 148 | # Convert prefixes to full names
|
170 |
| - full <- match(names(x), .all_aesthetics) |
171 |
| - names(x)[!is.na(full)] <- .all_aesthetics[full[!is.na(full)]] |
| 149 | + full <- match(names(x), ggplot_global$all_aesthetics) |
| 150 | + names(x)[!is.na(full)] <- ggplot_global$all_aesthetics[full[!is.na(full)]] |
172 | 151 |
|
173 |
| - plyr::rename(x, .base_to_ggplot, warn_missing = FALSE) |
| 152 | + plyr::rename(x, ggplot_global$base_to_ggplot, warn_missing = FALSE) |
174 | 153 | }
|
175 | 154 |
|
176 | 155 | # Look up the scale that should be used for a given aesthetic
|
@@ -315,7 +294,7 @@ aes_auto <- function(data = NULL, ...) {
|
315 | 294 | }
|
316 | 295 |
|
317 | 296 | # automatically detected aes
|
318 |
| - vars <- intersect(.all_aesthetics, vars) |
| 297 | + vars <- intersect(ggplot_global$all_aesthetics, vars) |
319 | 298 | names(vars) <- vars
|
320 | 299 | aes <- lapply(vars, function(x) parse(text = x)[[1]])
|
321 | 300 |
|
|
0 commit comments