可下载的 Plot 闪亮模块在启动时分解了我闪亮的应用程序
The downloadablePlot Shiny Module breaks down my shiny app upon launching
我有下面的 shiny
应用程序,我想知道如何使用 downloadablePlot
闪亮模块下载绘图。当我启动应用程序时,整个应用程序都崩溃了。
library(shiny)
library(periscope)
ui <- fluidPage(
plotOutput("plot"),
downloadablePlotUI("object_id1",
downloadtypes = c("png", "csv"),
download_hovertext = "Download the plot and data here!",
height = "500px",
btn_halign = "left")
)
server <- function(input, output) {
output$plot<-renderPlot(plot(iris))
plotInput = function() {
plot(iris)
}
callModule(downloadablePlot,
"object_id1",
logger = ss_userAction.Log,
filenameroot = "mydownload1",
aspectratio = 1.33,
downloadfxns = list(png = plotInput()),
visibleplot = plotInput())
}
shinyApp(ui = ui, server = server)
将plotInput
作为参数传递时,尝试删除plotInput
后的括号
library(shiny)
library(periscope)
ui <- fluidPage(
plotOutput("plot"),
downloadablePlotUI("object_id1",
downloadtypes = c("png", "csv"),
download_hovertext = "Download the plot and data here!",
height = "500px",
btn_halign = "left")
)
server <- function(input, output) {
output$plot<-renderPlot(plot(iris))
plotInput = function() {
plot(iris)
}
callModule(downloadablePlot,
"object_id1",
logger = ss_userAction.Log,
filenameroot = "mydownload1",
aspectratio = 1.33,
downloadfxns = list(png = plotInput),
visibleplot = plotInput)
}
shinyApp(ui = ui, server = server)
在 shiny 中,当传递函数/反应时,你通常需要避免在它们后面附加 ()
,因为这样做会评估它们。在上面的示例中,您返回了 plotInput 的 output 而不是函数本身
我有下面的 shiny
应用程序,我想知道如何使用 downloadablePlot
闪亮模块下载绘图。当我启动应用程序时,整个应用程序都崩溃了。
library(shiny)
library(periscope)
ui <- fluidPage(
plotOutput("plot"),
downloadablePlotUI("object_id1",
downloadtypes = c("png", "csv"),
download_hovertext = "Download the plot and data here!",
height = "500px",
btn_halign = "left")
)
server <- function(input, output) {
output$plot<-renderPlot(plot(iris))
plotInput = function() {
plot(iris)
}
callModule(downloadablePlot,
"object_id1",
logger = ss_userAction.Log,
filenameroot = "mydownload1",
aspectratio = 1.33,
downloadfxns = list(png = plotInput()),
visibleplot = plotInput())
}
shinyApp(ui = ui, server = server)
将plotInput
作为参数传递时,尝试删除plotInput
后的括号
library(shiny)
library(periscope)
ui <- fluidPage(
plotOutput("plot"),
downloadablePlotUI("object_id1",
downloadtypes = c("png", "csv"),
download_hovertext = "Download the plot and data here!",
height = "500px",
btn_halign = "left")
)
server <- function(input, output) {
output$plot<-renderPlot(plot(iris))
plotInput = function() {
plot(iris)
}
callModule(downloadablePlot,
"object_id1",
logger = ss_userAction.Log,
filenameroot = "mydownload1",
aspectratio = 1.33,
downloadfxns = list(png = plotInput),
visibleplot = plotInput)
}
shinyApp(ui = ui, server = server)
在 shiny 中,当传递函数/反应时,你通常需要避免在它们后面附加 ()
,因为这样做会评估它们。在上面的示例中,您返回了 plotInput 的 output 而不是函数本身