Add splash screen to teal application
Source: R/module_teal_with_splash.R
module_teal_with_splash.RdUsage
ui_teal_with_splash(
id,
data,
title = build_app_title(),
header = tags$p(),
footer = tags$p()
)
srv_teal_with_splash(id, data, modules, filter = teal_slices())Arguments
- id
(
character(1)) module id- data
(
teal_dataorteal_data_module) For constructing the data object, refer toteal_data()andteal_data_module().- title
(
shiny.tagorcharacter(1)) The browser window title. Defaults to a title "teal app" with the icon of NEST. Can be created using thebuild_app_title()or by passing a validshiny.tagwhich is a head tag with title and link tag.- header
(
shiny.tagorcharacter(1)) The header of the app.- footer
(
shiny.tagorcharacter(1)) The footer of the app.- modules
(
teal_modules) object containing the output modules which will be displayed in thetealapplication. Seemodules()andmodule()for more details.- filter
(
teal_slices) Specifies the initial filter usingteal_slices().
Value
Returns a reactive expression containing a teal_data object when data is loaded or NULL when it is not.
Details
This module pauses app initialization pending delayed data loading. This is necessary because the filter panel and modules depend on the data to initialize.
teal_with_splash follows the shiny module convention.
init() is a wrapper around this that assumes that teal it is
the top-level module and cannot be embedded.
Note: It is no longer recommended to embed teal in shiny apps as a module.
but rather use init to create a standalone application.
Examples
teal_modules <- modules(example_module())
# Shiny app with modular integration of teal
ui <- fluidPage(
ui_teal_with_splash(id = "app1", data = teal_data())
)
server <- function(input, output, session) {
srv_teal_with_splash(
id = "app1",
data = teal_data(iris = iris),
modules = teal_modules
)
}
if (interactive()) {
shinyApp(ui, server)
}