File tree Expand file tree Collapse file tree 4 files changed +5
-20
lines changed Expand file tree Collapse file tree 4 files changed +5
-20
lines changed Original file line number Diff line number Diff line change @@ -225,13 +225,8 @@ Guide <- ggproto(
225
225
226
226
mapped <- scale $ map(breaks )
227
227
labels <- scale $ get_labels(breaks )
228
- # {vctrs} doesn't play nice with expressions, convert to list.
229
- # see also https://github.com/r-lib/vctrs/issues/559
230
- if (is.expression(labels )) {
231
- labels <- as.list(labels )
232
- }
233
228
234
- key <- data_frame(mapped , .name_repair = ~ aesthetic )
229
+ key <- data_frame(!! aesthetic : = mapped )
235
230
key $ .value <- breaks
236
231
key $ .label <- labels
237
232
Original file line number Diff line number Diff line change @@ -110,7 +110,7 @@ GuideAxisTheta <- ggproto(
110
110
# labels of these positions
111
111
ends_apart <- (key $ theta [n ] - key $ theta [1 ]) %% (2 * pi )
112
112
if (n > 0 && ends_apart < 0.05 && ! is.null(key $ .label )) {
113
- if (is.expression(key $ .label )) {
113
+ if (is.expression(key $ .label [[ 1 ]] )) {
114
114
combined <- substitute(
115
115
paste(a , " /" , b ),
116
116
list (a = key $ .label [[1 ]], b = key $ .label [[n ]])
Original file line number Diff line number Diff line change @@ -176,9 +176,6 @@ GuideBins <- ggproto(
176
176
} else {
177
177
key $ .show [nrow(key )] <- TRUE
178
178
}
179
- if (is.expression(labels )) {
180
- labels <- as.list(labels )
181
- }
182
179
183
180
key $ .label <- labels
184
181
key <- vec_slice(key , ! is.na(oob_censor_any(key $ .value )))
Original file line number Diff line number Diff line change @@ -111,16 +111,9 @@ GuideColoursteps <- ggproto(
111
111
breaks <- parsed $ breaks
112
112
113
113
key <- data_frame0(!! aesthetic : = scale $ map(breaks ))
114
- if (even.steps ) {
115
- key $ .value <- seq_along(breaks )
116
- } else {
117
- key $ .value <- breaks
118
- }
119
- labels <- scale $ get_labels(breaks )
120
- if (is.expression(labels )) {
121
- labels <- as.list(labels )
122
- }
123
- key $ .label <- labels
114
+ fmt <- if (even.steps ) seq_along else identity
115
+ key $ .value <- fmt(breaks )
116
+ key $ .label <- scale $ get_labels(breaks )
124
117
125
118
if (breaks [1 ] %in% limits ) {
126
119
key $ .value <- key $ .value - 1L
You can’t perform that action at this time.
0 commit comments