This is a low level module to handle teal_data_module execution and validation.
teal_transform_module() inherits from teal_data_module() so it is handled by this module too.
srv_teal() accepts various data objects and eventually they are all transformed to reactive
teal.data::teal_data() which is a standard data class in whole teal framework.
Usage
ui_teal_data_module(id, data_module = function(id) NULL)
srv_teal_data_module(
id,
data_module = function(id) NULL,
modules = NULL,
validate_shiny_silent_error = TRUE,
is_transform_failed = reactiveValues()
)
ui_validate_reactive_teal_data(id)
srv_validate_reactive_teal_data(
id,
data,
modules = NULL,
validate_shiny_silent_error = FALSE,
hide_validation_error = reactive(FALSE)
)Arguments
- id
(
character(1))shinymodule instance id.- data_module
(
teal_data_module)- modules
(
teal_modulesorteal_module) Fordatanamesvalidation purpose- validate_shiny_silent_error
(
logical) IfTRUE, thenshiny.silent.erroris validated and- is_transform_failed
(
reactiveValues) containslogicalflags named after each transformator. Help to determine if any previous transformator failed, so that following transformators can be disabled and display a generic failure message.- data
(
teal_data,teal_data_module, orreactivereturningteal_data) The data which application will depend on.
Note
ui_teal_data_module was renamed from ui_teal_data.
srv_teal_data_module was renamed from srv_teal_data.
data validation
Executed teal_data_module() is validated and output is validated for consistency.
Output data is invalid if:
teal_data_module()is invalid if server doesn't returnreactive. Immediately crashes an app!reactivethrows ashiny.error- happens when module creatingteal.data::teal_data()fails.reactivereturnsqenv.error- happens whenteal.data::teal_data()evaluates a failing code.reactiveobject doesn't returnteal.data::teal_data().teal.data::teal_data()object lacks anydatanamesspecified in themodulesargument.
teal (observers in srv_teal) always waits to render an app until reactive teal_data is
returned. If error 2-4 occurs, relevant error message is displayed to the app user. Once the issue is
resolved, the app will continue to run. teal guarantees that errors in data don't crash the app
(except error 1).