在过go ,我已经成功地使用shinybusy
R包向shiny 的应用程序添加了微调工具,但这次我想添加一个定制的gif,而不是内置的微调工具
这个例子可以工作,但是gif只是暂停,而不是在服务器不忙时消失:
library(shiny)
library(shinybusy)
ui <- fluidPage(
# Use this function somewhere in UI
# with navBarPage use the "header" argument
add_busy_gif(
src = "https://jeroen.github.io/images/banana.gif",
height = "70px", width = "70px", position = "bottom-right"
),
actionButton("sleep", "Long calculation")
)
server <- function(input, output, session) {
observeEvent(input$sleep, {
Sys.sleep(5)
})
}
shinyApp(ui, server)
当服务器不忙的时候,我如何让香蕉消失?