library(shiny)
fd <- init_filtered_data(list(iris = iris))
fpa <- FilterPanelAPI$new(fd)
# get the actual filter state --> empty named list
isolate(fpa$get_filter_state())
# set a filter state
set_filter_state(
fpa,
teal_slices(
teal_slice(dataname = "iris", varname = "Species", selected = "setosa", keep_na = TRUE)
)
)
# get the actual filter state --> named list with filters
isolate(fpa$get_filter_state())
# remove all_filter_states
fpa$clear_filter_states()
# get the actual filter state --> empty named list
isolate(fpa$get_filter_state())
Run the code above in your browser using DataLab