We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a97299c commit e1b5f65Copy full SHA for e1b5f65
R/plotly_POST.R
@@ -31,7 +31,19 @@ plotly_POST <- function(x) {
31
# empty keyword arguments can cause problems
32
kwargs <- x[get_kwargs()]
33
kwargs <- kwargs[sapply(kwargs, length) > 0]
34
-
+
35
+ # class "environment" from $layout$enclos causes
36
+ # Error in unclass(x) : cannot unclass an environment
37
+ # in jsonlite::toJSON
38
+ # (https://github.com/ropensci/plotly/issues/254)
39
+ kwargs <- lapply(kwargs, function(i){
40
+ if(class(i)=="list") {
41
+ i[sapply(i, class) != "environment"]
42
+ } else{
43
+ i
44
+ }
45
+ })
46
47
# filename & fileopt are keyword arguments required by the API
48
# (note they can also be specified by the user)
49
0 commit comments