r - shiny add Progress bar with source() function -
at start of shiny application, run source function load , process data.
everything ok, when user start application, there loading time of 10 seconds. add progress bar.
i saw tutorials, integrated observe or reactive function, not case.
shinyserver(function(input, output,session) { source("/srv/shiny-server/data_base/import.r") }) how add progress bar ?
maybe link helps: https://github.com/daattali/shiny-server/blob/master/loading-screen/app.r
basically should add code outside reactive content:
appcss <- " #loading-content { position: absolute; background: #000000; opacity: 0.9; z-index: 100; left: 0; right: 0; height: 100%; text-align: center; color: #ffffff; } " this ui side:
useshinyjs(), inlinecss(appcss), # loading message div( id = "loading-content", h2("loading...") ), and server side (will hide "loading" message after content has been loaded:
hide(id = "loading-content", anim = true, animtype = "fade")
Comments
Post a Comment