| module_teal_module | R Documentation |
modulesModules create navigation bar with drop-down menu and tab content. Each teal_module is called recursively
according to the structure of modules argument. This is a custom module which utilizes shiny/Bootstrap
.nav class. modules are called with an id derived from teal_module's label and labels of its
ancestors (if any).
ui_teal_module(id, modules)
srv_teal_module(
id,
data,
modules,
datasets = NULL,
slices_global,
reporter = teal.reporter::Reporter$new(),
data_load_status = reactive("ok")
)
.teal_navbar_append(navbar, child)
.teal_navbar_insert_ui(
ui,
where = "afterBegin",
session = getDefaultReactiveDomain()
)
.teal_navbar_menu(..., id = NULL, label = NULL, class = NULL, icon = NULL)
.ui_teal_module(id, modules, active_module_id)
## Default S3 method:
.ui_teal_module(id, modules, active_module_id)
## S3 method for class 'teal_modules'
.ui_teal_module(id, modules, active_module_id)
## S3 method for class 'teal_module'
.ui_teal_module(id, modules, active_module_id)
.srv_teal_module(
id,
data,
modules,
datasets = NULL,
slices_global,
reporter = teal.reporter::Reporter$new(),
data_load_status = reactive("ok"),
active_module_id = reactive(TRUE)
)
## Default S3 method:
.srv_teal_module(
id,
data,
modules,
datasets = NULL,
slices_global,
reporter = teal.reporter::Reporter$new(),
data_load_status = reactive("ok"),
active_module_id = reactive(TRUE)
)
## S3 method for class 'teal_modules'
.srv_teal_module(
id,
data,
modules,
datasets = NULL,
slices_global,
reporter = teal.reporter::Reporter$new(),
data_load_status = reactive("ok"),
active_module_id = reactive(TRUE)
)
## S3 method for class 'teal_module'
.srv_teal_module(
id,
data,
modules,
datasets = NULL,
slices_global,
reporter = teal.reporter::Reporter$new(),
data_load_status = reactive("ok"),
active_module_id = reactive(TRUE)
)
id |
( |
modules |
( |
data |
( |
datasets |
( |
slices_global |
( |
reporter |
( |
data_load_status |
(
|
active_module_id |
( |
ui/srv_teal_module - wrapper module which links drop-down buttons with modules panels.
Here input$active_module_id is instantiated.
.ui/srv_teal_module - recursive S3 method which calls each module
.teal_navbar_append - wrapper for htmltools::tagAppendChild() to add any element to navigation bar.
.teal_navbar_insert_ui - wrapper for shiny::insertUI() to insert any element to navigation bar.
.teal_navbar_menu - UI function to create a drop-down menu for navigation bar.
.nav classNo extra javascript or server functionality were introduced to have navigation buttons toggle between
tab panels. This works thanks to .nav container which links .nav-link buttons href = #<module id>
attribute with .tab-pane's id = <module id> (see “.ui_teal_module.teal_module').
teal_module(s)Modules are initialized only when they are active. This speeds up app initialization and on startup only the first module is activated and its outputs are calculated. Only the active module is listening to reactive events. This way, modules are isolated and only one can run at any given time. This makes the app more efficient by reducing unnecessary computations on server side.
Output of currently active module.
srv_teal_module.teal_module returns reactiveVal containing output of the called module.
srv_teal_module.teal_modules returns output of modules in a list following the hierarchy of modules
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.