Skip to content

Commit 7f4435c

Browse files
committed
Adapt use of gg2list return accordingly
1 parent c170737 commit 7f4435c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

R/plotly.R

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,15 @@ For more help, see https://plot.ly/R or contact <[email protected]>.")
139139
if(!is.ggplot(gg)){
140140
stop("gg must be a ggplot")
141141
}
142-
pargs <- gg2list(gg)
142+
fig <- gg2list(gg)
143143
if (!"auto_open" %in% names(kwargs)) {
144144
kwargs <- c(kwargs, auto_open=TRUE)
145145
}
146-
pargs$kwargs <- c(pargs$kwargs, kwargs)
146+
147+
pargs <- fig$data
148+
pargs$kwargs <- kwargs
149+
pargs$kwargs$layout <- fig$layout
150+
147151
if (session == "interactive") { # we are on the command line
148152
resp <- do.call(pub$plotly, pargs)
149153
if (pargs$kwargs$auto_open) {

0 commit comments

Comments
 (0)