How to display a busy indicator in a shiny app?

后端 未结 5 1174
后悔当初
后悔当初 2020-12-13 21:30

Note : I have read almost all the discussions on this object in shiny googlegroups and here in SO.

I need an indicator that shows the shiny server is busy. I have tr

5条回答
  •  悲&欢浪女
    2020-12-13 22:31

    Alternatively, you can use shinycssloaders package https://github.com/andrewsali/shinycssloaders

    library(shiny)
    library(dplyr)
    library(shinycssloaders)
    
    ui <- fluidPage(
    
      actionButton("plot","plot"),
      plotOutput("Test") %>% withSpinner(color="#0dc5c1")
    )
    
    
    
    server <- function(input, output, session) {
    
    
      data <- eventReactive(input$plot,{
        rnorm(1:100000)
      })
    
      output$Test <- renderPlot({
        plot(data())
      })
    }
    
    shinyApp(ui = ui, server = server)
    

提交回复
热议问题