Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor of the filter-panel #165

Merged
merged 177 commits into from Jul 14, 2023
Merged

Refactor of the filter-panel #165

merged 177 commits into from Jul 14, 2023

Conversation

gogonzo
Copy link
Contributor

@gogonzo gogonzo commented Jan 19, 2023

Feature branch for recent changes related with refactor of the filter-panel

Todo before merge:


testing module


funny_module <- function (label = "Filter states", datanames = "all") {
  checkmate::assert_string(label)
  module(
    label = label,
    filters = datanames,
    ui = function(id, ...) {
      ns <- NS(id)
      div(
        h2("The following filter calls are generated:"),
        verbatimTextOutput(ns("filter_states")),
        verbatimTextOutput(ns("filter_calls")),
        actionButton(ns("reset"), "reset_to_default")
      )
    },
    server = function(input, output, session, data, filter_panel_api) {
      checkmate::assert_class(data, "tdata")
      observeEvent(input$reset, set_filter_state(filter_panel_api, default_filters))
      output$filter_states <-  renderPrint({
        logger::log_trace("rendering text1")
        filter_panel_api %>% get_filter_state()
      })
      output$filter_calls <- renderText({
        logger::log_trace("rendering text2")
        attr(data, "code")()
      })
    }
  )
}

MAE example

options(teal.log_level = "TRACE", teal.show_js_log = TRUE)
#options("teal.bs_theme" = bslib::bs_theme(version = 5))
#options(shiny.trace = TRUE)
devtools::load_all("teal.slice")
devtools::load_all("teal")
library(scda)
library(SummarizedExperiment)
utils::data(miniACC, package = "MultiAssayExperiment")

default_filters <- filter_settings(
  filter_expr(id = "F", title = "females", dataname = "MAE", datalabel = "subjects", expr = 'MAE$gender == "female"'),
  filter_var(dataname = "MAE", datalabel = "subjects", varname = "race"),
  filter_var(dataname = "MAE", datalabel = "RPPAArray", arg = "subset", varname = "Protein", selected = TRUE),
  filter_var(dataname = "MAE", datalabel = "RPPAArray", arg = "subset", varname = "Genes"),
  include_varnames = list(MAE = c("race", "gender")),
  count_type = "none"
)

MAE <- miniACC
data <- teal.data::teal_data(teal.data::dataset("MAE", MAE))

app <- init(
  data = data,
  modules = list(funny_module(), funny_module("module2")),
  filter = default_filters
)

runApp(app)

CDISC example

options(teal.log_level = "TRACE", teal.show_js_log = TRUE)
#options("teal.bs_theme" = bslib::bs_theme(version = 4))
#options(shiny.trace = TRUE)
devtools::load_all("teal.slice")
library(teal)
library(scda)

ADSL <- synthetic_cdisc_data("latest")$adsl
ADSL$empty <- NA
ADSL$logical1 <- FALSE
ADSL$logical <- sample(c(TRUE, FALSE), size = nrow(ADSL), replace = TRUE)
ADSL$numeric <- rnorm(nrow(ADSL))
ADSL$categorical2 <- sample(letters[1:10], size = nrow(ADSL), replace = TRUE)
ADSL$categorical <- sample(letters[1:3], size = nrow(ADSL), replace = TRUE, prob = c(.1, .3, .6))
ADSL$date <- Sys.Date() + seq_len(nrow(ADSL))
ADSL$date2 <- rep(Sys.Date() + 1:3, length.out = nrow(ADSL))
ADSL$datetime <- Sys.time() + seq_len(nrow(ADSL)) * 3600 * 12
ADSL$datetime2 <- rep(Sys.time() + 1:3 * 43200, length.out = nrow(ADSL))

ADSL$numeric[sample(1:nrow(ADSL), size = 10)] <- NA
ADSL$numeric[sample(1:nrow(ADSL), size = 10)] <- Inf
ADSL$logical[sample(1:nrow(ADSL), size = 10)] <- NA
ADSL$date[sample(1:nrow(ADSL), size = 10)] <- NA
ADSL$datetime[sample(1:nrow(ADSL), size = 10)] <- NA
ADSL$categorical2[sample(1:nrow(ADSL), size = 10)] <- NA
ADSL$categorical[sample(1:nrow(ADSL), size = 10)] <- NA

ADTTE <- synthetic_cdisc_data("latest")$adtte
ADRS <- synthetic_cdisc_data("latest")$adrs

ADTTE$numeric <- rnorm(nrow(ADTTE))
ADTTE$numeric[sample(1:nrow(ADTTE), size = 10,)] <- NA

default_filters <- filter_settings(
  filter_var(dataname = "ADSL", varname = "categorical", selected = c("a", "b"), disabled = TRUE),
  filter_var(dataname = "ADSL", varname = "categorical2", selected = c("a", "b"), disabled = TRUE),
  filter_var(dataname = "ADSL", varname = "numeric", selected = c(0, 140), keep_na = TRUE, keep_inf = TRUE, disabled = TRUE),
  filter_var(dataname = "ADSL", varname = "logical", selected = c(T), keep_na = TRUE, keep_inf = TRUE, disabled = TRUE),
  filter_var(dataname = "ADSL", varname = "datetime", disabled = TRUE),
  filter_var(dataname = "ADSL", varname = "date2", disabled = TRUE),
  filter_expr(id = "AF", title = "ADULT FEMALE", dataname = "ADSL", expr = "SEX %in% 'F' & AGE >= 18L", disabled = TRUE),
  filter_expr(id = "SE", title = "Safety-Evaluable", dataname = "ADSL", expr = "SAFFL == 'Y'", disabled = TRUE),
  filter_var(dataname = "ADSL", varname = "COUNTRY", selected = c("USA", "CAN", "JPN"), fixed = T, disabled = TRUE),
  count_type = "all",
  #include_varnames = list(ADSL = c("SEX", "categorical2", "numeric", "logical", "date", "datetime", "date2", "datetime2", "COUNTRY")),
  exclude_varnames = list(
    ADTTE = intersect(colnames(ADSL), colnames(ADTTE)),
    ADRS = colnames(ADSL)
  )
)

data <- cdisc_data(
  cdisc_dataset("ADSL", ADSL),
  cdisc_dataset("ADTTE", ADTTE),
  cdisc_dataset("ADRS", ADRS)
)

app <- init(
  data = data,
  modules = list(
    tm_data_table(
      variables_selected = list(ADSL = c("STUDYID", "USUBJID", "SUBJID", "SITEID", "AGE", "SEX")),
      dt_args = list(caption = "ADSL Table Caption")
    ),
    funny_module()
  ),
  filter = default_filters
)

runApp(app)

non-cdisc example

options(teal.log_level = "TRACE", teal.show_js_log = TRUE)
options("teal.bs_theme" = bslib::bs_theme(version = 4))
#options(shiny.trace = TRUE)
devtools::load_all("teal.slice")
library(teal)
library(scda)

Iris <- iris
attr(Iris[[1]], "label") <- "variable label"
attr(Iris[[2]], "label") <- "variable label"
attr(Iris[[3]], "label") <- "variable label"
attr(Iris[[4]], "label") <- "variable label"
data <- teal_data(
  dataset("iris", Iris),
  dataset("mtcars", mtcars)
)

default_filters <- filter_settings(
  filter_var("iris", "Sepal.Length", sel = c(5.1, 6.4), fixed = FALSE),
  filter_var("iris", "Sepal.Width", sel = c(2.5, 4.0), fixed = FALSE, disabled = TRUE),
  filter_var("iris", "Petal.Length", sel = c(4.5, 5.1), fixed = TRUE),
  filter_var("iris", "Petal.Width", sel = c(0.3, 1.8), fixed = TRUE, disabled = TRUE),
  filter_var("iris", "Species", sel = c("versicolor", "virginica"), fixed = FALSE),
  exclude_varnames = list(iris = c("Sepal.Length", "Sepal.Width"))
)

app <- init(
  data = data,
  modules = list(funny_module(), funny_module("module2")),
  filter = default_filters
)


runApp(app)

Closes #131 and closes #142 and closes #161 and closes #162


Co-authored-by: Dawid Kałędkowski <dawid.kaledkowski@gmail.com>
@gogonzo gogonzo added the core label Jan 19, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Feb 2, 2023

Unit Test Performance Difference

Test Suite $Status$ Time on main $±Time$ $±Tests$ $±Skipped$ $±Failures$ $±Errors$
FilterStates 💚 $8.84$ $-8.77$ $-57$ $0$ $0$ $0$
FilteredData 💔 $3.51$ $+8.03$ $+12$ $0$ $0$ $0$
MAEFilterStates 💚 $4.01$ $-2.87$ $0$ $0$ $0$ $0$
count_labels 👶 $+0.34$ $+53$ $0$ $0$ $0$
Additional test case details
Test Suite $Status$ Time on main $±Time$ Test Case
CDISCFilteredData 💀 $0.03$ $-0.03$ get_filterable_varnames_does_not_return_child_duplicates
CDISCFilteredData 💀 $0.03$ $-0.03$ get_filterable_varnames_does_not_return_child_non_filterable_variables
CDISCFilteredData 💀 $0.03$ $-0.03$ get_filterable_varnames_does_not_return_duplicates_from_parent_even_if_they_are_not_filterable
CDISCFilteredData 💀 $0.03$ $-0.03$ get_filterable_varnames_return_all_filterable_variables_from_parent_dataset
CDISCFilteredData 💀 $0.03$ $-0.03$ get_varlabels_returns_the_column_labels_of_the_passed_dataset
CDISCFilteredData 💀 $0.06$ $-0.06$ set_filter_state
CDISCFilteredData 👶 $+0.04$ set_filter_state_returns_warning_when_setting_a_filter_on_a_column_which_doesn_t_exist
CDISCFilteredData 👶 $+0.04$ set_filter_state_sets_don_t_throw_if_column_exists_and_isn_t_duplicated_with_parent
ChoicesFilterState 👶 $+0.04$ ChoicesFilterState_private_methods_return_proper_filtered_counts
ChoicesFilterState 👶 $+0.03$ is_any_filtered_returns_TRUE_when_enabled
DFFilterStates 👶 $+0.10$ DFFilterState_get_call_skips_conditions_form_FilterState_which_are_identified_by_sid
DFFilterStates 👶 $+0.09$ DFFilterStates_set_filter_state_sets_sid_after_state_list_index_and_varname
DFFilterStates 💀 $0.01$ $-0.01$ DFFilterStates_ui_add_filter_state_returns_a_message_inside_a_div_when_data_has_no_columns_or_no_rows
DFFilterStates 👶 $+0.01$ DFFilterStates_ui_add_returns_a_message_inside_a_div_when_data_has_no_columns_or_no_rows
DFFilterStates 👶 $+0.06$ get_filter_count_returns_the_number_of_active_filter_states_DFFilterStates
DateFilterState 👶 $+0.02$ is_any_filtered_returns_TRUE_when_enabled
DateFilterState 💀 $0.01$ $-0.01$ set_selected_raises_error_when_selection_is_not_sorted
DateFilterState 👶 $+0.03$ set_selected_warns_when_selection_is_not_sorted
DatetimeFilterState 👶 $+0.03$ is_any_filtered_returns_TRUE_when_enabled
DatetimeFilterState 💀 $0.02$ $-0.02$ set_selected_warns_when_the_selected_range_intersects_the_possible_range_but_is_not_fully_included_in_it
DatetimeFilterState 👶 $+0.02$ set_selected_warns_when_the_selected_range_intersects_the_range_but_is_not_fully_included_in_it
DefaultFilteredDataset 👶 $+0.01$ filter_states_list_is_initialized_with_single_FilterStates_element_named_as_filter
FilterState 👶 $+0.01$ disable_copies_last_state_to_the_cache
FilterState 👶 $+0.01$ disable_sets_all_state_elements_to_NULL
FilterState 👶 $+0.02$ enable_clears_cache
FilterState 👶 $+0.01$ enable_sets_state_back_to_the_last_state
FilterStates 👶 $+0.00$ Clearing_empty_FilterStates_does_not_raise_errors
FilterStates 💀 $0.01$ $-0.01$ Elements_of_the_list_returned_by_state_list_get_have_names_corresponding_to_varname_DFFilterStates
FilterStates 💀 $0.01$ $-0.01$ Elements_of_the_list_returned_by_state_list_get_have_names_corresponding_to_varname_MAEFilterStates
FilterStates 💀 $0.01$ $-0.01$ Elements_of_the_list_returned_by_state_list_get_have_names_corresponding_to_varname_MatrixFilterStates
FilterStates 💀 $0.01$ $-0.01$ Elements_of_the_list_returned_by_state_list_get_have_names_corresponding_to_varname_SEFilterStates
FilterStates 💀 $0.00$ $-0.00$ Emptying_empty_FilterStates_does_not_raise_errors
FilterStates 💀 $0.01$ $-0.01$ Error_message_from_validate_state_list_exists_displays_index_if_datalabel_is_character_0_
FilterStates 💀 $0.01$ $-0.01$ Passing_a_FilterState_to_state_list_push_is_the_same_as_passing_it_in_a_list_DFFilterStates
FilterStates 💀 $0.01$ $-0.01$ Passing_a_FilterState_to_state_list_push_is_the_same_as_passing_it_in_a_list_MAEFilterStates
FilterStates 💀 $0.01$ $-0.01$ Passing_a_FilterState_to_state_list_push_is_the_same_as_passing_it_in_a_list_MatrixFilterStates
FilterStates 💀 $0.01$ $-0.01$ Passing_a_FilterState_to_state_list_push_is_the_same_as_passing_it_in_a_list_SEFilterStates
FilterStates 💀 $0.36$ $-0.36$ get_call_returns_a_call_filtering_a_data.frame_base_on_a_combination_of_FilterState_objects
FilterStates 💀 $0.05$ $-0.05$ get_call_returns_a_call_filtering_a_data.frame_based_on_a_ChoicesFilterState
FilterStates 💀 $0.12$ $-0.12$ get_call_returns_a_call_filtering_a_data.frame_based_on_a_DateFilterState
FilterStates 💀 $0.14$ $-0.14$ get_call_returns_a_call_filtering_a_data.frame_based_on_a_DatetimeFilterState
FilterStates 💀 $0.03$ $-0.03$ get_call_returns_a_call_filtering_a_data.frame_based_on_a_LogicalFilterState
FilterStates 💀 $0.05$ $-0.05$ get_call_returns_a_call_filtering_a_data.frame_based_on_a_RangeFilterState
FilterStates 💀 $0.02$ $-0.02$ get_filter_count_properly_tallies_multiple_state_lists_SEFilterStates
FilterStates 💀 $0.02$ $-0.02$ get_filter_count_returns_the_number_of_active_filter_states_DFFilterStates
FilterStates 💀 $0.02$ $-0.02$ get_filter_count_returns_the_number_of_active_filter_states_MAEFilterStates
FilterStates 💀 $0.02$ $-0.02$ get_filter_count_returns_the_number_of_active_filter_states_MartixFilterStates
FilterStates 💀 $0.03$ $-0.03$ get_filter_count_returns_the_number_of_active_filter_states_SEFilterStates
FilterStates 💀 $0.01$ $-0.01$ state_list_get_returns_the_list_of_FilterState_objects_pushed_DFFilterStates
FilterStates 💀 $0.01$ $-0.01$ state_list_get_returns_the_list_of_FilterState_objects_pushed_MAEFilterStates
FilterStates 💀 $0.01$ $-0.01$ state_list_get_returns_the_list_of_FilterState_objects_pushed_MatrixFilterStates
FilterStates 💀 $0.01$ $-0.01$ state_list_get_returns_the_list_of_FilterState_objects_pushed_SEFilterStates
FilterStates 💀 $0.01$ $-0.01$ state_list_is_empty_after_pushing_and_removing_an_element_from_it_DFFilterStates
FilterStates 💀 $0.01$ $-0.01$ state_list_is_empty_after_pushing_and_removing_an_element_from_it_MAEFilterStates
FilterStates 💀 $0.01$ $-0.01$ state_list_is_empty_after_pushing_and_removing_an_element_from_it_MatrixFilterStates
FilterStates 💀 $0.01$ $-0.01$ state_list_is_empty_after_pushing_and_removing_an_element_from_it_SEFilterStates
FilterStates 💀 $0.01$ $-0.01$ state_list_is_empty_after_state_list_empty_DFFilterStates
FilterStates 💀 $0.01$ $-0.01$ state_list_is_empty_after_state_list_empty_MAEFilterStates
FilterStates 💀 $0.01$ $-0.01$ state_list_is_empty_after_state_list_empty_MatrixFilterStates
FilterStates 💀 $0.01$ $-0.01$ state_list_is_empty_after_state_list_empty_SEFilterStates
FilterStates 💀 $0.01$ $-0.01$ state_list_push_does_not_raise_errors_DFFilterStates
FilterStates 💀 $1.00$ $-1.00$ state_list_push_does_not_raise_errors_MAEFilterStates
FilterStates 💀 $0.01$ $-0.01$ state_list_push_does_not_raise_errors_MatrixFilterStates
FilterStates 💀 $6.57$ $-6.57$ state_list_push_does_not_raise_errors_SEFilterStates
FilterStates 💀 $0.01$ $-0.01$ state_list_remove_removes_filter_state_without_error_DFFilterStates
FilterStates 💀 $0.01$ $-0.01$ state_list_remove_removes_filter_state_without_error_MAEFilterStates
FilterStates 💀 $0.01$ $-0.01$ state_list_remove_removes_filter_state_without_error_MatrixFilterStates
FilterStates 💀 $0.01$ $-0.01$ state_list_remove_removes_filter_state_without_error_SEFilterStates
FilteredData 👶 $+0.09$ FilteredData_clear_filter_states_remove_the_filters_of_the_desired_dataset_only
FilteredData 👶 $+0.08$ FilteredData_clear_filter_states_removes_all_filters_of_all_datasets_in_FilteredData
FilteredData 👶 $+0.05$ FilteredData_get_call_return_a_list_of_calls_when_filter_applied
FilteredData 👶 $+0.02$ FilteredData_get_call_returns_a_NULL_if_no_filters_applied
FilteredData 👶 $+0.02$ FilteredData_get_call_throws_if_dataname_doesn_t_match_available_datasets
FilteredData 👶 $+0.05$ FilteredData_get_data_returns_an_object_filtered_by_set_filters
FilteredData 👶 $+0.06$ FilteredData_get_filter_state_returns_list_identical_to_input_with_attribute_format
FilteredData 💀 $0.22$ $-0.22$ FilteredData_get_filter_state_returns_list_identical_to_input_with_attributes
FilteredData 💀 $0.05$ $-0.05$ FilteredData_remove_all_filter_states_remove_the_filters_of_the_desired_dataset_only
FilteredData 💀 $0.05$ $-0.05$ FilteredData_remove_all_filter_states_removes_all_filters_of_all_datasets_in_FilteredData
FilteredData 💀 $0.05$ $-0.05$ FilteredData_set_filter_state_sets_filters_in_FilteredDataset_specified_by_the_named_list
FilteredData 👶 $+0.02$ The_constructor_accepts_check_to_be_a_flag
FilteredData 👶 $+0.02$ The_constructor_accepts_code_to_be_CodeClass_or_NULL
FilteredData 👶 $+7.13$ The_constructor_accepts_datasets_as_list_containing_data.frame_and_MAE_objects_only
FilteredData 👶 $+0.02$ The_constructor_accepts_join_keys_to_be_JoinKeys_or_NULL
FilteredData 💀 $0.02$ $-0.02$ The_constructor_does_not_throw
FilteredData 👶 $+0.02$ The_constructor_does_not_throw_with_argument_dataset_specified_only
FilteredData 👶 $+0.01$ datanames_returns_character_vector_reflecting_names_of_set_datasets
FilteredData 💀 $0.03$ $-0.03$ get_call_returns_a_list_of_language_objects_or_NULL
FilteredData 💀 $0.01$ $-0.01$ get_data_does_not_throw_when_passed_a_dataset_name
FilteredData 👶 $+0.01$ get_data_filtered_FALSE_returns_the_same_object_as_passed_to_the_constructor
FilteredData 👶 $+0.02$ get_data_requires_dataname_being_a_subset_of_datanames
FilteredData 💀 $0.01$ $-0.01$ get_data_returns_the_object_passed_to_the_constructor
FilteredData 👶 $+0.01$ get_data_returns_the_same_object_as_passed_to_the_constructor_if_no_filter_applied
FilteredData 💀 $0.02$ $-0.02$ get_filter_expr_returns_a_string_with_a_filtering_expression
FilteredData 👶 $+0.07$ get_filter_expr_returns_all_filter_calls_as_character
FilteredData 👶 $+0.01$ get_filter_expr_returns_empty_string_when_no_filters_applied
FilteredData 💀 $0.01$ $-0.01$ get_filtered_dataset_returns_a_list_of_FilteredDataset
FilteredData 💀 $0.01$ $-0.01$ get_filtered_dataset_returns_a_list_with_elements_named_after_set_datasets
FilteredData 💀 $0.01$ $-0.01$ get_varlabels_returns_an_array_of_NAs_when_dataset_has_no_variable_labels
FilteredData 💀 $0.04$ $-0.04$ get_varlabels_returns_array_s_labels_when_dataset_has_variable_labels
FilteredData 💀 $0.01$ $-0.01$ get_varnames_returns_dataname_s_column_names
FilteredData 💀 $0.02$ $-0.02$ restore_state_from_bookmark_is_a_pure_virtual_method
FilteredData 👶 $+0.01$ set_dataset_creates_FilteredDataset_object
FilteredDataset 👶 $+0.00$ filter_states_is_empty_when_not_initialized
FilteredDataset 💀 $0.00$ $-0.00$ get_filter_states_returns_an_empty_list_after_initialization
FilteredDataset 💀 $0.00$ $-0.00$ get_varlabels_NULL_returns_a_named_array_of_NAs_if_data.frame_has_no_varlabels
FilteredDataset 💀 $0.00$ $-0.00$ get_varlabels_returns_labels_for_the_part_of_the_variables_only
FilteredDataset 💀 $0.00$ $-0.00$ get_varnames_returns_the_names_of_the_variables_in_the_data_passed_to_the_constructor
FilteredDataset 💀 $0.01$ $-0.01$ set_filterable_varnames_restricts_which_variables_can_be_filtered
FilteredDataset 💀 $0.01$ $-0.01$ setting_filterable_varnames_to_NULL_or_character_0_does_not_affect_the_filterable_variables
FilteredDataset 💀 $0.00$ $-0.00$ setting_filterable_varnames_which_include_columns_that_do_not_exist_ignores_these_columns
FilteredDataset 💀 $0.03$ $-0.03$ setting_filterable_varnames_with_varnames_not_NULL_or_non_missing_character_throws_error
FilteredDataset 💀 $0.01$ $-0.01$ ui_add_filter_state_is_pure_virtual
FilteredDataset 👶 $+0.01$ ui_add_is_pure_virtual
LogicalFilterState 👶 $+0.02$ is_any_filtered_returns_TRUE_when_enabled
MAEFilterStates 💀 $0.08$ $-0.08$ MAEFilterStates_ui_add_filter_state_returns_a_message_inside_a_div_when_data_has_no_rows_or_no_columns
MAEFilterStates 💀 $1.22$ $-1.22$ get_call_returns_a_call_filtering_an_MAE_object_using_ChoicesFilterState
MAEFilterStates 💀 $1.95$ $-1.95$ get_call_returns_a_call_filtering_an_MAE_object_using_RangeFilterState
MAEFilterStates 👶 $+0.49$ get_call_returns_executable_subsetByColData_call_
MAEFilterStates 👶 $+0.04$ get_filter_count_returns_the_number_of_active_filter_states_MAEFilterStates
MAEFilteredDataset 💀 $0.09$ $-0.09$ MAEFilteredDataset_get_filterable_varnames_returns_character_0_
MAEFilteredDataset 💀 $0.10$ $-0.10$ MAEFilteredDataset_get_varlabels_returns_column_variable_labels
MAEFilteredDataset 👶 $+0.09$ filter_states_list_is_initialized_with_names_of_experiments
MatrixFilterStates 💀 $0.01$ $-0.01$ MatrixFilterStates_ui_add_filter_state_returns_a_message_inside_a_div_when_data_has_no_rows_or_no_columns
MatrixFilterStates 👶 $+0.00$ MatrixFilterStates_ui_add_returns_a_message_inside_a_div_when_data_has_no_rows_or_no_columns
MatrixFilterStates 💀 $0.01$ $-0.01$ get_call_returns_a_call_filtering_a_matrix_with_numeric_values
MatrixFilterStates 👶 $+0.03$ get_call_returns_a_executable_call_filtering_a_matrix_with_numeric_values
MatrixFilterStates 👶 $+0.03$ get_filter_count_returns_the_number_of_active_filter_states_MartixFilterStates
RangeFilterState 👶 $+0.02$ disable_copies_last_state_to_the_cache
RangeFilterState 👶 $+0.03$ disable_sets_all_state_elements_to_NULL
RangeFilterState 👶 $+0.03$ enable_clears_cache
RangeFilterState 👶 $+0.03$ enable_sets_state_back_to_the_last_state
RangeFilterState 👶 $+0.03$ is_any_filtered_returns_FALSE_when_disabled
RangeFilterState 👶 $+0.03$ is_any_filtered_returns_TRUE_when_enabled
SEFilterStates 💀 $0.06$ $-0.06$ SEFilterStates_remove_filter_state_throws_error_when_list_is_not_named
SEFilterStates 💀 $0.16$ $-0.16$ SEFilterStates_set_filter_state_sets_filters_in_state_list_specified_by_the_named_list
SEFilterStates 💀 $0.06$ $-0.06$ SEFilterStates_ui_add_filter_state_returns_a_message_inside_a_div_when_data_has_no_rows_or_no_columns
SEFilterStates 👶 $+0.05$ SEFilterStates_ui_add_returns_a_message_inside_a_div_when_data_has_no_rows_or_no_columns
SEFilterStates 💀 $0.09$ $-0.09$ clone_method_returns_object_with_the_same_state
SEFilterStates 💀 $0.01$ $-0.01$ get_call_method_returns_NULL
SEFilterStates 👶 $+0.05$ get_call_method_returns_NULL_if_no_states_added
SEFilterStates 👶 $+0.09$ get_filter_count_properly_tallies_multiple_state_lists_SEFilterStates
SEFilterStates 💀 $0.01$ $-0.01$ set_filter_state_throws_error_when_data_argument_is_not_of_class_SummarizedExperiment
SEFilterStates 💀 $0.01$ $-0.01$ set_filter_state_throws_error_when_no_data_argument_is_inputted
count_labels 👶 $+0.04$ countBar_requires_InputId_to_be_a_character_1_
count_labels 👶 $+0.02$ countBar_requires_countmax_to_be_a_numeric_1_
count_labels 👶 $+0.03$ countBar_requires_countnow_to_be_a_numeric_1_NULL_or_missing
count_labels 👶 $+0.02$ countBar_requires_counttotal_to_be_a_numeric_1_
count_labels 👶 $+0.03$ countBar_requires_label_to_be_a_character_1_
count_labels 👶 $+0.00$ countBar_returns_a_div_with_class_and_two_progressbars
count_labels 👶 $+0.04$ countBars_requires_InputId_to_be_a_character_1_
count_labels 👶 $+0.02$ countBars_requires_choices_to_be_a_vector
count_labels 👶 $+0.03$ countBars_requires_counstnow_to_be_a_numeric_lower_than_countsmax_NULL_or_missing
count_labels 👶 $+0.03$ countBars_requires_countsmax_to_be_a_numeric_of_the_same_length_as_choices
count_labels 👶 $+0.00$ countBars_returns_a_list_of_countBar_s_
count_labels 👶 $+0.02$ make_count_text_requires_countmax_to_be_a_numeric_1_
count_labels 👶 $+0.02$ make_count_text_requires_countnow_to_be_a_numeric_1_NULL_or_missing
count_labels 👶 $+0.02$ make_count_text_requires_label_to_be_a_character_1_
count_labels 👶 $+0.00$ make_count_text_returns_label_countmax_when_countnow_is_null_or_missing
count_labels 👶 $+0.00$ make_count_text_returns_label_countnow_countmax_
filter_panel_api 👶 $+0.09$ FilterPanelAPI_clear_filter_states_remove_the_filters_of_the_desired_dataset_only
filter_panel_api 👶 $+0.04$ FilterPanelAPI_clear_filter_states_removes_all_filters_of_datasets_in_FilterPanelAPI
filter_panel_api 💀 $0.04$ $-0.04$ FilterPanelAPI_remove_all_filter_states_remove_the_filters_of_the_desired_dataset_only
filter_panel_api 💀 $0.02$ $-0.02$ FilterPanelAPI_remove_all_filter_states_removes_all_filters_of_datasets_in_FilterPanelAPI

Results for commit d218074

♻️ This comment has been updated with latest results.

Nikolas Burkoff and others added 13 commits February 3, 2023 15:05
Merging `main` branch into `filter_panel_refactor`  following #189.

---------

Co-authored-by: chlebowa <chlebowa@users.noreply.github.com>
Co-authored-by: Dawid Kałędkowski <dawid.kaledkowski@gmail.com>
Allows filter state inputs to collapse and expand, defaulting to
collapsed. Only 1 filter state per data set can be open at a time.

- For a given data set, filter information is in an accordion of
collapsible cards
- Only 1 filter state (per data set) can be open at a time.
- Card headers show a summary of the filter state.

Logical and choices filter state UIs don't display correctly, at least
on Bootstrap 4.


Closes #129.

---------

Co-authored-by: Dawid Kałędkowski <dawid.kaledkowski@gmail.com>
# Pull Request

Fixes
#[183](#183)

---------

Signed-off-by: Marek Blazewicz <110387997+BLAZEWIM@users.noreply.github.com>
Co-authored-by: Mahmoud Hallal <86970066+mhallal1@users.noreply.github.com>
Co-authored-by: Dawid Kałędkowski <6959016+gogonzo@users.noreply.github.com>
# Pull Request

Fixes
#[158](#158)


1. At initialization, when values are not valid, corrections will be
performed with warnings.
2. Later, when changed by the user, shinyvalidate is used.
 
Example to test:

```
adsl <- synthetic_cdisc_dataset("latest", "adsl")

app <- init(
  data = teal_data(dataset("ADSL", adsl)),
  modules = example_module(),
  filter = list(
    "ADSL" = list(
      RANDDT = list(selected = c("2021-02-16", "2021-02-17")),
      TRT01SDTM = list(selected = c("2021-02-11 17:09:18", "2021-02-10 20:42:27"))
    )
  )
)
runApp(app)
```

---------

Signed-off-by: Marek Blazewicz <110387997+BLAZEWIM@users.noreply.github.com>
Co-authored-by: Dawid Kałędkowski <6959016+gogonzo@users.noreply.github.com>
@gogonzo gogonzo mentioned this pull request Feb 21, 2023
@gogonzo gogonzo added the Blocked label Jul 4, 2023
gogonzo and others added 8 commits July 5, 2023 15:22
rename and docs fixing
Closes #378 

This PR provides an ability to pass `trim_lines` parameter for
`$format()` method of FilterState, FilerStates, FilteredDataset and
FilteredData R6 objects.

---------

Signed-off-by: Marcin <133694481+m7pr@users.noreply.github.com>
Co-authored-by: Aleksander Chlebowski <114988527+chlebowa@users.noreply.github.com>
Co-authored-by: 27856297+dependabot-preview[bot]@users.noreply.github.com <27856297+dependabot-preview[bot]@users.noreply.github.com>
@github-actions
Copy link
Contributor

github-actions bot commented Jul 11, 2023

badge

Code Coverage Summary

Filename                      Stmts    Miss  Cover    Missing
--------------------------  -------  ------  -------  -----------------------------------------------------------------------------------------------------------------------------------------------------------------
R/calls_combine_by.R              8       0  100.00%
R/choices_labeled.R              49      14  71.43%   22, 33, 38, 48-53, 65, 69-73
R/count_labels.R                 98       0  100.00%
R/filter_panel_api.R             37       2  94.59%   89, 101
R/FilteredData-utils.R          117      17  85.47%   103-108, 201, 223-232
R/FilteredData.R                574     222  61.32%   100-103, 477-485, 568-577, 599, 620-661, 679-682, 698, 739-772, 787-789, 793-799, 825-854, 876-878, 882-884, 887-898, 902-911, 913-939, 957-1027, 1069, 1092-1110
R/FilteredDataset-utils.R        20       1  95.00%   133
R/FilteredDataset.R             179      67  62.57%   50, 146, 195-201, 229-286, 326-328
R/FilteredDatasetDefault.R      121       9  92.56%   69, 131, 141, 145, 227-231
R/FilteredDatasetMAE.R          134      37  72.39%   27, 113-118, 157-162, 166-167, 187-209
R/FilterPanelAPI.R               10       0  100.00%
R/FilterState-utils.R           133       1  99.25%   370
R/FilterState.R                 291      46  84.19%   88, 210, 280, 324, 617-642, 653-672, 707-713, 722-728
R/FilterStateChoices.R          358     122  65.92%   291-294, 306, 334-340, 365, 389-396, 400-417, 446, 461-472, 484-492, 496-525, 546-549, 552-555, 566-587, 600-601, 611-615, 617-621
R/FilterStateDate.R             229     141  38.43%   216-222, 235, 285-446
R/FilterStateDatettime.R        331     218  34.14%   253-259, 273, 323-567
R/FilterStateEmpty.R             63      41  34.92%   82, 92-97, 111, 125-176
R/FilterStateExpr.R              61      48  21.31%   138-231
R/FilterStateLogical.R          216     163  24.54%   127, 150, 206-212, 220, 223-421
R/FilterStateRange.R            435     131  69.89%   251, 348-354, 362, 385, 513-517, 520-530, 533, 545-551, 562-574, 578-588, 592-594, 608-635, 650-654, 656-660, 665-669, 671-675, 692-709, 744-749, 759-761
R/FilterStates-utils.R           70       9  87.14%   102, 121, 179-185, 207, 234
R/FilterStates.R                360      30  91.67%   76-80, 189, 317-326, 413-416, 459, 544-548, 593, 705-708
R/FilterStatesDF.R                5       0  100.00%
R/FilterStatesMAE.R              10       1  90.00%   39
R/FilterStatesMatrix.R            3       0  100.00%
R/FilterStatesSE.R              211     157  25.59%   34, 69-71, 81-83, 107-114, 122-129, 152-300
R/include_css_js.R                5       5  0.00%    12-16
R/teal_slice-store.R              7       7  0.00%    28-57
R/teal_slice.R                   98       2  97.96%   132, 194
R/teal_slices.R                 133       1  99.25%   194
R/test_utils.R                   21       0  100.00%
R/utils.R                        49       2  95.92%   101-102
R/variable_types.R               48      33  31.25%   41-46, 56, 69-104
R/zzz.R                          15      15  0.00%    3-46
TOTAL                          4499    1542  65.73%

Diff against main

Filename                      Stmts    Miss  Cover
--------------------------  -------  ------  --------
R/calls_combine_by.R             +1       0  +100.00%
R/count_labels.R                +98       0  +100.00%
R/filter_panel_api.R            +37      +2  +94.59%
R/FilteredData-utils.R          +19     -26  +29.35%
R/FilteredData.R                +69     -45  +14.20%
R/FilteredDataset-utils.R       +20      +1  +95.00%
R/FilteredDataset.R              -9     -10  +3.53%
R/FilteredDatasetDefault.R      +15      +1  +0.11%
R/FilteredDatasetMAE.R          -74     -22  +0.75%
R/FilterPanelAPI.R              -13      -8  +34.78%
R/FilterState-utils.R           -22     -14  +8.93%
R/FilterState.R                 +64     -42  +22.96%
R/FilterStateChoices.R         +189     +26  +22.73%
R/FilterStateDate.R             +64     +33  +3.88%
R/FilterStateDatettime.R        +93     +52  +3.89%
R/FilterStateEmpty.R            +22     +25  -26.05%
R/FilterStateExpr.R             +61     +48  +21.31%
R/FilterStateLogical.R          +78     +84  -18.22%
R/FilterStateRange.R           +210      +2  +27.22%
R/FilterStates-utils.R           +2      +4  -5.50%
R/FilterStates.R               +142     -63  +34.33%
R/FilterStatesDF.R             -225     -29  +12.61%
R/FilterStatesMAE.R            -211    -105  +37.96%
R/FilterStatesMatrix.R         -214    -108  +49.77%
R/FilterStatesSE.R             -198     -44  -25.26%
R/teal_slice-store.R             +7      +7  +100.00%
R/teal_slice.R                  +98      +2  +97.96%
R/teal_slices.R                +133      +1  +99.25%
R/test_utils.R                  +21       0  +100.00%
R/utils.R                       +10       0  +1.05%
R/zzz.R                          +9      +9  +100.00%
TOTAL                          +496    -219  +8.73%

Results for commit: d58f998

Minimum allowed coverage is 80%

♻️ This comment has been updated with latest results

gogonzo and others added 2 commits July 12, 2023 14:49
gogonzo and others added 3 commits July 13, 2023 08:53
closes #52

---------

Co-authored-by: Aleksander Chlebowski <aleksander.chlebowski@contractors.roche.com>
Co-authored-by: 27856297+dependabot-preview[bot]@users.noreply.github.com <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: m7pr <marcin.kosinski.mk1@roche.com>
@gogonzo gogonzo merged commit 56f30ba into main Jul 14, 2023
46 checks passed
@gogonzo gogonzo deleted the filter_panel_refactor@main branch July 14, 2023 16:13
gogonzo added a commit to insightsengineering/teal.gallery that referenced this pull request Jul 14, 2023
@donyunardi donyunardi mentioned this pull request Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants