Skip to content

Commit 654e247

Browse files
committed
exempt some coords from transforming x/y AsIs variables
1 parent f468053 commit 654e247

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

R/coord-polar.R

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,10 @@ CoordPolar <- ggproto("CoordPolar", Coord,
180180
},
181181

182182
transform = function(self, data, panel_params) {
183+
if (inherits(data$x, "AsIs") && inherits(data$y, "AsIs")) {
184+
return(data)
185+
}
186+
183187
arc <- self$start + c(0, 2 * pi)
184188
dir <- self$direction
185189
data <- rename_data(self, data)

R/coord-radial.R

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,10 @@ CoordRadial <- ggproto("CoordRadial", Coord,
275275
},
276276

277277
transform = function(self, data, panel_params) {
278+
if (inherits(data$x, "AsIs") && inherits(data$y, "AsIs")) {
279+
return(data)
280+
}
281+
278282
data <- rename_data(self, data)
279283
bbox <- panel_params$bbox %||% list(x = c(0, 1), y = c(0, 1))
280284
arc <- panel_params$arc %||% c(0, 2 * pi)

R/coord-sf.R

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ CoordSf <- ggproto("CoordSf", CoordCartesian,
7777
},
7878

7979
transform = function(self, data, panel_params) {
80+
if (inherits(data$x, "AsIs") && inherits(data$y, "AsIs")) {
81+
return(data)
82+
}
83+
8084
# we need to transform all non-sf data into the correct coordinate system
8185
source_crs <- panel_params$default_crs
8286
target_crs <- panel_params$crs

0 commit comments

Comments
 (0)