Skip to content

Commit

Permalink
cast expressions to lists
Browse files Browse the repository at this point in the history
  • Loading branch information
teunbrand committed Jul 18, 2024
1 parent c679d43 commit a91d4f5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions R/guide-bins.R
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,9 @@ GuideBins <- ggproto(
} else {
key$.show[nrow(key)] <- TRUE
}
if (is.expression(labels)) {
labels <- as.list(labels)
}

key$.label <- labels
key <- vec_slice(key, !is.na(oob_censor_any(key$.value)))
Expand Down
6 changes: 5 additions & 1 deletion R/guide-colorsteps.R
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,11 @@ GuideColoursteps <- ggproto(
} else {
key$.value <- breaks
}
key$.label <- scale$get_labels(breaks)
labels <- scale$get_labels(breaks)
if (is.expression(labels)) {
labels <- as.list(labels)
}
key$.label <- labels

if (breaks[1] %in% limits) {
key$.value <- key$.value - 1L
Expand Down

0 comments on commit a91d4f5

Please sign in to comment.