How do I add a loader page while my UI populates with computations on my dataset inside the server function? My UI populates with values in about 30 secs. So I want this loader page to show for 30 secs and then hide it to show my actual UI which would have filled up by then.
Any help would be appreciated. Here's the sample code below:
ui <- fluidPage(
useShinyjs(),
div(
id = "loading_page",
h1("Loading...")
),
titlePanel("XYZ"),
sidebarLayout(
sidebarPanel(
p("Lorem Ipsum"),
selectInput(inputId = "ab", label = "SelectSomething", choices = c("A","B","C","D")),
p("Please Wait for 30 secs for data to load.."),
sliderInput(inputId = "Age", label = "Age Range", min=16, max=45, value=c(16,45)),
actionButton(inputId = "update", label = "Go!")
),
mainPanel(
h3("ABC:"),
uiOutput("table"),
br(),
uiOutput("OP1"),
br(),
uiOutput("OP2"),
uiOutput("OP3"),
br(),
uiOutput("OP4")
)
)
)
dataset<-readRDS(file = "my_data.rds")
server <- function(input, output, session) {
})