File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -191,7 +191,7 @@ plotly_build <- function(l = get_plot()) {
191
191
# plots without NSE don't need it either
192
192
nms <- lapply(l $ data , names )
193
193
idx <- unique(unlist(lapply(l $ data , names ))) %in% c(" args" , " env" )
194
- if (sum(idx ) != 2 ) return (l )
194
+ if (sum(idx ) != 2 ) return (struct( l , " plotly " ) )
195
195
nms <- names(l )
196
196
# assume unnamed list elements are data/traces
197
197
idx <- nms %in% " "
@@ -307,8 +307,7 @@ plotly_build <- function(l = get_plot()) {
307
307
# traces shouldn't have any names
308
308
x $ data <- setNames(x $ data , NULL )
309
309
# add plotly class mainly for printing method
310
- class(x ) <- unique(c(" plotly" , class(x )))
311
- x
310
+ struct(x , " plotly" )
312
311
}
313
312
314
313
# returns a _list of traces_.
You can’t perform that action at this time.
0 commit comments