Skip to content

Commit 3743306

Browse files
committed
Don't name check transforms; fail gracefully when discrete & numeric data is supplied on an axis
1 parent 0806f6e commit 3743306

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

R/utils.R

+6-2
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ verify_attr_names <- function(p) {
266266
# make sure attribute names are valid
267267
attrs_name_check(
268268
names(thisTrace),
269-
c(names(attrSpec), "key", "set", "frame", "_isNestedKey", "_isSimpleKey"),
269+
c(names(attrSpec), "key", "set", "frame", "transforms", "_isNestedKey", "_isSimpleKey"),
270270
thisTrace$type
271271
)
272272
}
@@ -490,7 +490,11 @@ populate_categorical_axes <- function(p) {
490490
if (length(d) == 0) next
491491
isDiscrete <- vapply(d, is.discrete, logical(1))
492492
if (0 < sum(isDiscrete) & sum(isDiscrete) < length(d)) {
493-
stop("Can't display both discrete & non-discrete data on same axis")
493+
warning(
494+
"Can't display both discrete & non-discrete data on same axis",
495+
call. = FALSE
496+
)
497+
next
494498
}
495499
if (sum(isDiscrete) == 0) next
496500
categories <- lapply(d, getLevels)

0 commit comments

Comments
 (0)