1

我正在开发闪亮的应用程序,我想使用闪亮的BS。但是shinyBS不兼容新的shiny v1.0.5,全屏灰,包括模态。

我想在 bsModal 窗口上绘图。

shinyBS 有其他方法吗?

任何想法 ?

非常感谢。

这是代码:

library(shiny)
library(shinyBS)

shinyApp(
ui =
fluidPage(
  sidebarLayout(
    sidebarPanel(numericInput("n", "n", 50),actionButton("go", "Go")),
    mainPanel(
      bsModal("modalExample", "Your plot", "go", size = "large",plotOutput("plot"),downloadButton('downloadPlot', 'Download'))
    )
  )
),
server =
function(input, output, session) {

  randomVals <- eventReactive(input$go, {
    runif(input$n)
  })

  plotInput <- function(){hist(randomVals())}

  output$plot <- renderPlot({
    hist(randomVals())
  })

  output$downloadPlot <- downloadHandler(
    filename = "Shinyplot.png",
    content = function(file) {
      png(file)
      plotInput()
      dev.off()
    }) 

}
)
4

0 回答 0