We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 69a118a commit 1308282Copy full SHA for 1308282
R/ggplotly.R
@@ -23,7 +23,7 @@
23
#' ggplotly(viz)
24
#' }
25
#'
26
-ggplotly <- function(p = last_plot()) {
+ggplotly <- function(p = ggplot2::last_plot()) {
27
l <- gg2list(p)
28
hash_plot(p$data, l)
29
}
@@ -948,6 +948,8 @@ gg2list <- function(p) {
948
# unfortunately, this conflicts when using I() in qplot. For example,
949
# qplot(1:10, 1:10, size = I(10))
950
un <- function(x) {
951
+ # jsonlite converts NULL to {} and NA to null (plotly prefers null to {})
952
+ # https://github.com/jeroenooms/jsonlite/issues/29
953
if (is.null(x)) return(NA)
954
if (is.list(x)) lapply(x, un)
955
else if (inherits(x, "AsIs")) unclass(x)
0 commit comments