Skip to contents

For each filter type `.gui_filter` method should return a list of the below objects:

  • input UI structure defining filter input controllers.

  • feedback List defining feedback plot output.

  • server Optional server-side expression attached to filter panel (e.g. filter specific observers).

  • update An expression used for updating filter panel based on its configuration.

  • post_stats TRUE if post statistics are displayed in filter controller (e.g. for discrete filter). If FALSE, some operations are skipped which results with better performance.

  • multi_input TRUE if multiple input controllers are used for providing filter value (e.g. range input where both numericInput and sliderInput are used). If FALSE, some operations are skipped which results with better performance.

If you want to learn more about creating filter layers see `vignette("gui-filter-layer")`.

Usage

.gui_filter(filter, ...)

# S3 method for discrete
.gui_filter(filter, ...)

# S3 method for range
.gui_filter(filter, ...)

# S3 method for date_range
.gui_filter(filter, ...)

# S3 method for discrete_text
.gui_filter(filter, ...)

# S3 method for multi_discrete
.gui_filter(filter, ...)

Arguments

filter

Filter object.

...

Extra arguments passed to a specific method.

Value

List consisting filter metadata and methods that allow to perform filter based operations. See `vignette("custom-filters")`.

See also

Examples

library(cohortBuilder)
librarian_source <- set_source(as.tblist(librarian))
copies_filter <- filter(
  "range", id = "copies", name = "Copies", dataset = "books",
  variable = "copies", range = c(5, 12)
)
copies_filter_evaled <- copies_filter(librarian_source)
copies_filter_evaled$gui <- .gui_filter(copies_filter_evaled)

str(copies_filter_evaled$gui)
#> List of 6
#>  $ input      :function (input_id, cohort)  
#>  $ feedback   :function (input_id, cohort, empty = FALSE)  
#>  $ server     :function (input_id, input, output, session, cohort)  
#>  $ update     :function (session, input_id, cohort, reset = FALSE, ...)  
#>  $ post_stats : logi FALSE
#>  $ multi_input: logi TRUE