mirror of
https://github.com/rstudio/shiny.git
synced 2026-02-08 05:35:07 -05:00
Fix plot coordmap for devel version of ggplot2. Closes #2016
This commit is contained in:
@@ -555,9 +555,11 @@ find_panel_info_api <- function(b) {
|
||||
# ggplot object. The original uses quoted expressions; convert to
|
||||
# character.
|
||||
mapping <- layers$mapping[[1]]
|
||||
# lapply'ing as.character results in unexpected behavior for expressions
|
||||
# like `wt/2`; deparse handles it correctly.
|
||||
mapping <- lapply(mapping, deparse)
|
||||
# In ggplot2 <=2.2.1, the mappings are expressions. In later versions, they
|
||||
# are quosures. `deparse(quo_squash(x))` will handle both cases.
|
||||
# as.character results in unexpected behavior for expressions like `wt/2`,
|
||||
# which is why we use deparse.
|
||||
mapping <- lapply(mapping, function(x) deparse(rlang::quo_squash(x)))
|
||||
|
||||
# If either x or y is not present, give it a NULL entry.
|
||||
mapping <- mergeVectors(list(x = NULL, y = NULL), mapping)
|
||||
|
||||
Reference in New Issue
Block a user