Shiny application will show "Disconnected from server" pop up dialog box with a "Reload" button and grey out all the shiny application when network not available. This is annoying and user has to click the "Reload" button to reconnect to server. This function helps automatically reconnect and reload application whenever network is available again. Check in 1 second period.
1 |
Add disconnectAutoReload() to shiny server(session,input,output)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | library(shiny)
library(shinyjs)
library(databunny)
ui <- fluidPage(
titlePanel("Shiny Auto Reconnect"),
"This shiny app will auto reconnect when ever network available again."
)
server <- function(input, output) {
disconnectAutoReload()
}
shinyApp(ui = ui, server = server)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.