Skip to content

Commit

Permalink
<AsIs> never invokes identity scale (#5597)
Browse files Browse the repository at this point in the history
* skip AsIs scale type

* remove `scale_type.AsIs` method
  • Loading branch information
teunbrand authored and thomasp85 committed Feb 23, 2024
1 parent 3026fe8 commit 44200a2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
1 change: 0 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ S3method(print,ggproto_method)
S3method(print,rel)
S3method(print,theme)
S3method(print,uneval)
S3method(scale_type,AsIs)
S3method(scale_type,Date)
S3method(scale_type,POSIXt)
S3method(scale_type,character)
Expand Down
5 changes: 1 addition & 4 deletions R/scale-type.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ find_scale <- function(aes, x, env = parent.frame()) {
# Inf is ambiguous; it can be used either with continuous scales or with
# discrete scales, so just skip in the hope that we will have a better guess
# with the other layers
if (is.null(x) || (is_atomic(x) && all(is.infinite(x)))) {
if (is.null(x) || (is_atomic(x) && all(is.infinite(x))) || inherits(x, "AsIs")) {
return(NULL)
}

Expand Down Expand Up @@ -70,9 +70,6 @@ scale_type.default <- function(x) {
#' @export
scale_type.list <- function(x) "identity"

#' @export
scale_type.AsIs <- function(x) "identity"

#' @export
scale_type.logical <- function(x) "discrete"

Expand Down

0 comments on commit 44200a2

Please sign in to comment.