module_nested_tabs: Create a UI of nested tabs of 'teal_modules'

module_nested_tabsR Documentation

Create a UI of nested tabs of teal_modules

Description

Create a UI of nested tabs of teal_modules

Usage

ui_nested_tabs(id, modules, datasets, depth = 0L, is_module_specific = FALSE)

## Default S3 method:
ui_nested_tabs(id, modules, datasets, depth = 0L, is_module_specific = FALSE)

## S3 method for class 'teal_modules'
ui_nested_tabs(id, modules, datasets, depth = 0L, is_module_specific = FALSE)

## S3 method for class 'teal_module'
ui_nested_tabs(id, modules, datasets, depth = 0L, is_module_specific = FALSE)

srv_nested_tabs(
  id,
  datasets,
  modules,
  is_module_specific = FALSE,
  reporter = teal.reporter::Reporter$new()
)

## Default S3 method:
srv_nested_tabs(
  id,
  datasets,
  modules,
  is_module_specific = FALSE,
  reporter = teal.reporter::Reporter$new()
)

## S3 method for class 'teal_modules'
srv_nested_tabs(
  id,
  datasets,
  modules,
  is_module_specific = FALSE,
  reporter = teal.reporter::Reporter$new()
)

## S3 method for class 'teal_module'
srv_nested_tabs(
  id,
  datasets,
  modules,
  is_module_specific = TRUE,
  reporter = teal.reporter::Reporter$new()
)

Arguments

id

(character(1)) module id

modules

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

datasets

(named list of FilteredData) object to store filter state and filtered datasets, shared across modules. For more details see teal.slice::FilteredData. Structure of the list must be the same as structure of the modules argument and list names must correspond to the labels in modules. When filter is not module-specific then list contains the same object in all elements.

depth

(integer(1)) number which helps to determine depth of the modules nesting.

is_module_specific

(logical(1)) flag determining if the filter panel is global or module-specific. When set to TRUE, a filter panel is called inside of each module tab.

reporter

(Reporter) object from teal.reporter

Value

Depending on the class of modules, ui_nested_tabs returns:

  • teal_module: instantiated UI of the module.

  • teal_modules: tabsetPanel with each tab corresponding to recursively calling this function on it.

srv_nested_tabs returns a reactive which returns the active module that corresponds to the selected tab.

ui_nested_tabs

Each teal_modules is translated to a tabsetPanel and each of its children is another tab-module called recursively. The UI of a teal_module is obtained by calling its UI function.

The datasets argument is required to resolve the teal arguments in an isolated context (with respect to reactivity).

srv_nested_tabs

This module recursively calls all elements of modules and returns currently active one.

  • teal_module returns self as a active module.

  • teal_modules also returns module active within self which is determined by the input$active_tab.


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