Learn R Programming

dqshiny (version 0.0.3)

dq_busy: Adds a loading image if shiny is busy

Description

Adds a loading image to the page which is visible when shiny is busy.

Usage

dq_busy(icon_path = NULL, time = 500, animation = "fadeIn")

Arguments

icon_path

optional character, icon source path

time

optional integer indicating the animation time of the loader. Can be useful to omit loader for many short loading moments, but show it if calculation really needs some time. Set to 0 to disable animations.

animation

optional character specifying the animation of the loader

Value

shiny tag holding the icon

Examples

Run this code
# NOT RUN {
## Only run examples in interactive R sessions
if (interactive()) {

library(shiny)
shinyApp(
  ui = fluidPage(
    dq_busy(time = 1500),
    actionButton("button", "make me busy")
  ),
  server = function(input, output) {
    observeEvent(input$button, Sys.sleep(3))
  }
)

}
# }

Run the code above in your browser using DataLab