Skip to content

Commit 53dd7e2

Browse files
committed
Update gg2fig as gg2list
Following plotly/plotly.R#210
1 parent a3b3965 commit 53dd7e2

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

What_You_Need/plotlyGraphWidget.R

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,10 @@ graphOutput <- function(inputId, width="100%", height="550px") {
1212
)
1313
}
1414

15-
#Function to change ggplot figure into plotly syntax
16-
#gg is the users ggplot
17-
#called in the server script to return data and layout info separately
18-
gg2fig <- function(gg) {
19-
fig <- gg2list(gg)
20-
data <- list()
21-
for(i in 1:(length(fig)-1)){data[[i]]<-fig[[i]]}
22-
layout <- fig$kwargs$layout
23-
result <- list(data=data,layout=layout)
24-
return(result)
25-
}
15+
# Function to change ggplot figure into plotly syntax
16+
# Takes gg (the user's ggplot) as argument.
17+
# Provided by gg2list directly since package version 0.5.30
18+
gg2fig <- gg2list
2619

2720
renderGraph <- function(expr, env=parent.frame(), quoted=FALSE) {
2821
## This gets called when inputs change --

0 commit comments

Comments
 (0)