Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 4 additions & 11 deletions What_You_Need/plotlyGraphWidget.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,10 @@ graphOutput <- function(inputId, width="100%", height="550px") {
)
}

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

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