module_filter_manager | R Documentation |
FilteredData
objectsOversee filter states across the entire application.
ui_filter_manager_panel(id)
srv_filter_manager_panel(id, slices_global)
ui_filter_manager(id)
srv_filter_manager(id, slices_global)
srv_module_filter_manager(id, module_fd, slices_global)
id |
( |
slices_global |
( |
module_fd |
( |
Module returns a slices_global
(reactiveVal
) containing a teal_slices
object with mapping.
The key role in maintaining the module-specific filter states is played by the .slicesGlobal
object. It is a reference class that holds the following fields:
all_slices
(reactiveVal
) - reactive value containing all filters registered in an app.
module_slices_api
(reactiveValues
) - reactive field containing references to each modules'
FilteredData
object methods. At this moment it is used only in srv_filter_manager
to display
the filter states in a table combining informations from all_slices
and from
FilteredData$get_available_teal_slices()
.
During a session only new filters are added to all_slices
unless module_snapshot_manager
is
used to restore previous state. Filters from all_slices
can be activated or deactivated in a
module which is linked (both ways) by attr(, "mapping")
so that:
If module's filter is added or removed in its FilteredData
object, this information is passed
to SlicesGlobal
which updates attr(, "mapping")
accordingly.
When mapping changes in a SlicesGlobal
, filters are set or removed from module's
FilteredData
.
Filter-manager is split into two parts:
ui/srv_filter_manager_panel
- Called once for the whole app. This module observes changes in
the filters in slices_global
and displays them in a table utilizing information from mapping
:
(TRUE
) - filter is active in the module
(FALSE
) - filter is inactive in the module
(NA
) - filter is not available in the module
ui/srv_module_filter_manager
- Called once for each teal_module
. Handling filter states
for of single module and keeping module FilteredData
consistent with slices_global
, so that
local filters are always reflected in the slices_global
and its mapping and vice versa.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.