Skip to contents

Creates filter panel module from teal_data object and returns teal_data. It is build in a way that filter panel changes and anything what happens before (e.g. module_init_data) is triggering further reactive events only if something has changed and if the module is visible. Thanks to this special implementation all modules' data are recalculated only for those modules which are currently displayed.

Usage

ui_filter_data(id)

srv_filter_data(id, datasets, active_datanames, data_rv, is_active)

.make_filtered_teal_data(modules, data, datasets = NULL, datanames)

.observe_active_filter_changed(datasets, is_active, active_datanames, data_rv)

.get_filter_expr(datasets, datanames)

Arguments

id

(character) Optionally, a string specifying the shiny module id in cases it is used as a shiny module rather than a standalone shiny app. This is a legacy feature.

datasets

(reactive returning FilteredData or NULL) When datasets is passed from the parent module (srv_teal) then dataset is a singleton which implies in filter-panel to be "global". When NULL then filter-panel is "module-specific".

active_datanames

(reactive returning character) this module's data names

data_rv

(reactive returning teal_data)

modules

(list or teal_modules or teal_module) Nested list of teal_modules or teal_module objects or a single teal_modules or teal_module object. These are the specific output modules which will be displayed in the teal application. See modules() and module() for more details.

Value

A eventReactive containing teal_data containing filtered objects and filter code. eventReactive triggers only if all conditions are met:

  • tab is selected (is_active)

  • when filters are changed (get_filter_expr is different than previous)