Created
April 4, 2019 01:54
-
-
Save bfatemi/6aafaf6d65602c44e446b8786cba1bfc to your computer and use it in GitHub Desktop.
Loading page for shiny/R app implemented with the shinyjs R package.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(shiny) | |
library(shinyjs) | |
load_data <- function() { | |
Sys.sleep(2) | |
hide("loading_page") | |
show("main_content") | |
} | |
ui <- fluidPage( | |
useShinyjs(), | |
div( | |
id = "loading_page", | |
h1("Loading...") | |
), | |
hidden( | |
div( | |
id = "main_content", | |
"Data loaded, content goes here" | |
) | |
) | |
) | |
server <- function(input, output, session) { | |
load_data() | |
} | |
shinyApp(ui = ui, server = server) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment