dq_busy: Adds a loading image if shiny is busy

Description Usage Arguments Value Author(s) Examples

View source: R/dq_busy.R

Description

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

Usage

1
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

Author(s)

richard.kunze

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## 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))
  }
)

}

daqana/dqshiny documentation built on Sept. 1, 2020, 4:31 p.m.