module_teal: 'teal' main app module

module_tealR Documentation

teal main app module

Description

This is the main teal app that puts everything together.

Usage

ui_teal(
  id,
  splash_ui = tags$h2("Starting the Teal App"),
  title = build_app_title(),
  header = tags$p(),
  footer = tags$p()
)

srv_teal(id, modules, teal_data_rv, filter = teal_slices())

Arguments

id

(character(1)) module id

splash_ui

(shiny.tag) UI to display initially, can be a splash screen or a shiny module UI. For the latter, see init() about how to call the corresponding server function.

title

(shiny.tag or character(1)) The browser window title. Defaults to a title "teal app" with the icon of NEST. Can be created using the build_app_title() or by passing a valid shiny.tag which is a head tag with title and link tag.

header

(shiny.tag or character(1)) The header of the app.

footer

(shiny.tag or character(1)) The footer of the app.

modules

(teal_modules) object containing the output modules which will be displayed in the teal application. See modules() and module() for more details.

teal_data_rv

(reactive) returns the teal_data, only evaluated once, NULL value is ignored

filter

(teal_slices) Specifies the initial filter using teal_slices().

Details

It displays the splash UI which is used to fetch the data, possibly prompting for a password input to fetch the data. Once the data is ready, the splash screen is replaced by the actual teal UI that is tabsetted and has a filter panel with datanames that are relevant for the current tab. Nested tabs are possible, but we limit it to two nesting levels for reasons of clarity of the UI.

The splash screen functionality can also be used for non-delayed data which takes time to load into memory, avoiding shiny session timeouts.

Server evaluates the teal_data_rv (delayed data mechanism) and creates the datasets object that is shared across modules. Once it is ready and non-NULL, the splash screen is replaced by the main teal UI that depends on the data. The currently active tab is tracked and the right filter panel updates the displayed datasets to filter for according to the active datanames of the tab.

It is written as a shiny module so it can be added into other apps as well.

Value

Returns a reactive expression which returns the currently active module.


teal documentation built on May 29, 2024, 10:11 a.m.