From aac74be0b077320d376f18fb9ec9e8403948427f Mon Sep 17 00:00:00 2001 From: donyunardi Date: Fri, 1 Nov 2024 20:03:04 +0000 Subject: [PATCH] [actions skip] Built site for teal.slice@b732c15e22c43291f2e83ac8f4c409ed66f9008c --- 404.html | 26 +- .../coverage-report/index.html | 6876 ++++++++++------ CODE_OF_CONDUCT.html | 111 +- CONTRIBUTING.html | 130 +- LICENSE-text.html | 66 +- SECURITY.html | 78 +- articles/filter-panel.html | 26 +- articles/index.html | 76 +- articles/teal-slice.html | 26 +- authors.html | 72 +- .../coverage-report/index.html | 7234 ++++++++++------ latest-tag/404.html | 38 +- latest-tag/CODE_OF_CONDUCT.html | 123 +- latest-tag/CONTRIBUTING.html | 151 +- latest-tag/LICENSE-text.html | 78 +- latest-tag/SECURITY.html | 90 +- .../articles/filter-panel-for-developers.html | 38 +- latest-tag/articles/index.html | 91 +- latest-tag/articles/teal-slice-classes.html | 38 +- latest-tag/articles/teal-slice.html | 38 +- latest-tag/authors.html | 84 +- latest-tag/coverage-report/index.html | 6834 ++++++++++------ latest-tag/index.html | 38 +- latest-tag/news/index.html | 314 +- latest-tag/reference/ChoicesFilterState.html | 216 +- latest-tag/reference/DFFilterStates.html | 168 +- .../reference/DataframeFilteredDataset.html | 335 +- latest-tag/reference/DateFilterState.html | 216 +- latest-tag/reference/DatetimeFilterState.html | 216 +- .../reference/DefaultFilteredDataset.html | 419 +- latest-tag/reference/EmptyFilterState.html | 216 +- latest-tag/reference/FilterPanelAPI.html | 288 +- latest-tag/reference/FilterState.html | 431 +- latest-tag/reference/FilterStateExpr.html | 425 +- latest-tag/reference/FilterStates.html | 549 +- latest-tag/reference/FilteredData.html | 1008 ++- latest-tag/reference/FilteredDataset.html | 651 +- latest-tag/reference/LogicalFilterState.html | 216 +- latest-tag/reference/MAEFilterStates.html | 165 +- latest-tag/reference/MAEFilteredDataset.html | 303 +- latest-tag/reference/MatrixFilterStates.html | 165 +- latest-tag/reference/RangeFilterState.html | 239 +- latest-tag/reference/SEFilterStates.html | 270 +- latest-tag/reference/calls_combine_by.html | 101 +- latest-tag/reference/check_simple_name.html | 102 +- latest-tag/reference/choices_labeled.html | 102 +- latest-tag/reference/coalesce_r.html | 98 +- latest-tag/reference/countBar.html | 105 +- latest-tag/reference/countBars.html | 98 +- .../reference/data_choices_labeled.html | 95 +- latest-tag/reference/dot-table.html | 99 +- latest-tag/reference/eval_expr_with_msg.html | 99 +- latest-tag/reference/fetch_bs_color.html | 98 +- latest-tag/reference/filter_state_api.html | 117 +- latest-tag/reference/format_time.html | 98 +- .../reference/get_default_slice_id.html | 105 +- latest-tag/reference/get_filter_expr.html | 99 +- .../get_supported_filter_varnames.html | 102 +- latest-tag/reference/include_css_files.html | 99 +- latest-tag/reference/include_js_files.html | 99 +- latest-tag/reference/index.html | 151 +- latest-tag/reference/init_filter_state.html | 111 +- .../reference/init_filter_state_expr.html | 95 +- latest-tag/reference/init_filter_states.html | 98 +- latest-tag/reference/init_filtered_data.html | 101 +- .../reference/init_filtered_dataset.html | 104 +- latest-tag/reference/jsonify.html | 99 +- latest-tag/reference/justify_json.html | 99 +- latest-tag/reference/make_c_call.html | 102 +- latest-tag/reference/make_count_text.html | 106 +- latest-tag/reference/setdiff_teal_slices.html | 99 +- latest-tag/reference/teal.slice-package.html | 109 +- .../reference/teal_slice-utilities.html | 98 +- latest-tag/reference/teal_slice.html | 121 +- .../reference/teal_slices-utilities.html | 98 +- latest-tag/reference/teal_slices.html | 124 +- latest-tag/reference/to_json.html | 99 +- latest-tag/reference/toggle_button.html | 101 +- latest-tag/reference/topological_sort.html | 102 +- latest-tag/reference/trim_lines_json.html | 99 +- latest-tag/reference/variable_types.html | 98 +- .../coverage-report/index.html | 6862 ++++++++++------ main/404.html | 21 +- main/CODE_OF_CONDUCT.html | 114 +- main/CONTRIBUTING.html | 142 +- main/LICENSE-text.html | 69 +- main/SECURITY.html | 81 +- .../articles/filter-panel-for-developers.html | 21 +- main/articles/index.html | 82 +- main/articles/teal-slice-classes.html | 21 +- main/articles/teal-slice.html | 21 +- main/authors.html | 75 +- main/coverage-report/index.html | 7284 ++++++++++------ main/index.html | 21 +- main/news/index.html | 335 +- main/reference/ChoicesFilterState.html | 207 +- main/reference/DFFilterStates.html | 159 +- main/reference/DataframeFilteredDataset.html | 326 +- main/reference/DateFilterState.html | 207 +- main/reference/DatetimeFilterState.html | 207 +- main/reference/DefaultFilteredDataset.html | 410 +- main/reference/EmptyFilterState.html | 207 +- main/reference/FilterPanelAPI.html | 279 +- main/reference/FilterState.html | 422 +- main/reference/FilterStateExpr.html | 416 +- main/reference/FilterStates.html | 567 +- main/reference/FilteredData.html | 956 ++- main/reference/FilteredDataset.html | 646 +- main/reference/LogicalFilterState.html | 207 +- main/reference/MAEFilterStates.html | 156 +- main/reference/MAEFilteredDataset.html | 294 +- main/reference/MatrixFilterStates.html | 156 +- main/reference/RangeFilterState.html | 230 +- main/reference/SEFilterStates.html | 261 +- main/reference/calls_combine_by.html | 96 +- main/reference/choices_labeled.html | 103 +- main/reference/coalesce_r.html | 90 +- main/reference/countBar.html | 112 +- main/reference/countBars.html | 102 +- main/reference/data_choices_labeled.html | 96 +- .../dot-finalize_session_bindings.html | 94 +- main/reference/dot-table.html | 91 +- main/reference/eval_expr_with_msg.html | 94 +- main/reference/fetch_bs_color.html | 93 +- main/reference/filter_state_api.html | 115 +- main/reference/format_time.html | 90 +- main/reference/get_default_slice_id.html | 97 +- main/reference/get_filter_expr.html | 94 +- .../get_supported_filter_varnames.html | 94 +- main/reference/include_css_files.html | 91 +- main/reference/include_js_files.html | 91 +- main/reference/index.html | 142 +- main/reference/init_filter_state.html | 112 +- main/reference/init_filter_state_expr.html | 87 +- main/reference/init_filter_states.html | 102 +- main/reference/init_filtered_data.html | 102 +- main/reference/init_filtered_dataset.html | 114 +- main/reference/jsonify.html | 94 +- main/reference/justify_json.html | 91 +- main/reference/make_c_call.html | 94 +- main/reference/make_count_text.html | 104 +- main/reference/pair_counts.html | 87 +- main/reference/sanitize_id.html | 91 +- main/reference/setdiff_teal_slices.html | 91 +- main/reference/teal.slice-package.html | 100 +- main/reference/teal_slice-utilities.html | 99 +- main/reference/teal_slice.html | 149 +- main/reference/teal_slices-utilities.html | 105 +- main/reference/teal_slices.html | 125 +- main/reference/to_json.html | 91 +- main/reference/toggle_button.html | 99 +- main/reference/topological_sort.html | 94 +- main/reference/trim_lines_json.html | 91 +- main/reference/variable_types.html | 93 +- main/search.json | 2 +- news/index.html | 144 +- pull_request_template.html | 66 +- reference/CDISCFilteredData.html | 358 +- reference/ChoicesFilterState.html | 416 +- reference/DFFilterStates.html | 422 +- reference/DateFilterState.html | 367 +- reference/DatetimeFilterState.html | 364 +- reference/DefaultFilteredDataset.html | 391 +- reference/EmptyFilterState.html | 356 +- reference/FilterState.html | 771 +- reference/FilterStates.html | 647 +- reference/FilteredData.html | 1178 ++- reference/FilteredDataset.html | 706 +- reference/LogicalFilterState.html | 329 +- reference/MAEFilterStates.html | 406 +- reference/MAEFilteredDataset.html | 470 +- reference/MatrixFilterStates.html | 381 +- reference/Queue.html | 323 +- reference/RangeFilterState.html | 565 +- reference/ReactiveQueue.html | 175 +- reference/SEFilterStates.html | 381 +- reference/call_check_parse_varname.html | 80 +- reference/call_condition_choice.html | 96 +- reference/call_condition_logical.html | 89 +- reference/call_condition_range.html | 89 +- reference/call_condition_range_date.html | 89 +- reference/call_condition_range_posixct.html | 89 +- reference/call_extract_array.html | 86 +- reference/call_extract_list.html | 86 +- reference/call_extract_matrix.html | 86 +- reference/call_with_colon.html | 83 +- reference/calls_combine_by.html | 86 +- reference/check_ellipsis.html | 90 +- reference/check_in_range.html | 86 +- reference/check_in_subset.html | 83 +- reference/check_simple_name.html | 90 +- reference/choices_labeled.html | 90 +- reference/data_choices_labeled.html | 83 +- reference/filter_state_api.html | 145 +- reference/get_filter_expr.html | 87 +- reference/get_filterable_varnames.html | 90 +- reference/include_css_files.html | 87 +- reference/index.html | 159 +- reference/init_filter_state.html | 99 +- reference/init_filter_states.html | 83 +- reference/init_filtered_data.html | 96 +- reference/init_filtered_dataset.html | 86 +- reference/resolve_state.html | 115 +- reference/set_state.html | 105 +- reference/teal.slice-package.html | 83 +- reference/topological_sort.html | 90 +- reference/validate_dataset_args.html | 83 +- reference/variable_types.html | 86 +- release-candidate/404.html | 38 +- release-candidate/CODE_OF_CONDUCT.html | 123 +- release-candidate/CONTRIBUTING.html | 151 +- release-candidate/LICENSE-text.html | 78 +- release-candidate/SECURITY.html | 90 +- .../articles/filter-panel-for-developers.html | 38 +- release-candidate/articles/index.html | 91 +- .../articles/teal-slice-classes.html | 38 +- release-candidate/articles/teal-slice.html | 38 +- release-candidate/authors.html | 84 +- release-candidate/coverage-report/index.html | 6834 ++++++++++------ release-candidate/index.html | 38 +- release-candidate/news/index.html | 313 +- .../reference/ChoicesFilterState.html | 216 +- .../reference/DFFilterStates.html | 168 +- .../reference/DataframeFilteredDataset.html | 335 +- .../reference/DateFilterState.html | 216 +- .../reference/DatetimeFilterState.html | 216 +- .../reference/DefaultFilteredDataset.html | 419 +- .../reference/EmptyFilterState.html | 216 +- .../reference/FilterPanelAPI.html | 288 +- release-candidate/reference/FilterState.html | 431 +- .../reference/FilterStateExpr.html | 425 +- release-candidate/reference/FilterStates.html | 549 +- release-candidate/reference/FilteredData.html | 1008 ++- .../reference/FilteredDataset.html | 651 +- .../reference/LogicalFilterState.html | 216 +- .../reference/MAEFilterStates.html | 165 +- .../reference/MAEFilteredDataset.html | 303 +- .../reference/MatrixFilterStates.html | 165 +- .../reference/RangeFilterState.html | 239 +- .../reference/SEFilterStates.html | 270 +- .../reference/calls_combine_by.html | 101 +- .../reference/check_simple_name.html | 102 +- .../reference/choices_labeled.html | 102 +- release-candidate/reference/coalesce_r.html | 98 +- release-candidate/reference/countBar.html | 105 +- release-candidate/reference/countBars.html | 98 +- .../reference/data_choices_labeled.html | 95 +- release-candidate/reference/dot-table.html | 99 +- .../reference/eval_expr_with_msg.html | 99 +- .../reference/fetch_bs_color.html | 98 +- .../reference/filter_state_api.html | 117 +- release-candidate/reference/format_time.html | 98 +- .../reference/get_default_slice_id.html | 105 +- .../reference/get_filter_expr.html | 99 +- .../get_supported_filter_varnames.html | 102 +- .../reference/include_css_files.html | 99 +- .../reference/include_js_files.html | 99 +- release-candidate/reference/index.html | 151 +- .../reference/init_filter_state.html | 111 +- .../reference/init_filter_state_expr.html | 95 +- .../reference/init_filter_states.html | 98 +- .../reference/init_filtered_data.html | 101 +- .../reference/init_filtered_dataset.html | 104 +- release-candidate/reference/jsonify.html | 99 +- release-candidate/reference/justify_json.html | 99 +- release-candidate/reference/make_c_call.html | 102 +- .../reference/make_count_text.html | 106 +- .../reference/setdiff_teal_slices.html | 99 +- .../reference/teal.slice-package.html | 109 +- .../reference/teal_slice-utilities.html | 98 +- release-candidate/reference/teal_slice.html | 121 +- .../reference/teal_slices-utilities.html | 98 +- release-candidate/reference/teal_slices.html | 124 +- release-candidate/reference/to_json.html | 99 +- .../reference/toggle_button.html | 101 +- .../reference/topological_sort.html | 102 +- .../reference/trim_lines_json.html | 99 +- .../reference/variable_types.html | 98 +- .../coverage-report/index.html | 6859 ++++++++++------ v0.2.0/404.html | 26 +- v0.2.0/CODE_OF_CONDUCT.html | 111 +- v0.2.0/CONTRIBUTING.html | 130 +- v0.2.0/LICENSE-text.html | 66 +- v0.2.0/SECURITY.html | 78 +- v0.2.0/articles/filter-panel.html | 26 +- v0.2.0/articles/index.html | 76 +- v0.2.0/articles/teal-slice.html | 26 +- v0.2.0/authors.html | 72 +- v0.2.0/index.html | 26 +- v0.2.0/news/index.html | 174 +- v0.2.0/pull_request_template.html | 66 +- v0.2.0/reference/CDISCFilteredData.html | 358 +- v0.2.0/reference/ChoicesFilterState.html | 416 +- v0.2.0/reference/DFFilterStates.html | 422 +- v0.2.0/reference/DateFilterState.html | 367 +- v0.2.0/reference/DatetimeFilterState.html | 364 +- v0.2.0/reference/DefaultFilteredDataset.html | 391 +- v0.2.0/reference/EmptyFilterState.html | 356 +- v0.2.0/reference/FilterPanelAPI.html | 280 +- v0.2.0/reference/FilterState.html | 771 +- v0.2.0/reference/FilterStates.html | 647 +- v0.2.0/reference/FilteredData.html | 1201 ++- v0.2.0/reference/FilteredDataset.html | 707 +- v0.2.0/reference/LogicalFilterState.html | 329 +- v0.2.0/reference/MAEFilterStates.html | 406 +- v0.2.0/reference/MAEFilteredDataset.html | 470 +- v0.2.0/reference/MatrixFilterStates.html | 381 +- v0.2.0/reference/Queue.html | 323 +- v0.2.0/reference/RangeFilterState.html | 565 +- v0.2.0/reference/ReactiveQueue.html | 175 +- v0.2.0/reference/SEFilterStates.html | 381 +- .../reference/call_check_parse_varname.html | 80 +- v0.2.0/reference/call_condition_choice.html | 96 +- v0.2.0/reference/call_condition_logical.html | 89 +- v0.2.0/reference/call_condition_range.html | 89 +- .../reference/call_condition_range_date.html | 89 +- .../call_condition_range_posixct.html | 89 +- v0.2.0/reference/call_extract_array.html | 86 +- v0.2.0/reference/call_extract_list.html | 86 +- v0.2.0/reference/call_extract_matrix.html | 86 +- v0.2.0/reference/call_with_colon.html | 83 +- v0.2.0/reference/calls_combine_by.html | 86 +- v0.2.0/reference/check_ellipsis.html | 90 +- v0.2.0/reference/check_in_range.html | 86 +- v0.2.0/reference/check_in_subset.html | 83 +- v0.2.0/reference/check_simple_name.html | 87 +- v0.2.0/reference/choices_labeled.html | 90 +- v0.2.0/reference/data_choices_labeled.html | 83 +- v0.2.0/reference/filter_state_api.html | 145 +- v0.2.0/reference/get_filter_expr.html | 87 +- .../get_supported_filter_varnames.html | 90 +- v0.2.0/reference/get_teal_bs_theme.html | 71 +- v0.2.0/reference/include_css_files.html | 87 +- v0.2.0/reference/index.html | 163 +- v0.2.0/reference/init_filter_state.html | 99 +- v0.2.0/reference/init_filter_states.html | 83 +- v0.2.0/reference/init_filtered_data.html | 96 +- v0.2.0/reference/init_filtered_dataset.html | 86 +- v0.2.0/reference/resolve_state.html | 115 +- v0.2.0/reference/set_state.html | 105 +- v0.2.0/reference/teal.slice-package.html | 83 +- v0.2.0/reference/topological_sort.html | 90 +- v0.2.0/reference/validate_dataset_args.html | 83 +- v0.2.0/reference/variable_types.html | 86 +- v0.3.0/404.html | 38 +- v0.3.0/CODE_OF_CONDUCT.html | 123 +- v0.3.0/CONTRIBUTING.html | 151 +- v0.3.0/LICENSE-text.html | 78 +- v0.3.0/SECURITY.html | 90 +- v0.3.0/articles/filter-panel.html | 38 +- v0.3.0/articles/index.html | 88 +- v0.3.0/articles/teal-slice.html | 38 +- v0.3.0/authors.html | 84 +- v0.3.0/coverage-report/index.html | 5944 +++++++++----- v0.3.0/index.html | 38 +- v0.3.0/news/index.html | 231 +- v0.3.0/pull_request_template.html | 78 +- v0.3.0/reference/CDISCFilteredData.html | 370 +- v0.3.0/reference/ChoicesFilterState.html | 315 +- v0.3.0/reference/DFFilterStates.html | 437 +- v0.3.0/reference/DateFilterState.html | 308 +- v0.3.0/reference/DatetimeFilterState.html | 305 +- v0.3.0/reference/DefaultFilteredDataset.html | 403 +- v0.3.0/reference/EmptyFilterState.html | 303 +- v0.3.0/reference/FilterPanelAPI.html | 315 +- v0.3.0/reference/FilterState.html | 661 +- v0.3.0/reference/FilterStates.html | 653 +- v0.3.0/reference/FilteredData.html | 1293 ++- v0.3.0/reference/FilteredDataset.html | 719 +- v0.3.0/reference/LogicalFilterState.html | 270 +- v0.3.0/reference/MAEFilterStates.html | 419 +- v0.3.0/reference/MAEFilteredDataset.html | 482 +- v0.3.0/reference/MatrixFilterStates.html | 396 +- v0.3.0/reference/RangeFilterState.html | 435 +- v0.3.0/reference/SEFilterStates.html | 396 +- v0.3.0/reference/calls_combine_by.html | 98 +- v0.3.0/reference/check_ellipsis.html | 102 +- v0.3.0/reference/check_in_range.html | 98 +- v0.3.0/reference/check_in_subset.html | 95 +- v0.3.0/reference/check_simple_name.html | 99 +- v0.3.0/reference/choices_labeled.html | 102 +- v0.3.0/reference/contain_interval.html | 105 +- v0.3.0/reference/data_choices_labeled.html | 95 +- v0.3.0/reference/eval_expr_with_msg.html | 99 +- v0.3.0/reference/filter_state_api.html | 157 +- v0.3.0/reference/get_filter_expr.html | 99 +- .../get_supported_filter_varnames.html | 102 +- v0.3.0/reference/get_teal_bs_theme.html | 83 +- v0.3.0/reference/include_css_files.html | 99 +- v0.3.0/reference/index.html | 175 +- v0.3.0/reference/init_filter_state.html | 111 +- v0.3.0/reference/init_filter_states.html | 95 +- v0.3.0/reference/init_filtered_data.html | 108 +- v0.3.0/reference/init_filtered_dataset.html | 101 +- v0.3.0/reference/resolve_state.html | 127 +- v0.3.0/reference/teal.slice-package.html | 95 +- v0.3.0/reference/toggle_button.html | 101 +- v0.3.0/reference/topological_sort.html | 102 +- v0.3.0/reference/validate_dataset_args.html | 95 +- v0.3.0/reference/variable_types.html | 98 +- v0.4.0/404.html | 38 +- v0.4.0/CODE_OF_CONDUCT.html | 123 +- v0.4.0/CONTRIBUTING.html | 151 +- v0.4.0/LICENSE-text.html | 78 +- v0.4.0/SECURITY.html | 90 +- .../articles/filter-panel-for-developers.html | 38 +- v0.4.0/articles/index.html | 91 +- v0.4.0/articles/teal-slice-classes.html | 38 +- v0.4.0/articles/teal-slice.html | 38 +- v0.4.0/authors.html | 84 +- v0.4.0/coverage-report/index.html | 7288 +++++++++++------ v0.4.0/index.html | 38 +- v0.4.0/news/index.html | 252 +- v0.4.0/pull_request_template.html | 78 +- v0.4.0/reference/ChoicesFilterState.html | 213 +- v0.4.0/reference/DFFilterStates.html | 168 +- v0.4.0/reference/DateFilterState.html | 213 +- v0.4.0/reference/DatetimeFilterState.html | 213 +- v0.4.0/reference/DefaultFilteredDataset.html | 343 +- v0.4.0/reference/EmptyFilterState.html | 213 +- v0.4.0/reference/FilterPanelAPI.html | 292 +- v0.4.0/reference/FilterState.html | 431 +- v0.4.0/reference/FilterStateExpr.html | 422 +- v0.4.0/reference/FilterStates.html | 549 +- v0.4.0/reference/FilteredData.html | 1402 +++- v0.4.0/reference/FilteredDataset.html | 683 +- v0.4.0/reference/LogicalFilterState.html | 213 +- v0.4.0/reference/MAEFilterStates.html | 166 +- v0.4.0/reference/MAEFilteredDataset.html | 311 +- v0.4.0/reference/MatrixFilterStates.html | 165 +- v0.4.0/reference/RangeFilterState.html | 236 +- v0.4.0/reference/SEFilterStates.html | 271 +- v0.4.0/reference/calls_combine_by.html | 98 +- v0.4.0/reference/check_ellipsis.html | 102 +- v0.4.0/reference/check_simple_name.html | 99 +- v0.4.0/reference/choices_labeled.html | 102 +- v0.4.0/reference/countBar.html | 95 +- v0.4.0/reference/countBars.html | 102 +- v0.4.0/reference/data_choices_labeled.html | 95 +- v0.4.0/reference/eval_expr_with_msg.html | 99 +- v0.4.0/reference/fetch_bs_color.html | 98 +- v0.4.0/reference/filter_state_api.html | 111 +- v0.4.0/reference/get_default_slice_id.html | 109 +- v0.4.0/reference/get_filter_expr.html | 99 +- .../get_supported_filter_varnames.html | 102 +- v0.4.0/reference/get_teal_bs_theme.html | 83 +- v0.4.0/reference/include_css_files.html | 99 +- v0.4.0/reference/include_js_files.html | 99 +- v0.4.0/reference/index.html | 167 +- v0.4.0/reference/init_filter_state.html | 111 +- v0.4.0/reference/init_filter_state_expr.html | 95 +- v0.4.0/reference/init_filter_states.html | 95 +- v0.4.0/reference/init_filtered_data.html | 108 +- v0.4.0/reference/init_filtered_dataset.html | 101 +- v0.4.0/reference/jsonify.html | 99 +- v0.4.0/reference/justify_json.html | 99 +- v0.4.0/reference/make_c_call.html | 106 +- v0.4.0/reference/make_count_text.html | 106 +- v0.4.0/reference/setdiff_teal_slices.html | 99 +- v0.4.0/reference/slices_restore.html | 102 +- v0.4.0/reference/slices_store.html | 102 +- v0.4.0/reference/teal.slice-package.html | 95 +- v0.4.0/reference/teal_slice.html | 114 +- v0.4.0/reference/teal_slices.html | 114 +- v0.4.0/reference/to_json.html | 99 +- v0.4.0/reference/toggle_button.html | 101 +- v0.4.0/reference/topological_sort.html | 102 +- v0.4.0/reference/trim_lines_json.html | 99 +- v0.4.0/reference/validate_dataset_args.html | 95 +- v0.4.0/reference/variable_types.html | 98 +- v0.5.0-rc1/404.html | 38 +- v0.5.0-rc1/CODE_OF_CONDUCT.html | 123 +- v0.5.0-rc1/CONTRIBUTING.html | 151 +- v0.5.0-rc1/LICENSE-text.html | 78 +- v0.5.0-rc1/SECURITY.html | 90 +- .../articles/filter-panel-for-developers.html | 38 +- v0.5.0-rc1/articles/index.html | 91 +- v0.5.0-rc1/articles/teal-slice-classes.html | 38 +- v0.5.0-rc1/articles/teal-slice.html | 38 +- v0.5.0-rc1/authors.html | 84 +- v0.5.0-rc1/coverage-report/index.html | 6838 ++++++++++------ v0.5.0-rc1/index.html | 38 +- v0.5.0-rc1/news/index.html | 282 +- v0.5.0-rc1/pull_request_template.html | 78 +- v0.5.0-rc1/reference/ChoicesFilterState.html | 216 +- v0.5.0-rc1/reference/DFFilterStates.html | 168 +- .../reference/DataframeFilteredDataset.html | 335 +- v0.5.0-rc1/reference/DateFilterState.html | 216 +- v0.5.0-rc1/reference/DatetimeFilterState.html | 216 +- .../reference/DefaultFilteredDataset.html | 419 +- v0.5.0-rc1/reference/EmptyFilterState.html | 216 +- v0.5.0-rc1/reference/FilterPanelAPI.html | 288 +- v0.5.0-rc1/reference/FilterState.html | 431 +- v0.5.0-rc1/reference/FilterStateExpr.html | 425 +- v0.5.0-rc1/reference/FilterStates.html | 549 +- v0.5.0-rc1/reference/FilteredData.html | 1008 ++- v0.5.0-rc1/reference/FilteredDataset.html | 651 +- v0.5.0-rc1/reference/LogicalFilterState.html | 216 +- v0.5.0-rc1/reference/MAEFilterStates.html | 165 +- v0.5.0-rc1/reference/MAEFilteredDataset.html | 303 +- v0.5.0-rc1/reference/MatrixFilterStates.html | 165 +- v0.5.0-rc1/reference/RangeFilterState.html | 239 +- v0.5.0-rc1/reference/SEFilterStates.html | 270 +- v0.5.0-rc1/reference/calls_combine_by.html | 101 +- v0.5.0-rc1/reference/check_simple_name.html | 102 +- v0.5.0-rc1/reference/choices_labeled.html | 102 +- v0.5.0-rc1/reference/coalesce_r.html | 98 +- v0.5.0-rc1/reference/countBar.html | 105 +- v0.5.0-rc1/reference/countBars.html | 98 +- .../reference/data_choices_labeled.html | 95 +- v0.5.0-rc1/reference/eval_expr_with_msg.html | 99 +- v0.5.0-rc1/reference/fetch_bs_color.html | 98 +- v0.5.0-rc1/reference/filter_state_api.html | 117 +- v0.5.0-rc1/reference/format_time.html | 98 +- .../reference/get_default_slice_id.html | 105 +- v0.5.0-rc1/reference/get_filter_expr.html | 99 +- .../get_supported_filter_varnames.html | 102 +- v0.5.0-rc1/reference/include_css_files.html | 99 +- v0.5.0-rc1/reference/include_js_files.html | 99 +- v0.5.0-rc1/reference/index.html | 160 +- v0.5.0-rc1/reference/init_filter_state.html | 111 +- .../reference/init_filter_state_expr.html | 95 +- v0.5.0-rc1/reference/init_filter_states.html | 98 +- v0.5.0-rc1/reference/init_filtered_data.html | 101 +- .../reference/init_filtered_dataset.html | 104 +- v0.5.0-rc1/reference/jsonify.html | 99 +- v0.5.0-rc1/reference/justify_json.html | 99 +- v0.5.0-rc1/reference/make_c_call.html | 102 +- v0.5.0-rc1/reference/make_count_text.html | 106 +- v0.5.0-rc1/reference/setdiff_teal_slices.html | 99 +- v0.5.0-rc1/reference/teal.slice-package.html | 109 +- v0.5.0-rc1/reference/teal_slice.html | 117 +- v0.5.0-rc1/reference/teal_slices.html | 120 +- v0.5.0-rc1/reference/to_json.html | 99 +- v0.5.0-rc1/reference/toggle_button.html | 101 +- v0.5.0-rc1/reference/topological_sort.html | 102 +- v0.5.0-rc1/reference/trim_lines_json.html | 99 +- v0.5.0-rc1/reference/variable_types.html | 98 +- v0.5.0-rc2/404.html | 38 +- v0.5.0-rc2/CODE_OF_CONDUCT.html | 123 +- v0.5.0-rc2/CONTRIBUTING.html | 151 +- v0.5.0-rc2/LICENSE-text.html | 78 +- v0.5.0-rc2/SECURITY.html | 90 +- .../articles/filter-panel-for-developers.html | 38 +- v0.5.0-rc2/articles/index.html | 91 +- v0.5.0-rc2/articles/teal-slice-classes.html | 38 +- v0.5.0-rc2/articles/teal-slice.html | 38 +- v0.5.0-rc2/authors.html | 84 +- v0.5.0-rc2/coverage-report/index.html | 6838 ++++++++++------ v0.5.0-rc2/index.html | 38 +- v0.5.0-rc2/news/index.html | 282 +- v0.5.0-rc2/pull_request_template.html | 78 +- v0.5.0-rc2/reference/ChoicesFilterState.html | 213 +- v0.5.0-rc2/reference/DFFilterStates.html | 165 +- .../reference/DataframeFilteredDataset.html | 332 +- v0.5.0-rc2/reference/DateFilterState.html | 213 +- v0.5.0-rc2/reference/DatetimeFilterState.html | 213 +- .../reference/DefaultFilteredDataset.html | 416 +- v0.5.0-rc2/reference/EmptyFilterState.html | 213 +- v0.5.0-rc2/reference/FilterPanelAPI.html | 288 +- v0.5.0-rc2/reference/FilterState.html | 431 +- v0.5.0-rc2/reference/FilterStateExpr.html | 422 +- v0.5.0-rc2/reference/FilterStates.html | 549 +- v0.5.0-rc2/reference/FilteredData.html | 1005 ++- v0.5.0-rc2/reference/FilteredDataset.html | 651 +- v0.5.0-rc2/reference/LogicalFilterState.html | 213 +- v0.5.0-rc2/reference/MAEFilterStates.html | 165 +- v0.5.0-rc2/reference/MAEFilteredDataset.html | 300 +- v0.5.0-rc2/reference/MatrixFilterStates.html | 165 +- v0.5.0-rc2/reference/RangeFilterState.html | 236 +- v0.5.0-rc2/reference/SEFilterStates.html | 270 +- v0.5.0-rc2/reference/calls_combine_by.html | 98 +- v0.5.0-rc2/reference/check_simple_name.html | 102 +- v0.5.0-rc2/reference/choices_labeled.html | 102 +- v0.5.0-rc2/reference/coalesce_r.html | 98 +- v0.5.0-rc2/reference/countBar.html | 105 +- v0.5.0-rc2/reference/countBars.html | 95 +- .../reference/data_choices_labeled.html | 95 +- v0.5.0-rc2/reference/eval_expr_with_msg.html | 99 +- v0.5.0-rc2/reference/fetch_bs_color.html | 95 +- v0.5.0-rc2/reference/filter_state_api.html | 117 +- v0.5.0-rc2/reference/format_time.html | 98 +- .../reference/get_default_slice_id.html | 105 +- v0.5.0-rc2/reference/get_filter_expr.html | 99 +- .../get_supported_filter_varnames.html | 99 +- v0.5.0-rc2/reference/include_css_files.html | 99 +- v0.5.0-rc2/reference/include_js_files.html | 99 +- v0.5.0-rc2/reference/index.html | 160 +- v0.5.0-rc2/reference/init_filter_state.html | 108 +- .../reference/init_filter_state_expr.html | 95 +- v0.5.0-rc2/reference/init_filter_states.html | 95 +- v0.5.0-rc2/reference/init_filtered_data.html | 101 +- .../reference/init_filtered_dataset.html | 104 +- v0.5.0-rc2/reference/jsonify.html | 99 +- v0.5.0-rc2/reference/justify_json.html | 99 +- v0.5.0-rc2/reference/make_c_call.html | 99 +- v0.5.0-rc2/reference/make_count_text.html | 106 +- v0.5.0-rc2/reference/setdiff_teal_slices.html | 99 +- v0.5.0-rc2/reference/teal.slice-package.html | 109 +- v0.5.0-rc2/reference/teal_slice.html | 117 +- v0.5.0-rc2/reference/teal_slices.html | 120 +- v0.5.0-rc2/reference/to_json.html | 99 +- v0.5.0-rc2/reference/toggle_button.html | 98 +- v0.5.0-rc2/reference/topological_sort.html | 99 +- v0.5.0-rc2/reference/trim_lines_json.html | 99 +- v0.5.0-rc2/reference/variable_types.html | 95 +- v0.5.0/404.html | 38 +- v0.5.0/CODE_OF_CONDUCT.html | 123 +- v0.5.0/CONTRIBUTING.html | 151 +- v0.5.0/LICENSE-text.html | 78 +- v0.5.0/SECURITY.html | 90 +- .../articles/filter-panel-for-developers.html | 38 +- v0.5.0/articles/index.html | 91 +- v0.5.0/articles/teal-slice-classes.html | 38 +- v0.5.0/articles/teal-slice.html | 38 +- v0.5.0/authors.html | 84 +- v0.5.0/index.html | 38 +- v0.5.0/news/index.html | 283 +- v0.5.0/pull_request_template.html | 78 +- v0.5.0/reference/ChoicesFilterState.html | 213 +- v0.5.0/reference/DFFilterStates.html | 165 +- .../reference/DataframeFilteredDataset.html | 332 +- v0.5.0/reference/DateFilterState.html | 213 +- v0.5.0/reference/DatetimeFilterState.html | 213 +- v0.5.0/reference/DefaultFilteredDataset.html | 416 +- v0.5.0/reference/EmptyFilterState.html | 213 +- v0.5.0/reference/FilterPanelAPI.html | 288 +- v0.5.0/reference/FilterState.html | 431 +- v0.5.0/reference/FilterStateExpr.html | 422 +- v0.5.0/reference/FilterStates.html | 549 +- v0.5.0/reference/FilteredData.html | 1005 ++- v0.5.0/reference/FilteredDataset.html | 651 +- v0.5.0/reference/LogicalFilterState.html | 213 +- v0.5.0/reference/MAEFilterStates.html | 165 +- v0.5.0/reference/MAEFilteredDataset.html | 300 +- v0.5.0/reference/MatrixFilterStates.html | 165 +- v0.5.0/reference/RangeFilterState.html | 236 +- v0.5.0/reference/SEFilterStates.html | 270 +- v0.5.0/reference/calls_combine_by.html | 98 +- v0.5.0/reference/check_simple_name.html | 102 +- v0.5.0/reference/choices_labeled.html | 102 +- v0.5.0/reference/coalesce_r.html | 98 +- v0.5.0/reference/countBar.html | 105 +- v0.5.0/reference/countBars.html | 95 +- v0.5.0/reference/data_choices_labeled.html | 95 +- v0.5.0/reference/eval_expr_with_msg.html | 99 +- v0.5.0/reference/fetch_bs_color.html | 95 +- v0.5.0/reference/filter_state_api.html | 117 +- v0.5.0/reference/format_time.html | 98 +- v0.5.0/reference/get_default_slice_id.html | 105 +- v0.5.0/reference/get_filter_expr.html | 99 +- .../get_supported_filter_varnames.html | 99 +- v0.5.0/reference/include_css_files.html | 99 +- v0.5.0/reference/include_js_files.html | 99 +- v0.5.0/reference/index.html | 160 +- v0.5.0/reference/init_filter_state.html | 108 +- v0.5.0/reference/init_filter_state_expr.html | 95 +- v0.5.0/reference/init_filter_states.html | 95 +- v0.5.0/reference/init_filtered_data.html | 101 +- v0.5.0/reference/init_filtered_dataset.html | 104 +- v0.5.0/reference/jsonify.html | 99 +- v0.5.0/reference/justify_json.html | 99 +- v0.5.0/reference/make_c_call.html | 99 +- v0.5.0/reference/make_count_text.html | 106 +- v0.5.0/reference/setdiff_teal_slices.html | 99 +- v0.5.0/reference/teal.slice-package.html | 109 +- v0.5.0/reference/teal_slice.html | 117 +- v0.5.0/reference/teal_slices.html | 120 +- v0.5.0/reference/to_json.html | 99 +- v0.5.0/reference/toggle_button.html | 98 +- v0.5.0/reference/topological_sort.html | 99 +- v0.5.0/reference/trim_lines_json.html | 99 +- v0.5.0/reference/variable_types.html | 95 +- v0.5.1-rc1/404.html | 38 +- v0.5.1-rc1/CODE_OF_CONDUCT.html | 123 +- v0.5.1-rc1/CONTRIBUTING.html | 151 +- v0.5.1-rc1/LICENSE-text.html | 78 +- v0.5.1-rc1/SECURITY.html | 90 +- .../articles/filter-panel-for-developers.html | 38 +- v0.5.1-rc1/articles/index.html | 91 +- v0.5.1-rc1/articles/teal-slice-classes.html | 38 +- v0.5.1-rc1/articles/teal-slice.html | 38 +- v0.5.1-rc1/authors.html | 84 +- v0.5.1-rc1/coverage-report/index.html | 6834 ++++++++++------ v0.5.1-rc1/index.html | 38 +- v0.5.1-rc1/news/index.html | 313 +- v0.5.1-rc1/reference/ChoicesFilterState.html | 216 +- v0.5.1-rc1/reference/DFFilterStates.html | 168 +- .../reference/DataframeFilteredDataset.html | 335 +- v0.5.1-rc1/reference/DateFilterState.html | 216 +- v0.5.1-rc1/reference/DatetimeFilterState.html | 216 +- .../reference/DefaultFilteredDataset.html | 419 +- v0.5.1-rc1/reference/EmptyFilterState.html | 216 +- v0.5.1-rc1/reference/FilterPanelAPI.html | 288 +- v0.5.1-rc1/reference/FilterState.html | 431 +- v0.5.1-rc1/reference/FilterStateExpr.html | 425 +- v0.5.1-rc1/reference/FilterStates.html | 549 +- v0.5.1-rc1/reference/FilteredData.html | 1008 ++- v0.5.1-rc1/reference/FilteredDataset.html | 651 +- v0.5.1-rc1/reference/LogicalFilterState.html | 216 +- v0.5.1-rc1/reference/MAEFilterStates.html | 165 +- v0.5.1-rc1/reference/MAEFilteredDataset.html | 303 +- v0.5.1-rc1/reference/MatrixFilterStates.html | 165 +- v0.5.1-rc1/reference/RangeFilterState.html | 239 +- v0.5.1-rc1/reference/SEFilterStates.html | 270 +- v0.5.1-rc1/reference/calls_combine_by.html | 101 +- v0.5.1-rc1/reference/check_simple_name.html | 102 +- v0.5.1-rc1/reference/choices_labeled.html | 102 +- v0.5.1-rc1/reference/coalesce_r.html | 98 +- v0.5.1-rc1/reference/countBar.html | 105 +- v0.5.1-rc1/reference/countBars.html | 98 +- .../reference/data_choices_labeled.html | 95 +- v0.5.1-rc1/reference/dot-table.html | 99 +- v0.5.1-rc1/reference/eval_expr_with_msg.html | 99 +- v0.5.1-rc1/reference/fetch_bs_color.html | 98 +- v0.5.1-rc1/reference/filter_state_api.html | 117 +- v0.5.1-rc1/reference/format_time.html | 98 +- .../reference/get_default_slice_id.html | 105 +- v0.5.1-rc1/reference/get_filter_expr.html | 99 +- .../get_supported_filter_varnames.html | 102 +- v0.5.1-rc1/reference/include_css_files.html | 99 +- v0.5.1-rc1/reference/include_js_files.html | 99 +- v0.5.1-rc1/reference/index.html | 151 +- v0.5.1-rc1/reference/init_filter_state.html | 111 +- .../reference/init_filter_state_expr.html | 95 +- v0.5.1-rc1/reference/init_filter_states.html | 98 +- v0.5.1-rc1/reference/init_filtered_data.html | 101 +- .../reference/init_filtered_dataset.html | 104 +- v0.5.1-rc1/reference/jsonify.html | 99 +- v0.5.1-rc1/reference/justify_json.html | 99 +- v0.5.1-rc1/reference/make_c_call.html | 102 +- v0.5.1-rc1/reference/make_count_text.html | 106 +- v0.5.1-rc1/reference/setdiff_teal_slices.html | 99 +- v0.5.1-rc1/reference/teal.slice-package.html | 109 +- .../reference/teal_slice-utilities.html | 98 +- v0.5.1-rc1/reference/teal_slice.html | 121 +- .../reference/teal_slices-utilities.html | 98 +- v0.5.1-rc1/reference/teal_slices.html | 124 +- v0.5.1-rc1/reference/to_json.html | 99 +- v0.5.1-rc1/reference/toggle_button.html | 101 +- v0.5.1-rc1/reference/topological_sort.html | 102 +- v0.5.1-rc1/reference/trim_lines_json.html | 99 +- v0.5.1-rc1/reference/variable_types.html | 98 +- v0.5.1/404.html | 38 +- v0.5.1/CODE_OF_CONDUCT.html | 123 +- v0.5.1/CONTRIBUTING.html | 151 +- v0.5.1/LICENSE-text.html | 78 +- v0.5.1/SECURITY.html | 90 +- .../articles/filter-panel-for-developers.html | 38 +- v0.5.1/articles/index.html | 91 +- v0.5.1/articles/teal-slice-classes.html | 38 +- v0.5.1/articles/teal-slice.html | 38 +- v0.5.1/authors.html | 84 +- v0.5.1/coverage-report/index.html | 6834 ++++++++++------ v0.5.1/index.html | 38 +- v0.5.1/news/index.html | 314 +- v0.5.1/reference/ChoicesFilterState.html | 216 +- v0.5.1/reference/DFFilterStates.html | 168 +- .../reference/DataframeFilteredDataset.html | 335 +- v0.5.1/reference/DateFilterState.html | 216 +- v0.5.1/reference/DatetimeFilterState.html | 216 +- v0.5.1/reference/DefaultFilteredDataset.html | 419 +- v0.5.1/reference/EmptyFilterState.html | 216 +- v0.5.1/reference/FilterPanelAPI.html | 288 +- v0.5.1/reference/FilterState.html | 431 +- v0.5.1/reference/FilterStateExpr.html | 425 +- v0.5.1/reference/FilterStates.html | 549 +- v0.5.1/reference/FilteredData.html | 1008 ++- v0.5.1/reference/FilteredDataset.html | 651 +- v0.5.1/reference/LogicalFilterState.html | 216 +- v0.5.1/reference/MAEFilterStates.html | 165 +- v0.5.1/reference/MAEFilteredDataset.html | 303 +- v0.5.1/reference/MatrixFilterStates.html | 165 +- v0.5.1/reference/RangeFilterState.html | 239 +- v0.5.1/reference/SEFilterStates.html | 270 +- v0.5.1/reference/calls_combine_by.html | 101 +- v0.5.1/reference/check_simple_name.html | 102 +- v0.5.1/reference/choices_labeled.html | 102 +- v0.5.1/reference/coalesce_r.html | 98 +- v0.5.1/reference/countBar.html | 105 +- v0.5.1/reference/countBars.html | 98 +- v0.5.1/reference/data_choices_labeled.html | 95 +- v0.5.1/reference/dot-table.html | 99 +- v0.5.1/reference/eval_expr_with_msg.html | 99 +- v0.5.1/reference/fetch_bs_color.html | 98 +- v0.5.1/reference/filter_state_api.html | 117 +- v0.5.1/reference/format_time.html | 98 +- v0.5.1/reference/get_default_slice_id.html | 105 +- v0.5.1/reference/get_filter_expr.html | 99 +- .../get_supported_filter_varnames.html | 102 +- v0.5.1/reference/include_css_files.html | 99 +- v0.5.1/reference/include_js_files.html | 99 +- v0.5.1/reference/index.html | 151 +- v0.5.1/reference/init_filter_state.html | 111 +- v0.5.1/reference/init_filter_state_expr.html | 95 +- v0.5.1/reference/init_filter_states.html | 98 +- v0.5.1/reference/init_filtered_data.html | 101 +- v0.5.1/reference/init_filtered_dataset.html | 104 +- v0.5.1/reference/jsonify.html | 99 +- v0.5.1/reference/justify_json.html | 99 +- v0.5.1/reference/make_c_call.html | 102 +- v0.5.1/reference/make_count_text.html | 106 +- v0.5.1/reference/setdiff_teal_slices.html | 99 +- v0.5.1/reference/teal.slice-package.html | 109 +- v0.5.1/reference/teal_slice-utilities.html | 98 +- v0.5.1/reference/teal_slice.html | 121 +- v0.5.1/reference/teal_slices-utilities.html | 98 +- v0.5.1/reference/teal_slices.html | 124 +- v0.5.1/reference/to_json.html | 99 +- v0.5.1/reference/toggle_button.html | 101 +- v0.5.1/reference/topological_sort.html | 102 +- v0.5.1/reference/trim_lines_json.html | 99 +- v0.5.1/reference/variable_types.html | 98 +- 813 files changed, 157914 insertions(+), 72487 deletions(-) diff --git a/404.html b/404.html index bd97e7efc..da30b1f22 100644 --- a/404.html +++ b/404.html @@ -1,5 +1,4 @@ - - + @@ -49,23 +48,24 @@ - - - +v0.2.0 + + + diff --git a/546-fix-verdepcheck@main/coverage-report/index.html b/546-fix-verdepcheck@main/coverage-report/index.html index fe16ebeb7..df37ba5f9 100644 --- a/546-fix-verdepcheck@main/coverage-report/index.html +++ b/546-fix-verdepcheck@main/coverage-report/index.html @@ -1,23 +1,22 @@ - - + - + - + - - + + - + - + - - - + + + @@ -852,7 +851,8 @@

teal.slice coverage - 65.86%

106 - 67x + 67x +
      checkmate::assert_list(data_objects, any.missing = FALSE, min.len = 0, names = "unique")
@@ -866,14 +866,16 @@

teal.slice coverage - 65.86%

108 - 67x + 67x +
      data_objects <- lapply(data_objects, function(dataset) {
109 - 101x + 101x +
        if (is.list(dataset) && "dataset" %in% names(dataset)) {
@@ -894,7 +896,8 @@

teal.slice coverage - 65.86%

112 - 101x + 101x +
          dataset
@@ -929,49 +932,56 @@

teal.slice coverage - 65.86%

117 - 67x + 67x +
      checkmate::assert_class(join_keys, "join_keys")
118 - 66x + 66x +
      self$set_join_keys(join_keys)
119 - 66x + 66x +
      child_parent <- sapply(
120 - 66x + 66x +
        names(data_objects),
121 - 66x + 66x +
        function(i) teal.data::parent(join_keys, i),
122 - 66x + 66x +
        USE.NAMES = TRUE,
123 - 66x + 66x +
        simplify = FALSE
@@ -985,14 +995,16 @@

teal.slice coverage - 65.86%

125 - 66x + 66x +
      ordered_datanames <- topological_sort(child_parent)
126 - 66x + 66x +
      ordered_datanames <- intersect(ordered_datanames, names(data_objects))
@@ -1006,21 +1018,24 @@

teal.slice coverage - 65.86%

128 - 66x + 66x +
      for (dataname in ordered_datanames) {
129 - 100x + 100x +
        ds_object <- data_objects[[dataname]]
130 - 100x + 100x +
        self$set_dataset(data = ds_object, dataname = dataname)
@@ -1041,7 +1056,8 @@

teal.slice coverage - 65.86%

133 - 66x + 66x +
      self$set_available_teal_slices(x = reactive(NULL))
@@ -1055,7 +1071,8 @@

teal.slice coverage - 65.86%

135 - 66x + 66x +
      invisible(self)
@@ -1118,7 +1135,8 @@

teal.slice coverage - 65.86%

144 - 118x + 118x +
      names(private$filtered_datasets)
@@ -1188,7 +1206,8 @@

teal.slice coverage - 65.86%

154 - 1x + 1x +
      private$get_filtered_dataset(dataname)$get_dataset_label()
@@ -1293,14 +1312,16 @@

teal.slice coverage - 65.86%

169 - 67x + 67x +
      checkmate::assert_class(x, "reactive")
170 - 67x + 67x +
      private$available_teal_slices <- reactive({
@@ -1314,49 +1335,56 @@

teal.slice coverage - 65.86%

172 - 4x + 4x +
        current_state <- isolate(self$get_filter_state())
173 - 4x + 4x +
        allowed <- attr(current_state, "include_varnames")
174 - 4x + 4x +
        forbidden <- attr(current_state, "exclude_varnames")
175 - 4x + 4x +
        foo <- function(slice) {
176 - 13x + 13x +
          if (slice$dataname %in% self$datanames()) {
177 - 13x + 13x +
            if (slice$fixed) {
178 - 4x + 4x +
              TRUE
@@ -1370,14 +1398,16 @@

teal.slice coverage - 65.86%

180 - 9x + 9x +
              isTRUE(slice$varname %in% allowed[[slice$dataname]]) ||
181 - 9x + 9x +
                isFALSE(slice$varname %in% forbidden[[slice$dataname]])
@@ -1419,7 +1449,8 @@

teal.slice coverage - 65.86%

187 - 4x + 4x +
        Filter(foo, x())
@@ -1433,7 +1464,8 @@

teal.slice coverage - 65.86%

189 - 67x + 67x +
      invisible(NULL)
@@ -1510,7 +1542,8 @@

teal.slice coverage - 65.86%

200 - 4x + 4x +
      private$available_teal_slices
@@ -1706,14 +1739,16 @@

teal.slice coverage - 65.86%

228 - 10x + 10x +
      checkmate::assert_subset(dataname, self$datanames())
229 - 9x + 9x +
      private$get_filtered_dataset(dataname)$get_call()
@@ -1811,28 +1846,32 @@

teal.slice coverage - 65.86%

243 - 24x + 24x +
      checkmate::assert_subset(dataname, self$datanames())
244 - 23x + 23x +
      checkmate::assert_flag(filtered)
245 - 22x + 22x +
      data <- private$get_filtered_dataset(dataname)$get_dataset(filtered)
246 - 3x + 3x +
      if (filtered) data() else data
@@ -1895,7 +1934,8 @@

teal.slice coverage - 65.86%

255 - 2x + 2x +
      private$join_keys
@@ -1986,28 +2026,32 @@

teal.slice coverage - 65.86%

268 - 9x + 9x +
      rows <- lapply(
269 - 9x + 9x +
        datanames,
270 - 9x + 9x +
        function(dataname) {
271 - 11x + 11x +
          private$get_filtered_dataset(dataname)$get_filter_overview()
@@ -2028,14 +2072,16 @@

teal.slice coverage - 65.86%

274 - 5x + 5x +
      unssuported_idx <- vapply(rows, function(x) all(is.na(x[-1])), logical(1))
275 - 5x + 5x +
      dplyr::bind_rows(c(rows[!unssuported_idx], rows[unssuported_idx]))
@@ -2112,7 +2158,8 @@

teal.slice coverage - 65.86%

286 - 1x + 1x +
      private$get_filtered_dataset(dataname)$get_keys()
@@ -2266,14 +2313,16 @@

teal.slice coverage - 65.86%

308 - 105x + 105x +
      checkmate::assert_string(dataname)
309 - 105x + 105x +
      logger::log_trace("FilteredData$set_dataset setting dataset, name: { dataname }")
@@ -2294,7 +2343,8 @@

teal.slice coverage - 65.86%

312 - 105x + 105x +
      check_simple_name(dataname)
@@ -2308,21 +2358,24 @@

teal.slice coverage - 65.86%

314 - 105x + 105x +
      parent_dataname <- teal.data::parent(private$join_keys, dataname)
315 - 105x + 105x +
      keys <- private$join_keys[dataname, dataname]
316 - 104x + 104x +
      if (is.null(keys)) keys <- character(0)
@@ -2336,35 +2389,40 @@

teal.slice coverage - 65.86%

318 - 105x + 105x +
      if (length(parent_dataname) == 0) {
319 - 95x + 95x +
        private$filtered_datasets[[dataname]] <- init_filtered_dataset(
320 - 95x + 95x +
          dataset = data,
321 - 95x + 95x +
          dataname = dataname,
322 - 95x + 95x +
          keys = keys
@@ -2385,7 +2443,8 @@

teal.slice coverage - 65.86%

325 - 10x + 10x +
        join_keys <- private$join_keys[dataname, parent_dataname]
@@ -2399,49 +2458,56 @@

teal.slice coverage - 65.86%

327 - 10x + 10x +
        private$filtered_datasets[[dataname]] <- init_filtered_dataset(
328 - 10x + 10x +
          dataset = data,
329 - 10x + 10x +
          dataname = dataname,
330 - 10x + 10x +
          keys = keys,
331 - 10x + 10x +
          parent_name = parent_dataname,
332 - 10x + 10x +
          parent = reactive(self$get_data(parent_dataname, filtered = TRUE)),
333 - 10x + 10x +
          join_keys = join_keys
@@ -2469,7 +2535,8 @@

teal.slice coverage - 65.86%

337 - 105x + 105x +
      invisible(self)
@@ -2546,21 +2613,24 @@

teal.slice coverage - 65.86%

348 - 66x + 66x +
      checkmate::assert_class(join_keys, "join_keys")
349 - 66x + 66x +
      private$join_keys <- join_keys
350 - 66x + 66x +
      invisible(self)
@@ -2637,35 +2707,40 @@

teal.slice coverage - 65.86%

361 - 53x + 53x +
      states <- unname(lapply(private$filtered_datasets, function(x) x$get_filter_state()))
362 - 53x + 53x +
      slices <- Filter(Negate(is.null), states)
363 - 53x + 53x +
      slices <- do.call(c, slices)
364 - 53x + 53x +
      if (!is.null(slices)) {
365 - 53x + 53x +
        attr(slices, "allow_add") <- private$allow_add
@@ -2679,7 +2754,8 @@

teal.slice coverage - 65.86%

367 - 53x + 53x +
      slices
@@ -2763,35 +2839,40 @@

teal.slice coverage - 65.86%

379 - 5x + 5x +
      datasets <- lapply(self$datanames(), private$get_filtered_dataset)
380 - 5x + 5x +
      ind <- vapply(datasets, inherits, logical(1L), what = "DefaultFilteredDataset")
381 - 5x + 5x +
      states <- do.call(c, lapply(datasets[!ind], function(ds) ds$get_filter_state()))
382 - 5x + 5x +
      states_fmt <- format(states, show_all = show_all, trim_lines = trim_lines)
383 - 5x + 5x +
      holders_fmt <- vapply(datasets[ind], format, character(1L), show_all = show_all, trim_lines = trim_lines)
@@ -2805,28 +2886,32 @@

teal.slice coverage - 65.86%

385 - 5x + 5x +
      sprintf(
386 - 5x + 5x +
        "%s:\n%s",
387 - 5x + 5x +
        class(self)[1],
388 - 5x + 5x +
        paste(c(states_fmt, holders_fmt), collapse = "\n")
@@ -2966,42 +3051,48 @@

teal.slice coverage - 65.86%

408 - 31x + 31x +
      isolate({
409 - 31x + 31x +
        logger::log_trace("{ class(self)[1] }$set_filter_state initializing")
410 - 31x + 31x +
        checkmate::assert_class(state, "teal_slices")
411 - 31x + 31x +
        allow_add <- attr(state, "allow_add")
412 - 31x + 31x +
        if (!is.null(allow_add)) {
413 - 31x + 31x +
          private$allow_add <- allow_add
@@ -3022,21 +3113,24 @@

teal.slice coverage - 65.86%

416 - 31x + 31x +
        lapply(self$datanames(), function(dataname) {
417 - 63x + 63x +
          states <- Filter(function(x) identical(x$dataname, dataname), state)
418 - 63x + 63x +
          private$get_filtered_dataset(dataname)$set_filter_state(states)
@@ -3057,7 +3151,8 @@

teal.slice coverage - 65.86%

421 - 31x + 31x +
        logger::log_trace("{ class(self)[1] }$set_filter_state initialized")
@@ -3078,7 +3173,8 @@

teal.slice coverage - 65.86%

424 - 31x + 31x +
      invisible(NULL)
@@ -3169,28 +3265,32 @@

teal.slice coverage - 65.86%

437 - 8x + 8x +
      isolate({
438 - 8x + 8x +
        checkmate::assert_class(state, "teal_slices")
439 - 8x + 8x +
        datanames <- unique(vapply(state, "[[", character(1L), "dataname"))
440 - 8x + 8x +
        checkmate::assert_subset(datanames, self$datanames())
@@ -3204,14 +3304,16 @@

teal.slice coverage - 65.86%

442 - 8x + 8x +
        logger::log_trace(
443 - 8x + 8x +
          "{ class(self)[1] }$remove_filter_state removing filter(s), dataname: { private$dataname }"
@@ -3232,21 +3334,24 @@

teal.slice coverage - 65.86%

446 - 8x + 8x +
        lapply(datanames, function(dataname) {
447 - 9x + 9x +
          slices <- Filter(function(x) identical(x$dataname, dataname), state)
448 - 9x + 9x +
          private$get_filtered_dataset(dataname)$remove_filter_state(slices)
@@ -3267,14 +3372,16 @@

teal.slice coverage - 65.86%

451 - 8x + 8x +
        logger::log_trace(
452 - 8x + 8x +
          "{ class(self)[1] }$remove_filter_state removed filter(s), dataname: { private$dataname }"
@@ -3302,7 +3409,8 @@

teal.slice coverage - 65.86%

456 - 8x + 8x +
      invisible(NULL)
@@ -3407,14 +3515,16 @@

teal.slice coverage - 65.86%

471 - 7x + 7x +
      logger::log_trace(
472 - 7x + 7x +
        "FilteredData$clear_filter_states called, datanames: { toString(datanames) }"
@@ -3435,21 +3545,24 @@

teal.slice coverage - 65.86%

475 - 7x + 7x +
      for (dataname in datanames) {
476 - 12x + 12x +
        fdataset <- private$get_filtered_dataset(dataname = dataname)
477 - 12x + 12x +
        fdataset$clear_filter_states(force)
@@ -3470,28 +3583,32 @@

teal.slice coverage - 65.86%

480 - 7x + 7x +
      logger::log_trace(
481 - 7x + 7x +
        paste(
482 - 7x + 7x +
          "FilteredData$clear_filter_states removed all non-anchored FilterStates,",
483 - 7x + 7x +
          "datanames: { toString(datanames) }"
@@ -3519,7 +3636,8 @@

teal.slice coverage - 65.86%

487 - 7x + 7x +
      invisible(NULL)
@@ -3785,35 +3903,40 @@

teal.slice coverage - 65.86%

525 - 1x + 1x +
      checkmate::assert_function(active_datanames)
526 - 1x + 1x +
      moduleServer(
527 - 1x + 1x +
        id = id,
528 - 1x + 1x +
        function(input, output, session) {
529 - 1x + 1x +
          logger::log_trace("FilteredData$srv_filter_panel initializing")
@@ -3827,14 +3950,16 @@

teal.slice coverage - 65.86%

531 - 1x + 1x +
          active_datanames_resolved <- reactive({
532 - 1x + 1x +
            checkmate::assert_subset(active_datanames(), self$datanames())
@@ -3862,28 +3987,32 @@

teal.slice coverage - 65.86%

536 - 1x + 1x +
          self$srv_overview("overview", active_datanames_resolved)
537 - 1x + 1x +
          self$srv_active("active", active_datanames_resolved)
538 - 1x + 1x +
          if (private$allow_add) {
539 - 1x + 1x +
            self$srv_add("add", active_datanames_resolved)
@@ -3904,14 +4033,16 @@

teal.slice coverage - 65.86%

542 - 1x + 1x +
          logger::log_trace("FilteredData$srv_filter_panel initialized")
543 - 1x + 1x +
          NULL
@@ -4352,21 +4483,24 @@

teal.slice coverage - 65.86%

606 - 3x + 3x +
      checkmate::assert_function(active_datanames)
607 - 3x + 3x +
      moduleServer(id, function(input, output, session) {
608 - 3x + 3x +
        logger::log_trace("FilteredData$srv_active initializing")
@@ -4387,7 +4521,8 @@

teal.slice coverage - 65.86%

611 - 3x + 3x +
        private$srv_available_filters("available_filters")
@@ -4401,7 +4536,8 @@

teal.slice coverage - 65.86%

613 - 3x + 3x +
        observeEvent(input$minimise_filter_active, {
@@ -4450,42 +4586,48 @@

teal.slice coverage - 65.86%

620 - 3x + 3x +
        observeEvent(private$get_filter_count(), {
621 - 3x + 3x +
          shinyjs::toggle("remove_all_filters", condition = private$get_filter_count() != 0)
622 - 3x + 3x +
          shinyjs::show("filter_active_vars_contents")
623 - 3x + 3x +
          shinyjs::hide("filters_active_count")
624 - 3x + 3x +
          toggle_icon(session$ns("minimise_filter_active"), c("fa-angle-right", "fa-angle-down"), TRUE)
625 - 3x + 3x +
          toggle_title(session$ns("minimise_filter_active"), c("Restore panel", "Minimise Panel"), TRUE)
@@ -4506,28 +4648,32 @@

teal.slice coverage - 65.86%

628 - 3x + 3x +
        observeEvent(active_datanames(), {
629 - 2x + 2x +
          lapply(self$datanames(), function(dataname) {
630 - 4x + 4x +
            if (dataname %in% active_datanames()) {
631 - 4x + 4x +
              shinyjs::show(dataname)
@@ -4590,35 +4736,40 @@

teal.slice coverage - 65.86%

640 - 3x + 3x +
        lapply(
641 - 3x + 3x +
          self$datanames(),
642 - 3x + 3x +
          function(dataname) {
643 - 6x + 6x +
            fdataset <- private$get_filtered_dataset(dataname)
644 - 6x + 6x +
            fdataset$srv_active(id = dataname)
@@ -4646,49 +4797,56 @@

teal.slice coverage - 65.86%

648 - 3x + 3x +
        output$teal_filters_count <- renderText({
649 - 3x + 3x +
          n_filters_active <- private$get_filter_count()
650 - 3x + 3x +
          req(n_filters_active > 0L)
651 - 2x + 2x +
          sprintf(
652 - 2x + 2x +
            "%s filter%s applied across datasets",
653 - 2x + 2x +
            n_filters_active,
654 - 2x + 2x +
            ifelse(n_filters_active == 1, "", "s")
@@ -4716,28 +4874,32 @@

teal.slice coverage - 65.86%

658 - 3x + 3x +
        observeEvent(input$remove_all_filters, {
659 - 1x + 1x +
          logger::log_trace("FilteredData$srv_filter_panel@1 removing all non-anchored filters")
660 - 1x + 1x +
          self$clear_filter_states()
661 - 1x + 1x +
          logger::log_trace("FilteredData$srv_filter_panel@1 removed all non-anchored filters")
@@ -4751,14 +4913,16 @@

teal.slice coverage - 65.86%

663 - 3x + 3x +
        logger::log_trace("FilteredData$srv_active initialized")
664 - 3x + 3x +
        NULL
@@ -5136,21 +5300,24 @@

teal.slice coverage - 65.86%

718 - 1x + 1x +
      checkmate::assert_class(active_datanames, "reactive")
719 - 1x + 1x +
      moduleServer(id, function(input, output, session) {
720 - 1x + 1x +
        logger::log_trace("FilteredData$srv_add initializing")
@@ -5164,7 +5331,8 @@

teal.slice coverage - 65.86%

722 - 1x + 1x +
        observeEvent(input$minimise_filter_add_vars, {
@@ -5206,7 +5374,8 @@

teal.slice coverage - 65.86%

728 - 1x + 1x +
        observeEvent(active_datanames(), {
@@ -5290,35 +5459,40 @@

teal.slice coverage - 65.86%

740 - 1x + 1x +
        lapply(
741 - 1x + 1x +
          self$datanames(),
742 - 1x + 1x +
          function(dataname) {
743 - 2x + 2x +
            fdataset <- private$get_filtered_dataset(dataname)
744 - 2x + 2x +
            fdataset$srv_add(id = dataname)
@@ -5339,14 +5513,16 @@

teal.slice coverage - 65.86%

747 - 1x + 1x +
        logger::log_trace("FilteredData$srv_filter_panel initialized")
748 - 1x + 1x +
        NULL
@@ -5766,35 +5942,40 @@

teal.slice coverage - 65.86%

808 - 1x + 1x +
      checkmate::assert_class(active_datanames, "reactive")
809 - 1x + 1x +
      moduleServer(
810 - 1x + 1x +
        id = id,
811 - 1x + 1x +
        function(input, output, session) {
812 - 1x + 1x +
          logger::log_trace("FilteredData$srv_filter_overview initializing")
@@ -5815,7 +5996,8 @@

teal.slice coverage - 65.86%

815 - 1x + 1x +
          observeEvent(input$minimise_filter_overview, {
@@ -5857,7 +6039,8 @@

teal.slice coverage - 65.86%

821 - 1x + 1x +
          output$table <- renderUI({
@@ -6431,14 +6614,16 @@

teal.slice coverage - 65.86%

903 - 1x + 1x +
          logger::log_trace("FilteredData$srv_filter_overview initialized")
904 - 1x + 1x +
          NULL
@@ -6697,7 +6882,8 @@

teal.slice coverage - 65.86%

941 - 147x + 147x +
      if (length(dataname) == 0) {
@@ -6718,7 +6904,8 @@

teal.slice coverage - 65.86%

944 - 147x + 147x +
        private$filtered_datasets[[dataname]]
@@ -6802,7 +6989,8 @@

teal.slice coverage - 65.86%

956 - 11x + 11x +
      length(self$get_filter_state())
@@ -7068,7 +7256,8 @@

teal.slice coverage - 65.86%

994 - 4x + 4x +
      moduleServer(id, function(input, output, session) {
@@ -7082,21 +7271,24 @@

teal.slice coverage - 65.86%

996 - 4x + 4x +
        slices_available <- self$get_available_teal_slices()
997 - 4x + 4x +
        slices_interactive <- reactive(
998 - 4x + 4x +
          Filter(function(slice) isFALSE(slice$fixed), slices_available())
@@ -7110,14 +7302,16 @@

teal.slice coverage - 65.86%

1000 - 4x + 4x +
        slices_fixed <- reactive(
1001 - 4x + 4x +
          Filter(function(slice) isTRUE(slice$fixed), slices_available())
@@ -7131,21 +7325,24 @@

teal.slice coverage - 65.86%

1003 - 4x + 4x +
        available_slices_id <- reactive(vapply(slices_available(), `[[`, character(1), "id"))
1004 - 4x + 4x +
        active_slices_id <- reactive(vapply(self$get_filter_state(), `[[`, character(1), "id"))
1005 - 4x + 4x +
        duplicated_slice_references <- reactive({
@@ -7159,35 +7356,40 @@

teal.slice coverage - 65.86%

1007 - 8x + 8x +
          slice_reference <- vapply(slices_available(), get_default_slice_id, character(1))
1008 - 8x + 8x +
          is_duplicated_reference <- duplicated(slice_reference) | duplicated(slice_reference, fromLast = TRUE)
1009 - 8x + 8x +
          is_active <- available_slices_id() %in% active_slices_id()
1010 - 8x + 8x +
          is_not_expr <- !vapply(slices_available(), inherits, logical(1), "teal_slice_expr")
1011 - 8x + 8x +
          slice_reference[is_duplicated_reference & is_active & is_not_expr]
@@ -7208,70 +7410,80 @@

teal.slice coverage - 65.86%

1014 - 4x + 4x +
        checkbox_group_element <- function(name, value, label, checked, disabled = FALSE) {
1015 - 35x + 35x +
          tags$div(
1016 - 35x + 35x +
            class = "checkbox available-filters",
1017 - 35x + 35x +
            tags$label(
1018 - 35x + 35x +
              tags$input(
1019 - 35x + 35x +
                type = "checkbox",
1020 - 35x + 35x +
                name = name,
1021 - 35x + 35x +
                value = value,
1022 - 35x + 35x +
                checked = checked,
1023 - 35x + 35x +
                disabled = if (disabled) "disabled"
@@ -7285,7 +7497,8 @@

teal.slice coverage - 65.86%

1025 - 35x + 35x +
              tags$span(label, disabled = if (disabled) disabled)
@@ -7320,42 +7533,48 @@

teal.slice coverage - 65.86%

1030 - 4x + 4x +
        output$checkbox <- renderUI({
1031 - 8x + 8x +
          checkbox <- checkboxGroupInput(
1032 - 8x + 8x +
            session$ns("available_slices_id"),
1033 - 8x + 8x +
            label = NULL,
1034 - 8x + 8x +
            choices = NULL,
1035 - 8x + 8x +
            selected = NULL
@@ -7369,14 +7588,16 @@

teal.slice coverage - 65.86%

1037 - 8x + 8x +
          active_slices_ids <- active_slices_id()
1038 - 8x + 8x +
          duplicated_slice_refs <- duplicated_slice_references()
@@ -7390,7 +7611,8 @@

teal.slice coverage - 65.86%

1040 - 8x + 8x +
          checkbox_group_slice <- function(slice) {
@@ -7404,63 +7626,72 @@

teal.slice coverage - 65.86%

1042 - 35x + 35x +
            isolate({
1043 - 35x + 35x +
              checkbox_group_element(
1044 - 35x + 35x +
                name = session$ns("available_slices_id"),
1045 - 35x + 35x +
                value = slice$id,
1046 - 35x + 35x +
                label = slice$id,
1047 - 35x + 35x +
                checked = if (slice$id %in% active_slices_ids) "checked",
1048 - 35x + 35x +
                disabled = slice$anchored ||
1049 - 35x + 35x +
                  get_default_slice_id(slice) %in% duplicated_slice_refs &&
1050 - 35x + 35x +
                    !slice$id %in% active_slices_ids
@@ -7495,14 +7726,16 @@

teal.slice coverage - 65.86%

1055 - 8x + 8x +
          interactive_choice_mock <- lapply(slices_interactive(), checkbox_group_slice)
1056 - 8x + 8x +
          non_interactive_choice_mock <- lapply(slices_fixed(), checkbox_group_slice)
@@ -7516,63 +7749,72 @@

teal.slice coverage - 65.86%

1058 - 8x + 8x +
          htmltools::tagInsertChildren(
1059 - 8x + 8x +
            checkbox,
1060 - 8x + 8x +
            tags$br(),
1061 - 8x + 8x +
            if (length(non_interactive_choice_mock)) tags$strong("Fixed filters"),
1062 - 8x + 8x +
            non_interactive_choice_mock,
1063 - 8x + 8x +
            if (length(interactive_choice_mock)) tags$strong("Interactive filters"),
1064 - 8x + 8x +
            interactive_choice_mock,
1065 - 8x + 8x +
            .cssSelector = "div.shiny-options-group",
1066 - 8x + 8x +
            after = 0
@@ -7600,49 +7842,56 @@

teal.slice coverage - 65.86%

1070 - 4x + 4x +
        observeEvent(input$available_slices_id, ignoreNULL = FALSE, ignoreInit = TRUE, {
1071 - 5x + 5x +
          new_slices_id <- setdiff(input$available_slices_id, active_slices_id())
1072 - 5x + 5x +
          removed_slices_id <- setdiff(active_slices_id(), input$available_slices_id)
1073 - 5x + 5x +
          if (length(new_slices_id)) {
1074 - 3x + 3x +
            new_teal_slices <- Filter(
1075 - 3x + 3x +
              function(slice) slice$id %in% new_slices_id,
1076 - 3x + 3x +
              private$available_teal_slices()
@@ -7656,7 +7905,8 @@

teal.slice coverage - 65.86%

1078 - 3x + 3x +
            self$set_filter_state(new_teal_slices)
@@ -7677,28 +7927,32 @@

teal.slice coverage - 65.86%

1081 - 5x + 5x +
          if (length(removed_slices_id)) {
1082 - 4x + 4x +
            removed_teal_slices <- Filter(
1083 - 4x + 4x +
              function(slice) slice$id %in% removed_slices_id,
1084 - 4x + 4x +
              self$get_filter_state()
@@ -7712,7 +7966,8 @@

teal.slice coverage - 65.86%

1086 - 4x + 4x +
            self$remove_filter_state(removed_teal_slices)
@@ -7740,21 +7995,24 @@

teal.slice coverage - 65.86%

1090 - 4x + 4x +
        observeEvent(private$available_teal_slices(), ignoreNULL = FALSE, {
1091 - 3x + 3x +
          if (length(private$available_teal_slices())) {
1092 - 1x + 1x +
            shinyjs::show("available_menu")
@@ -7768,7 +8026,8 @@

teal.slice coverage - 65.86%

1094 - 2x + 2x +
            shinyjs::hide("available_menu")
@@ -8187,28 +8446,32 @@

teal.slice coverage - 65.86%

53 - 274x + 274x +
      checkmate::assert_string(dataname)
54 - 272x + 272x +
      logger::log_trace("Instantiating { class(self)[1] }, dataname: { dataname }")
55 - 272x + 272x +
      checkmate::assert_function(data_reactive, args = "sid")
56 - 272x + 272x +
      checkmate::assert_string(datalabel, null.ok = TRUE)
@@ -8222,42 +8485,48 @@

teal.slice coverage - 65.86%

58 - 272x + 272x +
      private$dataname <- dataname
59 - 272x + 272x +
      private$datalabel <- datalabel
60 - 272x + 272x +
      private$dataname_prefixed <- dataname
61 - 272x + 272x +
      private$data <- data
62 - 272x + 272x +
      private$data_reactive <- data_reactive
63 - 272x + 272x +
      private$state_list <- reactiveVal()
@@ -8271,14 +8540,16 @@

teal.slice coverage - 65.86%

65 - 272x + 272x +
      logger::log_trace("Instantiated { class(self)[1] }, dataname: { private$dataname }")
66 - 272x + 272x +
      invisible(self)
@@ -8705,7 +8976,8 @@

teal.slice coverage - 65.86%

127 - 88x + 88x +
      logger::log_trace("FilterStates$get_call initializing")
@@ -8740,21 +9012,24 @@

teal.slice coverage - 65.86%

132 - 88x + 88x +
      states_list <- private$state_list_get()
133 - 88x + 88x +
      if (length(states_list) == 0) {
134 - 52x + 52x +
        return(NULL)
@@ -8768,35 +9043,40 @@

teal.slice coverage - 65.86%

136 - 36x + 36x +
      args <- vapply(
137 - 36x + 36x +
        states_list,
138 - 36x + 36x +
        function(x) {
139 - 57x + 57x +
          arg <- x$get_state()$arg
140 - 7x + 7x +
          `if`(is.null(arg), "", arg) # converting NULL -> "" to enable tapply.
@@ -8810,7 +9090,8 @@

teal.slice coverage - 65.86%

142 - 36x + 36x +
        character(1)
@@ -8831,35 +9112,40 @@

teal.slice coverage - 65.86%

145 - 36x + 36x +
      filter_items <- tapply(
146 - 36x + 36x +
        X = states_list,
147 - 36x + 36x +
        INDEX = args,
148 - 36x + 36x +
        simplify = FALSE,
149 - 36x + 36x +
        function(items) {
@@ -8873,14 +9159,16 @@

teal.slice coverage - 65.86%

151 - 38x + 38x +
          other_filter_idx <- !names(items) %in% sid
152 - 38x + 38x +
          filtered_items <- items[other_filter_idx]
@@ -8894,42 +9182,48 @@

teal.slice coverage - 65.86%

154 - 38x + 38x +
          calls <- Filter(
155 - 38x + 38x +
            Negate(is.null),
156 - 38x + 38x +
            lapply(
157 - 38x + 38x +
              filtered_items,
158 - 38x + 38x +
              function(state) {
159 - 51x + 51x +
                state$get_call(dataname = private$dataname_prefixed)
@@ -8957,7 +9251,8 @@

teal.slice coverage - 65.86%

163 - 38x + 38x +
          calls_combine_by(calls, operator = "&")
@@ -8978,21 +9273,24 @@

teal.slice coverage - 65.86%

166 - 36x + 36x +
      filter_items <- Filter(
167 - 36x + 36x +
        x = filter_items,
168 - 36x + 36x +
        f = Negate(is.null)
@@ -9006,49 +9304,56 @@

teal.slice coverage - 65.86%

170 - 36x + 36x +
      if (length(filter_items) > 0L) {
171 - 35x + 35x +
        filter_function <- private$fun
172 - 35x + 35x +
        data_name <- str2lang(private$dataname_prefixed)
173 - 35x + 35x +
        substitute(
174 - 35x + 35x +
          env = list(
175 - 35x + 35x +
            lhs = data_name,
176 - 35x + 35x +
            rhs = as.call(c(filter_function, c(list(data_name), filter_items)))
@@ -9062,7 +9367,8 @@

teal.slice coverage - 65.86%

178 - 35x + 35x +
          expr = lhs <- rhs
@@ -9090,7 +9396,8 @@

teal.slice coverage - 65.86%

182 - 1x + 1x +
        NULL
@@ -9244,35 +9551,40 @@

teal.slice coverage - 65.86%

204 - 17x + 17x +
      checkmate::assert_class(state, "teal_slices")
205 - 17x + 17x +
      isolate({
206 - 17x + 17x +
        state_ids <- vapply(state, `[[`, character(1), "id")
207 - 17x + 17x +
        logger::log_trace("{ class(self)[1] }$remove_filter_state removing filters, state_id: { toString(state_ids) }")
208 - 17x + 17x +
        private$state_list_remove(state_ids)
@@ -9286,7 +9598,8 @@

teal.slice coverage - 65.86%

210 - 17x + 17x +
      invisible(NULL)
@@ -9370,14 +9683,16 @@

teal.slice coverage - 65.86%

222 - 364x + 364x +
      slices <- unname(lapply(private$state_list(), function(x) x$get_state()))
223 - 364x + 364x +
      fs <- do.call(teal_slices, c(slices, list(count_type = private$count_type)))
@@ -9391,35 +9706,40 @@

teal.slice coverage - 65.86%

225 - 364x + 364x +
      include_varnames <- private$include_varnames
226 - 364x + 364x +
      if (length(include_varnames)) {
227 - 214x + 214x +
        attr(fs, "include_varnames") <- structure(
228 - 214x + 214x +
          list(include_varnames),
229 - 214x + 214x +
          names = private$dataname
@@ -9447,35 +9767,40 @@

teal.slice coverage - 65.86%

233 - 364x + 364x +
      exclude_varnames <- private$exclude_varnames
234 - 364x + 364x +
      if (length(exclude_varnames)) {
235 - 9x + 9x +
        attr(fs, "exclude_varnames") <- structure(
236 - 9x + 9x +
          list(exclude_varnames),
237 - 9x + 9x +
          names = private$dataname
@@ -9503,7 +9828,8 @@

teal.slice coverage - 65.86%

241 - 364x + 364x +
      fs
@@ -9559,49 +9885,56 @@

teal.slice coverage - 65.86%

249 - 135x + 135x +
      isolate({
250 - 135x + 135x +
        logger::log_trace("{ class(self)[1] }$set_filter_state initializing, dataname: { private$dataname }")
251 - 135x + 135x +
        checkmate::assert_class(state, "teal_slices")
252 - 135x + 135x +
        lapply(state, function(x) {
253 - 177x + 177x +
          checkmate::assert_true(
254 - 177x + 177x +
            x$dataname == private$dataname,
255 - 177x + 177x +
            .var.name = "dataname matches private$dataname"
@@ -9629,21 +9962,24 @@

teal.slice coverage - 65.86%

259 - 135x + 135x +
        private$set_filterable_varnames(
260 - 135x + 135x +
          include_varnames = attr(state, "include_varnames")[[private$dataname]],
261 - 135x + 135x +
          exclude_varnames = attr(state, "exclude_varnames")[[private$dataname]]
@@ -9657,21 +9993,24 @@

teal.slice coverage - 65.86%

263 - 135x + 135x +
        count_type <- attr(state, "count_type")
264 - 135x + 135x +
        if (length(count_type)) {
265 - 21x + 21x +
          private$count_type <- count_type
@@ -9699,35 +10038,40 @@

teal.slice coverage - 65.86%

269 - 135x + 135x +
        varnames <- unique(unlist(lapply(state, "[[", "varname")))
270 - 135x + 135x +
        excluded_varnames <- setdiff(varnames, private$get_filterable_varnames())
271 - 135x + 135x +
        if (length(excluded_varnames)) {
272 - 3x + 3x +
          state <- Filter(function(x) !isTRUE(x$varname %in% excluded_varnames), state)
273 - 3x + 3x +
          warning(sprintf("filters for columns: %s excluded from %s", toString(excluded_varnames), private$dataname))
@@ -9748,35 +10092,40 @@

teal.slice coverage - 65.86%

276 - 135x + 135x +
        if (length(state) > 0) {
277 - 93x + 93x +
          private$set_filter_state_impl(
278 - 93x + 93x +
            state = state,
279 - 93x + 93x +
            data = private$data,
280 - 93x + 93x +
            data_reactive = private$data_reactive
@@ -9797,7 +10146,8 @@

teal.slice coverage - 65.86%

283 - 135x + 135x +
        logger::log_trace("{ class(self)[1] }$set_filter_state initialized, dataname: { private$dataname }")
@@ -9818,7 +10168,8 @@

teal.slice coverage - 65.86%

286 - 135x + 135x +
      invisible(NULL)
@@ -9902,14 +10253,16 @@

teal.slice coverage - 65.86%

298 - 25x + 25x +
      private$state_list_empty(force)
299 - 25x + 25x +
      invisible(NULL)
@@ -10161,49 +10514,56 @@

teal.slice coverage - 65.86%

335 - 12x + 12x +
      moduleServer(
336 - 12x + 12x +
        id = id,
337 - 12x + 12x +
        function(input, output, session) {
338 - 12x + 12x +
          logger::log_trace("FilterState$srv_active initializing, dataname: { private$dataname }")
339 - 12x + 12x +
          current_state <- reactive(private$state_list_get())
340 - 12x + 12x +
          previous_state <- reactiveVal(NULL) # FilterState list
341 - 12x + 12x +
          added_states <- reactiveVal(NULL) # FilterState list
@@ -10224,21 +10584,24 @@

teal.slice coverage - 65.86%

344 - 12x + 12x +
          fs_to_shiny_ns <- function(x) {
345 - 24x + 24x +
            checkmate::assert_multi_class(x, c("FilterState", "FilterStateExpr"))
346 - 24x + 24x +
            gsub("[^[:alnum:]]+", "_", get_default_slice_id(x$get_state()))
@@ -10259,28 +10622,32 @@

teal.slice coverage - 65.86%

349 - 12x + 12x +
          output$trigger_visible_state_change <- renderUI({
350 - 14x + 14x +
            current_state()
351 - 14x + 14x +
            isolate({
352 - 14x + 14x +
              logger::log_trace("FilterStates$srv_active@1 determining added and removed filter states")
@@ -10294,21 +10661,24 @@

teal.slice coverage - 65.86%

354 - 14x + 14x +
              added_states(setdiff_teal_slices(current_state(), previous_state()))
355 - 14x + 14x +
              previous_state(current_state())
356 - 14x + 14x +
              NULL
@@ -10336,42 +10706,48 @@

teal.slice coverage - 65.86%

360 - 12x + 12x +
          output[["cards"]] <- renderUI({
361 - 14x + 14x +
            lapply(
362 - 14x + 14x +
              current_state(), # observes only if added/removed
363 - 14x + 14x +
              function(state) {
364 - 12x + 12x +
                isolate( # isolates when existing state changes
365 - 12x + 12x +
                  state$ui(id = session$ns(fs_to_shiny_ns(state)), parent_id = session$ns("cards"))
@@ -10413,21 +10789,24 @@

teal.slice coverage - 65.86%

371 - 12x + 12x +
          observeEvent(
372 - 12x + 12x +
            added_states(), # we want to call FilterState module only once when it's added
373 - 12x + 12x +
            ignoreNULL = TRUE,
@@ -10441,63 +10820,72 @@

teal.slice coverage - 65.86%

375 - 10x + 10x +
              added_state_names <- vapply(added_states(), function(x) x$get_state()$id, character(1L))
376 - 10x + 10x +
              logger::log_trace("FilterStates$srv_active@2 triggered by added states: { toString(added_state_names) }")
377 - 10x + 10x +
              lapply(added_states(), function(state) {
378 - 12x + 12x +
                fs_callback <- state$server(id = fs_to_shiny_ns(state))
379 - 12x + 12x +
                observeEvent(
380 - 12x + 12x +
                  once = TRUE, # remove button can be called once, should be destroyed afterwards
381 - 12x + 12x +
                  ignoreInit = TRUE, # ignoreInit: should not matter because we destroy the previous input set of the UI
382 - 12x + 12x +
                  eventExpr = fs_callback(), # when remove button is clicked in the FilterState ui
383 - 12x + 12x +
                  handlerExpr = private$state_list_remove(state$get_state()$id)
@@ -10518,7 +10906,8 @@

teal.slice coverage - 65.86%

386 - 10x + 10x +
              added_states(NULL)
@@ -10546,7 +10935,8 @@

teal.slice coverage - 65.86%

390 - 12x + 12x +
          NULL
@@ -10644,14 +11034,16 @@

teal.slice coverage - 65.86%

404 - 1x + 1x +
      checkmate::assert_string(id)
405 - 1x + 1x +
      data <- private$data
@@ -10665,7 +11057,8 @@

teal.slice coverage - 65.86%

407 - 1x + 1x +
      ns <- NS(id)
@@ -10679,14 +11072,16 @@

teal.slice coverage - 65.86%

409 - 1x + 1x +
      if (ncol(data) == 0) {
410 - 1x + 1x +
        tags$div("no sample variables available")
@@ -10826,28 +11221,32 @@

teal.slice coverage - 65.86%

430 - 8x + 8x +
      moduleServer(
431 - 8x + 8x +
        id = id,
432 - 8x + 8x +
        function(input, output, session) {
433 - 8x + 8x +
          logger::log_trace("FilterStates$srv_add initializing, dataname: { private$dataname }")
@@ -10875,42 +11274,48 @@

teal.slice coverage - 65.86%

437 - 8x + 8x +
          avail_column_choices <- reactive({
438 - 9x + 9x +
            data <- private$data
439 - 9x + 9x +
            vars_include <- private$get_filterable_varnames()
440 - 9x + 9x +
            active_filter_vars <- unique(unlist(lapply(self$get_filter_state(), "[[", "varname")))
441 - 9x + 9x +
            choices <- setdiff(vars_include, active_filter_vars)
442 - 9x + 9x +
            varlabels <- get_varlabels(data)
@@ -10924,35 +11329,40 @@

teal.slice coverage - 65.86%

444 - 9x + 9x +
            data_choices_labeled(
445 - 9x + 9x +
              data = data,
446 - 9x + 9x +
              choices = choices,
447 - 9x + 9x +
              varlabels = varlabels,
448 - 9x + 9x +
              keys = private$keys
@@ -10987,21 +11397,24 @@

teal.slice coverage - 65.86%

453 - 8x + 8x +
          output$add_filter <- renderUI({
454 - 6x + 6x +
            logger::log_trace(
455 - 6x + 6x +
              "FilterStates$srv_add@1 updating available column choices, dataname: { private$dataname }"
@@ -11015,7 +11428,8 @@

teal.slice coverage - 65.86%

457 - 6x + 6x +
            if (length(avail_column_choices()) == 0) {
@@ -11036,56 +11450,64 @@

teal.slice coverage - 65.86%

460 - 6x + 6x +
              tags$div(
461 - 6x + 6x +
                teal.widgets::optionalSelectInput(
462 - 6x + 6x +
                  session$ns("var_to_add"),
463 - 6x + 6x +
                  choices = avail_column_choices(),
464 - 6x + 6x +
                  selected = NULL,
465 - 6x + 6x +
                  options = shinyWidgets::pickerOptions(
466 - 6x + 6x +
                    liveSearch = TRUE,
467 - 6x + 6x +
                    noneSelectedText = "Select variable to filter"
@@ -11134,56 +11556,64 @@

teal.slice coverage - 65.86%

474 - 8x + 8x +
          observeEvent(
475 - 8x + 8x +
            eventExpr = input$var_to_add,
476 - 8x + 8x +
            handlerExpr = {
477 - 3x + 3x +
              logger::log_trace(
478 - 3x + 3x +
                sprintf(
479 - 3x + 3x +
                  "FilterStates$srv_add@2 adding FilterState of variable %s, dataname: %s",
480 - 3x + 3x +
                  input$var_to_add,
481 - 3x + 3x +
                  private$dataname
@@ -11204,21 +11634,24 @@

teal.slice coverage - 65.86%

484 - 3x + 3x +
              self$set_filter_state(
485 - 3x + 3x +
                teal_slices(
486 - 3x + 3x +
                  teal_slice(dataname = private$dataname, varname = input$var_to_add)
@@ -11239,35 +11672,40 @@

teal.slice coverage - 65.86%

489 - 3x + 3x +
              logger::log_trace(
490 - 3x + 3x +
                sprintf(
491 - 3x + 3x +
                  "FilterStates$srv_add@2 added FilterState of variable %s, dataname: %s",
492 - 3x + 3x +
                  input$var_to_add,
493 - 3x + 3x +
                  private$dataname
@@ -11309,14 +11747,16 @@

teal.slice coverage - 65.86%

499 - 8x + 8x +
          logger::log_trace("FilterStates$srv_add initialized, dataname: { private$dataname }")
500 - 8x + 8x +
          NULL
@@ -11575,14 +12015,16 @@

teal.slice coverage - 65.86%

537 - 288x + 288x +
      if ((length(include_varnames) + length(exclude_varnames)) == 0L) {
538 - 113x + 113x +
        return(invisible(NULL))
@@ -11596,21 +12038,24 @@

teal.slice coverage - 65.86%

540 - 175x + 175x +
      checkmate::assert_character(include_varnames, any.missing = FALSE, min.len = 0L, null.ok = TRUE)
541 - 175x + 175x +
      checkmate::assert_character(exclude_varnames, any.missing = FALSE, min.len = 0L, null.ok = TRUE)
542 - 175x + 175x +
      if (length(include_varnames) && length(exclude_varnames)) {
@@ -11659,28 +12104,32 @@

teal.slice coverage - 65.86%

549 - 175x + 175x +
      supported_vars <- get_supported_filter_varnames(private$data)
550 - 175x + 175x +
      if (length(include_varnames)) {
551 - 161x + 161x +
        private$include_varnames <- intersect(include_varnames, supported_vars)
552 - 161x + 161x +
        private$exclude_varnames <- character(0)
@@ -11694,14 +12143,16 @@

teal.slice coverage - 65.86%

554 - 14x + 14x +
        private$exclude_varnames <- exclude_varnames
555 - 14x + 14x +
        private$include_varnames <- character(0)
@@ -11715,7 +12166,8 @@

teal.slice coverage - 65.86%

557 - 175x + 175x +
      invisible(NULL)
@@ -11792,14 +12244,16 @@

teal.slice coverage - 65.86%

568 - 144x + 144x +
      if (length(private$include_varnames)) {
569 - 97x + 97x +
        private$include_varnames
@@ -11813,14 +12267,16 @@

teal.slice coverage - 65.86%

571 - 47x + 47x +
        supported_varnames <- get_supported_filter_varnames(private$data)
572 - 47x + 47x +
        setdiff(supported_varnames, private$exclude_varnames)
@@ -11925,7 +12381,8 @@

teal.slice coverage - 65.86%

587 - 212x + 212x +
      checkmate::assert_string(state_id, null.ok = TRUE)
@@ -11939,14 +12396,16 @@

teal.slice coverage - 65.86%

589 - 212x + 212x +
      if (is.null(state_id)) {
590 - 212x + 212x +
        private$state_list()
@@ -12072,49 +12531,56 @@

teal.slice coverage - 65.86%

608 - 183x + 183x +
      logger::log_trace("{ class(self)[1] } pushing into state_list, dataname: { private$dataname }")
609 - 183x + 183x +
      checkmate::assert_string(state_id)
610 - 183x + 183x +
      checkmate::assert_multi_class(x, c("FilterState", "FilterStateExpr"))
611 - 183x + 183x +
      state <- stats::setNames(list(x), state_id)
612 - 183x + 183x +
      new_state_list <- c(
613 - 183x + 183x +
        isolate(private$state_list()),
614 - 183x + 183x +
        state
@@ -12128,7 +12594,8 @@

teal.slice coverage - 65.86%

616 - 183x + 183x +
      isolate(private$state_list(new_state_list))
@@ -12142,14 +12609,16 @@

teal.slice coverage - 65.86%

618 - 183x + 183x +
      logger::log_trace("{ class(self)[1] } pushed into queue, dataname: { private$dataname }")
619 - 183x + 183x +
      invisible(NULL)
@@ -12268,14 +12737,16 @@

teal.slice coverage - 65.86%

636 - 32x + 32x +
      checkmate::assert_character(state_id)
637 - 32x + 32x +
      logger::log_trace("{ class(self)[1] } removing a filter, state_id: { toString(state_id) }")
@@ -12289,63 +12760,72 @@

teal.slice coverage - 65.86%

639 - 32x + 32x +
      isolate({
640 - 32x + 32x +
        current_state_ids <- vapply(private$state_list(), function(x) x$get_state()$id, character(1))
641 - 32x + 32x +
        to_remove <- state_id %in% current_state_ids
642 - 32x + 32x +
        if (any(to_remove)) {
643 - 31x + 31x +
          new_state_list <- Filter(
644 - 31x + 31x +
            function(state) {
645 - 68x + 68x +
              if (state$get_state()$id %in% state_id) {
646 - 54x + 54x +
                if (state$get_state()$anchored && !force) {
647 - 7x + 7x +
                  return(TRUE)
@@ -12359,14 +12839,16 @@

teal.slice coverage - 65.86%

649 - 47x + 47x +
                  state$destroy_observers()
650 - 47x + 47x +
                  FALSE
@@ -12387,7 +12869,8 @@

teal.slice coverage - 65.86%

653 - 14x + 14x +
                TRUE
@@ -12408,7 +12891,8 @@

teal.slice coverage - 65.86%

656 - 31x + 31x +
            private$state_list()
@@ -12422,7 +12906,8 @@

teal.slice coverage - 65.86%

658 - 31x + 31x +
          private$state_list(new_state_list)
@@ -12436,7 +12921,8 @@

teal.slice coverage - 65.86%

660 - 1x + 1x +
          warning(sprintf("\"%s\" not found in state list", state_id))
@@ -12464,7 +12950,8 @@

teal.slice coverage - 65.86%

664 - 32x + 32x +
      invisible(NULL)
@@ -12534,21 +13021,24 @@

teal.slice coverage - 65.86%

674 - 25x + 25x +
      isolate({
675 - 25x + 25x +
        logger::log_trace(
676 - 25x + 25x +
          "{ class(self)[1] }$state_list_empty removing all non-anchored filters for dataname: { private$dataname }"
@@ -12569,28 +13059,32 @@

teal.slice coverage - 65.86%

679 - 25x + 25x +
        state_list <- private$state_list()
680 - 25x + 25x +
        if (length(state_list)) {
681 - 15x + 15x +
          state_ids <- vapply(state_list, function(x) x$get_state()$id, character(1))
682 - 15x + 15x +
          private$state_list_remove(state_ids, force)
@@ -12618,7 +13112,8 @@

teal.slice coverage - 65.86%

686 - 25x + 25x +
      invisible(NULL)
@@ -12744,35 +13239,40 @@

teal.slice coverage - 65.86%

704 - 211x + 211x +
      checkmate::assert_class(state, "teal_slices")
705 - 211x + 211x +
      checkmate::assert_multi_class(data, c("data.frame", "matrix", "DataFrame", "HermesData"))
706 - 211x + 211x +
      checkmate::assert_function(data_reactive, args = "sid")
707 - 211x + 211x +
      if (length(state) == 0L) {
708 - 101x + 101x +
        return(invisible(NULL))
@@ -12793,14 +13293,16 @@

teal.slice coverage - 65.86%

711 - 110x + 110x +
      slices_hashed <- vapply(state, `[[`, character(1L), "id")
712 - 110x + 110x +
      if (any(duplicated(slices_hashed))) {
@@ -12849,28 +13351,32 @@

teal.slice coverage - 65.86%

719 - 110x + 110x +
      state_list <- isolate(private$state_list_get())
720 - 110x + 110x +
      lapply(state, function(slice) {
721 - 191x + 191x +
        state_id <- slice$id
722 - 191x + 191x +
        if (state_id %in% names(state_list)) {
@@ -12884,7 +13390,8 @@

teal.slice coverage - 65.86%

724 - 8x + 8x +
          state_list[[state_id]]$set_state(slice)
@@ -12898,7 +13405,8 @@

teal.slice coverage - 65.86%

726 - 183x + 183x +
          if (inherits(slice, "teal_slice_expr")) {
@@ -12912,7 +13420,8 @@

teal.slice coverage - 65.86%

728 - 6x + 6x +
            fstate <- init_filter_state_expr(slice)
@@ -12933,14 +13442,16 @@

teal.slice coverage - 65.86%

731 - 177x + 177x +
            fstate <- init_filter_state(
732 - 177x + 177x +
              x = data[, slice$varname, drop = TRUE],
@@ -12989,14 +13500,16 @@

teal.slice coverage - 65.86%

739 - 177x + 177x +
              x_reactive = if (private$count_type == "none") {
740 - 171x + 171x +
                reactive(NULL)
@@ -13010,7 +13523,8 @@

teal.slice coverage - 65.86%

742 - 6x + 6x +
                reactive(data_reactive(state_id)[, slice$varname, drop = TRUE])
@@ -13024,14 +13538,16 @@

teal.slice coverage - 65.86%

744 - 177x + 177x +
              slice = slice,
745 - 177x + 177x +
              extract_type = private$extract_type
@@ -13052,7 +13568,8 @@

teal.slice coverage - 65.86%

748 - 183x + 183x +
          private$state_list_push(x = fstate, state_id = state_id)
@@ -13080,7 +13597,8 @@

teal.slice coverage - 65.86%

752 - 110x + 110x +
      invisible(NULL)
@@ -14206,56 +14724,64 @@

teal.slice coverage - 65.86%

157 - 121x + 121x +
      isolate({
158 - 121x + 121x +
        checkmate::assert_numeric(x, all.missing = FALSE)
159 - 2x + 2x +
        if (!any(is.finite(x))) stop("\"x\" contains no finite values")
160 - 118x + 118x +
        super$initialize(x = x, x_reactive = x_reactive, slice = slice, extract_type = extract_type)
161 - 118x + 118x +
        private$is_integer <- checkmate::test_integerish(x)
162 - 118x + 118x +
        private$inf_count <- sum(is.infinite(x))
163 - 118x + 118x +
        private$inf_filtered_count <- reactive(
164 - 118x + 118x +
          if (!is.null(private$x_reactive())) sum(is.infinite(private$x_reactive()))
@@ -14276,14 +14802,16 @@

teal.slice coverage - 65.86%

167 - 118x + 118x +
        checkmate::assert_numeric(slice$choices, null.ok = TRUE)
168 - 3x + 3x +
        if (is.null(slice$keep_inf) && any(is.infinite(x))) slice$keep_inf <- TRUE
@@ -14297,21 +14825,24 @@

teal.slice coverage - 65.86%

170 - 117x + 117x +
        private$set_choices(slice$choices)
171 - 42x + 42x +
        if (is.null(slice$selected)) slice$selected <- slice$choices
172 - 117x + 117x +
        private$set_selected(slice$selected)
@@ -14325,21 +14856,24 @@

teal.slice coverage - 65.86%

174 - 114x + 114x +
        private$is_integer <- checkmate::test_integerish(x)
175 - 114x + 114x +
        private$inf_filtered_count <- reactive(
176 - 114x + 114x +
          if (!is.null(private$x_reactive())) sum(is.infinite(private$x_reactive()))
@@ -14353,7 +14887,8 @@

teal.slice coverage - 65.86%

178 - 114x + 114x +
        private$inf_count <- sum(is.infinite(x))
@@ -14367,63 +14902,72 @@

teal.slice coverage - 65.86%

180 - 114x + 114x +
        private$plot_data <- list(
181 - 114x + 114x +
          type = "histogram",
182 - 114x + 114x +
          nbinsx = 50,
183 - 114x + 114x +
          x = Filter(Negate(is.na), Filter(is.finite, private$x)),
184 - 114x + 114x +
          color = I(fetch_bs_color("secondary")),
185 - 114x + 114x +
          alpha = 0.2,
186 - 114x + 114x +
          bingroup = 1,
187 - 114x + 114x +
          showlegend = FALSE,
188 - 114x + 114x +
          hoverinfo = "none"
@@ -14437,21 +14981,24 @@

teal.slice coverage - 65.86%

190 - 114x + 114x +
        private$plot_mask <- list(list(
191 - 114x + 114x +
          type = "rect", fillcolor = rgb(1, 1, 1, .65), line = list(width = 0),
192 - 114x + 114x +
          x0 = -0.5, x1 = 1.5, y0 = -0.5, y1 = 1.5, xref = "paper", yref = "paper"
@@ -14465,84 +15012,96 @@

teal.slice coverage - 65.86%

194 - 114x + 114x +
        private$plot_layout <- reactive({
195 - 5x + 5x +
          shapes <- private$get_shape_properties(private$get_selected())
196 - 5x + 5x +
          list(
197 - 5x + 5x +
            barmode = "overlay",
198 - 5x + 5x +
            xaxis = list(
199 - 5x + 5x +
              range = private$get_choices() * c(0.995, 1.005),
200 - 5x + 5x +
              rangeslider = list(thickness = 0),
201 - 5x + 5x +
              showticklabels = TRUE,
202 - 5x + 5x +
              ticks = "outside",
203 - 5x + 5x +
              ticklen = 1.5,
204 - 5x + 5x +
              tickmode = "auto",
205 - 5x + 5x +
              nticks = 10
@@ -14556,35 +15115,40 @@

teal.slice coverage - 65.86%

207 - 5x + 5x +
            yaxis = list(showgrid = FALSE, showticklabels = FALSE),
208 - 5x + 5x +
            margin = list(b = 17, l = 0, r = 0, t = 0, autoexpand = FALSE),
209 - 5x + 5x +
            plot_bgcolor = "#FFFFFF00",
210 - 5x + 5x +
            paper_bgcolor = "#FFFFFF00",
211 - 5x + 5x +
            shapes = shapes
@@ -14605,35 +15169,40 @@

teal.slice coverage - 65.86%

214 - 114x + 114x +
        private$plot_config <- reactive({
215 - 5x + 5x +
          list(
216 - 5x + 5x +
            doubleClick = "reset",
217 - 5x + 5x +
            displayModeBar = FALSE,
218 - 5x + 5x +
            edits = list(shapePosition = TRUE)
@@ -14654,49 +15223,56 @@

teal.slice coverage - 65.86%

221 - 114x + 114x +
        private$plot_filtered <- reactive({
222 - 5x + 5x +
          finite_values <- Filter(is.finite, private$x_reactive())
223 - 5x + 5x +
          if (!identical(finite_values, numeric(0))) {
224 - 5x + 5x +
            list(
225 - 5x + 5x +
              x = finite_values,
226 - 5x + 5x +
              bingroup = 1,
227 - 5x + 5x +
              color = I(fetch_bs_color("primary"))
@@ -14724,7 +15300,8 @@

teal.slice coverage - 65.86%

231 - 114x + 114x +
        invisible(self)
@@ -14815,14 +15392,16 @@

teal.slice coverage - 65.86%

244 - 35x + 35x +
      if (isFALSE(private$is_any_filtered())) {
245 - 1x + 1x +
        return(NULL)
@@ -14836,28 +15415,32 @@

teal.slice coverage - 65.86%

247 - 4x + 4x +
      if (missing(dataname)) dataname <- private$get_dataname()
248 - 34x + 34x +
      varname <- private$get_varname_prefixed(dataname)
249 - 34x + 34x +
      filter_call <-
250 - 34x + 34x +
        call(
@@ -14871,14 +15454,16 @@

teal.slice coverage - 65.86%

252 - 34x + 34x +
          call(">=", varname, private$get_selected()[1L]),
253 - 34x + 34x +
          call("<=", varname, private$get_selected()[2L])
@@ -14892,7 +15477,8 @@

teal.slice coverage - 65.86%

255 - 34x + 34x +
      private$add_keep_na_call(private$add_keep_inf_call(filter_call, varname), varname)
@@ -15074,21 +15660,24 @@

teal.slice coverage - 65.86%

281 - 117x + 117x +
      x <- private$x[is.finite(private$x)]
282 - 117x + 117x +
      if (is.null(choices)) {
283 - 105x + 105x +
        choices <- range(x)
@@ -15102,35 +15691,40 @@

teal.slice coverage - 65.86%

285 - 12x + 12x +
        choices_adjusted <- c(max(choices[1L], min(x)), min(choices[2L], max(x)))
286 - 12x + 12x +
        if (any(choices != choices_adjusted)) {
287 - 1x + 1x +
          warning(sprintf(
288 - 1x + 1x +
            "Choices adjusted (some values outside of variable range). Varname: %s, dataname: %s.",
289 - 1x + 1x +
            private$get_varname(), private$get_dataname()
@@ -15144,7 +15738,8 @@

teal.slice coverage - 65.86%

291 - 1x + 1x +
          choices <- choices_adjusted
@@ -15158,35 +15753,40 @@

teal.slice coverage - 65.86%

293 - 12x + 12x +
        if (choices[1L] > choices[2L]) {
294 - 1x + 1x +
          warning(sprintf(
295 - 1x + 1x +
            "Invalid choices: lower is higher / equal to upper, or not in range of variable values.
296 - 1x + 1x +
            Setting defaults. Varname: %s, dataname: %s.",
297 - 1x + 1x +
            private$get_varname(), private$get_dataname()
@@ -15200,7 +15800,8 @@

teal.slice coverage - 65.86%

299 - 1x + 1x +
          choices <- range(x)
@@ -15228,21 +15829,24 @@

teal.slice coverage - 65.86%

303 - 117x + 117x +
      private$set_is_choice_limited(private$x, choices)
304 - 117x + 117x +
      private$x <- private$x[
305 - 117x + 117x +
        (private$x >= choices[1L] & private$x <= choices[2L]) | is.na(private$x) | !is.finite(private$x)
@@ -15263,7 +15867,8 @@

teal.slice coverage - 65.86%

308 - 117x + 117x +
      x_range <- range(private$x, finite = TRUE)
@@ -15284,14 +15889,16 @@

teal.slice coverage - 65.86%

311 - 117x + 117x +
      if (identical(diff(x_range), 0)) {
312 - 2x + 2x +
        choices <- x_range
@@ -15305,21 +15912,24 @@

teal.slice coverage - 65.86%

314 - 115x + 115x +
        x_pretty <- pretty(x_range, 100L)
315 - 115x + 115x +
        choices <- range(x_pretty)
316 - 115x + 115x +
        private$numeric_step <- signif(private$get_pretty_range_step(x_pretty), digits = 10)
@@ -15333,14 +15943,16 @@

teal.slice coverage - 65.86%

318 - 117x + 117x +
      private$teal_slice$choices <- choices
319 - 117x + 117x +
      invisible(NULL)
@@ -15382,28 +15994,32 @@

teal.slice coverage - 65.86%

325 - 117x + 117x +
      xl <- xl[!is.na(xl)]
326 - 117x + 117x +
      xl <- xl[is.finite(xl)]
327 - 117x + 117x +
      private$is_choice_limited <- (any(xl < choices[1L]) | any(xl > choices[2L]))
328 - 117x + 117x +
      invisible(NULL)
@@ -15445,14 +16061,16 @@

teal.slice coverage - 65.86%

334 - 34x + 34x +
      if (isTRUE(private$get_keep_inf())) {
335 - 2x + 2x +
        call("|", call("is.infinite", varname), filter_call)
@@ -15466,7 +16084,8 @@

teal.slice coverage - 65.86%

337 - 32x + 32x +
        filter_call
@@ -15529,14 +16148,16 @@

teal.slice coverage - 65.86%

346 - 117x + 117x +
      if (private$is_integer && diff(range(pretty_range) > 2)) {
347 - 46x + 46x +
        return(1L)
@@ -15550,14 +16171,16 @@

teal.slice coverage - 65.86%

349 - 71x + 71x +
        n_steps <- length(pretty_range) - 1
350 - 71x + 71x +
        return(signif(digits = 10, (max(pretty_range) - min(pretty_range)) / n_steps))
@@ -15585,35 +16208,40 @@

teal.slice coverage - 65.86%

354 - 133x + 133x +
      tryCatch(
355 - 133x + 133x +
        expr = {
356 - 133x + 133x +
          values <- as.numeric(values)
357 - 4x + 4x +
          if (anyNA(values)) stop()
358 - 129x + 129x +
          values
@@ -15627,7 +16255,8 @@

teal.slice coverage - 65.86%

360 - 133x + 133x +
        error = function(e) stop("Vector of set values must contain values coercible to numeric")
@@ -15662,21 +16291,24 @@

teal.slice coverage - 65.86%

365 - 2x + 2x +
      if (length(values) != 2L) stop("Vector of set values must have length two.")
366 - 2x + 2x +
      if (values[1L] > values[2L]) stop("Vector of set values must be sorted.")
367 - 125x + 125x +
      values
@@ -15704,21 +16336,24 @@

teal.slice coverage - 65.86%

371 - 2x + 2x +
      if (values[1L] < private$get_choices()[1L]) values[1L] <- private$get_choices()[1L]
372 - 2x + 2x +
      if (values[2L] > private$get_choices()[2L]) values[2L] <- private$get_choices()[2L]
373 - 125x + 125x +
      values
@@ -15760,35 +16395,40 @@

teal.slice coverage - 65.86%

379 - 35x + 35x +
      if (private$is_choice_limited) {
380 - 1x + 1x +
        TRUE
381 - 34x + 34x +
      } else if (!isTRUE(all.equal(private$get_selected(), private$get_choices()))) {
382 - 32x + 32x +
        TRUE
383 - 2x + 2x +
      } else if (!isTRUE(private$get_keep_inf()) && private$inf_count > 0) {
@@ -15802,14 +16442,16 @@

teal.slice coverage - 65.86%

385 - 2x + 2x +
      } else if (!isTRUE(private$get_keep_na()) && private$na_count > 0) {
386 - 1x + 1x +
        TRUE
@@ -15823,7 +16465,8 @@

teal.slice coverage - 65.86%

388 - 1x + 1x +
        FALSE
@@ -15872,21 +16515,24 @@

teal.slice coverage - 65.86%

395 - 5x + 5x +
      list(
396 - 5x + 5x +
        list(type = "line", x0 = values[1], x1 = values[1], y0 = -100, y1 = 100, yref = "paper"),
397 - 5x + 5x +
        list(type = "line", x0 = values[2], x1 = values[2], y0 = -100, y1 = 100, yref = "paper")
@@ -15963,70 +16609,80 @@

teal.slice coverage - 65.86%

408 - 5x + 5x +
      ns <- NS(id)
409 - 5x + 5x +
      isolate({
410 - 5x + 5x +
        ui_input <- shinyWidgets::numericRangeInput(
411 - 5x + 5x +
          inputId = ns("selection_manual"),
412 - 5x + 5x +
          label = NULL,
413 - 5x + 5x +
          min = private$get_choices()[1L],
414 - 5x + 5x +
          max = private$get_choices()[2L],
415 - 5x + 5x +
          value = private$get_selected(),
416 - 5x + 5x +
          step = private$numeric_step,
417 - 5x + 5x +
          width = "100%"
@@ -16040,28 +16696,32 @@

teal.slice coverage - 65.86%

419 - 5x + 5x +
        tagList(
420 - 5x + 5x +
          tags$div(
421 - 5x + 5x +
            class = "choices_state",
422 - 5x + 5x +
            tags$head(tags$script(
@@ -16089,21 +16749,24 @@

teal.slice coverage - 65.86%

426 - 5x + 5x +
              HTML(
427 - 5x + 5x +
                '$(document).ready(function() {
428 - 5x + 5x +
                  $("[data-toggle=\'popover\']").popover();
@@ -16117,35 +16780,40 @@

teal.slice coverage - 65.86%

430 - 5x + 5x +
                  $(document).on("click", function (e) {
431 - 5x + 5x +
                    if (!$("[data-toggle=\'popover\']").is(e.target) &&
432 - 5x + 5x +
                        $("[data-toggle=\'popover\']").has(e.target).length === 0 &&
433 - 5x + 5x +
                        $(".popover").has(e.target).length === 0) {
434 - 5x + 5x +
                      $("[data-toggle=\'popover\']").popover("hide");
@@ -16187,105 +16855,120 @@

teal.slice coverage - 65.86%

440 - 5x + 5x +
            tags$div(
441 - 5x + 5x +
              actionLink(
442 - 5x + 5x +
                ns("plotly_info"),
443 - 5x + 5x +
                label = NULL,
444 - 5x + 5x +
                icon = icon("question-circle"),
445 - 5x + 5x +
                "data-toggle" = "popover",
446 - 5x + 5x +
                "data-html" = "true",
447 - 5x + 5x +
                "data-placement" = "left",
448 - 5x + 5x +
                "data-trigger" = "click",
449 - 5x + 5x +
                "data-title" = "Plot actions",
450 - 5x + 5x +
                "data-content" = "<p>
451 - 5x + 5x +
                                  Drag vertical lines to set selection.<br>
452 - 5x + 5x +
                                  Drag across plot to zoom in.<br>
453 - 5x + 5x +
                                  Drag axis to pan.<br>
454 - 5x + 5x +
                                  Double click to zoom out."
@@ -16299,7 +16982,8 @@

teal.slice coverage - 65.86%

456 - 5x + 5x +
              style = "text-align: right; font-size: 0.7em; margin-bottom: -1em; position: relative; z-index: 9;"
@@ -16313,35 +16997,40 @@

teal.slice coverage - 65.86%

458 - 5x + 5x +
            shinycssloaders::withSpinner(
459 - 5x + 5x +
              plotly::plotlyOutput(ns("plot"), height = "50px"),
460 - 5x + 5x +
              type = 4,
461 - 5x + 5x +
              size = 0.25,
462 - 5x + 5x +
              hide.ui = FALSE
@@ -16355,7 +17044,8 @@

teal.slice coverage - 65.86%

464 - 5x + 5x +
            ui_input
@@ -16369,28 +17059,32 @@

teal.slice coverage - 65.86%

466 - 5x + 5x +
          tags$div(
467 - 5x + 5x +
            class = "filter-card-body-keep-na-inf",
468 - 5x + 5x +
            private$keep_inf_ui(ns("keep_inf")),
469 - 5x + 5x +
            private$keep_na_ui(ns("keep_na"))
@@ -16467,28 +17161,32 @@

teal.slice coverage - 65.86%

480 - 5x + 5x +
      moduleServer(
481 - 5x + 5x +
        id = id,
482 - 5x + 5x +
        function(input, output, session) {
483 - 5x + 5x +
          logger::log_trace("RangeFilterState$server initializing, id: { private$get_id() }")
@@ -16509,7 +17207,8 @@

teal.slice coverage - 65.86%

486 - 5x + 5x +
          selection_manual <- debounce(reactive(input$selection_manual), 200)
@@ -16530,7 +17229,8 @@

teal.slice coverage - 65.86%

489 - 5x + 5x +
          plot_data <- c(private$plot_data, source = session$ns("histogram_plot"))
@@ -16551,42 +17251,48 @@

teal.slice coverage - 65.86%

492 - 5x + 5x +
          output$plot <- plotly::renderPlotly({
493 - 5x + 5x +
            histogram <- do.call(plotly::plot_ly, plot_data)
494 - 5x + 5x +
            histogram <- do.call(plotly::layout, c(list(p = histogram), private$plot_layout()))
495 - 5x + 5x +
            histogram <- do.call(plotly::config, c(list(p = histogram), private$plot_config()))
496 - 5x + 5x +
            histogram <- do.call(plotly::add_histogram, c(list(p = histogram), private$plot_filtered()))
497 - 5x + 5x +
            histogram
@@ -16614,63 +17320,72 @@

teal.slice coverage - 65.86%

501 - 5x + 5x +
          private$observers$relayout <-
502 - 5x + 5x +
            observeEvent(
503 - 5x + 5x +
              ignoreNULL = FALSE,
504 - 5x + 5x +
              ignoreInit = TRUE,
505 - 5x + 5x +
              eventExpr = plotly::event_data("plotly_relayout", source = session$ns("histogram_plot")),
506 - 5x + 5x +
              handlerExpr = {
507 - 1x + 1x +
                logger::log_trace("RangeFilterState$server@1 selection changed, id: { private$get_id() }")
508 - 1x + 1x +
                event <- plotly::event_data("plotly_relayout", source = session$ns("histogram_plot"))
509 - 1x + 1x +
                if (any(grepl("shapes", names(event)))) {
@@ -16859,42 +17574,48 @@

teal.slice coverage - 65.86%

536 - 5x + 5x +
          private$observers$selection_api <-
537 - 5x + 5x +
            observeEvent(
538 - 5x + 5x +
              ignoreNULL = FALSE,
539 - 5x + 5x +
              ignoreInit = TRUE,
540 - 5x + 5x +
              eventExpr = private$get_selected(),
541 - 5x + 5x +
              handlerExpr = {
@@ -16985,35 +17706,40 @@

teal.slice coverage - 65.86%

554 - 5x + 5x +
          private$observers$selection_manual <- observeEvent(
555 - 5x + 5x +
            ignoreNULL = FALSE,
556 - 5x + 5x +
            ignoreInit = TRUE,
557 - 5x + 5x +
            eventExpr = selection_manual(),
558 - 5x + 5x +
            handlerExpr = {
@@ -17279,14 +18005,16 @@

teal.slice coverage - 65.86%

596 - 5x + 5x +
          private$keep_inf_srv("keep_inf")
597 - 5x + 5x +
          private$keep_na_srv("keep_na")
@@ -17300,14 +18028,16 @@

teal.slice coverage - 65.86%

599 - 5x + 5x +
          logger::log_trace("RangeFilterState$server initialized, id: { private$get_id() }")
600 - 5x + 5x +
          NULL
@@ -17594,42 +18324,48 @@

teal.slice coverage - 65.86%

641 - 5x + 5x +
      selection <- private$get_selected()
642 - 5x + 5x +
      tagList(
643 - 5x + 5x +
        tags$span(HTML(selection[1], "&ndash;", selection[2]), class = "filter-card-summary-value"),
644 - 5x + 5x +
        tags$span(
645 - 5x + 5x +
          class = "filter-card-summary-controls",
646 - 5x + 5x +
          if (private$na_count > 0) {
@@ -17650,7 +18386,8 @@

teal.slice coverage - 65.86%

649 - 5x + 5x +
          if (private$inf_count > 0) {
@@ -17734,7 +18471,8 @@

teal.slice coverage - 65.86%

661 - 5x + 5x +
      ns <- NS(id)
@@ -17748,7 +18486,8 @@

teal.slice coverage - 65.86%

663 - 5x + 5x +
      if (private$inf_count > 0) {
@@ -17888,7 +18627,8 @@

teal.slice coverage - 65.86%

683 - 5x + 5x +
        NULL
@@ -17965,7 +18705,8 @@

teal.slice coverage - 65.86%

694 - 5x + 5x +
      moduleServer(id, function(input, output, session) {
@@ -18000,42 +18741,48 @@

teal.slice coverage - 65.86%

699 - 5x + 5x +
        output$trigger_visible <- renderUI({
700 - 5x + 5x +
          updateCountText(
701 - 5x + 5x +
            inputId = "count_label",
702 - 5x + 5x +
            label = "Keep Inf",
703 - 5x + 5x +
            countmax = private$inf_count,
704 - 5x + 5x +
            countnow = private$inf_filtered_count()
@@ -18049,7 +18796,8 @@

teal.slice coverage - 65.86%

706 - 5x + 5x +
          NULL
@@ -18091,35 +18839,40 @@

teal.slice coverage - 65.86%

712 - 5x + 5x +
        private$observers$keep_inf_api <- observeEvent(
713 - 5x + 5x +
          ignoreNULL = TRUE, # its not possible for range that NULL is selected
714 - 5x + 5x +
          ignoreInit = TRUE, # ignoreInit: should not matter because we set the UI with the desired initial state
715 - 5x + 5x +
          eventExpr = private$get_keep_inf(),
716 - 5x + 5x +
          handlerExpr = {
@@ -18196,35 +18949,40 @@

teal.slice coverage - 65.86%

727 - 5x + 5x +
        private$observers$keep_inf <- observeEvent(
728 - 5x + 5x +
          ignoreNULL = TRUE, # it's not possible for range that NULL is selected
729 - 5x + 5x +
          ignoreInit = TRUE, # ignoreInit: should not matter because we set the UI with the desired initial state
730 - 5x + 5x +
          eventExpr = input$value,
731 - 5x + 5x +
          handlerExpr = {
@@ -18273,7 +19031,8 @@

teal.slice coverage - 65.86%

738 - 5x + 5x +
        invisible(NULL)
@@ -18538,7 +19297,8 @@

teal.slice coverage - 65.86%

33 - 153x + 153x +
      logger::log_trace("Instantiating { class(self)[1] }, dataname: { dataname }")
@@ -18559,21 +19319,24 @@

teal.slice coverage - 65.86%

36 - 153x + 153x +
      check_simple_name(dataname)
37 - 151x + 151x +
      checkmate::assert_character(keys, any.missing = FALSE)
38 - 151x + 151x +
      checkmate::assert_character(label, null.ok = TRUE)
@@ -18587,35 +19350,40 @@

teal.slice coverage - 65.86%

40 - 151x + 151x +
      logger::log_trace("Instantiating { class(self)[1] }, dataname: { dataname }")
41 - 151x + 151x +
      private$dataset <- dataset
42 - 151x + 151x +
      private$dataname <- dataname
43 - 151x + 151x +
      private$keys <- keys
44 - 151x + 151x +
      private$label <- if (is.null(label)) character(0) else label
@@ -18636,28 +19404,32 @@

teal.slice coverage - 65.86%

47 - 151x + 151x +
      private$data_filtered_fun <- function(sid = "") {
48 - 24x + 24x +
        checkmate::assert_character(sid)
49 - 24x + 24x +
        if (length(sid)) {
50 - 24x + 24x +
          logger::log_trace("filtering data dataname: { dataname }, sid: { sid }")
@@ -18685,35 +19457,40 @@

teal.slice coverage - 65.86%

54 - 24x + 24x +
        env <- new.env(parent = parent.env(globalenv()))
55 - 24x + 24x +
        env[[dataname]] <- private$dataset
56 - 24x + 24x +
        filter_call <- self$get_call(sid)
57 - 24x + 24x +
        eval_expr_with_msg(filter_call, env)
58 - 24x + 24x +
        get(x = dataname, envir = env)
@@ -18734,21 +19511,24 @@

teal.slice coverage - 65.86%

61 - 151x + 151x +
      private$data_filtered <- reactive(private$data_filtered_fun())
62 - 151x + 151x +
      logger::log_trace("Instantiated { class(self)[1] }, dataname: { private$dataname }")
63 - 151x + 151x +
      invisible(self)
@@ -18832,28 +19612,32 @@

teal.slice coverage - 65.86%

75 - 24x + 24x +
      sprintf(
76 - 24x + 24x +
        "%s:\n%s",
77 - 24x + 24x +
        class(self)[1],
78 - 24x + 24x +
        format(self$get_filter_state(), show_all = show_all, trim_lines = trim_lines)
@@ -18923,7 +19707,8 @@

teal.slice coverage - 65.86%

88 - 10x + 10x +
      cat(isolate(self$format(...)), "\n")
@@ -19000,28 +19785,32 @@

teal.slice coverage - 65.86%

99 - 14x + 14x +
      logger::log_trace("Removing filters from FilteredDataset: { deparse1(self$get_dataname()) }")
100 - 14x + 14x +
      lapply(
101 - 14x + 14x +
        private$get_filter_states(),
102 - 14x + 14x +
        function(filter_states) filter_states$clear_filter_states(force)
@@ -19035,14 +19824,16 @@

teal.slice coverage - 65.86%

104 - 14x + 14x +
      logger::log_trace("Removed filters from FilteredDataset: { deparse1(self$get_dataname()) }")
105 - 14x + 14x +
      NULL
@@ -19175,21 +19966,24 @@

teal.slice coverage - 65.86%

124 - 47x + 47x +
      filter_call <- Filter(
125 - 47x + 47x +
        f = Negate(is.null),
126 - 47x + 47x +
        x = lapply(private$get_filter_states(), function(x) x$get_call(sid))
@@ -19203,14 +19997,16 @@

teal.slice coverage - 65.86%

128 - 47x + 47x +
      if (length(filter_call) == 0) {
129 - 29x + 29x +
        return(NULL)
@@ -19224,7 +20020,8 @@

teal.slice coverage - 65.86%

131 - 18x + 18x +
      filter_call
@@ -19287,14 +20084,16 @@

teal.slice coverage - 65.86%

140 - 184x + 184x +
      states <- unname(lapply(private$get_filter_states(), function(x) x$get_filter_state()))
141 - 184x + 184x +
      do.call(c, states)
@@ -19420,7 +20219,8 @@

teal.slice coverage - 65.86%

159 - 16x + 16x +
      length(self$get_filter_state())
@@ -19476,7 +20276,8 @@

teal.slice coverage - 65.86%

167 - 8x + 8x +
      private$dataname
@@ -19567,14 +20368,16 @@

teal.slice coverage - 65.86%

180 - 51x + 51x +
      if (filtered) {
181 - 33x + 33x +
        private$data_filtered
@@ -19588,7 +20391,8 @@

teal.slice coverage - 65.86%

183 - 18x + 18x +
        private$dataset
@@ -19693,7 +20497,8 @@

teal.slice coverage - 65.86%

198 - 133x + 133x +
      private$keys
@@ -19742,7 +20547,8 @@

teal.slice coverage - 65.86%

205 - 2x + 2x +
      private$label
@@ -20288,77 +21094,88 @@

teal.slice coverage - 65.86%

283 - 7x + 7x +
      moduleServer(
284 - 7x + 7x +
        id = id,
285 - 7x + 7x +
        function(input, output, session) {
286 - 7x + 7x +
          dataname <- self$get_dataname()
287 - 7x + 7x +
          logger::log_trace("FilteredDataset$srv_active initializing, dataname: { dataname }")
288 - 7x + 7x +
          checkmate::assert_string(dataname)
289 - 7x + 7x +
          output$filter_count <- renderText(
290 - 7x + 7x +
            sprintf(
291 - 7x + 7x +
              "%d filter%s applied",
292 - 7x + 7x +
              self$get_filter_count(),
293 - 7x + 7x +
              if (self$get_filter_count() != 1) "s" else ""
@@ -20386,28 +21203,32 @@

teal.slice coverage - 65.86%

297 - 7x + 7x +
          lapply(
298 - 7x + 7x +
            names(private$get_filter_states()),
299 - 7x + 7x +
            function(x) {
300 - 12x + 12x +
              private$get_filter_states()[[x]]$srv_active(id = x)
@@ -20435,35 +21256,40 @@

teal.slice coverage - 65.86%

304 - 7x + 7x +
          observeEvent(self$get_filter_state(), {
305 - 8x + 8x +
            shinyjs::hide("filter_count_ui")
306 - 8x + 8x +
            shinyjs::show("filters")
307 - 8x + 8x +
            shinyjs::toggle("remove_filters", condition = length(self$get_filter_state()) != 0)
308 - 8x + 8x +
            shinyjs::toggle("collapse", condition = length(self$get_filter_state()) != 0)
@@ -20484,7 +21310,8 @@

teal.slice coverage - 65.86%

311 - 7x + 7x +
          observeEvent(input$collapse, {
@@ -20526,28 +21353,32 @@

teal.slice coverage - 65.86%

317 - 7x + 7x +
          observeEvent(input$remove_filters, {
318 - 1x + 1x +
            logger::log_trace("FilteredDataset$srv_active@1 removing all non-anchored filters, dataname: { dataname }")
319 - 1x + 1x +
            self$clear_filter_states()
320 - 1x + 1x +
            logger::log_trace("FilteredDataset$srv_active@1 removed all non-anchored filters, dataname: { dataname }")
@@ -20568,7 +21399,8 @@

teal.slice coverage - 65.86%

323 - 7x + 7x +
          logger::log_trace("FilteredDataset$initialized, dataname: { dataname }")
@@ -20582,7 +21414,8 @@

teal.slice coverage - 65.86%

325 - 7x + 7x +
          NULL
@@ -20673,7 +21506,8 @@

teal.slice coverage - 65.86%

338 - 1x + 1x +
      stop("Pure virtual method")
@@ -20771,63 +21605,72 @@

teal.slice coverage - 65.86%

352 - 2x + 2x +
      moduleServer(
353 - 2x + 2x +
        id = id,
354 - 2x + 2x +
        function(input, output, session) {
355 - 2x + 2x +
          logger::log_trace("MAEFilteredDataset$srv_add initializing, dataname: { deparse1(self$get_dataname()) }")
356 - 2x + 2x +
          elems <- private$get_filter_states()
357 - 2x + 2x +
          elem_names <- names(private$get_filter_states())
358 - 2x + 2x +
          lapply(
359 - 2x + 2x +
            elem_names,
360 - 2x + 2x +
            function(elem_name) elems[[elem_name]]$srv_add(elem_name)
@@ -20841,14 +21684,16 @@

teal.slice coverage - 65.86%

362 - 2x + 2x +
          logger::log_trace("MAEFilteredDataset$srv_add initialized, dataname: { deparse1(self$get_dataname()) }")
363 - 2x + 2x +
          NULL
@@ -20988,28 +21833,32 @@

teal.slice coverage - 65.86%

383 - 225x + 225x +
      checkmate::assert_class(filter_states, "FilterStates")
384 - 225x + 225x +
      checkmate::assert_string(id)
385 - 225x + 225x +
      x <- stats::setNames(list(filter_states), id)
386 - 225x + 225x +
      private$filter_states <- c(private$get_filter_states(), x)
@@ -21058,7 +21907,8 @@

teal.slice coverage - 65.86%

393 - 684x + 684x +
      private$filter_states
@@ -21953,21 +22803,24 @@

teal.slice coverage - 65.86%

124 - 583x + 583x +
  checkmate::assert_string(dataname)
125 - 576x + 576x +
  checkmate::assert_flag(fixed)
126 - 574x + 574x +
  checkmate::assert_flag(anchored)
@@ -21981,7 +22834,8 @@

teal.slice coverage - 65.86%

128 - 572x + 572x +
  formal_args <- as.list(environment())
@@ -21995,7 +22849,8 @@

teal.slice coverage - 65.86%

130 - 572x + 572x +
  if (!missing(expr) && !missing(varname)) {
@@ -22009,28 +22864,32 @@

teal.slice coverage - 65.86%

132 - 572x + 572x +
  } else if (!missing(expr)) {
133 - 30x + 30x +
    checkmate::assert_string(id)
134 - 27x + 27x +
    checkmate::assert_string(title)
135 - 24x + 24x +
    checkmate::assert_string(expr)
@@ -22044,84 +22903,96 @@

teal.slice coverage - 65.86%

137 - 23x + 23x +
    formal_args$fixed <- TRUE
138 - 23x + 23x +
    ts_expr_args <- c("dataname", "id", "expr", "fixed", "anchored", "title")
139 - 23x + 23x +
    formal_args <- formal_args[ts_expr_args]
140 - 23x + 23x +
    ans <- do.call(reactiveValues, c(formal_args, list(...)))
141 - 23x + 23x +
    class(ans) <- c("teal_slice_expr", "teal_slice", class(ans))
142 - 542x + 542x +
  } else if (!missing(varname)) {
143 - 541x + 541x +
    checkmate::assert_string(varname)
144 - 538x + 538x +
    checkmate::assert_multi_class(choices, .filterable_class, null.ok = TRUE)
145 - 537x + 537x +
    checkmate::assert_multi_class(selected, .filterable_class, null.ok = TRUE)
146 - 535x + 535x +
    checkmate::assert_flag(keep_na, null.ok = TRUE)
147 - 534x + 534x +
    checkmate::assert_flag(keep_inf, null.ok = TRUE)
148 - 533x + 533x +
    checkmate::assert_flag(multiple)
@@ -22135,21 +23006,24 @@

teal.slice coverage - 65.86%

150 - 533x + 533x +
    ts_var_args <- c(
151 - 533x + 533x +
      "dataname", "varname", "id", "choices", "selected", "keep_na", "keep_inf",
152 - 533x + 533x +
      "fixed", "anchored", "multiple"
@@ -22163,42 +23037,48 @@

teal.slice coverage - 65.86%

154 - 533x + 533x +
    formal_args <- formal_args[ts_var_args]
155 - 533x + 533x +
    args <- c(formal_args, list(...))
156 - 533x + 533x +
    args[c("choices", "selected")] <-
157 - 533x + 533x +
      lapply(args[c("choices", "selected")], function(x) if (is.factor(x)) as.character(x) else x)
158 - 533x + 533x +
    if (missing(id)) {
159 - 524x + 524x +
      args$id <- get_default_slice_id(args)
@@ -22212,7 +23092,8 @@

teal.slice coverage - 65.86%

161 - 9x + 9x +
      checkmate::assert_string(id)
@@ -22226,14 +23107,16 @@

teal.slice coverage - 65.86%

163 - 530x + 530x +
    ans <- do.call(reactiveValues, args)
164 - 530x + 530x +
    class(ans) <- c("teal_slice_var", "teal_slice", class(ans))
@@ -22247,7 +23130,8 @@

teal.slice coverage - 65.86%

166 - 1x + 1x +
    stop("Must provide either `expr` or `varname`.")
@@ -22268,7 +23152,8 @@

teal.slice coverage - 65.86%

169 - 553x + 553x +
  ans
@@ -22401,7 +23286,8 @@

teal.slice coverage - 65.86%

188 - 4x + 4x +
  inherits(x, "teal_slice")
@@ -22506,7 +23392,8 @@

teal.slice coverage - 65.86%

203 - 283x + 283x +
  formal_args <- setdiff(names(formals(teal_slice)), "...")
@@ -22520,7 +23407,8 @@

teal.slice coverage - 65.86%

205 - 283x + 283x +
  x <- if (isRunning()) {
@@ -22541,7 +23429,8 @@

teal.slice coverage - 65.86%

208 - 283x + 283x +
    isolate(reactiveValuesToList(x))
@@ -22562,14 +23451,16 @@

teal.slice coverage - 65.86%

211 - 283x + 283x +
  formal_args <- intersect(formal_args, names(x))
212 - 283x + 283x +
  extra_args <- rev(setdiff(names(x), formal_args))
@@ -22583,7 +23474,8 @@

teal.slice coverage - 65.86%

214 - 283x + 283x +
  x[c(formal_args, extra_args)]
@@ -22639,14 +23531,16 @@

teal.slice coverage - 65.86%

222 - 116x + 116x +
  checkmate::assert_flag(show_all)
223 - 92x + 92x +
  checkmate::assert_flag(trim_lines)
@@ -22660,14 +23554,16 @@

teal.slice coverage - 65.86%

225 - 86x + 86x +
  x_list <- as.list(x)
226 - 47x + 47x +
  if (!show_all) x_list <- Filter(Negate(is.null), x_list)
@@ -22681,7 +23577,8 @@

teal.slice coverage - 65.86%

228 - 86x + 86x +
  jsonify(x_list, trim_lines)
@@ -22730,7 +23627,8 @@

teal.slice coverage - 65.86%

235 - 15x + 15x +
  cat(format(x, ...))
@@ -22856,7 +23754,8 @@

teal.slice coverage - 65.86%

253 - 131x + 131x +
  checkmate::assert_list(x)
@@ -22870,28 +23769,32 @@

teal.slice coverage - 65.86%

255 - 131x + 131x +
  x_json <- to_json(x)
256 - 131x + 131x +
  x_json_justified <- justify_json(x_json)
257 - 121x + 121x +
  if (trim_lines) x_json_justified <- trim_lines_json(x_json_justified)
258 - 131x + 131x +
  paste(x_json_justified, collapse = "\n")
@@ -22996,35 +23899,40 @@

teal.slice coverage - 65.86%

273 - 131x + 131x +
  no_unbox <- function(x) {
274 - 2390x + 2390x +
    vars <- c("selected", "choices")
275 - 2390x + 2390x +
    if (is.list(x)) {
276 - 385x + 385x +
      for (var in vars) {
277 - 307x + 307x +
        if (!is.null(x[[var]])) x[[var]] <- I(format_time(x[[var]]))
@@ -23038,7 +23946,8 @@

teal.slice coverage - 65.86%

279 - 385x + 385x +
      lapply(x, no_unbox)
@@ -23052,7 +23961,8 @@

teal.slice coverage - 65.86%

281 - 2005x + 2005x +
      x
@@ -23080,7 +23990,8 @@

teal.slice coverage - 65.86%

285 - 131x + 131x +
  jsonlite::toJSON(no_unbox(x), pretty = TRUE, auto_unbox = TRUE, digits = 16, null = "null")
@@ -23192,14 +24103,16 @@

teal.slice coverage - 65.86%

301 - 307x + 307x +
  if ("POSIXt" %in% class(x)) {
302 - 20x + 20x +
    format(x, format = "%Y-%m-%d %H:%M:%S", usetz = TRUE, tz = "UTC")
@@ -23213,7 +24126,8 @@

teal.slice coverage - 65.86%

304 - 287x + 287x +
    x
@@ -23318,35 +24232,40 @@

teal.slice coverage - 65.86%

319 - 131x + 131x +
  format_name <- function(name, name_width) {
320 - 2775x + 2775x +
    if (nchar(name) == 1 || nchar(gsub("\\s", "", name)) <= 2) {
321 - 630x + 630x +
      return(name)
322 - 2145x + 2145x +
    } else if (grepl("slices|attributes", name)) {
323 - 90x + 90x +
      paste0(name, ":")
@@ -23360,7 +24279,8 @@

teal.slice coverage - 65.86%

325 - 2055x + 2055x +
      paste(format(name, width = name_width), ":")
@@ -23381,28 +24301,32 @@

teal.slice coverage - 65.86%

328 - 131x + 131x +
  json_lines <- strsplit(json, "\n")[[1]]
329 - 131x + 131x +
  json_lines_split <- regmatches(json_lines, regexpr(":", json_lines), invert = TRUE)
330 - 131x + 131x +
  name_width <- max(unlist(regexpr(":", json_lines))) - 1
331 - 131x + 131x +
  vapply(json_lines_split, function(x) paste0(format_name(x[1], name_width), stats::na.omit(x[2])), character(1))
@@ -23507,35 +24431,40 @@

teal.slice coverage - 65.86%

346 - 121x + 121x +
  name_width <- max(unlist(gregexpr(":", x))) - 1
347 - 121x + 121x +
  trim_position <- name_width + 37L
348 - 121x + 121x +
  x_trim <- substr(x, 1, trim_position)
349 - 121x + 121x +
  substr(x_trim, trim_position - 2, trim_position) <- "..."
350 - 121x + 121x +
  x_trim
@@ -23703,28 +24632,32 @@

teal.slice coverage - 65.86%

374 - 613x + 613x +
  checkmate::assert_multi_class(x, c("teal_slice", "list"))
375 - 613x + 613x +
  isolate({
376 - 613x + 613x +
    if (inherits(x, "teal_slice_expr") || is.null(x$varname)) {
377 - 10x + 10x +
      x$id
@@ -23738,28 +24671,32 @@

teal.slice coverage - 65.86%

379 - 603x + 603x +
      paste(
380 - 603x + 603x +
        Filter(
381 - 603x + 603x +
          length,
382 - 603x + 603x +
          as.list(x)[c("dataname", "varname", "experiment", "arg")]
@@ -23773,7 +24710,8 @@

teal.slice coverage - 65.86%

384 - 603x + 603x +
        collapse = " "
@@ -24822,21 +25760,24 @@

teal.slice coverage - 65.86%

145 - 24x + 24x +
      isolate({
146 - 24x + 24x +
        checkmate::assert_date(x)
147 - 23x + 23x +
        checkmate::assert_class(x_reactive, "reactive")
@@ -24850,35 +25791,40 @@

teal.slice coverage - 65.86%

149 - 23x + 23x +
        super$initialize(
150 - 23x + 23x +
          x = x,
151 - 23x + 23x +
          x_reactive = x_reactive,
152 - 23x + 23x +
          slice = slice,
153 - 23x + 23x +
          extract_type = extract_type
@@ -24892,28 +25838,32 @@

teal.slice coverage - 65.86%

155 - 23x + 23x +
        checkmate::assert_date(slice$choices, null.ok = TRUE)
156 - 22x + 22x +
        private$set_choices(slice$choices)
157 - 14x + 14x +
        if (is.null(slice$selected)) slice$selected <- slice$choices
158 - 22x + 22x +
        private$set_selected(slice$selected)
@@ -24934,7 +25884,8 @@

teal.slice coverage - 65.86%

161 - 21x + 21x +
      invisible(self)
@@ -25011,14 +25962,16 @@

teal.slice coverage - 65.86%

172 - 7x + 7x +
      if (isFALSE(private$is_any_filtered())) {
173 - 1x + 1x +
        return(NULL)
@@ -25032,28 +25985,32 @@

teal.slice coverage - 65.86%

175 - 6x + 6x +
      choices <- as.character(private$get_selected())
176 - 6x + 6x +
      varname <- private$get_varname_prefixed(dataname)
177 - 6x + 6x +
      filter_call <-
178 - 6x + 6x +
        call(
@@ -25067,14 +26024,16 @@

teal.slice coverage - 65.86%

180 - 6x + 6x +
          call(">=", varname, call("as.Date", choices[1L])),
181 - 6x + 6x +
          call("<=", varname, call("as.Date", choices[2L]))
@@ -25088,7 +26047,8 @@

teal.slice coverage - 65.86%

183 - 6x + 6x +
      private$add_keep_na_call(filter_call, varname)
@@ -25144,14 +26104,16 @@

teal.slice coverage - 65.86%

191 - 22x + 22x +
      if (is.null(choices)) {
192 - 19x + 19x +
        choices <- range(private$x, na.rm = TRUE)
@@ -25165,21 +26127,24 @@

teal.slice coverage - 65.86%

194 - 3x + 3x +
        choices_adjusted <- c(
195 - 3x + 3x +
          max(choices[1L], min(private$x, na.rm = TRUE)),
196 - 3x + 3x +
          min(choices[2L], max(private$x, na.rm = TRUE))
@@ -25193,28 +26158,32 @@

teal.slice coverage - 65.86%

198 - 3x + 3x +
        if (any(choices != choices_adjusted)) {
199 - 1x + 1x +
          warning(sprintf(
200 - 1x + 1x +
            "Choices adjusted (some values outside of variable range). Varname: %s, dataname: %s.",
201 - 1x + 1x +
            private$get_varname(), private$get_dataname()
@@ -25228,7 +26197,8 @@

teal.slice coverage - 65.86%

203 - 1x + 1x +
          choices <- choices_adjusted
@@ -25242,35 +26212,40 @@

teal.slice coverage - 65.86%

205 - 3x + 3x +
        if (choices[1L] >= choices[2L]) {
206 - 1x + 1x +
          warning(sprintf(
207 - 1x + 1x +
            "Invalid choices: lower is higher / equal to upper, or not in range of variable values.
208 - 1x + 1x +
            Setting defaults. Varname: %s, dataname: %s.",
209 - 1x + 1x +
            private$get_varname(), private$get_dataname()
@@ -25284,7 +26259,8 @@

teal.slice coverage - 65.86%

211 - 1x + 1x +
          choices <- range(private$x, na.rm = TRUE)
@@ -25305,28 +26281,32 @@

teal.slice coverage - 65.86%

214 - 22x + 22x +
      private$set_is_choice_limited(private$x, choices)
215 - 22x + 22x +
      private$x <- private$x[(private$x >= choices[1L] & private$x <= choices[2L]) | is.na(private$x)]
216 - 22x + 22x +
      private$teal_slice$choices <- choices
217 - 22x + 22x +
      invisible(NULL)
@@ -25368,14 +26348,16 @@

teal.slice coverage - 65.86%

223 - 22x + 22x +
      private$is_choice_limited <- (any(xl < choices[1L], na.rm = TRUE) | any(xl > choices[2L], na.rm = TRUE))
224 - 22x + 22x +
      invisible(NULL)
@@ -25396,21 +26378,24 @@

teal.slice coverage - 65.86%

227 - 33x + 33x +
      tryCatch(
228 - 33x + 33x +
        expr = {
229 - 33x + 33x +
          values <- as.Date(values, origin = "1970-01-01")
@@ -25424,7 +26409,8 @@

teal.slice coverage - 65.86%

231 - 30x + 30x +
          values
@@ -25438,7 +26424,8 @@

teal.slice coverage - 65.86%

233 - 33x + 33x +
        error = function(e) stop("Vector of set values must contain values coercible to Date.")
@@ -25466,42 +26453,48 @@

teal.slice coverage - 65.86%

237 - 1x + 1x +
      if (length(values) != 2) stop("Vector of set values must have length two.")
238 - 29x + 29x +
      if (values[1] > values[2]) {
239 - 1x + 1x +
        warning(
240 - 1x + 1x +
          sprintf(
241 - 1x + 1x +
            "Start date %s is set after the end date %s, the values will be replaced with a default date range.",
242 - 1x + 1x +
            values[1], values[2]
@@ -25522,7 +26515,8 @@

teal.slice coverage - 65.86%

245 - 1x + 1x +
        values <- isolate(private$get_choices())
@@ -25536,7 +26530,8 @@

teal.slice coverage - 65.86%

247 - 29x + 29x +
      values
@@ -25557,42 +26552,48 @@

teal.slice coverage - 65.86%

250 - 29x + 29x +
      choices <- private$get_choices()
251 - 29x + 29x +
      if (values[1] < choices[1L] | values[1] > choices[2L]) {
252 - 5x + 5x +
        warning(
253 - 5x + 5x +
          sprintf(
254 - 5x + 5x +
            "Value: %s is outside of the possible range for column %s of dataset %s, setting minimum possible value.",
255 - 5x + 5x +
            values[1], private$get_varname(), private$get_dataname()
@@ -25613,7 +26614,8 @@

teal.slice coverage - 65.86%

258 - 5x + 5x +
        values[1] <- choices[1L]
@@ -25634,35 +26636,40 @@

teal.slice coverage - 65.86%

261 - 29x + 29x +
      if (values[2] > choices[2L] | values[2] < choices[1L]) {
262 - 5x + 5x +
        warning(
263 - 5x + 5x +
          sprintf(
264 - 5x + 5x +
            "Value: %s is outside of the possible range for column %s of dataset %s, setting maximum possible value.",
265 - 5x + 5x +
            values[2], private$get_varname(), private$get_dataname()
@@ -25683,7 +26690,8 @@

teal.slice coverage - 65.86%

268 - 5x + 5x +
        values[2] <- choices[2L]
@@ -25704,7 +26712,8 @@

teal.slice coverage - 65.86%

271 - 29x + 29x +
      values
@@ -27040,21 +28049,24 @@

teal.slice coverage - 65.86%

18 - 7x + 7x +
  checkmate::assert_list(x, any.missing = FALSE, names = "unique")
19 - 6x + 6x +
  checkmate::assert_class(join_keys, "join_keys")
20 - 5x + 5x +
  if (!missing(code)) {
@@ -27096,7 +28108,8 @@

teal.slice coverage - 65.86%

26 - 5x + 5x +
  if (!missing(check)) {
@@ -27138,7 +28151,8 @@

teal.slice coverage - 65.86%

32 - 5x + 5x +
  FilteredData$new(x, join_keys = join_keys)
@@ -27236,42 +28250,48 @@

teal.slice coverage - 65.86%

46 - 32x + 32x +
  lapply(
47 - 32x + 32x +
    expr,
48 - 32x + 32x +
    function(x) {
49 - 19x + 19x +
      tryCatch(
50 - 19x + 19x +
        eval(x, envir = env),
51 - 19x + 19x +
        error = function(e) {
@@ -27348,7 +28368,8 @@

teal.slice coverage - 65.86%

62 - 32x + 32x +
  invisible(NULL)
@@ -27908,21 +28929,24 @@

teal.slice coverage - 65.86%

142 - 3x + 3x +
  checkmate::assert_string(input_id)
143 - 3x + 3x +
  checkmate::assert_character(icons, len = 2L)
144 - 3x + 3x +
  checkmate::assert_flag(one_way)
@@ -27936,35 +28960,40 @@

teal.slice coverage - 65.86%

146 - 3x + 3x +
  expr <-
147 - 3x + 3x +
    if (one_way) {
148 - 3x + 3x +
      sprintf(
149 - 3x + 3x +
        "$('#%s i').removeClass('%s').addClass('%s');",
150 - 3x + 3x +
        input_id, icons[1], icons[2]
@@ -28006,7 +29035,8 @@

teal.slice coverage - 65.86%

156 - 3x + 3x +
  shinyjs::runjs(expr)
@@ -28020,7 +29050,8 @@

teal.slice coverage - 65.86%

158 - 3x + 3x +
  invisible(NULL)
@@ -28062,21 +29093,24 @@

teal.slice coverage - 65.86%

164 - 3x + 3x +
  checkmate::assert_string(input_id)
165 - 3x + 3x +
  checkmate::assert_character(titles, len = 2L)
166 - 3x + 3x +
  checkmate::assert_flag(one_way)
@@ -28090,35 +29124,40 @@

teal.slice coverage - 65.86%

168 - 3x + 3x +
  expr <-
169 - 3x + 3x +
    if (one_way) {
170 - 3x + 3x +
      sprintf(
171 - 3x + 3x +
        "$('a#%s').attr('title', '%s');",
172 - 3x + 3x +
        input_id, titles[2]
@@ -28223,7 +29262,8 @@

teal.slice coverage - 65.86%

187 - 3x + 3x +
  shinyjs::runjs(expr)
@@ -28237,7 +29277,8 @@

teal.slice coverage - 65.86%

189 - 3x + 3x +
  invisible(NULL)
@@ -28328,7 +29369,8 @@

teal.slice coverage - 65.86%

202 - 66x + 66x +
  utils::getFromNamespace("topological_sort", ns = "teal.data")(graph)
@@ -28803,35 +29845,40 @@

teal.slice coverage - 65.86%

66 - 195x + 195x +
  checkmate::assert_class(x_reactive, "reactive")
67 - 194x + 194x +
  checkmate::assert_character(extract_type, max.len = 1, any.missing = FALSE)
68 - 194x + 194x +
  checkmate::assert_class(slice, "teal_slice")
69 - 193x + 193x +
  if (length(extract_type) == 1) {
70 - 43x + 43x +
    checkmate::assert_choice(extract_type, choices = c("list", "matrix"))
@@ -28852,42 +29899,48 @@

teal.slice coverage - 65.86%

73 - 192x + 192x +
  if (all(is.na(x))) {
74 - 1x + 1x +
    EmptyFilterState$new(
75 - 1x + 1x +
      x = x,
76 - 1x + 1x +
      x_reactive = x_reactive,
77 - 1x + 1x +
      slice = slice,
78 - 1x + 1x +
      extract_type = extract_type
@@ -28908,7 +29961,8 @@

teal.slice coverage - 65.86%

81 - 191x + 191x +
    UseMethod("init_filter_state")
@@ -28978,35 +30032,40 @@

teal.slice coverage - 65.86%

91 - 1x + 1x +
  args <- list(
92 - 1x + 1x +
    x = x,
93 - 1x + 1x +
    x_reactive = x_reactive,
94 - 1x + 1x +
    extract_type = extract_type,
95 - 1x + 1x +
    slice
@@ -29027,7 +30086,8 @@

teal.slice coverage - 65.86%

98 - 1x + 1x +
  do.call(FilterState$new, args)
@@ -29090,35 +30150,40 @@

teal.slice coverage - 65.86%

107 - 1x + 1x +
  LogicalFilterState$new(
108 - 1x + 1x +
    x = x,
109 - 1x + 1x +
    x_reactive = x_reactive,
110 - 1x + 1x +
    slice = slice,
111 - 1x + 1x +
    extract_type = extract_type
@@ -29188,35 +30253,40 @@

teal.slice coverage - 65.86%

121 - 120x + 120x +
  args <- list(
122 - 120x + 120x +
    x = x,
123 - 120x + 120x +
    x_reactive = x_reactive,
124 - 120x + 120x +
    slice = slice,
125 - 120x + 120x +
    extract_type = extract_type
@@ -29237,14 +30307,16 @@

teal.slice coverage - 65.86%

128 - 120x + 120x +
  if (length(unique(x[!is.na(x)])) < getOption("teal.threshold_slider_vs_checkboxgroup")) {
129 - 28x + 28x +
    do.call(ChoicesFilterState$new, args)
@@ -29258,7 +30330,8 @@

teal.slice coverage - 65.86%

131 - 92x + 92x +
    do.call(RangeFilterState$new, args)
@@ -29328,35 +30401,40 @@

teal.slice coverage - 65.86%

141 - 31x + 31x +
  ChoicesFilterState$new(
142 - 31x + 31x +
    x = x,
143 - 31x + 31x +
    x_reactive = x_reactive,
144 - 31x + 31x +
    slice = slice,
145 - 31x + 31x +
    extract_type = extract_type
@@ -29426,35 +30504,40 @@

teal.slice coverage - 65.86%

155 - 32x + 32x +
  ChoicesFilterState$new(
156 - 32x + 32x +
    x = x,
157 - 32x + 32x +
    x_reactive = x_reactive,
158 - 32x + 32x +
    slice = slice,
159 - 32x + 32x +
    extract_type = extract_type
@@ -29524,35 +30607,40 @@

teal.slice coverage - 65.86%

169 - 2x + 2x +
  args <- list(
170 - 2x + 2x +
    x = x,
171 - 2x + 2x +
    x_reactive = x_reactive,
172 - 2x + 2x +
    slice = slice,
173 - 2x + 2x +
    extract_type = extract_type
@@ -29573,14 +30661,16 @@

teal.slice coverage - 65.86%

176 - 2x + 2x +
  if (length(unique(x[!is.na(x)])) < getOption("teal.threshold_slider_vs_checkboxgroup")) {
177 - 1x + 1x +
    do.call(ChoicesFilterState$new, args)
@@ -29594,7 +30684,8 @@

teal.slice coverage - 65.86%

179 - 1x + 1x +
    do.call(DateFilterState$new, args)
@@ -29664,35 +30755,40 @@

teal.slice coverage - 65.86%

189 - 2x + 2x +
  args <- list(
190 - 2x + 2x +
    x = x,
191 - 2x + 2x +
    x_reactive = x_reactive,
192 - 2x + 2x +
    slice = slice,
193 - 2x + 2x +
    extract_type = extract_type
@@ -29713,14 +30809,16 @@

teal.slice coverage - 65.86%

196 - 2x + 2x +
  if (length(unique(x[!is.na(x)])) < getOption("teal.threshold_slider_vs_checkboxgroup")) {
197 - 1x + 1x +
    do.call(ChoicesFilterState$new, args)
@@ -29734,7 +30832,8 @@

teal.slice coverage - 65.86%

199 - 1x + 1x +
    do.call(DatetimeFilterState$new, args)
@@ -29804,35 +30903,40 @@

teal.slice coverage - 65.86%

209 - 2x + 2x +
  args <- list(
210 - 2x + 2x +
    x = x,
211 - 2x + 2x +
    x_reactive = x_reactive,
212 - 2x + 2x +
    slice = slice,
213 - 2x + 2x +
    extract_type = extract_type
@@ -29853,14 +30957,16 @@

teal.slice coverage - 65.86%

216 - 2x + 2x +
  if (length(unique(x[!is.na(x)])) < getOption("teal.threshold_slider_vs_checkboxgroup")) {
217 - 1x + 1x +
    do.call(ChoicesFilterState$new, args)
@@ -29874,7 +30980,8 @@

teal.slice coverage - 65.86%

219 - 1x + 1x +
    do.call(DatetimeFilterState$new, args)
@@ -29965,7 +31072,8 @@

teal.slice coverage - 65.86%

232 - 6x + 6x +
  FilterStateExpr$new(slice)
@@ -30133,28 +31241,32 @@

teal.slice coverage - 65.86%

256 - 119x + 119x +
  checkmate::assert_string(color)
257 - 119x + 119x +
  checkmate::assert(
258 - 119x + 119x +
    checkmate::check_number(alpha, lower = 0, upper = 1, null.ok = TRUE),
259 - 119x + 119x +
    checkmate::check_string(alpha, pattern = "[0-9a-f]{2}", null.ok = TRUE)
@@ -30182,7 +31294,8 @@

teal.slice coverage - 65.86%

263 - 119x + 119x +
  sass_file <- if (utils::packageVersion("bslib") < as.package_version("0.5.1.9000")) {
@@ -30203,7 +31316,8 @@

teal.slice coverage - 65.86%

266 - 119x + 119x +
    bslib::bs_theme()[["layers"]][[2]][["defaults"]][[1]][[1]]
@@ -30217,7 +31331,8 @@

teal.slice coverage - 65.86%

268 - 119x + 119x +
  sass_file <- attr(sass_file, "sass_file_path")
@@ -30238,7 +31353,8 @@

teal.slice coverage - 65.86%

271 - 119x + 119x +
  variables_file <- readLines(sass_file)
@@ -30252,14 +31368,16 @@

teal.slice coverage - 65.86%

273 - 119x + 119x +
  ind <- grep("// scss-docs-(start|end) theme-color-variables", variables_file)
274 - 119x + 119x +
  color_definitions <- variables_file[(ind[1] + 1L):(ind[2] - 1L)]
@@ -30280,7 +31398,8 @@

teal.slice coverage - 65.86%

277 - 119x + 119x +
  color_names <- sub("(\\$)(\\w.+)(:.+)", "\\2", color_definitions)
@@ -30301,7 +31420,8 @@

teal.slice coverage - 65.86%

280 - 119x + 119x +
  checkmate::assert_choice(color, color_names)
@@ -30322,7 +31442,8 @@

teal.slice coverage - 65.86%

283 - 119x + 119x +
  color_references <- sub("(\\$)(\\w.+)(:\\s.+\\$)(\\w.+)(\\s.+)", "\\4", color_definitions)
@@ -30343,42 +31464,48 @@

teal.slice coverage - 65.86%

286 - 119x + 119x +
  color_specification <- structure(color_references, names = color_names)
287 - 119x + 119x +
  color_specification <- vapply(color_specification, function(x) {
288 - 952x + 952x +
    line <- grep(sprintf("^\\$%s:\\s+#\\w{6}\\s+!default", x), variables_file, value = TRUE)
289 - 952x + 952x +
    code <- sub("(.+)(#\\w{6})(\\s+.+)", "\\2", line)
290 - 952x + 952x +
    code
291 - 119x + 119x +
  }, character(1L))
@@ -30392,7 +31519,8 @@

teal.slice coverage - 65.86%

293 - 119x + 119x +
  if (!is.null(alpha)) {
@@ -30420,7 +31548,8 @@

teal.slice coverage - 65.86%

297 - 119x + 119x +
  paste0(color_specification[color], alpha)
@@ -31490,42 +32619,48 @@

teal.slice coverage - 65.86%

151 - 163x + 163x +
      isolate({
152 - 163x + 163x +
        checkmate::assert(
153 - 163x + 163x +
          is.character(x),
154 - 163x + 163x +
          is.factor(x),
155 - 163x + 163x +
          length(unique(x[!is.na(x)])) < getOption("teal.threshold_slider_vs_checkboxgroup"),
156 - 163x + 163x +
          combine = "or"
@@ -31539,14 +32674,16 @@

teal.slice coverage - 65.86%

158 - 163x + 163x +
        if (is.factor(x)) {
159 - 38x + 38x +
          x <- droplevels(x)
@@ -31560,35 +32697,40 @@

teal.slice coverage - 65.86%

161 - 163x + 163x +
        super$initialize(
162 - 163x + 163x +
          x = x,
163 - 163x + 163x +
          x_reactive = x_reactive,
164 - 163x + 163x +
          slice = slice,
165 - 163x + 163x +
          extract_type = extract_type
@@ -31602,63 +32744,72 @@

teal.slice coverage - 65.86%

167 - 163x + 163x +
        private$set_choices(slice$choices)
168 - 163x + 163x +
        if (is.null(slice$selected) && slice$multiple) {
169 - 45x + 45x +
          slice$selected <- private$get_choices()
170 - 118x + 118x +
        } else if (is.null(slice$selected)) {
171 - 1x + 1x +
          slice$selected <- private$get_choices()[1]
172 - 117x + 117x +
        } else if (length(slice$selected) > 1 && !slice$multiple) {
173 - 1x + 1x +
          warning(
174 - 1x + 1x +
            "ChoicesFilterState allows \"selected\" to be of length 1 when \"multiple\" is FALSE. ",
175 - 1x + 1x +
            "Only the first value will be used."
@@ -31672,7 +32823,8 @@

teal.slice coverage - 65.86%

177 - 1x + 1x +
          slice$selected <- slice$selected[1]
@@ -31686,21 +32838,24 @@

teal.slice coverage - 65.86%

179 - 163x + 163x +
        private$set_selected(slice$selected)
180 - 163x + 163x +
        if (inherits(x, "POSIXt")) {
181 - 9x + 9x +
          private$tzone <- Find(function(x) x != "", attr(as.POSIXlt(x), "tzone"))
@@ -31721,7 +32876,8 @@

teal.slice coverage - 65.86%

184 - 163x + 163x +
      invisible(self)
@@ -31798,14 +32954,16 @@

teal.slice coverage - 65.86%

195 - 61x + 61x +
      if (isFALSE(private$is_any_filtered())) {
196 - 7x + 7x +
        return(NULL)
@@ -31819,49 +32977,56 @@

teal.slice coverage - 65.86%

198 - 30x + 30x +
      if (missing(dataname)) dataname <- private$get_dataname()
199 - 54x + 54x +
      varname <- private$get_varname_prefixed(dataname)
200 - 54x + 54x +
      choices <- private$get_choices()
201 - 54x + 54x +
      selected <- private$get_selected()
202 - 54x + 54x +
      fun_compare <- if (length(selected) == 1L) "==" else "%in%"
203 - 54x + 54x +
      filter_call <- if (length(selected) == 0) {
204 - 6x + 6x +
        call("!", call(fun_compare, varname, make_c_call(as.character(choices))))
@@ -31875,70 +33040,80 @@

teal.slice coverage - 65.86%

206 - 48x + 48x +
        if (setequal(selected, choices) && !private$is_choice_limited) {
207 - 2x + 2x +
          NULL
208 - 46x + 46x +
        } else if (inherits(private$x, "Date")) {
209 - 1x + 1x +
          call(fun_compare, varname, call("as.Date", make_c_call(as.character(selected))))
210 - 45x + 45x +
        } else if (inherits(private$x, c("POSIXct", "POSIXlt"))) {
211 - 2x + 2x +
          class <- class(private$x)[1L]
212 - 2x + 2x +
          date_fun <- as.name(
213 - 2x + 2x +
            switch(class,
214 - 2x + 2x +
              "POSIXct" = "as.POSIXct",
215 - 2x + 2x +
              "POSIXlt" = "as.POSIXlt"
@@ -31959,28 +33134,32 @@

teal.slice coverage - 65.86%

218 - 2x + 2x +
          call(
219 - 2x + 2x +
            fun_compare,
220 - 2x + 2x +
            varname,
221 - 2x + 2x +
            as.call(list(date_fun, make_c_call(as.character(selected)), tz = private$tzone))
@@ -31994,14 +33173,16 @@

teal.slice coverage - 65.86%

223 - 43x + 43x +
        } else if (is.numeric(private$x)) {
224 - 7x + 7x +
          call(fun_compare, varname, make_c_call(as.numeric(selected)))
@@ -32022,7 +33203,8 @@

teal.slice coverage - 65.86%

227 - 36x + 36x +
          call(fun_compare, varname, make_c_call(selected))
@@ -32043,7 +33225,8 @@

teal.slice coverage - 65.86%

230 - 54x + 54x +
      private$add_keep_na_call(filter_call, varname)
@@ -32155,28 +33338,32 @@

teal.slice coverage - 65.86%

246 - 163x + 163x +
      named_counts <- .table(private$x)
247 - 163x + 163x +
      possible_choices <- names(named_counts)
248 - 163x + 163x +
      if (is.null(choices)) {
249 - 148x + 148x +
        choices <- possible_choices
@@ -32190,49 +33377,56 @@

teal.slice coverage - 65.86%

251 - 15x + 15x +
        choices <- as.character(choices)
252 - 15x + 15x +
        choices_adjusted <- choices[choices %in% possible_choices]
253 - 15x + 15x +
        if (length(setdiff(choices, choices_adjusted)) > 0L) {
254 - 2x + 2x +
          warning(
255 - 2x + 2x +
            sprintf(
256 - 2x + 2x +
              "Some choices not found in data. Adjusting. Filter id: %s.",
257 - 2x + 2x +
              private$get_id()
@@ -32253,7 +33447,8 @@

teal.slice coverage - 65.86%

260 - 2x + 2x +
          choices <- choices_adjusted
@@ -32267,35 +33462,40 @@

teal.slice coverage - 65.86%

262 - 15x + 15x +
        if (length(choices) == 0) {
263 - 1x + 1x +
          warning(
264 - 1x + 1x +
            sprintf(
265 - 1x + 1x +
              "None of the choices were found in data. Setting defaults. Filter id: %s.",
266 - 1x + 1x +
              private$get_id()
@@ -32316,7 +33516,8 @@

teal.slice coverage - 65.86%

269 - 1x + 1x +
          choices <- possible_choices
@@ -32337,14 +33538,16 @@

teal.slice coverage - 65.86%

272 - 163x + 163x +
      private$set_choices_counts(
273 - 163x + 163x +
        pair_counts(choices, named_counts)
@@ -32358,21 +33561,24 @@

teal.slice coverage - 65.86%

275 - 163x + 163x +
      private$set_is_choice_limited(possible_choices, choices)
276 - 163x + 163x +
      private$teal_slice$choices <- choices
277 - 163x + 163x +
      invisible(NULL)
@@ -32407,21 +33613,24 @@

teal.slice coverage - 65.86%

282 - 163x + 163x +
      xl <- x[!is.na(x)]
283 - 163x + 163x +
      private$is_choice_limited <- length(setdiff(xl, choices)) > 0L
284 - 163x + 163x +
      invisible(NULL)
@@ -32456,14 +33665,16 @@

teal.slice coverage - 65.86%

289 - 163x + 163x +
      private$choices_counts <- choices_counts
290 - 163x + 163x +
      invisible(NULL)
@@ -32498,7 +33709,8 @@

teal.slice coverage - 65.86%

295 - 25x + 25x +
      length(private$get_choices()) <= getOption("teal.threshold_slider_vs_checkboxgroup")
@@ -32519,21 +33731,24 @@

teal.slice coverage - 65.86%

298 - 192x + 192x +
      tryCatch(
299 - 192x + 192x +
        expr = {
300 - 192x + 192x +
          values <- as.character(values)
@@ -32554,7 +33769,8 @@

teal.slice coverage - 65.86%

303 - 192x + 192x +
        error = function(e) stop("The vector of set values must contain values coercible to character.")
@@ -32568,7 +33784,8 @@

teal.slice coverage - 65.86%

305 - 192x + 192x +
      values
@@ -32596,28 +33813,32 @@

teal.slice coverage - 65.86%

309 - 192x + 192x +
      if (!private$is_multiple() && length(values) > 1) {
310 - 1x + 1x +
        warning(
311 - 1x + 1x +
          sprintf("Selection: %s is not a vector of length one. ", toString(values, width = 360)),
312 - 1x + 1x +
          "Maintaining previous selection."
@@ -32631,7 +33852,8 @@

teal.slice coverage - 65.86%

314 - 1x + 1x +
        values <- isolate(private$get_selected())
@@ -32645,7 +33867,8 @@

teal.slice coverage - 65.86%

316 - 192x + 192x +
      values
@@ -32666,35 +33889,40 @@

teal.slice coverage - 65.86%

319 - 192x + 192x +
      in_choices_mask <- values %in% private$get_choices()
320 - 192x + 192x +
      if (length(values[!in_choices_mask]) > 0) {
321 - 17x + 17x +
        warning(paste(
322 - 17x + 17x +
          "Values:", toString(values[!in_choices_mask], width = 360),
323 - 17x + 17x +
          "are not in choices of column", private$get_varname(), "in dataset", private$get_dataname(), "."
@@ -32715,7 +33943,8 @@

teal.slice coverage - 65.86%

326 - 192x + 192x +
      values[in_choices_mask]
@@ -32792,7 +34021,8 @@

teal.slice coverage - 65.86%

337 - 9x + 9x +
      ns <- NS(id)
@@ -32813,42 +34043,48 @@

teal.slice coverage - 65.86%

340 - 9x + 9x +
      isolate({
341 - 9x + 9x +
        countsmax <- private$choices_counts
342 - 9x + 9x +
        countsnow <- if (!is.null(private$x_reactive())) {
343 - 2x + 2x +
          pair_counts(
344 - 2x + 2x +
            private$get_choices(),
345 - 2x + 2x +
            .table(private$x_reactive())
@@ -32876,42 +34112,48 @@

teal.slice coverage - 65.86%

349 - 9x + 9x +
        ui_input <- if (private$is_checkboxgroup()) {
350 - 9x + 9x +
          labels <- countBars(
351 - 9x + 9x +
            inputId = ns("labels"),
352 - 9x + 9x +
            choices = private$get_choices(),
353 - 9x + 9x +
            countsnow = countsnow,
354 - 9x + 9x +
            countsmax = countsmax
@@ -32925,70 +34167,80 @@

teal.slice coverage - 65.86%

356 - 9x + 9x +
          tags$div(
357 - 9x + 9x +
            class = "choices_state",
358 - 9x + 9x +
            if (private$is_multiple()) {
359 - 9x + 9x +
              checkboxGroupInput(
360 - 9x + 9x +
                inputId = ns("selection"),
361 - 9x + 9x +
                label = NULL,
362 - 9x + 9x +
                selected = private$get_selected(),
363 - 9x + 9x +
                choiceNames = labels,
364 - 9x + 9x +
                choiceValues = private$get_choices(),
365 - 9x + 9x +
                width = "100%"
@@ -33219,28 +34471,32 @@

teal.slice coverage - 65.86%

398 - 9x + 9x +
        tags$div(
399 - 9x + 9x +
          uiOutput(ns("trigger_visible")),
400 - 9x + 9x +
          ui_input,
401 - 9x + 9x +
          private$keep_na_ui(ns("keep_na"))
@@ -33310,28 +34566,32 @@

teal.slice coverage - 65.86%

411 - 7x + 7x +
      moduleServer(
412 - 7x + 7x +
        id = id,
413 - 7x + 7x +
        function(input, output, session) {
414 - 7x + 7x +
          logger::log_trace("ChoicesFilterState$server_inputs initializing, id: { private$get_id() }")
@@ -33373,21 +34633,24 @@

teal.slice coverage - 65.86%

420 - 7x + 7x +
          non_missing_values <- reactive(Filter(Negate(is.na), private$x_reactive()))
421 - 7x + 7x +
          output$trigger_visible <- renderUI({
422 - 7x + 7x +
            logger::log_trace("ChoicesFilterState$server_inputs@1 updating count labels, id: { private$get_id() }")
@@ -33401,7 +34664,8 @@

teal.slice coverage - 65.86%

424 - 7x + 7x +
            countsnow <- if (!is.null(private$x_reactive())) {
@@ -33457,49 +34721,56 @@

teal.slice coverage - 65.86%

432 - 7x + 7x +
            isolate({
433 - 7x + 7x +
              if (private$is_checkboxgroup()) {
434 - 7x + 7x +
                updateCountBars(
435 - 7x + 7x +
                  inputId = "labels",
436 - 7x + 7x +
                  choices = private$get_choices(),
437 - 7x + 7x +
                  countsmax = private$choices_counts,
438 - 7x + 7x +
                  countsnow = countsnow
@@ -33611,7 +34882,8 @@

teal.slice coverage - 65.86%

454 - 7x + 7x +
              NULL
@@ -33639,42 +34911,48 @@

teal.slice coverage - 65.86%

458 - 7x + 7x +
          if (private$is_checkboxgroup()) {
459 - 7x + 7x +
            private$observers$selection <- observeEvent(
460 - 7x + 7x +
              ignoreNULL = FALSE,
461 - 7x + 7x +
              ignoreInit = TRUE, # ignoreInit: should not matter because we set the UI with the desired initial state
462 - 7x + 7x +
              eventExpr = input$selection,
463 - 7x + 7x +
              handlerExpr = {
@@ -33996,7 +35274,8 @@

teal.slice coverage - 65.86%

509 - 7x + 7x +
          private$keep_na_srv("keep_na")
@@ -34031,7 +35310,8 @@

teal.slice coverage - 65.86%

514 - 7x + 7x +
          private$observers$selection_api <- observeEvent(private$get_selected(), {
@@ -34052,49 +35332,56 @@

teal.slice coverage - 65.86%

517 - 2x + 2x +
            if (!setequal(input$selection, private$get_selected())) {
518 - 2x + 2x +
              logger::log_trace("ChoicesFilterState$server@1 state changed, id: { private$get_id() }")
519 - 2x + 2x +
              if (private$is_checkboxgroup()) {
520 - 2x + 2x +
                if (private$is_multiple()) {
521 - 2x + 2x +
                  updateCheckboxGroupInput(
522 - 2x + 2x +
                    inputId = "selection",
523 - 2x + 2x +
                    selected = private$get_selected()
@@ -34213,14 +35500,16 @@

teal.slice coverage - 65.86%

540 - 7x + 7x +
          logger::log_trace("ChoicesFilterState$server_inputs initialized, id: { private$get_id() }")
541 - 7x + 7x +
          NULL
@@ -34493,21 +35782,24 @@

teal.slice coverage - 65.86%

580 - 7x + 7x +
      selected <- private$get_selected()
581 - 7x + 7x +
      selected_text <-
582 - 7x + 7x +
        if (length(selected) == 0L) {
@@ -34528,14 +35820,16 @@

teal.slice coverage - 65.86%

585 - 7x + 7x +
          if (sum(nchar(selected)) <= 40L) {
586 - 7x + 7x +
            paste(selected, collapse = ", ")
@@ -34570,28 +35864,32 @@

teal.slice coverage - 65.86%

591 - 7x + 7x +
      tagList(
592 - 7x + 7x +
        tags$span(
593 - 7x + 7x +
          class = "filter-card-summary-value",
594 - 7x + 7x +
          selected_text
@@ -34605,21 +35903,24 @@

teal.slice coverage - 65.86%

596 - 7x + 7x +
        tags$span(
597 - 7x + 7x +
          class = "filter-card-summary-controls",
598 - 7x + 7x +
          if (private$na_count > 0) {
@@ -34731,21 +36032,24 @@

teal.slice coverage - 65.86%

614 - 165x + 165x +
  tbl <- table(
615 - 165x + 165x +
    if (is.factor(x)) {
616 - 38x + 38x +
      x
@@ -34759,7 +36063,8 @@

teal.slice coverage - 65.86%

618 - 127x + 127x +
      as.character(x)
@@ -34794,21 +36099,24 @@

teal.slice coverage - 65.86%

623 - 165x + 165x +
  stats::setNames(
624 - 165x + 165x +
    as.vector(tbl),
625 - 165x + 165x +
    names(tbl)
@@ -35353,35 +36661,40 @@

teal.slice coverage - 65.86%

75 - 372x + 372x +
      checkmate::assert_class(x_reactive, "reactive")
76 - 371x + 371x +
      checkmate::assert_class(slice, "teal_slice")
77 - 369x + 369x +
      checkmate::assert_character(extract_type, max.len = 1, any.missing = FALSE)
78 - 369x + 369x +
      if (length(extract_type) == 1) {
79 - 53x + 53x +
        checkmate::assert_choice(extract_type, choices = c("list", "matrix"))
@@ -35409,14 +36722,16 @@

teal.slice coverage - 65.86%

83 - 368x + 368x +
      private$x <- x
84 - 368x + 368x +
      private$x_reactive <- x_reactive
@@ -35430,21 +36745,24 @@

teal.slice coverage - 65.86%

86 - 368x + 368x +
      private$na_count <- sum(is.na(x))
87 - 368x + 368x +
      private$filtered_na_count <- reactive(
88 - 368x + 368x +
        if (!is.null(private$x_reactive())) {
@@ -35479,7 +36797,8 @@

teal.slice coverage - 65.86%

93 - 368x + 368x +
      private$extract_type <- extract_type
@@ -35500,14 +36819,16 @@

teal.slice coverage - 65.86%

96 - 19x + 19x +
      if (is.null(isolate(slice$keep_na)) && anyNA(x)) slice$keep_na <- TRUE
97 - 368x + 368x +
      private$teal_slice <- slice
@@ -35521,7 +36842,8 @@

teal.slice coverage - 65.86%

99 - 368x + 368x +
      varlabel <- attr(x, "label", exact = TRUE)
@@ -35535,21 +36857,24 @@

teal.slice coverage - 65.86%

101 - 368x + 368x +
      private$varlabel <-
102 - 368x + 368x +
        if (is.null(varlabel) || identical(varlabel, private$get_varname())) {
103 - 367x + 367x +
          character(0)
@@ -35563,7 +36888,8 @@

teal.slice coverage - 65.86%

105 - 1x + 1x +
          varlabel
@@ -35584,7 +36910,8 @@

teal.slice coverage - 65.86%

108 - 368x + 368x +
      private$state_history <- reactiveVal(list())
@@ -35598,7 +36925,8 @@

teal.slice coverage - 65.86%

110 - 368x + 368x +
      logger::log_trace("Instantiated FilterState object id: { private$get_id() }")
@@ -35612,7 +36940,8 @@

teal.slice coverage - 65.86%

112 - 368x + 368x +
      invisible(self)
@@ -35696,28 +37025,32 @@

teal.slice coverage - 65.86%

124 - 68x + 68x +
      sprintf(
125 - 68x + 68x +
        "%s:\n%s",
126 - 68x + 68x +
        class(self)[1],
127 - 68x + 68x +
        format(self$get_state(), show_all = show_all, trim_lines = trim_lines)
@@ -35787,7 +37120,8 @@

teal.slice coverage - 65.86%

137 - 14x + 14x +
      cat(isolate(self$format(...)))
@@ -35878,21 +37212,24 @@

teal.slice coverage - 65.86%

150 - 89x + 89x +
      checkmate::assert_class(state, "teal_slice")
151 - 88x + 88x +
      if (private$is_fixed()) {
152 - 1x + 1x +
        warning("attempt to set state on fixed filter aborted id: ", private$get_id())
@@ -35906,28 +37243,32 @@

teal.slice coverage - 65.86%

154 - 87x + 87x +
        logger::log_trace("{ class(self)[1] }$set_state setting state of filter id: { private$get_id() }")
155 - 87x + 87x +
        isolate({
156 - 87x + 87x +
          if (!is.null(state$selected)) {
157 - 78x + 78x +
            private$set_selected(state$selected)
@@ -35941,14 +37282,16 @@

teal.slice coverage - 65.86%

159 - 75x + 75x +
          if (!is.null(state$keep_na)) {
160 - 16x + 16x +
            private$set_keep_na(state$keep_na)
@@ -35962,14 +37305,16 @@

teal.slice coverage - 65.86%

162 - 75x + 75x +
          if (!is.null(state$keep_inf)) {
163 - 9x + 9x +
            private$set_keep_inf(state$keep_inf)
@@ -35983,35 +37328,40 @@

teal.slice coverage - 65.86%

165 - 75x + 75x +
          current_state <- sprintf(
166 - 75x + 75x +
            "selected: %s; keep_na: %s; keep_inf: %s",
167 - 75x + 75x +
            toString(private$get_selected()),
168 - 75x + 75x +
            private$get_keep_na(),
169 - 75x + 75x +
            private$get_keep_inf()
@@ -36046,7 +37396,8 @@

teal.slice coverage - 65.86%

174 - 76x + 76x +
      invisible(self)
@@ -36116,7 +37467,8 @@

teal.slice coverage - 65.86%

184 - 749x + 749x +
      private$teal_slice
@@ -36186,7 +37538,8 @@

teal.slice coverage - 65.86%

194 - 1x + 1x +
      stop("this is a virtual method")
@@ -36270,28 +37623,32 @@

teal.slice coverage - 65.86%

206 - 12x + 12x +
      moduleServer(
207 - 12x + 12x +
        id = id,
208 - 12x + 12x +
        function(input, output, session) {
209 - 12x + 12x +
          logger::log_trace("FilterState$server initializing module for slice: { private$get_id() } ")
@@ -36305,14 +37662,16 @@

teal.slice coverage - 65.86%

211 - 12x + 12x +
          private$server_summary("summary")
212 - 12x + 12x +
          if (private$is_fixed()) {
@@ -36333,7 +37692,8 @@

teal.slice coverage - 65.86%

215 - 12x + 12x +
            private$server_inputs("inputs")
@@ -36354,49 +37714,56 @@

teal.slice coverage - 65.86%

218 - 12x + 12x +
          private$observers$state <- observeEvent(
219 - 12x + 12x +
            eventExpr = list(private$get_selected(), private$get_keep_na(), private$get_keep_inf()),
220 - 12x + 12x +
            handlerExpr = {
221 - 4x + 4x +
              current_state <- as.list(self$get_state())
222 - 4x + 4x +
              history <- private$state_history()
223 - 4x + 4x +
              history_update <- c(history, list(current_state))
224 - 4x + 4x +
              private$state_history(history_update)
@@ -36424,21 +37791,24 @@

teal.slice coverage - 65.86%

228 - 12x + 12x +
          private$observers$back <- observeEvent(
229 - 12x + 12x +
            eventExpr = input$back,
230 - 12x + 12x +
            handlerExpr = {
@@ -36501,21 +37871,24 @@

teal.slice coverage - 65.86%

239 - 12x + 12x +
          private$observers$reset <- observeEvent(
240 - 12x + 12x +
            eventExpr = input$reset,
241 - 12x + 12x +
            handlerExpr = {
@@ -36571,56 +37944,64 @@

teal.slice coverage - 65.86%

249 - 12x + 12x +
          private$observers$state_history <- observeEvent(
250 - 12x + 12x +
            eventExpr = private$state_history(),
251 - 12x + 12x +
            handlerExpr = {
252 - 4x + 4x +
              shinyjs::disable(id = "back")
253 - 4x + 4x +
              shinyjs::disable(id = "reset")
254 - 4x + 4x +
              shinyjs::delay(
255 - 4x + 4x +
                ms = 100,
256 - 4x + 4x +
                expr = {
@@ -36655,21 +38036,24 @@

teal.slice coverage - 65.86%

261 - 4x + 4x +
              shinyjs::delay(
262 - 4x + 4x +
                ms = 100,
263 - 4x + 4x +
                expr = {
@@ -36725,14 +38109,16 @@

teal.slice coverage - 65.86%

271 - 12x + 12x +
          private$destroy_shiny <- function() {
272 - 8x + 8x +
            logger::log_trace("Destroying FilterState inputs and observers; id: { private$get_id() }")
@@ -36746,7 +38132,8 @@

teal.slice coverage - 65.86%

274 - 8x + 8x +
            lapply(session$ns(names(input)), .subset2(input, "impl")$.values$remove)
@@ -36767,7 +38154,8 @@

teal.slice coverage - 65.86%

277 - 8x + 8x +
            lapply(private$observers, function(x) x$destroy())
@@ -36788,7 +38176,8 @@

teal.slice coverage - 65.86%

280 - 12x + 12x +
          reactive(input$remove)
@@ -36872,7 +38261,8 @@

teal.slice coverage - 65.86%

292 - 12x + 12x +
      ns <- NS(id)
@@ -36928,84 +38318,96 @@

teal.slice coverage - 65.86%

300 - 12x + 12x +
      tags$div(
301 - 12x + 12x +
        id = id,
302 - 12x + 12x +
        class = "panel filter-card",
303 - 12x + 12x +
        include_js_files("count-bar-labels.js"),
304 - 12x + 12x +
        tags$div(
305 - 12x + 12x +
          class = "filter-card-header",
306 - 12x + 12x +
          `data-toggle` = "collapse",
307 - 12x + 12x +
          `data-bs-toggle` = "collapse",
308 - 12x + 12x +
          href = paste0("#", ns("body")),
309 - 12x + 12x +
          tags$div(
310 - 12x + 12x +
            class = "filter-card-title",
311 - 12x + 12x +
            if (private$is_anchored() && private$is_fixed()) {
@@ -37019,7 +38421,8 @@

teal.slice coverage - 65.86%

313 - 12x + 12x +
            } else if (private$is_anchored() && !private$is_fixed()) {
@@ -37033,7 +38436,8 @@

teal.slice coverage - 65.86%

315 - 12x + 12x +
            } else if (!private$is_anchored() && private$is_fixed()) {
@@ -37054,28 +38458,32 @@

teal.slice coverage - 65.86%

318 - 12x + 12x +
            tags$div(class = "filter-card-varname", tags$strong(private$get_varname())),
319 - 12x + 12x +
            tags$div(class = "filter-card-varlabel", private$get_varlabel()),
320 - 12x + 12x +
            tags$div(
321 - 12x + 12x +
              class = "filter-card-controls",
@@ -37096,7 +38504,8 @@

teal.slice coverage - 65.86%

324 - 12x + 12x +
              onclick = "event.stopPropagation();event.preventDefault();",
@@ -37110,70 +38519,80 @@

teal.slice coverage - 65.86%

326 - 12x + 12x +
              `data-bs-toggle` = "collapse",
327 - 12x + 12x +
              `data-bs-target` = NULL,
328 - 12x + 12x +
              if (isFALSE(private$is_fixed())) {
329 - 12x + 12x +
                actionLink(
330 - 12x + 12x +
                  inputId = ns("back"),
331 - 12x + 12x +
                  label = NULL,
332 - 12x + 12x +
                  icon = icon("circle-arrow-left", lib = "font-awesome"),
333 - 12x + 12x +
                  title = "Rewind state",
334 - 12x + 12x +
                  class = "filter-card-back",
335 - 12x + 12x +
                  style = "display: none"
@@ -37194,56 +38613,64 @@

teal.slice coverage - 65.86%

338 - 12x + 12x +
              if (isFALSE(private$is_fixed())) {
339 - 12x + 12x +
                actionLink(
340 - 12x + 12x +
                  inputId = ns("reset"),
341 - 12x + 12x +
                  label = NULL,
342 - 12x + 12x +
                  icon = icon("circle-arrow-up", lib = "font-awesome"),
343 - 12x + 12x +
                  title = "Restore original state",
344 - 12x + 12x +
                  class = "filter-card-back",
345 - 12x + 12x +
                  style = "display: none"
@@ -37264,42 +38691,48 @@

teal.slice coverage - 65.86%

348 - 12x + 12x +
              if (isFALSE(private$is_anchored())) {
349 - 12x + 12x +
                actionLink(
350 - 12x + 12x +
                  inputId = ns("remove"),
351 - 12x + 12x +
                  label = icon("circle-xmark", lib = "font-awesome"),
352 - 12x + 12x +
                  title = "Remove filter",
353 - 12x + 12x +
                  class = "filter-card-remove"
@@ -37334,7 +38767,8 @@

teal.slice coverage - 65.86%

358 - 12x + 12x +
          tags$div(class = "filter-card-summary", private$ui_summary(ns("summary")))
@@ -37348,56 +38782,64 @@

teal.slice coverage - 65.86%

360 - 12x + 12x +
        tags$div(
361 - 12x + 12x +
          id = ns("body"),
362 - 12x + 12x +
          class = "collapse out",
363 - 12x + 12x +
          `data-parent` = paste0("#", parent_id),
364 - 12x + 12x +
          `data-bs-parent` = paste0("#", parent_id),
365 - 12x + 12x +
          tags$div(
366 - 12x + 12x +
            class = "filter-card-body",
367 - 12x + 12x +
            if (private$is_fixed()) {
@@ -37418,7 +38860,8 @@

teal.slice coverage - 65.86%

370 - 12x + 12x +
              private$ui_inputs(ns("inputs"))
@@ -37509,14 +38952,16 @@

teal.slice coverage - 65.86%

383 - 47x + 47x +
      if (!is.null(private$destroy_shiny)) {
384 - 8x + 8x +
        private$destroy_shiny()
@@ -37810,35 +39255,40 @@

teal.slice coverage - 65.86%

426 - 424x + 424x +
      logger::log_trace(
427 - 424x + 424x +
        sprintf(
428 - 424x + 424x +
          "%s$set_selected setting selection of id: %s",
429 - 424x + 424x +
          class(self)[1],
430 - 424x + 424x +
          private$get_id()
@@ -37859,35 +39309,40 @@

teal.slice coverage - 65.86%

433 - 424x + 424x +
      isolate({
434 - 424x + 424x +
        value <- private$cast_and_validate(value)
435 - 413x + 413x +
        value <- private$check_length(value)
436 - 407x + 407x +
        value <- private$remove_out_of_bounds_values(value)
437 - 407x + 407x +
        private$teal_slice$selected <- value
@@ -37901,35 +39356,40 @@

teal.slice coverage - 65.86%

439 - 407x + 407x +
      logger::log_trace(
440 - 407x + 407x +
        sprintf(
441 - 407x + 407x +
          "%s$set_selected selection of id: %s",
442 - 407x + 407x +
          class(self)[1],
443 - 407x + 407x +
          private$get_id()
@@ -37957,7 +39417,8 @@

teal.slice coverage - 65.86%

447 - 407x + 407x +
      invisible(NULL)
@@ -38041,56 +39502,64 @@

teal.slice coverage - 65.86%

459 - 16x + 16x +
      checkmate::assert_flag(value)
460 - 16x + 16x +
      private$teal_slice$keep_na <- value
461 - 16x + 16x +
      logger::log_trace(
462 - 16x + 16x +
        sprintf(
463 - 16x + 16x +
          "%s$set_keep_na set for filter %s to %s.",
464 - 16x + 16x +
          class(self)[1],
465 - 16x + 16x +
          private$get_id(),
466 - 16x + 16x +
          value
@@ -38111,7 +39580,8 @@

teal.slice coverage - 65.86%

469 - 16x + 16x +
      invisible(NULL)
@@ -38195,56 +39665,64 @@

teal.slice coverage - 65.86%

481 - 9x + 9x +
      checkmate::assert_flag(value)
482 - 9x + 9x +
      private$teal_slice$keep_inf <- value
483 - 9x + 9x +
      logger::log_trace(
484 - 9x + 9x +
        sprintf(
485 - 9x + 9x +
          "%s$set_keep_inf of filter %s set to %s",
486 - 9x + 9x +
          class(self)[1],
487 - 9x + 9x +
          private$get_id(),
488 - 9x + 9x +
          value
@@ -38272,7 +39750,8 @@

teal.slice coverage - 65.86%

492 - 9x + 9x +
      invisible(NULL)
@@ -38335,7 +39814,8 @@

teal.slice coverage - 65.86%

501 - 88x + 88x +
      isolate(private$teal_slice$dataname)
@@ -38384,7 +39864,8 @@

teal.slice coverage - 65.86%

508 - 166x + 166x +
      isolate(private$teal_slice$varname)
@@ -38433,7 +39914,8 @@

teal.slice coverage - 65.86%

515 - 4x + 4x +
      isolate(private$teal_slice$id)
@@ -38489,7 +39971,8 @@

teal.slice coverage - 65.86%

523 - 787x + 787x +
      isolate(private$teal_slice$choices)
@@ -38545,7 +40028,8 @@

teal.slice coverage - 65.86%

531 - 367x + 367x +
      private$teal_slice$selected
@@ -38594,7 +40078,8 @@

teal.slice coverage - 65.86%

538 - 129x + 129x +
      private$teal_slice$keep_na
@@ -38643,7 +40128,8 @@

teal.slice coverage - 65.86%

545 - 117x + 117x +
      private$teal_slice$keep_inf
@@ -38685,7 +40171,8 @@

teal.slice coverage - 65.86%

551 - 148x + 148x +
      isolate(isTRUE(private$teal_slice$fixed))
@@ -38727,7 +40214,8 @@

teal.slice coverage - 65.86%

557 - 48x + 48x +
      isolate(isTRUE(private$teal_slice$anchored))
@@ -38769,7 +40257,8 @@

teal.slice coverage - 65.86%

563 - 223x + 223x +
      isolate(isTRUE(private$teal_slice$multiple))
@@ -38832,7 +40321,8 @@

teal.slice coverage - 65.86%

572 - 12x + 12x +
      private$varlabel
@@ -38881,49 +40371,56 @@

teal.slice coverage - 65.86%

579 - 109x + 109x +
      varname <- private$get_varname()
580 - 109x + 109x +
      varname_backticked <- sprintf("`%s`", varname)
581 - 109x + 109x +
      ans <-
582 - 109x + 109x +
        if (isTRUE(private$extract_type == "list")) {
583 - 16x + 16x +
          sprintf("%s$%s", dataname, varname_backticked)
584 - 109x + 109x +
        } else if (isTRUE(private$extract_type == "matrix")) {
585 - 7x + 7x +
          sprintf("%s[, \"%s\"]", dataname, varname)
@@ -38937,7 +40434,8 @@

teal.slice coverage - 65.86%

587 - 86x + 86x +
          varname_backticked
@@ -38951,7 +40449,8 @@

teal.slice coverage - 65.86%

589 - 109x + 109x +
      str2lang(ans)
@@ -39021,14 +40520,16 @@

teal.slice coverage - 65.86%

599 - 108x + 108x +
      if (private$na_count == 0L) {
600 - 87x + 87x +
        return(filter_call)
@@ -39049,42 +40550,48 @@

teal.slice coverage - 65.86%

603 - 21x + 21x +
      if (is.null(filter_call) && isFALSE(private$get_keep_na())) {
604 - 2x + 2x +
        call("!", call("is.na", varname))
605 - 19x + 19x +
      } else if (!is.null(filter_call) && isTRUE(private$get_keep_na())) {
606 - 12x + 12x +
        call("|", call("is.na", varname), filter_call)
607 - 7x + 7x +
      } else if (!is.null(filter_call) && isFALSE(private$get_keep_na())) {
608 - 7x + 7x +
        call("&", call("!", call("is.na", varname)), filter_call)
@@ -39161,7 +40668,8 @@

teal.slice coverage - 65.86%

619 - 11x + 11x +
      values
@@ -39196,7 +40704,8 @@

teal.slice coverage - 65.86%

624 - 11x + 11x +
      values
@@ -39259,7 +40768,8 @@

teal.slice coverage - 65.86%

633 - 31x + 31x +
      values
@@ -39357,42 +40867,48 @@

teal.slice coverage - 65.86%

647 - 75x + 75x +
      if (private$is_choice_limited) {
648 - 3x + 3x +
        TRUE
649 - 72x + 72x +
      } else if (!setequal(private$get_selected(), private$get_choices())) {
650 - 59x + 59x +
        TRUE
651 - 13x + 13x +
      } else if (!isTRUE(private$get_keep_na()) && private$na_count > 0) {
652 - 4x + 4x +
        TRUE
@@ -39406,7 +40922,8 @@

teal.slice coverage - 65.86%

654 - 9x + 9x +
        FALSE
@@ -39476,14 +40993,16 @@

teal.slice coverage - 65.86%

664 - 12x + 12x +
      ns <- NS(id)
665 - 12x + 12x +
      uiOutput(ns("summary"), class = "filter-card-summary")
@@ -39539,28 +41058,32 @@

teal.slice coverage - 65.86%

673 - 12x + 12x +
      moduleServer(
674 - 12x + 12x +
        id = id,
675 - 12x + 12x +
        function(input, output, session) {
676 - 12x + 12x +
          output$summary <- renderUI(private$content_summary())
@@ -39826,14 +41349,16 @@

teal.slice coverage - 65.86%

714 - 14x + 14x +
      ns <- NS(id)
715 - 14x + 14x +
      if (private$na_count > 0) {
@@ -39987,7 +41512,8 @@

teal.slice coverage - 65.86%

737 - 14x + 14x +
        NULL
@@ -40064,7 +41590,8 @@

teal.slice coverage - 65.86%

748 - 12x + 12x +
      moduleServer(id, function(input, output, session) {
@@ -40099,42 +41626,48 @@

teal.slice coverage - 65.86%

753 - 12x + 12x +
        output$trigger_visible <- renderUI({
754 - 12x + 12x +
          updateCountText(
755 - 12x + 12x +
            inputId = "count_label",
756 - 12x + 12x +
            label = "Keep NA",
757 - 12x + 12x +
            countmax = private$na_count,
758 - 12x + 12x +
            countnow = private$filtered_na_count()
@@ -40148,7 +41681,8 @@

teal.slice coverage - 65.86%

760 - 12x + 12x +
          NULL
@@ -40190,35 +41724,40 @@

teal.slice coverage - 65.86%

766 - 12x + 12x +
        private$observers$keep_na_api <- observeEvent(
767 - 12x + 12x +
          ignoreNULL = FALSE, # nothing selected is possible for NA
768 - 12x + 12x +
          ignoreInit = TRUE, # ignoreInit: should not matter because we set the UI with the desired initial state
769 - 12x + 12x +
          eventExpr = private$get_keep_na(),
770 - 12x + 12x +
          handlerExpr = {
@@ -40295,35 +41834,40 @@

teal.slice coverage - 65.86%

781 - 12x + 12x +
        private$observers$keep_na <- observeEvent(
782 - 12x + 12x +
          ignoreNULL = FALSE, # ignoreNULL: we don't want to ignore NULL when nothing is selected in the `selectInput`
783 - 12x + 12x +
          ignoreInit = TRUE, # ignoreInit: should not matter because we set the UI with the desired initial state
784 - 12x + 12x +
          eventExpr = input$value,
785 - 12x + 12x +
          handlerExpr = {
@@ -40393,7 +41937,8 @@

teal.slice coverage - 65.86%

795 - 12x + 12x +
        invisible(NULL)
@@ -40875,7 +42420,8 @@

teal.slice coverage - 65.86%

64 - 229x + 229x +
  UseMethod("init_filter_states")
@@ -40952,42 +42498,48 @@

teal.slice coverage - 65.86%

75 - 100x + 100x +
  DFFilterStates$new(
76 - 100x + 100x +
    data = data,
77 - 100x + 100x +
    data_reactive = data_reactive,
78 - 100x + 100x +
    dataname = dataname,
79 - 100x + 100x +
    datalabel = datalabel,
80 - 100x + 100x +
    keys = keys
@@ -41064,35 +42616,40 @@

teal.slice coverage - 65.86%

91 - 22x + 22x +
  MatrixFilterStates$new(
92 - 22x + 22x +
    data = data,
93 - 22x + 22x +
    data_reactive = data_reactive,
94 - 22x + 22x +
    dataname = dataname,
95 - 22x + 22x +
    datalabel = datalabel
@@ -41176,7 +42733,8 @@

teal.slice coverage - 65.86%

107 - 22x + 22x +
  if (!requireNamespace("MultiAssayExperiment", quietly = TRUE)) {
@@ -41197,42 +42755,48 @@

teal.slice coverage - 65.86%

110 - 22x + 22x +
  MAEFilterStates$new(
111 - 22x + 22x +
    data = data,
112 - 22x + 22x +
    data_reactive = data_reactive,
113 - 22x + 22x +
    dataname = dataname,
114 - 22x + 22x +
    datalabel = datalabel,
115 - 22x + 22x +
    keys = keys
@@ -41309,7 +42873,8 @@

teal.slice coverage - 65.86%

126 - 85x + 85x +
  if (!requireNamespace("SummarizedExperiment", quietly = TRUE)) {
@@ -41330,35 +42895,40 @@

teal.slice coverage - 65.86%

129 - 85x + 85x +
  SEFilterStates$new(
130 - 85x + 85x +
    data = data,
131 - 85x + 85x +
    data_reactive = data_reactive,
132 - 85x + 85x +
    dataname = dataname,
133 - 85x + 85x +
    datalabel = datalabel
@@ -41540,7 +43110,8 @@

teal.slice coverage - 65.86%

159 - 227x + 227x +
  UseMethod("get_supported_filter_varnames")
@@ -41582,28 +43153,32 @@

teal.slice coverage - 65.86%

165 - 198x + 198x +
  is_expected_class <- vapply(
166 - 198x + 198x +
    X = data,
167 - 198x + 198x +
    FUN = function(x) any(class(x) %in% .filterable_class),
168 - 198x + 198x +
    FUN.VALUE = logical(1)
@@ -41617,7 +43192,8 @@

teal.slice coverage - 65.86%

170 - 198x + 198x +
  names(is_expected_class[is_expected_class])
@@ -41666,21 +43242,24 @@

teal.slice coverage - 65.86%

177 - 29x + 29x +
  is_expected_class <- class(data[, 1]) %in% .filterable_class
178 - 29x + 29x +
  if (is_expected_class && !is.null(colnames(data))) {
179 - 26x + 26x +
    colnames(data)
@@ -41694,7 +43273,8 @@

teal.slice coverage - 65.86%

181 - 3x + 3x +
    character(0)
@@ -41932,7 +43512,8 @@

teal.slice coverage - 65.86%

215 - 9x + 9x +
  if (length(choices) == 0) {
@@ -41953,14 +43534,16 @@

teal.slice coverage - 65.86%

218 - 9x + 9x +
  choice_types <- variable_types(data = data, columns = choices)
219 - 9x + 9x +
  choice_types[keys] <- "primary_key"
@@ -41974,28 +43557,32 @@

teal.slice coverage - 65.86%

221 - 9x + 9x +
  choices_labeled(
222 - 9x + 9x +
    choices = choices,
223 - 9x + 9x +
    labels = unname(varlabels[choices]),
224 - 9x + 9x +
    types = choice_types[choices]
@@ -42044,49 +43631,56 @@

teal.slice coverage - 65.86%

231 - 9x + 9x +
  if (!is.array(data)) {
232 - 9x + 9x +
    vapply(
233 - 9x + 9x +
      colnames(data),
234 - 9x + 9x +
      FUN = function(x) {
235 - 42x + 42x +
        label <- attr(data[[x]], "label")
236 - 42x + 42x +
        if (is.null(label)) {
237 - 40x + 40x +
          x
@@ -42100,7 +43694,8 @@

teal.slice coverage - 65.86%

239 - 2x + 2x +
          label
@@ -42121,7 +43716,8 @@

teal.slice coverage - 65.86%

242 - 9x + 9x +
      FUN.VALUE = character(1)
@@ -42694,21 +44290,24 @@

teal.slice coverage - 65.86%

76 - 15x + 15x +
      checkmate::assert_class(slice, "teal_slice_expr")
77 - 14x + 14x +
      private$teal_slice <- slice
78 - 14x + 14x +
      invisible(self)
@@ -42792,28 +44391,32 @@

teal.slice coverage - 65.86%

90 - 12x + 12x +
      sprintf(
91 - 12x + 12x +
        "%s:\n%s",
92 - 12x + 12x +
        class(self)[1],
93 - 12x + 12x +
        format(self$get_state(), show_all = show_all, trim_lines = trim_lines)
@@ -42883,7 +44486,8 @@

teal.slice coverage - 65.86%

103 - 1x + 1x +
      cat(isolate(self$format(...)))
@@ -42946,7 +44550,8 @@

teal.slice coverage - 65.86%

112 - 26x + 26x +
      private$teal_slice
@@ -43023,14 +44628,16 @@

teal.slice coverage - 65.86%

123 - 1x + 1x +
      checkmate::assert_class(state, "teal_slice_expr")
124 - 1x + 1x +
      invisible(self)
@@ -43142,7 +44749,8 @@

teal.slice coverage - 65.86%

140 - 2x + 2x +
      isolate(str2lang(private$teal_slice$expr))
@@ -44625,42 +46233,48 @@

teal.slice coverage - 65.86%

75 - 27x + 27x +
  checkmate::assert_string(inputId)
76 - 23x + 23x +
  checkmate::assert_vector(choices)
77 - 22x + 22x +
  checkmate::assert_numeric(countsmax, len = length(choices))
78 - 19x + 19x +
  checkmate::assert_numeric(countsnow, len = length(choices), null.ok = TRUE)
79 - 17x + 17x +
  if (!is.null(countsnow)) {
80 - 9x + 9x +
    checkmate::assert_true(all(countsnow <= countsmax))
@@ -44681,7 +46295,8 @@

teal.slice coverage - 65.86%

83 - 16x + 16x +
  ns <- NS(inputId)
@@ -44695,56 +46310,64 @@

teal.slice coverage - 65.86%

85 - 16x + 16x +
  mapply(
86 - 16x + 16x +
    countBar,
87 - 16x + 16x +
    inputId = ns(seq_along(choices)),
88 - 16x + 16x +
    label = as.character(choices),
89 - 16x + 16x +
    countmax = countsmax,
90 - 16x + 16x +
    countnow = if (is.null(countsnow)) rep(list(NULL), length(choices)) else countsnow,
91 - 16x + 16x +
    MoreArgs = list(
92 - 16x + 16x +
      counttotal = sum(countsmax)
@@ -44758,7 +46381,8 @@

teal.slice coverage - 65.86%

94 - 16x + 16x +
    SIMPLIFY = FALSE, USE.NAMES = FALSE
@@ -44933,35 +46557,40 @@

teal.slice coverage - 65.86%

119 - 70x + 70x +
  checkmate::assert_string(inputId)
120 - 66x + 66x +
  checkmate::assert_string(label)
121 - 63x + 63x +
  checkmate::assert_number(countmax)
122 - 61x + 61x +
  checkmate::assert_number(countnow, null.ok = TRUE, upper = countmax)
123 - 59x + 59x +
  checkmate::assert_number(counttotal, lower = countmax)
@@ -44975,35 +46604,40 @@

teal.slice coverage - 65.86%

125 - 57x + 57x +
  label <- make_count_text(label, countmax = countmax, countnow = countnow)
126 - 57x + 57x +
  ns <- NS(inputId)
127 - 26x + 26x +
  if (is.null(countnow)) countnow <- 0
128 - 57x + 57x +
  tags$div(
129 - 57x + 57x +
    class = "progress state-count-container",
@@ -45017,42 +46651,48 @@

teal.slice coverage - 65.86%

131 - 57x + 57x +
    tags$div(
132 - 57x + 57x +
      id = ns("count_bar_filtered"),
133 - 57x + 57x +
      class = "progress-bar state-count-bar-filtered",
134 - 57x + 57x +
      style = sprintf("width: %s%%", countnow / counttotal * 100),
135 - 57x + 57x +
      role = "progressbar",
136 - 57x + 57x +
      label
@@ -45066,35 +46706,40 @@

teal.slice coverage - 65.86%

138 - 57x + 57x +
    tags$div(
139 - 57x + 57x +
      id = ns("count_bar_unfiltered"),
140 - 57x + 57x +
      class = "progress-bar state-count-bar-unfiltered",
141 - 57x + 57x +
      style = sprintf("width: %s%%", (countmax - countnow) / counttotal * 100),
142 - 57x + 57x +
      role = "progressbar"
@@ -45143,28 +46788,32 @@

teal.slice coverage - 65.86%

149 - 7x + 7x +
  checkmate::assert_string(inputId)
150 - 7x + 7x +
  checkmate::assert_vector(choices)
151 - 7x + 7x +
  checkmate::assert_numeric(countsmax, len = length(choices))
152 - 7x + 7x +
  checkmate::assert_numeric(countsnow, len = length(choices), null.ok = TRUE)
@@ -45178,63 +46827,72 @@

teal.slice coverage - 65.86%

154 - 7x + 7x +
  ns <- NS(inputId)
155 - 7x + 7x +
  mapply(
156 - 7x + 7x +
    updateCountBar,
157 - 7x + 7x +
    inputId = ns(seq_along(choices)),
158 - 7x + 7x +
    label = choices,
159 - 7x + 7x +
    countmax = countsmax,
160 - 7x + 7x +
    countnow = if (is.null(countsnow)) rep(list(NULL), length(choices)) else countsnow,
161 - 7x + 7x +
    MoreArgs = list(
162 - 7x + 7x +
      counttotal = sum(countsmax)
@@ -45255,7 +46913,8 @@

teal.slice coverage - 65.86%

165 - 7x + 7x +
  invisible(NULL)
@@ -45290,35 +46949,40 @@

teal.slice coverage - 65.86%

170 - 18x + 18x +
  checkmate::assert_string(inputId)
171 - 18x + 18x +
  checkmate::assert_string(label)
172 - 18x + 18x +
  checkmate::assert_number(countmax)
173 - 18x + 18x +
  checkmate::assert_number(countnow, null.ok = TRUE)
174 - 18x + 18x +
  checkmate::assert_number(counttotal)
@@ -45332,70 +46996,80 @@

teal.slice coverage - 65.86%

176 - 18x + 18x +
  label <- make_count_text(label, countmax = countmax, countnow = countnow)
177 - 18x + 18x +
  if (is.null(countnow)) countnow <- countmax
178 - 18x + 18x +
  session$sendCustomMessage(
179 - 18x + 18x +
    type = "updateCountBar",
180 - 18x + 18x +
    message = list(
181 - 18x + 18x +
      id = session$ns(inputId),
182 - 18x + 18x +
      label = label,
183 - 18x + 18x +
      countmax = countmax,
184 - 18x + 18x +
      countnow = countnow,
185 - 18x + 18x +
      counttotal = counttotal
@@ -45423,7 +47097,8 @@

teal.slice coverage - 65.86%

189 - 18x + 18x +
  invisible(NULL)
@@ -45458,70 +47133,80 @@

teal.slice coverage - 65.86%

194 - 17x + 17x +
  checkmate::assert_string(inputId)
195 - 17x + 17x +
  checkmate::assert_string(label)
196 - 17x + 17x +
  checkmate::assert_number(countmax)
197 - 17x + 17x +
  checkmate::assert_number(countnow, null.ok = TRUE)
198 - 17x + 17x +
  label <- make_count_text(label, countmax = countmax, countnow = countnow)
199 - 17x + 17x +
  session$sendCustomMessage(
200 - 17x + 17x +
    type = "updateCountText",
201 - 17x + 17x +
    message = list(
202 - 17x + 17x +
      id = session$ns(inputId),
203 - 17x + 17x +
      label = label
@@ -45661,56 +47346,64 @@

teal.slice coverage - 65.86%

223 - 104x + 104x +
  checkmate::assert_string(label)
224 - 102x + 102x +
  checkmate::assert_number(countmax)
225 - 100x + 100x +
  checkmate::assert_number(countnow, null.ok = TRUE)
226 - 98x + 98x +
  sprintf(
227 - 98x + 98x +
    "%s (%s%s)",
228 - 98x + 98x +
    label,
229 - 98x + 98x +
    if (is.null(countnow)) "" else sprintf("%s/", countnow),
230 - 98x + 98x +
    countmax
@@ -45787,35 +47480,40 @@

teal.slice coverage - 65.86%

241 - 165x + 165x +
  checkmate::assert_numeric(counts)
242 - 165x + 165x +
  counts <- counts[match(choices, names(counts))]
243 - 165x + 165x +
  counts[is.na(counts)] <- 0
244 - 165x + 165x +
  names(counts) <- choices
245 - 165x + 165x +
  counts
@@ -46073,7 +47771,8 @@

teal.slice coverage - 65.86%

35 - 92x + 92x +
      if (!requireNamespace("SummarizedExperiment", quietly = TRUE)) {
@@ -46094,35 +47793,40 @@

teal.slice coverage - 65.86%

38 - 92x + 92x +
      checkmate::assert_function(data_reactive, args = "sid")
39 - 92x + 92x +
      checkmate::assert_class(data, "SummarizedExperiment")
40 - 91x + 91x +
      super$initialize(data, data_reactive, dataname, datalabel)
41 - 91x + 91x +
      if (!is.null(datalabel)) {
42 - 84x + 84x +
        private$dataname_prefixed <- sprintf("%s[['%s']]", dataname, datalabel)
@@ -46213,35 +47917,40 @@

teal.slice coverage - 65.86%

55 - 61x + 61x +
      isolate({
56 - 61x + 61x +
        logger::log_trace("{ class(self)[1] }$set_filter_state initializing, dataname: { private$dataname }")
57 - 61x + 61x +
        checkmate::assert_class(state, "teal_slices")
58 - 59x + 59x +
        lapply(state, function(x) {
59 - 17x + 17x +
          checkmate::assert_choice(x$arg, choices = c("subset", "select"), null.ok = TRUE, .var.name = "teal_slice$arg")
@@ -46255,21 +47964,24 @@

teal.slice coverage - 65.86%

61 - 59x + 59x +
        count_type <- attr(state, "count_type")
62 - 59x + 59x +
        if (length(count_type)) {
63 - 8x + 8x +
          private$count_type <- count_type
@@ -46290,35 +48002,40 @@

teal.slice coverage - 65.86%

66 - 59x + 59x +
        subset_states <- Filter(function(x) x$arg == "subset", state)
67 - 59x + 59x +
        private$set_filter_state_impl(
68 - 59x + 59x +
          state = subset_states,
69 - 59x + 59x +
          data = SummarizedExperiment::rowData(private$data),
70 - 59x + 59x +
          data_reactive = function(sid = "") {
@@ -46374,35 +48091,40 @@

teal.slice coverage - 65.86%

78 - 59x + 59x +
        select_states <- Filter(function(x) x$arg == "select", state)
79 - 59x + 59x +
        private$set_filter_state_impl(
80 - 59x + 59x +
          state = select_states,
81 - 59x + 59x +
          data = SummarizedExperiment::colData(private$data),
82 - 59x + 59x +
          data_reactive = function(sid = "") {
@@ -46458,14 +48180,16 @@

teal.slice coverage - 65.86%

90 - 59x + 59x +
        logger::log_trace("{ class(self)[1] }$set_filter_state initialized, dataname: { private$dataname }")
91 - 59x + 59x +
        invisible(NULL)
@@ -46535,49 +48259,56 @@

teal.slice coverage - 65.86%

101 - 2x + 2x +
      data <- private$data
102 - 2x + 2x +
      checkmate::assert_string(id)
103 - 2x + 2x +
      ns <- NS(id)
104 - 2x + 2x +
      row_input <- if (ncol(SummarizedExperiment::rowData(data)) == 0) {
105 - 1x + 1x +
        tags$div("no sample variables available")
106 - 2x + 2x +
      } else if (nrow(SummarizedExperiment::rowData(data)) == 0) {
107 - 1x + 1x +
        tags$div("no samples available")
@@ -46661,28 +48392,32 @@

teal.slice coverage - 65.86%

119 - 2x + 2x +
      col_input <- if (ncol(SummarizedExperiment::colData(data)) == 0) {
120 - 1x + 1x +
        tags$div("no sample variables available")
121 - 2x + 2x +
      } else if (nrow(SummarizedExperiment::colData(data)) == 0) {
122 - 1x + 1x +
        tags$div("no samples available")
@@ -46766,21 +48501,24 @@

teal.slice coverage - 65.86%

134 - 2x + 2x +
      tags$div(
135 - 2x + 2x +
        row_input,
136 - 2x + 2x +
        col_input
@@ -48473,14 +50211,16 @@

teal.slice coverage - 65.86%

71 - 103x + 103x +
      checkmate::assert_data_frame(dataset)
72 - 101x + 101x +
      super$initialize(dataset, dataname, keys, label)
@@ -48501,21 +50241,24 @@

teal.slice coverage - 65.86%

75 - 99x + 99x +
      if (!is.null(parent)) {
76 - 10x + 10x +
        checkmate::assert_character(parent_name, len = 1)
77 - 10x + 10x +
        checkmate::assert_character(join_keys, min.len = 1)
@@ -48529,14 +50272,16 @@

teal.slice coverage - 65.86%

79 - 10x + 10x +
        private$parent_name <- parent_name
80 - 10x + 10x +
        private$join_keys <- join_keys
@@ -48550,28 +50295,32 @@

teal.slice coverage - 65.86%

82 - 10x + 10x +
        private$data_filtered_fun <- function(sid = "") {
83 - 8x + 8x +
          checkmate::assert_character(sid)
84 - 8x + 8x +
          if (length(sid)) {
85 - 8x + 8x +
            logger::log_trace("filtering data dataname: { dataname }, sid: { sid }")
@@ -48599,42 +50348,48 @@

teal.slice coverage - 65.86%

89 - 8x + 8x +
          env <- new.env(parent = parent.env(globalenv()))
90 - 8x + 8x +
          env[[dataname]] <- private$dataset
91 - 8x + 8x +
          env[[parent_name]] <- parent()
92 - 8x + 8x +
          filter_call <- self$get_call(sid)
93 - 8x + 8x +
          eval_expr_with_msg(filter_call, env)
94 - 8x + 8x +
          get(x = dataname, envir = env)
@@ -48662,42 +50417,48 @@

teal.slice coverage - 65.86%

98 - 99x + 99x +
      private$add_filter_states(
99 - 99x + 99x +
        filter_states = init_filter_states(
100 - 99x + 99x +
          data = dataset,
101 - 99x + 99x +
          data_reactive = private$data_filtered_fun,
102 - 99x + 99x +
          dataname = dataname,
103 - 99x + 99x +
          keys = self$get_keys()
@@ -48711,7 +50472,8 @@

teal.slice coverage - 65.86%

105 - 99x + 99x +
        id = "filter"
@@ -48739,35 +50501,40 @@

teal.slice coverage - 65.86%

109 - 99x + 99x +
      if (!is.null(parent)) {
110 - 10x + 10x +
        fs <- teal_slices(
111 - 10x + 10x +
          exclude_varnames = structure(
112 - 10x + 10x +
            list(intersect(colnames(dataset), colnames(isolate(parent())))),
113 - 10x + 10x +
            names = private$dataname
@@ -48788,7 +50555,8 @@

teal.slice coverage - 65.86%

116 - 10x + 10x +
        self$set_filter_state(fs)
@@ -48809,7 +50577,8 @@

teal.slice coverage - 65.86%

119 - 99x + 99x +
      invisible(self)
@@ -48935,28 +50704,32 @@

teal.slice coverage - 65.86%

137 - 42x + 42x +
      logger::log_trace("DataframeFilteredDataset$get_call initializing for dataname: { private$dataname }")
138 - 42x + 42x +
      filter_call <- super$get_call(sid)
139 - 42x + 42x +
      dataname <- private$dataname
140 - 42x + 42x +
      parent_dataname <- private$parent_name
@@ -48970,28 +50743,32 @@

teal.slice coverage - 65.86%

142 - 42x + 42x +
      if (!identical(parent_dataname, character(0))) {
143 - 9x + 9x +
        join_keys <- private$join_keys
144 - 9x + 9x +
        parent_keys <- unname(join_keys)
145 - 9x + 9x +
        dataset_keys <- names(join_keys)
@@ -49005,7 +50782,8 @@

teal.slice coverage - 65.86%

147 - 9x + 9x +
        y_arg <- if (length(parent_keys) == 0L) {
@@ -49026,28 +50804,32 @@

teal.slice coverage - 65.86%

150 - 9x + 9x +
          sprintf(
151 - 9x + 9x +
            "%s[, c(%s), drop = FALSE]",
152 - 9x + 9x +
            parent_dataname,
153 - 9x + 9x +
            toString(dQuote(parent_keys, q = FALSE))
@@ -49075,7 +50857,8 @@

teal.slice coverage - 65.86%

157 - 9x + 9x +
        more_args <- if (length(parent_keys) == 0 || length(dataset_keys) == 0) {
@@ -49089,14 +50872,16 @@

teal.slice coverage - 65.86%

159 - 9x + 9x +
        } else if (identical(parent_keys, dataset_keys)) {
160 - 7x + 7x +
          list(by = parent_keys)
@@ -49110,7 +50895,8 @@

teal.slice coverage - 65.86%

162 - 2x + 2x +
          list(by = stats::setNames(parent_keys, dataset_keys))
@@ -49131,7 +50917,8 @@

teal.slice coverage - 65.86%

165 - 9x + 9x +
        merge_call <- call(
@@ -49145,49 +50932,56 @@

teal.slice coverage - 65.86%

167 - 9x + 9x +
          as.name(dataname),
168 - 9x + 9x +
          as.call(
169 - 9x + 9x +
            c(
170 - 9x + 9x +
              str2lang("dplyr::inner_join"),
171 - 9x + 9x +
              x = as.name(dataname),
172 - 9x + 9x +
              y = str2lang(y_arg),
173 - 9x + 9x +
              more_args
@@ -49222,7 +51016,8 @@

teal.slice coverage - 65.86%

178 - 9x + 9x +
        filter_call <- c(filter_call, merge_call)
@@ -49236,14 +51031,16 @@

teal.slice coverage - 65.86%

180 - 42x + 42x +
      logger::log_trace("DataframeFilteredDataset$get_call initializing for dataname: { private$dataname }")
181 - 42x + 42x +
      filter_call
@@ -49313,35 +51110,40 @@

teal.slice coverage - 65.86%

191 - 81x + 81x +
      isolate({
192 - 81x + 81x +
        logger::log_trace("{ class(self)[1] }$set_filter_state initializing, dataname: { private$dataname }")
193 - 81x + 81x +
        checkmate::assert_class(state, "teal_slices")
194 - 80x + 80x +
        lapply(state, function(slice) {
195 - 97x + 97x +
          checkmate::assert_true(slice$dataname == private$dataname)
@@ -49355,14 +51157,16 @@

teal.slice coverage - 65.86%

197 - 80x + 80x +
        private$get_filter_states()[[1L]]$set_filter_state(state = state)
198 - 80x + 80x +
        invisible(NULL)
@@ -49460,7 +51264,8 @@

teal.slice coverage - 65.86%

212 - 11x + 11x +
      checkmate::assert_class(state, "teal_slices")
@@ -49474,14 +51279,16 @@

teal.slice coverage - 65.86%

214 - 11x + 11x +
      isolate({
215 - 11x + 11x +
        logger::log_trace("{ class(self)[1] }$remove_filter_state removing filter(s), dataname: { private$dataname }")
@@ -49495,14 +51302,16 @@

teal.slice coverage - 65.86%

217 - 11x + 11x +
        varnames <- unique(unlist(lapply(state, "[[", "varname")))
218 - 11x + 11x +
        private$get_filter_states()[[1]]$remove_filter_state(state)
@@ -49516,7 +51325,8 @@

teal.slice coverage - 65.86%

220 - 11x + 11x +
        logger::log_trace("{ class(self)[1] }$remove_filter_state removed filter(s), dataname: { private$dataname }")
@@ -49537,7 +51347,8 @@

teal.slice coverage - 65.86%

223 - 11x + 11x +
      invisible(NULL)
@@ -49698,7 +51509,8 @@

teal.slice coverage - 65.86%

246 - 12x + 12x +
      logger::log_trace("FilteredDataset$srv_filter_overview initialized")
@@ -49719,14 +51531,16 @@

teal.slice coverage - 65.86%

249 - 12x + 12x +
      subject_keys <- if (length(private$parent_name) > 0) {
250 - 1x + 1x +
        names(private$join_keys)
@@ -49740,7 +51554,8 @@

teal.slice coverage - 65.86%

252 - 11x + 11x +
        self$get_keys()
@@ -49754,49 +51569,56 @@

teal.slice coverage - 65.86%

254 - 12x + 12x +
      dataset <- self$get_dataset()
255 - 12x + 12x +
      data_filtered <- self$get_dataset(TRUE)
256 - 12x + 12x +
      if (length(subject_keys) == 0) {
257 - 10x + 10x +
        data.frame(
258 - 10x + 10x +
          dataname = private$dataname,
259 - 10x + 10x +
          obs = nrow(dataset),
260 - 10x + 10x +
          obs_filtered = nrow(data_filtered())
@@ -49817,42 +51639,48 @@

teal.slice coverage - 65.86%

263 - 2x + 2x +
        data.frame(
264 - 2x + 2x +
          dataname = private$dataname,
265 - 2x + 2x +
          obs = nrow(dataset),
266 - 2x + 2x +
          obs_filtered = nrow(data_filtered()),
267 - 2x + 2x +
          subjects = nrow(unique(dataset[subject_keys])),
268 - 2x + 2x +
          subjects_filtered = nrow(unique(data_filtered()[subject_keys]))
@@ -51020,21 +52848,24 @@

teal.slice coverage - 65.86%

155 - 25x + 25x +
      isolate({
156 - 25x + 25x +
        checkmate::assert_multi_class(x, c("POSIXct", "POSIXlt"))
157 - 24x + 24x +
        checkmate::assert_class(x_reactive, "reactive")
@@ -51048,35 +52879,40 @@

teal.slice coverage - 65.86%

159 - 24x + 24x +
        super$initialize(
160 - 24x + 24x +
          x = x,
161 - 24x + 24x +
          x_reactive = x_reactive,
162 - 24x + 24x +
          slice = slice,
163 - 24x + 24x +
          extract_type = extract_type
@@ -51090,28 +52926,32 @@

teal.slice coverage - 65.86%

165 - 24x + 24x +
        checkmate::assert_multi_class(slice$choices, c("POSIXct", "POSIXlt"), null.ok = TRUE)
166 - 23x + 23x +
        private$set_choices(slice$choices)
167 - 15x + 15x +
        if (is.null(slice$selected)) slice$selected <- slice$choices
168 - 23x + 23x +
        private$set_selected(slice$selected)
@@ -51132,7 +52972,8 @@

teal.slice coverage - 65.86%

171 - 22x + 22x +
      invisible(self)
@@ -51209,14 +53050,16 @@

teal.slice coverage - 65.86%

182 - 7x + 7x +
      if (isFALSE(private$is_any_filtered())) {
183 - 1x + 1x +
        return(NULL)
@@ -51230,63 +53073,72 @@

teal.slice coverage - 65.86%

185 - 4x + 4x +
      if (missing(dataname)) dataname <- private$get_dataname()
186 - 6x + 6x +
      varname <- private$get_varname_prefixed(dataname)
187 - 6x + 6x +
      choices <- private$get_selected()
188 - 6x + 6x +
      tzone <- Find(function(x) x != "", attr(as.POSIXlt(choices), "tzone"))
189 - 6x + 6x +
      class <- class(choices)[1L]
190 - 6x + 6x +
      date_fun <- as.name(
191 - 6x + 6x +
        switch(class,
192 - 6x + 6x +
          "POSIXct" = "as.POSIXct",
193 - 6x + 6x +
          "POSIXlt" = "as.POSIXlt"
@@ -51307,21 +53159,24 @@

teal.slice coverage - 65.86%

196 - 6x + 6x +
      choices <- as.character(choices + c(0, 1))
197 - 6x + 6x +
      filter_call <-
198 - 6x + 6x +
        call(
@@ -51335,7 +53190,8 @@

teal.slice coverage - 65.86%

200 - 6x + 6x +
          call(
@@ -51349,14 +53205,16 @@

teal.slice coverage - 65.86%

202 - 6x + 6x +
            varname,
203 - 6x + 6x +
            as.call(list(date_fun, choices[1L], tz = tzone))
@@ -51370,7 +53228,8 @@

teal.slice coverage - 65.86%

205 - 6x + 6x +
          call(
@@ -51384,14 +53243,16 @@

teal.slice coverage - 65.86%

207 - 6x + 6x +
            varname,
208 - 6x + 6x +
            as.call(list(date_fun, choices[2L], tz = tzone))
@@ -51412,7 +53273,8 @@

teal.slice coverage - 65.86%

211 - 6x + 6x +
      private$add_keep_na_call(filter_call, varname)
@@ -51475,14 +53337,16 @@

teal.slice coverage - 65.86%

220 - 23x + 23x +
      if (is.null(choices)) {
221 - 20x + 20x +
        choices <- as.POSIXct(trunc(range(private$x, na.rm = TRUE), units = "secs"))
@@ -51496,28 +53360,32 @@

teal.slice coverage - 65.86%

223 - 3x + 3x +
        choices <- as.POSIXct(choices, units = "secs")
224 - 3x + 3x +
        choices_adjusted <- c(
225 - 3x + 3x +
          max(choices[1L], min(as.POSIXct(private$x), na.rm = TRUE)),
226 - 3x + 3x +
          min(choices[2L], max(as.POSIXct(private$x), na.rm = TRUE))
@@ -51531,28 +53399,32 @@

teal.slice coverage - 65.86%

228 - 3x + 3x +
        if (any(choices != choices_adjusted)) {
229 - 1x + 1x +
          warning(sprintf(
230 - 1x + 1x +
            "Choices adjusted (some values outside of variable range). Varname: %s, dataname: %s.",
231 - 1x + 1x +
            private$get_varname(), private$get_dataname()
@@ -51566,7 +53438,8 @@

teal.slice coverage - 65.86%

233 - 1x + 1x +
          choices <- choices_adjusted
@@ -51580,35 +53453,40 @@

teal.slice coverage - 65.86%

235 - 3x + 3x +
        if (choices[1L] >= choices[2L]) {
236 - 1x + 1x +
          warning(sprintf(
237 - 1x + 1x +
            "Invalid choices: lower is higher / equal to upper, or not in range of variable values.
238 - 1x + 1x +
            Setting defaults. Varname: %s, dataname: %s.",
239 - 1x + 1x +
            private$get_varname(), private$get_dataname()
@@ -51622,7 +53500,8 @@

teal.slice coverage - 65.86%

241 - 1x + 1x +
          choices <- range(private$x, na.rm = TRUE)
@@ -51650,14 +53529,16 @@

teal.slice coverage - 65.86%

245 - 23x + 23x +
      private$set_is_choice_limited(private$x, choices)
246 - 23x + 23x +
      private$x <- private$x[
@@ -51671,21 +53552,24 @@

teal.slice coverage - 65.86%

248 - 23x + 23x +
          as.POSIXct(trunc(private$x, units = "secs")) >= choices[1L] &
249 - 23x + 23x +
            as.POSIXct(trunc(private$x, units = "secs")) <= choices[2L]
250 - 23x + 23x +
        ) | is.na(private$x)
@@ -51699,14 +53583,16 @@

teal.slice coverage - 65.86%

252 - 23x + 23x +
      private$teal_slice$choices <- choices
253 - 23x + 23x +
      invisible(NULL)
@@ -51748,14 +53634,16 @@

teal.slice coverage - 65.86%

259 - 23x + 23x +
      private$is_choice_limited <- (any(xl < choices[1L], na.rm = TRUE) | any(xl > choices[2L], na.rm = TRUE))
260 - 23x + 23x +
      invisible(NULL)
@@ -51776,21 +53664,24 @@

teal.slice coverage - 65.86%

263 - 34x + 34x +
      tryCatch(
264 - 34x + 34x +
        expr = {
265 - 34x + 34x +
          values <- as.POSIXct(values, origin = "1970-01-01 00:00:00")
@@ -51804,7 +53695,8 @@

teal.slice coverage - 65.86%

267 - 31x + 31x +
          values
@@ -51818,7 +53710,8 @@

teal.slice coverage - 65.86%

269 - 34x + 34x +
        error = function(e) stop("Vector of set values must contain values coercible to POSIX.")
@@ -51846,42 +53739,48 @@

teal.slice coverage - 65.86%

273 - 1x + 1x +
      if (length(values) != 2) stop("Vector of set values must have length two.")
274 - 30x + 30x +
      if (values[1] > values[2]) {
275 - 1x + 1x +
        warning(
276 - 1x + 1x +
          sprintf(
277 - 1x + 1x +
            "Start date '%s' is set after the end date '%s', the values will be replaced by a default datetime range.",
278 - 1x + 1x +
            values[1], values[2]
@@ -51902,7 +53801,8 @@

teal.slice coverage - 65.86%

281 - 1x + 1x +
        values <- isolate(private$get_choices())
@@ -51916,7 +53816,8 @@

teal.slice coverage - 65.86%

283 - 30x + 30x +
      values
@@ -51937,42 +53838,48 @@

teal.slice coverage - 65.86%

286 - 30x + 30x +
      choices <- private$get_choices()
287 - 30x + 30x +
      if (values[1] < choices[1L] || values[1] > choices[2L]) {
288 - 5x + 5x +
        warning(
289 - 5x + 5x +
          sprintf(
290 - 5x + 5x +
            "Value: %s is outside of the range for the column '%s' in dataset '%s', setting minimum possible value.",
291 - 5x + 5x +
            values[1], private$get_varname(), toString(private$get_dataname())
@@ -51993,7 +53900,8 @@

teal.slice coverage - 65.86%

294 - 5x + 5x +
        values[1] <- choices[1L]
@@ -52014,35 +53922,40 @@

teal.slice coverage - 65.86%

297 - 30x + 30x +
      if (values[2] > choices[2L] | values[2] < choices[1L]) {
298 - 5x + 5x +
        warning(
299 - 5x + 5x +
          sprintf(
300 - 5x + 5x +
            "Value: '%s' is outside of the range for the column '%s' in dataset '%s', setting maximum possible value.",
301 - 5x + 5x +
            values[2], private$get_varname(), toString(private$get_dataname())
@@ -52063,7 +53976,8 @@

teal.slice coverage - 65.86%

304 - 5x + 5x +
        values[2] <- choices[2L]
@@ -52084,7 +53998,8 @@

teal.slice coverage - 65.86%

307 - 30x + 30x +
      values
@@ -54722,28 +56637,32 @@

teal.slice coverage - 65.86%

130 - 16x + 16x +
      isolate({
131 - 16x + 16x +
        checkmate::assert_logical(x)
132 - 15x + 15x +
        checkmate::assert_logical(slice$selected, null.ok = TRUE)
133 - 14x + 14x +
        super$initialize(x = x, x_reactive = x_reactive, slice = slice, extract_type = extract_type)
@@ -54757,7 +56676,8 @@

teal.slice coverage - 65.86%

135 - 14x + 14x +
        private$set_choices(slice$choices)
@@ -54771,28 +56691,32 @@

teal.slice coverage - 65.86%

137 - 14x + 14x +
        if (is.null(slice$selected) && slice$multiple) {
138 - 7x + 7x +
          slice$selected <- private$get_choices()
139 - 7x + 7x +
        } else if (length(slice$selected) != 1 && !slice$multiple) {
140 - 3x + 3x +
          slice$selected <- TRUE
@@ -54806,28 +56730,32 @@

teal.slice coverage - 65.86%

142 - 14x + 14x +
        private$set_selected(slice$selected)
143 - 14x + 14x +
        df <- factor(x, levels = c(TRUE, FALSE))
144 - 14x + 14x +
        tbl <- table(df)
145 - 14x + 14x +
        private$set_choices_counts(tbl)
@@ -54841,7 +56769,8 @@

teal.slice coverage - 65.86%

147 - 14x + 14x +
      invisible(self)
@@ -54911,7 +56840,8 @@

teal.slice coverage - 65.86%

157 - 6x + 6x +
      if (isFALSE(private$is_any_filtered())) {
@@ -54932,28 +56862,32 @@

teal.slice coverage - 65.86%

160 - 4x + 4x +
      if (missing(dataname)) dataname <- private$get_dataname()
161 - 6x + 6x +
      varname <- private$get_varname_prefixed(dataname)
162 - 6x + 6x +
      choices <- private$get_selected()
163 - 6x + 6x +
      n_choices <- length(choices)
@@ -54967,35 +56901,40 @@

teal.slice coverage - 65.86%

165 - 6x + 6x +
      filter_call <-
166 - 6x + 6x +
        if (n_choices == 1 && choices) {
167 - 1x + 1x +
          varname
168 - 6x + 6x +
        } else if (n_choices == 1 && !choices) {
169 - 4x + 4x +
          call("!", varname)
@@ -55009,7 +56948,8 @@

teal.slice coverage - 65.86%

171 - 1x + 1x +
          call("%in%", varname, make_c_call(choices))
@@ -55023,7 +56963,8 @@

teal.slice coverage - 65.86%

173 - 6x + 6x +
      private$add_keep_na_call(filter_call, varname)
@@ -55093,14 +57034,16 @@

teal.slice coverage - 65.86%

183 - 14x + 14x +
      private$teal_slice$choices <- c(TRUE, FALSE)
184 - 14x + 14x +
      invisible(NULL)
@@ -55135,14 +57078,16 @@

teal.slice coverage - 65.86%

189 - 14x + 14x +
      private$choices_counts <- choices_counts
190 - 14x + 14x +
      invisible(NULL)
@@ -55163,35 +57108,40 @@

teal.slice coverage - 65.86%

193 - 21x + 21x +
      tryCatch(
194 - 21x + 21x +
        expr = {
195 - 21x + 21x +
          values <- as.logical(values)
196 - 1x + 1x +
          if (anyNA(values)) stop()
197 - 20x + 20x +
          values
@@ -55205,7 +57155,8 @@

teal.slice coverage - 65.86%

199 - 21x + 21x +
        error = function(e) stop("Vector of set values must contain values coercible to logical.")
@@ -55240,28 +57191,32 @@

teal.slice coverage - 65.86%

204 - 20x + 20x +
      if (!private$is_multiple() && length(values) > 1) {
205 - 1x + 1x +
        warning(
206 - 1x + 1x +
          sprintf("Selection: %s is not a vector of length one. ", toString(values, width = 360)),
207 - 1x + 1x +
          "Maintaining previous selection."
@@ -55275,7 +57230,8 @@

teal.slice coverage - 65.86%

209 - 1x + 1x +
        values <- isolate(private$get_selected())
@@ -55289,7 +57245,8 @@

teal.slice coverage - 65.86%

211 - 20x + 20x +
      values
@@ -55331,7 +57288,8 @@

teal.slice coverage - 65.86%

217 - 6x + 6x +
      if (private$is_choice_limited) {
@@ -55345,14 +57303,16 @@

teal.slice coverage - 65.86%

219 - 6x + 6x +
      } else if (all(private$choices_counts > 0)) {
220 - 6x + 6x +
        TRUE
@@ -56961,21 +58921,24 @@

teal.slice coverage - 65.86%

39 - 9x + 9x +
  checkmate::assert_multi_class(data, c("data.frame", "DataFrame", "matrix"))
40 - 9x + 9x +
  checkmate::assert_character(columns, any.missing = FALSE, null.ok = TRUE)
41 - 9x + 9x +
  checkmate::assert_subset(columns, colnames(data))
@@ -56989,7 +58952,8 @@

teal.slice coverage - 65.86%

43 - 9x + 9x +
  if (is.matrix(data)) {
@@ -57059,14 +59023,16 @@

teal.slice coverage - 65.86%

53 - 9x + 9x +
    types <- vapply(data, function(x) class(x)[1L], character(1L))
54 - 9x + 9x +
    if (!is.null(columns)) types <- types[columns]
@@ -57087,7 +59053,8 @@

teal.slice coverage - 65.86%

57 - 9x + 9x +
  types
@@ -57268,7 +59235,8 @@

teal.slice coverage - 65.86%

24 - 9x + 9x +
  if (is.factor(choices)) {
@@ -57296,35 +59264,40 @@

teal.slice coverage - 65.86%

28 - 9x + 9x +
  stopifnot(
29 - 9x + 9x +
    is.character(choices) ||
30 - 9x + 9x +
      is.numeric(choices) ||
31 - 9x + 9x +
      is.logical(choices) ||
32 - 9x + 9x +
      (length(choices) == 1 && is.na(choices))
@@ -57345,7 +59318,8 @@

teal.slice coverage - 65.86%

35 - 9x + 9x +
  if (is.factor(labels)) {
@@ -57373,14 +59347,16 @@

teal.slice coverage - 65.86%

39 - 9x + 9x +
  checkmate::assert_character(labels[!is.na(labels)], any.missing = FALSE)
40 - 9x + 9x +
  if (length(choices) != length(labels)) {
@@ -57401,14 +59377,16 @@

teal.slice coverage - 65.86%

43 - 9x + 9x +
  stopifnot(is.null(subset) || is.vector(subset))
44 - 9x + 9x +
  stopifnot(is.null(types) || is.vector(types))
@@ -57422,14 +59400,16 @@

teal.slice coverage - 65.86%

46 - 9x + 9x +
  if (is.vector(types)) {
47 - 9x + 9x +
    stopifnot(length(choices) == length(types))
@@ -57450,7 +59430,8 @@

teal.slice coverage - 65.86%

50 - 9x + 9x +
  if (!is.null(subset)) {
@@ -57513,56 +59494,64 @@

teal.slice coverage - 65.86%

59 - 9x + 9x +
  is_dupl <- duplicated(choices)
60 - 9x + 9x +
  choices <- choices[!is_dupl]
61 - 9x + 9x +
  labels <- labels[!is_dupl]
62 - 9x + 9x +
  types <- types[!is_dupl]
63 - 9x + 9x +
  labels[is.na(labels)] <- "Label Missing"
64 - 9x + 9x +
  raw_labels <- labels
65 - 9x + 9x +
  combined_labels <- if (length(choices) > 0) {
66 - 9x + 9x +
    paste0(choices, ": ", labels)
@@ -57597,7 +59586,8 @@

teal.slice coverage - 65.86%

71 - 9x + 9x +
  if (!is.null(subset)) {
@@ -57646,49 +59636,56 @@

teal.slice coverage - 65.86%

78 - 9x + 9x +
  choices <- structure(
79 - 9x + 9x +
    choices,
80 - 9x + 9x +
    names = combined_labels,
81 - 9x + 9x +
    raw_labels = raw_labels,
82 - 9x + 9x +
    combined_labels = combined_labels,
83 - 9x + 9x +
    class = c("choices_labeled", "character"),
84 - 9x + 9x +
    types = types
@@ -57709,7 +59706,8 @@

teal.slice coverage - 65.86%

87 - 9x + 9x +
  choices
@@ -58569,28 +60567,32 @@

teal.slice coverage - 65.86%

121 - 3x + 3x +
  checkmate::assert_multi_class(datasets, c("FilteredData", "FilterPanelAPI"))
122 - 3x + 3x +
  checkmate::assert_class(filter, "teal_slices")
123 - 3x + 3x +
  datasets$set_filter_state(filter)
124 - 3x + 3x +
  invisible(NULL)
@@ -58632,14 +60634,16 @@

teal.slice coverage - 65.86%

130 - 4x + 4x +
  checkmate::assert_multi_class(datasets, c("FilteredData", "FilterPanelAPI"))
131 - 4x + 4x +
  if (isRunning()) {
@@ -58660,7 +60664,8 @@

teal.slice coverage - 65.86%

134 - 4x + 4x +
    isolate(datasets$get_filter_state())
@@ -58709,14 +60714,16 @@

teal.slice coverage - 65.86%

141 - 1x + 1x +
  checkmate::assert_multi_class(datasets, c("FilteredData", "FilterPanelAPI"))
142 - 1x + 1x +
  checkmate::assert_class(filter, "teal_slices")
@@ -58730,14 +60737,16 @@

teal.slice coverage - 65.86%

144 - 1x + 1x +
  datasets$remove_filter_state(filter)
145 - 1x + 1x +
  invisible(NULL)
@@ -58779,21 +60788,24 @@

teal.slice coverage - 65.86%

151 - 1x + 1x +
  checkmate::assert_multi_class(datasets, c("FilteredData", "FilterPanelAPI"))
152 - 1x + 1x +
  datasets$clear_filter_states(force = force)
153 - 1x + 1x +
  invisible(NULL)
@@ -58912,28 +60924,32 @@

teal.slice coverage - 65.86%

170 - 2x + 2x +
  checkmate::assert_character(datanames, min.len = 1, any.missing = FALSE)
171 - 2x + 2x +
  stopifnot(
172 - 2x + 2x +
    is(datasets, "FilteredData"),
173 - 2x + 2x +
    all(datanames %in% datasets$datanames())
@@ -58954,35 +60970,40 @@

teal.slice coverage - 65.86%

176 - 2x + 2x +
  paste(
177 - 2x + 2x +
    unlist(lapply(
178 - 2x + 2x +
      datanames,
179 - 2x + 2x +
      function(dataname) {
180 - 4x + 4x +
        datasets$get_call(dataname)
@@ -59003,7 +61024,8 @@

teal.slice coverage - 65.86%

183 - 2x + 2x +
    collapse = "\n"
@@ -59408,7 +61430,8 @@

teal.slice coverage - 65.86%

55 - 23x + 23x +
      if (!requireNamespace("MultiAssayExperiment", quietly = TRUE)) {
@@ -59429,21 +61452,24 @@

teal.slice coverage - 65.86%

58 - 23x + 23x +
      checkmate::assert_class(dataset, "MultiAssayExperiment")
59 - 21x + 21x +
      super$initialize(dataset, dataname, keys, label)
60 - 21x + 21x +
      experiment_names <- names(dataset)
@@ -59464,49 +61490,56 @@

teal.slice coverage - 65.86%

63 - 21x + 21x +
      private$add_filter_states(
64 - 21x + 21x +
        filter_states = init_filter_states(
65 - 21x + 21x +
          data = dataset,
66 - 21x + 21x +
          data_reactive = private$data_filtered_fun,
67 - 21x + 21x +
          dataname = dataname,
68 - 21x + 21x +
          datalabel = "subjects",
69 - 21x + 21x +
          keys = self$get_keys()
@@ -59520,7 +61553,8 @@

teal.slice coverage - 65.86%

71 - 21x + 21x +
        id = "subjects"
@@ -59555,70 +61589,80 @@

teal.slice coverage - 65.86%

76 - 21x + 21x +
      lapply(
77 - 21x + 21x +
        experiment_names,
78 - 21x + 21x +
        function(experiment_name) {
79 - 105x + 105x +
          data_reactive <- function(sid = "") private$data_filtered_fun(sid)[[experiment_name]]
80 - 105x + 105x +
          private$add_filter_states(
81 - 105x + 105x +
            filter_states = init_filter_states(
82 - 105x + 105x +
              data = dataset[[experiment_name]],
83 - 105x + 105x +
              data_reactive = data_reactive,
84 - 105x + 105x +
              dataname = dataname,
85 - 105x + 105x +
              datalabel = experiment_name
@@ -59632,7 +61676,8 @@

teal.slice coverage - 65.86%

87 - 105x + 105x +
            id = experiment_name
@@ -59723,35 +61768,40 @@

teal.slice coverage - 65.86%

100 - 15x + 15x +
      isolate({
101 - 15x + 15x +
        logger::log_trace("{ class(self)[1] }$set_filter_state initializing, dataname: { private$dataname }")
102 - 15x + 15x +
        checkmate::assert_class(state, "teal_slices")
103 - 14x + 14x +
        lapply(state, function(x) {
104 - 52x + 52x +
          checkmate::assert_true(x$dataname == private$dataname, .var.name = "dataname matches private$dataname")
@@ -59779,14 +61829,16 @@

teal.slice coverage - 65.86%

108 - 14x + 14x +
        subject_state <- Filter(function(x) is.null(x$experiment), state)
109 - 14x + 14x +
        private$get_filter_states()[["subjects"]]$set_filter_state(subject_state)
@@ -59814,28 +61866,32 @@

teal.slice coverage - 65.86%

113 - 14x + 14x +
        experiments <- unique(unlist(lapply(state, "[[", "experiment")))
114 - 14x + 14x +
        available_experiments <- setdiff(names(private$get_filter_states()), "subjects")
115 - 14x + 14x +
        excluded_filters <- setdiff(experiments, available_experiments)
116 - 14x + 14x +
        if (length(excluded_filters)) {
@@ -59905,21 +61961,24 @@

teal.slice coverage - 65.86%

126 - 14x + 14x +
        lapply(available_experiments, function(experiment) {
127 - 70x + 70x +
          slices <- Filter(function(x) identical(x$experiment, experiment), state)
128 - 70x + 70x +
          private$get_filter_states()[[experiment]]$set_filter_state(slices)
@@ -59940,7 +61999,8 @@

teal.slice coverage - 65.86%

131 - 14x + 14x +
        logger::log_trace("{ class(self)[1] }$set_filter_state initialized, dataname: { private$dataname }")
@@ -59954,7 +62014,8 @@

teal.slice coverage - 65.86%

133 - 14x + 14x +
        invisible(NULL)
@@ -60052,7 +62113,8 @@

teal.slice coverage - 65.86%

147 - 1x + 1x +
      checkmate::assert_class(state, "teal_slices")
@@ -60066,14 +62128,16 @@

teal.slice coverage - 65.86%

149 - 1x + 1x +
      isolate({
150 - 1x + 1x +
        logger::log_trace("{ class(self)[1] }$remove_filter_state removing filter(s), dataname: { private$dataname }")
@@ -60087,14 +62151,16 @@

teal.slice coverage - 65.86%

152 - 1x + 1x +
        subject_state <- Filter(function(x) is.null(x$experiment), state)
153 - 1x + 1x +
        private$get_filter_states()[["subjects"]]$remove_filter_state(subject_state)
@@ -60122,28 +62188,32 @@

teal.slice coverage - 65.86%

157 - 1x + 1x +
        experiments <- unique(unlist(lapply(state, "[[", "experiment")))
158 - 1x + 1x +
        available_experiments <- setdiff(names(private$get_filter_states()), "subjects")
159 - 1x + 1x +
        excluded_filters <- setdiff(experiments, available_experiments)
160 - 1x + 1x +
        if (length(excluded_filters)) {
@@ -60206,7 +62276,8 @@

teal.slice coverage - 65.86%

169 - 1x + 1x +
        lapply(experiments, function(experiment) {
@@ -60248,7 +62319,8 @@

teal.slice coverage - 65.86%

175 - 1x + 1x +
        logger::log_trace("{ class(self)[1] }$remove_filter_state removed filter(s), dataname: { private$dataname }")
@@ -60269,7 +62341,8 @@

teal.slice coverage - 65.86%

178 - 1x + 1x +
      invisible(NULL)
@@ -60556,21 +62629,24 @@

teal.slice coverage - 65.86%

219 - 2x + 2x +
      data <- self$get_dataset()
220 - 2x + 2x +
      data_filtered <- self$get_dataset(TRUE)
221 - 2x + 2x +
      experiment_names <- names(data)
@@ -60584,28 +62660,32 @@

teal.slice coverage - 65.86%

223 - 2x + 2x +
      mae_info <- data.frame(
224 - 2x + 2x +
        dataname = private$dataname,
225 - 2x + 2x +
        subjects = nrow(SummarizedExperiment::colData(data)),
226 - 2x + 2x +
        subjects_filtered = nrow(SummarizedExperiment::colData(data_filtered()))
@@ -60626,49 +62706,56 @@

teal.slice coverage - 65.86%

229 - 2x + 2x +
      experiment_obs_info <- do.call("rbind", lapply(
230 - 2x + 2x +
        experiment_names,
231 - 2x + 2x +
        function(experiment_name) {
232 - 10x + 10x +
          data.frame(
233 - 10x + 10x +
            dataname = sprintf("- %s", experiment_name),
234 - 10x + 10x +
            obs = nrow(data[[experiment_name]]),
235 - 10x + 10x +
            obs_filtered = nrow(data_filtered()[[experiment_name]])
@@ -60703,21 +62790,24 @@

teal.slice coverage - 65.86%

240 - 2x + 2x +
      get_experiment_keys <- function(mae, experiment) {
241 - 20x + 20x +
        sample_subset <- subset(MultiAssayExperiment::sampleMap(mae), colname %in% colnames(experiment))
242 - 20x + 20x +
        length(unique(sample_subset$primary))
@@ -60738,42 +62828,48 @@

teal.slice coverage - 65.86%

245 - 2x + 2x +
      experiment_subjects_info <- do.call("rbind", lapply(
246 - 2x + 2x +
        experiment_names,
247 - 2x + 2x +
        function(experiment_name) {
248 - 10x + 10x +
          data.frame(
249 - 10x + 10x +
            subjects = get_experiment_keys(data, data[[experiment_name]]),
250 - 10x + 10x +
            subjects_filtered = get_experiment_keys(data_filtered(), data_filtered()[[experiment_name]])
@@ -60808,14 +62904,16 @@

teal.slice coverage - 65.86%

255 - 2x + 2x +
      experiment_info <- cbind(experiment_obs_info, experiment_subjects_info)
256 - 2x + 2x +
      dplyr::bind_rows(mae_info, experiment_info)
@@ -61283,42 +63381,48 @@

teal.slice coverage - 65.86%

63 - 6x + 6x +
      isolate({
64 - 6x + 6x +
        super$initialize(
65 - 6x + 6x +
          x = x,
66 - 6x + 6x +
          x_reactive = x_reactive,
67 - 6x + 6x +
          slice = slice,
68 - 6x + 6x +
          extract_type = extract_type
@@ -61332,14 +63436,16 @@

teal.slice coverage - 65.86%

70 - 6x + 6x +
        private$set_choices(slice$choices)
71 - 6x + 6x +
        private$set_selected(slice$selected)
@@ -61360,7 +63466,8 @@

teal.slice coverage - 65.86%

74 - 6x + 6x +
      invisible(self)
@@ -61430,14 +63537,16 @@

teal.slice coverage - 65.86%

84 - 2x + 2x +
      if (isFALSE(private$is_any_filtered())) {
85 - 1x + 1x +
        return(NULL)
@@ -61451,14 +63560,16 @@

teal.slice coverage - 65.86%

87 - 1x + 1x +
      if (missing(dataname)) dataname <- private$get_dataname()
88 - 1x + 1x +
      filter_call <- if (isTRUE(private$get_keep_na())) {
@@ -61479,7 +63590,8 @@

teal.slice coverage - 65.86%

91 - 1x + 1x +
        substitute(!is.na(varname), list(varname = private$get_varname_prefixed(dataname)))
@@ -61591,14 +63703,16 @@

teal.slice coverage - 65.86%

107 - 6x + 6x +
      private$teal_slice$choices <- choices
108 - 6x + 6x +
      invisible(NULL)
@@ -61654,7 +63768,8 @@

teal.slice coverage - 65.86%

116 - 2x + 2x +
      if (private$is_choice_limited) {
@@ -61675,7 +63790,8 @@

teal.slice coverage - 65.86%

119 - 2x + 2x +
        !isTRUE(private$get_keep_na())
@@ -62717,49 +64833,56 @@

teal.slice coverage - 65.86%

95 - 764x + 764x +
  slices <- list(...)
96 - 764x + 764x +
  checkmate::assert_list(slices, types = "teal_slice", any.missing = FALSE)
97 - 763x + 763x +
  slices_id <- isolate(vapply(slices, `[[`, character(1L), "id"))
98 - 763x + 763x +
  if (any(duplicated(slices_id))) {
99 - 1x + 1x +
    stop(
100 - 1x + 1x +
      "Some teal_slice objects have the same id:\n",
101 - 1x + 1x +
      toString(unique(slices_id[duplicated(slices_id)]))
@@ -62780,35 +64903,40 @@

teal.slice coverage - 65.86%

104 - 762x + 762x +
  checkmate::assert_list(exclude_varnames, names = "named", types = "character", null.ok = TRUE, min.len = 1)
105 - 761x + 761x +
  checkmate::assert_list(include_varnames, names = "named", types = "character", null.ok = TRUE, min.len = 1)
106 - 760x + 760x +
  checkmate::assert_character(count_type, len = 1, null.ok = TRUE)
107 - 758x + 758x +
  checkmate::assert_subset(count_type, choices = c("all", "none"), empty.ok = TRUE)
108 - 757x + 757x +
  checkmate::assert_logical(allow_add)
@@ -62822,35 +64950,40 @@

teal.slice coverage - 65.86%

110 - 756x + 756x +
  duplicated_datasets <- intersect(names(include_varnames), names(exclude_varnames))
111 - 756x + 756x +
  if (length(duplicated_datasets)) {
112 - 1x + 1x +
    stop(
113 - 1x + 1x +
      "Some datasets are specified in both, include_varnames and exclude_varnames:\n",
114 - 1x + 1x +
      toString(duplicated_datasets)
@@ -62878,49 +65011,56 @@

teal.slice coverage - 65.86%

118 - 755x + 755x +
  structure(
119 - 755x + 755x +
    slices,
120 - 755x + 755x +
    exclude_varnames = exclude_varnames,
121 - 755x + 755x +
    include_varnames = include_varnames,
122 - 755x + 755x +
    count_type = count_type,
123 - 755x + 755x +
    allow_add = allow_add,
124 - 755x + 755x +
    class = c("teal_slices", class(slices))
@@ -63053,7 +65193,8 @@

teal.slice coverage - 65.86%

143 - 465x + 465x +
  inherits(x, "teal_slices")
@@ -63193,21 +65334,24 @@

teal.slice coverage - 65.86%

163 - 1077x + 1077x +
  ans <- unclass(x)
164 - 45x + 45x +
  if (recursive) ans[] <- lapply(ans, as.list)
165 - 1077x + 1077x +
  ans
@@ -63263,21 +65407,24 @@

teal.slice coverage - 65.86%

173 - 3x + 3x +
  if (missing(i)) i <- seq_along(x)
174 - 506x + 506x +
  if (length(i) == 0L) {
175 - 178x + 178x +
    return(x[0])
@@ -63291,35 +65438,40 @@

teal.slice coverage - 65.86%

177 - 1x + 1x +
  if (is.logical(i) && length(i) > length(x)) stop("subscript out of bounds")
178 - 1x + 1x +
  if (is.numeric(i) && max(i) > length(x)) stop("subscript out of bounds")
179 - 326x + 326x +
  if (is.character(i)) {
180 - 1x + 1x +
    if (!all(is.element(i, names(x)))) stop("subscript out of bounds")
181 - 2x + 2x +
    i <- which(is.element(i, names(x)))
@@ -63340,35 +65492,40 @@

teal.slice coverage - 65.86%

184 - 325x + 325x +
  y <- NextMethod("[")
185 - 325x + 325x +
  attrs <- attributes(x)
186 - 325x + 325x +
  attrs$names <- attrs$names[i]
187 - 325x + 325x +
  attributes(y) <- attrs
188 - 325x + 325x +
  y
@@ -63424,14 +65581,16 @@

teal.slice coverage - 65.86%

196 - 252x + 252x +
  x <- list(...)
197 - 252x + 252x +
  checkmate::assert_true(all(vapply(x, is.teal_slices, logical(1L))), .var.name = "all arguments are teal_slices")
@@ -63445,21 +65604,24 @@

teal.slice coverage - 65.86%

199 - 251x + 251x +
  all_attributes <- lapply(x, attributes)
200 - 251x + 251x +
  all_attributes <- coalesce_r(all_attributes)
201 - 251x + 251x +
  all_attributes <- all_attributes[names(all_attributes) != "class"]
@@ -63473,35 +65635,40 @@

teal.slice coverage - 65.86%

203 - 251x + 251x +
  do.call(
204 - 251x + 251x +
    teal_slices,
205 - 251x + 251x +
    c(
206 - 251x + 251x +
      unique(unlist(x, recursive = FALSE)),
207 - 251x + 251x +
      all_attributes
@@ -63585,14 +65752,16 @@

teal.slice coverage - 65.86%

219 - 45x + 45x +
  checkmate::assert_flag(show_all)
220 - 45x + 45x +
  checkmate::assert_flag(trim_lines)
@@ -63606,35 +65775,40 @@

teal.slice coverage - 65.86%

222 - 45x + 45x +
  x <- as.list(x, recursive = TRUE)
223 - 45x + 45x +
  attrs <- attributes(x)
224 - 45x + 45x +
  attributes(x) <- NULL
225 - 45x + 45x +
  slices_list <- list(slices = x, attributes = attrs)
226 - 45x + 45x +
  slices_list <- Filter(Negate(is.null), slices_list) # drop attributes if empty
@@ -63648,7 +65822,8 @@

teal.slice coverage - 65.86%

228 - 20x + 20x +
  if (!show_all) slices_list$slices <- lapply(slices_list$slices, function(slice) Filter(Negate(is.null), slice))
@@ -63662,7 +65837,8 @@

teal.slice coverage - 65.86%

230 - 45x + 45x +
  jsonify(slices_list, trim_lines)
@@ -63711,7 +65887,8 @@

teal.slice coverage - 65.86%

237 - 2x + 2x +
  cat(format(x, ...), "\n")
@@ -63795,21 +65972,24 @@

teal.slice coverage - 65.86%

249 - 14x + 14x +
  Filter(
250 - 14x + 14x +
    function(xx) {
251 - 12x + 12x +
      !any(vapply(y, function(yy) identical(yy, xx), logical(1)))
@@ -63823,7 +66003,8 @@

teal.slice coverage - 65.86%

253 - 14x + 14x +
    x
@@ -63970,28 +66151,32 @@

teal.slice coverage - 65.86%

274 - 1569x + 1569x +
  checkmate::assert_list(x)
275 - 1568x + 1568x +
  xnn <- Filter(Negate(is.null), x)
276 - 1568x + 1568x +
  if (all(vapply(xnn, is.atomic, logical(1L)))) {
277 - 1059x + 1059x +
    return(xnn[[1L]])
@@ -64005,21 +66190,24 @@

teal.slice coverage - 65.86%

279 - 509x + 509x +
  lapply(x, checkmate::assert_list, names = "named", null.ok = TRUE, .var.name = "list element")
280 - 508x + 508x +
  all_names <- unique(unlist(lapply(x, names)))
281 - 508x + 508x +
  sapply(all_names, function(nm) coalesce_r(lapply(x, `[[`, nm)), simplify = FALSE)
@@ -64319,7 +66507,8 @@

teal.slice coverage - 65.86%

41 - 24x + 24x +
      super$initialize(dataset = dataset, dataname = dataname, label = label)
@@ -64403,35 +66592,40 @@

teal.slice coverage - 65.86%

53 - 4x + 4x +
      class_string <- toString(class(private$dataset))
54 - 4x + 4x +
      if (trim_lines) {
55 - 2x + 2x +
        trim_position <- 37L
56 - 2x + 2x +
        class_string <- strtrim(class_string, trim_position)
57 - 2x + 2x +
        substr(class_string, 35L, 37L) <- "..."
@@ -64445,7 +66639,8 @@

teal.slice coverage - 65.86%

59 - 4x + 4x +
      sprintf(" - unfiltered dataset:\t\"%s\":   %s", private$dataname, class_string)
@@ -64487,7 +66682,8 @@

teal.slice coverage - 65.86%

65 - 1x + 1x +
      invisible(NULL)
@@ -64515,7 +66711,8 @@

teal.slice coverage - 65.86%

69 - 2x + 2x +
      invisible(NULL)
@@ -64550,14 +66747,16 @@

teal.slice coverage - 65.86%

74 - 3x + 3x +
      if (length(state) != 0L) {
75 - 1x + 1x +
        warning("DefaultFilterState cannot set state")
@@ -64571,7 +66770,8 @@

teal.slice coverage - 65.86%

77 - 3x + 3x +
      invisible(NULL)
@@ -64606,7 +66806,8 @@

teal.slice coverage - 65.86%

82 - 1x + 1x +
      invisible(NULL)
@@ -64662,7 +66863,8 @@

teal.slice coverage - 65.86%

90 - 1x + 1x +
      data.frame(dataname = private$dataname, obs = NA, obs_filtered = NA)
@@ -65543,7 +67745,8 @@

teal.slice coverage - 65.86%

92 - 107x + 107x +
  UseMethod("init_filtered_dataset")
@@ -65627,56 +67830,64 @@

teal.slice coverage - 65.86%

104 - 83x + 83x +
  DataframeFilteredDataset$new(
105 - 83x + 83x +
    dataset = dataset,
106 - 83x + 83x +
    dataname = dataname,
107 - 83x + 83x +
    keys = keys,
108 - 83x + 83x +
    parent_name = parent_name,
109 - 83x + 83x +
    parent = parent,
110 - 83x + 83x +
    join_keys = join_keys,
111 - 83x + 83x +
    label = label
@@ -65767,7 +67978,8 @@

teal.slice coverage - 65.86%

124 - 7x + 7x +
  if (!requireNamespace("MultiAssayExperiment", quietly = TRUE)) {
@@ -65788,35 +68000,40 @@

teal.slice coverage - 65.86%

127 - 7x + 7x +
  MAEFilteredDataset$new(
128 - 7x + 7x +
    dataset = dataset,
129 - 7x + 7x +
    dataname = dataname,
130 - 7x + 7x +
    keys = keys,
131 - 7x + 7x +
    label = label
@@ -65907,28 +68124,32 @@

teal.slice coverage - 65.86%

144 - 17x + 17x +
  DefaultFilteredDataset$new(
145 - 17x + 17x +
    dataset = dataset,
146 - 17x + 17x +
    dataname = dataname,
147 - 17x + 17x +
    label = label
@@ -66340,14 +68561,16 @@

teal.slice coverage - 65.86%

56 - 8x + 8x +
      checkmate::assert_class(datasets, "FilteredData")
57 - 6x + 6x +
      private$filtered_data <- datasets
@@ -66431,7 +68654,8 @@

teal.slice coverage - 65.86%

69 - 8x + 8x +
      private$filtered_data$get_filter_state()
@@ -66501,14 +68725,16 @@

teal.slice coverage - 65.86%

79 - 5x + 5x +
      private$filtered_data$set_filter_state(filter)
80 - 5x + 5x +
      invisible(NULL)
@@ -66599,14 +68825,16 @@

teal.slice coverage - 65.86%

93 - 1x + 1x +
      private$filtered_data$remove_filter_state(filter)
94 - 1x + 1x +
      invisible(NULL)
@@ -66697,21 +68925,24 @@

teal.slice coverage - 65.86%

107 - 2x + 2x +
      datanames_to_remove <- if (missing(datanames)) private$filtered_data$datanames() else datanames
108 - 2x + 2x +
      private$filtered_data$clear_filter_states(datanames = datanames_to_remove)
109 - 2x + 2x +
      invisible(NULL)
@@ -66871,49 +69102,56 @@

teal.slice coverage - 65.86%

15 - 273x + 273x +
  checkmate::assert_character(name, min.len = 1, any.missing = FALSE)
16 - 271x + 271x +
  if (!grepl("^[[:alpha:]][a-zA-Z0-9_]*$", name, perl = TRUE)) {
17 - 5x + 5x +
    stop(
18 - 5x + 5x +
      "name '",
19 - 5x + 5x +
      name,
20 - 5x + 5x +
      "' must only contain alphanumeric characters (with underscores)",
21 - 5x + 5x +
      " and the first character must be an alphabetic character"
@@ -67025,35 +69263,40 @@

teal.slice coverage - 65.86%

37 - 12x + 12x +
  checkmate::assert_character(pattern, min.len = 1, null.ok = TRUE)
38 - 12x + 12x +
  js_files <- list.files(
39 - 12x + 12x +
    system.file("js", package = "teal.slice", mustWork = TRUE),
40 - 12x + 12x +
    pattern = pattern,
41 - 12x + 12x +
    full.names = TRUE
@@ -67067,7 +69310,8 @@

teal.slice coverage - 65.86%

43 - 12x + 12x +
  singleton(lapply(js_files, includeScript))
@@ -67207,14 +69451,16 @@

teal.slice coverage - 65.86%

63 - 55x + 55x +
  if (length(choices) > 1) {
64 - 27x + 27x +
    do.call("call", append(list("c"), choices))
@@ -67228,7 +69474,8 @@

teal.slice coverage - 65.86%

66 - 28x + 28x +
    choices
@@ -67884,7 +70131,8 @@

teal.slice coverage - 65.86%

39 - 26x + 26x +
      if (!requireNamespace("MultiAssayExperiment", quietly = TRUE)) {
@@ -67905,14 +70153,16 @@

teal.slice coverage - 65.86%

42 - 26x + 26x +
      checkmate::assert_function(data_reactive, args = "sid")
43 - 26x + 26x +
      checkmate::assert_class(data, "MultiAssayExperiment")
@@ -67926,35 +70176,40 @@

teal.slice coverage - 65.86%

45 - 25x + 25x +
      data <- SummarizedExperiment::colData(data)
46 - 25x + 25x +
      data_reactive <- function(sid = "") SummarizedExperiment::colData(data_reactive(sid = sid))
47 - 25x + 25x +
      super$initialize(data, data_reactive, dataname, datalabel)
48 - 25x + 25x +
      private$keys <- keys
49 - 25x + 25x +
      private$set_filterable_varnames(include_varnames = colnames(data))
@@ -67968,7 +70223,8 @@

teal.slice coverage - 65.86%

51 - 25x + 25x +
      invisible(self)
@@ -69478,35 +71734,40 @@

teal.slice coverage - 65.86%

187 - 103x + 103x +
      checkmate::assert_function(data_reactive, args = "sid")
188 - 103x + 103x +
      checkmate::assert_data_frame(data)
189 - 103x + 103x +
      super$initialize(data, data_reactive, dataname, datalabel)
190 - 103x + 103x +
      private$keys <- keys
191 - 103x + 103x +
      private$set_filterable_varnames(include_varnames = colnames(private$data))
@@ -69778,21 +72039,24 @@

teal.slice coverage - 65.86%

30 - 47x + 47x +
  checkmate::assert_list(calls)
31 - 45x + 45x +
  if (length(calls) > 0L) checkmate::assert_list(calls, types = c("call", "name"))
32 - 46x + 46x +
  checkmate::assert_string(operator)
@@ -69806,21 +72070,24 @@

teal.slice coverage - 65.86%

34 - 44x + 44x +
  Reduce(
35 - 44x + 44x +
    x = calls,
36 - 44x + 44x +
    f = function(x, y) call(operator, x, y)
@@ -69889,14 +72156,16 @@

teal.slice coverage - 65.86%

7 - 9x + 9x +
  isolate(
8 - 9x + 9x +
    all(vapply(fields, function(x) identical(ts1[[x]], ts2[[x]]), logical(1L)))
@@ -69959,35 +72228,40 @@

teal.slice coverage - 65.86%

17 - 34x + 34x +
  isolate({
18 - 34x + 34x +
    testthat::expect_true(
19 - 34x + 34x +
      setequal(
20 - 34x + 34x +
        reactiveValuesToList(x),
21 - 34x + 34x +
        reactiveValuesToList(y)
@@ -70057,28 +72331,32 @@

teal.slice coverage - 65.86%

31 - 12x + 12x +
  isolate({
32 - 12x + 12x +
    mapply(
33 - 12x + 12x +
      function(x, y) {
34 - 27x + 27x +
        expect_identical_slice(x, y)
@@ -70092,14 +72370,16 @@

teal.slice coverage - 65.86%

36 - 12x + 12x +
      x = x,
37 - 12x + 12x +
      y = y
@@ -70113,7 +72393,8 @@

teal.slice coverage - 65.86%

39 - 12x + 12x +
    testthat::expect_identical(attributes(x), attributes(y))
@@ -70378,21 +72659,24 @@

teal.slice coverage - 65.86%

35 - 26x + 26x +
      checkmate::assert_matrix(data)
36 - 25x + 25x +
      super$initialize(data, data_reactive, dataname, datalabel)
37 - 25x + 25x +
      private$set_filterable_varnames(include_varnames = colnames(private$data))
diff --git a/CODE_OF_CONDUCT.html b/CODE_OF_CONDUCT.html index 6f1c7b108..151d7e630 100644 --- a/CODE_OF_CONDUCT.html +++ b/CODE_OF_CONDUCT.html @@ -1,8 +1,22 @@ - -Contributor Covenant Code of Conduct • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + + - + @@ -72,65 +92,80 @@
-

Our Pledge

+

Our Pledge +

We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.

-

Our Standards

+

Our Standards +

Examples of behavior that contributes to a positive environment for our community include:

-
  • Demonstrating empathy and kindness toward other people
  • +
      +
    • Demonstrating empathy and kindness toward other people
    • Being respectful of differing opinions, viewpoints, and experiences
    • Giving and gracefully accepting constructive feedback
    • Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
    • Focusing on what is best not just for us as individuals, but for the overall community
    • -

    Examples of unacceptable behavior include:

    -
    • The use of sexualized language or imagery, and sexual attention or advances of any kind
    • +
    +

    Examples of unacceptable behavior include:

    +
      +
    • The use of sexualized language or imagery, and sexual attention or advances of any kind
    • Trolling, insulting or derogatory comments, and personal or political attacks
    • Public or private harassment
    • Publishing others’ private information, such as a physical or email address, without their explicit permission
    • Other conduct which could reasonably be considered inappropriate in a professional setting
    • -
+ +
-

Enforcement Responsibilities

+

Enforcement Responsibilities +

Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.

Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.

-

Scope

+

Scope +

This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.

-

Enforcement

+

Enforcement +

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [INSERT CONTACT METHOD]. All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the reporter of any incident.

-

Enforcement Guidelines

+

Enforcement Guidelines +

Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:

-

1. Correction

+

1. Correction +

Community Impact: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.

Consequence: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.

-

2. Warning

+

2. Warning +

Community Impact: A violation through a single incident or series of actions.

Consequence: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.

-

3. Temporary Ban

+

3. Temporary Ban +

Community Impact: A serious violation of community standards, including sustained inappropriate behavior.

Consequence: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.

-

4. Permanent Ban

+

4. Permanent Ban +

Community Impact: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.

Consequence: A permanent ban from any sort of public interaction within the community.

-

Attribution

+

Attribution +

This Code of Conduct is adapted from the Contributor Covenant, version 2.1, available at https://www.contributor-covenant.org/version/2/1/code_of_conduct.html.

Community Impact Guidelines were inspired by Mozilla’s code of conduct enforcement ladder.

For answers to common questions about this code of conduct, see the FAQ at https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.

@@ -138,17 +173,19 @@

Attribution

+ + + + - - + + diff --git a/CONTRIBUTING.html b/CONTRIBUTING.html index 3f72000c5..78508fc6a 100644 --- a/CONTRIBUTING.html +++ b/CONTRIBUTING.html @@ -1,8 +1,22 @@ - -Contribution Guidelines • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + + - + @@ -74,7 +94,8 @@

🙏 Thank you for taking the time to contribute!

Your input is deeply valued, whether an issue, a pull request, or even feedback, regardless of size, content or scope.

-

Table of contents

+

Table of contents +

👶 Getting started

📔 Code of Conduct

🗃 License

@@ -85,38 +106,47 @@

Table of contents❓ Questions

-

Getting started

+

Getting started +

Please refer the project documentation for a brief introduction. Please also see other articles within the project documentation for additional information.

-

Code of Conduct

+

Code of Conduct +

A Code of Conduct governs this project. Participants and contributors are expected to follow the rules outlined therein.

-

License

+

License +

All your contributions will be covered by this project’s license.

-

Issues

+

Issues +

We use GitHub to track issues, feature requests, and bugs. Before submitting a new issue, please check if the issue has already been reported. If the issue already exists, please upvote the existing issue 👍.

For new feature requests, please elaborate on the context and the benefit the feature will have for users, developers, or other relevant personas.

-

Pull requests

+

Pull requests +

-

Github flow

+

Github flow +

This repository uses the Github flow model for collaboration. To submit a pull request:

-
  1. +
      +
    1. Create a branch.

      Please see the branch naming convention below. If you don’t have write access to this repository, please fork it.

    2. Make changes.

      Make sure your code:

      -
      • passes all checks imposed by GitHub Actions
      • +
          +
        • passes all checks imposed by GitHub Actions
        • is well documented
        • is well tested with unit tests sufficiently covering the changes introduced
        • -
        +
      +
    3. Create a pull request (PR).

      In the pull request description, please link the relevant issue (if any), provide a detailed description of the change, and include any assumptions.

      @@ -130,64 +160,78 @@

      Github flow -

      Branch naming convention

      +

      Branch naming convention +

      Suppose your changes are related to a current issue in the current project; please name your branch as follows: <issue_id>_<short_description>. Please use underscore (_) as a delimiter for word separation. For example, 420_fix_ui_bug would be a suitable branch name if your change is resolving and UI-related bug reported in issue number 420 in the current project.

      If your change affects multiple repositories, please name your branches as follows: <issue_id>_<issue_repo>_<short description>. For example, 69_awesomeproject_fix_spelling_error would reference issue 69 reported in project awesomeproject and aims to resolve one or more spelling errors in multiple (likely related) repositories.

monorepo and staged.dependencies -

+ +

Sometimes you might need to change upstream dependent package(s) to be able to submit a meaningful change. We are using staged.dependencies functionality to simulate a monorepo behavior. The dependency configuration is already specified in this project’s staged_dependencies.yaml file. You need to name the feature branches appropriately. This is the only exception from the branch naming convention described above.

Please refer to the staged.dependencies package documentation for more details.

- +
-

R & package versions

+

R & package versions +

We continuously test our packages against the newest R version along with the most recent dependencies from CRAN and BioConductor. We recommend that your working environment is also set up in the same way. You can find the details about the R version and packages used in the R CMD check GitHub Action execution log - there is a step that prints out the R sessionInfo().

If you discover bugs on older R versions or with an older set of dependencies, please create the relevant bug reports.

-

pre-commit

+

+pre-commit +

We highly recommend that you use the pre-commit tool combined with R hooks for pre-commit to execute some of the checks before committing and pushing your changes.

Pre-commit hooks are already available in this repository’s .pre-commit-config.yaml file.

-

Style guide

+

Style guide +

This repository follows the standard tidyverse style guide and uses lintr for lint checks. Customized lint configurations are available in this repository’s .lintr file.

-

Recognition model

+

Recognition model +

As mentioned previously, all contributions are deeply valued and appreciated. While all contribution data is available as part of the repository insights, to recognize a significant contribution and hence add the contributor to the package authors list, the following rules are enforced:

- +

*Excluding auto-generated code, including but not limited to roxygen comments or renv.lock files.

The package maintainer also reserves the right to adjust the criteria to recognize contributions.

-

Questions

+

Questions +

If you have further questions regarding the contribution guidelines, please contact the package/repository maintainer.

+ + + + - - + + diff --git a/LICENSE-text.html b/LICENSE-text.html index 9898b3d42..6c1148e38 100644 --- a/LICENSE-text.html +++ b/LICENSE-text.html @@ -1,8 +1,22 @@ - -License • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + + - + @@ -84,17 +104,19 @@ limitations under the License. - + + + + - - + + diff --git a/SECURITY.html b/SECURITY.html index cb9a15fbf..f9a746d62 100644 --- a/SECURITY.html +++ b/SECURITY.html @@ -1,8 +1,22 @@ - -Security Policy • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + + - + @@ -72,38 +92,44 @@
-

Reporting Security Issues

+

Reporting Security Issues +

If you believe you have found a security vulnerability in any of the repositories in this organization, please report it to us through coordinated disclosure.

Please do not report security vulnerabilities through public GitHub issues, discussions, or pull requests.

Instead, please send an email to vulnerability.management[@]roche.com.

Please include as much of the information listed below as you can to help us better understand and resolve the issue:

-
  • The type of issue (e.g., buffer overflow, SQL injection, or cross-site scripting)
  • +
      +
    • The type of issue (e.g., buffer overflow, SQL injection, or cross-site scripting)
    • Full paths of source file(s) related to the manifestation of the issue
    • The location of the affected source code (tag/branch/commit or direct URL)
    • Any special configuration required to reproduce the issue
    • Step-by-step instructions to reproduce the issue
    • Proof-of-concept or exploit code (if possible)
    • Impact of the issue, including how an attacker might exploit the issue
    • -

    This information will help us triage your report more quickly.

    +
+

This information will help us triage your report more quickly.

-

Data Security Standards (DSS)

+

Data Security Standards (DSS) +

Please make sure that while reporting issues in the form a bug, feature, or pull request, all sensitive information such as PII, PHI, and PCI is completely removed from any text and attachments, including pictures and videos.

+ + + + - - + + diff --git a/articles/filter-panel.html b/articles/filter-panel.html index 918d71a41..ae77f2caf 100644 --- a/articles/filter-panel.html +++ b/articles/filter-panel.html @@ -1,5 +1,4 @@ - - + @@ -51,23 +50,24 @@ - - - +v0.2.0 + + + diff --git a/articles/index.html b/articles/index.html index 3eddb0689..de7ccae66 100644 --- a/articles/index.html +++ b/articles/index.html @@ -1,8 +1,22 @@ - -Articles • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + + - + @@ -72,22 +92,28 @@

All vignettes

-
Filter panel for NEST developers
+
+
Filter panel for NEST developers
-
Introduction to teal.slice
+ +
Introduction to teal.slice
-
- + +
+ + + + + - - + + diff --git a/articles/teal-slice.html b/articles/teal-slice.html index 347caaf39..09e0dad8d 100644 --- a/articles/teal-slice.html +++ b/articles/teal-slice.html @@ -1,5 +1,4 @@ - - + @@ -51,23 +50,24 @@ - - - +v0.2.0 + + + diff --git a/authors.html b/authors.html index 5b85f6fae..ff18e9bbd 100644 --- a/authors.html +++ b/authors.html @@ -1,8 +1,22 @@ - -Authors and Citation • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + + - + @@ -71,7 +91,8 @@

Authors

-
+ +

Citation

@@ -121,17 +143,19 @@

Citation

}
+ + + + - - + + diff --git a/filter_panel_refactor@main/coverage-report/index.html b/filter_panel_refactor@main/coverage-report/index.html index d07d66b11..cbfaee8ad 100644 --- a/filter_panel_refactor@main/coverage-report/index.html +++ b/filter_panel_refactor@main/coverage-report/index.html @@ -1,22 +1,21 @@ - - + - + - - + + - + - + - - - + + + @@ -788,7 +787,8 @@

teal.slice coverage - 65.73%

97 - 104x + 104x +
  UseMethod("init_filtered_dataset")
@@ -879,63 +879,72 @@

teal.slice coverage - 65.73%

110 - 95x + 95x +
  DefaultFilteredDataset$new(
111 - 95x + 95x +
    dataset = dataset,
112 - 95x + 95x +
    dataname = dataname,
113 - 95x + 95x +
    keys = keys,
114 - 95x + 95x +
    parent_name = parent_name,
115 - 95x + 95x +
    parent = parent,
116 - 95x + 95x +
    join_keys = join_keys,
117 - 95x + 95x +
    label = label,
118 - 95x + 95x +
    metadata = metadata
@@ -1033,7 +1042,8 @@

teal.slice coverage - 65.73%

132 - 9x + 9x +
  if (!requireNamespace("MultiAssayExperiment", quietly = TRUE)) {
@@ -1054,42 +1064,48 @@

teal.slice coverage - 65.73%

135 - 9x + 9x +
  MAEFilteredDataset$new(
136 - 9x + 9x +
    dataset = dataset,
137 - 9x + 9x +
    dataname = dataname,
138 - 9x + 9x +
    keys = keys,
139 - 9x + 9x +
    label = label,
140 - 9x + 9x +
    metadata = metadata
@@ -2103,42 +2119,48 @@

teal.slice coverage - 65.73%

142 - 140x + 140x +
      shiny::isolate({
143 - 140x + 140x +
        checkmate::assert(
144 - 140x + 140x +
          is.character(x),
145 - 140x + 140x +
          is.factor(x),
146 - 140x + 140x +
          length(unique(x[!is.na(x)])) < getOption("teal.threshold_slider_vs_checkboxgroup"),
147 - 140x + 140x +
          combine = "or"
@@ -2159,28 +2181,32 @@

teal.slice coverage - 65.73%

150 - 140x + 140x +
        x_factor <- if (!is.factor(x)) {
151 - 104x + 104x +
          structure(
152 - 104x + 104x +
            factor(as.character(x), levels = as.character(sort(unique(x)))),
153 - 104x + 104x +
            label = attr(x, "label")
@@ -2201,7 +2227,8 @@

teal.slice coverage - 65.73%

156 - 36x + 36x +
          x
@@ -2222,35 +2249,40 @@

teal.slice coverage - 65.73%

159 - 140x + 140x +
        super$initialize(
160 - 140x + 140x +
          x = x_factor,
161 - 140x + 140x +
          x_reactive = x_reactive,
162 - 140x + 140x +
          slice = slice,
163 - 140x + 140x +
          extract_type = extract_type
@@ -2264,63 +2296,72 @@

teal.slice coverage - 65.73%

165 - 140x + 140x +
        private$set_choices(slice$choices)
166 - 140x + 140x +
        if (is.null(slice$selected) && slice$multiple) {
167 - 35x + 35x +
          slice$selected <- private$get_choices()
168 - 105x + 105x +
        } else if (is.null(slice$selected)) {
169 - 1x + 1x +
          slice$selected <- private$get_choices()[1]
170 - 104x + 104x +
        } else if (length(slice$selected) > 1 && !slice$multiple) {
171 - 1x + 1x +
          warning(
172 - 1x + 1x +
            "ChoicesFilterState allows \"selected\" to be of length 1 when \"multiple\" is FALSE. ",
173 - 1x + 1x +
            "Only the first value will be used."
@@ -2334,7 +2375,8 @@

teal.slice coverage - 65.73%

175 - 1x + 1x +
          slice$selected <- slice$selected[1]
@@ -2348,28 +2390,32 @@

teal.slice coverage - 65.73%

177 - 140x + 140x +
        private$set_selected(slice$selected)
178 - 140x + 140x +
        private$data_class <- class(x)[1L]
179 - 140x + 140x +
        if (inherits(x, "POSIXt")) {
180 - 9x + 9x +
          private$tzone <- Find(function(x) x != "", attr(as.POSIXlt(x), "tzone"))
@@ -2390,7 +2436,8 @@

teal.slice coverage - 65.73%

183 - 140x + 140x +
        private$set_choices_counts(unname(table(x_factor)))
@@ -2404,7 +2451,8 @@

teal.slice coverage - 65.73%

185 - 140x + 140x +
      invisible(self)
@@ -2488,14 +2536,16 @@

teal.slice coverage - 65.73%

197 - 36x + 36x +
      if (isFALSE(private$is_any_filtered())) {
198 - 2x + 2x +
        return(NULL)
@@ -2509,35 +2559,40 @@

teal.slice coverage - 65.73%

200 - 10x + 10x +
      if (missing(dataname)) dataname <- private$get_dataname()
201 - 34x + 34x +
      varname <- private$get_varname_prefixed(dataname)
202 - 34x + 34x +
      choices <- private$get_selected()
203 - 34x + 34x +
      if (private$data_class != "factor") {
204 - 27x + 27x +
        choices <- do.call(sprintf("as.%s", private$data_class), list(x = choices))
@@ -2551,7 +2606,8 @@

teal.slice coverage - 65.73%

206 - 34x + 34x +
      fun_compare <- if (length(choices) == 1L) "==" else "%in%"
@@ -2565,63 +2621,72 @@

teal.slice coverage - 65.73%

208 - 34x + 34x +
      filter_call <-
209 - 34x + 34x +
        if (inherits(choices, "Date")) {
210 - 1x + 1x +
          call(fun_compare, varname, call("as.Date", make_c_call(as.character(choices))))
211 - 34x + 34x +
        } else if (inherits(choices, c("POSIXct", "POSIXlt"))) {
212 - 2x + 2x +
          class <- class(choices)[1L]
213 - 2x + 2x +
          date_fun <- as.name(
214 - 2x + 2x +
            switch(class,
215 - 2x + 2x +
              "POSIXct" = "as.POSIXct",
216 - 2x + 2x +
              "POSIXlt" = "as.POSIXlt"
@@ -2642,28 +2707,32 @@

teal.slice coverage - 65.73%

219 - 2x + 2x +
          call(
220 - 2x + 2x +
            fun_compare,
221 - 2x + 2x +
            varname,
222 - 2x + 2x +
            as.call(list(date_fun, make_c_call(as.character(choices)), tz = private$tzone))
@@ -2691,7 +2760,8 @@

teal.slice coverage - 65.73%

226 - 31x + 31x +
          call(fun_compare, varname, make_c_call(choices))
@@ -2705,7 +2775,8 @@

teal.slice coverage - 65.73%

228 - 34x + 34x +
      private$add_keep_na_call(filter_call, dataname)
@@ -2824,14 +2895,16 @@

teal.slice coverage - 65.73%

245 - 140x + 140x +
      if (is.null(choices)) {
246 - 127x + 127x +
        choices <- levels(private$x)
@@ -2845,49 +2918,56 @@

teal.slice coverage - 65.73%

248 - 13x + 13x +
        choices <- as.character(choices)
249 - 13x + 13x +
        choices_adjusted <- choices[choices %in% private$x]
250 - 13x + 13x +
        if (length(setdiff(choices, choices_adjusted)) > 0L) {
251 - 2x + 2x +
          warning(
252 - 2x + 2x +
            sprintf(
253 - 2x + 2x +
              "Some choices not found in data. Adjusting. Filter id: %s.",
254 - 2x + 2x +
              private$get_id()
@@ -2908,7 +2988,8 @@

teal.slice coverage - 65.73%

257 - 2x + 2x +
          choices <- choices_adjusted
@@ -2922,35 +3003,40 @@

teal.slice coverage - 65.73%

259 - 13x + 13x +
        if (length(choices) == 0) {
260 - 1x + 1x +
          warning(
261 - 1x + 1x +
            sprintf(
262 - 1x + 1x +
              "None of the choices were found in data. Setting defaults. Filter id: %s.",
263 - 1x + 1x +
              private$get_id()
@@ -2971,7 +3057,8 @@

teal.slice coverage - 65.73%

266 - 1x + 1x +
          choices <- levels(private$x)
@@ -2992,35 +3079,40 @@

teal.slice coverage - 65.73%

269 - 140x + 140x +
      private$set_is_choice_limited(private$x, choices)
270 - 140x + 140x +
      private$teal_slice$choices <- choices
271 - 140x + 140x +
      private$x <- private$x[(private$x %in% private$get_choices()) | is.na(private$x)]
272 - 140x + 140x +
      private$x <- droplevels(private$x)
273 - 140x + 140x +
      invisible(NULL)
@@ -3055,21 +3147,24 @@

teal.slice coverage - 65.73%

278 - 140x + 140x +
      xl <- x[!is.na(x)]
279 - 140x + 140x +
      private$is_choice_limited <- length(setdiff(xl, choices)) > 0L
280 - 140x + 140x +
      invisible(NULL)
@@ -3104,14 +3199,16 @@

teal.slice coverage - 65.73%

285 - 140x + 140x +
      private$choices_counts <- choices_counts
286 - 140x + 140x +
      invisible(NULL)
@@ -3209,7 +3306,8 @@

teal.slice coverage - 65.73%

300 - 23x + 23x +
      length(private$get_choices()) <= getOption("teal.threshold_slider_vs_checkboxgroup")
@@ -3230,21 +3328,24 @@

teal.slice coverage - 65.73%

303 - 163x + 163x +
      tryCatch(
304 - 163x + 163x +
        expr = {
305 - 163x + 163x +
          values <- as.character(values)
@@ -3265,7 +3366,8 @@

teal.slice coverage - 65.73%

308 - 163x + 163x +
        error = function(error) stop("The array of set values must contain values coercible to character.")
@@ -3279,7 +3381,8 @@

teal.slice coverage - 65.73%

310 - 163x + 163x +
      values
@@ -3300,35 +3403,40 @@

teal.slice coverage - 65.73%

313 - 163x + 163x +
      in_choices_mask <- values %in% private$get_choices()
314 - 163x + 163x +
      if (length(values[!in_choices_mask]) > 0) {
315 - 17x + 17x +
        warning(paste(
316 - 17x + 17x +
          "Values:", toString(values[!in_choices_mask], width = 360),
317 - 17x + 17x +
          "are not in choices of column", private$get_varname(), "in dataset", private$get_dataname(), "."
@@ -3349,7 +3457,8 @@

teal.slice coverage - 65.73%

320 - 163x + 163x +
      values[in_choices_mask]
@@ -3370,28 +3479,32 @@

teal.slice coverage - 65.73%

323 - 163x + 163x +
      if (!private$is_multiple() && length(value) > 1) {
324 - 1x + 1x +
        warning(
325 - 1x + 1x +
          sprintf("Selection: %s is not a vector of length one. ", toString(value, width = 360)),
326 - 1x + 1x +
          "Maintaining previous selection."
@@ -3405,7 +3518,8 @@

teal.slice coverage - 65.73%

328 - 1x + 1x +
        value <- shiny::isolate(private$get_selected())
@@ -3419,7 +3533,8 @@

teal.slice coverage - 65.73%

330 - 163x + 163x +
      value
@@ -3440,7 +3555,8 @@

teal.slice coverage - 65.73%

333 - 163x + 163x +
      if (!is.character(value)) {
@@ -3503,28 +3619,32 @@

teal.slice coverage - 65.73%

342 - 163x + 163x +
      pre_msg <- sprintf(
343 - 163x + 163x +
        "data '%s', variable '%s': ",
344 - 163x + 163x +
        private$get_dataname(),
345 - 163x + 163x +
        private$get_varname()
@@ -3538,7 +3658,8 @@

teal.slice coverage - 65.73%

347 - 163x + 163x +
      check_in_subset(value, private$get_choices(), pre_msg = pre_msg)
@@ -3622,7 +3743,8 @@

teal.slice coverage - 65.73%

359 - 7x + 7x +
      ns <- NS(id)
@@ -3643,21 +3765,24 @@

teal.slice coverage - 65.73%

362 - 7x + 7x +
      shiny::isolate({
363 - 7x + 7x +
        countsmax <- private$choices_counts
364 - 7x + 7x +
        countsnow <- if (!is.null(private$x_reactive())) {
@@ -3678,7 +3803,8 @@

teal.slice coverage - 65.73%

367 - 7x + 7x +
          NULL
@@ -3699,42 +3825,48 @@

teal.slice coverage - 65.73%

370 - 7x + 7x +
        ui_input <- if (private$is_checkboxgroup()) {
371 - 7x + 7x +
          labels <- countBars(
372 - 7x + 7x +
            inputId = ns("labels"),
373 - 7x + 7x +
            choices = private$get_choices(),
374 - 7x + 7x +
            countsnow = countsnow,
375 - 7x + 7x +
            countsmax = countsmax
@@ -3748,70 +3880,80 @@

teal.slice coverage - 65.73%

377 - 7x + 7x +
          div(
378 - 7x + 7x +
            class = "choices_state",
379 - 7x + 7x +
            if (private$is_multiple()) {
380 - 7x + 7x +
              checkboxGroupInput(
381 - 7x + 7x +
                inputId = ns("selection"),
382 - 7x + 7x +
                label = NULL,
383 - 7x + 7x +
                selected = private$get_selected(),
384 - 7x + 7x +
                choiceNames = labels,
385 - 7x + 7x +
                choiceValues = private$get_choices(),
386 - 7x + 7x +
                width = "100%"
@@ -4042,28 +4184,32 @@

teal.slice coverage - 65.73%

419 - 7x + 7x +
        div(
420 - 7x + 7x +
          uiOutput(ns("trigger_visible")),
421 - 7x + 7x +
          ui_input,
422 - 7x + 7x +
          private$keep_na_ui(ns("keep_na"))
@@ -4140,28 +4286,32 @@

teal.slice coverage - 65.73%

433 - 7x + 7x +
      moduleServer(
434 - 7x + 7x +
        id = id,
435 - 7x + 7x +
        function(input, output, session) {
436 - 7x + 7x +
          logger::log_trace("ChoicesFilterState$server_inputs initializing, id: { private$get_id() }")
@@ -4196,21 +4346,24 @@

teal.slice coverage - 65.73%

441 - 7x + 7x +
          non_missing_values <- reactive(Filter(Negate(is.na), private$x_reactive()))
442 - 7x + 7x +
          output$trigger_visible <- renderUI({
443 - 7x + 7x +
            logger::log_trace("ChoicesFilterState$server_inputs@1 updating count labels, id: { private$get_id() }")
@@ -4224,7 +4377,8 @@

teal.slice coverage - 65.73%

445 - 7x + 7x +
            countsnow <- if (!is.null(private$x_reactive())) {
@@ -4245,7 +4399,8 @@

teal.slice coverage - 65.73%

448 - 7x + 7x +
              NULL
@@ -4273,49 +4428,56 @@

teal.slice coverage - 65.73%

452 - 7x + 7x +
            shiny::isolate({
453 - 7x + 7x +
              if (private$is_checkboxgroup()) {
454 - 7x + 7x +
                updateCountBars(
455 - 7x + 7x +
                  inputId = "labels",
456 - 7x + 7x +
                  choices = private$get_choices(),
457 - 7x + 7x +
                  countsmax = private$choices_counts,
458 - 7x + 7x +
                  countsnow = countsnow
@@ -4427,7 +4589,8 @@

teal.slice coverage - 65.73%

474 - 7x + 7x +
              NULL
@@ -4455,42 +4618,48 @@

teal.slice coverage - 65.73%

478 - 7x + 7x +
          if (private$is_checkboxgroup()) {
479 - 7x + 7x +
            private$observers$selection <- observeEvent(
480 - 7x + 7x +
              ignoreNULL = FALSE,
481 - 7x + 7x +
              ignoreInit = TRUE, # ignoreInit: should not matter because we set the UI with the desired initial state
482 - 7x + 7x +
              eventExpr = input$selection,
483 - 7x + 7x +
              handlerExpr = {
@@ -4812,7 +4981,8 @@

teal.slice coverage - 65.73%

529 - 7x + 7x +
          private$keep_na_srv("keep_na")
@@ -4847,7 +5017,8 @@

teal.slice coverage - 65.73%

534 - 7x + 7x +
          private$observers$selection_api <- observeEvent(private$get_selected(), {
@@ -4868,49 +5039,56 @@

teal.slice coverage - 65.73%

537 - 2x + 2x +
            if (!setequal(input$selection, private$get_selected())) {
538 - 2x + 2x +
              logger::log_trace("ChoicesFilterState$server@1 state changed, id: { private$get_id() }")
539 - 2x + 2x +
              if (private$is_checkboxgroup()) {
540 - 2x + 2x +
                if (private$is_multiple()) {
541 - 2x + 2x +
                  updateCheckboxGroupInput(
542 - 2x + 2x +
                    inputId = "selection",
543 - 2x + 2x +
                    selected = private$get_selected()
@@ -5029,14 +5207,16 @@

teal.slice coverage - 65.73%

560 - 7x + 7x +
          logger::log_trace("ChoicesFilterState$server_inputs initialized, id: { private$get_id() }")
561 - 7x + 7x +
          NULL
@@ -5274,28 +5454,32 @@

teal.slice coverage - 65.73%

595 - 7x + 7x +
      selected <- private$get_selected()
596 - 7x + 7x +
      selected_length <- nchar(paste0(selected, collapse = ""))
597 - 7x + 7x +
      if (selected_length <= 40) {
598 - 7x + 7x +
        selected_text <- paste0(selected, collapse = ", ")
@@ -5330,28 +5514,32 @@

teal.slice coverage - 65.73%

603 - 7x + 7x +
      tagList(
604 - 7x + 7x +
        tags$span(
605 - 7x + 7x +
          class = "filter-card-summary-value",
606 - 7x + 7x +
          selected_text
@@ -5365,21 +5553,24 @@

teal.slice coverage - 65.73%

608 - 7x + 7x +
        tags$span(
609 - 7x + 7x +
          class = "filter-card-summary-controls",
610 - 7x + 7x +
          if (isTRUE(private$get_keep_na()) && private$na_count > 0) {
@@ -5421,7 +5612,8 @@

teal.slice coverage - 65.73%

616 - 7x + 7x +
          } else if (isFALSE(private$get_keep_na()) && private$na_count > 0) {
@@ -5470,7 +5662,8 @@

teal.slice coverage - 65.73%

623 - 7x + 7x +
            NULL
@@ -6043,7 +6236,8 @@

teal.slice coverage - 65.73%

75 - 69x + 69x +
      checkmate::assert_list(data_objects, any.missing = FALSE, min.len = 0, names = "unique")
@@ -6057,21 +6251,24 @@

teal.slice coverage - 65.73%

77 - 69x + 69x +
      checkmate::assert_class(join_keys, "JoinKeys")
78 - 65x + 65x +
      checkmate::assert_class(code, "CodeClass", null.ok = TRUE)
79 - 65x + 65x +
      checkmate::assert_flag(check)
@@ -6085,21 +6282,24 @@

teal.slice coverage - 65.73%

81 - 65x + 65x +
      self$set_check(check)
82 - 65x + 65x +
      if (!is.null(code)) {
83 - 6x + 6x +
        self$set_code(code)
@@ -6120,7 +6320,8 @@

teal.slice coverage - 65.73%

86 - 65x + 65x +
      self$set_join_keys(join_keys)
@@ -6134,35 +6335,40 @@

teal.slice coverage - 65.73%

88 - 65x + 65x +
      child_parent <- sapply(
89 - 65x + 65x +
        names(data_objects),
90 - 65x + 65x +
        function(i) join_keys$get_parent(i),
91 - 65x + 65x +
        USE.NAMES = TRUE,
92 - 65x + 65x +
        simplify = FALSE
@@ -6176,7 +6382,8 @@

teal.slice coverage - 65.73%

94 - 65x + 65x +
      ordered_datanames <- topological_sort(child_parent)
@@ -6190,28 +6397,32 @@

teal.slice coverage - 65.73%

96 - 64x + 64x +
      for (dataname in ordered_datanames) {
97 - 98x + 98x +
        ds_object <- data_objects[[dataname]]
98 - 98x + 98x +
        validate_dataset_args(ds_object, dataname)
99 - 97x + 97x +
        if (inherits(ds_object, c("data.frame", "MultiAssayExperiment"))) {
@@ -6267,35 +6478,40 @@

teal.slice coverage - 65.73%

107 - 97x + 97x +
          self$set_dataset(
108 - 97x + 97x +
            data = ds_object$dataset,
109 - 97x + 97x +
            dataname = dataname,
110 - 97x + 97x +
            metadata = ds_object$metadata,
111 - 97x + 97x +
            label = ds_object$label
@@ -6330,7 +6546,8 @@

teal.slice coverage - 65.73%

116 - 63x + 63x +
      self$set_available_teal_slices(x = reactive(NULL))
@@ -6344,7 +6561,8 @@

teal.slice coverage - 65.73%

118 - 63x + 63x +
      invisible(self)
@@ -6414,7 +6632,8 @@

teal.slice coverage - 65.73%

128 - 111x + 111x +
      names(private$filtered_datasets)
@@ -6484,7 +6703,8 @@

teal.slice coverage - 65.73%

138 - 2x + 2x +
      private$get_filtered_dataset(dataname)$get_dataset_label()
@@ -6673,14 +6893,16 @@

teal.slice coverage - 65.73%

165 - 10x + 10x +
      checkmate::assert_subset(dataname, self$datanames())
166 - 9x + 9x +
      private$get_filtered_dataset(dataname)$get_call()
@@ -6757,14 +6979,16 @@

teal.slice coverage - 65.73%

177 - 2x + 2x +
      if (!is.null(private$code)) {
178 - 1x + 1x +
        paste0(private$code$get_code(dataname), collapse = "\n")
@@ -6778,7 +7002,8 @@

teal.slice coverage - 65.73%

180 - 1x + 1x +
        paste0("# No pre-processing code provided")
@@ -6876,28 +7101,32 @@

teal.slice coverage - 65.73%

194 - 18x + 18x +
      checkmate::assert_subset(dataname, self$datanames())
195 - 17x + 17x +
      checkmate::assert_flag(filtered)
196 - 16x + 16x +
      data <- private$get_filtered_dataset(dataname)$get_dataset(filtered)
197 - 3x + 3x +
      if (filtered) data() else data
@@ -6960,7 +7189,8 @@

teal.slice coverage - 65.73%

206 - 2x + 2x +
      private$.check
@@ -7037,14 +7267,16 @@

teal.slice coverage - 65.73%

217 - 3x + 3x +
      checkmate::assert_subset(dataname, self$datanames())
218 - 2x + 2x +
      private$get_filtered_dataset(dataname)$get_metadata()
@@ -7107,7 +7339,8 @@

teal.slice coverage - 65.73%

227 - 206x + 206x +
      return(private$join_keys)
@@ -7205,28 +7438,32 @@

teal.slice coverage - 65.73%

241 - 9x + 9x +
      rows <- lapply(
242 - 9x + 9x +
        datanames,
243 - 9x + 9x +
        function(dataname) {
244 - 11x + 11x +
          private$get_filtered_dataset(dataname)$get_filter_overview()
@@ -7247,7 +7484,8 @@

teal.slice coverage - 65.73%

247 - 5x + 5x +
      dplyr::bind_rows(rows)
@@ -7324,7 +7562,8 @@

teal.slice coverage - 65.73%

258 - 1x + 1x +
      private$get_filtered_dataset(dataname)$get_keys()
@@ -7520,7 +7759,8 @@

teal.slice coverage - 65.73%

286 - 102x + 102x +
      logger::log_trace("FilteredData$set_dataset setting dataset, name: { dataname }")
@@ -7541,7 +7781,8 @@

teal.slice coverage - 65.73%

289 - 102x + 102x +
      check_simple_name(dataname)
@@ -7555,63 +7796,72 @@

teal.slice coverage - 65.73%

291 - 102x + 102x +
      join_keys <- self$get_join_keys()
292 - 102x + 102x +
      parent_dataname <- join_keys$get_parent(dataname)
293 - 102x + 102x +
      if (length(parent_dataname) == 0) {
294 - 95x + 95x +
        private$filtered_datasets[[dataname]] <- init_filtered_dataset(
295 - 95x + 95x +
          dataset = data,
296 - 95x + 95x +
          dataname = dataname,
297 - 95x + 95x +
          metadata = metadata,
298 - 95x + 95x +
          label = label,
299 - 95x + 95x +
          keys = self$get_join_keys()$get(dataname, dataname)
@@ -7632,63 +7882,72 @@

teal.slice coverage - 65.73%

302 - 7x + 7x +
        private$filtered_datasets[[dataname]] <- init_filtered_dataset(
303 - 7x + 7x +
          dataset = data,
304 - 7x + 7x +
          dataname = dataname,
305 - 7x + 7x +
          keys = join_keys$get(dataname, dataname),
306 - 7x + 7x +
          parent_name = parent_dataname,
307 - 7x + 7x +
          parent = reactive(self$get_data(parent_dataname, filtered = TRUE)),
308 - 7x + 7x +
          join_keys = self$get_join_keys()$get(dataname, parent_dataname),
309 - 7x + 7x +
          label = label,
310 - 7x + 7x +
          metadata = metadata
@@ -7716,7 +7975,8 @@

teal.slice coverage - 65.73%

314 - 102x + 102x +
      invisible(self)
@@ -7793,21 +8053,24 @@

teal.slice coverage - 65.73%

325 - 65x + 65x +
      checkmate::assert_class(join_keys, "JoinKeys")
326 - 65x + 65x +
      private$join_keys <- join_keys
327 - 65x + 65x +
      invisible(self)
@@ -7884,21 +8147,24 @@

teal.slice coverage - 65.73%

338 - 65x + 65x +
      checkmate::assert_flag(check)
339 - 65x + 65x +
      private$.check <- check
340 - 65x + 65x +
      invisible(self)
@@ -7982,28 +8248,32 @@

teal.slice coverage - 65.73%

352 - 6x + 6x +
      checkmate::assert_class(code, "CodeClass")
353 - 6x + 6x +
      logger::log_trace("FilteredData$set_code setting code")
354 - 6x + 6x +
      private$code <- code
355 - 6x + 6x +
      invisible(self)
@@ -8080,35 +8350,40 @@

teal.slice coverage - 65.73%

366 - 57x + 57x +
      states <- unname(lapply(private$filtered_datasets, function(x) x$get_filter_state()))
367 - 57x + 57x +
      slices <- Filter(Negate(is.null), states)
368 - 57x + 57x +
      slices <- do.call(c, slices)
369 - 57x + 57x +
      if (!is.null(slices)) {
370 - 57x + 57x +
        attr(slices, "module_add") <- private$module_add
@@ -8122,7 +8397,8 @@

teal.slice coverage - 65.73%

372 - 57x + 57x +
      slices
@@ -8206,28 +8482,32 @@

teal.slice coverage - 65.73%

384 - 7x + 7x +
      sprintf(
385 - 7x + 7x +
        "%s:\n%s",
386 - 7x + 7x +
        class(self)[1],
387 - 7x + 7x +
        format(self$get_filter_state(), show_all = show_all, trim_lines = trim_lines)
@@ -8297,7 +8577,8 @@

teal.slice coverage - 65.73%

397 - 3x + 3x +
      cat(shiny::isolate(self$format(...)), "\n")
@@ -8556,56 +8837,64 @@

teal.slice coverage - 65.73%

434 - 31x + 31x +
      shiny::isolate({
435 - 31x + 31x +
        logger::log_trace("{ class(self)[1] }$set_filter_state initializing")
436 - 31x + 31x +
        if (!is.teal_slices(state)) {
437 - 1x + 1x +
          warning(
438 - 1x + 1x +
            paste(
439 - 1x + 1x +
              "From FilteredData$set_filter_state:",
440 - 1x + 1x +
              "Specifying filters as lists is obsolete and will be deprecated in the next release.",
441 - 1x + 1x +
              "Please see ?set_filter_state and ?teal_slices for details."
@@ -8619,7 +8908,8 @@

teal.slice coverage - 65.73%

443 - 1x + 1x +
            call. = FALSE
@@ -8633,7 +8923,8 @@

teal.slice coverage - 65.73%

445 - 1x + 1x +
          state <- as.teal_slices(state)
@@ -8654,28 +8945,32 @@

teal.slice coverage - 65.73%

448 - 31x + 31x +
        checkmate::assert_class(state, "teal_slices")
449 - 31x + 31x +
        module_add <- attr(state, "module_add")
450 - 31x + 31x +
        if (!is.null(module_add)) {
451 - 31x + 31x +
          private$module_add <- module_add
@@ -8696,21 +8991,24 @@

teal.slice coverage - 65.73%

454 - 31x + 31x +
        lapply(self$datanames(), function(dataname) {
455 - 61x + 61x +
          states <- Filter(function(x) identical(x$dataname, dataname), state)
456 - 61x + 61x +
          private$get_filtered_dataset(dataname)$set_filter_state(states)
@@ -8731,7 +9029,8 @@

teal.slice coverage - 65.73%

459 - 31x + 31x +
        logger::log_trace("{ class(self)[1] }$set_filter_state initialized")
@@ -8745,7 +9044,8 @@

teal.slice coverage - 65.73%

461 - 31x + 31x +
        invisible(NULL)
@@ -8843,14 +9143,16 @@

teal.slice coverage - 65.73%

475 - 8x + 8x +
      shiny::isolate({
476 - 8x + 8x +
        if (!is.teal_slices(state)) {
@@ -8934,21 +9236,24 @@

teal.slice coverage - 65.73%

488 - 8x + 8x +
        checkmate::assert_class(state, "teal_slices")
489 - 8x + 8x +
        datanames <- slices_field(state, "dataname")
490 - 8x + 8x +
        checkmate::assert_subset(datanames, self$datanames())
@@ -8962,14 +9267,16 @@

teal.slice coverage - 65.73%

492 - 8x + 8x +
        logger::log_trace(
493 - 8x + 8x +
          "{ class(self)[1] }$remove_filter_state removing filter(s), dataname: { private$dataname }"
@@ -8990,21 +9297,24 @@

teal.slice coverage - 65.73%

496 - 8x + 8x +
        lapply(datanames, function(dataname) {
497 - 9x + 9x +
          slices <- Filter(function(x) identical(x$dataname, dataname), state)
498 - 9x + 9x +
          private$get_filtered_dataset(dataname)$remove_filter_state(slices)
@@ -9025,14 +9335,16 @@

teal.slice coverage - 65.73%

501 - 8x + 8x +
        logger::log_trace(
502 - 8x + 8x +
          "{ class(self)[1] }$remove_filter_state removed filter(s), dataname: { private$dataname }"
@@ -9053,7 +9365,8 @@

teal.slice coverage - 65.73%

505 - 8x + 8x +
        invisible(NULL)
@@ -9158,14 +9471,16 @@

teal.slice coverage - 65.73%

520 - 7x + 7x +
      logger::log_trace(
521 - 7x + 7x +
        "FilteredData$clear_filter_states called, datanames: { toString(datanames) }"
@@ -9186,21 +9501,24 @@

teal.slice coverage - 65.73%

524 - 7x + 7x +
      for (dataname in datanames) {
525 - 12x + 12x +
        fdataset <- private$get_filtered_dataset(dataname = dataname)
526 - 12x + 12x +
        fdataset$clear_filter_states()
@@ -9221,28 +9539,32 @@

teal.slice coverage - 65.73%

529 - 7x + 7x +
      logger::log_trace(
530 - 7x + 7x +
        paste(
531 - 7x + 7x +
          "FilteredData$clear_filter_states removed all non-locked FilterStates,",
532 - 7x + 7x +
          "datanames: { toString(datanames) }"
@@ -9270,7 +9592,8 @@

teal.slice coverage - 65.73%

536 - 7x + 7x +
      invisible(NULL)
@@ -9368,14 +9691,16 @@

teal.slice coverage - 65.73%

550 - 64x + 64x +
      checkmate::assert_class(x, "reactive")
551 - 64x + 64x +
      private$available_teal_slices <- reactive({
@@ -9389,7 +9714,8 @@

teal.slice coverage - 65.73%

553 - 4x + 4x +
        Filter(function(x) x$dataname %in% self$datanames(), x())
@@ -9403,7 +9729,8 @@

teal.slice coverage - 65.73%

555 - 64x + 64x +
      invisible(NULL)
@@ -9655,35 +9982,40 @@

teal.slice coverage - 65.73%

591 - 1x + 1x +
      checkmate::assert_function(active_datanames)
592 - 1x + 1x +
      moduleServer(
593 - 1x + 1x +
        id = id,
594 - 1x + 1x +
        function(input, output, session) {
595 - 1x + 1x +
          logger::log_trace("FilteredData$srv_filter_panel initializing")
@@ -9697,14 +10029,16 @@

teal.slice coverage - 65.73%

597 - 1x + 1x +
          active_datanames_resolved <- reactive({
598 - 1x + 1x +
            checkmate::assert_subset(active_datanames(), self$datanames())
@@ -9732,28 +10066,32 @@

teal.slice coverage - 65.73%

602 - 1x + 1x +
          self$srv_overview("overview", active_datanames_resolved)
603 - 1x + 1x +
          self$srv_active("active", active_datanames_resolved)
604 - 1x + 1x +
          if (private$module_add) {
605 - 1x + 1x +
            self$srv_add("add", active_datanames_resolved)
@@ -9774,14 +10112,16 @@

teal.slice coverage - 65.73%

608 - 1x + 1x +
          logger::log_trace("FilteredData$srv_filter_panel initialized")
609 - 1x + 1x +
          NULL
@@ -10222,21 +10562,24 @@

teal.slice coverage - 65.73%

672 - 3x + 3x +
      checkmate::assert_function(active_datanames)
673 - 3x + 3x +
      shiny::moduleServer(id, function(input, output, session) {
674 - 3x + 3x +
        logger::log_trace("FilteredData$srv_active initializing")
@@ -10250,7 +10593,8 @@

teal.slice coverage - 65.73%

676 - 3x + 3x +
        private$srv_available_filters("available_filters")
@@ -10264,7 +10608,8 @@

teal.slice coverage - 65.73%

678 - 3x + 3x +
        shiny::observeEvent(input$minimise_filter_active, {
@@ -10313,42 +10658,48 @@

teal.slice coverage - 65.73%

685 - 3x + 3x +
        shiny::observeEvent(private$get_filter_count(), {
686 - 3x + 3x +
          shinyjs::toggle("remove_all_filters", condition = private$get_filter_count() != 0)
687 - 3x + 3x +
          shinyjs::show("filter_active_vars_contents")
688 - 3x + 3x +
          shinyjs::hide("filters_active_count")
689 - 3x + 3x +
          toggle_icon(session$ns("minimise_filter_active"), c("fa-angle-right", "fa-angle-down"), TRUE)
690 - 3x + 3x +
          toggle_title(session$ns("minimise_filter_active"), c("Restore panel", "Minimise Panel"), TRUE)
@@ -10369,28 +10720,32 @@

teal.slice coverage - 65.73%

693 - 3x + 3x +
        observeEvent(active_datanames(), {
694 - 2x + 2x +
          lapply(self$datanames(), function(dataname) {
695 - 4x + 4x +
            if (dataname %in% active_datanames()) {
696 - 4x + 4x +
              shinyjs::show(dataname)
@@ -10453,35 +10808,40 @@

teal.slice coverage - 65.73%

705 - 3x + 3x +
        lapply(
706 - 3x + 3x +
          self$datanames(),
707 - 3x + 3x +
          function(dataname) {
708 - 6x + 6x +
            fdataset <- private$get_filtered_dataset(dataname)
709 - 6x + 6x +
            fdataset$srv_active(id = dataname)
@@ -10509,49 +10869,56 @@

teal.slice coverage - 65.73%

713 - 3x + 3x +
        output$teal_filters_count <- shiny::renderText({
714 - 3x + 3x +
          n_filters_active <- private$get_filter_count()
715 - 3x + 3x +
          shiny::req(n_filters_active > 0L)
716 - 2x + 2x +
          sprintf(
717 - 2x + 2x +
            "%s filter%s applied across datasets",
718 - 2x + 2x +
            n_filters_active,
719 - 2x + 2x +
            ifelse(n_filters_active == 1, "", "s")
@@ -10579,28 +10946,32 @@

teal.slice coverage - 65.73%

723 - 3x + 3x +
        observeEvent(input$remove_all_filters, {
724 - 1x + 1x +
          logger::log_trace("FilteredData$srv_filter_panel@1 removing all non-locked filters")
725 - 1x + 1x +
          self$clear_filter_states()
726 - 1x + 1x +
          logger::log_trace("FilteredData$srv_filter_panel@1 removed all non-locked filters")
@@ -10614,14 +10985,16 @@

teal.slice coverage - 65.73%

728 - 3x + 3x +
        logger::log_trace("FilteredData$srv_active initialized")
729 - 3x + 3x +
        NULL
@@ -10999,28 +11372,32 @@

teal.slice coverage - 65.73%

783 - 1x + 1x +
      checkmate::assert_class(active_datanames, "reactive")
784 - 1x + 1x +
      moduleServer(id, function(input, output, session) {
785 - 1x + 1x +
        logger::log_trace("FilteredData$srv_add initializing")
786 - 1x + 1x +
        shiny::observeEvent(input$minimise_filter_add_vars, {
@@ -11062,7 +11439,8 @@

teal.slice coverage - 65.73%

792 - 1x + 1x +
        observeEvent(active_datanames(), {
@@ -11146,35 +11524,40 @@

teal.slice coverage - 65.73%

804 - 1x + 1x +
        lapply(
805 - 1x + 1x +
          self$datanames(),
806 - 1x + 1x +
          function(dataname) {
807 - 2x + 2x +
            fdataset <- private$get_filtered_dataset(dataname)
808 - 2x + 2x +
            fdataset$srv_add(id = dataname)
@@ -11195,14 +11578,16 @@

teal.slice coverage - 65.73%

811 - 1x + 1x +
        logger::log_trace("FilteredData$srv_filter_panel initialized")
812 - 1x + 1x +
        NULL
@@ -11601,35 +11986,40 @@

teal.slice coverage - 65.73%

869 - 1x + 1x +
      checkmate::assert_class(active_datanames, "reactive")
870 - 1x + 1x +
      moduleServer(
871 - 1x + 1x +
        id = id,
872 - 1x + 1x +
        function(input, output, session) {
873 - 1x + 1x +
          logger::log_trace("FilteredData$srv_filter_overview initializing")
@@ -11643,7 +12033,8 @@

teal.slice coverage - 65.73%

875 - 1x + 1x +
          shiny::observeEvent(input$minimise_filter_overview, {
@@ -11685,7 +12076,8 @@

teal.slice coverage - 65.73%

881 - 1x + 1x +
          output$table <- renderUI({
@@ -12105,14 +12497,16 @@

teal.slice coverage - 65.73%

941 - 1x + 1x +
          logger::log_trace("FilteredData$srv_filter_overview initialized")
942 - 1x + 1x +
          NULL
@@ -12994,7 +13388,8 @@

teal.slice coverage - 65.73%

1068 - 131x + 131x +
      if (length(dataname) == 0) {
@@ -13015,7 +13410,8 @@

teal.slice coverage - 65.73%

1071 - 131x + 131x +
        private$filtered_datasets[[dataname]]
@@ -13099,7 +13495,8 @@

teal.slice coverage - 65.73%

1083 - 11x + 11x +
      length(self$get_filter_state())
@@ -13344,35 +13741,40 @@

teal.slice coverage - 65.73%

1118 - 4x + 4x +
      moduleServer(id, function(input, output, session) {
1119 - 4x + 4x +
        slices_interactive <- reactive(
1120 - 4x + 4x +
          Filter(
1121 - 4x + 4x +
            function(slice) !isTRUE(slice$fixed) && !inherits(slice, "teal_slice_expr"),
1122 - 4x + 4x +
            private$available_teal_slices()
@@ -13393,28 +13795,32 @@

teal.slice coverage - 65.73%

1125 - 4x + 4x +
        slices_fixed <- reactive(
1126 - 4x + 4x +
          Filter(
1127 - 4x + 4x +
            function(slice) isTRUE(slice$fixed) || inherits(slice, "teal_slice_expr"),
1128 - 4x + 4x +
            private$available_teal_slices()
@@ -13435,21 +13841,24 @@

teal.slice coverage - 65.73%

1131 - 4x + 4x +
        available_slices_id <- reactive(vapply(private$available_teal_slices(), `[[`, character(1), "id"))
1132 - 4x + 4x +
        active_slices_id <- reactive(vapply(self$get_filter_state(), `[[`, character(1), "id"))
1133 - 4x + 4x +
        duplicated_slice_references <- reactive({
@@ -13463,35 +13872,40 @@

teal.slice coverage - 65.73%

1135 - 8x + 8x +
          slice_reference <- vapply(private$available_teal_slices(), get_default_slice_id, character(1))
1136 - 8x + 8x +
          is_duplicated_reference <- duplicated(slice_reference) | duplicated(slice_reference, fromLast = TRUE)
1137 - 8x + 8x +
          is_active <- available_slices_id() %in% active_slices_id()
1138 - 8x + 8x +
          is_not_expr <- !vapply(private$available_teal_slices(), inherits, logical(1), "teal_slice_expr")
1139 - 8x + 8x +
          slice_reference[is_duplicated_reference & is_active & is_not_expr]
@@ -13512,70 +13926,80 @@

teal.slice coverage - 65.73%

1142 - 4x + 4x +
        checkbox_group_element <- function(name, value, label, checked, disabled = FALSE) {
1143 - 35x + 35x +
          tags$div(
1144 - 35x + 35x +
            class = "checkbox available-filters",
1145 - 35x + 35x +
            tags$label(
1146 - 35x + 35x +
              tags$input(
1147 - 35x + 35x +
                type = "checkbox",
1148 - 35x + 35x +
                name = name,
1149 - 35x + 35x +
                value = value,
1150 - 35x + 35x +
                checked = checked,
1151 - 35x + 35x +
                disabled = if (disabled) "disabled"
@@ -13589,7 +14013,8 @@

teal.slice coverage - 65.73%

1153 - 35x + 35x +
              tags$span(label, disabled = if (disabled) disabled)
@@ -13624,42 +14049,48 @@

teal.slice coverage - 65.73%

1158 - 4x + 4x +
        output$checkbox <- renderUI({
1159 - 8x + 8x +
          checkbox <- checkboxGroupInput(
1160 - 8x + 8x +
            session$ns("available_slices_id"),
1161 - 8x + 8x +
            label = NULL,
1162 - 8x + 8x +
            choices = NULL,
1163 - 8x + 8x +
            selected = NULL
@@ -13673,14 +14104,16 @@

teal.slice coverage - 65.73%

1165 - 8x + 8x +
          active_slices_ids <- active_slices_id()
1166 - 8x + 8x +
          duplicated_slice_refs <- duplicated_slice_references()
@@ -13694,7 +14127,8 @@

teal.slice coverage - 65.73%

1168 - 8x + 8x +
          checkbox_group_slice <- function(slice) {
@@ -13708,63 +14142,72 @@

teal.slice coverage - 65.73%

1170 - 35x + 35x +
            shiny::isolate({
1171 - 35x + 35x +
              checkbox_group_element(
1172 - 35x + 35x +
                name = session$ns("available_slices_id"),
1173 - 35x + 35x +
                value = slice$id,
1174 - 35x + 35x +
                label = slice$id,
1175 - 35x + 35x +
                checked = if (slice$id %in% active_slices_ids) "checked",
1176 - 35x + 35x +
                disabled = slice$locked ||
1177 - 35x + 35x +
                  get_default_slice_id(slice) %in% duplicated_slice_refs &&
1178 - 35x + 35x +
                    !slice$id %in% active_slices_ids
@@ -13799,14 +14242,16 @@

teal.slice coverage - 65.73%

1183 - 8x + 8x +
          interactive_choice_mock <- lapply(slices_interactive(), checkbox_group_slice)
1184 - 8x + 8x +
          non_interactive_choice_mock <- lapply(slices_fixed(), checkbox_group_slice)
@@ -13820,63 +14265,72 @@

teal.slice coverage - 65.73%

1186 - 8x + 8x +
          htmltools::tagInsertChildren(
1187 - 8x + 8x +
            checkbox,
1188 - 8x + 8x +
            br(),
1189 - 8x + 8x +
            tags$strong("Fixed filters"),
1190 - 8x + 8x +
            non_interactive_choice_mock,
1191 - 8x + 8x +
            tags$strong("Interactive filters"),
1192 - 8x + 8x +
            interactive_choice_mock,
1193 - 8x + 8x +
            .cssSelector = "div.shiny-options-group",
1194 - 8x + 8x +
            after = 0
@@ -13904,49 +14358,56 @@

teal.slice coverage - 65.73%

1198 - 4x + 4x +
        observeEvent(input$available_slices_id, ignoreNULL = FALSE, ignoreInit = TRUE, {
1199 - 5x + 5x +
          new_slices_id <- setdiff(input$available_slices_id, active_slices_id())
1200 - 5x + 5x +
          removed_slices_id <- setdiff(active_slices_id(), input$available_slices_id)
1201 - 5x + 5x +
          if (length(new_slices_id)) {
1202 - 3x + 3x +
            new_teal_slices <- Filter(
1203 - 3x + 3x +
              function(slice) slice$id %in% new_slices_id,
1204 - 3x + 3x +
              private$available_teal_slices()
@@ -13960,7 +14421,8 @@

teal.slice coverage - 65.73%

1206 - 3x + 3x +
            self$set_filter_state(new_teal_slices)
@@ -13981,28 +14443,32 @@

teal.slice coverage - 65.73%

1209 - 5x + 5x +
          if (length(removed_slices_id)) {
1210 - 4x + 4x +
            removed_teal_slices <- Filter(
1211 - 4x + 4x +
              function(slice) slice$id %in% removed_slices_id,
1212 - 4x + 4x +
              self$get_filter_state()
@@ -14016,7 +14482,8 @@

teal.slice coverage - 65.73%

1214 - 4x + 4x +
            self$remove_filter_state(removed_teal_slices)
@@ -14044,21 +14511,24 @@

teal.slice coverage - 65.73%

1218 - 4x + 4x +
        observeEvent(private$available_teal_slices(), ignoreNULL = FALSE, {
1219 - 3x + 3x +
          if (length(private$available_teal_slices())) {
1220 - 1x + 1x +
            shinyjs::show("available_menu")
@@ -14072,7 +14542,8 @@

teal.slice coverage - 65.73%

1222 - 2x + 2x +
            shinyjs::hide("available_menu")
@@ -14323,7 +14794,8 @@

teal.slice coverage - 65.73%

29 - 145x + 145x +
      logger::log_trace("Instantiating { class(self)[1] }, dataname: { dataname }")
@@ -14344,28 +14816,32 @@

teal.slice coverage - 65.73%

32 - 145x + 145x +
      check_simple_name(dataname)
33 - 143x + 143x +
      checkmate::assert_character(keys, any.missing = FALSE)
34 - 143x + 143x +
      checkmate::assert_character(label, null.ok = TRUE)
35 - 143x + 143x +
      teal.data::validate_metadata(metadata)
@@ -14379,42 +14855,48 @@

teal.slice coverage - 65.73%

37 - 143x + 143x +
      logger::log_trace("Instantiating { class(self)[1] }, dataname: { dataname }")
38 - 143x + 143x +
      private$dataset <- dataset
39 - 143x + 143x +
      private$dataname <- dataname
40 - 143x + 143x +
      private$keys <- keys
41 - 143x + 143x +
      private$label <- if (is.null(label)) character(0) else label
42 - 143x + 143x +
      private$metadata <- metadata
@@ -14435,28 +14917,32 @@

teal.slice coverage - 65.73%

45 - 143x + 143x +
      private$data_filtered_fun <- function(sid = "") {
46 - 21x + 21x +
        checkmate::assert_character(sid)
47 - 21x + 21x +
        if (length(sid)) {
48 - 21x + 21x +
          logger::log_trace("filtering data dataname: { dataname }, sid: { sid }")
@@ -14484,35 +14970,40 @@

teal.slice coverage - 65.73%

52 - 21x + 21x +
        env <- new.env(parent = parent.env(globalenv()))
53 - 21x + 21x +
        env[[dataname]] <- private$dataset
54 - 21x + 21x +
        filter_call <- self$get_call(sid)
55 - 21x + 21x +
        eval_expr_with_msg(filter_call, env)
56 - 21x + 21x +
        get(x = dataname, envir = env)
@@ -14533,21 +15024,24 @@

teal.slice coverage - 65.73%

59 - 143x + 143x +
      private$data_filtered <- reactive(private$data_filtered_fun())
60 - 143x + 143x +
      logger::log_trace("Instantiated { class(self)[1] }, dataname: { private$dataname }")
61 - 143x + 143x +
      invisible(self)
@@ -14631,28 +15125,32 @@

teal.slice coverage - 65.73%

73 - 24x + 24x +
      sprintf(
74 - 24x + 24x +
        "%s:\n%s",
75 - 24x + 24x +
        class(self)[1],
76 - 24x + 24x +
        format(self$get_filter_state(), show_all = show_all, trim_lines = trim_lines)
@@ -14722,7 +15220,8 @@

teal.slice coverage - 65.73%

86 - 10x + 10x +
      cat(shiny::isolate(self$format(...)), "\n")
@@ -14771,28 +15270,32 @@

teal.slice coverage - 65.73%

93 - 14x + 14x +
      logger::log_trace("Removing all non-locked filters from FilteredDataset: { deparse1(self$get_dataname()) }")
94 - 14x + 14x +
      lapply(
95 - 14x + 14x +
        private$get_filter_states(),
96 - 14x + 14x +
        function(filter_states) filter_states$clear_filter_states()
@@ -14806,14 +15309,16 @@

teal.slice coverage - 65.73%

98 - 14x + 14x +
      logger::log_trace("Removed all non-locked filters from FilteredDataset: { deparse1(self$get_dataname()) }")
99 - 14x + 14x +
      NULL
@@ -14946,21 +15451,24 @@

teal.slice coverage - 65.73%

118 - 41x + 41x +
      filter_call <- Filter(
119 - 41x + 41x +
        f = Negate(is.null),
120 - 41x + 41x +
        x = lapply(private$get_filter_states(), function(x) x$get_call(sid))
@@ -14974,14 +15482,16 @@

teal.slice coverage - 65.73%

122 - 41x + 41x +
      if (length(filter_call) == 0) {
123 - 24x + 24x +
        return(NULL)
@@ -14995,7 +15505,8 @@

teal.slice coverage - 65.73%

125 - 17x + 17x +
      filter_call
@@ -15058,14 +15569,16 @@

teal.slice coverage - 65.73%

134 - 184x + 184x +
      states <- unname(lapply(private$get_filter_states(), function(x) x$get_filter_state()))
135 - 184x + 184x +
      do.call(c, states)
@@ -15191,7 +15704,8 @@

teal.slice coverage - 65.73%

153 - 16x + 16x +
      length(self$get_filter_state())
@@ -15247,7 +15761,8 @@

teal.slice coverage - 65.73%

161 - 8x + 8x +
      private$dataname
@@ -15324,14 +15839,16 @@

teal.slice coverage - 65.73%

172 - 45x + 45x +
      if (filtered) {
173 - 27x + 27x +
        private$data_filtered
@@ -15345,7 +15862,8 @@

teal.slice coverage - 65.73%

175 - 18x + 18x +
        private$dataset
@@ -15401,7 +15919,8 @@

teal.slice coverage - 65.73%

183 - 4x + 4x +
      private$metadata
@@ -15576,7 +16095,8 @@

teal.slice coverage - 65.73%

208 - 147x + 147x +
      private$keys
@@ -15625,7 +16145,8 @@

teal.slice coverage - 65.73%

215 - 3x + 3x +
      private$label
@@ -16199,77 +16720,88 @@

teal.slice coverage - 65.73%

297 - 7x + 7x +
      moduleServer(
298 - 7x + 7x +
        id = id,
299 - 7x + 7x +
        function(input, output, session) {
300 - 7x + 7x +
          dataname <- self$get_dataname()
301 - 7x + 7x +
          logger::log_trace("FilteredDataset$srv_active initializing, dataname: { dataname }")
302 - 7x + 7x +
          checkmate::assert_string(dataname)
303 - 7x + 7x +
          output$filter_count <- renderText(
304 - 7x + 7x +
            sprintf(
305 - 7x + 7x +
              "%d filter%s applied",
306 - 7x + 7x +
              self$get_filter_count(),
307 - 7x + 7x +
              if (self$get_filter_count() != 1) "s" else ""
@@ -16297,28 +16829,32 @@

teal.slice coverage - 65.73%

311 - 7x + 7x +
          lapply(
312 - 7x + 7x +
            names(private$get_filter_states()),
313 - 7x + 7x +
            function(x) {
314 - 12x + 12x +
              private$get_filter_states()[[x]]$srv_active(id = x)
@@ -16346,35 +16882,40 @@

teal.slice coverage - 65.73%

318 - 7x + 7x +
          shiny::observeEvent(self$get_filter_state(), {
319 - 8x + 8x +
            shinyjs::hide("filter_count_ui")
320 - 8x + 8x +
            shinyjs::show("filters")
321 - 8x + 8x +
            shinyjs::toggle("remove_filters", condition = length(self$get_filter_state()) != 0)
322 - 8x + 8x +
            shinyjs::toggle("collapse", condition = length(self$get_filter_state()) != 0)
@@ -16395,7 +16936,8 @@

teal.slice coverage - 65.73%

325 - 7x + 7x +
          shiny::observeEvent(input$collapse, {
@@ -16437,28 +16979,32 @@

teal.slice coverage - 65.73%

331 - 7x + 7x +
          observeEvent(input$remove_filters, {
332 - 1x + 1x +
            logger::log_trace("FilteredDataset$srv_active@1 removing all non-locked filters, dataname: { dataname }")
333 - 1x + 1x +
            self$clear_filter_states()
334 - 1x + 1x +
            logger::log_trace("FilteredDataset$srv_active@1 removed all non-locked filters, dataname: { dataname }")
@@ -16479,7 +17025,8 @@

teal.slice coverage - 65.73%

337 - 7x + 7x +
          logger::log_trace("FilteredDataset$initialized, dataname: { dataname }")
@@ -16493,7 +17040,8 @@

teal.slice coverage - 65.73%

339 - 7x + 7x +
          NULL
@@ -16591,7 +17139,8 @@

teal.slice coverage - 65.73%

353 - 1x + 1x +
      stop("Pure virtual method")
@@ -16717,63 +17266,72 @@

teal.slice coverage - 65.73%

371 - 2x + 2x +
      moduleServer(
372 - 2x + 2x +
        id = id,
373 - 2x + 2x +
        function(input, output, session) {
374 - 2x + 2x +
          logger::log_trace("MAEFilteredDataset$srv_add initializing, dataname: { deparse1(self$get_dataname()) }")
375 - 2x + 2x +
          elems <- private$get_filter_states()
376 - 2x + 2x +
          elem_names <- names(private$get_filter_states())
377 - 2x + 2x +
          lapply(
378 - 2x + 2x +
            elem_names,
379 - 2x + 2x +
            function(elem_name) elems[[elem_name]]$srv_add(elem_name)
@@ -16787,14 +17345,16 @@

teal.slice coverage - 65.73%

381 - 2x + 2x +
          logger::log_trace("MAEFilteredDataset$srv_add initialized, dataname: { deparse1(self$get_dataname()) }")
382 - 2x + 2x +
          NULL
@@ -16941,28 +17501,32 @@

teal.slice coverage - 65.73%

403 - 249x + 249x +
      checkmate::assert_class(filter_states, "FilterStates")
404 - 249x + 249x +
      checkmate::assert_string(id)
405 - 249x + 249x +
      x <- stats::setNames(list(filter_states), id)
406 - 249x + 249x +
      private$filter_states <- c(private$get_filter_states(), x)
@@ -17025,7 +17589,8 @@

teal.slice coverage - 65.73%

415 - 710x + 710x +
      private$filter_states
@@ -17359,7 +17924,8 @@

teal.slice coverage - 65.73%

26 - 25x + 25x +
      if (!requireNamespace("MultiAssayExperiment", quietly = TRUE)) {
@@ -17380,21 +17946,24 @@

teal.slice coverage - 65.73%

29 - 25x + 25x +
      checkmate::assert_class(dataset, "MultiAssayExperiment")
30 - 23x + 23x +
      super$initialize(dataset, dataname, keys, label, metadata)
31 - 23x + 23x +
      experiment_names <- names(dataset)
@@ -17415,49 +17984,56 @@

teal.slice coverage - 65.73%

34 - 23x + 23x +
      private$add_filter_states(
35 - 23x + 23x +
        filter_states = init_filter_states(
36 - 23x + 23x +
          data = dataset,
37 - 23x + 23x +
          data_reactive = private$data_filtered_fun,
38 - 23x + 23x +
          dataname = dataname,
39 - 23x + 23x +
          datalabel = "subjects",
40 - 23x + 23x +
          keys = self$get_keys()
@@ -17471,7 +18047,8 @@

teal.slice coverage - 65.73%

42 - 23x + 23x +
        id = "subjects"
@@ -17506,70 +18083,80 @@

teal.slice coverage - 65.73%

47 - 23x + 23x +
      lapply(
48 - 23x + 23x +
        experiment_names,
49 - 23x + 23x +
        function(experiment_name) {
50 - 115x + 115x +
          data_reactive <- function(sid = "") private$data_filtered_fun(sid)[[experiment_name]]
51 - 115x + 115x +
          private$add_filter_states(
52 - 115x + 115x +
            filter_states = init_filter_states(
53 - 115x + 115x +
              data = dataset[[experiment_name]],
54 - 115x + 115x +
              data_reactive = data_reactive,
55 - 115x + 115x +
              dataname = dataname,
56 - 115x + 115x +
              datalabel = experiment_name
@@ -17583,7 +18170,8 @@

teal.slice coverage - 65.73%

58 - 115x + 115x +
            id = experiment_name
@@ -17849,35 +18437,40 @@

teal.slice coverage - 65.73%

96 - 17x + 17x +
      shiny::isolate({
97 - 17x + 17x +
        logger::log_trace("{ class(self)[1] }$set_filter_state initializing, dataname: { private$dataname }")
98 - 17x + 17x +
        checkmate::assert_class(state, "teal_slices")
99 - 16x + 16x +
        lapply(state, function(x) {
100 - 60x + 60x +
          checkmate::assert_true(x$dataname == private$dataname, .var.name = "dataname matches private$dataname")
@@ -17905,14 +18498,16 @@

teal.slice coverage - 65.73%

104 - 16x + 16x +
        subject_state <- Filter(function(x) is.null(x$experiment), state)
105 - 16x + 16x +
        private$get_filter_states()[["subjects"]]$set_filter_state(subject_state)
@@ -17940,28 +18535,32 @@

teal.slice coverage - 65.73%

109 - 16x + 16x +
        experiments <- slices_field(state, "experiment")
110 - 16x + 16x +
        available_experiments <- setdiff(names(private$get_filter_states()), "subjects")
111 - 16x + 16x +
        excluded_filters <- setdiff(experiments, available_experiments)
112 - 16x + 16x +
        if (length(excluded_filters)) {
@@ -18031,21 +18630,24 @@

teal.slice coverage - 65.73%

122 - 16x + 16x +
        lapply(available_experiments, function(experiment) {
123 - 80x + 80x +
          slices <- Filter(function(x) identical(x$experiment, experiment), state)
124 - 80x + 80x +
          private$get_filter_states()[[experiment]]$set_filter_state(slices)
@@ -18066,7 +18668,8 @@

teal.slice coverage - 65.73%

127 - 16x + 16x +
        logger::log_trace("{ class(self)[1] }$set_filter_state initialized, dataname: { private$dataname }")
@@ -18080,7 +18683,8 @@

teal.slice coverage - 65.73%

129 - 16x + 16x +
        invisible(NULL)
@@ -18178,14 +18782,16 @@

teal.slice coverage - 65.73%

143 - 1x + 1x +
      shiny::isolate({
144 - 1x + 1x +
        checkmate::assert_class(state, "teal_slices")
@@ -18199,7 +18805,8 @@

teal.slice coverage - 65.73%

146 - 1x + 1x +
        logger::log_trace("{ class(self)[1] }$remove_filter_state removing filter(s), dataname: { private$dataname }")
@@ -18213,14 +18820,16 @@

teal.slice coverage - 65.73%

148 - 1x + 1x +
        subject_state <- Filter(function(x) is.null(x$experiment), state)
149 - 1x + 1x +
        private$get_filter_states()[["subjects"]]$remove_filter_state(subject_state)
@@ -18248,28 +18857,32 @@

teal.slice coverage - 65.73%

153 - 1x + 1x +
        experiments <- slices_field(state, "experiment")
154 - 1x + 1x +
        available_experiments <- setdiff(names(private$get_filter_states()), "subjects")
155 - 1x + 1x +
        excluded_filters <- setdiff(experiments, available_experiments)
156 - 1x + 1x +
        if (length(excluded_filters)) {
@@ -18332,7 +18945,8 @@

teal.slice coverage - 65.73%

165 - 1x + 1x +
        lapply(experiments, function(experiment) {
@@ -18374,7 +18988,8 @@

teal.slice coverage - 65.73%

171 - 1x + 1x +
        logger::log_trace("{ class(self)[1] }$remove_filter_state removed filter(s), dataname: { private$dataname }")
@@ -18388,7 +19003,8 @@

teal.slice coverage - 65.73%

173 - 1x + 1x +
        invisible(NULL)
@@ -18689,21 +19305,24 @@

teal.slice coverage - 65.73%

216 - 2x + 2x +
      data <- self$get_dataset()
217 - 2x + 2x +
      data_filtered <- self$get_dataset(TRUE)
218 - 2x + 2x +
      experiment_names <- names(data)
@@ -18717,28 +19336,32 @@

teal.slice coverage - 65.73%

220 - 2x + 2x +
      mae_info <- data.frame(
221 - 2x + 2x +
        dataname = private$dataname,
222 - 2x + 2x +
        subjects = nrow(SummarizedExperiment::colData(data)),
223 - 2x + 2x +
        subjects_filtered = nrow(SummarizedExperiment::colData(data_filtered()))
@@ -18759,49 +19382,56 @@

teal.slice coverage - 65.73%

226 - 2x + 2x +
      experiment_obs_info <- do.call("rbind", lapply(
227 - 2x + 2x +
        experiment_names,
228 - 2x + 2x +
        function(experiment_name) {
229 - 10x + 10x +
          data.frame(
230 - 10x + 10x +
            dataname = sprintf("- %s", experiment_name),
231 - 10x + 10x +
            obs = nrow(data[[experiment_name]]),
232 - 10x + 10x +
            obs_filtered = nrow(data_filtered()[[experiment_name]])
@@ -18836,21 +19466,24 @@

teal.slice coverage - 65.73%

237 - 2x + 2x +
      get_experiment_keys <- function(mae, experiment) {
238 - 20x + 20x +
        sample_subset <- subset(MultiAssayExperiment::sampleMap(mae), colname %in% colnames(experiment))
239 - 20x + 20x +
        length(unique(sample_subset$primary))
@@ -18871,42 +19504,48 @@

teal.slice coverage - 65.73%

242 - 2x + 2x +
      experiment_subjects_info <- do.call("rbind", lapply(
243 - 2x + 2x +
        experiment_names,
244 - 2x + 2x +
        function(experiment_name) {
245 - 10x + 10x +
          data.frame(
246 - 10x + 10x +
            subjects = get_experiment_keys(data, data[[experiment_name]]),
247 - 10x + 10x +
            subjects_filtered = get_experiment_keys(data_filtered(), data_filtered()[[experiment_name]])
@@ -18934,14 +19573,16 @@

teal.slice coverage - 65.73%

251 - 2x + 2x +
      experiment_info <- cbind(experiment_obs_info, experiment_subjects_info)
252 - 2x + 2x +
      dplyr::bind_rows(mae_info, experiment_info)
@@ -19815,28 +20456,32 @@

teal.slice coverage - 65.73%

121 - 16x + 16x +
      shiny::isolate({
122 - 16x + 16x +
        checkmate::assert_logical(x)
123 - 15x + 15x +
        checkmate::assert_logical(slice$selected, null.ok = TRUE)
124 - 14x + 14x +
        super$initialize(x = x, x_reactive = x_reactive, slice = slice, extract_type = extract_type)
@@ -19850,7 +20495,8 @@

teal.slice coverage - 65.73%

126 - 14x + 14x +
        private$set_choices(slice$choices)
@@ -19864,28 +20510,32 @@

teal.slice coverage - 65.73%

128 - 14x + 14x +
        if (is.null(slice$selected) && slice$multiple) {
129 - 7x + 7x +
          slice$selected <- private$get_choices()
130 - 7x + 7x +
        } else if (length(slice$selected) != 1 && !slice$multiple) {
131 - 3x + 3x +
          slice$selected <- TRUE
@@ -19899,28 +20549,32 @@

teal.slice coverage - 65.73%

133 - 14x + 14x +
        private$set_selected(slice$selected)
134 - 14x + 14x +
        df <- factor(x, levels = c(TRUE, FALSE))
135 - 14x + 14x +
        tbl <- table(df)
136 - 14x + 14x +
        private$set_choices_counts(tbl)
@@ -19934,7 +20588,8 @@

teal.slice coverage - 65.73%

138 - 14x + 14x +
      invisible(self)
@@ -20011,7 +20666,8 @@

teal.slice coverage - 65.73%

149 - 6x + 6x +
      if (isFALSE(private$is_any_filtered())) {
@@ -20032,28 +20688,32 @@

teal.slice coverage - 65.73%

152 - 4x + 4x +
      if (missing(dataname)) dataname <- private$get_dataname()
153 - 6x + 6x +
      varname <- private$get_varname_prefixed(dataname)
154 - 6x + 6x +
      choices <- private$get_selected()
155 - 6x + 6x +
      n_choices <- length(choices)
@@ -20067,35 +20727,40 @@

teal.slice coverage - 65.73%

157 - 6x + 6x +
      filter_call <-
158 - 6x + 6x +
        if (n_choices == 1 && choices) {
159 - 1x + 1x +
          private$get_varname_prefixed(dataname)
160 - 6x + 6x +
        } else if (n_choices == 1 && !choices) {
161 - 4x + 4x +
          call("!", private$get_varname_prefixed(dataname))
@@ -20109,7 +20774,8 @@

teal.slice coverage - 65.73%

163 - 1x + 1x +
          call("%in%", private$get_varname_prefixed(dataname), make_c_call(choices))
@@ -20123,7 +20789,8 @@

teal.slice coverage - 65.73%

165 - 6x + 6x +
      private$add_keep_na_call(filter_call, dataname)
@@ -20193,14 +20860,16 @@

teal.slice coverage - 65.73%

175 - 14x + 14x +
      private$teal_slice$choices <- c(TRUE, FALSE)
176 - 14x + 14x +
      invisible(NULL)
@@ -20235,14 +20904,16 @@

teal.slice coverage - 65.73%

181 - 14x + 14x +
      private$choices_counts <- choices_counts
182 - 14x + 14x +
      invisible(NULL)
@@ -20263,28 +20934,32 @@

teal.slice coverage - 65.73%

185 - 21x + 21x +
      tryCatch(
186 - 21x + 21x +
        expr = {
187 - 21x + 21x +
          values_logical <- as.logical(values)
188 - 1x + 1x +
          if (any(is.na(values_logical))) stop()
@@ -20298,7 +20973,8 @@

teal.slice coverage - 65.73%

190 - 21x + 21x +
        error = function(cond) stop("The array of set values must contain values coercible to logical.")
@@ -20312,7 +20988,8 @@

teal.slice coverage - 65.73%

192 - 20x + 20x +
      values_logical
@@ -20333,28 +21010,32 @@

teal.slice coverage - 65.73%

195 - 20x + 20x +
      if (!private$is_multiple() && length(value) > 1) {
196 - 1x + 1x +
        warning(
197 - 1x + 1x +
          sprintf("Selection: %s is not a vector of length one. ", toString(value, width = 360)),
198 - 1x + 1x +
          "Maintaining previous selection."
@@ -20368,7 +21049,8 @@

teal.slice coverage - 65.73%

200 - 1x + 1x +
        value <- shiny::isolate(private$get_selected())
@@ -20382,7 +21064,8 @@

teal.slice coverage - 65.73%

202 - 20x + 20x +
      value
@@ -20403,7 +21086,8 @@

teal.slice coverage - 65.73%

205 - 20x + 20x +
      if (!is.logical(value)) {
@@ -20501,7 +21185,8 @@

teal.slice coverage - 65.73%

219 - 6x + 6x +
      if (private$is_choice_limited) {
@@ -20515,14 +21200,16 @@

teal.slice coverage - 65.73%

221 - 6x + 6x +
      } else if (all(private$choices_counts > 0)) {
222 - 6x + 6x +
        TRUE
@@ -22964,21 +23651,24 @@

teal.slice coverage - 65.73%

146 - 25x + 25x +
      shiny::isolate({
147 - 25x + 25x +
        checkmate::assert_multi_class(x, c("POSIXct", "POSIXlt"))
148 - 24x + 24x +
        checkmate::assert_class(x_reactive, "reactive")
@@ -22992,35 +23682,40 @@

teal.slice coverage - 65.73%

150 - 24x + 24x +
        super$initialize(
151 - 24x + 24x +
          x = x,
152 - 24x + 24x +
          x_reactive = x_reactive,
153 - 24x + 24x +
          slice = slice,
154 - 24x + 24x +
          extract_type = extract_type
@@ -23034,28 +23729,32 @@

teal.slice coverage - 65.73%

156 - 24x + 24x +
        checkmate::assert_multi_class(slice$choices, c("POSIXct", "POSIXlt"), null.ok = TRUE)
157 - 23x + 23x +
        private$set_choices(slice$choices)
158 - 15x + 15x +
        if (is.null(slice$selected)) slice$selected <- slice$choices
159 - 23x + 23x +
        private$set_selected(slice$selected)
@@ -23076,7 +23775,8 @@

teal.slice coverage - 65.73%

162 - 22x + 22x +
      invisible(self)
@@ -23160,14 +23860,16 @@

teal.slice coverage - 65.73%

174 - 7x + 7x +
      if (isFALSE(private$is_any_filtered())) {
175 - 1x + 1x +
        return(NULL)
@@ -23181,56 +23883,64 @@

teal.slice coverage - 65.73%

177 - 4x + 4x +
      if (missing(dataname)) dataname <- private$get_dataname()
178 - 6x + 6x +
      choices <- private$get_selected()
179 - 6x + 6x +
      tzone <- Find(function(x) x != "", attr(as.POSIXlt(choices), "tzone"))
180 - 6x + 6x +
      class <- class(choices)[1L]
181 - 6x + 6x +
      date_fun <- as.name(
182 - 6x + 6x +
        switch(class,
183 - 6x + 6x +
          "POSIXct" = "as.POSIXct",
184 - 6x + 6x +
          "POSIXlt" = "as.POSIXlt"
@@ -23251,21 +23961,24 @@

teal.slice coverage - 65.73%

187 - 6x + 6x +
      choices <- as.character(choices + c(0, 1))
188 - 6x + 6x +
      filter_call <-
189 - 6x + 6x +
        call(
@@ -23279,7 +23992,8 @@

teal.slice coverage - 65.73%

191 - 6x + 6x +
          call(
@@ -23293,14 +24007,16 @@

teal.slice coverage - 65.73%

193 - 6x + 6x +
            private$get_varname_prefixed(dataname),
194 - 6x + 6x +
            as.call(list(date_fun, choices[1L], tz = tzone))
@@ -23314,7 +24030,8 @@

teal.slice coverage - 65.73%

196 - 6x + 6x +
          call(
@@ -23328,14 +24045,16 @@

teal.slice coverage - 65.73%

198 - 6x + 6x +
            private$get_varname_prefixed(dataname),
199 - 6x + 6x +
            as.call(list(date_fun, choices[2L], tz = tzone))
@@ -23356,7 +24075,8 @@

teal.slice coverage - 65.73%

202 - 6x + 6x +
      private$add_keep_na_call(filter_call, dataname)
@@ -23419,14 +24139,16 @@

teal.slice coverage - 65.73%

211 - 23x + 23x +
      if (is.null(choices)) {
212 - 20x + 20x +
        choices <- as.POSIXct(trunc(range(private$x, na.rm = TRUE), units = "secs"))
@@ -23440,28 +24162,32 @@

teal.slice coverage - 65.73%

214 - 3x + 3x +
        choices <- as.POSIXct(choices, units = "secs")
215 - 3x + 3x +
        choices_adjusted <- c(
216 - 3x + 3x +
          max(choices[1L], min(as.POSIXct(private$x), na.rm = TRUE)),
217 - 3x + 3x +
          min(choices[2L], max(as.POSIXct(private$x), na.rm = TRUE))
@@ -23475,28 +24201,32 @@

teal.slice coverage - 65.73%

219 - 3x + 3x +
        if (any(choices != choices_adjusted)) {
220 - 1x + 1x +
          warning(sprintf(
221 - 1x + 1x +
            "Choices adjusted (some values outside of variable range). Varname: %s, dataname: %s.",
222 - 1x + 1x +
            private$get_varname(), private$get_dataname()
@@ -23510,7 +24240,8 @@

teal.slice coverage - 65.73%

224 - 1x + 1x +
          choices <- choices_adjusted
@@ -23524,35 +24255,40 @@

teal.slice coverage - 65.73%

226 - 3x + 3x +
        if (choices[1L] >= choices[2L]) {
227 - 1x + 1x +
          warning(sprintf(
228 - 1x + 1x +
            "Invalid choices: lower is higher / equal to upper, or not in range of variable values.
229 - 1x + 1x +
            Setting defaults. Varname: %s, dataname: %s.",
230 - 1x + 1x +
            private$get_varname(), private$get_dataname()
@@ -23566,7 +24302,8 @@

teal.slice coverage - 65.73%

232 - 1x + 1x +
          choices <- range(private$x, na.rm = TRUE)
@@ -23594,28 +24331,32 @@

teal.slice coverage - 65.73%

236 - 23x + 23x +
      private$set_is_choice_limited(private$x, choices)
237 - 23x + 23x +
      private$x <- private$x[
238 - 23x + 23x +
        (as.POSIXct(trunc(private$x, units = "secs")) >= choices[1L] &
239 - 23x + 23x +
          as.POSIXct(trunc(private$x, units = "secs")) <= choices[2L]) | is.na(private$x)
@@ -23629,14 +24370,16 @@

teal.slice coverage - 65.73%

241 - 23x + 23x +
      private$teal_slice$choices <- choices
242 - 23x + 23x +
      invisible(NULL)
@@ -23678,14 +24421,16 @@

teal.slice coverage - 65.73%

248 - 23x + 23x +
      private$is_choice_limited <- (any(xl < choices[1L], na.rm = TRUE) | any(xl > choices[2L], na.rm = TRUE))
249 - 23x + 23x +
      invisible(NULL)
@@ -23706,7 +24451,8 @@

teal.slice coverage - 65.73%

252 - 30x + 30x +
      if (!(is(value, "POSIXct") || is(value, "POSIXlt"))) {
@@ -23776,28 +24522,32 @@

teal.slice coverage - 65.73%

262 - 30x + 30x +
      pre_msg <- sprintf(
263 - 30x + 30x +
        "dataset '%s', variable '%s': ",
264 - 30x + 30x +
        private$get_dataname(),
265 - 30x + 30x +
        private$get_varname()
@@ -23811,7 +24561,8 @@

teal.slice coverage - 65.73%

267 - 30x + 30x +
      check_in_range(value, private$get_choices(), pre_msg = pre_msg)
@@ -23832,21 +24583,24 @@

teal.slice coverage - 65.73%

270 - 34x + 34x +
      tryCatch(
271 - 34x + 34x +
        expr = {
272 - 34x + 34x +
          values <- as.POSIXct(values, origin = "1970-01-01 00:00:00")
@@ -23867,7 +24621,8 @@

teal.slice coverage - 65.73%

275 - 34x + 34x +
        error = function(error) stop("The array of set values must contain values coercible to POSIX.")
@@ -23881,14 +24636,16 @@

teal.slice coverage - 65.73%

277 - 1x + 1x +
      if (length(values) != 2) stop("The array of set values must have length two.")
278 - 30x + 30x +
      values
@@ -23909,42 +24666,48 @@

teal.slice coverage - 65.73%

281 - 30x + 30x +
      choices <- private$get_choices()
282 - 30x + 30x +
      if (values[1] < choices[1L] || values[1] > choices[2L]) {
283 - 5x + 5x +
        warning(
284 - 5x + 5x +
          sprintf(
285 - 5x + 5x +
            "Value: %s is outside of the range for the column '%s' in dataset '%s', setting minimum possible value.",
286 - 5x + 5x +
            values[1], private$get_varname(), toString(private$get_dataname())
@@ -23965,7 +24728,8 @@

teal.slice coverage - 65.73%

289 - 5x + 5x +
        values[1] <- choices[1L]
@@ -23986,35 +24750,40 @@

teal.slice coverage - 65.73%

292 - 30x + 30x +
      if (values[2] > choices[2L] | values[2] < choices[1L]) {
293 - 5x + 5x +
        warning(
294 - 5x + 5x +
          sprintf(
295 - 5x + 5x +
            "Value: '%s' is outside of the range for the column '%s' in dataset '%s', setting maximum possible value.",
296 - 5x + 5x +
            values[2], private$get_varname(), toString(private$get_dataname())
@@ -24035,7 +24804,8 @@

teal.slice coverage - 65.73%

299 - 5x + 5x +
        values[2] <- choices[2L]
@@ -24056,35 +24826,40 @@

teal.slice coverage - 65.73%

302 - 30x + 30x +
      if (values[1] > values[2]) {
303 - 1x + 1x +
        warning(
304 - 1x + 1x +
          sprintf(
305 - 1x + 1x +
            "Start date '%s' is set after the end date '%s', the values will be replaced by a default datetime range.",
306 - 1x + 1x +
            values[1], values[2]
@@ -24105,7 +24880,8 @@

teal.slice coverage - 65.73%

309 - 1x + 1x +
        values <- c(choices[1L], choices[2L])
@@ -24119,7 +24895,8 @@

teal.slice coverage - 65.73%

311 - 30x + 30x +
      values
@@ -26337,35 +27114,40 @@

teal.slice coverage - 65.73%

57 - 205x + 205x +
  checkmate::assert_class(x_reactive, "reactive")
58 - 204x + 204x +
  checkmate::assert_character(extract_type, max.len = 1, any.missing = FALSE)
59 - 204x + 204x +
  checkmate::assert_class(slice, "teal_slice")
60 - 203x + 203x +
  if (length(extract_type) == 1) {
61 - 49x + 49x +
    checkmate::assert_choice(extract_type, choices = c("list", "matrix"))
@@ -26386,42 +27168,48 @@

teal.slice coverage - 65.73%

64 - 202x + 202x +
  if (all(is.na(x))) {
65 - 1x + 1x +
    EmptyFilterState$new(
66 - 1x + 1x +
      x = x,
67 - 1x + 1x +
      x_reactive = x_reactive,
68 - 1x + 1x +
      slice = slice,
69 - 1x + 1x +
      extract_type = extract_type
@@ -26442,7 +27230,8 @@

teal.slice coverage - 65.73%

72 - 201x + 201x +
    UseMethod("init_filter_state")
@@ -26512,35 +27301,40 @@

teal.slice coverage - 65.73%

82 - 1x + 1x +
  args <- list(
83 - 1x + 1x +
    x = x,
84 - 1x + 1x +
    x_reactive = x_reactive,
85 - 1x + 1x +
    extract_type = extract_type,
86 - 1x + 1x +
    slice
@@ -26561,7 +27355,8 @@

teal.slice coverage - 65.73%

89 - 1x + 1x +
  do.call(FilterState$new, args)
@@ -26624,35 +27419,40 @@

teal.slice coverage - 65.73%

98 - 1x + 1x +
  LogicalFilterState$new(
99 - 1x + 1x +
    x = x,
100 - 1x + 1x +
    x_reactive = x_reactive,
101 - 1x + 1x +
    slice = slice,
102 - 1x + 1x +
    extract_type = extract_type
@@ -26722,35 +27522,40 @@

teal.slice coverage - 65.73%

112 - 125x + 125x +
  args <- list(
113 - 125x + 125x +
    x = x,
114 - 125x + 125x +
    x_reactive = x_reactive,
115 - 125x + 125x +
    slice = slice,
116 - 125x + 125x +
    extract_type = extract_type
@@ -26771,14 +27576,16 @@

teal.slice coverage - 65.73%

119 - 125x + 125x +
  if (length(unique(x[!is.na(x)])) < getOption("teal.threshold_slider_vs_checkboxgroup")) {
120 - 28x + 28x +
    do.call(ChoicesFilterState$new, args)
@@ -26792,7 +27599,8 @@

teal.slice coverage - 65.73%

122 - 97x + 97x +
    do.call(RangeFilterState$new, args)
@@ -26862,35 +27670,40 @@

teal.slice coverage - 65.73%

132 - 32x + 32x +
  ChoicesFilterState$new(
133 - 32x + 32x +
    x = x,
134 - 32x + 32x +
    x_reactive = x_reactive,
135 - 32x + 32x +
    slice = slice,
136 - 32x + 32x +
    extract_type = extract_type
@@ -26960,35 +27773,40 @@

teal.slice coverage - 65.73%

146 - 36x + 36x +
  ChoicesFilterState$new(
147 - 36x + 36x +
    x = x,
148 - 36x + 36x +
    x_reactive = x_reactive,
149 - 36x + 36x +
    slice = slice,
150 - 36x + 36x +
    extract_type = extract_type
@@ -27058,35 +27876,40 @@

teal.slice coverage - 65.73%

160 - 2x + 2x +
  args <- list(
161 - 2x + 2x +
    x = x,
162 - 2x + 2x +
    x_reactive = x_reactive,
163 - 2x + 2x +
    slice = slice,
164 - 2x + 2x +
    extract_type = extract_type
@@ -27107,14 +27930,16 @@

teal.slice coverage - 65.73%

167 - 2x + 2x +
  if (length(unique(x[!is.na(x)])) < getOption("teal.threshold_slider_vs_checkboxgroup")) {
168 - 1x + 1x +
    do.call(ChoicesFilterState$new, args)
@@ -27128,7 +27953,8 @@

teal.slice coverage - 65.73%

170 - 1x + 1x +
    do.call(DateFilterState$new, args)
@@ -27198,35 +28024,40 @@

teal.slice coverage - 65.73%

180 - 2x + 2x +
  args <- list(
181 - 2x + 2x +
    x = x,
182 - 2x + 2x +
    x_reactive = x_reactive,
183 - 2x + 2x +
    slice = slice,
184 - 2x + 2x +
    extract_type = extract_type
@@ -27247,14 +28078,16 @@

teal.slice coverage - 65.73%

187 - 2x + 2x +
  if (length(unique(x[!is.na(x)])) < getOption("teal.threshold_slider_vs_checkboxgroup")) {
188 - 1x + 1x +
    do.call(ChoicesFilterState$new, args)
@@ -27268,7 +28101,8 @@

teal.slice coverage - 65.73%

190 - 1x + 1x +
    do.call(DatetimeFilterState$new, args)
@@ -27338,35 +28172,40 @@

teal.slice coverage - 65.73%

200 - 2x + 2x +
  args <- list(
201 - 2x + 2x +
    x = x,
202 - 2x + 2x +
    x_reactive = x_reactive,
203 - 2x + 2x +
    slice = slice,
204 - 2x + 2x +
    extract_type = extract_type
@@ -27387,14 +28226,16 @@

teal.slice coverage - 65.73%

207 - 2x + 2x +
  if (length(unique(x[!is.na(x)])) < getOption("teal.threshold_slider_vs_checkboxgroup")) {
208 - 1x + 1x +
    do.call(ChoicesFilterState$new, args)
@@ -27408,7 +28249,8 @@

teal.slice coverage - 65.73%

210 - 1x + 1x +
    do.call(DatetimeFilterState$new, args)
@@ -27534,7 +28376,8 @@

teal.slice coverage - 65.73%

228 - 2x + 2x +
  FilterStateExpr$new(slice)
@@ -27688,49 +28531,56 @@

teal.slice coverage - 65.73%

250 - 64x + 64x +
  epsilon <- .Machine$double.eps^0.5 # needed for floating point arithmetic; same value as in base::all.equal()
251 - 64x + 64x +
  if ((length(subinterval) != 2)) {
252 - 2x + 2x +
    stop(
253 - 2x + 2x +
      sprintf(
254 - 2x + 2x +
        "%s range length should be 2 while it is %s",
255 - 2x + 2x +
        pre_msg,
256 - 2x + 2x +
        length(subinterval)
@@ -27758,42 +28608,48 @@

teal.slice coverage - 65.73%

260 - 62x + 62x +
  if (subinterval[[2]] + epsilon < subinterval[[1]]) {
261 - 1x + 1x +
    stop(sprintf(
262 - 1x + 1x +
      "%s unexpected: the upper bound of the range lower than the lower bound \n %s < %s",
263 - 1x + 1x +
      pre_msg,
264 - 1x + 1x +
      subinterval[[2]],
265 - 1x + 1x +
      subinterval[[1]]
@@ -27821,35 +28677,40 @@

teal.slice coverage - 65.73%

269 - 61x + 61x +
  if ((subinterval[[1]] + epsilon < range[[1]]) || (subinterval[[2]] - epsilon > range[[2]])) {
270 - 1x + 1x +
    stop(
271 - 1x + 1x +
      sprintf(
272 - 1x + 1x +
        "%s range (%s) not valid for full range (%s)",
273 - 1x + 1x +
        pre_msg, toString(subinterval), toString(range)
@@ -28017,21 +28878,24 @@

teal.slice coverage - 65.73%

297 - 166x + 166x +
  checkmate::assert_atomic(subset)
298 - 166x + 166x +
  checkmate::assert_atomic(choices)
299 - 166x + 166x +
  checkmate::assert_string(pre_msg)
@@ -28045,14 +28909,16 @@

teal.slice coverage - 65.73%

301 - 166x + 166x +
  subset <- unique(subset)
302 - 166x + 166x +
  choices <- unique(choices)
@@ -28066,49 +28932,56 @@

teal.slice coverage - 65.73%

304 - 166x + 166x +
  if (any(!(subset %in% choices))) {
305 - 2x + 2x +
    stop(paste0(
306 - 2x + 2x +
      pre_msg,
307 - 2x + 2x +
      "(", toString(subset[!(subset %in% choices)], width = 30), ")",
308 - 2x + 2x +
      " not in valid choices ",
309 - 2x + 2x +
      "(", toString(choices, width = 30), ")"
310 - 2x + 2x +
    ), call. = FALSE)
@@ -28122,7 +28995,8 @@

teal.slice coverage - 65.73%

312 - 164x + 164x +
  return(invisible(NULL))
@@ -28283,28 +29157,32 @@

teal.slice coverage - 65.73%

335 - 124x + 124x +
  checkmate::assert_string(color)
336 - 124x + 124x +
  checkmate::assert(
337 - 124x + 124x +
    checkmate::check_number(alpha, lower = 0, upper = 1, null.ok = TRUE),
338 - 124x + 124x +
    checkmate::check_string(alpha, pattern = "[0-9a-f]{2}", null.ok = TRUE)
@@ -28339,14 +29217,16 @@

teal.slice coverage - 65.73%

343 - 124x + 124x +
  sass_file <- bslib::bs_theme()[["layers"]][[2]][["defaults"]][[1]]
344 - 124x + 124x +
  sass_file <- attr(sass_file, "sass_file_path")
@@ -28367,7 +29247,8 @@

teal.slice coverage - 65.73%

347 - 124x + 124x +
  variables_file <- readLines(sass_file)
@@ -28381,14 +29262,16 @@

teal.slice coverage - 65.73%

349 - 124x + 124x +
  ind <- grep("// scss-docs-(start|end) theme-color-variables", variables_file)
350 - 124x + 124x +
  color_definitions <- variables_file[(ind[1] + 1L):(ind[2] - 1L)]
@@ -28409,7 +29292,8 @@

teal.slice coverage - 65.73%

353 - 124x + 124x +
  color_names <- sub("(\\$)(\\w.+)(:.+)", "\\2", color_definitions)
@@ -28430,7 +29314,8 @@

teal.slice coverage - 65.73%

356 - 124x + 124x +
  checkmate::assert_choice(color, color_names)
@@ -28451,7 +29336,8 @@

teal.slice coverage - 65.73%

359 - 124x + 124x +
  color_references <- sub("(\\$)(\\w.+)(:\\s.+\\$)(\\w.+)(\\s.+)", "\\4", color_definitions)
@@ -28472,42 +29358,48 @@

teal.slice coverage - 65.73%

362 - 124x + 124x +
  color_specification <- structure(color_references, names = color_names)
363 - 124x + 124x +
  color_specification <- vapply(color_specification, function(x) {
364 - 992x + 992x +
    line <- grep(sprintf("^\\$%s:\\s+#\\w{6}\\s+!default", x), variables_file, value = TRUE)
365 - 992x + 992x +
    code <- sub("(.+)(#\\w{6})(\\s+.+)", "\\2", line)
366 - 992x + 992x +
    code
367 - 124x + 124x +
  }, character(1L))
@@ -28521,7 +29413,8 @@

teal.slice coverage - 65.73%

369 - 124x + 124x +
  if (!is.null(alpha)) {
@@ -28549,7 +29442,8 @@

teal.slice coverage - 65.73%

373 - 124x + 124x +
  paste0(color_specification[color], alpha)
@@ -29605,56 +30499,64 @@

teal.slice coverage - 65.73%

149 - 126x + 126x +
      shiny::isolate({
150 - 126x + 126x +
        checkmate::assert_numeric(x, all.missing = FALSE)
151 - 2x + 2x +
        if (!any(is.finite(x))) stop("\"x\" contains no finite values")
152 - 123x + 123x +
        super$initialize(x = x, x_reactive = x_reactive, slice = slice, extract_type = extract_type)
153 - 123x + 123x +
        private$is_integer <- checkmate::test_integerish(x)
154 - 123x + 123x +
        private$inf_count <- sum(is.infinite(x))
155 - 123x + 123x +
        private$inf_filtered_count <- reactive(
156 - 123x + 123x +
          if (!is.null(private$x_reactive())) sum(is.infinite(private$x_reactive()))
@@ -29675,14 +30577,16 @@

teal.slice coverage - 65.73%

159 - 123x + 123x +
        checkmate::assert_numeric(slice$choices, null.ok = TRUE)
160 - 3x + 3x +
        if (is.null(slice$keep_inf) && any(is.infinite(x))) slice$keep_inf <- TRUE
@@ -29696,21 +30600,24 @@

teal.slice coverage - 65.73%

162 - 122x + 122x +
        private$set_choices(slice$choices)
163 - 44x + 44x +
        if (is.null(slice$selected)) slice$selected <- slice$choices
164 - 122x + 122x +
        private$set_selected(slice$selected)
@@ -29724,21 +30631,24 @@

teal.slice coverage - 65.73%

166 - 119x + 119x +
        private$is_integer <- checkmate::test_integerish(x)
167 - 119x + 119x +
        private$inf_filtered_count <- reactive(
168 - 119x + 119x +
          if (!is.null(private$x_reactive())) sum(is.infinite(private$x_reactive()))
@@ -29752,7 +30662,8 @@

teal.slice coverage - 65.73%

170 - 119x + 119x +
        private$inf_count <- sum(is.infinite(x))
@@ -29766,63 +30677,72 @@

teal.slice coverage - 65.73%

172 - 119x + 119x +
        private$plot_data <- list(
173 - 119x + 119x +
          type = "histogram",
174 - 119x + 119x +
          nbinsx = 50,
175 - 119x + 119x +
          x = Filter(Negate(is.na), Filter(is.finite, private$x)),
176 - 119x + 119x +
          color = I(fetch_bs_color("secondary")),
177 - 119x + 119x +
          alpha = 0.2,
178 - 119x + 119x +
          bingroup = 1,
179 - 119x + 119x +
          showlegend = FALSE,
180 - 119x + 119x +
          hoverinfo = "none"
@@ -29836,21 +30756,24 @@

teal.slice coverage - 65.73%

182 - 119x + 119x +
        private$plot_mask <- list(list(
183 - 119x + 119x +
          type = "rect", fillcolor = rgb(1, 1, 1, .65), line = list(width = 0),
184 - 119x + 119x +
          x0 = -0.5, x1 = 1.5, y0 = -0.5, y1 = 1.5, xref = "paper", yref = "paper"
@@ -29864,84 +30787,96 @@

teal.slice coverage - 65.73%

186 - 119x + 119x +
        private$plot_layout <- reactive({
187 - 5x + 5x +
          shapes <- private$get_shape_properties(private$get_selected())
188 - 5x + 5x +
          list(
189 - 5x + 5x +
            barmode = "overlay",
190 - 5x + 5x +
            xaxis = list(
191 - 5x + 5x +
              range = private$get_choices(),
192 - 5x + 5x +
              rangeslider = list(thickness = 0),
193 - 5x + 5x +
              showticklabels = TRUE,
194 - 5x + 5x +
              ticks = "outside",
195 - 5x + 5x +
              ticklen = 2,
196 - 5x + 5x +
              tickmode = "auto",
197 - 5x + 5x +
              nticks = 10
@@ -29955,35 +30890,40 @@

teal.slice coverage - 65.73%

199 - 5x + 5x +
            yaxis = list(showgrid = FALSE, showticklabels = FALSE),
200 - 5x + 5x +
            margin = list(b = 17, l = 0, r = 0, t = 0, autoexpand = FALSE),
201 - 5x + 5x +
            plot_bgcolor = "#FFFFFF00",
202 - 5x + 5x +
            paper_bgcolor = "#FFFFFF00",
203 - 5x + 5x +
            shapes = shapes
@@ -30004,35 +30944,40 @@

teal.slice coverage - 65.73%

206 - 119x + 119x +
        private$plot_config <- reactive({
207 - 5x + 5x +
          list(
208 - 5x + 5x +
            doubleClick = "reset",
209 - 5x + 5x +
            displayModeBar = FALSE,
210 - 5x + 5x +
            edits = list(shapePosition = TRUE)
@@ -30053,42 +30998,48 @@

teal.slice coverage - 65.73%

213 - 119x + 119x +
        private$plot_filtered <- reactive({
214 - 5x + 5x +
          finite_values <- Filter(is.finite, private$x_reactive())
215 - 5x + 5x +
          list(
216 - 5x + 5x +
            x = finite_values,
217 - 5x + 5x +
            bingroup = 1,
218 - 5x + 5x +
            color = I(fetch_bs_color("primary"))
@@ -30109,7 +31060,8 @@

teal.slice coverage - 65.73%

221 - 119x + 119x +
        invisible(self)
@@ -30200,14 +31152,16 @@

teal.slice coverage - 65.73%

234 - 34x + 34x +
      if (isFALSE(private$is_any_filtered())) {
235 - 1x + 1x +
        return(NULL)
@@ -30221,21 +31175,24 @@

teal.slice coverage - 65.73%

237 - 4x + 4x +
      if (missing(dataname)) dataname <- private$get_dataname()
238 - 33x + 33x +
      filter_call <-
239 - 33x + 33x +
        call(
@@ -30249,14 +31206,16 @@

teal.slice coverage - 65.73%

241 - 33x + 33x +
          call(">=", private$get_varname_prefixed(dataname), private$get_selected()[1L]),
242 - 33x + 33x +
          call("<=", private$get_varname_prefixed(dataname), private$get_selected()[2L])
@@ -30270,7 +31229,8 @@

teal.slice coverage - 65.73%

244 - 33x + 33x +
      private$add_keep_na_call(private$add_keep_inf_call(filter_call, dataname), dataname)
@@ -30452,21 +31412,24 @@

teal.slice coverage - 65.73%

270 - 122x + 122x +
      x <- private$x[is.finite(private$x)]
271 - 122x + 122x +
      if (is.null(choices)) {
272 - 110x + 110x +
        choices <- range(x)
@@ -30480,35 +31443,40 @@

teal.slice coverage - 65.73%

274 - 12x + 12x +
        choices_adjusted <- c(max(choices[1L], min(x)), min(choices[2L], max(x)))
275 - 12x + 12x +
        if (any(choices != choices_adjusted)) {
276 - 1x + 1x +
          warning(sprintf(
277 - 1x + 1x +
            "Choices adjusted (some values outside of variable range). Varname: %s, dataname: %s.",
278 - 1x + 1x +
            private$get_varname(), private$get_dataname()
@@ -30522,7 +31490,8 @@

teal.slice coverage - 65.73%

280 - 1x + 1x +
          choices <- choices_adjusted
@@ -30536,35 +31505,40 @@

teal.slice coverage - 65.73%

282 - 12x + 12x +
        if (choices[1L] > choices[2L]) {
283 - 1x + 1x +
          warning(sprintf(
284 - 1x + 1x +
            "Invalid choices: lower is higher / equal to upper, or not in range of variable values.
285 - 1x + 1x +
            Setting defaults. Varname: %s, dataname: %s.",
286 - 1x + 1x +
            private$get_varname(), private$get_dataname()
@@ -30578,7 +31552,8 @@

teal.slice coverage - 65.73%

288 - 1x + 1x +
          choices <- range(x)
@@ -30606,21 +31581,24 @@

teal.slice coverage - 65.73%

292 - 122x + 122x +
      private$set_is_choice_limited(private$x, choices)
293 - 122x + 122x +
      private$x <- private$x[
294 - 122x + 122x +
        (private$x >= choices[1L] & private$x <= choices[2L]) | is.na(private$x) | !is.finite(private$x)
@@ -30641,7 +31619,8 @@

teal.slice coverage - 65.73%

297 - 122x + 122x +
      x_range <- range(private$x, finite = TRUE)
@@ -30662,14 +31641,16 @@

teal.slice coverage - 65.73%

300 - 122x + 122x +
      if (identical(diff(x_range), 0)) {
301 - 2x + 2x +
        choices <- x_range
@@ -30683,21 +31664,24 @@

teal.slice coverage - 65.73%

303 - 120x + 120x +
        x_pretty <- pretty(x_range, 100L)
304 - 120x + 120x +
        choices <- range(x_pretty)
305 - 120x + 120x +
        private$numeric_step <- signif(private$get_pretty_range_step(x_pretty), digits = 10)
@@ -30711,14 +31695,16 @@

teal.slice coverage - 65.73%

307 - 122x + 122x +
      private$teal_slice$choices <- choices
308 - 122x + 122x +
      invisible(NULL)
@@ -30760,28 +31746,32 @@

teal.slice coverage - 65.73%

314 - 122x + 122x +
      xl <- xl[!is.na(xl)]
315 - 122x + 122x +
      xl <- xl[is.finite(xl)]
316 - 122x + 122x +
      private$is_choice_limited <- (any(xl < choices[1L]) | any(xl > choices[2L]))
317 - 122x + 122x +
      invisible(NULL)
@@ -30823,14 +31813,16 @@

teal.slice coverage - 65.73%

323 - 33x + 33x +
      if (isTRUE(private$get_keep_inf())) {
324 - 2x + 2x +
        call("|", call("is.infinite", private$get_varname_prefixed(dataname)), filter_call)
@@ -30844,7 +31836,8 @@

teal.slice coverage - 65.73%

326 - 31x + 31x +
        filter_call
@@ -30907,14 +31900,16 @@

teal.slice coverage - 65.73%

335 - 122x + 122x +
      if (private$is_integer && diff(range(pretty_range) > 2)) {
336 - 45x + 45x +
        return(1L)
@@ -30928,21 +31923,24 @@

teal.slice coverage - 65.73%

338 - 77x + 77x +
        n_steps <- length(pretty_range) - 1
339 - 77x + 77x +
        return(
340 - 77x + 77x +
          signif(digits = 10, (max(pretty_range) - min(pretty_range)) / n_steps)
@@ -30991,7 +31989,8 @@

teal.slice coverage - 65.73%

347 - 130x + 130x +
      if (!is.numeric(value)) {
@@ -31054,7 +32053,8 @@

teal.slice coverage - 65.73%

356 - 130x + 130x +
      invisible(NULL)
@@ -31103,28 +32103,32 @@

teal.slice coverage - 65.73%

363 - 138x + 138x +
      values <- as.numeric(values)
364 - 4x + 4x +
      if (any(is.na(values))) stop("Vector of set values must contain values coercible to numeric.")
365 - 2x + 2x +
      if (length(values) != 2) stop("Vector of set values must have length two.")
366 - 2x + 2x +
      if (values[1L] > values[2L]) stop("Vector of set values must be sorted.")
@@ -31138,7 +32142,8 @@

teal.slice coverage - 65.73%

368 - 130x + 130x +
      values
@@ -31166,21 +32171,24 @@

teal.slice coverage - 65.73%

372 - 2x + 2x +
      if (values[1L] < private$get_choices()[1L]) values[1L] <- private$get_choices()[1L]
373 - 2x + 2x +
      if (values[2L] > private$get_choices()[2L]) values[2L] <- private$get_choices()[2L]
374 - 130x + 130x +
      values
@@ -31222,35 +32230,40 @@

teal.slice coverage - 65.73%

380 - 34x + 34x +
      if (private$is_choice_limited) {
381 - 1x + 1x +
        TRUE
382 - 33x + 33x +
      } else if (!isTRUE(all.equal(private$get_selected(), private$get_choices()))) {
383 - 31x + 31x +
        TRUE
384 - 2x + 2x +
      } else if (!isTRUE(private$get_keep_inf()) && private$inf_count > 0) {
@@ -31264,14 +32277,16 @@

teal.slice coverage - 65.73%

386 - 2x + 2x +
      } else if (!isTRUE(private$get_keep_na()) && private$na_count > 0) {
387 - 1x + 1x +
        TRUE
@@ -31285,7 +32300,8 @@

teal.slice coverage - 65.73%

389 - 1x + 1x +
        FALSE
@@ -31334,21 +32350,24 @@

teal.slice coverage - 65.73%

396 - 5x + 5x +
      list(
397 - 5x + 5x +
        list(type = "line", x0 = values[1], x1 = values[1], y0 = -100, y1 = 100, yref = "paper"),
398 - 5x + 5x +
        list(type = "line", x0 = values[2], x1 = values[2], y0 = -100, y1 = 100, yref = "paper")
@@ -31432,70 +32451,80 @@

teal.slice coverage - 65.73%

410 - 5x + 5x +
      ns <- NS(id)
411 - 5x + 5x +
      shiny::isolate({
412 - 5x + 5x +
        ui_input <- shinyWidgets::numericRangeInput(
413 - 5x + 5x +
          inputId = ns("selection_manual"),
414 - 5x + 5x +
          label = NULL,
415 - 5x + 5x +
          min = private$get_choices()[1L],
416 - 5x + 5x +
          max = private$get_choices()[2L],
417 - 5x + 5x +
          value = private$get_selected(),
418 - 5x + 5x +
          step = private$numeric_step,
419 - 5x + 5x +
          width = "100%"
@@ -31509,28 +32538,32 @@

teal.slice coverage - 65.73%

421 - 5x + 5x +
        tagList(
422 - 5x + 5x +
          div(
423 - 5x + 5x +
            class = "choices_state",
424 - 5x + 5x +
            tags$head(tags$script(
@@ -31558,21 +32591,24 @@

teal.slice coverage - 65.73%

428 - 5x + 5x +
              HTML(
429 - 5x + 5x +
                '$(document).ready(function() {
430 - 5x + 5x +
                  $("[data-toggle=\'popover\']").popover();
@@ -31586,35 +32622,40 @@

teal.slice coverage - 65.73%

432 - 5x + 5x +
                  $(document).on("click", function (e) {
433 - 5x + 5x +
                    if (!$("[data-toggle=\'popover\']").is(e.target) &&
434 - 5x + 5x +
                        $("[data-toggle=\'popover\']").has(e.target).length === 0 &&
435 - 5x + 5x +
                        $(".popover").has(e.target).length === 0) {
436 - 5x + 5x +
                      $("[data-toggle=\'popover\']").popover("hide");
@@ -31656,105 +32697,120 @@

teal.slice coverage - 65.73%

442 - 5x + 5x +
            div(
443 - 5x + 5x +
              actionLink(
444 - 5x + 5x +
                ns("plotly_info"),
445 - 5x + 5x +
                label = NULL,
446 - 5x + 5x +
                icon = icon("question-circle"),
447 - 5x + 5x +
                "data-toggle" = "popover",
448 - 5x + 5x +
                "data-html" = "true",
449 - 5x + 5x +
                "data-placement" = "left",
450 - 5x + 5x +
                "data-trigger" = "click",
451 - 5x + 5x +
                "data-title" = "Plot actions",
452 - 5x + 5x +
                "data-content" = "<p>
453 - 5x + 5x +
                                  Drag vertical lines to set selection.<br>
454 - 5x + 5x +
                                  Drag across plot to zoom in.<br>
455 - 5x + 5x +
                                  Drag axis to pan.<br>
456 - 5x + 5x +
                                  Double click to zoom out."
@@ -31768,7 +32824,8 @@

teal.slice coverage - 65.73%

458 - 5x + 5x +
              style = "text-align: right; font-size: 0.7em; margin-bottom: -1em; position: relative; z-index: 9;"
@@ -31782,35 +32839,40 @@

teal.slice coverage - 65.73%

460 - 5x + 5x +
            shinycssloaders::withSpinner(
461 - 5x + 5x +
              plotly::plotlyOutput(ns("plot"), height = "50px"),
462 - 5x + 5x +
              type = 4,
463 - 5x + 5x +
              size = 0.25,
464 - 5x + 5x +
              hide.ui = FALSE
@@ -31824,7 +32886,8 @@

teal.slice coverage - 65.73%

466 - 5x + 5x +
            ui_input
@@ -31838,28 +32901,32 @@

teal.slice coverage - 65.73%

468 - 5x + 5x +
          div(
469 - 5x + 5x +
            class = "filter-card-body-keep-na-inf",
470 - 5x + 5x +
            private$keep_inf_ui(ns("keep_inf")),
471 - 5x + 5x +
            private$keep_na_ui(ns("keep_na"))
@@ -31943,28 +33010,32 @@

teal.slice coverage - 65.73%

483 - 5x + 5x +
      moduleServer(
484 - 5x + 5x +
        id = id,
485 - 5x + 5x +
        function(input, output, session) {
486 - 5x + 5x +
          logger::log_trace("RangeFilterState$server initializing, id: { private$get_id() }")
@@ -31985,7 +33056,8 @@

teal.slice coverage - 65.73%

489 - 5x + 5x +
          selection_manual <- debounce(reactive(input$selection_manual), 200)
@@ -32006,7 +33078,8 @@

teal.slice coverage - 65.73%

492 - 5x + 5x +
          plot_data <- c(private$plot_data, source = session$ns("histogram_plot"))
@@ -32027,42 +33100,48 @@

teal.slice coverage - 65.73%

495 - 5x + 5x +
          output$plot <- plotly::renderPlotly({
496 - 5x + 5x +
            histogram <- do.call(plotly::plot_ly, plot_data)
497 - 5x + 5x +
            histogram <- do.call(plotly::layout, c(list(p = histogram), private$plot_layout()))
498 - 5x + 5x +
            histogram <- do.call(plotly::config, c(list(p = histogram), private$plot_config()))
499 - 5x + 5x +
            histogram <- do.call(plotly::add_histogram, c(list(p = histogram), private$plot_filtered()))
500 - 5x + 5x +
            histogram
@@ -32090,63 +33169,72 @@

teal.slice coverage - 65.73%

504 - 5x + 5x +
          private$observers$relayout <-
505 - 5x + 5x +
            observeEvent(
506 - 5x + 5x +
              ignoreNULL = FALSE,
507 - 5x + 5x +
              ignoreInit = TRUE,
508 - 5x + 5x +
              eventExpr = plotly::event_data("plotly_relayout", source = session$ns("histogram_plot")),
509 - 5x + 5x +
              handlerExpr = {
510 - 1x + 1x +
                logger::log_trace("RangeFilterState$server@1 selection changed, id: { private$get_id() }")
511 - 1x + 1x +
                event <- plotly::event_data("plotly_relayout", source = session$ns("histogram_plot"))
512 - 1x + 1x +
                if (any(grepl("shapes", names(event)))) {
@@ -32335,42 +33423,48 @@

teal.slice coverage - 65.73%

539 - 5x + 5x +
          private$observers$selection_api <-
540 - 5x + 5x +
            observeEvent(
541 - 5x + 5x +
              ignoreNULL = FALSE,
542 - 5x + 5x +
              ignoreInit = TRUE,
543 - 5x + 5x +
              eventExpr = private$get_selected(),
544 - 5x + 5x +
              handlerExpr = {
@@ -32461,35 +33555,40 @@

teal.slice coverage - 65.73%

557 - 5x + 5x +
          private$observers$selection_manual <- observeEvent(
558 - 5x + 5x +
            ignoreNULL = FALSE,
559 - 5x + 5x +
            ignoreInit = TRUE,
560 - 5x + 5x +
            eventExpr = selection_manual(),
561 - 5x + 5x +
            handlerExpr = {
@@ -32755,14 +33854,16 @@

teal.slice coverage - 65.73%

599 - 5x + 5x +
          private$keep_inf_srv("keep_inf")
600 - 5x + 5x +
          private$keep_na_srv("keep_na")
@@ -32776,14 +33877,16 @@

teal.slice coverage - 65.73%

602 - 5x + 5x +
          logger::log_trace("RangeFilterState$server initialized, id: { private$get_id() }")
603 - 5x + 5x +
          NULL
@@ -33070,42 +34173,48 @@

teal.slice coverage - 65.73%

644 - 5x + 5x +
      selection <- private$get_selected()
645 - 5x + 5x +
      tagList(
646 - 5x + 5x +
        tags$span(shiny::HTML(selection[1], "&ndash;", selection[2]), class = "filter-card-summary-value"),
647 - 5x + 5x +
        tags$span(
648 - 5x + 5x +
          class = "filter-card-summary-controls",
649 - 5x + 5x +
          if (isTRUE(private$get_keep_na()) && private$na_count > 0) {
@@ -33147,7 +34256,8 @@

teal.slice coverage - 65.73%

655 - 5x + 5x +
          } else if (isFALSE(private$get_keep_na()) && private$na_count > 0) {
@@ -33196,7 +34306,8 @@

teal.slice coverage - 65.73%

662 - 5x + 5x +
            NULL
@@ -33210,7 +34321,8 @@

teal.slice coverage - 65.73%

664 - 5x + 5x +
          if (isTRUE(private$get_keep_inf()) && private$inf_count > 0) {
@@ -33252,7 +34364,8 @@

teal.slice coverage - 65.73%

670 - 5x + 5x +
          } else if (isFALSE(private$get_keep_inf()) && private$inf_count > 0) {
@@ -33301,7 +34414,8 @@

teal.slice coverage - 65.73%

677 - 5x + 5x +
            NULL
@@ -33385,7 +34499,8 @@

teal.slice coverage - 65.73%

689 - 5x + 5x +
      ns <- NS(id)
@@ -33399,7 +34514,8 @@

teal.slice coverage - 65.73%

691 - 5x + 5x +
      if (private$inf_count > 0) {
@@ -33539,7 +34655,8 @@

teal.slice coverage - 65.73%

711 - 5x + 5x +
        NULL
@@ -33616,7 +34733,8 @@

teal.slice coverage - 65.73%

722 - 5x + 5x +
      moduleServer(id, function(input, output, session) {
@@ -33644,42 +34762,48 @@

teal.slice coverage - 65.73%

726 - 5x + 5x +
        output$trigger_visible <- renderUI({
727 - 5x + 5x +
          updateCountText(
728 - 5x + 5x +
            inputId = "count_label",
729 - 5x + 5x +
            label = "Keep Inf",
730 - 5x + 5x +
            countmax = private$inf_count,
731 - 5x + 5x +
            countnow = private$inf_filtered_count()
@@ -33693,7 +34817,8 @@

teal.slice coverage - 65.73%

733 - 5x + 5x +
          NULL
@@ -33735,35 +34860,40 @@

teal.slice coverage - 65.73%

739 - 5x + 5x +
        private$observers$keep_inf_api <- observeEvent(
740 - 5x + 5x +
          ignoreNULL = TRUE, # its not possible for range that NULL is selected
741 - 5x + 5x +
          ignoreInit = TRUE, # ignoreInit: should not matter because we set the UI with the desired initial state
742 - 5x + 5x +
          eventExpr = private$get_keep_inf(),
743 - 5x + 5x +
          handlerExpr = {
@@ -33840,35 +34970,40 @@

teal.slice coverage - 65.73%

754 - 5x + 5x +
        private$observers$keep_inf <- observeEvent(
755 - 5x + 5x +
          ignoreNULL = TRUE, # it's not possible for range that NULL is selected
756 - 5x + 5x +
          ignoreInit = TRUE, # ignoreInit: should not matter because we set the UI with the desired initial state
757 - 5x + 5x +
          eventExpr = input$value,
758 - 5x + 5x +
          handlerExpr = {
@@ -33917,7 +35052,8 @@

teal.slice coverage - 65.73%

765 - 5x + 5x +
        invisible(NULL)
@@ -34469,35 +35605,40 @@

teal.slice coverage - 65.73%

74 - 356x + 356x +
      checkmate::assert_class(x_reactive, "reactive")
75 - 355x + 355x +
      checkmate::assert_class(slice, "teal_slice")
76 - 353x + 353x +
      checkmate::assert_character(extract_type, max.len = 1, any.missing = FALSE)
77 - 353x + 353x +
      if (length(extract_type) == 1) {
78 - 59x + 59x +
        checkmate::assert_choice(extract_type, choices = c("list", "matrix"))
@@ -34525,14 +35666,16 @@

teal.slice coverage - 65.73%

82 - 352x + 352x +
      private$x <- x
83 - 352x + 352x +
      private$x_reactive <- x_reactive
@@ -34546,21 +35689,24 @@

teal.slice coverage - 65.73%

85 - 352x + 352x +
      private$na_count <- sum(is.na(x))
86 - 352x + 352x +
      private$filtered_na_count <- reactive(
87 - 352x + 352x +
        if (!is.null(private$x_reactive())) {
@@ -34595,7 +35741,8 @@

teal.slice coverage - 65.73%

92 - 352x + 352x +
      private$extract_type <- extract_type
@@ -34616,14 +35763,16 @@

teal.slice coverage - 65.73%

95 - 14x + 14x +
      if (is.null(shiny::isolate(slice$keep_na)) && anyNA(x)) slice$keep_na <- TRUE
96 - 352x + 352x +
      private$teal_slice <- slice
@@ -34637,7 +35786,8 @@

teal.slice coverage - 65.73%

98 - 352x + 352x +
      varlabel <- attr(x, "label")
@@ -34651,21 +35801,24 @@

teal.slice coverage - 65.73%

100 - 352x + 352x +
      private$varlabel <-
101 - 352x + 352x +
        if (is.null(varlabel) || identical(varlabel, private$get_varname())) {
102 - 351x + 351x +
          character(0)
@@ -34679,7 +35832,8 @@

teal.slice coverage - 65.73%

104 - 1x + 1x +
          varlabel
@@ -34700,7 +35854,8 @@

teal.slice coverage - 65.73%

107 - 352x + 352x +
      logger::log_trace("Instantiated FilterState object id: { private$get_id() }")
@@ -34714,7 +35869,8 @@

teal.slice coverage - 65.73%

109 - 352x + 352x +
      invisible(self)
@@ -34798,28 +35954,32 @@

teal.slice coverage - 65.73%

121 - 68x + 68x +
      sprintf(
122 - 68x + 68x +
        "%s:\n%s",
123 - 68x + 68x +
        class(self)[1],
124 - 68x + 68x +
        format(self$get_state(), show_all = show_all, trim_lines = trim_lines)
@@ -34889,7 +36049,8 @@

teal.slice coverage - 65.73%

134 - 14x + 14x +
      cat(shiny::isolate(self$format(...)))
@@ -34980,21 +36141,24 @@

teal.slice coverage - 65.73%

147 - 83x + 83x +
      checkmate::assert_class(state, "teal_slice")
148 - 82x + 82x +
      if (private$is_fixed()) {
149 - 1x + 1x +
        logger::log_warn("attempt to set state on fixed filter aborted id: { private$get_id() }")
@@ -35008,28 +36172,32 @@

teal.slice coverage - 65.73%

151 - 81x + 81x +
        logger::log_trace("{ class(self)[1] }$set_state setting state of filter id: { private$get_id() }")
152 - 81x + 81x +
        shiny::isolate({
153 - 81x + 81x +
          if (!is.null(state$selected)) {
154 - 72x + 72x +
            private$set_selected(state$selected)
@@ -35043,14 +36211,16 @@

teal.slice coverage - 65.73%

156 - 69x + 69x +
          if (!is.null(state$keep_na)) {
157 - 16x + 16x +
            private$set_keep_na(state$keep_na)
@@ -35064,14 +36234,16 @@

teal.slice coverage - 65.73%

159 - 69x + 69x +
          if (!is.null(state$keep_inf)) {
160 - 9x + 9x +
            private$set_keep_inf(state$keep_inf)
@@ -35085,35 +36257,40 @@

teal.slice coverage - 65.73%

162 - 69x + 69x +
          current_state <- sprintf(
163 - 69x + 69x +
            "selected: %s; keep_na: %s; keep_inf: %s",
164 - 69x + 69x +
            toString(private$get_selected()),
165 - 69x + 69x +
            private$get_keep_na(),
166 - 69x + 69x +
            private$get_keep_inf()
@@ -35148,7 +36325,8 @@

teal.slice coverage - 65.73%

171 - 70x + 70x +
      invisible(self)
@@ -35218,7 +36396,8 @@

teal.slice coverage - 65.73%

181 - 747x + 747x +
      private$teal_slice
@@ -35288,7 +36467,8 @@

teal.slice coverage - 65.73%

191 - 1x + 1x +
      stop("this is a virtual method")
@@ -35379,42 +36559,48 @@

teal.slice coverage - 65.73%

204 - 12x + 12x +
      moduleServer(
205 - 12x + 12x +
        id = id,
206 - 12x + 12x +
        function(input, output, session) {
207 - 12x + 12x +
          logger::log_trace("FilterState$server initializing module for slice: { private$get_id() } ")
208 - 12x + 12x +
          private$server_summary("summary")
209 - 12x + 12x +
          if (private$is_fixed()) {
@@ -35435,7 +36621,8 @@

teal.slice coverage - 65.73%

212 - 12x + 12x +
            private$server_inputs("inputs")
@@ -35456,14 +36643,16 @@

teal.slice coverage - 65.73%

215 - 12x + 12x +
          private$destroy_shiny <- function() {
216 - 8x + 8x +
            logger::log_trace("Destroying FilterState inputs and observers; id: { private$get_id() }")
@@ -35477,7 +36666,8 @@

teal.slice coverage - 65.73%

218 - 8x + 8x +
            lapply(session$ns(names(input)), .subset2(input, "impl")$.values$remove)
@@ -35498,7 +36688,8 @@

teal.slice coverage - 65.73%

221 - 8x + 8x +
            lapply(private$observers, function(x) x$destroy())
@@ -35519,7 +36710,8 @@

teal.slice coverage - 65.73%

224 - 12x + 12x +
          reactive(input$remove)
@@ -35610,7 +36802,8 @@

teal.slice coverage - 65.73%

237 - 12x + 12x +
      ns <- NS(id)
@@ -35624,49 +36817,56 @@

teal.slice coverage - 65.73%

239 - 12x + 12x +
      tags$div(
240 - 12x + 12x +
        id = id,
241 - 12x + 12x +
        class = "panel filter-card",
242 - 12x + 12x +
        include_js_files("count-bar-labels.js"),
243 - 12x + 12x +
        tags$div(
244 - 12x + 12x +
          class = "filter-card-header",
245 - 12x + 12x +
          tags$div(
@@ -35680,28 +36880,32 @@

teal.slice coverage - 65.73%

247 - 12x + 12x +
            class = "filter-card-title",
248 - 12x + 12x +
            `data-toggle` = "collapse",
249 - 12x + 12x +
            `data-bs-toggle` = "collapse",
250 - 12x + 12x +
            href = paste0("#", ns("body")),
@@ -35715,28 +36919,32 @@

teal.slice coverage - 65.73%

252 - 12x + 12x +
            if (private$is_locked()) icon("lock") else NULL,
253 - 12x + 12x +
            if (private$is_fixed()) icon("burst") else NULL,
254 - 12x + 12x +
            tags$span(tags$strong(private$get_varname())),
255 - 12x + 12x +
            tags$span(private$get_varlabel(), class = "filter-card-varlabel")
@@ -35750,35 +36958,40 @@

teal.slice coverage - 65.73%

257 - 12x + 12x +
          if (isFALSE(private$is_locked())) {
258 - 12x + 12x +
            actionLink(
259 - 12x + 12x +
              inputId = ns("remove"),
260 - 12x + 12x +
              label = icon("circle-xmark", lib = "font-awesome"),
261 - 12x + 12x +
              class = "filter-card-remove"
@@ -35799,42 +37012,48 @@

teal.slice coverage - 65.73%

264 - 12x + 12x +
          tags$div(
265 - 12x + 12x +
            class = "filter-card-summary",
266 - 12x + 12x +
            `data-toggle` = "collapse",
267 - 12x + 12x +
            `data-bs-toggle` = "collapse",
268 - 12x + 12x +
            href = paste0("#", ns("body")),
269 - 12x + 12x +
            private$ui_summary(ns("summary"))
@@ -35855,56 +37074,64 @@

teal.slice coverage - 65.73%

272 - 12x + 12x +
        tags$div(
273 - 12x + 12x +
          id = ns("body"),
274 - 12x + 12x +
          class = "collapse out",
275 - 12x + 12x +
          `data-parent` = paste0("#", parent_id),
276 - 12x + 12x +
          `data-bs-parent` = paste0("#", parent_id),
277 - 12x + 12x +
          tags$div(
278 - 12x + 12x +
            class = "filter-card-body",
279 - 12x + 12x +
            if (private$is_fixed()) {
@@ -35925,7 +37152,8 @@

teal.slice coverage - 65.73%

282 - 12x + 12x +
              private$ui_inputs(ns("inputs"))
@@ -36016,14 +37244,16 @@

teal.slice coverage - 65.73%

295 - 47x + 47x +
      if (!is.null(private$destroy_shiny)) {
296 - 8x + 8x +
        private$destroy_shiny()
@@ -36317,35 +37547,40 @@

teal.slice coverage - 65.73%

338 - 400x + 400x +
      logger::log_trace(
339 - 400x + 400x +
        sprintf(
340 - 400x + 400x +
          "%s$set_selected setting selection of id: %s",
341 - 400x + 400x +
          class(self)[1],
342 - 400x + 400x +
          private$get_id()
@@ -36366,42 +37601,48 @@

teal.slice coverage - 65.73%

345 - 400x + 400x +
      shiny::isolate({
346 - 400x + 400x +
        value <- private$cast_and_validate(value)
347 - 383x + 383x +
        value <- private$remove_out_of_bound_values(value)
348 - 383x + 383x +
        value <- private$check_multiple(value)
349 - 383x + 383x +
        private$validate_selection(value)
350 - 383x + 383x +
        private$teal_slice$selected <- value
@@ -36415,35 +37656,40 @@

teal.slice coverage - 65.73%

352 - 383x + 383x +
      logger::log_trace(
353 - 383x + 383x +
        sprintf(
354 - 383x + 383x +
          "%s$set_selected selection of id: %s",
355 - 383x + 383x +
          class(self)[1],
356 - 383x + 383x +
          private$get_id()
@@ -36471,7 +37717,8 @@

teal.slice coverage - 65.73%

360 - 383x + 383x +
      invisible(NULL)
@@ -36569,56 +37816,64 @@

teal.slice coverage - 65.73%

374 - 16x + 16x +
      checkmate::assert_flag(value)
375 - 16x + 16x +
      private$teal_slice$keep_na <- value
376 - 16x + 16x +
      logger::log_trace(
377 - 16x + 16x +
        sprintf(
378 - 16x + 16x +
          "%s$set_keep_na set for filter %s to %s.",
379 - 16x + 16x +
          class(self)[1],
380 - 16x + 16x +
          private$get_id(),
381 - 16x + 16x +
          value
@@ -36639,14 +37894,16 @@

teal.slice coverage - 65.73%

384 - 16x + 16x +
      private$set_na_rm(!value)
385 - 16x + 16x +
      invisible(NULL)
@@ -36730,56 +37987,64 @@

teal.slice coverage - 65.73%

397 - 9x + 9x +
      checkmate::assert_flag(value)
398 - 9x + 9x +
      private$teal_slice$keep_inf <- value
399 - 9x + 9x +
      logger::log_trace(
400 - 9x + 9x +
        sprintf(
401 - 9x + 9x +
          "%s$set_keep_inf of filter %s set to %s",
402 - 9x + 9x +
          class(self)[1],
403 - 9x + 9x +
          private$get_id(),
404 - 9x + 9x +
          value
@@ -36807,7 +38072,8 @@

teal.slice coverage - 65.73%

408 - 9x + 9x +
      invisible(NULL)
@@ -36912,21 +38178,24 @@

teal.slice coverage - 65.73%

423 - 16x + 16x +
      checkmate::assert_flag(value)
424 - 16x + 16x +
      private$na_rm <- value
425 - 16x + 16x +
      invisible(NULL)
@@ -36989,7 +38258,8 @@

teal.slice coverage - 65.73%

434 - 288x + 288x +
      shiny::isolate(private$teal_slice$dataname)
@@ -37038,7 +38308,8 @@

teal.slice coverage - 65.73%

441 - 434x + 434x +
      shiny::isolate(private$teal_slice$varname)
@@ -37087,7 +38358,8 @@

teal.slice coverage - 65.73%

448 - 4x + 4x +
      shiny::isolate(private$teal_slice$id)
@@ -37136,7 +38408,8 @@

teal.slice coverage - 65.73%

455 - 1030x + 1030x +
      shiny::isolate(private$teal_slice$choices)
@@ -37185,7 +38458,8 @@

teal.slice coverage - 65.73%

462 - 307x + 307x +
      private$teal_slice$selected
@@ -37234,7 +38508,8 @@

teal.slice coverage - 65.73%

469 - 198x + 198x +
      private$teal_slice$keep_na
@@ -37283,7 +38558,8 @@

teal.slice coverage - 65.73%

476 - 116x + 116x +
      private$teal_slice$keep_inf
@@ -37325,7 +38601,8 @@

teal.slice coverage - 65.73%

482 - 118x + 118x +
      shiny::isolate(isTRUE(private$teal_slice$fixed))
@@ -37367,7 +38644,8 @@

teal.slice coverage - 65.73%

488 - 24x + 24x +
      shiny::isolate(isTRUE(private$teal_slice$locked))
@@ -37409,7 +38687,8 @@

teal.slice coverage - 65.73%

494 - 192x + 192x +
      shiny::isolate(isTRUE(private$teal_slice$multiple))
@@ -37472,7 +38751,8 @@

teal.slice coverage - 65.73%

503 - 12x + 12x +
      private$varlabel
@@ -37535,35 +38815,40 @@

teal.slice coverage - 65.73%

512 - 155x + 155x +
      ans <-
513 - 155x + 155x +
        if (isTRUE(private$extract_type == "list")) {
514 - 29x + 29x +
          sprintf("%s$%s", dataname, private$get_varname())
515 - 155x + 155x +
        } else if (isTRUE(private$extract_type == "matrix")) {
516 - 13x + 13x +
          sprintf("%s[, \"%s\"]", dataname, private$get_varname())
@@ -37577,7 +38862,8 @@

teal.slice coverage - 65.73%

518 - 113x + 113x +
          private$get_varname()
@@ -37591,7 +38877,8 @@

teal.slice coverage - 65.73%

520 - 155x + 155x +
      str2lang(ans)
@@ -37668,28 +38955,32 @@

teal.slice coverage - 65.73%

531 - 89x + 89x +
      if (isTRUE(private$get_keep_na())) {
532 - 15x + 15x +
        call("|", call("is.na", private$get_varname_prefixed(dataname)), filter_call)
533 - 74x + 74x +
      } else if (isTRUE(private$na_rm) && private$na_count > 0L) {
534 - 1x + 1x +
        call(
@@ -37703,14 +38994,16 @@

teal.slice coverage - 65.73%

536 - 1x + 1x +
          call("!", call("is.na", private$get_varname_prefixed(dataname))),
537 - 1x + 1x +
          filter_call
@@ -37731,7 +39024,8 @@

teal.slice coverage - 65.73%

540 - 73x + 73x +
        filter_call
@@ -37815,7 +39109,8 @@

teal.slice coverage - 65.73%

552 - 11x + 11x +
      values
@@ -37878,7 +39173,8 @@

teal.slice coverage - 65.73%

561 - 31x + 31x +
      values
@@ -37920,7 +39216,8 @@

teal.slice coverage - 65.73%

567 - 200x + 200x +
      value
@@ -37969,7 +39266,8 @@

teal.slice coverage - 65.73%

574 - 11x + 11x +
      invisible(NULL)
@@ -38018,42 +39316,48 @@

teal.slice coverage - 65.73%

581 - 50x + 50x +
      if (private$is_choice_limited) {
582 - 3x + 3x +
        TRUE
583 - 47x + 47x +
      } else if (!setequal(private$get_selected(), private$get_choices())) {
584 - 40x + 40x +
        TRUE
585 - 7x + 7x +
      } else if (!isTRUE(private$get_keep_na()) && private$na_count > 0) {
586 - 3x + 3x +
        TRUE
@@ -38067,7 +39371,8 @@

teal.slice coverage - 65.73%

588 - 4x + 4x +
        FALSE
@@ -38137,14 +39442,16 @@

teal.slice coverage - 65.73%

598 - 12x + 12x +
      ns <- NS(id)
599 - 12x + 12x +
      uiOutput(ns("summary"), class = "filter-card-summary")
@@ -38200,28 +39507,32 @@

teal.slice coverage - 65.73%

607 - 12x + 12x +
      moduleServer(
608 - 12x + 12x +
        id = id,
609 - 12x + 12x +
        function(input, output, session) {
610 - 12x + 12x +
          output$summary <- renderUI(private$content_summary())
@@ -38508,14 +39819,16 @@

teal.slice coverage - 65.73%

651 - 12x + 12x +
      ns <- NS(id)
652 - 12x + 12x +
      if (private$na_count > 0) {
@@ -38669,7 +39982,8 @@

teal.slice coverage - 65.73%

674 - 12x + 12x +
        NULL
@@ -38746,7 +40060,8 @@

teal.slice coverage - 65.73%

685 - 12x + 12x +
      moduleServer(id, function(input, output, session) {
@@ -38774,42 +40089,48 @@

teal.slice coverage - 65.73%

689 - 12x + 12x +
        output$trigger_visible <- renderUI({
690 - 12x + 12x +
          updateCountText(
691 - 12x + 12x +
            inputId = "count_label",
692 - 12x + 12x +
            label = "Keep NA",
693 - 12x + 12x +
            countmax = private$na_count,
694 - 12x + 12x +
            countnow = private$filtered_na_count()
@@ -38823,7 +40144,8 @@

teal.slice coverage - 65.73%

696 - 12x + 12x +
          NULL
@@ -38865,35 +40187,40 @@

teal.slice coverage - 65.73%

702 - 12x + 12x +
        private$observers$keep_na_api <- observeEvent(
703 - 12x + 12x +
          eventExpr = private$get_keep_na(),
704 - 12x + 12x +
          ignoreNULL = FALSE, # nothing selected is possible for NA
705 - 12x + 12x +
          ignoreInit = TRUE, # ignoreInit: should not matter because we set the UI with the desired initial state
706 - 12x + 12x +
          handlerExpr = {
@@ -38970,35 +40297,40 @@

teal.slice coverage - 65.73%

717 - 12x + 12x +
        private$observers$keep_na <- observeEvent(
718 - 12x + 12x +
          ignoreNULL = FALSE, # ignoreNULL: we don't want to ignore NULL when nothing is selected in the `selectInput`
719 - 12x + 12x +
          ignoreInit = TRUE, # ignoreInit: should not matter because we set the UI with the desired initial state
720 - 12x + 12x +
          eventExpr = input$value,
721 - 12x + 12x +
          handlerExpr = {
@@ -39068,7 +40400,8 @@

teal.slice coverage - 65.73%

731 - 12x + 12x +
        invisible(NULL)
@@ -39249,7 +40582,8 @@

teal.slice coverage - 65.73%

21 - 9x + 9x +
  if (is.factor(choices)) {
@@ -39277,35 +40611,40 @@

teal.slice coverage - 65.73%

25 - 9x + 9x +
  stopifnot(
26 - 9x + 9x +
    is.character(choices) ||
27 - 9x + 9x +
      is.numeric(choices) ||
28 - 9x + 9x +
      is.logical(choices) ||
29 - 9x + 9x +
      (length(choices) == 1 && is.na(choices))
@@ -39326,7 +40665,8 @@

teal.slice coverage - 65.73%

32 - 9x + 9x +
  if (is.factor(labels)) {
@@ -39354,14 +40694,16 @@

teal.slice coverage - 65.73%

36 - 9x + 9x +
  checkmate::assert_character(labels[!is.na(labels)], any.missing = FALSE)
37 - 9x + 9x +
  if (length(choices) != length(labels)) {
@@ -39382,14 +40724,16 @@

teal.slice coverage - 65.73%

40 - 9x + 9x +
  stopifnot(is.null(subset) || is.vector(subset))
41 - 9x + 9x +
  stopifnot(is.null(types) || is.vector(types))
@@ -39403,14 +40747,16 @@

teal.slice coverage - 65.73%

43 - 9x + 9x +
  if (is.vector(types)) {
44 - 9x + 9x +
    stopifnot(length(choices) == length(types))
@@ -39431,7 +40777,8 @@

teal.slice coverage - 65.73%

47 - 9x + 9x +
  if (!is.null(subset)) {
@@ -39494,56 +40841,64 @@

teal.slice coverage - 65.73%

56 - 9x + 9x +
  is_dupl <- duplicated(choices)
57 - 9x + 9x +
  choices <- choices[!is_dupl]
58 - 9x + 9x +
  labels <- labels[!is_dupl]
59 - 9x + 9x +
  types <- types[!is_dupl]
60 - 9x + 9x +
  labels[is.na(labels)] <- "Label Missing"
61 - 9x + 9x +
  raw_labels <- labels
62 - 9x + 9x +
  combined_labels <- if (length(choices) > 0) {
63 - 9x + 9x +
    paste0(choices, ": ", labels)
@@ -39578,7 +40933,8 @@

teal.slice coverage - 65.73%

68 - 9x + 9x +
  if (!is.null(subset)) {
@@ -39627,49 +40983,56 @@

teal.slice coverage - 65.73%

75 - 9x + 9x +
  choices <- structure(
76 - 9x + 9x +
    choices,
77 - 9x + 9x +
    names = combined_labels,
78 - 9x + 9x +
    raw_labels = raw_labels,
79 - 9x + 9x +
    combined_labels = combined_labels,
80 - 9x + 9x +
    class = c("choices_labeled", "character"),
81 - 9x + 9x +
    types = types
@@ -39690,7 +41053,8 @@

teal.slice coverage - 65.73%

84 - 9x + 9x +
  return(choices)
@@ -40284,28 +41648,32 @@

teal.slice coverage - 65.73%

83 - 3x + 3x +
  checkmate::assert_multi_class(datasets, c("FilteredData", "FilterPanelAPI"))
84 - 3x + 3x +
  checkmate::assert(
85 - 3x + 3x +
    checkmate::check_class(filter, "teal_slices"),
86 - 3x + 3x +
    checkmate::check_list(filter, min.len = 0, null.ok = TRUE)
@@ -40319,7 +41687,8 @@

teal.slice coverage - 65.73%

88 - 3x + 3x +
  if (!is.teal_slices(filter)) {
@@ -40347,14 +41716,16 @@

teal.slice coverage - 65.73%

92 - 3x + 3x +
  datasets$set_filter_state(filter)
93 - 3x + 3x +
  invisible(NULL)
@@ -40396,14 +41767,16 @@

teal.slice coverage - 65.73%

99 - 4x + 4x +
  checkmate::assert_multi_class(datasets, c("FilteredData", "FilterPanelAPI"))
100 - 4x + 4x +
  if (shiny::isRunning()) {
@@ -40424,7 +41797,8 @@

teal.slice coverage - 65.73%

103 - 4x + 4x +
    shiny::isolate(datasets$get_filter_state())
@@ -40473,28 +41847,32 @@

teal.slice coverage - 65.73%

110 - 1x + 1x +
  checkmate::assert_multi_class(datasets, c("FilteredData", "FilterPanelAPI"))
111 - 1x + 1x +
  checkmate::assert(
112 - 1x + 1x +
    checkmate::check_class(filter, "teal_slices"),
113 - 1x + 1x +
    checkmate::check_list(filter, min.len = 0, null.ok = TRUE)
@@ -40515,14 +41893,16 @@

teal.slice coverage - 65.73%

116 - 1x + 1x +
  datasets$remove_filter_state(filter)
117 - 1x + 1x +
  invisible(NULL)
@@ -40564,21 +41944,24 @@

teal.slice coverage - 65.73%

123 - 1x + 1x +
  checkmate::assert_multi_class(datasets, c("FilteredData", "FilterPanelAPI"))
124 - 1x + 1x +
  datasets$clear_filter_states()
125 - 1x + 1x +
  invisible(NULL)
@@ -40683,28 +42066,32 @@

teal.slice coverage - 65.73%

140 - 2x + 2x +
  checkmate::assert_character(datanames, min.len = 1, any.missing = FALSE)
141 - 2x + 2x +
  stopifnot(
142 - 2x + 2x +
    is(datasets, "FilteredData"),
143 - 2x + 2x +
    all(datanames %in% datasets$datanames())
@@ -40725,35 +42112,40 @@

teal.slice coverage - 65.73%

146 - 2x + 2x +
  paste(
147 - 2x + 2x +
    unlist(lapply(
148 - 2x + 2x +
      datanames,
149 - 2x + 2x +
      function(dataname) {
150 - 4x + 4x +
        datasets$get_call(dataname)
@@ -40774,7 +42166,8 @@

teal.slice coverage - 65.73%

153 - 2x + 2x +
    collapse = "\n"
@@ -41151,28 +42544,32 @@

teal.slice coverage - 65.73%

51 - 296x + 296x +
      checkmate::assert_string(dataname)
52 - 294x + 294x +
      logger::log_trace("Instantiating { class(self)[1] }, dataname: { dataname }")
53 - 294x + 294x +
      checkmate::assert_function(data_reactive, args = "sid")
54 - 294x + 294x +
      checkmate::assert_string(datalabel, null.ok = TRUE)
@@ -41186,42 +42583,48 @@

teal.slice coverage - 65.73%

56 - 294x + 294x +
      private$dataname <- dataname
57 - 294x + 294x +
      private$datalabel <- datalabel
58 - 294x + 294x +
      private$dataname_prefixed <- dataname
59 - 294x + 294x +
      private$data <- data
60 - 294x + 294x +
      private$data_reactive <- data_reactive
61 - 294x + 294x +
      private$state_list <- reactiveVal()
@@ -41235,14 +42638,16 @@

teal.slice coverage - 65.73%

63 - 294x + 294x +
      logger::log_trace("Instantiated { class(self)[1] }, dataname: { private$dataname }")
64 - 294x + 294x +
      invisible(self)
@@ -41669,7 +43074,8 @@

teal.slice coverage - 65.73%

125 - 82x + 82x +
      logger::log_trace("FilterStates$get_call initializing")
@@ -41704,21 +43110,24 @@

teal.slice coverage - 65.73%

130 - 82x + 82x +
      states_list <- private$state_list_get()
131 - 82x + 82x +
      if (length(states_list) == 0) {
132 - 47x + 47x +
        return(NULL)
@@ -41732,35 +43141,40 @@

teal.slice coverage - 65.73%

134 - 35x + 35x +
      args <- vapply(
135 - 35x + 35x +
        states_list,
136 - 35x + 35x +
        function(x) {
137 - 56x + 56x +
          arg <- x$get_state()$arg
138 - 7x + 7x +
          `if`(is.null(arg), "", arg) # converting NULL -> "" to enable tapply.
@@ -41774,7 +43188,8 @@

teal.slice coverage - 65.73%

140 - 35x + 35x +
        character(1)
@@ -41795,35 +43210,40 @@

teal.slice coverage - 65.73%

143 - 35x + 35x +
      filter_items <- tapply(
144 - 35x + 35x +
        X = states_list,
145 - 35x + 35x +
        INDEX = args,
146 - 35x + 35x +
        simplify = FALSE,
147 - 35x + 35x +
        function(items) {
@@ -41837,14 +43257,16 @@

teal.slice coverage - 65.73%

149 - 37x + 37x +
          other_filter_idx <- !names(items) %in% sid
150 - 37x + 37x +
          filtered_items <- items[other_filter_idx]
@@ -41858,42 +43280,48 @@

teal.slice coverage - 65.73%

152 - 37x + 37x +
          calls <- Filter(
153 - 37x + 37x +
            Negate(is.null),
154 - 37x + 37x +
            lapply(
155 - 37x + 37x +
              filtered_items,
156 - 37x + 37x +
              function(state) {
157 - 50x + 50x +
                state$get_call(dataname = private$dataname_prefixed)
@@ -41921,7 +43349,8 @@

teal.slice coverage - 65.73%

161 - 37x + 37x +
          calls_combine_by(calls, operator = "&")
@@ -41942,21 +43371,24 @@

teal.slice coverage - 65.73%

164 - 35x + 35x +
      filter_items <- Filter(
165 - 35x + 35x +
        x = filter_items,
166 - 35x + 35x +
        f = Negate(is.null)
@@ -41970,49 +43402,56 @@

teal.slice coverage - 65.73%

168 - 35x + 35x +
      if (length(filter_items) > 0L) {
169 - 34x + 34x +
        filter_function <- private$fun
170 - 34x + 34x +
        data_name <- str2lang(private$dataname_prefixed)
171 - 34x + 34x +
        substitute(
172 - 34x + 34x +
          env = list(
173 - 34x + 34x +
            lhs = data_name,
174 - 34x + 34x +
            rhs = as.call(c(filter_function, c(list(data_name), filter_items)))
@@ -42026,7 +43465,8 @@

teal.slice coverage - 65.73%

176 - 34x + 34x +
          expr = lhs <- rhs
@@ -42054,7 +43494,8 @@

teal.slice coverage - 65.73%

180 - 1x + 1x +
        NULL
@@ -42208,42 +43649,48 @@

teal.slice coverage - 65.73%

202 - 17x + 17x +
      shiny::isolate({
203 - 17x + 17x +
        checkmate::assert_class(state, "teal_slices")
204 - 17x + 17x +
        state_ids <- vapply(state, `[[`, character(1), "id")
205 - 17x + 17x +
        logger::log_trace("{ class(self)[1] }$remove_filter_state removing filters, state_id: { toString(state_ids) }")
206 - 17x + 17x +
        private$state_list_remove(state_ids)
207 - 17x + 17x +
        invisible(NULL)
@@ -42334,14 +43781,16 @@

teal.slice coverage - 65.73%

220 - 370x + 370x +
      slices <- unname(lapply(private$state_list(), function(x) x$get_state()))
221 - 370x + 370x +
      fs <- do.call(teal_slices, c(slices, list(count_type = private$count_type)))
@@ -42355,35 +43804,40 @@

teal.slice coverage - 65.73%

223 - 370x + 370x +
      include_varnames <- private$include_varnames
224 - 370x + 370x +
      if (length(include_varnames)) {
225 - 211x + 211x +
        attr(fs, "include_varnames") <- structure(
226 - 211x + 211x +
          list(include_varnames),
227 - 211x + 211x +
          names = private$dataname
@@ -42411,35 +43865,40 @@

teal.slice coverage - 65.73%

231 - 370x + 370x +
      exclude_varnames <- private$exclude_varnames
232 - 370x + 370x +
      if (length(exclude_varnames)) {
233 - 8x + 8x +
        attr(fs, "exclude_varnames") <- structure(
234 - 8x + 8x +
          list(exclude_varnames),
235 - 8x + 8x +
          names = private$dataname
@@ -42467,7 +43926,8 @@

teal.slice coverage - 65.73%

239 - 370x + 370x +
      return(fs)
@@ -42565,49 +44025,56 @@

teal.slice coverage - 65.73%

253 - 131x + 131x +
      shiny::isolate({
254 - 131x + 131x +
        logger::log_trace("{ class(self)[1] }$set_filter_state initializing, dataname: { private$dataname }")
255 - 131x + 131x +
        checkmate::assert_class(state, "teal_slices")
256 - 131x + 131x +
        lapply(state, function(x) {
257 - 179x + 179x +
          checkmate::assert_true(
258 - 179x + 179x +
            x$dataname == private$dataname,
259 - 179x + 179x +
            .var.name = "dataname matches private$dataname"
@@ -42635,21 +44102,24 @@

teal.slice coverage - 65.73%

263 - 131x + 131x +
        private$set_filterable_varnames(
264 - 131x + 131x +
          include_varnames = attr(state, "include_varnames")[[private$dataname]],
265 - 131x + 131x +
          exclude_varnames = attr(state, "exclude_varnames")[[private$dataname]]
@@ -42670,21 +44140,24 @@

teal.slice coverage - 65.73%

268 - 131x + 131x +
        count_type <- attr(state, "count_type")
269 - 131x + 131x +
        if (length(count_type)) {
270 - 19x + 19x +
          private$count_type <- count_type
@@ -42712,35 +44185,40 @@

teal.slice coverage - 65.73%

274 - 131x + 131x +
        varnames <- slices_field(state, "varname")
275 - 131x + 131x +
        excluded_varnames <- setdiff(varnames, private$get_filterable_varnames())
276 - 131x + 131x +
        if (length(excluded_varnames)) {
277 - 1x + 1x +
          state <- Filter(function(x) !x$varname %in% excluded_varnames, state)
278 - 1x + 1x +
          logger::log_warn("filters for columns: { toString(excluded_varnames) } excluded from { private$dataname }")
@@ -42761,35 +44239,40 @@

teal.slice coverage - 65.73%

281 - 131x + 131x +
        if (length(state) > 0) {
282 - 92x + 92x +
          private$set_filter_state_impl(
283 - 92x + 92x +
            state = state,
284 - 92x + 92x +
            data = private$data,
285 - 92x + 92x +
            data_reactive = private$data_reactive
@@ -42810,7 +44293,8 @@

teal.slice coverage - 65.73%

288 - 131x + 131x +
        logger::log_trace("{ class(self)[1] }$set_filter_state initialized, dataname: { private$dataname }")
@@ -42824,7 +44308,8 @@

teal.slice coverage - 65.73%

290 - 131x + 131x +
        invisible(NULL)
@@ -42894,7 +44379,8 @@

teal.slice coverage - 65.73%

300 - 25x + 25x +
      private$state_list_empty()
@@ -43160,49 +44646,56 @@

teal.slice coverage - 65.73%

338 - 12x + 12x +
      moduleServer(
339 - 12x + 12x +
        id = id,
340 - 12x + 12x +
        function(input, output, session) {
341 - 12x + 12x +
          logger::log_trace("FilterState$srv_active initializing, dataname: { private$dataname }")
342 - 12x + 12x +
          current_state <- reactive(private$state_list_get())
343 - 12x + 12x +
          previous_state <- reactiveVal(NULL) # FilterState list
344 - 12x + 12x +
          added_states <- reactiveVal(NULL) # FilterState list
@@ -43223,21 +44716,24 @@

teal.slice coverage - 65.73%

347 - 12x + 12x +
          fs_to_shiny_ns <- function(x) {
348 - 24x + 24x +
            checkmate::assert_multi_class(x, c("FilterState", "FilterStateExpr"))
349 - 24x + 24x +
            gsub("[^[:alnum:]]+", "_", get_default_slice_id(x$get_state()))
@@ -43258,28 +44754,32 @@

teal.slice coverage - 65.73%

352 - 12x + 12x +
          output$trigger_visible_state_change <- renderUI({
353 - 14x + 14x +
            current_state()
354 - 14x + 14x +
            isolate({
355 - 14x + 14x +
              logger::log_trace("FilterStates$srv_active@1 determining added and removed filter states")
@@ -43293,21 +44793,24 @@

teal.slice coverage - 65.73%

357 - 14x + 14x +
              added_states(setdiff_teal_slices(current_state(), previous_state()))
358 - 14x + 14x +
              previous_state(current_state())
359 - 14x + 14x +
              NULL
@@ -43335,42 +44838,48 @@

teal.slice coverage - 65.73%

363 - 12x + 12x +
          output[["cards"]] <- shiny::renderUI({
364 - 14x + 14x +
            lapply(
365 - 14x + 14x +
              current_state(), # observes only if added/removed
366 - 14x + 14x +
              function(state) {
367 - 12x + 12x +
                shiny::isolate( # isolates when existing state changes
368 - 12x + 12x +
                  state$ui(id = session$ns(fs_to_shiny_ns(state)), parent_id = session$ns("cards"))
@@ -43412,21 +44921,24 @@

teal.slice coverage - 65.73%

374 - 12x + 12x +
          observeEvent(
375 - 12x + 12x +
            added_states(), # we want to call FilterState module only once when it's added
376 - 12x + 12x +
            ignoreNULL = TRUE,
@@ -43440,56 +44952,64 @@

teal.slice coverage - 65.73%

378 - 10x + 10x +
              added_state_names <- vapply(added_states(), function(x) x$get_state()$id, character(1L))
379 - 10x + 10x +
              logger::log_trace("FilterStates$srv_active@2 triggered by added states: { toString(added_state_names) }")
380 - 10x + 10x +
              lapply(added_states(), function(state) {
381 - 12x + 12x +
                fs_callback <- state$server(id = fs_to_shiny_ns(state))
382 - 12x + 12x +
                observeEvent(
383 - 12x + 12x +
                  eventExpr = fs_callback(), # when remove button is clicked in the FilterState ui
384 - 12x + 12x +
                  once = TRUE, # remove button can be called once, should be destroyed afterwards
385 - 12x + 12x +
                  handlerExpr = private$state_list_remove(state$get_state()$id)
@@ -43510,7 +45030,8 @@

teal.slice coverage - 65.73%

388 - 10x + 10x +
              added_states(NULL)
@@ -43538,7 +45059,8 @@

teal.slice coverage - 65.73%

392 - 12x + 12x +
          NULL
@@ -43636,14 +45158,16 @@

teal.slice coverage - 65.73%

406 - 1x + 1x +
      checkmate::assert_string(id)
407 - 1x + 1x +
      data <- private$data
@@ -43657,7 +45181,8 @@

teal.slice coverage - 65.73%

409 - 1x + 1x +
      ns <- NS(id)
@@ -43671,14 +45196,16 @@

teal.slice coverage - 65.73%

411 - 1x + 1x +
      if (ncol(data) == 0) {
412 - 1x + 1x +
        div("no sample variables available")
@@ -43818,28 +45345,32 @@

teal.slice coverage - 65.73%

432 - 8x + 8x +
      moduleServer(
433 - 8x + 8x +
        id = id,
434 - 8x + 8x +
        function(input, output, session) {
435 - 8x + 8x +
          logger::log_trace("FilterStates$srv_add initializing, dataname: { private$dataname }")
@@ -43860,42 +45391,48 @@

teal.slice coverage - 65.73%

438 - 8x + 8x +
          avail_column_choices <- reactive({
439 - 9x + 9x +
            data <- private$data
440 - 9x + 9x +
            vars_include <- private$get_filterable_varnames()
441 - 9x + 9x +
            active_filter_vars <- slices_field(self$get_filter_state(), "varname")
442 - 9x + 9x +
            choices <- setdiff(vars_include, active_filter_vars)
443 - 9x + 9x +
            varlabels <- get_varlabels(data)
@@ -43909,35 +45446,40 @@

teal.slice coverage - 65.73%

445 - 9x + 9x +
            data_choices_labeled(
446 - 9x + 9x +
              data = data,
447 - 9x + 9x +
              choices = choices,
448 - 9x + 9x +
              varlabels = varlabels,
449 - 9x + 9x +
              keys = private$keys
@@ -43972,21 +45514,24 @@

teal.slice coverage - 65.73%

454 - 8x + 8x +
          output$add_filter <- renderUI({
455 - 6x + 6x +
            logger::log_trace(
456 - 6x + 6x +
              "FilterStates$srv_add@1 updating available column choices, dataname: { private$dataname }"
@@ -44000,7 +45545,8 @@

teal.slice coverage - 65.73%

458 - 6x + 6x +
            if (length(avail_column_choices()) == 0) {
@@ -44021,56 +45567,64 @@

teal.slice coverage - 65.73%

461 - 6x + 6x +
              div(
462 - 6x + 6x +
                teal.widgets::optionalSelectInput(
463 - 6x + 6x +
                  session$ns("var_to_add"),
464 - 6x + 6x +
                  choices = avail_column_choices(),
465 - 6x + 6x +
                  selected = NULL,
466 - 6x + 6x +
                  options = shinyWidgets::pickerOptions(
467 - 6x + 6x +
                    liveSearch = TRUE,
468 - 6x + 6x +
                    noneSelectedText = "Select variable to filter"
@@ -44119,56 +45673,64 @@

teal.slice coverage - 65.73%

475 - 8x + 8x +
          observeEvent(
476 - 8x + 8x +
            eventExpr = input$var_to_add,
477 - 8x + 8x +
            handlerExpr = {
478 - 3x + 3x +
              logger::log_trace(
479 - 3x + 3x +
                sprintf(
480 - 3x + 3x +
                  "FilterStates$srv_add@2 adding FilterState of variable %s, dataname: %s",
481 - 3x + 3x +
                  input$var_to_add,
482 - 3x + 3x +
                  private$dataname
@@ -44189,21 +45751,24 @@

teal.slice coverage - 65.73%

485 - 3x + 3x +
              self$set_filter_state(
486 - 3x + 3x +
                teal_slices(
487 - 3x + 3x +
                  teal_slice(dataname = private$dataname, varname = input$var_to_add)
@@ -44224,35 +45789,40 @@

teal.slice coverage - 65.73%

490 - 3x + 3x +
              logger::log_trace(
491 - 3x + 3x +
                sprintf(
492 - 3x + 3x +
                  "FilterStates$srv_add@2 added FilterState of variable %s, dataname: %s",
493 - 3x + 3x +
                  input$var_to_add,
494 - 3x + 3x +
                  private$dataname
@@ -44294,14 +45864,16 @@

teal.slice coverage - 65.73%

500 - 8x + 8x +
          logger::log_trace("FilterStates$srv_add initialized, dataname: { private$dataname }")
501 - 8x + 8x +
          NULL
@@ -44560,14 +46132,16 @@

teal.slice coverage - 65.73%

538 - 300x + 300x +
      if ((length(include_varnames) + length(exclude_varnames)) == 0L) {
539 - 110x + 110x +
        return(invisible(NULL))
@@ -44581,21 +46155,24 @@

teal.slice coverage - 65.73%

541 - 190x + 190x +
      checkmate::assert_character(include_varnames, any.missing = FALSE, min.len = 0L, null.ok = TRUE)
542 - 190x + 190x +
      checkmate::assert_character(exclude_varnames, any.missing = FALSE, min.len = 0L, null.ok = TRUE)
543 - 190x + 190x +
      if (length(include_varnames) && length(exclude_varnames)) {
@@ -44644,28 +46221,32 @@

teal.slice coverage - 65.73%

550 - 190x + 190x +
      supported_vars <- get_supported_filter_varnames(private$data)
551 - 190x + 190x +
      if (length(include_varnames)) {
552 - 181x + 181x +
        private$include_varnames <- intersect(include_varnames, supported_vars)
553 - 181x + 181x +
        private$exclude_varnames <- character(0)
@@ -44679,14 +46260,16 @@

teal.slice coverage - 65.73%

555 - 9x + 9x +
        private$exclude_varnames <- exclude_varnames
556 - 9x + 9x +
        private$include_varnames <- character(0)
@@ -44700,7 +46283,8 @@

teal.slice coverage - 65.73%

558 - 190x + 190x +
      invisible(NULL)
@@ -44777,14 +46361,16 @@

teal.slice coverage - 65.73%

569 - 140x + 140x +
      if (length(private$include_varnames)) {
570 - 98x + 98x +
        private$include_varnames
@@ -44798,14 +46384,16 @@

teal.slice coverage - 65.73%

572 - 42x + 42x +
        supported_varnames <- get_supported_filter_varnames(private$data)
573 - 42x + 42x +
        setdiff(supported_varnames, private$exclude_varnames)
@@ -44910,7 +46498,8 @@

teal.slice coverage - 65.73%

588 - 207x + 207x +
      checkmate::assert_string(state_id, null.ok = TRUE)
@@ -44924,14 +46513,16 @@

teal.slice coverage - 65.73%

590 - 207x + 207x +
      if (is.null(state_id)) {
591 - 207x + 207x +
        private$state_list()
@@ -45057,49 +46648,56 @@

teal.slice coverage - 65.73%

609 - 189x + 189x +
      logger::log_trace("{ class(self)[1] } pushing into state_list, dataname: { private$dataname }")
610 - 189x + 189x +
      checkmate::assert_string(state_id)
611 - 189x + 189x +
      checkmate::assert_multi_class(x, c("FilterState", "FilterStateExpr"))
612 - 189x + 189x +
      state <- stats::setNames(list(x), state_id)
613 - 189x + 189x +
      new_state_list <- c(
614 - 189x + 189x +
        shiny::isolate(private$state_list()),
615 - 189x + 189x +
        state
@@ -45113,7 +46711,8 @@

teal.slice coverage - 65.73%

617 - 189x + 189x +
      shiny::isolate(private$state_list(new_state_list))
@@ -45127,14 +46726,16 @@

teal.slice coverage - 65.73%

619 - 189x + 189x +
      logger::log_trace("{ class(self)[1] } pushed into queue, dataname: { private$dataname }")
620 - 189x + 189x +
      invisible(NULL)
@@ -45239,84 +46840,96 @@

teal.slice coverage - 65.73%

635 - 32x + 32x +
      shiny::isolate({
636 - 32x + 32x +
        logger::log_trace("{ class(self)[1] } removing a filter, state_id: { state_id }")
637 - 32x + 32x +
        checkmate::assert_character(state_id)
638 - 32x + 32x +
        new_state_list <- private$state_list()
639 - 32x + 32x +
        current_state_ids <- vapply(private$state_list(), function(x) x$get_state()$id, character(1))
640 - 32x + 32x +
        to_remove <- state_id %in% current_state_ids
641 - 32x + 32x +
        if (any(to_remove)) {
642 - 31x + 31x +
          new_state_list <- Filter(
643 - 31x + 31x +
            function(state) {
644 - 68x + 68x +
              if (state$get_state()$id %in% state_id && !state$get_state()$locked) {
645 - 47x + 47x +
                state$destroy_observers()
646 - 47x + 47x +
                FALSE
@@ -45330,7 +46943,8 @@

teal.slice coverage - 65.73%

648 - 21x + 21x +
                TRUE
@@ -45351,7 +46965,8 @@

teal.slice coverage - 65.73%

651 - 31x + 31x +
            private$state_list()
@@ -45365,7 +46980,8 @@

teal.slice coverage - 65.73%

653 - 31x + 31x +
          private$state_list(new_state_list)
@@ -45379,7 +46995,8 @@

teal.slice coverage - 65.73%

655 - 1x + 1x +
          warning(sprintf("\"%s\" not found in state list", state_id))
@@ -45393,7 +47010,8 @@

teal.slice coverage - 65.73%

657 - 32x + 32x +
        invisible(NULL)
@@ -45463,21 +47081,24 @@

teal.slice coverage - 65.73%

667 - 25x + 25x +
      shiny::isolate({
668 - 25x + 25x +
        logger::log_trace(
669 - 25x + 25x +
          "{ class(self)[1] }$state_list_empty removing all non-locked filters for dataname: { private$dataname }"
@@ -45498,28 +47119,32 @@

teal.slice coverage - 65.73%

672 - 25x + 25x +
        state_list <- private$state_list()
673 - 25x + 25x +
        if (length(state_list)) {
674 - 15x + 15x +
          state_list_ids <- vapply(state_list, function(x) x$get_state()$id, character(1))
675 - 15x + 15x +
          private$state_list_remove(state_list_ids)
@@ -45533,7 +47158,8 @@

teal.slice coverage - 65.73%

677 - 25x + 25x +
        invisible(NULL)
@@ -45666,35 +47292,40 @@

teal.slice coverage - 65.73%

696 - 226x + 226x +
      checkmate::assert_class(state, "teal_slices")
697 - 226x + 226x +
      checkmate::assert_multi_class(data, c("data.frame", "matrix", "DataFrame", "HermesData"))
698 - 226x + 226x +
      checkmate::assert_function(data_reactive, args = "sid")
699 - 226x + 226x +
      if (length(state) == 0L) {
700 - 115x + 115x +
        return(invisible(NULL))
@@ -45715,14 +47346,16 @@

teal.slice coverage - 65.73%

703 - 111x + 111x +
      slices_hashed <- vapply(state, `[[`, character(1L), "id")
704 - 111x + 111x +
      if (any(duplicated(slices_hashed))) {
@@ -45771,28 +47404,32 @@

teal.slice coverage - 65.73%

711 - 111x + 111x +
      state_list <- shiny::isolate(private$state_list_get())
712 - 111x + 111x +
      lapply(state, function(slice) {
713 - 197x + 197x +
        state_id <- slice$id
714 - 197x + 197x +
        if (state_id %in% names(state_list)) {
@@ -45806,7 +47443,8 @@

teal.slice coverage - 65.73%

716 - 8x + 8x +
          state_list[[state_id]]$set_state(slice)
@@ -45820,7 +47458,8 @@

teal.slice coverage - 65.73%

718 - 189x + 189x +
          if (inherits(slice, "teal_slice_expr")) {
@@ -45834,14 +47473,16 @@

teal.slice coverage - 65.73%

720 - 2x + 2x +
            fstate <- init_filter_state_expr(slice)
721 - 2x + 2x +
            private$state_list_push(x = fstate, state_id = state_id)
@@ -45862,14 +47503,16 @@

teal.slice coverage - 65.73%

724 - 187x + 187x +
            fstate <- init_filter_state(
725 - 187x + 187x +
              x = data[, slice$varname, drop = TRUE],
@@ -45918,14 +47561,16 @@

teal.slice coverage - 65.73%

732 - 187x + 187x +
              x_reactive = if (private$count_type == "none") {
733 - 181x + 181x +
                reactive(NULL)
@@ -45939,7 +47584,8 @@

teal.slice coverage - 65.73%

735 - 6x + 6x +
                reactive(data_reactive(state_id)[, slice$varname, drop = TRUE])
@@ -45953,14 +47599,16 @@

teal.slice coverage - 65.73%

737 - 187x + 187x +
              slice = slice,
738 - 187x + 187x +
              extract_type = private$extract_type
@@ -45974,7 +47622,8 @@

teal.slice coverage - 65.73%

740 - 187x + 187x +
            private$state_list_push(x = fstate, state_id = state_id)
@@ -46009,7 +47658,8 @@

teal.slice coverage - 65.73%

745 - 111x + 111x +
      invisible(NULL)
@@ -46512,21 +48162,24 @@

teal.slice coverage - 65.73%

68 - 11x + 11x +
      checkmate::assert_class(slice, "teal_slice_expr")
69 - 10x + 10x +
      private$teal_slice <- slice
70 - 10x + 10x +
      invisible(self)
@@ -46610,28 +48263,32 @@

teal.slice coverage - 65.73%

82 - 12x + 12x +
      sprintf(
83 - 12x + 12x +
        "%s:\n%s",
84 - 12x + 12x +
        class(self)[1],
85 - 12x + 12x +
        format(self$get_state(), show_all = show_all, trim_lines = trim_lines)
@@ -46694,7 +48351,8 @@

teal.slice coverage - 65.73%

94 - 1x + 1x +
      cat(shiny::isolate(self$format(...)))
@@ -46757,7 +48415,8 @@

teal.slice coverage - 65.73%

103 - 18x + 18x +
      private$teal_slice
@@ -46834,14 +48493,16 @@

teal.slice coverage - 65.73%

114 - 1x + 1x +
      checkmate::assert_class(state, "teal_slice_expr")
115 - 1x + 1x +
      invisible(NULL)
@@ -46939,7 +48600,8 @@

teal.slice coverage - 65.73%

129 - 2x + 2x +
      shiny::isolate(str2lang(private$teal_slice$expr))
@@ -48632,21 +50294,24 @@

teal.slice coverage - 65.73%

136 - 24x + 24x +
      shiny::isolate({
137 - 24x + 24x +
        checkmate::assert_date(x)
138 - 23x + 23x +
        checkmate::assert_class(x_reactive, "reactive")
@@ -48660,35 +50325,40 @@

teal.slice coverage - 65.73%

140 - 23x + 23x +
        super$initialize(
141 - 23x + 23x +
          x = x,
142 - 23x + 23x +
          x_reactive = x_reactive,
143 - 23x + 23x +
          slice = slice,
144 - 23x + 23x +
          extract_type = extract_type
@@ -48702,28 +50372,32 @@

teal.slice coverage - 65.73%

146 - 23x + 23x +
        checkmate::assert_date(slice$choices, null.ok = TRUE)
147 - 22x + 22x +
        private$set_choices(slice$choices)
148 - 14x + 14x +
        if (is.null(slice$selected)) slice$selected <- slice$choices
149 - 22x + 22x +
        private$set_selected(slice$selected)
@@ -48744,7 +50418,8 @@

teal.slice coverage - 65.73%

152 - 21x + 21x +
      invisible(self)
@@ -48828,14 +50503,16 @@

teal.slice coverage - 65.73%

164 - 7x + 7x +
      if (isFALSE(private$is_any_filtered())) {
165 - 1x + 1x +
        return(NULL)
@@ -48849,21 +50526,24 @@

teal.slice coverage - 65.73%

167 - 6x + 6x +
      choices <- as.character(private$get_selected())
168 - 6x + 6x +
      filter_call <-
169 - 6x + 6x +
        call(
@@ -48877,14 +50557,16 @@

teal.slice coverage - 65.73%

171 - 6x + 6x +
          call(">=", private$get_varname_prefixed(dataname), call("as.Date", choices[1L])),
172 - 6x + 6x +
          call("<=", private$get_varname_prefixed(dataname), call("as.Date", choices[2L]))
@@ -48898,7 +50580,8 @@

teal.slice coverage - 65.73%

174 - 6x + 6x +
      private$add_keep_na_call(filter_call)
@@ -48954,14 +50637,16 @@

teal.slice coverage - 65.73%

182 - 22x + 22x +
      if (is.null(choices)) {
183 - 19x + 19x +
        choices <- range(private$x, na.rm = TRUE)
@@ -48975,35 +50660,40 @@

teal.slice coverage - 65.73%

185 - 3x + 3x +
        choices_adjusted <- c(max(choices[1L], min(private$x)), min(choices[2L], max(private$x)))
186 - 3x + 3x +
        if (any(choices != choices_adjusted)) {
187 - 1x + 1x +
          warning(sprintf(
188 - 1x + 1x +
            "Choices adjusted (some values outside of variable range). Varname: %s, dataname: %s.",
189 - 1x + 1x +
            private$get_varname(), private$get_dataname()
@@ -49017,7 +50707,8 @@

teal.slice coverage - 65.73%

191 - 1x + 1x +
          choices <- choices_adjusted
@@ -49031,35 +50722,40 @@

teal.slice coverage - 65.73%

193 - 3x + 3x +
        if (choices[1L] >= choices[2L]) {
194 - 1x + 1x +
          warning(sprintf(
195 - 1x + 1x +
            "Invalid choices: lower is higher / equal to upper, or not in range of variable values.
196 - 1x + 1x +
            Setting defaults. Varname: %s, dataname: %s.",
197 - 1x + 1x +
            private$get_varname(), private$get_dataname()
@@ -49073,7 +50769,8 @@

teal.slice coverage - 65.73%

199 - 1x + 1x +
          choices <- range(private$x, na.rm = TRUE)
@@ -49094,28 +50791,32 @@

teal.slice coverage - 65.73%

202 - 22x + 22x +
      private$set_is_choice_limited(private$x, choices)
203 - 22x + 22x +
      private$x <- private$x[(private$x >= choices[1L] & private$x <= choices[2L]) | is.na(private$x)]
204 - 22x + 22x +
      private$teal_slice$choices <- choices
205 - 22x + 22x +
      invisible(NULL)
@@ -49157,14 +50858,16 @@

teal.slice coverage - 65.73%

211 - 22x + 22x +
      private$is_choice_limited <- (any(xl < choices[1L], na.rm = TRUE) | any(xl > choices[2L], na.rm = TRUE))
212 - 22x + 22x +
      invisible(NULL)
@@ -49185,7 +50888,8 @@

teal.slice coverage - 65.73%

215 - 29x + 29x +
      if (!is(value, "Date")) {
@@ -49248,28 +50952,32 @@

teal.slice coverage - 65.73%

224 - 29x + 29x +
      pre_msg <- sprintf(
225 - 29x + 29x +
        "dataset '%s', variable '%s': ",
226 - 29x + 29x +
        private$get_dataname(),
227 - 29x + 29x +
        private$get_varname()
@@ -49283,7 +50991,8 @@

teal.slice coverage - 65.73%

229 - 29x + 29x +
      check_in_range(value, private$get_choices(), pre_msg = pre_msg)
@@ -49304,21 +51013,24 @@

teal.slice coverage - 65.73%

232 - 33x + 33x +
      tryCatch(
233 - 33x + 33x +
        expr = {
234 - 33x + 33x +
          values <- as.Date(values, origin = "1970-01-01")
@@ -49339,7 +51051,8 @@

teal.slice coverage - 65.73%

237 - 33x + 33x +
        error = function(error) stop("The array of set values must contain values coercible to Date.")
@@ -49353,14 +51066,16 @@

teal.slice coverage - 65.73%

239 - 1x + 1x +
      if (length(values) != 2) stop("The array of set values must have length two.")
240 - 29x + 29x +
      values
@@ -49381,42 +51096,48 @@

teal.slice coverage - 65.73%

243 - 29x + 29x +
      choices <- private$get_choices()
244 - 29x + 29x +
      if (values[1] < choices[1L] | values[1] > choices[2L]) {
245 - 5x + 5x +
        warning(
246 - 5x + 5x +
          sprintf(
247 - 5x + 5x +
            "Value: %s is outside of the possible range for column %s of dataset %s, setting minimum possible value.",
248 - 5x + 5x +
            values[1], private$get_varname(), private$get_dataname()
@@ -49437,7 +51158,8 @@

teal.slice coverage - 65.73%

251 - 5x + 5x +
        values[1] <- choices[1L]
@@ -49458,35 +51180,40 @@

teal.slice coverage - 65.73%

254 - 29x + 29x +
      if (values[2] > choices[2L] | values[2] < choices[1L]) {
255 - 5x + 5x +
        warning(
256 - 5x + 5x +
          sprintf(
257 - 5x + 5x +
            "Value: %s is outside of the possible range for column %s of dataset %s, setting maximum possible value.",
258 - 5x + 5x +
            values[2], private$get_varname(), private$get_dataname()
@@ -49507,7 +51234,8 @@

teal.slice coverage - 65.73%

261 - 5x + 5x +
        values[2] <- choices[2L]
@@ -49528,35 +51256,40 @@

teal.slice coverage - 65.73%

264 - 29x + 29x +
      if (values[1] > values[2]) {
265 - 1x + 1x +
        warning(
266 - 1x + 1x +
          sprintf(
267 - 1x + 1x +
            "Start date %s is set after the end date %s, the values will be replaced with a default date range.",
268 - 1x + 1x +
            values[1], values[2]
@@ -49577,7 +51310,8 @@

teal.slice coverage - 65.73%

271 - 1x + 1x +
        values <- c(choices[1L], choices[2L])
@@ -49591,7 +51325,8 @@

teal.slice coverage - 65.73%

273 - 29x + 29x +
      values
@@ -51200,14 +52935,16 @@

teal.slice coverage - 65.73%

53 - 115x + 115x +
      checkmate::assert_data_frame(dataset)
54 - 113x + 113x +
      super$initialize(dataset, dataname, keys, label, metadata)
@@ -51228,21 +52965,24 @@

teal.slice coverage - 65.73%

57 - 111x + 111x +
      if (!is.null(parent)) {
58 - 7x + 7x +
        checkmate::assert_character(parent_name, len = 1)
59 - 7x + 7x +
        checkmate::assert_character(join_keys, min.len = 1)
@@ -51256,14 +52996,16 @@

teal.slice coverage - 65.73%

61 - 7x + 7x +
        private$parent_name <- parent_name
62 - 7x + 7x +
        private$join_keys <- join_keys
@@ -51277,28 +53019,32 @@

teal.slice coverage - 65.73%

64 - 7x + 7x +
        private$data_filtered_fun <- function(sid = "") {
65 - 5x + 5x +
          checkmate::assert_character(sid)
66 - 5x + 5x +
          if (length(sid)) {
67 - 5x + 5x +
            logger::log_trace("filtering data dataname: { dataname }, sid: { sid }")
@@ -51326,42 +53072,48 @@

teal.slice coverage - 65.73%

71 - 5x + 5x +
          env <- new.env(parent = parent.env(globalenv()))
72 - 5x + 5x +
          env[[dataname]] <- private$dataset
73 - 5x + 5x +
          env[[parent_name]] <- parent()
74 - 5x + 5x +
          filter_call <- self$get_call(sid)
75 - 5x + 5x +
          eval_expr_with_msg(filter_call, env)
76 - 5x + 5x +
          get(x = dataname, envir = env)
@@ -51389,42 +53141,48 @@

teal.slice coverage - 65.73%

80 - 111x + 111x +
      private$add_filter_states(
81 - 111x + 111x +
        filter_states = init_filter_states(
82 - 111x + 111x +
          data = dataset,
83 - 111x + 111x +
          data_reactive = private$data_filtered_fun,
84 - 111x + 111x +
          dataname = dataname,
85 - 111x + 111x +
          keys = self$get_keys()
@@ -51438,7 +53196,8 @@

teal.slice coverage - 65.73%

87 - 111x + 111x +
        id = "filter"
@@ -51466,35 +53225,40 @@

teal.slice coverage - 65.73%

91 - 111x + 111x +
      if (!is.null(parent)) {
92 - 7x + 7x +
        fs <- teal_slices(
93 - 7x + 7x +
          exclude_varnames = structure(
94 - 7x + 7x +
            list(intersect(colnames(dataset), colnames(isolate(parent())))),
95 - 7x + 7x +
            names = private$dataname
@@ -51515,7 +53279,8 @@

teal.slice coverage - 65.73%

98 - 7x + 7x +
        self$set_filter_state(fs)
@@ -51536,7 +53301,8 @@

teal.slice coverage - 65.73%

101 - 111x + 111x +
      invisible(self)
@@ -51669,28 +53435,32 @@

teal.slice coverage - 65.73%

120 - 36x + 36x +
      logger::log_trace("FilteredDatasetDefault$get_call initializing for dataname: { private$dataname }")
121 - 36x + 36x +
      filter_call <- super$get_call(sid)
122 - 36x + 36x +
      dataname <- private$dataname
123 - 36x + 36x +
      parent_dataname <- private$parent_name
@@ -51704,28 +53474,32 @@

teal.slice coverage - 65.73%

125 - 36x + 36x +
      if (!identical(parent_dataname, character(0))) {
126 - 6x + 6x +
        join_keys <- private$join_keys
127 - 6x + 6x +
        parent_keys <- names(join_keys)
128 - 6x + 6x +
        dataset_keys <- unname(join_keys)
@@ -51739,7 +53513,8 @@

teal.slice coverage - 65.73%

130 - 6x + 6x +
        y_arg <- if (length(parent_keys) == 0L) {
@@ -51760,28 +53535,32 @@

teal.slice coverage - 65.73%

133 - 6x + 6x +
          sprintf(
134 - 6x + 6x +
            "%s[, c(%s), drop = FALSE]",
135 - 6x + 6x +
            parent_dataname,
136 - 6x + 6x +
            toString(dQuote(parent_keys, q = FALSE))
@@ -51809,7 +53588,8 @@

teal.slice coverage - 65.73%

140 - 6x + 6x +
        more_args <- if (length(parent_keys) == 0 || length(dataset_keys) == 0) {
@@ -51823,14 +53603,16 @@

teal.slice coverage - 65.73%

142 - 6x + 6x +
        } else if (identical(parent_keys, dataset_keys)) {
143 - 6x + 6x +
          list(by = parent_keys)
@@ -51865,7 +53647,8 @@

teal.slice coverage - 65.73%

148 - 6x + 6x +
        merge_call <- call(
@@ -51879,49 +53662,56 @@

teal.slice coverage - 65.73%

150 - 6x + 6x +
          as.name(dataname),
151 - 6x + 6x +
          as.call(
152 - 6x + 6x +
            c(
153 - 6x + 6x +
              str2lang("dplyr::inner_join"),
154 - 6x + 6x +
              x = as.name(dataname),
155 - 6x + 6x +
              y = str2lang(y_arg),
156 - 6x + 6x +
              more_args
@@ -51956,7 +53746,8 @@

teal.slice coverage - 65.73%

161 - 6x + 6x +
        filter_call <- c(filter_call, merge_call)
@@ -51970,14 +53761,16 @@

teal.slice coverage - 65.73%

163 - 36x + 36x +
      logger::log_trace("FilteredDatasetDefault$get_call initializing for dataname: { private$dataname }")
164 - 36x + 36x +
      filter_call
@@ -52117,35 +53910,40 @@

teal.slice coverage - 65.73%

184 - 75x + 75x +
      shiny::isolate({
185 - 75x + 75x +
        logger::log_trace("{ class(self)[1] }$set_filter_state initializing, dataname: { private$dataname }")
186 - 75x + 75x +
        checkmate::assert_class(state, "teal_slices")
187 - 74x + 74x +
        lapply(state, function(slice) {
188 - 100x + 100x +
          checkmate::assert_true(slice$dataname == private$dataname)
@@ -52159,14 +53957,16 @@

teal.slice coverage - 65.73%

190 - 74x + 74x +
        private$get_filter_states()[[1L]]$set_filter_state(state = state)
191 - 74x + 74x +
        invisible(NULL)
@@ -52264,21 +54064,24 @@

teal.slice coverage - 65.73%

205 - 11x + 11x +
      shiny::isolate({
206 - 11x + 11x +
        logger::log_trace("{ class(self)[1] }$remove_filter_state removing filter(s), dataname: { private$dataname }")
207 - 11x + 11x +
        checkmate::assert_class(state, "teal_slices")
@@ -52292,14 +54095,16 @@

teal.slice coverage - 65.73%

209 - 11x + 11x +
        varnames <- slices_field(state, "varname")
210 - 11x + 11x +
        private$get_filter_states()[[1]]$remove_filter_state(state)
@@ -52313,7 +54118,8 @@

teal.slice coverage - 65.73%

212 - 11x + 11x +
        logger::log_trace("{ class(self)[1] }$remove_filter_state removed filter(s), dataname: { private$dataname }")
@@ -52327,7 +54133,8 @@

teal.slice coverage - 65.73%

214 - 11x + 11x +
        invisible(NULL)
@@ -52509,7 +54316,8 @@

teal.slice coverage - 65.73%

240 - 12x + 12x +
      logger::log_trace("FilteredDataset$srv_filter_overview initialized")
@@ -52530,14 +54338,16 @@

teal.slice coverage - 65.73%

243 - 12x + 12x +
      subject_keys <- if (length(private$parent_name) > 0) {
244 - 1x + 1x +
        private$join_keys
@@ -52551,7 +54361,8 @@

teal.slice coverage - 65.73%

246 - 11x + 11x +
        self$get_keys()
@@ -52572,49 +54383,56 @@

teal.slice coverage - 65.73%

249 - 12x + 12x +
      dataset <- self$get_dataset()
250 - 12x + 12x +
      data_filtered <- self$get_dataset(TRUE)
251 - 12x + 12x +
      if (length(subject_keys) == 0) {
252 - 10x + 10x +
        data.frame(
253 - 10x + 10x +
          dataname = private$dataname,
254 - 10x + 10x +
          obs = nrow(dataset),
255 - 10x + 10x +
          obs_filtered = nrow(data_filtered())
@@ -52635,42 +54453,48 @@

teal.slice coverage - 65.73%

258 - 2x + 2x +
        data.frame(
259 - 2x + 2x +
          dataname = private$dataname,
260 - 2x + 2x +
          obs = nrow(dataset),
261 - 2x + 2x +
          obs_filtered = nrow(data_filtered()),
262 - 2x + 2x +
          subjects = nrow(unique(dataset[subject_keys])),
263 - 2x + 2x +
          subjects_filtered = nrow(unique(data_filtered()[subject_keys]))
@@ -53082,14 +54906,16 @@

teal.slice coverage - 65.73%

49 - 8x + 8x +
      checkmate::assert_class(datasets, "FilteredData")
50 - 6x + 6x +
      private$filtered_data <- datasets
@@ -53173,7 +54999,8 @@

teal.slice coverage - 65.73%

62 - 8x + 8x +
      private$filtered_data$get_filter_state()
@@ -53243,14 +55070,16 @@

teal.slice coverage - 65.73%

72 - 5x + 5x +
      private$filtered_data$set_filter_state(filter)
73 - 5x + 5x +
      invisible(NULL)
@@ -53341,14 +55170,16 @@

teal.slice coverage - 65.73%

86 - 1x + 1x +
      private$filtered_data$remove_filter_state(filter)
87 - 1x + 1x +
      invisible(NULL)
@@ -53432,21 +55263,24 @@

teal.slice coverage - 65.73%

99 - 2x + 2x +
      datanames_to_remove <- if (missing(datanames)) private$filtered_data$datanames() else datanames
100 - 2x + 2x +
      private$filtered_data$clear_filter_states(datanames = datanames_to_remove)
101 - 2x + 2x +
      invisible(NULL)
@@ -54117,49 +55951,56 @@

teal.slice coverage - 65.73%

88 - 753x + 753x +
  slices <- list(...)
89 - 753x + 753x +
  checkmate::assert_list(slices, types = "teal_slice", any.missing = FALSE)
90 - 752x + 752x +
  slices_id <- shiny::isolate(vapply(slices, `[[`, character(1L), "id"))
91 - 752x + 752x +
  if (any(duplicated(slices_id))) {
92 - 1x + 1x +
    stop(
93 - 1x + 1x +
      "Some teal_slice objects have the same id:\n",
94 - 1x + 1x +
      toString(unique(slices_id[duplicated(slices_id)]))
@@ -54180,35 +56021,40 @@

teal.slice coverage - 65.73%

97 - 751x + 751x +
  checkmate::assert_list(exclude_varnames, names = "named", types = "character", null.ok = TRUE, min.len = 1)
98 - 750x + 750x +
  checkmate::assert_list(include_varnames, names = "named", types = "character", null.ok = TRUE, min.len = 1)
99 - 749x + 749x +
  checkmate::assert_character(count_type, len = 1, null.ok = TRUE)
100 - 747x + 747x +
  checkmate::assert_subset(count_type, choices = c("all", "none"), empty.ok = TRUE)
101 - 746x + 746x +
  checkmate::assert_logical(module_add)
@@ -54222,49 +56068,56 @@

teal.slice coverage - 65.73%

103 - 745x + 745x +
  structure(
104 - 745x + 745x +
    slices,
105 - 745x + 745x +
    exclude_varnames = exclude_varnames,
106 - 745x + 745x +
    include_varnames = include_varnames,
107 - 745x + 745x +
    count_type = count_type,
108 - 745x + 745x +
    module_add = module_add,
109 - 745x + 745x +
    class = c("teal_slices", class(slices))
@@ -54341,7 +56194,8 @@

teal.slice coverage - 65.73%

120 - 511x + 511x +
  inherits(x, "teal_slices")
@@ -54397,35 +56251,40 @@

teal.slice coverage - 65.73%

128 - 1x + 1x +
  checkmate::assert_list(x, names = "named")
129 - 1x + 1x +
  is_bottom <- function(x) {
130 - 10x + 10x +
    isTRUE(is.list(x) && any(names(x) %in% c("selected", "keep_na", "keep_inf"))) ||
131 - 10x + 10x +
      identical(x, list()) ||
132 - 10x + 10x +
      is.atomic(x)
@@ -54439,28 +56298,32 @@

teal.slice coverage - 65.73%

134 - 1x + 1x +
  make_args <- function(object, dataname, varname, experiment = NULL, arg = NULL) {
135 - 7x + 7x +
    args <- list(
136 - 7x + 7x +
      dataname = dataname,
137 - 7x + 7x +
      varname = varname
@@ -54474,42 +56337,48 @@

teal.slice coverage - 65.73%

139 - 1x + 1x +
    if (!is.null(experiment)) args$experiment <- experiment
140 - 1x + 1x +
    if (!is.null(arg)) args$arg <- arg
141 - 7x + 7x +
    if (is.list(object)) {
142 - 6x + 6x +
      args <- c(args, object)
143 - 1x + 1x +
    } else if (is.atomic(object)) {
144 - 1x + 1x +
      args$selected <- object
@@ -54523,7 +56392,8 @@

teal.slice coverage - 65.73%

146 - 7x + 7x +
    args
@@ -54537,7 +56407,8 @@

teal.slice coverage - 65.73%

148 - 1x + 1x +
  slices <- vector("list")
@@ -54551,63 +56422,72 @@

teal.slice coverage - 65.73%

150 - 1x + 1x +
  for (dataname in names(x)) {
151 - 2x + 2x +
    item <- x[[dataname]]
152 - 2x + 2x +
    for (name_i in names(item)) {
153 - 5x + 5x +
      subitem <- item[[name_i]]
154 - 5x + 5x +
      if (is_bottom(subitem)) {
155 - 3x + 3x +
        args <- make_args(
156 - 3x + 3x +
          subitem,
157 - 3x + 3x +
          dataname = dataname,
158 - 3x + 3x +
          varname = name_i
@@ -54621,7 +56501,8 @@

teal.slice coverage - 65.73%

160 - 3x + 3x +
        slices <- c(slices, list(as.teal_slice(args)))
@@ -54642,56 +56523,64 @@

teal.slice coverage - 65.73%

163 - 2x + 2x +
        for (name_ii in names(subitem)) {
164 - 4x + 4x +
          subsubitem <- subitem[[name_ii]]
165 - 4x + 4x +
          if (is_bottom(subsubitem)) {
166 - 3x + 3x +
            args <- make_args(
167 - 3x + 3x +
              subsubitem,
168 - 3x + 3x +
              dataname = dataname,
169 - 3x + 3x +
              experiment = if (name_i != "subjects") name_i,
170 - 3x + 3x +
              varname = name_ii
@@ -54705,7 +56594,8 @@

teal.slice coverage - 65.73%

172 - 3x + 3x +
            slices <- c(slices, list(as.teal_slice(args)))
@@ -54719,63 +56609,72 @@

teal.slice coverage - 65.73%

174 - 1x + 1x +
            for (name_iii in names(subsubitem)) {
175 - 1x + 1x +
              subsubsubitem <- subsubitem[[name_iii]]
176 - 1x + 1x +
              if (is_bottom(subsubsubitem)) {
177 - 1x + 1x +
                args <- make_args(
178 - 1x + 1x +
                  subsubsubitem,
179 - 1x + 1x +
                  dataname = dataname,
180 - 1x + 1x +
                  experiment = name_i,
181 - 1x + 1x +
                  arg = name_ii,
182 - 1x + 1x +
                  varname = name_iii
@@ -54789,7 +56688,8 @@

teal.slice coverage - 65.73%

184 - 1x + 1x +
                slices <- c(slices, list(as.teal_slice(args)))
@@ -54852,7 +56752,8 @@

teal.slice coverage - 65.73%

193 - 1x + 1x +
  if (length(slices) == 0L && length(x) != 0L) {
@@ -54880,7 +56781,8 @@

teal.slice coverage - 65.73%

197 - 1x + 1x +
  do.call(teal_slices, c(slices, list(include_varnames = attr(x, "filterable"))))
@@ -54943,21 +56845,24 @@

teal.slice coverage - 65.73%

206 - 3x + 3x +
  if (missing(i)) i <- seq_along(x)
207 - 547x + 547x +
  if (length(i) == 0L) {
208 - 197x + 197x +
    return(x[0])
@@ -54971,35 +56876,40 @@

teal.slice coverage - 65.73%

210 - 1x + 1x +
  if (is.logical(i) && length(i) > length(x)) stop("subscript out of bounds")
211 - 1x + 1x +
  if (is.numeric(i) && max(i) > length(x)) stop("subscript out of bounds")
212 - 348x + 348x +
  if (is.character(i)) {
213 - 1x + 1x +
    if (!all(is.element(i, names(x)))) stop("subscript out of bounds")
214 - 2x + 2x +
    i <- which(is.element(i, names(x)))
@@ -55020,35 +56930,40 @@

teal.slice coverage - 65.73%

217 - 347x + 347x +
  y <- NextMethod("[")
218 - 347x + 347x +
  attrs <- attributes(x)
219 - 347x + 347x +
  attrs$names <- attrs$names[i]
220 - 347x + 347x +
  attributes(y) <- attrs
221 - 347x + 347x +
  y
@@ -55111,14 +57026,16 @@

teal.slice coverage - 65.73%

230 - 248x + 248x +
  x <- list(...)
231 - 248x + 248x +
  checkmate::assert_true(all(vapply(x, is.teal_slices, logical(1L))), .var.name = "all arguments are teal_slices")
@@ -55132,28 +57049,32 @@

teal.slice coverage - 65.73%

233 - 247x + 247x +
  excludes <- lapply(x, attr, "exclude_varnames")
234 - 247x + 247x +
  names(excludes) <- NULL
235 - 247x + 247x +
  excludes <- unlist(excludes, recursive = FALSE)
236 - 247x + 247x +
  excludes <- excludes[!duplicated(names(excludes))]
@@ -55167,28 +57088,32 @@

teal.slice coverage - 65.73%

238 - 247x + 247x +
  includes <- lapply(x, attr, "include_varnames")
239 - 247x + 247x +
  names(includes) <- NULL
240 - 247x + 247x +
  includes <- unlist(includes, recursive = FALSE)
241 - 247x + 247x +
  includes <- includes[!duplicated(names(includes))]
@@ -55202,14 +57127,16 @@

teal.slice coverage - 65.73%

243 - 247x + 247x +
  count_types <- lapply(x, attr, "count_type")
244 - 247x + 247x +
  count_types <- unique(unlist(count_types))
@@ -55223,56 +57150,64 @@

teal.slice coverage - 65.73%

246 - 247x + 247x +
  do.call(
247 - 247x + 247x +
    teal_slices,
248 - 247x + 247x +
    c(
249 - 247x + 247x +
      unique(unlist(x, recursive = FALSE)),
250 - 247x + 247x +
      list(
251 - 247x + 247x +
        include_varnames = if (length(includes)) includes,
252 - 247x + 247x +
        exclude_varnames = if (length(excludes)) excludes,
253 - 247x + 247x +
        count_type = count_types
@@ -55370,14 +57305,16 @@

teal.slice coverage - 65.73%

267 - 49x + 49x +
  checkmate::assert_flag(show_all)
268 - 49x + 49x +
  checkmate::assert_flag(trim_lines)
@@ -55391,7 +57328,8 @@

teal.slice coverage - 65.73%

270 - 49x + 49x +
  slices_list <- slices_to_list(x)
@@ -55405,7 +57343,8 @@

teal.slice coverage - 65.73%

272 - 22x + 22x +
  if (!show_all) slices_list$slices <- lapply(slices_list$slices, function(slice) Filter(Negate(is.null), slice))
@@ -55419,7 +57358,8 @@

teal.slice coverage - 65.73%

274 - 49x + 49x +
  jsonify(slices_list, trim_lines)
@@ -55475,7 +57415,8 @@

teal.slice coverage - 65.73%

282 - 5x + 5x +
  cat(format(x, ...), "\n")
@@ -55545,21 +57486,24 @@

teal.slice coverage - 65.73%

292 - 192x + 192x +
  checkmate::assert_string(field)
293 - 191x + 191x +
  checkmate::assert_class(tss, "teal_slices")
294 - 191x + 191x +
  unique(unlist(lapply(tss, function(x) x[[field]])))
@@ -55629,28 +57573,32 @@

teal.slice coverage - 65.73%

304 - 49x + 49x +
  slices_list <- lapply(tss, as.list)
305 - 49x + 49x +
  attrs <- attributes(unclass(tss))
306 - 49x + 49x +
  tss_list <- list(slices = slices_list, attributes = attrs)
307 - 49x + 49x +
  Filter(Negate(is.null), tss_list) # drop attributes if empty
@@ -55727,21 +57675,24 @@

teal.slice coverage - 65.73%

318 - 14x + 14x +
  Filter(
319 - 14x + 14x +
    function(xx) {
320 - 12x + 12x +
      !any(vapply(y, function(yy) identical(yy, xx), logical(1)))
@@ -55755,7 +57706,8 @@

teal.slice coverage - 65.73%

322 - 14x + 14x +
    x
@@ -56188,42 +58140,48 @@

teal.slice coverage - 65.73%

59 - 25x + 25x +
  checkmate::assert_string(inputId)
60 - 21x + 21x +
  checkmate::assert_vector(choices)
61 - 20x + 20x +
  checkmate::assert_numeric(countsmax, len = length(choices))
62 - 17x + 17x +
  checkmate::assert_numeric(countsnow, len = length(choices), null.ok = TRUE)
63 - 15x + 15x +
  if (!is.null(countsnow)) {
64 - 7x + 7x +
    checkmate::assert_true(all(countsnow <= countsmax))
@@ -56244,14 +58202,16 @@

teal.slice coverage - 65.73%

67 - 14x + 14x +
  ns <- NS(inputId)
68 - 14x + 14x +
  counttotal <- sum(countsmax)
@@ -56265,56 +58225,64 @@

teal.slice coverage - 65.73%

70 - 14x + 14x +
  mapply(
71 - 14x + 14x +
    countBar,
72 - 14x + 14x +
    inputId = ns(seq_along(choices)),
73 - 14x + 14x +
    label = as.character(choices),
74 - 14x + 14x +
    countmax = countsmax,
75 - 14x + 14x +
    countnow = if (is.null(countsnow)) rep(list(NULL), length(choices)) else countsnow,
76 - 14x + 14x +
    MoreArgs = list(
77 - 14x + 14x +
      counttotal = sum(countsmax)
@@ -56328,7 +58296,8 @@

teal.slice coverage - 65.73%

79 - 14x + 14x +
    SIMPLIFY = FALSE, USE.NAMES = FALSE
@@ -56454,35 +58423,40 @@

teal.slice coverage - 65.73%

97 - 62x + 62x +
  checkmate::assert_string(inputId)
98 - 58x + 58x +
  checkmate::assert_string(label)
99 - 55x + 55x +
  checkmate::assert_number(countmax)
100 - 53x + 53x +
  checkmate::assert_number(countnow, null.ok = TRUE, upper = countmax)
101 - 51x + 51x +
  checkmate::assert_number(counttotal, lower = countmax)
@@ -56496,35 +58470,40 @@

teal.slice coverage - 65.73%

103 - 49x + 49x +
  label <- make_count_text(label, countmax = countmax, countnow = countnow)
104 - 49x + 49x +
  ns <- NS(inputId)
105 - 26x + 26x +
  if (is.null(countnow)) countnow <- 0
106 - 49x + 49x +
  tags$div(
107 - 49x + 49x +
    class = "progress state-count-container",
@@ -56538,42 +58517,48 @@

teal.slice coverage - 65.73%

109 - 49x + 49x +
    tags$div(
110 - 49x + 49x +
      id = ns("count_bar_filtered"),
111 - 49x + 49x +
      class = "progress-bar state-count-bar-filtered",
112 - 49x + 49x +
      style = sprintf("width: %s%%", countnow / counttotal * 100),
113 - 49x + 49x +
      role = "progressbar",
114 - 49x + 49x +
      label
@@ -56587,35 +58572,40 @@

teal.slice coverage - 65.73%

116 - 49x + 49x +
    tags$div(
117 - 49x + 49x +
      id = ns("count_bar_unfiltered"),
118 - 49x + 49x +
      class = "progress-bar state-count-bar-unfiltered",
119 - 49x + 49x +
      style = sprintf("width: %s%%", (countmax - countnow) / counttotal * 100),
120 - 49x + 49x +
      role = "progressbar"
@@ -56671,28 +58661,32 @@

teal.slice coverage - 65.73%

128 - 7x + 7x +
  checkmate::assert_string(inputId)
129 - 7x + 7x +
  checkmate::assert_vector(choices)
130 - 7x + 7x +
  checkmate::assert_numeric(countsmax, len = length(choices))
131 - 7x + 7x +
  checkmate::assert_numeric(countsnow, len = length(choices), null.ok = TRUE)
@@ -56706,63 +58700,72 @@

teal.slice coverage - 65.73%

133 - 7x + 7x +
  ns <- NS(inputId)
134 - 7x + 7x +
  mapply(
135 - 7x + 7x +
    updateCountBar,
136 - 7x + 7x +
    inputId = ns(seq_along(choices)),
137 - 7x + 7x +
    label = choices,
138 - 7x + 7x +
    countmax = countsmax,
139 - 7x + 7x +
    countnow = if (is.null(countsnow)) rep(list(NULL), length(choices)) else countsnow,
140 - 7x + 7x +
    MoreArgs = list(
141 - 7x + 7x +
      counttotal = sum(countsmax)
@@ -56783,7 +58786,8 @@

teal.slice coverage - 65.73%

144 - 7x + 7x +
  invisible(NULL)
@@ -56825,35 +58829,40 @@

teal.slice coverage - 65.73%

150 - 18x + 18x +
  checkmate::assert_string(inputId)
151 - 18x + 18x +
  checkmate::assert_string(label)
152 - 18x + 18x +
  checkmate::assert_number(countmax)
153 - 18x + 18x +
  checkmate::assert_number(countnow, null.ok = TRUE)
154 - 18x + 18x +
  checkmate::assert_number(counttotal)
@@ -56867,70 +58876,80 @@

teal.slice coverage - 65.73%

156 - 18x + 18x +
  label <- make_count_text(label, countmax = countmax, countnow = countnow)
157 - 18x + 18x +
  if (is.null(countnow)) countnow <- countmax
158 - 18x + 18x +
  session$sendCustomMessage(
159 - 18x + 18x +
    type = "updateCountBar",
160 - 18x + 18x +
    message = list(
161 - 18x + 18x +
      id = session$ns(inputId),
162 - 18x + 18x +
      label = label,
163 - 18x + 18x +
      countmax = countmax,
164 - 18x + 18x +
      countnow = countnow,
165 - 18x + 18x +
      counttotal = counttotal
@@ -56958,7 +58977,8 @@

teal.slice coverage - 65.73%

169 - 18x + 18x +
  invisible(NULL)
@@ -56993,70 +59013,80 @@

teal.slice coverage - 65.73%

174 - 17x + 17x +
  checkmate::assert_string(inputId)
175 - 17x + 17x +
  checkmate::assert_string(label)
176 - 17x + 17x +
  checkmate::assert_number(countmax)
177 - 17x + 17x +
  checkmate::assert_number(countnow, null.ok = TRUE)
178 - 17x + 17x +
  label <- make_count_text(label, countmax = countmax, countnow = countnow)
179 - 17x + 17x +
  session$sendCustomMessage(
180 - 17x + 17x +
    type = "updateCountText",
181 - 17x + 17x +
    message = list(
182 - 17x + 17x +
      id = session$ns(inputId),
183 - 17x + 17x +
      label = label
@@ -57168,56 +59198,64 @@

teal.slice coverage - 65.73%

199 - 96x + 96x +
  checkmate::assert_string(label)
200 - 94x + 94x +
  checkmate::assert_number(countmax)
201 - 92x + 92x +
  checkmate::assert_number(countnow, null.ok = TRUE)
202 - 90x + 90x +
  sprintf(
203 - 90x + 90x +
    "%s (%s%s)",
204 - 90x + 90x +
    label,
205 - 90x + 90x +
    if (is.null(countnow)) "" else sprintf("%s/", countnow),
206 - 90x + 90x +
    countmax
@@ -58119,21 +60157,24 @@

teal.slice coverage - 65.73%

126 - 555x + 555x +
  checkmate::assert_string(dataname)
127 - 548x + 548x +
  checkmate::assert_flag(fixed)
128 - 546x + 546x +
  checkmate::assert_flag(locked)
@@ -58147,14 +60188,16 @@

teal.slice coverage - 65.73%

130 - 544x + 544x +
  formal_args <- as.list(environment())
131 - 544x + 544x +
  if (!missing(expr) && !missing(varname)) {
@@ -58168,98 +60211,112 @@

teal.slice coverage - 65.73%

133 - 544x + 544x +
  } else if (!missing(expr)) {
134 - 26x + 26x +
    fixed <- TRUE
135 - 26x + 26x +
    ts_expr_args <- c("dataname", "id", "expr", "fixed", "locked", "title")
136 - 26x + 26x +
    formal_args <- formal_args[ts_expr_args]
137 - 26x + 26x +
    checkmate::assert_string(id)
138 - 23x + 23x +
    checkmate::assert_string(title)
139 - 20x + 20x +
    checkmate::assert_string(expr)
140 - 19x + 19x +
    ans <- do.call(shiny::reactiveValues, c(formal_args, list(...)))
141 - 19x + 19x +
    class(ans) <- c("teal_slice_expr", "teal_slice", class(ans))
142 - 19x + 19x +
    ans
143 - 518x + 518x +
  } else if (!missing(varname)) {
144 - 517x + 517x +
    ts_var_args <- c(
145 - 517x + 517x +
      "dataname", "varname", "id", "choices", "selected", "keep_na", "keep_inf",
146 - 517x + 517x +
      "fixed", "locked", "multiple"
@@ -58273,70 +60330,80 @@

teal.slice coverage - 65.73%

148 - 517x + 517x +
    formal_args <- formal_args[ts_var_args]
149 - 517x + 517x +
    args <- c(formal_args, list(...))
150 - 517x + 517x +
    checkmate::assert_string(varname)
151 - 514x + 514x +
    checkmate::assert_multi_class(choices, .filterable_class, null.ok = TRUE)
152 - 513x + 513x +
    checkmate::assert_multi_class(selected, .filterable_class, null.ok = TRUE)
153 - 511x + 511x +
    checkmate::assert_flag(keep_na, null.ok = TRUE)
154 - 510x + 510x +
    checkmate::assert_flag(keep_inf, null.ok = TRUE)
155 - 509x + 509x +
    checkmate::assert_flag(multiple)
156 - 509x + 509x +
    if (missing(id)) {
157 - 500x + 500x +
      args$id <- get_default_slice_id(args)
@@ -58350,7 +60417,8 @@

teal.slice coverage - 65.73%

159 - 9x + 9x +
      checkmate::assert_string(id)
@@ -58364,21 +60432,24 @@

teal.slice coverage - 65.73%

161 - 506x + 506x +
    ans <- do.call(shiny::reactiveValues, args)
162 - 506x + 506x +
    class(ans) <- c("teal_slice_var", "teal_slice", class(ans))
163 - 506x + 506x +
    ans
@@ -58392,7 +60463,8 @@

teal.slice coverage - 65.73%

165 - 1x + 1x +
    stop("Must provide either `expr` or `varname`.")
@@ -58455,7 +60527,8 @@

teal.slice coverage - 65.73%

174 - 4x + 4x +
  inherits(x, "teal_slice")
@@ -58511,14 +60584,16 @@

teal.slice coverage - 65.73%

182 - 7x + 7x +
  checkmate::assert_list(x, names = "named")
183 - 7x + 7x +
  do.call(teal_slice, x)
@@ -58574,7 +60649,8 @@

teal.slice coverage - 65.73%

191 - 303x + 303x +
  formal_args <- setdiff(names(formals(teal_slice)), "...")
@@ -58588,7 +60664,8 @@

teal.slice coverage - 65.73%

193 - 303x + 303x +
  x <- if (shiny::isRunning()) {
@@ -58609,7 +60686,8 @@

teal.slice coverage - 65.73%

196 - 303x + 303x +
    shiny::isolate(shiny::reactiveValuesToList(x))
@@ -58630,14 +60708,16 @@

teal.slice coverage - 65.73%

199 - 303x + 303x +
  formal_args <- intersect(formal_args, names(x))
200 - 303x + 303x +
  extra_args <- rev(setdiff(names(x), formal_args))
@@ -58651,7 +60731,8 @@

teal.slice coverage - 65.73%

202 - 303x + 303x +
  x[c(formal_args, extra_args)]
@@ -58714,14 +60795,16 @@

teal.slice coverage - 65.73%

211 - 116x + 116x +
  checkmate::assert_flag(show_all)
212 - 92x + 92x +
  checkmate::assert_flag(trim_lines)
@@ -58735,14 +60818,16 @@

teal.slice coverage - 65.73%

214 - 86x + 86x +
  x_list <- as.list(x)
215 - 47x + 47x +
  if (!show_all) x_list <- Filter(Negate(is.null), x_list)
@@ -58756,7 +60841,8 @@

teal.slice coverage - 65.73%

217 - 86x + 86x +
  jsonify(x_list, trim_lines)
@@ -58812,7 +60898,8 @@

teal.slice coverage - 65.73%

225 - 15x + 15x +
  cat(format(x, ...))
@@ -58938,7 +61025,8 @@

teal.slice coverage - 65.73%

243 - 135x + 135x +
  checkmate::assert_list(x)
@@ -58952,28 +61040,32 @@

teal.slice coverage - 65.73%

245 - 135x + 135x +
  x_json <- to_json(x)
246 - 135x + 135x +
  x_json_justified <- justify_json(x_json)
247 - 123x + 123x +
  if (trim_lines) x_json_justified <- trim_lines_json(x_json_justified)
248 - 135x + 135x +
  paste(x_json_justified, collapse = "\n")
@@ -59085,35 +61177,40 @@

teal.slice coverage - 65.73%

264 - 135x + 135x +
  no_unbox <- function(x) {
265 - 2578x + 2578x +
    vars <- c("selected", "choices")
266 - 2578x + 2578x +
    if (is.list(x)) {
267 - 419x + 419x +
      for (var in vars) {
268 - 335x + 335x +
        if (!is.null(x[[var]])) x[[var]] <- I(x[[var]])
@@ -59127,7 +61224,8 @@

teal.slice coverage - 65.73%

270 - 419x + 419x +
      lapply(x, no_unbox)
@@ -59141,7 +61239,8 @@

teal.slice coverage - 65.73%

272 - 2159x + 2159x +
      x
@@ -59169,7 +61268,8 @@

teal.slice coverage - 65.73%

276 - 135x + 135x +
  jsonlite::toJSON(no_unbox(x), pretty = TRUE, auto_unbox = TRUE, digits = 16, null = "null")
@@ -59260,35 +61360,40 @@

teal.slice coverage - 65.73%

289 - 135x + 135x +
  format_name <- function(name, name_width) {
290 - 2997x + 2997x +
    if (nchar(name) == 1 || nchar(gsub("\\s", "", name)) <= 2) {
291 - 680x + 680x +
      return(name)
292 - 2317x + 2317x +
    } else if (grepl("slices|attributes", name)) {
293 - 98x + 98x +
      paste0(name, ":")
@@ -59302,7 +61407,8 @@

teal.slice coverage - 65.73%

295 - 2219x + 2219x +
      paste(format(name, width = name_width), ":")
@@ -59323,28 +61429,32 @@

teal.slice coverage - 65.73%

298 - 135x + 135x +
  json_lines <- strsplit(json, "\n")[[1]]
299 - 135x + 135x +
  json_lines_split <- regmatches(json_lines, regexpr(":", json_lines), invert = TRUE)
300 - 135x + 135x +
  name_width <- max(unlist(regexpr(":", json_lines))) - 1
301 - 135x + 135x +
  vapply(json_lines_split, function(x) paste0(format_name(x[1], name_width), stats::na.omit(x[2])), character(1))
@@ -59449,35 +61559,40 @@

teal.slice coverage - 65.73%

316 - 123x + 123x +
  name_width <- max(unlist(gregexpr(":", x))) - 1
317 - 123x + 123x +
  trim_position <- name_width + 17L
318 - 123x + 123x +
  x_trim <- substr(x, 1, trim_position)
319 - 123x + 123x +
  substr(x_trim, trim_position - 2, trim_position) <- "..."
320 - 123x + 123x +
  x_trim
@@ -59603,35 +61718,40 @@

teal.slice coverage - 65.73%

338 - 589x + 589x +
  shiny::isolate({
339 - 589x + 589x +
    paste(
340 - 589x + 589x +
      Filter(
341 - 589x + 589x +
        length,
342 - 589x + 589x +
        as.list(x)[c("dataname", "varname", "experiment", "arg")]
@@ -59645,7 +61765,8 @@

teal.slice coverage - 65.73%

344 - 589x + 589x +
      collapse = " "
@@ -59903,7 +62024,8 @@

teal.slice coverage - 65.73%

33 - 9x + 9x +
  UseMethod("variable_types")
@@ -59938,7 +62060,8 @@

teal.slice coverage - 65.73%

38 - 9x + 9x +
  checkmate::assert_character(columns, null.ok = TRUE, any.missing = FALSE)
@@ -59952,7 +62075,8 @@

teal.slice coverage - 65.73%

40 - 9x + 9x +
  res <- if (is.null(columns)) {
@@ -60001,49 +62125,56 @@

teal.slice coverage - 65.73%

47 - 9x + 9x +
  } else if (checkmate::test_character(columns, any.missing = FALSE)) {
48 - 9x + 9x +
    stopifnot(all(columns %in% names(data) | vapply(columns, identical, logical(1L), "")))
49 - 9x + 9x +
    vapply(
50 - 9x + 9x +
      columns,
51 - 9x + 9x +
      function(x) ifelse(x == "", "", class(data[[x]])[[1]]),
52 - 9x + 9x +
      character(1),
53 - 9x + 9x +
      USE.NAMES = FALSE
@@ -60085,7 +62216,8 @@

teal.slice coverage - 65.73%

59 - 9x + 9x +
  return(res)
@@ -60120,7 +62252,8 @@

teal.slice coverage - 65.73%

64 - 9x + 9x +
  variable_types.default(data, columns)
@@ -60819,7 +62952,8 @@

teal.slice coverage - 65.73%

58 - 253x + 253x +
  UseMethod("init_filter_states")
@@ -60896,42 +63030,48 @@

teal.slice coverage - 65.73%

69 - 112x + 112x +
  DFFilterStates$new(
70 - 112x + 112x +
    data = data,
71 - 112x + 112x +
    data_reactive = data_reactive,
72 - 112x + 112x +
    dataname = dataname,
73 - 112x + 112x +
    datalabel = datalabel,
74 - 112x + 112x +
    keys = keys
@@ -61008,35 +63148,40 @@

teal.slice coverage - 65.73%

85 - 24x + 24x +
  MatrixFilterStates$new(
86 - 24x + 24x +
    data = data,
87 - 24x + 24x +
    data_reactive = data_reactive,
88 - 24x + 24x +
    dataname = dataname,
89 - 24x + 24x +
    datalabel = datalabel
@@ -61120,7 +63265,8 @@

teal.slice coverage - 65.73%

101 - 24x + 24x +
  if (!requireNamespace("MultiAssayExperiment", quietly = TRUE)) {
@@ -61141,42 +63287,48 @@

teal.slice coverage - 65.73%

104 - 24x + 24x +
  MAEFilterStates$new(
105 - 24x + 24x +
    data = data,
106 - 24x + 24x +
    data_reactive = data_reactive,
107 - 24x + 24x +
    dataname = dataname,
108 - 24x + 24x +
    datalabel = datalabel,
109 - 24x + 24x +
    keys = keys
@@ -61253,7 +63405,8 @@

teal.slice coverage - 65.73%

120 - 93x + 93x +
  if (!requireNamespace("SummarizedExperiment", quietly = TRUE)) {
@@ -61274,35 +63427,40 @@

teal.slice coverage - 65.73%

123 - 93x + 93x +
  SEFilterStates$new(
124 - 93x + 93x +
    data = data,
125 - 93x + 93x +
    data_reactive = data_reactive,
126 - 93x + 93x +
    dataname = dataname,
127 - 93x + 93x +
    datalabel = datalabel
@@ -61463,7 +63621,8 @@

teal.slice coverage - 65.73%

150 - 237x + 237x +
  UseMethod("get_supported_filter_varnames")
@@ -61505,28 +63664,32 @@

teal.slice coverage - 65.73%

156 - 202x + 202x +
  is_expected_class <- vapply(
157 - 202x + 202x +
    X = data,
158 - 202x + 202x +
    FUN = function(x) any(class(x) %in% .filterable_class),
159 - 202x + 202x +
    FUN.VALUE = logical(1)
@@ -61540,7 +63703,8 @@

teal.slice coverage - 65.73%

161 - 202x + 202x +
  names(is_expected_class[is_expected_class])
@@ -61589,21 +63753,24 @@

teal.slice coverage - 65.73%

168 - 35x + 35x +
  is_expected_class <- class(data[, 1]) %in% .filterable_class
169 - 35x + 35x +
  if (is_expected_class && !is.null(colnames(data))) {
170 - 32x + 32x +
    colnames(data)
@@ -61617,7 +63784,8 @@

teal.slice coverage - 65.73%

172 - 3x + 3x +
    character(0)
@@ -61855,7 +64023,8 @@

teal.slice coverage - 65.73%

206 - 9x + 9x +
  if (length(choices) == 0) {
@@ -61876,14 +64045,16 @@

teal.slice coverage - 65.73%

209 - 9x + 9x +
  choice_types <- stats::setNames(variable_types(data = data, columns = choices), choices)
210 - 9x + 9x +
  choice_types[keys] <- "primary_key"
@@ -61897,28 +64068,32 @@

teal.slice coverage - 65.73%

212 - 9x + 9x +
  choices_labeled(
213 - 9x + 9x +
    choices = choices,
214 - 9x + 9x +
    labels = unname(varlabels[choices]),
215 - 9x + 9x +
    types = choice_types[choices]
@@ -61953,49 +64128,56 @@

teal.slice coverage - 65.73%

220 - 9x + 9x +
  if (!is.array(data)) {
221 - 9x + 9x +
    vapply(
222 - 9x + 9x +
      colnames(data),
223 - 9x + 9x +
      FUN = function(x) {
224 - 42x + 42x +
        label <- attr(data[[x]], "label")
225 - 42x + 42x +
        if (is.null(label)) {
226 - 40x + 40x +
          x
@@ -62009,7 +64191,8 @@

teal.slice coverage - 65.73%

228 - 2x + 2x +
          label
@@ -62030,7 +64213,8 @@

teal.slice coverage - 65.73%

231 - 9x + 9x +
      FUN.VALUE = character(1)
@@ -62449,42 +64633,48 @@

teal.slice coverage - 65.73%

54 - 6x + 6x +
      shiny::isolate({
55 - 6x + 6x +
        super$initialize(
56 - 6x + 6x +
          x = x,
57 - 6x + 6x +
          x_reactive = x_reactive,
58 - 6x + 6x +
          slice = slice,
59 - 6x + 6x +
          extract_type = extract_type
@@ -62498,14 +64688,16 @@

teal.slice coverage - 65.73%

61 - 6x + 6x +
        private$set_choices(slice$choices)
62 - 6x + 6x +
        private$set_selected(slice$selected)
@@ -62526,7 +64718,8 @@

teal.slice coverage - 65.73%

65 - 6x + 6x +
      invisible(self)
@@ -62610,14 +64803,16 @@

teal.slice coverage - 65.73%

77 - 2x + 2x +
      if (isFALSE(private$is_any_filtered())) {
78 - 1x + 1x +
        return(NULL)
@@ -62631,14 +64826,16 @@

teal.slice coverage - 65.73%

80 - 1x + 1x +
      if (missing(dataname)) dataname <- private$get_dataname()
81 - 1x + 1x +
      filter_call <- if (isTRUE(private$get_keep_na())) {
@@ -62659,7 +64856,8 @@

teal.slice coverage - 65.73%

84 - 1x + 1x +
        substitute(!is.na(varname), list(varname = private$get_varname_prefixed(dataname)))
@@ -62771,14 +64969,16 @@

teal.slice coverage - 65.73%

100 - 6x + 6x +
      private$teal_slice$choices <- choices
101 - 6x + 6x +
      invisible(NULL)
@@ -62841,7 +65041,8 @@

teal.slice coverage - 65.73%

110 - 2x + 2x +
      if (private$is_choice_limited) {
@@ -62862,7 +65063,8 @@

teal.slice coverage - 65.73%

113 - 2x + 2x +
        !isTRUE(private$get_keep_na())
@@ -63498,7 +65700,8 @@

teal.slice coverage - 65.73%

24 - 16x + 16x +
  UseMethod("init_filtered_data")
@@ -63561,56 +65764,64 @@

teal.slice coverage - 65.73%

33 - 2x + 2x +
  data_objects <- lapply(
34 - 2x + 2x +
    x$get_datanames(),
35 - 2x + 2x +
    function(dataname) {
36 - 3x + 3x +
      dataset <- x$get_dataset(dataname)
37 - 3x + 3x +
      list(
38 - 3x + 3x +
        dataset = dataset$get_raw_data(),
39 - 3x + 3x +
        metadata = dataset$get_metadata(),
40 - 3x + 3x +
        label = dataset$get_dataset_label()
@@ -63638,7 +65849,8 @@

teal.slice coverage - 65.73%

44 - 2x + 2x +
  names(data_objects) <- x$get_datanames()
@@ -63652,35 +65864,40 @@

teal.slice coverage - 65.73%

46 - 2x + 2x +
  init_filtered_data(
47 - 2x + 2x +
    x = data_objects,
48 - 2x + 2x +
    join_keys = join_keys,
49 - 2x + 2x +
    code = code,
50 - 2x + 2x +
    check = check
@@ -63729,42 +65946,48 @@

teal.slice coverage - 65.73%

57 - 14x + 14x +
  checkmate::assert_list(x, any.missing = FALSE, names = "unique")
58 - 13x + 13x +
  mapply(validate_dataset_args, x, names(x))
59 - 13x + 13x +
  checkmate::assert_class(code, "CodeClass", null.ok = TRUE)
60 - 12x + 12x +
  checkmate::assert_class(join_keys, "JoinKeys")
61 - 11x + 11x +
  checkmate::assert_flag(check)
62 - 10x + 10x +
  FilteredData$new(x, join_keys = join_keys, code = code, check = check)
@@ -63862,14 +66085,16 @@

teal.slice coverage - 65.73%

76 - 118x + 118x +
  check_simple_name(dataname)
77 - 118x + 118x +
  checkmate::assert_list(dataset_args, names = "unique")
@@ -63883,7 +66108,8 @@

teal.slice coverage - 65.73%

79 - 118x + 118x +
  allowed_names <- c("dataset", "label", "metadata")
@@ -63897,28 +66123,32 @@

teal.slice coverage - 65.73%

81 - 118x + 118x +
  checkmate::assert_subset(names(dataset_args), choices = allowed_names)
82 - 118x + 118x +
  checkmate::assert_multi_class(dataset_args[["dataset"]], classes = c("data.frame", "MultiAssayExperiment"))
83 - 117x + 117x +
  teal.data::validate_metadata(dataset_args[["metadata"]])
84 - 117x + 117x +
  checkmate::assert_character(dataset_args[["label"]], null.ok = TRUE, min.len = 0, max.len = 1)
@@ -64009,42 +66239,48 @@

teal.slice coverage - 65.73%

97 - 26x + 26x +
  lapply(
98 - 26x + 26x +
    expr,
99 - 26x + 26x +
    function(x) {
100 - 15x + 15x +
      tryCatch(
101 - 15x + 15x +
        eval(x, envir = env),
102 - 15x + 15x +
        error = function(e) {
@@ -64107,7 +66343,8 @@

teal.slice coverage - 65.73%

111 - 15x + 15x +
      return(invisible(NULL))
@@ -64660,21 +66897,24 @@

teal.slice coverage - 65.73%

190 - 3x + 3x +
  checkmate::assert_string(input_id)
191 - 3x + 3x +
  checkmate::assert_character(icons, len = 2L)
192 - 3x + 3x +
  checkmate::assert_flag(one_way)
@@ -64688,35 +66928,40 @@

teal.slice coverage - 65.73%

194 - 3x + 3x +
  expr <-
195 - 3x + 3x +
    if (one_way) {
196 - 3x + 3x +
      sprintf(
197 - 3x + 3x +
        "$('#%s i').removeClass('%s').addClass('%s');",
198 - 3x + 3x +
        input_id, icons[1], icons[2]
@@ -64758,7 +67003,8 @@

teal.slice coverage - 65.73%

204 - 3x + 3x +
  shinyjs::runjs(expr)
@@ -64772,7 +67018,8 @@

teal.slice coverage - 65.73%

206 - 3x + 3x +
  invisible(NULL)
@@ -64814,21 +67061,24 @@

teal.slice coverage - 65.73%

212 - 3x + 3x +
  checkmate::assert_string(input_id)
213 - 3x + 3x +
  checkmate::assert_character(titles, len = 2L)
214 - 3x + 3x +
  checkmate::assert_flag(one_way)
@@ -64842,35 +67092,40 @@

teal.slice coverage - 65.73%

216 - 3x + 3x +
  expr <-
217 - 3x + 3x +
    if (one_way) {
218 - 3x + 3x +
      sprintf(
219 - 3x + 3x +
        "$('a#%s').attr('title', '%s');",
220 - 3x + 3x +
        input_id, titles[2]
@@ -64975,7 +67230,8 @@

teal.slice coverage - 65.73%

235 - 3x + 3x +
  shinyjs::runjs(expr)
@@ -64989,7 +67245,8 @@

teal.slice coverage - 65.73%

237 - 3x + 3x +
  invisible(NULL)
@@ -65122,35 +67379,40 @@

teal.slice coverage - 65.73%

256 - 65x + 65x +
  in_degrees <- list()
257 - 65x + 65x +
  for (node in names(graph)) {
258 - 101x + 101x +
    in_degrees[[node]] <- 0
259 - 101x + 101x +
    for (to_edge in graph[[node]]) {
260 - 9x + 9x +
      in_degrees[[to_edge]] <- 0
@@ -65178,21 +67440,24 @@

teal.slice coverage - 65.73%

264 - 65x + 65x +
  for (node in graph) {
265 - 101x + 101x +
    for (to_edge in node) {
266 - 9x + 9x +
      in_degrees[[to_edge]] <- in_degrees[[to_edge]] + 1
@@ -65227,35 +67492,40 @@

teal.slice coverage - 65.73%

271 - 65x + 65x +
  visited <- 0
272 - 65x + 65x +
  sorted <- list()
273 - 65x + 65x +
  zero_in <- list()
274 - 65x + 65x +
  for (node in names(in_degrees)) {
275 - 92x + 92x +
    if (in_degrees[[node]] == 0) zero_in <- append(zero_in, node)
@@ -65269,7 +67539,8 @@

teal.slice coverage - 65.73%

277 - 65x + 65x +
  zero_in <- rev(zero_in)
@@ -65283,49 +67554,56 @@

teal.slice coverage - 65.73%

279 - 65x + 65x +
  while (length(zero_in) != 0) {
280 - 98x + 98x +
    visited <- visited + 1
281 - 98x + 98x +
    sorted <- c(zero_in[[1]], sorted)
282 - 98x + 98x +
    for (edge_to in graph[[zero_in[[1]]]]) {
283 - 6x + 6x +
      in_degrees[[edge_to]] <- in_degrees[[edge_to]] - 1
284 - 6x + 6x +
      if (in_degrees[[edge_to]] == 0) {
285 - 6x + 6x +
        zero_in <- append(zero_in, edge_to, 1)
@@ -65346,7 +67624,8 @@

teal.slice coverage - 65.73%

288 - 98x + 98x +
    zero_in[[1]] <- NULL
@@ -65367,28 +67646,32 @@

teal.slice coverage - 65.73%

291 - 65x + 65x +
  if (visited != length(in_degrees)) {
292 - 1x + 1x +
    stop(
293 - 1x + 1x +
      "Graph is not a directed acyclic graph. Cycles involving nodes: ",
294 - 1x + 1x +
      paste0(setdiff(names(in_degrees), sorted), collapse = " ")
@@ -65409,7 +67692,8 @@

teal.slice coverage - 65.73%

297 - 64x + 64x +
    return(sorted)
@@ -65660,7 +67944,8 @@

teal.slice coverage - 65.73%

33 - 100x + 100x +
      if (!requireNamespace("SummarizedExperiment", quietly = TRUE)) {
@@ -65681,35 +67966,40 @@

teal.slice coverage - 65.73%

36 - 100x + 100x +
      checkmate::assert_function(data_reactive, args = "sid")
37 - 100x + 100x +
      checkmate::assert_class(data, "SummarizedExperiment")
38 - 99x + 99x +
      super$initialize(data, data_reactive, dataname, datalabel)
39 - 99x + 99x +
      if (!is.null(datalabel)) {
40 - 92x + 92x +
        private$dataname_prefixed <- sprintf("%s[['%s']]", dataname, datalabel)
@@ -65800,35 +68090,40 @@

teal.slice coverage - 65.73%

53 - 69x + 69x +
      shiny::isolate({
54 - 69x + 69x +
        logger::log_trace("{ class(self)[1] }$set_filter_state initializing, dataname: { private$dataname }")
55 - 69x + 69x +
        checkmate::assert_class(state, "teal_slices")
56 - 67x + 67x +
        lapply(state, function(x) {
57 - 19x + 19x +
          checkmate::assert_choice(x$arg, choices = c("subset", "select"), null.ok = TRUE, .var.name = "teal_slice$arg")
@@ -65842,21 +68137,24 @@

teal.slice coverage - 65.73%

59 - 67x + 67x +
        count_type <- attr(state, "count_type")
60 - 67x + 67x +
        if (length(count_type)) {
61 - 8x + 8x +
          private$count_type <- count_type
@@ -65877,35 +68175,40 @@

teal.slice coverage - 65.73%

64 - 67x + 67x +
        subset_states <- Filter(function(x) x$arg == "subset", state)
65 - 67x + 67x +
        private$set_filter_state_impl(
66 - 67x + 67x +
          state = subset_states,
67 - 67x + 67x +
          data = SummarizedExperiment::rowData(private$data),
68 - 67x + 67x +
          data_reactive = function(sid = "") {
@@ -65961,35 +68264,40 @@

teal.slice coverage - 65.73%

76 - 67x + 67x +
        select_states <- Filter(function(x) x$arg == "select", state)
77 - 67x + 67x +
        private$set_filter_state_impl(
78 - 67x + 67x +
          state = select_states,
79 - 67x + 67x +
          data = SummarizedExperiment::colData(private$data),
80 - 67x + 67x +
          data_reactive = function(sid = "") {
@@ -66045,14 +68353,16 @@

teal.slice coverage - 65.73%

88 - 67x + 67x +
        logger::log_trace("{ class(self)[1] }$set_filter_state initialized, dataname: { private$dataname }")
89 - 67x + 67x +
        invisible(NULL)
@@ -66122,49 +68432,56 @@

teal.slice coverage - 65.73%

99 - 2x + 2x +
      data <- private$data
100 - 2x + 2x +
      checkmate::assert_string(id)
101 - 2x + 2x +
      ns <- NS(id)
102 - 2x + 2x +
      row_input <- if (ncol(SummarizedExperiment::rowData(data)) == 0) {
103 - 1x + 1x +
        div("no sample variables available")
104 - 2x + 2x +
      } else if (nrow(SummarizedExperiment::rowData(data)) == 0) {
105 - 1x + 1x +
        div("no samples available")
@@ -66248,28 +68565,32 @@

teal.slice coverage - 65.73%

117 - 2x + 2x +
      col_input <- if (ncol(SummarizedExperiment::colData(data)) == 0) {
118 - 1x + 1x +
        div("no sample variables available")
119 - 2x + 2x +
      } else if (nrow(SummarizedExperiment::colData(data)) == 0) {
120 - 1x + 1x +
        div("no samples available")
@@ -66353,21 +68674,24 @@

teal.slice coverage - 65.73%

132 - 2x + 2x +
      div(
133 - 2x + 2x +
        row_input,
134 - 2x + 2x +
        col_input
@@ -67724,49 +70048,56 @@

teal.slice coverage - 65.73%

24 - 18x + 18x +
  if (!missing(...)) {
25 - 16x + 16x +
    checkmate::assert_flag(stop)
26 - 16x + 16x +
    checkmate::assert_character(allowed_args, min.len = 0, null.ok = TRUE, any.missing = FALSE)
27 - 16x + 16x +
    args <- list(...)
28 - 16x + 16x +
    arg_names <- names(args)
29 - 16x + 16x +
    if (is.null(arg_names)) {
30 - 4x + 4x +
      arg_names <- rep("", length(args))
@@ -67780,21 +70111,24 @@

teal.slice coverage - 65.73%

32 - 16x + 16x +
    extra_args <- arg_names[!is.element(arg_names, allowed_args)]
33 - 16x + 16x +
    if (length(extra_args) == 0) {
34 - 4x + 4x +
      return(invisible(NULL))
@@ -67808,7 +70142,8 @@

teal.slice coverage - 65.73%

36 - 12x + 12x +
    message <- paste(length(extra_args), "total unused argument(s).")
@@ -67822,28 +70157,32 @@

teal.slice coverage - 65.73%

38 - 12x + 12x +
    named_extra_args <- extra_args[!vapply(extra_args, identical, logical(1), "")]
39 - 12x + 12x +
    if (length(named_extra_args) > 0) {
40 - 9x + 9x +
      message <- paste0(
41 - 9x + 9x +
        message,
@@ -67857,21 +70196,24 @@

teal.slice coverage - 65.73%

43 - 9x + 9x +
        length(named_extra_args),
44 - 9x + 9x +
        " with name(s): ",
45 - 9x + 9x +
        paste(named_extra_args, collapse = ", "),
@@ -67899,14 +70241,16 @@

teal.slice coverage - 65.73%

49 - 12x + 12x +
    if (stop) {
50 - 8x + 8x +
      stop(message)
@@ -67920,7 +70264,8 @@

teal.slice coverage - 65.73%

52 - 4x + 4x +
      warning(message)
@@ -68137,49 +70482,56 @@

teal.slice coverage - 65.73%

83 - 380x + 380x +
  checkmate::assert_character(name, min.len = 1, any.missing = FALSE)
84 - 378x + 378x +
  if (!grepl("^[[:alpha:]][a-zA-Z0-9_]*$", name, perl = TRUE)) {
85 - 5x + 5x +
    stop(
86 - 5x + 5x +
      "name '",
87 - 5x + 5x +
      name,
88 - 5x + 5x +
      "' must only contain alphanumeric characters (with underscores)",
89 - 5x + 5x +
      " and the first character must be an alphabetic character"
@@ -68235,28 +70587,32 @@

teal.slice coverage - 65.73%

97 - 2x + 2x +
  bs_theme <- getOption("teal.bs_theme")
98 - 2x + 2x +
  if (is.null(bs_theme)) {
99 - 1x + 1x +
    NULL
100 - 1x + 1x +
  } else if (!inherits(bs_theme, "bs_theme")) {
@@ -68284,7 +70640,8 @@

teal.slice coverage - 65.73%

104 - 1x + 1x +
    bs_theme
@@ -68396,35 +70753,40 @@

teal.slice coverage - 65.73%

120 - 12x + 12x +
  checkmate::assert_character(pattern, min.len = 1, null.ok = TRUE)
121 - 12x + 12x +
  js_files <- list.files(
122 - 12x + 12x +
    system.file("js", package = "teal.slice", mustWork = TRUE),
123 - 12x + 12x +
    pattern = pattern,
124 - 12x + 12x +
    full.names = TRUE
@@ -68438,7 +70800,8 @@

teal.slice coverage - 65.73%

126 - 12x + 12x +
  return(singleton(lapply(js_files, includeScript)))
@@ -68564,14 +70927,16 @@

teal.slice coverage - 65.73%

144 - 37x + 37x +
  if (length(choices) > 1) {
145 - 16x + 16x +
    do.call("call", append(list("c"), choices))
@@ -68585,7 +70950,8 @@

teal.slice coverage - 65.73%

147 - 21x + 21x +
    choices
@@ -68640,14 +71006,16 @@

teal.slice coverage - 65.73%

5 - 9x + 9x +
  shiny::isolate(
6 - 9x + 9x +
    all(vapply(fields, function(x) identical(ts1[[x]], ts2[[x]]), logical(1L)))
@@ -68696,35 +71064,40 @@

teal.slice coverage - 65.73%

13 - 33x + 33x +
  shiny::isolate({
14 - 33x + 33x +
    testthat::expect_true(
15 - 33x + 33x +
      setequal(
16 - 33x + 33x +
        reactiveValuesToList(x),
17 - 33x + 33x +
        reactiveValuesToList(y)
@@ -68780,28 +71153,32 @@

teal.slice coverage - 65.73%

25 - 10x + 10x +
  shiny::isolate({
26 - 10x + 10x +
    mapply(
27 - 10x + 10x +
      function(x, y) {
28 - 26x + 26x +
        expect_identical_slice(x, y)
@@ -68815,14 +71192,16 @@

teal.slice coverage - 65.73%

30 - 10x + 10x +
      x = x,
31 - 10x + 10x +
      y = y
@@ -68836,7 +71215,8 @@

teal.slice coverage - 65.73%

33 - 10x + 10x +
    testthat::expect_identical(attributes(x), attributes(y))
@@ -70304,35 +72684,40 @@

teal.slice coverage - 65.73%

156 - 115x + 115x +
      checkmate::assert_function(data_reactive, args = "sid")
157 - 115x + 115x +
      checkmate::assert_data_frame(data)
158 - 115x + 115x +
      super$initialize(data, data_reactive, dataname, datalabel)
159 - 115x + 115x +
      private$keys <- keys
160 - 115x + 115x +
      private$set_filterable_varnames(include_varnames = colnames(private$data))
@@ -70625,21 +73010,24 @@

teal.slice coverage - 65.73%

33 - 28x + 28x +
      checkmate::assert_matrix(data)
34 - 27x + 27x +
      super$initialize(data, data_reactive, dataname, datalabel)
35 - 27x + 27x +
      private$set_filterable_varnames(include_varnames = colnames(private$data))
@@ -70855,21 +73243,24 @@

teal.slice coverage - 65.73%

24 - 46x + 46x +
  checkmate::assert_list(calls)
25 - 44x + 44x +
  if (length(calls) > 0L) checkmate::assert_list(calls, types = c("call", "name"))
26 - 45x + 45x +
  checkmate::assert_string(operator)
@@ -70883,7 +73274,8 @@

teal.slice coverage - 65.73%

28 - 43x + 43x +
  calls <- Filter(x = calls, f = Negate(is.null))
@@ -70897,21 +73289,24 @@

teal.slice coverage - 65.73%

30 - 43x + 43x +
  Reduce(
31 - 43x + 43x +
    x = calls,
32 - 43x + 43x +
    f = function(x, y) call(operator, x, y)
@@ -71197,7 +73592,8 @@

teal.slice coverage - 65.73%

38 - 28x + 28x +
      if (!requireNamespace("MultiAssayExperiment", quietly = TRUE)) {
@@ -71218,56 +73614,64 @@

teal.slice coverage - 65.73%

41 - 28x + 28x +
      checkmate::assert_function(data_reactive, args = "sid")
42 - 28x + 28x +
      checkmate::assert_class(data, "MultiAssayExperiment")
43 - 27x + 27x +
      data <- SummarizedExperiment::colData(data)
44 - 27x + 27x +
      data_reactive <- function(sid = "") SummarizedExperiment::colData(data_reactive(sid = sid))
45 - 27x + 27x +
      super$initialize(data, data_reactive, dataname, datalabel)
46 - 27x + 27x +
      private$keys <- keys
47 - 27x + 27x +
      private$set_filterable_varnames(include_varnames = colnames(data))
48 - 27x + 27x +
      return(invisible(self))
diff --git a/latest-tag/404.html b/latest-tag/404.html index d78b51333..465f0b5da 100644 --- a/latest-tag/404.html +++ b/latest-tag/404.html @@ -1,5 +1,4 @@ - - + @@ -50,22 +49,7 @@ - - + - + + diff --git a/latest-tag/CODE_OF_CONDUCT.html b/latest-tag/CODE_OF_CONDUCT.html index ce1ca96bd..5676a050f 100644 --- a/latest-tag/CODE_OF_CONDUCT.html +++ b/latest-tag/CODE_OF_CONDUCT.html @@ -1,8 +1,22 @@ - -Contributor Covenant Code of Conduct • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -80,65 +100,80 @@
-

Our Pledge

+

Our Pledge +

We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.

-

Our Standards

+

Our Standards +

Examples of behavior that contributes to a positive environment for our community include:

-
  • Demonstrating empathy and kindness toward other people
  • +
      +
    • Demonstrating empathy and kindness toward other people
    • Being respectful of differing opinions, viewpoints, and experiences
    • Giving and gracefully accepting constructive feedback
    • Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
    • Focusing on what is best not just for us as individuals, but for the overall community
    • -

    Examples of unacceptable behavior include:

    -
    • The use of sexualized language or imagery, and sexual attention or advances of any kind
    • +
    +

    Examples of unacceptable behavior include:

    +
      +
    • The use of sexualized language or imagery, and sexual attention or advances of any kind
    • Trolling, insulting or derogatory comments, and personal or political attacks
    • Public or private harassment
    • Publishing others’ private information, such as a physical or email address, without their explicit permission
    • Other conduct which could reasonably be considered inappropriate in a professional setting
    • -
+ +
-

Enforcement Responsibilities

+

Enforcement Responsibilities +

Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.

Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.

-

Scope

+

Scope +

This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.

-

Enforcement

+

Enforcement +

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [INSERT CONTACT METHOD]. All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the reporter of any incident.

-

Enforcement Guidelines

+

Enforcement Guidelines +

Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:

-

1. Correction

+

1. Correction +

Community Impact: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.

Consequence: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.

-

2. Warning

+

2. Warning +

Community Impact: A violation through a single incident or series of actions.

Consequence: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.

-

3. Temporary Ban

+

3. Temporary Ban +

Community Impact: A serious violation of community standards, including sustained inappropriate behavior.

Consequence: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.

-

4. Permanent Ban

+

4. Permanent Ban +

Community Impact: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.

Consequence: A permanent ban from any sort of public interaction within the community.

-

Attribution

+

Attribution +

This Code of Conduct is adapted from the Contributor Covenant, version 2.1, available at https://www.contributor-covenant.org/version/2/1/code_of_conduct.html.

Community Impact Guidelines were inspired by Mozilla’s code of conduct enforcement ladder.

For answers to common questions about this code of conduct, see the FAQ at https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.

@@ -146,17 +181,19 @@

Attribution

+ + + + - - + + diff --git a/latest-tag/CONTRIBUTING.html b/latest-tag/CONTRIBUTING.html index 3690a5c9a..c61674ed4 100644 --- a/latest-tag/CONTRIBUTING.html +++ b/latest-tag/CONTRIBUTING.html @@ -1,8 +1,22 @@ - -Contribution Guidelines • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -82,7 +102,8 @@

🙏 Thank you for taking the time to contribute!

Your input is deeply valued, whether an issue, a pull request, or even feedback, regardless of size, content or scope.

-

Table of contents

+

Table of contents +

👶 Getting started

📔 Code of Conduct

🗃 License

@@ -93,38 +114,47 @@

Table of contents❓ Questions

-

Getting started

+

Getting started +

Please refer the project documentation for a brief introduction. Please also see other articles within the project documentation for additional information.

-

Code of Conduct

+

Code of Conduct +

A Code of Conduct governs this project. Participants and contributors are expected to follow the rules outlined therein.

-

License

+

License +

All your contributions will be covered by this project’s license.

-

Issues

+

Issues +

We use GitHub to track issues, feature requests, and bugs. Before submitting a new issue, please check if the issue has already been reported. If the issue already exists, please upvote the existing issue 👍.

For new feature requests, please elaborate on the context and the benefit the feature will have for users, developers, or other relevant personas.

-

Pull requests

+

Pull requests +

-

GitHub Flow

+

GitHub Flow +

This repository uses the GitHub Flow model for collaboration. To submit a pull request:

-
  1. +
      +
    1. Create a branch

      Please see the branch naming convention below. If you don’t have write access to this repository, please fork it.

    2. Make changes

      Make sure your code

      -
      • passes all checks imposed by GitHub Actions
      • +
          +
        • passes all checks imposed by GitHub Actions
        • is well documented
        • is well tested with unit tests sufficiently covering the changes introduced
        • -
        +
      +
    3. Create a pull request (PR)

      In the pull request description, please link the relevant issue (if any), provide a detailed description of the change, and include any assumptions.

      @@ -138,76 +168,93 @@

      GitHub Flow -

      Branch naming convention

      +

      Branch naming convention +

      Suppose your changes are related to a current issue in the current project; please name your branch as follows: <issue_id>_<short_description>. Please use underscore (_) as a delimiter for word separation. For example, 420_fix_ui_bug would be a suitable branch name if your change is resolving and UI-related bug reported in issue number 420 in the current project.

      If your change affects multiple repositories, please name your branches as follows: <issue_id>_<issue_repo>_<short description>. For example, 69_awesomeproject_fix_spelling_error would reference issue 69 reported in project awesomeproject and aims to resolve one or more spelling errors in multiple (likely related) repositories.

monorepo and staged.dependencies -

+ +

Sometimes you might need to change upstream dependent package(s) to be able to submit a meaningful change. We are using staged.dependencies functionality to simulate a monorepo behavior. The dependency configuration is already specified in this project’s staged_dependencies.yaml file. You need to name the feature branches appropriately. This is the only exception from the branch naming convention described above.

Please refer to the staged.dependencies package documentation for more details.

-

Coding guidelines

+

Coding guidelines +

This repository follows some unified processes and standards adopted by its maintainers to ensure software development is carried out consistently within teams and cohesively across other repositories.

-

Style guide

+

Style guide +

This repository follows the standard tidyverse style guide and uses lintr for lint checks. Customized lint configurations are available in this repository’s .lintr file.

-

Dependency management

+

Dependency management +

Lightweight is the right weight. This repository follows tinyverse recommendations of limiting dependencies to minimum.

-

Dependency version management

+

Dependency version management +

If the code is not compatible with all (!) historical versions of a given dependency package, it is required to specify minimal version in the DESCRIPTION file. In particular: if the development version requires (imports) the development version of another package - it is required to put abc (>= 1.2.3.9000).

- +
-

R & package versions

+

R & package versions +

We continuously test our packages against the newest R version along with the most recent dependencies from CRAN and BioConductor. We recommend that your working environment is also set up in the same way. You can find the details about the R version and packages used in the R CMD check GitHub Action execution log - there is a step that prints out the R sessionInfo().

If you discover bugs on older R versions or with an older set of dependencies, please create the relevant bug reports.

-

pre-commit

+

+pre-commit +

We highly recommend that you use the pre-commit tool combined with R hooks for pre-commit to execute some of the checks before committing and pushing your changes.

Pre-commit hooks are already available in this repository’s .pre-commit-config.yaml file.

-

Recognition model

+

Recognition model +

As mentioned previously, all contributions are deeply valued and appreciated. While all contribution data is available as part of the repository insights, to recognize a significant contribution and hence add the contributor to the package authors list, the following rules are enforced:

- +

*Excluding auto-generated code, including but not limited to roxygen comments or renv.lock files.

The package maintainer also reserves the right to adjust the criteria to recognize contributions.

-

Questions

+

Questions +

If you have further questions regarding the contribution guidelines, please contact the package/repository maintainer.

+ + + + - - + + diff --git a/latest-tag/LICENSE-text.html b/latest-tag/LICENSE-text.html index de80e9399..e10520d89 100644 --- a/latest-tag/LICENSE-text.html +++ b/latest-tag/LICENSE-text.html @@ -1,8 +1,22 @@ - -License • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -92,17 +112,19 @@ limitations under the License. - + + + + - - + + diff --git a/latest-tag/SECURITY.html b/latest-tag/SECURITY.html index f6f263475..c74550f27 100644 --- a/latest-tag/SECURITY.html +++ b/latest-tag/SECURITY.html @@ -1,8 +1,22 @@ - -Security Policy • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -80,38 +100,44 @@
-

Reporting Security Issues

+

Reporting Security Issues +

If you believe you have found a security vulnerability in any of the repositories in this organization, please report it to us through coordinated disclosure.

Please do not report security vulnerabilities through public GitHub issues, discussions, or pull requests.

Instead, please send an email to vulnerability.management[@]roche.com.

Please include as much of the information listed below as you can to help us better understand and resolve the issue:

-
  • The type of issue (e.g., buffer overflow, SQL injection, or cross-site scripting)
  • +
      +
    • The type of issue (e.g., buffer overflow, SQL injection, or cross-site scripting)
    • Full paths of source file(s) related to the manifestation of the issue
    • The location of the affected source code (tag/branch/commit or direct URL)
    • Any special configuration required to reproduce the issue
    • Step-by-step instructions to reproduce the issue
    • Proof-of-concept or exploit code (if possible)
    • Impact of the issue, including how an attacker might exploit the issue
    • -

    This information will help us triage your report more quickly.

    +
+

This information will help us triage your report more quickly.

-

Data Security Standards (DSS)

+

Data Security Standards (DSS) +

Please make sure that while reporting issues in the form a bug, feature, or pull request, all sensitive information such as PII, PHI, and PCI is completely removed from any text and attachments, including pictures and videos.

+ + + + - - + + diff --git a/latest-tag/articles/filter-panel-for-developers.html b/latest-tag/articles/filter-panel-for-developers.html index 986ec9cce..34dc283f9 100644 --- a/latest-tag/articles/filter-panel-for-developers.html +++ b/latest-tag/articles/filter-panel-for-developers.html @@ -1,5 +1,4 @@ - - + @@ -52,22 +51,7 @@ - - + - + + diff --git a/latest-tag/articles/index.html b/latest-tag/articles/index.html index 236a4f07e..5cc494abd 100644 --- a/latest-tag/articles/index.html +++ b/latest-tag/articles/index.html @@ -1,8 +1,22 @@ - -Articles • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -80,24 +100,31 @@

All vignettes

-
Filter Panel for Developers
+
+
Filter Panel for Developers
-
teal.slice Classes
+ +
teal.slice Classes
-
Introduction to teal.slice
+ +
Introduction to teal.slice
-
- + +
+ + + + + - - + + diff --git a/latest-tag/articles/teal-slice-classes.html b/latest-tag/articles/teal-slice-classes.html index 6c98d7032..1f7434bb9 100644 --- a/latest-tag/articles/teal-slice-classes.html +++ b/latest-tag/articles/teal-slice-classes.html @@ -1,5 +1,4 @@ - - + @@ -52,22 +51,7 @@ - - + - + + diff --git a/latest-tag/articles/teal-slice.html b/latest-tag/articles/teal-slice.html index f1b965356..c19605cfd 100644 --- a/latest-tag/articles/teal-slice.html +++ b/latest-tag/articles/teal-slice.html @@ -1,5 +1,4 @@ - - + @@ -52,22 +51,7 @@ - - + - + + diff --git a/latest-tag/authors.html b/latest-tag/authors.html index b1b4c129b..136084e67 100644 --- a/latest-tag/authors.html +++ b/latest-tag/authors.html @@ -1,8 +1,22 @@ - -Authors and Citation • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -79,7 +99,8 @@

Authors

-
+ +

Citation

@@ -160,17 +182,19 @@

Citation

}
+ + + + - - + + diff --git a/latest-tag/coverage-report/index.html b/latest-tag/coverage-report/index.html index c10bf9398..0f7bb6c5c 100644 --- a/latest-tag/coverage-report/index.html +++ b/latest-tag/coverage-report/index.html @@ -1,23 +1,22 @@ - - + - + - + - - + + - + - + - - - + + + @@ -852,7 +851,8 @@

teal.slice coverage - 65.92%

106 - 67x + 67x +
      checkmate::assert_list(data_objects, any.missing = FALSE, min.len = 0, names = "unique")
@@ -866,14 +866,16 @@

teal.slice coverage - 65.92%

108 - 67x + 67x +
      data_objects <- lapply(data_objects, function(dataset) {
109 - 101x + 101x +
        if (is.list(dataset) && "dataset" %in% names(dataset)) {
@@ -894,7 +896,8 @@

teal.slice coverage - 65.92%

112 - 101x + 101x +
          dataset
@@ -929,49 +932,56 @@

teal.slice coverage - 65.92%

117 - 67x + 67x +
      checkmate::assert_class(join_keys, "join_keys")
118 - 66x + 66x +
      self$set_join_keys(join_keys)
119 - 66x + 66x +
      child_parent <- sapply(
120 - 66x + 66x +
        names(data_objects),
121 - 66x + 66x +
        function(i) teal.data::parent(join_keys, i),
122 - 66x + 66x +
        USE.NAMES = TRUE,
123 - 66x + 66x +
        simplify = FALSE
@@ -985,14 +995,16 @@

teal.slice coverage - 65.92%

125 - 66x + 66x +
      ordered_datanames <- topological_sort(child_parent)
126 - 66x + 66x +
      ordered_datanames <- intersect(ordered_datanames, names(data_objects))
@@ -1006,21 +1018,24 @@

teal.slice coverage - 65.92%

128 - 66x + 66x +
      for (dataname in ordered_datanames) {
129 - 100x + 100x +
        ds_object <- data_objects[[dataname]]
130 - 100x + 100x +
        self$set_dataset(data = ds_object, dataname = dataname)
@@ -1041,7 +1056,8 @@

teal.slice coverage - 65.92%

133 - 66x + 66x +
      self$set_available_teal_slices(x = reactive(NULL))
@@ -1055,7 +1071,8 @@

teal.slice coverage - 65.92%

135 - 66x + 66x +
      invisible(self)
@@ -1118,7 +1135,8 @@

teal.slice coverage - 65.92%

144 - 118x + 118x +
      names(private$filtered_datasets)
@@ -1188,7 +1206,8 @@

teal.slice coverage - 65.92%

154 - 1x + 1x +
      private$get_filtered_dataset(dataname)$get_dataset_label()
@@ -1293,14 +1312,16 @@

teal.slice coverage - 65.92%

169 - 67x + 67x +
      checkmate::assert_class(x, "reactive")
170 - 67x + 67x +
      private$available_teal_slices <- reactive({
@@ -1314,49 +1335,56 @@

teal.slice coverage - 65.92%

172 - 4x + 4x +
        current_state <- isolate(self$get_filter_state())
173 - 4x + 4x +
        allowed <- attr(current_state, "include_varnames")
174 - 4x + 4x +
        forbidden <- attr(current_state, "exclude_varnames")
175 - 4x + 4x +
        foo <- function(slice) {
176 - 13x + 13x +
          if (slice$dataname %in% self$datanames()) {
177 - 13x + 13x +
            if (slice$fixed) {
178 - 4x + 4x +
              TRUE
@@ -1370,14 +1398,16 @@

teal.slice coverage - 65.92%

180 - 9x + 9x +
              isTRUE(slice$varname %in% allowed[[slice$dataname]]) ||
181 - 9x + 9x +
                isFALSE(slice$varname %in% forbidden[[slice$dataname]])
@@ -1419,7 +1449,8 @@

teal.slice coverage - 65.92%

187 - 4x + 4x +
        Filter(foo, x())
@@ -1433,7 +1464,8 @@

teal.slice coverage - 65.92%

189 - 67x + 67x +
      invisible(NULL)
@@ -1510,7 +1542,8 @@

teal.slice coverage - 65.92%

200 - 4x + 4x +
      private$available_teal_slices
@@ -1706,14 +1739,16 @@

teal.slice coverage - 65.92%

228 - 10x + 10x +
      checkmate::assert_subset(dataname, self$datanames())
229 - 9x + 9x +
      private$get_filtered_dataset(dataname)$get_call()
@@ -1811,28 +1846,32 @@

teal.slice coverage - 65.92%

243 - 24x + 24x +
      checkmate::assert_subset(dataname, self$datanames())
244 - 23x + 23x +
      checkmate::assert_flag(filtered)
245 - 22x + 22x +
      data <- private$get_filtered_dataset(dataname)$get_dataset(filtered)
246 - 3x + 3x +
      if (filtered) data() else data
@@ -1895,7 +1934,8 @@

teal.slice coverage - 65.92%

255 - 2x + 2x +
      private$join_keys
@@ -1986,28 +2026,32 @@

teal.slice coverage - 65.92%

268 - 9x + 9x +
      rows <- lapply(
269 - 9x + 9x +
        datanames,
270 - 9x + 9x +
        function(dataname) {
271 - 11x + 11x +
          private$get_filtered_dataset(dataname)$get_filter_overview()
@@ -2028,14 +2072,16 @@

teal.slice coverage - 65.92%

274 - 5x + 5x +
      unssuported_idx <- vapply(rows, function(x) all(is.na(x[-1])), logical(1))
275 - 5x + 5x +
      dplyr::bind_rows(c(rows[!unssuported_idx], rows[unssuported_idx]))
@@ -2112,7 +2158,8 @@

teal.slice coverage - 65.92%

286 - 1x + 1x +
      private$get_filtered_dataset(dataname)$get_keys()
@@ -2266,14 +2313,16 @@

teal.slice coverage - 65.92%

308 - 105x + 105x +
      checkmate::assert_string(dataname)
309 - 105x + 105x +
      logger::log_trace("FilteredData$set_dataset setting dataset, name: { dataname }")
@@ -2294,7 +2343,8 @@

teal.slice coverage - 65.92%

312 - 105x + 105x +
      check_simple_name(dataname)
@@ -2308,21 +2358,24 @@

teal.slice coverage - 65.92%

314 - 105x + 105x +
      parent_dataname <- teal.data::parent(private$join_keys, dataname)
315 - 105x + 105x +
      keys <- private$join_keys[dataname, dataname]
316 - 104x + 104x +
      if (is.null(keys)) keys <- character(0)
@@ -2336,35 +2389,40 @@

teal.slice coverage - 65.92%

318 - 105x + 105x +
      if (length(parent_dataname) == 0) {
319 - 95x + 95x +
        private$filtered_datasets[[dataname]] <- init_filtered_dataset(
320 - 95x + 95x +
          dataset = data,
321 - 95x + 95x +
          dataname = dataname,
322 - 95x + 95x +
          keys = keys
@@ -2385,7 +2443,8 @@

teal.slice coverage - 65.92%

325 - 10x + 10x +
        join_keys <- private$join_keys[dataname, parent_dataname]
@@ -2399,49 +2458,56 @@

teal.slice coverage - 65.92%

327 - 10x + 10x +
        private$filtered_datasets[[dataname]] <- init_filtered_dataset(
328 - 10x + 10x +
          dataset = data,
329 - 10x + 10x +
          dataname = dataname,
330 - 10x + 10x +
          keys = keys,
331 - 10x + 10x +
          parent_name = parent_dataname,
332 - 10x + 10x +
          parent = reactive(self$get_data(parent_dataname, filtered = TRUE)),
333 - 10x + 10x +
          join_keys = join_keys
@@ -2469,7 +2535,8 @@

teal.slice coverage - 65.92%

337 - 105x + 105x +
      invisible(self)
@@ -2546,21 +2613,24 @@

teal.slice coverage - 65.92%

348 - 66x + 66x +
      checkmate::assert_class(join_keys, "join_keys")
349 - 66x + 66x +
      private$join_keys <- join_keys
350 - 66x + 66x +
      invisible(self)
@@ -2637,35 +2707,40 @@

teal.slice coverage - 65.92%

361 - 53x + 53x +
      states <- unname(lapply(private$filtered_datasets, function(x) x$get_filter_state()))
362 - 53x + 53x +
      slices <- Filter(Negate(is.null), states)
363 - 53x + 53x +
      slices <- do.call(c, slices)
364 - 53x + 53x +
      if (!is.null(slices)) {
365 - 53x + 53x +
        attr(slices, "allow_add") <- private$allow_add
@@ -2679,7 +2754,8 @@

teal.slice coverage - 65.92%

367 - 53x + 53x +
      slices
@@ -2763,35 +2839,40 @@

teal.slice coverage - 65.92%

379 - 5x + 5x +
      datasets <- lapply(self$datanames(), private$get_filtered_dataset)
380 - 5x + 5x +
      ind <- vapply(datasets, inherits, logical(1L), what = "DefaultFilteredDataset")
381 - 5x + 5x +
      states <- do.call(c, lapply(datasets[!ind], function(ds) ds$get_filter_state()))
382 - 5x + 5x +
      states_fmt <- format(states, show_all = show_all, trim_lines = trim_lines)
383 - 5x + 5x +
      holders_fmt <- vapply(datasets[ind], format, character(1L), show_all = show_all, trim_lines = trim_lines)
@@ -2805,28 +2886,32 @@

teal.slice coverage - 65.92%

385 - 5x + 5x +
      sprintf(
386 - 5x + 5x +
        "%s:\n%s",
387 - 5x + 5x +
        class(self)[1],
388 - 5x + 5x +
        paste(c(states_fmt, holders_fmt), collapse = "\n")
@@ -2966,42 +3051,48 @@

teal.slice coverage - 65.92%

408 - 31x + 31x +
      isolate({
409 - 31x + 31x +
        logger::log_trace("{ class(self)[1] }$set_filter_state initializing")
410 - 31x + 31x +
        checkmate::assert_class(state, "teal_slices")
411 - 31x + 31x +
        allow_add <- attr(state, "allow_add")
412 - 31x + 31x +
        if (!is.null(allow_add)) {
413 - 31x + 31x +
          private$allow_add <- allow_add
@@ -3022,21 +3113,24 @@

teal.slice coverage - 65.92%

416 - 31x + 31x +
        lapply(self$datanames(), function(dataname) {
417 - 63x + 63x +
          states <- Filter(function(x) identical(x$dataname, dataname), state)
418 - 63x + 63x +
          private$get_filtered_dataset(dataname)$set_filter_state(states)
@@ -3057,7 +3151,8 @@

teal.slice coverage - 65.92%

421 - 31x + 31x +
        logger::log_trace("{ class(self)[1] }$set_filter_state initialized")
@@ -3078,7 +3173,8 @@

teal.slice coverage - 65.92%

424 - 31x + 31x +
      invisible(NULL)
@@ -3169,28 +3265,32 @@

teal.slice coverage - 65.92%

437 - 8x + 8x +
      isolate({
438 - 8x + 8x +
        checkmate::assert_class(state, "teal_slices")
439 - 8x + 8x +
        datanames <- unique(vapply(state, "[[", character(1L), "dataname"))
440 - 8x + 8x +
        checkmate::assert_subset(datanames, self$datanames())
@@ -3204,14 +3304,16 @@

teal.slice coverage - 65.92%

442 - 8x + 8x +
        logger::log_trace(
443 - 8x + 8x +
          "{ class(self)[1] }$remove_filter_state removing filter(s), dataname: { private$dataname }"
@@ -3232,21 +3334,24 @@

teal.slice coverage - 65.92%

446 - 8x + 8x +
        lapply(datanames, function(dataname) {
447 - 9x + 9x +
          slices <- Filter(function(x) identical(x$dataname, dataname), state)
448 - 9x + 9x +
          private$get_filtered_dataset(dataname)$remove_filter_state(slices)
@@ -3267,14 +3372,16 @@

teal.slice coverage - 65.92%

451 - 8x + 8x +
        logger::log_trace(
452 - 8x + 8x +
          "{ class(self)[1] }$remove_filter_state removed filter(s), dataname: { private$dataname }"
@@ -3302,7 +3409,8 @@

teal.slice coverage - 65.92%

456 - 8x + 8x +
      invisible(NULL)
@@ -3407,14 +3515,16 @@

teal.slice coverage - 65.92%

471 - 7x + 7x +
      logger::log_trace(
472 - 7x + 7x +
        "FilteredData$clear_filter_states called, datanames: { toString(datanames) }"
@@ -3435,21 +3545,24 @@

teal.slice coverage - 65.92%

475 - 7x + 7x +
      for (dataname in datanames) {
476 - 12x + 12x +
        fdataset <- private$get_filtered_dataset(dataname = dataname)
477 - 12x + 12x +
        fdataset$clear_filter_states(force)
@@ -3470,28 +3583,32 @@

teal.slice coverage - 65.92%

480 - 7x + 7x +
      logger::log_trace(
481 - 7x + 7x +
        paste(
482 - 7x + 7x +
          "FilteredData$clear_filter_states removed all non-anchored FilterStates,",
483 - 7x + 7x +
          "datanames: { toString(datanames) }"
@@ -3519,7 +3636,8 @@

teal.slice coverage - 65.92%

487 - 7x + 7x +
      invisible(NULL)
@@ -3785,35 +3903,40 @@

teal.slice coverage - 65.92%

525 - 1x + 1x +
      checkmate::assert_function(active_datanames)
526 - 1x + 1x +
      moduleServer(
527 - 1x + 1x +
        id = id,
528 - 1x + 1x +
        function(input, output, session) {
529 - 1x + 1x +
          logger::log_trace("FilteredData$srv_filter_panel initializing")
@@ -3827,14 +3950,16 @@

teal.slice coverage - 65.92%

531 - 1x + 1x +
          active_datanames_resolved <- reactive({
532 - 1x + 1x +
            checkmate::assert_subset(active_datanames(), self$datanames())
@@ -3862,28 +3987,32 @@

teal.slice coverage - 65.92%

536 - 1x + 1x +
          self$srv_overview("overview", active_datanames_resolved)
537 - 1x + 1x +
          self$srv_active("active", active_datanames_resolved)
538 - 1x + 1x +
          if (private$allow_add) {
539 - 1x + 1x +
            self$srv_add("add", active_datanames_resolved)
@@ -3904,14 +4033,16 @@

teal.slice coverage - 65.92%

542 - 1x + 1x +
          logger::log_trace("FilteredData$srv_filter_panel initialized")
543 - 1x + 1x +
          NULL
@@ -4352,21 +4483,24 @@

teal.slice coverage - 65.92%

606 - 3x + 3x +
      checkmate::assert_function(active_datanames)
607 - 3x + 3x +
      moduleServer(id, function(input, output, session) {
608 - 3x + 3x +
        logger::log_trace("FilteredData$srv_active initializing")
@@ -4380,7 +4514,8 @@

teal.slice coverage - 65.92%

610 - 3x + 3x +
        private$srv_available_filters("available_filters")
@@ -4394,7 +4529,8 @@

teal.slice coverage - 65.92%

612 - 3x + 3x +
        observeEvent(input$minimise_filter_active, {
@@ -4443,42 +4579,48 @@

teal.slice coverage - 65.92%

619 - 3x + 3x +
        observeEvent(private$get_filter_count(), {
620 - 3x + 3x +
          shinyjs::toggle("remove_all_filters", condition = private$get_filter_count() != 0)
621 - 3x + 3x +
          shinyjs::show("filter_active_vars_contents")
622 - 3x + 3x +
          shinyjs::hide("filters_active_count")
623 - 3x + 3x +
          toggle_icon(session$ns("minimise_filter_active"), c("fa-angle-right", "fa-angle-down"), TRUE)
624 - 3x + 3x +
          toggle_title(session$ns("minimise_filter_active"), c("Restore panel", "Minimise Panel"), TRUE)
@@ -4499,28 +4641,32 @@

teal.slice coverage - 65.92%

627 - 3x + 3x +
        observeEvent(active_datanames(), {
628 - 2x + 2x +
          lapply(self$datanames(), function(dataname) {
629 - 4x + 4x +
            if (dataname %in% active_datanames()) {
630 - 4x + 4x +
              shinyjs::show(dataname)
@@ -4583,35 +4729,40 @@

teal.slice coverage - 65.92%

639 - 3x + 3x +
        lapply(
640 - 3x + 3x +
          self$datanames(),
641 - 3x + 3x +
          function(dataname) {
642 - 6x + 6x +
            fdataset <- private$get_filtered_dataset(dataname)
643 - 6x + 6x +
            fdataset$srv_active(id = dataname)
@@ -4639,49 +4790,56 @@

teal.slice coverage - 65.92%

647 - 3x + 3x +
        output$teal_filters_count <- renderText({
648 - 3x + 3x +
          n_filters_active <- private$get_filter_count()
649 - 3x + 3x +
          req(n_filters_active > 0L)
650 - 2x + 2x +
          sprintf(
651 - 2x + 2x +
            "%s filter%s applied across datasets",
652 - 2x + 2x +
            n_filters_active,
653 - 2x + 2x +
            ifelse(n_filters_active == 1, "", "s")
@@ -4709,28 +4867,32 @@

teal.slice coverage - 65.92%

657 - 3x + 3x +
        observeEvent(input$remove_all_filters, {
658 - 1x + 1x +
          logger::log_trace("FilteredData$srv_filter_panel@1 removing all non-anchored filters")
659 - 1x + 1x +
          self$clear_filter_states()
660 - 1x + 1x +
          logger::log_trace("FilteredData$srv_filter_panel@1 removed all non-anchored filters")
@@ -4744,14 +4906,16 @@

teal.slice coverage - 65.92%

662 - 3x + 3x +
        logger::log_trace("FilteredData$srv_active initialized")
663 - 3x + 3x +
        NULL
@@ -5129,28 +5293,32 @@

teal.slice coverage - 65.92%

717 - 1x + 1x +
      checkmate::assert_class(active_datanames, "reactive")
718 - 1x + 1x +
      moduleServer(id, function(input, output, session) {
719 - 1x + 1x +
        logger::log_trace("FilteredData$srv_add initializing")
720 - 1x + 1x +
        observeEvent(input$minimise_filter_add_vars, {
@@ -5192,7 +5360,8 @@

teal.slice coverage - 65.92%

726 - 1x + 1x +
        observeEvent(active_datanames(), {
@@ -5276,35 +5445,40 @@

teal.slice coverage - 65.92%

738 - 1x + 1x +
        lapply(
739 - 1x + 1x +
          self$datanames(),
740 - 1x + 1x +
          function(dataname) {
741 - 2x + 2x +
            fdataset <- private$get_filtered_dataset(dataname)
742 - 2x + 2x +
            fdataset$srv_add(id = dataname)
@@ -5325,14 +5499,16 @@

teal.slice coverage - 65.92%

745 - 1x + 1x +
        logger::log_trace("FilteredData$srv_filter_panel initialized")
746 - 1x + 1x +
        NULL
@@ -5752,35 +5928,40 @@

teal.slice coverage - 65.92%

806 - 1x + 1x +
      checkmate::assert_class(active_datanames, "reactive")
807 - 1x + 1x +
      moduleServer(
808 - 1x + 1x +
        id = id,
809 - 1x + 1x +
        function(input, output, session) {
810 - 1x + 1x +
          logger::log_trace("FilteredData$srv_filter_overview initializing")
@@ -5794,7 +5975,8 @@

teal.slice coverage - 65.92%

812 - 1x + 1x +
          observeEvent(input$minimise_filter_overview, {
@@ -5836,7 +6018,8 @@

teal.slice coverage - 65.92%

818 - 1x + 1x +
          output$table <- renderUI({
@@ -6410,14 +6593,16 @@

teal.slice coverage - 65.92%

900 - 1x + 1x +
          logger::log_trace("FilteredData$srv_filter_overview initialized")
901 - 1x + 1x +
          NULL
@@ -6676,7 +6861,8 @@

teal.slice coverage - 65.92%

938 - 147x + 147x +
      if (length(dataname) == 0) {
@@ -6697,7 +6883,8 @@

teal.slice coverage - 65.92%

941 - 147x + 147x +
        private$filtered_datasets[[dataname]]
@@ -6781,7 +6968,8 @@

teal.slice coverage - 65.92%

953 - 11x + 11x +
      length(self$get_filter_state())
@@ -7047,28 +7235,32 @@

teal.slice coverage - 65.92%

991 - 4x + 4x +
      moduleServer(id, function(input, output, session) {
992 - 4x + 4x +
        slices_available <- self$get_available_teal_slices()
993 - 4x + 4x +
        slices_interactive <- reactive(
994 - 4x + 4x +
          Filter(function(slice) isFALSE(slice$fixed), slices_available())
@@ -7082,14 +7274,16 @@

teal.slice coverage - 65.92%

996 - 4x + 4x +
        slices_fixed <- reactive(
997 - 4x + 4x +
          Filter(function(slice) isTRUE(slice$fixed), slices_available())
@@ -7103,21 +7297,24 @@

teal.slice coverage - 65.92%

999 - 4x + 4x +
        available_slices_id <- reactive(vapply(slices_available(), `[[`, character(1), "id"))
1000 - 4x + 4x +
        active_slices_id <- reactive(vapply(self$get_filter_state(), `[[`, character(1), "id"))
1001 - 4x + 4x +
        duplicated_slice_references <- reactive({
@@ -7131,35 +7328,40 @@

teal.slice coverage - 65.92%

1003 - 8x + 8x +
          slice_reference <- vapply(slices_available(), get_default_slice_id, character(1))
1004 - 8x + 8x +
          is_duplicated_reference <- duplicated(slice_reference) | duplicated(slice_reference, fromLast = TRUE)
1005 - 8x + 8x +
          is_active <- available_slices_id() %in% active_slices_id()
1006 - 8x + 8x +
          is_not_expr <- !vapply(slices_available(), inherits, logical(1), "teal_slice_expr")
1007 - 8x + 8x +
          slice_reference[is_duplicated_reference & is_active & is_not_expr]
@@ -7180,70 +7382,80 @@

teal.slice coverage - 65.92%

1010 - 4x + 4x +
        checkbox_group_element <- function(name, value, label, checked, disabled = FALSE) {
1011 - 35x + 35x +
          tags$div(
1012 - 35x + 35x +
            class = "checkbox available-filters",
1013 - 35x + 35x +
            tags$label(
1014 - 35x + 35x +
              tags$input(
1015 - 35x + 35x +
                type = "checkbox",
1016 - 35x + 35x +
                name = name,
1017 - 35x + 35x +
                value = value,
1018 - 35x + 35x +
                checked = checked,
1019 - 35x + 35x +
                disabled = if (disabled) "disabled"
@@ -7257,7 +7469,8 @@

teal.slice coverage - 65.92%

1021 - 35x + 35x +
              tags$span(label, disabled = if (disabled) disabled)
@@ -7292,42 +7505,48 @@

teal.slice coverage - 65.92%

1026 - 4x + 4x +
        output$checkbox <- renderUI({
1027 - 8x + 8x +
          checkbox <- checkboxGroupInput(
1028 - 8x + 8x +
            session$ns("available_slices_id"),
1029 - 8x + 8x +
            label = NULL,
1030 - 8x + 8x +
            choices = NULL,
1031 - 8x + 8x +
            selected = NULL
@@ -7341,14 +7560,16 @@

teal.slice coverage - 65.92%

1033 - 8x + 8x +
          active_slices_ids <- active_slices_id()
1034 - 8x + 8x +
          duplicated_slice_refs <- duplicated_slice_references()
@@ -7362,7 +7583,8 @@

teal.slice coverage - 65.92%

1036 - 8x + 8x +
          checkbox_group_slice <- function(slice) {
@@ -7376,63 +7598,72 @@

teal.slice coverage - 65.92%

1038 - 35x + 35x +
            isolate({
1039 - 35x + 35x +
              checkbox_group_element(
1040 - 35x + 35x +
                name = session$ns("available_slices_id"),
1041 - 35x + 35x +
                value = slice$id,
1042 - 35x + 35x +
                label = slice$id,
1043 - 35x + 35x +
                checked = if (slice$id %in% active_slices_ids) "checked",
1044 - 35x + 35x +
                disabled = slice$anchored ||
1045 - 35x + 35x +
                  get_default_slice_id(slice) %in% duplicated_slice_refs &&
1046 - 35x + 35x +
                    !slice$id %in% active_slices_ids
@@ -7467,14 +7698,16 @@

teal.slice coverage - 65.92%

1051 - 8x + 8x +
          interactive_choice_mock <- lapply(slices_interactive(), checkbox_group_slice)
1052 - 8x + 8x +
          non_interactive_choice_mock <- lapply(slices_fixed(), checkbox_group_slice)
@@ -7488,63 +7721,72 @@

teal.slice coverage - 65.92%

1054 - 8x + 8x +
          htmltools::tagInsertChildren(
1055 - 8x + 8x +
            checkbox,
1056 - 8x + 8x +
            tags$br(),
1057 - 8x + 8x +
            if (length(non_interactive_choice_mock)) tags$strong("Fixed filters"),
1058 - 8x + 8x +
            non_interactive_choice_mock,
1059 - 8x + 8x +
            if (length(interactive_choice_mock)) tags$strong("Interactive filters"),
1060 - 8x + 8x +
            interactive_choice_mock,
1061 - 8x + 8x +
            .cssSelector = "div.shiny-options-group",
1062 - 8x + 8x +
            after = 0
@@ -7572,49 +7814,56 @@

teal.slice coverage - 65.92%

1066 - 4x + 4x +
        observeEvent(input$available_slices_id, ignoreNULL = FALSE, ignoreInit = TRUE, {
1067 - 5x + 5x +
          new_slices_id <- setdiff(input$available_slices_id, active_slices_id())
1068 - 5x + 5x +
          removed_slices_id <- setdiff(active_slices_id(), input$available_slices_id)
1069 - 5x + 5x +
          if (length(new_slices_id)) {
1070 - 3x + 3x +
            new_teal_slices <- Filter(
1071 - 3x + 3x +
              function(slice) slice$id %in% new_slices_id,
1072 - 3x + 3x +
              private$available_teal_slices()
@@ -7628,7 +7877,8 @@

teal.slice coverage - 65.92%

1074 - 3x + 3x +
            self$set_filter_state(new_teal_slices)
@@ -7649,28 +7899,32 @@

teal.slice coverage - 65.92%

1077 - 5x + 5x +
          if (length(removed_slices_id)) {
1078 - 4x + 4x +
            removed_teal_slices <- Filter(
1079 - 4x + 4x +
              function(slice) slice$id %in% removed_slices_id,
1080 - 4x + 4x +
              self$get_filter_state()
@@ -7684,7 +7938,8 @@

teal.slice coverage - 65.92%

1082 - 4x + 4x +
            self$remove_filter_state(removed_teal_slices)
@@ -7712,21 +7967,24 @@

teal.slice coverage - 65.92%

1086 - 4x + 4x +
        observeEvent(private$available_teal_slices(), ignoreNULL = FALSE, {
1087 - 3x + 3x +
          if (length(private$available_teal_slices())) {
1088 - 1x + 1x +
            shinyjs::show("available_menu")
@@ -7740,7 +7998,8 @@

teal.slice coverage - 65.92%

1090 - 2x + 2x +
            shinyjs::hide("available_menu")
@@ -8887,56 +9146,64 @@

teal.slice coverage - 65.92%

157 - 121x + 121x +
      isolate({
158 - 121x + 121x +
        checkmate::assert_numeric(x, all.missing = FALSE)
159 - 2x + 2x +
        if (!any(is.finite(x))) stop("\"x\" contains no finite values")
160 - 118x + 118x +
        super$initialize(x = x, x_reactive = x_reactive, slice = slice, extract_type = extract_type)
161 - 118x + 118x +
        private$is_integer <- checkmate::test_integerish(x)
162 - 118x + 118x +
        private$inf_count <- sum(is.infinite(x))
163 - 118x + 118x +
        private$inf_filtered_count <- reactive(
164 - 118x + 118x +
          if (!is.null(private$x_reactive())) sum(is.infinite(private$x_reactive()))
@@ -8957,14 +9224,16 @@

teal.slice coverage - 65.92%

167 - 118x + 118x +
        checkmate::assert_numeric(slice$choices, null.ok = TRUE)
168 - 3x + 3x +
        if (is.null(slice$keep_inf) && any(is.infinite(x))) slice$keep_inf <- TRUE
@@ -8978,21 +9247,24 @@

teal.slice coverage - 65.92%

170 - 117x + 117x +
        private$set_choices(slice$choices)
171 - 42x + 42x +
        if (is.null(slice$selected)) slice$selected <- slice$choices
172 - 117x + 117x +
        private$set_selected(slice$selected)
@@ -9006,21 +9278,24 @@

teal.slice coverage - 65.92%

174 - 114x + 114x +
        private$is_integer <- checkmate::test_integerish(x)
175 - 114x + 114x +
        private$inf_filtered_count <- reactive(
176 - 114x + 114x +
          if (!is.null(private$x_reactive())) sum(is.infinite(private$x_reactive()))
@@ -9034,7 +9309,8 @@

teal.slice coverage - 65.92%

178 - 114x + 114x +
        private$inf_count <- sum(is.infinite(x))
@@ -9048,63 +9324,72 @@

teal.slice coverage - 65.92%

180 - 114x + 114x +
        private$plot_data <- list(
181 - 114x + 114x +
          type = "histogram",
182 - 114x + 114x +
          nbinsx = 50,
183 - 114x + 114x +
          x = Filter(Negate(is.na), Filter(is.finite, private$x)),
184 - 114x + 114x +
          color = I(fetch_bs_color("secondary")),
185 - 114x + 114x +
          alpha = 0.2,
186 - 114x + 114x +
          bingroup = 1,
187 - 114x + 114x +
          showlegend = FALSE,
188 - 114x + 114x +
          hoverinfo = "none"
@@ -9118,21 +9403,24 @@

teal.slice coverage - 65.92%

190 - 114x + 114x +
        private$plot_mask <- list(list(
191 - 114x + 114x +
          type = "rect", fillcolor = rgb(1, 1, 1, .65), line = list(width = 0),
192 - 114x + 114x +
          x0 = -0.5, x1 = 1.5, y0 = -0.5, y1 = 1.5, xref = "paper", yref = "paper"
@@ -9146,84 +9434,96 @@

teal.slice coverage - 65.92%

194 - 114x + 114x +
        private$plot_layout <- reactive({
195 - 5x + 5x +
          shapes <- private$get_shape_properties(private$get_selected())
196 - 5x + 5x +
          list(
197 - 5x + 5x +
            barmode = "overlay",
198 - 5x + 5x +
            xaxis = list(
199 - 5x + 5x +
              range = private$get_choices() * c(0.995, 1.005),
200 - 5x + 5x +
              rangeslider = list(thickness = 0),
201 - 5x + 5x +
              showticklabels = TRUE,
202 - 5x + 5x +
              ticks = "outside",
203 - 5x + 5x +
              ticklen = 1.5,
204 - 5x + 5x +
              tickmode = "auto",
205 - 5x + 5x +
              nticks = 10
@@ -9237,35 +9537,40 @@

teal.slice coverage - 65.92%

207 - 5x + 5x +
            yaxis = list(showgrid = FALSE, showticklabels = FALSE),
208 - 5x + 5x +
            margin = list(b = 17, l = 0, r = 0, t = 0, autoexpand = FALSE),
209 - 5x + 5x +
            plot_bgcolor = "#FFFFFF00",
210 - 5x + 5x +
            paper_bgcolor = "#FFFFFF00",
211 - 5x + 5x +
            shapes = shapes
@@ -9286,35 +9591,40 @@

teal.slice coverage - 65.92%

214 - 114x + 114x +
        private$plot_config <- reactive({
215 - 5x + 5x +
          list(
216 - 5x + 5x +
            doubleClick = "reset",
217 - 5x + 5x +
            displayModeBar = FALSE,
218 - 5x + 5x +
            edits = list(shapePosition = TRUE)
@@ -9335,49 +9645,56 @@

teal.slice coverage - 65.92%

221 - 114x + 114x +
        private$plot_filtered <- reactive({
222 - 5x + 5x +
          finite_values <- Filter(is.finite, private$x_reactive())
223 - 5x + 5x +
          if (!identical(finite_values, numeric(0))) {
224 - 5x + 5x +
            list(
225 - 5x + 5x +
              x = finite_values,
226 - 5x + 5x +
              bingroup = 1,
227 - 5x + 5x +
              color = I(fetch_bs_color("primary"))
@@ -9405,7 +9722,8 @@

teal.slice coverage - 65.92%

231 - 114x + 114x +
        invisible(self)
@@ -9496,14 +9814,16 @@

teal.slice coverage - 65.92%

244 - 35x + 35x +
      if (isFALSE(private$is_any_filtered())) {
245 - 1x + 1x +
        return(NULL)
@@ -9517,28 +9837,32 @@

teal.slice coverage - 65.92%

247 - 4x + 4x +
      if (missing(dataname)) dataname <- private$get_dataname()
248 - 34x + 34x +
      varname <- private$get_varname_prefixed(dataname)
249 - 34x + 34x +
      filter_call <-
250 - 34x + 34x +
        call(
@@ -9552,14 +9876,16 @@

teal.slice coverage - 65.92%

252 - 34x + 34x +
          call(">=", varname, private$get_selected()[1L]),
253 - 34x + 34x +
          call("<=", varname, private$get_selected()[2L])
@@ -9573,7 +9899,8 @@

teal.slice coverage - 65.92%

255 - 34x + 34x +
      private$add_keep_na_call(private$add_keep_inf_call(filter_call, varname), varname)
@@ -9755,21 +10082,24 @@

teal.slice coverage - 65.92%

281 - 117x + 117x +
      x <- private$x[is.finite(private$x)]
282 - 117x + 117x +
      if (is.null(choices)) {
283 - 105x + 105x +
        choices <- range(x)
@@ -9783,35 +10113,40 @@

teal.slice coverage - 65.92%

285 - 12x + 12x +
        choices_adjusted <- c(max(choices[1L], min(x)), min(choices[2L], max(x)))
286 - 12x + 12x +
        if (any(choices != choices_adjusted)) {
287 - 1x + 1x +
          warning(sprintf(
288 - 1x + 1x +
            "Choices adjusted (some values outside of variable range). Varname: %s, dataname: %s.",
289 - 1x + 1x +
            private$get_varname(), private$get_dataname()
@@ -9825,7 +10160,8 @@

teal.slice coverage - 65.92%

291 - 1x + 1x +
          choices <- choices_adjusted
@@ -9839,35 +10175,40 @@

teal.slice coverage - 65.92%

293 - 12x + 12x +
        if (choices[1L] > choices[2L]) {
294 - 1x + 1x +
          warning(sprintf(
295 - 1x + 1x +
            "Invalid choices: lower is higher / equal to upper, or not in range of variable values.
296 - 1x + 1x +
            Setting defaults. Varname: %s, dataname: %s.",
297 - 1x + 1x +
            private$get_varname(), private$get_dataname()
@@ -9881,7 +10222,8 @@

teal.slice coverage - 65.92%

299 - 1x + 1x +
          choices <- range(x)
@@ -9909,21 +10251,24 @@

teal.slice coverage - 65.92%

303 - 117x + 117x +
      private$set_is_choice_limited(private$x, choices)
304 - 117x + 117x +
      private$x <- private$x[
305 - 117x + 117x +
        (private$x >= choices[1L] & private$x <= choices[2L]) | is.na(private$x) | !is.finite(private$x)
@@ -9944,7 +10289,8 @@

teal.slice coverage - 65.92%

308 - 117x + 117x +
      x_range <- range(private$x, finite = TRUE)
@@ -9965,14 +10311,16 @@

teal.slice coverage - 65.92%

311 - 117x + 117x +
      if (identical(diff(x_range), 0)) {
312 - 2x + 2x +
        choices <- x_range
@@ -9986,21 +10334,24 @@

teal.slice coverage - 65.92%

314 - 115x + 115x +
        x_pretty <- pretty(x_range, 100L)
315 - 115x + 115x +
        choices <- range(x_pretty)
316 - 115x + 115x +
        private$numeric_step <- signif(private$get_pretty_range_step(x_pretty), digits = 10)
@@ -10014,14 +10365,16 @@

teal.slice coverage - 65.92%

318 - 117x + 117x +
      private$teal_slice$choices <- choices
319 - 117x + 117x +
      invisible(NULL)
@@ -10063,28 +10416,32 @@

teal.slice coverage - 65.92%

325 - 117x + 117x +
      xl <- xl[!is.na(xl)]
326 - 117x + 117x +
      xl <- xl[is.finite(xl)]
327 - 117x + 117x +
      private$is_choice_limited <- (any(xl < choices[1L]) | any(xl > choices[2L]))
328 - 117x + 117x +
      invisible(NULL)
@@ -10126,14 +10483,16 @@

teal.slice coverage - 65.92%

334 - 34x + 34x +
      if (isTRUE(private$get_keep_inf())) {
335 - 2x + 2x +
        call("|", call("is.infinite", varname), filter_call)
@@ -10147,7 +10506,8 @@

teal.slice coverage - 65.92%

337 - 32x + 32x +
        filter_call
@@ -10210,14 +10570,16 @@

teal.slice coverage - 65.92%

346 - 117x + 117x +
      if (private$is_integer && diff(range(pretty_range) > 2)) {
347 - 46x + 46x +
        return(1L)
@@ -10231,14 +10593,16 @@

teal.slice coverage - 65.92%

349 - 71x + 71x +
        n_steps <- length(pretty_range) - 1
350 - 71x + 71x +
        return(signif(digits = 10, (max(pretty_range) - min(pretty_range)) / n_steps))
@@ -10266,35 +10630,40 @@

teal.slice coverage - 65.92%

354 - 133x + 133x +
      tryCatch(
355 - 133x + 133x +
        expr = {
356 - 133x + 133x +
          values <- as.numeric(values)
357 - 4x + 4x +
          if (anyNA(values)) stop()
358 - 129x + 129x +
          values
@@ -10308,7 +10677,8 @@

teal.slice coverage - 65.92%

360 - 133x + 133x +
        error = function(e) stop("Vector of set values must contain values coercible to numeric")
@@ -10343,21 +10713,24 @@

teal.slice coverage - 65.92%

365 - 2x + 2x +
      if (length(values) != 2L) stop("Vector of set values must have length two.")
366 - 2x + 2x +
      if (values[1L] > values[2L]) stop("Vector of set values must be sorted.")
367 - 125x + 125x +
      values
@@ -10385,21 +10758,24 @@

teal.slice coverage - 65.92%

371 - 2x + 2x +
      if (values[1L] < private$get_choices()[1L]) values[1L] <- private$get_choices()[1L]
372 - 2x + 2x +
      if (values[2L] > private$get_choices()[2L]) values[2L] <- private$get_choices()[2L]
373 - 125x + 125x +
      values
@@ -10441,35 +10817,40 @@

teal.slice coverage - 65.92%

379 - 35x + 35x +
      if (private$is_choice_limited) {
380 - 1x + 1x +
        TRUE
381 - 34x + 34x +
      } else if (!isTRUE(all.equal(private$get_selected(), private$get_choices()))) {
382 - 32x + 32x +
        TRUE
383 - 2x + 2x +
      } else if (!isTRUE(private$get_keep_inf()) && private$inf_count > 0) {
@@ -10483,14 +10864,16 @@

teal.slice coverage - 65.92%

385 - 2x + 2x +
      } else if (!isTRUE(private$get_keep_na()) && private$na_count > 0) {
386 - 1x + 1x +
        TRUE
@@ -10504,7 +10887,8 @@

teal.slice coverage - 65.92%

388 - 1x + 1x +
        FALSE
@@ -10553,21 +10937,24 @@

teal.slice coverage - 65.92%

395 - 5x + 5x +
      list(
396 - 5x + 5x +
        list(type = "line", x0 = values[1], x1 = values[1], y0 = -100, y1 = 100, yref = "paper"),
397 - 5x + 5x +
        list(type = "line", x0 = values[2], x1 = values[2], y0 = -100, y1 = 100, yref = "paper")
@@ -10644,70 +11031,80 @@

teal.slice coverage - 65.92%

408 - 5x + 5x +
      ns <- NS(id)
409 - 5x + 5x +
      isolate({
410 - 5x + 5x +
        ui_input <- shinyWidgets::numericRangeInput(
411 - 5x + 5x +
          inputId = ns("selection_manual"),
412 - 5x + 5x +
          label = NULL,
413 - 5x + 5x +
          min = private$get_choices()[1L],
414 - 5x + 5x +
          max = private$get_choices()[2L],
415 - 5x + 5x +
          value = private$get_selected(),
416 - 5x + 5x +
          step = private$numeric_step,
417 - 5x + 5x +
          width = "100%"
@@ -10721,28 +11118,32 @@

teal.slice coverage - 65.92%

419 - 5x + 5x +
        tagList(
420 - 5x + 5x +
          tags$div(
421 - 5x + 5x +
            class = "choices_state",
422 - 5x + 5x +
            tags$head(tags$script(
@@ -10770,21 +11171,24 @@

teal.slice coverage - 65.92%

426 - 5x + 5x +
              HTML(
427 - 5x + 5x +
                '$(document).ready(function() {
428 - 5x + 5x +
                  $("[data-toggle=\'popover\']").popover();
@@ -10798,35 +11202,40 @@

teal.slice coverage - 65.92%

430 - 5x + 5x +
                  $(document).on("click", function (e) {
431 - 5x + 5x +
                    if (!$("[data-toggle=\'popover\']").is(e.target) &&
432 - 5x + 5x +
                        $("[data-toggle=\'popover\']").has(e.target).length === 0 &&
433 - 5x + 5x +
                        $(".popover").has(e.target).length === 0) {
434 - 5x + 5x +
                      $("[data-toggle=\'popover\']").popover("hide");
@@ -10868,105 +11277,120 @@

teal.slice coverage - 65.92%

440 - 5x + 5x +
            tags$div(
441 - 5x + 5x +
              actionLink(
442 - 5x + 5x +
                ns("plotly_info"),
443 - 5x + 5x +
                label = NULL,
444 - 5x + 5x +
                icon = icon("question-circle"),
445 - 5x + 5x +
                "data-toggle" = "popover",
446 - 5x + 5x +
                "data-html" = "true",
447 - 5x + 5x +
                "data-placement" = "left",
448 - 5x + 5x +
                "data-trigger" = "click",
449 - 5x + 5x +
                "data-title" = "Plot actions",
450 - 5x + 5x +
                "data-content" = "<p>
451 - 5x + 5x +
                                  Drag vertical lines to set selection.<br>
452 - 5x + 5x +
                                  Drag across plot to zoom in.<br>
453 - 5x + 5x +
                                  Drag axis to pan.<br>
454 - 5x + 5x +
                                  Double click to zoom out."
@@ -10980,7 +11404,8 @@

teal.slice coverage - 65.92%

456 - 5x + 5x +
              style = "text-align: right; font-size: 0.7em; margin-bottom: -1em; position: relative; z-index: 9;"
@@ -10994,35 +11419,40 @@

teal.slice coverage - 65.92%

458 - 5x + 5x +
            shinycssloaders::withSpinner(
459 - 5x + 5x +
              plotly::plotlyOutput(ns("plot"), height = "50px"),
460 - 5x + 5x +
              type = 4,
461 - 5x + 5x +
              size = 0.25,
462 - 5x + 5x +
              hide.ui = FALSE
@@ -11036,7 +11466,8 @@

teal.slice coverage - 65.92%

464 - 5x + 5x +
            ui_input
@@ -11050,28 +11481,32 @@

teal.slice coverage - 65.92%

466 - 5x + 5x +
          tags$div(
467 - 5x + 5x +
            class = "filter-card-body-keep-na-inf",
468 - 5x + 5x +
            private$keep_inf_ui(ns("keep_inf")),
469 - 5x + 5x +
            private$keep_na_ui(ns("keep_na"))
@@ -11148,28 +11583,32 @@

teal.slice coverage - 65.92%

480 - 5x + 5x +
      moduleServer(
481 - 5x + 5x +
        id = id,
482 - 5x + 5x +
        function(input, output, session) {
483 - 5x + 5x +
          logger::log_trace("RangeFilterState$server initializing, id: { private$get_id() }")
@@ -11190,7 +11629,8 @@

teal.slice coverage - 65.92%

486 - 5x + 5x +
          selection_manual <- debounce(reactive(input$selection_manual), 200)
@@ -11211,7 +11651,8 @@

teal.slice coverage - 65.92%

489 - 5x + 5x +
          plot_data <- c(private$plot_data, source = session$ns("histogram_plot"))
@@ -11232,42 +11673,48 @@

teal.slice coverage - 65.92%

492 - 5x + 5x +
          output$plot <- plotly::renderPlotly({
493 - 5x + 5x +
            histogram <- do.call(plotly::plot_ly, plot_data)
494 - 5x + 5x +
            histogram <- do.call(plotly::layout, c(list(p = histogram), private$plot_layout()))
495 - 5x + 5x +
            histogram <- do.call(plotly::config, c(list(p = histogram), private$plot_config()))
496 - 5x + 5x +
            histogram <- do.call(plotly::add_histogram, c(list(p = histogram), private$plot_filtered()))
497 - 5x + 5x +
            histogram
@@ -11295,63 +11742,72 @@

teal.slice coverage - 65.92%

501 - 5x + 5x +
          private$observers$relayout <-
502 - 5x + 5x +
            observeEvent(
503 - 5x + 5x +
              ignoreNULL = FALSE,
504 - 5x + 5x +
              ignoreInit = TRUE,
505 - 5x + 5x +
              eventExpr = plotly::event_data("plotly_relayout", source = session$ns("histogram_plot")),
506 - 5x + 5x +
              handlerExpr = {
507 - 1x + 1x +
                logger::log_trace("RangeFilterState$server@1 selection changed, id: { private$get_id() }")
508 - 1x + 1x +
                event <- plotly::event_data("plotly_relayout", source = session$ns("histogram_plot"))
509 - 1x + 1x +
                if (any(grepl("shapes", names(event)))) {
@@ -11540,42 +11996,48 @@

teal.slice coverage - 65.92%

536 - 5x + 5x +
          private$observers$selection_api <-
537 - 5x + 5x +
            observeEvent(
538 - 5x + 5x +
              ignoreNULL = FALSE,
539 - 5x + 5x +
              ignoreInit = TRUE,
540 - 5x + 5x +
              eventExpr = private$get_selected(),
541 - 5x + 5x +
              handlerExpr = {
@@ -11666,35 +12128,40 @@

teal.slice coverage - 65.92%

554 - 5x + 5x +
          private$observers$selection_manual <- observeEvent(
555 - 5x + 5x +
            ignoreNULL = FALSE,
556 - 5x + 5x +
            ignoreInit = TRUE,
557 - 5x + 5x +
            eventExpr = selection_manual(),
558 - 5x + 5x +
            handlerExpr = {
@@ -11960,14 +12427,16 @@

teal.slice coverage - 65.92%

596 - 5x + 5x +
          private$keep_inf_srv("keep_inf")
597 - 5x + 5x +
          private$keep_na_srv("keep_na")
@@ -11981,14 +12450,16 @@

teal.slice coverage - 65.92%

599 - 5x + 5x +
          logger::log_trace("RangeFilterState$server initialized, id: { private$get_id() }")
600 - 5x + 5x +
          NULL
@@ -12275,42 +12746,48 @@

teal.slice coverage - 65.92%

641 - 5x + 5x +
      selection <- private$get_selected()
642 - 5x + 5x +
      tagList(
643 - 5x + 5x +
        tags$span(HTML(selection[1], "&ndash;", selection[2]), class = "filter-card-summary-value"),
644 - 5x + 5x +
        tags$span(
645 - 5x + 5x +
          class = "filter-card-summary-controls",
646 - 5x + 5x +
          if (private$na_count > 0) {
@@ -12331,7 +12808,8 @@

teal.slice coverage - 65.92%

649 - 5x + 5x +
          if (private$inf_count > 0) {
@@ -12415,7 +12893,8 @@

teal.slice coverage - 65.92%

661 - 5x + 5x +
      ns <- NS(id)
@@ -12429,7 +12908,8 @@

teal.slice coverage - 65.92%

663 - 5x + 5x +
      if (private$inf_count > 0) {
@@ -12569,7 +13049,8 @@

teal.slice coverage - 65.92%

683 - 5x + 5x +
        NULL
@@ -12646,7 +13127,8 @@

teal.slice coverage - 65.92%

694 - 5x + 5x +
      moduleServer(id, function(input, output, session) {
@@ -12674,42 +13156,48 @@

teal.slice coverage - 65.92%

698 - 5x + 5x +
        output$trigger_visible <- renderUI({
699 - 5x + 5x +
          updateCountText(
700 - 5x + 5x +
            inputId = "count_label",
701 - 5x + 5x +
            label = "Keep Inf",
702 - 5x + 5x +
            countmax = private$inf_count,
703 - 5x + 5x +
            countnow = private$inf_filtered_count()
@@ -12723,7 +13211,8 @@

teal.slice coverage - 65.92%

705 - 5x + 5x +
          NULL
@@ -12765,35 +13254,40 @@

teal.slice coverage - 65.92%

711 - 5x + 5x +
        private$observers$keep_inf_api <- observeEvent(
712 - 5x + 5x +
          ignoreNULL = TRUE, # its not possible for range that NULL is selected
713 - 5x + 5x +
          ignoreInit = TRUE, # ignoreInit: should not matter because we set the UI with the desired initial state
714 - 5x + 5x +
          eventExpr = private$get_keep_inf(),
715 - 5x + 5x +
          handlerExpr = {
@@ -12870,35 +13364,40 @@

teal.slice coverage - 65.92%

726 - 5x + 5x +
        private$observers$keep_inf <- observeEvent(
727 - 5x + 5x +
          ignoreNULL = TRUE, # it's not possible for range that NULL is selected
728 - 5x + 5x +
          ignoreInit = TRUE, # ignoreInit: should not matter because we set the UI with the desired initial state
729 - 5x + 5x +
          eventExpr = input$value,
730 - 5x + 5x +
          handlerExpr = {
@@ -12947,7 +13446,8 @@

teal.slice coverage - 65.92%

737 - 5x + 5x +
        invisible(NULL)
@@ -13366,7 +13866,8 @@

teal.slice coverage - 65.92%

55 - 23x + 23x +
      if (!requireNamespace("MultiAssayExperiment", quietly = TRUE)) {
@@ -13387,21 +13888,24 @@

teal.slice coverage - 65.92%

58 - 23x + 23x +
      checkmate::assert_class(dataset, "MultiAssayExperiment")
59 - 21x + 21x +
      super$initialize(dataset, dataname, keys, label)
60 - 21x + 21x +
      experiment_names <- names(dataset)
@@ -13422,49 +13926,56 @@

teal.slice coverage - 65.92%

63 - 21x + 21x +
      private$add_filter_states(
64 - 21x + 21x +
        filter_states = init_filter_states(
65 - 21x + 21x +
          data = dataset,
66 - 21x + 21x +
          data_reactive = private$data_filtered_fun,
67 - 21x + 21x +
          dataname = dataname,
68 - 21x + 21x +
          datalabel = "subjects",
69 - 21x + 21x +
          keys = self$get_keys()
@@ -13478,7 +13989,8 @@

teal.slice coverage - 65.92%

71 - 21x + 21x +
        id = "subjects"
@@ -13513,70 +14025,80 @@

teal.slice coverage - 65.92%

76 - 21x + 21x +
      lapply(
77 - 21x + 21x +
        experiment_names,
78 - 21x + 21x +
        function(experiment_name) {
79 - 105x + 105x +
          data_reactive <- function(sid = "") private$data_filtered_fun(sid)[[experiment_name]]
80 - 105x + 105x +
          private$add_filter_states(
81 - 105x + 105x +
            filter_states = init_filter_states(
82 - 105x + 105x +
              data = dataset[[experiment_name]],
83 - 105x + 105x +
              data_reactive = data_reactive,
84 - 105x + 105x +
              dataname = dataname,
85 - 105x + 105x +
              datalabel = experiment_name
@@ -13590,7 +14112,8 @@

teal.slice coverage - 65.92%

87 - 105x + 105x +
            id = experiment_name
@@ -13681,35 +14204,40 @@

teal.slice coverage - 65.92%

100 - 15x + 15x +
      isolate({
101 - 15x + 15x +
        logger::log_trace("{ class(self)[1] }$set_filter_state initializing, dataname: { private$dataname }")
102 - 15x + 15x +
        checkmate::assert_class(state, "teal_slices")
103 - 14x + 14x +
        lapply(state, function(x) {
104 - 52x + 52x +
          checkmate::assert_true(x$dataname == private$dataname, .var.name = "dataname matches private$dataname")
@@ -13737,14 +14265,16 @@

teal.slice coverage - 65.92%

108 - 14x + 14x +
        subject_state <- Filter(function(x) is.null(x$experiment), state)
109 - 14x + 14x +
        private$get_filter_states()[["subjects"]]$set_filter_state(subject_state)
@@ -13772,28 +14302,32 @@

teal.slice coverage - 65.92%

113 - 14x + 14x +
        experiments <- unique(unlist(lapply(state, "[[", "experiment")))
114 - 14x + 14x +
        available_experiments <- setdiff(names(private$get_filter_states()), "subjects")
115 - 14x + 14x +
        excluded_filters <- setdiff(experiments, available_experiments)
116 - 14x + 14x +
        if (length(excluded_filters)) {
@@ -13863,21 +14397,24 @@

teal.slice coverage - 65.92%

126 - 14x + 14x +
        lapply(available_experiments, function(experiment) {
127 - 70x + 70x +
          slices <- Filter(function(x) identical(x$experiment, experiment), state)
128 - 70x + 70x +
          private$get_filter_states()[[experiment]]$set_filter_state(slices)
@@ -13898,7 +14435,8 @@

teal.slice coverage - 65.92%

131 - 14x + 14x +
        logger::log_trace("{ class(self)[1] }$set_filter_state initialized, dataname: { private$dataname }")
@@ -13912,7 +14450,8 @@

teal.slice coverage - 65.92%

133 - 14x + 14x +
        invisible(NULL)
@@ -14010,7 +14549,8 @@

teal.slice coverage - 65.92%

147 - 1x + 1x +
      checkmate::assert_class(state, "teal_slices")
@@ -14024,14 +14564,16 @@

teal.slice coverage - 65.92%

149 - 1x + 1x +
      isolate({
150 - 1x + 1x +
        logger::log_trace("{ class(self)[1] }$remove_filter_state removing filter(s), dataname: { private$dataname }")
@@ -14045,14 +14587,16 @@

teal.slice coverage - 65.92%

152 - 1x + 1x +
        subject_state <- Filter(function(x) is.null(x$experiment), state)
153 - 1x + 1x +
        private$get_filter_states()[["subjects"]]$remove_filter_state(subject_state)
@@ -14080,28 +14624,32 @@

teal.slice coverage - 65.92%

157 - 1x + 1x +
        experiments <- unique(unlist(lapply(state, "[[", "experiment")))
158 - 1x + 1x +
        available_experiments <- setdiff(names(private$get_filter_states()), "subjects")
159 - 1x + 1x +
        excluded_filters <- setdiff(experiments, available_experiments)
160 - 1x + 1x +
        if (length(excluded_filters)) {
@@ -14164,7 +14712,8 @@

teal.slice coverage - 65.92%

169 - 1x + 1x +
        lapply(experiments, function(experiment) {
@@ -14206,7 +14755,8 @@

teal.slice coverage - 65.92%

175 - 1x + 1x +
        logger::log_trace("{ class(self)[1] }$remove_filter_state removed filter(s), dataname: { private$dataname }")
@@ -14227,7 +14777,8 @@

teal.slice coverage - 65.92%

178 - 1x + 1x +
      invisible(NULL)
@@ -14514,21 +15065,24 @@

teal.slice coverage - 65.92%

219 - 2x + 2x +
      data <- self$get_dataset()
220 - 2x + 2x +
      data_filtered <- self$get_dataset(TRUE)
221 - 2x + 2x +
      experiment_names <- names(data)
@@ -14542,28 +15096,32 @@

teal.slice coverage - 65.92%

223 - 2x + 2x +
      mae_info <- data.frame(
224 - 2x + 2x +
        dataname = private$dataname,
225 - 2x + 2x +
        subjects = nrow(SummarizedExperiment::colData(data)),
226 - 2x + 2x +
        subjects_filtered = nrow(SummarizedExperiment::colData(data_filtered()))
@@ -14584,49 +15142,56 @@

teal.slice coverage - 65.92%

229 - 2x + 2x +
      experiment_obs_info <- do.call("rbind", lapply(
230 - 2x + 2x +
        experiment_names,
231 - 2x + 2x +
        function(experiment_name) {
232 - 10x + 10x +
          data.frame(
233 - 10x + 10x +
            dataname = sprintf("- %s", experiment_name),
234 - 10x + 10x +
            obs = nrow(data[[experiment_name]]),
235 - 10x + 10x +
            obs_filtered = nrow(data_filtered()[[experiment_name]])
@@ -14661,21 +15226,24 @@

teal.slice coverage - 65.92%

240 - 2x + 2x +
      get_experiment_keys <- function(mae, experiment) {
241 - 20x + 20x +
        sample_subset <- subset(MultiAssayExperiment::sampleMap(mae), colname %in% colnames(experiment))
242 - 20x + 20x +
        length(unique(sample_subset$primary))
@@ -14696,42 +15264,48 @@

teal.slice coverage - 65.92%

245 - 2x + 2x +
      experiment_subjects_info <- do.call("rbind", lapply(
246 - 2x + 2x +
        experiment_names,
247 - 2x + 2x +
        function(experiment_name) {
248 - 10x + 10x +
          data.frame(
249 - 10x + 10x +
            subjects = get_experiment_keys(data, data[[experiment_name]]),
250 - 10x + 10x +
            subjects_filtered = get_experiment_keys(data_filtered(), data_filtered()[[experiment_name]])
@@ -14766,14 +15340,16 @@

teal.slice coverage - 65.92%

255 - 2x + 2x +
      experiment_info <- cbind(experiment_obs_info, experiment_subjects_info)
256 - 2x + 2x +
      dplyr::bind_rows(mae_info, experiment_info)
@@ -15668,21 +16244,24 @@

teal.slice coverage - 65.92%

124 - 580x + 580x +
  checkmate::assert_string(dataname)
125 - 573x + 573x +
  checkmate::assert_flag(fixed)
126 - 571x + 571x +
  checkmate::assert_flag(anchored)
@@ -15696,7 +16275,8 @@

teal.slice coverage - 65.92%

128 - 569x + 569x +
  formal_args <- as.list(environment())
@@ -15710,7 +16290,8 @@

teal.slice coverage - 65.92%

130 - 569x + 569x +
  if (!missing(expr) && !missing(varname)) {
@@ -15724,28 +16305,32 @@

teal.slice coverage - 65.92%

132 - 569x + 569x +
  } else if (!missing(expr)) {
133 - 30x + 30x +
    checkmate::assert_string(id)
134 - 27x + 27x +
    checkmate::assert_string(title)
135 - 24x + 24x +
    checkmate::assert_string(expr)
@@ -15759,84 +16344,96 @@

teal.slice coverage - 65.92%

137 - 23x + 23x +
    formal_args$fixed <- TRUE
138 - 23x + 23x +
    ts_expr_args <- c("dataname", "id", "expr", "fixed", "anchored", "title")
139 - 23x + 23x +
    formal_args <- formal_args[ts_expr_args]
140 - 23x + 23x +
    ans <- do.call(reactiveValues, c(formal_args, list(...)))
141 - 23x + 23x +
    class(ans) <- c("teal_slice_expr", "teal_slice", class(ans))
142 - 539x + 539x +
  } else if (!missing(varname)) {
143 - 538x + 538x +
    checkmate::assert_string(varname)
144 - 535x + 535x +
    checkmate::assert_multi_class(choices, .filterable_class, null.ok = TRUE)
145 - 534x + 534x +
    checkmate::assert_multi_class(selected, .filterable_class, null.ok = TRUE)
146 - 532x + 532x +
    checkmate::assert_flag(keep_na, null.ok = TRUE)
147 - 531x + 531x +
    checkmate::assert_flag(keep_inf, null.ok = TRUE)
148 - 530x + 530x +
    checkmate::assert_flag(multiple)
@@ -15850,21 +16447,24 @@

teal.slice coverage - 65.92%

150 - 530x + 530x +
    ts_var_args <- c(
151 - 530x + 530x +
      "dataname", "varname", "id", "choices", "selected", "keep_na", "keep_inf",
152 - 530x + 530x +
      "fixed", "anchored", "multiple"
@@ -15878,42 +16478,48 @@

teal.slice coverage - 65.92%

154 - 530x + 530x +
    formal_args <- formal_args[ts_var_args]
155 - 530x + 530x +
    args <- c(formal_args, list(...))
156 - 530x + 530x +
    args[c("choices", "selected")] <-
157 - 530x + 530x +
      lapply(args[c("choices", "selected")], function(x) if (is.factor(x)) as.character(x) else x)
158 - 530x + 530x +
    if (missing(id)) {
159 - 521x + 521x +
      args$id <- get_default_slice_id(args)
@@ -15927,7 +16533,8 @@

teal.slice coverage - 65.92%

161 - 9x + 9x +
      checkmate::assert_string(id)
@@ -15941,14 +16548,16 @@

teal.slice coverage - 65.92%

163 - 527x + 527x +
    ans <- do.call(reactiveValues, args)
164 - 527x + 527x +
    class(ans) <- c("teal_slice_var", "teal_slice", class(ans))
@@ -15962,7 +16571,8 @@

teal.slice coverage - 65.92%

166 - 1x + 1x +
    stop("Must provide either `expr` or `varname`.")
@@ -15983,7 +16593,8 @@

teal.slice coverage - 65.92%

169 - 550x + 550x +
  ans
@@ -16116,7 +16727,8 @@

teal.slice coverage - 65.92%

188 - 4x + 4x +
  inherits(x, "teal_slice")
@@ -16221,7 +16833,8 @@

teal.slice coverage - 65.92%

203 - 283x + 283x +
  formal_args <- setdiff(names(formals(teal_slice)), "...")
@@ -16235,7 +16848,8 @@

teal.slice coverage - 65.92%

205 - 283x + 283x +
  x <- if (isRunning()) {
@@ -16256,7 +16870,8 @@

teal.slice coverage - 65.92%

208 - 283x + 283x +
    isolate(reactiveValuesToList(x))
@@ -16277,14 +16892,16 @@

teal.slice coverage - 65.92%

211 - 283x + 283x +
  formal_args <- intersect(formal_args, names(x))
212 - 283x + 283x +
  extra_args <- rev(setdiff(names(x), formal_args))
@@ -16298,7 +16915,8 @@

teal.slice coverage - 65.92%

214 - 283x + 283x +
  x[c(formal_args, extra_args)]
@@ -16354,14 +16972,16 @@

teal.slice coverage - 65.92%

222 - 116x + 116x +
  checkmate::assert_flag(show_all)
223 - 92x + 92x +
  checkmate::assert_flag(trim_lines)
@@ -16375,14 +16995,16 @@

teal.slice coverage - 65.92%

225 - 86x + 86x +
  x_list <- as.list(x)
226 - 47x + 47x +
  if (!show_all) x_list <- Filter(Negate(is.null), x_list)
@@ -16396,7 +17018,8 @@

teal.slice coverage - 65.92%

228 - 86x + 86x +
  jsonify(x_list, trim_lines)
@@ -16445,7 +17068,8 @@

teal.slice coverage - 65.92%

235 - 15x + 15x +
  cat(format(x, ...))
@@ -16571,7 +17195,8 @@

teal.slice coverage - 65.92%

253 - 131x + 131x +
  checkmate::assert_list(x)
@@ -16585,28 +17210,32 @@

teal.slice coverage - 65.92%

255 - 131x + 131x +
  x_json <- to_json(x)
256 - 131x + 131x +
  x_json_justified <- justify_json(x_json)
257 - 121x + 121x +
  if (trim_lines) x_json_justified <- trim_lines_json(x_json_justified)
258 - 131x + 131x +
  paste(x_json_justified, collapse = "\n")
@@ -16711,35 +17340,40 @@

teal.slice coverage - 65.92%

273 - 131x + 131x +
  no_unbox <- function(x) {
274 - 2390x + 2390x +
    vars <- c("selected", "choices")
275 - 2390x + 2390x +
    if (is.list(x)) {
276 - 385x + 385x +
      for (var in vars) {
277 - 307x + 307x +
        if (!is.null(x[[var]])) x[[var]] <- I(format_time(x[[var]]))
@@ -16753,7 +17387,8 @@

teal.slice coverage - 65.92%

279 - 385x + 385x +
      lapply(x, no_unbox)
@@ -16767,7 +17402,8 @@

teal.slice coverage - 65.92%

281 - 2005x + 2005x +
      x
@@ -16795,7 +17431,8 @@

teal.slice coverage - 65.92%

285 - 131x + 131x +
  jsonlite::toJSON(no_unbox(x), pretty = TRUE, auto_unbox = TRUE, digits = 16, null = "null")
@@ -16907,14 +17544,16 @@

teal.slice coverage - 65.92%

301 - 307x + 307x +
  if ("POSIXt" %in% class(x)) {
302 - 20x + 20x +
    format(x, format = "%Y-%m-%d %H:%M:%S", usetz = TRUE, tz = "UTC")
@@ -16928,7 +17567,8 @@

teal.slice coverage - 65.92%

304 - 287x + 287x +
    x
@@ -17033,35 +17673,40 @@

teal.slice coverage - 65.92%

319 - 131x + 131x +
  format_name <- function(name, name_width) {
320 - 2775x + 2775x +
    if (nchar(name) == 1 || nchar(gsub("\\s", "", name)) <= 2) {
321 - 630x + 630x +
      return(name)
322 - 2145x + 2145x +
    } else if (grepl("slices|attributes", name)) {
323 - 90x + 90x +
      paste0(name, ":")
@@ -17075,7 +17720,8 @@

teal.slice coverage - 65.92%

325 - 2055x + 2055x +
      paste(format(name, width = name_width), ":")
@@ -17096,28 +17742,32 @@

teal.slice coverage - 65.92%

328 - 131x + 131x +
  json_lines <- strsplit(json, "\n")[[1]]
329 - 131x + 131x +
  json_lines_split <- regmatches(json_lines, regexpr(":", json_lines), invert = TRUE)
330 - 131x + 131x +
  name_width <- max(unlist(regexpr(":", json_lines))) - 1
331 - 131x + 131x +
  vapply(json_lines_split, function(x) paste0(format_name(x[1], name_width), stats::na.omit(x[2])), character(1))
@@ -17222,35 +17872,40 @@

teal.slice coverage - 65.92%

346 - 121x + 121x +
  name_width <- max(unlist(gregexpr(":", x))) - 1
347 - 121x + 121x +
  trim_position <- name_width + 37L
348 - 121x + 121x +
  x_trim <- substr(x, 1, trim_position)
349 - 121x + 121x +
  substr(x_trim, trim_position - 2, trim_position) <- "..."
350 - 121x + 121x +
  x_trim
@@ -17418,28 +18073,32 @@

teal.slice coverage - 65.92%

374 - 610x + 610x +
  checkmate::assert_multi_class(x, c("teal_slice", "list"))
375 - 610x + 610x +
  isolate({
376 - 610x + 610x +
    if (inherits(x, "teal_slice_expr") || is.null(x$varname)) {
377 - 10x + 10x +
      x$id
@@ -17453,28 +18112,32 @@

teal.slice coverage - 65.92%

379 - 600x + 600x +
      paste(
380 - 600x + 600x +
        Filter(
381 - 600x + 600x +
          length,
382 - 600x + 600x +
          as.list(x)[c("dataname", "varname", "experiment", "arg")]
@@ -17488,7 +18151,8 @@

teal.slice coverage - 65.92%

384 - 600x + 600x +
        collapse = " "
@@ -18019,14 +18683,16 @@

teal.slice coverage - 65.92%

71 - 103x + 103x +
      checkmate::assert_data_frame(dataset)
72 - 101x + 101x +
      super$initialize(dataset, dataname, keys, label)
@@ -18047,21 +18713,24 @@

teal.slice coverage - 65.92%

75 - 99x + 99x +
      if (!is.null(parent)) {
76 - 10x + 10x +
        checkmate::assert_character(parent_name, len = 1)
77 - 10x + 10x +
        checkmate::assert_character(join_keys, min.len = 1)
@@ -18075,14 +18744,16 @@

teal.slice coverage - 65.92%

79 - 10x + 10x +
        private$parent_name <- parent_name
80 - 10x + 10x +
        private$join_keys <- join_keys
@@ -18096,28 +18767,32 @@

teal.slice coverage - 65.92%

82 - 10x + 10x +
        private$data_filtered_fun <- function(sid = "") {
83 - 8x + 8x +
          checkmate::assert_character(sid)
84 - 8x + 8x +
          if (length(sid)) {
85 - 8x + 8x +
            logger::log_trace("filtering data dataname: { dataname }, sid: { sid }")
@@ -18145,42 +18820,48 @@

teal.slice coverage - 65.92%

89 - 8x + 8x +
          env <- new.env(parent = parent.env(globalenv()))
90 - 8x + 8x +
          env[[dataname]] <- private$dataset
91 - 8x + 8x +
          env[[parent_name]] <- parent()
92 - 8x + 8x +
          filter_call <- self$get_call(sid)
93 - 8x + 8x +
          eval_expr_with_msg(filter_call, env)
94 - 8x + 8x +
          get(x = dataname, envir = env)
@@ -18208,42 +18889,48 @@

teal.slice coverage - 65.92%

98 - 99x + 99x +
      private$add_filter_states(
99 - 99x + 99x +
        filter_states = init_filter_states(
100 - 99x + 99x +
          data = dataset,
101 - 99x + 99x +
          data_reactive = private$data_filtered_fun,
102 - 99x + 99x +
          dataname = dataname,
103 - 99x + 99x +
          keys = self$get_keys()
@@ -18257,7 +18944,8 @@

teal.slice coverage - 65.92%

105 - 99x + 99x +
        id = "filter"
@@ -18285,35 +18973,40 @@

teal.slice coverage - 65.92%

109 - 99x + 99x +
      if (!is.null(parent)) {
110 - 10x + 10x +
        fs <- teal_slices(
111 - 10x + 10x +
          exclude_varnames = structure(
112 - 10x + 10x +
            list(intersect(colnames(dataset), colnames(isolate(parent())))),
113 - 10x + 10x +
            names = private$dataname
@@ -18334,7 +19027,8 @@

teal.slice coverage - 65.92%

116 - 10x + 10x +
        self$set_filter_state(fs)
@@ -18355,7 +19049,8 @@

teal.slice coverage - 65.92%

119 - 99x + 99x +
      invisible(self)
@@ -18481,28 +19176,32 @@

teal.slice coverage - 65.92%

137 - 42x + 42x +
      logger::log_trace("DataframeFilteredDataset$get_call initializing for dataname: { private$dataname }")
138 - 42x + 42x +
      filter_call <- super$get_call(sid)
139 - 42x + 42x +
      dataname <- private$dataname
140 - 42x + 42x +
      parent_dataname <- private$parent_name
@@ -18516,28 +19215,32 @@

teal.slice coverage - 65.92%

142 - 42x + 42x +
      if (!identical(parent_dataname, character(0))) {
143 - 9x + 9x +
        join_keys <- private$join_keys
144 - 9x + 9x +
        parent_keys <- unname(join_keys)
145 - 9x + 9x +
        dataset_keys <- names(join_keys)
@@ -18551,7 +19254,8 @@

teal.slice coverage - 65.92%

147 - 9x + 9x +
        y_arg <- if (length(parent_keys) == 0L) {
@@ -18572,28 +19276,32 @@

teal.slice coverage - 65.92%

150 - 9x + 9x +
          sprintf(
151 - 9x + 9x +
            "%s[, c(%s), drop = FALSE]",
152 - 9x + 9x +
            parent_dataname,
153 - 9x + 9x +
            toString(dQuote(parent_keys, q = FALSE))
@@ -18621,7 +19329,8 @@

teal.slice coverage - 65.92%

157 - 9x + 9x +
        more_args <- if (length(parent_keys) == 0 || length(dataset_keys) == 0) {
@@ -18635,14 +19344,16 @@

teal.slice coverage - 65.92%

159 - 9x + 9x +
        } else if (identical(parent_keys, dataset_keys)) {
160 - 7x + 7x +
          list(by = parent_keys)
@@ -18656,7 +19367,8 @@

teal.slice coverage - 65.92%

162 - 2x + 2x +
          list(by = stats::setNames(parent_keys, dataset_keys))
@@ -18677,7 +19389,8 @@

teal.slice coverage - 65.92%

165 - 9x + 9x +
        merge_call <- call(
@@ -18691,49 +19404,56 @@

teal.slice coverage - 65.92%

167 - 9x + 9x +
          as.name(dataname),
168 - 9x + 9x +
          as.call(
169 - 9x + 9x +
            c(
170 - 9x + 9x +
              str2lang("dplyr::inner_join"),
171 - 9x + 9x +
              x = as.name(dataname),
172 - 9x + 9x +
              y = str2lang(y_arg),
173 - 9x + 9x +
              more_args
@@ -18768,7 +19488,8 @@

teal.slice coverage - 65.92%

178 - 9x + 9x +
        filter_call <- c(filter_call, merge_call)
@@ -18782,14 +19503,16 @@

teal.slice coverage - 65.92%

180 - 42x + 42x +
      logger::log_trace("DataframeFilteredDataset$get_call initializing for dataname: { private$dataname }")
181 - 42x + 42x +
      filter_call
@@ -18859,35 +19582,40 @@

teal.slice coverage - 65.92%

191 - 81x + 81x +
      isolate({
192 - 81x + 81x +
        logger::log_trace("{ class(self)[1] }$set_filter_state initializing, dataname: { private$dataname }")
193 - 81x + 81x +
        checkmate::assert_class(state, "teal_slices")
194 - 80x + 80x +
        lapply(state, function(slice) {
195 - 97x + 97x +
          checkmate::assert_true(slice$dataname == private$dataname)
@@ -18901,14 +19629,16 @@

teal.slice coverage - 65.92%

197 - 80x + 80x +
        private$get_filter_states()[[1L]]$set_filter_state(state = state)
198 - 80x + 80x +
        invisible(NULL)
@@ -19006,7 +19736,8 @@

teal.slice coverage - 65.92%

212 - 11x + 11x +
      checkmate::assert_class(state, "teal_slices")
@@ -19020,14 +19751,16 @@

teal.slice coverage - 65.92%

214 - 11x + 11x +
      isolate({
215 - 11x + 11x +
        logger::log_trace("{ class(self)[1] }$remove_filter_state removing filter(s), dataname: { private$dataname }")
@@ -19041,14 +19774,16 @@

teal.slice coverage - 65.92%

217 - 11x + 11x +
        varnames <- unique(unlist(lapply(state, "[[", "varname")))
218 - 11x + 11x +
        private$get_filter_states()[[1]]$remove_filter_state(state)
@@ -19062,7 +19797,8 @@

teal.slice coverage - 65.92%

220 - 11x + 11x +
        logger::log_trace("{ class(self)[1] }$remove_filter_state removed filter(s), dataname: { private$dataname }")
@@ -19083,7 +19819,8 @@

teal.slice coverage - 65.92%

223 - 11x + 11x +
      invisible(NULL)
@@ -19244,7 +19981,8 @@

teal.slice coverage - 65.92%

246 - 12x + 12x +
      logger::log_trace("FilteredDataset$srv_filter_overview initialized")
@@ -19265,14 +20003,16 @@

teal.slice coverage - 65.92%

249 - 12x + 12x +
      subject_keys <- if (length(private$parent_name) > 0) {
250 - 1x + 1x +
        names(private$join_keys)
@@ -19286,7 +20026,8 @@

teal.slice coverage - 65.92%

252 - 11x + 11x +
        self$get_keys()
@@ -19300,49 +20041,56 @@

teal.slice coverage - 65.92%

254 - 12x + 12x +
      dataset <- self$get_dataset()
255 - 12x + 12x +
      data_filtered <- self$get_dataset(TRUE)
256 - 12x + 12x +
      if (length(subject_keys) == 0) {
257 - 10x + 10x +
        data.frame(
258 - 10x + 10x +
          dataname = private$dataname,
259 - 10x + 10x +
          obs = nrow(dataset),
260 - 10x + 10x +
          obs_filtered = nrow(data_filtered())
@@ -19363,42 +20111,48 @@

teal.slice coverage - 65.92%

263 - 2x + 2x +
        data.frame(
264 - 2x + 2x +
          dataname = private$dataname,
265 - 2x + 2x +
          obs = nrow(dataset),
266 - 2x + 2x +
          obs_filtered = nrow(data_filtered()),
267 - 2x + 2x +
          subjects = nrow(unique(dataset[subject_keys])),
268 - 2x + 2x +
          subjects_filtered = nrow(unique(data_filtered()[subject_keys]))
@@ -20566,21 +21320,24 @@

teal.slice coverage - 65.92%

155 - 25x + 25x +
      isolate({
156 - 25x + 25x +
        checkmate::assert_multi_class(x, c("POSIXct", "POSIXlt"))
157 - 24x + 24x +
        checkmate::assert_class(x_reactive, "reactive")
@@ -20594,35 +21351,40 @@

teal.slice coverage - 65.92%

159 - 24x + 24x +
        super$initialize(
160 - 24x + 24x +
          x = x,
161 - 24x + 24x +
          x_reactive = x_reactive,
162 - 24x + 24x +
          slice = slice,
163 - 24x + 24x +
          extract_type = extract_type
@@ -20636,28 +21398,32 @@

teal.slice coverage - 65.92%

165 - 24x + 24x +
        checkmate::assert_multi_class(slice$choices, c("POSIXct", "POSIXlt"), null.ok = TRUE)
166 - 23x + 23x +
        private$set_choices(slice$choices)
167 - 15x + 15x +
        if (is.null(slice$selected)) slice$selected <- slice$choices
168 - 23x + 23x +
        private$set_selected(slice$selected)
@@ -20678,7 +21444,8 @@

teal.slice coverage - 65.92%

171 - 22x + 22x +
      invisible(self)
@@ -20755,14 +21522,16 @@

teal.slice coverage - 65.92%

182 - 7x + 7x +
      if (isFALSE(private$is_any_filtered())) {
183 - 1x + 1x +
        return(NULL)
@@ -20776,63 +21545,72 @@

teal.slice coverage - 65.92%

185 - 4x + 4x +
      if (missing(dataname)) dataname <- private$get_dataname()
186 - 6x + 6x +
      varname <- private$get_varname_prefixed(dataname)
187 - 6x + 6x +
      choices <- private$get_selected()
188 - 6x + 6x +
      tzone <- Find(function(x) x != "", attr(as.POSIXlt(choices), "tzone"))
189 - 6x + 6x +
      class <- class(choices)[1L]
190 - 6x + 6x +
      date_fun <- as.name(
191 - 6x + 6x +
        switch(class,
192 - 6x + 6x +
          "POSIXct" = "as.POSIXct",
193 - 6x + 6x +
          "POSIXlt" = "as.POSIXlt"
@@ -20853,21 +21631,24 @@

teal.slice coverage - 65.92%

196 - 6x + 6x +
      choices <- as.character(choices + c(0, 1))
197 - 6x + 6x +
      filter_call <-
198 - 6x + 6x +
        call(
@@ -20881,7 +21662,8 @@

teal.slice coverage - 65.92%

200 - 6x + 6x +
          call(
@@ -20895,14 +21677,16 @@

teal.slice coverage - 65.92%

202 - 6x + 6x +
            varname,
203 - 6x + 6x +
            as.call(list(date_fun, choices[1L], tz = tzone))
@@ -20916,7 +21700,8 @@

teal.slice coverage - 65.92%

205 - 6x + 6x +
          call(
@@ -20930,14 +21715,16 @@

teal.slice coverage - 65.92%

207 - 6x + 6x +
            varname,
208 - 6x + 6x +
            as.call(list(date_fun, choices[2L], tz = tzone))
@@ -20958,7 +21745,8 @@

teal.slice coverage - 65.92%

211 - 6x + 6x +
      private$add_keep_na_call(filter_call, varname)
@@ -21021,14 +21809,16 @@

teal.slice coverage - 65.92%

220 - 23x + 23x +
      if (is.null(choices)) {
221 - 20x + 20x +
        choices <- as.POSIXct(trunc(range(private$x, na.rm = TRUE), units = "secs"))
@@ -21042,28 +21832,32 @@

teal.slice coverage - 65.92%

223 - 3x + 3x +
        choices <- as.POSIXct(choices, units = "secs")
224 - 3x + 3x +
        choices_adjusted <- c(
225 - 3x + 3x +
          max(choices[1L], min(as.POSIXct(private$x), na.rm = TRUE)),
226 - 3x + 3x +
          min(choices[2L], max(as.POSIXct(private$x), na.rm = TRUE))
@@ -21077,28 +21871,32 @@

teal.slice coverage - 65.92%

228 - 3x + 3x +
        if (any(choices != choices_adjusted)) {
229 - 1x + 1x +
          warning(sprintf(
230 - 1x + 1x +
            "Choices adjusted (some values outside of variable range). Varname: %s, dataname: %s.",
231 - 1x + 1x +
            private$get_varname(), private$get_dataname()
@@ -21112,7 +21910,8 @@

teal.slice coverage - 65.92%

233 - 1x + 1x +
          choices <- choices_adjusted
@@ -21126,35 +21925,40 @@

teal.slice coverage - 65.92%

235 - 3x + 3x +
        if (choices[1L] >= choices[2L]) {
236 - 1x + 1x +
          warning(sprintf(
237 - 1x + 1x +
            "Invalid choices: lower is higher / equal to upper, or not in range of variable values.
238 - 1x + 1x +
            Setting defaults. Varname: %s, dataname: %s.",
239 - 1x + 1x +
            private$get_varname(), private$get_dataname()
@@ -21168,7 +21972,8 @@

teal.slice coverage - 65.92%

241 - 1x + 1x +
          choices <- range(private$x, na.rm = TRUE)
@@ -21196,14 +22001,16 @@

teal.slice coverage - 65.92%

245 - 23x + 23x +
      private$set_is_choice_limited(private$x, choices)
246 - 23x + 23x +
      private$x <- private$x[
@@ -21217,21 +22024,24 @@

teal.slice coverage - 65.92%

248 - 23x + 23x +
          as.POSIXct(trunc(private$x, units = "secs")) >= choices[1L] &
249 - 23x + 23x +
            as.POSIXct(trunc(private$x, units = "secs")) <= choices[2L]
250 - 23x + 23x +
        ) | is.na(private$x)
@@ -21245,14 +22055,16 @@

teal.slice coverage - 65.92%

252 - 23x + 23x +
      private$teal_slice$choices <- choices
253 - 23x + 23x +
      invisible(NULL)
@@ -21294,14 +22106,16 @@

teal.slice coverage - 65.92%

259 - 23x + 23x +
      private$is_choice_limited <- (any(xl < choices[1L], na.rm = TRUE) | any(xl > choices[2L], na.rm = TRUE))
260 - 23x + 23x +
      invisible(NULL)
@@ -21322,21 +22136,24 @@

teal.slice coverage - 65.92%

263 - 34x + 34x +
      tryCatch(
264 - 34x + 34x +
        expr = {
265 - 34x + 34x +
          values <- as.POSIXct(values, origin = "1970-01-01 00:00:00")
@@ -21350,7 +22167,8 @@

teal.slice coverage - 65.92%

267 - 31x + 31x +
          values
@@ -21364,7 +22182,8 @@

teal.slice coverage - 65.92%

269 - 34x + 34x +
        error = function(e) stop("Vector of set values must contain values coercible to POSIX.")
@@ -21392,42 +22211,48 @@

teal.slice coverage - 65.92%

273 - 1x + 1x +
      if (length(values) != 2) stop("Vector of set values must have length two.")
274 - 30x + 30x +
      if (values[1] > values[2]) {
275 - 1x + 1x +
        warning(
276 - 1x + 1x +
          sprintf(
277 - 1x + 1x +
            "Start date '%s' is set after the end date '%s', the values will be replaced by a default datetime range.",
278 - 1x + 1x +
            values[1], values[2]
@@ -21448,7 +22273,8 @@

teal.slice coverage - 65.92%

281 - 1x + 1x +
        values <- isolate(private$get_choices())
@@ -21462,7 +22288,8 @@

teal.slice coverage - 65.92%

283 - 30x + 30x +
      values
@@ -21483,42 +22310,48 @@

teal.slice coverage - 65.92%

286 - 30x + 30x +
      choices <- private$get_choices()
287 - 30x + 30x +
      if (values[1] < choices[1L] || values[1] > choices[2L]) {
288 - 5x + 5x +
        warning(
289 - 5x + 5x +
          sprintf(
290 - 5x + 5x +
            "Value: %s is outside of the range for the column '%s' in dataset '%s', setting minimum possible value.",
291 - 5x + 5x +
            values[1], private$get_varname(), toString(private$get_dataname())
@@ -21539,7 +22372,8 @@

teal.slice coverage - 65.92%

294 - 5x + 5x +
        values[1] <- choices[1L]
@@ -21560,35 +22394,40 @@

teal.slice coverage - 65.92%

297 - 30x + 30x +
      if (values[2] > choices[2L] | values[2] < choices[1L]) {
298 - 5x + 5x +
        warning(
299 - 5x + 5x +
          sprintf(
300 - 5x + 5x +
            "Value: '%s' is outside of the range for the column '%s' in dataset '%s', setting maximum possible value.",
301 - 5x + 5x +
            values[2], private$get_varname(), toString(private$get_dataname())
@@ -21609,7 +22448,8 @@

teal.slice coverage - 65.92%

304 - 5x + 5x +
        values[2] <- choices[2L]
@@ -21630,7 +22470,8 @@

teal.slice coverage - 65.92%

307 - 30x + 30x +
      values
@@ -23813,35 +24654,40 @@

teal.slice coverage - 65.92%

66 - 195x + 195x +
  checkmate::assert_class(x_reactive, "reactive")
67 - 194x + 194x +
  checkmate::assert_character(extract_type, max.len = 1, any.missing = FALSE)
68 - 194x + 194x +
  checkmate::assert_class(slice, "teal_slice")
69 - 193x + 193x +
  if (length(extract_type) == 1) {
70 - 43x + 43x +
    checkmate::assert_choice(extract_type, choices = c("list", "matrix"))
@@ -23862,42 +24708,48 @@

teal.slice coverage - 65.92%

73 - 192x + 192x +
  if (all(is.na(x))) {
74 - 1x + 1x +
    EmptyFilterState$new(
75 - 1x + 1x +
      x = x,
76 - 1x + 1x +
      x_reactive = x_reactive,
77 - 1x + 1x +
      slice = slice,
78 - 1x + 1x +
      extract_type = extract_type
@@ -23918,7 +24770,8 @@

teal.slice coverage - 65.92%

81 - 191x + 191x +
    UseMethod("init_filter_state")
@@ -23988,35 +24841,40 @@

teal.slice coverage - 65.92%

91 - 1x + 1x +
  args <- list(
92 - 1x + 1x +
    x = x,
93 - 1x + 1x +
    x_reactive = x_reactive,
94 - 1x + 1x +
    extract_type = extract_type,
95 - 1x + 1x +
    slice
@@ -24037,7 +24895,8 @@

teal.slice coverage - 65.92%

98 - 1x + 1x +
  do.call(FilterState$new, args)
@@ -24100,35 +24959,40 @@

teal.slice coverage - 65.92%

107 - 1x + 1x +
  LogicalFilterState$new(
108 - 1x + 1x +
    x = x,
109 - 1x + 1x +
    x_reactive = x_reactive,
110 - 1x + 1x +
    slice = slice,
111 - 1x + 1x +
    extract_type = extract_type
@@ -24198,35 +25062,40 @@

teal.slice coverage - 65.92%

121 - 120x + 120x +
  args <- list(
122 - 120x + 120x +
    x = x,
123 - 120x + 120x +
    x_reactive = x_reactive,
124 - 120x + 120x +
    slice = slice,
125 - 120x + 120x +
    extract_type = extract_type
@@ -24247,14 +25116,16 @@

teal.slice coverage - 65.92%

128 - 120x + 120x +
  if (length(unique(x[!is.na(x)])) < getOption("teal.threshold_slider_vs_checkboxgroup")) {
129 - 28x + 28x +
    do.call(ChoicesFilterState$new, args)
@@ -24268,7 +25139,8 @@

teal.slice coverage - 65.92%

131 - 92x + 92x +
    do.call(RangeFilterState$new, args)
@@ -24338,35 +25210,40 @@

teal.slice coverage - 65.92%

141 - 31x + 31x +
  ChoicesFilterState$new(
142 - 31x + 31x +
    x = x,
143 - 31x + 31x +
    x_reactive = x_reactive,
144 - 31x + 31x +
    slice = slice,
145 - 31x + 31x +
    extract_type = extract_type
@@ -24436,35 +25313,40 @@

teal.slice coverage - 65.92%

155 - 32x + 32x +
  ChoicesFilterState$new(
156 - 32x + 32x +
    x = x,
157 - 32x + 32x +
    x_reactive = x_reactive,
158 - 32x + 32x +
    slice = slice,
159 - 32x + 32x +
    extract_type = extract_type
@@ -24534,35 +25416,40 @@

teal.slice coverage - 65.92%

169 - 2x + 2x +
  args <- list(
170 - 2x + 2x +
    x = x,
171 - 2x + 2x +
    x_reactive = x_reactive,
172 - 2x + 2x +
    slice = slice,
173 - 2x + 2x +
    extract_type = extract_type
@@ -24583,14 +25470,16 @@

teal.slice coverage - 65.92%

176 - 2x + 2x +
  if (length(unique(x[!is.na(x)])) < getOption("teal.threshold_slider_vs_checkboxgroup")) {
177 - 1x + 1x +
    do.call(ChoicesFilterState$new, args)
@@ -24604,7 +25493,8 @@

teal.slice coverage - 65.92%

179 - 1x + 1x +
    do.call(DateFilterState$new, args)
@@ -24674,35 +25564,40 @@

teal.slice coverage - 65.92%

189 - 2x + 2x +
  args <- list(
190 - 2x + 2x +
    x = x,
191 - 2x + 2x +
    x_reactive = x_reactive,
192 - 2x + 2x +
    slice = slice,
193 - 2x + 2x +
    extract_type = extract_type
@@ -24723,14 +25618,16 @@

teal.slice coverage - 65.92%

196 - 2x + 2x +
  if (length(unique(x[!is.na(x)])) < getOption("teal.threshold_slider_vs_checkboxgroup")) {
197 - 1x + 1x +
    do.call(ChoicesFilterState$new, args)
@@ -24744,7 +25641,8 @@

teal.slice coverage - 65.92%

199 - 1x + 1x +
    do.call(DatetimeFilterState$new, args)
@@ -24814,35 +25712,40 @@

teal.slice coverage - 65.92%

209 - 2x + 2x +
  args <- list(
210 - 2x + 2x +
    x = x,
211 - 2x + 2x +
    x_reactive = x_reactive,
212 - 2x + 2x +
    slice = slice,
213 - 2x + 2x +
    extract_type = extract_type
@@ -24863,14 +25766,16 @@

teal.slice coverage - 65.92%

216 - 2x + 2x +
  if (length(unique(x[!is.na(x)])) < getOption("teal.threshold_slider_vs_checkboxgroup")) {
217 - 1x + 1x +
    do.call(ChoicesFilterState$new, args)
@@ -24884,7 +25789,8 @@

teal.slice coverage - 65.92%

219 - 1x + 1x +
    do.call(DatetimeFilterState$new, args)
@@ -24975,7 +25881,8 @@

teal.slice coverage - 65.92%

232 - 6x + 6x +
  FilterStateExpr$new(slice)
@@ -25143,28 +26050,32 @@

teal.slice coverage - 65.92%

256 - 119x + 119x +
  checkmate::assert_string(color)
257 - 119x + 119x +
  checkmate::assert(
258 - 119x + 119x +
    checkmate::check_number(alpha, lower = 0, upper = 1, null.ok = TRUE),
259 - 119x + 119x +
    checkmate::check_string(alpha, pattern = "[0-9a-f]{2}", null.ok = TRUE)
@@ -25192,7 +26103,8 @@

teal.slice coverage - 65.92%

263 - 119x + 119x +
  sass_file <- if (utils::packageVersion("bslib") < as.package_version("0.5.1.9000")) {
@@ -25213,7 +26125,8 @@

teal.slice coverage - 65.92%

266 - 119x + 119x +
    bslib::bs_theme()[["layers"]][[2]][["defaults"]][[1]][[1]]
@@ -25227,7 +26140,8 @@

teal.slice coverage - 65.92%

268 - 119x + 119x +
  sass_file <- attr(sass_file, "sass_file_path")
@@ -25248,7 +26162,8 @@

teal.slice coverage - 65.92%

271 - 119x + 119x +
  variables_file <- readLines(sass_file)
@@ -25262,14 +26177,16 @@

teal.slice coverage - 65.92%

273 - 119x + 119x +
  ind <- grep("// scss-docs-(start|end) theme-color-variables", variables_file)
274 - 119x + 119x +
  color_definitions <- variables_file[(ind[1] + 1L):(ind[2] - 1L)]
@@ -25290,7 +26207,8 @@

teal.slice coverage - 65.92%

277 - 119x + 119x +
  color_names <- sub("(\\$)(\\w.+)(:.+)", "\\2", color_definitions)
@@ -25311,7 +26229,8 @@

teal.slice coverage - 65.92%

280 - 119x + 119x +
  checkmate::assert_choice(color, color_names)
@@ -25332,7 +26251,8 @@

teal.slice coverage - 65.92%

283 - 119x + 119x +
  color_references <- sub("(\\$)(\\w.+)(:\\s.+\\$)(\\w.+)(\\s.+)", "\\4", color_definitions)
@@ -25353,42 +26273,48 @@

teal.slice coverage - 65.92%

286 - 119x + 119x +
  color_specification <- structure(color_references, names = color_names)
287 - 119x + 119x +
  color_specification <- vapply(color_specification, function(x) {
288 - 952x + 952x +
    line <- grep(sprintf("^\\$%s:\\s+#\\w{6}\\s+!default", x), variables_file, value = TRUE)
289 - 952x + 952x +
    code <- sub("(.+)(#\\w{6})(\\s+.+)", "\\2", line)
290 - 952x + 952x +
    code
291 - 119x + 119x +
  }, character(1L))
@@ -25402,7 +26328,8 @@

teal.slice coverage - 65.92%

293 - 119x + 119x +
  if (!is.null(alpha)) {
@@ -25430,7 +26357,8 @@

teal.slice coverage - 65.92%

297 - 119x + 119x +
  paste0(color_specification[color], alpha)
@@ -26500,42 +27428,48 @@

teal.slice coverage - 65.92%

151 - 160x + 160x +
      isolate({
152 - 160x + 160x +
        checkmate::assert(
153 - 160x + 160x +
          is.character(x),
154 - 160x + 160x +
          is.factor(x),
155 - 160x + 160x +
          length(unique(x[!is.na(x)])) < getOption("teal.threshold_slider_vs_checkboxgroup"),
156 - 160x + 160x +
          combine = "or"
@@ -26549,35 +27483,40 @@

teal.slice coverage - 65.92%

158 - 160x + 160x +
        super$initialize(
159 - 160x + 160x +
          x = x,
160 - 160x + 160x +
          x_reactive = x_reactive,
161 - 160x + 160x +
          slice = slice,
162 - 160x + 160x +
          extract_type = extract_type
@@ -26591,63 +27530,72 @@

teal.slice coverage - 65.92%

164 - 160x + 160x +
        private$set_choices(slice$choices)
165 - 160x + 160x +
        if (is.null(slice$selected) && slice$multiple) {
166 - 42x + 42x +
          slice$selected <- private$get_choices()
167 - 118x + 118x +
        } else if (is.null(slice$selected)) {
168 - 1x + 1x +
          slice$selected <- private$get_choices()[1]
169 - 117x + 117x +
        } else if (length(slice$selected) > 1 && !slice$multiple) {
170 - 1x + 1x +
          warning(
171 - 1x + 1x +
            "ChoicesFilterState allows \"selected\" to be of length 1 when \"multiple\" is FALSE. ",
172 - 1x + 1x +
            "Only the first value will be used."
@@ -26661,7 +27609,8 @@

teal.slice coverage - 65.92%

174 - 1x + 1x +
          slice$selected <- slice$selected[1]
@@ -26675,21 +27624,24 @@

teal.slice coverage - 65.92%

176 - 160x + 160x +
        private$set_selected(slice$selected)
177 - 160x + 160x +
        if (inherits(x, "POSIXt")) {
178 - 9x + 9x +
          private$tzone <- Find(function(x) x != "", attr(as.POSIXlt(x), "tzone"))
@@ -26710,7 +27662,8 @@

teal.slice coverage - 65.92%

181 - 160x + 160x +
      invisible(self)
@@ -26787,14 +27740,16 @@

teal.slice coverage - 65.92%

192 - 61x + 61x +
      if (isFALSE(private$is_any_filtered())) {
193 - 7x + 7x +
        return(NULL)
@@ -26808,49 +27763,56 @@

teal.slice coverage - 65.92%

195 - 30x + 30x +
      if (missing(dataname)) dataname <- private$get_dataname()
196 - 54x + 54x +
      varname <- private$get_varname_prefixed(dataname)
197 - 54x + 54x +
      choices <- private$get_choices()
198 - 54x + 54x +
      selected <- private$get_selected()
199 - 54x + 54x +
      fun_compare <- if (length(selected) == 1L) "==" else "%in%"
200 - 54x + 54x +
      filter_call <- if (length(selected) == 0) {
201 - 6x + 6x +
        call("!", call(fun_compare, varname, make_c_call(as.character(choices))))
@@ -26864,70 +27826,80 @@

teal.slice coverage - 65.92%

203 - 48x + 48x +
        if (setequal(selected, choices) && !private$is_choice_limited) {
204 - 2x + 2x +
          NULL
205 - 46x + 46x +
        } else if (inherits(private$x, "Date")) {
206 - 1x + 1x +
          call(fun_compare, varname, call("as.Date", make_c_call(as.character(selected))))
207 - 45x + 45x +
        } else if (inherits(private$x, c("POSIXct", "POSIXlt"))) {
208 - 2x + 2x +
          class <- class(private$x)[1L]
209 - 2x + 2x +
          date_fun <- as.name(
210 - 2x + 2x +
            switch(class,
211 - 2x + 2x +
              "POSIXct" = "as.POSIXct",
212 - 2x + 2x +
              "POSIXlt" = "as.POSIXlt"
@@ -26948,28 +27920,32 @@

teal.slice coverage - 65.92%

215 - 2x + 2x +
          call(
216 - 2x + 2x +
            fun_compare,
217 - 2x + 2x +
            varname,
218 - 2x + 2x +
            as.call(list(date_fun, make_c_call(as.character(selected)), tz = private$tzone))
@@ -26983,14 +27959,16 @@

teal.slice coverage - 65.92%

220 - 43x + 43x +
        } else if (is.numeric(private$x)) {
221 - 7x + 7x +
          call(fun_compare, varname, make_c_call(as.numeric(selected)))
@@ -27011,7 +27989,8 @@

teal.slice coverage - 65.92%

224 - 36x + 36x +
          call(fun_compare, varname, make_c_call(selected))
@@ -27032,7 +28011,8 @@

teal.slice coverage - 65.92%

227 - 54x + 54x +
      private$add_keep_na_call(filter_call, varname)
@@ -27144,28 +28124,32 @@

teal.slice coverage - 65.92%

243 - 160x + 160x +
      ordered_counts <- .table(private$x)
244 - 160x + 160x +
      possible_choices <- names(ordered_counts)
245 - 160x + 160x +
      if (is.null(choices)) {
246 - 145x + 145x +
        choices <- possible_choices
@@ -27179,49 +28163,56 @@

teal.slice coverage - 65.92%

248 - 15x + 15x +
        choices <- as.character(choices)
249 - 15x + 15x +
        choices_adjusted <- choices[choices %in% possible_choices]
250 - 15x + 15x +
        if (length(setdiff(choices, choices_adjusted)) > 0L) {
251 - 2x + 2x +
          warning(
252 - 2x + 2x +
            sprintf(
253 - 2x + 2x +
              "Some choices not found in data. Adjusting. Filter id: %s.",
254 - 2x + 2x +
              private$get_id()
@@ -27242,7 +28233,8 @@

teal.slice coverage - 65.92%

257 - 2x + 2x +
          choices <- choices_adjusted
@@ -27256,35 +28248,40 @@

teal.slice coverage - 65.92%

259 - 15x + 15x +
        if (length(choices) == 0) {
260 - 1x + 1x +
          warning(
261 - 1x + 1x +
            sprintf(
262 - 1x + 1x +
              "None of the choices were found in data. Setting defaults. Filter id: %s.",
263 - 1x + 1x +
              private$get_id()
@@ -27305,7 +28302,8 @@

teal.slice coverage - 65.92%

266 - 1x + 1x +
          choices <- possible_choices
@@ -27326,28 +28324,32 @@

teal.slice coverage - 65.92%

269 - 160x + 160x +
      private$set_choices_counts(unname(ordered_counts[choices]))
270 - 160x + 160x +
      private$set_is_choice_limited(possible_choices, choices)
271 - 160x + 160x +
      private$teal_slice$choices <- choices
272 - 160x + 160x +
      invisible(NULL)
@@ -27382,21 +28384,24 @@

teal.slice coverage - 65.92%

277 - 160x + 160x +
      xl <- x[!is.na(x)]
278 - 160x + 160x +
      private$is_choice_limited <- length(setdiff(xl, choices)) > 0L
279 - 160x + 160x +
      invisible(NULL)
@@ -27431,14 +28436,16 @@

teal.slice coverage - 65.92%

284 - 160x + 160x +
      private$choices_counts <- choices_counts
285 - 160x + 160x +
      invisible(NULL)
@@ -27473,7 +28480,8 @@

teal.slice coverage - 65.92%

290 - 23x + 23x +
      length(private$get_choices()) <= getOption("teal.threshold_slider_vs_checkboxgroup")
@@ -27494,21 +28502,24 @@

teal.slice coverage - 65.92%

293 - 189x + 189x +
      tryCatch(
294 - 189x + 189x +
        expr = {
295 - 189x + 189x +
          values <- as.character(values)
@@ -27529,7 +28540,8 @@

teal.slice coverage - 65.92%

298 - 189x + 189x +
        error = function(e) stop("The vector of set values must contain values coercible to character.")
@@ -27543,7 +28555,8 @@

teal.slice coverage - 65.92%

300 - 189x + 189x +
      values
@@ -27571,28 +28584,32 @@

teal.slice coverage - 65.92%

304 - 189x + 189x +
      if (!private$is_multiple() && length(values) > 1) {
305 - 1x + 1x +
        warning(
306 - 1x + 1x +
          sprintf("Selection: %s is not a vector of length one. ", toString(values, width = 360)),
307 - 1x + 1x +
          "Maintaining previous selection."
@@ -27606,7 +28623,8 @@

teal.slice coverage - 65.92%

309 - 1x + 1x +
        values <- isolate(private$get_selected())
@@ -27620,7 +28638,8 @@

teal.slice coverage - 65.92%

311 - 189x + 189x +
      values
@@ -27641,35 +28660,40 @@

teal.slice coverage - 65.92%

314 - 189x + 189x +
      in_choices_mask <- values %in% private$get_choices()
315 - 189x + 189x +
      if (length(values[!in_choices_mask]) > 0) {
316 - 17x + 17x +
        warning(paste(
317 - 17x + 17x +
          "Values:", toString(values[!in_choices_mask], width = 360),
318 - 17x + 17x +
          "are not in choices of column", private$get_varname(), "in dataset", private$get_dataname(), "."
@@ -27690,7 +28714,8 @@

teal.slice coverage - 65.92%

321 - 189x + 189x +
      values[in_choices_mask]
@@ -27767,7 +28792,8 @@

teal.slice coverage - 65.92%

332 - 7x + 7x +
      ns <- NS(id)
@@ -27788,21 +28814,24 @@

teal.slice coverage - 65.92%

335 - 7x + 7x +
      isolate({
336 - 7x + 7x +
        countsmax <- private$choices_counts
337 - 7x + 7x +
        countsnow <- if (!is.null(private$x_reactive())) {
@@ -27844,42 +28873,48 @@

teal.slice coverage - 65.92%

343 - 7x + 7x +
        ui_input <- if (private$is_checkboxgroup()) {
344 - 7x + 7x +
          labels <- countBars(
345 - 7x + 7x +
            inputId = ns("labels"),
346 - 7x + 7x +
            choices = private$get_choices(),
347 - 7x + 7x +
            countsnow = countsnow,
348 - 7x + 7x +
            countsmax = countsmax
@@ -27893,70 +28928,80 @@

teal.slice coverage - 65.92%

350 - 6x + 6x +
          tags$div(
351 - 6x + 6x +
            class = "choices_state",
352 - 6x + 6x +
            if (private$is_multiple()) {
353 - 6x + 6x +
              checkboxGroupInput(
354 - 6x + 6x +
                inputId = ns("selection"),
355 - 6x + 6x +
                label = NULL,
356 - 6x + 6x +
                selected = private$get_selected(),
357 - 6x + 6x +
                choiceNames = labels,
358 - 6x + 6x +
                choiceValues = private$get_choices(),
359 - 6x + 6x +
                width = "100%"
@@ -28187,28 +29232,32 @@

teal.slice coverage - 65.92%

392 - 6x + 6x +
        tags$div(
393 - 6x + 6x +
          uiOutput(ns("trigger_visible")),
394 - 6x + 6x +
          ui_input,
395 - 6x + 6x +
          private$keep_na_ui(ns("keep_na"))
@@ -28278,28 +29327,32 @@

teal.slice coverage - 65.92%

405 - 7x + 7x +
      moduleServer(
406 - 7x + 7x +
        id = id,
407 - 7x + 7x +
        function(input, output, session) {
408 - 7x + 7x +
          logger::log_trace("ChoicesFilterState$server_inputs initializing, id: { private$get_id() }")
@@ -28334,21 +29387,24 @@

teal.slice coverage - 65.92%

413 - 7x + 7x +
          non_missing_values <- reactive(Filter(Negate(is.na), private$x_reactive()))
414 - 7x + 7x +
          output$trigger_visible <- renderUI({
415 - 7x + 7x +
            logger::log_trace("ChoicesFilterState$server_inputs@1 updating count labels, id: { private$get_id() }")
@@ -28362,7 +29418,8 @@

teal.slice coverage - 65.92%

417 - 7x + 7x +
            countsnow <- if (!is.null(private$x_reactive())) {
@@ -28411,49 +29468,56 @@

teal.slice coverage - 65.92%

424 - 7x + 7x +
            isolate({
425 - 7x + 7x +
              if (private$is_checkboxgroup()) {
426 - 7x + 7x +
                updateCountBars(
427 - 7x + 7x +
                  inputId = "labels",
428 - 7x + 7x +
                  choices = private$get_choices(),
429 - 7x + 7x +
                  countsmax = private$choices_counts,
430 - 7x + 7x +
                  countsnow = countsnow
@@ -28565,7 +29629,8 @@

teal.slice coverage - 65.92%

446 - 6x + 6x +
              NULL
@@ -28593,42 +29658,48 @@

teal.slice coverage - 65.92%

450 - 7x + 7x +
          if (private$is_checkboxgroup()) {
451 - 7x + 7x +
            private$observers$selection <- observeEvent(
452 - 7x + 7x +
              ignoreNULL = FALSE,
453 - 7x + 7x +
              ignoreInit = TRUE, # ignoreInit: should not matter because we set the UI with the desired initial state
454 - 7x + 7x +
              eventExpr = input$selection,
455 - 7x + 7x +
              handlerExpr = {
@@ -28950,7 +30021,8 @@

teal.slice coverage - 65.92%

501 - 7x + 7x +
          private$keep_na_srv("keep_na")
@@ -28985,7 +30057,8 @@

teal.slice coverage - 65.92%

506 - 7x + 7x +
          private$observers$selection_api <- observeEvent(private$get_selected(), {
@@ -29006,49 +30079,56 @@

teal.slice coverage - 65.92%

509 - 2x + 2x +
            if (!setequal(input$selection, private$get_selected())) {
510 - 2x + 2x +
              logger::log_trace("ChoicesFilterState$server@1 state changed, id: { private$get_id() }")
511 - 2x + 2x +
              if (private$is_checkboxgroup()) {
512 - 2x + 2x +
                if (private$is_multiple()) {
513 - 2x + 2x +
                  updateCheckboxGroupInput(
514 - 2x + 2x +
                    inputId = "selection",
515 - 2x + 2x +
                    selected = private$get_selected()
@@ -29167,14 +30247,16 @@

teal.slice coverage - 65.92%

532 - 7x + 7x +
          logger::log_trace("ChoicesFilterState$server_inputs initialized, id: { private$get_id() }")
533 - 7x + 7x +
          NULL
@@ -29440,21 +30522,24 @@

teal.slice coverage - 65.92%

571 - 7x + 7x +
      selected <- private$get_selected()
572 - 7x + 7x +
      selected_text <-
573 - 7x + 7x +
        if (length(selected) == 0L) {
@@ -29475,14 +30560,16 @@

teal.slice coverage - 65.92%

576 - 7x + 7x +
          if (sum(nchar(selected)) <= 40L) {
577 - 7x + 7x +
            paste(selected, collapse = ", ")
@@ -29517,28 +30604,32 @@

teal.slice coverage - 65.92%

582 - 7x + 7x +
      tagList(
583 - 7x + 7x +
        tags$span(
584 - 7x + 7x +
          class = "filter-card-summary-value",
585 - 7x + 7x +
          selected_text
@@ -29552,21 +30643,24 @@

teal.slice coverage - 65.92%

587 - 7x + 7x +
        tags$span(
588 - 7x + 7x +
          class = "filter-card-summary-controls",
589 - 7x + 7x +
          if (private$na_count > 0) {
@@ -29678,21 +30772,24 @@

teal.slice coverage - 65.92%

605 - 160x + 160x +
  table(
606 - 160x + 160x +
    if (is.factor(x)) {
607 - 36x + 36x +
      x
@@ -29706,7 +30803,8 @@

teal.slice coverage - 65.92%

609 - 124x + 124x +
      as.character(x)
@@ -30104,28 +31202,32 @@

teal.slice coverage - 65.92%

53 - 274x + 274x +
      checkmate::assert_string(dataname)
54 - 272x + 272x +
      logger::log_trace("Instantiating { class(self)[1] }, dataname: { dataname }")
55 - 272x + 272x +
      checkmate::assert_function(data_reactive, args = "sid")
56 - 272x + 272x +
      checkmate::assert_string(datalabel, null.ok = TRUE)
@@ -30139,42 +31241,48 @@

teal.slice coverage - 65.92%

58 - 272x + 272x +
      private$dataname <- dataname
59 - 272x + 272x +
      private$datalabel <- datalabel
60 - 272x + 272x +
      private$dataname_prefixed <- dataname
61 - 272x + 272x +
      private$data <- data
62 - 272x + 272x +
      private$data_reactive <- data_reactive
63 - 272x + 272x +
      private$state_list <- reactiveVal()
@@ -30188,14 +31296,16 @@

teal.slice coverage - 65.92%

65 - 272x + 272x +
      logger::log_trace("Instantiated { class(self)[1] }, dataname: { private$dataname }")
66 - 272x + 272x +
      invisible(self)
@@ -30622,7 +31732,8 @@

teal.slice coverage - 65.92%

127 - 88x + 88x +
      logger::log_trace("FilterStates$get_call initializing")
@@ -30657,21 +31768,24 @@

teal.slice coverage - 65.92%

132 - 88x + 88x +
      states_list <- private$state_list_get()
133 - 88x + 88x +
      if (length(states_list) == 0) {
134 - 52x + 52x +
        return(NULL)
@@ -30685,35 +31799,40 @@

teal.slice coverage - 65.92%

136 - 36x + 36x +
      args <- vapply(
137 - 36x + 36x +
        states_list,
138 - 36x + 36x +
        function(x) {
139 - 57x + 57x +
          arg <- x$get_state()$arg
140 - 7x + 7x +
          `if`(is.null(arg), "", arg) # converting NULL -> "" to enable tapply.
@@ -30727,7 +31846,8 @@

teal.slice coverage - 65.92%

142 - 36x + 36x +
        character(1)
@@ -30748,35 +31868,40 @@

teal.slice coverage - 65.92%

145 - 36x + 36x +
      filter_items <- tapply(
146 - 36x + 36x +
        X = states_list,
147 - 36x + 36x +
        INDEX = args,
148 - 36x + 36x +
        simplify = FALSE,
149 - 36x + 36x +
        function(items) {
@@ -30790,14 +31915,16 @@

teal.slice coverage - 65.92%

151 - 38x + 38x +
          other_filter_idx <- !names(items) %in% sid
152 - 38x + 38x +
          filtered_items <- items[other_filter_idx]
@@ -30811,42 +31938,48 @@

teal.slice coverage - 65.92%

154 - 38x + 38x +
          calls <- Filter(
155 - 38x + 38x +
            Negate(is.null),
156 - 38x + 38x +
            lapply(
157 - 38x + 38x +
              filtered_items,
158 - 38x + 38x +
              function(state) {
159 - 51x + 51x +
                state$get_call(dataname = private$dataname_prefixed)
@@ -30874,7 +32007,8 @@

teal.slice coverage - 65.92%

163 - 38x + 38x +
          calls_combine_by(calls, operator = "&")
@@ -30895,21 +32029,24 @@

teal.slice coverage - 65.92%

166 - 36x + 36x +
      filter_items <- Filter(
167 - 36x + 36x +
        x = filter_items,
168 - 36x + 36x +
        f = Negate(is.null)
@@ -30923,49 +32060,56 @@

teal.slice coverage - 65.92%

170 - 36x + 36x +
      if (length(filter_items) > 0L) {
171 - 35x + 35x +
        filter_function <- private$fun
172 - 35x + 35x +
        data_name <- str2lang(private$dataname_prefixed)
173 - 35x + 35x +
        substitute(
174 - 35x + 35x +
          env = list(
175 - 35x + 35x +
            lhs = data_name,
176 - 35x + 35x +
            rhs = as.call(c(filter_function, c(list(data_name), filter_items)))
@@ -30979,7 +32123,8 @@

teal.slice coverage - 65.92%

178 - 35x + 35x +
          expr = lhs <- rhs
@@ -31007,7 +32152,8 @@

teal.slice coverage - 65.92%

182 - 1x + 1x +
        NULL
@@ -31161,35 +32307,40 @@

teal.slice coverage - 65.92%

204 - 17x + 17x +
      checkmate::assert_class(state, "teal_slices")
205 - 17x + 17x +
      isolate({
206 - 17x + 17x +
        state_ids <- vapply(state, `[[`, character(1), "id")
207 - 17x + 17x +
        logger::log_trace("{ class(self)[1] }$remove_filter_state removing filters, state_id: { toString(state_ids) }")
208 - 17x + 17x +
        private$state_list_remove(state_ids)
@@ -31203,7 +32354,8 @@

teal.slice coverage - 65.92%

210 - 17x + 17x +
      invisible(NULL)
@@ -31287,14 +32439,16 @@

teal.slice coverage - 65.92%

222 - 364x + 364x +
      slices <- unname(lapply(private$state_list(), function(x) x$get_state()))
223 - 364x + 364x +
      fs <- do.call(teal_slices, c(slices, list(count_type = private$count_type)))
@@ -31308,35 +32462,40 @@

teal.slice coverage - 65.92%

225 - 364x + 364x +
      include_varnames <- private$include_varnames
226 - 364x + 364x +
      if (length(include_varnames)) {
227 - 214x + 214x +
        attr(fs, "include_varnames") <- structure(
228 - 214x + 214x +
          list(include_varnames),
229 - 214x + 214x +
          names = private$dataname
@@ -31364,35 +32523,40 @@

teal.slice coverage - 65.92%

233 - 364x + 364x +
      exclude_varnames <- private$exclude_varnames
234 - 364x + 364x +
      if (length(exclude_varnames)) {
235 - 9x + 9x +
        attr(fs, "exclude_varnames") <- structure(
236 - 9x + 9x +
          list(exclude_varnames),
237 - 9x + 9x +
          names = private$dataname
@@ -31420,7 +32584,8 @@

teal.slice coverage - 65.92%

241 - 364x + 364x +
      fs
@@ -31476,49 +32641,56 @@

teal.slice coverage - 65.92%

249 - 135x + 135x +
      isolate({
250 - 135x + 135x +
        logger::log_trace("{ class(self)[1] }$set_filter_state initializing, dataname: { private$dataname }")
251 - 135x + 135x +
        checkmate::assert_class(state, "teal_slices")
252 - 135x + 135x +
        lapply(state, function(x) {
253 - 177x + 177x +
          checkmate::assert_true(
254 - 177x + 177x +
            x$dataname == private$dataname,
255 - 177x + 177x +
            .var.name = "dataname matches private$dataname"
@@ -31546,21 +32718,24 @@

teal.slice coverage - 65.92%

259 - 135x + 135x +
        private$set_filterable_varnames(
260 - 135x + 135x +
          include_varnames = attr(state, "include_varnames")[[private$dataname]],
261 - 135x + 135x +
          exclude_varnames = attr(state, "exclude_varnames")[[private$dataname]]
@@ -31574,21 +32749,24 @@

teal.slice coverage - 65.92%

263 - 135x + 135x +
        count_type <- attr(state, "count_type")
264 - 135x + 135x +
        if (length(count_type)) {
265 - 21x + 21x +
          private$count_type <- count_type
@@ -31616,35 +32794,40 @@

teal.slice coverage - 65.92%

269 - 135x + 135x +
        varnames <- unique(unlist(lapply(state, "[[", "varname")))
270 - 135x + 135x +
        excluded_varnames <- setdiff(varnames, private$get_filterable_varnames())
271 - 135x + 135x +
        if (length(excluded_varnames)) {
272 - 3x + 3x +
          state <- Filter(function(x) !isTRUE(x$varname %in% excluded_varnames), state)
273 - 3x + 3x +
          warning(sprintf("filters for columns: %s excluded from %s", toString(excluded_varnames), private$dataname))
@@ -31665,35 +32848,40 @@

teal.slice coverage - 65.92%

276 - 135x + 135x +
        if (length(state) > 0) {
277 - 93x + 93x +
          private$set_filter_state_impl(
278 - 93x + 93x +
            state = state,
279 - 93x + 93x +
            data = private$data,
280 - 93x + 93x +
            data_reactive = private$data_reactive
@@ -31714,7 +32902,8 @@

teal.slice coverage - 65.92%

283 - 135x + 135x +
        logger::log_trace("{ class(self)[1] }$set_filter_state initialized, dataname: { private$dataname }")
@@ -31735,7 +32924,8 @@

teal.slice coverage - 65.92%

286 - 135x + 135x +
      invisible(NULL)
@@ -31819,14 +33009,16 @@

teal.slice coverage - 65.92%

298 - 25x + 25x +
      private$state_list_empty(force)
299 - 25x + 25x +
      invisible(NULL)
@@ -32078,49 +33270,56 @@

teal.slice coverage - 65.92%

335 - 12x + 12x +
      moduleServer(
336 - 12x + 12x +
        id = id,
337 - 12x + 12x +
        function(input, output, session) {
338 - 12x + 12x +
          logger::log_trace("FilterState$srv_active initializing, dataname: { private$dataname }")
339 - 12x + 12x +
          current_state <- reactive(private$state_list_get())
340 - 12x + 12x +
          previous_state <- reactiveVal(NULL) # FilterState list
341 - 12x + 12x +
          added_states <- reactiveVal(NULL) # FilterState list
@@ -32141,21 +33340,24 @@

teal.slice coverage - 65.92%

344 - 12x + 12x +
          fs_to_shiny_ns <- function(x) {
345 - 24x + 24x +
            checkmate::assert_multi_class(x, c("FilterState", "FilterStateExpr"))
346 - 24x + 24x +
            gsub("[^[:alnum:]]+", "_", get_default_slice_id(x$get_state()))
@@ -32176,28 +33378,32 @@

teal.slice coverage - 65.92%

349 - 12x + 12x +
          output$trigger_visible_state_change <- renderUI({
350 - 14x + 14x +
            current_state()
351 - 14x + 14x +
            isolate({
352 - 14x + 14x +
              logger::log_trace("FilterStates$srv_active@1 determining added and removed filter states")
@@ -32211,21 +33417,24 @@

teal.slice coverage - 65.92%

354 - 14x + 14x +
              added_states(setdiff_teal_slices(current_state(), previous_state()))
355 - 14x + 14x +
              previous_state(current_state())
356 - 14x + 14x +
              NULL
@@ -32253,42 +33462,48 @@

teal.slice coverage - 65.92%

360 - 12x + 12x +
          output[["cards"]] <- renderUI({
361 - 14x + 14x +
            lapply(
362 - 14x + 14x +
              current_state(), # observes only if added/removed
363 - 14x + 14x +
              function(state) {
364 - 12x + 12x +
                isolate( # isolates when existing state changes
365 - 12x + 12x +
                  state$ui(id = session$ns(fs_to_shiny_ns(state)), parent_id = session$ns("cards"))
@@ -32330,21 +33545,24 @@

teal.slice coverage - 65.92%

371 - 12x + 12x +
          observeEvent(
372 - 12x + 12x +
            added_states(), # we want to call FilterState module only once when it's added
373 - 12x + 12x +
            ignoreNULL = TRUE,
@@ -32358,63 +33576,72 @@

teal.slice coverage - 65.92%

375 - 10x + 10x +
              added_state_names <- vapply(added_states(), function(x) x$get_state()$id, character(1L))
376 - 10x + 10x +
              logger::log_trace("FilterStates$srv_active@2 triggered by added states: { toString(added_state_names) }")
377 - 10x + 10x +
              lapply(added_states(), function(state) {
378 - 12x + 12x +
                fs_callback <- state$server(id = fs_to_shiny_ns(state))
379 - 12x + 12x +
                observeEvent(
380 - 12x + 12x +
                  once = TRUE, # remove button can be called once, should be destroyed afterwards
381 - 12x + 12x +
                  ignoreInit = TRUE, # ignoreInit: should not matter because we destroy the previous input set of the UI
382 - 12x + 12x +
                  eventExpr = fs_callback(), # when remove button is clicked in the FilterState ui
383 - 12x + 12x +
                  handlerExpr = private$state_list_remove(state$get_state()$id)
@@ -32435,7 +33662,8 @@

teal.slice coverage - 65.92%

386 - 10x + 10x +
              added_states(NULL)
@@ -32463,7 +33691,8 @@

teal.slice coverage - 65.92%

390 - 12x + 12x +
          NULL
@@ -32561,14 +33790,16 @@

teal.slice coverage - 65.92%

404 - 1x + 1x +
      checkmate::assert_string(id)
405 - 1x + 1x +
      data <- private$data
@@ -32582,7 +33813,8 @@

teal.slice coverage - 65.92%

407 - 1x + 1x +
      ns <- NS(id)
@@ -32596,14 +33828,16 @@

teal.slice coverage - 65.92%

409 - 1x + 1x +
      if (ncol(data) == 0) {
410 - 1x + 1x +
        tags$div("no sample variables available")
@@ -32743,28 +33977,32 @@

teal.slice coverage - 65.92%

430 - 8x + 8x +
      moduleServer(
431 - 8x + 8x +
        id = id,
432 - 8x + 8x +
        function(input, output, session) {
433 - 8x + 8x +
          logger::log_trace("FilterStates$srv_add initializing, dataname: { private$dataname }")
@@ -32785,42 +34023,48 @@

teal.slice coverage - 65.92%

436 - 8x + 8x +
          avail_column_choices <- reactive({
437 - 9x + 9x +
            data <- private$data
438 - 9x + 9x +
            vars_include <- private$get_filterable_varnames()
439 - 9x + 9x +
            active_filter_vars <- unique(unlist(lapply(self$get_filter_state(), "[[", "varname")))
440 - 9x + 9x +
            choices <- setdiff(vars_include, active_filter_vars)
441 - 9x + 9x +
            varlabels <- get_varlabels(data)
@@ -32834,35 +34078,40 @@

teal.slice coverage - 65.92%

443 - 9x + 9x +
            data_choices_labeled(
444 - 9x + 9x +
              data = data,
445 - 9x + 9x +
              choices = choices,
446 - 9x + 9x +
              varlabels = varlabels,
447 - 9x + 9x +
              keys = private$keys
@@ -32897,21 +34146,24 @@

teal.slice coverage - 65.92%

452 - 8x + 8x +
          output$add_filter <- renderUI({
453 - 6x + 6x +
            logger::log_trace(
454 - 6x + 6x +
              "FilterStates$srv_add@1 updating available column choices, dataname: { private$dataname }"
@@ -32925,7 +34177,8 @@

teal.slice coverage - 65.92%

456 - 6x + 6x +
            if (length(avail_column_choices()) == 0) {
@@ -32946,56 +34199,64 @@

teal.slice coverage - 65.92%

459 - 6x + 6x +
              tags$div(
460 - 6x + 6x +
                teal.widgets::optionalSelectInput(
461 - 6x + 6x +
                  session$ns("var_to_add"),
462 - 6x + 6x +
                  choices = avail_column_choices(),
463 - 6x + 6x +
                  selected = NULL,
464 - 6x + 6x +
                  options = shinyWidgets::pickerOptions(
465 - 6x + 6x +
                    liveSearch = TRUE,
466 - 6x + 6x +
                    noneSelectedText = "Select variable to filter"
@@ -33044,56 +34305,64 @@

teal.slice coverage - 65.92%

473 - 8x + 8x +
          observeEvent(
474 - 8x + 8x +
            eventExpr = input$var_to_add,
475 - 8x + 8x +
            handlerExpr = {
476 - 3x + 3x +
              logger::log_trace(
477 - 3x + 3x +
                sprintf(
478 - 3x + 3x +
                  "FilterStates$srv_add@2 adding FilterState of variable %s, dataname: %s",
479 - 3x + 3x +
                  input$var_to_add,
480 - 3x + 3x +
                  private$dataname
@@ -33114,21 +34383,24 @@

teal.slice coverage - 65.92%

483 - 3x + 3x +
              self$set_filter_state(
484 - 3x + 3x +
                teal_slices(
485 - 3x + 3x +
                  teal_slice(dataname = private$dataname, varname = input$var_to_add)
@@ -33149,35 +34421,40 @@

teal.slice coverage - 65.92%

488 - 3x + 3x +
              logger::log_trace(
489 - 3x + 3x +
                sprintf(
490 - 3x + 3x +
                  "FilterStates$srv_add@2 added FilterState of variable %s, dataname: %s",
491 - 3x + 3x +
                  input$var_to_add,
492 - 3x + 3x +
                  private$dataname
@@ -33219,14 +34496,16 @@

teal.slice coverage - 65.92%

498 - 8x + 8x +
          logger::log_trace("FilterStates$srv_add initialized, dataname: { private$dataname }")
499 - 8x + 8x +
          NULL
@@ -33485,14 +34764,16 @@

teal.slice coverage - 65.92%

536 - 288x + 288x +
      if ((length(include_varnames) + length(exclude_varnames)) == 0L) {
537 - 113x + 113x +
        return(invisible(NULL))
@@ -33506,21 +34787,24 @@

teal.slice coverage - 65.92%

539 - 175x + 175x +
      checkmate::assert_character(include_varnames, any.missing = FALSE, min.len = 0L, null.ok = TRUE)
540 - 175x + 175x +
      checkmate::assert_character(exclude_varnames, any.missing = FALSE, min.len = 0L, null.ok = TRUE)
541 - 175x + 175x +
      if (length(include_varnames) && length(exclude_varnames)) {
@@ -33569,28 +34853,32 @@

teal.slice coverage - 65.92%

548 - 175x + 175x +
      supported_vars <- get_supported_filter_varnames(private$data)
549 - 175x + 175x +
      if (length(include_varnames)) {
550 - 161x + 161x +
        private$include_varnames <- intersect(include_varnames, supported_vars)
551 - 161x + 161x +
        private$exclude_varnames <- character(0)
@@ -33604,14 +34892,16 @@

teal.slice coverage - 65.92%

553 - 14x + 14x +
        private$exclude_varnames <- exclude_varnames
554 - 14x + 14x +
        private$include_varnames <- character(0)
@@ -33625,7 +34915,8 @@

teal.slice coverage - 65.92%

556 - 175x + 175x +
      invisible(NULL)
@@ -33702,14 +34993,16 @@

teal.slice coverage - 65.92%

567 - 144x + 144x +
      if (length(private$include_varnames)) {
568 - 97x + 97x +
        private$include_varnames
@@ -33723,14 +35016,16 @@

teal.slice coverage - 65.92%

570 - 47x + 47x +
        supported_varnames <- get_supported_filter_varnames(private$data)
571 - 47x + 47x +
        setdiff(supported_varnames, private$exclude_varnames)
@@ -33835,7 +35130,8 @@

teal.slice coverage - 65.92%

586 - 212x + 212x +
      checkmate::assert_string(state_id, null.ok = TRUE)
@@ -33849,14 +35145,16 @@

teal.slice coverage - 65.92%

588 - 212x + 212x +
      if (is.null(state_id)) {
589 - 212x + 212x +
        private$state_list()
@@ -33982,49 +35280,56 @@

teal.slice coverage - 65.92%

607 - 183x + 183x +
      logger::log_trace("{ class(self)[1] } pushing into state_list, dataname: { private$dataname }")
608 - 183x + 183x +
      checkmate::assert_string(state_id)
609 - 183x + 183x +
      checkmate::assert_multi_class(x, c("FilterState", "FilterStateExpr"))
610 - 183x + 183x +
      state <- stats::setNames(list(x), state_id)
611 - 183x + 183x +
      new_state_list <- c(
612 - 183x + 183x +
        isolate(private$state_list()),
613 - 183x + 183x +
        state
@@ -34038,7 +35343,8 @@

teal.slice coverage - 65.92%

615 - 183x + 183x +
      isolate(private$state_list(new_state_list))
@@ -34052,14 +35358,16 @@

teal.slice coverage - 65.92%

617 - 183x + 183x +
      logger::log_trace("{ class(self)[1] } pushed into queue, dataname: { private$dataname }")
618 - 183x + 183x +
      invisible(NULL)
@@ -34178,14 +35486,16 @@

teal.slice coverage - 65.92%

635 - 32x + 32x +
      checkmate::assert_character(state_id)
636 - 32x + 32x +
      logger::log_trace("{ class(self)[1] } removing a filter, state_id: { toString(state_id) }")
@@ -34199,63 +35509,72 @@

teal.slice coverage - 65.92%

638 - 32x + 32x +
      isolate({
639 - 32x + 32x +
        current_state_ids <- vapply(private$state_list(), function(x) x$get_state()$id, character(1))
640 - 32x + 32x +
        to_remove <- state_id %in% current_state_ids
641 - 32x + 32x +
        if (any(to_remove)) {
642 - 31x + 31x +
          new_state_list <- Filter(
643 - 31x + 31x +
            function(state) {
644 - 68x + 68x +
              if (state$get_state()$id %in% state_id) {
645 - 54x + 54x +
                if (state$get_state()$anchored && !force) {
646 - 7x + 7x +
                  return(TRUE)
@@ -34269,14 +35588,16 @@

teal.slice coverage - 65.92%

648 - 47x + 47x +
                  state$destroy_observers()
649 - 47x + 47x +
                  FALSE
@@ -34297,7 +35618,8 @@

teal.slice coverage - 65.92%

652 - 14x + 14x +
                TRUE
@@ -34318,7 +35640,8 @@

teal.slice coverage - 65.92%

655 - 31x + 31x +
            private$state_list()
@@ -34332,7 +35655,8 @@

teal.slice coverage - 65.92%

657 - 31x + 31x +
          private$state_list(new_state_list)
@@ -34346,7 +35670,8 @@

teal.slice coverage - 65.92%

659 - 1x + 1x +
          warning(sprintf("\"%s\" not found in state list", state_id))
@@ -34374,7 +35699,8 @@

teal.slice coverage - 65.92%

663 - 32x + 32x +
      invisible(NULL)
@@ -34444,21 +35770,24 @@

teal.slice coverage - 65.92%

673 - 25x + 25x +
      isolate({
674 - 25x + 25x +
        logger::log_trace(
675 - 25x + 25x +
          "{ class(self)[1] }$state_list_empty removing all non-anchored filters for dataname: { private$dataname }"
@@ -34479,28 +35808,32 @@

teal.slice coverage - 65.92%

678 - 25x + 25x +
        state_list <- private$state_list()
679 - 25x + 25x +
        if (length(state_list)) {
680 - 15x + 15x +
          state_ids <- vapply(state_list, function(x) x$get_state()$id, character(1))
681 - 15x + 15x +
          private$state_list_remove(state_ids, force)
@@ -34528,7 +35861,8 @@

teal.slice coverage - 65.92%

685 - 25x + 25x +
      invisible(NULL)
@@ -34654,35 +35988,40 @@

teal.slice coverage - 65.92%

703 - 211x + 211x +
      checkmate::assert_class(state, "teal_slices")
704 - 211x + 211x +
      checkmate::assert_multi_class(data, c("data.frame", "matrix", "DataFrame", "HermesData"))
705 - 211x + 211x +
      checkmate::assert_function(data_reactive, args = "sid")
706 - 211x + 211x +
      if (length(state) == 0L) {
707 - 101x + 101x +
        return(invisible(NULL))
@@ -34703,14 +36042,16 @@

teal.slice coverage - 65.92%

710 - 110x + 110x +
      slices_hashed <- vapply(state, `[[`, character(1L), "id")
711 - 110x + 110x +
      if (any(duplicated(slices_hashed))) {
@@ -34759,28 +36100,32 @@

teal.slice coverage - 65.92%

718 - 110x + 110x +
      state_list <- isolate(private$state_list_get())
719 - 110x + 110x +
      lapply(state, function(slice) {
720 - 191x + 191x +
        state_id <- slice$id
721 - 191x + 191x +
        if (state_id %in% names(state_list)) {
@@ -34794,7 +36139,8 @@

teal.slice coverage - 65.92%

723 - 8x + 8x +
          state_list[[state_id]]$set_state(slice)
@@ -34808,7 +36154,8 @@

teal.slice coverage - 65.92%

725 - 183x + 183x +
          if (inherits(slice, "teal_slice_expr")) {
@@ -34822,7 +36169,8 @@

teal.slice coverage - 65.92%

727 - 6x + 6x +
            fstate <- init_filter_state_expr(slice)
@@ -34843,14 +36191,16 @@

teal.slice coverage - 65.92%

730 - 177x + 177x +
            fstate <- init_filter_state(
731 - 177x + 177x +
              x = data[, slice$varname, drop = TRUE],
@@ -34899,14 +36249,16 @@

teal.slice coverage - 65.92%

738 - 177x + 177x +
              x_reactive = if (private$count_type == "none") {
739 - 171x + 171x +
                reactive(NULL)
@@ -34920,7 +36272,8 @@

teal.slice coverage - 65.92%

741 - 6x + 6x +
                reactive(data_reactive(state_id)[, slice$varname, drop = TRUE])
@@ -34934,14 +36287,16 @@

teal.slice coverage - 65.92%

743 - 177x + 177x +
              slice = slice,
744 - 177x + 177x +
              extract_type = private$extract_type
@@ -34962,7 +36317,8 @@

teal.slice coverage - 65.92%

747 - 183x + 183x +
          private$state_list_push(x = fstate, state_id = state_id)
@@ -34990,7 +36346,8 @@

teal.slice coverage - 65.92%

751 - 110x + 110x +
      invisible(NULL)
@@ -35542,35 +36899,40 @@

teal.slice coverage - 65.92%

75 - 369x + 369x +
      checkmate::assert_class(x_reactive, "reactive")
76 - 368x + 368x +
      checkmate::assert_class(slice, "teal_slice")
77 - 366x + 366x +
      checkmate::assert_character(extract_type, max.len = 1, any.missing = FALSE)
78 - 366x + 366x +
      if (length(extract_type) == 1) {
79 - 53x + 53x +
        checkmate::assert_choice(extract_type, choices = c("list", "matrix"))
@@ -35598,14 +36960,16 @@

teal.slice coverage - 65.92%

83 - 365x + 365x +
      private$x <- x
84 - 365x + 365x +
      private$x_reactive <- x_reactive
@@ -35619,21 +36983,24 @@

teal.slice coverage - 65.92%

86 - 365x + 365x +
      private$na_count <- sum(is.na(x))
87 - 365x + 365x +
      private$filtered_na_count <- reactive(
88 - 365x + 365x +
        if (!is.null(private$x_reactive())) {
@@ -35668,7 +37035,8 @@

teal.slice coverage - 65.92%

93 - 365x + 365x +
      private$extract_type <- extract_type
@@ -35689,14 +37057,16 @@

teal.slice coverage - 65.92%

96 - 18x + 18x +
      if (is.null(isolate(slice$keep_na)) && anyNA(x)) slice$keep_na <- TRUE
97 - 365x + 365x +
      private$teal_slice <- slice
@@ -35710,7 +37080,8 @@

teal.slice coverage - 65.92%

99 - 365x + 365x +
      varlabel <- attr(x, "label", exact = TRUE)
@@ -35724,21 +37095,24 @@

teal.slice coverage - 65.92%

101 - 365x + 365x +
      private$varlabel <-
102 - 365x + 365x +
        if (is.null(varlabel) || identical(varlabel, private$get_varname())) {
103 - 364x + 364x +
          character(0)
@@ -35752,7 +37126,8 @@

teal.slice coverage - 65.92%

105 - 1x + 1x +
          varlabel
@@ -35773,7 +37148,8 @@

teal.slice coverage - 65.92%

108 - 365x + 365x +
      private$state_history <- reactiveVal(list())
@@ -35787,7 +37163,8 @@

teal.slice coverage - 65.92%

110 - 365x + 365x +
      logger::log_trace("Instantiated FilterState object id: { private$get_id() }")
@@ -35801,7 +37178,8 @@

teal.slice coverage - 65.92%

112 - 365x + 365x +
      invisible(self)
@@ -35885,28 +37263,32 @@

teal.slice coverage - 65.92%

124 - 68x + 68x +
      sprintf(
125 - 68x + 68x +
        "%s:\n%s",
126 - 68x + 68x +
        class(self)[1],
127 - 68x + 68x +
        format(self$get_state(), show_all = show_all, trim_lines = trim_lines)
@@ -35976,7 +37358,8 @@

teal.slice coverage - 65.92%

137 - 14x + 14x +
      cat(isolate(self$format(...)))
@@ -36067,21 +37450,24 @@

teal.slice coverage - 65.92%

150 - 89x + 89x +
      checkmate::assert_class(state, "teal_slice")
151 - 88x + 88x +
      if (private$is_fixed()) {
152 - 1x + 1x +
        warning("attempt to set state on fixed filter aborted id: ", private$get_id())
@@ -36095,28 +37481,32 @@

teal.slice coverage - 65.92%

154 - 87x + 87x +
        logger::log_trace("{ class(self)[1] }$set_state setting state of filter id: { private$get_id() }")
155 - 87x + 87x +
        isolate({
156 - 87x + 87x +
          if (!is.null(state$selected)) {
157 - 78x + 78x +
            private$set_selected(state$selected)
@@ -36130,14 +37520,16 @@

teal.slice coverage - 65.92%

159 - 75x + 75x +
          if (!is.null(state$keep_na)) {
160 - 16x + 16x +
            private$set_keep_na(state$keep_na)
@@ -36151,14 +37543,16 @@

teal.slice coverage - 65.92%

162 - 75x + 75x +
          if (!is.null(state$keep_inf)) {
163 - 9x + 9x +
            private$set_keep_inf(state$keep_inf)
@@ -36172,35 +37566,40 @@

teal.slice coverage - 65.92%

165 - 75x + 75x +
          current_state <- sprintf(
166 - 75x + 75x +
            "selected: %s; keep_na: %s; keep_inf: %s",
167 - 75x + 75x +
            toString(private$get_selected()),
168 - 75x + 75x +
            private$get_keep_na(),
169 - 75x + 75x +
            private$get_keep_inf()
@@ -36235,7 +37634,8 @@

teal.slice coverage - 65.92%

174 - 76x + 76x +
      invisible(self)
@@ -36305,7 +37705,8 @@

teal.slice coverage - 65.92%

184 - 747x + 747x +
      private$teal_slice
@@ -36375,7 +37776,8 @@

teal.slice coverage - 65.92%

194 - 1x + 1x +
      stop("this is a virtual method")
@@ -36459,42 +37861,48 @@

teal.slice coverage - 65.92%

206 - 12x + 12x +
      moduleServer(
207 - 12x + 12x +
        id = id,
208 - 12x + 12x +
        function(input, output, session) {
209 - 12x + 12x +
          logger::log_trace("FilterState$server initializing module for slice: { private$get_id() } ")
210 - 12x + 12x +
          private$server_summary("summary")
211 - 12x + 12x +
          if (private$is_fixed()) {
@@ -36515,7 +37923,8 @@

teal.slice coverage - 65.92%

214 - 12x + 12x +
            private$server_inputs("inputs")
@@ -36536,49 +37945,56 @@

teal.slice coverage - 65.92%

217 - 12x + 12x +
          private$observers$state <- observeEvent(
218 - 12x + 12x +
            eventExpr = list(private$get_selected(), private$get_keep_na(), private$get_keep_inf()),
219 - 12x + 12x +
            handlerExpr = {
220 - 4x + 4x +
              current_state <- as.list(self$get_state())
221 - 4x + 4x +
              history <- private$state_history()
222 - 4x + 4x +
              history_update <- c(history, list(current_state))
223 - 4x + 4x +
              private$state_history(history_update)
@@ -36606,21 +38022,24 @@

teal.slice coverage - 65.92%

227 - 12x + 12x +
          private$observers$back <- observeEvent(
228 - 12x + 12x +
            eventExpr = input$back,
229 - 12x + 12x +
            handlerExpr = {
@@ -36683,21 +38102,24 @@

teal.slice coverage - 65.92%

238 - 12x + 12x +
          private$observers$reset <- observeEvent(
239 - 12x + 12x +
            eventExpr = input$reset,
240 - 12x + 12x +
            handlerExpr = {
@@ -36753,56 +38175,64 @@

teal.slice coverage - 65.92%

248 - 12x + 12x +
          private$observers$state_history <- observeEvent(
249 - 12x + 12x +
            eventExpr = private$state_history(),
250 - 12x + 12x +
            handlerExpr = {
251 - 4x + 4x +
              shinyjs::disable(id = "back")
252 - 4x + 4x +
              shinyjs::disable(id = "reset")
253 - 4x + 4x +
              shinyjs::delay(
254 - 4x + 4x +
                ms = 100,
255 - 4x + 4x +
                expr = {
@@ -36837,21 +38267,24 @@

teal.slice coverage - 65.92%

260 - 4x + 4x +
              shinyjs::delay(
261 - 4x + 4x +
                ms = 100,
262 - 4x + 4x +
                expr = {
@@ -36907,14 +38340,16 @@

teal.slice coverage - 65.92%

270 - 12x + 12x +
          private$destroy_shiny <- function() {
271 - 8x + 8x +
            logger::log_trace("Destroying FilterState inputs and observers; id: { private$get_id() }")
@@ -36928,7 +38363,8 @@

teal.slice coverage - 65.92%

273 - 8x + 8x +
            lapply(session$ns(names(input)), .subset2(input, "impl")$.values$remove)
@@ -36949,7 +38385,8 @@

teal.slice coverage - 65.92%

276 - 8x + 8x +
            lapply(private$observers, function(x) x$destroy())
@@ -36970,7 +38407,8 @@

teal.slice coverage - 65.92%

279 - 12x + 12x +
          reactive(input$remove)
@@ -37054,7 +38492,8 @@

teal.slice coverage - 65.92%

291 - 12x + 12x +
      ns <- NS(id)
@@ -37110,84 +38549,96 @@

teal.slice coverage - 65.92%

299 - 12x + 12x +
      tags$div(
300 - 12x + 12x +
        id = id,
301 - 12x + 12x +
        class = "panel filter-card",
302 - 12x + 12x +
        include_js_files("count-bar-labels.js"),
303 - 12x + 12x +
        tags$div(
304 - 12x + 12x +
          class = "filter-card-header",
305 - 12x + 12x +
          `data-toggle` = "collapse",
306 - 12x + 12x +
          `data-bs-toggle` = "collapse",
307 - 12x + 12x +
          href = paste0("#", ns("body")),
308 - 12x + 12x +
          tags$div(
309 - 12x + 12x +
            class = "filter-card-title",
310 - 12x + 12x +
            if (private$is_anchored() && private$is_fixed()) {
@@ -37201,7 +38652,8 @@

teal.slice coverage - 65.92%

312 - 12x + 12x +
            } else if (private$is_anchored() && !private$is_fixed()) {
@@ -37215,7 +38667,8 @@

teal.slice coverage - 65.92%

314 - 12x + 12x +
            } else if (!private$is_anchored() && private$is_fixed()) {
@@ -37236,28 +38689,32 @@

teal.slice coverage - 65.92%

317 - 12x + 12x +
            tags$div(class = "filter-card-varname", tags$strong(private$get_varname())),
318 - 12x + 12x +
            tags$div(class = "filter-card-varlabel", private$get_varlabel()),
319 - 12x + 12x +
            tags$div(
320 - 12x + 12x +
              class = "filter-card-controls",
@@ -37278,7 +38735,8 @@

teal.slice coverage - 65.92%

323 - 12x + 12x +
              onclick = "event.stopPropagation();event.preventDefault();",
@@ -37292,70 +38750,80 @@

teal.slice coverage - 65.92%

325 - 12x + 12x +
              `data-bs-toggle` = "collapse",
326 - 12x + 12x +
              `data-bs-target` = NULL,
327 - 12x + 12x +
              if (isFALSE(private$is_fixed())) {
328 - 12x + 12x +
                actionLink(
329 - 12x + 12x +
                  inputId = ns("back"),
330 - 12x + 12x +
                  label = NULL,
331 - 12x + 12x +
                  icon = icon("circle-arrow-left", lib = "font-awesome"),
332 - 12x + 12x +
                  title = "Rewind state",
333 - 12x + 12x +
                  class = "filter-card-back",
334 - 12x + 12x +
                  style = "display: none"
@@ -37376,56 +38844,64 @@

teal.slice coverage - 65.92%

337 - 12x + 12x +
              if (isFALSE(private$is_fixed())) {
338 - 12x + 12x +
                actionLink(
339 - 12x + 12x +
                  inputId = ns("reset"),
340 - 12x + 12x +
                  label = NULL,
341 - 12x + 12x +
                  icon = icon("circle-arrow-up", lib = "font-awesome"),
342 - 12x + 12x +
                  title = "Restore original state",
343 - 12x + 12x +
                  class = "filter-card-back",
344 - 12x + 12x +
                  style = "display: none"
@@ -37446,42 +38922,48 @@

teal.slice coverage - 65.92%

347 - 12x + 12x +
              if (isFALSE(private$is_anchored())) {
348 - 12x + 12x +
                actionLink(
349 - 12x + 12x +
                  inputId = ns("remove"),
350 - 12x + 12x +
                  label = icon("circle-xmark", lib = "font-awesome"),
351 - 12x + 12x +
                  title = "Remove filter",
352 - 12x + 12x +
                  class = "filter-card-remove"
@@ -37516,7 +38998,8 @@

teal.slice coverage - 65.92%

357 - 12x + 12x +
          tags$div(class = "filter-card-summary", private$ui_summary(ns("summary")))
@@ -37530,56 +39013,64 @@

teal.slice coverage - 65.92%

359 - 12x + 12x +
        tags$div(
360 - 12x + 12x +
          id = ns("body"),
361 - 12x + 12x +
          class = "collapse out",
362 - 12x + 12x +
          `data-parent` = paste0("#", parent_id),
363 - 12x + 12x +
          `data-bs-parent` = paste0("#", parent_id),
364 - 12x + 12x +
          tags$div(
365 - 12x + 12x +
            class = "filter-card-body",
366 - 12x + 12x +
            if (private$is_fixed()) {
@@ -37600,7 +39091,8 @@

teal.slice coverage - 65.92%

369 - 12x + 12x +
              private$ui_inputs(ns("inputs"))
@@ -37691,14 +39183,16 @@

teal.slice coverage - 65.92%

382 - 47x + 47x +
      if (!is.null(private$destroy_shiny)) {
383 - 8x + 8x +
        private$destroy_shiny()
@@ -37992,35 +39486,40 @@

teal.slice coverage - 65.92%

425 - 421x + 421x +
      logger::log_trace(
426 - 421x + 421x +
        sprintf(
427 - 421x + 421x +
          "%s$set_selected setting selection of id: %s",
428 - 421x + 421x +
          class(self)[1],
429 - 421x + 421x +
          private$get_id()
@@ -38041,35 +39540,40 @@

teal.slice coverage - 65.92%

432 - 421x + 421x +
      isolate({
433 - 421x + 421x +
        value <- private$cast_and_validate(value)
434 - 410x + 410x +
        value <- private$check_length(value)
435 - 404x + 404x +
        value <- private$remove_out_of_bounds_values(value)
436 - 404x + 404x +
        private$teal_slice$selected <- value
@@ -38083,35 +39587,40 @@

teal.slice coverage - 65.92%

438 - 404x + 404x +
      logger::log_trace(
439 - 404x + 404x +
        sprintf(
440 - 404x + 404x +
          "%s$set_selected selection of id: %s",
441 - 404x + 404x +
          class(self)[1],
442 - 404x + 404x +
          private$get_id()
@@ -38139,7 +39648,8 @@

teal.slice coverage - 65.92%

446 - 404x + 404x +
      invisible(NULL)
@@ -38223,56 +39733,64 @@

teal.slice coverage - 65.92%

458 - 16x + 16x +
      checkmate::assert_flag(value)
459 - 16x + 16x +
      private$teal_slice$keep_na <- value
460 - 16x + 16x +
      logger::log_trace(
461 - 16x + 16x +
        sprintf(
462 - 16x + 16x +
          "%s$set_keep_na set for filter %s to %s.",
463 - 16x + 16x +
          class(self)[1],
464 - 16x + 16x +
          private$get_id(),
465 - 16x + 16x +
          value
@@ -38293,7 +39811,8 @@

teal.slice coverage - 65.92%

468 - 16x + 16x +
      invisible(NULL)
@@ -38377,56 +39896,64 @@

teal.slice coverage - 65.92%

480 - 9x + 9x +
      checkmate::assert_flag(value)
481 - 9x + 9x +
      private$teal_slice$keep_inf <- value
482 - 9x + 9x +
      logger::log_trace(
483 - 9x + 9x +
        sprintf(
484 - 9x + 9x +
          "%s$set_keep_inf of filter %s set to %s",
485 - 9x + 9x +
          class(self)[1],
486 - 9x + 9x +
          private$get_id(),
487 - 9x + 9x +
          value
@@ -38454,7 +39981,8 @@

teal.slice coverage - 65.92%

491 - 9x + 9x +
      invisible(NULL)
@@ -38517,7 +40045,8 @@

teal.slice coverage - 65.92%

500 - 88x + 88x +
      isolate(private$teal_slice$dataname)
@@ -38566,7 +40095,8 @@

teal.slice coverage - 65.92%

507 - 166x + 166x +
      isolate(private$teal_slice$varname)
@@ -38615,7 +40145,8 @@

teal.slice coverage - 65.92%

514 - 4x + 4x +
      isolate(private$teal_slice$id)
@@ -38671,7 +40202,8 @@

teal.slice coverage - 65.92%

522 - 772x + 772x +
      isolate(private$teal_slice$choices)
@@ -38727,7 +40259,8 @@

teal.slice coverage - 65.92%

530 - 364x + 364x +
      private$teal_slice$selected
@@ -38776,7 +40309,8 @@

teal.slice coverage - 65.92%

537 - 129x + 129x +
      private$teal_slice$keep_na
@@ -38825,7 +40359,8 @@

teal.slice coverage - 65.92%

544 - 117x + 117x +
      private$teal_slice$keep_inf
@@ -38867,7 +40402,8 @@

teal.slice coverage - 65.92%

550 - 148x + 148x +
      isolate(isTRUE(private$teal_slice$fixed))
@@ -38909,7 +40445,8 @@

teal.slice coverage - 65.92%

556 - 48x + 48x +
      isolate(isTRUE(private$teal_slice$anchored))
@@ -38951,7 +40488,8 @@

teal.slice coverage - 65.92%

562 - 217x + 217x +
      isolate(isTRUE(private$teal_slice$multiple))
@@ -39014,7 +40552,8 @@

teal.slice coverage - 65.92%

571 - 12x + 12x +
      private$varlabel
@@ -39063,49 +40602,56 @@

teal.slice coverage - 65.92%

578 - 109x + 109x +
      varname <- private$get_varname()
579 - 109x + 109x +
      varname_backticked <- sprintf("`%s`", varname)
580 - 109x + 109x +
      ans <-
581 - 109x + 109x +
        if (isTRUE(private$extract_type == "list")) {
582 - 16x + 16x +
          sprintf("%s$%s", dataname, varname_backticked)
583 - 109x + 109x +
        } else if (isTRUE(private$extract_type == "matrix")) {
584 - 7x + 7x +
          sprintf("%s[, \"%s\"]", dataname, varname)
@@ -39119,7 +40665,8 @@

teal.slice coverage - 65.92%

586 - 86x + 86x +
          varname_backticked
@@ -39133,7 +40680,8 @@

teal.slice coverage - 65.92%

588 - 109x + 109x +
      str2lang(ans)
@@ -39203,14 +40751,16 @@

teal.slice coverage - 65.92%

598 - 108x + 108x +
      if (private$na_count == 0L) {
599 - 87x + 87x +
        return(filter_call)
@@ -39231,42 +40781,48 @@

teal.slice coverage - 65.92%

602 - 21x + 21x +
      if (is.null(filter_call) && isFALSE(private$get_keep_na())) {
603 - 2x + 2x +
        call("!", call("is.na", varname))
604 - 19x + 19x +
      } else if (!is.null(filter_call) && isTRUE(private$get_keep_na())) {
605 - 12x + 12x +
        call("|", call("is.na", varname), filter_call)
606 - 7x + 7x +
      } else if (!is.null(filter_call) && isFALSE(private$get_keep_na())) {
607 - 7x + 7x +
        call("&", call("!", call("is.na", varname)), filter_call)
@@ -39343,7 +40899,8 @@

teal.slice coverage - 65.92%

618 - 11x + 11x +
      values
@@ -39378,7 +40935,8 @@

teal.slice coverage - 65.92%

623 - 11x + 11x +
      values
@@ -39441,7 +40999,8 @@

teal.slice coverage - 65.92%

632 - 31x + 31x +
      values
@@ -39539,42 +41098,48 @@

teal.slice coverage - 65.92%

646 - 75x + 75x +
      if (private$is_choice_limited) {
647 - 3x + 3x +
        TRUE
648 - 72x + 72x +
      } else if (!setequal(private$get_selected(), private$get_choices())) {
649 - 59x + 59x +
        TRUE
650 - 13x + 13x +
      } else if (!isTRUE(private$get_keep_na()) && private$na_count > 0) {
651 - 4x + 4x +
        TRUE
@@ -39588,7 +41153,8 @@

teal.slice coverage - 65.92%

653 - 9x + 9x +
        FALSE
@@ -39658,14 +41224,16 @@

teal.slice coverage - 65.92%

663 - 12x + 12x +
      ns <- NS(id)
664 - 12x + 12x +
      uiOutput(ns("summary"), class = "filter-card-summary")
@@ -39721,28 +41289,32 @@

teal.slice coverage - 65.92%

672 - 12x + 12x +
      moduleServer(
673 - 12x + 12x +
        id = id,
674 - 12x + 12x +
        function(input, output, session) {
675 - 12x + 12x +
          output$summary <- renderUI(private$content_summary())
@@ -40008,14 +41580,16 @@

teal.slice coverage - 65.92%

713 - 11x + 11x +
      ns <- NS(id)
714 - 11x + 11x +
      if (private$na_count > 0) {
@@ -40169,7 +41743,8 @@

teal.slice coverage - 65.92%

736 - 11x + 11x +
        NULL
@@ -40246,7 +41821,8 @@

teal.slice coverage - 65.92%

747 - 12x + 12x +
      moduleServer(id, function(input, output, session) {
@@ -40274,42 +41850,48 @@

teal.slice coverage - 65.92%

751 - 12x + 12x +
        output$trigger_visible <- renderUI({
752 - 12x + 12x +
          updateCountText(
753 - 12x + 12x +
            inputId = "count_label",
754 - 12x + 12x +
            label = "Keep NA",
755 - 12x + 12x +
            countmax = private$na_count,
756 - 12x + 12x +
            countnow = private$filtered_na_count()
@@ -40323,7 +41905,8 @@

teal.slice coverage - 65.92%

758 - 12x + 12x +
          NULL
@@ -40365,35 +41948,40 @@

teal.slice coverage - 65.92%

764 - 12x + 12x +
        private$observers$keep_na_api <- observeEvent(
765 - 12x + 12x +
          ignoreNULL = FALSE, # nothing selected is possible for NA
766 - 12x + 12x +
          ignoreInit = TRUE, # ignoreInit: should not matter because we set the UI with the desired initial state
767 - 12x + 12x +
          eventExpr = private$get_keep_na(),
768 - 12x + 12x +
          handlerExpr = {
@@ -40470,35 +42058,40 @@

teal.slice coverage - 65.92%

779 - 12x + 12x +
        private$observers$keep_na <- observeEvent(
780 - 12x + 12x +
          ignoreNULL = FALSE, # ignoreNULL: we don't want to ignore NULL when nothing is selected in the `selectInput`
781 - 12x + 12x +
          ignoreInit = TRUE, # ignoreInit: should not matter because we set the UI with the desired initial state
782 - 12x + 12x +
          eventExpr = input$value,
783 - 12x + 12x +
          handlerExpr = {
@@ -40568,7 +42161,8 @@

teal.slice coverage - 65.92%

793 - 12x + 12x +
        invisible(NULL)
@@ -40847,7 +42441,8 @@

teal.slice coverage - 65.92%

35 - 92x + 92x +
      if (!requireNamespace("SummarizedExperiment", quietly = TRUE)) {
@@ -40868,35 +42463,40 @@

teal.slice coverage - 65.92%

38 - 92x + 92x +
      checkmate::assert_function(data_reactive, args = "sid")
39 - 92x + 92x +
      checkmate::assert_class(data, "SummarizedExperiment")
40 - 91x + 91x +
      super$initialize(data, data_reactive, dataname, datalabel)
41 - 91x + 91x +
      if (!is.null(datalabel)) {
42 - 84x + 84x +
        private$dataname_prefixed <- sprintf("%s[['%s']]", dataname, datalabel)
@@ -40987,35 +42587,40 @@

teal.slice coverage - 65.92%

55 - 61x + 61x +
      isolate({
56 - 61x + 61x +
        logger::log_trace("{ class(self)[1] }$set_filter_state initializing, dataname: { private$dataname }")
57 - 61x + 61x +
        checkmate::assert_class(state, "teal_slices")
58 - 59x + 59x +
        lapply(state, function(x) {
59 - 17x + 17x +
          checkmate::assert_choice(x$arg, choices = c("subset", "select"), null.ok = TRUE, .var.name = "teal_slice$arg")
@@ -41029,21 +42634,24 @@

teal.slice coverage - 65.92%

61 - 59x + 59x +
        count_type <- attr(state, "count_type")
62 - 59x + 59x +
        if (length(count_type)) {
63 - 8x + 8x +
          private$count_type <- count_type
@@ -41064,35 +42672,40 @@

teal.slice coverage - 65.92%

66 - 59x + 59x +
        subset_states <- Filter(function(x) x$arg == "subset", state)
67 - 59x + 59x +
        private$set_filter_state_impl(
68 - 59x + 59x +
          state = subset_states,
69 - 59x + 59x +
          data = SummarizedExperiment::rowData(private$data),
70 - 59x + 59x +
          data_reactive = function(sid = "") {
@@ -41148,35 +42761,40 @@

teal.slice coverage - 65.92%

78 - 59x + 59x +
        select_states <- Filter(function(x) x$arg == "select", state)
79 - 59x + 59x +
        private$set_filter_state_impl(
80 - 59x + 59x +
          state = select_states,
81 - 59x + 59x +
          data = SummarizedExperiment::colData(private$data),
82 - 59x + 59x +
          data_reactive = function(sid = "") {
@@ -41232,14 +42850,16 @@

teal.slice coverage - 65.92%

90 - 59x + 59x +
        logger::log_trace("{ class(self)[1] }$set_filter_state initialized, dataname: { private$dataname }")
91 - 59x + 59x +
        invisible(NULL)
@@ -41309,49 +42929,56 @@

teal.slice coverage - 65.92%

101 - 2x + 2x +
      data <- private$data
102 - 2x + 2x +
      checkmate::assert_string(id)
103 - 2x + 2x +
      ns <- NS(id)
104 - 2x + 2x +
      row_input <- if (ncol(SummarizedExperiment::rowData(data)) == 0) {
105 - 1x + 1x +
        tags$div("no sample variables available")
106 - 2x + 2x +
      } else if (nrow(SummarizedExperiment::rowData(data)) == 0) {
107 - 1x + 1x +
        tags$div("no samples available")
@@ -41435,28 +43062,32 @@

teal.slice coverage - 65.92%

119 - 2x + 2x +
      col_input <- if (ncol(SummarizedExperiment::colData(data)) == 0) {
120 - 1x + 1x +
        tags$div("no sample variables available")
121 - 2x + 2x +
      } else if (nrow(SummarizedExperiment::colData(data)) == 0) {
122 - 1x + 1x +
        tags$div("no samples available")
@@ -41540,21 +43171,24 @@

teal.slice coverage - 65.92%

134 - 2x + 2x +
      tags$div(
135 - 2x + 2x +
        row_input,
136 - 2x + 2x +
        col_input
@@ -42974,7 +44608,8 @@

teal.slice coverage - 65.92%

33 - 153x + 153x +
      logger::log_trace("Instantiating { class(self)[1] }, dataname: { dataname }")
@@ -42995,21 +44630,24 @@

teal.slice coverage - 65.92%

36 - 153x + 153x +
      check_simple_name(dataname)
37 - 151x + 151x +
      checkmate::assert_character(keys, any.missing = FALSE)
38 - 151x + 151x +
      checkmate::assert_character(label, null.ok = TRUE)
@@ -43023,35 +44661,40 @@

teal.slice coverage - 65.92%

40 - 151x + 151x +
      logger::log_trace("Instantiating { class(self)[1] }, dataname: { dataname }")
41 - 151x + 151x +
      private$dataset <- dataset
42 - 151x + 151x +
      private$dataname <- dataname
43 - 151x + 151x +
      private$keys <- keys
44 - 151x + 151x +
      private$label <- if (is.null(label)) character(0) else label
@@ -43072,28 +44715,32 @@

teal.slice coverage - 65.92%

47 - 151x + 151x +
      private$data_filtered_fun <- function(sid = "") {
48 - 24x + 24x +
        checkmate::assert_character(sid)
49 - 24x + 24x +
        if (length(sid)) {
50 - 24x + 24x +
          logger::log_trace("filtering data dataname: { dataname }, sid: { sid }")
@@ -43121,35 +44768,40 @@

teal.slice coverage - 65.92%

54 - 24x + 24x +
        env <- new.env(parent = parent.env(globalenv()))
55 - 24x + 24x +
        env[[dataname]] <- private$dataset
56 - 24x + 24x +
        filter_call <- self$get_call(sid)
57 - 24x + 24x +
        eval_expr_with_msg(filter_call, env)
58 - 24x + 24x +
        get(x = dataname, envir = env)
@@ -43170,21 +44822,24 @@

teal.slice coverage - 65.92%

61 - 151x + 151x +
      private$data_filtered <- reactive(private$data_filtered_fun())
62 - 151x + 151x +
      logger::log_trace("Instantiated { class(self)[1] }, dataname: { private$dataname }")
63 - 151x + 151x +
      invisible(self)
@@ -43268,28 +44923,32 @@

teal.slice coverage - 65.92%

75 - 24x + 24x +
      sprintf(
76 - 24x + 24x +
        "%s:\n%s",
77 - 24x + 24x +
        class(self)[1],
78 - 24x + 24x +
        format(self$get_filter_state(), show_all = show_all, trim_lines = trim_lines)
@@ -43359,7 +45018,8 @@

teal.slice coverage - 65.92%

88 - 10x + 10x +
      cat(isolate(self$format(...)), "\n")
@@ -43436,28 +45096,32 @@

teal.slice coverage - 65.92%

99 - 14x + 14x +
      logger::log_trace("Removing filters from FilteredDataset: { deparse1(self$get_dataname()) }")
100 - 14x + 14x +
      lapply(
101 - 14x + 14x +
        private$get_filter_states(),
102 - 14x + 14x +
        function(filter_states) filter_states$clear_filter_states(force)
@@ -43471,14 +45135,16 @@

teal.slice coverage - 65.92%

104 - 14x + 14x +
      logger::log_trace("Removed filters from FilteredDataset: { deparse1(self$get_dataname()) }")
105 - 14x + 14x +
      NULL
@@ -43611,21 +45277,24 @@

teal.slice coverage - 65.92%

124 - 47x + 47x +
      filter_call <- Filter(
125 - 47x + 47x +
        f = Negate(is.null),
126 - 47x + 47x +
        x = lapply(private$get_filter_states(), function(x) x$get_call(sid))
@@ -43639,14 +45308,16 @@

teal.slice coverage - 65.92%

128 - 47x + 47x +
      if (length(filter_call) == 0) {
129 - 29x + 29x +
        return(NULL)
@@ -43660,7 +45331,8 @@

teal.slice coverage - 65.92%

131 - 18x + 18x +
      filter_call
@@ -43723,14 +45395,16 @@

teal.slice coverage - 65.92%

140 - 184x + 184x +
      states <- unname(lapply(private$get_filter_states(), function(x) x$get_filter_state()))
141 - 184x + 184x +
      do.call(c, states)
@@ -43856,7 +45530,8 @@

teal.slice coverage - 65.92%

159 - 16x + 16x +
      length(self$get_filter_state())
@@ -43912,7 +45587,8 @@

teal.slice coverage - 65.92%

167 - 8x + 8x +
      private$dataname
@@ -44003,14 +45679,16 @@

teal.slice coverage - 65.92%

180 - 51x + 51x +
      if (filtered) {
181 - 33x + 33x +
        private$data_filtered
@@ -44024,7 +45702,8 @@

teal.slice coverage - 65.92%

183 - 18x + 18x +
        private$dataset
@@ -44129,7 +45808,8 @@

teal.slice coverage - 65.92%

198 - 133x + 133x +
      private$keys
@@ -44178,7 +45858,8 @@

teal.slice coverage - 65.92%

205 - 2x + 2x +
      private$label
@@ -44724,77 +46405,88 @@

teal.slice coverage - 65.92%

283 - 7x + 7x +
      moduleServer(
284 - 7x + 7x +
        id = id,
285 - 7x + 7x +
        function(input, output, session) {
286 - 7x + 7x +
          dataname <- self$get_dataname()
287 - 7x + 7x +
          logger::log_trace("FilteredDataset$srv_active initializing, dataname: { dataname }")
288 - 7x + 7x +
          checkmate::assert_string(dataname)
289 - 7x + 7x +
          output$filter_count <- renderText(
290 - 7x + 7x +
            sprintf(
291 - 7x + 7x +
              "%d filter%s applied",
292 - 7x + 7x +
              self$get_filter_count(),
293 - 7x + 7x +
              if (self$get_filter_count() != 1) "s" else ""
@@ -44822,28 +46514,32 @@

teal.slice coverage - 65.92%

297 - 7x + 7x +
          lapply(
298 - 7x + 7x +
            names(private$get_filter_states()),
299 - 7x + 7x +
            function(x) {
300 - 12x + 12x +
              private$get_filter_states()[[x]]$srv_active(id = x)
@@ -44871,35 +46567,40 @@

teal.slice coverage - 65.92%

304 - 7x + 7x +
          observeEvent(self$get_filter_state(), {
305 - 8x + 8x +
            shinyjs::hide("filter_count_ui")
306 - 8x + 8x +
            shinyjs::show("filters")
307 - 8x + 8x +
            shinyjs::toggle("remove_filters", condition = length(self$get_filter_state()) != 0)
308 - 8x + 8x +
            shinyjs::toggle("collapse", condition = length(self$get_filter_state()) != 0)
@@ -44920,7 +46621,8 @@

teal.slice coverage - 65.92%

311 - 7x + 7x +
          observeEvent(input$collapse, {
@@ -44962,28 +46664,32 @@

teal.slice coverage - 65.92%

317 - 7x + 7x +
          observeEvent(input$remove_filters, {
318 - 1x + 1x +
            logger::log_trace("FilteredDataset$srv_active@1 removing all non-anchored filters, dataname: { dataname }")
319 - 1x + 1x +
            self$clear_filter_states()
320 - 1x + 1x +
            logger::log_trace("FilteredDataset$srv_active@1 removed all non-anchored filters, dataname: { dataname }")
@@ -45004,7 +46710,8 @@

teal.slice coverage - 65.92%

323 - 7x + 7x +
          logger::log_trace("FilteredDataset$initialized, dataname: { dataname }")
@@ -45018,7 +46725,8 @@

teal.slice coverage - 65.92%

325 - 7x + 7x +
          NULL
@@ -45109,7 +46817,8 @@

teal.slice coverage - 65.92%

338 - 1x + 1x +
      stop("Pure virtual method")
@@ -45207,63 +46916,72 @@

teal.slice coverage - 65.92%

352 - 2x + 2x +
      moduleServer(
353 - 2x + 2x +
        id = id,
354 - 2x + 2x +
        function(input, output, session) {
355 - 2x + 2x +
          logger::log_trace("MAEFilteredDataset$srv_add initializing, dataname: { deparse1(self$get_dataname()) }")
356 - 2x + 2x +
          elems <- private$get_filter_states()
357 - 2x + 2x +
          elem_names <- names(private$get_filter_states())
358 - 2x + 2x +
          lapply(
359 - 2x + 2x +
            elem_names,
360 - 2x + 2x +
            function(elem_name) elems[[elem_name]]$srv_add(elem_name)
@@ -45277,14 +46995,16 @@

teal.slice coverage - 65.92%

362 - 2x + 2x +
          logger::log_trace("MAEFilteredDataset$srv_add initialized, dataname: { deparse1(self$get_dataname()) }")
363 - 2x + 2x +
          NULL
@@ -45424,28 +47144,32 @@

teal.slice coverage - 65.92%

383 - 225x + 225x +
      checkmate::assert_class(filter_states, "FilterStates")
384 - 225x + 225x +
      checkmate::assert_string(id)
385 - 225x + 225x +
      x <- stats::setNames(list(filter_states), id)
386 - 225x + 225x +
      private$filter_states <- c(private$get_filter_states(), x)
@@ -45494,7 +47218,8 @@

teal.slice coverage - 65.92%

393 - 684x + 684x +
      private$filter_states
@@ -45962,42 +47687,48 @@

teal.slice coverage - 65.92%

63 - 6x + 6x +
      isolate({
64 - 6x + 6x +
        super$initialize(
65 - 6x + 6x +
          x = x,
66 - 6x + 6x +
          x_reactive = x_reactive,
67 - 6x + 6x +
          slice = slice,
68 - 6x + 6x +
          extract_type = extract_type
@@ -46011,14 +47742,16 @@

teal.slice coverage - 65.92%

70 - 6x + 6x +
        private$set_choices(slice$choices)
71 - 6x + 6x +
        private$set_selected(slice$selected)
@@ -46039,7 +47772,8 @@

teal.slice coverage - 65.92%

74 - 6x + 6x +
      invisible(self)
@@ -46109,14 +47843,16 @@

teal.slice coverage - 65.92%

84 - 2x + 2x +
      if (isFALSE(private$is_any_filtered())) {
85 - 1x + 1x +
        return(NULL)
@@ -46130,14 +47866,16 @@

teal.slice coverage - 65.92%

87 - 1x + 1x +
      if (missing(dataname)) dataname <- private$get_dataname()
88 - 1x + 1x +
      filter_call <- if (isTRUE(private$get_keep_na())) {
@@ -46158,7 +47896,8 @@

teal.slice coverage - 65.92%

91 - 1x + 1x +
        substitute(!is.na(varname), list(varname = private$get_varname_prefixed(dataname)))
@@ -46270,14 +48009,16 @@

teal.slice coverage - 65.92%

107 - 6x + 6x +
      private$teal_slice$choices <- choices
108 - 6x + 6x +
      invisible(NULL)
@@ -46333,7 +48074,8 @@

teal.slice coverage - 65.92%

116 - 2x + 2x +
      if (private$is_choice_limited) {
@@ -46354,7 +48096,8 @@

teal.slice coverage - 65.92%

119 - 2x + 2x +
        !isTRUE(private$get_keep_na())
@@ -47256,42 +48999,48 @@

teal.slice coverage - 65.92%

75 - 25x + 25x +
  checkmate::assert_string(inputId)
76 - 21x + 21x +
  checkmate::assert_vector(choices)
77 - 20x + 20x +
  checkmate::assert_numeric(countsmax, len = length(choices))
78 - 17x + 17x +
  checkmate::assert_numeric(countsnow, len = length(choices), null.ok = TRUE)
79 - 15x + 15x +
  if (!is.null(countsnow)) {
80 - 7x + 7x +
    checkmate::assert_true(all(countsnow <= countsmax))
@@ -47312,7 +49061,8 @@

teal.slice coverage - 65.92%

83 - 14x + 14x +
  ns <- NS(inputId)
@@ -47326,56 +49076,64 @@

teal.slice coverage - 65.92%

85 - 14x + 14x +
  mapply(
86 - 14x + 14x +
    countBar,
87 - 14x + 14x +
    inputId = ns(seq_along(choices)),
88 - 14x + 14x +
    label = as.character(choices),
89 - 14x + 14x +
    countmax = countsmax,
90 - 14x + 14x +
    countnow = if (is.null(countsnow)) rep(list(NULL), length(choices)) else countsnow,
91 - 14x + 14x +
    MoreArgs = list(
92 - 14x + 14x +
      counttotal = sum(countsmax)
@@ -47389,7 +49147,8 @@

teal.slice coverage - 65.92%

94 - 14x + 14x +
    SIMPLIFY = FALSE, USE.NAMES = FALSE
@@ -47564,35 +49323,40 @@

teal.slice coverage - 65.92%

119 - 61x + 61x +
  checkmate::assert_string(inputId)
120 - 57x + 57x +
  checkmate::assert_string(label)
121 - 54x + 54x +
  checkmate::assert_number(countmax)
122 - 51x + 51x +
  checkmate::assert_number(countnow, null.ok = TRUE, upper = countmax)
123 - 49x + 49x +
  checkmate::assert_number(counttotal, lower = countmax)
@@ -47606,35 +49370,40 @@

teal.slice coverage - 65.92%

125 - 47x + 47x +
  label <- make_count_text(label, countmax = countmax, countnow = countnow)
126 - 47x + 47x +
  ns <- NS(inputId)
127 - 24x + 24x +
  if (is.null(countnow)) countnow <- 0
128 - 47x + 47x +
  tags$div(
129 - 47x + 47x +
    class = "progress state-count-container",
@@ -47648,42 +49417,48 @@

teal.slice coverage - 65.92%

131 - 47x + 47x +
    tags$div(
132 - 47x + 47x +
      id = ns("count_bar_filtered"),
133 - 47x + 47x +
      class = "progress-bar state-count-bar-filtered",
134 - 47x + 47x +
      style = sprintf("width: %s%%", countnow / counttotal * 100),
135 - 47x + 47x +
      role = "progressbar",
136 - 47x + 47x +
      label
@@ -47697,35 +49472,40 @@

teal.slice coverage - 65.92%

138 - 47x + 47x +
    tags$div(
139 - 47x + 47x +
      id = ns("count_bar_unfiltered"),
140 - 47x + 47x +
      class = "progress-bar state-count-bar-unfiltered",
141 - 47x + 47x +
      style = sprintf("width: %s%%", (countmax - countnow) / counttotal * 100),
142 - 47x + 47x +
      role = "progressbar"
@@ -47774,28 +49554,32 @@

teal.slice coverage - 65.92%

149 - 7x + 7x +
  checkmate::assert_string(inputId)
150 - 7x + 7x +
  checkmate::assert_vector(choices)
151 - 7x + 7x +
  checkmate::assert_numeric(countsmax, len = length(choices))
152 - 7x + 7x +
  checkmate::assert_numeric(countsnow, len = length(choices), null.ok = TRUE)
@@ -47809,63 +49593,72 @@

teal.slice coverage - 65.92%

154 - 7x + 7x +
  ns <- NS(inputId)
155 - 7x + 7x +
  mapply(
156 - 7x + 7x +
    updateCountBar,
157 - 7x + 7x +
    inputId = ns(seq_along(choices)),
158 - 7x + 7x +
    label = choices,
159 - 7x + 7x +
    countmax = countsmax,
160 - 7x + 7x +
    countnow = if (is.null(countsnow)) rep(list(NULL), length(choices)) else countsnow,
161 - 7x + 7x +
    MoreArgs = list(
162 - 7x + 7x +
      counttotal = sum(countsmax)
@@ -47886,7 +49679,8 @@

teal.slice coverage - 65.92%

165 - 6x + 6x +
  invisible(NULL)
@@ -47921,35 +49715,40 @@

teal.slice coverage - 65.92%

170 - 17x + 17x +
  checkmate::assert_string(inputId)
171 - 17x + 17x +
  checkmate::assert_string(label)
172 - 17x + 17x +
  checkmate::assert_number(countmax)
173 - 16x + 16x +
  checkmate::assert_number(countnow, null.ok = TRUE)
174 - 16x + 16x +
  checkmate::assert_number(counttotal)
@@ -47963,70 +49762,80 @@

teal.slice coverage - 65.92%

176 - 16x + 16x +
  label <- make_count_text(label, countmax = countmax, countnow = countnow)
177 - 16x + 16x +
  if (is.null(countnow)) countnow <- countmax
178 - 16x + 16x +
  session$sendCustomMessage(
179 - 16x + 16x +
    type = "updateCountBar",
180 - 16x + 16x +
    message = list(
181 - 16x + 16x +
      id = session$ns(inputId),
182 - 16x + 16x +
      label = label,
183 - 16x + 16x +
      countmax = countmax,
184 - 16x + 16x +
      countnow = countnow,
185 - 16x + 16x +
      counttotal = counttotal
@@ -48054,7 +49863,8 @@

teal.slice coverage - 65.92%

189 - 16x + 16x +
  invisible(NULL)
@@ -48089,70 +49899,80 @@

teal.slice coverage - 65.92%

194 - 17x + 17x +
  checkmate::assert_string(inputId)
195 - 17x + 17x +
  checkmate::assert_string(label)
196 - 17x + 17x +
  checkmate::assert_number(countmax)
197 - 17x + 17x +
  checkmate::assert_number(countnow, null.ok = TRUE)
198 - 17x + 17x +
  label <- make_count_text(label, countmax = countmax, countnow = countnow)
199 - 17x + 17x +
  session$sendCustomMessage(
200 - 17x + 17x +
    type = "updateCountText",
201 - 17x + 17x +
    message = list(
202 - 17x + 17x +
      id = session$ns(inputId),
203 - 17x + 17x +
      label = label
@@ -48292,56 +50112,64 @@

teal.slice coverage - 65.92%

223 - 92x + 92x +
  checkmate::assert_string(label)
224 - 90x + 90x +
  checkmate::assert_number(countmax)
225 - 88x + 88x +
  checkmate::assert_number(countnow, null.ok = TRUE)
226 - 86x + 86x +
  sprintf(
227 - 86x + 86x +
    "%s (%s%s)",
228 - 86x + 86x +
    label,
229 - 86x + 86x +
    if (is.null(countnow)) "" else sprintf("%s/", countnow),
230 - 86x + 86x +
    countmax
@@ -48648,7 +50476,8 @@

teal.slice coverage - 65.92%

41 - 24x + 24x +
      super$initialize(dataset = dataset, dataname = dataname, label = label)
@@ -48732,35 +50561,40 @@

teal.slice coverage - 65.92%

53 - 4x + 4x +
      class_string <- toString(class(private$dataset))
54 - 4x + 4x +
      if (trim_lines) {
55 - 2x + 2x +
        trim_position <- 37L
56 - 2x + 2x +
        class_string <- strtrim(class_string, trim_position)
57 - 2x + 2x +
        substr(class_string, 35L, 37L) <- "..."
@@ -48774,7 +50608,8 @@

teal.slice coverage - 65.92%

59 - 4x + 4x +
      sprintf(" - unfiltered dataset:\t\"%s\":   %s", private$dataname, class_string)
@@ -48816,7 +50651,8 @@

teal.slice coverage - 65.92%

65 - 1x + 1x +
      invisible(NULL)
@@ -48844,7 +50680,8 @@

teal.slice coverage - 65.92%

69 - 2x + 2x +
      invisible(NULL)
@@ -48879,14 +50716,16 @@

teal.slice coverage - 65.92%

74 - 3x + 3x +
      if (length(state) != 0L) {
75 - 1x + 1x +
        warning("DefaultFilterState cannot set state")
@@ -48900,7 +50739,8 @@

teal.slice coverage - 65.92%

77 - 3x + 3x +
      invisible(NULL)
@@ -48935,7 +50775,8 @@

teal.slice coverage - 65.92%

82 - 1x + 1x +
      invisible(NULL)
@@ -48991,7 +50832,8 @@

teal.slice coverage - 65.92%

90 - 1x + 1x +
      data.frame(dataname = private$dataname, obs = NA, obs_filtered = NA)
@@ -49676,7 +51518,8 @@

teal.slice coverage - 65.92%

64 - 229x + 229x +
  UseMethod("init_filter_states")
@@ -49753,42 +51596,48 @@

teal.slice coverage - 65.92%

75 - 100x + 100x +
  DFFilterStates$new(
76 - 100x + 100x +
    data = data,
77 - 100x + 100x +
    data_reactive = data_reactive,
78 - 100x + 100x +
    dataname = dataname,
79 - 100x + 100x +
    datalabel = datalabel,
80 - 100x + 100x +
    keys = keys
@@ -49865,35 +51714,40 @@

teal.slice coverage - 65.92%

91 - 22x + 22x +
  MatrixFilterStates$new(
92 - 22x + 22x +
    data = data,
93 - 22x + 22x +
    data_reactive = data_reactive,
94 - 22x + 22x +
    dataname = dataname,
95 - 22x + 22x +
    datalabel = datalabel
@@ -49977,7 +51831,8 @@

teal.slice coverage - 65.92%

107 - 22x + 22x +
  if (!requireNamespace("MultiAssayExperiment", quietly = TRUE)) {
@@ -49998,42 +51853,48 @@

teal.slice coverage - 65.92%

110 - 22x + 22x +
  MAEFilterStates$new(
111 - 22x + 22x +
    data = data,
112 - 22x + 22x +
    data_reactive = data_reactive,
113 - 22x + 22x +
    dataname = dataname,
114 - 22x + 22x +
    datalabel = datalabel,
115 - 22x + 22x +
    keys = keys
@@ -50110,7 +51971,8 @@

teal.slice coverage - 65.92%

126 - 85x + 85x +
  if (!requireNamespace("SummarizedExperiment", quietly = TRUE)) {
@@ -50131,35 +51993,40 @@

teal.slice coverage - 65.92%

129 - 85x + 85x +
  SEFilterStates$new(
130 - 85x + 85x +
    data = data,
131 - 85x + 85x +
    data_reactive = data_reactive,
132 - 85x + 85x +
    dataname = dataname,
133 - 85x + 85x +
    datalabel = datalabel
@@ -50341,7 +52208,8 @@

teal.slice coverage - 65.92%

159 - 227x + 227x +
  UseMethod("get_supported_filter_varnames")
@@ -50383,28 +52251,32 @@

teal.slice coverage - 65.92%

165 - 198x + 198x +
  is_expected_class <- vapply(
166 - 198x + 198x +
    X = data,
167 - 198x + 198x +
    FUN = function(x) any(class(x) %in% .filterable_class),
168 - 198x + 198x +
    FUN.VALUE = logical(1)
@@ -50418,7 +52290,8 @@

teal.slice coverage - 65.92%

170 - 198x + 198x +
  names(is_expected_class[is_expected_class])
@@ -50467,21 +52340,24 @@

teal.slice coverage - 65.92%

177 - 29x + 29x +
  is_expected_class <- class(data[, 1]) %in% .filterable_class
178 - 29x + 29x +
  if (is_expected_class && !is.null(colnames(data))) {
179 - 26x + 26x +
    colnames(data)
@@ -50495,7 +52371,8 @@

teal.slice coverage - 65.92%

181 - 3x + 3x +
    character(0)
@@ -50733,7 +52610,8 @@

teal.slice coverage - 65.92%

215 - 9x + 9x +
  if (length(choices) == 0) {
@@ -50754,14 +52632,16 @@

teal.slice coverage - 65.92%

218 - 9x + 9x +
  choice_types <- variable_types(data = data, columns = choices)
219 - 9x + 9x +
  choice_types[keys] <- "primary_key"
@@ -50775,28 +52655,32 @@

teal.slice coverage - 65.92%

221 - 9x + 9x +
  choices_labeled(
222 - 9x + 9x +
    choices = choices,
223 - 9x + 9x +
    labels = unname(varlabels[choices]),
224 - 9x + 9x +
    types = choice_types[choices]
@@ -50845,49 +52729,56 @@

teal.slice coverage - 65.92%

231 - 9x + 9x +
  if (!is.array(data)) {
232 - 9x + 9x +
    vapply(
233 - 9x + 9x +
      colnames(data),
234 - 9x + 9x +
      FUN = function(x) {
235 - 42x + 42x +
        label <- attr(data[[x]], "label")
236 - 42x + 42x +
        if (is.null(label)) {
237 - 40x + 40x +
          x
@@ -50901,7 +52792,8 @@

teal.slice coverage - 65.92%

239 - 2x + 2x +
          label
@@ -50922,7 +52814,8 @@

teal.slice coverage - 65.92%

242 - 9x + 9x +
      FUN.VALUE = character(1)
@@ -51131,7 +53024,8 @@

teal.slice coverage - 65.92%

24 - 9x + 9x +
  if (is.factor(choices)) {
@@ -51159,35 +53053,40 @@

teal.slice coverage - 65.92%

28 - 9x + 9x +
  stopifnot(
29 - 9x + 9x +
    is.character(choices) ||
30 - 9x + 9x +
      is.numeric(choices) ||
31 - 9x + 9x +
      is.logical(choices) ||
32 - 9x + 9x +
      (length(choices) == 1 && is.na(choices))
@@ -51208,7 +53107,8 @@

teal.slice coverage - 65.92%

35 - 9x + 9x +
  if (is.factor(labels)) {
@@ -51236,14 +53136,16 @@

teal.slice coverage - 65.92%

39 - 9x + 9x +
  checkmate::assert_character(labels[!is.na(labels)], any.missing = FALSE)
40 - 9x + 9x +
  if (length(choices) != length(labels)) {
@@ -51264,14 +53166,16 @@

teal.slice coverage - 65.92%

43 - 9x + 9x +
  stopifnot(is.null(subset) || is.vector(subset))
44 - 9x + 9x +
  stopifnot(is.null(types) || is.vector(types))
@@ -51285,14 +53189,16 @@

teal.slice coverage - 65.92%

46 - 9x + 9x +
  if (is.vector(types)) {
47 - 9x + 9x +
    stopifnot(length(choices) == length(types))
@@ -51313,7 +53219,8 @@

teal.slice coverage - 65.92%

50 - 9x + 9x +
  if (!is.null(subset)) {
@@ -51376,56 +53283,64 @@

teal.slice coverage - 65.92%

59 - 9x + 9x +
  is_dupl <- duplicated(choices)
60 - 9x + 9x +
  choices <- choices[!is_dupl]
61 - 9x + 9x +
  labels <- labels[!is_dupl]
62 - 9x + 9x +
  types <- types[!is_dupl]
63 - 9x + 9x +
  labels[is.na(labels)] <- "Label Missing"
64 - 9x + 9x +
  raw_labels <- labels
65 - 9x + 9x +
  combined_labels <- if (length(choices) > 0) {
66 - 9x + 9x +
    paste0(choices, ": ", labels)
@@ -51460,7 +53375,8 @@

teal.slice coverage - 65.92%

71 - 9x + 9x +
  if (!is.null(subset)) {
@@ -51509,49 +53425,56 @@

teal.slice coverage - 65.92%

78 - 9x + 9x +
  choices <- structure(
79 - 9x + 9x +
    choices,
80 - 9x + 9x +
    names = combined_labels,
81 - 9x + 9x +
    raw_labels = raw_labels,
82 - 9x + 9x +
    combined_labels = combined_labels,
83 - 9x + 9x +
    class = c("choices_labeled", "character"),
84 - 9x + 9x +
    types = types
@@ -51572,7 +53495,8 @@

teal.slice coverage - 65.92%

87 - 9x + 9x +
  choices
@@ -52600,21 +54524,24 @@

teal.slice coverage - 65.92%

145 - 24x + 24x +
      isolate({
146 - 24x + 24x +
        checkmate::assert_date(x)
147 - 23x + 23x +
        checkmate::assert_class(x_reactive, "reactive")
@@ -52628,35 +54555,40 @@

teal.slice coverage - 65.92%

149 - 23x + 23x +
        super$initialize(
150 - 23x + 23x +
          x = x,
151 - 23x + 23x +
          x_reactive = x_reactive,
152 - 23x + 23x +
          slice = slice,
153 - 23x + 23x +
          extract_type = extract_type
@@ -52670,28 +54602,32 @@

teal.slice coverage - 65.92%

155 - 23x + 23x +
        checkmate::assert_date(slice$choices, null.ok = TRUE)
156 - 22x + 22x +
        private$set_choices(slice$choices)
157 - 14x + 14x +
        if (is.null(slice$selected)) slice$selected <- slice$choices
158 - 22x + 22x +
        private$set_selected(slice$selected)
@@ -52712,7 +54648,8 @@

teal.slice coverage - 65.92%

161 - 21x + 21x +
      invisible(self)
@@ -52789,14 +54726,16 @@

teal.slice coverage - 65.92%

172 - 7x + 7x +
      if (isFALSE(private$is_any_filtered())) {
173 - 1x + 1x +
        return(NULL)
@@ -52810,28 +54749,32 @@

teal.slice coverage - 65.92%

175 - 6x + 6x +
      choices <- as.character(private$get_selected())
176 - 6x + 6x +
      varname <- private$get_varname_prefixed(dataname)
177 - 6x + 6x +
      filter_call <-
178 - 6x + 6x +
        call(
@@ -52845,14 +54788,16 @@

teal.slice coverage - 65.92%

180 - 6x + 6x +
          call(">=", varname, call("as.Date", choices[1L])),
181 - 6x + 6x +
          call("<=", varname, call("as.Date", choices[2L]))
@@ -52866,7 +54811,8 @@

teal.slice coverage - 65.92%

183 - 6x + 6x +
      private$add_keep_na_call(filter_call, varname)
@@ -52922,14 +54868,16 @@

teal.slice coverage - 65.92%

191 - 22x + 22x +
      if (is.null(choices)) {
192 - 19x + 19x +
        choices <- range(private$x, na.rm = TRUE)
@@ -52943,21 +54891,24 @@

teal.slice coverage - 65.92%

194 - 3x + 3x +
        choices_adjusted <- c(
195 - 3x + 3x +
          max(choices[1L], min(private$x, na.rm = TRUE)),
196 - 3x + 3x +
          min(choices[2L], max(private$x, na.rm = TRUE))
@@ -52971,28 +54922,32 @@

teal.slice coverage - 65.92%

198 - 3x + 3x +
        if (any(choices != choices_adjusted)) {
199 - 1x + 1x +
          warning(sprintf(
200 - 1x + 1x +
            "Choices adjusted (some values outside of variable range). Varname: %s, dataname: %s.",
201 - 1x + 1x +
            private$get_varname(), private$get_dataname()
@@ -53006,7 +54961,8 @@

teal.slice coverage - 65.92%

203 - 1x + 1x +
          choices <- choices_adjusted
@@ -53020,35 +54976,40 @@

teal.slice coverage - 65.92%

205 - 3x + 3x +
        if (choices[1L] >= choices[2L]) {
206 - 1x + 1x +
          warning(sprintf(
207 - 1x + 1x +
            "Invalid choices: lower is higher / equal to upper, or not in range of variable values.
208 - 1x + 1x +
            Setting defaults. Varname: %s, dataname: %s.",
209 - 1x + 1x +
            private$get_varname(), private$get_dataname()
@@ -53062,7 +55023,8 @@

teal.slice coverage - 65.92%

211 - 1x + 1x +
          choices <- range(private$x, na.rm = TRUE)
@@ -53083,28 +55045,32 @@

teal.slice coverage - 65.92%

214 - 22x + 22x +
      private$set_is_choice_limited(private$x, choices)
215 - 22x + 22x +
      private$x <- private$x[(private$x >= choices[1L] & private$x <= choices[2L]) | is.na(private$x)]
216 - 22x + 22x +
      private$teal_slice$choices <- choices
217 - 22x + 22x +
      invisible(NULL)
@@ -53146,14 +55112,16 @@

teal.slice coverage - 65.92%

223 - 22x + 22x +
      private$is_choice_limited <- (any(xl < choices[1L], na.rm = TRUE) | any(xl > choices[2L], na.rm = TRUE))
224 - 22x + 22x +
      invisible(NULL)
@@ -53174,21 +55142,24 @@

teal.slice coverage - 65.92%

227 - 33x + 33x +
      tryCatch(
228 - 33x + 33x +
        expr = {
229 - 33x + 33x +
          values <- as.Date(values, origin = "1970-01-01")
@@ -53202,7 +55173,8 @@

teal.slice coverage - 65.92%

231 - 30x + 30x +
          values
@@ -53216,7 +55188,8 @@

teal.slice coverage - 65.92%

233 - 33x + 33x +
        error = function(e) stop("Vector of set values must contain values coercible to Date.")
@@ -53244,42 +55217,48 @@

teal.slice coverage - 65.92%

237 - 1x + 1x +
      if (length(values) != 2) stop("Vector of set values must have length two.")
238 - 29x + 29x +
      if (values[1] > values[2]) {
239 - 1x + 1x +
        warning(
240 - 1x + 1x +
          sprintf(
241 - 1x + 1x +
            "Start date %s is set after the end date %s, the values will be replaced with a default date range.",
242 - 1x + 1x +
            values[1], values[2]
@@ -53300,7 +55279,8 @@

teal.slice coverage - 65.92%

245 - 1x + 1x +
        values <- isolate(private$get_choices())
@@ -53314,7 +55294,8 @@

teal.slice coverage - 65.92%

247 - 29x + 29x +
      values
@@ -53335,42 +55316,48 @@

teal.slice coverage - 65.92%

250 - 29x + 29x +
      choices <- private$get_choices()
251 - 29x + 29x +
      if (values[1] < choices[1L] | values[1] > choices[2L]) {
252 - 5x + 5x +
        warning(
253 - 5x + 5x +
          sprintf(
254 - 5x + 5x +
            "Value: %s is outside of the possible range for column %s of dataset %s, setting minimum possible value.",
255 - 5x + 5x +
            values[1], private$get_varname(), private$get_dataname()
@@ -53391,7 +55378,8 @@

teal.slice coverage - 65.92%

258 - 5x + 5x +
        values[1] <- choices[1L]
@@ -53412,35 +55400,40 @@

teal.slice coverage - 65.92%

261 - 29x + 29x +
      if (values[2] > choices[2L] | values[2] < choices[1L]) {
262 - 5x + 5x +
        warning(
263 - 5x + 5x +
          sprintf(
264 - 5x + 5x +
            "Value: %s is outside of the possible range for column %s of dataset %s, setting maximum possible value.",
265 - 5x + 5x +
            values[2], private$get_varname(), private$get_dataname()
@@ -53461,7 +55454,8 @@

teal.slice coverage - 65.92%

268 - 5x + 5x +
        values[2] <- choices[2L]
@@ -53482,7 +55476,8 @@

teal.slice coverage - 65.92%

271 - 29x + 29x +
      values
@@ -55595,28 +57590,32 @@

teal.slice coverage - 65.92%

130 - 16x + 16x +
      isolate({
131 - 16x + 16x +
        checkmate::assert_logical(x)
132 - 15x + 15x +
        checkmate::assert_logical(slice$selected, null.ok = TRUE)
133 - 14x + 14x +
        super$initialize(x = x, x_reactive = x_reactive, slice = slice, extract_type = extract_type)
@@ -55630,7 +57629,8 @@

teal.slice coverage - 65.92%

135 - 14x + 14x +
        private$set_choices(slice$choices)
@@ -55644,28 +57644,32 @@

teal.slice coverage - 65.92%

137 - 14x + 14x +
        if (is.null(slice$selected) && slice$multiple) {
138 - 7x + 7x +
          slice$selected <- private$get_choices()
139 - 7x + 7x +
        } else if (length(slice$selected) != 1 && !slice$multiple) {
140 - 3x + 3x +
          slice$selected <- TRUE
@@ -55679,28 +57683,32 @@

teal.slice coverage - 65.92%

142 - 14x + 14x +
        private$set_selected(slice$selected)
143 - 14x + 14x +
        df <- factor(x, levels = c(TRUE, FALSE))
144 - 14x + 14x +
        tbl <- table(df)
145 - 14x + 14x +
        private$set_choices_counts(tbl)
@@ -55714,7 +57722,8 @@

teal.slice coverage - 65.92%

147 - 14x + 14x +
      invisible(self)
@@ -55784,7 +57793,8 @@

teal.slice coverage - 65.92%

157 - 6x + 6x +
      if (isFALSE(private$is_any_filtered())) {
@@ -55805,28 +57815,32 @@

teal.slice coverage - 65.92%

160 - 4x + 4x +
      if (missing(dataname)) dataname <- private$get_dataname()
161 - 6x + 6x +
      varname <- private$get_varname_prefixed(dataname)
162 - 6x + 6x +
      choices <- private$get_selected()
163 - 6x + 6x +
      n_choices <- length(choices)
@@ -55840,35 +57854,40 @@

teal.slice coverage - 65.92%

165 - 6x + 6x +
      filter_call <-
166 - 6x + 6x +
        if (n_choices == 1 && choices) {
167 - 1x + 1x +
          varname
168 - 6x + 6x +
        } else if (n_choices == 1 && !choices) {
169 - 4x + 4x +
          call("!", varname)
@@ -55882,7 +57901,8 @@

teal.slice coverage - 65.92%

171 - 1x + 1x +
          call("%in%", varname, make_c_call(choices))
@@ -55896,7 +57916,8 @@

teal.slice coverage - 65.92%

173 - 6x + 6x +
      private$add_keep_na_call(filter_call, varname)
@@ -55966,14 +57987,16 @@

teal.slice coverage - 65.92%

183 - 14x + 14x +
      private$teal_slice$choices <- c(TRUE, FALSE)
184 - 14x + 14x +
      invisible(NULL)
@@ -56008,14 +58031,16 @@

teal.slice coverage - 65.92%

189 - 14x + 14x +
      private$choices_counts <- choices_counts
190 - 14x + 14x +
      invisible(NULL)
@@ -56036,35 +58061,40 @@

teal.slice coverage - 65.92%

193 - 21x + 21x +
      tryCatch(
194 - 21x + 21x +
        expr = {
195 - 21x + 21x +
          values <- as.logical(values)
196 - 1x + 1x +
          if (anyNA(values)) stop()
197 - 20x + 20x +
          values
@@ -56078,7 +58108,8 @@

teal.slice coverage - 65.92%

199 - 21x + 21x +
        error = function(e) stop("Vector of set values must contain values coercible to logical.")
@@ -56113,28 +58144,32 @@

teal.slice coverage - 65.92%

204 - 20x + 20x +
      if (!private$is_multiple() && length(values) > 1) {
205 - 1x + 1x +
        warning(
206 - 1x + 1x +
          sprintf("Selection: %s is not a vector of length one. ", toString(values, width = 360)),
207 - 1x + 1x +
          "Maintaining previous selection."
@@ -56148,7 +58183,8 @@

teal.slice coverage - 65.92%

209 - 1x + 1x +
        values <- isolate(private$get_selected())
@@ -56162,7 +58198,8 @@

teal.slice coverage - 65.92%

211 - 20x + 20x +
      values
@@ -56204,7 +58241,8 @@

teal.slice coverage - 65.92%

217 - 6x + 6x +
      if (private$is_choice_limited) {
@@ -56218,14 +58256,16 @@

teal.slice coverage - 65.92%

219 - 6x + 6x +
      } else if (all(private$choices_counts > 0)) {
220 - 6x + 6x +
        TRUE
@@ -58219,49 +60259,56 @@

teal.slice coverage - 65.92%

95 - 764x + 764x +
  slices <- list(...)
96 - 764x + 764x +
  checkmate::assert_list(slices, types = "teal_slice", any.missing = FALSE)
97 - 763x + 763x +
  slices_id <- isolate(vapply(slices, `[[`, character(1L), "id"))
98 - 763x + 763x +
  if (any(duplicated(slices_id))) {
99 - 1x + 1x +
    stop(
100 - 1x + 1x +
      "Some teal_slice objects have the same id:\n",
101 - 1x + 1x +
      toString(unique(slices_id[duplicated(slices_id)]))
@@ -58282,35 +60329,40 @@

teal.slice coverage - 65.92%

104 - 762x + 762x +
  checkmate::assert_list(exclude_varnames, names = "named", types = "character", null.ok = TRUE, min.len = 1)
105 - 761x + 761x +
  checkmate::assert_list(include_varnames, names = "named", types = "character", null.ok = TRUE, min.len = 1)
106 - 760x + 760x +
  checkmate::assert_character(count_type, len = 1, null.ok = TRUE)
107 - 758x + 758x +
  checkmate::assert_subset(count_type, choices = c("all", "none"), empty.ok = TRUE)
108 - 757x + 757x +
  checkmate::assert_logical(allow_add)
@@ -58324,35 +60376,40 @@

teal.slice coverage - 65.92%

110 - 756x + 756x +
  duplicated_datasets <- intersect(names(include_varnames), names(exclude_varnames))
111 - 756x + 756x +
  if (length(duplicated_datasets)) {
112 - 1x + 1x +
    stop(
113 - 1x + 1x +
      "Some datasets are specified in both, include_varnames and exclude_varnames:\n",
114 - 1x + 1x +
      toString(duplicated_datasets)
@@ -58380,49 +60437,56 @@

teal.slice coverage - 65.92%

118 - 755x + 755x +
  structure(
119 - 755x + 755x +
    slices,
120 - 755x + 755x +
    exclude_varnames = exclude_varnames,
121 - 755x + 755x +
    include_varnames = include_varnames,
122 - 755x + 755x +
    count_type = count_type,
123 - 755x + 755x +
    allow_add = allow_add,
124 - 755x + 755x +
    class = c("teal_slices", class(slices))
@@ -58555,7 +60619,8 @@

teal.slice coverage - 65.92%

143 - 465x + 465x +
  inherits(x, "teal_slices")
@@ -58695,21 +60760,24 @@

teal.slice coverage - 65.92%

163 - 1077x + 1077x +
  ans <- unclass(x)
164 - 45x + 45x +
  if (recursive) ans[] <- lapply(ans, as.list)
165 - 1077x + 1077x +
  ans
@@ -58765,21 +60833,24 @@

teal.slice coverage - 65.92%

173 - 3x + 3x +
  if (missing(i)) i <- seq_along(x)
174 - 506x + 506x +
  if (length(i) == 0L) {
175 - 178x + 178x +
    return(x[0])
@@ -58793,35 +60864,40 @@

teal.slice coverage - 65.92%

177 - 1x + 1x +
  if (is.logical(i) && length(i) > length(x)) stop("subscript out of bounds")
178 - 1x + 1x +
  if (is.numeric(i) && max(i) > length(x)) stop("subscript out of bounds")
179 - 326x + 326x +
  if (is.character(i)) {
180 - 1x + 1x +
    if (!all(is.element(i, names(x)))) stop("subscript out of bounds")
181 - 2x + 2x +
    i <- which(is.element(i, names(x)))
@@ -58842,35 +60918,40 @@

teal.slice coverage - 65.92%

184 - 325x + 325x +
  y <- NextMethod("[")
185 - 325x + 325x +
  attrs <- attributes(x)
186 - 325x + 325x +
  attrs$names <- attrs$names[i]
187 - 325x + 325x +
  attributes(y) <- attrs
188 - 325x + 325x +
  y
@@ -58926,14 +61007,16 @@

teal.slice coverage - 65.92%

196 - 252x + 252x +
  x <- list(...)
197 - 252x + 252x +
  checkmate::assert_true(all(vapply(x, is.teal_slices, logical(1L))), .var.name = "all arguments are teal_slices")
@@ -58947,21 +61030,24 @@

teal.slice coverage - 65.92%

199 - 251x + 251x +
  all_attributes <- lapply(x, attributes)
200 - 251x + 251x +
  all_attributes <- coalesce_r(all_attributes)
201 - 251x + 251x +
  all_attributes <- all_attributes[names(all_attributes) != "class"]
@@ -58975,35 +61061,40 @@

teal.slice coverage - 65.92%

203 - 251x + 251x +
  do.call(
204 - 251x + 251x +
    teal_slices,
205 - 251x + 251x +
    c(
206 - 251x + 251x +
      unique(unlist(x, recursive = FALSE)),
207 - 251x + 251x +
      all_attributes
@@ -59087,14 +61178,16 @@

teal.slice coverage - 65.92%

219 - 45x + 45x +
  checkmate::assert_flag(show_all)
220 - 45x + 45x +
  checkmate::assert_flag(trim_lines)
@@ -59108,35 +61201,40 @@

teal.slice coverage - 65.92%

222 - 45x + 45x +
  x <- as.list(x, recursive = TRUE)
223 - 45x + 45x +
  attrs <- attributes(x)
224 - 45x + 45x +
  attributes(x) <- NULL
225 - 45x + 45x +
  slices_list <- list(slices = x, attributes = attrs)
226 - 45x + 45x +
  slices_list <- Filter(Negate(is.null), slices_list) # drop attributes if empty
@@ -59150,7 +61248,8 @@

teal.slice coverage - 65.92%

228 - 20x + 20x +
  if (!show_all) slices_list$slices <- lapply(slices_list$slices, function(slice) Filter(Negate(is.null), slice))
@@ -59164,7 +61263,8 @@

teal.slice coverage - 65.92%

230 - 45x + 45x +
  jsonify(slices_list, trim_lines)
@@ -59213,7 +61313,8 @@

teal.slice coverage - 65.92%

237 - 2x + 2x +
  cat(format(x, ...), "\n")
@@ -59297,21 +61398,24 @@

teal.slice coverage - 65.92%

249 - 14x + 14x +
  Filter(
250 - 14x + 14x +
    function(xx) {
251 - 12x + 12x +
      !any(vapply(y, function(yy) identical(yy, xx), logical(1)))
@@ -59325,7 +61429,8 @@

teal.slice coverage - 65.92%

253 - 14x + 14x +
    x
@@ -59472,28 +61577,32 @@

teal.slice coverage - 65.92%

274 - 1569x + 1569x +
  checkmate::assert_list(x)
275 - 1568x + 1568x +
  xnn <- Filter(Negate(is.null), x)
276 - 1568x + 1568x +
  if (all(vapply(xnn, is.atomic, logical(1L)))) {
277 - 1059x + 1059x +
    return(xnn[[1L]])
@@ -59507,21 +61616,24 @@

teal.slice coverage - 65.92%

279 - 509x + 509x +
  lapply(x, checkmate::assert_list, names = "named", null.ok = TRUE, .var.name = "list element")
280 - 508x + 508x +
  all_names <- unique(unlist(lapply(x, names)))
281 - 508x + 508x +
  sapply(all_names, function(nm) coalesce_r(lapply(x, `[[`, nm)), simplify = FALSE)
@@ -59660,21 +61772,24 @@

teal.slice coverage - 65.92%

18 - 7x + 7x +
  checkmate::assert_list(x, any.missing = FALSE, names = "unique")
19 - 6x + 6x +
  checkmate::assert_class(join_keys, "join_keys")
20 - 5x + 5x +
  if (!missing(code)) {
@@ -59716,7 +61831,8 @@

teal.slice coverage - 65.92%

26 - 5x + 5x +
  if (!missing(check)) {
@@ -59758,7 +61874,8 @@

teal.slice coverage - 65.92%

32 - 5x + 5x +
  FilteredData$new(x, join_keys = join_keys)
@@ -59856,42 +61973,48 @@

teal.slice coverage - 65.92%

46 - 32x + 32x +
  lapply(
47 - 32x + 32x +
    expr,
48 - 32x + 32x +
    function(x) {
49 - 19x + 19x +
      tryCatch(
50 - 19x + 19x +
        eval(x, envir = env),
51 - 19x + 19x +
        error = function(e) {
@@ -59968,7 +62091,8 @@

teal.slice coverage - 65.92%

62 - 32x + 32x +
  invisible(NULL)
@@ -60528,21 +62652,24 @@

teal.slice coverage - 65.92%

142 - 3x + 3x +
  checkmate::assert_string(input_id)
143 - 3x + 3x +
  checkmate::assert_character(icons, len = 2L)
144 - 3x + 3x +
  checkmate::assert_flag(one_way)
@@ -60556,35 +62683,40 @@

teal.slice coverage - 65.92%

146 - 3x + 3x +
  expr <-
147 - 3x + 3x +
    if (one_way) {
148 - 3x + 3x +
      sprintf(
149 - 3x + 3x +
        "$('#%s i').removeClass('%s').addClass('%s');",
150 - 3x + 3x +
        input_id, icons[1], icons[2]
@@ -60626,7 +62758,8 @@

teal.slice coverage - 65.92%

156 - 3x + 3x +
  shinyjs::runjs(expr)
@@ -60640,7 +62773,8 @@

teal.slice coverage - 65.92%

158 - 3x + 3x +
  invisible(NULL)
@@ -60682,21 +62816,24 @@

teal.slice coverage - 65.92%

164 - 3x + 3x +
  checkmate::assert_string(input_id)
165 - 3x + 3x +
  checkmate::assert_character(titles, len = 2L)
166 - 3x + 3x +
  checkmate::assert_flag(one_way)
@@ -60710,35 +62847,40 @@

teal.slice coverage - 65.92%

168 - 3x + 3x +
  expr <-
169 - 3x + 3x +
    if (one_way) {
170 - 3x + 3x +
      sprintf(
171 - 3x + 3x +
        "$('a#%s').attr('title', '%s');",
172 - 3x + 3x +
        input_id, titles[2]
@@ -60843,7 +62985,8 @@

teal.slice coverage - 65.92%

187 - 3x + 3x +
  shinyjs::runjs(expr)
@@ -60857,7 +63000,8 @@

teal.slice coverage - 65.92%

189 - 3x + 3x +
  invisible(NULL)
@@ -60948,7 +63092,8 @@

teal.slice coverage - 65.92%

202 - 66x + 66x +
  utils::getFromNamespace("topological_sort", ns = "teal.data")(graph)
@@ -61493,21 +63638,24 @@

teal.slice coverage - 65.92%

76 - 15x + 15x +
      checkmate::assert_class(slice, "teal_slice_expr")
77 - 14x + 14x +
      private$teal_slice <- slice
78 - 14x + 14x +
      invisible(self)
@@ -61591,28 +63739,32 @@

teal.slice coverage - 65.92%

90 - 12x + 12x +
      sprintf(
91 - 12x + 12x +
        "%s:\n%s",
92 - 12x + 12x +
        class(self)[1],
93 - 12x + 12x +
        format(self$get_state(), show_all = show_all, trim_lines = trim_lines)
@@ -61682,7 +63834,8 @@

teal.slice coverage - 65.92%

103 - 1x + 1x +
      cat(isolate(self$format(...)))
@@ -61745,7 +63898,8 @@

teal.slice coverage - 65.92%

112 - 26x + 26x +
      private$teal_slice
@@ -61822,14 +63976,16 @@

teal.slice coverage - 65.92%

123 - 1x + 1x +
      checkmate::assert_class(state, "teal_slice_expr")
124 - 1x + 1x +
      invisible(self)
@@ -61941,7 +64097,8 @@

teal.slice coverage - 65.92%

140 - 2x + 2x +
      isolate(str2lang(private$teal_slice$expr))
@@ -63102,21 +65259,24 @@

teal.slice coverage - 65.92%

30 - 47x + 47x +
  checkmate::assert_list(calls)
31 - 45x + 45x +
  if (length(calls) > 0L) checkmate::assert_list(calls, types = c("call", "name"))
32 - 46x + 46x +
  checkmate::assert_string(operator)
@@ -63130,21 +65290,24 @@

teal.slice coverage - 65.92%

34 - 44x + 44x +
  Reduce(
35 - 44x + 44x +
    x = calls,
36 - 44x + 44x +
    f = function(x, y) call(operator, x, y)
@@ -63556,14 +65719,16 @@

teal.slice coverage - 65.92%

56 - 8x + 8x +
      checkmate::assert_class(datasets, "FilteredData")
57 - 6x + 6x +
      private$filtered_data <- datasets
@@ -63647,7 +65812,8 @@

teal.slice coverage - 65.92%

69 - 8x + 8x +
      private$filtered_data$get_filter_state()
@@ -63717,14 +65883,16 @@

teal.slice coverage - 65.92%

79 - 5x + 5x +
      private$filtered_data$set_filter_state(filter)
80 - 5x + 5x +
      invisible(NULL)
@@ -63815,14 +65983,16 @@

teal.slice coverage - 65.92%

93 - 1x + 1x +
      private$filtered_data$remove_filter_state(filter)
94 - 1x + 1x +
      invisible(NULL)
@@ -63913,21 +66083,24 @@

teal.slice coverage - 65.92%

107 - 2x + 2x +
      datanames_to_remove <- if (missing(datanames)) private$filtered_data$datanames() else datanames
108 - 2x + 2x +
      private$filtered_data$clear_filter_states(datanames = datanames_to_remove)
109 - 2x + 2x +
      invisible(NULL)
@@ -64626,7 +66799,8 @@

teal.slice coverage - 65.92%

92 - 107x + 107x +
  UseMethod("init_filtered_dataset")
@@ -64710,56 +66884,64 @@

teal.slice coverage - 65.92%

104 - 83x + 83x +
  DataframeFilteredDataset$new(
105 - 83x + 83x +
    dataset = dataset,
106 - 83x + 83x +
    dataname = dataname,
107 - 83x + 83x +
    keys = keys,
108 - 83x + 83x +
    parent_name = parent_name,
109 - 83x + 83x +
    parent = parent,
110 - 83x + 83x +
    join_keys = join_keys,
111 - 83x + 83x +
    label = label
@@ -64850,7 +67032,8 @@

teal.slice coverage - 65.92%

124 - 7x + 7x +
  if (!requireNamespace("MultiAssayExperiment", quietly = TRUE)) {
@@ -64871,35 +67054,40 @@

teal.slice coverage - 65.92%

127 - 7x + 7x +
  MAEFilteredDataset$new(
128 - 7x + 7x +
    dataset = dataset,
129 - 7x + 7x +
    dataname = dataname,
130 - 7x + 7x +
    keys = keys,
131 - 7x + 7x +
    label = label
@@ -64990,28 +67178,32 @@

teal.slice coverage - 65.92%

144 - 17x + 17x +
  DefaultFilteredDataset$new(
145 - 17x + 17x +
    dataset = dataset,
146 - 17x + 17x +
    dataname = dataname,
147 - 17x + 17x +
    label = label
@@ -65878,28 +68070,32 @@

teal.slice coverage - 65.92%

121 - 3x + 3x +
  checkmate::assert_multi_class(datasets, c("FilteredData", "FilterPanelAPI"))
122 - 3x + 3x +
  checkmate::assert_class(filter, "teal_slices")
123 - 3x + 3x +
  datasets$set_filter_state(filter)
124 - 3x + 3x +
  invisible(NULL)
@@ -65941,14 +68137,16 @@

teal.slice coverage - 65.92%

130 - 4x + 4x +
  checkmate::assert_multi_class(datasets, c("FilteredData", "FilterPanelAPI"))
131 - 4x + 4x +
  if (isRunning()) {
@@ -65969,7 +68167,8 @@

teal.slice coverage - 65.92%

134 - 4x + 4x +
    isolate(datasets$get_filter_state())
@@ -66018,14 +68217,16 @@

teal.slice coverage - 65.92%

141 - 1x + 1x +
  checkmate::assert_multi_class(datasets, c("FilteredData", "FilterPanelAPI"))
142 - 1x + 1x +
  checkmate::assert_class(filter, "teal_slices")
@@ -66039,14 +68240,16 @@

teal.slice coverage - 65.92%

144 - 1x + 1x +
  datasets$remove_filter_state(filter)
145 - 1x + 1x +
  invisible(NULL)
@@ -66088,21 +68291,24 @@

teal.slice coverage - 65.92%

151 - 1x + 1x +
  checkmate::assert_multi_class(datasets, c("FilteredData", "FilterPanelAPI"))
152 - 1x + 1x +
  datasets$clear_filter_states(force = force)
153 - 1x + 1x +
  invisible(NULL)
@@ -66221,28 +68427,32 @@

teal.slice coverage - 65.92%

170 - 2x + 2x +
  checkmate::assert_character(datanames, min.len = 1, any.missing = FALSE)
171 - 2x + 2x +
  stopifnot(
172 - 2x + 2x +
    is(datasets, "FilteredData"),
173 - 2x + 2x +
    all(datanames %in% datasets$datanames())
@@ -66263,35 +68473,40 @@

teal.slice coverage - 65.92%

176 - 2x + 2x +
  paste(
177 - 2x + 2x +
    unlist(lapply(
178 - 2x + 2x +
      datanames,
179 - 2x + 2x +
      function(dataname) {
180 - 4x + 4x +
        datasets$get_call(dataname)
@@ -66312,7 +68527,8 @@

teal.slice coverage - 65.92%

183 - 2x + 2x +
    collapse = "\n"
@@ -66577,21 +68793,24 @@

teal.slice coverage - 65.92%

35 - 26x + 26x +
      checkmate::assert_matrix(data)
36 - 25x + 25x +
      super$initialize(data, data_reactive, dataname, datalabel)
37 - 25x + 25x +
      private$set_filterable_varnames(include_varnames = colnames(private$data))
@@ -66744,49 +68963,56 @@

teal.slice coverage - 65.92%

15 - 273x + 273x +
  checkmate::assert_character(name, min.len = 1, any.missing = FALSE)
16 - 271x + 271x +
  if (!grepl("^[[:alpha:]][a-zA-Z0-9_]*$", name, perl = TRUE)) {
17 - 5x + 5x +
    stop(
18 - 5x + 5x +
      "name '",
19 - 5x + 5x +
      name,
20 - 5x + 5x +
      "' must only contain alphanumeric characters (with underscores)",
21 - 5x + 5x +
      " and the first character must be an alphabetic character"
@@ -66898,35 +69124,40 @@

teal.slice coverage - 65.92%

37 - 12x + 12x +
  checkmate::assert_character(pattern, min.len = 1, null.ok = TRUE)
38 - 12x + 12x +
  js_files <- list.files(
39 - 12x + 12x +
    system.file("js", package = "teal.slice", mustWork = TRUE),
40 - 12x + 12x +
    pattern = pattern,
41 - 12x + 12x +
    full.names = TRUE
@@ -66940,7 +69171,8 @@

teal.slice coverage - 65.92%

43 - 12x + 12x +
  singleton(lapply(js_files, includeScript))
@@ -67080,14 +69312,16 @@

teal.slice coverage - 65.92%

63 - 55x + 55x +
  if (length(choices) > 1) {
64 - 27x + 27x +
    do.call("call", append(list("c"), choices))
@@ -67101,7 +69335,8 @@

teal.slice coverage - 65.92%

66 - 28x + 28x +
    choices
@@ -67394,21 +69629,24 @@

teal.slice coverage - 65.92%

39 - 9x + 9x +
  checkmate::assert_multi_class(data, c("data.frame", "DataFrame", "matrix"))
40 - 9x + 9x +
  checkmate::assert_character(columns, any.missing = FALSE, null.ok = TRUE)
41 - 9x + 9x +
  checkmate::assert_subset(columns, colnames(data))
@@ -67422,7 +69660,8 @@

teal.slice coverage - 65.92%

43 - 9x + 9x +
  if (is.matrix(data)) {
@@ -67492,14 +69731,16 @@

teal.slice coverage - 65.92%

53 - 9x + 9x +
    types <- vapply(data, function(x) class(x)[1L], character(1L))
54 - 9x + 9x +
    if (!is.null(columns)) types <- types[columns]
@@ -67520,7 +69761,8 @@

teal.slice coverage - 65.92%

57 - 9x + 9x +
  types
@@ -69205,35 +71447,40 @@

teal.slice coverage - 65.92%

187 - 103x + 103x +
      checkmate::assert_function(data_reactive, args = "sid")
188 - 103x + 103x +
      checkmate::assert_data_frame(data)
189 - 103x + 103x +
      super$initialize(data, data_reactive, dataname, datalabel)
190 - 103x + 103x +
      private$keys <- keys
191 - 103x + 103x +
      private$set_filterable_varnames(include_varnames = colnames(private$data))
@@ -69568,7 +71815,8 @@

teal.slice coverage - 65.92%

39 - 26x + 26x +
      if (!requireNamespace("MultiAssayExperiment", quietly = TRUE)) {
@@ -69589,14 +71837,16 @@

teal.slice coverage - 65.92%

42 - 26x + 26x +
      checkmate::assert_function(data_reactive, args = "sid")
43 - 26x + 26x +
      checkmate::assert_class(data, "MultiAssayExperiment")
@@ -69610,35 +71860,40 @@

teal.slice coverage - 65.92%

45 - 25x + 25x +
      data <- SummarizedExperiment::colData(data)
46 - 25x + 25x +
      data_reactive <- function(sid = "") SummarizedExperiment::colData(data_reactive(sid = sid))
47 - 25x + 25x +
      super$initialize(data, data_reactive, dataname, datalabel)
48 - 25x + 25x +
      private$keys <- keys
49 - 25x + 25x +
      private$set_filterable_varnames(include_varnames = colnames(data))
@@ -69652,7 +71907,8 @@

teal.slice coverage - 65.92%

51 - 25x + 25x +
      invisible(self)
@@ -69777,14 +72033,16 @@

teal.slice coverage - 65.92%

7 - 9x + 9x +
  isolate(
8 - 9x + 9x +
    all(vapply(fields, function(x) identical(ts1[[x]], ts2[[x]]), logical(1L)))
@@ -69847,35 +72105,40 @@

teal.slice coverage - 65.92%

17 - 34x + 34x +
  isolate({
18 - 34x + 34x +
    testthat::expect_true(
19 - 34x + 34x +
      setequal(
20 - 34x + 34x +
        reactiveValuesToList(x),
21 - 34x + 34x +
        reactiveValuesToList(y)
@@ -69945,28 +72208,32 @@

teal.slice coverage - 65.92%

31 - 12x + 12x +
  isolate({
32 - 12x + 12x +
    mapply(
33 - 12x + 12x +
      function(x, y) {
34 - 27x + 27x +
        expect_identical_slice(x, y)
@@ -69980,14 +72247,16 @@

teal.slice coverage - 65.92%

36 - 12x + 12x +
      x = x,
37 - 12x + 12x +
      y = y
@@ -70001,7 +72270,8 @@

teal.slice coverage - 65.92%

39 - 12x + 12x +
    testthat::expect_identical(attributes(x), attributes(y))
diff --git a/latest-tag/index.html b/latest-tag/index.html index d8c65f9ba..487ebe528 100644 --- a/latest-tag/index.html +++ b/latest-tag/index.html @@ -1,5 +1,4 @@ - - + @@ -52,22 +51,7 @@ - - + - + + diff --git a/latest-tag/news/index.html b/latest-tag/news/index.html index e88fec196..7bf6a10a8 100644 --- a/latest-tag/news/index.html +++ b/latest-tag/news/index.html @@ -1,8 +1,22 @@ - -Changelog • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -78,49 +98,74 @@
-

teal.slice 0.5.1

CRAN release: 2024-04-30

+

teal.slice 0.5.1 +

+

CRAN release: 2024-04-30

-

Bug fixes

-
  • Fix how the filter panel handles NA values in a Date column.
  • +

    Bug fixes +

    +
      +
    • Fix how the filter panel handles NA values in a Date column.
    • Fix filtering of ordered column to return the right call.
    • Ensure choices are sorted for factor and ordered data types.
    • -
+ +
-

Miscellaneous

-
+ +
-

teal.slice 0.5.0

CRAN release: 2024-02-06

+

teal.slice 0.5.0 +

+

CRAN release: 2024-02-06

-

Enhancements

-
  • Simplified init_filtered_data to accept a named list of datasets. init_filtered_data does not currently handle a list containing dataset, metadata, datalabel and code.
  • -
+

Enhancements +

+ +
-

Breaking changes

-
+ +
-

Bug fixes

-
+

Bug fixes +

+ +
-

Miscellaneous

-
+ +
-

teal.slice 0.4.0

+

teal.slice 0.4.0 +

-

New features

-
+ +
-

Breaking changes

-
+ +
-

teal.slice 0.3.0

- +
-

Enhancements

-
+

Enhancements +

+ +
-

Bug fixes

-
+ +
-

Miscellaneous

-
+ +
-

teal.slice 0.2.0

+

teal.slice 0.2.0 +

-

New features

-
+ +
-

Enhancements

-
+ +
-

Breaking changes

-
+

Breaking changes +

+ +
-

Bug fixes

-
+ +
-

teal.slice 0.1.1

+

teal.slice 0.1.1 +

-

New features

-
  • Added a formatting function for filter panel classes.
  • -
+

New features +

+ +
-

Miscellaneous

-
+ +
-

Fix

-
+

Fix +

+ +
-

teal.slice 0.1.0

-
-

Changes (from behavior when functionality was part of teal)

+

teal.slice 0.1.0 +

+
    +
  • Initial release of teal.slice - a package providing a filter module for teal applications.
  • +
+
+

Changes (from behavior when functionality was part of teal) +

-

Breaking changes

-
  • +

    Breaking changes +

    +
      +
    • default_filter has been deprecated - use list() instead for a default filter.
    • -
+ +
-

Bug fixes

-
  • Add counts to filtering categorical variables bar charts in the filtering panel in cases where they were missing.
  • +

    Bug fixes +

    +
      +
    • Add counts to filtering categorical variables bar charts in the filtering panel in cases where they were missing.
    • Fixed a bug causing an error when both sliders of RangeFilterState where put to either end of the allowed range in the UI.
    • -
+ +
-

Miscellaneous

-
  • Added is_any_filtered method to all FilterState classes to detect if selected values actually filters out any data. This is used to decide if an explicit filter statement is added to the call.
  • +

    Miscellaneous +

    +
      +
    • Added is_any_filtered method to all FilterState classes to detect if selected values actually filters out any data. This is used to decide if an explicit filter statement is added to the call.
    • The filter panel now displays a helpful message when data has no rows or columns in place of an empty drop down widget.
    • FilteredData now stores whether its datasets had a reproducibility check or not via two new methods to its class: set_check and get_check.
    • -
+ +
+ + + + - - + + diff --git a/latest-tag/reference/ChoicesFilterState.html b/latest-tag/reference/ChoicesFilterState.html index 3e537436b..529e238bb 100644 --- a/latest-tag/reference/ChoicesFilterState.html +++ b/latest-tag/reference/ChoicesFilterState.html @@ -1,8 +1,24 @@ - -FilterState object for categorical data — ChoicesFilterState • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
@@ -84,40 +107,60 @@
-

Super class

+

Super class +

teal.slice::FilterState -> ChoicesFilterState

+

Inherited methods


-

Method new()

-

Initialize a FilterState object.

-

Usage

-

ChoicesFilterState$new(
+

+
+
+

Method new() +

+

Initialize a FilterState object.

+
+

Usage +

+

+
+
ChoicesFilterState$new(
   x,
   x_reactive = reactive(NULL),
   slice,
   extract_type = character(0)
-)

+)
+

+
-

Returns

+

Returns +

Object of class ChoicesFilterState, invisibly.

-


-

Method get_call()

+
+

+
+
+

Method get_call() +

Returns reproducible condition call for current selection. For this class returned call looks like -<varname> %in% c(<values selected>) with optional is.na(<varname>).

-

Usage

-

ChoicesFilterState$get_call(dataname)

+<varname> %in% c(<values selected>) with optional is.na(<varname>).

+
+

Usage +

+

+
+
ChoicesFilterState$get_call(dataname)
+

+
-

Arguments

-

dataname
+

Arguments +

+

+
+
+
dataname

(character(1)) name of data set; defaults to private$get_dataname()

-

+
+

+
-

Returns

+

Returns +

call or NULL

-


-

Method clone()

-

The objects of this class are cloneable with this method.

-

Usage

-

ChoicesFilterState$clone(deep = FALSE)

+
+

+
+
+

Method clone() +

+

The objects of this class are cloneable with this method.

+
+

Usage +

+

+
+
ChoicesFilterState$clone(deep = FALSE)
+

+
-

Arguments

-

deep
+

Arguments +

+

+
+
+
deep

Whether to make a deep clone.

-

+
+

+
@@ -197,7 +280,8 @@

Arguments -

Examples

+

Examples +

# use non-exported function from teal.slice
 include_css_files <- getFromNamespace("include_css_files", "teal.slice")
 include_js_files <- getFromNamespace("include_js_files", "teal.slice")
@@ -313,17 +397,19 @@ 

Examples

+ +
+ +
- - + + diff --git a/latest-tag/reference/DFFilterStates.html b/latest-tag/reference/DFFilterStates.html index 6af7a032f..f0020eac4 100644 --- a/latest-tag/reference/DFFilterStates.html +++ b/latest-tag/reference/DFFilterStates.html @@ -1,8 +1,24 @@ - -FilterStates subclass for data frames — DFFilterStates • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
@@ -84,18 +107,25 @@
-

Super class

+

Super class +

teal.slice::FilterStates -> DFFilterStates

-

Methods

+

Methods +

-

Public methods

+

Public methods +

-

Inherited methods +
+

Inherited methods


-

Method new()

+

+
+
+

Method new() +

Initializes DFFilterStates object by setting dataname and initializing state_list (shiny::reactiveVal). This class contains a single state_list with no specified name, which means that when calling the subset function associated with this class -(dplyr::filter), a list of conditions is passed to unnamed arguments (...).

-

Usage

-

DFFilterStates$new(
+(dplyr::filter), a list of conditions is passed to unnamed arguments (...).

+
+

Usage +

+

+
+
DFFilterStates$new(
   data,
   data_reactive = function(sid = "") NULL,
   dataname,
   datalabel = NULL,
   keys = character(0)
-)

+)
+

+
-

Arguments

-

data
+

Arguments +

+

+
+
+
data

(data.frame) the R object which dplyr::filter function will be applied on.

@@ -154,23 +197,41 @@

Arguments
-

Method clone()

-

The objects of this class are cloneable with this method.

-

Usage

-

DFFilterStates$clone(deep = FALSE)

+
+

+
+
+

Method clone() +

+

The objects of this class are cloneable with this method.

+
+

Usage +

+

+
+
DFFilterStates$clone(deep = FALSE)
+

+
-

Arguments

-

deep
+

Arguments +

+

+
+
+
deep

Whether to make a deep clone.

-

+
+

+
@@ -178,7 +239,8 @@

Arguments -

Examples

+

Examples +

# use non-exported function from teal.slice
 include_css_files <- getFromNamespace("include_css_files", "teal.slice")
 include_js_files <- getFromNamespace("include_js_files", "teal.slice")
@@ -323,17 +385,19 @@ 

Examples

+ +

+ +
- - + + diff --git a/latest-tag/reference/DataframeFilteredDataset.html b/latest-tag/reference/DataframeFilteredDataset.html index 164f379e6..cc4f423b6 100644 --- a/latest-tag/reference/DataframeFilteredDataset.html +++ b/latest-tag/reference/DataframeFilteredDataset.html @@ -1,10 +1,26 @@ - -The DataframeFilteredDataset R6 class — DataframeFilteredDataset • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + +
@@ -87,23 +109,30 @@
-

Super class

+

Super class +

teal.slice::FilteredDataset -> DataframeFilteredDataset

+

Inherited methods


-

Method new()

-

Initializes this DataframeFilteredDataset object.

-

Usage

-

DataframeFilteredDataset$new(
+

+
+
+

Method new() +

+

Initializes this DataframeFilteredDataset object.

+
+

Usage +

+

+
+
DataframeFilteredDataset$new(
   dataset,
   dataname,
   keys = character(0),
@@ -127,12 +163,18 @@ 

Usage

parent = NULL, join_keys = character(0), label = character(0) -)

+)
+

+
-

Arguments

-

dataset
+

Arguments +

+

+
+
+
dataset

(data.frame) single data.frame for which filters are rendered.

@@ -170,129 +212,227 @@

Arguments -

Returns

+

Returns +

Object of class DataframeFilteredDataset, invisibly.

-


-

Method get_call()

+
+

+
+
+

Method get_call() +

Gets the subset expression.

This function returns subset expressions equivalent to selected items within each of filter_states. Configuration of the expressions is constant and depends on filter_states type and order which are set during initialization. This class contains single FilterStates which contains single state_list -and all FilterState objects apply to one argument (...) in a dplyr::filter call.

-

Usage

-

DataframeFilteredDataset$get_call(sid = "")

+and all FilterState objects apply to one argument (...) in a dplyr::filter call.

+
+

Usage +

+

+
+
DataframeFilteredDataset$get_call(sid = "")
+

+
-

Arguments

-

sid
+

Arguments +

+

+
+
+
sid

(character) when specified, the method returns code containing conditions calls of FilterState objects with sid different to that of this sid argument.

-

+
+

+
-

Returns

+

Returns +

Either a list of length 1 containing a filter call, or NULL.

-


-

Method set_filter_state()

-

Set filter state.

-

Usage

-

DataframeFilteredDataset$set_filter_state(state)

+
+

+
+
+

Method set_filter_state() +

+

Set filter state.

+
+

Usage +

+

+
+
DataframeFilteredDataset$set_filter_state(state)
+

+
-

Arguments

-

state
+

Arguments +

+

+
+
+
state

(teal_slices)

-

+
+

+
-

Returns

+

Returns +

NULL, invisibly.

-


-

Method remove_filter_state()

-

Remove one or more FilterState form a FilteredDataset.

-

Usage

-

DataframeFilteredDataset$remove_filter_state(state)

+
+

+
+
+

Method remove_filter_state() +

+

Remove one or more FilterState form a FilteredDataset.

+
+

Usage +

+

+
+
DataframeFilteredDataset$remove_filter_state(state)
+

+
-

Arguments

-

state
+

Arguments +

+

+
+
+
state

(teal_slices) specifying FilterState objects to remove; teal_slices may contain only dataname and varname, other elements are ignored

-

+
+

+
-

Returns

+

Returns +

NULL, invisibly.

-


-

Method ui_add()

-

UI module to add filter variable for this dataset.

-

Usage

-

DataframeFilteredDataset$ui_add(id)

+
+

+
+
+

Method ui_add() +

+

UI module to add filter variable for this dataset.

+
+

Usage +

+

+
+
DataframeFilteredDataset$ui_add(id)
+

+
-

Arguments

-

id
+

Arguments +

+

+
+
+
id

(character(1)) shiny module instance id.

-

+
+

+
-

Returns

+

Returns +

shiny.tag

-


-

Method get_filter_overview()

-

Creates row for filter overview in the form of
dataname -- observations (remaining/total) - data.frame

-

Usage

-

DataframeFilteredDataset$get_filter_overview()

+
+

+
+
+

Method get_filter_overview() +

+

Creates row for filter overview in the form of
dataname -- observations (remaining/total) - data.frame

+
+

Usage +

+

+
+
DataframeFilteredDataset$get_filter_overview()
+

+
-

Returns

+

Returns +

A data.frame.

-


-

Method clone()

-

The objects of this class are cloneable with this method.

-

Usage

-

DataframeFilteredDataset$clone(deep = FALSE)

+
+

+
+
+

Method clone() +

+

The objects of this class are cloneable with this method.

+
+

Usage +

+

+
+
DataframeFilteredDataset$clone(deep = FALSE)
+

+
-

Arguments

-

deep
+

Arguments +

+

+
+
+
deep

Whether to make a deep clone.

-

+
+

+
@@ -300,7 +440,8 @@

Arguments -

Examples

+

Examples +

# use non-exported function from teal.slice
 DataframeFilteredDataset <- getFromNamespace("DataframeFilteredDataset", "teal.slice")
 
@@ -394,17 +535,19 @@ 

Examples

+ +
+ +
- - + + diff --git a/latest-tag/reference/DateFilterState.html b/latest-tag/reference/DateFilterState.html index 28f1ed1e2..cbe39b936 100644 --- a/latest-tag/reference/DateFilterState.html +++ b/latest-tag/reference/DateFilterState.html @@ -1,8 +1,24 @@ - -FilterState object for Date data — DateFilterState • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
@@ -84,40 +107,60 @@
-

Super class

+

Super class +

teal.slice::FilterState -> DateFilterState

+

Inherited methods


-

Method new()

-

Initialize a FilterState object.

-

Usage

-

DateFilterState$new(
+

+
+
+

Method new() +

+

Initialize a FilterState object.

+
+

Usage +

+

+
+
DateFilterState$new(
   x,
   x_reactive = reactive(NULL),
   slice,
   extract_type = character(0)
-)

+)
+

+
-

Returns

+

Returns +

Object of class DateFilterState, invisibly.

-


-

Method get_call()

+
+

+
+
+

Method get_call() +

Returns reproducible condition call for current selection. For this class returned call looks like -<varname> >= <min value> & <varname> <= <max value> with optional is.na(<varname>).

-

Usage

-

DateFilterState$get_call(dataname)

+<varname> >= <min value> & <varname> <= <max value> with optional is.na(<varname>).

+
+

Usage +

+

+
+
DateFilterState$get_call(dataname)
+

+
-

Arguments

-

dataname
+

Arguments +

+

+
+
+
dataname

(character(1)) containing possibly prefixed name of data set

-

+
+

+
-

Returns

+

Returns +

call or NULL

-


-

Method clone()

-

The objects of this class are cloneable with this method.

-

Usage

-

DateFilterState$clone(deep = FALSE)

+
+

+
+
+

Method clone() +

+

The objects of this class are cloneable with this method.

+
+

Usage +

+

+
+
DateFilterState$clone(deep = FALSE)
+

+
-

Arguments

-

deep
+

Arguments +

+

+
+
+
deep

Whether to make a deep clone.

-

+
+

+
@@ -197,7 +280,8 @@

Arguments -

Examples

+

Examples +

# use non-exported function from teal.slice
 include_css_files <- getFromNamespace("include_css_files", "teal.slice")
 include_js_files <- getFromNamespace("include_js_files", "teal.slice")
@@ -299,17 +383,19 @@ 

Examples

+ +
+ +
- - + + diff --git a/latest-tag/reference/DatetimeFilterState.html b/latest-tag/reference/DatetimeFilterState.html index 840a81b4f..4b4587b8d 100644 --- a/latest-tag/reference/DatetimeFilterState.html +++ b/latest-tag/reference/DatetimeFilterState.html @@ -1,8 +1,24 @@ - -FilterState object for date time data — DatetimeFilterState • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
@@ -84,44 +107,64 @@
-

Super class

+

Super class +

teal.slice::FilterState -> DatetimeFilterState

+

Inherited methods


-

Method new()

+

+
+
+

Method new() +

Initialize a FilterState object. This class has an extra field, private$timezone, which is set to Sys.timezone() by default. However, in case when using this module in teal app, one needs timezone of the app user. App user timezone is taken from session$userData$timezone -and is set only if object is initialized in shiny.

-

Usage

-

DatetimeFilterState$new(
+and is set only if object is initialized in shiny.

+
+

Usage +

+

+
+
DatetimeFilterState$new(
   x,
   x_reactive = reactive(NULL),
   extract_type = character(0),
   slice
-)

+)
+

+
-

Arguments

-

x
+

Arguments +

+

+
+
+
x

(POSIXct or POSIXlt) variable to be filtered.

@@ -135,11 +178,15 @@

Arguments varname in the condition call will be returned as <dataname>$<varname>

  • "matrix" varname in the condition call will be returned as <dataname>[, <varname>]

  • - + +
    slice
    @@ -151,49 +198,85 @@

    Arguments -

    Returns

    +

    Returns +

    Object of class DatetimeFilterState, invisibly.

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection. For this class returned call looks like -<varname> >= as.POSIXct(<min>) & <varname> <= <max>) with optional is.na(<varname>).

    -

    Usage

    -

    DatetimeFilterState$get_call(dataname)

    +<varname> >= as.POSIXct(<min>) & <varname> <= <max>) with optional is.na(<varname>).

    +
    +

    Usage +

    +

    +
    +
    DatetimeFilterState$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    name of data set; defaults to private$get_dataname()

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    call

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    DatetimeFilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    DatetimeFilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -201,7 +284,8 @@

    Arguments -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     include_css_files <- getFromNamespace("include_css_files", "teal.slice")
     include_js_files <- getFromNamespace("include_js_files", "teal.slice")
    @@ -311,17 +395,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/latest-tag/reference/DefaultFilteredDataset.html b/latest-tag/reference/DefaultFilteredDataset.html index 8efb5a58c..959a4abfc 100644 --- a/latest-tag/reference/DefaultFilteredDataset.html +++ b/latest-tag/reference/DefaultFilteredDataset.html @@ -1,8 +1,24 @@ - -DefaultFilteredDataset R6 class — DefaultFilteredDataset • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,16 +107,20 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilteredDataset -> DefaultFilteredDataset

    +

    Inherited methods


    -

    Method new()

    -

    Initializes this DefaultFilteredDataset object.

    -

    Usage

    -

    DefaultFilteredDataset$new(dataset, dataname, label = character(0))

    +

    +
    +
    +

    Method new() +

    +

    Initializes this DefaultFilteredDataset object.

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$new(dataset, dataname, label = character(0))
    +

    +
    -

    Arguments

    -

    dataset
    +

    Arguments +

    +

    +
    +
    +
    dataset

    any type of object; will not be filtered.

    @@ -134,23 +177,40 @@

    Arguments -

    Returns

    +

    Returns +

    Object of class DefaultFilteredDataset, invisibly.

    -


    -

    Method format()

    -

    Returns a formatted string representing this DefaultFilteredDataset object.

    -

    Usage

    -

    DefaultFilteredDataset$format(show_all, trim_lines = FALSE)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns a formatted string representing this DefaultFilteredDataset object.

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$format(show_all, trim_lines = FALSE)
    +

    +
    -

    Arguments

    -

    show_all
    +

    Arguments +

    +

    +
    +
    +
    show_all

    (logical(1)) for method consistency, ignored.

    @@ -158,167 +218,291 @@

    Arguments -

    Returns

    +

    Returns +

    The formatted string.

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    -

    Usage

    -

    DefaultFilteredDataset$get_call(sid)

    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$get_call(sid)
    +

    +
    -

    Arguments

    -

    sid
    +

    Arguments +

    +

    +
    +
    +
    sid

    (character(1)) for method consistency, ignored.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    +

    +
    +
    +

    Method get_filter_state() +

    -

    Usage

    -

    DefaultFilteredDataset$get_filter_state()

    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$get_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    +

    +
    +
    +

    Method set_filter_state() +

    -

    Usage

    -

    DefaultFilteredDataset$set_filter_state(state)

    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$set_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices) for method consistency, ignored.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    +

    +
    +
    +

    Method clear_filter_states() +

    -

    Usage

    -

    DefaultFilteredDataset$clear_filter_states(force)

    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$clear_filter_states(force)
    +

    +
    -

    Arguments

    -

    force
    +

    Arguments +

    +

    +
    +
    +
    force

    (logical(1)) for method consistency, ignored.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method get_filter_overview()

    -

    Creates row for filter overview in the form of
    dataname - unsupported data class

    -

    Usage

    -

    DefaultFilteredDataset$get_filter_overview()

    +
    +

    +
    +
    +

    Method get_filter_overview() +

    +

    Creates row for filter overview in the form of
    dataname - unsupported data class

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$get_filter_overview()
    +

    +
    -

    Returns

    +

    Returns +

    A data.frame.

    -


    -

    Method ui_active()

    -

    Overwrites parent method.

    -

    Usage

    -

    DefaultFilteredDataset$ui_active(id)

    +
    +

    +
    +
    +

    Method ui_active() +

    +

    Overwrites parent method.

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$ui_active(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Details

    +

    Details +

    Blank UI module that would list active filter states for this dataset.

    -

    Returns

    +

    Returns +

    An empty div.

    -


    -

    Method ui_add()

    -

    Overwrites parent method.

    -

    Usage

    -

    DefaultFilteredDataset$ui_add(id)

    +
    +

    +
    +
    +

    Method ui_add() +

    +

    Overwrites parent method.

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$ui_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Details

    +

    Details +

    Blank UI module that would list active filter states for this dataset.

    -

    Returns

    +

    Returns +

    An empty div.

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    DefaultFilteredDataset$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -326,7 +510,8 @@

    Arguments -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     DefaultFilteredDataset <- getFromNamespace("DefaultFilteredDataset", "teal.slice")
     
    @@ -339,17 +524,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/latest-tag/reference/EmptyFilterState.html b/latest-tag/reference/EmptyFilterState.html index f7dcadc62..0aed053cb 100644 --- a/latest-tag/reference/EmptyFilterState.html +++ b/latest-tag/reference/EmptyFilterState.html @@ -1,8 +1,24 @@ - -FilterState object for empty variables — EmptyFilterState • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,40 +107,60 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterState -> EmptyFilterState

    +

    Inherited methods


    -

    Method new()

    -

    Initialize EmptyFilterState object.

    -

    Usage

    -

    EmptyFilterState$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize EmptyFilterState object.

    +
    +

    Usage +

    +

    +
    +
    EmptyFilterState$new(
       x,
       x_reactive = reactive(NULL),
       extract_type = character(0),
       slice
    -)

    +)
    +

    +
    -

    Arguments

    -

    x
    +

    Arguments +

    +

    + -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection relevant for selected variable type. -Uses internal reactive values, hence must be called in reactive or isolated context.

    -

    Usage

    -

    EmptyFilterState$get_call(dataname)

    +Uses internal reactive values, hence must be called in reactive or isolated context.

    +
    +

    Usage +

    +

    +
    +
    EmptyFilterState$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    name of data set; defaults to private$get_dataname()

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    logical(1)

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    EmptyFilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    EmptyFilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -196,7 +279,8 @@

    Arguments -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     include_js_files <- getFromNamespace("include_js_files", "teal.slice")
     EmptyFilterState <- getFromNamespace("EmptyFilterState", "teal.slice")
    @@ -217,17 +301,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/latest-tag/reference/FilterPanelAPI.html b/latest-tag/reference/FilterPanelAPI.html index a2e99bf8a..4fbb75ada 100644 --- a/latest-tag/reference/FilterPanelAPI.html +++ b/latest-tag/reference/FilterPanelAPI.html @@ -1,8 +1,24 @@ - -Class to encapsulate the API of the filter panel of a teal app — FilterPanelAPI • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,7 +106,8 @@
    -

    Details

    +

    Details +

    The purpose of this class is to encapsulate the API of the filter panel in a new class FilterPanelAPI so that it can be passed and used in the server call of any module instead of passing the whole FilteredData object.

    @@ -92,125 +115,223 @@

    Details

    -

    Methods

    +

    Methods +


    -

    Method new()

    -

    Initialize a FilterPanelAPI object.

    -

    Usage

    -

    FilterPanelAPI$new(datasets)

    + +
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterPanelAPI object.

    +
    +

    Usage +

    +

    +
    +
    FilterPanelAPI$new(datasets)
    +

    +
    -

    Arguments

    -

    datasets
    +

    Arguments +

    +

    +
    +
    +
    datasets

    (FilteredData)

    -

    +
    +

    +
    -


    +

    +
    +
    +

    Method get_filter_state() +

    Gets the reactive values from the active FilterState objects of the FilteredData object.

    Gets all active filters in the form of a nested list. -The output list is a compatible input to set_filter_state.

    -

    Usage

    -

    FilterPanelAPI$get_filter_state()

    +The output list is a compatible input to set_filter_state.

    +
    +

    Usage +

    +

    +
    +
    FilterPanelAPI$get_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    list with named elements corresponding to FilteredDataset objects with active filters.

    -


    -

    Method set_filter_state()

    -

    Sets active filter states.

    -

    Usage

    -

    FilterPanelAPI$set_filter_state(filter)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Sets active filter states.

    +
    +

    Usage +

    +

    +
    +
    FilterPanelAPI$set_filter_state(filter)
    +

    +
    -

    Arguments

    -

    filter
    +

    Arguments +

    +

    +
    +
    +
    filter

    (teal_slices)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method remove_filter_state()

    -

    Remove one or more FilterState of a FilteredDataset in the FilteredData object.

    -

    Usage

    -

    FilterPanelAPI$remove_filter_state(filter)

    +
    +

    +
    +
    +

    Method remove_filter_state() +

    +

    Remove one or more FilterState of a FilteredDataset in the FilteredData object.

    +
    +

    Usage +

    +

    +
    +
    FilterPanelAPI$remove_filter_state(filter)
    +

    +
    -

    Arguments

    -

    filter
    +

    Arguments +

    +

    +
    +
    +
    filter

    (teal_slices) specifying FilterState objects to remove; teal_slices may contain only dataname and varname, other elements are ignored

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method clear_filter_states()

    -

    Remove all FilterStates of the FilteredData object.

    -

    Usage

    -

    FilterPanelAPI$clear_filter_states(datanames)

    +
    +

    +
    +
    +

    Method clear_filter_states() +

    +

    Remove all FilterStates of the FilteredData object.

    +
    +

    Usage +

    +

    +
    +
    FilterPanelAPI$clear_filter_states(datanames)
    +

    +
    -

    Arguments

    -

    datanames
    +

    Arguments +

    +

    +
    +
    +
    datanames

    (character) datanames to remove their FilterStates; omit to remove all FilterStates in the FilteredData object

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    FilterPanelAPI$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    FilterPanelAPI$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -218,7 +339,8 @@

    Arguments -

    Examples

    +

    Examples +

    library(shiny)
     
     fd <- init_filtered_data(list(iris = iris))
    @@ -289,17 +411,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/latest-tag/reference/FilterState.html b/latest-tag/reference/FilterState.html index 2ed9dd5b9..2156cd5b6 100644 --- a/latest-tag/reference/FilterState.html +++ b/latest-tag/reference/FilterState.html @@ -1,8 +1,24 @@ - -FilterState abstract class — FilterState • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,12 +107,15 @@
    -

    Details

    +

    Details +

    This class is responsible for managing a single filter item within a FilteredData object and outputs a condition call (logical predicate) for subsetting one variable. Filter states depend on the variable type: (logical, integer, numeric, character, factor, Date, POSIXct, POSIXlt) -and FilterState subclasses exist that correspond to those types.

    +

    Each variable's filter state is an R6 object keeps the variable that is filtered, a teal_slice object that describes the filter state, as well as a shiny module (UI and server) that allows the user to alter the filter state. Changes to the filter state that cause some observations to be omitted trigger the get_call method and every R function call up in the reactive chain.

    -

    Modifying state

    +

    Modifying state +

    -

    Modifying a FilterState object is possible in three scenarios:

    • In an interactive session, by passing an appropriate teal_slice to the set_state method.

    • +

      Modifying a FilterState object is possible in three scenarios:

      +
        +
      • In an interactive session, by passing an appropriate teal_slice to the set_state method.

      • In a running application, by changing appropriate inputs.

      • In a running application, by using filter_state_api which directly uses set_state method of the FilterState object.

      • -
    + +
    -

    Methods

    +

    Methods +


    -

    Method new()

    -

    Initialize a FilterState object.

    -

    Usage

    -

    FilterState$new(
    +
    +
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterState object.

    +
    +

    Usage +

    +

    +
    +
    FilterState$new(
       x,
       x_reactive = reactive(NULL),
       slice,
       extract_type = character(0)
    -)

    +)
    +

    +
    -

    Returns

    +

    Returns +

    Object of class FilterState, invisibly.

    -


    -

    Method format()

    -

    Returns a formatted string representing this FilterState object.

    -

    Usage

    -

    FilterState$format(show_all = FALSE, trim_lines = TRUE)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns a formatted string representing this FilterState object.

    +
    +

    Usage +

    +

    +
    +
    FilterState$format(show_all = FALSE, trim_lines = TRUE)
    +

    +
    -

    Arguments

    -

    show_all
    +

    Arguments +

    +

    +
    +
    +
    show_all

    (logical(1)) passed to format.teal_slice

    @@ -197,106 +267,196 @@

    Arguments -

    Returns

    +

    Returns +

    character(1) the formatted string

    -


    -

    Method print()

    -

    Prints this FilterState object.

    -

    Usage

    -

    FilterState$print(...)

    +
    +

    +
    +
    +

    Method print() +

    +

    Prints this FilterState object.

    +
    +

    Usage +

    +

    +
    +
    FilterState$print(...)
    +

    +
    -

    Arguments

    -

    ...
    +

    Arguments +

    +

    +
    +
    +
    ...

    additional arguments

    -

    +
    +

    +
    -


    -

    Method set_state()

    -

    Sets mutable parameters of the filter state.

    • fixed state is prevented from changing state

    • +
    +

    +
    +
    +

    Method set_state() +

    +

    Sets mutable parameters of the filter state.

    +
      +
    • fixed state is prevented from changing state

    • anchored state is prevented from removing state

    • -
    -

    Usage

    -

    FilterState$set_state(state)

    + +
    +

    Usage +

    +

    +
    +
    FilterState$set_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slice)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    self invisibly

    -


    -

    Method get_state()

    -

    Returns a complete description of the filter state.

    -

    Usage

    -

    FilterState$get_state()

    +
    +

    +
    +
    +

    Method get_state() +

    +

    Returns a complete description of the filter state.

    +
    +

    Usage +

    +

    +
    +
    FilterState$get_state()
    +

    +
    -

    Returns

    +

    Returns +

    A teal_slice object.

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection relevant for selected variable type. Method is using internal reactive values which makes it reactive -and must be executed in reactive or isolated context.

    -

    Usage

    -

    FilterState$get_call()

    +and must be executed in reactive or isolated context.

    +
    +

    Usage +

    +

    +
    +
    FilterState$get_call()
    +

    +
    -


    -

    Method server()

    -

    shiny module server.

    -

    Usage

    -

    FilterState$server(id)

    +
    +

    +
    +
    +

    Method server() +

    +

    shiny module server.

    +
    +

    Usage +

    +

    +
    +
    FilterState$server(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Reactive expression signaling that remove button has been clicked.

    -


    -

    Method ui()

    +
    +

    +
    +
    +

    Method ui() +

    shiny UI module. -The UI for this class contains simple message stating that it is not supported.

    -

    Usage

    -

    FilterState$ui(id, parent_id = "cards")

    +The UI for this class contains simple message stating that it is not supported.

    +
    +

    Usage +

    +

    +
    +
    FilterState$ui(id, parent_id = "cards")
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    @@ -305,35 +465,64 @@

    Arguments
    -

    Method destroy_observers()

    -

    Destroy observers stored in private$observers.

    -

    Usage

    -

    FilterState$destroy_observers()

    +
    +

    +
    +
    +

    Method destroy_observers() +

    +

    Destroy observers stored in private$observers.

    +
    +

    Usage +

    +

    +
    +
    FilterState$destroy_observers()
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    FilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    FilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -341,17 +530,19 @@

    Arguments

    + +

    + +
    - - + + diff --git a/latest-tag/reference/FilterStateExpr.html b/latest-tag/reference/FilterStateExpr.html index 6b5e6af54..f086f1df5 100644 --- a/latest-tag/reference/FilterStateExpr.html +++ b/latest-tag/reference/FilterStateExpr.html @@ -1,8 +1,24 @@ - -FilterStateExpr R6 class — FilterStateExpr • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,18 +107,22 @@
    -

    Details

    +

    Details +

    Creates a filter state around a predefined condition call (logical predicate). The condition call is independent of the data and the filter card allows no interaction (the filter is always fixed).

    -

    Methods

    +

    Methods +


    -

    Method new()

    -

    Initialize a FilterStateExpr object.

    -

    Usage

    -

    FilterStateExpr$new(slice)

    + +
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterStateExpr object.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$new(slice)
    +

    +
    -

    Arguments

    -

    slice
    +

    Arguments +

    +

    +
    +
    +
    slice

    (teal_slice_expr)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Object of class FilterStateExpr, invisibly.

    -


    -

    Method format()

    -

    Returns a formatted string representing this FilterStateExpr object.

    -

    Usage

    -

    FilterStateExpr$format(show_all = FALSE, trim_lines = TRUE)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns a formatted string representing this FilterStateExpr object.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$format(show_all = FALSE, trim_lines = TRUE)
    +

    +
    -

    Arguments

    -

    show_all
    +

    Arguments +

    +

    +
    +
    +
    show_all

    (logical(1)) passed to format.teal_slice

    @@ -142,133 +201,242 @@

    Arguments -

    Returns

    +

    Returns +

    character(1) the formatted string

    -


    -

    Method print()

    -

    Prints this FilterStateExpr object.

    -

    Usage

    -

    FilterStateExpr$print(...)

    +
    +

    +
    +
    +

    Method print() +

    +

    Prints this FilterStateExpr object.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$print(...)
    +

    +
    -

    Arguments

    -

    ...
    +

    Arguments +

    +

    +
    +
    +
    ...

    arguments passed to the format method

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method get_state()

    -

    Returns a complete description of this filter state.

    -

    Usage

    -

    FilterStateExpr$get_state()

    +
    +

    +
    +
    +

    Method get_state() +

    +

    Returns a complete description of this filter state.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$get_state()
    +

    +
    -

    Returns

    +

    Returns +

    A teal_slice object.

    -


    -

    Method set_state()

    -

    Does nothing. Exists for compatibility.

    -

    Usage

    -

    FilterStateExpr$set_state(state)

    +
    +

    +
    +
    +

    Method set_state() +

    +

    Does nothing. Exists for compatibility.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$set_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slice)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    self, invisibly.

    -


    -

    Method get_call()

    -

    Get reproducible call.

    -

    Usage

    -

    FilterStateExpr$get_call(dataname)

    +
    +

    +
    +
    +

    Method get_call() +

    +

    Get reproducible call.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    -

    (ignored) for a consistency with FilterState

    +

    Arguments +

    +

    +
    +
    +
    dataname
    +
    +

    (ignored) for a consistency with FilterState

    Returns reproducible condition call for current selection relevant for selected variable type. Method is using internal reactive values which makes it reactive -and must be executed in reactive or isolated context.

    +and must be executed in reactive or isolated context.

    +
    -

    + +

    +
    -

    Returns

    +

    Returns +

    call or NULL

    -


    -

    Method destroy_observers()

    -

    Destroy observers stored in private$observers.

    -

    Usage

    -

    FilterStateExpr$destroy_observers()

    +
    +

    +
    +
    +

    Method destroy_observers() +

    +

    Destroy observers stored in private$observers.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$destroy_observers()
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method server()

    -

    shiny module server.

    -

    Usage

    -

    FilterStateExpr$server(id)

    +
    +

    +
    +
    +

    Method server() +

    +

    shiny module server.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$server(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Reactive expression signaling that the remove button has been clicked.

    -


    -

    Method ui()

    +
    +

    +
    +
    +

    Method ui() +

    shiny module UI. -The UI for this class contains simple message stating that it is not supported.

    -

    Usage

    -

    FilterStateExpr$ui(id, parent_id = "cards")

    +The UI for this class contains simple message stating that it is not supported.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$ui(id, parent_id = "cards")
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    @@ -278,23 +446,41 @@

    Arguments
    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    FilterStateExpr$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -302,7 +488,8 @@

    Arguments -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     include_js_files <- getFromNamespace("include_js_files", "teal.slice")
     include_css_files <- getFromNamespace("include_css_files", "teal.slice")
    @@ -355,17 +542,19 @@ 

    Examples

    + +

    + +
    - - + + diff --git a/latest-tag/reference/FilterStates.html b/latest-tag/reference/FilterStates.html index 08f5f0b55..8ed054d79 100644 --- a/latest-tag/reference/FilterStates.html +++ b/latest-tag/reference/FilterStates.html @@ -1,5 +1,10 @@ - - + + + + + +FilterStates R6 class — FilterStates • teal.slice +FilterStates R6 class — FilterStates • teal.slice + + + + + + + + + + Skip to contents @@ -38,7 +54,8 @@ + +
    @@ -114,12 +137,15 @@
    -

    Methods

    +

    Methods +


    -

    Method new()

    + +
    +

    +
    +
    +

    Method new() +

    Initializes FilterStates object by setting -dataname, and datalabel.

    -

    Usage

    -

    FilterStates$new(
    +dataname, and datalabel.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$new(
       data,
       data_reactive = function(sid = "") NULL,
       dataname,
       datalabel = NULL
    -)

    +)
    +

    +
    -

    Arguments

    -

    data
    +

    Arguments +

    +

    +
    +
    +
    data

    (data.frame or MultiAssayExperiment or SummarizedExperiment or matrix) the R object which subset function is applied on.

    @@ -171,23 +212,40 @@

    Arguments -

    Returns

    +

    Returns +

    Object of class FilterStates, invisibly.

    -


    -

    Method format()

    -

    Returns a formatted string representing this FilterStates object.

    -

    Usage

    -

    FilterStates$format(show_all = FALSE, trim_lines = TRUE)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns a formatted string representing this FilterStates object.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$format(show_all = FALSE, trim_lines = TRUE)
    +

    +
    -

    Arguments

    -

    show_all
    +

    Arguments +

    +

    +
    +
    +
    show_all

    (logical(1)) passed to format.teal_slices

    @@ -195,28 +253,40 @@

    Arguments -

    Returns

    +

    Returns +

    character(1) the formatted string

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Filter call

    Builds subset expression from condition calls generated by FilterState. The lhs of the expression is a dataname_prefixed, where word prefixed refers to situation when call is evaluated on elements of the original data, for example dataname[[x]]. By default dataname_prefixed = dataname and it's not alterable through class methods. Customization of private$dataname_prefixed is done through inheriting classes.

    -

    The rhs is a call to private$fun with following arguments:

    • dataname_prefixed

    • +

      The rhs is a call to private$fun with following arguments:

      +
        +
      • dataname_prefixed

      • list of logical expressions generated by FilterState objects stored in private$state_list. Each logical predicate is combined with & operator. Variables in these logical expressions by default are not prefixed but this can be changed by setting private$extract_type (change in the similar way as dataname_prefixed) Possible call outputs depending on a custom fields/options:

      • -

      # default
      +
    +

    +
    +
    # default
     dataname <- subset(dataname, col == "x")
     
     # fun = dplyr::filter
    @@ -229,222 +299,399 @@ 

    Method get_call()dataname <- subset(dataname, subset = row_col == "x", select = col_col == "x") # dataname = dataname[[element]] -dataname[[element]] <- subset(dataname[[element]], subset = col == "x")

    -

    If no filters are applied, NULL is returned to avoid no-op calls such as dataname <- dataname.

    -

    Usage

    -

    FilterStates$get_call(sid = "")

    +dataname[[element]] <- subset(dataname[[element]], subset = col == "x")
    +

    +
    +

    If no filters are applied, NULL is returned to avoid no-op calls such as dataname <- dataname.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$get_call(sid = "")
    +

    +
    -

    Arguments

    -

    sid
    +

    Arguments +

    +

    +
    +
    +
    sid

    (character) when specified then method returns code containing condition calls (logical predicates) of FilterState objects which "sid" attribute is different than this sid argument.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    call or NULL

    -


    -

    Method print()

    -

    Prints this FilterStates object.

    -

    Usage

    -

    FilterStates$print(...)

    +
    +

    +
    +
    +

    Method print() +

    +

    Prints this FilterStates object.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$print(...)
    +

    +
    -

    Arguments

    -

    ...
    +

    Arguments +

    +

    +
    +
    +
    ...

    additional arguments passed to format.

    -

    +
    +

    +
    -


    -

    Method remove_filter_state()

    -

    Remove one or more FilterStates from the state_list along with their UI elements.

    -

    Usage

    -

    FilterStates$remove_filter_state(state)

    +
    +

    +
    +
    +

    Method remove_filter_state() +

    +

    Remove one or more FilterStates from the state_list along with their UI elements.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$remove_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices) specifying FilterState objects to remove; teal_slices may contain only dataname and varname, other elements are ignored

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    +

    +
    +
    +

    Method get_filter_state() +

    Gets reactive values from active FilterState objects.

    Get active filter state from FilterState objects stored in state_list(s). -The output is a list compatible with input to self$set_filter_state.

    -

    Usage

    -

    FilterStates$get_filter_state()

    +The output is a list compatible with input to self$set_filter_state.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$get_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    Object of class teal_slices.

    -


    -

    Method set_filter_state()

    -

    Sets active FilterState objects.

    -

    Usage

    -

    FilterStates$set_filter_state(state)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Sets active FilterState objects.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$set_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Function that raises an error.

    -


    -

    Method clear_filter_states()

    -

    Remove all FilterState objects from this FilterStates object.

    -

    Usage

    -

    FilterStates$clear_filter_states(force = FALSE)

    +
    +

    +
    +
    +

    Method clear_filter_states() +

    +

    Remove all FilterState objects from this FilterStates object.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$clear_filter_states(force = FALSE)
    +

    +
    -

    Arguments

    -

    force
    +

    Arguments +

    +

    +
    +
    +
    force

    (logical(1)) flag specifying whether to include anchored filter states.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method ui_active()

    +
    +

    +
    +
    +

    Method ui_active() +

    shiny UI definition that stores FilterState UI elements. -Populated with elements created with renderUI in the module server.

    -

    Usage

    -

    FilterStates$ui_active(id)

    +Populated with elements created with renderUI in the module server.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$ui_active(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_active()

    -

    shiny server module.

    -

    Usage

    -

    FilterStates$srv_active(id)

    +
    +

    +
    +
    +

    Method srv_active() +

    +

    shiny server module.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$srv_active(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL.

    -


    -

    Method ui_add()

    -

    shiny UI module to add filter variable.

    -

    Usage

    -

    FilterStates$ui_add(id)

    +
    +

    +
    +
    +

    Method ui_add() +

    +

    shiny UI module to add filter variable.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$ui_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_add()

    +
    +

    +
    +
    +

    Method srv_add() +

    shiny server module to add filter variable.

    This module controls available choices to select as a filter variable. Once selected, a variable is removed from available choices. -Removing a filter variable adds it back to available choices.

    -

    Usage

    -

    FilterStates$srv_add(id)

    +Removing a filter variable adds it back to available choices.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$srv_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL.

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    FilterStates$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -452,17 +699,19 @@

    Arguments

    + +
    + +
    - - + + diff --git a/latest-tag/reference/FilteredData.html b/latest-tag/reference/FilteredData.html index 5e690874d..cef5a5636 100644 --- a/latest-tag/reference/FilteredData.html +++ b/latest-tag/reference/FilteredData.html @@ -1,8 +1,24 @@ - -Class to encapsulate filtered datasets — FilteredData • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,7 +106,8 @@ + +
    -

    Methods

    +

    Methods +


    -

    Method new()

    -

    Initialize a FilteredData object.

    -

    Usage

    -

    FilteredData$new(data_objects, join_keys = teal.data::join_keys())

    + +
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilteredData object.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$new(data_objects, join_keys = teal.data::join_keys())
    +

    +
    -

    Arguments

    -

    data_objects
    +

    Arguments +

    +

    +
    +
    +
    data_objects

    (named list) List of data objects. Names of the list will be used as dataname for respective datasets.

    @@ -157,65 +204,113 @@

    Argumentsteal.data::join_keys().

    -

    +
    +

    +
    -


    -

    Method datanames()

    -

    Gets datanames.

    -

    Usage

    -

    FilteredData$datanames()

    +
    +

    +
    +
    +

    Method datanames() +

    +

    Gets datanames.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$datanames()
    +

    +
    -

    Details

    +

    Details +

    The datanames are returned in the order in which they must be evaluated (in case of dependencies).

    -

    Returns

    +

    Returns +

    Character vector.

    -


    -

    Method get_datalabel()

    +
    +

    +
    +
    +

    Method get_datalabel() +

    Gets data label for the dataset. -Useful to display in Show R Code.

    -

    Usage

    -

    FilteredData$get_datalabel(dataname)

    +Useful to display in Show R Code.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_datalabel(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Character string.

    -


    -

    Method set_available_teal_slices()

    -

    Set list of external filter states available for activation.

    -

    Usage

    -

    FilteredData$set_available_teal_slices(x)

    +
    +

    +
    +
    +

    Method set_available_teal_slices() +

    +

    Set list of external filter states available for activation.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$set_available_teal_slices(x)
    +

    +
    -

    Arguments

    -

    x
    +

    Arguments +

    +

    +
    +
    +
    x

    (reactive) should return teal_slices

    -

    +
    +

    +
    -

    Details

    +

    Details +

    Unlike adding new filter from the column, these filters can come with some prespecified settings. teal_slices are wrapped in a reactive so they can be updated from elsewhere in the app. Filters passed in x are limited to those that can be set for this FilteredData object, @@ -224,46 +319,76 @@

    Details -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method get_available_teal_slices()

    -

    Get list of filter states available for this object.

    -

    Usage

    -

    FilteredData$get_available_teal_slices()

    +
    +

    +
    +
    +

    Method get_available_teal_slices() +

    +

    Get list of filter states available for this object.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_available_teal_slices()
    +

    +
    -

    Details

    +

    Details +

    All teal_slice objects that have been created since the beginning of the app session are stored in one teal_slices object. This returns a subset of that teal_slices, describing filter states that can be set for this object.

    -

    Returns

    +

    Returns +

    reactive that returns teal_slices.

    -


    -

    Method get_call()

    -

    Gets a call to filter the dataset according to the filter state.

    -

    Usage

    -

    FilteredData$get_call(dataname)

    +
    +

    +
    +
    +

    Method get_call() +

    +

    Gets a call to filter the dataset according to the filter state.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset

    -

    +
    +

    +
    -

    Details

    +

    Details +

    It returns a call to filter the dataset only, assuming the other (filtered) datasets it depends on are available.

    Together with self$datanames() which returns the datasets in the correct @@ -277,21 +402,36 @@

    Details -

    Returns

    +

    Returns +

    A list of calls.

    -


    -

    Method get_data()

    +
    +

    +
    +
    +

    Method get_data() +

    Gets filtered or unfiltered dataset.

    -

    For filtered = FALSE, the original data set with set_data is returned including all attributes.

    -

    Usage

    -

    FilteredData$get_data(dataname, filtered = TRUE)

    +

    For filtered = FALSE, the original data set with set_data is returned including all attributes.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_data(dataname, filtered = TRUE)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset.

    @@ -299,77 +439,139 @@

    Arguments -

    Returns

    +

    Returns +

    A data object, a data.frame or a MultiAssayExperiment.

    -


    -

    Method get_join_keys()

    -

    Get join keys between two datasets.

    -

    Usage

    -

    FilteredData$get_join_keys()

    +
    +

    +
    +
    +

    Method get_join_keys() +

    +

    Get join keys between two datasets.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_join_keys()
    +

    +
    -

    Returns

    +

    Returns +

    join_keys

    -


    -

    Method get_filter_overview()

    +
    +

    +
    +
    +

    Method get_filter_overview() +

    Creates filter overview table to be displayed in the application. One row is created per dataset, according to the get_filter_overview methods -of the contained FilteredDataset objects.

    -

    Usage

    -

    FilteredData$get_filter_overview(datanames)

    +of the contained FilteredDataset objects.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_filter_overview(datanames)
    +

    +
    -

    Arguments

    -

    datanames
    +

    Arguments +

    +

    +
    +
    +
    datanames

    (character) vector of dataset names.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    A data.frame listing the numbers of observations in all datasets.

    -


    -

    Method get_keys()

    -

    Get keys for the dataset.

    -

    Usage

    -

    FilteredData$get_keys(dataname)

    +
    +

    +
    +
    +

    Method get_keys() +

    +

    Get keys for the dataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_keys(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Character vector of key column names.

    -


    -

    Method set_dataset()

    -

    Adds a dataset to this FilteredData.

    -

    Usage

    -

    FilteredData$set_dataset(data, dataname)

    +
    +

    +
    +
    +

    Method set_dataset() +

    +

    Adds a dataset to this FilteredData.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$set_dataset(data, dataname)
    +

    +
    -

    Arguments

    -

    data
    +

    Arguments +

    +

    +
    +
    +
    data

    (data.frame or MultiAssayExperiment) data to be filtered.

    @@ -379,10 +581,13 @@

    Arguments -

    Details

    +

    Details +

    set_dataset creates a FilteredDataset object which keeps dataset for the filtering purpose. If this data has a parent specified in the join_keys object stored in private$join_keys then created FilteredDataset (child) gets linked with other FilteredDataset (parent). @@ -391,52 +596,95 @@

    Details -

    Returns

    +

    Returns +

    self, invisibly.

    -


    -

    Method set_join_keys()

    -

    Set the join_keys.

    -

    Usage

    -

    FilteredData$set_join_keys(join_keys)

    +
    +

    +
    +
    +

    Method set_join_keys() +

    +

    Set the join_keys.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$set_join_keys(join_keys)
    +

    +
    -

    Arguments

    -

    join_keys
    +

    Arguments +

    +

    +
    +
    +
    join_keys

    (join_keys), see teal.data::join_keys().

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    self, invisibly.

    -


    -

    Method get_filter_state()

    -

    Gets states of all contained FilterState objects.

    -

    Usage

    -

    FilteredData$get_filter_state()

    +
    +

    +
    +
    +

    Method get_filter_state() +

    +

    Gets states of all contained FilterState objects.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    A teal_slices object.

    -


    -

    Method format()

    -

    Returns a formatted string representing this FilteredData object.

    -

    Usage

    -

    FilteredData$format(show_all = FALSE, trim_lines = TRUE)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns a formatted string representing this FilteredData object.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$format(show_all = FALSE, trim_lines = TRUE)
    +

    +
    -

    Arguments

    -

    show_all
    +

    Arguments +

    +

    +
    +
    +
    show_all

    (logical(1)) passed to format.teal_slice.

    @@ -444,81 +692,148 @@

    Arguments -

    Returns

    +

    Returns +

    character(1) the formatted string.

    -


    -

    Method print()

    -

    Prints this FilteredData object.

    -

    Usage

    -

    FilteredData$print(...)

    +
    +

    +
    +
    +

    Method print() +

    +

    Prints this FilteredData object.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$print(...)
    +

    +
    -

    Arguments

    -

    ...
    +

    Arguments +

    +

    +
    +
    +
    ...

    additional arguments passed to format.

    -

    +
    +

    +
    -


    -

    Method set_filter_state()

    -

    Sets active filter states.

    -

    Usage

    -

    FilteredData$set_filter_state(state)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Sets active filter states.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$set_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method remove_filter_state()

    -

    Removes one or more FilterState from a FilteredData object.

    -

    Usage

    -

    FilteredData$remove_filter_state(state)

    +
    +

    +
    +
    +

    Method remove_filter_state() +

    +

    Removes one or more FilterState from a FilteredData object.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$remove_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices) specifying FilterState objects to remove; teal_slices may contain only dataname and varname, other elements are ignored.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method clear_filter_states()

    -

    Remove all FilterStates of a FilteredDataset or all FilterStates of a FilteredData object.

    -

    Usage

    -

    FilteredData$clear_filter_states(datanames = self$datanames(), force = FALSE)

    +
    +

    +
    +
    +

    Method clear_filter_states() +

    +

    Remove all FilterStates of a FilteredDataset or all FilterStates of a FilteredData object.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$clear_filter_states(datanames = self$datanames(), force = FALSE)
    +

    +
    -

    Arguments

    -

    datanames
    +

    Arguments +

    +

    +
    +
    +
    datanames

    (character) names of datasets for which to remove all filter states. Defaults to all datasets in this FilteredData object.

    @@ -529,45 +844,79 @@

    Arguments -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method ui_filter_panel()

    +
    +

    +
    +
    +

    Method ui_filter_panel() +

    top-level shiny module for the filter panel in the teal app. -Contains 1) filter overview panel, 2) filter active panel, and 3) add filters panel.

    -

    Usage

    -

    FilteredData$ui_filter_panel(id)

    +Contains 1) filter overview panel, 2) filter active panel, and 3) add filters panel.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$ui_filter_panel(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_filter_panel()

    -

    Server function for filter panel.

    -

    Usage

    -

    FilteredData$srv_filter_panel(id, active_datanames = self$datanames)

    +
    +

    +
    +
    +

    Method srv_filter_panel() +

    +

    Server function for filter panel.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$srv_filter_panel(id, active_datanames = self$datanames)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    @@ -580,44 +929,78 @@

    Arguments -

    Returns

    +

    Returns +

    NULL.

    -


    -

    Method ui_active()

    -

    Server module responsible for displaying active filters.

    -

    Usage

    -

    FilteredData$ui_active(id)

    +
    +

    +
    +
    +

    Method ui_active() +

    +

    Server module responsible for displaying active filters.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$ui_active(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_active()

    -

    Server module responsible for displaying active filters.

    -

    Usage

    -

    FilteredData$srv_active(id, active_datanames = self$datanames)

    +
    +

    +
    +
    +

    Method srv_active() +

    +

    Server module responsible for displaying active filters.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$srv_active(id, active_datanames = self$datanames)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    @@ -627,44 +1010,78 @@

    Arguments -

    Returns

    +

    Returns +

    NULL.

    -


    -

    Method ui_add()

    -

    Server module responsible for displaying drop-downs with variables to add a filter.

    -

    Usage

    -

    FilteredData$ui_add(id)

    +
    +

    +
    +
    +

    Method ui_add() +

    +

    Server module responsible for displaying drop-downs with variables to add a filter.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$ui_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_add()

    -

    Server module responsible for displaying drop-downs with variables to add a filter.

    -

    Usage

    -

    FilteredData$srv_add(id, active_datanames = reactive(self$datanames()))

    +
    +

    +
    +
    +

    Method srv_add() +

    +

    Server module responsible for displaying drop-downs with variables to add a filter.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$srv_add(id, active_datanames = reactive(self$datanames()))
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    @@ -674,45 +1091,78 @@

    Arguments -

    Returns

    +

    Returns +

    NULL.

    -


    -

    Method ui_overview()

    +
    +

    +
    +
    +

    Method ui_overview() +

    Creates the UI definition for the module showing counts for each dataset contrasting the filtered to the full unfiltered dataset.

    Per dataset, it displays the number of rows/observations in each dataset, -the number of unique subjects.

    -

    Usage

    -

    FilteredData$ui_overview(id)

    +the number of unique subjects.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$ui_overview(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -


    -

    Method srv_overview()

    +
    +

    +
    +
    +

    Method srv_overview() +

    Server function to display the number of records in the filtered and unfiltered -data.

    -

    Usage

    -

    FilteredData$srv_overview(id, active_datanames = self$datanames)

    +data.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$srv_overview(id, active_datanames = self$datanames)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    @@ -725,27 +1175,46 @@

    Arguments -

    Returns

    +

    Returns +

    NULL.

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    FilteredData$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -753,7 +1222,8 @@

    Arguments -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     FilteredData <- getFromNamespace("FilteredData", "teal.slice")
     
    @@ -931,17 +1401,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/latest-tag/reference/FilteredDataset.html b/latest-tag/reference/FilteredDataset.html index e09e98053..ca6a3587c 100644 --- a/latest-tag/reference/FilteredDataset.html +++ b/latest-tag/reference/FilteredDataset.html @@ -1,16 +1,32 @@ - - + + + + + +FilteredDataset R6 class — FilteredDataset • teal.slice +FilteredDataset R6 class — FilteredDataset • teal.slice + + + + + + + + + + Skip to contents @@ -26,7 +42,8 @@ + +
    @@ -96,12 +119,15 @@
    -

    Methods

    +

    Methods +


    -

    Method new()

    -

    Initializes this FilteredDataset object.

    -

    Usage

    -

    +

    +
    +
    +

    Method new() +

    +

    Initializes this FilteredDataset object.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$new(
       dataset,
       dataname,
       keys = character(0),
       label = attr(dataset, "label", exact = TRUE)
    -)

    +)
    +

    +
    -

    Arguments

    -

    dataset
    +

    Arguments +

    +

    +
    +
    +
    dataset

    any object

    @@ -152,23 +193,40 @@

    Arguments -

    Returns

    +

    Returns +

    Object of class FilteredDataset, invisibly.

    -


    -

    Method format()

    -

    Returns a formatted string representing this FilteredDataset object.

    -

    Usage

    -

    FilteredDataset$format(show_all = FALSE, trim_lines = TRUE)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns a formatted string representing this FilteredDataset object.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$format(show_all = FALSE, trim_lines = TRUE)
    +

    +
    -

    Arguments

    -

    show_all
    +

    Arguments +

    +

    +
    +
    +
    show_all

    (logical(1)) passed to format.teal_slice.

    @@ -176,289 +234,526 @@

    Arguments -

    Returns

    +

    Returns +

    The formatted character string.

    -


    -

    Method print()

    -

    Prints this FilteredDataset object.

    -

    Usage

    -

    FilteredDataset$print(...)

    +
    +

    +
    +
    +

    Method print() +

    +

    Prints this FilteredDataset object.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$print(...)
    +

    +
    -

    Arguments

    -

    ...
    +

    Arguments +

    +

    +
    +
    +
    ...

    additional arguments passed to format.

    -

    +
    +

    +
    -


    -

    Method clear_filter_states()

    -

    Removes all filter items applied to this dataset.

    -

    Usage

    -

    FilteredDataset$clear_filter_states(force = FALSE)

    +
    +

    +
    +
    +

    Method clear_filter_states() +

    +

    Removes all filter items applied to this dataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$clear_filter_states(force = FALSE)
    +

    +
    -

    Arguments

    -

    force
    +

    Arguments +

    +

    +
    +
    +
    force

    (logical(1)) flag specifying whether to include anchored filter states.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL.

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Gets a filter expression.

    This function returns filter calls equivalent to selected items within each of filter_states. Configuration of the calls is constant and -depends on filter_states type and order which are set during initialization.

    -

    Usage

    -

    FilteredDataset$get_call(sid = "")

    +depends on filter_states type and order which are set during initialization.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_call(sid = "")
    +

    +
    -

    Arguments

    -

    sid
    +

    Arguments +

    +

    +
    +
    +
    sid

    (character) when specified, the method returns code containing conditions calls of FilterState objects with sid different to this sid argument.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Either a list of filter calls, or NULL.

    -


    -

    Method get_filter_state()

    -

    Gets states of all contained FilterState objects.

    -

    Usage

    -

    FilteredDataset$get_filter_state()

    +
    +

    +
    +
    +

    Method get_filter_state() +

    +

    Gets states of all contained FilterState objects.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    A teal_slices object.

    -


    -

    Method set_filter_state()

    -

    Set filter state.

    -

    Usage

    -

    FilteredDataset$set_filter_state(state)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Set filter state.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$set_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Virtual method, returns nothing and raises error.

    -


    -

    Method get_filter_count()

    -

    Gets the number of FilterState objects in all FilterStates in this FilteredDataset.

    -

    Usage

    -

    FilteredDataset$get_filter_count()

    +
    +

    +
    +
    +

    Method get_filter_count() +

    +

    Gets the number of FilterState objects in all FilterStates in this FilteredDataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_filter_count()
    +

    +
    -

    Returns

    +

    Returns +

    integer(1)

    -


    -

    Method get_dataname()

    -

    Gets the name of the dataset.

    -

    Usage

    -

    FilteredDataset$get_dataname()

    +
    +

    +
    +
    +

    Method get_dataname() +

    +

    Gets the name of the dataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_dataname()
    +

    +
    -

    Returns

    +

    Returns +

    A character string.

    -


    -

    Method get_dataset()

    -

    Gets the dataset object in this FilteredDataset.

    -

    Usage

    -

    FilteredDataset$get_dataset(filtered = FALSE)

    +
    +

    +
    +
    +

    Method get_dataset() +

    +

    Gets the dataset object in this FilteredDataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_dataset(filtered = FALSE)
    +

    +
    -

    Arguments

    -

    filtered
    +

    Arguments +

    +

    +
    +
    +
    filtered

    (logical(1))

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    The stored dataset. If data.frame or MultiAssayExperiment, either raw or as a reactive with current filters applied (depending on filtered).

    -


    -

    Method get_filter_overview()

    -

    Get filter overview of a dataset.

    -

    Usage

    -

    FilteredDataset$get_filter_overview()

    +
    +

    +
    +
    +

    Method get_filter_overview() +

    +

    Get filter overview of a dataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_filter_overview()
    +

    +
    -

    Returns

    +

    Returns +

    Virtual method, returns nothing and raises an error.

    -


    -

    Method get_keys()

    -

    Gets the key columns for this dataset.

    -

    Usage

    -

    FilteredDataset$get_keys()

    +
    +

    +
    +
    +

    Method get_keys() +

    +

    Gets the key columns for this dataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_keys()
    +

    +
    -

    Returns

    +

    Returns +

    Character vector of variable names

    -


    -

    Method get_dataset_label()

    -

    Gets the dataset label.

    -

    Usage

    -

    FilteredDataset$get_dataset_label()

    +
    +

    +
    +
    +

    Method get_dataset_label() +

    +

    Gets the dataset label.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_dataset_label()
    +

    +
    -

    Returns

    +

    Returns +

    Character string.

    -


    -

    Method ui_active()

    -

    shiny module containing active filters for a dataset, along with a title and a remove button.

    -

    Usage

    -

    FilteredDataset$ui_active(id)

    +
    +

    +
    +
    +

    Method ui_active() +

    +

    shiny module containing active filters for a dataset, along with a title and a remove button.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$ui_active(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_active()

    -

    Server module for a dataset active filters.

    -

    Usage

    -

    FilteredDataset$srv_active(id)

    +
    +

    +
    +
    +

    Method srv_active() +

    +

    Server module for a dataset active filters.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$srv_active(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL.

    -


    -

    Method ui_add()

    -

    UI module to add filter variable for this dataset.

    -

    Usage

    -

    FilteredDataset$ui_add(id)

    +
    +

    +
    +
    +

    Method ui_add() +

    +

    UI module to add filter variable for this dataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$ui_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Virtual method, returns nothing and raises error.

    -


    -

    Method srv_add()

    +
    +

    +
    +
    +

    Method srv_add() +

    Server module to add filter variable for this dataset. For this class srv_add calls multiple modules of the same name from FilterStates as MAEFilteredDataset -contains one FilterStates object for colData and one for each experiment.

    -

    Usage

    -

    FilteredDataset$srv_add(id)

    +contains one FilterStates object for colData and one for each experiment.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$srv_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL.

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    FilteredDataset$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -466,17 +761,19 @@

    Arguments

    + +
    + +
    - - + + diff --git a/latest-tag/reference/LogicalFilterState.html b/latest-tag/reference/LogicalFilterState.html index 68c34e73e..9e186e794 100644 --- a/latest-tag/reference/LogicalFilterState.html +++ b/latest-tag/reference/LogicalFilterState.html @@ -1,8 +1,24 @@ - -FilterState object for logical data — LogicalFilterState • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,40 +107,60 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterState -> LogicalFilterState

    +

    Inherited methods


    -

    Method new()

    -

    Initialize a FilterState object.

    -

    Usage

    -

    LogicalFilterState$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterState object.

    +
    +

    Usage +

    +

    +
    +
    LogicalFilterState$new(
       x,
       x_reactive = reactive(NULL),
       extract_type = character(0),
       slice
    -)

    +)
    +

    +
    -

    Arguments

    -

    x
    +

    Arguments +

    +

    + -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection. -For LogicalFilterState it's a !<varname> or <varname> and optionally is.na(<varname>)

    -

    Usage

    -

    LogicalFilterState$get_call(dataname)

    +For LogicalFilterState it's a !<varname> or <varname> and optionally is.na(<varname>)

    +
    +

    Usage +

    +

    +
    +
    LogicalFilterState$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    name of data set; defaults to private$get_dataname()

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    call

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    LogicalFilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    LogicalFilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -196,7 +279,8 @@

    Arguments -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     include_css_files <- getFromNamespace("include_css_files", "teal.slice")
     include_js_files <- getFromNamespace("include_js_files", "teal.slice")
    @@ -284,17 +368,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/latest-tag/reference/MAEFilterStates.html b/latest-tag/reference/MAEFilterStates.html index e234b346d..2a22f92b4 100644 --- a/latest-tag/reference/MAEFilterStates.html +++ b/latest-tag/reference/MAEFilterStates.html @@ -1,8 +1,24 @@ - -FilterStates subclass for MultiAssayExperiments — MAEFilterStates • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,18 +107,25 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterStates -> MAEFilterStates

    -

    Methods

    +

    Methods +

    Inherited methods +
    +

    Inherited methods


    -

    Method new()

    -

    Initialize MAEFilterStates object.

    -

    Usage

    -

    MAEFilterStates$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize MAEFilterStates object.

    +
    +

    Usage +

    +

    +
    +
    MAEFilterStates$new(
       data,
       data_reactive = function(sid = "") NULL,
       dataname,
       datalabel = "subjects",
       keys = character(0)
    -)

    +)
    +

    +
    -

    Arguments

    -

    data
    +

    Arguments +

    +

    +
    +
    +
    data

    (MultiAssayExperiment) the R object which MultiAssayExperiment::subsetByColData function is applied on.

    @@ -155,23 +198,41 @@

    Arguments
    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    MAEFilterStates$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    MAEFilterStates$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -179,17 +240,19 @@

    Arguments

    + +

    + +
    - - + + diff --git a/latest-tag/reference/MAEFilteredDataset.html b/latest-tag/reference/MAEFilteredDataset.html index 075ae5c20..de644fd92 100644 --- a/latest-tag/reference/MAEFilteredDataset.html +++ b/latest-tag/reference/MAEFilteredDataset.html @@ -1,10 +1,26 @@ - -MAEFilteredDataset R6 class — MAEFilteredDataset • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + +
    @@ -87,22 +110,29 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilteredDataset -> MAEFilteredDataset

    +

    Inherited methods


    -

    Method new()

    -

    Initialize MAEFilteredDataset object.

    -

    Usage

    -

    MAEFilteredDataset$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize MAEFilteredDataset object.

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$new(
       dataset,
       dataname,
       keys = character(0),
       label = character(0)
    -)

    +)
    +

    +
    -

    Arguments

    -

    dataset
    +

    Arguments +

    +

    +
    +
    +
    dataset

    (MulitiAssayExperiment) single MulitiAssayExperiment for which filters are rendered.

    @@ -149,102 +192,183 @@

    Arguments -

    Returns

    +

    Returns +

    Object of class MAEFilteredDataset, invisibly.

    -


    -

    Method set_filter_state()

    -

    Set filter state.

    -

    Usage

    -

    MAEFilteredDataset$set_filter_state(state)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Set filter state.

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$set_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method remove_filter_state()

    -

    Remove one or more FilterState of a MAEFilteredDataset.

    -

    Usage

    -

    MAEFilteredDataset$remove_filter_state(state)

    +
    +

    +
    +
    +

    Method remove_filter_state() +

    +

    Remove one or more FilterState of a MAEFilteredDataset.

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$remove_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices) specifying FilterState objects to remove; teal_slices may contain only dataname and varname, other elements are ignored.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method ui_add()

    -

    UI module to add filter variable for this dataset.

    -

    Usage

    -

    MAEFilteredDataset$ui_add(id)

    +
    +

    +
    +
    +

    Method ui_add() +

    +

    UI module to add filter variable for this dataset.

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$ui_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method get_filter_overview()

    -

    Creates row for filter overview in the form of
    dataname -- observations (remaining/total) -- subjects (remaining/total) - MAE

    -

    Usage

    -

    MAEFilteredDataset$get_filter_overview()

    +
    +

    +
    +
    +

    Method get_filter_overview() +

    +

    Creates row for filter overview in the form of
    dataname -- observations (remaining/total) -- subjects (remaining/total) - MAE

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$get_filter_overview()
    +

    +
    -

    Returns

    +

    Returns +

    A data.frame.

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    MAEFilteredDataset$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -252,7 +376,8 @@

    Arguments -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     MAEFilteredDataset <- getFromNamespace("MAEFilteredDataset", "teal.slice")
     
    @@ -324,17 +449,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/latest-tag/reference/MatrixFilterStates.html b/latest-tag/reference/MatrixFilterStates.html index 4745975bd..ae136b858 100644 --- a/latest-tag/reference/MatrixFilterStates.html +++ b/latest-tag/reference/MatrixFilterStates.html @@ -1,8 +1,24 @@ - -FilterStates subclass for matrices — MatrixFilterStates • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,18 +107,25 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterStates -> MatrixFilterStates

    -

    Methods

    +

    Methods +

    Inherited methods +
    +

    Inherited methods


    -

    Method new()

    -

    Initialize MatrixFilterStates object.

    -

    Usage

    -

    MatrixFilterStates$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize MatrixFilterStates object.

    +
    +

    Usage +

    +

    +
    +
    MatrixFilterStates$new(
       data,
       data_reactive = function(sid = "") NULL,
       dataname,
       datalabel = NULL
    -)

    +)
    +

    +
    -

    Arguments

    -

    data
    +

    Arguments +

    +

    +
    +
    +
    data

    (matrix) the R object which subset function is applied on.

    @@ -144,23 +187,41 @@

    Arguments
    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    MatrixFilterStates$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    MatrixFilterStates$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -168,17 +229,19 @@

    Arguments

    + +

    + +
    - - + + diff --git a/latest-tag/reference/RangeFilterState.html b/latest-tag/reference/RangeFilterState.html index be948086c..9220dd9be 100644 --- a/latest-tag/reference/RangeFilterState.html +++ b/latest-tag/reference/RangeFilterState.html @@ -1,8 +1,24 @@ - -FilterState object for numeric data — RangeFilterState • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,41 +107,61 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterState -> RangeFilterState

    +

    Inherited methods


    -

    Method new()

    -

    Initialize a FilterState object for range selection.

    -

    Usage

    -

    RangeFilterState$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterState object for range selection.

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$new(
       x,
       x_reactive = reactive(NULL),
       extract_type = character(0),
       slice
    -)

    +)
    +

    +
    -

    Arguments

    -

    x
    +

    Arguments +

    +

    + -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection. For this class returned call looks like <varname> >= <min value> & <varname> <= <max value> with -optional is.na(<varname>) and is.finite(<varname>).

    -

    Usage

    -

    RangeFilterState$get_call(dataname)

    +optional is.na(<varname>) and is.finite(<varname>).

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    name of data set; defaults to private$get_dataname()

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    call

    -


    -

    Method get_keep_inf()

    -

    Returns current keep_inf selection.

    -

    Usage

    -

    RangeFilterState$get_keep_inf()

    +
    +

    +
    +
    +

    Method get_keep_inf() +

    +

    Returns current keep_inf selection.

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$get_keep_inf()
    +

    +
    -

    Returns

    +

    Returns +

    logical(1)

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    RangeFilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -211,7 +305,8 @@

    Arguments -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     include_css_files <- getFromNamespace("include_css_files", "teal.slice")
     include_js_files <- getFromNamespace("include_js_files", "teal.slice")
    @@ -327,17 +422,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/latest-tag/reference/SEFilterStates.html b/latest-tag/reference/SEFilterStates.html index e1d50e7d4..2c9d32573 100644 --- a/latest-tag/reference/SEFilterStates.html +++ b/latest-tag/reference/SEFilterStates.html @@ -1,8 +1,24 @@ - -FilterStates subclass for SummarizedExperiments — SEFilterStates • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,21 +107,28 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterStates -> SEFilterStates

    +

    Inherited methods


    -

    Method new()

    -

    Initialize SEFilterStates object.

    -

    Usage

    -

    SEFilterStates$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize SEFilterStates object.

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$new(
       data,
       data_reactive = function(sid = "") NULL,
       dataname,
       datalabel = NULL
    -)

    +)
    +

    +
    -

    Arguments

    -

    data
    +

    Arguments +

    +

    +
    +
    +
    data

    (SummarizedExperiment) the R object which subset function is applied on.

    @@ -144,92 +187,161 @@

    Arguments
    -

    Method set_filter_state()

    -

    Set filter state.

    -

    Usage

    -

    SEFilterStates$set_filter_state(state)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Set filter state.

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$set_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices) teal_slice objects should contain the field arg %in% c("subset", "select")

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method ui_add()

    -

    shiny UI module to add filter variable.

    -

    Usage

    -

    SEFilterStates$ui_add(id)

    +
    +

    +
    +
    +

    Method ui_add() +

    +

    shiny UI module to add filter variable.

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$ui_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_add()

    +
    +

    +
    +
    +

    Method srv_add() +

    shiny server module to add filter variable.

    Module controls available choices to select as a filter variable. Selected filter variable is being removed from available choices. Removed filter variable gets back to available choices. This module unlike other FilterStates classes manages two sets of filter variables - one for colData and another for -rowData.

    -

    Usage

    -

    SEFilterStates$srv_add(id)

    +rowData.

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$srv_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    SEFilterStates$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -237,17 +349,19 @@

    Arguments

    + +
    + +
    - - + + diff --git a/latest-tag/reference/calls_combine_by.html b/latest-tag/reference/calls_combine_by.html index 65b87d277..692c31fa1 100644 --- a/latest-tag/reference/calls_combine_by.html +++ b/latest-tag/reference/calls_combine_by.html @@ -1,8 +1,24 @@ - -Compose predicates — calls_combine_by • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +

    @@ -83,13 +105,16 @@
    -

    Usage

    +

    Usage +

    calls_combine_by(calls, operator)
    -

    Arguments

    -
    calls
    +

    Arguments +

    +
    +
    calls

    (list) containing calls (or symbols) to be combined by operator

    @@ -98,21 +123,25 @@

    Arguments

    -

    + +
    -

    Value

    +

    Value +

    A call where elements of calls are composed with operator or NULL if calls is an empty list.

    -

    Details

    +

    Details +

    This function is used to combine logical predicates produced by FilterState objects to build a complete subset expression.

    -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     calls_combine_by <- getFromNamespace("calls_combine_by", "teal.slice")
     
    @@ -127,17 +156,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/latest-tag/reference/check_simple_name.html b/latest-tag/reference/check_simple_name.html index 07a32394b..68ee98b31 100644 --- a/latest-tag/reference/check_simple_name.html +++ b/latest-tag/reference/check_simple_name.html @@ -1,14 +1,30 @@ - - + + + + + +Test whether variable name can be used within Show R Code — check_simple_name • teal.slice +Test whether variable name can be used within Show R Code — check_simple_name • teal.slice + + + + + + + + + + Skip to contents @@ -24,7 +40,8 @@ + +
    @@ -92,35 +115,42 @@
    -

    Usage

    +

    Usage +

    check_simple_name(name)
    -

    Arguments

    -
    name
    +

    Arguments +

    +
    +
    name

    (character) vector of names to check

    -
    + +
    -

    Value

    +

    Value +

    Returns NULL or raises error.

    + +
    + +
    - - + + diff --git a/latest-tag/reference/choices_labeled.html b/latest-tag/reference/choices_labeled.html index 08bb980b8..0dc4ec4d3 100644 --- a/latest-tag/reference/choices_labeled.html +++ b/latest-tag/reference/choices_labeled.html @@ -1,10 +1,26 @@ - -Set "<choice>:<label>" type of names — choices_labeled • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + +
    @@ -86,13 +108,16 @@
    -

    Usage

    +

    Usage +

    choices_labeled(choices, labels, subset = NULL, types = NULL)
    -

    Arguments

    -
    choices
    +

    Arguments +

    +
    +
    choices

    (character or numeric or logical) vector

    @@ -110,31 +135,36 @@

    Arguments -

    Value

    +

    Value +

    A named character vector.

    -

    Details

    +

    Details +

    If either choices or labels are factors, they are coerced to character. Duplicated elements from choices get removed.

    + +
    + +
    - - + + diff --git a/latest-tag/reference/coalesce_r.html b/latest-tag/reference/coalesce_r.html index 100dd18d9..3af1e6887 100644 --- a/latest-tag/reference/coalesce_r.html +++ b/latest-tag/reference/coalesce_r.html @@ -1,8 +1,24 @@ - -Recursively coalesce list elements. — coalesce_r • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,24 +105,30 @@
    -

    Usage

    +

    Usage +

    coalesce_r(x)
    -

    Arguments

    -
    x
    +

    Arguments +

    +
    +
    x

    (list), either of atomic vectors or of named lists

    -
    + +
    -

    Value

    +

    Value +

    Either an atomic vector of length 1 or a (potentially nested) list.

    -

    Details

    +

    Details +

    Given a list of atomic vectors, the first non-null element is returned. Given a list of lists, for all names found in all elements of the list the first non-null element of a given name is returned.

    @@ -108,17 +136,19 @@

    Details

    + +
    + +
    - - + + diff --git a/latest-tag/reference/countBar.html b/latest-tag/reference/countBar.html index 64d821d2c..5e9c0487e 100644 --- a/latest-tag/reference/countBar.html +++ b/latest-tag/reference/countBar.html @@ -1,8 +1,24 @@ - -Progress bar with label — countBar • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,7 +105,8 @@
    -

    Usage

    +

    Usage +

    countBar(inputId, label, countmax, countnow = NULL, counttotal = countmax)
     
     updateCountBar(
    @@ -105,8 +128,10 @@ 

    Usage

    -

    Arguments

    -
    inputId
    +

    Arguments +

    +
    +
    inputId

    (character(1)) shiny id of the parent element (e.g. a check-box group input).

    @@ -129,32 +154,40 @@

    Arguments -

    Value

    +

    Value +

    shiny.tag object with a progress bar and a label.

    -

    Details

    -

    A progress bar is created to visualize the number of counts in a variable, with filling and a text label.

    • progress bar width is derived as a fraction of the container width: style = "width: <countmax> / <counttotal>%",

    • +

      Details +

      +

      A progress bar is created to visualize the number of counts in a variable, with filling and a text label.

      +
        +
      • progress bar width is derived as a fraction of the container width: style = "width: <countmax> / <counttotal>%",

      • progress bar is filled up to the fraction <countnow> / <countmax>,

      • text label is obtained by <label> (<countnow> / <countmax>).

      • -
    + +
    + +
    + +
    - - + + diff --git a/latest-tag/reference/countBars.html b/latest-tag/reference/countBars.html index 9a9ab86c1..0fc83c820 100644 --- a/latest-tag/reference/countBars.html +++ b/latest-tag/reference/countBars.html @@ -1,8 +1,24 @@ - -Progress bars with labels — countBars • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,7 +105,8 @@
    -

    Usage

    +

    Usage +

    countBars(inputId, choices, countsmax, countsnow = NULL)
     
     updateCountBars(
    @@ -96,8 +119,10 @@ 

    Usage

    -

    Arguments

    -
    inputId
    +

    Arguments +

    +
    +
    inputId

    (character(1)) shiny id of the parent element (e.g. a check-box group input).

    @@ -116,9 +141,11 @@

    Arguments -

    Value

    +

    Value +

    List of shiny.tags.

    @@ -138,7 +165,8 @@

    Value

    -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     include_js_files <- getFromNamespace("include_js_files", "teal.slice")
     include_css_files <- getFromNamespace("include_css_files", "teal.slice")
    @@ -190,17 +218,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/latest-tag/reference/data_choices_labeled.html b/latest-tag/reference/data_choices_labeled.html index c8b28de43..5ee5c15f3 100644 --- a/latest-tag/reference/data_choices_labeled.html +++ b/latest-tag/reference/data_choices_labeled.html @@ -1,8 +1,24 @@ - -Returns a choices_labeled object — data_choices_labeled • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,7 +105,8 @@
    -

    Usage

    +

    Usage +

    data_choices_labeled(
       data,
       choices,
    @@ -93,8 +116,10 @@ 

    Usage

    -

    Arguments

    -
    data
    +

    Arguments +

    +
    +
    data

    (data.frame or DFrame or list) where labels can be taken from in case when varlabels is not specified. data must be specified if varlabels is not specified.

    @@ -114,26 +139,30 @@

    Arguments -

    Value

    +

    Value +

    character(0) if choices are empty; a choices_labeled object otherwise

    + +
    + +
    - - + + diff --git a/latest-tag/reference/dot-table.html b/latest-tag/reference/dot-table.html index 1c69f977b..a2891a07b 100644 --- a/latest-tag/reference/dot-table.html +++ b/latest-tag/reference/dot-table.html @@ -1,8 +1,24 @@ - -table handling POSIXlt — .table • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,35 +107,42 @@
    -

    Usage

    +

    Usage +

    .table(x)
    -

    Arguments

    -
    x
    +

    Arguments +

    +
    +
    x

    (vector) variable to get counts from.

    -
    + +
    -

    Value

    +

    Value +

    vector of counts named by unique values of x.

    + +
    + + - - + + diff --git a/latest-tag/reference/eval_expr_with_msg.html b/latest-tag/reference/eval_expr_with_msg.html index ef4d0af0d..2b8f47f10 100644 --- a/latest-tag/reference/eval_expr_with_msg.html +++ b/latest-tag/reference/eval_expr_with_msg.html @@ -1,12 +1,28 @@ - - + + + + + +Evaluate expression with meaningful message — eval_expr_with_msg • teal.slice +Evaluate expression with meaningful message — eval_expr_with_msg • teal.slice + + + + + + + + + + Skip to contents @@ -22,7 +38,8 @@ + + @@ -89,39 +111,46 @@
    -

    Usage

    +

    Usage +

    eval_expr_with_msg(expr, env)
    -

    Arguments

    -
    expr
    +

    Arguments +

    +
    +
    expr

    (language)

    env

    (environment) where expression is evaluated.

    -
    + +
    -

    Value

    +

    Value +

    NULL, invisibly.

    + + + + - - + + diff --git a/latest-tag/reference/fetch_bs_color.html b/latest-tag/reference/fetch_bs_color.html index 8911cbc5c..e07252870 100644 --- a/latest-tag/reference/fetch_bs_color.html +++ b/latest-tag/reference/fetch_bs_color.html @@ -1,8 +1,24 @@ - -Get hex code of the current Bootstrap theme color. — fetch_bs_color • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -83,13 +105,16 @@
    -

    Usage

    +

    Usage +

    fetch_bs_color(color, alpha = NULL)
    -

    Arguments

    -
    color
    +

    Arguments +

    +
    +
    color

    (character(1)) naming one of the available theme colors

    @@ -98,16 +123,19 @@

    Arguments -

    Value

    +

    Value +

    Named character(1) containing a hexadecimal color representation.

    -

    Examples

    +

    Examples +

    fetch_bs_color <- getFromNamespace("fetch_bs_color", "teal.slice")
     fetch_bs_color("primary")
     #> [1] "#0d6efd"
    @@ -119,17 +147,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/latest-tag/reference/filter_state_api.html b/latest-tag/reference/filter_state_api.html index 377d718a1..6ae3e54ee 100644 --- a/latest-tag/reference/filter_state_api.html +++ b/latest-tag/reference/filter_state_api.html @@ -1,10 +1,26 @@ - -Managing FilteredData states — filter_state_api • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + @@ -86,7 +108,8 @@
    -

    Usage

    +

    Usage +

    set_filter_state(datasets, filter)
     
     get_filter_state(datasets)
    @@ -97,11 +120,15 @@ 

    Usage

    -

    Arguments

    -
    datasets
    -

    (FilteredData) +

    Arguments +

    +
    +
    datasets
    +
    +

    (FilteredData) object to store filter state and filtered datasets, shared across modules

    -

    see FilteredData for details

    +

    see FilteredData for details

    +
    filter
    @@ -113,22 +140,28 @@

    Arguments -

    Value

    +

    Value +

    -
    • set_*, remove_* and clear_filter_state return NULL invisibly

    • +
        +
      • set_*, remove_* and clear_filter_state return NULL invisibly

      • get_filter_state returns a named teal_slices object containing a teal_slice for every existing FilterState

      • -
    + +
    -

    See also

    +

    See also +

    -

    Examples

    +

    Examples +

    datasets <- init_filtered_data(list(iris = iris, mtcars = mtcars))
     fs <- teal_slices(
       teal_slice(dataname = "iris", varname = "Species", selected = c("setosa", "versicolor")),
    @@ -271,17 +304,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/latest-tag/reference/format_time.html b/latest-tag/reference/format_time.html index c948a2431..86a8744c8 100644 --- a/latest-tag/reference/format_time.html +++ b/latest-tag/reference/format_time.html @@ -1,8 +1,24 @@ - -Format POSIXt for storage — format_time • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -83,40 +105,48 @@
    -

    Usage

    +

    Usage +

    format_time(x)
    -

    Arguments

    -
    x
    +

    Arguments +

    +
    +
    x

    (POSIXt) vector of date time values or anything else

    -
    + +
    -

    Value

    +

    Value +

    If x is of class POSIXt, a character vector, otherwise x itself.

    -

    Details

    +

    Details +

    Date times are stored as string representations expressed in the UTC time zone. The storage format is YYYY-MM-DD HH:MM:SS.

    + + + + - - + + diff --git a/latest-tag/reference/get_default_slice_id.html b/latest-tag/reference/get_default_slice_id.html index a06a0a524..855a27f1c 100644 --- a/latest-tag/reference/get_default_slice_id.html +++ b/latest-tag/reference/get_default_slice_id.html @@ -1,8 +1,24 @@ - -Default teal_slice id — get_default_slice_id • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -83,48 +105,59 @@
    -

    Usage

    +

    Usage +

    get_default_slice_id(x)
    -

    Arguments

    -
    x
    +

    Arguments +

    +
    +
    x

    (teal_slice or list)

    -
    + +
    -

    Value

    +

    Value +

    (character(1)) id for a teal_slice object.

    -

    Details

    +

    Details +

    Function returns a default id for a teal_slice object which needs to be distinct from other teal_slice objects created for any FilterStates object. Returned id can be treated as a location of -a vector on which FilterState is built:

    • for a data.frame id concatenates dataname and varname.

    • +a vector on which FilterState is built:

      +
        +
      • for a data.frame id concatenates dataname and varname.

      • for a MultiAssayExperiment id concatenates dataname, varname, experiment and arg, so that one can add teal_slice for a varname which exists in multiple SummarizedExperiments or exists in both colData and rowData of given experiment. For such a vector teal.slice doesn't allow to activate more than one filters. In case of teal_slice_expr id is mandatory and must be unique.

      • -
    + + + + + + - - + + diff --git a/latest-tag/reference/get_filter_expr.html b/latest-tag/reference/get_filter_expr.html index 3ecb0168d..cbc3af0fd 100644 --- a/latest-tag/reference/get_filter_expr.html +++ b/latest-tag/reference/get_filter_expr.html @@ -1,10 +1,26 @@ - -Gets filter expression for multiple datanames taking into account its order. — get_filter_expr • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + @@ -86,39 +108,46 @@
    -

    Usage

    +

    Usage +

    get_filter_expr(datasets, datanames = datasets$datanames())
    -

    Arguments

    -
    datasets
    +

    Arguments +

    +
    +
    datasets

    (FilteredData)

    datanames

    (character) vector of dataset names

    -
    + +
    -

    Value

    +

    Value +

    A character string containing all subset expressions.

    + + + + - - + + diff --git a/latest-tag/reference/get_supported_filter_varnames.html b/latest-tag/reference/get_supported_filter_varnames.html index a0d5387b3..6c1cf1f32 100644 --- a/latest-tag/reference/get_supported_filter_varnames.html +++ b/latest-tag/reference/get_supported_filter_varnames.html @@ -1,10 +1,26 @@ - -Gets supported filterable variable names — get_supported_filter_varnames • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + @@ -86,25 +108,31 @@
    -

    Usage

    +

    Usage +

    get_supported_filter_varnames(data)
    -

    Arguments

    -
    data
    +

    Arguments +

    +
    +
    data

    the R object containing elements which class can be checked through vapply or apply.

    -
    + +
    -

    Value

    +

    Value +

    character vector of variable names.

    -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     get_supported_filter_varnames <- getFromNamespace("get_supported_filter_varnames", "teal.slice")
     
    @@ -120,17 +148,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/latest-tag/reference/include_css_files.html b/latest-tag/reference/include_css_files.html index f2bcc017b..3472b06fe 100644 --- a/latest-tag/reference/include_css_files.html +++ b/latest-tag/reference/include_css_files.html @@ -1,12 +1,28 @@ - - + + + + + +Include CSS files from /inst/css/ package directory to application header — include_css_files • teal.slice +Include CSS files from /inst/css/ package directory to application header — include_css_files • teal.slice + + + + + + + + + + Skip to contents @@ -22,7 +38,8 @@ + + @@ -89,35 +111,42 @@
    -

    Usage

    +

    Usage +

    include_css_files(pattern = "*")
    -

    Arguments

    -
    pattern
    +

    Arguments +

    +
    +
    pattern

    (character) pattern of files to be included

    -
    + +
    -

    Value

    +

    Value +

    HTML code that includes CSS files

    + + + + - - + + diff --git a/latest-tag/reference/include_js_files.html b/latest-tag/reference/include_js_files.html index 3013e1169..5aa882445 100644 --- a/latest-tag/reference/include_js_files.html +++ b/latest-tag/reference/include_js_files.html @@ -1,12 +1,28 @@ - - + + + + + +Include JS files from /inst/js/ package directory to application header — include_js_files • teal.slice +Include JS files from /inst/js/ package directory to application header — include_js_files • teal.slice + + + + + + + + + + Skip to contents @@ -22,7 +38,8 @@ + + @@ -89,35 +111,42 @@
    -

    Usage

    +

    Usage +

    include_js_files(pattern)
    -

    Arguments

    -
    pattern
    +

    Arguments +

    +
    +
    pattern

    (character) pattern of files to be included, passed to system.file

    -
    + +
    -

    Value

    +

    Value +

    HTML code that includes JS files

    + + + + - - + + diff --git a/latest-tag/reference/index.html b/latest-tag/reference/index.html index e753fa1f3..daa1c4f4c 100644 --- a/latest-tag/reference/index.html +++ b/latest-tag/reference/index.html @@ -1,8 +1,22 @@ - -Function reference • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -77,96 +97,129 @@
    -

    teal filter-panel API

    +

    +teal filter-panel API +

    Functions used initialize filter-panel and to modify its states.

    -
    +
    +
    -
    +
    +
    init_filtered_data()
    -
    Initialize FilteredData
    -
    +
    Initialize FilteredData +
    +
    +
    +
    set_filter_state() get_filter_state() remove_filter_state() clear_filter_states()
    Managing FilteredData states
    -
    +
    +
    +
    get_filter_expr()
    Gets filter expression for multiple datanames taking into account its order.
    -
    +
    +
    +
    teal_slice()
    Specify single filter
    -
    +
    +
    +
    teal_slices()
    Complete filter specification
    -
    -

    For developers

    + +
    +
    +

    For developers +

    Abstract and concrete classes used to build teal functionality.

    -
    +
    +
    -

    R6 Classes

    +

    R6 Classes +

    Abstract and concrete classes used to build teal functionality.

    -
    +
    +
    -
    +
    +
    FilteredData
    Class to encapsulate filtered datasets
    -
    +
    +
    +
    FilteredDataset
    -
    FilteredDataset R6 class
    -
    +
    +FilteredDataset R6 class
    +
    +
    +
    FilterPanelAPI
    Class to encapsulate the API of the filter panel of a teal app
    -
    +
    +
    +
    DataframeFilteredDataset
    The DataframeFilteredDataset R6 class
    -
    +
    +
    +
    MAEFilteredDataset
    -
    MAEFilteredDataset R6 class
    -
    +
    +MAEFilteredDataset R6 class
    + + + + + + - - + + diff --git a/latest-tag/reference/init_filter_state.html b/latest-tag/reference/init_filter_state.html index e60ece6fc..1e536bc6b 100644 --- a/latest-tag/reference/init_filter_state.html +++ b/latest-tag/reference/init_filter_state.html @@ -1,8 +1,24 @@ - -Initialize FilterState — init_filter_state • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,7 +106,8 @@
    -

    Usage

    +

    Usage +

    init_filter_state(
       x,
       x_reactive = reactive(NULL),
    @@ -93,8 +117,10 @@ 

    Usage

    + +
    -

    Value

    +

    Value +

    FilterState object

    -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     init_filter_state <- getFromNamespace("init_filter_state", "teal.slice")
     
    @@ -172,17 +205,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/latest-tag/reference/init_filter_state_expr.html b/latest-tag/reference/init_filter_state_expr.html index e922a4357..ef4524df9 100644 --- a/latest-tag/reference/init_filter_state_expr.html +++ b/latest-tag/reference/init_filter_state_expr.html @@ -1,8 +1,24 @@ - -Initialize a FilterStateExpr object — init_filter_state_expr • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -83,36 +105,43 @@
    -

    Usage

    +

    Usage +

    init_filter_state_expr(slice)
    -

    Arguments

    -
    slice
    +

    Arguments +

    +
    +
    slice

    (teal_slice_expr) specifying this filter state.

    -
    + +
    -

    Value

    +

    Value +

    FilterStateExpr object

    + + + + - - + + diff --git a/latest-tag/reference/init_filter_states.html b/latest-tag/reference/init_filter_states.html index e039d1e65..2d0a2b1bc 100644 --- a/latest-tag/reference/init_filter_states.html +++ b/latest-tag/reference/init_filter_states.html @@ -1,8 +1,24 @@ - -Initialize FilterStates object — init_filter_states • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -83,7 +105,8 @@
    -

    Usage

    +

    Usage +

    init_filter_states(
       data,
       data_reactive = reactive(NULL),
    @@ -94,8 +117,10 @@ 

    Usage

    -

    Arguments

    -
    data
    +

    Arguments +

    +
    +
    data

    (data.frame or MultiAssayExperiment or SummarizedExperiment or matrix) object to subset.

    @@ -123,16 +148,19 @@

    Arguments -

    Value

    +

    Value +

    Object of class FilterStates.

    -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     init_filter_states <- getFromNamespace("init_filter_states", "teal.slice")
     
    @@ -171,17 +199,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/latest-tag/reference/init_filtered_data.html b/latest-tag/reference/init_filtered_data.html index 86ecbae25..376b5c200 100644 --- a/latest-tag/reference/init_filtered_data.html +++ b/latest-tag/reference/init_filtered_data.html @@ -1,8 +1,24 @@ - -Initialize FilteredData — init_filtered_data • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,13 +106,16 @@
    -

    Usage

    +

    Usage +

    init_filtered_data(x, join_keys = teal.data::join_keys(), code, check)
    -

    Arguments

    -
    x
    +

    Arguments +

    +
    +
    x

    (named list) of datasets.

    @@ -104,16 +130,19 @@

    Arguments[Deprecated]

    -

    + +
    -

    Value

    +

    Value +

    Object of class FilteredData.

    -

    Examples

    +

    Examples +

    datasets <- init_filtered_data(list(iris = iris, mtcars = mtcars))
     datasets
     #> FilteredData:
    @@ -132,17 +161,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/latest-tag/reference/init_filtered_dataset.html b/latest-tag/reference/init_filtered_dataset.html index bfa701847..47cccbbfc 100644 --- a/latest-tag/reference/init_filtered_dataset.html +++ b/latest-tag/reference/init_filtered_dataset.html @@ -1,8 +1,24 @@ - -Initialize FilteredDataset — init_filtered_dataset • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,7 +106,8 @@
    -

    Usage

    +

    Usage +

    init_filtered_dataset(
       dataset,
       dataname,
    @@ -96,8 +120,10 @@ 

    Usage

    -

    Arguments

    -
    dataset
    +

    Arguments +

    +
    +
    dataset

    any object

    @@ -133,15 +159,18 @@

    Arguments -

    Value

    +

    Value +

    Object of class FilteredDataset.

    -

    Warning

    +

    Warning +

    This function is exported to allow other packages to extend teal.slice but it is treated as internal. @@ -150,7 +179,8 @@

    Warning
    -

    Examples

    +

    Examples +

    # DataframeFilteredDataset example
     library(shiny)
     
    @@ -206,17 +236,19 @@ 

    Examples

    + +

    + +
    - - + + diff --git a/latest-tag/reference/jsonify.html b/latest-tag/reference/jsonify.html index 92a7010d1..5cb32b26b 100644 --- a/latest-tag/reference/jsonify.html +++ b/latest-tag/reference/jsonify.html @@ -1,12 +1,28 @@ - - + + + + + +Convert a list to a justified JSON string — jsonify • teal.slice +Convert a list to a justified JSON string — jsonify • teal.slice + + + + + + + + + + Skip to contents @@ -22,7 +38,8 @@ + +
    @@ -89,39 +111,46 @@
    -

    Usage

    +

    Usage +

    jsonify(x, trim_lines)
    -

    Arguments

    -
    x
    +

    Arguments +

    +
    +
    x

    (list), possibly recursive, obtained from teal_slice or teal_slices.

    trim_lines

    (logical(1)) flag specifying whether to trim lines of the JSON string.

    -
    + +
    -

    Value

    +

    Value +

    A JSON string representation of the input list.

    + + + + - - + + diff --git a/latest-tag/reference/justify_json.html b/latest-tag/reference/justify_json.html index c4f6b1f09..d3b21bb06 100644 --- a/latest-tag/reference/justify_json.html +++ b/latest-tag/reference/justify_json.html @@ -1,10 +1,26 @@ - -Justify colons in JSON string — justify_json • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + @@ -86,35 +108,42 @@
    -

    Usage

    +

    Usage +

    justify_json(json)
    -

    Arguments

    -
    json
    +

    Arguments +

    +
    +
    json

    (character(1)) a JSON string.

    -
    + +
    -

    Value

    +

    Value +

    A list of character strings, which can be collapsed into a JSON string.

    + + + + - - + + diff --git a/latest-tag/reference/make_c_call.html b/latest-tag/reference/make_c_call.html index a0fffd855..75bccd7aa 100644 --- a/latest-tag/reference/make_c_call.html +++ b/latest-tag/reference/make_c_call.html @@ -1,10 +1,26 @@ - -Build concatenating call — make_c_call • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + @@ -86,25 +108,31 @@
    -

    Usage

    +

    Usage +

    make_c_call(choices)
    -

    Arguments

    -
    choices
    +

    Arguments +

    +
    +
    choices

    A vector of values.

    -
    + +
    -

    Value

    +

    Value +

    A c call.

    -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     make_c_call <- getFromNamespace("make_c_call", "teal.slice")
     make_c_call(1:3)
    @@ -115,17 +143,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/latest-tag/reference/make_count_text.html b/latest-tag/reference/make_count_text.html index d5a3d5ed4..c1ba190af 100644 --- a/latest-tag/reference/make_count_text.html +++ b/latest-tag/reference/make_count_text.html @@ -1,16 +1,32 @@ - - + + + + + +Build count text — make_count_text • teal.slice +Build count text — make_count_text • teal.slice + + + + + + + + + + Skip to contents @@ -26,7 +42,8 @@ + + @@ -87,18 +109,24 @@
    -

    Returns a text label describing filtered counts. The text is composed in the following way:

    • when countnow is not NULL: <label> (<countnow>/<countmax>)

    • +

      Returns a text label describing filtered counts. The text is composed in the following way:

      +
        +
      • when countnow is not NULL: <label> (<countnow>/<countmax>)

      • when countnow is NULL: <label> (<countmax>)

      • -
    + +
    -

    Usage

    +

    Usage +

    make_count_text(label, countmax, countnow = NULL)
    -

    Arguments

    -
    label
    +

    Arguments +

    +
    +
    label

    (character(1)) Text displayed before counts.

    @@ -109,26 +137,30 @@

    Arguments -

    Value

    +

    Value +

    A character string.

    + + + + - - + + diff --git a/latest-tag/reference/setdiff_teal_slices.html b/latest-tag/reference/setdiff_teal_slices.html index 0b2ac76cb..75aa55a8e 100644 --- a/latest-tag/reference/setdiff_teal_slices.html +++ b/latest-tag/reference/setdiff_teal_slices.html @@ -1,8 +1,24 @@ - -setdiff method for teal_slices — setdiff_teal_slices • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,18 +107,23 @@
    -

    Usage

    +

    Usage +

    setdiff_teal_slices(x, y)
    -

    Arguments

    -
    x, y
    +

    Arguments +

    +
    +
    x, y

    (teal_slices)

    -
    + +
    -

    Value

    +

    Value +

    teal_slices

    @@ -103,17 +132,19 @@

    Value

    + + + + - - + + diff --git a/latest-tag/reference/teal.slice-package.html b/latest-tag/reference/teal.slice-package.html index 3d179bedc..7d6de92e8 100644 --- a/latest-tag/reference/teal.slice-package.html +++ b/latest-tag/reference/teal.slice-package.html @@ -1,8 +1,24 @@ - -teal.slice: Interactive Exploration of Clinical Trials Data — teal.slice-package • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,16 +107,24 @@
    -

    Author

    +

    Author +

    Maintainer: Dawid Kaledkowski dawid.kaledkowski@roche.com (ORCID)

    -

    Authors:

    + +
    + + + + - - + + diff --git a/latest-tag/reference/teal_slice-utilities.html b/latest-tag/reference/teal_slice-utilities.html index 15eea9cc1..be6471f8c 100644 --- a/latest-tag/reference/teal_slice-utilities.html +++ b/latest-tag/reference/teal_slice-utilities.html @@ -1,8 +1,24 @@ - -teal_slice utility functions — teal_slice-utilities • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,7 +106,8 @@
    -

    Usage

    +

    Usage +

    is.teal_slice(x)
     
     as.teal_slice(x)
    @@ -99,8 +123,10 @@ 

    Usage

    -

    Arguments

    -
    x
    +

    Arguments +

    +
    +
    x

    (teal.slice)

    @@ -116,10 +142,12 @@

    Arguments -

    Examples

    +

    Examples +

    x1 <- teal_slice(
       dataname = "data",
       id = "Female adults",
    @@ -196,17 +224,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/latest-tag/reference/teal_slice.html b/latest-tag/reference/teal_slice.html index 333f9c1cb..26d9018d3 100644 --- a/latest-tag/reference/teal_slice.html +++ b/latest-tag/reference/teal_slice.html @@ -1,10 +1,26 @@ - -Specify single filter — teal_slice • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + @@ -86,7 +108,8 @@
    -

    Usage

    +

    Usage +

    teal_slice(
       dataname,
       varname,
    @@ -105,8 +128,10 @@ 

    Usage

    -

    Arguments

    -
    dataname
    +

    Arguments +

    +
    +
    dataname

    (character(1)) name of data set

    @@ -165,16 +190,19 @@

    Arguments -

    Value

    +

    Value +

    A teal.slice object. Depending on whether varname or expr was specified, the resulting teal_slice also receives class teal_slice_var or teal_slice_expr, respectively.

    -

    Details

    +

    Details +

    teal_slice object fully describes filter state and can be used to create, modify, and delete a filter state. A teal_slice contains a number of common fields (all named arguments of teal_slice), some of which are mandatory, but only @@ -183,7 +211,9 @@

    DetailsSetting any of the other values to NULL means that those properties will not be modified (when setting an existing state) or that they will be determined by data (when creating new a new one). Entire object is FilterState class member and can be accessed with FilterState$get_state().

    -

    A teal_slice can come in two flavors:

    1. teal_slice_var - +

      A teal_slice can come in two flavors:

      +
        +
      1. teal_slice_var - this describes a typical interactive filter that refers to a single variable, managed by the FilterState class. This class is created when varname is specified. The object retains all fields specified in the call. id can be created by default and need not be specified.

      2. @@ -193,7 +223,8 @@

        Detailsexpr is specified. dataname and anchored are retained, fixed is set to TRUE, id becomes mandatory, title remains optional, while other arguments are disregarded.

        -

      A teal_slice can be passed FilterState/FilterStateExpr constructors to instantiate an object. +

    +

    A teal_slice can be passed FilterState/FilterStateExpr constructors to instantiate an object. It can also be passed to FilterState$set_state to modify the state. However, once a FilterState is created, only the mutable features can be set with a teal_slice: selected, keep_na and keep_inf.

    @@ -205,11 +236,13 @@

    DetailsFilterState instantiated with anchored = TRUE cannot be removed.

    -

    Note

    +

    Note +

    Date time objects of POSIX*t classes are printed as strings after converting to UTC timezone.

    -

    Filters in SumarizedExperiment and MultiAssayExperiment objects

    +

    Filters in SumarizedExperiment and MultiAssayExperiment objects +

    @@ -223,13 +256,15 @@

    Filters in order to determine whether the filter refers to the SE's rowData or colData.

    -

    Examples

    +

    Examples +

    x1 <- teal_slice(
       dataname = "data",
       id = "Female adults",
    @@ -306,17 +341,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/latest-tag/reference/teal_slices-utilities.html b/latest-tag/reference/teal_slices-utilities.html index 0aea97630..d2478cac7 100644 --- a/latest-tag/reference/teal_slices-utilities.html +++ b/latest-tag/reference/teal_slices-utilities.html @@ -1,8 +1,24 @@ - -teal_slices utility functions — teal_slices-utilities • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,7 +106,8 @@
    -

    Usage

    +

    Usage +

    is.teal_slices(x)
     
     as.teal_slices(x)
    @@ -105,8 +129,10 @@ 

    Usage

    -

    Arguments

    -
    x
    +

    Arguments +

    +
    +
    x

    object to test for teal_slices, object to convert to teal_slices or a teal_slices object

    @@ -129,10 +155,12 @@

    Arguments -

    Examples

    +

    Examples +

    filter_1 <- teal_slice(
       dataname = "dataname1",
       varname = "varname1",
    @@ -345,17 +373,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/latest-tag/reference/teal_slices.html b/latest-tag/reference/teal_slices.html index 74f3eb340..3e0350dce 100644 --- a/latest-tag/reference/teal_slices.html +++ b/latest-tag/reference/teal_slices.html @@ -1,10 +1,26 @@ - -Complete filter specification — teal_slices • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + @@ -86,7 +108,8 @@
    -

    Usage

    +

    Usage +

    teal_slices(
       ...,
       exclude_varnames = NULL,
    @@ -97,8 +120,10 @@ 

    Usage

    -

    Arguments

    -
    ...
    +

    Arguments +

    +
    +
    ...

    any number of teal_slice objects.

    @@ -109,29 +134,36 @@

    Arguments[Experimental] +
    +

    [Experimental] This is a new feature. Do kindly share your opinions on teal.slice's GitHub repository.

    (character(1)) string specifying how observations are tallied by these filter states. -Possible options:

    • "none" (default) to have counts of single FilterState to show unfiltered number only.

    • +Possible options:

      +
        +
      • "none" (default) to have counts of single FilterState to show unfiltered number only.

      • "all" to have counts of single FilterState to show number of observation in filtered and unfiltered dataset. Note, that issues were reported when using this option with MultiAssayExperiment. Please make sure that adding new filters doesn't fail on target platform before deploying for production.

      • -
    + +
    allow_add

    (logical(1)) logical flag specifying whether the user will be able to add new filters

    -

    + +
    -

    Value

    +

    Value +

    teal_slices, which is an unnamed list of teal_slice objects.

    -

    Details

    +

    Details +

    teal_slices() collates multiple teal_slice objects into a teal_slices object, a complete filter specification. This is used by all classes above FilterState as well as filter_panel_api wrapper functions. @@ -142,17 +174,21 @@

    Detailsteal_slices.

    -

    See also

    +

    See also +

    -
    + +
    -

    Examples

    +

    Examples +

    filter_1 <- teal_slice(
       dataname = "dataname1",
       varname = "varname1",
    @@ -365,17 +401,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/latest-tag/reference/to_json.html b/latest-tag/reference/to_json.html index 766da7489..d77cc5611 100644 --- a/latest-tag/reference/to_json.html +++ b/latest-tag/reference/to_json.html @@ -1,12 +1,28 @@ - - + + + + + +Converts a list to a JSON string — to_json • teal.slice +Converts a list to a JSON string — to_json • teal.slice + + + + + + + + + + Skip to contents @@ -22,7 +38,8 @@ + + @@ -89,35 +111,42 @@
    -

    Usage

    +

    Usage +

    to_json(x)
    -

    Arguments

    -
    x
    +

    Arguments +

    +
    +
    x

    (list) representation of teal_slices object.

    -
    + +
    -

    Value

    +

    Value +

    A JSON string.

    + + + + - - + + diff --git a/latest-tag/reference/toggle_button.html b/latest-tag/reference/toggle_button.html index f87ce85e7..4a1b70d4e 100644 --- a/latest-tag/reference/toggle_button.html +++ b/latest-tag/reference/toggle_button.html @@ -1,8 +1,24 @@ - -Toggle button properties. — toggle_button • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -83,15 +105,18 @@
    -

    Usage

    +

    Usage +

    toggle_icon(input_id, icons, one_way = FALSE)
     
     toggle_title(input_id, titles, one_way = FALSE)
    -

    Arguments

    -
    input_id
    +

    Arguments +

    +
    +
    input_id

    (character(1)) (name-spaced) id of the button

    @@ -104,15 +129,18 @@

    Arguments -

    Value

    +

    Value +

    NULL, invisibly.

    -

    Details

    +

    Details +

    Wrapper functions that use shinyjs::runjs to change button properties in response to events, typically clicking those very buttons. shiny's actionButton and actionLink create <a> tags, @@ -123,7 +151,8 @@

    Details
    -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     toggle_icon <- getFromNamespace("toggle_icon", "teal.slice")
     
    @@ -178,17 +207,19 @@ 

    Examples

    + +

    + + - - + + diff --git a/latest-tag/reference/topological_sort.html b/latest-tag/reference/topological_sort.html index 85b576f21..76a94714b 100644 --- a/latest-tag/reference/topological_sort.html +++ b/latest-tag/reference/topological_sort.html @@ -1,10 +1,26 @@ - -Topological graph sort — topological_sort • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + @@ -86,23 +108,29 @@
    -

    Usage

    +

    Usage +

    topological_sort(graph)
    -

    Arguments

    -
    graph
    +

    Arguments +

    +
    +
    graph

    (named list) with node vector elements

    -
    + +
    -

    Details

    +

    Details +

    Implementation of Kahn algorithm with a modification to maintain the order of input elements.

    -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     topological_sort <- getFromNamespace("topological_sort", "teal.slice")
     
    @@ -148,17 +176,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/latest-tag/reference/trim_lines_json.html b/latest-tag/reference/trim_lines_json.html index 962b55ad5..b5f123b9a 100644 --- a/latest-tag/reference/trim_lines_json.html +++ b/latest-tag/reference/trim_lines_json.html @@ -1,10 +1,26 @@ - -Trim lines in JSON string — trim_lines_json • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + @@ -86,35 +108,42 @@
    -

    Usage

    +

    Usage +

    trim_lines_json(x)
    -

    Arguments

    -
    x
    +

    Arguments +

    +
    +
    x

    (character)

    -
    + +
    -

    Value

    +

    Value +

    A character string trimmed after a certain hard-coded number of characters in the value portion.

    + + + + - - + + diff --git a/latest-tag/reference/variable_types.html b/latest-tag/reference/variable_types.html index d27e6b158..05e7f0d79 100644 --- a/latest-tag/reference/variable_types.html +++ b/latest-tag/reference/variable_types.html @@ -1,8 +1,24 @@ - -Get classes of selected columns from dataset — variable_types • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -83,13 +105,16 @@
    -

    Usage

    +

    Usage +

    variable_types(data, columns = NULL)
    -

    Arguments

    -
    data
    +

    Arguments +

    +
    +
    data

    (data.frame or DataFrame or matrix) Object in which to determine variable types.

    @@ -97,16 +122,19 @@

    Arguments -

    Value

    +

    Value +

    Character vector of classes of columns from provided data.

    -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     variable_types <- getFromNamespace("variable_types", "teal.slice")
     
    @@ -142,17 +170,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/linter_indentation@pre-release-cleanup@main/coverage-report/index.html b/linter_indentation@pre-release-cleanup@main/coverage-report/index.html index 74a420b75..8e4ed1012 100644 --- a/linter_indentation@pre-release-cleanup@main/coverage-report/index.html +++ b/linter_indentation@pre-release-cleanup@main/coverage-report/index.html @@ -1,22 +1,21 @@ - - + - + - - + + - + - + - - - + + + @@ -795,7 +794,8 @@

    teal.slice coverage - 65.74%

    98 - 67x + 67x +
          checkmate::assert_list(data_objects, any.missing = FALSE, min.len = 0, names = "unique")
    @@ -809,21 +809,24 @@

    teal.slice coverage - 65.74%

    100 - 67x + 67x +
          data_objects <- lapply(data_objects, function(dataset) {
    101 - 101x + 101x +
            if (is.list(dataset) && "dataset" %in% names(dataset)) {
    102 - 76x + 76x +
              dataset$dataset
    @@ -837,7 +840,8 @@

    teal.slice coverage - 65.74%

    104 - 25x + 25x +
              dataset
    @@ -872,49 +876,56 @@

    teal.slice coverage - 65.74%

    109 - 67x + 67x +
          checkmate::assert_class(join_keys, "join_keys")
    110 - 66x + 66x +
          self$set_join_keys(join_keys)
    111 - 66x + 66x +
          child_parent <- sapply(
    112 - 66x + 66x +
            names(data_objects),
    113 - 66x + 66x +
            function(i) teal.data::parent(join_keys, i),
    114 - 66x + 66x +
            USE.NAMES = TRUE,
    115 - 66x + 66x +
            simplify = FALSE
    @@ -928,14 +939,16 @@

    teal.slice coverage - 65.74%

    117 - 66x + 66x +
          ordered_datanames <- topological_sort(child_parent)
    118 - 66x + 66x +
          ordered_datanames <- intersect(ordered_datanames, names(data_objects))
    @@ -949,21 +962,24 @@

    teal.slice coverage - 65.74%

    120 - 66x + 66x +
          for (dataname in ordered_datanames) {
    121 - 100x + 100x +
            ds_object <- data_objects[[dataname]]
    122 - 100x + 100x +
            self$set_dataset(data = ds_object, dataname = dataname)
    @@ -984,7 +1000,8 @@

    teal.slice coverage - 65.74%

    125 - 66x + 66x +
          self$set_available_teal_slices(x = reactive(NULL))
    @@ -998,7 +1015,8 @@

    teal.slice coverage - 65.74%

    127 - 66x + 66x +
          invisible(self)
    @@ -1068,7 +1086,8 @@

    teal.slice coverage - 65.74%

    137 - 118x + 118x +
          names(private$filtered_datasets)
    @@ -1138,7 +1157,8 @@

    teal.slice coverage - 65.74%

    147 - 1x + 1x +
          private$get_filtered_dataset(dataname)$get_dataset_label()
    @@ -1236,14 +1256,16 @@

    teal.slice coverage - 65.74%

    161 - 67x + 67x +
          checkmate::assert_class(x, "reactive")
    162 - 67x + 67x +
          private$available_teal_slices <- reactive({
    @@ -1257,49 +1279,56 @@

    teal.slice coverage - 65.74%

    164 - 4x + 4x +
            current_state <- isolate(self$get_filter_state())
    165 - 4x + 4x +
            allowed <- attr(current_state, "include_varnames")
    166 - 4x + 4x +
            forbidden <- attr(current_state, "exclude_varnames")
    167 - 4x + 4x +
            foo <- function(slice) {
    168 - 13x + 13x +
              if (slice$dataname %in% self$datanames()) {
    169 - 13x + 13x +
                if (slice$fixed) {
    170 - 4x + 4x +
                  TRUE
    @@ -1313,14 +1342,16 @@

    teal.slice coverage - 65.74%

    172 - 9x + 9x +
                  isTRUE(slice$varname %in% allowed[[slice$dataname]]) ||
    173 - 9x + 9x +
                    isFALSE(slice$varname %in% forbidden[[slice$dataname]])
    @@ -1362,7 +1393,8 @@

    teal.slice coverage - 65.74%

    179 - 4x + 4x +
            Filter(foo, x())
    @@ -1376,7 +1408,8 @@

    teal.slice coverage - 65.74%

    181 - 67x + 67x +
          invisible(NULL)
    @@ -1446,7 +1479,8 @@

    teal.slice coverage - 65.74%

    191 - 4x + 4x +
          private$available_teal_slices
    @@ -1642,14 +1676,16 @@

    teal.slice coverage - 65.74%

    219 - 10x + 10x +
          checkmate::assert_subset(dataname, self$datanames())
    220 - 9x + 9x +
          private$get_filtered_dataset(dataname)$get_call()
    @@ -1740,28 +1776,32 @@

    teal.slice coverage - 65.74%

    233 - 24x + 24x +
          checkmate::assert_subset(dataname, self$datanames())
    234 - 23x + 23x +
          checkmate::assert_flag(filtered)
    235 - 22x + 22x +
          data <- private$get_filtered_dataset(dataname)$get_dataset(filtered)
    236 - 3x + 3x +
          if (filtered) data() else data
    @@ -1824,7 +1864,8 @@

    teal.slice coverage - 65.74%

    245 - 2x + 2x +
          return(private$join_keys)
    @@ -1922,28 +1963,32 @@

    teal.slice coverage - 65.74%

    259 - 9x + 9x +
          rows <- lapply(
    260 - 9x + 9x +
            datanames,
    261 - 9x + 9x +
            function(dataname) {
    262 - 11x + 11x +
              private$get_filtered_dataset(dataname)$get_filter_overview()
    @@ -1964,14 +2009,16 @@

    teal.slice coverage - 65.74%

    265 - 5x + 5x +
          unssuported_idx <- vapply(rows, function(x) all(is.na(x[-1])), logical(1))
    266 - 5x + 5x +
          dplyr::bind_rows(c(rows[!unssuported_idx], rows[unssuported_idx]))
    @@ -2048,7 +2095,8 @@

    teal.slice coverage - 65.74%

    277 - 1x + 1x +
          private$get_filtered_dataset(dataname)$get_keys()
    @@ -2202,14 +2250,16 @@

    teal.slice coverage - 65.74%

    299 - 105x + 105x +
          checkmate::assert_string(dataname)
    300 - 105x + 105x +
          logger::log_trace("FilteredData$set_dataset setting dataset, name: { dataname }")
    @@ -2230,7 +2280,8 @@

    teal.slice coverage - 65.74%

    303 - 105x + 105x +
          check_simple_name(dataname)
    @@ -2244,21 +2295,24 @@

    teal.slice coverage - 65.74%

    305 - 105x + 105x +
          parent_dataname <- teal.data::parent(private$join_keys, dataname)
    306 - 105x + 105x +
          keys <- private$join_keys[dataname, dataname]
    307 - 104x + 104x +
          if (is.null(keys)) keys <- character(0)
    @@ -2272,35 +2326,40 @@

    teal.slice coverage - 65.74%

    309 - 105x + 105x +
          if (length(parent_dataname) == 0) {
    310 - 95x + 95x +
            private$filtered_datasets[[dataname]] <- init_filtered_dataset(
    311 - 95x + 95x +
              dataset = data,
    312 - 95x + 95x +
              dataname = dataname,
    313 - 95x + 95x +
              keys = keys
    @@ -2321,7 +2380,8 @@

    teal.slice coverage - 65.74%

    316 - 10x + 10x +
            join_keys <- private$join_keys[dataname, parent_dataname]
    @@ -2335,49 +2395,56 @@

    teal.slice coverage - 65.74%

    318 - 10x + 10x +
            private$filtered_datasets[[dataname]] <- init_filtered_dataset(
    319 - 10x + 10x +
              dataset = data,
    320 - 10x + 10x +
              dataname = dataname,
    321 - 10x + 10x +
              keys = keys,
    322 - 10x + 10x +
              parent_name = parent_dataname,
    323 - 10x + 10x +
              parent = reactive(self$get_data(parent_dataname, filtered = TRUE)),
    324 - 10x + 10x +
              join_keys = join_keys
    @@ -2405,7 +2472,8 @@

    teal.slice coverage - 65.74%

    328 - 105x + 105x +
          invisible(self)
    @@ -2482,21 +2550,24 @@

    teal.slice coverage - 65.74%

    339 - 66x + 66x +
          checkmate::assert_class(join_keys, "join_keys")
    340 - 66x + 66x +
          private$join_keys <- join_keys
    341 - 66x + 66x +
          invisible(self)
    @@ -2573,35 +2644,40 @@

    teal.slice coverage - 65.74%

    352 - 53x + 53x +
          states <- unname(lapply(private$filtered_datasets, function(x) x$get_filter_state()))
    353 - 53x + 53x +
          slices <- Filter(Negate(is.null), states)
    354 - 53x + 53x +
          slices <- do.call(c, slices)
    355 - 53x + 53x +
          if (!is.null(slices)) {
    356 - 53x + 53x +
            attr(slices, "allow_add") <- private$allow_add
    @@ -2615,7 +2691,8 @@

    teal.slice coverage - 65.74%

    358 - 53x + 53x +
          slices
    @@ -2699,35 +2776,40 @@

    teal.slice coverage - 65.74%

    370 - 5x + 5x +
          datasets <- lapply(self$datanames(), private$get_filtered_dataset)
    371 - 5x + 5x +
          ind <- vapply(datasets, inherits, logical(1L), what = "DefaultFilteredDataset")
    372 - 5x + 5x +
          states <- do.call(c, lapply(datasets[!ind], function(ds) ds$get_filter_state()))
    373 - 5x + 5x +
          states_fmt <- format(states, show_all = show_all, trim_lines = trim_lines)
    374 - 5x + 5x +
          holders_fmt <- vapply(datasets[ind], format, character(1L), show_all = show_all, trim_lines = trim_lines)
    @@ -2741,28 +2823,32 @@

    teal.slice coverage - 65.74%

    376 - 5x + 5x +
          sprintf(
    377 - 5x + 5x +
            "%s:\n%s",
    378 - 5x + 5x +
            class(self)[1],
    379 - 5x + 5x +
            paste(c(states_fmt, holders_fmt), collapse = "\n")
    @@ -2902,42 +2988,48 @@

    teal.slice coverage - 65.74%

    399 - 31x + 31x +
          shiny::isolate({
    400 - 31x + 31x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initializing")
    401 - 31x + 31x +
            checkmate::assert_class(state, "teal_slices")
    402 - 31x + 31x +
            allow_add <- attr(state, "allow_add")
    403 - 31x + 31x +
            if (!is.null(allow_add)) {
    404 - 31x + 31x +
              private$allow_add <- allow_add
    @@ -2958,21 +3050,24 @@

    teal.slice coverage - 65.74%

    407 - 31x + 31x +
            lapply(self$datanames(), function(dataname) {
    408 - 63x + 63x +
              states <- Filter(function(x) identical(x$dataname, dataname), state)
    409 - 63x + 63x +
              private$get_filtered_dataset(dataname)$set_filter_state(states)
    @@ -2993,7 +3088,8 @@

    teal.slice coverage - 65.74%

    412 - 31x + 31x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initialized")
    @@ -3014,7 +3110,8 @@

    teal.slice coverage - 65.74%

    415 - 31x + 31x +
          invisible(NULL)
    @@ -3105,28 +3202,32 @@

    teal.slice coverage - 65.74%

    428 - 8x + 8x +
          shiny::isolate({
    429 - 8x + 8x +
            checkmate::assert_class(state, "teal_slices")
    430 - 8x + 8x +
            datanames <- unique(vapply(state, "[[", character(1L), "dataname"))
    431 - 8x + 8x +
            checkmate::assert_subset(datanames, self$datanames())
    @@ -3140,14 +3241,16 @@

    teal.slice coverage - 65.74%

    433 - 8x + 8x +
            logger::log_trace(
    434 - 8x + 8x +
              "{ class(self)[1] }$remove_filter_state removing filter(s), dataname: { private$dataname }"
    @@ -3168,21 +3271,24 @@

    teal.slice coverage - 65.74%

    437 - 8x + 8x +
            lapply(datanames, function(dataname) {
    438 - 9x + 9x +
              slices <- Filter(function(x) identical(x$dataname, dataname), state)
    439 - 9x + 9x +
              private$get_filtered_dataset(dataname)$remove_filter_state(slices)
    @@ -3203,14 +3309,16 @@

    teal.slice coverage - 65.74%

    442 - 8x + 8x +
            logger::log_trace(
    443 - 8x + 8x +
              "{ class(self)[1] }$remove_filter_state removed filter(s), dataname: { private$dataname }"
    @@ -3238,7 +3346,8 @@

    teal.slice coverage - 65.74%

    447 - 8x + 8x +
          invisible(NULL)
    @@ -3350,14 +3459,16 @@

    teal.slice coverage - 65.74%

    463 - 7x + 7x +
          logger::log_trace(
    464 - 7x + 7x +
            "FilteredData$clear_filter_states called, datanames: { toString(datanames) }"
    @@ -3378,21 +3489,24 @@

    teal.slice coverage - 65.74%

    467 - 7x + 7x +
          for (dataname in datanames) {
    468 - 12x + 12x +
            fdataset <- private$get_filtered_dataset(dataname = dataname)
    469 - 12x + 12x +
            fdataset$clear_filter_states(force)
    @@ -3413,28 +3527,32 @@

    teal.slice coverage - 65.74%

    472 - 7x + 7x +
          logger::log_trace(
    473 - 7x + 7x +
            paste(
    474 - 7x + 7x +
              "FilteredData$clear_filter_states removed all non-anchored FilterStates,",
    475 - 7x + 7x +
              "datanames: { toString(datanames) }"
    @@ -3462,7 +3580,8 @@

    teal.slice coverage - 65.74%

    479 - 7x + 7x +
          invisible(NULL)
    @@ -3735,35 +3854,40 @@

    teal.slice coverage - 65.74%

    518 - 1x + 1x +
          checkmate::assert_function(active_datanames)
    519 - 1x + 1x +
          moduleServer(
    520 - 1x + 1x +
            id = id,
    521 - 1x + 1x +
            function(input, output, session) {
    522 - 1x + 1x +
              logger::log_trace("FilteredData$srv_filter_panel initializing")
    @@ -3777,14 +3901,16 @@

    teal.slice coverage - 65.74%

    524 - 1x + 1x +
              active_datanames_resolved <- reactive({
    525 - 1x + 1x +
                checkmate::assert_subset(active_datanames(), self$datanames())
    @@ -3812,28 +3938,32 @@

    teal.slice coverage - 65.74%

    529 - 1x + 1x +
              self$srv_overview("overview", active_datanames_resolved)
    530 - 1x + 1x +
              self$srv_active("active", active_datanames_resolved)
    531 - 1x + 1x +
              if (private$allow_add) {
    532 - 1x + 1x +
                self$srv_add("add", active_datanames_resolved)
    @@ -3854,14 +3984,16 @@

    teal.slice coverage - 65.74%

    535 - 1x + 1x +
              logger::log_trace("FilteredData$srv_filter_panel initialized")
    536 - 1x + 1x +
              NULL
    @@ -4302,21 +4434,24 @@

    teal.slice coverage - 65.74%

    599 - 3x + 3x +
          checkmate::assert_function(active_datanames)
    600 - 3x + 3x +
          shiny::moduleServer(id, function(input, output, session) {
    601 - 3x + 3x +
            logger::log_trace("FilteredData$srv_active initializing")
    @@ -4330,7 +4465,8 @@

    teal.slice coverage - 65.74%

    603 - 3x + 3x +
            private$srv_available_filters("available_filters")
    @@ -4344,7 +4480,8 @@

    teal.slice coverage - 65.74%

    605 - 3x + 3x +
            observeEvent(input$minimise_filter_active, {
    @@ -4393,42 +4530,48 @@

    teal.slice coverage - 65.74%

    612 - 3x + 3x +
            observeEvent(private$get_filter_count(), {
    613 - 3x + 3x +
              shinyjs::toggle("remove_all_filters", condition = private$get_filter_count() != 0)
    614 - 3x + 3x +
              shinyjs::show("filter_active_vars_contents")
    615 - 3x + 3x +
              shinyjs::hide("filters_active_count")
    616 - 3x + 3x +
              toggle_icon(session$ns("minimise_filter_active"), c("fa-angle-right", "fa-angle-down"), TRUE)
    617 - 3x + 3x +
              toggle_title(session$ns("minimise_filter_active"), c("Restore panel", "Minimise Panel"), TRUE)
    @@ -4449,28 +4592,32 @@

    teal.slice coverage - 65.74%

    620 - 3x + 3x +
            observeEvent(active_datanames(), {
    621 - 2x + 2x +
              lapply(self$datanames(), function(dataname) {
    622 - 4x + 4x +
                if (dataname %in% active_datanames()) {
    623 - 4x + 4x +
                  shinyjs::show(dataname)
    @@ -4533,35 +4680,40 @@

    teal.slice coverage - 65.74%

    632 - 3x + 3x +
            lapply(
    633 - 3x + 3x +
              self$datanames(),
    634 - 3x + 3x +
              function(dataname) {
    635 - 6x + 6x +
                fdataset <- private$get_filtered_dataset(dataname)
    636 - 6x + 6x +
                fdataset$srv_active(id = dataname)
    @@ -4589,49 +4741,56 @@

    teal.slice coverage - 65.74%

    640 - 3x + 3x +
            output$teal_filters_count <- shiny::renderText({
    641 - 3x + 3x +
              n_filters_active <- private$get_filter_count()
    642 - 3x + 3x +
              shiny::req(n_filters_active > 0L)
    643 - 2x + 2x +
              sprintf(
    644 - 2x + 2x +
                "%s filter%s applied across datasets",
    645 - 2x + 2x +
                n_filters_active,
    646 - 2x + 2x +
                ifelse(n_filters_active == 1, "", "s")
    @@ -4659,28 +4818,32 @@

    teal.slice coverage - 65.74%

    650 - 3x + 3x +
            observeEvent(input$remove_all_filters, {
    651 - 1x + 1x +
              logger::log_trace("FilteredData$srv_filter_panel@1 removing all non-anchored filters")
    652 - 1x + 1x +
              self$clear_filter_states()
    653 - 1x + 1x +
              logger::log_trace("FilteredData$srv_filter_panel@1 removed all non-anchored filters")
    @@ -4694,14 +4857,16 @@

    teal.slice coverage - 65.74%

    655 - 3x + 3x +
            logger::log_trace("FilteredData$srv_active initialized")
    656 - 3x + 3x +
            NULL
    @@ -5079,28 +5244,32 @@

    teal.slice coverage - 65.74%

    710 - 1x + 1x +
          checkmate::assert_class(active_datanames, "reactive")
    711 - 1x + 1x +
          moduleServer(id, function(input, output, session) {
    712 - 1x + 1x +
            logger::log_trace("FilteredData$srv_add initializing")
    713 - 1x + 1x +
            shiny::observeEvent(input$minimise_filter_add_vars, {
    @@ -5142,7 +5311,8 @@

    teal.slice coverage - 65.74%

    719 - 1x + 1x +
            observeEvent(active_datanames(), {
    @@ -5226,35 +5396,40 @@

    teal.slice coverage - 65.74%

    731 - 1x + 1x +
            lapply(
    732 - 1x + 1x +
              self$datanames(),
    733 - 1x + 1x +
              function(dataname) {
    734 - 2x + 2x +
                fdataset <- private$get_filtered_dataset(dataname)
    735 - 2x + 2x +
                fdataset$srv_add(id = dataname)
    @@ -5275,14 +5450,16 @@

    teal.slice coverage - 65.74%

    738 - 1x + 1x +
            logger::log_trace("FilteredData$srv_filter_panel initialized")
    739 - 1x + 1x +
            NULL
    @@ -5674,35 +5851,40 @@

    teal.slice coverage - 65.74%

    795 - 1x + 1x +
          checkmate::assert_class(active_datanames, "reactive")
    796 - 1x + 1x +
          moduleServer(
    797 - 1x + 1x +
            id = id,
    798 - 1x + 1x +
            function(input, output, session) {
    799 - 1x + 1x +
              logger::log_trace("FilteredData$srv_filter_overview initializing")
    @@ -5716,7 +5898,8 @@

    teal.slice coverage - 65.74%

    801 - 1x + 1x +
              shiny::observeEvent(input$minimise_filter_overview, {
    @@ -5758,7 +5941,8 @@

    teal.slice coverage - 65.74%

    807 - 1x + 1x +
              output$table <- renderUI({
    @@ -6262,14 +6446,16 @@

    teal.slice coverage - 65.74%

    879 - 1x + 1x +
              logger::log_trace("FilteredData$srv_filter_overview initialized")
    880 - 1x + 1x +
              NULL
    @@ -6528,7 +6714,8 @@

    teal.slice coverage - 65.74%

    917 - 147x + 147x +
          if (length(dataname) == 0) {
    @@ -6549,7 +6736,8 @@

    teal.slice coverage - 65.74%

    920 - 147x + 147x +
            private$filtered_datasets[[dataname]]
    @@ -6633,7 +6821,8 @@

    teal.slice coverage - 65.74%

    932 - 11x + 11x +
          length(self$get_filter_state())
    @@ -6899,28 +7088,32 @@

    teal.slice coverage - 65.74%

    970 - 4x + 4x +
          moduleServer(id, function(input, output, session) {
    971 - 4x + 4x +
            slices_available <- self$get_available_teal_slices()
    972 - 4x + 4x +
            slices_interactive <- reactive(
    973 - 4x + 4x +
              Filter(function(slice) isFALSE(slice$fixed), slices_available())
    @@ -6934,14 +7127,16 @@

    teal.slice coverage - 65.74%

    975 - 4x + 4x +
            slices_fixed <- reactive(
    976 - 4x + 4x +
              Filter(function(slice) isTRUE(slice$fixed), slices_available())
    @@ -6955,21 +7150,24 @@

    teal.slice coverage - 65.74%

    978 - 4x + 4x +
            available_slices_id <- reactive(vapply(slices_available(), `[[`, character(1), "id"))
    979 - 4x + 4x +
            active_slices_id <- reactive(vapply(self$get_filter_state(), `[[`, character(1), "id"))
    980 - 4x + 4x +
            duplicated_slice_references <- reactive({
    @@ -6983,35 +7181,40 @@

    teal.slice coverage - 65.74%

    982 - 8x + 8x +
              slice_reference <- vapply(slices_available(), get_default_slice_id, character(1))
    983 - 8x + 8x +
              is_duplicated_reference <- duplicated(slice_reference) | duplicated(slice_reference, fromLast = TRUE)
    984 - 8x + 8x +
              is_active <- available_slices_id() %in% active_slices_id()
    985 - 8x + 8x +
              is_not_expr <- !vapply(slices_available(), inherits, logical(1), "teal_slice_expr")
    986 - 8x + 8x +
              slice_reference[is_duplicated_reference & is_active & is_not_expr]
    @@ -7032,70 +7235,80 @@

    teal.slice coverage - 65.74%

    989 - 4x + 4x +
            checkbox_group_element <- function(name, value, label, checked, disabled = FALSE) {
    990 - 35x + 35x +
              tags$div(
    991 - 35x + 35x +
                class = "checkbox available-filters",
    992 - 35x + 35x +
                tags$label(
    993 - 35x + 35x +
                  tags$input(
    994 - 35x + 35x +
                    type = "checkbox",
    995 - 35x + 35x +
                    name = name,
    996 - 35x + 35x +
                    value = value,
    997 - 35x + 35x +
                    checked = checked,
    998 - 35x + 35x +
                    disabled = if (disabled) "disabled"
    @@ -7109,7 +7322,8 @@

    teal.slice coverage - 65.74%

    1000 - 35x + 35x +
                  tags$span(label, disabled = if (disabled) disabled)
    @@ -7144,42 +7358,48 @@

    teal.slice coverage - 65.74%

    1005 - 4x + 4x +
            output$checkbox <- renderUI({
    1006 - 8x + 8x +
              checkbox <- checkboxGroupInput(
    1007 - 8x + 8x +
                session$ns("available_slices_id"),
    1008 - 8x + 8x +
                label = NULL,
    1009 - 8x + 8x +
                choices = NULL,
    1010 - 8x + 8x +
                selected = NULL
    @@ -7193,14 +7413,16 @@

    teal.slice coverage - 65.74%

    1012 - 8x + 8x +
              active_slices_ids <- active_slices_id()
    1013 - 8x + 8x +
              duplicated_slice_refs <- duplicated_slice_references()
    @@ -7214,7 +7436,8 @@

    teal.slice coverage - 65.74%

    1015 - 8x + 8x +
              checkbox_group_slice <- function(slice) {
    @@ -7228,63 +7451,72 @@

    teal.slice coverage - 65.74%

    1017 - 35x + 35x +
                shiny::isolate({
    1018 - 35x + 35x +
                  checkbox_group_element(
    1019 - 35x + 35x +
                    name = session$ns("available_slices_id"),
    1020 - 35x + 35x +
                    value = slice$id,
    1021 - 35x + 35x +
                    label = slice$id,
    1022 - 35x + 35x +
                    checked = if (slice$id %in% active_slices_ids) "checked",
    1023 - 35x + 35x +
                    disabled = slice$anchored ||
    1024 - 35x + 35x +
                      get_default_slice_id(slice) %in% duplicated_slice_refs &&
    1025 - 35x + 35x +
                        !slice$id %in% active_slices_ids
    @@ -7319,14 +7551,16 @@

    teal.slice coverage - 65.74%

    1030 - 8x + 8x +
              interactive_choice_mock <- lapply(slices_interactive(), checkbox_group_slice)
    1031 - 8x + 8x +
              non_interactive_choice_mock <- lapply(slices_fixed(), checkbox_group_slice)
    @@ -7340,63 +7574,72 @@

    teal.slice coverage - 65.74%

    1033 - 8x + 8x +
              htmltools::tagInsertChildren(
    1034 - 8x + 8x +
                checkbox,
    1035 - 8x + 8x +
                br(),
    1036 - 8x + 8x +
                if (length(non_interactive_choice_mock)) tags$strong("Fixed filters"),
    1037 - 8x + 8x +
                non_interactive_choice_mock,
    1038 - 8x + 8x +
                if (length(interactive_choice_mock)) tags$strong("Interactive filters"),
    1039 - 8x + 8x +
                interactive_choice_mock,
    1040 - 8x + 8x +
                .cssSelector = "div.shiny-options-group",
    1041 - 8x + 8x +
                after = 0
    @@ -7424,49 +7667,56 @@

    teal.slice coverage - 65.74%

    1045 - 4x + 4x +
            observeEvent(input$available_slices_id, ignoreNULL = FALSE, ignoreInit = TRUE, {
    1046 - 5x + 5x +
              new_slices_id <- setdiff(input$available_slices_id, active_slices_id())
    1047 - 5x + 5x +
              removed_slices_id <- setdiff(active_slices_id(), input$available_slices_id)
    1048 - 5x + 5x +
              if (length(new_slices_id)) {
    1049 - 3x + 3x +
                new_teal_slices <- Filter(
    1050 - 3x + 3x +
                  function(slice) slice$id %in% new_slices_id,
    1051 - 3x + 3x +
                  private$available_teal_slices()
    @@ -7480,7 +7730,8 @@

    teal.slice coverage - 65.74%

    1053 - 3x + 3x +
                self$set_filter_state(new_teal_slices)
    @@ -7501,28 +7752,32 @@

    teal.slice coverage - 65.74%

    1056 - 5x + 5x +
              if (length(removed_slices_id)) {
    1057 - 4x + 4x +
                removed_teal_slices <- Filter(
    1058 - 4x + 4x +
                  function(slice) slice$id %in% removed_slices_id,
    1059 - 4x + 4x +
                  self$get_filter_state()
    @@ -7536,7 +7791,8 @@

    teal.slice coverage - 65.74%

    1061 - 4x + 4x +
                self$remove_filter_state(removed_teal_slices)
    @@ -7564,21 +7820,24 @@

    teal.slice coverage - 65.74%

    1065 - 4x + 4x +
            observeEvent(private$available_teal_slices(), ignoreNULL = FALSE, {
    1066 - 3x + 3x +
              if (length(private$available_teal_slices())) {
    1067 - 1x + 1x +
                shinyjs::show("available_menu")
    @@ -7592,7 +7851,8 @@

    teal.slice coverage - 65.74%

    1069 - 2x + 2x +
                shinyjs::hide("available_menu")
    @@ -8662,42 +8922,48 @@

    teal.slice coverage - 65.74%

    146 - 159x + 159x +
          shiny::isolate({
    147 - 159x + 159x +
            checkmate::assert(
    148 - 159x + 159x +
              is.character(x),
    149 - 159x + 159x +
              is.factor(x),
    150 - 159x + 159x +
              length(unique(x[!is.na(x)])) < getOption("teal.threshold_slider_vs_checkboxgroup"),
    151 - 159x + 159x +
              combine = "or"
    @@ -8718,28 +8984,32 @@

    teal.slice coverage - 65.74%

    154 - 159x + 159x +
            x_factor <- if (!is.factor(x)) {
    155 - 124x + 124x +
              structure(
    156 - 124x + 124x +
                factor(as.character(x), levels = as.character(sort(unique(x)))),
    157 - 124x + 124x +
                label = attr(x, "label")
    @@ -8760,7 +9030,8 @@

    teal.slice coverage - 65.74%

    160 - 35x + 35x +
              x
    @@ -8781,35 +9052,40 @@

    teal.slice coverage - 65.74%

    163 - 159x + 159x +
            super$initialize(
    164 - 159x + 159x +
              x = x_factor,
    165 - 159x + 159x +
              x_reactive = x_reactive,
    166 - 159x + 159x +
              slice = slice,
    167 - 159x + 159x +
              extract_type = extract_type
    @@ -8823,63 +9099,72 @@

    teal.slice coverage - 65.74%

    169 - 159x + 159x +
            private$set_choices(slice$choices)
    170 - 159x + 159x +
            if (is.null(slice$selected) && slice$multiple) {
    171 - 42x + 42x +
              slice$selected <- private$get_choices()
    172 - 117x + 117x +
            } else if (is.null(slice$selected)) {
    173 - 1x + 1x +
              slice$selected <- private$get_choices()[1]
    174 - 116x + 116x +
            } else if (length(slice$selected) > 1 && !slice$multiple) {
    175 - 1x + 1x +
              warning(
    176 - 1x + 1x +
                "ChoicesFilterState allows \"selected\" to be of length 1 when \"multiple\" is FALSE. ",
    177 - 1x + 1x +
                "Only the first value will be used."
    @@ -8893,7 +9178,8 @@

    teal.slice coverage - 65.74%

    179 - 1x + 1x +
              slice$selected <- slice$selected[1]
    @@ -8907,28 +9193,32 @@

    teal.slice coverage - 65.74%

    181 - 159x + 159x +
            private$set_selected(slice$selected)
    182 - 159x + 159x +
            private$data_class <- class(x)[1L]
    183 - 159x + 159x +
            if (inherits(x, "POSIXt")) {
    184 - 9x + 9x +
              private$tzone <- Find(function(x) x != "", attr(as.POSIXlt(x), "tzone"))
    @@ -8949,7 +9239,8 @@

    teal.slice coverage - 65.74%

    187 - 159x + 159x +
            private$set_choices_counts(unname(table(x_factor)))
    @@ -8963,7 +9254,8 @@

    teal.slice coverage - 65.74%

    189 - 159x + 159x +
          invisible(self)
    @@ -9047,14 +9339,16 @@

    teal.slice coverage - 65.74%

    201 - 60x + 60x +
          if (isFALSE(private$is_any_filtered())) {
    202 - 7x + 7x +
            return(NULL)
    @@ -9068,49 +9362,56 @@

    teal.slice coverage - 65.74%

    204 - 29x + 29x +
          if (missing(dataname)) dataname <- private$get_dataname()
    205 - 53x + 53x +
          varname <- private$get_varname_prefixed(dataname)
    206 - 53x + 53x +
          selected <- private$get_selected()
    207 - 53x + 53x +
          if (length(selected) == 0) {
    208 - 6x + 6x +
            choices <- private$get_choices()
    209 - 6x + 6x +
            fun_compare <- if (length(choices) == 1L) "==" else "%in%"
    210 - 6x + 6x +
            filter_call <- call("!", call(fun_compare, varname, make_c_call(as.character(choices))))
    @@ -9124,14 +9425,16 @@

    teal.slice coverage - 65.74%

    212 - 47x + 47x +
            if (setequal(na.omit(private$x), selected)) {
    213 - 3x + 3x +
              filter_call <- NULL
    @@ -9145,7 +9448,8 @@

    teal.slice coverage - 65.74%

    215 - 44x + 44x +
              fun_compare <- if (length(selected) == 1L) "==" else "%in%"
    @@ -9159,14 +9463,16 @@

    teal.slice coverage - 65.74%

    217 - 44x + 44x +
              if (private$data_class != "factor") {
    218 - 37x + 37x +
                selected <- do.call(sprintf("as.%s", private$data_class), list(x = selected))
    @@ -9187,63 +9493,72 @@

    teal.slice coverage - 65.74%

    221 - 44x + 44x +
              filter_call <-
    222 - 44x + 44x +
                if (inherits(selected, "Date")) {
    223 - 1x + 1x +
                  call(fun_compare, varname, call("as.Date", make_c_call(as.character(selected))))
    224 - 44x + 44x +
                } else if (inherits(selected, c("POSIXct", "POSIXlt"))) {
    225 - 2x + 2x +
                  class <- class(selected)[1L]
    226 - 2x + 2x +
                  date_fun <- as.name(
    227 - 2x + 2x +
                    switch(class,
    228 - 2x + 2x +
                      "POSIXct" = "as.POSIXct",
    229 - 2x + 2x +
                      "POSIXlt" = "as.POSIXlt"
    @@ -9264,28 +9579,32 @@

    teal.slice coverage - 65.74%

    232 - 2x + 2x +
                  call(
    233 - 2x + 2x +
                    fun_compare,
    234 - 2x + 2x +
                    varname,
    235 - 2x + 2x +
                    as.call(list(date_fun, make_c_call(as.character(selected)), tz = private$tzone))
    @@ -9313,7 +9632,8 @@

    teal.slice coverage - 65.74%

    239 - 41x + 41x +
                  call(fun_compare, varname, make_c_call(selected))
    @@ -9341,7 +9661,8 @@

    teal.slice coverage - 65.74%

    243 - 53x + 53x +
          private$add_keep_na_call(filter_call, varname)
    @@ -9460,14 +9781,16 @@

    teal.slice coverage - 65.74%

    260 - 159x + 159x +
          if (is.null(choices)) {
    261 - 144x + 144x +
            choices <- levels(private$x)
    @@ -9481,49 +9804,56 @@

    teal.slice coverage - 65.74%

    263 - 15x + 15x +
            choices <- as.character(choices)
    264 - 15x + 15x +
            choices_adjusted <- choices[choices %in% levels(private$x)]
    265 - 15x + 15x +
            if (length(setdiff(choices, choices_adjusted)) > 0L) {
    266 - 2x + 2x +
              warning(
    267 - 2x + 2x +
                sprintf(
    268 - 2x + 2x +
                  "Some choices not found in data. Adjusting. Filter id: %s.",
    269 - 2x + 2x +
                  private$get_id()
    @@ -9544,7 +9874,8 @@

    teal.slice coverage - 65.74%

    272 - 2x + 2x +
              choices <- choices_adjusted
    @@ -9558,35 +9889,40 @@

    teal.slice coverage - 65.74%

    274 - 15x + 15x +
            if (length(choices) == 0) {
    275 - 1x + 1x +
              warning(
    276 - 1x + 1x +
                sprintf(
    277 - 1x + 1x +
                  "None of the choices were found in data. Setting defaults. Filter id: %s.",
    278 - 1x + 1x +
                  private$get_id()
    @@ -9607,7 +9943,8 @@

    teal.slice coverage - 65.74%

    281 - 1x + 1x +
              choices <- levels(private$x)
    @@ -9628,35 +9965,40 @@

    teal.slice coverage - 65.74%

    284 - 159x + 159x +
          private$set_is_choice_limited(private$x, choices)
    285 - 159x + 159x +
          private$teal_slice$choices <- choices
    286 - 159x + 159x +
          private$x <- private$x[(private$x %in% private$get_choices()) | is.na(private$x)]
    287 - 159x + 159x +
          private$x <- droplevels(private$x)
    288 - 159x + 159x +
          invisible(NULL)
    @@ -9691,21 +10033,24 @@

    teal.slice coverage - 65.74%

    293 - 159x + 159x +
          xl <- x[!is.na(x)]
    294 - 159x + 159x +
          private$is_choice_limited <- length(setdiff(xl, choices)) > 0L
    295 - 159x + 159x +
          invisible(NULL)
    @@ -9740,14 +10085,16 @@

    teal.slice coverage - 65.74%

    300 - 159x + 159x +
          private$choices_counts <- choices_counts
    301 - 159x + 159x +
          invisible(NULL)
    @@ -9845,7 +10192,8 @@

    teal.slice coverage - 65.74%

    315 - 23x + 23x +
          length(private$get_choices()) <= getOption("teal.threshold_slider_vs_checkboxgroup")
    @@ -9866,21 +10214,24 @@

    teal.slice coverage - 65.74%

    318 - 188x + 188x +
          tryCatch(
    319 - 188x + 188x +
            expr = {
    320 - 188x + 188x +
              values <- as.character(values)
    @@ -9901,7 +10252,8 @@

    teal.slice coverage - 65.74%

    323 - 188x + 188x +
            error = function(e) stop("The vector of set values must contain values coercible to character.")
    @@ -9915,7 +10267,8 @@

    teal.slice coverage - 65.74%

    325 - 188x + 188x +
          values
    @@ -9943,28 +10296,32 @@

    teal.slice coverage - 65.74%

    329 - 188x + 188x +
          if (!private$is_multiple() && length(values) > 1) {
    330 - 1x + 1x +
            warning(
    331 - 1x + 1x +
              sprintf("Selection: %s is not a vector of length one. ", toString(values, width = 360)),
    332 - 1x + 1x +
              "Maintaining previous selection."
    @@ -9978,7 +10335,8 @@

    teal.slice coverage - 65.74%

    334 - 1x + 1x +
            values <- shiny::isolate(private$get_selected())
    @@ -9992,7 +10350,8 @@

    teal.slice coverage - 65.74%

    336 - 188x + 188x +
          values
    @@ -10013,35 +10372,40 @@

    teal.slice coverage - 65.74%

    339 - 188x + 188x +
          in_choices_mask <- values %in% private$get_choices()
    340 - 188x + 188x +
          if (length(values[!in_choices_mask]) > 0) {
    341 - 17x + 17x +
            warning(paste(
    342 - 17x + 17x +
              "Values:", toString(values[!in_choices_mask], width = 360),
    343 - 17x + 17x +
              "are not in choices of column", private$get_varname(), "in dataset", private$get_dataname(), "."
    @@ -10062,7 +10426,8 @@

    teal.slice coverage - 65.74%

    346 - 188x + 188x +
          values[in_choices_mask]
    @@ -10146,7 +10511,8 @@

    teal.slice coverage - 65.74%

    358 - 7x + 7x +
          ns <- NS(id)
    @@ -10167,21 +10533,24 @@

    teal.slice coverage - 65.74%

    361 - 7x + 7x +
          shiny::isolate({
    362 - 7x + 7x +
            countsmax <- private$choices_counts
    363 - 7x + 7x +
            countsnow <- if (!is.null(private$x_reactive())) {
    @@ -10202,7 +10571,8 @@

    teal.slice coverage - 65.74%

    366 - 7x + 7x +
              NULL
    @@ -10223,42 +10593,48 @@

    teal.slice coverage - 65.74%

    369 - 7x + 7x +
            ui_input <- if (private$is_checkboxgroup()) {
    370 - 7x + 7x +
              labels <- countBars(
    371 - 7x + 7x +
                inputId = ns("labels"),
    372 - 7x + 7x +
                choices = private$get_choices(),
    373 - 7x + 7x +
                countsnow = countsnow,
    374 - 7x + 7x +
                countsmax = countsmax
    @@ -10272,70 +10648,80 @@

    teal.slice coverage - 65.74%

    376 - 7x + 7x +
              div(
    377 - 7x + 7x +
                class = "choices_state",
    378 - 7x + 7x +
                if (private$is_multiple()) {
    379 - 7x + 7x +
                  checkboxGroupInput(
    380 - 7x + 7x +
                    inputId = ns("selection"),
    381 - 7x + 7x +
                    label = NULL,
    382 - 7x + 7x +
                    selected = private$get_selected(),
    383 - 7x + 7x +
                    choiceNames = labels,
    384 - 7x + 7x +
                    choiceValues = private$get_choices(),
    385 - 7x + 7x +
                    width = "100%"
    @@ -10566,28 +10952,32 @@

    teal.slice coverage - 65.74%

    418 - 7x + 7x +
            div(
    419 - 7x + 7x +
              uiOutput(ns("trigger_visible")),
    420 - 7x + 7x +
              ui_input,
    421 - 7x + 7x +
              private$keep_na_ui(ns("keep_na"))
    @@ -10664,28 +11054,32 @@

    teal.slice coverage - 65.74%

    432 - 7x + 7x +
          moduleServer(
    433 - 7x + 7x +
            id = id,
    434 - 7x + 7x +
            function(input, output, session) {
    435 - 7x + 7x +
              logger::log_trace("ChoicesFilterState$server_inputs initializing, id: { private$get_id() }")
    @@ -10720,21 +11114,24 @@

    teal.slice coverage - 65.74%

    440 - 7x + 7x +
              non_missing_values <- reactive(Filter(Negate(is.na), private$x_reactive()))
    441 - 7x + 7x +
              output$trigger_visible <- renderUI({
    442 - 7x + 7x +
                logger::log_trace("ChoicesFilterState$server_inputs@1 updating count labels, id: { private$get_id() }")
    @@ -10748,7 +11145,8 @@

    teal.slice coverage - 65.74%

    444 - 7x + 7x +
                countsnow <- if (!is.null(private$x_reactive())) {
    @@ -10769,7 +11167,8 @@

    teal.slice coverage - 65.74%

    447 - 7x + 7x +
                  NULL
    @@ -10797,49 +11196,56 @@

    teal.slice coverage - 65.74%

    451 - 7x + 7x +
                shiny::isolate({
    452 - 7x + 7x +
                  if (private$is_checkboxgroup()) {
    453 - 7x + 7x +
                    updateCountBars(
    454 - 7x + 7x +
                      inputId = "labels",
    455 - 7x + 7x +
                      choices = private$get_choices(),
    456 - 7x + 7x +
                      countsmax = private$choices_counts,
    457 - 7x + 7x +
                      countsnow = countsnow
    @@ -10951,7 +11357,8 @@

    teal.slice coverage - 65.74%

    473 - 7x + 7x +
                  NULL
    @@ -10979,42 +11386,48 @@

    teal.slice coverage - 65.74%

    477 - 7x + 7x +
              if (private$is_checkboxgroup()) {
    478 - 7x + 7x +
                private$observers$selection <- observeEvent(
    479 - 7x + 7x +
                  ignoreNULL = FALSE,
    480 - 7x + 7x +
                  ignoreInit = TRUE, # ignoreInit: should not matter because we set the UI with the desired initial state
    481 - 7x + 7x +
                  eventExpr = input$selection,
    482 - 7x + 7x +
                  handlerExpr = {
    @@ -11336,7 +11749,8 @@

    teal.slice coverage - 65.74%

    528 - 7x + 7x +
              private$keep_na_srv("keep_na")
    @@ -11371,7 +11785,8 @@

    teal.slice coverage - 65.74%

    533 - 7x + 7x +
              private$observers$selection_api <- observeEvent(private$get_selected(), {
    @@ -11392,49 +11807,56 @@

    teal.slice coverage - 65.74%

    536 - 2x + 2x +
                if (!setequal(input$selection, private$get_selected())) {
    537 - 2x + 2x +
                  logger::log_trace("ChoicesFilterState$server@1 state changed, id: { private$get_id() }")
    538 - 2x + 2x +
                  if (private$is_checkboxgroup()) {
    539 - 2x + 2x +
                    if (private$is_multiple()) {
    540 - 2x + 2x +
                      updateCheckboxGroupInput(
    541 - 2x + 2x +
                        inputId = "selection",
    542 - 2x + 2x +
                        selected = private$get_selected()
    @@ -11553,14 +11975,16 @@

    teal.slice coverage - 65.74%

    559 - 7x + 7x +
              logger::log_trace("ChoicesFilterState$server_inputs initialized, id: { private$get_id() }")
    560 - 7x + 7x +
              NULL
    @@ -11798,28 +12222,32 @@

    teal.slice coverage - 65.74%

    594 - 7x + 7x +
          selected <- private$get_selected()
    595 - 7x + 7x +
          selected_length <- nchar(paste0(selected, collapse = ""))
    596 - 7x + 7x +
          if (selected_length <= 40) {
    597 - 7x + 7x +
            selected_text <- paste0(selected, collapse = ", ")
    @@ -11854,28 +12282,32 @@

    teal.slice coverage - 65.74%

    602 - 7x + 7x +
          tagList(
    603 - 7x + 7x +
            tags$span(
    604 - 7x + 7x +
              class = "filter-card-summary-value",
    605 - 7x + 7x +
              selected_text
    @@ -11889,21 +12321,24 @@

    teal.slice coverage - 65.74%

    607 - 7x + 7x +
            tags$span(
    608 - 7x + 7x +
              class = "filter-card-summary-controls",
    609 - 7x + 7x +
              if (private$na_count > 0) {
    @@ -13022,56 +13457,64 @@

    teal.slice coverage - 65.74%

    152 - 121x + 121x +
          shiny::isolate({
    153 - 121x + 121x +
            checkmate::assert_numeric(x, all.missing = FALSE)
    154 - 2x + 2x +
            if (!any(is.finite(x))) stop("\"x\" contains no finite values")
    155 - 118x + 118x +
            super$initialize(x = x, x_reactive = x_reactive, slice = slice, extract_type = extract_type)
    156 - 118x + 118x +
            private$is_integer <- checkmate::test_integerish(x)
    157 - 118x + 118x +
            private$inf_count <- sum(is.infinite(x))
    158 - 118x + 118x +
            private$inf_filtered_count <- reactive(
    159 - 118x + 118x +
              if (!is.null(private$x_reactive())) sum(is.infinite(private$x_reactive()))
    @@ -13092,14 +13535,16 @@

    teal.slice coverage - 65.74%

    162 - 118x + 118x +
            checkmate::assert_numeric(slice$choices, null.ok = TRUE)
    163 - 3x + 3x +
            if (is.null(slice$keep_inf) && any(is.infinite(x))) slice$keep_inf <- TRUE
    @@ -13113,21 +13558,24 @@

    teal.slice coverage - 65.74%

    165 - 117x + 117x +
            private$set_choices(slice$choices)
    166 - 42x + 42x +
            if (is.null(slice$selected)) slice$selected <- slice$choices
    167 - 117x + 117x +
            private$set_selected(slice$selected)
    @@ -13141,21 +13589,24 @@

    teal.slice coverage - 65.74%

    169 - 114x + 114x +
            private$is_integer <- checkmate::test_integerish(x)
    170 - 114x + 114x +
            private$inf_filtered_count <- reactive(
    171 - 114x + 114x +
              if (!is.null(private$x_reactive())) sum(is.infinite(private$x_reactive()))
    @@ -13169,7 +13620,8 @@

    teal.slice coverage - 65.74%

    173 - 114x + 114x +
            private$inf_count <- sum(is.infinite(x))
    @@ -13183,63 +13635,72 @@

    teal.slice coverage - 65.74%

    175 - 114x + 114x +
            private$plot_data <- list(
    176 - 114x + 114x +
              type = "histogram",
    177 - 114x + 114x +
              nbinsx = 50,
    178 - 114x + 114x +
              x = Filter(Negate(is.na), Filter(is.finite, private$x)),
    179 - 114x + 114x +
              color = I(fetch_bs_color("secondary")),
    180 - 114x + 114x +
              alpha = 0.2,
    181 - 114x + 114x +
              bingroup = 1,
    182 - 114x + 114x +
              showlegend = FALSE,
    183 - 114x + 114x +
              hoverinfo = "none"
    @@ -13253,21 +13714,24 @@

    teal.slice coverage - 65.74%

    185 - 114x + 114x +
            private$plot_mask <- list(list(
    186 - 114x + 114x +
              type = "rect", fillcolor = rgb(1, 1, 1, .65), line = list(width = 0),
    187 - 114x + 114x +
              x0 = -0.5, x1 = 1.5, y0 = -0.5, y1 = 1.5, xref = "paper", yref = "paper"
    @@ -13281,84 +13745,96 @@

    teal.slice coverage - 65.74%

    189 - 114x + 114x +
            private$plot_layout <- reactive({
    190 - 5x + 5x +
              shapes <- private$get_shape_properties(private$get_selected())
    191 - 5x + 5x +
              list(
    192 - 5x + 5x +
                barmode = "overlay",
    193 - 5x + 5x +
                xaxis = list(
    194 - 5x + 5x +
                  range = private$get_choices() * c(0.995, 1.005),
    195 - 5x + 5x +
                  rangeslider = list(thickness = 0),
    196 - 5x + 5x +
                  showticklabels = TRUE,
    197 - 5x + 5x +
                  ticks = "outside",
    198 - 5x + 5x +
                  ticklen = 1.5,
    199 - 5x + 5x +
                  tickmode = "auto",
    200 - 5x + 5x +
                  nticks = 10
    @@ -13372,35 +13848,40 @@

    teal.slice coverage - 65.74%

    202 - 5x + 5x +
                yaxis = list(showgrid = FALSE, showticklabels = FALSE),
    203 - 5x + 5x +
                margin = list(b = 17, l = 0, r = 0, t = 0, autoexpand = FALSE),
    204 - 5x + 5x +
                plot_bgcolor = "#FFFFFF00",
    205 - 5x + 5x +
                paper_bgcolor = "#FFFFFF00",
    206 - 5x + 5x +
                shapes = shapes
    @@ -13421,35 +13902,40 @@

    teal.slice coverage - 65.74%

    209 - 114x + 114x +
            private$plot_config <- reactive({
    210 - 5x + 5x +
              list(
    211 - 5x + 5x +
                doubleClick = "reset",
    212 - 5x + 5x +
                displayModeBar = FALSE,
    213 - 5x + 5x +
                edits = list(shapePosition = TRUE)
    @@ -13470,49 +13956,56 @@

    teal.slice coverage - 65.74%

    216 - 114x + 114x +
            private$plot_filtered <- reactive({
    217 - 5x + 5x +
              finite_values <- Filter(is.finite, private$x_reactive())
    218 - 5x + 5x +
              if (!identical(finite_values, numeric(0))) {
    219 - 5x + 5x +
                list(
    220 - 5x + 5x +
                  x = finite_values,
    221 - 5x + 5x +
                  bingroup = 1,
    222 - 5x + 5x +
                  color = I(fetch_bs_color("primary"))
    @@ -13540,7 +14033,8 @@

    teal.slice coverage - 65.74%

    226 - 114x + 114x +
            invisible(self)
    @@ -13631,14 +14125,16 @@

    teal.slice coverage - 65.74%

    239 - 35x + 35x +
          if (isFALSE(private$is_any_filtered())) {
    240 - 1x + 1x +
            return(NULL)
    @@ -13652,28 +14148,32 @@

    teal.slice coverage - 65.74%

    242 - 4x + 4x +
          if (missing(dataname)) dataname <- private$get_dataname()
    243 - 34x + 34x +
          varname <- private$get_varname_prefixed(dataname)
    244 - 34x + 34x +
          filter_call <-
    245 - 34x + 34x +
            call(
    @@ -13687,14 +14187,16 @@

    teal.slice coverage - 65.74%

    247 - 34x + 34x +
              call(">=", varname, private$get_selected()[1L]),
    248 - 34x + 34x +
              call("<=", varname, private$get_selected()[2L])
    @@ -13708,7 +14210,8 @@

    teal.slice coverage - 65.74%

    250 - 34x + 34x +
          private$add_keep_na_call(private$add_keep_inf_call(filter_call, varname), varname)
    @@ -13890,21 +14393,24 @@

    teal.slice coverage - 65.74%

    276 - 117x + 117x +
          x <- private$x[is.finite(private$x)]
    277 - 117x + 117x +
          if (is.null(choices)) {
    278 - 105x + 105x +
            choices <- range(x)
    @@ -13918,35 +14424,40 @@

    teal.slice coverage - 65.74%

    280 - 12x + 12x +
            choices_adjusted <- c(max(choices[1L], min(x)), min(choices[2L], max(x)))
    281 - 12x + 12x +
            if (any(choices != choices_adjusted)) {
    282 - 1x + 1x +
              warning(sprintf(
    283 - 1x + 1x +
                "Choices adjusted (some values outside of variable range). Varname: %s, dataname: %s.",
    284 - 1x + 1x +
                private$get_varname(), private$get_dataname()
    @@ -13960,7 +14471,8 @@

    teal.slice coverage - 65.74%

    286 - 1x + 1x +
              choices <- choices_adjusted
    @@ -13974,35 +14486,40 @@

    teal.slice coverage - 65.74%

    288 - 12x + 12x +
            if (choices[1L] > choices[2L]) {
    289 - 1x + 1x +
              warning(sprintf(
    290 - 1x + 1x +
                "Invalid choices: lower is higher / equal to upper, or not in range of variable values.
    291 - 1x + 1x +
                Setting defaults. Varname: %s, dataname: %s.",
    292 - 1x + 1x +
                private$get_varname(), private$get_dataname()
    @@ -14016,7 +14533,8 @@

    teal.slice coverage - 65.74%

    294 - 1x + 1x +
              choices <- range(x)
    @@ -14044,21 +14562,24 @@

    teal.slice coverage - 65.74%

    298 - 117x + 117x +
          private$set_is_choice_limited(private$x, choices)
    299 - 117x + 117x +
          private$x <- private$x[
    300 - 117x + 117x +
            (private$x >= choices[1L] & private$x <= choices[2L]) | is.na(private$x) | !is.finite(private$x)
    @@ -14079,7 +14600,8 @@

    teal.slice coverage - 65.74%

    303 - 117x + 117x +
          x_range <- range(private$x, finite = TRUE)
    @@ -14100,14 +14622,16 @@

    teal.slice coverage - 65.74%

    306 - 117x + 117x +
          if (identical(diff(x_range), 0)) {
    307 - 2x + 2x +
            choices <- x_range
    @@ -14121,21 +14645,24 @@

    teal.slice coverage - 65.74%

    309 - 115x + 115x +
            x_pretty <- pretty(x_range, 100L)
    310 - 115x + 115x +
            choices <- range(x_pretty)
    311 - 115x + 115x +
            private$numeric_step <- signif(private$get_pretty_range_step(x_pretty), digits = 10)
    @@ -14149,14 +14676,16 @@

    teal.slice coverage - 65.74%

    313 - 117x + 117x +
          private$teal_slice$choices <- choices
    314 - 117x + 117x +
          invisible(NULL)
    @@ -14198,28 +14727,32 @@

    teal.slice coverage - 65.74%

    320 - 117x + 117x +
          xl <- xl[!is.na(xl)]
    321 - 117x + 117x +
          xl <- xl[is.finite(xl)]
    322 - 117x + 117x +
          private$is_choice_limited <- (any(xl < choices[1L]) | any(xl > choices[2L]))
    323 - 117x + 117x +
          invisible(NULL)
    @@ -14261,14 +14794,16 @@

    teal.slice coverage - 65.74%

    329 - 34x + 34x +
          if (isTRUE(private$get_keep_inf())) {
    330 - 2x + 2x +
            call("|", call("is.infinite", varname), filter_call)
    @@ -14282,7 +14817,8 @@

    teal.slice coverage - 65.74%

    332 - 32x + 32x +
            filter_call
    @@ -14345,14 +14881,16 @@

    teal.slice coverage - 65.74%

    341 - 117x + 117x +
          if (private$is_integer && diff(range(pretty_range) > 2)) {
    342 - 46x + 46x +
            return(1L)
    @@ -14366,21 +14904,24 @@

    teal.slice coverage - 65.74%

    344 - 71x + 71x +
            n_steps <- length(pretty_range) - 1
    345 - 71x + 71x +
            return(
    346 - 71x + 71x +
              signif(digits = 10, (max(pretty_range) - min(pretty_range)) / n_steps)
    @@ -14415,35 +14956,40 @@

    teal.slice coverage - 65.74%

    351 - 133x + 133x +
          tryCatch(
    352 - 133x + 133x +
            expr = {
    353 - 133x + 133x +
              values <- as.numeric(values)
    354 - 4x + 4x +
              if (anyNA(values)) stop()
    355 - 129x + 129x +
              values
    @@ -14457,7 +15003,8 @@

    teal.slice coverage - 65.74%

    357 - 133x + 133x +
            error = function(e) stop("Vector of set values must contain values coercible to numeric")
    @@ -14492,21 +15039,24 @@

    teal.slice coverage - 65.74%

    362 - 2x + 2x +
          if (length(values) != 2L) stop("Vector of set values must have length two.")
    363 - 2x + 2x +
          if (values[1L] > values[2L]) stop("Vector of set values must be sorted.")
    364 - 125x + 125x +
          values
    @@ -14534,21 +15084,24 @@

    teal.slice coverage - 65.74%

    368 - 2x + 2x +
          if (values[1L] < private$get_choices()[1L]) values[1L] <- private$get_choices()[1L]
    369 - 2x + 2x +
          if (values[2L] > private$get_choices()[2L]) values[2L] <- private$get_choices()[2L]
    370 - 125x + 125x +
          values
    @@ -14590,35 +15143,40 @@

    teal.slice coverage - 65.74%

    376 - 35x + 35x +
          if (private$is_choice_limited) {
    377 - 1x + 1x +
            TRUE
    378 - 34x + 34x +
          } else if (!isTRUE(all.equal(private$get_selected(), private$get_choices()))) {
    379 - 32x + 32x +
            TRUE
    380 - 2x + 2x +
          } else if (!isTRUE(private$get_keep_inf()) && private$inf_count > 0) {
    @@ -14632,14 +15190,16 @@

    teal.slice coverage - 65.74%

    382 - 2x + 2x +
          } else if (!isTRUE(private$get_keep_na()) && private$na_count > 0) {
    383 - 1x + 1x +
            TRUE
    @@ -14653,7 +15213,8 @@

    teal.slice coverage - 65.74%

    385 - 1x + 1x +
            FALSE
    @@ -14702,21 +15263,24 @@

    teal.slice coverage - 65.74%

    392 - 5x + 5x +
          list(
    393 - 5x + 5x +
            list(type = "line", x0 = values[1], x1 = values[1], y0 = -100, y1 = 100, yref = "paper"),
    394 - 5x + 5x +
            list(type = "line", x0 = values[2], x1 = values[2], y0 = -100, y1 = 100, yref = "paper")
    @@ -14800,70 +15364,80 @@

    teal.slice coverage - 65.74%

    406 - 5x + 5x +
          ns <- NS(id)
    407 - 5x + 5x +
          shiny::isolate({
    408 - 5x + 5x +
            ui_input <- shinyWidgets::numericRangeInput(
    409 - 5x + 5x +
              inputId = ns("selection_manual"),
    410 - 5x + 5x +
              label = NULL,
    411 - 5x + 5x +
              min = private$get_choices()[1L],
    412 - 5x + 5x +
              max = private$get_choices()[2L],
    413 - 5x + 5x +
              value = private$get_selected(),
    414 - 5x + 5x +
              step = private$numeric_step,
    415 - 5x + 5x +
              width = "100%"
    @@ -14877,28 +15451,32 @@

    teal.slice coverage - 65.74%

    417 - 5x + 5x +
            tagList(
    418 - 5x + 5x +
              div(
    419 - 5x + 5x +
                class = "choices_state",
    420 - 5x + 5x +
                tags$head(tags$script(
    @@ -14926,21 +15504,24 @@

    teal.slice coverage - 65.74%

    424 - 5x + 5x +
                  HTML(
    425 - 5x + 5x +
                    '$(document).ready(function() {
    426 - 5x + 5x +
                      $("[data-toggle=\'popover\']").popover();
    @@ -14954,35 +15535,40 @@

    teal.slice coverage - 65.74%

    428 - 5x + 5x +
                      $(document).on("click", function (e) {
    429 - 5x + 5x +
                        if (!$("[data-toggle=\'popover\']").is(e.target) &&
    430 - 5x + 5x +
                            $("[data-toggle=\'popover\']").has(e.target).length === 0 &&
    431 - 5x + 5x +
                            $(".popover").has(e.target).length === 0) {
    432 - 5x + 5x +
                          $("[data-toggle=\'popover\']").popover("hide");
    @@ -15024,105 +15610,120 @@

    teal.slice coverage - 65.74%

    438 - 5x + 5x +
                div(
    439 - 5x + 5x +
                  actionLink(
    440 - 5x + 5x +
                    ns("plotly_info"),
    441 - 5x + 5x +
                    label = NULL,
    442 - 5x + 5x +
                    icon = icon("question-circle"),
    443 - 5x + 5x +
                    "data-toggle" = "popover",
    444 - 5x + 5x +
                    "data-html" = "true",
    445 - 5x + 5x +
                    "data-placement" = "left",
    446 - 5x + 5x +
                    "data-trigger" = "click",
    447 - 5x + 5x +
                    "data-title" = "Plot actions",
    448 - 5x + 5x +
                    "data-content" = "<p>
    449 - 5x + 5x +
                                      Drag vertical lines to set selection.<br>
    450 - 5x + 5x +
                                      Drag across plot to zoom in.<br>
    451 - 5x + 5x +
                                      Drag axis to pan.<br>
    452 - 5x + 5x +
                                      Double click to zoom out."
    @@ -15136,7 +15737,8 @@

    teal.slice coverage - 65.74%

    454 - 5x + 5x +
                  style = "text-align: right; font-size: 0.7em; margin-bottom: -1em; position: relative; z-index: 9;"
    @@ -15150,35 +15752,40 @@

    teal.slice coverage - 65.74%

    456 - 5x + 5x +
                shinycssloaders::withSpinner(
    457 - 5x + 5x +
                  plotly::plotlyOutput(ns("plot"), height = "50px"),
    458 - 5x + 5x +
                  type = 4,
    459 - 5x + 5x +
                  size = 0.25,
    460 - 5x + 5x +
                  hide.ui = FALSE
    @@ -15192,7 +15799,8 @@

    teal.slice coverage - 65.74%

    462 - 5x + 5x +
                ui_input
    @@ -15206,28 +15814,32 @@

    teal.slice coverage - 65.74%

    464 - 5x + 5x +
              div(
    465 - 5x + 5x +
                class = "filter-card-body-keep-na-inf",
    466 - 5x + 5x +
                private$keep_inf_ui(ns("keep_inf")),
    467 - 5x + 5x +
                private$keep_na_ui(ns("keep_na"))
    @@ -15311,28 +15923,32 @@

    teal.slice coverage - 65.74%

    479 - 5x + 5x +
          moduleServer(
    480 - 5x + 5x +
            id = id,
    481 - 5x + 5x +
            function(input, output, session) {
    482 - 5x + 5x +
              logger::log_trace("RangeFilterState$server initializing, id: { private$get_id() }")
    @@ -15353,7 +15969,8 @@

    teal.slice coverage - 65.74%

    485 - 5x + 5x +
              selection_manual <- debounce(reactive(input$selection_manual), 200)
    @@ -15374,7 +15991,8 @@

    teal.slice coverage - 65.74%

    488 - 5x + 5x +
              plot_data <- c(private$plot_data, source = session$ns("histogram_plot"))
    @@ -15395,42 +16013,48 @@

    teal.slice coverage - 65.74%

    491 - 5x + 5x +
              output$plot <- plotly::renderPlotly({
    492 - 5x + 5x +
                histogram <- do.call(plotly::plot_ly, plot_data)
    493 - 5x + 5x +
                histogram <- do.call(plotly::layout, c(list(p = histogram), private$plot_layout()))
    494 - 5x + 5x +
                histogram <- do.call(plotly::config, c(list(p = histogram), private$plot_config()))
    495 - 5x + 5x +
                histogram <- do.call(plotly::add_histogram, c(list(p = histogram), private$plot_filtered()))
    496 - 5x + 5x +
                histogram
    @@ -15458,63 +16082,72 @@

    teal.slice coverage - 65.74%

    500 - 5x + 5x +
              private$observers$relayout <-
    501 - 5x + 5x +
                observeEvent(
    502 - 5x + 5x +
                  ignoreNULL = FALSE,
    503 - 5x + 5x +
                  ignoreInit = TRUE,
    504 - 5x + 5x +
                  eventExpr = plotly::event_data("plotly_relayout", source = session$ns("histogram_plot")),
    505 - 5x + 5x +
                  handlerExpr = {
    506 - 1x + 1x +
                    logger::log_trace("RangeFilterState$server@1 selection changed, id: { private$get_id() }")
    507 - 1x + 1x +
                    event <- plotly::event_data("plotly_relayout", source = session$ns("histogram_plot"))
    508 - 1x + 1x +
                    if (any(grepl("shapes", names(event)))) {
    @@ -15703,42 +16336,48 @@

    teal.slice coverage - 65.74%

    535 - 5x + 5x +
              private$observers$selection_api <-
    536 - 5x + 5x +
                observeEvent(
    537 - 5x + 5x +
                  ignoreNULL = FALSE,
    538 - 5x + 5x +
                  ignoreInit = TRUE,
    539 - 5x + 5x +
                  eventExpr = private$get_selected(),
    540 - 5x + 5x +
                  handlerExpr = {
    @@ -15829,35 +16468,40 @@

    teal.slice coverage - 65.74%

    553 - 5x + 5x +
              private$observers$selection_manual <- observeEvent(
    554 - 5x + 5x +
                ignoreNULL = FALSE,
    555 - 5x + 5x +
                ignoreInit = TRUE,
    556 - 5x + 5x +
                eventExpr = selection_manual(),
    557 - 5x + 5x +
                handlerExpr = {
    @@ -16123,14 +16767,16 @@

    teal.slice coverage - 65.74%

    595 - 5x + 5x +
              private$keep_inf_srv("keep_inf")
    596 - 5x + 5x +
              private$keep_na_srv("keep_na")
    @@ -16144,14 +16790,16 @@

    teal.slice coverage - 65.74%

    598 - 5x + 5x +
              logger::log_trace("RangeFilterState$server initialized, id: { private$get_id() }")
    599 - 5x + 5x +
              NULL
    @@ -16438,42 +17086,48 @@

    teal.slice coverage - 65.74%

    640 - 5x + 5x +
          selection <- private$get_selected()
    641 - 5x + 5x +
          tagList(
    642 - 5x + 5x +
            tags$span(shiny::HTML(selection[1], "&ndash;", selection[2]), class = "filter-card-summary-value"),
    643 - 5x + 5x +
            tags$span(
    644 - 5x + 5x +
              class = "filter-card-summary-controls",
    645 - 5x + 5x +
              if (private$na_count > 0) {
    @@ -16494,7 +17148,8 @@

    teal.slice coverage - 65.74%

    648 - 5x + 5x +
              if (private$inf_count > 0) {
    @@ -16585,7 +17240,8 @@

    teal.slice coverage - 65.74%

    661 - 5x + 5x +
          ns <- NS(id)
    @@ -16599,7 +17255,8 @@

    teal.slice coverage - 65.74%

    663 - 5x + 5x +
          if (private$inf_count > 0) {
    @@ -16739,7 +17396,8 @@

    teal.slice coverage - 65.74%

    683 - 5x + 5x +
            NULL
    @@ -16816,7 +17474,8 @@

    teal.slice coverage - 65.74%

    694 - 5x + 5x +
          moduleServer(id, function(input, output, session) {
    @@ -16844,42 +17503,48 @@

    teal.slice coverage - 65.74%

    698 - 5x + 5x +
            output$trigger_visible <- renderUI({
    699 - 5x + 5x +
              updateCountText(
    700 - 5x + 5x +
                inputId = "count_label",
    701 - 5x + 5x +
                label = "Keep Inf",
    702 - 5x + 5x +
                countmax = private$inf_count,
    703 - 5x + 5x +
                countnow = private$inf_filtered_count()
    @@ -16893,7 +17558,8 @@

    teal.slice coverage - 65.74%

    705 - 5x + 5x +
              NULL
    @@ -16935,35 +17601,40 @@

    teal.slice coverage - 65.74%

    711 - 5x + 5x +
            private$observers$keep_inf_api <- observeEvent(
    712 - 5x + 5x +
              ignoreNULL = TRUE, # its not possible for range that NULL is selected
    713 - 5x + 5x +
              ignoreInit = TRUE, # ignoreInit: should not matter because we set the UI with the desired initial state
    714 - 5x + 5x +
              eventExpr = private$get_keep_inf(),
    715 - 5x + 5x +
              handlerExpr = {
    @@ -17040,35 +17711,40 @@

    teal.slice coverage - 65.74%

    726 - 5x + 5x +
            private$observers$keep_inf <- observeEvent(
    727 - 5x + 5x +
              ignoreNULL = TRUE, # it's not possible for range that NULL is selected
    728 - 5x + 5x +
              ignoreInit = TRUE, # ignoreInit: should not matter because we set the UI with the desired initial state
    729 - 5x + 5x +
              eventExpr = input$value,
    730 - 5x + 5x +
              handlerExpr = {
    @@ -17117,7 +17793,8 @@

    teal.slice coverage - 65.74%

    737 - 5x + 5x +
            invisible(NULL)
    @@ -17508,28 +18185,32 @@

    teal.slice coverage - 65.74%

    51 - 274x + 274x +
          checkmate::assert_string(dataname)
    52 - 272x + 272x +
          logger::log_trace("Instantiating { class(self)[1] }, dataname: { dataname }")
    53 - 272x + 272x +
          checkmate::assert_function(data_reactive, args = "sid")
    54 - 272x + 272x +
          checkmate::assert_string(datalabel, null.ok = TRUE)
    @@ -17543,42 +18224,48 @@

    teal.slice coverage - 65.74%

    56 - 272x + 272x +
          private$dataname <- dataname
    57 - 272x + 272x +
          private$datalabel <- datalabel
    58 - 272x + 272x +
          private$dataname_prefixed <- dataname
    59 - 272x + 272x +
          private$data <- data
    60 - 272x + 272x +
          private$data_reactive <- data_reactive
    61 - 272x + 272x +
          private$state_list <- reactiveVal()
    @@ -17592,14 +18279,16 @@

    teal.slice coverage - 65.74%

    63 - 272x + 272x +
          logger::log_trace("Instantiated { class(self)[1] }, dataname: { private$dataname }")
    64 - 272x + 272x +
          invisible(self)
    @@ -18026,7 +18715,8 @@

    teal.slice coverage - 65.74%

    125 - 88x + 88x +
          logger::log_trace("FilterStates$get_call initializing")
    @@ -18061,21 +18751,24 @@

    teal.slice coverage - 65.74%

    130 - 88x + 88x +
          states_list <- private$state_list_get()
    131 - 88x + 88x +
          if (length(states_list) == 0) {
    132 - 52x + 52x +
            return(NULL)
    @@ -18089,35 +18782,40 @@

    teal.slice coverage - 65.74%

    134 - 36x + 36x +
          args <- vapply(
    135 - 36x + 36x +
            states_list,
    136 - 36x + 36x +
            function(x) {
    137 - 57x + 57x +
              arg <- x$get_state()$arg
    138 - 7x + 7x +
              `if`(is.null(arg), "", arg) # converting NULL -> "" to enable tapply.
    @@ -18131,7 +18829,8 @@

    teal.slice coverage - 65.74%

    140 - 36x + 36x +
            character(1)
    @@ -18152,35 +18851,40 @@

    teal.slice coverage - 65.74%

    143 - 36x + 36x +
          filter_items <- tapply(
    144 - 36x + 36x +
            X = states_list,
    145 - 36x + 36x +
            INDEX = args,
    146 - 36x + 36x +
            simplify = FALSE,
    147 - 36x + 36x +
            function(items) {
    @@ -18194,14 +18898,16 @@

    teal.slice coverage - 65.74%

    149 - 38x + 38x +
              other_filter_idx <- !names(items) %in% sid
    150 - 38x + 38x +
              filtered_items <- items[other_filter_idx]
    @@ -18215,42 +18921,48 @@

    teal.slice coverage - 65.74%

    152 - 38x + 38x +
              calls <- Filter(
    153 - 38x + 38x +
                Negate(is.null),
    154 - 38x + 38x +
                lapply(
    155 - 38x + 38x +
                  filtered_items,
    156 - 38x + 38x +
                  function(state) {
    157 - 51x + 51x +
                    state$get_call(dataname = private$dataname_prefixed)
    @@ -18278,7 +18990,8 @@

    teal.slice coverage - 65.74%

    161 - 38x + 38x +
              calls_combine_by(calls, operator = "&")
    @@ -18299,21 +19012,24 @@

    teal.slice coverage - 65.74%

    164 - 36x + 36x +
          filter_items <- Filter(
    165 - 36x + 36x +
            x = filter_items,
    166 - 36x + 36x +
            f = Negate(is.null)
    @@ -18327,49 +19043,56 @@

    teal.slice coverage - 65.74%

    168 - 36x + 36x +
          if (length(filter_items) > 0L) {
    169 - 35x + 35x +
            filter_function <- private$fun
    170 - 35x + 35x +
            data_name <- str2lang(private$dataname_prefixed)
    171 - 35x + 35x +
            substitute(
    172 - 35x + 35x +
              env = list(
    173 - 35x + 35x +
                lhs = data_name,
    174 - 35x + 35x +
                rhs = as.call(c(filter_function, c(list(data_name), filter_items)))
    @@ -18383,7 +19106,8 @@

    teal.slice coverage - 65.74%

    176 - 35x + 35x +
              expr = lhs <- rhs
    @@ -18411,7 +19135,8 @@

    teal.slice coverage - 65.74%

    180 - 1x + 1x +
            NULL
    @@ -18565,35 +19290,40 @@

    teal.slice coverage - 65.74%

    202 - 17x + 17x +
          checkmate::assert_class(state, "teal_slices")
    203 - 17x + 17x +
          shiny::isolate({
    204 - 17x + 17x +
            state_ids <- vapply(state, `[[`, character(1), "id")
    205 - 17x + 17x +
            logger::log_trace("{ class(self)[1] }$remove_filter_state removing filters, state_id: { toString(state_ids) }")
    206 - 17x + 17x +
            private$state_list_remove(state_ids)
    @@ -18607,7 +19337,8 @@

    teal.slice coverage - 65.74%

    208 - 17x + 17x +
          invisible(NULL)
    @@ -18691,14 +19422,16 @@

    teal.slice coverage - 65.74%

    220 - 364x + 364x +
          slices <- unname(lapply(private$state_list(), function(x) x$get_state()))
    221 - 364x + 364x +
          fs <- do.call(teal_slices, c(slices, list(count_type = private$count_type)))
    @@ -18712,35 +19445,40 @@

    teal.slice coverage - 65.74%

    223 - 364x + 364x +
          include_varnames <- private$include_varnames
    224 - 364x + 364x +
          if (length(include_varnames)) {
    225 - 214x + 214x +
            attr(fs, "include_varnames") <- structure(
    226 - 214x + 214x +
              list(include_varnames),
    227 - 214x + 214x +
              names = private$dataname
    @@ -18768,35 +19506,40 @@

    teal.slice coverage - 65.74%

    231 - 364x + 364x +
          exclude_varnames <- private$exclude_varnames
    232 - 364x + 364x +
          if (length(exclude_varnames)) {
    233 - 9x + 9x +
            attr(fs, "exclude_varnames") <- structure(
    234 - 9x + 9x +
              list(exclude_varnames),
    235 - 9x + 9x +
              names = private$dataname
    @@ -18824,7 +19567,8 @@

    teal.slice coverage - 65.74%

    239 - 364x + 364x +
          return(fs)
    @@ -18901,49 +19645,56 @@

    teal.slice coverage - 65.74%

    250 - 135x + 135x +
          shiny::isolate({
    251 - 135x + 135x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initializing, dataname: { private$dataname }")
    252 - 135x + 135x +
            checkmate::assert_class(state, "teal_slices")
    253 - 135x + 135x +
            lapply(state, function(x) {
    254 - 177x + 177x +
              checkmate::assert_true(
    255 - 177x + 177x +
                x$dataname == private$dataname,
    256 - 177x + 177x +
                .var.name = "dataname matches private$dataname"
    @@ -18971,21 +19722,24 @@

    teal.slice coverage - 65.74%

    260 - 135x + 135x +
            private$set_filterable_varnames(
    261 - 135x + 135x +
              include_varnames = attr(state, "include_varnames")[[private$dataname]],
    262 - 135x + 135x +
              exclude_varnames = attr(state, "exclude_varnames")[[private$dataname]]
    @@ -18999,21 +19753,24 @@

    teal.slice coverage - 65.74%

    264 - 135x + 135x +
            count_type <- attr(state, "count_type")
    265 - 135x + 135x +
            if (length(count_type)) {
    266 - 21x + 21x +
              private$count_type <- count_type
    @@ -19041,35 +19798,40 @@

    teal.slice coverage - 65.74%

    270 - 135x + 135x +
            varnames <- unique(unlist(lapply(state, "[[", "varname")))
    271 - 135x + 135x +
            excluded_varnames <- setdiff(varnames, private$get_filterable_varnames())
    272 - 135x + 135x +
            if (length(excluded_varnames)) {
    273 - 3x + 3x +
              state <- Filter(function(x) !isTRUE(x$varname %in% excluded_varnames), state)
    274 - 3x + 3x +
              logger::log_warn("filters for columns: { toString(excluded_varnames) } excluded from { private$dataname }")
    @@ -19090,35 +19852,40 @@

    teal.slice coverage - 65.74%

    277 - 135x + 135x +
            if (length(state) > 0) {
    278 - 93x + 93x +
              private$set_filter_state_impl(
    279 - 93x + 93x +
                state = state,
    280 - 93x + 93x +
                data = private$data,
    281 - 93x + 93x +
                data_reactive = private$data_reactive
    @@ -19139,7 +19906,8 @@

    teal.slice coverage - 65.74%

    284 - 135x + 135x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initialized, dataname: { private$dataname }")
    @@ -19160,7 +19928,8 @@

    teal.slice coverage - 65.74%

    287 - 135x + 135x +
          invisible(NULL)
    @@ -19244,14 +20013,16 @@

    teal.slice coverage - 65.74%

    299 - 25x + 25x +
          private$state_list_empty(force)
    300 - 25x + 25x +
          invisible(NULL)
    @@ -19517,49 +20288,56 @@

    teal.slice coverage - 65.74%

    338 - 12x + 12x +
          moduleServer(
    339 - 12x + 12x +
            id = id,
    340 - 12x + 12x +
            function(input, output, session) {
    341 - 12x + 12x +
              logger::log_trace("FilterState$srv_active initializing, dataname: { private$dataname }")
    342 - 12x + 12x +
              current_state <- reactive(private$state_list_get())
    343 - 12x + 12x +
              previous_state <- reactiveVal(NULL) # FilterState list
    344 - 12x + 12x +
              added_states <- reactiveVal(NULL) # FilterState list
    @@ -19580,21 +20358,24 @@

    teal.slice coverage - 65.74%

    347 - 12x + 12x +
              fs_to_shiny_ns <- function(x) {
    348 - 24x + 24x +
                checkmate::assert_multi_class(x, c("FilterState", "FilterStateExpr"))
    349 - 24x + 24x +
                gsub("[^[:alnum:]]+", "_", get_default_slice_id(x$get_state()))
    @@ -19615,28 +20396,32 @@

    teal.slice coverage - 65.74%

    352 - 12x + 12x +
              output$trigger_visible_state_change <- renderUI({
    353 - 14x + 14x +
                current_state()
    354 - 14x + 14x +
                isolate({
    355 - 14x + 14x +
                  logger::log_trace("FilterStates$srv_active@1 determining added and removed filter states")
    @@ -19650,21 +20435,24 @@

    teal.slice coverage - 65.74%

    357 - 14x + 14x +
                  added_states(setdiff_teal_slices(current_state(), previous_state()))
    358 - 14x + 14x +
                  previous_state(current_state())
    359 - 14x + 14x +
                  NULL
    @@ -19692,42 +20480,48 @@

    teal.slice coverage - 65.74%

    363 - 12x + 12x +
              output[["cards"]] <- shiny::renderUI({
    364 - 14x + 14x +
                lapply(
    365 - 14x + 14x +
                  current_state(), # observes only if added/removed
    366 - 14x + 14x +
                  function(state) {
    367 - 12x + 12x +
                    shiny::isolate( # isolates when existing state changes
    368 - 12x + 12x +
                      state$ui(id = session$ns(fs_to_shiny_ns(state)), parent_id = session$ns("cards"))
    @@ -19769,21 +20563,24 @@

    teal.slice coverage - 65.74%

    374 - 12x + 12x +
              observeEvent(
    375 - 12x + 12x +
                added_states(), # we want to call FilterState module only once when it's added
    376 - 12x + 12x +
                ignoreNULL = TRUE,
    @@ -19797,63 +20594,72 @@

    teal.slice coverage - 65.74%

    378 - 10x + 10x +
                  added_state_names <- vapply(added_states(), function(x) x$get_state()$id, character(1L))
    379 - 10x + 10x +
                  logger::log_trace("FilterStates$srv_active@2 triggered by added states: { toString(added_state_names) }")
    380 - 10x + 10x +
                  lapply(added_states(), function(state) {
    381 - 12x + 12x +
                    fs_callback <- state$server(id = fs_to_shiny_ns(state))
    382 - 12x + 12x +
                    observeEvent(
    383 - 12x + 12x +
                      once = TRUE, # remove button can be called once, should be destroyed afterwards
    384 - 12x + 12x +
                      ignoreInit = TRUE, # ignoreInit: should not matter because we destroy the previous input set of the UI
    385 - 12x + 12x +
                      eventExpr = fs_callback(), # when remove button is clicked in the FilterState ui
    386 - 12x + 12x +
                      handlerExpr = private$state_list_remove(state$get_state()$id)
    @@ -19874,7 +20680,8 @@

    teal.slice coverage - 65.74%

    389 - 10x + 10x +
                  added_states(NULL)
    @@ -19902,7 +20709,8 @@

    teal.slice coverage - 65.74%

    393 - 12x + 12x +
              NULL
    @@ -20000,14 +20808,16 @@

    teal.slice coverage - 65.74%

    407 - 1x + 1x +
          checkmate::assert_string(id)
    408 - 1x + 1x +
          data <- private$data
    @@ -20021,7 +20831,8 @@

    teal.slice coverage - 65.74%

    410 - 1x + 1x +
          ns <- NS(id)
    @@ -20035,14 +20846,16 @@

    teal.slice coverage - 65.74%

    412 - 1x + 1x +
          if (ncol(data) == 0) {
    413 - 1x + 1x +
            div("no sample variables available")
    @@ -20182,28 +20995,32 @@

    teal.slice coverage - 65.74%

    433 - 8x + 8x +
          moduleServer(
    434 - 8x + 8x +
            id = id,
    435 - 8x + 8x +
            function(input, output, session) {
    436 - 8x + 8x +
              logger::log_trace("FilterStates$srv_add initializing, dataname: { private$dataname }")
    @@ -20224,42 +21041,48 @@

    teal.slice coverage - 65.74%

    439 - 8x + 8x +
              avail_column_choices <- reactive({
    440 - 9x + 9x +
                data <- private$data
    441 - 9x + 9x +
                vars_include <- private$get_filterable_varnames()
    442 - 9x + 9x +
                active_filter_vars <- unique(unlist(lapply(self$get_filter_state(), "[[", "varname")))
    443 - 9x + 9x +
                choices <- setdiff(vars_include, active_filter_vars)
    444 - 9x + 9x +
                varlabels <- get_varlabels(data)
    @@ -20273,35 +21096,40 @@

    teal.slice coverage - 65.74%

    446 - 9x + 9x +
                data_choices_labeled(
    447 - 9x + 9x +
                  data = data,
    448 - 9x + 9x +
                  choices = choices,
    449 - 9x + 9x +
                  varlabels = varlabels,
    450 - 9x + 9x +
                  keys = private$keys
    @@ -20336,21 +21164,24 @@

    teal.slice coverage - 65.74%

    455 - 8x + 8x +
              output$add_filter <- renderUI({
    456 - 6x + 6x +
                logger::log_trace(
    457 - 6x + 6x +
                  "FilterStates$srv_add@1 updating available column choices, dataname: { private$dataname }"
    @@ -20364,7 +21195,8 @@

    teal.slice coverage - 65.74%

    459 - 6x + 6x +
                if (length(avail_column_choices()) == 0) {
    @@ -20385,56 +21217,64 @@

    teal.slice coverage - 65.74%

    462 - 6x + 6x +
                  div(
    463 - 6x + 6x +
                    teal.widgets::optionalSelectInput(
    464 - 6x + 6x +
                      session$ns("var_to_add"),
    465 - 6x + 6x +
                      choices = avail_column_choices(),
    466 - 6x + 6x +
                      selected = NULL,
    467 - 6x + 6x +
                      options = shinyWidgets::pickerOptions(
    468 - 6x + 6x +
                        liveSearch = TRUE,
    469 - 6x + 6x +
                        noneSelectedText = "Select variable to filter"
    @@ -20483,56 +21323,64 @@

    teal.slice coverage - 65.74%

    476 - 8x + 8x +
              observeEvent(
    477 - 8x + 8x +
                eventExpr = input$var_to_add,
    478 - 8x + 8x +
                handlerExpr = {
    479 - 3x + 3x +
                  logger::log_trace(
    480 - 3x + 3x +
                    sprintf(
    481 - 3x + 3x +
                      "FilterStates$srv_add@2 adding FilterState of variable %s, dataname: %s",
    482 - 3x + 3x +
                      input$var_to_add,
    483 - 3x + 3x +
                      private$dataname
    @@ -20553,21 +21401,24 @@

    teal.slice coverage - 65.74%

    486 - 3x + 3x +
                  self$set_filter_state(
    487 - 3x + 3x +
                    teal_slices(
    488 - 3x + 3x +
                      teal_slice(dataname = private$dataname, varname = input$var_to_add)
    @@ -20588,35 +21439,40 @@

    teal.slice coverage - 65.74%

    491 - 3x + 3x +
                  logger::log_trace(
    492 - 3x + 3x +
                    sprintf(
    493 - 3x + 3x +
                      "FilterStates$srv_add@2 added FilterState of variable %s, dataname: %s",
    494 - 3x + 3x +
                      input$var_to_add,
    495 - 3x + 3x +
                      private$dataname
    @@ -20658,14 +21514,16 @@

    teal.slice coverage - 65.74%

    501 - 8x + 8x +
              logger::log_trace("FilterStates$srv_add initialized, dataname: { private$dataname }")
    502 - 8x + 8x +
              NULL
    @@ -20924,14 +21782,16 @@

    teal.slice coverage - 65.74%

    539 - 288x + 288x +
          if ((length(include_varnames) + length(exclude_varnames)) == 0L) {
    540 - 113x + 113x +
            return(invisible(NULL))
    @@ -20945,21 +21805,24 @@

    teal.slice coverage - 65.74%

    542 - 175x + 175x +
          checkmate::assert_character(include_varnames, any.missing = FALSE, min.len = 0L, null.ok = TRUE)
    543 - 175x + 175x +
          checkmate::assert_character(exclude_varnames, any.missing = FALSE, min.len = 0L, null.ok = TRUE)
    544 - 175x + 175x +
          if (length(include_varnames) && length(exclude_varnames)) {
    @@ -21008,28 +21871,32 @@

    teal.slice coverage - 65.74%

    551 - 175x + 175x +
          supported_vars <- get_supported_filter_varnames(private$data)
    552 - 175x + 175x +
          if (length(include_varnames)) {
    553 - 161x + 161x +
            private$include_varnames <- intersect(include_varnames, supported_vars)
    554 - 161x + 161x +
            private$exclude_varnames <- character(0)
    @@ -21043,14 +21910,16 @@

    teal.slice coverage - 65.74%

    556 - 14x + 14x +
            private$exclude_varnames <- exclude_varnames
    557 - 14x + 14x +
            private$include_varnames <- character(0)
    @@ -21064,7 +21933,8 @@

    teal.slice coverage - 65.74%

    559 - 175x + 175x +
          invisible(NULL)
    @@ -21141,14 +22011,16 @@

    teal.slice coverage - 65.74%

    570 - 144x + 144x +
          if (length(private$include_varnames)) {
    571 - 97x + 97x +
            private$include_varnames
    @@ -21162,14 +22034,16 @@

    teal.slice coverage - 65.74%

    573 - 47x + 47x +
            supported_varnames <- get_supported_filter_varnames(private$data)
    574 - 47x + 47x +
            setdiff(supported_varnames, private$exclude_varnames)
    @@ -21274,7 +22148,8 @@

    teal.slice coverage - 65.74%

    589 - 212x + 212x +
          checkmate::assert_string(state_id, null.ok = TRUE)
    @@ -21288,14 +22163,16 @@

    teal.slice coverage - 65.74%

    591 - 212x + 212x +
          if (is.null(state_id)) {
    592 - 212x + 212x +
            private$state_list()
    @@ -21421,49 +22298,56 @@

    teal.slice coverage - 65.74%

    610 - 183x + 183x +
          logger::log_trace("{ class(self)[1] } pushing into state_list, dataname: { private$dataname }")
    611 - 183x + 183x +
          checkmate::assert_string(state_id)
    612 - 183x + 183x +
          checkmate::assert_multi_class(x, c("FilterState", "FilterStateExpr"))
    613 - 183x + 183x +
          state <- stats::setNames(list(x), state_id)
    614 - 183x + 183x +
          new_state_list <- c(
    615 - 183x + 183x +
            shiny::isolate(private$state_list()),
    616 - 183x + 183x +
            state
    @@ -21477,7 +22361,8 @@

    teal.slice coverage - 65.74%

    618 - 183x + 183x +
          shiny::isolate(private$state_list(new_state_list))
    @@ -21491,14 +22376,16 @@

    teal.slice coverage - 65.74%

    620 - 183x + 183x +
          logger::log_trace("{ class(self)[1] } pushed into queue, dataname: { private$dataname }")
    621 - 183x + 183x +
          invisible(NULL)
    @@ -21617,14 +22504,16 @@

    teal.slice coverage - 65.74%

    638 - 32x + 32x +
          checkmate::assert_character(state_id)
    639 - 32x + 32x +
          logger::log_trace("{ class(self)[1] } removing a filter, state_id: { toString(state_id) }")
    @@ -21638,63 +22527,72 @@

    teal.slice coverage - 65.74%

    641 - 32x + 32x +
          shiny::isolate({
    642 - 32x + 32x +
            current_state_ids <- vapply(private$state_list(), function(x) x$get_state()$id, character(1))
    643 - 32x + 32x +
            to_remove <- state_id %in% current_state_ids
    644 - 32x + 32x +
            if (any(to_remove)) {
    645 - 31x + 31x +
              new_state_list <- Filter(
    646 - 31x + 31x +
                function(state) {
    647 - 68x + 68x +
                  if (state$get_state()$id %in% state_id) {
    648 - 54x + 54x +
                    if (state$get_state()$anchored && !force) {
    649 - 7x + 7x +
                      return(TRUE)
    @@ -21708,14 +22606,16 @@

    teal.slice coverage - 65.74%

    651 - 47x + 47x +
                      state$destroy_observers()
    652 - 47x + 47x +
                      FALSE
    @@ -21736,7 +22636,8 @@

    teal.slice coverage - 65.74%

    655 - 14x + 14x +
                    TRUE
    @@ -21757,7 +22658,8 @@

    teal.slice coverage - 65.74%

    658 - 31x + 31x +
                private$state_list()
    @@ -21771,7 +22673,8 @@

    teal.slice coverage - 65.74%

    660 - 31x + 31x +
              private$state_list(new_state_list)
    @@ -21785,7 +22688,8 @@

    teal.slice coverage - 65.74%

    662 - 1x + 1x +
              warning(sprintf("\"%s\" not found in state list", state_id))
    @@ -21813,7 +22717,8 @@

    teal.slice coverage - 65.74%

    666 - 32x + 32x +
          invisible(NULL)
    @@ -21883,21 +22788,24 @@

    teal.slice coverage - 65.74%

    676 - 25x + 25x +
          shiny::isolate({
    677 - 25x + 25x +
            logger::log_trace(
    678 - 25x + 25x +
              "{ class(self)[1] }$state_list_empty removing all non-anchored filters for dataname: { private$dataname }"
    @@ -21918,28 +22826,32 @@

    teal.slice coverage - 65.74%

    681 - 25x + 25x +
            state_list <- private$state_list()
    682 - 25x + 25x +
            if (length(state_list)) {
    683 - 15x + 15x +
              state_ids <- vapply(state_list, function(x) x$get_state()$id, character(1))
    684 - 15x + 15x +
              private$state_list_remove(state_ids, force)
    @@ -21967,7 +22879,8 @@

    teal.slice coverage - 65.74%

    688 - 25x + 25x +
          invisible(NULL)
    @@ -22093,35 +23006,40 @@

    teal.slice coverage - 65.74%

    706 - 211x + 211x +
          checkmate::assert_class(state, "teal_slices")
    707 - 211x + 211x +
          checkmate::assert_multi_class(data, c("data.frame", "matrix", "DataFrame", "HermesData"))
    708 - 211x + 211x +
          checkmate::assert_function(data_reactive, args = "sid")
    709 - 211x + 211x +
          if (length(state) == 0L) {
    710 - 101x + 101x +
            return(invisible(NULL))
    @@ -22142,14 +23060,16 @@

    teal.slice coverage - 65.74%

    713 - 110x + 110x +
          slices_hashed <- vapply(state, `[[`, character(1L), "id")
    714 - 110x + 110x +
          if (any(duplicated(slices_hashed))) {
    @@ -22198,28 +23118,32 @@

    teal.slice coverage - 65.74%

    721 - 110x + 110x +
          state_list <- shiny::isolate(private$state_list_get())
    722 - 110x + 110x +
          lapply(state, function(slice) {
    723 - 191x + 191x +
            state_id <- slice$id
    724 - 191x + 191x +
            if (state_id %in% names(state_list)) {
    @@ -22233,7 +23157,8 @@

    teal.slice coverage - 65.74%

    726 - 8x + 8x +
              state_list[[state_id]]$set_state(slice)
    @@ -22247,7 +23172,8 @@

    teal.slice coverage - 65.74%

    728 - 183x + 183x +
              if (inherits(slice, "teal_slice_expr")) {
    @@ -22261,7 +23187,8 @@

    teal.slice coverage - 65.74%

    730 - 6x + 6x +
                fstate <- init_filter_state_expr(slice)
    @@ -22282,14 +23209,16 @@

    teal.slice coverage - 65.74%

    733 - 177x + 177x +
                fstate <- init_filter_state(
    734 - 177x + 177x +
                  x = data[, slice$varname, drop = TRUE],
    @@ -22338,14 +23267,16 @@

    teal.slice coverage - 65.74%

    741 - 177x + 177x +
                  x_reactive = if (private$count_type == "none") {
    742 - 171x + 171x +
                    reactive(NULL)
    @@ -22359,7 +23290,8 @@

    teal.slice coverage - 65.74%

    744 - 6x + 6x +
                    reactive(data_reactive(state_id)[, slice$varname, drop = TRUE])
    @@ -22373,14 +23305,16 @@

    teal.slice coverage - 65.74%

    746 - 177x + 177x +
                  slice = slice,
    747 - 177x + 177x +
                  extract_type = private$extract_type
    @@ -22401,7 +23335,8 @@

    teal.slice coverage - 65.74%

    750 - 183x + 183x +
              private$state_list_push(x = fstate, state_id = state_id)
    @@ -22429,7 +23364,8 @@

    teal.slice coverage - 65.74%

    754 - 110x + 110x +
          invisible(NULL)
    @@ -22904,42 +23840,48 @@

    teal.slice coverage - 65.74%

    64 - 25x + 25x +
      checkmate::assert_string(inputId)
    65 - 21x + 21x +
      checkmate::assert_vector(choices)
    66 - 20x + 20x +
      checkmate::assert_numeric(countsmax, len = length(choices))
    67 - 17x + 17x +
      checkmate::assert_numeric(countsnow, len = length(choices), null.ok = TRUE)
    68 - 15x + 15x +
      if (!is.null(countsnow)) {
    69 - 7x + 7x +
        checkmate::assert_true(all(countsnow <= countsmax))
    @@ -22960,7 +23902,8 @@

    teal.slice coverage - 65.74%

    72 - 14x + 14x +
      ns <- NS(inputId)
    @@ -22974,56 +23917,64 @@

    teal.slice coverage - 65.74%

    74 - 14x + 14x +
      mapply(
    75 - 14x + 14x +
        countBar,
    76 - 14x + 14x +
        inputId = ns(seq_along(choices)),
    77 - 14x + 14x +
        label = as.character(choices),
    78 - 14x + 14x +
        countmax = countsmax,
    79 - 14x + 14x +
        countnow = if (is.null(countsnow)) rep(list(NULL), length(choices)) else countsnow,
    80 - 14x + 14x +
        MoreArgs = list(
    81 - 14x + 14x +
          counttotal = sum(countsmax)
    @@ -23037,7 +23988,8 @@

    teal.slice coverage - 65.74%

    83 - 14x + 14x +
        SIMPLIFY = FALSE, USE.NAMES = FALSE
    @@ -23163,35 +24115,40 @@

    teal.slice coverage - 65.74%

    101 - 62x + 62x +
      checkmate::assert_string(inputId)
    102 - 58x + 58x +
      checkmate::assert_string(label)
    103 - 55x + 55x +
      checkmate::assert_number(countmax)
    104 - 53x + 53x +
      checkmate::assert_number(countnow, null.ok = TRUE, upper = countmax)
    105 - 51x + 51x +
      checkmate::assert_number(counttotal, lower = countmax)
    @@ -23205,35 +24162,40 @@

    teal.slice coverage - 65.74%

    107 - 49x + 49x +
      label <- make_count_text(label, countmax = countmax, countnow = countnow)
    108 - 49x + 49x +
      ns <- NS(inputId)
    109 - 26x + 26x +
      if (is.null(countnow)) countnow <- 0
    110 - 49x + 49x +
      tags$div(
    111 - 49x + 49x +
        class = "progress state-count-container",
    @@ -23247,42 +24209,48 @@

    teal.slice coverage - 65.74%

    113 - 49x + 49x +
        tags$div(
    114 - 49x + 49x +
          id = ns("count_bar_filtered"),
    115 - 49x + 49x +
          class = "progress-bar state-count-bar-filtered",
    116 - 49x + 49x +
          style = sprintf("width: %s%%", countnow / counttotal * 100),
    117 - 49x + 49x +
          role = "progressbar",
    118 - 49x + 49x +
          label
    @@ -23296,35 +24264,40 @@

    teal.slice coverage - 65.74%

    120 - 49x + 49x +
        tags$div(
    121 - 49x + 49x +
          id = ns("count_bar_unfiltered"),
    122 - 49x + 49x +
          class = "progress-bar state-count-bar-unfiltered",
    123 - 49x + 49x +
          style = sprintf("width: %s%%", (countmax - countnow) / counttotal * 100),
    124 - 49x + 49x +
          role = "progressbar"
    @@ -23380,28 +24353,32 @@

    teal.slice coverage - 65.74%

    132 - 7x + 7x +
      checkmate::assert_string(inputId)
    133 - 7x + 7x +
      checkmate::assert_vector(choices)
    134 - 7x + 7x +
      checkmate::assert_numeric(countsmax, len = length(choices))
    135 - 7x + 7x +
      checkmate::assert_numeric(countsnow, len = length(choices), null.ok = TRUE)
    @@ -23415,63 +24392,72 @@

    teal.slice coverage - 65.74%

    137 - 7x + 7x +
      ns <- NS(inputId)
    138 - 7x + 7x +
      mapply(
    139 - 7x + 7x +
        updateCountBar,
    140 - 7x + 7x +
        inputId = ns(seq_along(choices)),
    141 - 7x + 7x +
        label = choices,
    142 - 7x + 7x +
        countmax = countsmax,
    143 - 7x + 7x +
        countnow = if (is.null(countsnow)) rep(list(NULL), length(choices)) else countsnow,
    144 - 7x + 7x +
        MoreArgs = list(
    145 - 7x + 7x +
          counttotal = sum(countsmax)
    @@ -23492,7 +24478,8 @@

    teal.slice coverage - 65.74%

    148 - 7x + 7x +
      invisible(NULL)
    @@ -23534,35 +24521,40 @@

    teal.slice coverage - 65.74%

    154 - 18x + 18x +
      checkmate::assert_string(inputId)
    155 - 18x + 18x +
      checkmate::assert_string(label)
    156 - 18x + 18x +
      checkmate::assert_number(countmax)
    157 - 18x + 18x +
      checkmate::assert_number(countnow, null.ok = TRUE)
    158 - 18x + 18x +
      checkmate::assert_number(counttotal)
    @@ -23576,70 +24568,80 @@

    teal.slice coverage - 65.74%

    160 - 18x + 18x +
      label <- make_count_text(label, countmax = countmax, countnow = countnow)
    161 - 18x + 18x +
      if (is.null(countnow)) countnow <- countmax
    162 - 18x + 18x +
      session$sendCustomMessage(
    163 - 18x + 18x +
        type = "updateCountBar",
    164 - 18x + 18x +
        message = list(
    165 - 18x + 18x +
          id = session$ns(inputId),
    166 - 18x + 18x +
          label = label,
    167 - 18x + 18x +
          countmax = countmax,
    168 - 18x + 18x +
          countnow = countnow,
    169 - 18x + 18x +
          counttotal = counttotal
    @@ -23667,7 +24669,8 @@

    teal.slice coverage - 65.74%

    173 - 18x + 18x +
      invisible(NULL)
    @@ -23702,70 +24705,80 @@

    teal.slice coverage - 65.74%

    178 - 17x + 17x +
      checkmate::assert_string(inputId)
    179 - 17x + 17x +
      checkmate::assert_string(label)
    180 - 17x + 17x +
      checkmate::assert_number(countmax)
    181 - 17x + 17x +
      checkmate::assert_number(countnow, null.ok = TRUE)
    182 - 17x + 17x +
      label <- make_count_text(label, countmax = countmax, countnow = countnow)
    183 - 17x + 17x +
      session$sendCustomMessage(
    184 - 17x + 17x +
        type = "updateCountText",
    185 - 17x + 17x +
        message = list(
    186 - 17x + 17x +
          id = session$ns(inputId),
    187 - 17x + 17x +
          label = label
    @@ -23877,56 +24890,64 @@

    teal.slice coverage - 65.74%

    203 - 96x + 96x +
      checkmate::assert_string(label)
    204 - 94x + 94x +
      checkmate::assert_number(countmax)
    205 - 92x + 92x +
      checkmate::assert_number(countnow, null.ok = TRUE)
    206 - 90x + 90x +
      sprintf(
    207 - 90x + 90x +
        "%s (%s%s)",
    208 - 90x + 90x +
        label,
    209 - 90x + 90x +
        if (is.null(countnow)) "" else sprintf("%s/", countnow),
    210 - 90x + 90x +
        countmax
    @@ -24093,7 +25114,8 @@

    teal.slice coverage - 65.74%

    21 - 9x + 9x +
      if (is.factor(choices)) {
    @@ -24121,35 +25143,40 @@

    teal.slice coverage - 65.74%

    25 - 9x + 9x +
      stopifnot(
    26 - 9x + 9x +
        is.character(choices) ||
    27 - 9x + 9x +
          is.numeric(choices) ||
    28 - 9x + 9x +
          is.logical(choices) ||
    29 - 9x + 9x +
          (length(choices) == 1 && is.na(choices))
    @@ -24170,7 +25197,8 @@

    teal.slice coverage - 65.74%

    32 - 9x + 9x +
      if (is.factor(labels)) {
    @@ -24198,14 +25226,16 @@

    teal.slice coverage - 65.74%

    36 - 9x + 9x +
      checkmate::assert_character(labels[!is.na(labels)], any.missing = FALSE)
    37 - 9x + 9x +
      if (length(choices) != length(labels)) {
    @@ -24226,14 +25256,16 @@

    teal.slice coverage - 65.74%

    40 - 9x + 9x +
      stopifnot(is.null(subset) || is.vector(subset))
    41 - 9x + 9x +
      stopifnot(is.null(types) || is.vector(types))
    @@ -24247,14 +25279,16 @@

    teal.slice coverage - 65.74%

    43 - 9x + 9x +
      if (is.vector(types)) {
    44 - 9x + 9x +
        stopifnot(length(choices) == length(types))
    @@ -24275,7 +25309,8 @@

    teal.slice coverage - 65.74%

    47 - 9x + 9x +
      if (!is.null(subset)) {
    @@ -24338,56 +25373,64 @@

    teal.slice coverage - 65.74%

    56 - 9x + 9x +
      is_dupl <- duplicated(choices)
    57 - 9x + 9x +
      choices <- choices[!is_dupl]
    58 - 9x + 9x +
      labels <- labels[!is_dupl]
    59 - 9x + 9x +
      types <- types[!is_dupl]
    60 - 9x + 9x +
      labels[is.na(labels)] <- "Label Missing"
    61 - 9x + 9x +
      raw_labels <- labels
    62 - 9x + 9x +
      combined_labels <- if (length(choices) > 0) {
    63 - 9x + 9x +
        paste0(choices, ": ", labels)
    @@ -24422,7 +25465,8 @@

    teal.slice coverage - 65.74%

    68 - 9x + 9x +
      if (!is.null(subset)) {
    @@ -24471,49 +25515,56 @@

    teal.slice coverage - 65.74%

    75 - 9x + 9x +
      choices <- structure(
    76 - 9x + 9x +
        choices,
    77 - 9x + 9x +
        names = combined_labels,
    78 - 9x + 9x +
        raw_labels = raw_labels,
    79 - 9x + 9x +
        combined_labels = combined_labels,
    80 - 9x + 9x +
        class = c("choices_labeled", "character"),
    81 - 9x + 9x +
        types = types
    @@ -24534,7 +25585,8 @@

    teal.slice coverage - 65.74%

    84 - 9x + 9x +
      return(choices)
    @@ -24974,35 +26026,40 @@

    teal.slice coverage - 65.74%

    61 - 195x + 195x +
      checkmate::assert_class(x_reactive, "reactive")
    62 - 194x + 194x +
      checkmate::assert_character(extract_type, max.len = 1, any.missing = FALSE)
    63 - 194x + 194x +
      checkmate::assert_class(slice, "teal_slice")
    64 - 193x + 193x +
      if (length(extract_type) == 1) {
    65 - 43x + 43x +
        checkmate::assert_choice(extract_type, choices = c("list", "matrix"))
    @@ -25023,42 +26080,48 @@

    teal.slice coverage - 65.74%

    68 - 192x + 192x +
      if (all(is.na(x))) {
    69 - 1x + 1x +
        EmptyFilterState$new(
    70 - 1x + 1x +
          x = x,
    71 - 1x + 1x +
          x_reactive = x_reactive,
    72 - 1x + 1x +
          slice = slice,
    73 - 1x + 1x +
          extract_type = extract_type
    @@ -25079,7 +26142,8 @@

    teal.slice coverage - 65.74%

    76 - 191x + 191x +
        UseMethod("init_filter_state")
    @@ -25149,35 +26213,40 @@

    teal.slice coverage - 65.74%

    86 - 1x + 1x +
      args <- list(
    87 - 1x + 1x +
        x = x,
    88 - 1x + 1x +
        x_reactive = x_reactive,
    89 - 1x + 1x +
        extract_type = extract_type,
    90 - 1x + 1x +
        slice
    @@ -25198,7 +26267,8 @@

    teal.slice coverage - 65.74%

    93 - 1x + 1x +
      do.call(FilterState$new, args)
    @@ -25261,35 +26331,40 @@

    teal.slice coverage - 65.74%

    102 - 1x + 1x +
      LogicalFilterState$new(
    103 - 1x + 1x +
        x = x,
    104 - 1x + 1x +
        x_reactive = x_reactive,
    105 - 1x + 1x +
        slice = slice,
    106 - 1x + 1x +
        extract_type = extract_type
    @@ -25359,35 +26434,40 @@

    teal.slice coverage - 65.74%

    116 - 120x + 120x +
      args <- list(
    117 - 120x + 120x +
        x = x,
    118 - 120x + 120x +
        x_reactive = x_reactive,
    119 - 120x + 120x +
        slice = slice,
    120 - 120x + 120x +
        extract_type = extract_type
    @@ -25408,14 +26488,16 @@

    teal.slice coverage - 65.74%

    123 - 120x + 120x +
      if (length(unique(x[!is.na(x)])) < getOption("teal.threshold_slider_vs_checkboxgroup")) {
    124 - 28x + 28x +
        do.call(ChoicesFilterState$new, args)
    @@ -25429,7 +26511,8 @@

    teal.slice coverage - 65.74%

    126 - 92x + 92x +
        do.call(RangeFilterState$new, args)
    @@ -25499,35 +26582,40 @@

    teal.slice coverage - 65.74%

    136 - 31x + 31x +
      ChoicesFilterState$new(
    137 - 31x + 31x +
        x = x,
    138 - 31x + 31x +
        x_reactive = x_reactive,
    139 - 31x + 31x +
        slice = slice,
    140 - 31x + 31x +
        extract_type = extract_type
    @@ -25597,35 +26685,40 @@

    teal.slice coverage - 65.74%

    150 - 32x + 32x +
      ChoicesFilterState$new(
    151 - 32x + 32x +
        x = x,
    152 - 32x + 32x +
        x_reactive = x_reactive,
    153 - 32x + 32x +
        slice = slice,
    154 - 32x + 32x +
        extract_type = extract_type
    @@ -25695,35 +26788,40 @@

    teal.slice coverage - 65.74%

    164 - 2x + 2x +
      args <- list(
    165 - 2x + 2x +
        x = x,
    166 - 2x + 2x +
        x_reactive = x_reactive,
    167 - 2x + 2x +
        slice = slice,
    168 - 2x + 2x +
        extract_type = extract_type
    @@ -25744,14 +26842,16 @@

    teal.slice coverage - 65.74%

    171 - 2x + 2x +
      if (length(unique(x[!is.na(x)])) < getOption("teal.threshold_slider_vs_checkboxgroup")) {
    172 - 1x + 1x +
        do.call(ChoicesFilterState$new, args)
    @@ -25765,7 +26865,8 @@

    teal.slice coverage - 65.74%

    174 - 1x + 1x +
        do.call(DateFilterState$new, args)
    @@ -25835,35 +26936,40 @@

    teal.slice coverage - 65.74%

    184 - 2x + 2x +
      args <- list(
    185 - 2x + 2x +
        x = x,
    186 - 2x + 2x +
        x_reactive = x_reactive,
    187 - 2x + 2x +
        slice = slice,
    188 - 2x + 2x +
        extract_type = extract_type
    @@ -25884,14 +26990,16 @@

    teal.slice coverage - 65.74%

    191 - 2x + 2x +
      if (length(unique(x[!is.na(x)])) < getOption("teal.threshold_slider_vs_checkboxgroup")) {
    192 - 1x + 1x +
        do.call(ChoicesFilterState$new, args)
    @@ -25905,7 +27013,8 @@

    teal.slice coverage - 65.74%

    194 - 1x + 1x +
        do.call(DatetimeFilterState$new, args)
    @@ -25975,35 +27084,40 @@

    teal.slice coverage - 65.74%

    204 - 2x + 2x +
      args <- list(
    205 - 2x + 2x +
        x = x,
    206 - 2x + 2x +
        x_reactive = x_reactive,
    207 - 2x + 2x +
        slice = slice,
    208 - 2x + 2x +
        extract_type = extract_type
    @@ -26024,14 +27138,16 @@

    teal.slice coverage - 65.74%

    211 - 2x + 2x +
      if (length(unique(x[!is.na(x)])) < getOption("teal.threshold_slider_vs_checkboxgroup")) {
    212 - 1x + 1x +
        do.call(ChoicesFilterState$new, args)
    @@ -26045,7 +27161,8 @@

    teal.slice coverage - 65.74%

    214 - 1x + 1x +
        do.call(DatetimeFilterState$new, args)
    @@ -26171,7 +27288,8 @@

    teal.slice coverage - 65.74%

    232 - 6x + 6x +
      FilterStateExpr$new(slice)
    @@ -26290,28 +27408,32 @@

    teal.slice coverage - 65.74%

    249 - 119x + 119x +
      checkmate::assert_string(color)
    250 - 119x + 119x +
      checkmate::assert(
    251 - 119x + 119x +
        checkmate::check_number(alpha, lower = 0, upper = 1, null.ok = TRUE),
    252 - 119x + 119x +
        checkmate::check_string(alpha, pattern = "[0-9a-f]{2}", null.ok = TRUE)
    @@ -26346,7 +27468,8 @@

    teal.slice coverage - 65.74%

    257 - 119x + 119x +
      sass_file <- if (utils::packageVersion("bslib") < as.package_version("0.5.1.9000")) {
    @@ -26367,7 +27490,8 @@

    teal.slice coverage - 65.74%

    260 - 119x + 119x +
        bslib::bs_theme()[["layers"]][[2]][["defaults"]][[1]][[1]]
    @@ -26381,7 +27505,8 @@

    teal.slice coverage - 65.74%

    262 - 119x + 119x +
      sass_file <- attr(sass_file, "sass_file_path")
    @@ -26402,7 +27527,8 @@

    teal.slice coverage - 65.74%

    265 - 119x + 119x +
      variables_file <- readLines(sass_file)
    @@ -26416,14 +27542,16 @@

    teal.slice coverage - 65.74%

    267 - 119x + 119x +
      ind <- grep("// scss-docs-(start|end) theme-color-variables", variables_file)
    268 - 119x + 119x +
      color_definitions <- variables_file[(ind[1] + 1L):(ind[2] - 1L)]
    @@ -26444,7 +27572,8 @@

    teal.slice coverage - 65.74%

    271 - 119x + 119x +
      color_names <- sub("(\\$)(\\w.+)(:.+)", "\\2", color_definitions)
    @@ -26465,7 +27594,8 @@

    teal.slice coverage - 65.74%

    274 - 119x + 119x +
      checkmate::assert_choice(color, color_names)
    @@ -26486,7 +27616,8 @@

    teal.slice coverage - 65.74%

    277 - 119x + 119x +
      color_references <- sub("(\\$)(\\w.+)(:\\s.+\\$)(\\w.+)(\\s.+)", "\\4", color_definitions)
    @@ -26507,42 +27638,48 @@

    teal.slice coverage - 65.74%

    280 - 119x + 119x +
      color_specification <- structure(color_references, names = color_names)
    281 - 119x + 119x +
      color_specification <- vapply(color_specification, function(x) {
    282 - 952x + 952x +
        line <- grep(sprintf("^\\$%s:\\s+#\\w{6}\\s+!default", x), variables_file, value = TRUE)
    283 - 952x + 952x +
        code <- sub("(.+)(#\\w{6})(\\s+.+)", "\\2", line)
    284 - 952x + 952x +
        code
    285 - 119x + 119x +
      }, character(1L))
    @@ -26556,7 +27693,8 @@

    teal.slice coverage - 65.74%

    287 - 119x + 119x +
      if (!is.null(alpha)) {
    @@ -26584,7 +27722,8 @@

    teal.slice coverage - 65.74%

    291 - 119x + 119x +
      paste0(color_specification[color], alpha)
    @@ -27269,49 +28408,56 @@

    teal.slice coverage - 65.74%

    96 - 764x + 764x +
      slices <- list(...)
    97 - 764x + 764x +
      checkmate::assert_list(slices, types = "teal_slice", any.missing = FALSE)
    98 - 763x + 763x +
      slices_id <- shiny::isolate(vapply(slices, `[[`, character(1L), "id"))
    99 - 763x + 763x +
      if (any(duplicated(slices_id))) {
    100 - 1x + 1x +
        stop(
    101 - 1x + 1x +
          "Some teal_slice objects have the same id:\n",
    102 - 1x + 1x +
          toString(unique(slices_id[duplicated(slices_id)]))
    @@ -27332,35 +28478,40 @@

    teal.slice coverage - 65.74%

    105 - 762x + 762x +
      checkmate::assert_list(exclude_varnames, names = "named", types = "character", null.ok = TRUE, min.len = 1)
    106 - 761x + 761x +
      checkmate::assert_list(include_varnames, names = "named", types = "character", null.ok = TRUE, min.len = 1)
    107 - 760x + 760x +
      checkmate::assert_character(count_type, len = 1, null.ok = TRUE)
    108 - 758x + 758x +
      checkmate::assert_subset(count_type, choices = c("all", "none"), empty.ok = TRUE)
    109 - 757x + 757x +
      checkmate::assert_logical(allow_add)
    @@ -27374,35 +28525,40 @@

    teal.slice coverage - 65.74%

    111 - 756x + 756x +
      duplicated_datasets <- intersect(names(include_varnames), names(exclude_varnames))
    112 - 756x + 756x +
      if (length(duplicated_datasets)) {
    113 - 1x + 1x +
        stop(
    114 - 1x + 1x +
          "Some datasets are specified in both, include_varnames and exclude_varnames:\n",
    115 - 1x + 1x +
          toString(duplicated_datasets)
    @@ -27430,49 +28586,56 @@

    teal.slice coverage - 65.74%

    119 - 755x + 755x +
      structure(
    120 - 755x + 755x +
        slices,
    121 - 755x + 755x +
        exclude_varnames = exclude_varnames,
    122 - 755x + 755x +
        include_varnames = include_varnames,
    123 - 755x + 755x +
        count_type = count_type,
    124 - 755x + 755x +
        allow_add = allow_add,
    125 - 755x + 755x +
        class = c("teal_slices", class(slices))
    @@ -27542,7 +28705,8 @@

    teal.slice coverage - 65.74%

    135 - 465x + 465x +
      inherits(x, "teal_slices")
    @@ -27703,21 +28867,24 @@

    teal.slice coverage - 65.74%

    158 - 1077x + 1077x +
      ans <- unclass(x)
    159 - 45x + 45x +
      if (recursive) ans[] <- lapply(ans, as.list)
    160 - 1077x + 1077x +
      ans
    @@ -27780,21 +28947,24 @@

    teal.slice coverage - 65.74%

    169 - 3x + 3x +
      if (missing(i)) i <- seq_along(x)
    170 - 506x + 506x +
      if (length(i) == 0L) {
    171 - 178x + 178x +
        return(x[0])
    @@ -27808,35 +28978,40 @@

    teal.slice coverage - 65.74%

    173 - 1x + 1x +
      if (is.logical(i) && length(i) > length(x)) stop("subscript out of bounds")
    174 - 1x + 1x +
      if (is.numeric(i) && max(i) > length(x)) stop("subscript out of bounds")
    175 - 326x + 326x +
      if (is.character(i)) {
    176 - 1x + 1x +
        if (!all(is.element(i, names(x)))) stop("subscript out of bounds")
    177 - 2x + 2x +
        i <- which(is.element(i, names(x)))
    @@ -27857,35 +29032,40 @@

    teal.slice coverage - 65.74%

    180 - 325x + 325x +
      y <- NextMethod("[")
    181 - 325x + 325x +
      attrs <- attributes(x)
    182 - 325x + 325x +
      attrs$names <- attrs$names[i]
    183 - 325x + 325x +
      attributes(y) <- attrs
    184 - 325x + 325x +
      y
    @@ -27948,14 +29128,16 @@

    teal.slice coverage - 65.74%

    193 - 252x + 252x +
      x <- list(...)
    194 - 252x + 252x +
      checkmate::assert_true(all(vapply(x, is.teal_slices, logical(1L))), .var.name = "all arguments are teal_slices")
    @@ -27969,21 +29151,24 @@

    teal.slice coverage - 65.74%

    196 - 251x + 251x +
      all_attributes <- lapply(x, attributes)
    197 - 251x + 251x +
      all_attributes <- coalesce_r(all_attributes)
    198 - 251x + 251x +
      all_attributes <- all_attributes[names(all_attributes) != "class"]
    @@ -27997,35 +29182,40 @@

    teal.slice coverage - 65.74%

    200 - 251x + 251x +
      do.call(
    201 - 251x + 251x +
        teal_slices,
    202 - 251x + 251x +
        c(
    203 - 251x + 251x +
          unique(unlist(x, recursive = FALSE)),
    204 - 251x + 251x +
          all_attributes
    @@ -28116,14 +29306,16 @@

    teal.slice coverage - 65.74%

    217 - 45x + 45x +
      checkmate::assert_flag(show_all)
    218 - 45x + 45x +
      checkmate::assert_flag(trim_lines)
    @@ -28137,35 +29329,40 @@

    teal.slice coverage - 65.74%

    220 - 45x + 45x +
      x <- as.list(x, recursive = TRUE)
    221 - 45x + 45x +
      attrs <- attributes(x)
    222 - 45x + 45x +
      attributes(x) <- NULL
    223 - 45x + 45x +
      slices_list <- list(slices = x, attributes = attrs)
    224 - 45x + 45x +
      slices_list <- Filter(Negate(is.null), slices_list) # drop attributes if empty
    @@ -28179,7 +29376,8 @@

    teal.slice coverage - 65.74%

    226 - 20x + 20x +
      if (!show_all) slices_list$slices <- lapply(slices_list$slices, function(slice) Filter(Negate(is.null), slice))
    @@ -28193,7 +29391,8 @@

    teal.slice coverage - 65.74%

    228 - 45x + 45x +
      jsonify(slices_list, trim_lines)
    @@ -28249,7 +29448,8 @@

    teal.slice coverage - 65.74%

    236 - 2x + 2x +
      cat(format(x, ...), "\n")
    @@ -28333,21 +29533,24 @@

    teal.slice coverage - 65.74%

    248 - 14x + 14x +
      Filter(
    249 - 14x + 14x +
        function(xx) {
    250 - 12x + 12x +
          !any(vapply(y, function(yy) identical(yy, xx), logical(1)))
    @@ -28361,7 +29564,8 @@

    teal.slice coverage - 65.74%

    252 - 14x + 14x +
        x
    @@ -28508,28 +29712,32 @@

    teal.slice coverage - 65.74%

    273 - 1569x + 1569x +
      checkmate::assert_list(x)
    274 - 1568x + 1568x +
      xnn <- Filter(Negate(is.null), x)
    275 - 1568x + 1568x +
      if (all(vapply(xnn, is.atomic, logical(1L)))) {
    276 - 1059x + 1059x +
        return(xnn[[1L]])
    @@ -28543,21 +29751,24 @@

    teal.slice coverage - 65.74%

    278 - 509x + 509x +
      lapply(x, checkmate::assert_list, names = "named", null.ok = TRUE, .var.name = "list element")
    279 - 508x + 508x +
      all_names <- unique(unlist(lapply(x, names)))
    280 - 508x + 508x +
      sapply(all_names, function(nm) coalesce_r(lapply(x, `[[`, nm)), simplify = FALSE)
    @@ -29550,21 +30761,24 @@

    teal.slice coverage - 65.74%

    140 - 24x + 24x +
          shiny::isolate({
    141 - 24x + 24x +
            checkmate::assert_date(x)
    142 - 23x + 23x +
            checkmate::assert_class(x_reactive, "reactive")
    @@ -29578,35 +30792,40 @@

    teal.slice coverage - 65.74%

    144 - 23x + 23x +
            super$initialize(
    145 - 23x + 23x +
              x = x,
    146 - 23x + 23x +
              x_reactive = x_reactive,
    147 - 23x + 23x +
              slice = slice,
    148 - 23x + 23x +
              extract_type = extract_type
    @@ -29620,28 +30839,32 @@

    teal.slice coverage - 65.74%

    150 - 23x + 23x +
            checkmate::assert_date(slice$choices, null.ok = TRUE)
    151 - 22x + 22x +
            private$set_choices(slice$choices)
    152 - 14x + 14x +
            if (is.null(slice$selected)) slice$selected <- slice$choices
    153 - 22x + 22x +
            private$set_selected(slice$selected)
    @@ -29662,7 +30885,8 @@

    teal.slice coverage - 65.74%

    156 - 21x + 21x +
          invisible(self)
    @@ -29746,14 +30970,16 @@

    teal.slice coverage - 65.74%

    168 - 7x + 7x +
          if (isFALSE(private$is_any_filtered())) {
    169 - 1x + 1x +
            return(NULL)
    @@ -29767,28 +30993,32 @@

    teal.slice coverage - 65.74%

    171 - 6x + 6x +
          choices <- as.character(private$get_selected())
    172 - 6x + 6x +
          varname <- private$get_varname_prefixed(dataname)
    173 - 6x + 6x +
          filter_call <-
    174 - 6x + 6x +
            call(
    @@ -29802,14 +31032,16 @@

    teal.slice coverage - 65.74%

    176 - 6x + 6x +
              call(">=", varname, call("as.Date", choices[1L])),
    177 - 6x + 6x +
              call("<=", varname, call("as.Date", choices[2L]))
    @@ -29823,7 +31055,8 @@

    teal.slice coverage - 65.74%

    179 - 6x + 6x +
          private$add_keep_na_call(filter_call, varname)
    @@ -29879,14 +31112,16 @@

    teal.slice coverage - 65.74%

    187 - 22x + 22x +
          if (is.null(choices)) {
    188 - 19x + 19x +
            choices <- range(private$x, na.rm = TRUE)
    @@ -29900,35 +31135,40 @@

    teal.slice coverage - 65.74%

    190 - 3x + 3x +
            choices_adjusted <- c(max(choices[1L], min(private$x)), min(choices[2L], max(private$x)))
    191 - 3x + 3x +
            if (any(choices != choices_adjusted)) {
    192 - 1x + 1x +
              warning(sprintf(
    193 - 1x + 1x +
                "Choices adjusted (some values outside of variable range). Varname: %s, dataname: %s.",
    194 - 1x + 1x +
                private$get_varname(), private$get_dataname()
    @@ -29942,7 +31182,8 @@

    teal.slice coverage - 65.74%

    196 - 1x + 1x +
              choices <- choices_adjusted
    @@ -29956,35 +31197,40 @@

    teal.slice coverage - 65.74%

    198 - 3x + 3x +
            if (choices[1L] >= choices[2L]) {
    199 - 1x + 1x +
              warning(sprintf(
    200 - 1x + 1x +
                "Invalid choices: lower is higher / equal to upper, or not in range of variable values.
    201 - 1x + 1x +
                Setting defaults. Varname: %s, dataname: %s.",
    202 - 1x + 1x +
                private$get_varname(), private$get_dataname()
    @@ -29998,7 +31244,8 @@

    teal.slice coverage - 65.74%

    204 - 1x + 1x +
              choices <- range(private$x, na.rm = TRUE)
    @@ -30019,28 +31266,32 @@

    teal.slice coverage - 65.74%

    207 - 22x + 22x +
          private$set_is_choice_limited(private$x, choices)
    208 - 22x + 22x +
          private$x <- private$x[(private$x >= choices[1L] & private$x <= choices[2L]) | is.na(private$x)]
    209 - 22x + 22x +
          private$teal_slice$choices <- choices
    210 - 22x + 22x +
          invisible(NULL)
    @@ -30082,14 +31333,16 @@

    teal.slice coverage - 65.74%

    216 - 22x + 22x +
          private$is_choice_limited <- (any(xl < choices[1L], na.rm = TRUE) | any(xl > choices[2L], na.rm = TRUE))
    217 - 22x + 22x +
          invisible(NULL)
    @@ -30110,21 +31363,24 @@

    teal.slice coverage - 65.74%

    220 - 33x + 33x +
          tryCatch(
    221 - 33x + 33x +
            expr = {
    222 - 33x + 33x +
              values <- as.Date(values, origin = "1970-01-01")
    @@ -30138,7 +31394,8 @@

    teal.slice coverage - 65.74%

    224 - 30x + 30x +
              values
    @@ -30152,7 +31409,8 @@

    teal.slice coverage - 65.74%

    226 - 33x + 33x +
            error = function(e) stop("Vector of set values must contain values coercible to Date.")
    @@ -30180,42 +31438,48 @@

    teal.slice coverage - 65.74%

    230 - 1x + 1x +
          if (length(values) != 2) stop("Vector of set values must have length two.")
    231 - 29x + 29x +
          if (values[1] > values[2]) {
    232 - 1x + 1x +
            warning(
    233 - 1x + 1x +
              sprintf(
    234 - 1x + 1x +
                "Start date %s is set after the end date %s, the values will be replaced with a default date range.",
    235 - 1x + 1x +
                values[1], values[2]
    @@ -30236,7 +31500,8 @@

    teal.slice coverage - 65.74%

    238 - 1x + 1x +
            values <- isolate(private$get_choices())
    @@ -30250,7 +31515,8 @@

    teal.slice coverage - 65.74%

    240 - 29x + 29x +
          values
    @@ -30271,42 +31537,48 @@

    teal.slice coverage - 65.74%

    243 - 29x + 29x +
          choices <- private$get_choices()
    244 - 29x + 29x +
          if (values[1] < choices[1L] | values[1] > choices[2L]) {
    245 - 5x + 5x +
            warning(
    246 - 5x + 5x +
              sprintf(
    247 - 5x + 5x +
                "Value: %s is outside of the possible range for column %s of dataset %s, setting minimum possible value.",
    248 - 5x + 5x +
                values[1], private$get_varname(), private$get_dataname()
    @@ -30327,7 +31599,8 @@

    teal.slice coverage - 65.74%

    251 - 5x + 5x +
            values[1] <- choices[1L]
    @@ -30348,35 +31621,40 @@

    teal.slice coverage - 65.74%

    254 - 29x + 29x +
          if (values[2] > choices[2L] | values[2] < choices[1L]) {
    255 - 5x + 5x +
            warning(
    256 - 5x + 5x +
              sprintf(
    257 - 5x + 5x +
                "Value: %s is outside of the possible range for column %s of dataset %s, setting maximum possible value.",
    258 - 5x + 5x +
                values[2], private$get_varname(), private$get_dataname()
    @@ -30397,7 +31675,8 @@

    teal.slice coverage - 65.74%

    261 - 5x + 5x +
            values[2] <- choices[2L]
    @@ -30418,7 +31697,8 @@

    teal.slice coverage - 65.74%

    264 - 29x + 29x +
          values
    @@ -31957,7 +33237,8 @@

    teal.slice coverage - 65.74%

    46 - 23x + 23x +
          if (!requireNamespace("MultiAssayExperiment", quietly = TRUE)) {
    @@ -31978,21 +33259,24 @@

    teal.slice coverage - 65.74%

    49 - 23x + 23x +
          checkmate::assert_class(dataset, "MultiAssayExperiment")
    50 - 21x + 21x +
          super$initialize(dataset, dataname, keys, label)
    51 - 21x + 21x +
          experiment_names <- names(dataset)
    @@ -32013,49 +33297,56 @@

    teal.slice coverage - 65.74%

    54 - 21x + 21x +
          private$add_filter_states(
    55 - 21x + 21x +
            filter_states = init_filter_states(
    56 - 21x + 21x +
              data = dataset,
    57 - 21x + 21x +
              data_reactive = private$data_filtered_fun,
    58 - 21x + 21x +
              dataname = dataname,
    59 - 21x + 21x +
              datalabel = "subjects",
    60 - 21x + 21x +
              keys = self$get_keys()
    @@ -32069,7 +33360,8 @@

    teal.slice coverage - 65.74%

    62 - 21x + 21x +
            id = "subjects"
    @@ -32104,70 +33396,80 @@

    teal.slice coverage - 65.74%

    67 - 21x + 21x +
          lapply(
    68 - 21x + 21x +
            experiment_names,
    69 - 21x + 21x +
            function(experiment_name) {
    70 - 105x + 105x +
              data_reactive <- function(sid = "") private$data_filtered_fun(sid)[[experiment_name]]
    71 - 105x + 105x +
              private$add_filter_states(
    72 - 105x + 105x +
                filter_states = init_filter_states(
    73 - 105x + 105x +
                  data = dataset[[experiment_name]],
    74 - 105x + 105x +
                  data_reactive = data_reactive,
    75 - 105x + 105x +
                  dataname = dataname,
    76 - 105x + 105x +
                  datalabel = experiment_name
    @@ -32181,7 +33483,8 @@

    teal.slice coverage - 65.74%

    78 - 105x + 105x +
                id = experiment_name
    @@ -32272,35 +33575,40 @@

    teal.slice coverage - 65.74%

    91 - 15x + 15x +
          shiny::isolate({
    92 - 15x + 15x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initializing, dataname: { private$dataname }")
    93 - 15x + 15x +
            checkmate::assert_class(state, "teal_slices")
    94 - 14x + 14x +
            lapply(state, function(x) {
    95 - 52x + 52x +
              checkmate::assert_true(x$dataname == private$dataname, .var.name = "dataname matches private$dataname")
    @@ -32328,14 +33636,16 @@

    teal.slice coverage - 65.74%

    99 - 14x + 14x +
            subject_state <- Filter(function(x) is.null(x$experiment), state)
    100 - 14x + 14x +
            private$get_filter_states()[["subjects"]]$set_filter_state(subject_state)
    @@ -32363,28 +33673,32 @@

    teal.slice coverage - 65.74%

    104 - 14x + 14x +
            experiments <- unique(unlist(lapply(state, "[[", "experiment")))
    105 - 14x + 14x +
            available_experiments <- setdiff(names(private$get_filter_states()), "subjects")
    106 - 14x + 14x +
            excluded_filters <- setdiff(experiments, available_experiments)
    107 - 14x + 14x +
            if (length(excluded_filters)) {
    @@ -32454,21 +33768,24 @@

    teal.slice coverage - 65.74%

    117 - 14x + 14x +
            lapply(available_experiments, function(experiment) {
    118 - 70x + 70x +
              slices <- Filter(function(x) identical(x$experiment, experiment), state)
    119 - 70x + 70x +
              private$get_filter_states()[[experiment]]$set_filter_state(slices)
    @@ -32489,7 +33806,8 @@

    teal.slice coverage - 65.74%

    122 - 14x + 14x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initialized, dataname: { private$dataname }")
    @@ -32503,7 +33821,8 @@

    teal.slice coverage - 65.74%

    124 - 14x + 14x +
            invisible(NULL)
    @@ -32601,7 +33920,8 @@

    teal.slice coverage - 65.74%

    138 - 1x + 1x +
          checkmate::assert_class(state, "teal_slices")
    @@ -32615,14 +33935,16 @@

    teal.slice coverage - 65.74%

    140 - 1x + 1x +
          shiny::isolate({
    141 - 1x + 1x +
            logger::log_trace("{ class(self)[1] }$remove_filter_state removing filter(s), dataname: { private$dataname }")
    @@ -32636,14 +33958,16 @@

    teal.slice coverage - 65.74%

    143 - 1x + 1x +
            subject_state <- Filter(function(x) is.null(x$experiment), state)
    144 - 1x + 1x +
            private$get_filter_states()[["subjects"]]$remove_filter_state(subject_state)
    @@ -32671,28 +33995,32 @@

    teal.slice coverage - 65.74%

    148 - 1x + 1x +
            experiments <- unique(unlist(lapply(state, "[[", "experiment")))
    149 - 1x + 1x +
            available_experiments <- setdiff(names(private$get_filter_states()), "subjects")
    150 - 1x + 1x +
            excluded_filters <- setdiff(experiments, available_experiments)
    151 - 1x + 1x +
            if (length(excluded_filters)) {
    @@ -32755,7 +34083,8 @@

    teal.slice coverage - 65.74%

    160 - 1x + 1x +
            lapply(experiments, function(experiment) {
    @@ -32797,7 +34126,8 @@

    teal.slice coverage - 65.74%

    166 - 1x + 1x +
            logger::log_trace("{ class(self)[1] }$remove_filter_state removed filter(s), dataname: { private$dataname }")
    @@ -32818,7 +34148,8 @@

    teal.slice coverage - 65.74%

    169 - 1x + 1x +
          invisible(NULL)
    @@ -33112,21 +34443,24 @@

    teal.slice coverage - 65.74%

    211 - 2x + 2x +
          data <- self$get_dataset()
    212 - 2x + 2x +
          data_filtered <- self$get_dataset(TRUE)
    213 - 2x + 2x +
          experiment_names <- names(data)
    @@ -33140,28 +34474,32 @@

    teal.slice coverage - 65.74%

    215 - 2x + 2x +
          mae_info <- data.frame(
    216 - 2x + 2x +
            dataname = private$dataname,
    217 - 2x + 2x +
            subjects = nrow(SummarizedExperiment::colData(data)),
    218 - 2x + 2x +
            subjects_filtered = nrow(SummarizedExperiment::colData(data_filtered()))
    @@ -33182,49 +34520,56 @@

    teal.slice coverage - 65.74%

    221 - 2x + 2x +
          experiment_obs_info <- do.call("rbind", lapply(
    222 - 2x + 2x +
            experiment_names,
    223 - 2x + 2x +
            function(experiment_name) {
    224 - 10x + 10x +
              data.frame(
    225 - 10x + 10x +
                dataname = sprintf("- %s", experiment_name),
    226 - 10x + 10x +
                obs = nrow(data[[experiment_name]]),
    227 - 10x + 10x +
                obs_filtered = nrow(data_filtered()[[experiment_name]])
    @@ -33259,21 +34604,24 @@

    teal.slice coverage - 65.74%

    232 - 2x + 2x +
          get_experiment_keys <- function(mae, experiment) {
    233 - 20x + 20x +
            sample_subset <- subset(MultiAssayExperiment::sampleMap(mae), colname %in% colnames(experiment))
    234 - 20x + 20x +
            length(unique(sample_subset$primary))
    @@ -33294,42 +34642,48 @@

    teal.slice coverage - 65.74%

    237 - 2x + 2x +
          experiment_subjects_info <- do.call("rbind", lapply(
    238 - 2x + 2x +
            experiment_names,
    239 - 2x + 2x +
            function(experiment_name) {
    240 - 10x + 10x +
              data.frame(
    241 - 10x + 10x +
                subjects = get_experiment_keys(data, data[[experiment_name]]),
    242 - 10x + 10x +
                subjects_filtered = get_experiment_keys(data_filtered(), data_filtered()[[experiment_name]])
    @@ -33364,14 +34718,16 @@

    teal.slice coverage - 65.74%

    247 - 2x + 2x +
          experiment_info <- cbind(experiment_obs_info, experiment_subjects_info)
    248 - 2x + 2x +
          dplyr::bind_rows(mae_info, experiment_info)
    @@ -33580,7 +34936,8 @@

    teal.slice coverage - 65.74%

    26 - 153x + 153x +
          logger::log_trace("Instantiating { class(self)[1] }, dataname: { dataname }")
    @@ -33601,21 +34958,24 @@

    teal.slice coverage - 65.74%

    29 - 153x + 153x +
          check_simple_name(dataname)
    30 - 151x + 151x +
          checkmate::assert_character(keys, any.missing = FALSE)
    31 - 151x + 151x +
          checkmate::assert_character(label, null.ok = TRUE)
    @@ -33629,35 +34989,40 @@

    teal.slice coverage - 65.74%

    33 - 151x + 151x +
          logger::log_trace("Instantiating { class(self)[1] }, dataname: { dataname }")
    34 - 151x + 151x +
          private$dataset <- dataset
    35 - 151x + 151x +
          private$dataname <- dataname
    36 - 151x + 151x +
          private$keys <- keys
    37 - 151x + 151x +
          private$label <- if (is.null(label)) character(0) else label
    @@ -33678,28 +35043,32 @@

    teal.slice coverage - 65.74%

    40 - 151x + 151x +
          private$data_filtered_fun <- function(sid = "") {
    41 - 24x + 24x +
            checkmate::assert_character(sid)
    42 - 24x + 24x +
            if (length(sid)) {
    43 - 24x + 24x +
              logger::log_trace("filtering data dataname: { dataname }, sid: { sid }")
    @@ -33727,35 +35096,40 @@

    teal.slice coverage - 65.74%

    47 - 24x + 24x +
            env <- new.env(parent = parent.env(globalenv()))
    48 - 24x + 24x +
            env[[dataname]] <- private$dataset
    49 - 24x + 24x +
            filter_call <- self$get_call(sid)
    50 - 24x + 24x +
            eval_expr_with_msg(filter_call, env)
    51 - 24x + 24x +
            get(x = dataname, envir = env)
    @@ -33776,21 +35150,24 @@

    teal.slice coverage - 65.74%

    54 - 151x + 151x +
          private$data_filtered <- reactive(private$data_filtered_fun())
    55 - 151x + 151x +
          logger::log_trace("Instantiated { class(self)[1] }, dataname: { private$dataname }")
    56 - 151x + 151x +
          invisible(self)
    @@ -33874,28 +35251,32 @@

    teal.slice coverage - 65.74%

    68 - 24x + 24x +
          sprintf(
    69 - 24x + 24x +
            "%s:\n%s",
    70 - 24x + 24x +
            class(self)[1],
    71 - 24x + 24x +
            format(self$get_filter_state(), show_all = show_all, trim_lines = trim_lines)
    @@ -33965,7 +35346,8 @@

    teal.slice coverage - 65.74%

    81 - 10x + 10x +
          cat(shiny::isolate(self$format(...)), "\n")
    @@ -34035,28 +35417,32 @@

    teal.slice coverage - 65.74%

    91 - 14x + 14x +
          logger::log_trace("Removing filters from FilteredDataset: { deparse1(self$get_dataname()) }")
    92 - 14x + 14x +
          lapply(
    93 - 14x + 14x +
            private$get_filter_states(),
    94 - 14x + 14x +
            function(filter_states) filter_states$clear_filter_states(force)
    @@ -34070,14 +35456,16 @@

    teal.slice coverage - 65.74%

    96 - 14x + 14x +
          logger::log_trace("Removed filters from FilteredDataset: { deparse1(self$get_dataname()) }")
    97 - 14x + 14x +
          NULL
    @@ -34210,21 +35598,24 @@

    teal.slice coverage - 65.74%

    116 - 47x + 47x +
          filter_call <- Filter(
    117 - 47x + 47x +
            f = Negate(is.null),
    118 - 47x + 47x +
            x = lapply(private$get_filter_states(), function(x) x$get_call(sid))
    @@ -34238,14 +35629,16 @@

    teal.slice coverage - 65.74%

    120 - 47x + 47x +
          if (length(filter_call) == 0) {
    121 - 29x + 29x +
            return(NULL)
    @@ -34259,7 +35652,8 @@

    teal.slice coverage - 65.74%

    123 - 18x + 18x +
          filter_call
    @@ -34322,14 +35716,16 @@

    teal.slice coverage - 65.74%

    132 - 184x + 184x +
          states <- unname(lapply(private$get_filter_states(), function(x) x$get_filter_state()))
    133 - 184x + 184x +
          do.call(c, states)
    @@ -34455,7 +35851,8 @@

    teal.slice coverage - 65.74%

    151 - 16x + 16x +
          length(self$get_filter_state())
    @@ -34511,7 +35908,8 @@

    teal.slice coverage - 65.74%

    159 - 8x + 8x +
          private$dataname
    @@ -34588,14 +35986,16 @@

    teal.slice coverage - 65.74%

    170 - 51x + 51x +
          if (filtered) {
    171 - 33x + 33x +
            private$data_filtered
    @@ -34609,7 +36009,8 @@

    teal.slice coverage - 65.74%

    173 - 18x + 18x +
            private$dataset
    @@ -34791,7 +36192,8 @@

    teal.slice coverage - 65.74%

    199 - 133x + 133x +
          private$keys
    @@ -34840,7 +36242,8 @@

    teal.slice coverage - 65.74%

    206 - 2x + 2x +
          private$label
    @@ -35414,77 +36817,88 @@

    teal.slice coverage - 65.74%

    288 - 7x + 7x +
          moduleServer(
    289 - 7x + 7x +
            id = id,
    290 - 7x + 7x +
            function(input, output, session) {
    291 - 7x + 7x +
              dataname <- self$get_dataname()
    292 - 7x + 7x +
              logger::log_trace("FilteredDataset$srv_active initializing, dataname: { dataname }")
    293 - 7x + 7x +
              checkmate::assert_string(dataname)
    294 - 7x + 7x +
              output$filter_count <- renderText(
    295 - 7x + 7x +
                sprintf(
    296 - 7x + 7x +
                  "%d filter%s applied",
    297 - 7x + 7x +
                  self$get_filter_count(),
    298 - 7x + 7x +
                  if (self$get_filter_count() != 1) "s" else ""
    @@ -35512,28 +36926,32 @@

    teal.slice coverage - 65.74%

    302 - 7x + 7x +
              lapply(
    303 - 7x + 7x +
                names(private$get_filter_states()),
    304 - 7x + 7x +
                function(x) {
    305 - 12x + 12x +
                  private$get_filter_states()[[x]]$srv_active(id = x)
    @@ -35561,35 +36979,40 @@

    teal.slice coverage - 65.74%

    309 - 7x + 7x +
              shiny::observeEvent(self$get_filter_state(), {
    310 - 8x + 8x +
                shinyjs::hide("filter_count_ui")
    311 - 8x + 8x +
                shinyjs::show("filters")
    312 - 8x + 8x +
                shinyjs::toggle("remove_filters", condition = length(self$get_filter_state()) != 0)
    313 - 8x + 8x +
                shinyjs::toggle("collapse", condition = length(self$get_filter_state()) != 0)
    @@ -35610,7 +37033,8 @@

    teal.slice coverage - 65.74%

    316 - 7x + 7x +
              shiny::observeEvent(input$collapse, {
    @@ -35652,28 +37076,32 @@

    teal.slice coverage - 65.74%

    322 - 7x + 7x +
              observeEvent(input$remove_filters, {
    323 - 1x + 1x +
                logger::log_trace("FilteredDataset$srv_active@1 removing all non-anchored filters, dataname: { dataname }")
    324 - 1x + 1x +
                self$clear_filter_states()
    325 - 1x + 1x +
                logger::log_trace("FilteredDataset$srv_active@1 removed all non-anchored filters, dataname: { dataname }")
    @@ -35694,7 +37122,8 @@

    teal.slice coverage - 65.74%

    328 - 7x + 7x +
              logger::log_trace("FilteredDataset$initialized, dataname: { dataname }")
    @@ -35708,7 +37137,8 @@

    teal.slice coverage - 65.74%

    330 - 7x + 7x +
              NULL
    @@ -35806,7 +37236,8 @@

    teal.slice coverage - 65.74%

    344 - 1x + 1x +
          stop("Pure virtual method")
    @@ -35932,63 +37363,72 @@

    teal.slice coverage - 65.74%

    362 - 2x + 2x +
          moduleServer(
    363 - 2x + 2x +
            id = id,
    364 - 2x + 2x +
            function(input, output, session) {
    365 - 2x + 2x +
              logger::log_trace("MAEFilteredDataset$srv_add initializing, dataname: { deparse1(self$get_dataname()) }")
    366 - 2x + 2x +
              elems <- private$get_filter_states()
    367 - 2x + 2x +
              elem_names <- names(private$get_filter_states())
    368 - 2x + 2x +
              lapply(
    369 - 2x + 2x +
                elem_names,
    370 - 2x + 2x +
                function(elem_name) elems[[elem_name]]$srv_add(elem_name)
    @@ -36002,14 +37442,16 @@

    teal.slice coverage - 65.74%

    372 - 2x + 2x +
              logger::log_trace("MAEFilteredDataset$srv_add initialized, dataname: { deparse1(self$get_dataname()) }")
    373 - 2x + 2x +
              NULL
    @@ -36149,28 +37591,32 @@

    teal.slice coverage - 65.74%

    393 - 225x + 225x +
          checkmate::assert_class(filter_states, "FilterStates")
    394 - 225x + 225x +
          checkmate::assert_string(id)
    395 - 225x + 225x +
          x <- stats::setNames(list(filter_states), id)
    396 - 225x + 225x +
          private$filter_states <- c(private$get_filter_states(), x)
    @@ -36233,7 +37679,8 @@

    teal.slice coverage - 65.74%

    405 - 684x + 684x +
          private$filter_states
    @@ -37156,21 +38603,24 @@

    teal.slice coverage - 65.74%

    128 - 579x + 579x +
      checkmate::assert_string(dataname)
    129 - 572x + 572x +
      checkmate::assert_flag(fixed)
    130 - 570x + 570x +
      checkmate::assert_flag(anchored)
    @@ -37184,7 +38634,8 @@

    teal.slice coverage - 65.74%

    132 - 568x + 568x +
      formal_args <- as.list(environment())
    @@ -37198,7 +38649,8 @@

    teal.slice coverage - 65.74%

    134 - 568x + 568x +
      if (!missing(expr) && !missing(varname)) {
    @@ -37212,28 +38664,32 @@

    teal.slice coverage - 65.74%

    136 - 568x + 568x +
      } else if (!missing(expr)) {
    137 - 30x + 30x +
        checkmate::assert_string(id)
    138 - 27x + 27x +
        checkmate::assert_string(title)
    139 - 24x + 24x +
        checkmate::assert_string(expr)
    @@ -37247,84 +38703,96 @@

    teal.slice coverage - 65.74%

    141 - 23x + 23x +
        formal_args$fixed <- TRUE
    142 - 23x + 23x +
        ts_expr_args <- c("dataname", "id", "expr", "fixed", "anchored", "title")
    143 - 23x + 23x +
        formal_args <- formal_args[ts_expr_args]
    144 - 23x + 23x +
        ans <- do.call(shiny::reactiveValues, c(formal_args, list(...)))
    145 - 23x + 23x +
        class(ans) <- c("teal_slice_expr", "teal_slice", class(ans))
    146 - 538x + 538x +
      } else if (!missing(varname)) {
    147 - 537x + 537x +
        checkmate::assert_string(varname)
    148 - 534x + 534x +
        checkmate::assert_multi_class(choices, .filterable_class, null.ok = TRUE)
    149 - 533x + 533x +
        checkmate::assert_multi_class(selected, .filterable_class, null.ok = TRUE)
    150 - 531x + 531x +
        checkmate::assert_flag(keep_na, null.ok = TRUE)
    151 - 530x + 530x +
        checkmate::assert_flag(keep_inf, null.ok = TRUE)
    152 - 529x + 529x +
        checkmate::assert_flag(multiple)
    @@ -37338,21 +38806,24 @@

    teal.slice coverage - 65.74%

    154 - 529x + 529x +
        ts_var_args <- c(
    155 - 529x + 529x +
          "dataname", "varname", "id", "choices", "selected", "keep_na", "keep_inf",
    156 - 529x + 529x +
          "fixed", "anchored", "multiple"
    @@ -37366,42 +38837,48 @@

    teal.slice coverage - 65.74%

    158 - 529x + 529x +
        formal_args <- formal_args[ts_var_args]
    159 - 529x + 529x +
        args <- c(formal_args, list(...))
    160 - 529x + 529x +
        args[c("choices", "selected")] <-
    161 - 529x + 529x +
          lapply(args[c("choices", "selected")], function(x) if (is.factor(x)) as.character(x) else x)
    162 - 529x + 529x +
        if (missing(id)) {
    163 - 520x + 520x +
          args$id <- get_default_slice_id(args)
    @@ -37415,7 +38892,8 @@

    teal.slice coverage - 65.74%

    165 - 9x + 9x +
          checkmate::assert_string(id)
    @@ -37429,14 +38907,16 @@

    teal.slice coverage - 65.74%

    167 - 526x + 526x +
        ans <- do.call(shiny::reactiveValues, args)
    168 - 526x + 526x +
        class(ans) <- c("teal_slice_var", "teal_slice", class(ans))
    @@ -37450,7 +38930,8 @@

    teal.slice coverage - 65.74%

    170 - 1x + 1x +
        stop("Must provide either `expr` or `varname`.")
    @@ -37471,7 +38952,8 @@

    teal.slice coverage - 65.74%

    173 - 549x + 549x +
      ans
    @@ -37527,7 +39009,8 @@

    teal.slice coverage - 65.74%

    181 - 4x + 4x +
      inherits(x, "teal_slice")
    @@ -37646,7 +39129,8 @@

    teal.slice coverage - 65.74%

    198 - 283x + 283x +
      formal_args <- setdiff(names(formals(teal_slice)), "...")
    @@ -37660,7 +39144,8 @@

    teal.slice coverage - 65.74%

    200 - 283x + 283x +
      x <- if (shiny::isRunning()) {
    @@ -37681,7 +39166,8 @@

    teal.slice coverage - 65.74%

    203 - 283x + 283x +
        shiny::isolate(shiny::reactiveValuesToList(x))
    @@ -37702,14 +39188,16 @@

    teal.slice coverage - 65.74%

    206 - 283x + 283x +
      formal_args <- intersect(formal_args, names(x))
    207 - 283x + 283x +
      extra_args <- rev(setdiff(names(x), formal_args))
    @@ -37723,7 +39211,8 @@

    teal.slice coverage - 65.74%

    209 - 283x + 283x +
      x[c(formal_args, extra_args)]
    @@ -37786,14 +39275,16 @@

    teal.slice coverage - 65.74%

    218 - 116x + 116x +
      checkmate::assert_flag(show_all)
    219 - 92x + 92x +
      checkmate::assert_flag(trim_lines)
    @@ -37807,14 +39298,16 @@

    teal.slice coverage - 65.74%

    221 - 86x + 86x +
      x_list <- as.list(x)
    222 - 47x + 47x +
      if (!show_all) x_list <- Filter(Negate(is.null), x_list)
    @@ -37828,7 +39321,8 @@

    teal.slice coverage - 65.74%

    224 - 86x + 86x +
      jsonify(x_list, trim_lines)
    @@ -37884,7 +39378,8 @@

    teal.slice coverage - 65.74%

    232 - 15x + 15x +
      cat(format(x, ...))
    @@ -38010,7 +39505,8 @@

    teal.slice coverage - 65.74%

    250 - 131x + 131x +
      checkmate::assert_list(x)
    @@ -38024,28 +39520,32 @@

    teal.slice coverage - 65.74%

    252 - 131x + 131x +
      x_json <- to_json(x)
    253 - 131x + 131x +
      x_json_justified <- justify_json(x_json)
    254 - 121x + 121x +
      if (trim_lines) x_json_justified <- trim_lines_json(x_json_justified)
    255 - 131x + 131x +
      paste(x_json_justified, collapse = "\n")
    @@ -38150,35 +39650,40 @@

    teal.slice coverage - 65.74%

    270 - 131x + 131x +
      no_unbox <- function(x) {
    271 - 2390x + 2390x +
        vars <- c("selected", "choices")
    272 - 2390x + 2390x +
        if (is.list(x)) {
    273 - 385x + 385x +
          for (var in vars) {
    274 - 307x + 307x +
            if (!is.null(x[[var]])) x[[var]] <- I(format_time(x[[var]]))
    @@ -38192,7 +39697,8 @@

    teal.slice coverage - 65.74%

    276 - 385x + 385x +
          lapply(x, no_unbox)
    @@ -38206,7 +39712,8 @@

    teal.slice coverage - 65.74%

    278 - 2005x + 2005x +
          x
    @@ -38234,7 +39741,8 @@

    teal.slice coverage - 65.74%

    282 - 131x + 131x +
      jsonlite::toJSON(no_unbox(x), pretty = TRUE, auto_unbox = TRUE, digits = 16, null = "null")
    @@ -38346,14 +39854,16 @@

    teal.slice coverage - 65.74%

    298 - 307x + 307x +
      if ("POSIXt" %in% class(x)) {
    299 - 20x + 20x +
        format(x, format = "%Y-%m-%d %H:%M:%S", usetz = TRUE, tz = "UTC")
    @@ -38367,7 +39877,8 @@

    teal.slice coverage - 65.74%

    301 - 287x + 287x +
        x
    @@ -38472,35 +39983,40 @@

    teal.slice coverage - 65.74%

    316 - 131x + 131x +
      format_name <- function(name, name_width) {
    317 - 2775x + 2775x +
        if (nchar(name) == 1 || nchar(gsub("\\s", "", name)) <= 2) {
    318 - 630x + 630x +
          return(name)
    319 - 2145x + 2145x +
        } else if (grepl("slices|attributes", name)) {
    320 - 90x + 90x +
          paste0(name, ":")
    @@ -38514,7 +40030,8 @@

    teal.slice coverage - 65.74%

    322 - 2055x + 2055x +
          paste(format(name, width = name_width), ":")
    @@ -38535,28 +40052,32 @@

    teal.slice coverage - 65.74%

    325 - 131x + 131x +
      json_lines <- strsplit(json, "\n")[[1]]
    326 - 131x + 131x +
      json_lines_split <- regmatches(json_lines, regexpr(":", json_lines), invert = TRUE)
    327 - 131x + 131x +
      name_width <- max(unlist(regexpr(":", json_lines))) - 1
    328 - 131x + 131x +
      vapply(json_lines_split, function(x) paste0(format_name(x[1], name_width), stats::na.omit(x[2])), character(1))
    @@ -38661,35 +40182,40 @@

    teal.slice coverage - 65.74%

    343 - 121x + 121x +
      name_width <- max(unlist(gregexpr(":", x))) - 1
    344 - 121x + 121x +
      trim_position <- name_width + 37L
    345 - 121x + 121x +
      x_trim <- substr(x, 1, trim_position)
    346 - 121x + 121x +
      substr(x_trim, trim_position - 2, trim_position) <- "..."
    347 - 121x + 121x +
      x_trim
    @@ -38857,28 +40383,32 @@

    teal.slice coverage - 65.74%

    371 - 609x + 609x +
      checkmate::assert_multi_class(x, c("teal_slice", "list"))
    372 - 609x + 609x +
      shiny::isolate({
    373 - 609x + 609x +
        if (inherits(x, "teal_slice_expr") || is.null(x$varname)) {
    374 - 10x + 10x +
          x$id
    @@ -38892,28 +40422,32 @@

    teal.slice coverage - 65.74%

    376 - 599x + 599x +
          paste(
    377 - 599x + 599x +
            Filter(
    378 - 599x + 599x +
              length,
    379 - 599x + 599x +
              as.list(x)[c("dataname", "varname", "experiment", "arg")]
    @@ -38927,7 +40461,8 @@

    teal.slice coverage - 65.74%

    381 - 599x + 599x +
            collapse = " "
    @@ -39192,7 +40727,8 @@

    teal.slice coverage - 65.74%

    33 - 92x + 92x +
          if (!requireNamespace("SummarizedExperiment", quietly = TRUE)) {
    @@ -39213,35 +40749,40 @@

    teal.slice coverage - 65.74%

    36 - 92x + 92x +
          checkmate::assert_function(data_reactive, args = "sid")
    37 - 92x + 92x +
          checkmate::assert_class(data, "SummarizedExperiment")
    38 - 91x + 91x +
          super$initialize(data, data_reactive, dataname, datalabel)
    39 - 91x + 91x +
          if (!is.null(datalabel)) {
    40 - 84x + 84x +
            private$dataname_prefixed <- sprintf("%s[['%s']]", dataname, datalabel)
    @@ -39332,35 +40873,40 @@

    teal.slice coverage - 65.74%

    53 - 61x + 61x +
          shiny::isolate({
    54 - 61x + 61x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initializing, dataname: { private$dataname }")
    55 - 61x + 61x +
            checkmate::assert_class(state, "teal_slices")
    56 - 59x + 59x +
            lapply(state, function(x) {
    57 - 17x + 17x +
              checkmate::assert_choice(x$arg, choices = c("subset", "select"), null.ok = TRUE, .var.name = "teal_slice$arg")
    @@ -39374,21 +40920,24 @@

    teal.slice coverage - 65.74%

    59 - 59x + 59x +
            count_type <- attr(state, "count_type")
    60 - 59x + 59x +
            if (length(count_type)) {
    61 - 8x + 8x +
              private$count_type <- count_type
    @@ -39409,35 +40958,40 @@

    teal.slice coverage - 65.74%

    64 - 59x + 59x +
            subset_states <- Filter(function(x) x$arg == "subset", state)
    65 - 59x + 59x +
            private$set_filter_state_impl(
    66 - 59x + 59x +
              state = subset_states,
    67 - 59x + 59x +
              data = SummarizedExperiment::rowData(private$data),
    68 - 59x + 59x +
              data_reactive = function(sid = "") {
    @@ -39493,35 +41047,40 @@

    teal.slice coverage - 65.74%

    76 - 59x + 59x +
            select_states <- Filter(function(x) x$arg == "select", state)
    77 - 59x + 59x +
            private$set_filter_state_impl(
    78 - 59x + 59x +
              state = select_states,
    79 - 59x + 59x +
              data = SummarizedExperiment::colData(private$data),
    80 - 59x + 59x +
              data_reactive = function(sid = "") {
    @@ -39577,14 +41136,16 @@

    teal.slice coverage - 65.74%

    88 - 59x + 59x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initialized, dataname: { private$dataname }")
    89 - 59x + 59x +
            invisible(NULL)
    @@ -39654,49 +41215,56 @@

    teal.slice coverage - 65.74%

    99 - 2x + 2x +
          data <- private$data
    100 - 2x + 2x +
          checkmate::assert_string(id)
    101 - 2x + 2x +
          ns <- NS(id)
    102 - 2x + 2x +
          row_input <- if (ncol(SummarizedExperiment::rowData(data)) == 0) {
    103 - 1x + 1x +
            div("no sample variables available")
    104 - 2x + 2x +
          } else if (nrow(SummarizedExperiment::rowData(data)) == 0) {
    105 - 1x + 1x +
            div("no samples available")
    @@ -39780,28 +41348,32 @@

    teal.slice coverage - 65.74%

    117 - 2x + 2x +
          col_input <- if (ncol(SummarizedExperiment::colData(data)) == 0) {
    118 - 1x + 1x +
            div("no sample variables available")
    119 - 2x + 2x +
          } else if (nrow(SummarizedExperiment::colData(data)) == 0) {
    120 - 1x + 1x +
            div("no samples available")
    @@ -39885,21 +41457,24 @@

    teal.slice coverage - 65.74%

    132 - 2x + 2x +
          div(
    133 - 2x + 2x +
            row_input,
    134 - 2x + 2x +
            col_input
    @@ -41529,14 +43104,16 @@

    teal.slice coverage - 65.74%

    63 - 103x + 103x +
          checkmate::assert_data_frame(dataset)
    64 - 101x + 101x +
          super$initialize(dataset, dataname, keys, label)
    @@ -41557,21 +43134,24 @@

    teal.slice coverage - 65.74%

    67 - 99x + 99x +
          if (!is.null(parent)) {
    68 - 10x + 10x +
            checkmate::assert_character(parent_name, len = 1)
    69 - 10x + 10x +
            checkmate::assert_character(join_keys, min.len = 1)
    @@ -41585,14 +43165,16 @@

    teal.slice coverage - 65.74%

    71 - 10x + 10x +
            private$parent_name <- parent_name
    72 - 10x + 10x +
            private$join_keys <- join_keys
    @@ -41606,28 +43188,32 @@

    teal.slice coverage - 65.74%

    74 - 10x + 10x +
            private$data_filtered_fun <- function(sid = "") {
    75 - 8x + 8x +
              checkmate::assert_character(sid)
    76 - 8x + 8x +
              if (length(sid)) {
    77 - 8x + 8x +
                logger::log_trace("filtering data dataname: { dataname }, sid: { sid }")
    @@ -41655,42 +43241,48 @@

    teal.slice coverage - 65.74%

    81 - 8x + 8x +
              env <- new.env(parent = parent.env(globalenv()))
    82 - 8x + 8x +
              env[[dataname]] <- private$dataset
    83 - 8x + 8x +
              env[[parent_name]] <- parent()
    84 - 8x + 8x +
              filter_call <- self$get_call(sid)
    85 - 8x + 8x +
              eval_expr_with_msg(filter_call, env)
    86 - 8x + 8x +
              get(x = dataname, envir = env)
    @@ -41718,42 +43310,48 @@

    teal.slice coverage - 65.74%

    90 - 99x + 99x +
          private$add_filter_states(
    91 - 99x + 99x +
            filter_states = init_filter_states(
    92 - 99x + 99x +
              data = dataset,
    93 - 99x + 99x +
              data_reactive = private$data_filtered_fun,
    94 - 99x + 99x +
              dataname = dataname,
    95 - 99x + 99x +
              keys = self$get_keys()
    @@ -41767,7 +43365,8 @@

    teal.slice coverage - 65.74%

    97 - 99x + 99x +
            id = "filter"
    @@ -41795,35 +43394,40 @@

    teal.slice coverage - 65.74%

    101 - 99x + 99x +
          if (!is.null(parent)) {
    102 - 10x + 10x +
            fs <- teal_slices(
    103 - 10x + 10x +
              exclude_varnames = structure(
    104 - 10x + 10x +
                list(intersect(colnames(dataset), colnames(isolate(parent())))),
    105 - 10x + 10x +
                names = private$dataname
    @@ -41844,7 +43448,8 @@

    teal.slice coverage - 65.74%

    108 - 10x + 10x +
            self$set_filter_state(fs)
    @@ -41865,7 +43470,8 @@

    teal.slice coverage - 65.74%

    111 - 99x + 99x +
          invisible(self)
    @@ -41998,28 +43604,32 @@

    teal.slice coverage - 65.74%

    130 - 42x + 42x +
          logger::log_trace("DataframeFilteredDataset$get_call initializing for dataname: { private$dataname }")
    131 - 42x + 42x +
          filter_call <- super$get_call(sid)
    132 - 42x + 42x +
          dataname <- private$dataname
    133 - 42x + 42x +
          parent_dataname <- private$parent_name
    @@ -42033,28 +43643,32 @@

    teal.slice coverage - 65.74%

    135 - 42x + 42x +
          if (!identical(parent_dataname, character(0))) {
    136 - 9x + 9x +
            join_keys <- private$join_keys
    137 - 9x + 9x +
            parent_keys <- unname(join_keys)
    138 - 9x + 9x +
            dataset_keys <- names(join_keys)
    @@ -42068,7 +43682,8 @@

    teal.slice coverage - 65.74%

    140 - 9x + 9x +
            y_arg <- if (length(parent_keys) == 0L) {
    @@ -42089,28 +43704,32 @@

    teal.slice coverage - 65.74%

    143 - 9x + 9x +
              sprintf(
    144 - 9x + 9x +
                "%s[, c(%s), drop = FALSE]",
    145 - 9x + 9x +
                parent_dataname,
    146 - 9x + 9x +
                toString(dQuote(parent_keys, q = FALSE))
    @@ -42138,7 +43757,8 @@

    teal.slice coverage - 65.74%

    150 - 9x + 9x +
            more_args <- if (length(parent_keys) == 0 || length(dataset_keys) == 0) {
    @@ -42152,14 +43772,16 @@

    teal.slice coverage - 65.74%

    152 - 9x + 9x +
            } else if (identical(parent_keys, dataset_keys)) {
    153 - 7x + 7x +
              list(by = parent_keys)
    @@ -42173,7 +43795,8 @@

    teal.slice coverage - 65.74%

    155 - 2x + 2x +
              list(by = stats::setNames(parent_keys, dataset_keys))
    @@ -42194,7 +43817,8 @@

    teal.slice coverage - 65.74%

    158 - 9x + 9x +
            merge_call <- call(
    @@ -42208,49 +43832,56 @@

    teal.slice coverage - 65.74%

    160 - 9x + 9x +
              as.name(dataname),
    161 - 9x + 9x +
              as.call(
    162 - 9x + 9x +
                c(
    163 - 9x + 9x +
                  str2lang("dplyr::inner_join"),
    164 - 9x + 9x +
                  x = as.name(dataname),
    165 - 9x + 9x +
                  y = str2lang(y_arg),
    166 - 9x + 9x +
                  more_args
    @@ -42285,7 +43916,8 @@

    teal.slice coverage - 65.74%

    171 - 9x + 9x +
            filter_call <- c(filter_call, merge_call)
    @@ -42299,14 +43931,16 @@

    teal.slice coverage - 65.74%

    173 - 42x + 42x +
          logger::log_trace("DataframeFilteredDataset$get_call initializing for dataname: { private$dataname }")
    174 - 42x + 42x +
          filter_call
    @@ -42376,35 +44010,40 @@

    teal.slice coverage - 65.74%

    184 - 81x + 81x +
          shiny::isolate({
    185 - 81x + 81x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initializing, dataname: { private$dataname }")
    186 - 81x + 81x +
            checkmate::assert_class(state, "teal_slices")
    187 - 80x + 80x +
            lapply(state, function(slice) {
    188 - 97x + 97x +
              checkmate::assert_true(slice$dataname == private$dataname)
    @@ -42418,14 +44057,16 @@

    teal.slice coverage - 65.74%

    190 - 80x + 80x +
            private$get_filter_states()[[1L]]$set_filter_state(state = state)
    191 - 80x + 80x +
            invisible(NULL)
    @@ -42523,7 +44164,8 @@

    teal.slice coverage - 65.74%

    205 - 11x + 11x +
          checkmate::assert_class(state, "teal_slices")
    @@ -42537,14 +44179,16 @@

    teal.slice coverage - 65.74%

    207 - 11x + 11x +
          shiny::isolate({
    208 - 11x + 11x +
            logger::log_trace("{ class(self)[1] }$remove_filter_state removing filter(s), dataname: { private$dataname }")
    @@ -42558,14 +44202,16 @@

    teal.slice coverage - 65.74%

    210 - 11x + 11x +
            varnames <- unique(unlist(lapply(state, "[[", "varname")))
    211 - 11x + 11x +
            private$get_filter_states()[[1]]$remove_filter_state(state)
    @@ -42579,7 +44225,8 @@

    teal.slice coverage - 65.74%

    213 - 11x + 11x +
            logger::log_trace("{ class(self)[1] }$remove_filter_state removed filter(s), dataname: { private$dataname }")
    @@ -42600,7 +44247,8 @@

    teal.slice coverage - 65.74%

    216 - 11x + 11x +
          invisible(NULL)
    @@ -42775,7 +44423,8 @@

    teal.slice coverage - 65.74%

    241 - 12x + 12x +
          logger::log_trace("FilteredDataset$srv_filter_overview initialized")
    @@ -42796,14 +44445,16 @@

    teal.slice coverage - 65.74%

    244 - 12x + 12x +
          subject_keys <- if (length(private$parent_name) > 0) {
    245 - 1x + 1x +
            names(private$join_keys)
    @@ -42817,7 +44468,8 @@

    teal.slice coverage - 65.74%

    247 - 11x + 11x +
            self$get_keys()
    @@ -42831,49 +44483,56 @@

    teal.slice coverage - 65.74%

    249 - 12x + 12x +
          dataset <- self$get_dataset()
    250 - 12x + 12x +
          data_filtered <- self$get_dataset(TRUE)
    251 - 12x + 12x +
          if (length(subject_keys) == 0) {
    252 - 10x + 10x +
            data.frame(
    253 - 10x + 10x +
              dataname = private$dataname,
    254 - 10x + 10x +
              obs = nrow(dataset),
    255 - 10x + 10x +
              obs_filtered = nrow(data_filtered())
    @@ -42894,42 +44553,48 @@

    teal.slice coverage - 65.74%

    258 - 2x + 2x +
            data.frame(
    259 - 2x + 2x +
              dataname = private$dataname,
    260 - 2x + 2x +
              obs = nrow(dataset),
    261 - 2x + 2x +
              obs_filtered = nrow(data_filtered()),
    262 - 2x + 2x +
              subjects = nrow(unique(dataset[subject_keys])),
    263 - 2x + 2x +
              subjects_filtered = nrow(unique(data_filtered()[subject_keys]))
    @@ -43530,35 +45195,40 @@

    teal.slice coverage - 65.74%

    74 - 368x + 368x +
          checkmate::assert_class(x_reactive, "reactive")
    75 - 367x + 367x +
          checkmate::assert_class(slice, "teal_slice")
    76 - 365x + 365x +
          checkmate::assert_character(extract_type, max.len = 1, any.missing = FALSE)
    77 - 365x + 365x +
          if (length(extract_type) == 1) {
    78 - 53x + 53x +
            checkmate::assert_choice(extract_type, choices = c("list", "matrix"))
    @@ -43586,14 +45256,16 @@

    teal.slice coverage - 65.74%

    82 - 364x + 364x +
          private$x <- x
    83 - 364x + 364x +
          private$x_reactive <- x_reactive
    @@ -43607,21 +45279,24 @@

    teal.slice coverage - 65.74%

    85 - 364x + 364x +
          private$na_count <- sum(is.na(x))
    86 - 364x + 364x +
          private$filtered_na_count <- reactive(
    87 - 364x + 364x +
            if (!is.null(private$x_reactive())) {
    @@ -43656,7 +45331,8 @@

    teal.slice coverage - 65.74%

    92 - 364x + 364x +
          private$extract_type <- extract_type
    @@ -43677,14 +45353,16 @@

    teal.slice coverage - 65.74%

    95 - 18x + 18x +
          if (is.null(shiny::isolate(slice$keep_na)) && anyNA(x)) slice$keep_na <- TRUE
    96 - 364x + 364x +
          private$teal_slice <- slice
    @@ -43698,7 +45376,8 @@

    teal.slice coverage - 65.74%

    98 - 364x + 364x +
          varlabel <- attr(x, "label")
    @@ -43712,21 +45391,24 @@

    teal.slice coverage - 65.74%

    100 - 364x + 364x +
          private$varlabel <-
    101 - 364x + 364x +
            if (is.null(varlabel) || identical(varlabel, private$get_varname())) {
    102 - 363x + 363x +
              character(0)
    @@ -43740,7 +45422,8 @@

    teal.slice coverage - 65.74%

    104 - 1x + 1x +
              varlabel
    @@ -43761,7 +45444,8 @@

    teal.slice coverage - 65.74%

    107 - 364x + 364x +
          private$state_history <- reactiveVal(list())
    @@ -43775,7 +45459,8 @@

    teal.slice coverage - 65.74%

    109 - 364x + 364x +
          logger::log_trace("Instantiated FilterState object id: { private$get_id() }")
    @@ -43789,7 +45474,8 @@

    teal.slice coverage - 65.74%

    111 - 364x + 364x +
          invisible(self)
    @@ -43873,28 +45559,32 @@

    teal.slice coverage - 65.74%

    123 - 68x + 68x +
          sprintf(
    124 - 68x + 68x +
            "%s:\n%s",
    125 - 68x + 68x +
            class(self)[1],
    126 - 68x + 68x +
            format(self$get_state(), show_all = show_all, trim_lines = trim_lines)
    @@ -43964,7 +45654,8 @@

    teal.slice coverage - 65.74%

    136 - 14x + 14x +
          cat(shiny::isolate(self$format(...)))
    @@ -44055,21 +45746,24 @@

    teal.slice coverage - 65.74%

    149 - 89x + 89x +
          checkmate::assert_class(state, "teal_slice")
    150 - 88x + 88x +
          if (private$is_fixed()) {
    151 - 1x + 1x +
            logger::log_warn("attempt to set state on fixed filter aborted id: { private$get_id() }")
    @@ -44083,28 +45777,32 @@

    teal.slice coverage - 65.74%

    153 - 87x + 87x +
            logger::log_trace("{ class(self)[1] }$set_state setting state of filter id: { private$get_id() }")
    154 - 87x + 87x +
            shiny::isolate({
    155 - 87x + 87x +
              if (!is.null(state$selected)) {
    156 - 78x + 78x +
                private$set_selected(state$selected)
    @@ -44118,14 +45816,16 @@

    teal.slice coverage - 65.74%

    158 - 75x + 75x +
              if (!is.null(state$keep_na)) {
    159 - 16x + 16x +
                private$set_keep_na(state$keep_na)
    @@ -44139,14 +45839,16 @@

    teal.slice coverage - 65.74%

    161 - 75x + 75x +
              if (!is.null(state$keep_inf)) {
    162 - 9x + 9x +
                private$set_keep_inf(state$keep_inf)
    @@ -44160,35 +45862,40 @@

    teal.slice coverage - 65.74%

    164 - 75x + 75x +
              current_state <- sprintf(
    165 - 75x + 75x +
                "selected: %s; keep_na: %s; keep_inf: %s",
    166 - 75x + 75x +
                toString(private$get_selected()),
    167 - 75x + 75x +
                private$get_keep_na(),
    168 - 75x + 75x +
                private$get_keep_inf()
    @@ -44223,7 +45930,8 @@

    teal.slice coverage - 65.74%

    173 - 76x + 76x +
          invisible(self)
    @@ -44293,7 +46001,8 @@

    teal.slice coverage - 65.74%

    183 - 747x + 747x +
          private$teal_slice
    @@ -44363,7 +46072,8 @@

    teal.slice coverage - 65.74%

    193 - 1x + 1x +
          stop("this is a virtual method")
    @@ -44454,42 +46164,48 @@

    teal.slice coverage - 65.74%

    206 - 12x + 12x +
          moduleServer(
    207 - 12x + 12x +
            id = id,
    208 - 12x + 12x +
            function(input, output, session) {
    209 - 12x + 12x +
              logger::log_trace("FilterState$server initializing module for slice: { private$get_id() } ")
    210 - 12x + 12x +
              private$server_summary("summary")
    211 - 12x + 12x +
              if (private$is_fixed()) {
    @@ -44510,7 +46226,8 @@

    teal.slice coverage - 65.74%

    214 - 12x + 12x +
                private$server_inputs("inputs")
    @@ -44531,49 +46248,56 @@

    teal.slice coverage - 65.74%

    217 - 12x + 12x +
              private$observers$state <- observeEvent(
    218 - 12x + 12x +
                eventExpr = list(private$get_selected(), private$get_keep_na(), private$get_keep_inf()),
    219 - 12x + 12x +
                handlerExpr = {
    220 - 4x + 4x +
                  current_state <- as.list(self$get_state())
    221 - 4x + 4x +
                  history <- private$state_history()
    222 - 4x + 4x +
                  history_update <- c(history, list(current_state))
    223 - 4x + 4x +
                  private$state_history(history_update)
    @@ -44601,21 +46325,24 @@

    teal.slice coverage - 65.74%

    227 - 12x + 12x +
              private$observers$back <- observeEvent(
    228 - 12x + 12x +
                eventExpr = input$back,
    229 - 12x + 12x +
                handlerExpr = {
    @@ -44678,21 +46405,24 @@

    teal.slice coverage - 65.74%

    238 - 12x + 12x +
              private$observers$reset <- observeEvent(
    239 - 12x + 12x +
                eventExpr = input$reset,
    240 - 12x + 12x +
                handlerExpr = {
    @@ -44748,56 +46478,64 @@

    teal.slice coverage - 65.74%

    248 - 12x + 12x +
              private$observers$state_history <- observeEvent(
    249 - 12x + 12x +
                eventExpr = private$state_history(),
    250 - 12x + 12x +
                handlerExpr = {
    251 - 4x + 4x +
                  shinyjs::disable(id = "back")
    252 - 4x + 4x +
                  shinyjs::disable(id = "reset")
    253 - 4x + 4x +
                  shinyjs::delay(
    254 - 4x + 4x +
                    ms = 100,
    255 - 4x + 4x +
                    expr = {
    @@ -44832,21 +46570,24 @@

    teal.slice coverage - 65.74%

    260 - 4x + 4x +
                  shinyjs::delay(
    261 - 4x + 4x +
                    ms = 100,
    262 - 4x + 4x +
                    expr = {
    @@ -44902,14 +46643,16 @@

    teal.slice coverage - 65.74%

    270 - 12x + 12x +
              private$destroy_shiny <- function() {
    271 - 8x + 8x +
                logger::log_trace("Destroying FilterState inputs and observers; id: { private$get_id() }")
    @@ -44923,7 +46666,8 @@

    teal.slice coverage - 65.74%

    273 - 8x + 8x +
                lapply(session$ns(names(input)), .subset2(input, "impl")$.values$remove)
    @@ -44944,7 +46688,8 @@

    teal.slice coverage - 65.74%

    276 - 8x + 8x +
                lapply(private$observers, function(x) x$destroy())
    @@ -44965,7 +46710,8 @@

    teal.slice coverage - 65.74%

    279 - 12x + 12x +
              reactive(input$remove)
    @@ -45056,7 +46802,8 @@

    teal.slice coverage - 65.74%

    292 - 12x + 12x +
          ns <- NS(id)
    @@ -45112,84 +46859,96 @@

    teal.slice coverage - 65.74%

    300 - 12x + 12x +
          div(
    301 - 12x + 12x +
            id = id,
    302 - 12x + 12x +
            class = "panel filter-card",
    303 - 12x + 12x +
            include_js_files("count-bar-labels.js"),
    304 - 12x + 12x +
            div(
    305 - 12x + 12x +
              class = "filter-card-header",
    306 - 12x + 12x +
              `data-toggle` = "collapse",
    307 - 12x + 12x +
              `data-bs-toggle` = "collapse",
    308 - 12x + 12x +
              href = paste0("#", ns("body")),
    309 - 12x + 12x +
              div(
    310 - 12x + 12x +
                class = "filter-card-title",
    311 - 12x + 12x +
                if (private$is_anchored() && private$is_fixed()) {
    @@ -45203,7 +46962,8 @@

    teal.slice coverage - 65.74%

    313 - 12x + 12x +
                } else if (private$is_anchored() && !private$is_fixed()) {
    @@ -45217,7 +46977,8 @@

    teal.slice coverage - 65.74%

    315 - 12x + 12x +
                } else if (!private$is_anchored() && private$is_fixed()) {
    @@ -45238,28 +46999,32 @@

    teal.slice coverage - 65.74%

    318 - 12x + 12x +
                div(class = "filter-card-varname", strong(private$get_varname())),
    319 - 12x + 12x +
                div(class = "filter-card-varlabel", private$get_varlabel()),
    320 - 12x + 12x +
                div(
    321 - 12x + 12x +
                  class = "filter-card-controls",
    @@ -45280,7 +47045,8 @@

    teal.slice coverage - 65.74%

    324 - 12x + 12x +
                  onclick = "event.stopPropagation();event.preventDefault();",
    @@ -45294,70 +47060,80 @@

    teal.slice coverage - 65.74%

    326 - 12x + 12x +
                  `data-bs-toggle` = "collapse",
    327 - 12x + 12x +
                  `data-bs-target` = NULL,
    328 - 12x + 12x +
                  if (isFALSE(private$is_fixed())) {
    329 - 12x + 12x +
                    actionLink(
    330 - 12x + 12x +
                      inputId = ns("back"),
    331 - 12x + 12x +
                      label = NULL,
    332 - 12x + 12x +
                      icon = icon("circle-arrow-left", lib = "font-awesome"),
    333 - 12x + 12x +
                      title = "Rewind state",
    334 - 12x + 12x +
                      class = "filter-card-back",
    335 - 12x + 12x +
                      style = "display: none"
    @@ -45378,56 +47154,64 @@

    teal.slice coverage - 65.74%

    338 - 12x + 12x +
                  if (isFALSE(private$is_fixed())) {
    339 - 12x + 12x +
                    actionLink(
    340 - 12x + 12x +
                      inputId = ns("reset"),
    341 - 12x + 12x +
                      label = NULL,
    342 - 12x + 12x +
                      icon = icon("circle-arrow-up", lib = "font-awesome"),
    343 - 12x + 12x +
                      title = "Restore original state",
    344 - 12x + 12x +
                      class = "filter-card-back",
    345 - 12x + 12x +
                      style = "display: none"
    @@ -45448,42 +47232,48 @@

    teal.slice coverage - 65.74%

    348 - 12x + 12x +
                  if (isFALSE(private$is_anchored())) {
    349 - 12x + 12x +
                    actionLink(
    350 - 12x + 12x +
                      inputId = ns("remove"),
    351 - 12x + 12x +
                      label = icon("circle-xmark", lib = "font-awesome"),
    352 - 12x + 12x +
                      title = "Remove filter",
    353 - 12x + 12x +
                      class = "filter-card-remove"
    @@ -45518,7 +47308,8 @@

    teal.slice coverage - 65.74%

    358 - 12x + 12x +
              div(class = "filter-card-summary", private$ui_summary(ns("summary")))
    @@ -45532,56 +47323,64 @@

    teal.slice coverage - 65.74%

    360 - 12x + 12x +
            div(
    361 - 12x + 12x +
              id = ns("body"),
    362 - 12x + 12x +
              class = "collapse out",
    363 - 12x + 12x +
              `data-parent` = paste0("#", parent_id),
    364 - 12x + 12x +
              `data-bs-parent` = paste0("#", parent_id),
    365 - 12x + 12x +
              div(
    366 - 12x + 12x +
                class = "filter-card-body",
    367 - 12x + 12x +
                if (private$is_fixed()) {
    @@ -45602,7 +47401,8 @@

    teal.slice coverage - 65.74%

    370 - 12x + 12x +
                  private$ui_inputs(ns("inputs"))
    @@ -45693,14 +47493,16 @@

    teal.slice coverage - 65.74%

    383 - 47x + 47x +
          if (!is.null(private$destroy_shiny)) {
    384 - 8x + 8x +
            private$destroy_shiny()
    @@ -45994,35 +47796,40 @@

    teal.slice coverage - 65.74%

    426 - 420x + 420x +
          logger::log_trace(
    427 - 420x + 420x +
            sprintf(
    428 - 420x + 420x +
              "%s$set_selected setting selection of id: %s",
    429 - 420x + 420x +
              class(self)[1],
    430 - 420x + 420x +
              private$get_id()
    @@ -46043,35 +47850,40 @@

    teal.slice coverage - 65.74%

    433 - 420x + 420x +
          shiny::isolate({
    434 - 420x + 420x +
            value <- private$cast_and_validate(value)
    435 - 409x + 409x +
            value <- private$check_length(value)
    436 - 403x + 403x +
            value <- private$remove_out_of_bounds_values(value)
    437 - 403x + 403x +
            private$teal_slice$selected <- value
    @@ -46085,35 +47897,40 @@

    teal.slice coverage - 65.74%

    439 - 403x + 403x +
          logger::log_trace(
    440 - 403x + 403x +
            sprintf(
    441 - 403x + 403x +
              "%s$set_selected selection of id: %s",
    442 - 403x + 403x +
              class(self)[1],
    443 - 403x + 403x +
              private$get_id()
    @@ -46141,7 +47958,8 @@

    teal.slice coverage - 65.74%

    447 - 403x + 403x +
          invisible(NULL)
    @@ -46239,56 +48057,64 @@

    teal.slice coverage - 65.74%

    461 - 16x + 16x +
          checkmate::assert_flag(value)
    462 - 16x + 16x +
          private$teal_slice$keep_na <- value
    463 - 16x + 16x +
          logger::log_trace(
    464 - 16x + 16x +
            sprintf(
    465 - 16x + 16x +
              "%s$set_keep_na set for filter %s to %s.",
    466 - 16x + 16x +
              class(self)[1],
    467 - 16x + 16x +
              private$get_id(),
    468 - 16x + 16x +
              value
    @@ -46309,7 +48135,8 @@

    teal.slice coverage - 65.74%

    471 - 16x + 16x +
          invisible(NULL)
    @@ -46393,56 +48220,64 @@

    teal.slice coverage - 65.74%

    483 - 9x + 9x +
          checkmate::assert_flag(value)
    484 - 9x + 9x +
          private$teal_slice$keep_inf <- value
    485 - 9x + 9x +
          logger::log_trace(
    486 - 9x + 9x +
            sprintf(
    487 - 9x + 9x +
              "%s$set_keep_inf of filter %s set to %s",
    488 - 9x + 9x +
              class(self)[1],
    489 - 9x + 9x +
              private$get_id(),
    490 - 9x + 9x +
              value
    @@ -46470,7 +48305,8 @@

    teal.slice coverage - 65.74%

    494 - 9x + 9x +
          invisible(NULL)
    @@ -46533,7 +48369,8 @@

    teal.slice coverage - 65.74%

    503 - 87x + 87x +
          shiny::isolate(private$teal_slice$dataname)
    @@ -46582,7 +48419,8 @@

    teal.slice coverage - 65.74%

    510 - 165x + 165x +
          shiny::isolate(private$teal_slice$varname)
    @@ -46631,7 +48469,8 @@

    teal.slice coverage - 65.74%

    517 - 4x + 4x +
          shiny::isolate(private$teal_slice$id)
    @@ -46680,7 +48519,8 @@

    teal.slice coverage - 65.74%

    524 - 882x + 882x +
          shiny::isolate(private$teal_slice$choices)
    @@ -46729,7 +48569,8 @@

    teal.slice coverage - 65.74%

    531 - 363x + 363x +
          private$teal_slice$selected
    @@ -46778,7 +48619,8 @@

    teal.slice coverage - 65.74%

    538 - 129x + 129x +
          private$teal_slice$keep_na
    @@ -46827,7 +48669,8 @@

    teal.slice coverage - 65.74%

    545 - 117x + 117x +
          private$teal_slice$keep_inf
    @@ -46869,7 +48712,8 @@

    teal.slice coverage - 65.74%

    551 - 148x + 148x +
          shiny::isolate(isTRUE(private$teal_slice$fixed))
    @@ -46911,7 +48755,8 @@

    teal.slice coverage - 65.74%

    557 - 48x + 48x +
          shiny::isolate(isTRUE(private$teal_slice$anchored))
    @@ -46953,7 +48798,8 @@

    teal.slice coverage - 65.74%

    563 - 217x + 217x +
          shiny::isolate(isTRUE(private$teal_slice$multiple))
    @@ -47016,7 +48862,8 @@

    teal.slice coverage - 65.74%

    572 - 12x + 12x +
          private$varlabel
    @@ -47079,49 +48926,56 @@

    teal.slice coverage - 65.74%

    581 - 108x + 108x +
          varname <- private$get_varname()
    582 - 108x + 108x +
          varname_backticked <- sprintf("`%s`", varname)
    583 - 108x + 108x +
          ans <-
    584 - 108x + 108x +
            if (isTRUE(private$extract_type == "list")) {
    585 - 16x + 16x +
              sprintf("%s$%s", dataname, varname_backticked)
    586 - 108x + 108x +
            } else if (isTRUE(private$extract_type == "matrix")) {
    587 - 7x + 7x +
              sprintf("%s[, \"%s\"]", dataname, varname)
    @@ -47135,7 +48989,8 @@

    teal.slice coverage - 65.74%

    589 - 85x + 85x +
              varname_backticked
    @@ -47149,7 +49004,8 @@

    teal.slice coverage - 65.74%

    591 - 108x + 108x +
          str2lang(ans)
    @@ -47233,14 +49089,16 @@

    teal.slice coverage - 65.74%

    603 - 107x + 107x +
          if (private$na_count == 0L) {
    604 - 86x + 86x +
            return(filter_call)
    @@ -47261,42 +49119,48 @@

    teal.slice coverage - 65.74%

    607 - 21x + 21x +
          if (is.null(filter_call) && isFALSE(private$get_keep_na())) {
    608 - 2x + 2x +
            call("!", call("is.na", varname))
    609 - 19x + 19x +
          } else if (!is.null(filter_call) && isTRUE(private$get_keep_na())) {
    610 - 12x + 12x +
            call("|", call("is.na", varname), filter_call)
    611 - 7x + 7x +
          } else if (!is.null(filter_call) && isFALSE(private$get_keep_na())) {
    612 - 7x + 7x +
            call("&", call("!", call("is.na", varname)), filter_call)
    @@ -47373,7 +49237,8 @@

    teal.slice coverage - 65.74%

    623 - 11x + 11x +
          values
    @@ -47408,7 +49273,8 @@

    teal.slice coverage - 65.74%

    628 - 11x + 11x +
          values
    @@ -47471,7 +49337,8 @@

    teal.slice coverage - 65.74%

    637 - 31x + 31x +
          values
    @@ -47569,42 +49436,48 @@

    teal.slice coverage - 65.74%

    651 - 74x + 74x +
          if (private$is_choice_limited) {
    652 - 3x + 3x +
            TRUE
    653 - 71x + 71x +
          } else if (!setequal(private$get_selected(), private$get_choices())) {
    654 - 58x + 58x +
            TRUE
    655 - 13x + 13x +
          } else if (!isTRUE(private$get_keep_na()) && private$na_count > 0) {
    656 - 4x + 4x +
            TRUE
    @@ -47618,7 +49491,8 @@

    teal.slice coverage - 65.74%

    658 - 9x + 9x +
            FALSE
    @@ -47688,14 +49562,16 @@

    teal.slice coverage - 65.74%

    668 - 12x + 12x +
          ns <- NS(id)
    669 - 12x + 12x +
          uiOutput(ns("summary"), class = "filter-card-summary")
    @@ -47751,28 +49627,32 @@

    teal.slice coverage - 65.74%

    677 - 12x + 12x +
          moduleServer(
    678 - 12x + 12x +
            id = id,
    679 - 12x + 12x +
            function(input, output, session) {
    680 - 12x + 12x +
              output$summary <- renderUI(private$content_summary())
    @@ -48059,14 +49939,16 @@

    teal.slice coverage - 65.74%

    721 - 12x + 12x +
          ns <- NS(id)
    722 - 12x + 12x +
          if (private$na_count > 0) {
    @@ -48220,7 +50102,8 @@

    teal.slice coverage - 65.74%

    744 - 12x + 12x +
            NULL
    @@ -48297,7 +50180,8 @@

    teal.slice coverage - 65.74%

    755 - 12x + 12x +
          moduleServer(id, function(input, output, session) {
    @@ -48325,42 +50209,48 @@

    teal.slice coverage - 65.74%

    759 - 12x + 12x +
            output$trigger_visible <- renderUI({
    760 - 12x + 12x +
              updateCountText(
    761 - 12x + 12x +
                inputId = "count_label",
    762 - 12x + 12x +
                label = "Keep NA",
    763 - 12x + 12x +
                countmax = private$na_count,
    764 - 12x + 12x +
                countnow = private$filtered_na_count()
    @@ -48374,7 +50264,8 @@

    teal.slice coverage - 65.74%

    766 - 12x + 12x +
              NULL
    @@ -48416,35 +50307,40 @@

    teal.slice coverage - 65.74%

    772 - 12x + 12x +
            private$observers$keep_na_api <- observeEvent(
    773 - 12x + 12x +
              ignoreNULL = FALSE, # nothing selected is possible for NA
    774 - 12x + 12x +
              ignoreInit = TRUE, # ignoreInit: should not matter because we set the UI with the desired initial state
    775 - 12x + 12x +
              eventExpr = private$get_keep_na(),
    776 - 12x + 12x +
              handlerExpr = {
    @@ -48521,35 +50417,40 @@

    teal.slice coverage - 65.74%

    787 - 12x + 12x +
            private$observers$keep_na <- observeEvent(
    788 - 12x + 12x +
              ignoreNULL = FALSE, # ignoreNULL: we don't want to ignore NULL when nothing is selected in the `selectInput`
    789 - 12x + 12x +
              ignoreInit = TRUE, # ignoreInit: should not matter because we set the UI with the desired initial state
    790 - 12x + 12x +
              eventExpr = input$value,
    791 - 12x + 12x +
              handlerExpr = {
    @@ -48619,7 +50520,8 @@

    teal.slice coverage - 65.74%

    801 - 12x + 12x +
            invisible(NULL)
    @@ -49094,7 +50996,8 @@

    teal.slice coverage - 65.74%

    63 - 229x + 229x +
      UseMethod("init_filter_states")
    @@ -49171,42 +51074,48 @@

    teal.slice coverage - 65.74%

    74 - 100x + 100x +
      DFFilterStates$new(
    75 - 100x + 100x +
        data = data,
    76 - 100x + 100x +
        data_reactive = data_reactive,
    77 - 100x + 100x +
        dataname = dataname,
    78 - 100x + 100x +
        datalabel = datalabel,
    79 - 100x + 100x +
        keys = keys
    @@ -49283,35 +51192,40 @@

    teal.slice coverage - 65.74%

    90 - 22x + 22x +
      MatrixFilterStates$new(
    91 - 22x + 22x +
        data = data,
    92 - 22x + 22x +
        data_reactive = data_reactive,
    93 - 22x + 22x +
        dataname = dataname,
    94 - 22x + 22x +
        datalabel = datalabel
    @@ -49395,7 +51309,8 @@

    teal.slice coverage - 65.74%

    106 - 22x + 22x +
      if (!requireNamespace("MultiAssayExperiment", quietly = TRUE)) {
    @@ -49416,42 +51331,48 @@

    teal.slice coverage - 65.74%

    109 - 22x + 22x +
      MAEFilterStates$new(
    110 - 22x + 22x +
        data = data,
    111 - 22x + 22x +
        data_reactive = data_reactive,
    112 - 22x + 22x +
        dataname = dataname,
    113 - 22x + 22x +
        datalabel = datalabel,
    114 - 22x + 22x +
        keys = keys
    @@ -49528,7 +51449,8 @@

    teal.slice coverage - 65.74%

    125 - 85x + 85x +
      if (!requireNamespace("SummarizedExperiment", quietly = TRUE)) {
    @@ -49549,35 +51471,40 @@

    teal.slice coverage - 65.74%

    128 - 85x + 85x +
      SEFilterStates$new(
    129 - 85x + 85x +
        data = data,
    130 - 85x + 85x +
        data_reactive = data_reactive,
    131 - 85x + 85x +
        dataname = dataname,
    132 - 85x + 85x +
        datalabel = datalabel
    @@ -49752,7 +51679,8 @@

    teal.slice coverage - 65.74%

    157 - 227x + 227x +
      UseMethod("get_supported_filter_varnames")
    @@ -49794,28 +51722,32 @@

    teal.slice coverage - 65.74%

    163 - 198x + 198x +
      is_expected_class <- vapply(
    164 - 198x + 198x +
        X = data,
    165 - 198x + 198x +
        FUN = function(x) any(class(x) %in% .filterable_class),
    166 - 198x + 198x +
        FUN.VALUE = logical(1)
    @@ -49829,7 +51761,8 @@

    teal.slice coverage - 65.74%

    168 - 198x + 198x +
      names(is_expected_class[is_expected_class])
    @@ -49878,21 +51811,24 @@

    teal.slice coverage - 65.74%

    175 - 29x + 29x +
      is_expected_class <- class(data[, 1]) %in% .filterable_class
    176 - 29x + 29x +
      if (is_expected_class && !is.null(colnames(data))) {
    177 - 26x + 26x +
        colnames(data)
    @@ -49906,7 +51842,8 @@

    teal.slice coverage - 65.74%

    179 - 3x + 3x +
        character(0)
    @@ -50144,7 +52081,8 @@

    teal.slice coverage - 65.74%

    213 - 9x + 9x +
      if (length(choices) == 0) {
    @@ -50165,14 +52103,16 @@

    teal.slice coverage - 65.74%

    216 - 9x + 9x +
      choice_types <- stats::setNames(variable_types(data = data, columns = choices), choices)
    217 - 9x + 9x +
      choice_types[keys] <- "primary_key"
    @@ -50186,28 +52126,32 @@

    teal.slice coverage - 65.74%

    219 - 9x + 9x +
      choices_labeled(
    220 - 9x + 9x +
        choices = choices,
    221 - 9x + 9x +
        labels = unname(varlabels[choices]),
    222 - 9x + 9x +
        types = choice_types[choices]
    @@ -50242,49 +52186,56 @@

    teal.slice coverage - 65.74%

    227 - 9x + 9x +
      if (!is.array(data)) {
    228 - 9x + 9x +
        vapply(
    229 - 9x + 9x +
          colnames(data),
    230 - 9x + 9x +
          FUN = function(x) {
    231 - 42x + 42x +
            label <- attr(data[[x]], "label")
    232 - 42x + 42x +
            if (is.null(label)) {
    233 - 40x + 40x +
              x
    @@ -50298,7 +52249,8 @@

    teal.slice coverage - 65.74%

    235 - 2x + 2x +
              label
    @@ -50319,7 +52271,8 @@

    teal.slice coverage - 65.74%

    238 - 9x + 9x +
          FUN.VALUE = character(1)
    @@ -50857,21 +52810,24 @@

    teal.slice coverage - 65.74%

    71 - 15x + 15x +
          checkmate::assert_class(slice, "teal_slice_expr")
    72 - 14x + 14x +
          private$teal_slice <- slice
    73 - 14x + 14x +
          invisible(self)
    @@ -50955,28 +52911,32 @@

    teal.slice coverage - 65.74%

    85 - 12x + 12x +
          sprintf(
    86 - 12x + 12x +
            "%s:\n%s",
    87 - 12x + 12x +
            class(self)[1],
    88 - 12x + 12x +
            format(self$get_state(), show_all = show_all, trim_lines = trim_lines)
    @@ -51039,7 +52999,8 @@

    teal.slice coverage - 65.74%

    97 - 1x + 1x +
          cat(shiny::isolate(self$format(...)))
    @@ -51102,7 +53063,8 @@

    teal.slice coverage - 65.74%

    106 - 26x + 26x +
          private$teal_slice
    @@ -51179,14 +53141,16 @@

    teal.slice coverage - 65.74%

    117 - 1x + 1x +
          checkmate::assert_class(state, "teal_slice_expr")
    118 - 1x + 1x +
          invisible(self)
    @@ -51284,7 +53248,8 @@

    teal.slice coverage - 65.74%

    132 - 2x + 2x +
          shiny::isolate(str2lang(private$teal_slice$expr))
    @@ -53124,28 +55089,32 @@

    teal.slice coverage - 65.74%

    126 - 16x + 16x +
          shiny::isolate({
    127 - 16x + 16x +
            checkmate::assert_logical(x)
    128 - 15x + 15x +
            checkmate::assert_logical(slice$selected, null.ok = TRUE)
    129 - 14x + 14x +
            super$initialize(x = x, x_reactive = x_reactive, slice = slice, extract_type = extract_type)
    @@ -53159,7 +55128,8 @@

    teal.slice coverage - 65.74%

    131 - 14x + 14x +
            private$set_choices(slice$choices)
    @@ -53173,28 +55143,32 @@

    teal.slice coverage - 65.74%

    133 - 14x + 14x +
            if (is.null(slice$selected) && slice$multiple) {
    134 - 7x + 7x +
              slice$selected <- private$get_choices()
    135 - 7x + 7x +
            } else if (length(slice$selected) != 1 && !slice$multiple) {
    136 - 3x + 3x +
              slice$selected <- TRUE
    @@ -53208,28 +55182,32 @@

    teal.slice coverage - 65.74%

    138 - 14x + 14x +
            private$set_selected(slice$selected)
    139 - 14x + 14x +
            df <- factor(x, levels = c(TRUE, FALSE))
    140 - 14x + 14x +
            tbl <- table(df)
    141 - 14x + 14x +
            private$set_choices_counts(tbl)
    @@ -53243,7 +55221,8 @@

    teal.slice coverage - 65.74%

    143 - 14x + 14x +
          invisible(self)
    @@ -53320,7 +55299,8 @@

    teal.slice coverage - 65.74%

    154 - 6x + 6x +
          if (isFALSE(private$is_any_filtered())) {
    @@ -53341,28 +55321,32 @@

    teal.slice coverage - 65.74%

    157 - 4x + 4x +
          if (missing(dataname)) dataname <- private$get_dataname()
    158 - 6x + 6x +
          varname <- private$get_varname_prefixed(dataname)
    159 - 6x + 6x +
          choices <- private$get_selected()
    160 - 6x + 6x +
          n_choices <- length(choices)
    @@ -53376,35 +55360,40 @@

    teal.slice coverage - 65.74%

    162 - 6x + 6x +
          filter_call <-
    163 - 6x + 6x +
            if (n_choices == 1 && choices) {
    164 - 1x + 1x +
              varname
    165 - 6x + 6x +
            } else if (n_choices == 1 && !choices) {
    166 - 4x + 4x +
              call("!", varname)
    @@ -53418,7 +55407,8 @@

    teal.slice coverage - 65.74%

    168 - 1x + 1x +
              call("%in%", varname, make_c_call(choices))
    @@ -53432,7 +55422,8 @@

    teal.slice coverage - 65.74%

    170 - 6x + 6x +
          private$add_keep_na_call(filter_call, varname)
    @@ -53502,14 +55493,16 @@

    teal.slice coverage - 65.74%

    180 - 14x + 14x +
          private$teal_slice$choices <- c(TRUE, FALSE)
    181 - 14x + 14x +
          invisible(NULL)
    @@ -53544,14 +55537,16 @@

    teal.slice coverage - 65.74%

    186 - 14x + 14x +
          private$choices_counts <- choices_counts
    187 - 14x + 14x +
          invisible(NULL)
    @@ -53572,35 +55567,40 @@

    teal.slice coverage - 65.74%

    190 - 21x + 21x +
          tryCatch(
    191 - 21x + 21x +
            expr = {
    192 - 21x + 21x +
              values <- as.logical(values)
    193 - 1x + 1x +
              if (anyNA(values)) stop()
    194 - 20x + 20x +
              values
    @@ -53614,7 +55614,8 @@

    teal.slice coverage - 65.74%

    196 - 21x + 21x +
            error = function(e) stop("Vector of set values must contain values coercible to logical.")
    @@ -53649,28 +55650,32 @@

    teal.slice coverage - 65.74%

    201 - 20x + 20x +
          if (!private$is_multiple() && length(values) > 1) {
    202 - 1x + 1x +
            warning(
    203 - 1x + 1x +
              sprintf("Selection: %s is not a vector of length one. ", toString(values, width = 360)),
    204 - 1x + 1x +
              "Maintaining previous selection."
    @@ -53684,7 +55689,8 @@

    teal.slice coverage - 65.74%

    206 - 1x + 1x +
            values <- shiny::isolate(private$get_selected())
    @@ -53698,7 +55704,8 @@

    teal.slice coverage - 65.74%

    208 - 20x + 20x +
          values
    @@ -53740,7 +55747,8 @@

    teal.slice coverage - 65.74%

    214 - 6x + 6x +
          if (private$is_choice_limited) {
    @@ -53754,14 +55762,16 @@

    teal.slice coverage - 65.74%

    216 - 6x + 6x +
          } else if (all(private$choices_counts > 0)) {
    217 - 6x + 6x +
            TRUE
    @@ -55510,42 +57520,48 @@

    teal.slice coverage - 65.74%

    57 - 6x + 6x +
          shiny::isolate({
    58 - 6x + 6x +
            super$initialize(
    59 - 6x + 6x +
              x = x,
    60 - 6x + 6x +
              x_reactive = x_reactive,
    61 - 6x + 6x +
              slice = slice,
    62 - 6x + 6x +
              extract_type = extract_type
    @@ -55559,14 +57575,16 @@

    teal.slice coverage - 65.74%

    64 - 6x + 6x +
            private$set_choices(slice$choices)
    65 - 6x + 6x +
            private$set_selected(slice$selected)
    @@ -55587,7 +57605,8 @@

    teal.slice coverage - 65.74%

    68 - 6x + 6x +
          invisible(self)
    @@ -55671,14 +57690,16 @@

    teal.slice coverage - 65.74%

    80 - 2x + 2x +
          if (isFALSE(private$is_any_filtered())) {
    81 - 1x + 1x +
            return(NULL)
    @@ -55692,14 +57713,16 @@

    teal.slice coverage - 65.74%

    83 - 1x + 1x +
          if (missing(dataname)) dataname <- private$get_dataname()
    84 - 1x + 1x +
          filter_call <- if (isTRUE(private$get_keep_na())) {
    @@ -55720,7 +57743,8 @@

    teal.slice coverage - 65.74%

    87 - 1x + 1x +
            substitute(!is.na(varname), list(varname = private$get_varname_prefixed(dataname)))
    @@ -55832,14 +57856,16 @@

    teal.slice coverage - 65.74%

    103 - 6x + 6x +
          private$teal_slice$choices <- choices
    104 - 6x + 6x +
          invisible(NULL)
    @@ -55902,7 +57928,8 @@

    teal.slice coverage - 65.74%

    113 - 2x + 2x +
          if (private$is_choice_limited) {
    @@ -55923,7 +57950,8 @@

    teal.slice coverage - 65.74%

    116 - 2x + 2x +
            !isTRUE(private$get_keep_na())
    @@ -57371,21 +59399,24 @@

    teal.slice coverage - 65.74%

    150 - 25x + 25x +
          shiny::isolate({
    151 - 25x + 25x +
            checkmate::assert_multi_class(x, c("POSIXct", "POSIXlt"))
    152 - 24x + 24x +
            checkmate::assert_class(x_reactive, "reactive")
    @@ -57399,35 +59430,40 @@

    teal.slice coverage - 65.74%

    154 - 24x + 24x +
            super$initialize(
    155 - 24x + 24x +
              x = x,
    156 - 24x + 24x +
              x_reactive = x_reactive,
    157 - 24x + 24x +
              slice = slice,
    158 - 24x + 24x +
              extract_type = extract_type
    @@ -57441,28 +59477,32 @@

    teal.slice coverage - 65.74%

    160 - 24x + 24x +
            checkmate::assert_multi_class(slice$choices, c("POSIXct", "POSIXlt"), null.ok = TRUE)
    161 - 23x + 23x +
            private$set_choices(slice$choices)
    162 - 15x + 15x +
            if (is.null(slice$selected)) slice$selected <- slice$choices
    163 - 23x + 23x +
            private$set_selected(slice$selected)
    @@ -57483,7 +59523,8 @@

    teal.slice coverage - 65.74%

    166 - 22x + 22x +
          invisible(self)
    @@ -57567,14 +59608,16 @@

    teal.slice coverage - 65.74%

    178 - 7x + 7x +
          if (isFALSE(private$is_any_filtered())) {
    179 - 1x + 1x +
            return(NULL)
    @@ -57588,63 +59631,72 @@

    teal.slice coverage - 65.74%

    181 - 4x + 4x +
          if (missing(dataname)) dataname <- private$get_dataname()
    182 - 6x + 6x +
          varname <- private$get_varname_prefixed(dataname)
    183 - 6x + 6x +
          choices <- private$get_selected()
    184 - 6x + 6x +
          tzone <- Find(function(x) x != "", attr(as.POSIXlt(choices), "tzone"))
    185 - 6x + 6x +
          class <- class(choices)[1L]
    186 - 6x + 6x +
          date_fun <- as.name(
    187 - 6x + 6x +
            switch(class,
    188 - 6x + 6x +
              "POSIXct" = "as.POSIXct",
    189 - 6x + 6x +
              "POSIXlt" = "as.POSIXlt"
    @@ -57665,21 +59717,24 @@

    teal.slice coverage - 65.74%

    192 - 6x + 6x +
          choices <- as.character(choices + c(0, 1))
    193 - 6x + 6x +
          filter_call <-
    194 - 6x + 6x +
            call(
    @@ -57693,7 +59748,8 @@

    teal.slice coverage - 65.74%

    196 - 6x + 6x +
              call(
    @@ -57707,14 +59763,16 @@

    teal.slice coverage - 65.74%

    198 - 6x + 6x +
                varname,
    199 - 6x + 6x +
                as.call(list(date_fun, choices[1L], tz = tzone))
    @@ -57728,7 +59786,8 @@

    teal.slice coverage - 65.74%

    201 - 6x + 6x +
              call(
    @@ -57742,14 +59801,16 @@

    teal.slice coverage - 65.74%

    203 - 6x + 6x +
                varname,
    204 - 6x + 6x +
                as.call(list(date_fun, choices[2L], tz = tzone))
    @@ -57770,7 +59831,8 @@

    teal.slice coverage - 65.74%

    207 - 6x + 6x +
          private$add_keep_na_call(filter_call, varname)
    @@ -57833,14 +59895,16 @@

    teal.slice coverage - 65.74%

    216 - 23x + 23x +
          if (is.null(choices)) {
    217 - 20x + 20x +
            choices <- as.POSIXct(trunc(range(private$x, na.rm = TRUE), units = "secs"))
    @@ -57854,28 +59918,32 @@

    teal.slice coverage - 65.74%

    219 - 3x + 3x +
            choices <- as.POSIXct(choices, units = "secs")
    220 - 3x + 3x +
            choices_adjusted <- c(
    221 - 3x + 3x +
              max(choices[1L], min(as.POSIXct(private$x), na.rm = TRUE)),
    222 - 3x + 3x +
              min(choices[2L], max(as.POSIXct(private$x), na.rm = TRUE))
    @@ -57889,28 +59957,32 @@

    teal.slice coverage - 65.74%

    224 - 3x + 3x +
            if (any(choices != choices_adjusted)) {
    225 - 1x + 1x +
              warning(sprintf(
    226 - 1x + 1x +
                "Choices adjusted (some values outside of variable range). Varname: %s, dataname: %s.",
    227 - 1x + 1x +
                private$get_varname(), private$get_dataname()
    @@ -57924,7 +59996,8 @@

    teal.slice coverage - 65.74%

    229 - 1x + 1x +
              choices <- choices_adjusted
    @@ -57938,35 +60011,40 @@

    teal.slice coverage - 65.74%

    231 - 3x + 3x +
            if (choices[1L] >= choices[2L]) {
    232 - 1x + 1x +
              warning(sprintf(
    233 - 1x + 1x +
                "Invalid choices: lower is higher / equal to upper, or not in range of variable values.
    234 - 1x + 1x +
                Setting defaults. Varname: %s, dataname: %s.",
    235 - 1x + 1x +
                private$get_varname(), private$get_dataname()
    @@ -57980,7 +60058,8 @@

    teal.slice coverage - 65.74%

    237 - 1x + 1x +
              choices <- range(private$x, na.rm = TRUE)
    @@ -58008,14 +60087,16 @@

    teal.slice coverage - 65.74%

    241 - 23x + 23x +
          private$set_is_choice_limited(private$x, choices)
    242 - 23x + 23x +
          private$x <- private$x[
    @@ -58029,21 +60110,24 @@

    teal.slice coverage - 65.74%

    244 - 23x + 23x +
              as.POSIXct(trunc(private$x, units = "secs")) >= choices[1L] &
    245 - 23x + 23x +
                as.POSIXct(trunc(private$x, units = "secs")) <= choices[2L]
    246 - 23x + 23x +
            ) | is.na(private$x)
    @@ -58057,14 +60141,16 @@

    teal.slice coverage - 65.74%

    248 - 23x + 23x +
          private$teal_slice$choices <- choices
    249 - 23x + 23x +
          invisible(NULL)
    @@ -58106,14 +60192,16 @@

    teal.slice coverage - 65.74%

    255 - 23x + 23x +
          private$is_choice_limited <- (any(xl < choices[1L], na.rm = TRUE) | any(xl > choices[2L], na.rm = TRUE))
    256 - 23x + 23x +
          invisible(NULL)
    @@ -58134,21 +60222,24 @@

    teal.slice coverage - 65.74%

    259 - 34x + 34x +
          tryCatch(
    260 - 34x + 34x +
            expr = {
    261 - 34x + 34x +
              values <- as.POSIXct(values, origin = "1970-01-01 00:00:00")
    @@ -58162,7 +60253,8 @@

    teal.slice coverage - 65.74%

    263 - 31x + 31x +
              values
    @@ -58176,7 +60268,8 @@

    teal.slice coverage - 65.74%

    265 - 34x + 34x +
            error = function(e) stop("Vector of set values must contain values coercible to POSIX.")
    @@ -58204,42 +60297,48 @@

    teal.slice coverage - 65.74%

    269 - 1x + 1x +
          if (length(values) != 2) stop("Vector of set values must have length two.")
    270 - 30x + 30x +
          if (values[1] > values[2]) {
    271 - 1x + 1x +
            warning(
    272 - 1x + 1x +
              sprintf(
    273 - 1x + 1x +
                "Start date '%s' is set after the end date '%s', the values will be replaced by a default datetime range.",
    274 - 1x + 1x +
                values[1], values[2]
    @@ -58260,7 +60359,8 @@

    teal.slice coverage - 65.74%

    277 - 1x + 1x +
            values <- isolate(private$get_choices())
    @@ -58274,7 +60374,8 @@

    teal.slice coverage - 65.74%

    279 - 30x + 30x +
          values
    @@ -58295,42 +60396,48 @@

    teal.slice coverage - 65.74%

    282 - 30x + 30x +
          choices <- private$get_choices()
    283 - 30x + 30x +
          if (values[1] < choices[1L] || values[1] > choices[2L]) {
    284 - 5x + 5x +
            warning(
    285 - 5x + 5x +
              sprintf(
    286 - 5x + 5x +
                "Value: %s is outside of the range for the column '%s' in dataset '%s', setting minimum possible value.",
    287 - 5x + 5x +
                values[1], private$get_varname(), toString(private$get_dataname())
    @@ -58351,7 +60458,8 @@

    teal.slice coverage - 65.74%

    290 - 5x + 5x +
            values[1] <- choices[1L]
    @@ -58372,35 +60480,40 @@

    teal.slice coverage - 65.74%

    293 - 30x + 30x +
          if (values[2] > choices[2L] | values[2] < choices[1L]) {
    294 - 5x + 5x +
            warning(
    295 - 5x + 5x +
              sprintf(
    296 - 5x + 5x +
                "Value: '%s' is outside of the range for the column '%s' in dataset '%s', setting maximum possible value.",
    297 - 5x + 5x +
                values[2], private$get_varname(), toString(private$get_dataname())
    @@ -58421,7 +60534,8 @@

    teal.slice coverage - 65.74%

    300 - 5x + 5x +
            values[2] <- choices[2L]
    @@ -58442,7 +60556,8 @@

    teal.slice coverage - 65.74%

    303 - 30x + 30x +
          values
    @@ -60520,14 +62635,16 @@

    teal.slice coverage - 65.74%

    49 - 8x + 8x +
          checkmate::assert_class(datasets, "FilteredData")
    50 - 6x + 6x +
          private$filtered_data <- datasets
    @@ -60611,7 +62728,8 @@

    teal.slice coverage - 65.74%

    62 - 8x + 8x +
          private$filtered_data$get_filter_state()
    @@ -60681,14 +62799,16 @@

    teal.slice coverage - 65.74%

    72 - 5x + 5x +
          private$filtered_data$set_filter_state(filter)
    73 - 5x + 5x +
          invisible(NULL)
    @@ -60779,14 +62899,16 @@

    teal.slice coverage - 65.74%

    86 - 1x + 1x +
          private$filtered_data$remove_filter_state(filter)
    87 - 1x + 1x +
          invisible(NULL)
    @@ -60870,21 +62992,24 @@

    teal.slice coverage - 65.74%

    99 - 2x + 2x +
          datanames_to_remove <- if (missing(datanames)) private$filtered_data$datanames() else datanames
    100 - 2x + 2x +
          private$filtered_data$clear_filter_states(datanames = datanames_to_remove)
    101 - 2x + 2x +
          invisible(NULL)
    @@ -61548,28 +63673,32 @@

    teal.slice coverage - 65.74%

    87 - 3x + 3x +
      checkmate::assert_multi_class(datasets, c("FilteredData", "FilterPanelAPI"))
    88 - 3x + 3x +
      checkmate::assert_class(filter, "teal_slices")
    89 - 3x + 3x +
      datasets$set_filter_state(filter)
    90 - 3x + 3x +
      invisible(NULL)
    @@ -61611,14 +63740,16 @@

    teal.slice coverage - 65.74%

    96 - 4x + 4x +
      checkmate::assert_multi_class(datasets, c("FilteredData", "FilterPanelAPI"))
    97 - 4x + 4x +
      if (shiny::isRunning()) {
    @@ -61639,7 +63770,8 @@

    teal.slice coverage - 65.74%

    100 - 4x + 4x +
        shiny::isolate(datasets$get_filter_state())
    @@ -61688,14 +63820,16 @@

    teal.slice coverage - 65.74%

    107 - 1x + 1x +
      checkmate::assert_multi_class(datasets, c("FilteredData", "FilterPanelAPI"))
    108 - 1x + 1x +
      checkmate::assert_class(filter, "teal_slices")
    @@ -61709,14 +63843,16 @@

    teal.slice coverage - 65.74%

    110 - 1x + 1x +
      datasets$remove_filter_state(filter)
    111 - 1x + 1x +
      invisible(NULL)
    @@ -61758,21 +63894,24 @@

    teal.slice coverage - 65.74%

    117 - 1x + 1x +
      checkmate::assert_multi_class(datasets, c("FilteredData", "FilterPanelAPI"))
    118 - 1x + 1x +
      datasets$clear_filter_states(force = force)
    119 - 1x + 1x +
      invisible(NULL)
    @@ -61870,28 +64009,32 @@

    teal.slice coverage - 65.74%

    133 - 2x + 2x +
      checkmate::assert_character(datanames, min.len = 1, any.missing = FALSE)
    134 - 2x + 2x +
      stopifnot(
    135 - 2x + 2x +
        is(datasets, "FilteredData"),
    136 - 2x + 2x +
        all(datanames %in% datasets$datanames())
    @@ -61912,35 +64055,40 @@

    teal.slice coverage - 65.74%

    139 - 2x + 2x +
      paste(
    140 - 2x + 2x +
        unlist(lapply(
    141 - 2x + 2x +
          datanames,
    142 - 2x + 2x +
          function(dataname) {
    143 - 4x + 4x +
            datasets$get_call(dataname)
    @@ -61961,7 +64109,8 @@

    teal.slice coverage - 65.74%

    146 - 2x + 2x +
        collapse = "\n"
    @@ -63604,35 +65753,40 @@

    teal.slice coverage - 65.74%

    181 - 103x + 103x +
          checkmate::assert_function(data_reactive, args = "sid")
    182 - 103x + 103x +
          checkmate::assert_data_frame(data)
    183 - 103x + 103x +
          super$initialize(data, data_reactive, dataname, datalabel)
    184 - 103x + 103x +
          private$keys <- keys
    185 - 103x + 103x +
          private$set_filterable_varnames(include_varnames = colnames(private$data))
    @@ -63960,7 +66114,8 @@

    teal.slice coverage - 65.74%

    38 - 26x + 26x +
          if (!requireNamespace("MultiAssayExperiment", quietly = TRUE)) {
    @@ -63981,56 +66136,64 @@

    teal.slice coverage - 65.74%

    41 - 26x + 26x +
          checkmate::assert_function(data_reactive, args = "sid")
    42 - 26x + 26x +
          checkmate::assert_class(data, "MultiAssayExperiment")
    43 - 25x + 25x +
          data <- SummarizedExperiment::colData(data)
    44 - 25x + 25x +
          data_reactive <- function(sid = "") SummarizedExperiment::colData(data_reactive(sid = sid))
    45 - 25x + 25x +
          super$initialize(data, data_reactive, dataname, datalabel)
    46 - 25x + 25x +
          private$keys <- keys
    47 - 25x + 25x +
          private$set_filterable_varnames(include_varnames = colnames(data))
    48 - 25x + 25x +
          return(invisible(self))
    @@ -64652,7 +66815,8 @@

    teal.slice coverage - 65.74%

    78 - 107x + 107x +
      UseMethod("init_filtered_dataset")
    @@ -64736,56 +66900,64 @@

    teal.slice coverage - 65.74%

    90 - 83x + 83x +
      DataframeFilteredDataset$new(
    91 - 83x + 83x +
        dataset = dataset,
    92 - 83x + 83x +
        dataname = dataname,
    93 - 83x + 83x +
        keys = keys,
    94 - 83x + 83x +
        parent_name = parent_name,
    95 - 83x + 83x +
        parent = parent,
    96 - 83x + 83x +
        join_keys = join_keys,
    97 - 83x + 83x +
        label = label
    @@ -64876,7 +67048,8 @@

    teal.slice coverage - 65.74%

    110 - 7x + 7x +
      if (!requireNamespace("MultiAssayExperiment", quietly = TRUE)) {
    @@ -64897,35 +67070,40 @@

    teal.slice coverage - 65.74%

    113 - 7x + 7x +
      MAEFilteredDataset$new(
    114 - 7x + 7x +
        dataset = dataset,
    115 - 7x + 7x +
        dataname = dataname,
    116 - 7x + 7x +
        keys = keys,
    117 - 7x + 7x +
        label = label
    @@ -65016,28 +67194,32 @@

    teal.slice coverage - 65.74%

    130 - 17x + 17x +
      DefaultFilteredDataset$new(
    131 - 17x + 17x +
        dataset = dataset,
    132 - 17x + 17x +
        dataname = dataname,
    133 - 17x + 17x +
        label = label
    @@ -65441,7 +67623,8 @@

    teal.slice coverage - 65.74%

    37 - 9x + 9x +
      UseMethod("variable_types")
    @@ -65476,7 +67659,8 @@

    teal.slice coverage - 65.74%

    42 - 9x + 9x +
      checkmate::assert_character(columns, null.ok = TRUE, any.missing = FALSE)
    @@ -65490,7 +67674,8 @@

    teal.slice coverage - 65.74%

    44 - 9x + 9x +
      res <- if (is.null(columns)) {
    @@ -65539,49 +67724,56 @@

    teal.slice coverage - 65.74%

    51 - 9x + 9x +
      } else if (checkmate::test_character(columns, any.missing = FALSE)) {
    52 - 9x + 9x +
        stopifnot(all(columns %in% names(data) | vapply(columns, identical, logical(1L), "")))
    53 - 9x + 9x +
        vapply(
    54 - 9x + 9x +
          columns,
    55 - 9x + 9x +
          function(x) ifelse(x == "", "", class(data[[x]])[[1]]),
    56 - 9x + 9x +
          character(1),
    57 - 9x + 9x +
          USE.NAMES = FALSE
    @@ -65623,7 +67815,8 @@

    teal.slice coverage - 65.74%

    63 - 9x + 9x +
      return(res)
    @@ -65658,7 +67851,8 @@

    teal.slice coverage - 65.74%

    68 - 9x + 9x +
      variable_types.default(data, columns)
    @@ -66049,49 +68243,56 @@

    teal.slice coverage - 65.74%

    14 - 273x + 273x +
      checkmate::assert_character(name, min.len = 1, any.missing = FALSE)
    15 - 271x + 271x +
      if (!grepl("^[[:alpha:]][a-zA-Z0-9_]*$", name, perl = TRUE)) {
    16 - 5x + 5x +
        stop(
    17 - 5x + 5x +
          "name '",
    18 - 5x + 5x +
          name,
    19 - 5x + 5x +
          "' must only contain alphanumeric characters (with underscores)",
    20 - 5x + 5x +
          " and the first character must be an alphabetic character"
    @@ -66210,35 +68411,40 @@

    teal.slice coverage - 65.74%

    37 - 12x + 12x +
      checkmate::assert_character(pattern, min.len = 1, null.ok = TRUE)
    38 - 12x + 12x +
      js_files <- list.files(
    39 - 12x + 12x +
        system.file("js", package = "teal.slice", mustWork = TRUE),
    40 - 12x + 12x +
        pattern = pattern,
    41 - 12x + 12x +
        full.names = TRUE
    @@ -66252,7 +68458,8 @@

    teal.slice coverage - 65.74%

    43 - 12x + 12x +
      return(singleton(lapply(js_files, includeScript)))
    @@ -66392,14 +68599,16 @@

    teal.slice coverage - 65.74%

    63 - 53x + 53x +
      if (length(choices) > 1) {
    64 - 26x + 26x +
        do.call("call", append(list("c"), choices))
    @@ -66413,7 +68622,8 @@

    teal.slice coverage - 65.74%

    66 - 27x + 27x +
        choices
    @@ -66643,7 +68853,8 @@

    teal.slice coverage - 65.74%

    30 - 24x + 24x +
          super$initialize(dataset = dataset, dataname = dataname, label = label)
    @@ -66727,35 +68938,40 @@

    teal.slice coverage - 65.74%

    42 - 4x + 4x +
          class_string <- toString(class(private$dataset))
    43 - 4x + 4x +
          if (trim_lines) {
    44 - 2x + 2x +
            trim_position <- 37L
    45 - 2x + 2x +
            class_string <- strtrim(class_string, trim_position)
    46 - 2x + 2x +
            substr(class_string, 35L, 37L) <- "..."
    @@ -66769,7 +68985,8 @@

    teal.slice coverage - 65.74%

    48 - 4x + 4x +
          sprintf(" - unfiltered dataset:\t\"%s\":   %s", private$dataname, class_string)
    @@ -66811,7 +69028,8 @@

    teal.slice coverage - 65.74%

    54 - 1x + 1x +
          invisible(NULL)
    @@ -66839,7 +69057,8 @@

    teal.slice coverage - 65.74%

    58 - 2x + 2x +
          invisible(NULL)
    @@ -66874,14 +69093,16 @@

    teal.slice coverage - 65.74%

    63 - 3x + 3x +
          if (length(state) != 0L) {
    64 - 1x + 1x +
            warning("DefaultFilterState cannot set state")
    @@ -66895,7 +69116,8 @@

    teal.slice coverage - 65.74%

    66 - 3x + 3x +
          invisible(NULL)
    @@ -66930,7 +69152,8 @@

    teal.slice coverage - 65.74%

    71 - 1x + 1x +
          invisible(NULL)
    @@ -66986,7 +69209,8 @@

    teal.slice coverage - 65.74%

    79 - 1x + 1x +
          data.frame(dataname = private$dataname, obs = NA, obs_filtered = NA)
    @@ -67433,21 +69657,24 @@

    teal.slice coverage - 65.74%

    30 - 47x + 47x +
      checkmate::assert_list(calls)
    31 - 45x + 45x +
      if (length(calls) > 0L) checkmate::assert_list(calls, types = c("call", "name"))
    32 - 46x + 46x +
      checkmate::assert_string(operator)
    @@ -67461,21 +69688,24 @@

    teal.slice coverage - 65.74%

    34 - 44x + 44x +
      Reduce(
    35 - 44x + 44x +
        x = calls,
    36 - 44x + 44x +
        f = function(x, y) call(operator, x, y)
    @@ -67586,21 +69816,24 @@

    teal.slice coverage - 65.74%

    13 - 7x + 7x +
      checkmate::assert_list(x, any.missing = FALSE, names = "unique")
    14 - 6x + 6x +
      checkmate::assert_class(join_keys, "join_keys")
    15 - 5x + 5x +
      if (!missing(code)) {
    @@ -67642,7 +69875,8 @@

    teal.slice coverage - 65.74%

    21 - 5x + 5x +
      if (!missing(check)) {
    @@ -67684,7 +69918,8 @@

    teal.slice coverage - 65.74%

    27 - 5x + 5x +
      FilteredData$new(x, join_keys = join_keys)
    @@ -67775,42 +70010,48 @@

    teal.slice coverage - 65.74%

    40 - 32x + 32x +
      lapply(
    41 - 32x + 32x +
        expr,
    42 - 32x + 32x +
        function(x) {
    43 - 19x + 19x +
          tryCatch(
    44 - 19x + 19x +
            eval(x, envir = env),
    45 - 19x + 19x +
            error = function(e) {
    @@ -67873,7 +70114,8 @@

    teal.slice coverage - 65.74%

    54 - 19x + 19x +
          return(invisible(NULL))
    @@ -68426,21 +70668,24 @@

    teal.slice coverage - 65.74%

    133 - 3x + 3x +
      checkmate::assert_string(input_id)
    134 - 3x + 3x +
      checkmate::assert_character(icons, len = 2L)
    135 - 3x + 3x +
      checkmate::assert_flag(one_way)
    @@ -68454,35 +70699,40 @@

    teal.slice coverage - 65.74%

    137 - 3x + 3x +
      expr <-
    138 - 3x + 3x +
        if (one_way) {
    139 - 3x + 3x +
          sprintf(
    140 - 3x + 3x +
            "$('#%s i').removeClass('%s').addClass('%s');",
    141 - 3x + 3x +
            input_id, icons[1], icons[2]
    @@ -68524,7 +70774,8 @@

    teal.slice coverage - 65.74%

    147 - 3x + 3x +
      shinyjs::runjs(expr)
    @@ -68538,7 +70789,8 @@

    teal.slice coverage - 65.74%

    149 - 3x + 3x +
      invisible(NULL)
    @@ -68580,21 +70832,24 @@

    teal.slice coverage - 65.74%

    155 - 3x + 3x +
      checkmate::assert_string(input_id)
    156 - 3x + 3x +
      checkmate::assert_character(titles, len = 2L)
    157 - 3x + 3x +
      checkmate::assert_flag(one_way)
    @@ -68608,35 +70863,40 @@

    teal.slice coverage - 65.74%

    159 - 3x + 3x +
      expr <-
    160 - 3x + 3x +
        if (one_way) {
    161 - 3x + 3x +
          sprintf(
    162 - 3x + 3x +
            "$('a#%s').attr('title', '%s');",
    163 - 3x + 3x +
            input_id, titles[2]
    @@ -68741,7 +71001,8 @@

    teal.slice coverage - 65.74%

    178 - 3x + 3x +
      shinyjs::runjs(expr)
    @@ -68755,7 +71016,8 @@

    teal.slice coverage - 65.74%

    180 - 3x + 3x +
      invisible(NULL)
    @@ -68895,7 +71157,8 @@

    teal.slice coverage - 65.74%

    200 - 66x + 66x +
      utils::getFromNamespace("topological_sort", ns = "teal.data")(graph)
    @@ -68957,14 +71220,16 @@

    teal.slice coverage - 65.74%

    7 - 9x + 9x +
      shiny::isolate(
    8 - 9x + 9x +
        all(vapply(fields, function(x) identical(ts1[[x]], ts2[[x]]), logical(1L)))
    @@ -69027,35 +71292,40 @@

    teal.slice coverage - 65.74%

    17 - 34x + 34x +
      shiny::isolate({
    18 - 34x + 34x +
        testthat::expect_true(
    19 - 34x + 34x +
          setequal(
    20 - 34x + 34x +
            reactiveValuesToList(x),
    21 - 34x + 34x +
            reactiveValuesToList(y)
    @@ -69125,28 +71395,32 @@

    teal.slice coverage - 65.74%

    31 - 12x + 12x +
      shiny::isolate({
    32 - 12x + 12x +
        mapply(
    33 - 12x + 12x +
          function(x, y) {
    34 - 27x + 27x +
            expect_identical_slice(x, y)
    @@ -69160,14 +71434,16 @@

    teal.slice coverage - 65.74%

    36 - 12x + 12x +
          x = x,
    37 - 12x + 12x +
          y = y
    @@ -69181,7 +71457,8 @@

    teal.slice coverage - 65.74%

    39 - 12x + 12x +
        testthat::expect_identical(attributes(x), attributes(y))
    @@ -69432,21 +71709,24 @@

    teal.slice coverage - 65.74%

    33 - 26x + 26x +
          checkmate::assert_matrix(data)
    34 - 25x + 25x +
          super$initialize(data, data_reactive, dataname, datalabel)
    35 - 25x + 25x +
          private$set_filterable_varnames(include_varnames = colnames(private$data))
    diff --git a/main/404.html b/main/404.html index b126307f2..dbaf1fd4f 100644 --- a/main/404.html +++ b/main/404.html @@ -1,5 +1,4 @@ - - + @@ -49,7 +48,23 @@
  • Non-CRAN unit test report
  • - + + + @@ -47,65 +86,80 @@

    Contributor Covenant Code of Conduct

    -

    Our Pledge

    +

    Our Pledge +

    We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.

    We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.

    -

    Our Standards

    +

    Our Standards +

    Examples of behavior that contributes to a positive environment for our community include:

    -
    • Demonstrating empathy and kindness toward other people
    • +
        +
      • Demonstrating empathy and kindness toward other people
      • Being respectful of differing opinions, viewpoints, and experiences
      • Giving and gracefully accepting constructive feedback
      • Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
      • Focusing on what is best not just for us as individuals, but for the overall community
      • -

      Examples of unacceptable behavior include:

      -
      • The use of sexualized language or imagery, and sexual attention or advances of any kind
      • +
      +

      Examples of unacceptable behavior include:

      +
        +
      • The use of sexualized language or imagery, and sexual attention or advances of any kind
      • Trolling, insulting or derogatory comments, and personal or political attacks
      • Public or private harassment
      • Publishing others’ private information, such as a physical or email address, without their explicit permission
      • Other conduct which could reasonably be considered inappropriate in a professional setting
      • -
    + +
    -

    Enforcement Responsibilities

    +

    Enforcement Responsibilities +

    Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.

    Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.

    -

    Scope

    +

    Scope +

    This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.

    -

    Enforcement

    +

    Enforcement +

    Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [INSERT CONTACT METHOD]. All complaints will be reviewed and investigated promptly and fairly.

    All community leaders are obligated to respect the privacy and security of the reporter of any incident.

    -

    Enforcement Guidelines

    +

    Enforcement Guidelines +

    Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:

    -

    1. Correction

    +

    1. Correction +

    Community Impact: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.

    Consequence: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.

    -

    2. Warning

    +

    2. Warning +

    Community Impact: A violation through a single incident or series of actions.

    Consequence: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.

    -

    3. Temporary Ban

    +

    3. Temporary Ban +

    Community Impact: A serious violation of community standards, including sustained inappropriate behavior.

    Consequence: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.

    -

    4. Permanent Ban

    +

    4. Permanent Ban +

    Community Impact: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.

    Consequence: A permanent ban from any sort of public interaction within the community.

    -

    Attribution

    +

    Attribution +

    This Code of Conduct is adapted from the Contributor Covenant, version 2.1, available at https://www.contributor-covenant.org/version/2/1/code_of_conduct.html.

    Community Impact Guidelines were inspired by Mozilla’s code of conduct enforcement ladder.

    For answers to common questions about this code of conduct, see the FAQ at https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.

    @@ -113,17 +167,19 @@

    Attribution

    + + - + + - + + diff --git a/main/CONTRIBUTING.html b/main/CONTRIBUTING.html index 432d544a7..a22442e25 100644 --- a/main/CONTRIBUTING.html +++ b/main/CONTRIBUTING.html @@ -1,5 +1,19 @@ - -Contribution Guidelines • teal.slice + + + + + + +Contribution Guidelines • teal.slice + + + + + + + + + Skip to contents @@ -15,24 +29,49 @@ + + @@ -49,7 +88,8 @@

    Contribution Guidelines

    🙏 Thank you for taking the time to contribute!

    Your input is deeply valued, whether an issue, a pull request, or even feedback, regardless of size, content or scope.

    -

    Table of contents

    +

    Table of contents +

    👶 Getting started

    📔 Code of Conduct

    🗃 License

    @@ -60,38 +100,47 @@

    Table of contents❓ Questions

    -

    Getting started

    +

    Getting started +

    Please refer the project documentation for a brief introduction. Please also see other articles within the project documentation for additional information.

    -

    Code of Conduct

    +

    Code of Conduct +

    A Code of Conduct governs this project. Participants and contributors are expected to follow the rules outlined therein.

    -

    License

    +

    License +

    All your contributions will be covered by this project’s license.

    -

    Issues

    +

    Issues +

    We use GitHub to track issues, feature requests, and bugs. Before submitting a new issue, please check if the issue has already been reported. If the issue already exists, please upvote the existing issue 👍.

    For new feature requests, please elaborate on the context and the benefit the feature will have for users, developers, or other relevant personas.

    -

    Pull requests

    +

    Pull requests +

    -

    GitHub Flow

    +

    GitHub Flow +

    This repository uses the GitHub Flow model for collaboration. To submit a pull request:

    -
    1. +
        +
      1. Create a branch

        Please see the branch naming convention below. If you don’t have write access to this repository, please fork it.

      2. Make changes

        Make sure your code

        -
        • passes all checks imposed by GitHub Actions
        • +
            +
          • passes all checks imposed by GitHub Actions
          • is well documented
          • is well tested with unit tests sufficiently covering the changes introduced
          • -
          +
        +
      3. Create a pull request (PR)

        In the pull request description, please link the relevant issue (if any), provide a detailed description of the change, and include any assumptions.

        @@ -105,76 +154,93 @@

        GitHub Flow -

        Branch naming convention

        +

        Branch naming convention +

        Suppose your changes are related to a current issue in the current project; please name your branch as follows: <issue_id>_<short_description>. Please use underscore (_) as a delimiter for word separation. For example, 420_fix_ui_bug would be a suitable branch name if your change is resolving and UI-related bug reported in issue number 420 in the current project.

        If your change affects multiple repositories, please name your branches as follows: <issue_id>_<issue_repo>_<short description>. For example, 69_awesomeproject_fix_spelling_error would reference issue 69 reported in project awesomeproject and aims to resolve one or more spelling errors in multiple (likely related) repositories.

    monorepo and staged.dependencies -

    + +

    Sometimes you might need to change upstream dependent package(s) to be able to submit a meaningful change. We are using staged.dependencies functionality to simulate a monorepo behavior. The dependency configuration is already specified in this project’s staged_dependencies.yaml file. You need to name the feature branches appropriately. This is the only exception from the branch naming convention described above.

    Please refer to the staged.dependencies package documentation for more details.

    -

    Coding guidelines

    +

    Coding guidelines +

    This repository follows some unified processes and standards adopted by its maintainers to ensure software development is carried out consistently within teams and cohesively across other repositories.

    -

    Style guide

    +

    Style guide +

    This repository follows the standard tidyverse style guide and uses lintr for lint checks. Customized lint configurations are available in this repository’s .lintr file.

    -

    Dependency management

    +

    Dependency management +

    Lightweight is the right weight. This repository follows tinyverse recommendations of limiting dependencies to minimum.

    -

    Dependency version management

    +

    Dependency version management +

    If the code is not compatible with all (!) historical versions of a given dependency package, it is required to specify minimal version in the DESCRIPTION file. In particular: if the development version requires (imports) the development version of another package - it is required to put abc (>= 1.2.3.9000).

    - +
    -

    R & package versions

    +

    R & package versions +

    We continuously test our packages against the newest R version along with the most recent dependencies from CRAN and BioConductor. We recommend that your working environment is also set up in the same way. You can find the details about the R version and packages used in the R CMD check GitHub Action execution log - there is a step that prints out the R sessionInfo().

    If you discover bugs on older R versions or with an older set of dependencies, please create the relevant bug reports.

    -

    pre-commit

    +

    +pre-commit +

    We highly recommend that you use the pre-commit tool combined with R hooks for pre-commit to execute some of the checks before committing and pushing your changes.

    Pre-commit hooks are already available in this repository’s .pre-commit-config.yaml file.

    -

    Recognition model

    +

    Recognition model +

    As mentioned previously, all contributions are deeply valued and appreciated. While all contribution data is available as part of the repository insights, to recognize a significant contribution and hence add the contributor to the package authors list, the following rules are enforced:

    -
    • Minimum 5% of lines of code authored* (determined by git blame query) OR
    • +
        +
      • Minimum 5% of lines of code authored* (determined by git blame query) OR
      • Being at the top 5 contributors in terms of number of commits OR lines added OR lines removed*
      • -

      *Excluding auto-generated code, including but not limited to roxygen comments or renv.lock files.

      +
    +

    *Excluding auto-generated code, including but not limited to roxygen comments or renv.lock files.

    The package maintainer also reserves the right to adjust the criteria to recognize contributions.

    -

    Questions

    +

    Questions +

    If you have further questions regarding the contribution guidelines, please contact the package/repository maintainer.

    + + - + + - + + diff --git a/main/LICENSE-text.html b/main/LICENSE-text.html index 6e24e6ed5..4051fc4bc 100644 --- a/main/LICENSE-text.html +++ b/main/LICENSE-text.html @@ -1,5 +1,19 @@ - -License • teal.slice + + + + + + +License • teal.slice + + + + + + + + + Skip to contents @@ -15,24 +29,49 @@ + + @@ -59,17 +98,19 @@

    License

    limitations under the License. - + + - + + - + + diff --git a/main/SECURITY.html b/main/SECURITY.html index 230ab0a44..0c00f03a4 100644 --- a/main/SECURITY.html +++ b/main/SECURITY.html @@ -1,5 +1,19 @@ - -Security Policy • teal.slice + + + + + + +Security Policy • teal.slice + + + + + + + + + Skip to contents @@ -15,24 +29,49 @@ + + @@ -47,38 +86,44 @@

    Security Policy

    -

    Reporting Security Issues

    +

    Reporting Security Issues +

    If you believe you have found a security vulnerability in any of the repositories in this organization, please report it to us through coordinated disclosure.

    Please do not report security vulnerabilities through public GitHub issues, discussions, or pull requests.

    Instead, please send an email to vulnerability.management[@]roche.com.

    Please include as much of the information listed below as you can to help us better understand and resolve the issue:

    -
    • The type of issue (e.g., buffer overflow, SQL injection, or cross-site scripting)
    • +
        +
      • The type of issue (e.g., buffer overflow, SQL injection, or cross-site scripting)
      • Full paths of source file(s) related to the manifestation of the issue
      • The location of the affected source code (tag/branch/commit or direct URL)
      • Any special configuration required to reproduce the issue
      • Step-by-step instructions to reproduce the issue
      • Proof-of-concept or exploit code (if possible)
      • Impact of the issue, including how an attacker might exploit the issue
      • -

      This information will help us triage your report more quickly.

      +
    +

    This information will help us triage your report more quickly.

    -

    Data Security Standards (DSS)

    +

    Data Security Standards (DSS) +

    Please make sure that while reporting issues in the form a bug, feature, or pull request, all sensitive information such as PII, PHI, and PCI is completely removed from any text and attachments, including pictures and videos.

    + + - + + - + + diff --git a/main/articles/filter-panel-for-developers.html b/main/articles/filter-panel-for-developers.html index 040dd1280..cbaa1004d 100644 --- a/main/articles/filter-panel-for-developers.html +++ b/main/articles/filter-panel-for-developers.html @@ -1,5 +1,4 @@ - - + @@ -49,7 +48,23 @@
  • Non-CRAN unit test report
  • - + + + @@ -47,24 +86,31 @@

    Articles

    All vignettes

    -
    Filter Panel for Developers
    +
    +
    Filter Panel for Developers
    -
    teal.slice Classes
    + +
    teal.slice Classes
    -
    Introduction to teal.slice
    + +
    Introduction to teal.slice
    -
    - + +
    + + + - + + - + + diff --git a/main/articles/teal-slice-classes.html b/main/articles/teal-slice-classes.html index 50409d6bc..30d3195c2 100644 --- a/main/articles/teal-slice-classes.html +++ b/main/articles/teal-slice-classes.html @@ -1,5 +1,4 @@ - - + @@ -49,7 +48,23 @@
  • Non-CRAN unit test report
  • - + + - + + + @@ -46,7 +85,8 @@

    Authors and Citation

    Authors

    -
    • +
        +
      • Dawid Kaledkowski. Author, maintainer.

      • @@ -106,7 +146,8 @@

        Authors

        F. Hoffmann-La Roche AG. Copyright holder, funder.

        -
    + +

    Citation

    @@ -128,17 +169,19 @@

    Citation

    + + - + + - + + diff --git a/main/coverage-report/index.html b/main/coverage-report/index.html index e93a123a8..2f4aeead1 100644 --- a/main/coverage-report/index.html +++ b/main/coverage-report/index.html @@ -1,23 +1,22 @@ - - + - + - + - - + + - + - + - - - + + + @@ -998,35 +997,40 @@

    teal.slice coverage - 69.64%

    75 - 364x + 364x +
          checkmate::assert_class(x_reactive, "reactive")
    76 - 363x + 363x +
          checkmate::assert_class(slice, "teal_slice")
    77 - 361x + 361x +
          checkmate::assert_character(extract_type, max.len = 1, any.missing = FALSE)
    78 - 361x + 361x +
          if (length(extract_type) == 1) {
    79 - 50x + 50x +
            checkmate::assert_choice(extract_type, choices = c("list", "matrix"))
    @@ -1054,14 +1058,16 @@

    teal.slice coverage - 69.64%

    83 - 360x + 360x +
          private$x <- x
    84 - 360x + 360x +
          private$x_reactive <- x_reactive
    @@ -1075,21 +1081,24 @@

    teal.slice coverage - 69.64%

    86 - 360x + 360x +
          private$na_count <- sum(is.na(x))
    87 - 360x + 360x +
          private$filtered_na_count <- reactive(
    88 - 360x + 360x +
            if (!is.null(private$x_reactive())) {
    @@ -1124,7 +1133,8 @@

    teal.slice coverage - 69.64%

    93 - 360x + 360x +
          private$extract_type <- extract_type
    @@ -1145,14 +1155,16 @@

    teal.slice coverage - 69.64%

    96 - 19x + 19x +
          if (is.null(isolate(slice$keep_na)) && anyNA(x)) slice$keep_na <- TRUE
    97 - 360x + 360x +
          private$teal_slice <- slice
    @@ -1166,7 +1178,8 @@

    teal.slice coverage - 69.64%

    99 - 360x + 360x +
          varlabel <- attr(x, "label", exact = TRUE)
    @@ -1180,21 +1193,24 @@

    teal.slice coverage - 69.64%

    101 - 360x + 360x +
          private$varlabel <-
    102 - 360x + 360x +
            if (is.null(varlabel) || identical(varlabel, private$get_varname())) {
    103 - 359x + 359x +
              character(0)
    @@ -1208,7 +1224,8 @@

    teal.slice coverage - 69.64%

    105 - 1x + 1x +
              varlabel
    @@ -1229,7 +1246,8 @@

    teal.slice coverage - 69.64%

    108 - 360x + 360x +
          private$state_history <- reactiveVal(list())
    @@ -1243,7 +1261,8 @@

    teal.slice coverage - 69.64%

    110 - 360x + 360x +
          invisible(self)
    @@ -1327,28 +1346,32 @@

    teal.slice coverage - 69.64%

    122 - 68x + 68x +
          sprintf(
    123 - 68x + 68x +
            "%s:\n%s",
    124 - 68x + 68x +
            class(self)[1],
    125 - 68x + 68x +
            format(self$get_state(), show_all = show_all, trim_lines = trim_lines)
    @@ -1418,7 +1441,8 @@

    teal.slice coverage - 69.64%

    135 - 14x + 14x +
          cat(isolate(self$format(...)))
    @@ -1509,21 +1533,24 @@

    teal.slice coverage - 69.64%

    148 - 89x + 89x +
          checkmate::assert_class(state, "teal_slice")
    149 - 88x + 88x +
          if (private$is_fixed()) {
    150 - 1x + 1x +
            warning("attempt to set state on fixed filter aborted id: ", private$get_id())
    @@ -1537,28 +1564,32 @@

    teal.slice coverage - 69.64%

    152 - 87x + 87x +
            logger::log_debug("{ class(self)[1] }$set_state setting state of filter id: { private$get_id() }")
    153 - 87x + 87x +
            isolate({
    154 - 87x + 87x +
              if (!is.null(state$selected)) {
    155 - 78x + 78x +
                private$set_selected(state$selected)
    @@ -1572,14 +1603,16 @@

    teal.slice coverage - 69.64%

    157 - 75x + 75x +
              if (!is.null(state$keep_na)) {
    158 - 16x + 16x +
                private$set_keep_na(state$keep_na)
    @@ -1593,14 +1626,16 @@

    teal.slice coverage - 69.64%

    160 - 75x + 75x +
              if (!is.null(state$keep_inf)) {
    161 - 9x + 9x +
                private$set_keep_inf(state$keep_inf)
    @@ -1614,35 +1649,40 @@

    teal.slice coverage - 69.64%

    163 - 75x + 75x +
              current_state <- sprintf(
    164 - 75x + 75x +
                "selected: %s; keep_na: %s; keep_inf: %s",
    165 - 75x + 75x +
                toString(private$get_selected()),
    166 - 75x + 75x +
                private$get_keep_na(),
    167 - 75x + 75x +
                private$get_keep_inf()
    @@ -1677,7 +1717,8 @@

    teal.slice coverage - 69.64%

    172 - 76x + 76x +
          invisible(self)
    @@ -1747,7 +1788,8 @@

    teal.slice coverage - 69.64%

    182 - 1205x + 1205x +
          private$teal_slice
    @@ -1817,7 +1859,8 @@

    teal.slice coverage - 69.64%

    192 - 1x + 1x +
          stop("this is a virtual method")
    @@ -1922,42 +1965,48 @@

    teal.slice coverage - 69.64%

    207 - 12x + 12x +
          moduleServer(
    208 - 12x + 12x +
            id = id,
    209 - 12x + 12x +
            function(input, output, session) {
    210 - 12x + 12x +
              logger::log_debug("FilterState$server initializing module for slice: { private$get_id() } ")
    211 - 12x + 12x +
              private$server_summary("summary")
    212 - 12x + 12x +
              if (private$is_fixed()) {
    @@ -1978,7 +2027,8 @@

    teal.slice coverage - 69.64%

    215 - 12x + 12x +
                private$server_inputs("inputs")
    @@ -1999,49 +2049,56 @@

    teal.slice coverage - 69.64%

    218 - 12x + 12x +
              private$session_bindings[[session$ns("state")]] <- observeEvent(
    219 - 12x + 12x +
                eventExpr = list(private$get_selected(), private$get_keep_na(), private$get_keep_inf()),
    220 - 12x + 12x +
                handlerExpr = {
    221 - 4x + 4x +
                  current_state <- as.list(self$get_state())
    222 - 4x + 4x +
                  history <- private$state_history()
    223 - 4x + 4x +
                  history_update <- c(history, list(current_state))
    224 - 4x + 4x +
                  private$state_history(history_update)
    @@ -2069,21 +2126,24 @@

    teal.slice coverage - 69.64%

    228 - 12x + 12x +
              private$session_bindings[[session$ns("back")]] <- observeEvent(
    229 - 12x + 12x +
                eventExpr = input$back,
    230 - 12x + 12x +
                handlerExpr = {
    @@ -2146,21 +2206,24 @@

    teal.slice coverage - 69.64%

    239 - 12x + 12x +
              private$session_bindings[[session$ns("reset")]] <- observeEvent(
    240 - 12x + 12x +
                eventExpr = input$reset,
    241 - 12x + 12x +
                handlerExpr = {
    @@ -2216,56 +2279,64 @@

    teal.slice coverage - 69.64%

    249 - 12x + 12x +
              private$session_bindings[[session$ns("state_history")]] <- observeEvent(
    250 - 12x + 12x +
                eventExpr = private$state_history(),
    251 - 12x + 12x +
                handlerExpr = {
    252 - 4x + 4x +
                  shinyjs::disable(id = "back")
    253 - 4x + 4x +
                  shinyjs::disable(id = "reset")
    254 - 4x + 4x +
                  shinyjs::delay(
    255 - 4x + 4x +
                    ms = 100,
    256 - 4x + 4x +
                    expr = {
    @@ -2300,21 +2371,24 @@

    teal.slice coverage - 69.64%

    261 - 4x + 4x +
                  shinyjs::delay(
    262 - 4x + 4x +
                    ms = 100,
    263 - 4x + 4x +
                    expr = {
    @@ -2370,35 +2444,40 @@

    teal.slice coverage - 69.64%

    271 - 12x + 12x +
              private$session_bindings[[session$ns("remove")]] <- observeEvent(
    272 - 12x + 12x +
                once = TRUE, # remove button can be called once, should be destroyed afterwards
    273 - 12x + 12x +
                ignoreInit = TRUE, # ignoreInit: should not matter because we destroy the previous input set of the UI
    274 - 12x + 12x +
                eventExpr = input$remove, # when remove button is clicked in the FilterState ui
    275 - 12x + 12x +
                handlerExpr = remove_callback()
    @@ -2419,35 +2498,40 @@

    teal.slice coverage - 69.64%

    278 - 12x + 12x +
              private$session_bindings[[session$ns("inputs")]] <- list(
    279 - 12x + 12x +
                destroy = function() {
    280 - 24x + 24x +
                  logger::log_debug("Destroying FilterState inputs and observers; id: { private$get_id() }")
    281 - 24x + 24x +
                  if (!session$isEnded()) {
    282 - 8x + 8x +
                    lapply(session$ns(names(input)), .subset2(input, "impl")$.values$remove)
    @@ -2482,7 +2566,8 @@

    teal.slice coverage - 69.64%

    287 - 12x + 12x +
              private$state_history <- reactiveVal(list())
    @@ -2496,7 +2581,8 @@

    teal.slice coverage - 69.64%

    289 - 12x + 12x +
              NULL
    @@ -2580,7 +2666,8 @@

    teal.slice coverage - 69.64%

    301 - 12x + 12x +
          ns <- NS(id)
    @@ -2636,84 +2723,96 @@

    teal.slice coverage - 69.64%

    309 - 12x + 12x +
          tags$div(
    310 - 12x + 12x +
            id = id,
    311 - 12x + 12x +
            class = "panel filter-card",
    312 - 12x + 12x +
            include_js_files("count-bar-labels.js"),
    313 - 12x + 12x +
            tags$div(
    314 - 12x + 12x +
              class = "filter-card-header",
    315 - 12x + 12x +
              `data-toggle` = "collapse",
    316 - 12x + 12x +
              `data-bs-toggle` = "collapse",
    317 - 12x + 12x +
              href = paste0("#", ns("body")),
    318 - 12x + 12x +
              tags$div(
    319 - 12x + 12x +
                class = "filter-card-title",
    320 - 12x + 12x +
                if (private$is_anchored() && private$is_fixed()) {
    @@ -2727,7 +2826,8 @@

    teal.slice coverage - 69.64%

    322 - 12x + 12x +
                } else if (private$is_anchored() && !private$is_fixed()) {
    @@ -2741,7 +2841,8 @@

    teal.slice coverage - 69.64%

    324 - 12x + 12x +
                } else if (!private$is_anchored() && private$is_fixed()) {
    @@ -2762,28 +2863,32 @@

    teal.slice coverage - 69.64%

    327 - 12x + 12x +
                tags$div(class = "filter-card-varname", tags$strong(private$get_varname())),
    328 - 12x + 12x +
                tags$div(class = "filter-card-varlabel", private$get_varlabel()),
    329 - 12x + 12x +
                tags$div(
    330 - 12x + 12x +
                  class = "filter-card-controls",
    @@ -2804,7 +2909,8 @@

    teal.slice coverage - 69.64%

    333 - 12x + 12x +
                  onclick = "event.stopPropagation();event.preventDefault();",
    @@ -2818,70 +2924,80 @@

    teal.slice coverage - 69.64%

    335 - 12x + 12x +
                  `data-bs-toggle` = "collapse",
    336 - 12x + 12x +
                  `data-bs-target` = NULL,
    337 - 12x + 12x +
                  if (isFALSE(private$is_fixed())) {
    338 - 12x + 12x +
                    actionLink(
    339 - 12x + 12x +
                      inputId = ns("back"),
    340 - 12x + 12x +
                      label = NULL,
    341 - 12x + 12x +
                      icon = icon("circle-arrow-left", lib = "font-awesome"),
    342 - 12x + 12x +
                      title = "Rewind state",
    343 - 12x + 12x +
                      class = "filter-card-back",
    344 - 12x + 12x +
                      style = "display: none"
    @@ -2902,56 +3018,64 @@

    teal.slice coverage - 69.64%

    347 - 12x + 12x +
                  if (isFALSE(private$is_fixed())) {
    348 - 12x + 12x +
                    actionLink(
    349 - 12x + 12x +
                      inputId = ns("reset"),
    350 - 12x + 12x +
                      label = NULL,
    351 - 12x + 12x +
                      icon = icon("circle-arrow-up", lib = "font-awesome"),
    352 - 12x + 12x +
                      title = "Restore original state",
    353 - 12x + 12x +
                      class = "filter-card-back",
    354 - 12x + 12x +
                      style = "display: none"
    @@ -2972,42 +3096,48 @@

    teal.slice coverage - 69.64%

    357 - 12x + 12x +
                  if (isFALSE(private$is_anchored())) {
    358 - 12x + 12x +
                    actionLink(
    359 - 12x + 12x +
                      inputId = ns("remove"),
    360 - 12x + 12x +
                      label = icon("circle-xmark", lib = "font-awesome"),
    361 - 12x + 12x +
                      title = "Remove filter",
    362 - 12x + 12x +
                      class = "filter-card-remove"
    @@ -3042,7 +3172,8 @@

    teal.slice coverage - 69.64%

    367 - 12x + 12x +
              tags$div(class = "filter-card-summary", private$ui_summary(ns("summary")))
    @@ -3056,56 +3187,64 @@

    teal.slice coverage - 69.64%

    369 - 12x + 12x +
            tags$div(
    370 - 12x + 12x +
              id = ns("body"),
    371 - 12x + 12x +
              class = "collapse out",
    372 - 12x + 12x +
              `data-parent` = paste0("#", parent_id),
    373 - 12x + 12x +
              `data-bs-parent` = paste0("#", parent_id),
    374 - 12x + 12x +
              tags$div(
    375 - 12x + 12x +
                class = "filter-card-body",
    376 - 12x + 12x +
                if (private$is_fixed()) {
    @@ -3126,7 +3265,8 @@

    teal.slice coverage - 69.64%

    379 - 12x + 12x +
                  private$ui_inputs(ns("inputs"))
    @@ -3224,14 +3364,16 @@

    teal.slice coverage - 69.64%

    393 - 521x + 521x +
          .finalize_session_bindings(self, private)
    394 - 521x + 521x +
          invisible(NULL)
    @@ -3511,35 +3653,40 @@

    teal.slice coverage - 69.64%

    434 - 416x + 416x +
          logger::log_debug(
    435 - 416x + 416x +
            sprintf(
    436 - 416x + 416x +
              "%s$set_selected setting selection of id: %s",
    437 - 416x + 416x +
              class(self)[1],
    438 - 416x + 416x +
              private$get_id()
    @@ -3560,35 +3707,40 @@

    teal.slice coverage - 69.64%

    441 - 416x + 416x +
          isolate({
    442 - 416x + 416x +
            value <- private$cast_and_validate(value)
    443 - 405x + 405x +
            value <- private$check_length(value)
    444 - 399x + 399x +
            value <- private$remove_out_of_bounds_values(value)
    445 - 399x + 399x +
            private$teal_slice$selected <- value
    @@ -3609,7 +3761,8 @@

    teal.slice coverage - 69.64%

    448 - 399x + 399x +
          invisible(NULL)
    @@ -3693,56 +3846,64 @@

    teal.slice coverage - 69.64%

    460 - 16x + 16x +
          checkmate::assert_flag(value)
    461 - 16x + 16x +
          private$teal_slice$keep_na <- value
    462 - 16x + 16x +
          logger::log_debug(
    463 - 16x + 16x +
            sprintf(
    464 - 16x + 16x +
              "%s$set_keep_na set for filter %s to %s.",
    465 - 16x + 16x +
              class(self)[1],
    466 - 16x + 16x +
              private$get_id(),
    467 - 16x + 16x +
              value
    @@ -3763,7 +3924,8 @@

    teal.slice coverage - 69.64%

    470 - 16x + 16x +
          invisible(NULL)
    @@ -3847,56 +4009,64 @@

    teal.slice coverage - 69.64%

    482 - 9x + 9x +
          checkmate::assert_flag(value)
    483 - 9x + 9x +
          private$teal_slice$keep_inf <- value
    484 - 9x + 9x +
          logger::log_debug(
    485 - 9x + 9x +
            sprintf(
    486 - 9x + 9x +
              "%s$set_keep_inf of filter %s set to %s",
    487 - 9x + 9x +
              class(self)[1],
    488 - 9x + 9x +
              private$get_id(),
    489 - 9x + 9x +
              value
    @@ -3924,7 +4094,8 @@

    teal.slice coverage - 69.64%

    493 - 9x + 9x +
          invisible(NULL)
    @@ -3987,7 +4158,8 @@

    teal.slice coverage - 69.64%

    502 - 88x + 88x +
          isolate(private$teal_slice$dataname)
    @@ -4036,7 +4208,8 @@

    teal.slice coverage - 69.64%

    509 - 166x + 166x +
          isolate(private$teal_slice$varname)
    @@ -4085,7 +4258,8 @@

    teal.slice coverage - 69.64%

    516 - 4x + 4x +
          isolate(private$teal_slice$id)
    @@ -4141,7 +4315,8 @@

    teal.slice coverage - 69.64%

    524 - 776x + 776x +
          isolate(private$teal_slice$choices)
    @@ -4197,7 +4372,8 @@

    teal.slice coverage - 69.64%

    532 - 367x + 367x +
          private$teal_slice$selected
    @@ -4246,7 +4422,8 @@

    teal.slice coverage - 69.64%

    539 - 129x + 129x +
          private$teal_slice$keep_na
    @@ -4295,7 +4472,8 @@

    teal.slice coverage - 69.64%

    546 - 117x + 117x +
          private$teal_slice$keep_inf
    @@ -4337,7 +4515,8 @@

    teal.slice coverage - 69.64%

    552 - 148x + 148x +
          isolate(isTRUE(private$teal_slice$fixed))
    @@ -4379,7 +4558,8 @@

    teal.slice coverage - 69.64%

    558 - 48x + 48x +
          isolate(isTRUE(private$teal_slice$anchored))
    @@ -4421,7 +4601,8 @@

    teal.slice coverage - 69.64%

    564 - 218x + 218x +
          isolate(isTRUE(private$teal_slice$multiple))
    @@ -4484,7 +4665,8 @@

    teal.slice coverage - 69.64%

    573 - 12x + 12x +
          private$varlabel
    @@ -4533,49 +4715,56 @@

    teal.slice coverage - 69.64%

    580 - 109x + 109x +
          varname <- private$get_varname()
    581 - 109x + 109x +
          varname_backticked <- sprintf("`%s`", varname)
    582 - 109x + 109x +
          ans <-
    583 - 109x + 109x +
            if (isTRUE(private$extract_type == "list")) {
    584 - 16x + 16x +
              sprintf("%s$%s", dataname, varname_backticked)
    585 - 109x + 109x +
            } else if (isTRUE(private$extract_type == "matrix")) {
    586 - 7x + 7x +
              sprintf("%s[, \"%s\"]", dataname, varname)
    @@ -4589,7 +4778,8 @@

    teal.slice coverage - 69.64%

    588 - 86x + 86x +
              varname_backticked
    @@ -4603,7 +4793,8 @@

    teal.slice coverage - 69.64%

    590 - 109x + 109x +
          str2lang(ans)
    @@ -4673,14 +4864,16 @@

    teal.slice coverage - 69.64%

    600 - 108x + 108x +
          if (private$na_count == 0L) {
    601 - 87x + 87x +
            return(filter_call)
    @@ -4701,42 +4894,48 @@

    teal.slice coverage - 69.64%

    604 - 21x + 21x +
          if (is.null(filter_call) && isFALSE(private$get_keep_na())) {
    605 - 2x + 2x +
            call("!", call("is.na", varname))
    606 - 19x + 19x +
          } else if (!is.null(filter_call) && isTRUE(private$get_keep_na())) {
    607 - 12x + 12x +
            call("|", call("is.na", varname), filter_call)
    608 - 7x + 7x +
          } else if (!is.null(filter_call) && isFALSE(private$get_keep_na())) {
    609 - 7x + 7x +
            call("&", call("!", call("is.na", varname)), filter_call)
    @@ -4813,7 +5012,8 @@

    teal.slice coverage - 69.64%

    620 - 11x + 11x +
          values
    @@ -4848,7 +5048,8 @@

    teal.slice coverage - 69.64%

    625 - 11x + 11x +
          values
    @@ -4911,7 +5112,8 @@

    teal.slice coverage - 69.64%

    634 - 31x + 31x +
          values
    @@ -5009,42 +5211,48 @@

    teal.slice coverage - 69.64%

    648 - 75x + 75x +
          if (private$is_choice_limited) {
    649 - 3x + 3x +
            TRUE
    650 - 72x + 72x +
          } else if (!setequal(private$get_selected(), private$get_choices())) {
    651 - 59x + 59x +
            TRUE
    652 - 13x + 13x +
          } else if (!isTRUE(private$get_keep_na()) && private$na_count > 0) {
    653 - 4x + 4x +
            TRUE
    @@ -5058,7 +5266,8 @@

    teal.slice coverage - 69.64%

    655 - 9x + 9x +
            FALSE
    @@ -5128,14 +5337,16 @@

    teal.slice coverage - 69.64%

    665 - 12x + 12x +
          ns <- NS(id)
    666 - 12x + 12x +
          uiOutput(ns("summary"), class = "filter-card-summary")
    @@ -5191,28 +5402,32 @@

    teal.slice coverage - 69.64%

    674 - 12x + 12x +
          moduleServer(
    675 - 12x + 12x +
            id = id,
    676 - 12x + 12x +
            function(input, output, session) {
    677 - 12x + 12x +
              output$summary <- renderUI(private$content_summary())
    @@ -5478,14 +5693,16 @@

    teal.slice coverage - 69.64%

    715 - 14x + 14x +
          ns <- NS(id)
    716 - 14x + 14x +
          if (private$na_count > 0) {
    @@ -5639,7 +5856,8 @@

    teal.slice coverage - 69.64%

    738 - 14x + 14x +
            NULL
    @@ -5716,7 +5934,8 @@

    teal.slice coverage - 69.64%

    749 - 12x + 12x +
          moduleServer(id, function(input, output, session) {
    @@ -5744,42 +5963,48 @@

    teal.slice coverage - 69.64%

    753 - 12x + 12x +
            output$trigger_visible <- renderUI({
    754 - 12x + 12x +
              updateCountText(
    755 - 12x + 12x +
                inputId = "count_label",
    756 - 12x + 12x +
                label = "Keep NA",
    757 - 12x + 12x +
                countmax = private$na_count,
    758 - 12x + 12x +
                countnow = private$filtered_na_count()
    @@ -5793,7 +6018,8 @@

    teal.slice coverage - 69.64%

    760 - 12x + 12x +
              NULL
    @@ -5835,35 +6061,40 @@

    teal.slice coverage - 69.64%

    766 - 12x + 12x +
            private$session_bindings[[session$ns("keep_na_api")]] <- observeEvent(
    767 - 12x + 12x +
              ignoreNULL = FALSE, # nothing selected is possible for NA
    768 - 12x + 12x +
              ignoreInit = TRUE, # ignoreInit: should not matter because we set the UI with the desired initial state
    769 - 12x + 12x +
              eventExpr = private$get_keep_na(),
    770 - 12x + 12x +
              handlerExpr = {
    @@ -5940,35 +6171,40 @@

    teal.slice coverage - 69.64%

    781 - 12x + 12x +
            private$session_bindings[[session$ns("keep_na")]] <- observeEvent(
    782 - 12x + 12x +
              ignoreNULL = FALSE, # ignoreNULL: we don't want to ignore NULL when nothing is selected in the `selectInput`
    783 - 12x + 12x +
              ignoreInit = TRUE, # ignoreInit: should not matter because we set the UI with the desired initial state
    784 - 12x + 12x +
              eventExpr = input$value,
    785 - 12x + 12x +
              handlerExpr = {
    @@ -6038,7 +6274,8 @@

    teal.slice coverage - 69.64%

    795 - 12x + 12x +
            invisible(NULL)
    @@ -6919,28 +7156,32 @@

    teal.slice coverage - 69.64%

    121 - 3x + 3x +
      checkmate::assert_multi_class(datasets, c("FilteredData", "FilterPanelAPI"))
    122 - 3x + 3x +
      checkmate::assert_class(filter, "teal_slices")
    123 - 3x + 3x +
      datasets$set_filter_state(filter)
    124 - 3x + 3x +
      invisible(NULL)
    @@ -6982,14 +7223,16 @@

    teal.slice coverage - 69.64%

    130 - 4x + 4x +
      checkmate::assert_multi_class(datasets, c("FilteredData", "FilterPanelAPI"))
    131 - 4x + 4x +
      if (isRunning()) {
    @@ -7010,7 +7253,8 @@

    teal.slice coverage - 69.64%

    134 - 4x + 4x +
        isolate(datasets$get_filter_state())
    @@ -7059,14 +7303,16 @@

    teal.slice coverage - 69.64%

    141 - 1x + 1x +
      checkmate::assert_multi_class(datasets, c("FilteredData", "FilterPanelAPI"))
    142 - 1x + 1x +
      checkmate::assert_class(filter, "teal_slices")
    @@ -7080,14 +7326,16 @@

    teal.slice coverage - 69.64%

    144 - 1x + 1x +
      datasets$remove_filter_state(filter)
    145 - 1x + 1x +
      invisible(NULL)
    @@ -7129,21 +7377,24 @@

    teal.slice coverage - 69.64%

    151 - 1x + 1x +
      checkmate::assert_multi_class(datasets, c("FilteredData", "FilterPanelAPI"))
    152 - 1x + 1x +
      datasets$clear_filter_states(force = force)
    153 - 1x + 1x +
      invisible(NULL)
    @@ -7262,56 +7513,64 @@

    teal.slice coverage - 69.64%

    170 - 2x + 2x +
      checkmate::check_class(datasets, "FilteredData")
    171 - 2x + 2x +
      checkmate::assert_character(datanames, any.missing = FALSE)
    172 - 2x + 2x +
      checkmate::assert_subset(datanames, datasets$datanames())
    173 - 2x + 2x +
      paste(
    174 - 2x + 2x +
        unlist(lapply(
    175 - 2x + 2x +
          datanames,
    176 - 2x + 2x +
          function(dataname) {
    177 - 4x + 4x +
            datasets$get_call(dataname)
    @@ -7332,7 +7591,8 @@

    teal.slice coverage - 69.64%

    180 - 2x + 2x +
        collapse = "\n"
    @@ -7737,7 +7997,8 @@

    teal.slice coverage - 69.64%

    55 - 21x + 21x +
          if (!requireNamespace("MultiAssayExperiment", quietly = TRUE)) {
    @@ -7758,21 +8019,24 @@

    teal.slice coverage - 69.64%

    58 - 21x + 21x +
          checkmate::assert_class(dataset, "MultiAssayExperiment")
    59 - 19x + 19x +
          super$initialize(dataset, dataname, keys, label)
    60 - 19x + 19x +
          experiment_names <- names(dataset)
    @@ -7793,49 +8057,56 @@

    teal.slice coverage - 69.64%

    63 - 19x + 19x +
          private$add_filter_states(
    64 - 19x + 19x +
            filter_states = init_filter_states(
    65 - 19x + 19x +
              data = dataset,
    66 - 19x + 19x +
              data_reactive = private$data_filtered_fun,
    67 - 19x + 19x +
              dataname = dataname,
    68 - 19x + 19x +
              datalabel = "subjects",
    69 - 19x + 19x +
              keys = self$get_keys()
    @@ -7849,7 +8120,8 @@

    teal.slice coverage - 69.64%

    71 - 19x + 19x +
            id = "subjects"
    @@ -7884,70 +8156,80 @@

    teal.slice coverage - 69.64%

    76 - 19x + 19x +
          lapply(
    77 - 19x + 19x +
            experiment_names,
    78 - 19x + 19x +
            function(experiment_name) {
    79 - 95x + 95x +
              data_reactive <- function(sid = "") private$data_filtered_fun(sid)[[experiment_name]]
    80 - 95x + 95x +
              private$add_filter_states(
    81 - 95x + 95x +
                filter_states = init_filter_states(
    82 - 95x + 95x +
                  data = dataset[[experiment_name]],
    83 - 95x + 95x +
                  data_reactive = data_reactive,
    84 - 95x + 95x +
                  dataname = dataname,
    85 - 95x + 95x +
                  datalabel = experiment_name
    @@ -7961,7 +8243,8 @@

    teal.slice coverage - 69.64%

    87 - 95x + 95x +
                id = experiment_name
    @@ -8052,35 +8335,40 @@

    teal.slice coverage - 69.64%

    100 - 13x + 13x +
          isolate({
    101 - 13x + 13x +
            logger::log_debug("{ class(self)[1] }$set_filter_state initializing, dataname: { private$dataname }")
    102 - 13x + 13x +
            checkmate::assert_class(state, "teal_slices")
    103 - 12x + 12x +
            lapply(state, function(x) {
    104 - 48x + 48x +
              checkmate::assert_true(x$dataname == private$dataname, .var.name = "dataname matches private$dataname")
    @@ -8108,14 +8396,16 @@

    teal.slice coverage - 69.64%

    108 - 12x + 12x +
            subject_state <- Filter(function(x) is.null(x$experiment), state)
    109 - 12x + 12x +
            private$get_filter_states()[["subjects"]]$set_filter_state(subject_state)
    @@ -8143,28 +8433,32 @@

    teal.slice coverage - 69.64%

    113 - 12x + 12x +
            experiments <- unique(unlist(lapply(state, "[[", "experiment")))
    114 - 12x + 12x +
            available_experiments <- setdiff(names(private$get_filter_states()), "subjects")
    115 - 12x + 12x +
            excluded_filters <- setdiff(experiments, available_experiments)
    116 - 12x + 12x +
            if (length(excluded_filters)) {
    @@ -8234,21 +8528,24 @@

    teal.slice coverage - 69.64%

    126 - 12x + 12x +
            lapply(available_experiments, function(experiment) {
    127 - 60x + 60x +
              slices <- Filter(function(x) identical(x$experiment, experiment), state)
    128 - 60x + 60x +
              private$get_filter_states()[[experiment]]$set_filter_state(slices)
    @@ -8269,7 +8566,8 @@

    teal.slice coverage - 69.64%

    131 - 12x + 12x +
            invisible(NULL)
    @@ -8367,7 +8665,8 @@

    teal.slice coverage - 69.64%

    145 - 1x + 1x +
          checkmate::assert_class(state, "teal_slices")
    @@ -8381,14 +8680,16 @@

    teal.slice coverage - 69.64%

    147 - 1x + 1x +
          isolate({
    148 - 1x + 1x +
            logger::log_debug("{ class(self)[1] }$remove_filter_state removing filter(s), dataname: { private$dataname }")
    @@ -8402,14 +8703,16 @@

    teal.slice coverage - 69.64%

    150 - 1x + 1x +
            subject_state <- Filter(function(x) is.null(x$experiment), state)
    151 - 1x + 1x +
            private$get_filter_states()[["subjects"]]$remove_filter_state(subject_state)
    @@ -8437,28 +8740,32 @@

    teal.slice coverage - 69.64%

    155 - 1x + 1x +
            experiments <- unique(unlist(lapply(state, "[[", "experiment")))
    156 - 1x + 1x +
            available_experiments <- setdiff(names(private$get_filter_states()), "subjects")
    157 - 1x + 1x +
            excluded_filters <- setdiff(experiments, available_experiments)
    158 - 1x + 1x +
            if (length(excluded_filters)) {
    @@ -8521,7 +8828,8 @@

    teal.slice coverage - 69.64%

    167 - 1x + 1x +
            lapply(experiments, function(experiment) {
    @@ -8563,7 +8871,8 @@

    teal.slice coverage - 69.64%

    173 - 1x + 1x +
            logger::log_debug("{ class(self)[1] }$remove_filter_state removed filter(s), dataname: { private$dataname }")
    @@ -8584,7 +8893,8 @@

    teal.slice coverage - 69.64%

    176 - 1x + 1x +
          invisible(NULL)
    @@ -8871,21 +9181,24 @@

    teal.slice coverage - 69.64%

    217 - 2x + 2x +
          data <- self$get_dataset()
    218 - 2x + 2x +
          data_filtered <- self$get_dataset(TRUE)
    219 - 2x + 2x +
          experiment_names <- names(data)
    @@ -8899,28 +9212,32 @@

    teal.slice coverage - 69.64%

    221 - 2x + 2x +
          mae_info <- data.frame(
    222 - 2x + 2x +
            dataname = private$dataname,
    223 - 2x + 2x +
            subjects = nrow(SummarizedExperiment::colData(data)),
    224 - 2x + 2x +
            subjects_filtered = nrow(SummarizedExperiment::colData(data_filtered()))
    @@ -8941,49 +9258,56 @@

    teal.slice coverage - 69.64%

    227 - 2x + 2x +
          experiment_obs_info <- do.call("rbind", lapply(
    228 - 2x + 2x +
            experiment_names,
    229 - 2x + 2x +
            function(experiment_name) {
    230 - 10x + 10x +
              data.frame(
    231 - 10x + 10x +
                dataname = sprintf("- %s", experiment_name),
    232 - 10x + 10x +
                obs = nrow(data[[experiment_name]]),
    233 - 10x + 10x +
                obs_filtered = nrow(data_filtered()[[experiment_name]])
    @@ -9018,21 +9342,24 @@

    teal.slice coverage - 69.64%

    238 - 2x + 2x +
          get_experiment_keys <- function(mae, experiment) {
    239 - 20x + 20x +
            sample_subset <- subset(MultiAssayExperiment::sampleMap(mae), colname %in% colnames(experiment))
    240 - 20x + 20x +
            length(unique(sample_subset$primary))
    @@ -9053,42 +9380,48 @@

    teal.slice coverage - 69.64%

    243 - 2x + 2x +
          experiment_subjects_info <- do.call("rbind", lapply(
    244 - 2x + 2x +
            experiment_names,
    245 - 2x + 2x +
            function(experiment_name) {
    246 - 10x + 10x +
              data.frame(
    247 - 10x + 10x +
                subjects = get_experiment_keys(data, data[[experiment_name]]),
    248 - 10x + 10x +
                subjects_filtered = get_experiment_keys(data_filtered(), data_filtered()[[experiment_name]])
    @@ -9123,14 +9456,16 @@

    teal.slice coverage - 69.64%

    253 - 2x + 2x +
          experiment_info <- cbind(experiment_obs_info, experiment_subjects_info)
    254 - 2x + 2x +
          dplyr::bind_rows(mae_info, experiment_info)
    @@ -10256,56 +10591,64 @@

    teal.slice coverage - 69.64%

    157 - 118x + 118x +
          isolate({
    158 - 118x + 118x +
            checkmate::assert_numeric(x, all.missing = FALSE)
    159 - 2x + 2x +
            if (!any(is.finite(x))) stop("\"x\" contains no finite values")
    160 - 115x + 115x +
            super$initialize(x = x, x_reactive = x_reactive, slice = slice, extract_type = extract_type)
    161 - 115x + 115x +
            private$is_integer <- checkmate::test_integerish(x)
    162 - 115x + 115x +
            private$inf_count <- sum(is.infinite(x))
    163 - 115x + 115x +
            private$inf_filtered_count <- reactive(
    164 - 115x + 115x +
              if (!is.null(private$x_reactive())) sum(is.infinite(private$x_reactive()))
    @@ -10326,14 +10669,16 @@

    teal.slice coverage - 69.64%

    167 - 115x + 115x +
            checkmate::assert_numeric(slice$choices, null.ok = TRUE)
    168 - 3x + 3x +
            if (is.null(slice$keep_inf) && any(is.infinite(x))) slice$keep_inf <- TRUE
    @@ -10347,21 +10692,24 @@

    teal.slice coverage - 69.64%

    170 - 114x + 114x +
            private$set_choices(slice$choices)
    171 - 41x + 41x +
            if (is.null(slice$selected)) slice$selected <- slice$choices
    172 - 114x + 114x +
            private$set_selected(slice$selected)
    @@ -10375,21 +10723,24 @@

    teal.slice coverage - 69.64%

    174 - 111x + 111x +
            private$is_integer <- checkmate::test_integerish(x)
    175 - 111x + 111x +
            private$inf_filtered_count <- reactive(
    176 - 111x + 111x +
              if (!is.null(private$x_reactive())) sum(is.infinite(private$x_reactive()))
    @@ -10403,7 +10754,8 @@

    teal.slice coverage - 69.64%

    178 - 111x + 111x +
            private$inf_count <- sum(is.infinite(x))
    @@ -10417,63 +10769,72 @@

    teal.slice coverage - 69.64%

    180 - 111x + 111x +
            private$plot_data <- list(
    181 - 111x + 111x +
              type = "histogram",
    182 - 111x + 111x +
              nbinsx = 50,
    183 - 111x + 111x +
              x = Filter(Negate(is.na), Filter(is.finite, private$x)),
    184 - 111x + 111x +
              color = I(fetch_bs_color("secondary")),
    185 - 111x + 111x +
              alpha = 0.2,
    186 - 111x + 111x +
              bingroup = 1,
    187 - 111x + 111x +
              showlegend = FALSE,
    188 - 111x + 111x +
              hoverinfo = "none"
    @@ -10487,21 +10848,24 @@

    teal.slice coverage - 69.64%

    190 - 111x + 111x +
            private$plot_mask <- list(list(
    191 - 111x + 111x +
              type = "rect", fillcolor = rgb(1, 1, 1, .65), line = list(width = 0),
    192 - 111x + 111x +
              x0 = -0.5, x1 = 1.5, y0 = -0.5, y1 = 1.5, xref = "paper", yref = "paper"
    @@ -10515,84 +10879,96 @@

    teal.slice coverage - 69.64%

    194 - 111x + 111x +
            private$plot_layout <- reactive({
    195 - 5x + 5x +
              shapes <- private$get_shape_properties(private$get_selected())
    196 - 5x + 5x +
              list(
    197 - 5x + 5x +
                barmode = "overlay",
    198 - 5x + 5x +
                xaxis = list(
    199 - 5x + 5x +
                  range = private$get_choices() * c(0.995, 1.005),
    200 - 5x + 5x +
                  rangeslider = list(thickness = 0),
    201 - 5x + 5x +
                  showticklabels = TRUE,
    202 - 5x + 5x +
                  ticks = "outside",
    203 - 5x + 5x +
                  ticklen = 1.5,
    204 - 5x + 5x +
                  tickmode = "auto",
    205 - 5x + 5x +
                  nticks = 10
    @@ -10606,35 +10982,40 @@

    teal.slice coverage - 69.64%

    207 - 5x + 5x +
                yaxis = list(showgrid = FALSE, showticklabels = FALSE),
    208 - 5x + 5x +
                margin = list(b = 17, l = 0, r = 0, t = 0, autoexpand = FALSE),
    209 - 5x + 5x +
                plot_bgcolor = "#FFFFFF00",
    210 - 5x + 5x +
                paper_bgcolor = "#FFFFFF00",
    211 - 5x + 5x +
                shapes = shapes
    @@ -10655,35 +11036,40 @@

    teal.slice coverage - 69.64%

    214 - 111x + 111x +
            private$plot_config <- reactive({
    215 - 5x + 5x +
              list(
    216 - 5x + 5x +
                doubleClick = "reset",
    217 - 5x + 5x +
                displayModeBar = FALSE,
    218 - 5x + 5x +
                edits = list(shapePosition = TRUE)
    @@ -10704,49 +11090,56 @@

    teal.slice coverage - 69.64%

    221 - 111x + 111x +
            private$plot_filtered <- reactive({
    222 - 5x + 5x +
              finite_values <- Filter(is.finite, private$x_reactive())
    223 - 5x + 5x +
              if (!identical(finite_values, numeric(0))) {
    224 - 5x + 5x +
                list(
    225 - 5x + 5x +
                  x = finite_values,
    226 - 5x + 5x +
                  bingroup = 1,
    227 - 5x + 5x +
                  color = I(fetch_bs_color("primary"))
    @@ -10774,7 +11167,8 @@

    teal.slice coverage - 69.64%

    231 - 111x + 111x +
            invisible(self)
    @@ -10865,14 +11259,16 @@

    teal.slice coverage - 69.64%

    244 - 35x + 35x +
          if (isFALSE(private$is_any_filtered())) {
    245 - 1x + 1x +
            return(NULL)
    @@ -10886,28 +11282,32 @@

    teal.slice coverage - 69.64%

    247 - 4x + 4x +
          if (missing(dataname)) dataname <- private$get_dataname()
    248 - 34x + 34x +
          varname <- private$get_varname_prefixed(dataname)
    249 - 34x + 34x +
          filter_call <-
    250 - 34x + 34x +
            call(
    @@ -10921,14 +11321,16 @@

    teal.slice coverage - 69.64%

    252 - 34x + 34x +
              call(">=", varname, private$get_selected()[1L]),
    253 - 34x + 34x +
              call("<=", varname, private$get_selected()[2L])
    @@ -10942,7 +11344,8 @@

    teal.slice coverage - 69.64%

    255 - 34x + 34x +
          private$add_keep_na_call(private$add_keep_inf_call(filter_call, varname), varname)
    @@ -11124,21 +11527,24 @@

    teal.slice coverage - 69.64%

    281 - 114x + 114x +
          x <- private$x[is.finite(private$x)]
    282 - 114x + 114x +
          if (is.null(choices)) {
    283 - 102x + 102x +
            choices <- range(x)
    @@ -11152,35 +11558,40 @@

    teal.slice coverage - 69.64%

    285 - 12x + 12x +
            choices_adjusted <- c(max(choices[1L], min(x)), min(choices[2L], max(x)))
    286 - 12x + 12x +
            if (any(choices != choices_adjusted)) {
    287 - 1x + 1x +
              warning(sprintf(
    288 - 1x + 1x +
                "Choices adjusted (some values outside of variable range). Varname: %s, dataname: %s.",
    289 - 1x + 1x +
                private$get_varname(), private$get_dataname()
    @@ -11194,7 +11605,8 @@

    teal.slice coverage - 69.64%

    291 - 1x + 1x +
              choices <- choices_adjusted
    @@ -11208,35 +11620,40 @@

    teal.slice coverage - 69.64%

    293 - 12x + 12x +
            if (choices[1L] > choices[2L]) {
    294 - 1x + 1x +
              warning(sprintf(
    295 - 1x + 1x +
                "Invalid choices: lower is higher / equal to upper, or not in range of variable values.
    296 - 1x + 1x +
                Setting defaults. Varname: %s, dataname: %s.",
    297 - 1x + 1x +
                private$get_varname(), private$get_dataname()
    @@ -11250,7 +11667,8 @@

    teal.slice coverage - 69.64%

    299 - 1x + 1x +
              choices <- range(x)
    @@ -11278,21 +11696,24 @@

    teal.slice coverage - 69.64%

    303 - 114x + 114x +
          private$set_is_choice_limited(private$x, choices)
    304 - 114x + 114x +
          private$x <- private$x[
    305 - 114x + 114x +
            (private$x >= choices[1L] & private$x <= choices[2L]) | is.na(private$x) | !is.finite(private$x)
    @@ -11313,7 +11734,8 @@

    teal.slice coverage - 69.64%

    308 - 114x + 114x +
          x_range <- range(private$x, finite = TRUE)
    @@ -11334,14 +11756,16 @@

    teal.slice coverage - 69.64%

    311 - 114x + 114x +
          if (identical(diff(x_range), 0)) {
    312 - 2x + 2x +
            choices <- x_range
    @@ -11355,21 +11779,24 @@

    teal.slice coverage - 69.64%

    314 - 112x + 112x +
            x_pretty <- pretty(x_range, 100L)
    315 - 112x + 112x +
            choices <- range(x_pretty)
    316 - 112x + 112x +
            private$numeric_step <- signif(private$get_pretty_range_step(x_pretty), digits = 10)
    @@ -11383,14 +11810,16 @@

    teal.slice coverage - 69.64%

    318 - 114x + 114x +
          private$teal_slice$choices <- choices
    319 - 114x + 114x +
          invisible(NULL)
    @@ -11432,28 +11861,32 @@

    teal.slice coverage - 69.64%

    325 - 114x + 114x +
          xl <- xl[!is.na(xl)]
    326 - 114x + 114x +
          xl <- xl[is.finite(xl)]
    327 - 114x + 114x +
          private$is_choice_limited <- (any(xl < choices[1L]) | any(xl > choices[2L]))
    328 - 114x + 114x +
          invisible(NULL)
    @@ -11495,14 +11928,16 @@

    teal.slice coverage - 69.64%

    334 - 34x + 34x +
          if (isTRUE(private$get_keep_inf())) {
    335 - 2x + 2x +
            call("|", call("is.infinite", varname), filter_call)
    @@ -11516,7 +11951,8 @@

    teal.slice coverage - 69.64%

    337 - 32x + 32x +
            filter_call
    @@ -11579,14 +12015,16 @@

    teal.slice coverage - 69.64%

    346 - 114x + 114x +
          if (private$is_integer && diff(range(pretty_range) > 2)) {
    347 - 46x + 46x +
            return(1L)
    @@ -11600,14 +12038,16 @@

    teal.slice coverage - 69.64%

    349 - 68x + 68x +
            n_steps <- length(pretty_range) - 1
    350 - 68x + 68x +
            return(signif(digits = 10, (max(pretty_range) - min(pretty_range)) / n_steps))
    @@ -11635,35 +12075,40 @@

    teal.slice coverage - 69.64%

    354 - 130x + 130x +
          tryCatch(
    355 - 130x + 130x +
            expr = {
    356 - 130x + 130x +
              values <- as.numeric(values)
    357 - 4x + 4x +
              if (anyNA(values)) stop()
    358 - 126x + 126x +
              values
    @@ -11677,7 +12122,8 @@

    teal.slice coverage - 69.64%

    360 - 130x + 130x +
            error = function(e) stop("Vector of set values must contain values coercible to numeric")
    @@ -11712,21 +12158,24 @@

    teal.slice coverage - 69.64%

    365 - 2x + 2x +
          if (length(values) != 2L) stop("Vector of set values must have length two.")
    366 - 2x + 2x +
          if (values[1L] > values[2L]) stop("Vector of set values must be sorted.")
    367 - 122x + 122x +
          values
    @@ -11754,21 +12203,24 @@

    teal.slice coverage - 69.64%

    371 - 2x + 2x +
          if (values[1L] < private$get_choices()[1L]) values[1L] <- private$get_choices()[1L]
    372 - 2x + 2x +
          if (values[2L] > private$get_choices()[2L]) values[2L] <- private$get_choices()[2L]
    373 - 122x + 122x +
          values
    @@ -11810,35 +12262,40 @@

    teal.slice coverage - 69.64%

    379 - 35x + 35x +
          if (private$is_choice_limited) {
    380 - 1x + 1x +
            TRUE
    381 - 34x + 34x +
          } else if (!isTRUE(all.equal(private$get_selected(), private$get_choices()))) {
    382 - 32x + 32x +
            TRUE
    383 - 2x + 2x +
          } else if (!isTRUE(private$get_keep_inf()) && private$inf_count > 0) {
    @@ -11852,14 +12309,16 @@

    teal.slice coverage - 69.64%

    385 - 2x + 2x +
          } else if (!isTRUE(private$get_keep_na()) && private$na_count > 0) {
    386 - 1x + 1x +
            TRUE
    @@ -11873,7 +12332,8 @@

    teal.slice coverage - 69.64%

    388 - 1x + 1x +
            FALSE
    @@ -11922,21 +12382,24 @@

    teal.slice coverage - 69.64%

    395 - 5x + 5x +
          list(
    396 - 5x + 5x +
            list(type = "line", x0 = values[1], x1 = values[1], y0 = -100, y1 = 100, yref = "paper"),
    397 - 5x + 5x +
            list(type = "line", x0 = values[2], x1 = values[2], y0 = -100, y1 = 100, yref = "paper")
    @@ -12013,70 +12476,80 @@

    teal.slice coverage - 69.64%

    408 - 5x + 5x +
          ns <- NS(id)
    409 - 5x + 5x +
          isolate({
    410 - 5x + 5x +
            ui_input <- shinyWidgets::numericRangeInput(
    411 - 5x + 5x +
              inputId = ns("selection_manual"),
    412 - 5x + 5x +
              label = NULL,
    413 - 5x + 5x +
              min = private$get_choices()[1L],
    414 - 5x + 5x +
              max = private$get_choices()[2L],
    415 - 5x + 5x +
              value = private$get_selected(),
    416 - 5x + 5x +
              step = private$numeric_step,
    417 - 5x + 5x +
              width = "100%"
    @@ -12090,28 +12563,32 @@

    teal.slice coverage - 69.64%

    419 - 5x + 5x +
            tagList(
    420 - 5x + 5x +
              tags$div(
    421 - 5x + 5x +
                class = "choices_state",
    422 - 5x + 5x +
                tags$head(tags$script(
    @@ -12139,21 +12616,24 @@

    teal.slice coverage - 69.64%

    426 - 5x + 5x +
                  HTML(
    427 - 5x + 5x +
                    '$(document).ready(function() {
    428 - 5x + 5x +
                      $("[data-toggle=\'popover\']").popover();
    @@ -12167,35 +12647,40 @@

    teal.slice coverage - 69.64%

    430 - 5x + 5x +
                      $(document).on("click", function (e) {
    431 - 5x + 5x +
                        if (!$("[data-toggle=\'popover\']").is(e.target) &&
    432 - 5x + 5x +
                            $("[data-toggle=\'popover\']").has(e.target).length === 0 &&
    433 - 5x + 5x +
                            $(".popover").has(e.target).length === 0) {
    434 - 5x + 5x +
                          $("[data-toggle=\'popover\']").popover("hide");
    @@ -12237,105 +12722,120 @@

    teal.slice coverage - 69.64%

    440 - 5x + 5x +
                tags$div(
    441 - 5x + 5x +
                  actionLink(
    442 - 5x + 5x +
                    ns("plotly_info"),
    443 - 5x + 5x +
                    label = NULL,
    444 - 5x + 5x +
                    icon = icon("question-circle"),
    445 - 5x + 5x +
                    "data-toggle" = "popover",
    446 - 5x + 5x +
                    "data-html" = "true",
    447 - 5x + 5x +
                    "data-placement" = "left",
    448 - 5x + 5x +
                    "data-trigger" = "click",
    449 - 5x + 5x +
                    "data-title" = "Plot actions",
    450 - 5x + 5x +
                    "data-content" = "<p>
    451 - 5x + 5x +
                                      Drag vertical lines to set selection.<br>
    452 - 5x + 5x +
                                      Drag across plot to zoom in.<br>
    453 - 5x + 5x +
                                      Drag axis to pan.<br>
    454 - 5x + 5x +
                                      Double click to zoom out."
    @@ -12349,7 +12849,8 @@

    teal.slice coverage - 69.64%

    456 - 5x + 5x +
                  style = "text-align: right; font-size: 0.7em; margin-bottom: -1em; position: relative; z-index: 9;"
    @@ -12363,35 +12864,40 @@

    teal.slice coverage - 69.64%

    458 - 5x + 5x +
                shinycssloaders::withSpinner(
    459 - 5x + 5x +
                  plotly::plotlyOutput(ns("plot"), height = "50px"),
    460 - 5x + 5x +
                  type = 4,
    461 - 5x + 5x +
                  size = 0.25,
    462 - 5x + 5x +
                  hide.ui = FALSE
    @@ -12405,7 +12911,8 @@

    teal.slice coverage - 69.64%

    464 - 5x + 5x +
                ui_input
    @@ -12419,28 +12926,32 @@

    teal.slice coverage - 69.64%

    466 - 5x + 5x +
              tags$div(
    467 - 5x + 5x +
                class = "filter-card-body-keep-na-inf",
    468 - 5x + 5x +
                private$keep_inf_ui(ns("keep_inf")),
    469 - 5x + 5x +
                private$keep_na_ui(ns("keep_na"))
    @@ -12517,28 +13028,32 @@

    teal.slice coverage - 69.64%

    480 - 5x + 5x +
          moduleServer(
    481 - 5x + 5x +
            id = id,
    482 - 5x + 5x +
            function(input, output, session) {
    483 - 5x + 5x +
              logger::log_debug("RangeFilterState$server initializing, id: { private$get_id() }")
    @@ -12559,7 +13074,8 @@

    teal.slice coverage - 69.64%

    486 - 5x + 5x +
              selection_manual <- debounce(reactive(input$selection_manual), 200)
    @@ -12580,7 +13096,8 @@

    teal.slice coverage - 69.64%

    489 - 5x + 5x +
              plot_data <- c(private$plot_data, source = session$ns("histogram_plot"))
    @@ -12594,7 +13111,8 @@

    teal.slice coverage - 69.64%

    491 - 5x + 5x +
              trigger_event_data <- reactiveVal(NULL)
    @@ -12615,49 +13133,56 @@

    teal.slice coverage - 69.64%

    494 - 5x + 5x +
              output$plot <- plotly::renderPlotly({
    495 - 5x + 5x +
                histogram <- do.call(plotly::plot_ly, plot_data)
    496 - 5x + 5x +
                histogram <- do.call(plotly::layout, c(list(p = histogram), private$plot_layout()))
    497 - 5x + 5x +
                histogram <- do.call(plotly::config, c(list(p = histogram), private$plot_config()))
    498 - 5x + 5x +
                histogram <- do.call(plotly::add_histogram, c(list(p = histogram), private$plot_filtered()))
    499 - 5x + 5x +
                trigger_event_data(TRUE)
    500 - 5x + 5x +
                histogram
    @@ -12678,21 +13203,24 @@

    teal.slice coverage - 69.64%

    503 - 5x + 5x +
              relayout_data <- reactive({
    504 - 3x + 3x +
                req(trigger_event_data())
    505 - 3x + 3x +
                plotly::event_data("plotly_relayout", source = session$ns("histogram_plot"))
    @@ -12720,56 +13248,64 @@

    teal.slice coverage - 69.64%

    509 - 5x + 5x +
              private$session_bindings[[session$ns("relayout")]] <- observeEvent(
    510 - 5x + 5x +
                ignoreNULL = FALSE,
    511 - 5x + 5x +
                ignoreInit = TRUE,
    512 - 5x + 5x +
                eventExpr = relayout_data(),
    513 - 5x + 5x +
                handlerExpr = {
    514 - 1x + 1x +
                  logger::log_debug("RangeFilterState$server@1 selection changed, id: { private$get_id() }")
    515 - 1x + 1x +
                  event <- relayout_data()
    516 - 1x + 1x +
                  if (any(grepl("shapes", names(event)))) {
    @@ -12958,35 +13494,40 @@

    teal.slice coverage - 69.64%

    543 - 5x + 5x +
              private$session_bindings[[session$ns("selection_api")]] <- observeEvent(
    544 - 5x + 5x +
                ignoreNULL = FALSE,
    545 - 5x + 5x +
                ignoreInit = TRUE,
    546 - 5x + 5x +
                eventExpr = private$get_selected(),
    547 - 5x + 5x +
                handlerExpr = {
    @@ -13077,35 +13618,40 @@

    teal.slice coverage - 69.64%

    560 - 5x + 5x +
              private$session_bindings[[session$ns("selection_manual")]] <- observeEvent(
    561 - 5x + 5x +
                ignoreNULL = FALSE,
    562 - 5x + 5x +
                ignoreInit = TRUE,
    563 - 5x + 5x +
                eventExpr = selection_manual(),
    564 - 5x + 5x +
                handlerExpr = {
    @@ -13371,14 +13917,16 @@

    teal.slice coverage - 69.64%

    602 - 5x + 5x +
              private$keep_inf_srv("keep_inf")
    603 - 5x + 5x +
              private$keep_na_srv("keep_na")
    @@ -13392,7 +13940,8 @@

    teal.slice coverage - 69.64%

    605 - 5x + 5x +
              NULL
    @@ -13672,42 +14221,48 @@

    teal.slice coverage - 69.64%

    645 - 5x + 5x +
          selection <- private$get_selected()
    646 - 5x + 5x +
          tagList(
    647 - 5x + 5x +
            tags$span(HTML(selection[1], "&ndash;", selection[2]), class = "filter-card-summary-value"),
    648 - 5x + 5x +
            tags$span(
    649 - 5x + 5x +
              class = "filter-card-summary-controls",
    650 - 5x + 5x +
              if (private$na_count > 0) {
    @@ -13728,7 +14283,8 @@

    teal.slice coverage - 69.64%

    653 - 5x + 5x +
              if (private$inf_count > 0) {
    @@ -13812,7 +14368,8 @@

    teal.slice coverage - 69.64%

    665 - 5x + 5x +
          ns <- NS(id)
    @@ -13826,7 +14383,8 @@

    teal.slice coverage - 69.64%

    667 - 5x + 5x +
          if (private$inf_count > 0) {
    @@ -13966,7 +14524,8 @@

    teal.slice coverage - 69.64%

    687 - 5x + 5x +
            NULL
    @@ -14043,7 +14602,8 @@

    teal.slice coverage - 69.64%

    698 - 5x + 5x +
          moduleServer(id, function(input, output, session) {
    @@ -14071,42 +14631,48 @@

    teal.slice coverage - 69.64%

    702 - 5x + 5x +
            output$trigger_visible <- renderUI({
    703 - 5x + 5x +
              updateCountText(
    704 - 5x + 5x +
                inputId = "count_label",
    705 - 5x + 5x +
                label = "Keep Inf",
    706 - 5x + 5x +
                countmax = private$inf_count,
    707 - 5x + 5x +
                countnow = private$inf_filtered_count()
    @@ -14120,7 +14686,8 @@

    teal.slice coverage - 69.64%

    709 - 5x + 5x +
              NULL
    @@ -14162,35 +14729,40 @@

    teal.slice coverage - 69.64%

    715 - 5x + 5x +
            private$session_bindings[[session$ns("keep_inf_api")]] <- observeEvent(
    716 - 5x + 5x +
              ignoreNULL = TRUE, # its not possible for range that NULL is selected
    717 - 5x + 5x +
              ignoreInit = TRUE, # ignoreInit: should not matter because we set the UI with the desired initial state
    718 - 5x + 5x +
              eventExpr = private$get_keep_inf(),
    719 - 5x + 5x +
              handlerExpr = {
    @@ -14267,35 +14839,40 @@

    teal.slice coverage - 69.64%

    730 - 5x + 5x +
            private$session_bindings[[session$ns("keep_inf")]] <- observeEvent(
    731 - 5x + 5x +
              ignoreNULL = TRUE, # it's not possible for range that NULL is selected
    732 - 5x + 5x +
              ignoreInit = TRUE, # ignoreInit: should not matter because we set the UI with the desired initial state
    733 - 5x + 5x +
              eventExpr = input$value,
    734 - 5x + 5x +
              handlerExpr = {
    @@ -14344,7 +14921,8 @@

    teal.slice coverage - 69.64%

    741 - 5x + 5x +
            invisible(NULL)
    @@ -15288,28 +15866,32 @@

    teal.slice coverage - 69.64%

    130 - 16x + 16x +
          isolate({
    131 - 16x + 16x +
            checkmate::assert_logical(x)
    132 - 15x + 15x +
            checkmate::assert_logical(slice$selected, null.ok = TRUE)
    133 - 14x + 14x +
            super$initialize(x = x, x_reactive = x_reactive, slice = slice, extract_type = extract_type)
    @@ -15323,7 +15905,8 @@

    teal.slice coverage - 69.64%

    135 - 14x + 14x +
            private$set_choices(slice$choices)
    @@ -15337,28 +15920,32 @@

    teal.slice coverage - 69.64%

    137 - 14x + 14x +
            if (is.null(slice$selected) && slice$multiple) {
    138 - 7x + 7x +
              slice$selected <- private$get_choices()
    139 - 7x + 7x +
            } else if (length(slice$selected) != 1 && !slice$multiple) {
    140 - 3x + 3x +
              slice$selected <- TRUE
    @@ -15372,28 +15959,32 @@

    teal.slice coverage - 69.64%

    142 - 14x + 14x +
            private$set_selected(slice$selected)
    143 - 14x + 14x +
            df <- factor(x, levels = c(TRUE, FALSE))
    144 - 14x + 14x +
            tbl <- table(df)
    145 - 14x + 14x +
            private$set_choices_counts(tbl)
    @@ -15407,7 +15998,8 @@

    teal.slice coverage - 69.64%

    147 - 14x + 14x +
          invisible(self)
    @@ -15477,7 +16069,8 @@

    teal.slice coverage - 69.64%

    157 - 6x + 6x +
          if (isFALSE(private$is_any_filtered())) {
    @@ -15498,28 +16091,32 @@

    teal.slice coverage - 69.64%

    160 - 4x + 4x +
          if (missing(dataname)) dataname <- private$get_dataname()
    161 - 6x + 6x +
          varname <- private$get_varname_prefixed(dataname)
    162 - 6x + 6x +
          choices <- private$get_selected()
    163 - 6x + 6x +
          n_choices <- length(choices)
    @@ -15533,35 +16130,40 @@

    teal.slice coverage - 69.64%

    165 - 6x + 6x +
          filter_call <-
    166 - 6x + 6x +
            if (n_choices == 1 && choices) {
    167 - 1x + 1x +
              varname
    168 - 6x + 6x +
            } else if (n_choices == 1 && !choices) {
    169 - 4x + 4x +
              call("!", varname)
    @@ -15575,7 +16177,8 @@

    teal.slice coverage - 69.64%

    171 - 1x + 1x +
              call("%in%", varname, make_c_call(choices))
    @@ -15589,7 +16192,8 @@

    teal.slice coverage - 69.64%

    173 - 6x + 6x +
          private$add_keep_na_call(filter_call, varname)
    @@ -15659,14 +16263,16 @@

    teal.slice coverage - 69.64%

    183 - 14x + 14x +
          private$teal_slice$choices <- c(TRUE, FALSE)
    184 - 14x + 14x +
          invisible(NULL)
    @@ -15701,14 +16307,16 @@

    teal.slice coverage - 69.64%

    189 - 14x + 14x +
          private$choices_counts <- choices_counts
    190 - 14x + 14x +
          invisible(NULL)
    @@ -15729,35 +16337,40 @@

    teal.slice coverage - 69.64%

    193 - 21x + 21x +
          tryCatch(
    194 - 21x + 21x +
            expr = {
    195 - 21x + 21x +
              values <- as.logical(values)
    196 - 1x + 1x +
              if (anyNA(values)) stop()
    197 - 20x + 20x +
              values
    @@ -15771,7 +16384,8 @@

    teal.slice coverage - 69.64%

    199 - 21x + 21x +
            error = function(e) stop("Vector of set values must contain values coercible to logical.")
    @@ -15806,28 +16420,32 @@

    teal.slice coverage - 69.64%

    204 - 20x + 20x +
          if (!private$is_multiple() && length(values) > 1) {
    205 - 1x + 1x +
            warning(
    206 - 1x + 1x +
              sprintf("Selection: %s is not a vector of length one. ", toString(values, width = 360)),
    207 - 1x + 1x +
              "Maintaining previous selection."
    @@ -15841,7 +16459,8 @@

    teal.slice coverage - 69.64%

    209 - 1x + 1x +
            values <- isolate(private$get_selected())
    @@ -15855,7 +16474,8 @@

    teal.slice coverage - 69.64%

    211 - 20x + 20x +
          values
    @@ -15897,7 +16517,8 @@

    teal.slice coverage - 69.64%

    217 - 6x + 6x +
          if (private$is_choice_limited) {
    @@ -15911,14 +16532,16 @@

    teal.slice coverage - 69.64%

    219 - 6x + 6x +
          } else if (all(private$choices_counts > 0)) {
    220 - 6x + 6x +
            TRUE
    @@ -17695,35 +18318,40 @@

    teal.slice coverage - 69.64%

    66 - 187x + 187x +
      checkmate::assert_class(x_reactive, "reactive")
    67 - 186x + 186x +
      checkmate::assert_character(extract_type, max.len = 1, any.missing = FALSE)
    68 - 186x + 186x +
      checkmate::assert_class(slice, "teal_slice")
    69 - 185x + 185x +
      if (length(extract_type) == 1) {
    70 - 40x + 40x +
        checkmate::assert_choice(extract_type, choices = c("list", "matrix"))
    @@ -17744,42 +18372,48 @@

    teal.slice coverage - 69.64%

    73 - 184x + 184x +
      if (all(is.na(x))) {
    74 - 1x + 1x +
        EmptyFilterState$new(
    75 - 1x + 1x +
          x = x,
    76 - 1x + 1x +
          x_reactive = x_reactive,
    77 - 1x + 1x +
          slice = slice,
    78 - 1x + 1x +
          extract_type = extract_type
    @@ -17800,7 +18434,8 @@

    teal.slice coverage - 69.64%

    81 - 183x + 183x +
        UseMethod("init_filter_state")
    @@ -17870,35 +18505,40 @@

    teal.slice coverage - 69.64%

    91 - 1x + 1x +
      args <- list(
    92 - 1x + 1x +
        x = x,
    93 - 1x + 1x +
        x_reactive = x_reactive,
    94 - 1x + 1x +
        extract_type = extract_type,
    95 - 1x + 1x +
        slice
    @@ -17919,7 +18559,8 @@

    teal.slice coverage - 69.64%

    98 - 1x + 1x +
      do.call(FilterState$new, args)
    @@ -17982,35 +18623,40 @@

    teal.slice coverage - 69.64%

    107 - 1x + 1x +
      LogicalFilterState$new(
    108 - 1x + 1x +
        x = x,
    109 - 1x + 1x +
        x_reactive = x_reactive,
    110 - 1x + 1x +
        slice = slice,
    111 - 1x + 1x +
        extract_type = extract_type
    @@ -18080,35 +18726,40 @@

    teal.slice coverage - 69.64%

    121 - 115x + 115x +
      args <- list(
    122 - 115x + 115x +
        x = x,
    123 - 115x + 115x +
        x_reactive = x_reactive,
    124 - 115x + 115x +
        slice = slice,
    125 - 115x + 115x +
        extract_type = extract_type
    @@ -18129,14 +18780,16 @@

    teal.slice coverage - 69.64%

    128 - 115x + 115x +
      if (length(unique(x[!is.na(x)])) < getOption("teal.threshold_slider_vs_checkboxgroup")) {
    129 - 26x + 26x +
        do.call(ChoicesFilterState$new, args)
    @@ -18150,7 +18803,8 @@

    teal.slice coverage - 69.64%

    131 - 89x + 89x +
        do.call(RangeFilterState$new, args)
    @@ -18220,35 +18874,40 @@

    teal.slice coverage - 69.64%

    141 - 30x + 30x +
      ChoicesFilterState$new(
    142 - 30x + 30x +
        x = x,
    143 - 30x + 30x +
        x_reactive = x_reactive,
    144 - 30x + 30x +
        slice = slice,
    145 - 30x + 30x +
        extract_type = extract_type
    @@ -18318,35 +18977,40 @@

    teal.slice coverage - 69.64%

    155 - 30x + 30x +
      ChoicesFilterState$new(
    156 - 30x + 30x +
        x = x,
    157 - 30x + 30x +
        x_reactive = x_reactive,
    158 - 30x + 30x +
        slice = slice,
    159 - 30x + 30x +
        extract_type = extract_type
    @@ -18416,35 +19080,40 @@

    teal.slice coverage - 69.64%

    169 - 2x + 2x +
      args <- list(
    170 - 2x + 2x +
        x = x,
    171 - 2x + 2x +
        x_reactive = x_reactive,
    172 - 2x + 2x +
        slice = slice,
    173 - 2x + 2x +
        extract_type = extract_type
    @@ -18465,14 +19134,16 @@

    teal.slice coverage - 69.64%

    176 - 2x + 2x +
      if (length(unique(x[!is.na(x)])) < getOption("teal.threshold_slider_vs_checkboxgroup")) {
    177 - 1x + 1x +
        do.call(ChoicesFilterState$new, args)
    @@ -18486,7 +19157,8 @@

    teal.slice coverage - 69.64%

    179 - 1x + 1x +
        do.call(DateFilterState$new, args)
    @@ -18556,35 +19228,40 @@

    teal.slice coverage - 69.64%

    189 - 2x + 2x +
      args <- list(
    190 - 2x + 2x +
        x = x,
    191 - 2x + 2x +
        x_reactive = x_reactive,
    192 - 2x + 2x +
        slice = slice,
    193 - 2x + 2x +
        extract_type = extract_type
    @@ -18605,14 +19282,16 @@

    teal.slice coverage - 69.64%

    196 - 2x + 2x +
      if (length(unique(x[!is.na(x)])) < getOption("teal.threshold_slider_vs_checkboxgroup")) {
    197 - 1x + 1x +
        do.call(ChoicesFilterState$new, args)
    @@ -18626,7 +19305,8 @@

    teal.slice coverage - 69.64%

    199 - 1x + 1x +
        do.call(DatetimeFilterState$new, args)
    @@ -18696,35 +19376,40 @@

    teal.slice coverage - 69.64%

    209 - 2x + 2x +
      args <- list(
    210 - 2x + 2x +
        x = x,
    211 - 2x + 2x +
        x_reactive = x_reactive,
    212 - 2x + 2x +
        slice = slice,
    213 - 2x + 2x +
        extract_type = extract_type
    @@ -18745,14 +19430,16 @@

    teal.slice coverage - 69.64%

    216 - 2x + 2x +
      if (length(unique(x[!is.na(x)])) < getOption("teal.threshold_slider_vs_checkboxgroup")) {
    217 - 1x + 1x +
        do.call(ChoicesFilterState$new, args)
    @@ -18766,7 +19453,8 @@

    teal.slice coverage - 69.64%

    219 - 1x + 1x +
        do.call(DatetimeFilterState$new, args)
    @@ -18857,7 +19545,8 @@

    teal.slice coverage - 69.64%

    232 - 6x + 6x +
      FilterStateExpr$new(slice)
    @@ -19025,28 +19714,32 @@

    teal.slice coverage - 69.64%

    256 - 116x + 116x +
      checkmate::assert_string(color)
    257 - 116x + 116x +
      checkmate::assert(
    258 - 116x + 116x +
        checkmate::check_number(alpha, lower = 0, upper = 1, null.ok = TRUE),
    259 - 116x + 116x +
        checkmate::check_string(alpha, pattern = "[0-9a-f]{2}", null.ok = TRUE)
    @@ -19074,7 +19767,8 @@

    teal.slice coverage - 69.64%

    263 - 116x + 116x +
      sass_file <- if (utils::packageVersion("bslib") < as.package_version("0.5.1.9000")) {
    @@ -19095,7 +19789,8 @@

    teal.slice coverage - 69.64%

    266 - 116x + 116x +
        bslib::bs_theme()[["layers"]][[2]][["defaults"]][[1]][[1]]
    @@ -19109,7 +19804,8 @@

    teal.slice coverage - 69.64%

    268 - 116x + 116x +
      sass_file <- attr(sass_file, "sass_file_path")
    @@ -19130,7 +19826,8 @@

    teal.slice coverage - 69.64%

    271 - 116x + 116x +
      variables_file <- readLines(sass_file)
    @@ -19144,14 +19841,16 @@

    teal.slice coverage - 69.64%

    273 - 116x + 116x +
      ind <- grep("// scss-docs-(start|end) theme-color-variables", variables_file)
    274 - 116x + 116x +
      color_definitions <- variables_file[(ind[1] + 1L):(ind[2] - 1L)]
    @@ -19172,7 +19871,8 @@

    teal.slice coverage - 69.64%

    277 - 116x + 116x +
      color_names <- sub("(\\$)(\\w.+)(:.+)", "\\2", color_definitions)
    @@ -19193,7 +19893,8 @@

    teal.slice coverage - 69.64%

    280 - 116x + 116x +
      checkmate::assert_choice(color, color_names)
    @@ -19214,7 +19915,8 @@

    teal.slice coverage - 69.64%

    283 - 116x + 116x +
      color_references <- sub("(\\$)(\\w.+)(:\\s.+\\$)(\\w.+)(\\s.+)", "\\4", color_definitions)
    @@ -19235,42 +19937,48 @@

    teal.slice coverage - 69.64%

    286 - 116x + 116x +
      color_specification <- structure(color_references, names = color_names)
    287 - 116x + 116x +
      color_specification <- vapply(color_specification, function(x) {
    288 - 928x + 928x +
        line <- grep(sprintf("^\\$%s:\\s+#\\w{6}\\s+!default", x), variables_file, value = TRUE)
    289 - 928x + 928x +
        code <- sub("(.+)(#\\w{6})(\\s+.+)", "\\2", line)
    290 - 928x + 928x +
        code
    291 - 116x + 116x +
      }, character(1L))
    @@ -19284,7 +19992,8 @@

    teal.slice coverage - 69.64%

    293 - 116x + 116x +
      if (!is.null(alpha)) {
    @@ -19312,7 +20021,8 @@

    teal.slice coverage - 69.64%

    297 - 116x + 116x +
      paste0(color_specification[color], alpha)
    @@ -19696,28 +20406,32 @@

    teal.slice coverage - 69.64%

    53 - 258x + 258x +
          checkmate::assert_string(dataname)
    54 - 256x + 256x +
          logger::log_debug("Instantiating { class(self)[1] }, dataname: { dataname }")
    55 - 256x + 256x +
          checkmate::assert_function(data_reactive, args = "sid")
    56 - 256x + 256x +
          checkmate::assert_string(datalabel, null.ok = TRUE)
    @@ -19731,28 +20445,32 @@

    teal.slice coverage - 69.64%

    58 - 256x + 256x +
          private$dataname <- dataname
    59 - 256x + 256x +
          private$datalabel <- datalabel
    60 - 256x + 256x +
          private$dataname_prefixed <- if (identical(dataname, make.names(dataname))) {
    61 - 256x + 256x +
            dataname
    @@ -19780,28 +20498,32 @@

    teal.slice coverage - 69.64%

    65 - 256x + 256x +
          private$data <- data
    66 - 256x + 256x +
          private$data_reactive <- data_reactive
    67 - 256x + 256x +
          private$state_list <- reactiveVal()
    68 - 256x + 256x +
          invisible(self)
    @@ -20249,21 +20971,24 @@

    teal.slice coverage - 69.64%

    132 - 88x + 88x +
          states_list <- private$state_list_get()
    133 - 88x + 88x +
          if (length(states_list) == 0) {
    134 - 52x + 52x +
            return(NULL)
    @@ -20277,35 +21002,40 @@

    teal.slice coverage - 69.64%

    136 - 36x + 36x +
          args <- vapply(
    137 - 36x + 36x +
            states_list,
    138 - 36x + 36x +
            function(x) {
    139 - 57x + 57x +
              arg <- x$get_state()$arg
    140 - 7x + 7x +
              `if`(is.null(arg), "", arg) # converting NULL -> "" to enable tapply.
    @@ -20319,7 +21049,8 @@

    teal.slice coverage - 69.64%

    142 - 36x + 36x +
            character(1)
    @@ -20340,35 +21071,40 @@

    teal.slice coverage - 69.64%

    145 - 36x + 36x +
          filter_items <- tapply(
    146 - 36x + 36x +
            X = states_list,
    147 - 36x + 36x +
            INDEX = args,
    148 - 36x + 36x +
            simplify = FALSE,
    149 - 36x + 36x +
            function(items) {
    @@ -20382,14 +21118,16 @@

    teal.slice coverage - 69.64%

    151 - 38x + 38x +
              other_filter_idx <- !names(items) %in% sid
    152 - 38x + 38x +
              filtered_items <- items[other_filter_idx]
    @@ -20403,42 +21141,48 @@

    teal.slice coverage - 69.64%

    154 - 38x + 38x +
              calls <- Filter(
    155 - 38x + 38x +
                Negate(is.null),
    156 - 38x + 38x +
                lapply(
    157 - 38x + 38x +
                  filtered_items,
    158 - 38x + 38x +
                  function(state) {
    159 - 51x + 51x +
                    state$get_call(dataname = private$dataname_prefixed)
    @@ -20466,7 +21210,8 @@

    teal.slice coverage - 69.64%

    163 - 38x + 38x +
              calls_combine_by(calls, operator = "&")
    @@ -20487,21 +21232,24 @@

    teal.slice coverage - 69.64%

    166 - 36x + 36x +
          filter_items <- Filter(
    167 - 36x + 36x +
            x = filter_items,
    168 - 36x + 36x +
            f = Negate(is.null)
    @@ -20515,21 +21263,24 @@

    teal.slice coverage - 69.64%

    170 - 36x + 36x +
          if (length(filter_items) > 0L) {
    171 - 35x + 35x +
            filter_function <- private$fun
    172 - 35x + 35x +
            data_name <- tryCatch(
    @@ -20543,7 +21294,8 @@

    teal.slice coverage - 69.64%

    174 - 35x + 35x +
                str2lang(private$dataname_prefixed)
    @@ -20557,7 +21309,8 @@

    teal.slice coverage - 69.64%

    176 - 35x + 35x +
              error = function(e) str2lang(paste0("`", private$dataname_prefixed, "`"))
    @@ -20571,28 +21324,32 @@

    teal.slice coverage - 69.64%

    178 - 35x + 35x +
            substitute(
    179 - 35x + 35x +
              env = list(
    180 - 35x + 35x +
                lhs = data_name,
    181 - 35x + 35x +
                rhs = as.call(c(filter_function, c(list(data_name), filter_items)))
    @@ -20606,7 +21363,8 @@

    teal.slice coverage - 69.64%

    183 - 35x + 35x +
              expr = lhs <- rhs
    @@ -20634,7 +21392,8 @@

    teal.slice coverage - 69.64%

    187 - 1x + 1x +
            NULL
    @@ -20788,35 +21547,40 @@

    teal.slice coverage - 69.64%

    209 - 17x + 17x +
          checkmate::assert_class(state, "teal_slices")
    210 - 17x + 17x +
          isolate({
    211 - 17x + 17x +
            state_ids <- vapply(state, `[[`, character(1), "id")
    212 - 17x + 17x +
            logger::log_debug("{ class(self)[1] }$remove_filter_state removing filters, state_id: { toString(state_ids) }")
    213 - 17x + 17x +
            private$state_list_remove(state_ids)
    @@ -20830,7 +21594,8 @@

    teal.slice coverage - 69.64%

    215 - 17x + 17x +
          invisible(NULL)
    @@ -20914,14 +21679,16 @@

    teal.slice coverage - 69.64%

    227 - 306x + 306x +
          slices <- unname(lapply(private$state_list(), function(x) x$get_state()))
    228 - 306x + 306x +
          fs <- do.call(teal_slices, c(slices, list(count_type = private$count_type)))
    @@ -20935,35 +21702,40 @@

    teal.slice coverage - 69.64%

    230 - 306x + 306x +
          include_varnames <- private$include_varnames
    231 - 306x + 306x +
          if (length(include_varnames)) {
    232 - 180x + 180x +
            attr(fs, "include_varnames") <- structure(
    233 - 180x + 180x +
              list(include_varnames),
    234 - 180x + 180x +
              names = private$dataname
    @@ -20991,35 +21763,40 @@

    teal.slice coverage - 69.64%

    238 - 306x + 306x +
          exclude_varnames <- private$exclude_varnames
    239 - 306x + 306x +
          if (length(exclude_varnames)) {
    240 - 9x + 9x +
            attr(fs, "exclude_varnames") <- structure(
    241 - 9x + 9x +
              list(exclude_varnames),
    242 - 9x + 9x +
              names = private$dataname
    @@ -21047,7 +21824,8 @@

    teal.slice coverage - 69.64%

    246 - 306x + 306x +
          fs
    @@ -21103,49 +21881,56 @@

    teal.slice coverage - 69.64%

    254 - 127x + 127x +
          isolate({
    255 - 127x + 127x +
            logger::log_debug("{ class(self)[1] }$set_filter_state initializing, dataname: { private$dataname }")
    256 - 127x + 127x +
            checkmate::assert_class(state, "teal_slices")
    257 - 127x + 127x +
            lapply(state, function(x) {
    258 - 170x + 170x +
              checkmate::assert_true(
    259 - 170x + 170x +
                x$dataname == private$dataname,
    260 - 170x + 170x +
                .var.name = "dataname matches private$dataname"
    @@ -21173,21 +21958,24 @@

    teal.slice coverage - 69.64%

    264 - 127x + 127x +
            private$set_filterable_varnames(
    265 - 127x + 127x +
              include_varnames = attr(state, "include_varnames")[[private$dataname]],
    266 - 127x + 127x +
              exclude_varnames = attr(state, "exclude_varnames")[[private$dataname]]
    @@ -21201,21 +21989,24 @@

    teal.slice coverage - 69.64%

    268 - 127x + 127x +
            count_type <- attr(state, "count_type")
    269 - 127x + 127x +
            if (length(count_type)) {
    270 - 21x + 21x +
              private$count_type <- count_type
    @@ -21243,35 +22034,40 @@

    teal.slice coverage - 69.64%

    274 - 127x + 127x +
            varnames <- unique(unlist(lapply(state, "[[", "varname")))
    275 - 127x + 127x +
            excluded_varnames <- setdiff(varnames, private$get_filterable_varnames())
    276 - 127x + 127x +
            if (length(excluded_varnames)) {
    277 - 3x + 3x +
              state <- Filter(function(x) !isTRUE(x$varname %in% excluded_varnames), state)
    278 - 3x + 3x +
              warning(sprintf("filters for columns: %s excluded from %s", toString(excluded_varnames), private$dataname))
    @@ -21292,35 +22088,40 @@

    teal.slice coverage - 69.64%

    281 - 127x + 127x +
            if (length(state) > 0) {
    282 - 90x + 90x +
              private$set_filter_state_impl(
    283 - 90x + 90x +
                state = state,
    284 - 90x + 90x +
                data = private$data,
    285 - 90x + 90x +
                data_reactive = private$data_reactive
    @@ -21355,7 +22156,8 @@

    teal.slice coverage - 69.64%

    290 - 127x + 127x +
          invisible(NULL)
    @@ -21439,14 +22241,16 @@

    teal.slice coverage - 69.64%

    302 - 25x + 25x +
          private$state_list_empty(force)
    303 - 25x + 25x +
          invisible(NULL)
    @@ -21698,49 +22502,56 @@

    teal.slice coverage - 69.64%

    339 - 12x + 12x +
          moduleServer(
    340 - 12x + 12x +
            id = id,
    341 - 12x + 12x +
            function(input, output, session) {
    342 - 12x + 12x +
              logger::log_debug("FilterState$srv_active initializing, dataname: { private$dataname }")
    343 - 12x + 12x +
              current_state <- reactive(private$state_list_get())
    344 - 12x + 12x +
              previous_state <- reactiveVal(NULL) # FilterState list
    345 - 12x + 12x +
              added_states <- reactiveVal(NULL) # FilterState list
    @@ -21761,21 +22572,24 @@

    teal.slice coverage - 69.64%

    348 - 12x + 12x +
              fs_to_shiny_ns <- function(x) {
    349 - 24x + 24x +
                checkmate::assert_multi_class(x, c("FilterState", "FilterStateExpr"))
    350 - 24x + 24x +
                gsub("[^[:alnum:]]+", "_", get_default_slice_id(x$get_state()))
    @@ -21796,28 +22610,32 @@

    teal.slice coverage - 69.64%

    353 - 12x + 12x +
              output$trigger_visible_state_change <- renderUI({
    354 - 14x + 14x +
                current_state()
    355 - 14x + 14x +
                isolate({
    356 - 14x + 14x +
                  logger::log_debug("FilterStates$srv_active@1 determining added and removed filter states")
    @@ -21831,21 +22649,24 @@

    teal.slice coverage - 69.64%

    358 - 14x + 14x +
                  added_states(setdiff_teal_slices(current_state(), previous_state()))
    359 - 14x + 14x +
                  previous_state(current_state())
    360 - 14x + 14x +
                  NULL
    @@ -21873,42 +22694,48 @@

    teal.slice coverage - 69.64%

    364 - 12x + 12x +
              output[["cards"]] <- renderUI({
    365 - 14x + 14x +
                lapply(
    366 - 14x + 14x +
                  current_state(), # observes only if added/removed
    367 - 14x + 14x +
                  function(state) {
    368 - 12x + 12x +
                    isolate( # isolates when existing state changes
    369 - 12x + 12x +
                      state$ui(id = session$ns(fs_to_shiny_ns(state)), parent_id = session$ns("cards"))
    @@ -21950,21 +22777,24 @@

    teal.slice coverage - 69.64%

    375 - 12x + 12x +
              private$session_bindings[[session$ns("added_states")]] <- observeEvent(
    376 - 12x + 12x +
                added_states(), # we want to call FilterState module only once when it's added
    377 - 12x + 12x +
                ignoreNULL = TRUE,
    @@ -21978,42 +22808,48 @@

    teal.slice coverage - 69.64%

    379 - 10x + 10x +
                  added_state_names <- vapply(added_states(), function(x) x$get_state()$id, character(1L))
    380 - 10x + 10x +
                  logger::log_debug("FilterStates$srv_active@2 triggered by added states: { toString(added_state_names) }")
    381 - 10x + 10x +
                  lapply(added_states(), function(state) {
    382 - 12x + 12x +
                    state$server(
    383 - 12x + 12x +
                      id = fs_to_shiny_ns(state),
    384 - 12x + 12x +
                      remove_callback = function() private$state_list_remove(state$get_state()$id)
    @@ -22034,7 +22870,8 @@

    teal.slice coverage - 69.64%

    387 - 10x + 10x +
                  added_states(NULL)
    @@ -22062,7 +22899,8 @@

    teal.slice coverage - 69.64%

    391 - 12x + 12x +
              NULL
    @@ -22160,14 +22998,16 @@

    teal.slice coverage - 69.64%

    405 - 1x + 1x +
          checkmate::assert_string(id)
    406 - 1x + 1x +
          data <- private$data
    @@ -22181,7 +23021,8 @@

    teal.slice coverage - 69.64%

    408 - 1x + 1x +
          ns <- NS(id)
    @@ -22195,14 +23036,16 @@

    teal.slice coverage - 69.64%

    410 - 1x + 1x +
          if (ncol(data) == 0) {
    411 - 1x + 1x +
            tags$div("no sample variables available")
    @@ -22342,28 +23185,32 @@

    teal.slice coverage - 69.64%

    431 - 14x + 14x +
          moduleServer(
    432 - 14x + 14x +
            id = id,
    433 - 14x + 14x +
            function(input, output, session) {
    434 - 14x + 14x +
              logger::log_debug("FilterStates$srv_add initializing, dataname: { private$dataname }")
    @@ -22384,42 +23231,48 @@

    teal.slice coverage - 69.64%

    437 - 14x + 14x +
              avail_column_choices <- reactive({
    438 - 17x + 17x +
                data <- private$data
    439 - 17x + 17x +
                vars_include <- private$get_filterable_varnames()
    440 - 17x + 17x +
                active_filter_vars <- unique(unlist(lapply(self$get_filter_state(), "[[", "varname")))
    441 - 17x + 17x +
                choices <- setdiff(vars_include, active_filter_vars)
    442 - 17x + 17x +
                varlabels <- get_varlabels(data)
    @@ -22433,35 +23286,40 @@

    teal.slice coverage - 69.64%

    444 - 17x + 17x +
                data_choices_labeled(
    445 - 17x + 17x +
                  data = data,
    446 - 17x + 17x +
                  choices = choices,
    447 - 17x + 17x +
                  varlabels = varlabels,
    448 - 17x + 17x +
                  keys = private$keys
    @@ -22489,21 +23347,24 @@

    teal.slice coverage - 69.64%

    452 - 14x + 14x +
              output$add_filter <- renderUI({
    453 - 14x + 14x +
                logger::log_debug(
    454 - 14x + 14x +
                  "FilterStates$srv_add@1 updating available column choices, dataname: { private$dataname }"
    @@ -22517,7 +23378,8 @@

    teal.slice coverage - 69.64%

    456 - 14x + 14x +
                if (length(avail_column_choices()) == 0) {
    @@ -22545,56 +23407,64 @@

    teal.slice coverage - 69.64%

    460 - 14x + 14x +
                  tags$div(
    461 - 14x + 14x +
                    teal.widgets::optionalSelectInput(
    462 - 14x + 14x +
                      session$ns("var_to_add"),
    463 - 14x + 14x +
                      choices = avail_column_choices(),
    464 - 14x + 14x +
                      selected = NULL,
    465 - 14x + 14x +
                      options = shinyWidgets::pickerOptions(
    466 - 14x + 14x +
                        liveSearch = TRUE,
    467 - 14x + 14x +
                        noneSelectedText = "Select variable to filter"
    @@ -22643,56 +23513,64 @@

    teal.slice coverage - 69.64%

    474 - 14x + 14x +
              private$session_bindings[[session$ns("var_to_add")]] <- observeEvent(
    475 - 14x + 14x +
                eventExpr = input$var_to_add,
    476 - 14x + 14x +
                handlerExpr = {
    477 - 3x + 3x +
                  logger::log_debug(
    478 - 3x + 3x +
                    sprintf(
    479 - 3x + 3x +
                      "FilterStates$srv_add@2 adding FilterState of variable %s, dataname: %s",
    480 - 3x + 3x +
                      input$var_to_add,
    481 - 3x + 3x +
                      private$dataname
    @@ -22713,21 +23591,24 @@

    teal.slice coverage - 69.64%

    484 - 3x + 3x +
                  self$set_filter_state(
    485 - 3x + 3x +
                    teal_slices(
    486 - 3x + 3x +
                      teal_slice(dataname = private$dataname, varname = input$var_to_add)
    @@ -22776,21 +23657,24 @@

    teal.slice coverage - 69.64%

    493 - 14x + 14x +
              private$session_bindings[[session$ns("inputs")]] <- list(
    494 - 14x + 14x +
                destroy = function() {
    495 - 27x + 27x +
                  if (!session$isEnded()) {
    @@ -22832,7 +23716,8 @@

    teal.slice coverage - 69.64%

    501 - 14x + 14x +
              NULL
    @@ -22930,28 +23815,32 @@

    teal.slice coverage - 69.64%

    515 - 567x + 567x +
          .finalize_session_bindings(self, private) # Remove all inputs and observers
    516 - 567x + 567x +
          private$state_list_empty(force = TRUE)
    517 - 567x + 567x +
          isolate(private$state_list(NULL))
    518 - 567x + 567x +
          invisible(NULL)
    @@ -23196,14 +24085,16 @@

    teal.slice coverage - 69.64%

    553 - 272x + 272x +
          if ((length(include_varnames) + length(exclude_varnames)) == 0L) {
    554 - 105x + 105x +
            return(invisible(NULL))
    @@ -23217,21 +24108,24 @@

    teal.slice coverage - 69.64%

    556 - 167x + 167x +
          checkmate::assert_character(include_varnames, any.missing = FALSE, min.len = 0L, null.ok = TRUE)
    557 - 167x + 167x +
          checkmate::assert_character(exclude_varnames, any.missing = FALSE, min.len = 0L, null.ok = TRUE)
    558 - 167x + 167x +
          if (length(include_varnames) && length(exclude_varnames)) {
    @@ -23280,28 +24174,32 @@

    teal.slice coverage - 69.64%

    565 - 167x + 167x +
          supported_vars <- get_supported_filter_varnames(private$data)
    566 - 167x + 167x +
          if (length(include_varnames)) {
    567 - 153x + 153x +
            private$include_varnames <- intersect(include_varnames, supported_vars)
    568 - 153x + 153x +
            private$exclude_varnames <- character(0)
    @@ -23315,14 +24213,16 @@

    teal.slice coverage - 69.64%

    570 - 14x + 14x +
            private$exclude_varnames <- exclude_varnames
    571 - 14x + 14x +
            private$include_varnames <- character(0)
    @@ -23336,7 +24236,8 @@

    teal.slice coverage - 69.64%

    573 - 167x + 167x +
          invisible(NULL)
    @@ -23413,14 +24314,16 @@

    teal.slice coverage - 69.64%

    584 - 144x + 144x +
          if (length(private$include_varnames)) {
    585 - 97x + 97x +
            private$include_varnames
    @@ -23434,14 +24337,16 @@

    teal.slice coverage - 69.64%

    587 - 47x + 47x +
            supported_varnames <- get_supported_filter_varnames(private$data)
    588 - 47x + 47x +
            setdiff(supported_varnames, private$exclude_varnames)
    @@ -23546,7 +24451,8 @@

    teal.slice coverage - 69.64%

    603 - 208x + 208x +
          checkmate::assert_string(state_id, null.ok = TRUE)
    @@ -23560,14 +24466,16 @@

    teal.slice coverage - 69.64%

    605 - 208x + 208x +
          if (is.null(state_id)) {
    606 - 208x + 208x +
            private$state_list()
    @@ -23693,49 +24601,56 @@

    teal.slice coverage - 69.64%

    624 - 175x + 175x +
          logger::log_debug("{ class(self)[1] } pushing into state_list, dataname: { private$dataname }")
    625 - 175x + 175x +
          checkmate::assert_string(state_id)
    626 - 175x + 175x +
          checkmate::assert_multi_class(x, c("FilterState", "FilterStateExpr"))
    627 - 175x + 175x +
          state <- stats::setNames(list(x), state_id)
    628 - 175x + 175x +
          new_state_list <- c(
    629 - 175x + 175x +
            isolate(private$state_list()),
    630 - 175x + 175x +
            state
    @@ -23749,7 +24664,8 @@

    teal.slice coverage - 69.64%

    632 - 175x + 175x +
          isolate(private$state_list(new_state_list))
    @@ -23763,14 +24679,16 @@

    teal.slice coverage - 69.64%

    634 - 175x + 175x +
          logger::log_debug("{ class(self)[1] } pushed into queue, dataname: { private$dataname }")
    635 - 175x + 175x +
          invisible(NULL)
    @@ -23889,77 +24807,88 @@

    teal.slice coverage - 69.64%

    652 - 109x + 109x +
          checkmate::assert_character(state_id)
    653 - 109x + 109x +
          logger::log_debug("{ class(self)[1] } removing a filter, state_id: { toString(state_id) }")
    654 - 109x + 109x +
          isolate({
    655 - 109x + 109x +
            current_state_ids <- vapply(private$state_list(), function(x) x$get_state()$id, character(1))
    656 - 109x + 109x +
            to_remove <- state_id %in% current_state_ids
    657 - 109x + 109x +
            if (any(to_remove)) {
    658 - 108x + 108x +
              new_state_list <- Filter(
    659 - 108x + 108x +
                function(state) {
    660 - 196x + 196x +
                  if (state$get_state()$id %in% state_id) {
    661 - 182x + 182x +
                    if (state$get_state()$anchored && !force) {
    662 - 7x + 7x +
                      return(TRUE)
    @@ -23973,14 +24902,16 @@

    teal.slice coverage - 69.64%

    664 - 175x + 175x +
                      state$finalize()
    665 - 175x + 175x +
                      FALSE
    @@ -24001,7 +24932,8 @@

    teal.slice coverage - 69.64%

    668 - 14x + 14x +
                    TRUE
    @@ -24022,7 +24954,8 @@

    teal.slice coverage - 69.64%

    671 - 108x + 108x +
                private$state_list()
    @@ -24036,7 +24969,8 @@

    teal.slice coverage - 69.64%

    673 - 108x + 108x +
              private$state_list(new_state_list)
    @@ -24050,7 +24984,8 @@

    teal.slice coverage - 69.64%

    675 - 1x + 1x +
              warning(sprintf("\"%s\" not found in state list", state_id))
    @@ -24078,7 +25013,8 @@

    teal.slice coverage - 69.64%

    679 - 109x + 109x +
          invisible(NULL)
    @@ -24148,21 +25084,24 @@

    teal.slice coverage - 69.64%

    689 - 592x + 592x +
          isolate({
    690 - 592x + 592x +
            logger::log_debug(
    691 - 592x + 592x +
              "{ class(self)[1] }$state_list_empty removing all non-anchored filters for dataname: { private$dataname }"
    @@ -24183,28 +25122,32 @@

    teal.slice coverage - 69.64%

    694 - 592x + 592x +
            state_list <- private$state_list()
    695 - 592x + 592x +
            if (length(state_list)) {
    696 - 92x + 92x +
              state_ids <- vapply(state_list, function(x) x$get_state()$id, character(1))
    697 - 92x + 92x +
              private$state_list_remove(state_ids, force)
    @@ -24232,7 +25175,8 @@

    teal.slice coverage - 69.64%

    701 - 592x + 592x +
          invisible(NULL)
    @@ -24358,35 +25302,40 @@

    teal.slice coverage - 69.64%

    719 - 192x + 192x +
          checkmate::assert_class(state, "teal_slices")
    720 - 192x + 192x +
          checkmate::assert_multi_class(data, c("data.frame", "matrix", "DataFrame", "HermesData"))
    721 - 192x + 192x +
          checkmate::assert_function(data_reactive, args = "sid")
    722 - 192x + 192x +
          if (length(state) == 0L) {
    723 - 86x + 86x +
            return(invisible(NULL))
    @@ -24407,14 +25356,16 @@

    teal.slice coverage - 69.64%

    726 - 106x + 106x +
          slices_hashed <- vapply(state, `[[`, character(1L), "id")
    727 - 106x + 106x +
          if (any(duplicated(slices_hashed))) {
    @@ -24463,28 +25414,32 @@

    teal.slice coverage - 69.64%

    734 - 106x + 106x +
          state_list <- isolate(private$state_list_get())
    735 - 106x + 106x +
          lapply(state, function(slice) {
    736 - 183x + 183x +
            state_id <- slice$id
    737 - 183x + 183x +
            if (state_id %in% names(state_list)) {
    @@ -24498,7 +25453,8 @@

    teal.slice coverage - 69.64%

    739 - 8x + 8x +
              state_list[[state_id]]$set_state(slice)
    @@ -24512,7 +25468,8 @@

    teal.slice coverage - 69.64%

    741 - 175x + 175x +
              if (inherits(slice, "teal_slice_expr")) {
    @@ -24526,7 +25483,8 @@

    teal.slice coverage - 69.64%

    743 - 6x + 6x +
                fstate <- init_filter_state_expr(slice)
    @@ -24547,14 +25505,16 @@

    teal.slice coverage - 69.64%

    746 - 169x + 169x +
                fstate <- init_filter_state(
    747 - 169x + 169x +
                  x = data[, slice$varname, drop = TRUE],
    @@ -24603,14 +25563,16 @@

    teal.slice coverage - 69.64%

    754 - 169x + 169x +
                  x_reactive = if (private$count_type == "none") {
    755 - 163x + 163x +
                    reactive(NULL)
    @@ -24624,7 +25586,8 @@

    teal.slice coverage - 69.64%

    757 - 6x + 6x +
                    reactive(data_reactive(state_id)[, slice$varname, drop = TRUE])
    @@ -24638,14 +25601,16 @@

    teal.slice coverage - 69.64%

    759 - 169x + 169x +
                  slice = slice,
    760 - 169x + 169x +
                  extract_type = private$extract_type
    @@ -24666,7 +25631,8 @@

    teal.slice coverage - 69.64%

    763 - 175x + 175x +
              private$state_list_push(x = fstate, state_id = state_id)
    @@ -24694,7 +25660,8 @@

    teal.slice coverage - 69.64%

    767 - 106x + 106x +
          invisible(NULL)
    @@ -25806,21 +26773,24 @@

    teal.slice coverage - 69.64%

    155 - 25x + 25x +
          isolate({
    156 - 25x + 25x +
            checkmate::assert_multi_class(x, c("POSIXct", "POSIXlt"))
    157 - 24x + 24x +
            checkmate::assert_class(x_reactive, "reactive")
    @@ -25834,35 +26804,40 @@

    teal.slice coverage - 69.64%

    159 - 24x + 24x +
            super$initialize(
    160 - 24x + 24x +
              x = x,
    161 - 24x + 24x +
              x_reactive = x_reactive,
    162 - 24x + 24x +
              slice = slice,
    163 - 24x + 24x +
              extract_type = extract_type
    @@ -25876,28 +26851,32 @@

    teal.slice coverage - 69.64%

    165 - 24x + 24x +
            checkmate::assert_multi_class(slice$choices, c("POSIXct", "POSIXlt"), null.ok = TRUE)
    166 - 23x + 23x +
            private$set_choices(slice$choices)
    167 - 15x + 15x +
            if (is.null(slice$selected)) slice$selected <- slice$choices
    168 - 23x + 23x +
            private$set_selected(slice$selected)
    @@ -25918,7 +26897,8 @@

    teal.slice coverage - 69.64%

    171 - 22x + 22x +
          invisible(self)
    @@ -25995,14 +26975,16 @@

    teal.slice coverage - 69.64%

    182 - 7x + 7x +
          if (isFALSE(private$is_any_filtered())) {
    183 - 1x + 1x +
            return(NULL)
    @@ -26016,63 +26998,72 @@

    teal.slice coverage - 69.64%

    185 - 4x + 4x +
          if (missing(dataname)) dataname <- private$get_dataname()
    186 - 6x + 6x +
          varname <- private$get_varname_prefixed(dataname)
    187 - 6x + 6x +
          choices <- private$get_selected()
    188 - 6x + 6x +
          tzone <- Find(function(x) x != "", attr(as.POSIXlt(choices), "tzone"))
    189 - 6x + 6x +
          class <- class(choices)[1L]
    190 - 6x + 6x +
          date_fun <- as.name(
    191 - 6x + 6x +
            switch(class,
    192 - 6x + 6x +
              "POSIXct" = "as.POSIXct",
    193 - 6x + 6x +
              "POSIXlt" = "as.POSIXlt"
    @@ -26093,21 +27084,24 @@

    teal.slice coverage - 69.64%

    196 - 6x + 6x +
          choices <- as.character(choices + c(0, 1))
    197 - 6x + 6x +
          filter_call <-
    198 - 6x + 6x +
            call(
    @@ -26121,7 +27115,8 @@

    teal.slice coverage - 69.64%

    200 - 6x + 6x +
              call(
    @@ -26135,14 +27130,16 @@

    teal.slice coverage - 69.64%

    202 - 6x + 6x +
                varname,
    203 - 6x + 6x +
                as.call(list(date_fun, choices[1L], tz = tzone))
    @@ -26156,7 +27153,8 @@

    teal.slice coverage - 69.64%

    205 - 6x + 6x +
              call(
    @@ -26170,14 +27168,16 @@

    teal.slice coverage - 69.64%

    207 - 6x + 6x +
                varname,
    208 - 6x + 6x +
                as.call(list(date_fun, choices[2L], tz = tzone))
    @@ -26198,7 +27198,8 @@

    teal.slice coverage - 69.64%

    211 - 6x + 6x +
          private$add_keep_na_call(filter_call, varname)
    @@ -26261,14 +27262,16 @@

    teal.slice coverage - 69.64%

    220 - 23x + 23x +
          if (is.null(choices)) {
    221 - 20x + 20x +
            choices <- as.POSIXct(trunc(range(private$x, na.rm = TRUE), units = "secs"))
    @@ -26282,28 +27285,32 @@

    teal.slice coverage - 69.64%

    223 - 3x + 3x +
            choices <- as.POSIXct(choices, units = "secs")
    224 - 3x + 3x +
            choices_adjusted <- c(
    225 - 3x + 3x +
              max(choices[1L], min(as.POSIXct(private$x), na.rm = TRUE)),
    226 - 3x + 3x +
              min(choices[2L], max(as.POSIXct(private$x), na.rm = TRUE))
    @@ -26317,28 +27324,32 @@

    teal.slice coverage - 69.64%

    228 - 3x + 3x +
            if (any(choices != choices_adjusted)) {
    229 - 1x + 1x +
              warning(sprintf(
    230 - 1x + 1x +
                "Choices adjusted (some values outside of variable range). Varname: %s, dataname: %s.",
    231 - 1x + 1x +
                private$get_varname(), private$get_dataname()
    @@ -26352,7 +27363,8 @@

    teal.slice coverage - 69.64%

    233 - 1x + 1x +
              choices <- choices_adjusted
    @@ -26366,35 +27378,40 @@

    teal.slice coverage - 69.64%

    235 - 3x + 3x +
            if (choices[1L] >= choices[2L]) {
    236 - 1x + 1x +
              warning(sprintf(
    237 - 1x + 1x +
                "Invalid choices: lower is higher / equal to upper, or not in range of variable values.
    238 - 1x + 1x +
                Setting defaults. Varname: %s, dataname: %s.",
    239 - 1x + 1x +
                private$get_varname(), private$get_dataname()
    @@ -26408,7 +27425,8 @@

    teal.slice coverage - 69.64%

    241 - 1x + 1x +
              choices <- range(private$x, na.rm = TRUE)
    @@ -26436,14 +27454,16 @@

    teal.slice coverage - 69.64%

    245 - 23x + 23x +
          private$set_is_choice_limited(private$x, choices)
    246 - 23x + 23x +
          private$x <- private$x[
    @@ -26457,21 +27477,24 @@

    teal.slice coverage - 69.64%

    248 - 23x + 23x +
              as.POSIXct(trunc(private$x, units = "secs")) >= choices[1L] &
    249 - 23x + 23x +
                as.POSIXct(trunc(private$x, units = "secs")) <= choices[2L]
    250 - 23x + 23x +
            ) | is.na(private$x)
    @@ -26485,14 +27508,16 @@

    teal.slice coverage - 69.64%

    252 - 23x + 23x +
          private$teal_slice$choices <- choices
    253 - 23x + 23x +
          invisible(NULL)
    @@ -26534,14 +27559,16 @@

    teal.slice coverage - 69.64%

    259 - 23x + 23x +
          private$is_choice_limited <- (any(xl < choices[1L], na.rm = TRUE) | any(xl > choices[2L], na.rm = TRUE))
    260 - 23x + 23x +
          invisible(NULL)
    @@ -26562,21 +27589,24 @@

    teal.slice coverage - 69.64%

    263 - 34x + 34x +
          tryCatch(
    264 - 34x + 34x +
            expr = {
    265 - 34x + 34x +
              values <- as.POSIXct(values, origin = "1970-01-01 00:00:00")
    @@ -26590,7 +27620,8 @@

    teal.slice coverage - 69.64%

    267 - 31x + 31x +
              values
    @@ -26604,7 +27635,8 @@

    teal.slice coverage - 69.64%

    269 - 34x + 34x +
            error = function(e) stop("Vector of set values must contain values coercible to POSIX.")
    @@ -26632,42 +27664,48 @@

    teal.slice coverage - 69.64%

    273 - 1x + 1x +
          if (length(values) != 2) stop("Vector of set values must have length two.")
    274 - 30x + 30x +
          if (values[1] > values[2]) {
    275 - 1x + 1x +
            warning(
    276 - 1x + 1x +
              sprintf(
    277 - 1x + 1x +
                "Start date '%s' is set after the end date '%s', the values will be replaced by a default datetime range.",
    278 - 1x + 1x +
                values[1], values[2]
    @@ -26688,7 +27726,8 @@

    teal.slice coverage - 69.64%

    281 - 1x + 1x +
            values <- isolate(private$get_choices())
    @@ -26702,7 +27741,8 @@

    teal.slice coverage - 69.64%

    283 - 30x + 30x +
          values
    @@ -26723,42 +27763,48 @@

    teal.slice coverage - 69.64%

    286 - 30x + 30x +
          choices <- private$get_choices()
    287 - 30x + 30x +
          if (values[1] < choices[1L] || values[1] > choices[2L]) {
    288 - 5x + 5x +
            warning(
    289 - 5x + 5x +
              sprintf(
    290 - 5x + 5x +
                "Value: %s is outside of the range for the column '%s' in dataset '%s', setting minimum possible value.",
    291 - 5x + 5x +
                values[1], private$get_varname(), toString(private$get_dataname())
    @@ -26779,7 +27825,8 @@

    teal.slice coverage - 69.64%

    294 - 5x + 5x +
            values[1] <- choices[1L]
    @@ -26800,35 +27847,40 @@

    teal.slice coverage - 69.64%

    297 - 30x + 30x +
          if (values[2] > choices[2L] | values[2] < choices[1L]) {
    298 - 5x + 5x +
            warning(
    299 - 5x + 5x +
              sprintf(
    300 - 5x + 5x +
                "Value: '%s' is outside of the range for the column '%s' in dataset '%s', setting maximum possible value.",
    301 - 5x + 5x +
                values[2], private$get_varname(), toString(private$get_dataname())
    @@ -26849,7 +27901,8 @@

    teal.slice coverage - 69.64%

    304 - 5x + 5x +
            values[2] <- choices[2L]
    @@ -26870,7 +27923,8 @@

    teal.slice coverage - 69.64%

    307 - 30x + 30x +
          values
    @@ -29634,42 +30688,48 @@

    teal.slice coverage - 69.64%

    151 - 158x + 158x +
          isolate({
    152 - 158x + 158x +
            checkmate::assert(
    153 - 158x + 158x +
              is.character(x),
    154 - 158x + 158x +
              is.factor(x),
    155 - 158x + 158x +
              length(unique(x[!is.na(x)])) < getOption("teal.threshold_slider_vs_checkboxgroup"),
    156 - 158x + 158x +
              combine = "or"
    @@ -29683,14 +30743,16 @@

    teal.slice coverage - 69.64%

    158 - 158x + 158x +
            if (is.factor(x)) {
    159 - 37x + 37x +
              x <- droplevels(x)
    @@ -29704,35 +30766,40 @@

    teal.slice coverage - 69.64%

    161 - 158x + 158x +
            super$initialize(
    162 - 158x + 158x +
              x = x,
    163 - 158x + 158x +
              x_reactive = x_reactive,
    164 - 158x + 158x +
              slice = slice,
    165 - 158x + 158x +
              extract_type = extract_type
    @@ -29746,63 +30813,72 @@

    teal.slice coverage - 69.64%

    167 - 158x + 158x +
            private$set_choices(slice$choices)
    168 - 158x + 158x +
            if (is.null(slice$selected) && slice$multiple) {
    169 - 45x + 45x +
              slice$selected <- private$get_choices()
    170 - 113x + 113x +
            } else if (is.null(slice$selected)) {
    171 - 1x + 1x +
              slice$selected <- private$get_choices()[1]
    172 - 112x + 112x +
            } else if (length(slice$selected) > 1 && !slice$multiple) {
    173 - 1x + 1x +
              warning(
    174 - 1x + 1x +
                "ChoicesFilterState allows \"selected\" to be of length 1 when \"multiple\" is FALSE. ",
    175 - 1x + 1x +
                "Only the first value will be used."
    @@ -29816,7 +30892,8 @@

    teal.slice coverage - 69.64%

    177 - 1x + 1x +
              slice$selected <- slice$selected[1]
    @@ -29830,21 +30907,24 @@

    teal.slice coverage - 69.64%

    179 - 158x + 158x +
            private$set_selected(slice$selected)
    180 - 158x + 158x +
            if (inherits(x, "POSIXt")) {
    181 - 9x + 9x +
              private$tzone <- Find(function(x) x != "", attr(as.POSIXlt(x), "tzone"))
    @@ -29865,7 +30945,8 @@

    teal.slice coverage - 69.64%

    184 - 158x + 158x +
          invisible(self)
    @@ -29942,14 +31023,16 @@

    teal.slice coverage - 69.64%

    195 - 61x + 61x +
          if (isFALSE(private$is_any_filtered())) {
    196 - 7x + 7x +
            return(NULL)
    @@ -29963,49 +31046,56 @@

    teal.slice coverage - 69.64%

    198 - 30x + 30x +
          if (missing(dataname)) dataname <- private$get_dataname()
    199 - 54x + 54x +
          varname <- private$get_varname_prefixed(dataname)
    200 - 54x + 54x +
          choices <- private$get_choices()
    201 - 54x + 54x +
          selected <- private$get_selected()
    202 - 54x + 54x +
          fun_compare <- if (length(selected) == 1L) "==" else "%in%"
    203 - 54x + 54x +
          filter_call <- if (length(selected) == 0) {
    204 - 6x + 6x +
            call("!", call(fun_compare, varname, make_c_call(as.character(choices))))
    @@ -30019,70 +31109,80 @@

    teal.slice coverage - 69.64%

    206 - 48x + 48x +
            if (setequal(selected, choices) && !private$is_choice_limited) {
    207 - 2x + 2x +
              NULL
    208 - 46x + 46x +
            } else if (inherits(private$x, "Date")) {
    209 - 1x + 1x +
              call(fun_compare, varname, call("as.Date", make_c_call(as.character(selected))))
    210 - 45x + 45x +
            } else if (inherits(private$x, c("POSIXct", "POSIXlt"))) {
    211 - 2x + 2x +
              class <- class(private$x)[1L]
    212 - 2x + 2x +
              date_fun <- as.name(
    213 - 2x + 2x +
                switch(class,
    214 - 2x + 2x +
                  "POSIXct" = "as.POSIXct",
    215 - 2x + 2x +
                  "POSIXlt" = "as.POSIXlt"
    @@ -30103,28 +31203,32 @@

    teal.slice coverage - 69.64%

    218 - 2x + 2x +
              call(
    219 - 2x + 2x +
                fun_compare,
    220 - 2x + 2x +
                varname,
    221 - 2x + 2x +
                as.call(list(date_fun, make_c_call(as.character(selected)), tz = private$tzone))
    @@ -30138,14 +31242,16 @@

    teal.slice coverage - 69.64%

    223 - 43x + 43x +
            } else if (is.numeric(private$x)) {
    224 - 7x + 7x +
              call(fun_compare, varname, make_c_call(as.numeric(selected)))
    @@ -30166,7 +31272,8 @@

    teal.slice coverage - 69.64%

    227 - 36x + 36x +
              call(fun_compare, varname, make_c_call(selected))
    @@ -30187,7 +31294,8 @@

    teal.slice coverage - 69.64%

    230 - 54x + 54x +
          private$add_keep_na_call(filter_call, varname)
    @@ -30299,28 +31407,32 @@

    teal.slice coverage - 69.64%

    246 - 158x + 158x +
          named_counts <- .table(private$x)
    247 - 158x + 158x +
          possible_choices <- names(named_counts)
    248 - 158x + 158x +
          if (is.null(choices)) {
    249 - 143x + 143x +
            choices <- possible_choices
    @@ -30334,49 +31446,56 @@

    teal.slice coverage - 69.64%

    251 - 15x + 15x +
            choices <- as.character(choices)
    252 - 15x + 15x +
            choices_adjusted <- choices[choices %in% possible_choices]
    253 - 15x + 15x +
            if (length(setdiff(choices, choices_adjusted)) > 0L) {
    254 - 2x + 2x +
              warning(
    255 - 2x + 2x +
                sprintf(
    256 - 2x + 2x +
                  "Some choices not found in data. Adjusting. Filter id: %s.",
    257 - 2x + 2x +
                  private$get_id()
    @@ -30397,7 +31516,8 @@

    teal.slice coverage - 69.64%

    260 - 2x + 2x +
              choices <- choices_adjusted
    @@ -30411,35 +31531,40 @@

    teal.slice coverage - 69.64%

    262 - 15x + 15x +
            if (length(choices) == 0) {
    263 - 1x + 1x +
              warning(
    264 - 1x + 1x +
                sprintf(
    265 - 1x + 1x +
                  "None of the choices were found in data. Setting defaults. Filter id: %s.",
    266 - 1x + 1x +
                  private$get_id()
    @@ -30460,7 +31585,8 @@

    teal.slice coverage - 69.64%

    269 - 1x + 1x +
              choices <- possible_choices
    @@ -30481,14 +31607,16 @@

    teal.slice coverage - 69.64%

    272 - 158x + 158x +
          private$set_choices_counts(
    273 - 158x + 158x +
            pair_counts(choices, named_counts)
    @@ -30502,21 +31630,24 @@

    teal.slice coverage - 69.64%

    275 - 158x + 158x +
          private$set_is_choice_limited(possible_choices, choices)
    276 - 158x + 158x +
          private$teal_slice$choices <- choices
    277 - 158x + 158x +
          invisible(NULL)
    @@ -30551,21 +31682,24 @@

    teal.slice coverage - 69.64%

    282 - 158x + 158x +
          xl <- x[!is.na(x)]
    283 - 158x + 158x +
          private$is_choice_limited <- length(setdiff(xl, choices)) > 0L
    284 - 158x + 158x +
          invisible(NULL)
    @@ -30600,14 +31734,16 @@

    teal.slice coverage - 69.64%

    289 - 158x + 158x +
          private$choices_counts <- choices_counts
    290 - 158x + 158x +
          invisible(NULL)
    @@ -30642,7 +31778,8 @@

    teal.slice coverage - 69.64%

    295 - 25x + 25x +
          length(private$get_choices()) <= getOption("teal.threshold_slider_vs_checkboxgroup")
    @@ -30663,21 +31800,24 @@

    teal.slice coverage - 69.64%

    298 - 187x + 187x +
          tryCatch(
    299 - 187x + 187x +
            expr = {
    300 - 187x + 187x +
              values <- as.character(values)
    @@ -30698,7 +31838,8 @@

    teal.slice coverage - 69.64%

    303 - 187x + 187x +
            error = function(e) stop("The vector of set values must contain values coercible to character.")
    @@ -30712,7 +31853,8 @@

    teal.slice coverage - 69.64%

    305 - 187x + 187x +
          values
    @@ -30740,28 +31882,32 @@

    teal.slice coverage - 69.64%

    309 - 187x + 187x +
          if (!private$is_multiple() && length(values) > 1) {
    310 - 1x + 1x +
            warning(
    311 - 1x + 1x +
              sprintf("Selection: %s is not a vector of length one. ", toString(values, width = 360)),
    312 - 1x + 1x +
              "Maintaining previous selection."
    @@ -30775,7 +31921,8 @@

    teal.slice coverage - 69.64%

    314 - 1x + 1x +
            values <- isolate(private$get_selected())
    @@ -30789,7 +31936,8 @@

    teal.slice coverage - 69.64%

    316 - 187x + 187x +
          values
    @@ -30810,35 +31958,40 @@

    teal.slice coverage - 69.64%

    319 - 187x + 187x +
          in_choices_mask <- values %in% private$get_choices()
    320 - 187x + 187x +
          if (length(values[!in_choices_mask]) > 0) {
    321 - 17x + 17x +
            warning(paste(
    322 - 17x + 17x +
              "Values:", toString(values[!in_choices_mask], width = 360),
    323 - 17x + 17x +
              "are not in choices of column", private$get_varname(), "in dataset", private$get_dataname(), "."
    @@ -30859,7 +32012,8 @@

    teal.slice coverage - 69.64%

    326 - 187x + 187x +
          values[in_choices_mask]
    @@ -30936,7 +32090,8 @@

    teal.slice coverage - 69.64%

    337 - 9x + 9x +
          ns <- NS(id)
    @@ -30957,42 +32112,48 @@

    teal.slice coverage - 69.64%

    340 - 9x + 9x +
          isolate({
    341 - 9x + 9x +
            countsmax <- private$choices_counts
    342 - 9x + 9x +
            countsnow <- if (!is.null(private$x_reactive())) {
    343 - 2x + 2x +
              pair_counts(
    344 - 2x + 2x +
                private$get_choices(),
    345 - 2x + 2x +
                .table(private$x_reactive())
    @@ -31020,42 +32181,48 @@

    teal.slice coverage - 69.64%

    349 - 9x + 9x +
            ui_input <- if (private$is_checkboxgroup()) {
    350 - 9x + 9x +
              labels <- countBars(
    351 - 9x + 9x +
                inputId = ns("labels"),
    352 - 9x + 9x +
                choices = private$get_choices(),
    353 - 9x + 9x +
                countsnow = countsnow,
    354 - 9x + 9x +
                countsmax = countsmax
    @@ -31069,70 +32236,80 @@

    teal.slice coverage - 69.64%

    356 - 9x + 9x +
              tags$div(
    357 - 9x + 9x +
                class = "choices_state",
    358 - 9x + 9x +
                if (private$is_multiple()) {
    359 - 9x + 9x +
                  checkboxGroupInput(
    360 - 9x + 9x +
                    inputId = ns("selection"),
    361 - 9x + 9x +
                    label = NULL,
    362 - 9x + 9x +
                    selected = private$get_selected(),
    363 - 9x + 9x +
                    choiceNames = labels,
    364 - 9x + 9x +
                    choiceValues = private$get_choices(),
    365 - 9x + 9x +
                    width = "100%"
    @@ -31363,28 +32540,32 @@

    teal.slice coverage - 69.64%

    398 - 9x + 9x +
            tags$div(
    399 - 9x + 9x +
              uiOutput(ns("trigger_visible")),
    400 - 9x + 9x +
              ui_input,
    401 - 9x + 9x +
              private$keep_na_ui(ns("keep_na"))
    @@ -31454,28 +32635,32 @@

    teal.slice coverage - 69.64%

    411 - 7x + 7x +
          moduleServer(
    412 - 7x + 7x +
            id = id,
    413 - 7x + 7x +
            function(input, output, session) {
    414 - 7x + 7x +
              logger::log_debug("ChoicesFilterState$server_inputs initializing, id: { private$get_id() }")
    @@ -31503,21 +32688,24 @@

    teal.slice coverage - 69.64%

    418 - 7x + 7x +
              non_missing_values <- reactive(Filter(Negate(is.na), private$x_reactive()))
    419 - 7x + 7x +
              output$trigger_visible <- renderUI({
    420 - 7x + 7x +
                logger::log_debug("ChoicesFilterState$server_inputs@1 updating count labels, id: { private$get_id() }")
    @@ -31531,7 +32719,8 @@

    teal.slice coverage - 69.64%

    422 - 7x + 7x +
                countsnow <- if (!is.null(private$x_reactive())) {
    @@ -31587,49 +32776,56 @@

    teal.slice coverage - 69.64%

    430 - 7x + 7x +
                isolate({
    431 - 7x + 7x +
                  if (private$is_checkboxgroup()) {
    432 - 7x + 7x +
                    updateCountBars(
    433 - 7x + 7x +
                      inputId = "labels",
    434 - 7x + 7x +
                      choices = private$get_choices(),
    435 - 7x + 7x +
                      countsmax = private$choices_counts,
    436 - 7x + 7x +
                      countsnow = countsnow
    @@ -31741,7 +32937,8 @@

    teal.slice coverage - 69.64%

    452 - 7x + 7x +
                  NULL
    @@ -31769,42 +32966,48 @@

    teal.slice coverage - 69.64%

    456 - 7x + 7x +
              private$session_bindings[[session$ns("selection")]] <- if (private$is_checkboxgroup()) {
    457 - 7x + 7x +
                observeEvent(
    458 - 7x + 7x +
                  ignoreNULL = FALSE,
    459 - 7x + 7x +
                  ignoreInit = TRUE, # ignoreInit: should not matter because we set the UI with the desired initial state
    460 - 7x + 7x +
                  eventExpr = input$selection,
    461 - 7x + 7x +
                  handlerExpr = {
    @@ -32119,7 +33322,8 @@

    teal.slice coverage - 69.64%

    506 - 7x + 7x +
              private$keep_na_srv("keep_na")
    @@ -32154,7 +33358,8 @@

    teal.slice coverage - 69.64%

    511 - 7x + 7x +
              private$session_bindings[[session$ns("selection_api")]] <- observeEvent(private$get_selected(), {
    @@ -32175,49 +33380,56 @@

    teal.slice coverage - 69.64%

    514 - 2x + 2x +
                if (!setequal(input$selection, private$get_selected())) {
    515 - 2x + 2x +
                  logger::log_debug("ChoicesFilterState$server@1 state changed, id: { private$get_id() }")
    516 - 2x + 2x +
                  if (private$is_checkboxgroup()) {
    517 - 2x + 2x +
                    if (private$is_multiple()) {
    518 - 2x + 2x +
                      updateCheckboxGroupInput(
    519 - 2x + 2x +
                        inputId = "selection",
    520 - 2x + 2x +
                        selected = private$get_selected()
    @@ -32336,7 +33548,8 @@

    teal.slice coverage - 69.64%

    537 - 7x + 7x +
              NULL
    @@ -32602,21 +33815,24 @@

    teal.slice coverage - 69.64%

    575 - 7x + 7x +
          selected <- private$get_selected()
    576 - 7x + 7x +
          selected_text <-
    577 - 7x + 7x +
            if (length(selected) == 0L) {
    @@ -32637,14 +33853,16 @@

    teal.slice coverage - 69.64%

    580 - 7x + 7x +
              if (sum(nchar(selected)) <= 40L) {
    581 - 7x + 7x +
                paste(selected, collapse = ", ")
    @@ -32679,28 +33897,32 @@

    teal.slice coverage - 69.64%

    586 - 7x + 7x +
          tagList(
    587 - 7x + 7x +
            tags$span(
    588 - 7x + 7x +
              class = "filter-card-summary-value",
    589 - 7x + 7x +
              selected_text
    @@ -32714,21 +33936,24 @@

    teal.slice coverage - 69.64%

    591 - 7x + 7x +
            tags$span(
    592 - 7x + 7x +
              class = "filter-card-summary-controls",
    593 - 7x + 7x +
              if (private$na_count > 0) {
    @@ -32840,21 +34065,24 @@

    teal.slice coverage - 69.64%

    609 - 160x + 160x +
      tbl <- table(
    610 - 160x + 160x +
        if (is.factor(x)) {
    611 - 37x + 37x +
          x
    @@ -32868,7 +34096,8 @@

    teal.slice coverage - 69.64%

    613 - 123x + 123x +
          as.character(x)
    @@ -32903,21 +34132,24 @@

    teal.slice coverage - 69.64%

    618 - 160x + 160x +
      stats::setNames(
    619 - 160x + 160x +
        as.vector(tbl),
    620 - 160x + 160x +
        names(tbl)
    @@ -33679,7 +34911,8 @@

    teal.slice coverage - 69.64%

    106 - 65x + 65x +
          checkmate::assert_list(data_objects, any.missing = FALSE, min.len = 0, names = "unique")
    @@ -33693,14 +34926,16 @@

    teal.slice coverage - 69.64%

    108 - 65x + 65x +
          data_objects <- lapply(data_objects, function(dataset) {
    109 - 95x + 95x +
            if (is.list(dataset) && "dataset" %in% names(dataset)) {
    @@ -33721,7 +34956,8 @@

    teal.slice coverage - 69.64%

    112 - 95x + 95x +
              dataset
    @@ -33756,49 +34992,56 @@

    teal.slice coverage - 69.64%

    117 - 65x + 65x +
          checkmate::assert_class(join_keys, "join_keys")
    118 - 64x + 64x +
          self$set_join_keys(join_keys)
    119 - 64x + 64x +
          child_parent <- sapply(
    120 - 64x + 64x +
            names(data_objects),
    121 - 64x + 64x +
            function(i) teal.data::parent(join_keys, i),
    122 - 64x + 64x +
            USE.NAMES = TRUE,
    123 - 64x + 64x +
            simplify = FALSE
    @@ -33812,14 +35055,16 @@

    teal.slice coverage - 69.64%

    125 - 64x + 64x +
          ordered_datanames <- topological_sort(child_parent)
    126 - 64x + 64x +
          ordered_datanames <- intersect(ordered_datanames, names(data_objects))
    @@ -33833,21 +35078,24 @@

    teal.slice coverage - 69.64%

    128 - 64x + 64x +
          for (dataname in ordered_datanames) {
    129 - 94x + 94x +
            ds_object <- data_objects[[dataname]]
    130 - 94x + 94x +
            self$set_dataset(data = ds_object, dataname = dataname)
    @@ -33868,7 +35116,8 @@

    teal.slice coverage - 69.64%

    133 - 64x + 64x +
          self$set_available_teal_slices(x = reactive(NULL))
    @@ -33882,7 +35131,8 @@

    teal.slice coverage - 69.64%

    135 - 64x + 64x +
          invisible(self)
    @@ -33945,7 +35195,8 @@

    teal.slice coverage - 69.64%

    144 - 115x + 115x +
          names(private$filtered_datasets)
    @@ -34015,7 +35266,8 @@

    teal.slice coverage - 69.64%

    154 - 1x + 1x +
          private$get_filtered_dataset(dataname)$get_dataset_label()
    @@ -34120,14 +35372,16 @@

    teal.slice coverage - 69.64%

    169 - 65x + 65x +
          checkmate::assert_class(x, "reactive")
    170 - 65x + 65x +
          private$available_teal_slices <- reactive({
    @@ -34141,49 +35395,56 @@

    teal.slice coverage - 69.64%

    172 - 4x + 4x +
            current_state <- isolate(self$get_filter_state())
    173 - 4x + 4x +
            allowed <- attr(current_state, "include_varnames")
    174 - 4x + 4x +
            forbidden <- attr(current_state, "exclude_varnames")
    175 - 4x + 4x +
            foo <- function(slice) {
    176 - 13x + 13x +
              if (slice$dataname %in% self$datanames()) {
    177 - 13x + 13x +
                if (slice$fixed) {
    178 - 4x + 4x +
                  TRUE
    @@ -34197,14 +35458,16 @@

    teal.slice coverage - 69.64%

    180 - 9x + 9x +
                  isTRUE(slice$varname %in% allowed[[slice$dataname]]) ||
    181 - 9x + 9x +
                    isFALSE(slice$varname %in% forbidden[[slice$dataname]])
    @@ -34246,7 +35509,8 @@

    teal.slice coverage - 69.64%

    187 - 4x + 4x +
            Filter(foo, x())
    @@ -34260,7 +35524,8 @@

    teal.slice coverage - 69.64%

    189 - 65x + 65x +
          invisible(NULL)
    @@ -34337,7 +35602,8 @@

    teal.slice coverage - 69.64%

    200 - 4x + 4x +
          private$available_teal_slices
    @@ -34533,14 +35799,16 @@

    teal.slice coverage - 69.64%

    228 - 10x + 10x +
          checkmate::assert_subset(dataname, self$datanames())
    229 - 9x + 9x +
          private$get_filtered_dataset(dataname)$get_call()
    @@ -34638,28 +35906,32 @@

    teal.slice coverage - 69.64%

    243 - 24x + 24x +
          checkmate::assert_subset(dataname, self$datanames())
    244 - 23x + 23x +
          checkmate::assert_flag(filtered)
    245 - 22x + 22x +
          data <- private$get_filtered_dataset(dataname)$get_dataset(filtered)
    246 - 3x + 3x +
          if (filtered) data() else data
    @@ -34722,7 +35994,8 @@

    teal.slice coverage - 69.64%

    255 - 2x + 2x +
          private$join_keys
    @@ -34813,28 +36086,32 @@

    teal.slice coverage - 69.64%

    268 - 9x + 9x +
          rows <- lapply(
    269 - 9x + 9x +
            datanames,
    270 - 9x + 9x +
            function(dataname) {
    271 - 11x + 11x +
              private$get_filtered_dataset(dataname)$get_filter_overview()
    @@ -34855,14 +36132,16 @@

    teal.slice coverage - 69.64%

    274 - 5x + 5x +
          unssuported_idx <- vapply(rows, function(x) all(is.na(x[-1])), logical(1))
    275 - 5x + 5x +
          dplyr::bind_rows(c(rows[!unssuported_idx], rows[unssuported_idx]))
    @@ -34939,7 +36218,8 @@

    teal.slice coverage - 69.64%

    286 - 1x + 1x +
          private$get_filtered_dataset(dataname)$get_keys()
    @@ -35093,14 +36373,16 @@

    teal.slice coverage - 69.64%

    308 - 99x + 99x +
          checkmate::assert_string(dataname)
    309 - 99x + 99x +
          logger::log_debug("FilteredData$set_dataset setting dataset, name: { dataname }")
    @@ -35114,21 +36396,24 @@

    teal.slice coverage - 69.64%

    311 - 99x + 99x +
          parent_dataname <- teal.data::parent(private$join_keys, dataname)
    312 - 99x + 99x +
          keys <- private$join_keys[dataname, dataname]
    313 - 98x + 98x +
          if (is.null(keys)) keys <- character(0)
    @@ -35142,35 +36427,40 @@

    teal.slice coverage - 69.64%

    315 - 99x + 99x +
          if (length(parent_dataname) == 0) {
    316 - 89x + 89x +
            private$filtered_datasets[[dataname]] <- init_filtered_dataset(
    317 - 89x + 89x +
              dataset = data,
    318 - 89x + 89x +
              dataname = dataname,
    319 - 89x + 89x +
              keys = keys
    @@ -35191,7 +36481,8 @@

    teal.slice coverage - 69.64%

    322 - 10x + 10x +
            join_keys <- private$join_keys[dataname, parent_dataname]
    @@ -35205,49 +36496,56 @@

    teal.slice coverage - 69.64%

    324 - 10x + 10x +
            private$filtered_datasets[[dataname]] <- init_filtered_dataset(
    325 - 10x + 10x +
              dataset = data,
    326 - 10x + 10x +
              dataname = dataname,
    327 - 10x + 10x +
              keys = keys,
    328 - 10x + 10x +
              parent_name = parent_dataname,
    329 - 10x + 10x +
              parent = reactive(self$get_data(parent_dataname, filtered = TRUE)),
    330 - 10x + 10x +
              join_keys = join_keys
    @@ -35275,7 +36573,8 @@

    teal.slice coverage - 69.64%

    334 - 99x + 99x +
          invisible(self)
    @@ -35352,21 +36651,24 @@

    teal.slice coverage - 69.64%

    345 - 64x + 64x +
          checkmate::assert_class(join_keys, "join_keys")
    346 - 64x + 64x +
          private$join_keys <- join_keys
    347 - 64x + 64x +
          invisible(self)
    @@ -35443,35 +36745,40 @@

    teal.slice coverage - 69.64%

    358 - 46x + 46x +
          states <- unname(lapply(private$filtered_datasets, function(x) x$get_filter_state()))
    359 - 46x + 46x +
          slices <- Filter(Negate(is.null), states)
    360 - 46x + 46x +
          slices <- do.call(c, slices)
    361 - 46x + 46x +
          if (!is.null(slices)) {
    362 - 46x + 46x +
            attr(slices, "allow_add") <- private$allow_add
    @@ -35485,7 +36792,8 @@

    teal.slice coverage - 69.64%

    364 - 46x + 46x +
          slices
    @@ -35569,35 +36877,40 @@

    teal.slice coverage - 69.64%

    376 - 5x + 5x +
          datasets <- lapply(self$datanames(), private$get_filtered_dataset)
    377 - 5x + 5x +
          ind <- vapply(datasets, inherits, logical(1L), what = "DefaultFilteredDataset")
    378 - 5x + 5x +
          states <- do.call(c, lapply(datasets[!ind], function(ds) ds$get_filter_state()))
    379 - 5x + 5x +
          states_fmt <- format(states, show_all = show_all, trim_lines = trim_lines)
    380 - 5x + 5x +
          holders_fmt <- vapply(datasets[ind], format, character(1L), show_all = show_all, trim_lines = trim_lines)
    @@ -35611,28 +36924,32 @@

    teal.slice coverage - 69.64%

    382 - 5x + 5x +
          sprintf(
    383 - 5x + 5x +
            "%s:\n%s",
    384 - 5x + 5x +
            class(self)[1],
    385 - 5x + 5x +
            paste(c(states_fmt, holders_fmt), collapse = "\n")
    @@ -35772,42 +37089,48 @@

    teal.slice coverage - 69.64%

    405 - 29x + 29x +
          isolate({
    406 - 29x + 29x +
            logger::log_debug("{ class(self)[1] }$set_filter_state initializing")
    407 - 29x + 29x +
            checkmate::assert_class(state, "teal_slices")
    408 - 29x + 29x +
            allow_add <- attr(state, "allow_add")
    409 - 29x + 29x +
            if (!is.null(allow_add)) {
    410 - 29x + 29x +
              private$allow_add <- allow_add
    @@ -35828,21 +37151,24 @@

    teal.slice coverage - 69.64%

    413 - 29x + 29x +
            lapply(self$datanames(), function(dataname) {
    414 - 57x + 57x +
              states <- Filter(function(x) identical(x$dataname, dataname), state)
    415 - 57x + 57x +
              private$get_filtered_dataset(dataname)$set_filter_state(states)
    @@ -35863,7 +37189,8 @@

    teal.slice coverage - 69.64%

    418 - 29x + 29x +
            invisible(NULL)
    @@ -35884,7 +37211,8 @@

    teal.slice coverage - 69.64%

    421 - 29x + 29x +
          invisible(NULL)
    @@ -35975,28 +37303,32 @@

    teal.slice coverage - 69.64%

    434 - 8x + 8x +
          isolate({
    435 - 8x + 8x +
            checkmate::assert_class(state, "teal_slices")
    436 - 8x + 8x +
            datanames <- unique(vapply(state, "[[", character(1L), "dataname"))
    437 - 8x + 8x +
            checkmate::assert_subset(datanames, self$datanames())
    @@ -36010,14 +37342,16 @@

    teal.slice coverage - 69.64%

    439 - 8x + 8x +
            logger::log_debug(
    440 - 8x + 8x +
              "{ class(self)[1] }$remove_filter_state removing filter(s), dataname: { private$dataname }"
    @@ -36038,21 +37372,24 @@

    teal.slice coverage - 69.64%

    443 - 8x + 8x +
            lapply(datanames, function(dataname) {
    444 - 9x + 9x +
              slices <- Filter(function(x) identical(x$dataname, dataname), state)
    445 - 9x + 9x +
              private$get_filtered_dataset(dataname)$remove_filter_state(slices)
    @@ -36073,14 +37410,16 @@

    teal.slice coverage - 69.64%

    448 - 8x + 8x +
            logger::log_debug(
    449 - 8x + 8x +
              "{ class(self)[1] }$remove_filter_state removed filter(s), dataname: { private$dataname }"
    @@ -36108,7 +37447,8 @@

    teal.slice coverage - 69.64%

    453 - 8x + 8x +
          invisible(NULL)
    @@ -36213,14 +37553,16 @@

    teal.slice coverage - 69.64%

    468 - 7x + 7x +
          logger::log_debug(
    469 - 7x + 7x +
            "FilteredData$clear_filter_states called, datanames: { toString(datanames) }"
    @@ -36241,21 +37583,24 @@

    teal.slice coverage - 69.64%

    472 - 7x + 7x +
          for (dataname in datanames) {
    473 - 12x + 12x +
            fdataset <- private$get_filtered_dataset(dataname = dataname)
    474 - 12x + 12x +
            fdataset$clear_filter_states(force)
    @@ -36276,28 +37621,32 @@

    teal.slice coverage - 69.64%

    477 - 7x + 7x +
          logger::log_debug(
    478 - 7x + 7x +
            paste(
    479 - 7x + 7x +
              "FilteredData$clear_filter_states removed all non-anchored FilterStates,",
    480 - 7x + 7x +
              "datanames: { toString(datanames) }"
    @@ -36325,7 +37674,8 @@

    teal.slice coverage - 69.64%

    484 - 7x + 7x +
          invisible(NULL)
    @@ -36598,35 +37948,40 @@

    teal.slice coverage - 69.64%

    523 - 1x + 1x +
          checkmate::assert_function(active_datanames)
    524 - 1x + 1x +
          moduleServer(
    525 - 1x + 1x +
            id = id,
    526 - 1x + 1x +
            function(input, output, session) {
    527 - 1x + 1x +
              logger::log_debug("FilteredData$srv_filter_panel initializing")
    @@ -36640,14 +37995,16 @@

    teal.slice coverage - 69.64%

    529 - 1x + 1x +
              active_datanames_resolved <- reactive({
    530 - 1x + 1x +
                checkmate::assert_subset(active_datanames(), self$datanames())
    @@ -36675,14 +38032,16 @@

    teal.slice coverage - 69.64%

    534 - 1x + 1x +
              self$srv_overview("overview", active_datanames_resolved)
    535 - 1x + 1x +
              self$srv_active("active", active_datanames_resolved)
    @@ -36696,7 +38055,8 @@

    teal.slice coverage - 69.64%

    537 - 1x + 1x +
              NULL
    @@ -37165,21 +38525,24 @@

    teal.slice coverage - 69.64%

    604 - 3x + 3x +
          checkmate::assert_function(active_datanames)
    605 - 3x + 3x +
          moduleServer(id, function(input, output, session) {
    606 - 3x + 3x +
            logger::log_debug("FilteredData$srv_active initializing")
    @@ -37193,7 +38556,8 @@

    teal.slice coverage - 69.64%

    608 - 3x + 3x +
            private$srv_available_filters("available_filters")
    @@ -37207,21 +38571,24 @@

    teal.slice coverage - 69.64%

    610 - 3x + 3x +
            private$session_bindings[[session$ns("minimise_filter_active")]] <- observeEvent(
    611 - 3x + 3x +
              eventExpr = input$minimise_filter_active,
    612 - 3x + 3x +
              handlerExpr = {
    @@ -37277,14 +38644,16 @@

    teal.slice coverage - 69.64%

    620 - 3x + 3x +
            filter_count <- reactive({
    621 - 3x + 3x +
              length(self$get_filter_state())
    @@ -37305,21 +38674,24 @@

    teal.slice coverage - 69.64%

    624 - 3x + 3x +
            is_filter_removable <- reactive({
    625 - 3x + 3x +
              non_anchored <- Filter(function(x) !x$anchored, self$get_filter_state())
    626 - 3x + 3x +
              isTRUE(length(non_anchored) > 0)
    @@ -37340,56 +38712,64 @@

    teal.slice coverage - 69.64%

    629 - 3x + 3x +
            output$remove_all_filters_ui <- renderUI({
    630 - 3x + 3x +
              req(is_filter_removable())
    631 - 2x + 2x +
              actionLink(
    632 - 2x + 2x +
                inputId = session$ns("remove_all_filters"),
    633 - 2x + 2x +
                label = "",
    634 - 2x + 2x +
                icon("circle-xmark", lib = "font-awesome"),
    635 - 2x + 2x +
                title = "Remove active filters",
    636 - 2x + 2x +
                class = "remove_all"
    @@ -37417,56 +38797,64 @@

    teal.slice coverage - 69.64%

    640 - 3x + 3x +
            private$session_bindings[[session$ns("is_filter_removable")]] <- observeEvent(
    641 - 3x + 3x +
              eventExpr = is_filter_removable(),
    642 - 3x + 3x +
              handlerExpr = {
    643 - 3x + 3x +
                shinyjs::toggle("remove_all_filters", condition = is_filter_removable())
    644 - 3x + 3x +
                shinyjs::show("filter_active_vars_contents")
    645 - 3x + 3x +
                shinyjs::hide("filters_active_count")
    646 - 3x + 3x +
                toggle_icon(session$ns("minimise_filter_active"), c("fa-angle-right", "fa-angle-down"), TRUE)
    647 - 3x + 3x +
                toggle_title(session$ns("minimise_filter_active"), c("Restore panel", "Minimise Panel"), TRUE)
    @@ -37494,35 +38882,40 @@

    teal.slice coverage - 69.64%

    651 - 3x + 3x +
            private$session_bindings[[session$ns("active_datanames")]] <- observeEvent(
    652 - 3x + 3x +
              eventExpr = active_datanames(),
    653 - 3x + 3x +
              handlerExpr = lapply(self$datanames(), function(dataname) {
    654 - 4x + 4x +
                if (dataname %in% active_datanames()) {
    655 - 4x + 4x +
                  shinyjs::show(dataname)
    @@ -37585,35 +38978,40 @@

    teal.slice coverage - 69.64%

    664 - 3x + 3x +
            lapply(
    665 - 3x + 3x +
              self$datanames(),
    666 - 3x + 3x +
              function(dataname) {
    667 - 6x + 6x +
                fdataset <- private$get_filtered_dataset(dataname)
    668 - 6x + 6x +
                fdataset$srv_active(id = dataname)
    @@ -37641,49 +39039,56 @@

    teal.slice coverage - 69.64%

    672 - 3x + 3x +
            output$teal_filters_count <- renderText({
    673 - 3x + 3x +
              n_filters_active <- filter_count()
    674 - 3x + 3x +
              req(n_filters_active > 0L)
    675 - 2x + 2x +
              sprintf(
    676 - 2x + 2x +
                "%s filter%s applied across datasets",
    677 - 2x + 2x +
                n_filters_active,
    678 - 2x + 2x +
                ifelse(n_filters_active == 1, "", "s")
    @@ -37711,42 +39116,48 @@

    teal.slice coverage - 69.64%

    682 - 3x + 3x +
            private$session_bindings[[session$ns("remove_all_filters")]] <- observeEvent(
    683 - 3x + 3x +
              eventExpr = input$remove_all_filters,
    684 - 3x + 3x +
              handlerExpr = {
    685 - 1x + 1x +
                logger::log_debug("FilteredData$srv_filter_panel@1 removing all non-anchored filters")
    686 - 1x + 1x +
                self$clear_filter_states()
    687 - 1x + 1x +
                logger::log_debug("FilteredData$srv_filter_panel@1 removed all non-anchored filters")
    @@ -37774,21 +39185,24 @@

    teal.slice coverage - 69.64%

    691 - 3x + 3x +
            private$session_bindings[[session$ns("inputs")]] <- list(
    692 - 3x + 3x +
              destroy = function() {
    693 - 3x + 3x +
                if (!session$isEnded()) {
    @@ -37830,7 +39244,8 @@

    teal.slice coverage - 69.64%

    699 - 3x + 3x +
            NULL
    @@ -38278,35 +39693,40 @@

    teal.slice coverage - 69.64%

    763 - 1x + 1x +
          checkmate::assert_class(active_datanames, "reactive")
    764 - 1x + 1x +
          moduleServer(
    765 - 1x + 1x +
            id = id,
    766 - 1x + 1x +
            function(input, output, session) {
    767 - 1x + 1x +
              logger::log_debug("FilteredData$srv_filter_overview initializing")
    @@ -38320,7 +39740,8 @@

    teal.slice coverage - 69.64%

    769 - 1x + 1x +
              output$table <- renderUI({
    @@ -38901,7 +40322,8 @@

    teal.slice coverage - 69.64%

    852 - 1x + 1x +
              NULL
    @@ -38992,21 +40414,24 @@

    teal.slice coverage - 69.64%

    865 - 64x + 64x +
          .finalize_session_bindings(self, private)
    866 - 64x + 64x +
          lapply(private$filtered_datasets, function(x) x$finalize())
    867 - 64x + 64x +
          invisible(NULL)
    @@ -39272,7 +40697,8 @@

    teal.slice coverage - 69.64%

    905 - 139x + 139x +
          if (length(dataname) == 0) {
    @@ -39293,7 +40719,8 @@

    teal.slice coverage - 69.64%

    908 - 139x + 139x +
            private$filtered_datasets[[dataname]]
    @@ -39566,28 +40993,32 @@

    teal.slice coverage - 69.64%

    947 - 4x + 4x +
          moduleServer(id, function(input, output, session) {
    948 - 4x + 4x +
            slices_available <- self$get_available_teal_slices()
    949 - 4x + 4x +
            slices_interactive <- reactive(
    950 - 4x + 4x +
              Filter(function(slice) isFALSE(slice$fixed), slices_available())
    @@ -39601,14 +41032,16 @@

    teal.slice coverage - 69.64%

    952 - 4x + 4x +
            slices_fixed <- reactive(
    953 - 4x + 4x +
              Filter(function(slice) isTRUE(slice$fixed), slices_available())
    @@ -39622,21 +41055,24 @@

    teal.slice coverage - 69.64%

    955 - 4x + 4x +
            available_slices_id <- reactive(vapply(slices_available(), `[[`, character(1), "id"))
    956 - 4x + 4x +
            active_slices_id <- reactive(vapply(self$get_filter_state(), `[[`, character(1), "id"))
    957 - 4x + 4x +
            duplicated_slice_references <- reactive({
    @@ -39650,35 +41086,40 @@

    teal.slice coverage - 69.64%

    959 - 8x + 8x +
              slice_reference <- vapply(slices_available(), get_default_slice_id, character(1))
    960 - 8x + 8x +
              is_duplicated_reference <- duplicated(slice_reference) | duplicated(slice_reference, fromLast = TRUE)
    961 - 8x + 8x +
              is_active <- available_slices_id() %in% active_slices_id()
    962 - 8x + 8x +
              is_not_expr <- !vapply(slices_available(), inherits, logical(1), "teal_slice_expr")
    963 - 8x + 8x +
              slice_reference[is_duplicated_reference & is_active & is_not_expr]
    @@ -39699,70 +41140,80 @@

    teal.slice coverage - 69.64%

    966 - 4x + 4x +
            checkbox_group_element <- function(name, value, label, checked, disabled = FALSE) {
    967 - 35x + 35x +
              tags$div(
    968 - 35x + 35x +
                class = "checkbox available-filters",
    969 - 35x + 35x +
                tags$label(
    970 - 35x + 35x +
                  tags$input(
    971 - 35x + 35x +
                    type = "checkbox",
    972 - 35x + 35x +
                    name = name,
    973 - 35x + 35x +
                    value = value,
    974 - 35x + 35x +
                    checked = checked,
    975 - 35x + 35x +
                    disabled = if (disabled) "disabled"
    @@ -39776,7 +41227,8 @@

    teal.slice coverage - 69.64%

    977 - 35x + 35x +
                  tags$span(label, disabled = if (disabled) disabled)
    @@ -39811,42 +41263,48 @@

    teal.slice coverage - 69.64%

    982 - 4x + 4x +
            output$checkbox <- renderUI({
    983 - 8x + 8x +
              checkbox <- checkboxGroupInput(
    984 - 8x + 8x +
                session$ns("available_slices_id"),
    985 - 8x + 8x +
                label = NULL,
    986 - 8x + 8x +
                choices = NULL,
    987 - 8x + 8x +
                selected = NULL
    @@ -39860,14 +41318,16 @@

    teal.slice coverage - 69.64%

    989 - 8x + 8x +
              active_slices_ids <- active_slices_id()
    990 - 8x + 8x +
              duplicated_slice_refs <- duplicated_slice_references()
    @@ -39881,7 +41341,8 @@

    teal.slice coverage - 69.64%

    992 - 8x + 8x +
              checkbox_group_slice <- function(slice) {
    @@ -39895,63 +41356,72 @@

    teal.slice coverage - 69.64%

    994 - 35x + 35x +
                isolate({
    995 - 35x + 35x +
                  checkbox_group_element(
    996 - 35x + 35x +
                    name = session$ns("available_slices_id"),
    997 - 35x + 35x +
                    value = slice$id,
    998 - 35x + 35x +
                    label = slice$id,
    999 - 35x + 35x +
                    checked = if (slice$id %in% active_slices_ids) "checked",
    1000 - 35x + 35x +
                    disabled = slice$anchored ||
    1001 - 35x + 35x +
                      get_default_slice_id(slice) %in% duplicated_slice_refs &&
    1002 - 35x + 35x +
                        !slice$id %in% active_slices_ids
    @@ -39986,14 +41456,16 @@

    teal.slice coverage - 69.64%

    1007 - 8x + 8x +
              interactive_choice_mock <- lapply(slices_interactive(), checkbox_group_slice)
    1008 - 8x + 8x +
              non_interactive_choice_mock <- lapply(slices_fixed(), checkbox_group_slice)
    @@ -40007,63 +41479,72 @@

    teal.slice coverage - 69.64%

    1010 - 8x + 8x +
              htmltools::tagInsertChildren(
    1011 - 8x + 8x +
                checkbox,
    1012 - 8x + 8x +
                tags$br(),
    1013 - 8x + 8x +
                if (length(non_interactive_choice_mock)) tags$strong("Fixed filters"),
    1014 - 8x + 8x +
                non_interactive_choice_mock,
    1015 - 8x + 8x +
                if (length(interactive_choice_mock)) tags$strong("Interactive filters"),
    1016 - 8x + 8x +
                interactive_choice_mock,
    1017 - 8x + 8x +
                .cssSelector = "div.shiny-options-group",
    1018 - 8x + 8x +
                after = 0
    @@ -40091,77 +41572,88 @@

    teal.slice coverage - 69.64%

    1022 - 4x + 4x +
            private$session_bindings[[session$ns("available_slices_id")]] <- observeEvent(
    1023 - 4x + 4x +
              eventExpr = input$available_slices_id,
    1024 - 4x + 4x +
              ignoreNULL = FALSE,
    1025 - 4x + 4x +
              ignoreInit = TRUE,
    1026 - 4x + 4x +
              handlerExpr = {
    1027 - 5x + 5x +
                new_slices_id <- setdiff(input$available_slices_id, active_slices_id())
    1028 - 5x + 5x +
                removed_slices_id <- setdiff(active_slices_id(), input$available_slices_id)
    1029 - 5x + 5x +
                if (length(new_slices_id)) {
    1030 - 3x + 3x +
                  new_teal_slices <- Filter(
    1031 - 3x + 3x +
                    function(slice) slice$id %in% new_slices_id,
    1032 - 3x + 3x +
                    private$available_teal_slices()
    @@ -40175,7 +41667,8 @@

    teal.slice coverage - 69.64%

    1034 - 3x + 3x +
                  self$set_filter_state(new_teal_slices)
    @@ -40196,28 +41689,32 @@

    teal.slice coverage - 69.64%

    1037 - 5x + 5x +
                if (length(removed_slices_id)) {
    1038 - 4x + 4x +
                  removed_teal_slices <- Filter(
    1039 - 4x + 4x +
                    function(slice) slice$id %in% removed_slices_id,
    1040 - 4x + 4x +
                    self$get_filter_state()
    @@ -40231,7 +41728,8 @@

    teal.slice coverage - 69.64%

    1042 - 4x + 4x +
                  self$remove_filter_state(removed_teal_slices)
    @@ -40266,42 +41764,48 @@

    teal.slice coverage - 69.64%

    1047 - 4x + 4x +
            private$session_bindings[[session$ns("available_teal_slices")]] <- observeEvent(
    1048 - 4x + 4x +
              eventExpr = private$available_teal_slices(),
    1049 - 4x + 4x +
              ignoreNULL = FALSE,
    1050 - 4x + 4x +
              handlerExpr = {
    1051 - 3x + 3x +
                if (length(private$available_teal_slices())) {
    1052 - 1x + 1x +
                  shinyjs::show("available_menu")
    @@ -40315,7 +41819,8 @@

    teal.slice coverage - 69.64%

    1054 - 2x + 2x +
                  shinyjs::hide("available_menu")
    @@ -40601,56 +42106,64 @@

    teal.slice coverage - 69.64%

    33 - 147x + 147x +
          checkmate::assert_string(dataname)
    34 - 145x + 145x +
          logger::log_debug("Instantiating { class(self)[1] }, dataname: { dataname }")
    35 - 145x + 145x +
          checkmate::assert_character(keys, any.missing = FALSE)
    36 - 145x + 145x +
          checkmate::assert_character(label, null.ok = TRUE)
    37 - 145x + 145x +
          private$dataset <- dataset
    38 - 145x + 145x +
          private$dataname <- dataname
    39 - 145x + 145x +
          private$keys <- keys
    40 - 145x + 145x +
          private$label <- if (is.null(label)) character(0) else label
    @@ -40671,28 +42184,32 @@

    teal.slice coverage - 69.64%

    43 - 145x + 145x +
          private$data_filtered_fun <- function(sid = "") {
    44 - 24x + 24x +
            checkmate::assert_character(sid)
    45 - 24x + 24x +
            if (length(sid)) {
    46 - 24x + 24x +
              logger::log_debug("filtering data dataname: { dataname }, sid: { sid }")
    @@ -40720,35 +42237,40 @@

    teal.slice coverage - 69.64%

    50 - 24x + 24x +
            env <- new.env(parent = parent.env(globalenv()))
    51 - 24x + 24x +
            env[[dataname]] <- private$dataset
    52 - 24x + 24x +
            filter_call <- self$get_call(sid)
    53 - 24x + 24x +
            eval_expr_with_msg(filter_call, env)
    54 - 24x + 24x +
            get(x = dataname, envir = env)
    @@ -40769,14 +42291,16 @@

    teal.slice coverage - 69.64%

    57 - 145x + 145x +
          private$data_filtered <- reactive(private$data_filtered_fun())
    58 - 145x + 145x +
          invisible(self)
    @@ -40860,28 +42384,32 @@

    teal.slice coverage - 69.64%

    70 - 24x + 24x +
          sprintf(
    71 - 24x + 24x +
            "%s:\n%s",
    72 - 24x + 24x +
            class(self)[1],
    73 - 24x + 24x +
            format(self$get_filter_state(), show_all = show_all, trim_lines = trim_lines)
    @@ -40951,7 +42479,8 @@

    teal.slice coverage - 69.64%

    83 - 10x + 10x +
          cat(isolate(self$format(...)), "\n")
    @@ -41028,28 +42557,32 @@

    teal.slice coverage - 69.64%

    94 - 14x + 14x +
          logger::log_debug("Removing filters from FilteredDataset: { deparse1(self$get_dataname()) }")
    95 - 14x + 14x +
          lapply(
    96 - 14x + 14x +
            private$get_filter_states(),
    97 - 14x + 14x +
            function(filter_states) filter_states$clear_filter_states(force)
    @@ -41063,14 +42596,16 @@

    teal.slice coverage - 69.64%

    99 - 14x + 14x +
          logger::log_debug("Removed filters from FilteredDataset: { deparse1(self$get_dataname()) }")
    100 - 14x + 14x +
          NULL
    @@ -41203,21 +42738,24 @@

    teal.slice coverage - 69.64%

    119 - 47x + 47x +
          filter_call <- Filter(
    120 - 47x + 47x +
            f = Negate(is.null),
    121 - 47x + 47x +
            x = lapply(private$get_filter_states(), function(x) x$get_call(sid))
    @@ -41231,14 +42769,16 @@

    teal.slice coverage - 69.64%

    123 - 47x + 47x +
          if (length(filter_call) == 0) {
    124 - 29x + 29x +
            return(NULL)
    @@ -41252,7 +42792,8 @@

    teal.slice coverage - 69.64%

    126 - 18x + 18x +
          filter_call
    @@ -41315,14 +42856,16 @@

    teal.slice coverage - 69.64%

    135 - 150x + 150x +
          states <- unname(lapply(private$get_filter_states(), function(x) x$get_filter_state()))
    136 - 150x + 150x +
          do.call(c, states)
    @@ -41455,7 +42998,8 @@

    teal.slice coverage - 69.64%

    155 - 8x + 8x +
          private$dataname
    @@ -41546,14 +43090,16 @@

    teal.slice coverage - 69.64%

    168 - 51x + 51x +
          if (filtered) {
    169 - 33x + 33x +
            private$data_filtered
    @@ -41567,7 +43113,8 @@

    teal.slice coverage - 69.64%

    171 - 18x + 18x +
            private$dataset
    @@ -41672,7 +43219,8 @@

    teal.slice coverage - 69.64%

    186 - 127x + 127x +
          private$keys
    @@ -41721,7 +43269,8 @@

    teal.slice coverage - 69.64%

    193 - 2x + 2x +
          private$label
    @@ -42372,42 +43921,48 @@

    teal.slice coverage - 69.64%

    286 - 7x + 7x +
          moduleServer(
    287 - 7x + 7x +
            id = id,
    288 - 7x + 7x +
            function(input, output, session) {
    289 - 7x + 7x +
              dataname <- self$get_dataname()
    290 - 7x + 7x +
              logger::log_debug("FilteredDataset$srv_active initializing, dataname: { dataname }")
    291 - 7x + 7x +
              checkmate::assert_string(dataname)
    @@ -42421,14 +43976,16 @@

    teal.slice coverage - 69.64%

    293 - 7x + 7x +
              filter_count <- reactive({
    294 - 8x + 8x +
                length(self$get_filter_state())
    @@ -42449,35 +44006,40 @@

    teal.slice coverage - 69.64%

    297 - 7x + 7x +
              output$filter_count <- renderText(
    298 - 7x + 7x +
                sprintf(
    299 - 7x + 7x +
                  "%d filter%s applied",
    300 - 7x + 7x +
                  filter_count(),
    301 - 7x + 7x +
                  if (filter_count() != 1) "s" else ""
    @@ -42505,28 +44067,32 @@

    teal.slice coverage - 69.64%

    305 - 7x + 7x +
              lapply(
    306 - 7x + 7x +
                names(private$get_filter_states()),
    307 - 7x + 7x +
                function(x) {
    308 - 12x + 12x +
                  private$get_filter_states()[[x]]$srv_active(id = x)
    @@ -42554,14 +44120,16 @@

    teal.slice coverage - 69.64%

    312 - 7x + 7x +
              is_filter_collapsible <- reactive({
    313 - 8x + 8x +
                filter_count() != 0
    @@ -42582,63 +44150,72 @@

    teal.slice coverage - 69.64%

    316 - 7x + 7x +
              output$collapse_ui <- renderUI({
    317 - 8x + 8x +
                req(is_filter_collapsible())
    318 - 5x + 5x +
                tags$a(
    319 - 5x + 5x +
                  id = session$ns("collapse"),
    320 - 5x + 5x +
                  class = "filter-icon",
    321 - 5x + 5x +
                  tags$i(
    322 - 5x + 5x +
                    id = session$ns("collapse_icon"),
    323 - 5x + 5x +
                    class = "fa fa-angle-down",
    324 - 5x + 5x +
                    title = "fold/expand dataset filters",
    @@ -42659,42 +44236,48 @@

    teal.slice coverage - 69.64%

    327 - 5x + 5x +
                    onclick = sprintf(
    328 - 5x + 5x +
                      "togglePanelItems(this, ['%s', '%s'], 'fa-angle-down', 'fa-angle-right');
    329 - 5x + 5x +
                      clickWhenClassPresent('%s', 'fa-minus', this.classList.contains('fa-angle-right'));",
    330 - 5x + 5x +
                      session$ns("filter_count_ui"),
    331 - 5x + 5x +
                      session$ns("filters"),
    332 - 5x + 5x +
                      session$ns("add_filter_icon")
    @@ -42736,21 +44319,24 @@

    teal.slice coverage - 69.64%

    338 - 7x + 7x +
              is_filter_removable <- reactive({
    339 - 8x + 8x +
                non_anchored <- Filter(function(x) !x$anchored, self$get_filter_state())
    340 - 8x + 8x +
                isTRUE(length(non_anchored) > 0)
    @@ -42771,21 +44357,24 @@

    teal.slice coverage - 69.64%

    343 - 7x + 7x +
              private$session_bindings[[session$ns("get_filter_state")]] <- observeEvent(
    344 - 7x + 7x +
                self$get_filter_state(),
    345 - 7x + 7x +
                ignoreInit = TRUE,
    @@ -42799,56 +44388,64 @@

    teal.slice coverage - 69.64%

    347 - 3x + 3x +
                  shinyjs::hide("filter_count_ui")
    348 - 3x + 3x +
                  shinyjs::show("filters")
    349 - 3x + 3x +
                  shinyjs::toggle("remove_filters_ui", condition = is_filter_removable())
    350 - 3x + 3x +
                  shinyjs::toggle("collapse_ui", condition = is_filter_collapsible())
    351 - 3x + 3x +
                  shinyjs::runjs(
    352 - 3x + 3x +
                    sprintf(
    353 - 3x + 3x +
                      "setAndRemoveClass('#%s', 'fa-angle-down', 'fa-angle-right')",
    354 - 3x + 3x +
                      session$ns("collapse_icon")
    @@ -42890,49 +44487,56 @@

    teal.slice coverage - 69.64%

    360 - 7x + 7x +
              output$remove_filters_ui <- renderUI({
    361 - 8x + 8x +
                req(is_filter_removable())
    362 - 5x + 5x +
                actionLink(
    363 - 5x + 5x +
                  session$ns("remove_filters"),
    364 - 5x + 5x +
                  label = "",
    365 - 5x + 5x +
                  icon = icon("circle-xmark", lib = "font-awesome"),
    366 - 5x + 5x +
                  class = "filter-icon"
    @@ -42960,28 +44564,32 @@

    teal.slice coverage - 69.64%

    370 - 7x + 7x +
              private$session_bindings[[session$ns("remove_filters")]] <- observeEvent(input$remove_filters, {
    371 - 1x + 1x +
                logger::log_debug("FilteredDataset$srv_active@1 removing all non-anchored filters, dataname: { dataname }")
    372 - 1x + 1x +
                self$clear_filter_states()
    373 - 1x + 1x +
                logger::log_debug("FilteredDataset$srv_active@1 removed all non-anchored filters, dataname: { dataname }")
    @@ -43002,21 +44610,24 @@

    teal.slice coverage - 69.64%

    376 - 7x + 7x +
              private$session_bindings[[session$ns("inputs")]] <- list(
    377 - 7x + 7x +
                destroy = function() {
    378 - 13x + 13x +
                  if (!session$isEnded()) {
    @@ -43058,7 +44669,8 @@

    teal.slice coverage - 69.64%

    384 - 7x + 7x +
              self$srv_add(private$dataname)
    @@ -43072,7 +44684,8 @@

    teal.slice coverage - 69.64%

    386 - 7x + 7x +
              NULL
    @@ -43163,7 +44776,8 @@

    teal.slice coverage - 69.64%

    399 - 1x + 1x +
          stop("Pure virtual method")
    @@ -43261,63 +44875,72 @@

    teal.slice coverage - 69.64%

    413 - 7x + 7x +
          moduleServer(
    414 - 7x + 7x +
            id = id,
    415 - 7x + 7x +
            function(input, output, session) {
    416 - 7x + 7x +
              logger::log_debug("MAEFilteredDataset$srv_add initializing, dataname: { deparse1(self$get_dataname()) }")
    417 - 7x + 7x +
              elems <- private$get_filter_states()
    418 - 7x + 7x +
              elem_names <- names(private$get_filter_states())
    419 - 7x + 7x +
              lapply(
    420 - 7x + 7x +
                elem_names,
    421 - 7x + 7x +
                function(elem_name) elems[[elem_name]]$srv_add(elem_name)
    @@ -43338,7 +44961,8 @@

    teal.slice coverage - 69.64%

    424 - 7x + 7x +
              NULL
    @@ -43429,21 +45053,24 @@

    teal.slice coverage - 69.64%

    437 - 244x + 244x +
          .finalize_session_bindings(self, private)
    438 - 244x + 244x +
          lapply(private$filter_states, function(x) x$finalize())
    439 - 244x + 244x +
          invisible(NULL)
    @@ -43576,28 +45203,32 @@

    teal.slice coverage - 69.64%

    458 - 209x + 209x +
          checkmate::assert_class(filter_states, "FilterStates")
    459 - 209x + 209x +
          checkmate::assert_string(id)
    460 - 209x + 209x +
          x <- stats::setNames(list(filter_states), id)
    461 - 209x + 209x +
          private$filter_states <- c(private$get_filter_states(), x)
    @@ -43646,7 +45277,8 @@

    teal.slice coverage - 69.64%

    468 - 626x + 626x +
          private$filter_states
    @@ -44170,14 +45802,16 @@

    teal.slice coverage - 69.64%

    71 - 99x + 99x +
          checkmate::assert_data_frame(dataset)
    72 - 97x + 97x +
          super$initialize(dataset, dataname, keys, label)
    @@ -44198,21 +45832,24 @@

    teal.slice coverage - 69.64%

    75 - 95x + 95x +
          if (!is.null(parent)) {
    76 - 10x + 10x +
            checkmate::assert_character(parent_name, len = 1)
    77 - 10x + 10x +
            checkmate::assert_character(join_keys, min.len = 1)
    @@ -44226,14 +45863,16 @@

    teal.slice coverage - 69.64%

    79 - 10x + 10x +
            private$parent_name <- parent_name
    80 - 10x + 10x +
            private$join_keys <- join_keys
    @@ -44247,28 +45886,32 @@

    teal.slice coverage - 69.64%

    82 - 10x + 10x +
            private$data_filtered_fun <- function(sid = "") {
    83 - 8x + 8x +
              checkmate::assert_character(sid)
    84 - 8x + 8x +
              if (length(sid)) {
    85 - 8x + 8x +
                logger::log_debug("filtering data dataname: { dataname }, sid: { sid }")
    @@ -44296,42 +45939,48 @@

    teal.slice coverage - 69.64%

    89 - 8x + 8x +
              env <- new.env(parent = parent.env(globalenv()))
    90 - 8x + 8x +
              env[[dataname]] <- private$dataset
    91 - 8x + 8x +
              env[[parent_name]] <- parent()
    92 - 8x + 8x +
              filter_call <- self$get_call(sid)
    93 - 8x + 8x +
              eval_expr_with_msg(filter_call, env)
    94 - 8x + 8x +
              get(x = dataname, envir = env)
    @@ -44359,42 +46008,48 @@

    teal.slice coverage - 69.64%

    98 - 95x + 95x +
          private$add_filter_states(
    99 - 95x + 95x +
            filter_states = init_filter_states(
    100 - 95x + 95x +
              data = dataset,
    101 - 95x + 95x +
              data_reactive = private$data_filtered_fun,
    102 - 95x + 95x +
              dataname = dataname,
    103 - 95x + 95x +
              keys = self$get_keys()
    @@ -44408,7 +46063,8 @@

    teal.slice coverage - 69.64%

    105 - 95x + 95x +
            id = "filter"
    @@ -44436,42 +46092,48 @@

    teal.slice coverage - 69.64%

    109 - 95x + 95x +
          if (!is.null(parent)) {
    110 - 10x + 10x +
            logger::log_debug("Excluding { parent_name } columns from possible teal_slices for dataname: { dataname }")
    111 - 10x + 10x +
            fs <- teal_slices(
    112 - 10x + 10x +
              exclude_varnames = structure(
    113 - 10x + 10x +
                list(intersect(colnames(dataset), colnames(isolate(parent())))),
    114 - 10x + 10x +
                names = private$dataname
    @@ -44492,7 +46154,8 @@

    teal.slice coverage - 69.64%

    117 - 10x + 10x +
            self$set_filter_state(fs)
    @@ -44513,7 +46176,8 @@

    teal.slice coverage - 69.64%

    120 - 95x + 95x +
          invisible(self)
    @@ -44639,21 +46303,24 @@

    teal.slice coverage - 69.64%

    138 - 42x + 42x +
          filter_call <- super$get_call(sid)
    139 - 42x + 42x +
          dataname <- private$dataname
    140 - 42x + 42x +
          parent_dataname <- private$parent_name
    @@ -44667,28 +46334,32 @@

    teal.slice coverage - 69.64%

    142 - 42x + 42x +
          if (!identical(parent_dataname, character(0))) {
    143 - 9x + 9x +
            join_keys <- private$join_keys
    144 - 9x + 9x +
            parent_keys <- unname(join_keys)
    145 - 9x + 9x +
            dataset_keys <- names(join_keys)
    @@ -44702,7 +46373,8 @@

    teal.slice coverage - 69.64%

    147 - 9x + 9x +
            y_arg <- if (length(parent_keys) == 0L) {
    @@ -44723,28 +46395,32 @@

    teal.slice coverage - 69.64%

    150 - 9x + 9x +
              sprintf(
    151 - 9x + 9x +
                "%s[, c(%s), drop = FALSE]",
    152 - 9x + 9x +
                parent_dataname,
    153 - 9x + 9x +
                toString(dQuote(parent_keys, q = FALSE))
    @@ -44772,7 +46448,8 @@

    teal.slice coverage - 69.64%

    157 - 9x + 9x +
            more_args <- if (length(parent_keys) == 0 || length(dataset_keys) == 0) {
    @@ -44786,14 +46463,16 @@

    teal.slice coverage - 69.64%

    159 - 9x + 9x +
            } else if (identical(parent_keys, dataset_keys)) {
    160 - 7x + 7x +
              list(by = parent_keys)
    @@ -44807,7 +46486,8 @@

    teal.slice coverage - 69.64%

    162 - 2x + 2x +
              list(by = stats::setNames(parent_keys, dataset_keys))
    @@ -44828,7 +46508,8 @@

    teal.slice coverage - 69.64%

    165 - 9x + 9x +
            merge_call <- call(
    @@ -44842,49 +46523,56 @@

    teal.slice coverage - 69.64%

    167 - 9x + 9x +
              as.name(dataname),
    168 - 9x + 9x +
              as.call(
    169 - 9x + 9x +
                c(
    170 - 9x + 9x +
                  str2lang("dplyr::inner_join"),
    171 - 9x + 9x +
                  x = as.name(dataname),
    172 - 9x + 9x +
                  y = str2lang(y_arg),
    173 - 9x + 9x +
                  more_args
    @@ -44919,7 +46607,8 @@

    teal.slice coverage - 69.64%

    178 - 9x + 9x +
            filter_call <- c(filter_call, merge_call)
    @@ -44933,7 +46622,8 @@

    teal.slice coverage - 69.64%

    180 - 42x + 42x +
          filter_call
    @@ -45003,35 +46693,40 @@

    teal.slice coverage - 69.64%

    190 - 77x + 77x +
          isolate({
    191 - 77x + 77x +
            logger::log_debug("{ class(self)[1] }$set_filter_state initializing, dataname: { private$dataname }")
    192 - 77x + 77x +
            checkmate::assert_class(state, "teal_slices")
    193 - 76x + 76x +
            lapply(state, function(slice) {
    194 - 93x + 93x +
              checkmate::assert_true(slice$dataname == private$dataname)
    @@ -45045,14 +46740,16 @@

    teal.slice coverage - 69.64%

    196 - 76x + 76x +
            private$get_filter_states()[[1L]]$set_filter_state(state = state)
    197 - 76x + 76x +
            invisible(NULL)
    @@ -45150,7 +46847,8 @@

    teal.slice coverage - 69.64%

    211 - 11x + 11x +
          checkmate::assert_class(state, "teal_slices")
    @@ -45164,14 +46862,16 @@

    teal.slice coverage - 69.64%

    213 - 11x + 11x +
          isolate({
    214 - 11x + 11x +
            logger::log_debug("{ class(self)[1] }$remove_filter_state removing filter(s), dataname: { private$dataname }")
    @@ -45185,14 +46885,16 @@

    teal.slice coverage - 69.64%

    216 - 11x + 11x +
            varnames <- unique(unlist(lapply(state, "[[", "varname")))
    217 - 11x + 11x +
            private$get_filter_states()[[1]]$remove_filter_state(state)
    @@ -45206,7 +46908,8 @@

    teal.slice coverage - 69.64%

    219 - 11x + 11x +
            logger::log_debug("{ class(self)[1] }$remove_filter_state removed filter(s), dataname: { private$dataname }")
    @@ -45227,7 +46930,8 @@

    teal.slice coverage - 69.64%

    222 - 11x + 11x +
          invisible(NULL)
    @@ -45388,7 +47092,8 @@

    teal.slice coverage - 69.64%

    245 - 12x + 12x +
          logger::log_debug("FilteredDataset$srv_filter_overview initializing")
    @@ -45409,14 +47114,16 @@

    teal.slice coverage - 69.64%

    248 - 12x + 12x +
          subject_keys <- if (length(private$parent_name) > 0) {
    249 - 1x + 1x +
            names(private$join_keys)
    @@ -45430,7 +47137,8 @@

    teal.slice coverage - 69.64%

    251 - 11x + 11x +
            self$get_keys()
    @@ -45444,49 +47152,56 @@

    teal.slice coverage - 69.64%

    253 - 12x + 12x +
          dataset <- self$get_dataset()
    254 - 12x + 12x +
          data_filtered <- self$get_dataset(TRUE)
    255 - 12x + 12x +
          if (length(subject_keys) == 0) {
    256 - 10x + 10x +
            data.frame(
    257 - 10x + 10x +
              dataname = private$dataname,
    258 - 10x + 10x +
              obs = nrow(dataset),
    259 - 10x + 10x +
              obs_filtered = nrow(data_filtered())
    @@ -45507,42 +47222,48 @@

    teal.slice coverage - 69.64%

    262 - 2x + 2x +
            data.frame(
    263 - 2x + 2x +
              dataname = private$dataname,
    264 - 2x + 2x +
              obs = nrow(dataset),
    265 - 2x + 2x +
              obs_filtered = nrow(data_filtered()),
    266 - 2x + 2x +
              subjects = nrow(unique(dataset[subject_keys])),
    267 - 2x + 2x +
              subjects_filtered = nrow(unique(data_filtered()[subject_keys]))
    @@ -46073,7 +47794,8 @@

    teal.slice coverage - 69.64%

    64 - 213x + 213x +
      UseMethod("init_filter_states")
    @@ -46150,42 +47872,48 @@

    teal.slice coverage - 69.64%

    75 - 96x + 96x +
      DFFilterStates$new(
    76 - 96x + 96x +
        data = data,
    77 - 96x + 96x +
        data_reactive = data_reactive,
    78 - 96x + 96x +
        dataname = dataname,
    79 - 96x + 96x +
        datalabel = datalabel,
    80 - 96x + 96x +
        keys = keys
    @@ -46262,35 +47990,40 @@

    teal.slice coverage - 69.64%

    91 - 20x + 20x +
      MatrixFilterStates$new(
    92 - 20x + 20x +
        data = data,
    93 - 20x + 20x +
        data_reactive = data_reactive,
    94 - 20x + 20x +
        dataname = dataname,
    95 - 20x + 20x +
        datalabel = datalabel
    @@ -46374,7 +48107,8 @@

    teal.slice coverage - 69.64%

    107 - 20x + 20x +
      if (!requireNamespace("MultiAssayExperiment", quietly = TRUE)) {
    @@ -46395,42 +48129,48 @@

    teal.slice coverage - 69.64%

    110 - 20x + 20x +
      MAEFilterStates$new(
    111 - 20x + 20x +
        data = data,
    112 - 20x + 20x +
        data_reactive = data_reactive,
    113 - 20x + 20x +
        dataname = dataname,
    114 - 20x + 20x +
        datalabel = datalabel,
    115 - 20x + 20x +
        keys = keys
    @@ -46507,7 +48247,8 @@

    teal.slice coverage - 69.64%

    126 - 77x + 77x +
      if (!requireNamespace("SummarizedExperiment", quietly = TRUE)) {
    @@ -46528,35 +48269,40 @@

    teal.slice coverage - 69.64%

    129 - 77x + 77x +
      SEFilterStates$new(
    130 - 77x + 77x +
        data = data,
    131 - 77x + 77x +
        data_reactive = data_reactive,
    132 - 77x + 77x +
        dataname = dataname,
    133 - 77x + 77x +
        datalabel = datalabel
    @@ -46738,7 +48484,8 @@

    teal.slice coverage - 69.64%

    159 - 227x + 227x +
      UseMethod("get_supported_filter_varnames")
    @@ -46780,28 +48527,32 @@

    teal.slice coverage - 69.64%

    165 - 200x + 200x +
      is_expected_class <- vapply(
    166 - 200x + 200x +
        X = data,
    167 - 200x + 200x +
        FUN = function(x) any(class(x) %in% .filterable_class),
    168 - 200x + 200x +
        FUN.VALUE = logical(1)
    @@ -46815,7 +48566,8 @@

    teal.slice coverage - 69.64%

    170 - 200x + 200x +
      names(is_expected_class[is_expected_class])
    @@ -46864,21 +48616,24 @@

    teal.slice coverage - 69.64%

    177 - 27x + 27x +
      is_expected_class <- class(data[, 1]) %in% .filterable_class
    178 - 27x + 27x +
      if (is_expected_class && !is.null(colnames(data))) {
    179 - 24x + 24x +
        colnames(data)
    @@ -46892,7 +48647,8 @@

    teal.slice coverage - 69.64%

    181 - 3x + 3x +
        character(0)
    @@ -47130,14 +48886,16 @@

    teal.slice coverage - 69.64%

    215 - 25x + 25x +
      if (length(choices) == 0) {
    216 - 6x + 6x +
        return(character(0))
    @@ -47151,14 +48909,16 @@

    teal.slice coverage - 69.64%

    218 - 19x + 19x +
      choice_types <- variable_types(data = data, columns = choices)
    219 - 19x + 19x +
      choice_types[keys] <- "primary_key"
    @@ -47172,28 +48932,32 @@

    teal.slice coverage - 69.64%

    221 - 19x + 19x +
      choices_labeled(
    222 - 19x + 19x +
        choices = choices,
    223 - 19x + 19x +
        labels = unname(varlabels[choices]),
    224 - 19x + 19x +
        types = choice_types[choices]
    @@ -47242,49 +49006,56 @@

    teal.slice coverage - 69.64%

    231 - 17x + 17x +
      if (!is.array(data)) {
    232 - 16x + 16x +
        vapply(
    233 - 16x + 16x +
          colnames(data),
    234 - 16x + 16x +
          FUN = function(x) {
    235 - 120x + 120x +
            label <- attr(data[[x]], "label")
    236 - 120x + 120x +
            if (is.null(label)) {
    237 - 118x + 118x +
              x
    @@ -47298,7 +49069,8 @@

    teal.slice coverage - 69.64%

    239 - 2x + 2x +
              label
    @@ -47319,7 +49091,8 @@

    teal.slice coverage - 69.64%

    242 - 16x + 16x +
          FUN.VALUE = character(1)
    @@ -47340,7 +49113,8 @@

    teal.slice coverage - 69.64%

    245 - 1x + 1x +
        character(0)
    @@ -47801,42 +49575,48 @@

    teal.slice coverage - 69.64%

    63 - 6x + 6x +
          isolate({
    64 - 6x + 6x +
            super$initialize(
    65 - 6x + 6x +
              x = x,
    66 - 6x + 6x +
              x_reactive = x_reactive,
    67 - 6x + 6x +
              slice = slice,
    68 - 6x + 6x +
              extract_type = extract_type
    @@ -47850,14 +49630,16 @@

    teal.slice coverage - 69.64%

    70 - 6x + 6x +
            private$set_choices(slice$choices)
    71 - 6x + 6x +
            private$set_selected(slice$selected)
    @@ -47878,7 +49660,8 @@

    teal.slice coverage - 69.64%

    74 - 6x + 6x +
          invisible(self)
    @@ -47948,14 +49731,16 @@

    teal.slice coverage - 69.64%

    84 - 2x + 2x +
          if (isFALSE(private$is_any_filtered())) {
    85 - 1x + 1x +
            return(NULL)
    @@ -47969,14 +49754,16 @@

    teal.slice coverage - 69.64%

    87 - 1x + 1x +
          if (missing(dataname)) dataname <- private$get_dataname()
    88 - 1x + 1x +
          filter_call <- if (isTRUE(private$get_keep_na())) {
    @@ -47997,7 +49784,8 @@

    teal.slice coverage - 69.64%

    91 - 1x + 1x +
            substitute(!is.na(varname), list(varname = private$get_varname_prefixed(dataname)))
    @@ -48109,14 +49897,16 @@

    teal.slice coverage - 69.64%

    107 - 6x + 6x +
          private$teal_slice$choices <- choices
    108 - 6x + 6x +
          invisible(NULL)
    @@ -48172,7 +49962,8 @@

    teal.slice coverage - 69.64%

    116 - 2x + 2x +
          if (private$is_choice_limited) {
    @@ -48193,7 +49984,8 @@

    teal.slice coverage - 69.64%

    119 - 2x + 2x +
            !isTRUE(private$get_keep_na())
    @@ -48696,21 +50488,24 @@

    teal.slice coverage - 69.64%

    18 - 7x + 7x +
      checkmate::assert_list(x, any.missing = FALSE, names = "unique")
    19 - 6x + 6x +
      checkmate::assert_class(join_keys, "join_keys")
    20 - 5x + 5x +
      if (!missing(code)) {
    @@ -48752,7 +50547,8 @@

    teal.slice coverage - 69.64%

    26 - 5x + 5x +
      if (!missing(check)) {
    @@ -48794,7 +50590,8 @@

    teal.slice coverage - 69.64%

    32 - 5x + 5x +
      FilteredData$new(x, join_keys = join_keys)
    @@ -48892,42 +50689,48 @@

    teal.slice coverage - 69.64%

    46 - 32x + 32x +
      lapply(
    47 - 32x + 32x +
        expr,
    48 - 32x + 32x +
        function(x) {
    49 - 19x + 19x +
          tryCatch(
    50 - 19x + 19x +
            eval(x, envir = env),
    51 - 19x + 19x +
            error = function(e) {
    @@ -49004,7 +50807,8 @@

    teal.slice coverage - 69.64%

    62 - 32x + 32x +
      invisible(NULL)
    @@ -49564,21 +51368,24 @@

    teal.slice coverage - 69.64%

    142 - 3x + 3x +
      checkmate::assert_string(input_id)
    143 - 3x + 3x +
      checkmate::assert_character(icons, len = 2L)
    144 - 3x + 3x +
      checkmate::assert_flag(one_way)
    @@ -49592,35 +51399,40 @@

    teal.slice coverage - 69.64%

    146 - 3x + 3x +
      expr <-
    147 - 3x + 3x +
        if (one_way) {
    148 - 3x + 3x +
          sprintf(
    149 - 3x + 3x +
            "$('#%s i').removeClass('%s').addClass('%s');",
    150 - 3x + 3x +
            input_id, icons[1], icons[2]
    @@ -49662,7 +51474,8 @@

    teal.slice coverage - 69.64%

    156 - 3x + 3x +
      shinyjs::runjs(expr)
    @@ -49676,7 +51489,8 @@

    teal.slice coverage - 69.64%

    158 - 3x + 3x +
      invisible(NULL)
    @@ -49718,21 +51532,24 @@

    teal.slice coverage - 69.64%

    164 - 3x + 3x +
      checkmate::assert_string(input_id)
    165 - 3x + 3x +
      checkmate::assert_character(titles, len = 2L)
    166 - 3x + 3x +
      checkmate::assert_flag(one_way)
    @@ -49746,35 +51563,40 @@

    teal.slice coverage - 69.64%

    168 - 3x + 3x +
      expr <-
    169 - 3x + 3x +
        if (one_way) {
    170 - 3x + 3x +
          sprintf(
    171 - 3x + 3x +
            "$('a#%s').attr('title', '%s');",
    172 - 3x + 3x +
            input_id, titles[2]
    @@ -49879,7 +51701,8 @@

    teal.slice coverage - 69.64%

    187 - 3x + 3x +
      shinyjs::runjs(expr)
    @@ -49893,7 +51716,8 @@

    teal.slice coverage - 69.64%

    189 - 3x + 3x +
      invisible(NULL)
    @@ -49984,7 +51808,8 @@

    teal.slice coverage - 69.64%

    202 - 64x + 64x +
      utils::getFromNamespace("topological_sort", ns = "teal.data")(graph)
    @@ -50662,49 +52487,56 @@

    teal.slice coverage - 69.64%

    95 - 663x + 663x +
      slices <- list(...)
    96 - 663x + 663x +
      checkmate::assert_list(slices, types = "teal_slice", any.missing = FALSE)
    97 - 662x + 662x +
      slices_id <- isolate(vapply(slices, `[[`, character(1L), "id"))
    98 - 662x + 662x +
      if (any(duplicated(slices_id))) {
    99 - 1x + 1x +
        stop(
    100 - 1x + 1x +
          "Some teal_slice objects have the same id:\n",
    101 - 1x + 1x +
          toString(unique(slices_id[duplicated(slices_id)]))
    @@ -50725,35 +52557,40 @@

    teal.slice coverage - 69.64%

    104 - 661x + 661x +
      checkmate::assert_list(exclude_varnames, names = "named", types = "character", null.ok = TRUE, min.len = 1)
    105 - 660x + 660x +
      checkmate::assert_list(include_varnames, names = "named", types = "character", null.ok = TRUE, min.len = 1)
    106 - 659x + 659x +
      checkmate::assert_character(count_type, len = 1, null.ok = TRUE)
    107 - 657x + 657x +
      checkmate::assert_subset(count_type, choices = c("all", "none"), empty.ok = TRUE)
    108 - 656x + 656x +
      checkmate::assert_logical(allow_add)
    @@ -50767,35 +52604,40 @@

    teal.slice coverage - 69.64%

    110 - 655x + 655x +
      duplicated_datasets <- intersect(names(include_varnames), names(exclude_varnames))
    111 - 655x + 655x +
      if (length(duplicated_datasets)) {
    112 - 1x + 1x +
        stop(
    113 - 1x + 1x +
          "Some datasets are specified in both, include_varnames and exclude_varnames:\n",
    114 - 1x + 1x +
          toString(duplicated_datasets)
    @@ -50823,49 +52665,56 @@

    teal.slice coverage - 69.64%

    118 - 654x + 654x +
      structure(
    119 - 654x + 654x +
        slices,
    120 - 654x + 654x +
        exclude_varnames = exclude_varnames,
    121 - 654x + 654x +
        include_varnames = include_varnames,
    122 - 654x + 654x +
        count_type = count_type,
    123 - 654x + 654x +
        allow_add = allow_add,
    124 - 654x + 654x +
        class = c("teal_slices", class(slices))
    @@ -50998,7 +52847,8 @@

    teal.slice coverage - 69.64%

    143 - 373x + 373x +
      inherits(x, "teal_slices")
    @@ -51138,21 +52988,24 @@

    teal.slice coverage - 69.64%

    163 - 1038x + 1038x +
      ans <- unclass(x)
    164 - 45x + 45x +
      if (recursive) ans[] <- lapply(ans, as.list)
    165 - 1038x + 1038x +
      ans
    @@ -51208,21 +53061,24 @@

    teal.slice coverage - 69.64%

    173 - 3x + 3x +
      if (missing(i)) i <- seq_along(x)
    174 - 475x + 475x +
      if (length(i) == 0L) {
    175 - 162x + 162x +
        return(x[0])
    @@ -51236,35 +53092,40 @@

    teal.slice coverage - 69.64%

    177 - 1x + 1x +
      if (is.logical(i) && length(i) > length(x)) stop("subscript out of bounds")
    178 - 1x + 1x +
      if (is.numeric(i) && max(i) > length(x)) stop("subscript out of bounds")
    179 - 311x + 311x +
      if (is.character(i)) {
    180 - 1x + 1x +
        if (!all(is.element(i, names(x)))) stop("subscript out of bounds")
    181 - 2x + 2x +
        i <- which(is.element(i, names(x)))
    @@ -51285,35 +53146,40 @@

    teal.slice coverage - 69.64%

    184 - 310x + 310x +
      y <- NextMethod("[")
    185 - 310x + 310x +
      attrs <- attributes(x)
    186 - 310x + 310x +
      attrs$names <- attrs$names[i]
    187 - 310x + 310x +
      attributes(y) <- attrs
    188 - 310x + 310x +
      y
    @@ -51369,14 +53235,16 @@

    teal.slice coverage - 69.64%

    196 - 211x + 211x +
      x <- list(...)
    197 - 211x + 211x +
      checkmate::assert_true(all(vapply(x, is.teal_slices, logical(1L))), .var.name = "all arguments are teal_slices")
    @@ -51390,21 +53258,24 @@

    teal.slice coverage - 69.64%

    199 - 210x + 210x +
      all_attributes <- lapply(x, attributes)
    200 - 210x + 210x +
      all_attributes <- coalesce_r(all_attributes)
    201 - 210x + 210x +
      all_attributes <- all_attributes[names(all_attributes) != "class"]
    @@ -51418,35 +53289,40 @@

    teal.slice coverage - 69.64%

    203 - 210x + 210x +
      do.call(
    204 - 210x + 210x +
        teal_slices,
    205 - 210x + 210x +
        c(
    206 - 210x + 210x +
          unique(unlist(x, recursive = FALSE)),
    207 - 210x + 210x +
          all_attributes
    @@ -51530,14 +53406,16 @@

    teal.slice coverage - 69.64%

    219 - 45x + 45x +
      checkmate::assert_flag(show_all)
    220 - 45x + 45x +
      checkmate::assert_flag(trim_lines)
    @@ -51551,35 +53429,40 @@

    teal.slice coverage - 69.64%

    222 - 45x + 45x +
      x <- as.list(x, recursive = TRUE)
    223 - 45x + 45x +
      attrs <- attributes(x)
    224 - 45x + 45x +
      attributes(x) <- NULL
    225 - 45x + 45x +
      slices_list <- list(slices = x, attributes = attrs)
    226 - 45x + 45x +
      slices_list <- Filter(Negate(is.null), slices_list) # drop attributes if empty
    @@ -51593,7 +53476,8 @@

    teal.slice coverage - 69.64%

    228 - 20x + 20x +
      if (!show_all) slices_list$slices <- lapply(slices_list$slices, function(slice) Filter(Negate(is.null), slice))
    @@ -51607,7 +53491,8 @@

    teal.slice coverage - 69.64%

    230 - 45x + 45x +
      jsonify(slices_list, trim_lines)
    @@ -51656,7 +53541,8 @@

    teal.slice coverage - 69.64%

    237 - 2x + 2x +
      cat(format(x, ...), "\n")
    @@ -51740,21 +53626,24 @@

    teal.slice coverage - 69.64%

    249 - 14x + 14x +
      Filter(
    250 - 14x + 14x +
        function(xx) {
    251 - 12x + 12x +
          !any(vapply(y, function(yy) identical(yy, xx), logical(1)))
    @@ -51768,7 +53657,8 @@

    teal.slice coverage - 69.64%

    253 - 14x + 14x +
        x
    @@ -51915,28 +53805,32 @@

    teal.slice coverage - 69.64%

    274 - 1312x + 1312x +
      checkmate::assert_list(x)
    275 - 1311x + 1311x +
      xnn <- Filter(Negate(is.null), x)
    276 - 1311x + 1311x +
      if (all(vapply(xnn, is.atomic, logical(1L)))) {
    277 - 884x + 884x +
        return(xnn[[1L]])
    @@ -51950,21 +53844,24 @@

    teal.slice coverage - 69.64%

    279 - 427x + 427x +
      lapply(x, checkmate::assert_list, names = "named", null.ok = TRUE, .var.name = "list element")
    280 - 426x + 426x +
      all_names <- unique(unlist(lapply(x, names)))
    281 - 426x + 426x +
      sapply(all_names, function(nm) coalesce_r(lapply(x, `[[`, nm)), simplify = FALSE)
    @@ -52145,7 +54042,8 @@

    teal.slice coverage - 69.64%

    24 - 19x + 19x +
      if (is.factor(choices)) {
    @@ -52173,35 +54071,40 @@

    teal.slice coverage - 69.64%

    28 - 19x + 19x +
      stopifnot(
    29 - 19x + 19x +
        is.character(choices) ||
    30 - 19x + 19x +
          is.numeric(choices) ||
    31 - 19x + 19x +
          is.logical(choices) ||
    32 - 19x + 19x +
          (length(choices) == 1 && is.na(choices))
    @@ -52222,7 +54125,8 @@

    teal.slice coverage - 69.64%

    35 - 19x + 19x +
      if (is.factor(labels)) {
    @@ -52250,14 +54154,16 @@

    teal.slice coverage - 69.64%

    39 - 19x + 19x +
      checkmate::assert_character(labels[!is.na(labels)], any.missing = FALSE)
    40 - 19x + 19x +
      if (length(choices) != length(labels)) {
    @@ -52278,14 +54184,16 @@

    teal.slice coverage - 69.64%

    43 - 19x + 19x +
      stopifnot(is.null(subset) || is.vector(subset))
    44 - 19x + 19x +
      stopifnot(is.null(types) || is.vector(types))
    @@ -52299,14 +54207,16 @@

    teal.slice coverage - 69.64%

    46 - 19x + 19x +
      if (is.vector(types)) {
    47 - 19x + 19x +
        stopifnot(length(choices) == length(types))
    @@ -52327,7 +54237,8 @@

    teal.slice coverage - 69.64%

    50 - 19x + 19x +
      if (!is.null(subset)) {
    @@ -52390,56 +54301,64 @@

    teal.slice coverage - 69.64%

    59 - 19x + 19x +
      is_dupl <- duplicated(choices)
    60 - 19x + 19x +
      choices <- choices[!is_dupl]
    61 - 19x + 19x +
      labels <- labels[!is_dupl]
    62 - 19x + 19x +
      types <- types[!is_dupl]
    63 - 19x + 19x +
      labels[is.na(labels)] <- "Label Missing"
    64 - 19x + 19x +
      raw_labels <- labels
    65 - 19x + 19x +
      combined_labels <- if (length(choices) > 0) {
    66 - 19x + 19x +
        paste0(choices, ": ", labels)
    @@ -52474,7 +54393,8 @@

    teal.slice coverage - 69.64%

    71 - 19x + 19x +
      if (!is.null(subset)) {
    @@ -52523,49 +54443,56 @@

    teal.slice coverage - 69.64%

    78 - 19x + 19x +
      choices <- structure(
    79 - 19x + 19x +
        choices,
    80 - 19x + 19x +
        names = combined_labels,
    81 - 19x + 19x +
        raw_labels = raw_labels,
    82 - 19x + 19x +
        combined_labels = combined_labels,
    83 - 19x + 19x +
        class = c("choices_labeled", "character"),
    84 - 19x + 19x +
        types = types
    @@ -52586,7 +54513,8 @@

    teal.slice coverage - 69.64%

    87 - 19x + 19x +
      choices
    @@ -52844,7 +54772,8 @@

    teal.slice coverage - 69.64%

    35 - 84x + 84x +
          if (!requireNamespace("SummarizedExperiment", quietly = TRUE)) {
    @@ -52865,42 +54794,48 @@

    teal.slice coverage - 69.64%

    38 - 84x + 84x +
          checkmate::assert_function(data_reactive, args = "sid")
    39 - 84x + 84x +
          checkmate::assert_class(data, "SummarizedExperiment")
    40 - 83x + 83x +
          super$initialize(data, data_reactive, dataname, datalabel)
    41 - 83x + 83x +
          if (!is.null(datalabel)) {
    42 - 76x + 76x +
            private$dataname_prefixed <- sprintf(
    43 - 76x + 76x +
              "%s[['%s']]", private$dataname_prefixed, datalabel
    @@ -52998,35 +54933,40 @@

    teal.slice coverage - 69.64%

    57 - 53x + 53x +
          isolate({
    58 - 53x + 53x +
            logger::log_debug("{ class(self)[1] }$set_filter_state initializing, dataname: { private$dataname }")
    59 - 53x + 53x +
            checkmate::assert_class(state, "teal_slices")
    60 - 51x + 51x +
            lapply(state, function(x) {
    61 - 16x + 16x +
              checkmate::assert_choice(x$arg, choices = c("subset", "select"), null.ok = TRUE, .var.name = "teal_slice$arg")
    @@ -53040,21 +54980,24 @@

    teal.slice coverage - 69.64%

    63 - 51x + 51x +
            count_type <- attr(state, "count_type")
    64 - 51x + 51x +
            if (length(count_type)) {
    65 - 8x + 8x +
              private$count_type <- count_type
    @@ -53075,35 +55018,40 @@

    teal.slice coverage - 69.64%

    68 - 51x + 51x +
            subset_states <- Filter(function(x) x$arg == "subset", state)
    69 - 51x + 51x +
            private$set_filter_state_impl(
    70 - 51x + 51x +
              state = subset_states,
    71 - 51x + 51x +
              data = SummarizedExperiment::rowData(private$data),
    72 - 51x + 51x +
              data_reactive = function(sid = "") {
    @@ -53159,35 +55107,40 @@

    teal.slice coverage - 69.64%

    80 - 51x + 51x +
            select_states <- Filter(function(x) x$arg == "select", state)
    81 - 51x + 51x +
            private$set_filter_state_impl(
    82 - 51x + 51x +
              state = select_states,
    83 - 51x + 51x +
              data = SummarizedExperiment::colData(private$data),
    84 - 51x + 51x +
              data_reactive = function(sid = "") {
    @@ -53243,7 +55196,8 @@

    teal.slice coverage - 69.64%

    92 - 51x + 51x +
            invisible(NULL)
    @@ -53313,49 +55267,56 @@

    teal.slice coverage - 69.64%

    102 - 2x + 2x +
          data <- private$data
    103 - 2x + 2x +
          checkmate::assert_string(id)
    104 - 2x + 2x +
          ns <- NS(id)
    105 - 2x + 2x +
          row_input <- if (ncol(SummarizedExperiment::rowData(data)) == 0) {
    106 - 1x + 1x +
            tags$div("no sample variables available")
    107 - 2x + 2x +
          } else if (nrow(SummarizedExperiment::rowData(data)) == 0) {
    108 - 1x + 1x +
            tags$div("no samples available")
    @@ -53439,28 +55400,32 @@

    teal.slice coverage - 69.64%

    120 - 2x + 2x +
          col_input <- if (ncol(SummarizedExperiment::colData(data)) == 0) {
    121 - 1x + 1x +
            tags$div("no sample variables available")
    122 - 2x + 2x +
          } else if (nrow(SummarizedExperiment::colData(data)) == 0) {
    123 - 1x + 1x +
            tags$div("no samples available")
    @@ -53544,21 +55509,24 @@

    teal.slice coverage - 69.64%

    135 - 2x + 2x +
          tags$div(
    136 - 2x + 2x +
            row_input,
    137 - 2x + 2x +
            col_input
    @@ -53684,42 +55652,48 @@

    teal.slice coverage - 69.64%

    155 - 4x + 4x +
          data <- private$data
    156 - 4x + 4x +
          data_reactive <- private$data_reactive
    157 - 4x + 4x +
          moduleServer(
    158 - 4x + 4x +
            id = id,
    159 - 4x + 4x +
            function(input, output, session) {
    160 - 4x + 4x +
              logger::log_debug("SEFilterState$srv_add initializing, dataname: { private$dataname }")
    @@ -53733,14 +55707,16 @@

    teal.slice coverage - 69.64%

    162 - 4x + 4x +
              row_data <- SummarizedExperiment::rowData(data)
    163 - 4x + 4x +
              col_data <- SummarizedExperiment::colData(data)
    @@ -53754,21 +55730,24 @@

    teal.slice coverage - 69.64%

    165 - 4x + 4x +
              avail_row_data_choices <- reactive({
    166 - 4x + 4x +
                slices_for_subset <- Filter(function(x) x$arg == "subset", self$get_filter_state())
    167 - 4x + 4x +
                active_filter_row_vars <- unique(unlist(lapply(slices_for_subset, "[[", "varname")))
    @@ -53782,21 +55761,24 @@

    teal.slice coverage - 69.64%

    169 - 4x + 4x +
                choices <- setdiff(
    170 - 4x + 4x +
                  get_supported_filter_varnames(data = row_data),
    171 - 4x + 4x +
                  active_filter_row_vars
    @@ -53817,35 +55799,40 @@

    teal.slice coverage - 69.64%

    174 - 4x + 4x +
                data_choices_labeled(
    175 - 4x + 4x +
                  data = row_data,
    176 - 4x + 4x +
                  choices = choices,
    177 - 4x + 4x +
                  varlabels = character(0),
    178 - 4x + 4x +
                  keys = NULL
    @@ -53873,21 +55860,24 @@

    teal.slice coverage - 69.64%

    182 - 4x + 4x +
              avail_col_data_choices <- reactive({
    183 - 4x + 4x +
                slices_for_select <- Filter(function(x) x$arg == "select", self$get_filter_state())
    184 - 4x + 4x +
                active_filter_col_vars <- unique(unlist(lapply(slices_for_select, "[[", "varname")))
    @@ -53901,21 +55891,24 @@

    teal.slice coverage - 69.64%

    186 - 4x + 4x +
                choices <- setdiff(
    187 - 4x + 4x +
                  get_supported_filter_varnames(data = col_data),
    188 - 4x + 4x +
                  active_filter_col_vars
    @@ -53936,35 +55929,40 @@

    teal.slice coverage - 69.64%

    191 - 4x + 4x +
                data_choices_labeled(
    192 - 4x + 4x +
                  data = col_data,
    193 - 4x + 4x +
                  choices = choices,
    194 - 4x + 4x +
                  varlabels = character(0),
    195 - 4x + 4x +
                  keys = NULL
    @@ -53992,49 +55990,56 @@

    teal.slice coverage - 69.64%

    199 - 4x + 4x +
              private$session_bindings[[session$ns("avail_row_data_choices")]] <- observeEvent(
    200 - 4x + 4x +
                avail_row_data_choices(),
    201 - 4x + 4x +
                ignoreNULL = TRUE,
    202 - 4x + 4x +
                handlerExpr = {
    203 - 4x + 4x +
                  logger::log_debug(paste(
    204 - 4x + 4x +
                    "SEFilterStates$srv_add@1 updating available row data choices,",
    205 - 4x + 4x +
                    "dataname: { private$dataname }"
    @@ -54048,7 +56053,8 @@

    teal.slice coverage - 69.64%

    207 - 4x + 4x +
                  if (is.null(avail_row_data_choices())) {
    @@ -54069,7 +56075,8 @@

    teal.slice coverage - 69.64%

    210 - 4x + 4x +
                    shinyjs::show("row_to_add")
    @@ -54083,28 +56090,32 @@

    teal.slice coverage - 69.64%

    212 - 4x + 4x +
                  teal.widgets::updateOptionalSelectInput(
    213 - 4x + 4x +
                    session,
    214 - 4x + 4x +
                    "row_to_add",
    215 - 4x + 4x +
                    choices = avail_row_data_choices()
    @@ -54118,21 +56129,24 @@

    teal.slice coverage - 69.64%

    217 - 4x + 4x +
                  logger::log_debug(paste(
    218 - 4x + 4x +
                    "SEFilterStates$srv_add@1 updated available row data choices,",
    219 - 4x + 4x +
                    "dataname: { private$dataname }"
    @@ -54167,49 +56181,56 @@

    teal.slice coverage - 69.64%

    224 - 4x + 4x +
              private$session_bindings[[session$ns("avail_col_data_choices")]] <- observeEvent(
    225 - 4x + 4x +
                avail_col_data_choices(),
    226 - 4x + 4x +
                ignoreNULL = TRUE,
    227 - 4x + 4x +
                handlerExpr = {
    228 - 4x + 4x +
                  logger::log_debug(paste(
    229 - 4x + 4x +
                    "SEFilterStates$srv_add@2 updating available col data choices,",
    230 - 4x + 4x +
                    "dataname: { private$dataname }"
    @@ -54223,7 +56244,8 @@

    teal.slice coverage - 69.64%

    232 - 4x + 4x +
                  if (is.null(avail_col_data_choices())) {
    @@ -54244,7 +56266,8 @@

    teal.slice coverage - 69.64%

    235 - 4x + 4x +
                    shinyjs::show("col_to_add")
    @@ -54258,28 +56281,32 @@

    teal.slice coverage - 69.64%

    237 - 4x + 4x +
                  teal.widgets::updateOptionalSelectInput(
    238 - 4x + 4x +
                    session,
    239 - 4x + 4x +
                    "col_to_add",
    240 - 4x + 4x +
                    choices = avail_col_data_choices()
    @@ -54293,21 +56320,24 @@

    teal.slice coverage - 69.64%

    242 - 4x + 4x +
                  logger::log_debug(paste(
    243 - 4x + 4x +
                    "SEFilterStates$srv_add@2 updated available col data choices,",
    244 - 4x + 4x +
                    "dataname: { private$dataname }"
    @@ -54342,21 +56372,24 @@

    teal.slice coverage - 69.64%

    249 - 4x + 4x +
              private$session_bindings[[session$ns("col_to_add")]] <- observeEvent(
    250 - 4x + 4x +
                eventExpr = input$col_to_add,
    251 - 4x + 4x +
                handlerExpr = {
    @@ -54524,21 +56557,24 @@

    teal.slice coverage - 69.64%

    275 - 4x + 4x +
              private$session_bindings[[session$ns("row_to_add")]] <- observeEvent(
    276 - 4x + 4x +
                eventExpr = input$row_to_add,
    277 - 4x + 4x +
                handlerExpr = {
    @@ -54706,21 +56742,24 @@

    teal.slice coverage - 69.64%

    301 - 4x + 4x +
              private$session_bindings[[session$ns("inputs")]] <- list(
    302 - 4x + 4x +
                destroy = function() {
    303 - 8x + 8x +
                  if (!session$isEnded()) {
    @@ -54762,7 +56801,8 @@

    teal.slice coverage - 69.64%

    309 - 4x + 4x +
              NULL
    @@ -55818,21 +57858,24 @@

    teal.slice coverage - 69.64%

    145 - 24x + 24x +
          isolate({
    146 - 24x + 24x +
            checkmate::assert_date(x)
    147 - 23x + 23x +
            checkmate::assert_class(x_reactive, "reactive")
    @@ -55846,35 +57889,40 @@

    teal.slice coverage - 69.64%

    149 - 23x + 23x +
            super$initialize(
    150 - 23x + 23x +
              x = x,
    151 - 23x + 23x +
              x_reactive = x_reactive,
    152 - 23x + 23x +
              slice = slice,
    153 - 23x + 23x +
              extract_type = extract_type
    @@ -55888,28 +57936,32 @@

    teal.slice coverage - 69.64%

    155 - 23x + 23x +
            checkmate::assert_date(slice$choices, null.ok = TRUE)
    156 - 22x + 22x +
            private$set_choices(slice$choices)
    157 - 14x + 14x +
            if (is.null(slice$selected)) slice$selected <- slice$choices
    158 - 22x + 22x +
            private$set_selected(slice$selected)
    @@ -55930,7 +57982,8 @@

    teal.slice coverage - 69.64%

    161 - 21x + 21x +
          invisible(self)
    @@ -56007,14 +58060,16 @@

    teal.slice coverage - 69.64%

    172 - 7x + 7x +
          if (isFALSE(private$is_any_filtered())) {
    173 - 1x + 1x +
            return(NULL)
    @@ -56028,28 +58083,32 @@

    teal.slice coverage - 69.64%

    175 - 6x + 6x +
          choices <- as.character(private$get_selected())
    176 - 6x + 6x +
          varname <- private$get_varname_prefixed(dataname)
    177 - 6x + 6x +
          filter_call <-
    178 - 6x + 6x +
            call(
    @@ -56063,14 +58122,16 @@

    teal.slice coverage - 69.64%

    180 - 6x + 6x +
              call(">=", varname, call("as.Date", choices[1L])),
    181 - 6x + 6x +
              call("<=", varname, call("as.Date", choices[2L]))
    @@ -56084,7 +58145,8 @@

    teal.slice coverage - 69.64%

    183 - 6x + 6x +
          private$add_keep_na_call(filter_call, varname)
    @@ -56140,14 +58202,16 @@

    teal.slice coverage - 69.64%

    191 - 22x + 22x +
          if (is.null(choices)) {
    192 - 19x + 19x +
            choices <- range(private$x, na.rm = TRUE)
    @@ -56161,21 +58225,24 @@

    teal.slice coverage - 69.64%

    194 - 3x + 3x +
            choices_adjusted <- c(
    195 - 3x + 3x +
              max(choices[1L], min(private$x, na.rm = TRUE)),
    196 - 3x + 3x +
              min(choices[2L], max(private$x, na.rm = TRUE))
    @@ -56189,28 +58256,32 @@

    teal.slice coverage - 69.64%

    198 - 3x + 3x +
            if (any(choices != choices_adjusted)) {
    199 - 1x + 1x +
              warning(sprintf(
    200 - 1x + 1x +
                "Choices adjusted (some values outside of variable range). Varname: %s, dataname: %s.",
    201 - 1x + 1x +
                private$get_varname(), private$get_dataname()
    @@ -56224,7 +58295,8 @@

    teal.slice coverage - 69.64%

    203 - 1x + 1x +
              choices <- choices_adjusted
    @@ -56238,35 +58310,40 @@

    teal.slice coverage - 69.64%

    205 - 3x + 3x +
            if (choices[1L] >= choices[2L]) {
    206 - 1x + 1x +
              warning(sprintf(
    207 - 1x + 1x +
                "Invalid choices: lower is higher / equal to upper, or not in range of variable values.
    208 - 1x + 1x +
                Setting defaults. Varname: %s, dataname: %s.",
    209 - 1x + 1x +
                private$get_varname(), private$get_dataname()
    @@ -56280,7 +58357,8 @@

    teal.slice coverage - 69.64%

    211 - 1x + 1x +
              choices <- range(private$x, na.rm = TRUE)
    @@ -56301,28 +58379,32 @@

    teal.slice coverage - 69.64%

    214 - 22x + 22x +
          private$set_is_choice_limited(private$x, choices)
    215 - 22x + 22x +
          private$x <- private$x[(private$x >= choices[1L] & private$x <= choices[2L]) | is.na(private$x)]
    216 - 22x + 22x +
          private$teal_slice$choices <- choices
    217 - 22x + 22x +
          invisible(NULL)
    @@ -56364,14 +58446,16 @@

    teal.slice coverage - 69.64%

    223 - 22x + 22x +
          private$is_choice_limited <- (any(xl < choices[1L], na.rm = TRUE) | any(xl > choices[2L], na.rm = TRUE))
    224 - 22x + 22x +
          invisible(NULL)
    @@ -56392,21 +58476,24 @@

    teal.slice coverage - 69.64%

    227 - 33x + 33x +
          tryCatch(
    228 - 33x + 33x +
            expr = {
    229 - 33x + 33x +
              values <- as.Date(values, origin = "1970-01-01")
    @@ -56420,7 +58507,8 @@

    teal.slice coverage - 69.64%

    231 - 30x + 30x +
              values
    @@ -56434,7 +58522,8 @@

    teal.slice coverage - 69.64%

    233 - 33x + 33x +
            error = function(e) stop("Vector of set values must contain values coercible to Date.")
    @@ -56462,42 +58551,48 @@

    teal.slice coverage - 69.64%

    237 - 1x + 1x +
          if (length(values) != 2) stop("Vector of set values must have length two.")
    238 - 29x + 29x +
          if (values[1] > values[2]) {
    239 - 1x + 1x +
            warning(
    240 - 1x + 1x +
              sprintf(
    241 - 1x + 1x +
                "Start date %s is set after the end date %s, the values will be replaced with a default date range.",
    242 - 1x + 1x +
                values[1], values[2]
    @@ -56518,7 +58613,8 @@

    teal.slice coverage - 69.64%

    245 - 1x + 1x +
            values <- isolate(private$get_choices())
    @@ -56532,7 +58628,8 @@

    teal.slice coverage - 69.64%

    247 - 29x + 29x +
          values
    @@ -56553,42 +58650,48 @@

    teal.slice coverage - 69.64%

    250 - 29x + 29x +
          choices <- private$get_choices()
    251 - 29x + 29x +
          if (values[1] < choices[1L] | values[1] > choices[2L]) {
    252 - 5x + 5x +
            warning(
    253 - 5x + 5x +
              sprintf(
    254 - 5x + 5x +
                "Value: %s is outside of the possible range for column %s of dataset %s, setting minimum possible value.",
    255 - 5x + 5x +
                values[1], private$get_varname(), private$get_dataname()
    @@ -56609,7 +58712,8 @@

    teal.slice coverage - 69.64%

    258 - 5x + 5x +
            values[1] <- choices[1L]
    @@ -56630,35 +58734,40 @@

    teal.slice coverage - 69.64%

    261 - 29x + 29x +
          if (values[2] > choices[2L] | values[2] < choices[1L]) {
    262 - 5x + 5x +
            warning(
    263 - 5x + 5x +
              sprintf(
    264 - 5x + 5x +
                "Value: %s is outside of the possible range for column %s of dataset %s, setting maximum possible value.",
    265 - 5x + 5x +
                values[2], private$get_varname(), private$get_dataname()
    @@ -56679,7 +58788,8 @@

    teal.slice coverage - 69.64%

    268 - 5x + 5x +
            values[2] <- choices[2L]
    @@ -56700,7 +58810,8 @@

    teal.slice coverage - 69.64%

    271 - 29x + 29x +
          values
    @@ -58757,21 +60868,24 @@

    teal.slice coverage - 69.64%

    124 - 575x + 575x +
      checkmate::assert_string(dataname)
    125 - 568x + 568x +
      checkmate::assert_flag(fixed)
    126 - 566x + 566x +
      checkmate::assert_flag(anchored)
    @@ -58785,7 +60899,8 @@

    teal.slice coverage - 69.64%

    128 - 564x + 564x +
      formal_args <- as.list(environment())
    @@ -58799,7 +60914,8 @@

    teal.slice coverage - 69.64%

    130 - 564x + 564x +
      if (!missing(expr) && !missing(varname)) {
    @@ -58813,28 +60929,32 @@

    teal.slice coverage - 69.64%

    132 - 564x + 564x +
      } else if (!missing(expr)) {
    133 - 30x + 30x +
        checkmate::assert_string(id)
    134 - 27x + 27x +
        checkmate::assert_string(title)
    135 - 24x + 24x +
        checkmate::assert_string(expr)
    @@ -58848,84 +60968,96 @@

    teal.slice coverage - 69.64%

    137 - 23x + 23x +
        formal_args$fixed <- TRUE
    138 - 23x + 23x +
        ts_expr_args <- c("dataname", "id", "expr", "fixed", "anchored", "title")
    139 - 23x + 23x +
        formal_args <- formal_args[ts_expr_args]
    140 - 23x + 23x +
        ans <- do.call(reactiveValues, c(formal_args, list(...)))
    141 - 23x + 23x +
        class(ans) <- c("teal_slice_expr", "teal_slice", class(ans))
    142 - 534x + 534x +
      } else if (!missing(varname)) {
    143 - 533x + 533x +
        checkmate::assert_string(varname)
    144 - 530x + 530x +
        checkmate::assert_multi_class(choices, .filterable_class, null.ok = TRUE)
    145 - 529x + 529x +
        checkmate::assert_multi_class(selected, .filterable_class, null.ok = TRUE)
    146 - 527x + 527x +
        checkmate::assert_flag(keep_na, null.ok = TRUE)
    147 - 526x + 526x +
        checkmate::assert_flag(keep_inf, null.ok = TRUE)
    148 - 525x + 525x +
        checkmate::assert_flag(multiple)
    @@ -58939,21 +61071,24 @@

    teal.slice coverage - 69.64%

    150 - 525x + 525x +
        ts_var_args <- c(
    151 - 525x + 525x +
          "dataname", "varname", "id", "choices", "selected", "keep_na", "keep_inf",
    152 - 525x + 525x +
          "fixed", "anchored", "multiple"
    @@ -58967,42 +61102,48 @@

    teal.slice coverage - 69.64%

    154 - 525x + 525x +
        formal_args <- formal_args[ts_var_args]
    155 - 525x + 525x +
        args <- c(formal_args, list(...))
    156 - 525x + 525x +
        args[c("choices", "selected")] <-
    157 - 525x + 525x +
          lapply(args[c("choices", "selected")], function(x) if (is.factor(x)) as.character(x) else x)
    158 - 525x + 525x +
        if (missing(id)) {
    159 - 516x + 516x +
          args$id <- get_default_slice_id(args)
    @@ -59016,7 +61157,8 @@

    teal.slice coverage - 69.64%

    161 - 9x + 9x +
          checkmate::assert_string(id)
    @@ -59030,14 +61172,16 @@

    teal.slice coverage - 69.64%

    163 - 522x + 522x +
        ans <- do.call(reactiveValues, args)
    164 - 522x + 522x +
        class(ans) <- c("teal_slice_var", "teal_slice", class(ans))
    @@ -59051,7 +61195,8 @@

    teal.slice coverage - 69.64%

    166 - 1x + 1x +
        stop("Must provide either `expr` or `varname`.")
    @@ -59072,7 +61217,8 @@

    teal.slice coverage - 69.64%

    169 - 545x + 545x +
      ans
    @@ -59205,7 +61351,8 @@

    teal.slice coverage - 69.64%

    188 - 4x + 4x +
      inherits(x, "teal_slice")
    @@ -59310,7 +61457,8 @@

    teal.slice coverage - 69.64%

    203 - 283x + 283x +
      formal_args <- setdiff(names(formals(teal_slice)), "...")
    @@ -59324,7 +61472,8 @@

    teal.slice coverage - 69.64%

    205 - 283x + 283x +
      x <- if (isRunning()) {
    @@ -59345,7 +61494,8 @@

    teal.slice coverage - 69.64%

    208 - 283x + 283x +
        isolate(reactiveValuesToList(x))
    @@ -59366,14 +61516,16 @@

    teal.slice coverage - 69.64%

    211 - 283x + 283x +
      formal_args <- intersect(formal_args, names(x))
    212 - 283x + 283x +
      extra_args <- rev(setdiff(names(x), formal_args))
    @@ -59387,7 +61539,8 @@

    teal.slice coverage - 69.64%

    214 - 283x + 283x +
      x[c(formal_args, extra_args)]
    @@ -59443,14 +61596,16 @@

    teal.slice coverage - 69.64%

    222 - 116x + 116x +
      checkmate::assert_flag(show_all)
    223 - 92x + 92x +
      checkmate::assert_flag(trim_lines)
    @@ -59464,14 +61619,16 @@

    teal.slice coverage - 69.64%

    225 - 86x + 86x +
      x_list <- as.list(x)
    226 - 47x + 47x +
      if (!show_all) x_list <- Filter(Negate(is.null), x_list)
    @@ -59485,7 +61642,8 @@

    teal.slice coverage - 69.64%

    228 - 86x + 86x +
      jsonify(x_list, trim_lines)
    @@ -59534,7 +61692,8 @@

    teal.slice coverage - 69.64%

    235 - 15x + 15x +
      cat(format(x, ...))
    @@ -59660,7 +61819,8 @@

    teal.slice coverage - 69.64%

    253 - 131x + 131x +
      checkmate::assert_list(x)
    @@ -59674,28 +61834,32 @@

    teal.slice coverage - 69.64%

    255 - 131x + 131x +
      x_json <- to_json(x)
    256 - 131x + 131x +
      x_json_justified <- justify_json(x_json)
    257 - 121x + 121x +
      if (trim_lines) x_json_justified <- trim_lines_json(x_json_justified)
    258 - 131x + 131x +
      paste(x_json_justified, collapse = "\n")
    @@ -59800,35 +61964,40 @@

    teal.slice coverage - 69.64%

    273 - 131x + 131x +
      no_unbox <- function(x) {
    274 - 2390x + 2390x +
        vars <- c("selected", "choices")
    275 - 2390x + 2390x +
        if (is.list(x)) {
    276 - 385x + 385x +
          for (var in vars) {
    277 - 307x + 307x +
            if (!is.null(x[[var]])) x[[var]] <- I(format_time(x[[var]]))
    @@ -59842,7 +62011,8 @@

    teal.slice coverage - 69.64%

    279 - 385x + 385x +
          lapply(x, no_unbox)
    @@ -59856,7 +62026,8 @@

    teal.slice coverage - 69.64%

    281 - 2005x + 2005x +
          x
    @@ -59884,7 +62055,8 @@

    teal.slice coverage - 69.64%

    285 - 131x + 131x +
      jsonlite::toJSON(no_unbox(x), pretty = TRUE, auto_unbox = TRUE, digits = 16, null = "null")
    @@ -59996,14 +62168,16 @@

    teal.slice coverage - 69.64%

    301 - 307x + 307x +
      if ("POSIXt" %in% class(x)) {
    302 - 20x + 20x +
        format(x, format = "%Y-%m-%d %H:%M:%S", usetz = TRUE, tz = "UTC")
    @@ -60017,7 +62191,8 @@

    teal.slice coverage - 69.64%

    304 - 287x + 287x +
        x
    @@ -60122,35 +62297,40 @@

    teal.slice coverage - 69.64%

    319 - 131x + 131x +
      format_name <- function(name, name_width) {
    320 - 2775x + 2775x +
        if (nchar(name) == 1 || nchar(gsub("\\s", "", name)) <= 2) {
    321 - 630x + 630x +
          return(name)
    322 - 2145x + 2145x +
        } else if (grepl("slices|attributes", name)) {
    323 - 90x + 90x +
          paste0(name, ":")
    @@ -60164,7 +62344,8 @@

    teal.slice coverage - 69.64%

    325 - 2055x + 2055x +
          paste(format(name, width = name_width), ":")
    @@ -60185,28 +62366,32 @@

    teal.slice coverage - 69.64%

    328 - 131x + 131x +
      json_lines <- strsplit(json, "\n")[[1]]
    329 - 131x + 131x +
      json_lines_split <- regmatches(json_lines, regexpr(":", json_lines), invert = TRUE)
    330 - 131x + 131x +
      name_width <- max(unlist(regexpr(":", json_lines))) - 1
    331 - 131x + 131x +
      vapply(json_lines_split, function(x) paste0(format_name(x[1], name_width), stats::na.omit(x[2])), character(1))
    @@ -60311,35 +62496,40 @@

    teal.slice coverage - 69.64%

    346 - 121x + 121x +
      name_width <- max(unlist(gregexpr(":", x))) - 1
    347 - 121x + 121x +
      trim_position <- name_width + 37L
    348 - 121x + 121x +
      x_trim <- substr(x, 1, trim_position)
    349 - 121x + 121x +
      substr(x_trim, trim_position - 2, trim_position) <- "..."
    350 - 121x + 121x +
      x_trim
    @@ -60507,28 +62697,32 @@

    teal.slice coverage - 69.64%

    374 - 605x + 605x +
      checkmate::assert_multi_class(x, c("teal_slice", "list"))
    375 - 605x + 605x +
      isolate({
    376 - 605x + 605x +
        if (inherits(x, "teal_slice_expr") || is.null(x$varname)) {
    377 - 10x + 10x +
          x$id
    @@ -60542,28 +62736,32 @@

    teal.slice coverage - 69.64%

    379 - 595x + 595x +
          paste(
    380 - 595x + 595x +
            Filter(
    381 - 595x + 595x +
              length,
    382 - 595x + 595x +
              as.list(x)[c("dataname", "varname", "experiment", "arg")]
    @@ -60577,7 +62775,8 @@

    teal.slice coverage - 69.64%

    384 - 595x + 595x +
            collapse = " "
    @@ -61136,42 +63335,48 @@

    teal.slice coverage - 69.64%

    75 - 27x + 27x +
      checkmate::assert_string(inputId)
    76 - 23x + 23x +
      checkmate::assert_vector(choices)
    77 - 22x + 22x +
      checkmate::assert_numeric(countsmax, len = length(choices))
    78 - 19x + 19x +
      checkmate::assert_numeric(countsnow, len = length(choices), null.ok = TRUE)
    79 - 17x + 17x +
      if (!is.null(countsnow)) {
    80 - 9x + 9x +
        checkmate::assert_true(all(countsnow <= countsmax))
    @@ -61192,7 +63397,8 @@

    teal.slice coverage - 69.64%

    83 - 16x + 16x +
      ns <- NS(inputId)
    @@ -61206,56 +63412,64 @@

    teal.slice coverage - 69.64%

    85 - 16x + 16x +
      mapply(
    86 - 16x + 16x +
        countBar,
    87 - 16x + 16x +
        inputId = ns(seq_along(choices)),
    88 - 16x + 16x +
        label = as.character(choices),
    89 - 16x + 16x +
        countmax = countsmax,
    90 - 16x + 16x +
        countnow = if (is.null(countsnow)) rep(list(NULL), length(choices)) else countsnow,
    91 - 16x + 16x +
        MoreArgs = list(
    92 - 16x + 16x +
          counttotal = sum(countsmax)
    @@ -61269,7 +63483,8 @@

    teal.slice coverage - 69.64%

    94 - 16x + 16x +
        SIMPLIFY = FALSE, USE.NAMES = FALSE
    @@ -61444,35 +63659,40 @@

    teal.slice coverage - 69.64%

    119 - 70x + 70x +
      checkmate::assert_string(inputId)
    120 - 66x + 66x +
      checkmate::assert_string(label)
    121 - 63x + 63x +
      checkmate::assert_number(countmax)
    122 - 61x + 61x +
      checkmate::assert_number(countnow, null.ok = TRUE, upper = countmax)
    123 - 59x + 59x +
      checkmate::assert_number(counttotal, lower = countmax)
    @@ -61486,35 +63706,40 @@

    teal.slice coverage - 69.64%

    125 - 57x + 57x +
      label <- make_count_text(label, countmax = countmax, countnow = countnow)
    126 - 57x + 57x +
      ns <- NS(inputId)
    127 - 26x + 26x +
      if (is.null(countnow)) countnow <- 0
    128 - 57x + 57x +
      tags$div(
    129 - 57x + 57x +
        class = "progress state-count-container",
    @@ -61528,42 +63753,48 @@

    teal.slice coverage - 69.64%

    131 - 57x + 57x +
        tags$div(
    132 - 57x + 57x +
          id = ns("count_bar_filtered"),
    133 - 57x + 57x +
          class = "progress-bar state-count-bar-filtered",
    134 - 57x + 57x +
          style = sprintf("width: %s%%", countnow / counttotal * 100),
    135 - 57x + 57x +
          role = "progressbar",
    136 - 57x + 57x +
          label
    @@ -61577,35 +63808,40 @@

    teal.slice coverage - 69.64%

    138 - 57x + 57x +
        tags$div(
    139 - 57x + 57x +
          id = ns("count_bar_unfiltered"),
    140 - 57x + 57x +
          class = "progress-bar state-count-bar-unfiltered",
    141 - 57x + 57x +
          style = sprintf("width: %s%%", (countmax - countnow) / counttotal * 100),
    142 - 57x + 57x +
          role = "progressbar"
    @@ -61654,28 +63890,32 @@

    teal.slice coverage - 69.64%

    149 - 7x + 7x +
      checkmate::assert_string(inputId)
    150 - 7x + 7x +
      checkmate::assert_vector(choices)
    151 - 7x + 7x +
      checkmate::assert_numeric(countsmax, len = length(choices))
    152 - 7x + 7x +
      checkmate::assert_numeric(countsnow, len = length(choices), null.ok = TRUE)
    @@ -61689,63 +63929,72 @@

    teal.slice coverage - 69.64%

    154 - 7x + 7x +
      ns <- NS(inputId)
    155 - 7x + 7x +
      mapply(
    156 - 7x + 7x +
        updateCountBar,
    157 - 7x + 7x +
        inputId = ns(seq_along(choices)),
    158 - 7x + 7x +
        label = choices,
    159 - 7x + 7x +
        countmax = countsmax,
    160 - 7x + 7x +
        countnow = if (is.null(countsnow)) rep(list(NULL), length(choices)) else countsnow,
    161 - 7x + 7x +
        MoreArgs = list(
    162 - 7x + 7x +
          counttotal = sum(countsmax)
    @@ -61766,7 +64015,8 @@

    teal.slice coverage - 69.64%

    165 - 7x + 7x +
      invisible(NULL)
    @@ -61801,35 +64051,40 @@

    teal.slice coverage - 69.64%

    170 - 18x + 18x +
      checkmate::assert_string(inputId)
    171 - 18x + 18x +
      checkmate::assert_string(label)
    172 - 18x + 18x +
      checkmate::assert_number(countmax)
    173 - 18x + 18x +
      checkmate::assert_number(countnow, null.ok = TRUE)
    174 - 18x + 18x +
      checkmate::assert_number(counttotal)
    @@ -61843,70 +64098,80 @@

    teal.slice coverage - 69.64%

    176 - 18x + 18x +
      label <- make_count_text(label, countmax = countmax, countnow = countnow)
    177 - 18x + 18x +
      if (is.null(countnow)) countnow <- countmax
    178 - 18x + 18x +
      session$sendCustomMessage(
    179 - 18x + 18x +
        type = "updateCountBar",
    180 - 18x + 18x +
        message = list(
    181 - 18x + 18x +
          id = session$ns(inputId),
    182 - 18x + 18x +
          label = label,
    183 - 18x + 18x +
          countmax = countmax,
    184 - 18x + 18x +
          countnow = countnow,
    185 - 18x + 18x +
          counttotal = counttotal
    @@ -61934,7 +64199,8 @@

    teal.slice coverage - 69.64%

    189 - 18x + 18x +
      invisible(NULL)
    @@ -61969,70 +64235,80 @@

    teal.slice coverage - 69.64%

    194 - 17x + 17x +
      checkmate::assert_string(inputId)
    195 - 17x + 17x +
      checkmate::assert_string(label)
    196 - 17x + 17x +
      checkmate::assert_number(countmax)
    197 - 17x + 17x +
      checkmate::assert_number(countnow, null.ok = TRUE)
    198 - 17x + 17x +
      label <- make_count_text(label, countmax = countmax, countnow = countnow)
    199 - 17x + 17x +
      session$sendCustomMessage(
    200 - 17x + 17x +
        type = "updateCountText",
    201 - 17x + 17x +
        message = list(
    202 - 17x + 17x +
          id = session$ns(inputId),
    203 - 17x + 17x +
          label = label
    @@ -62172,56 +64448,64 @@

    teal.slice coverage - 69.64%

    223 - 104x + 104x +
      checkmate::assert_string(label)
    224 - 102x + 102x +
      checkmate::assert_number(countmax)
    225 - 100x + 100x +
      checkmate::assert_number(countnow, null.ok = TRUE)
    226 - 98x + 98x +
      sprintf(
    227 - 98x + 98x +
        "%s (%s%s)",
    228 - 98x + 98x +
        label,
    229 - 98x + 98x +
        if (is.null(countnow)) "" else sprintf("%s/", countnow),
    230 - 98x + 98x +
        countmax
    @@ -62298,35 +64582,40 @@

    teal.slice coverage - 69.64%

    241 - 160x + 160x +
      checkmate::assert_numeric(counts)
    242 - 160x + 160x +
      counts <- counts[match(choices, names(counts))]
    243 - 160x + 160x +
      counts[is.na(counts)] <- 0
    244 - 160x + 160x +
      names(counts) <- choices
    245 - 160x + 160x +
      counts
    @@ -62423,35 +64712,40 @@

    teal.slice coverage - 69.64%

    12 - 12x + 12x +
      checkmate::assert_character(pattern, min.len = 1, null.ok = TRUE)
    13 - 12x + 12x +
      js_files <- list.files(
    14 - 12x + 12x +
        system.file("js", package = "teal.slice", mustWork = TRUE),
    15 - 12x + 12x +
        pattern = pattern,
    16 - 12x + 12x +
        full.names = TRUE
    @@ -62465,7 +64759,8 @@

    teal.slice coverage - 69.64%

    18 - 12x + 12x +
      singleton(lapply(js_files, includeScript))
    @@ -62605,14 +64900,16 @@

    teal.slice coverage - 69.64%

    38 - 55x + 55x +
      if (length(choices) > 1) {
    39 - 27x + 27x +
        do.call("call", append(list("c"), choices))
    @@ -62626,7 +64923,8 @@

    teal.slice coverage - 69.64%

    41 - 28x + 28x +
        choices
    @@ -62731,14 +65029,16 @@

    teal.slice coverage - 69.64%

    56 - 76x + 76x +
      if (length(private$session_bindings) > 0) lapply(private$session_bindings, function(x) x$destroy())
    57 - 1416x + 1416x +
      invisible(NULL)
    @@ -62892,7 +65192,8 @@

    teal.slice coverage - 69.64%

    79 - 392x + 392x +
      pattern_escape <- "[^0-9A-Za-z_]"
    @@ -62906,14 +65207,16 @@

    teal.slice coverage - 69.64%

    81 - 392x + 392x +
      id_new <- gsub(pattern_escape, "_", id)
    82 - 392x + 392x +
      hashes <- vapply(id[id != id_new], rlang::hash, character(1), USE.NAMES = FALSE)
    @@ -62927,14 +65230,16 @@

    teal.slice coverage - 69.64%

    84 - 392x + 392x +
      id[id != id_new] <- paste0("h", substr(hashes, 1, 4), "_", id_new[id != id_new])
    85 - 392x + 392x +
      id
    @@ -62997,14 +65302,16 @@

    teal.slice coverage - 69.64%

    94 - 148x + 148x +
      if (!missing(id)) {
    95 - 3x + 3x +
        return(shiny::NS(namespace, sanitize_id(id)))
    @@ -63025,14 +65332,16 @@

    teal.slice coverage - 69.64%

    98 - 145x + 145x +
      function(id) {
    99 - 282x + 282x +
        shiny::NS(namespace, sanitize_id(id))
    @@ -63102,14 +65411,16 @@

    teal.slice coverage - 69.64%

    109 - 107x + 107x +
      id <- sanitize_id(id)
    110 - 107x + 107x +
      shiny::moduleServer(id, module, session)
    @@ -63514,14 +65825,16 @@

    teal.slice coverage - 69.64%

    56 - 8x + 8x +
          checkmate::assert_class(datasets, "FilteredData")
    57 - 6x + 6x +
          private$filtered_data <- datasets
    @@ -63605,7 +65918,8 @@

    teal.slice coverage - 69.64%

    69 - 8x + 8x +
          private$filtered_data$get_filter_state()
    @@ -63675,14 +65989,16 @@

    teal.slice coverage - 69.64%

    79 - 5x + 5x +
          private$filtered_data$set_filter_state(filter)
    80 - 5x + 5x +
          invisible(NULL)
    @@ -63773,14 +66089,16 @@

    teal.slice coverage - 69.64%

    93 - 1x + 1x +
          private$filtered_data$remove_filter_state(filter)
    94 - 1x + 1x +
          invisible(NULL)
    @@ -63871,21 +66189,24 @@

    teal.slice coverage - 69.64%

    107 - 2x + 2x +
          datanames_to_remove <- if (missing(datanames)) private$filtered_data$datanames() else datanames
    108 - 2x + 2x +
          private$filtered_data$clear_filter_states(datanames = datanames_to_remove)
    109 - 2x + 2x +
          invisible(NULL)
    @@ -64213,7 +66534,8 @@

    teal.slice coverage - 69.64%

    39 - 24x + 24x +
          if (!requireNamespace("MultiAssayExperiment", quietly = TRUE)) {
    @@ -64234,14 +66556,16 @@

    teal.slice coverage - 69.64%

    42 - 24x + 24x +
          checkmate::assert_function(data_reactive, args = "sid")
    43 - 24x + 24x +
          checkmate::assert_class(data, "MultiAssayExperiment")
    @@ -64255,35 +66579,40 @@

    teal.slice coverage - 69.64%

    45 - 23x + 23x +
          data <- SummarizedExperiment::colData(data)
    46 - 23x + 23x +
          data_reactive <- function(sid = "") SummarizedExperiment::colData(data_reactive(sid = sid))
    47 - 23x + 23x +
          super$initialize(data, data_reactive, dataname, datalabel)
    48 - 23x + 23x +
          private$keys <- keys
    49 - 23x + 23x +
          private$set_filterable_varnames(include_varnames = colnames(data))
    @@ -64297,7 +66626,8 @@

    teal.slice coverage - 69.64%

    51 - 23x + 23x +
          invisible(self)
    @@ -64905,21 +67235,24 @@

    teal.slice coverage - 69.64%

    76 - 15x + 15x +
          checkmate::assert_class(slice, "teal_slice_expr")
    77 - 14x + 14x +
          private$teal_slice <- slice
    78 - 14x + 14x +
          invisible(self)
    @@ -65003,28 +67336,32 @@

    teal.slice coverage - 69.64%

    90 - 12x + 12x +
          sprintf(
    91 - 12x + 12x +
            "%s:\n%s",
    92 - 12x + 12x +
            class(self)[1],
    93 - 12x + 12x +
            format(self$get_state(), show_all = show_all, trim_lines = trim_lines)
    @@ -65094,7 +67431,8 @@

    teal.slice coverage - 69.64%

    103 - 1x + 1x +
          cat(isolate(self$format(...)))
    @@ -65157,7 +67495,8 @@

    teal.slice coverage - 69.64%

    112 - 50x + 50x +
          private$teal_slice
    @@ -65234,14 +67573,16 @@

    teal.slice coverage - 69.64%

    123 - 1x + 1x +
          checkmate::assert_class(state, "teal_slice_expr")
    124 - 1x + 1x +
          invisible(self)
    @@ -65353,7 +67694,8 @@

    teal.slice coverage - 69.64%

    140 - 2x + 2x +
          isolate(str2lang(private$teal_slice$expr))
    @@ -65416,14 +67758,16 @@

    teal.slice coverage - 69.64%

    149 - 20x + 20x +
          .finalize_session_bindings(self, private)
    150 - 20x + 20x +
          invisible(NULL)
    @@ -66633,21 +68977,24 @@

    teal.slice coverage - 69.64%

    39 - 19x + 19x +
      checkmate::assert_multi_class(data, c("data.frame", "DataFrame", "matrix"))
    40 - 19x + 19x +
      checkmate::assert_character(columns, any.missing = FALSE, null.ok = TRUE)
    41 - 19x + 19x +
      checkmate::assert_subset(columns, colnames(data))
    @@ -66661,35 +69008,40 @@

    teal.slice coverage - 69.64%

    43 - 19x + 19x +
      if (is.matrix(data)) {
    44 - 1x + 1x +
        type <- typeof(data)
    45 - 1x + 1x +
        if (type == "double") type <- "numeric"
    46 - 1x + 1x +
        types <-
    47 - 1x + 1x +
          if (is.null(columns)) {
    @@ -66710,7 +69062,8 @@

    teal.slice coverage - 69.64%

    50 - 1x + 1x +
            stats::setNames(rep_len(type, length(columns)), nm = columns)
    @@ -66731,14 +69084,16 @@

    teal.slice coverage - 69.64%

    53 - 18x + 18x +
        types <- vapply(data, function(x) class(x)[1L], character(1L))
    54 - 18x + 18x +
        if (!is.null(columns)) types <- types[columns]
    @@ -66759,7 +69114,8 @@

    teal.slice coverage - 69.64%

    57 - 19x + 19x +
      types
    @@ -68081,35 +70437,40 @@

    teal.slice coverage - 69.64%

    187 - 99x + 99x +
          checkmate::assert_function(data_reactive, args = "sid")
    188 - 99x + 99x +
          checkmate::assert_data_frame(data)
    189 - 99x + 99x +
          super$initialize(data, data_reactive, dataname, datalabel)
    190 - 99x + 99x +
          private$keys <- keys
    191 - 99x + 99x +
          private$set_filterable_varnames(include_varnames = colnames(private$data))
    @@ -68220,14 +70581,16 @@

    teal.slice coverage - 69.64%

    7 - 9x + 9x +
      isolate(
    8 - 9x + 9x +
        all(vapply(fields, function(x) identical(ts1[[x]], ts2[[x]]), logical(1L)))
    @@ -68290,35 +70653,40 @@

    teal.slice coverage - 69.64%

    17 - 34x + 34x +
      isolate({
    18 - 34x + 34x +
        testthat::expect_true(
    19 - 34x + 34x +
          setequal(
    20 - 34x + 34x +
            reactiveValuesToList(x),
    21 - 34x + 34x +
            reactiveValuesToList(y)
    @@ -68388,28 +70756,32 @@

    teal.slice coverage - 69.64%

    31 - 12x + 12x +
      isolate({
    32 - 12x + 12x +
        mapply(
    33 - 12x + 12x +
          function(x, y) {
    34 - 27x + 27x +
            expect_identical_slice(x, y)
    @@ -68423,14 +70795,16 @@

    teal.slice coverage - 69.64%

    36 - 12x + 12x +
          x = x,
    37 - 12x + 12x +
          y = y
    @@ -68444,7 +70818,8 @@

    teal.slice coverage - 69.64%

    39 - 12x + 12x +
        testthat::expect_identical(attributes(x), attributes(y))
    @@ -68751,7 +71126,8 @@

    teal.slice coverage - 69.64%

    41 - 24x + 24x +
          super$initialize(dataset = dataset, dataname = dataname, label = label)
    @@ -68835,35 +71211,40 @@

    teal.slice coverage - 69.64%

    53 - 4x + 4x +
          class_string <- toString(class(private$dataset))
    54 - 4x + 4x +
          if (trim_lines) {
    55 - 2x + 2x +
            trim_position <- 37L
    56 - 2x + 2x +
            class_string <- strtrim(class_string, trim_position)
    57 - 2x + 2x +
            substr(class_string, 35L, 37L) <- "..."
    @@ -68877,7 +71258,8 @@

    teal.slice coverage - 69.64%

    59 - 4x + 4x +
          sprintf(" - unfiltered dataset:\t\"%s\":   %s", private$dataname, class_string)
    @@ -68919,7 +71301,8 @@

    teal.slice coverage - 69.64%

    65 - 1x + 1x +
          invisible(NULL)
    @@ -68947,7 +71330,8 @@

    teal.slice coverage - 69.64%

    69 - 2x + 2x +
          invisible(NULL)
    @@ -68982,14 +71366,16 @@

    teal.slice coverage - 69.64%

    74 - 3x + 3x +
          if (length(state) != 0L) {
    75 - 1x + 1x +
            warning("DefaultFilterState cannot set state")
    @@ -69003,7 +71389,8 @@

    teal.slice coverage - 69.64%

    77 - 3x + 3x +
          invisible(NULL)
    @@ -69038,7 +71425,8 @@

    teal.slice coverage - 69.64%

    82 - 1x + 1x +
          invisible(NULL)
    @@ -69094,7 +71482,8 @@

    teal.slice coverage - 69.64%

    90 - 1x + 1x +
          data.frame(dataname = private$dataname, obs = NA, obs_filtered = NA)
    @@ -69673,21 +72062,24 @@

    teal.slice coverage - 69.64%

    30 - 47x + 47x +
      checkmate::assert_list(calls)
    31 - 45x + 45x +
      if (length(calls) > 0L) checkmate::assert_list(calls, types = c("call", "name"))
    32 - 46x + 46x +
      checkmate::assert_string(operator)
    @@ -69701,21 +72093,24 @@

    teal.slice coverage - 69.64%

    34 - 44x + 44x +
      Reduce(
    35 - 44x + 44x +
        x = calls,
    36 - 44x + 44x +
        f = function(x, y) call(operator, x, y)
    @@ -69980,42 +72375,48 @@

    teal.slice coverage - 69.64%

    35 - 24x + 24x +
          checkmate::assert_matrix(data)
    36 - 23x + 23x +
          super$initialize(data, data_reactive, dataname, datalabel)
    37 - 23x + 23x +
          private$set_filterable_varnames(include_varnames = colnames(private$data))
    38 - 23x + 23x +
          if (!is.null(datalabel)) {
    39 - 19x + 19x +
            private$dataname_prefixed <- sprintf(
    40 - 19x + 19x +
              "%s[['%s']]", private$dataname_prefixed, datalabel
    @@ -70721,7 +73122,8 @@

    teal.slice coverage - 69.64%

    92 - 101x + 101x +
      UseMethod("init_filtered_dataset")
    @@ -70805,56 +73207,64 @@

    teal.slice coverage - 69.64%

    104 - 79x + 79x +
      DataframeFilteredDataset$new(
    105 - 79x + 79x +
        dataset = dataset,
    106 - 79x + 79x +
        dataname = dataname,
    107 - 79x + 79x +
        keys = keys,
    108 - 79x + 79x +
        parent_name = parent_name,
    109 - 79x + 79x +
        parent = parent,
    110 - 79x + 79x +
        join_keys = join_keys,
    111 - 79x + 79x +
        label = label
    @@ -70945,7 +73355,8 @@

    teal.slice coverage - 69.64%

    124 - 5x + 5x +
      if (!requireNamespace("MultiAssayExperiment", quietly = TRUE)) {
    @@ -70966,35 +73377,40 @@

    teal.slice coverage - 69.64%

    127 - 5x + 5x +
      MAEFilteredDataset$new(
    128 - 5x + 5x +
        dataset = dataset,
    129 - 5x + 5x +
        dataname = dataname,
    130 - 5x + 5x +
        keys = keys,
    131 - 5x + 5x +
        label = label
    @@ -71085,28 +73501,32 @@

    teal.slice coverage - 69.64%

    144 - 17x + 17x +
      DefaultFilteredDataset$new(
    145 - 17x + 17x +
        dataset = dataset,
    146 - 17x + 17x +
        dataname = dataname,
    147 - 17x + 17x +
        label = label
    diff --git a/main/index.html b/main/index.html index fa89f3d99..4b3d3094e 100644 --- a/main/index.html +++ b/main/index.html @@ -1,5 +1,4 @@ - - + @@ -51,7 +50,23 @@
  • Non-CRAN unit test report
  • - + + + @@ -45,65 +84,100 @@

    Changelog

    -

    teal.slice 0.5.1.9014

    +

    teal.slice 0.5.1.9014 +

    -

    Enhancements

    -
    • Reduced the space of the filter panel by not displaying the “add filters” UI in a separate panel.
    • -
    +

    Enhancements +

    +
      +
    • Reduced the space of the filter panel by not displaying the “add filters” UI in a separate panel.
    • +
    +
    -

    Bug fixes

    -
    • Fix error while creating the filter choices when the data has a factor with a level containing an empty string (““).
    • -
    +

    Bug fixes +

    +
      +
    • Fix error while creating the filter choices when the data has a factor with a level containing an empty string (““).
    • +
    +
    -

    Breaking changes

    -
    • +

      Breaking changes +

      +
        +
      • ui_add and srv_add no longer exist as adding new filters is a part of ui_active and srv_active.
      • -
    + +
    -

    teal.slice 0.5.1

    CRAN release: 2024-04-30

    +

    teal.slice 0.5.1 +

    +

    CRAN release: 2024-04-30

    -

    Bug fixes

    -
    • Fix how the filter panel handles NA values in a Date column.
    • +

      Bug fixes +

      +
        +
      • Fix how the filter panel handles NA values in a Date column.
      • Fix filtering of ordered column to return the right call.
      • Ensure choices are sorted for factor and ordered data types.
      • -
    + +
    -

    Miscellaneous

    -
    • Added teal_slice and teal_slices to package index.
    • +

      Miscellaneous +

      +
        +
      • Added teal_slice and teal_slices to package index.
      • Implement mouse-over behavior for the filter card when it is selected.
      • -
    + +
    -

    teal.slice 0.5.0

    CRAN release: 2024-02-06

    +

    teal.slice 0.5.0 +

    +

    CRAN release: 2024-02-06

    -

    Enhancements

    -
    • Simplified init_filtered_data to accept a named list of datasets. init_filtered_data does not currently handle a list containing dataset, metadata, datalabel and code.
    • -
    +

    Enhancements +

    +
      +
    • Simplified init_filtered_data to accept a named list of datasets. init_filtered_data does not currently handle a list containing dataset, metadata, datalabel and code.
    • +
    +
    -

    Breaking changes

    -
    • +

      Breaking changes +

      +
        +
      • TealData object is no longer supported by teal.slice.
      • set_filter_state no longer accepts a nested list. Use teal_slices() and teal_slice() instead.
      • Renamed FilteredDataset subclass that handles data.frames from DefaultFilteredDataset to DataframeFilteredDataset. Added new class DefaultFilteredDataset that will store any type of object. Filtering will is not supported.
      • -
    + +
    -

    Bug fixes

    -
    • Performs an exact match when determining the default label of a dataset from attributes.
    • -
    +

    Bug fixes +

    +
      +
    • Performs an exact match when determining the default label of a dataset from attributes.
    • +
    +
    -

    Miscellaneous

    -
    • Specified minimal version of package dependencies.
    • +

      Miscellaneous +

      +
        +
      • Specified minimal version of package dependencies.
      • Removed storing and restoring of teal_slices objects.
      • Update documentation and code to reflect the changes due to the refactor of teal.data::JoinKeys into teal.data::join_keys.
      • -
    + +
    -

    teal.slice 0.4.0

    +

    teal.slice 0.4.0 +

    -

    New features

    -
    + +
    -

    Breaking changes

    -
    • Setting filters using a list is now deprecated. Use teal_slices and teal_slice instead.
    • +

      Breaking changes +

      +
        +
      • Setting filters using a list is now deprecated. Use teal_slices and teal_slice instead.
      • Removed CDISCFilteredData and CDISCFilteredDataset and implementing JoinKeys handling in their parent classes (FilteredData and DefaultFilteredDataset).
      • Specifying set of filterable columns is done through include_varnames and exclude_varnames in teal_slices. Specifying attr(, "filterable") is hard deprecated.
      • Removed private fields $code and $check from FilteredData class and made appropriate changes to constructor and init_filtered_data.
      • -
    + +
    -

    teal.slice 0.3.0

    -
    • Examples now use scda.2022 instead of scda.2021.
    • +

      teal.slice 0.3.0 +

      +
        +
      • Examples now use scda.2022 instead of scda.2021.
      • Transferred data hashing step in FilteredDataset to teal.
      • Removed constructor of Queue class.
      • -
      -

      New features

      -
      • Added a global turn on/off button for the Filter Panel.
      • +
      +
      +

      New features +

      +
        +
      • Added a global turn on/off button for the Filter Panel.
      • Added ability to collapse Active Filter Display panel.
      • Added ability to collapse all filters of an individual dataset.
      • Added fixed filter states.
      • -
      +
    +
    -

    Enhancements

    -
    • Improved filter state presentation in FilterState$format.
    • -
    +

    Enhancements +

    +
      +
    • Improved filter state presentation in FilterState$format.
    • +
    +
    -

    Bug fixes

    -
    • Fixed an error where the RangeFilterState produced an error when using bootstrap 4.
    • +

      Bug fixes +

      +
        +
      • Fixed an error where the RangeFilterState produced an error when using bootstrap 4.
      • Fixed a bug that caused the range slider to omit values selected by the filter API.
      • Fixed a bug where setting incorrect values for Date and Date time ranges caused the app to crash.
      • -
    + +
    -

    Miscellaneous

    -
    • Calculation of step in slider for RangeFilterState now uses checkmate::test_integerish instead of is.integer.
    • +

      Miscellaneous +

      +
        +
      • Calculation of step in slider for RangeFilterState now uses checkmate::test_integerish instead of is.integer.
      • Updated init_filtered_data to take into account the removal of CDISCTealData from teal.data package.
      • Added shinyvalidate validation for Date and Date time ranges.
      • Added examples apps for FilterState child classes and DFFilterStates.
      • -
    + +
    -

    teal.slice 0.2.0

    +

    teal.slice 0.2.0 +

    -

    New features

    -
    + +
    -

    Enhancements

    -
    • Redesigned the count bars for filter panel check box inputs.
    • +

      Enhancements +

      +
        +
      • Redesigned the count bars for filter panel check box inputs.
      • Redesigned the filter panel input for dates to use CSS flexbox.
      • Update icons to be compatible with Font Awesome 6.
      • Updates the FilteredData method get_formatted_filter_state so it no longer appends empty filters.
      • Added clearer installation instructions to README.
      • -
    + +
    -

    Breaking changes

    -
    • Renamed internal S3 method get_filterable_varnames to get_supported_filter_varnames.
    • -
    +

    Breaking changes +

    +
      +
    • Renamed internal S3 method get_filterable_varnames to get_supported_filter_varnames.
    • +
    +
    -

    Bug fixes

    -
    • Fixed a bug when the filter panel overview would not refresh if the panel was hidden during a transition between active modules.
    • +

      Bug fixes +

      +
        +
      • Fixed a bug when the filter panel overview would not refresh if the panel was hidden during a transition between active modules.
      • Fixed a bug in FilterState where sliderInput step values were too precise.
      • -
    + +
    -

    teal.slice 0.1.1

    +

    teal.slice 0.1.1 +

    -

    New features

    -
    • Added a formatting function for filter panel classes.
    • -
    +

    New features +

    +
      +
    • Added a formatting function for filter panel classes.
    • +
    +
    -

    Miscellaneous

    -
    • Added a template to the pkgdown site.
    • +

      Miscellaneous +

      +
        +
      • Added a template to the pkgdown site.
      • Updated package authors.
      • Added package vignettes.
      • -
    + +
    -

    Fix

    -
    • Fixed a bug in FilteredDataset, where launching a shiny application without FilteredData would not attach the appropriate CSS files.
    • -
    +

    Fix +

    +
      +
    • Fixed a bug in FilteredDataset, where launching a shiny application without FilteredData would not attach the appropriate CSS files.
    • +
    +
    -

    teal.slice 0.1.0

    -
    • Initial release of teal.slice - a package providing a filter module for teal applications.
    • -
    -

    Changes (from behavior when functionality was part of teal)

    +

    teal.slice 0.1.0 +

    +
      +
    • Initial release of teal.slice - a package providing a filter module for teal applications.
    • +
    +
    +

    Changes (from behavior when functionality was part of teal) +

    -

    Breaking changes

    -
    • +

      Breaking changes +

      +
        +
      • default_filter has been deprecated - use list() instead for a default filter.
      • -
    + +
    -

    Bug fixes

    -
    • Add counts to filtering categorical variables bar charts in the filtering panel in cases where they were missing.
    • +

      Bug fixes +

      +
        +
      • Add counts to filtering categorical variables bar charts in the filtering panel in cases where they were missing.
      • Fixed a bug causing an error when both sliders of RangeFilterState where put to either end of the allowed range in the UI.
      • -
    + +
    -

    Miscellaneous

    -
    • Added is_any_filtered method to all FilterState classes to detect if selected values actually filters out any data. This is used to decide if an explicit filter statement is added to the call.
    • +

      Miscellaneous +

      +
        +
      • Added is_any_filtered method to all FilterState classes to detect if selected values actually filters out any data. This is used to decide if an explicit filter statement is added to the call.
      • The filter panel now displays a helpful message when data has no rows or columns in place of an empty drop down widget.
      • FilteredData now stores whether its datasets had a reproducibility check or not via two new methods to its class: set_check and get_check.
      • -
    + +
    + + - + + - + + diff --git a/main/reference/ChoicesFilterState.html b/main/reference/ChoicesFilterState.html index c2d3274ea..ccbc7a663 100644 --- a/main/reference/ChoicesFilterState.html +++ b/main/reference/ChoicesFilterState.html @@ -1,5 +1,21 @@ - -FilterState object for categorical data — ChoicesFilterState • teal.slice + + + + + + +FilterState object for categorical data — ChoicesFilterState • teal.slice + + + + + + + + + + + Skip to contents @@ -15,24 +31,49 @@ + + @@ -40,7 +81,8 @@
    @@ -51,40 +93,60 @@

    FilterState object for categorical data

    -

    Super class

    +

    Super class +

    teal.slice::FilterState -> ChoicesFilterState

    +

    Inherited methods


    -

    Method new()

    -

    Initialize a FilterState object.

    -

    Usage

    -

    ChoicesFilterState$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterState object.

    +
    +

    Usage +

    +

    +
    +
    ChoicesFilterState$new(
       x,
       x_reactive = reactive(NULL),
       slice,
       extract_type = character(0)
    -)

    +)
    +

    +
    -

    Returns

    +

    Returns +

    Object of class ChoicesFilterState, invisibly.

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection. For this class returned call looks like -<varname> %in% c(<values selected>) with optional is.na(<varname>).

    -

    Usage

    -

    ChoicesFilterState$get_call(dataname)

    +<varname> %in% c(<values selected>) with optional is.na(<varname>).

    +
    +

    Usage +

    +

    +
    +
    ChoicesFilterState$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of data set; defaults to private$get_dataname()

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    call or NULL

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    ChoicesFilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    ChoicesFilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -164,7 +266,8 @@

    Arguments -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     include_css_files <- getFromNamespace("include_css_files", "teal.slice")
     include_js_files <- getFromNamespace("include_js_files", "teal.slice")
    @@ -280,17 +383,19 @@ 

    Examples

    + +
    - + +
    - + + diff --git a/main/reference/DFFilterStates.html b/main/reference/DFFilterStates.html index cb85e77e7..aae0f31c5 100644 --- a/main/reference/DFFilterStates.html +++ b/main/reference/DFFilterStates.html @@ -1,5 +1,21 @@ - -FilterStates subclass for data frames — DFFilterStates • teal.slice + + + + + + +FilterStates subclass for data frames — DFFilterStates • teal.slice + + + + + + + + + + + Skip to contents @@ -15,24 +31,49 @@ + + @@ -40,7 +81,8 @@
    @@ -51,18 +93,25 @@

    FilterStates subclass for data frames

    -

    Super class

    +

    Super class +

    teal.slice::FilterStates -> DFFilterStates

    -

    Methods

    +

    Methods +

    -

    Public methods

    +

    Public methods +

    -

    Inherited methods +
    +

    Inherited methods


    -

    Method new()

    +

    +
    +
    +

    Method new() +

    Initializes DFFilterStates object by setting dataname and initializing state_list (shiny::reactiveVal). This class contains a single state_list with no specified name, which means that when calling the subset function associated with this class -(dplyr::filter), a list of conditions is passed to unnamed arguments (...).

    -

    Usage

    -

    DFFilterStates$new(
    +(dplyr::filter), a list of conditions is passed to unnamed arguments (...).

    +
    +

    Usage +

    +

    +
    +
    DFFilterStates$new(
       data,
       data_reactive = function(sid = "") NULL,
       dataname,
       datalabel = NULL,
       keys = character(0)
    -)

    +)
    +

    +
    -

    Arguments

    -

    data
    +

    Arguments +

    +

    +
    +
    +
    data

    (data.frame) the R object which dplyr::filter function will be applied on.

    @@ -122,23 +184,41 @@

    Arguments
    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    DFFilterStates$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    DFFilterStates$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -146,7 +226,8 @@

    Arguments -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     include_css_files <- getFromNamespace("include_css_files", "teal.slice")
     include_js_files <- getFromNamespace("include_js_files", "teal.slice")
    @@ -291,17 +372,19 @@ 

    Examples

    + +

    - + +
    - + + diff --git a/main/reference/DataframeFilteredDataset.html b/main/reference/DataframeFilteredDataset.html index 2cd6685a5..62eacc628 100644 --- a/main/reference/DataframeFilteredDataset.html +++ b/main/reference/DataframeFilteredDataset.html @@ -1,7 +1,23 @@ - -The DataframeFilteredDataset R6 class — DataframeFilteredDataset • teal.slice + + + + + + +The DataframeFilteredDataset R6 class — DataframeFilteredDataset • teal.slice + + + + + + + + + + + Skip to contents @@ -17,24 +33,49 @@ + +
    @@ -54,23 +95,30 @@

    The DataframeFilteredDataset R6 class

    -

    Super class

    +

    Super class +

    teal.slice::FilteredDataset -> DataframeFilteredDataset

    +

    Inherited methods


    -

    Method new()

    -

    Initializes this DataframeFilteredDataset object.

    -

    Usage

    -

    DataframeFilteredDataset$new(
    +

    +
    +
    +

    Method new() +

    +

    Initializes this DataframeFilteredDataset object.

    +
    +

    Usage +

    +

    +
    +
    DataframeFilteredDataset$new(
       dataset,
       dataname,
       keys = character(0),
    @@ -94,12 +149,18 @@ 

    Usage

    parent = NULL, join_keys = character(0), label = character(0) -)

    +)
    +

    +
    -

    Arguments

    -

    dataset
    +

    Arguments +

    +

    +
    +
    +
    dataset

    (data.frame) single data.frame for which filters are rendered.

    @@ -137,129 +198,227 @@

    Arguments -

    Returns

    +

    Returns +

    Object of class DataframeFilteredDataset, invisibly.

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Gets the subset expression.

    This function returns subset expressions equivalent to selected items within each of filter_states. Configuration of the expressions is constant and depends on filter_states type and order which are set during initialization. This class contains single FilterStates which contains single state_list -and all FilterState objects apply to one argument (...) in a dplyr::filter call.

    -

    Usage

    -

    DataframeFilteredDataset$get_call(sid = "")

    +and all FilterState objects apply to one argument (...) in a dplyr::filter call.

    +
    +

    Usage +

    +

    +
    +
    DataframeFilteredDataset$get_call(sid = "")
    +

    +
    -

    Arguments

    -

    sid
    +

    Arguments +

    +

    +
    +
    +
    sid

    (character) when specified, the method returns code containing conditions calls of FilterState objects with sid different to that of this sid argument.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Either a list of length 1 containing a filter call, or NULL.

    -


    -

    Method set_filter_state()

    -

    Set filter state.

    -

    Usage

    -

    DataframeFilteredDataset$set_filter_state(state)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Set filter state.

    +
    +

    Usage +

    +

    +
    +
    DataframeFilteredDataset$set_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method remove_filter_state()

    -

    Remove one or more FilterState form a FilteredDataset.

    -

    Usage

    -

    DataframeFilteredDataset$remove_filter_state(state)

    +
    +

    +
    +
    +

    Method remove_filter_state() +

    +

    Remove one or more FilterState form a FilteredDataset.

    +
    +

    Usage +

    +

    +
    +
    DataframeFilteredDataset$remove_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices) specifying FilterState objects to remove; teal_slices may contain only dataname and varname, other elements are ignored

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method ui_add()

    -

    UI module to add filter variable for this dataset.

    -

    Usage

    -

    DataframeFilteredDataset$ui_add(id)

    +
    +

    +
    +
    +

    Method ui_add() +

    +

    UI module to add filter variable for this dataset.

    +
    +

    Usage +

    +

    +
    +
    DataframeFilteredDataset$ui_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method get_filter_overview()

    -

    Creates row for filter overview in the form of
    dataname -- observations (remaining/total) - data.frame

    -

    Usage

    -

    DataframeFilteredDataset$get_filter_overview()

    +
    +

    +
    +
    +

    Method get_filter_overview() +

    +

    Creates row for filter overview in the form of
    dataname -- observations (remaining/total) - data.frame

    +
    +

    Usage +

    +

    +
    +
    DataframeFilteredDataset$get_filter_overview()
    +

    +
    -

    Returns

    +

    Returns +

    A data.frame.

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    DataframeFilteredDataset$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    DataframeFilteredDataset$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -267,7 +426,8 @@

    Arguments -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     DataframeFilteredDataset <- getFromNamespace("DataframeFilteredDataset", "teal.slice")
     
    @@ -361,17 +521,19 @@ 

    Examples

    + +
    - + +
    - + + diff --git a/main/reference/DateFilterState.html b/main/reference/DateFilterState.html index ea52135c5..f9ff4e2bc 100644 --- a/main/reference/DateFilterState.html +++ b/main/reference/DateFilterState.html @@ -1,5 +1,21 @@ - -FilterState object for Date data — DateFilterState • teal.slice + + + + + + +FilterState object for Date data — DateFilterState • teal.slice + + + + + + + + + + + Skip to contents @@ -15,24 +31,49 @@ + +
    @@ -40,7 +81,8 @@
    @@ -51,40 +93,60 @@

    FilterState object for Date data

    -

    Super class

    +

    Super class +

    teal.slice::FilterState -> DateFilterState

    -

    Methods

    +

    Methods +

    Inherited methods +
    +

    Inherited methods


    -

    Method new()

    -

    Initialize a FilterState object.

    -

    Usage

    -

    DateFilterState$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterState object.

    +
    +

    Usage +

    +

    +
    +
    DateFilterState$new(
       x,
       x_reactive = reactive(NULL),
       slice,
       extract_type = character(0)
    -)

    +)
    +

    +
    -

    Returns

    +

    Returns +

    Object of class DateFilterState, invisibly.

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection. For this class returned call looks like -<varname> >= <min value> & <varname> <= <max value> with optional is.na(<varname>).

    -

    Usage

    -

    DateFilterState$get_call(dataname)

    +<varname> >= <min value> & <varname> <= <max value> with optional is.na(<varname>).

    +
    +

    Usage +

    +

    +
    +
    DateFilterState$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) containing possibly prefixed name of data set

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    call or NULL

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    DateFilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    DateFilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -164,7 +266,8 @@

    Arguments -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     include_css_files <- getFromNamespace("include_css_files", "teal.slice")
     include_js_files <- getFromNamespace("include_js_files", "teal.slice")
    @@ -266,17 +369,19 @@ 

    Examples

    + +
    - + +
    - + + diff --git a/main/reference/DatetimeFilterState.html b/main/reference/DatetimeFilterState.html index f5b18240f..742ea6152 100644 --- a/main/reference/DatetimeFilterState.html +++ b/main/reference/DatetimeFilterState.html @@ -1,5 +1,21 @@ - -FilterState object for date time data — DatetimeFilterState • teal.slice + + + + + + +FilterState object for date time data — DatetimeFilterState • teal.slice + + + + + + + + + + + Skip to contents @@ -15,24 +31,49 @@ + +
    @@ -40,7 +81,8 @@
    @@ -51,44 +93,64 @@

    FilterState object for date time data

    -

    Super class

    +

    Super class +

    teal.slice::FilterState -> DatetimeFilterState

    +

    Inherited methods


    -

    Method new()

    +

    +
    +
    +

    Method new() +

    Initialize a FilterState object. This class has an extra field, private$timezone, which is set to Sys.timezone() by default. However, in case when using this module in teal app, one needs timezone of the app user. App user timezone is taken from session$userData$timezone -and is set only if object is initialized in shiny.

    -

    Usage

    -

    DatetimeFilterState$new(
    +and is set only if object is initialized in shiny.

    +
    +

    Usage +

    +

    +
    +
    DatetimeFilterState$new(
       x,
       x_reactive = reactive(NULL),
       extract_type = character(0),
       slice
    -)

    +)
    +

    +
    -

    Arguments

    -

    x
    +

    Arguments +

    +

    +
    +
    +
    x

    (POSIXct or POSIXlt) variable to be filtered.

    @@ -102,11 +164,15 @@

    Arguments varname in the condition call will be returned as <dataname>$<varname>

  • "matrix" varname in the condition call will be returned as <dataname>[, <varname>]

  • - + +
    slice
    @@ -118,49 +184,85 @@

    Arguments -

    Returns

    +

    Returns +

    Object of class DatetimeFilterState, invisibly.

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection. For this class returned call looks like -<varname> >= as.POSIXct(<min>) & <varname> <= <max>) with optional is.na(<varname>).

    -

    Usage

    -

    DatetimeFilterState$get_call(dataname)

    +<varname> >= as.POSIXct(<min>) & <varname> <= <max>) with optional is.na(<varname>).

    +
    +

    Usage +

    +

    +
    +
    DatetimeFilterState$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    name of data set; defaults to private$get_dataname()

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    call

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    DatetimeFilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    DatetimeFilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -168,7 +270,8 @@

    Arguments -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     include_css_files <- getFromNamespace("include_css_files", "teal.slice")
     include_js_files <- getFromNamespace("include_js_files", "teal.slice")
    @@ -278,17 +381,19 @@ 

    Examples

    + +
    - + +
    - + + diff --git a/main/reference/DefaultFilteredDataset.html b/main/reference/DefaultFilteredDataset.html index 09eae64b7..731c3f87c 100644 --- a/main/reference/DefaultFilteredDataset.html +++ b/main/reference/DefaultFilteredDataset.html @@ -1,5 +1,21 @@ - -DefaultFilteredDataset R6 class — DefaultFilteredDataset • teal.slice + + + + + + +DefaultFilteredDataset R6 class — DefaultFilteredDataset • teal.slice + + + + + + + + + + + Skip to contents @@ -15,24 +31,49 @@ + +
    @@ -40,7 +81,8 @@
    @@ -51,16 +93,20 @@

    DefaultFilteredDataset R6 class

    -

    Super class

    +

    Super class +

    teal.slice::FilteredDataset -> DefaultFilteredDataset

    +

    Inherited methods


    -

    Method new()

    -

    Initializes this DefaultFilteredDataset object.

    -

    Usage

    -

    DefaultFilteredDataset$new(dataset, dataname, label = character(0))

    +

    +
    +
    +

    Method new() +

    +

    Initializes this DefaultFilteredDataset object.

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$new(dataset, dataname, label = character(0))
    +

    +
    -

    Arguments

    -

    dataset
    +

    Arguments +

    +

    +
    +
    +
    dataset

    any type of object; will not be filtered.

    @@ -101,23 +163,40 @@

    Arguments -

    Returns

    +

    Returns +

    Object of class DefaultFilteredDataset, invisibly.

    -


    -

    Method format()

    -

    Returns a formatted string representing this DefaultFilteredDataset object.

    -

    Usage

    -

    DefaultFilteredDataset$format(show_all, trim_lines = FALSE)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns a formatted string representing this DefaultFilteredDataset object.

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$format(show_all, trim_lines = FALSE)
    +

    +
    -

    Arguments

    -

    show_all
    +

    Arguments +

    +

    +
    +
    +
    show_all

    (logical(1)) for method consistency, ignored.

    @@ -125,111 +204,197 @@

    Arguments -

    Returns

    +

    Returns +

    The formatted string.

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    -

    Usage

    -

    DefaultFilteredDataset$get_call(sid)

    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$get_call(sid)
    +

    +
    -

    Arguments

    -

    sid
    +

    Arguments +

    +

    +
    +
    +
    sid

    (character(1)) for method consistency, ignored.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    +

    +
    +
    +

    Method get_filter_state() +

    -

    Usage

    -

    DefaultFilteredDataset$get_filter_state()

    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$get_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    +

    +
    +
    +

    Method set_filter_state() +

    -

    Usage

    -

    DefaultFilteredDataset$set_filter_state(state)

    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$set_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices) for method consistency, ignored.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    +

    +
    +
    +

    Method clear_filter_states() +

    -

    Usage

    -

    DefaultFilteredDataset$clear_filter_states(force)

    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$clear_filter_states(force)
    +

    +
    -

    Arguments

    -

    force
    +

    Arguments +

    +

    +
    +
    +
    force

    (logical(1)) for method consistency, ignored.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method get_filter_overview()

    -

    Creates row for filter overview in the form of
    dataname - unsupported data class

    -

    Usage

    -

    DefaultFilteredDataset$get_filter_overview()

    +
    +

    +
    +
    +

    Method get_filter_overview() +

    +

    Creates row for filter overview in the form of
    dataname - unsupported data class

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$get_filter_overview()
    +

    +
    -

    Returns

    +

    Returns +

    A data.frame.

    -


    -

    Method ui_active()

    -

    Overwrites parent method.

    -

    Usage

    -

    DefaultFilteredDataset$ui_active(id, allow_add)

    +
    +

    +
    +
    +

    Method ui_active() +

    +

    Overwrites parent method.

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$ui_active(id, allow_add)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    @@ -238,58 +403,96 @@

    Arguments -

    Details

    +

    Details +

    Blank UI module that would list active filter states for this dataset.

    -

    Returns

    +

    Returns +

    An empty div.

    -


    -

    Method ui_add()

    -

    Overwrites parent method.

    -

    Usage

    -

    DefaultFilteredDataset$ui_add(id)

    +
    +

    +
    +
    +

    Method ui_add() +

    +

    Overwrites parent method.

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$ui_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Details

    +

    Details +

    Blank UI module that would list active filter states for this dataset.

    -

    Returns

    +

    Returns +

    An empty div.

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    DefaultFilteredDataset$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -297,7 +500,8 @@

    Arguments -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     DefaultFilteredDataset <- getFromNamespace("DefaultFilteredDataset", "teal.slice")
     
    @@ -310,17 +514,19 @@ 

    Examples

    + +
    - + +
    - + + diff --git a/main/reference/EmptyFilterState.html b/main/reference/EmptyFilterState.html index 665a00604..67e1afc16 100644 --- a/main/reference/EmptyFilterState.html +++ b/main/reference/EmptyFilterState.html @@ -1,5 +1,21 @@ - -FilterState object for empty variables — EmptyFilterState • teal.slice + + + + + + +FilterState object for empty variables — EmptyFilterState • teal.slice + + + + + + + + + + + Skip to contents @@ -15,24 +31,49 @@ + +
    @@ -40,7 +81,8 @@
    @@ -51,40 +93,60 @@

    FilterState object for empty variables

    -

    Super class

    +

    Super class +

    teal.slice::FilterState -> EmptyFilterState

    -

    Methods

    +

    Methods +

    Inherited methods +
    +

    Inherited methods


    -

    Method new()

    -

    Initialize EmptyFilterState object.

    -

    Usage

    -

    EmptyFilterState$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize EmptyFilterState object.

    +
    +

    Usage +

    +

    +
    +
    EmptyFilterState$new(
       x,
       x_reactive = reactive(NULL),
       extract_type = character(0),
       slice
    -)

    +)
    +

    +
    -

    Arguments

    -

    x
    +

    Arguments +

    +

    + -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection relevant for selected variable type. -Uses internal reactive values, hence must be called in reactive or isolated context.

    -

    Usage

    -

    EmptyFilterState$get_call(dataname)

    +Uses internal reactive values, hence must be called in reactive or isolated context.

    +
    +

    Usage +

    +

    +
    +
    EmptyFilterState$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    name of data set; defaults to private$get_dataname()

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    logical(1)

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    EmptyFilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    EmptyFilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -163,7 +265,8 @@

    Arguments -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     include_js_files <- getFromNamespace("include_js_files", "teal.slice")
     EmptyFilterState <- getFromNamespace("EmptyFilterState", "teal.slice")
    @@ -184,17 +287,19 @@ 

    Examples

    + +
    - + +
    - + + diff --git a/main/reference/FilterPanelAPI.html b/main/reference/FilterPanelAPI.html index 7f45ea164..8e143a9ac 100644 --- a/main/reference/FilterPanelAPI.html +++ b/main/reference/FilterPanelAPI.html @@ -1,5 +1,21 @@ - -Class to encapsulate the API of the filter panel of a teal app — FilterPanelAPI • teal.slice + + + + + + +Class to encapsulate the API of the filter panel of a teal app — FilterPanelAPI • teal.slice + + + + + + + + + + + Skip to contents @@ -15,24 +31,49 @@ + +
    @@ -51,7 +92,8 @@

    Class to encapsulate the API of the filter panel of a teal app

    -

    Details

    +

    Details +

    The purpose of this class is to encapsulate the API of the filter panel in a new class FilterPanelAPI so that it can be passed and used in the server call of any module instead of passing the whole FilteredData object.

    @@ -59,125 +101,223 @@

    Details

    -

    Methods

    +

    Methods +


    -

    Method new()

    -

    Initialize a FilterPanelAPI object.

    -

    Usage

    -

    FilterPanelAPI$new(datasets)

    + +
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterPanelAPI object.

    +
    +

    Usage +

    +

    +
    +
    FilterPanelAPI$new(datasets)
    +

    +
    -

    Arguments

    -

    datasets
    +

    Arguments +

    +

    +
    +
    +
    datasets

    (FilteredData)

    -

    +
    +

    +
    -


    +

    +
    +
    +

    Method get_filter_state() +

    Gets the reactive values from the active FilterState objects of the FilteredData object.

    Gets all active filters in the form of a nested list. -The output list is a compatible input to set_filter_state.

    -

    Usage

    -

    FilterPanelAPI$get_filter_state()

    +The output list is a compatible input to set_filter_state.

    +
    +

    Usage +

    +

    +
    +
    FilterPanelAPI$get_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    list with named elements corresponding to FilteredDataset objects with active filters.

    -


    -

    Method set_filter_state()

    -

    Sets active filter states.

    -

    Usage

    -

    FilterPanelAPI$set_filter_state(filter)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Sets active filter states.

    +
    +

    Usage +

    +

    +
    +
    FilterPanelAPI$set_filter_state(filter)
    +

    +
    -

    Arguments

    -

    filter
    +

    Arguments +

    +

    +
    +
    +
    filter

    (teal_slices)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method remove_filter_state()

    -

    Remove one or more FilterState of a FilteredDataset in the FilteredData object.

    -

    Usage

    -

    FilterPanelAPI$remove_filter_state(filter)

    +
    +

    +
    +
    +

    Method remove_filter_state() +

    +

    Remove one or more FilterState of a FilteredDataset in the FilteredData object.

    +
    +

    Usage +

    +

    +
    +
    FilterPanelAPI$remove_filter_state(filter)
    +

    +
    -

    Arguments

    -

    filter
    +

    Arguments +

    +

    +
    +
    +
    filter

    (teal_slices) specifying FilterState objects to remove; teal_slices may contain only dataname and varname, other elements are ignored

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method clear_filter_states()

    -

    Remove all FilterStates of the FilteredData object.

    -

    Usage

    -

    FilterPanelAPI$clear_filter_states(datanames)

    +
    +

    +
    +
    +

    Method clear_filter_states() +

    +

    Remove all FilterStates of the FilteredData object.

    +
    +

    Usage +

    +

    +
    +
    FilterPanelAPI$clear_filter_states(datanames)
    +

    +
    -

    Arguments

    -

    datanames
    +

    Arguments +

    +

    +
    +
    +
    datanames

    (character) datanames to remove their FilterStates; omit to remove all FilterStates in the FilteredData object

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    FilterPanelAPI$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    FilterPanelAPI$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -185,7 +325,8 @@

    Arguments -

    Examples

    +

    Examples +

    library(shiny)
     
     fd <- init_filtered_data(list(iris = iris))
    @@ -256,17 +397,19 @@ 

    Examples

    + +
    - + +
    - + + diff --git a/main/reference/FilterState.html b/main/reference/FilterState.html index c566346a9..07959ef3a 100644 --- a/main/reference/FilterState.html +++ b/main/reference/FilterState.html @@ -1,5 +1,21 @@ - -FilterState abstract class — FilterState • teal.slice + + + + + + +FilterState abstract class — FilterState • teal.slice + + + + + + + + + + + Skip to contents @@ -15,24 +31,49 @@ + +
    @@ -40,7 +81,8 @@
    @@ -51,12 +93,15 @@

    FilterState abstract class

    -

    Details

    +

    Details +

    This class is responsible for managing a single filter item within a FilteredData object and outputs a condition call (logical predicate) for subsetting one variable. Filter states depend on the variable type: (logical, integer, numeric, character, factor, Date, POSIXct, POSIXlt) -and FilterState subclasses exist that correspond to those types.

    +

    Each variable's filter state is an R6 object keeps the variable that is filtered, a teal_slice object that describes the filter state, as well as a shiny module (UI and server) that allows the user to alter the filter state. Changes to the filter state that cause some observations to be omitted trigger the get_call method and every R function call up in the reactive chain.

    -

    Modifying state

    +

    Modifying state +

    -

    Modifying a FilterState object is possible in three scenarios:

    • In an interactive session, by passing an appropriate teal_slice to the set_state method.

    • +

      Modifying a FilterState object is possible in three scenarios:

      +
        +
      • In an interactive session, by passing an appropriate teal_slice to the set_state method.

      • In a running application, by changing appropriate inputs.

      • In a running application, by using filter_state_api which directly uses set_state method of the FilterState object.

      • -
    + +
    -

    Methods

    +

    Methods +


    -

    Method new()

    -

    Initialize a FilterState object.

    -

    Usage

    -

    FilterState$new(
    +
    +
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterState object.

    +
    +

    Usage +

    +

    +
    +
    FilterState$new(
       x,
       x_reactive = reactive(NULL),
       slice,
       extract_type = character(0)
    -)

    +)
    +

    +
    -

    Returns

    +

    Returns +

    Object of class FilterState, invisibly.

    -


    -

    Method format()

    -

    Returns a formatted string representing this FilterState object.

    -

    Usage

    -

    FilterState$format(show_all = FALSE, trim_lines = TRUE)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns a formatted string representing this FilterState object.

    +
    +

    Usage +

    +

    +
    +
    FilterState$format(show_all = FALSE, trim_lines = TRUE)
    +

    +
    -

    Arguments

    -

    show_all
    +

    Arguments +

    +

    +
    +
    +
    show_all

    (logical(1)) passed to format.teal_slice

    @@ -164,84 +253,157 @@

    Arguments -

    Returns

    +

    Returns +

    character(1) the formatted string

    -


    -

    Method print()

    -

    Prints this FilterState object.

    -

    Usage

    -

    FilterState$print(...)

    +
    +

    +
    +
    +

    Method print() +

    +

    Prints this FilterState object.

    +
    +

    Usage +

    +

    +
    +
    FilterState$print(...)
    +

    +
    -

    Arguments

    -

    ...
    +

    Arguments +

    +

    +
    +
    +
    ...

    additional arguments

    -

    +
    +

    +
    -


    -

    Method set_state()

    -

    Sets mutable parameters of the filter state.

    • fixed state is prevented from changing state

    • +
    +

    +
    +
    +

    Method set_state() +

    +

    Sets mutable parameters of the filter state.

    +
      +
    • fixed state is prevented from changing state

    • anchored state is prevented from removing state

    • -
    -

    Usage

    -

    FilterState$set_state(state)

    + +
    +

    Usage +

    +

    +
    +
    FilterState$set_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slice)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    self invisibly

    -


    -

    Method get_state()

    -

    Returns a complete description of the filter state.

    -

    Usage

    -

    FilterState$get_state()

    +
    +

    +
    +
    +

    Method get_state() +

    +

    Returns a complete description of the filter state.

    +
    +

    Usage +

    +

    +
    +
    FilterState$get_state()
    +

    +
    -

    Returns

    +

    Returns +

    A teal_slice object.

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection relevant for selected variable type. Method is using internal reactive values which makes it reactive -and must be executed in reactive or isolated context.

    -

    Usage

    -

    FilterState$get_call()

    +and must be executed in reactive or isolated context.

    +
    +

    Usage +

    +

    +
    +
    FilterState$get_call()
    +

    +
    -


    -

    Method server()

    -

    shiny module server.

    -

    Usage

    -

    FilterState$server(id, remove_callback)

    +
    +

    +
    +
    +

    Method server() +

    +

    shiny module server.

    +
    +

    Usage +

    +

    +
    +
    FilterState$server(id, remove_callback)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    @@ -251,24 +413,41 @@

    Arguments -

    Returns

    +

    Returns +

    Reactive expression signaling that remove button has been clicked.

    -


    -

    Method ui()

    +
    +

    +
    +
    +

    Method ui() +

    shiny UI module. -The UI for this class contains simple message stating that it is not supported.

    -

    Usage

    -

    FilterState$ui(id, parent_id = "cards")

    +The UI for this class contains simple message stating that it is not supported.

    +
    +

    Usage +

    +

    +
    +
    FilterState$ui(id, parent_id = "cards")
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    @@ -277,35 +456,64 @@

    Arguments
    -

    Method finalize()

    -

    Destroy inputs and observers stored in private$session_bindings.

    -

    Usage

    -

    FilterState$finalize()

    +
    +

    +
    +
    +

    Method finalize() +

    +

    Destroy inputs and observers stored in private$session_bindings.

    +
    +

    Usage +

    +

    +
    +
    FilterState$finalize()
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    FilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    FilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -313,17 +521,19 @@

    Arguments

    + +

    - + +
    - + + diff --git a/main/reference/FilterStateExpr.html b/main/reference/FilterStateExpr.html index 1a8659803..dec29fe83 100644 --- a/main/reference/FilterStateExpr.html +++ b/main/reference/FilterStateExpr.html @@ -1,5 +1,21 @@ - -FilterStateExpr R6 class — FilterStateExpr • teal.slice + + + + + + +FilterStateExpr R6 class — FilterStateExpr • teal.slice + + + + + + + + + + + Skip to contents @@ -15,24 +31,49 @@ + +
    @@ -40,7 +81,8 @@
    @@ -51,18 +93,22 @@

    FilterStateExpr R6 class

    -

    Details

    +

    Details +

    Creates a filter state around a predefined condition call (logical predicate). The condition call is independent of the data and the filter card allows no interaction (the filter is always fixed).

    -

    Methods

    +

    Methods +


    -

    Method new()

    -

    Initialize a FilterStateExpr object.

    -

    Usage

    -

    FilterStateExpr$new(slice)

    + +
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterStateExpr object.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$new(slice)
    +

    +
    -

    Arguments

    -

    slice
    +

    Arguments +

    +

    +
    +
    +
    slice

    (teal_slice_expr)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Object of class FilterStateExpr, invisibly.

    -


    -

    Method format()

    -

    Returns a formatted string representing this FilterStateExpr object.

    -

    Usage

    -

    FilterStateExpr$format(show_all = FALSE, trim_lines = TRUE)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns a formatted string representing this FilterStateExpr object.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$format(show_all = FALSE, trim_lines = TRUE)
    +

    +
    -

    Arguments

    -

    show_all
    +

    Arguments +

    +

    +
    +
    +
    show_all

    (logical(1)) passed to format.teal_slice

    @@ -109,111 +187,203 @@

    Arguments -

    Returns

    +

    Returns +

    character(1) the formatted string

    -


    -

    Method print()

    -

    Prints this FilterStateExpr object.

    -

    Usage

    -

    FilterStateExpr$print(...)

    +
    +

    +
    +
    +

    Method print() +

    +

    Prints this FilterStateExpr object.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$print(...)
    +

    +
    -

    Arguments

    -

    ...
    +

    Arguments +

    +

    +
    +
    +
    ...

    arguments passed to the format method

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method get_state()

    -

    Returns a complete description of this filter state.

    -

    Usage

    -

    FilterStateExpr$get_state()

    +
    +

    +
    +
    +

    Method get_state() +

    +

    Returns a complete description of this filter state.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$get_state()
    +

    +
    -

    Returns

    +

    Returns +

    A teal_slice object.

    -


    -

    Method set_state()

    -

    Does nothing. Exists for compatibility.

    -

    Usage

    -

    FilterStateExpr$set_state(state)

    +
    +

    +
    +
    +

    Method set_state() +

    +

    Does nothing. Exists for compatibility.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$set_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slice)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    self, invisibly.

    -


    -

    Method get_call()

    -

    Get reproducible call.

    -

    Usage

    -

    FilterStateExpr$get_call(dataname)

    +
    +

    +
    +
    +

    Method get_call() +

    +

    Get reproducible call.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    -

    (ignored) for a consistency with FilterState

    +

    Arguments +

    +

    +
    +
    +
    dataname
    +
    +

    (ignored) for a consistency with FilterState

    Returns reproducible condition call for current selection relevant for selected variable type. Method is using internal reactive values which makes it reactive -and must be executed in reactive or isolated context.

    +and must be executed in reactive or isolated context.

    +
    -

    + +

    +
    -

    Returns

    +

    Returns +

    call or NULL

    -


    -

    Method finalize()

    -

    Destroy inputs and observers stored in private$session_bindings.

    -

    Usage

    -

    FilterStateExpr$finalize()

    +
    +

    +
    +
    +

    Method finalize() +

    +

    Destroy inputs and observers stored in private$session_bindings.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$finalize()
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method server()

    -

    shiny module server.

    -

    Usage

    -

    FilterStateExpr$server(id, remove_callback)

    +
    +

    +
    +
    +

    Method server() +

    +

    shiny module server.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$server(id, remove_callback)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    @@ -223,24 +393,41 @@

    Arguments -

    Returns

    +

    Returns +

    Reactive expression signaling that the remove button has been clicked.

    -


    -

    Method ui()

    +
    +

    +
    +
    +

    Method ui() +

    shiny module UI. -The UI for this class contains simple message stating that it is not supported.

    -

    Usage

    -

    FilterStateExpr$ui(id, parent_id = "cards")

    +The UI for this class contains simple message stating that it is not supported.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$ui(id, parent_id = "cards")
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    @@ -250,23 +437,41 @@

    Arguments
    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    FilterStateExpr$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -274,7 +479,8 @@

    Arguments -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     include_js_files <- getFromNamespace("include_js_files", "teal.slice")
     include_css_files <- getFromNamespace("include_css_files", "teal.slice")
    @@ -327,17 +533,19 @@ 

    Examples

    + +

    - + +
    - + + diff --git a/main/reference/FilterStates.html b/main/reference/FilterStates.html index cf16e5bf0..9560a000c 100644 --- a/main/reference/FilterStates.html +++ b/main/reference/FilterStates.html @@ -1,5 +1,16 @@ - -FilterStates R6 class — FilterStates • teal.slice + + + + + +FilterStates R6 class — FilterStates • teal.slice + + + + + + + +SummarizedExperiment, and MultiAssayExperiment."> + + + + Skip to contents @@ -35,24 +51,49 @@ + +
    @@ -60,7 +101,8 @@
    @@ -81,12 +123,15 @@

    FilterStates R6 class

    -

    Methods

    +

    Methods +


    -

    Method new()

    + +
    +

    +
    +
    +

    Method new() +

    Initializes FilterStates object by setting -dataname, and datalabel.

    -

    Usage

    -

    FilterStates$new(
    +dataname, and datalabel.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$new(
       data,
       data_reactive = function(sid = "") NULL,
       dataname,
       datalabel = NULL
    -)

    +)
    +

    +
    -

    Arguments

    -

    data
    +

    Arguments +

    +

    +
    +
    +
    data

    (data.frame or MultiAssayExperiment or SummarizedExperiment or matrix) the R object which subset function is applied on.

    @@ -139,23 +199,40 @@

    Arguments -

    Returns

    +

    Returns +

    Object of class FilterStates, invisibly.

    -


    -

    Method format()

    -

    Returns a formatted string representing this FilterStates object.

    -

    Usage

    -

    FilterStates$format(show_all = FALSE, trim_lines = TRUE)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns a formatted string representing this FilterStates object.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$format(show_all = FALSE, trim_lines = TRUE)
    +

    +
    -

    Arguments

    -

    show_all
    +

    Arguments +

    +

    +
    +
    +
    show_all

    (logical(1)) passed to format.teal_slices

    @@ -163,28 +240,40 @@

    Arguments -

    Returns

    +

    Returns +

    character(1) the formatted string

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Filter call

    Builds subset expression from condition calls generated by FilterState. The lhs of the expression is a dataname_prefixed, where word prefixed refers to situation when call is evaluated on elements of the original data, for example dataname[[x]]. By default dataname_prefixed = dataname and it's not alterable through class methods. Customization of private$dataname_prefixed is done through inheriting classes.

    -

    The rhs is a call to private$fun with following arguments:

    • dataname_prefixed

    • +

      The rhs is a call to private$fun with following arguments:

      +
        +
      • dataname_prefixed

      • list of logical expressions generated by FilterState objects stored in private$state_list. Each logical predicate is combined with & operator. Variables in these logical expressions by default are not prefixed but this can be changed by setting private$extract_type (change in the similar way as dataname_prefixed) Possible call outputs depending on a custom fields/options:

      • -

      # default
      +
    +

    +
    +
    # default
     dataname <- subset(dataname, col == "x")
     
     # fun = dplyr::filter
    @@ -197,236 +286,426 @@ 

    Method get_call()dataname <- subset(dataname, subset = row_col == "x", select = col_col == "x") # dataname = dataname[[element]] -dataname[[element]] <- subset(dataname[[element]], subset = col == "x")

    -

    If no filters are applied, NULL is returned to avoid no-op calls such as dataname <- dataname.

    -

    Usage

    -

    FilterStates$get_call(sid = "")

    +dataname[[element]] <- subset(dataname[[element]], subset = col == "x")
    +

    +
    +

    If no filters are applied, NULL is returned to avoid no-op calls such as dataname <- dataname.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$get_call(sid = "")
    +

    +
    -

    Arguments

    -

    sid
    +

    Arguments +

    +

    +
    +
    +
    sid

    (character) when specified then method returns code containing condition calls (logical predicates) of FilterState objects which "sid" attribute is different than this sid argument.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    call or NULL

    -


    -

    Method print()

    -

    Prints this FilterStates object.

    -

    Usage

    -

    FilterStates$print(...)

    +
    +

    +
    +
    +

    Method print() +

    +

    Prints this FilterStates object.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$print(...)
    +

    +
    -

    Arguments

    -

    ...
    +

    Arguments +

    +

    +
    +
    +
    ...

    additional arguments passed to format.

    -

    +
    +

    +
    -


    -

    Method remove_filter_state()

    -

    Remove one or more FilterStates from the state_list along with their UI elements.

    -

    Usage

    -

    FilterStates$remove_filter_state(state)

    +
    +

    +
    +
    +

    Method remove_filter_state() +

    +

    Remove one or more FilterStates from the state_list along with their UI elements.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$remove_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices) specifying FilterState objects to remove; teal_slices may contain only dataname and varname, other elements are ignored

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    +

    +
    +
    +

    Method get_filter_state() +

    Gets reactive values from active FilterState objects.

    Get active filter state from FilterState objects stored in state_list(s). -The output is a list compatible with input to self$set_filter_state.

    -

    Usage

    -

    FilterStates$get_filter_state()

    +The output is a list compatible with input to self$set_filter_state.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$get_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    Object of class teal_slices.

    -


    -

    Method set_filter_state()

    -

    Sets active FilterState objects.

    -

    Usage

    -

    FilterStates$set_filter_state(state)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Sets active FilterState objects.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$set_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Function that raises an error.

    -


    -

    Method clear_filter_states()

    -

    Remove all FilterState objects from this FilterStates object.

    -

    Usage

    -

    FilterStates$clear_filter_states(force = FALSE)

    +
    +

    +
    +
    +

    Method clear_filter_states() +

    +

    Remove all FilterState objects from this FilterStates object.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$clear_filter_states(force = FALSE)
    +

    +
    -

    Arguments

    -

    force
    +

    Arguments +

    +

    +
    +
    +
    force

    (logical(1)) flag specifying whether to include anchored filter states.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method ui_active()

    +
    +

    +
    +
    +

    Method ui_active() +

    shiny UI definition that stores FilterState UI elements. -Populated with elements created with renderUI in the module server.

    -

    Usage

    -

    FilterStates$ui_active(id)

    +Populated with elements created with renderUI in the module server.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$ui_active(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_active()

    -

    shiny server module.

    -

    Usage

    -

    FilterStates$srv_active(id)

    +
    +

    +
    +
    +

    Method srv_active() +

    +

    shiny server module.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$srv_active(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL.

    -


    -

    Method ui_add()

    -

    shiny UI module to add filter variable.

    -

    Usage

    -

    FilterStates$ui_add(id)

    +
    +

    +
    +
    +

    Method ui_add() +

    +

    shiny UI module to add filter variable.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$ui_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_add()

    +
    +

    +
    +
    +

    Method srv_add() +

    shiny server module to add filter variable.

    This module controls available choices to select as a filter variable. Once selected, a variable is removed from available choices. -Removing a filter variable adds it back to available choices.

    -

    Usage

    -

    FilterStates$srv_add(id)

    +Removing a filter variable adds it back to available choices.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$srv_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL.

    -


    -

    Method finalize()

    -

    Object cleanup.

    • Destroy inputs and observers stored in private$session_bindings

    • +
    +

    +
    +
    +

    Method finalize() +

    +

    Object cleanup.

    +
      +
    • Destroy inputs and observers stored in private$session_bindings

    • Clean state_list

    • -
    -

    Usage

    -

    FilterStates$finalize()

    + +
    +

    Usage +

    +

    +
    +
    FilterStates$finalize()
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    FilterStates$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -434,17 +713,19 @@

    Arguments

    + +
    - + +
    - + + diff --git a/main/reference/FilteredData.html b/main/reference/FilteredData.html index 6774d982e..fa0ad6009 100644 --- a/main/reference/FilteredData.html +++ b/main/reference/FilteredData.html @@ -1,5 +1,21 @@ - -Class to encapsulate filtered datasets — FilteredData • teal.slice + + + + + + +Class to encapsulate filtered datasets — FilteredData • teal.slice + + + + + + + + + + + Skip to contents @@ -15,24 +31,49 @@ + +
    @@ -51,7 +92,8 @@

    Class to encapsulate filtered datasets

    + +
    -

    Methods

    +

    Methods +


    -

    Method new()

    -

    Initialize a FilteredData object.

    -

    Usage

    -

    FilteredData$new(data_objects, join_keys = teal.data::join_keys())

    + +
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilteredData object.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$new(data_objects, join_keys = teal.data::join_keys())
    +

    +
    -

    Arguments

    -

    data_objects
    +

    Arguments +

    +

    +
    +
    +
    data_objects

    (named list) List of data objects. Names of the list will be used as dataname for respective datasets.

    @@ -123,65 +189,113 @@

    Argumentsteal.data::join_keys().

    -

    +
    +

    +
    -


    -

    Method datanames()

    -

    Gets datanames.

    -

    Usage

    -

    FilteredData$datanames()

    +
    +

    +
    +
    +

    Method datanames() +

    +

    Gets datanames.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$datanames()
    +

    +
    -

    Details

    +

    Details +

    The datanames are returned in the order in which they must be evaluated (in case of dependencies).

    -

    Returns

    +

    Returns +

    Character vector.

    -


    -

    Method get_datalabel()

    +
    +

    +
    +
    +

    Method get_datalabel() +

    Gets data label for the dataset. -Useful to display in Show R Code.

    -

    Usage

    -

    FilteredData$get_datalabel(dataname)

    +Useful to display in Show R Code.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_datalabel(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Character string.

    -


    -

    Method set_available_teal_slices()

    -

    Set list of external filter states available for activation.

    -

    Usage

    -

    FilteredData$set_available_teal_slices(x)

    +
    +

    +
    +
    +

    Method set_available_teal_slices() +

    +

    Set list of external filter states available for activation.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$set_available_teal_slices(x)
    +

    +
    -

    Arguments

    -

    x
    +

    Arguments +

    +

    +
    +
    +
    x

    (reactive) should return teal_slices

    -

    +
    +

    +
    -

    Details

    +

    Details +

    Unlike adding new filter from the column, these filters can come with some prespecified settings. teal_slices are wrapped in a reactive so they can be updated from elsewhere in the app. Filters passed in x are limited to those that can be set for this FilteredData object, @@ -190,46 +304,76 @@

    Details -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method get_available_teal_slices()

    -

    Get list of filter states available for this object.

    -

    Usage

    -

    FilteredData$get_available_teal_slices()

    +
    +

    +
    +
    +

    Method get_available_teal_slices() +

    +

    Get list of filter states available for this object.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_available_teal_slices()
    +

    +
    -

    Details

    +

    Details +

    All teal_slice objects that have been created since the beginning of the app session are stored in one teal_slices object. This returns a subset of that teal_slices, describing filter states that can be set for this object.

    -

    Returns

    +

    Returns +

    reactive that returns teal_slices.

    -


    -

    Method get_call()

    -

    Gets a call to filter the dataset according to the filter state.

    -

    Usage

    -

    FilteredData$get_call(dataname)

    +
    +

    +
    +
    +

    Method get_call() +

    +

    Gets a call to filter the dataset according to the filter state.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset

    -

    +
    +

    +
    -

    Details

    +

    Details +

    It returns a call to filter the dataset only, assuming the other (filtered) datasets it depends on are available.

    Together with self$datanames() which returns the datasets in the correct @@ -243,21 +387,36 @@

    Details -

    Returns

    +

    Returns +

    A list of calls.

    -


    -

    Method get_data()

    +
    +

    +
    +
    +

    Method get_data() +

    Gets filtered or unfiltered dataset.

    -

    For filtered = FALSE, the original data set with set_data is returned including all attributes.

    -

    Usage

    -

    FilteredData$get_data(dataname, filtered = TRUE)

    +

    For filtered = FALSE, the original data set with set_data is returned including all attributes.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_data(dataname, filtered = TRUE)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset.

    @@ -265,77 +424,139 @@

    Arguments -

    Returns

    +

    Returns +

    A data object, a data.frame or a MultiAssayExperiment.

    -


    -

    Method get_join_keys()

    -

    Get join keys between two datasets.

    -

    Usage

    -

    FilteredData$get_join_keys()

    +
    +

    +
    +
    +

    Method get_join_keys() +

    +

    Get join keys between two datasets.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_join_keys()
    +

    +
    -

    Returns

    +

    Returns +

    join_keys

    -


    -

    Method get_filter_overview()

    +
    +

    +
    +
    +

    Method get_filter_overview() +

    Creates filter overview table to be displayed in the application. One row is created per dataset, according to the get_filter_overview methods -of the contained FilteredDataset objects.

    -

    Usage

    -

    FilteredData$get_filter_overview(datanames)

    +of the contained FilteredDataset objects.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_filter_overview(datanames)
    +

    +
    -

    Arguments

    -

    datanames
    +

    Arguments +

    +

    +
    +
    +
    datanames

    (character) vector of dataset names.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    A data.frame listing the numbers of observations in all datasets.

    -


    -

    Method get_keys()

    -

    Get keys for the dataset.

    -

    Usage

    -

    FilteredData$get_keys(dataname)

    +
    +

    +
    +
    +

    Method get_keys() +

    +

    Get keys for the dataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_keys(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Character vector of key column names.

    -


    -

    Method set_dataset()

    -

    Adds a dataset to this FilteredData.

    -

    Usage

    -

    FilteredData$set_dataset(data, dataname)

    +
    +

    +
    +
    +

    Method set_dataset() +

    +

    Adds a dataset to this FilteredData.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$set_dataset(data, dataname)
    +

    +
    -

    Arguments

    -

    data
    +

    Arguments +

    +

    +
    +
    +
    data

    (data.frame or MultiAssayExperiment) data to be filtered.

    @@ -345,10 +566,13 @@

    Arguments -

    Details

    +

    Details +

    set_dataset creates a FilteredDataset object which keeps dataset for the filtering purpose. If this data has a parent specified in the join_keys object stored in private$join_keys then created FilteredDataset (child) gets linked with other FilteredDataset (parent). @@ -357,52 +581,95 @@

    Details -

    Returns

    +

    Returns +

    self, invisibly.

    -


    -

    Method set_join_keys()

    -

    Set the join_keys.

    -

    Usage

    -

    FilteredData$set_join_keys(join_keys)

    +
    +

    +
    +
    +

    Method set_join_keys() +

    +

    Set the join_keys.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$set_join_keys(join_keys)
    +

    +
    -

    Arguments

    -

    join_keys
    +

    Arguments +

    +

    +
    +
    +
    join_keys

    (join_keys), see teal.data::join_keys().

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    self, invisibly.

    -


    -

    Method get_filter_state()

    -

    Gets states of all contained FilterState objects.

    -

    Usage

    -

    FilteredData$get_filter_state()

    +
    +

    +
    +
    +

    Method get_filter_state() +

    +

    Gets states of all contained FilterState objects.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    A teal_slices object.

    -


    -

    Method format()

    -

    Returns a formatted string representing this FilteredData object.

    -

    Usage

    -

    FilteredData$format(show_all = FALSE, trim_lines = TRUE)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns a formatted string representing this FilteredData object.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$format(show_all = FALSE, trim_lines = TRUE)
    +

    +
    -

    Arguments

    -

    show_all
    +

    Arguments +

    +

    +
    +
    +
    show_all

    (logical(1)) passed to format.teal_slice.

    @@ -410,81 +677,148 @@

    Arguments -

    Returns

    +

    Returns +

    character(1) the formatted string.

    -


    -

    Method print()

    -

    Prints this FilteredData object.

    -

    Usage

    -

    FilteredData$print(...)

    +
    +

    +
    +
    +

    Method print() +

    +

    Prints this FilteredData object.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$print(...)
    +

    +
    -

    Arguments

    -

    ...
    +

    Arguments +

    +

    +
    +
    +
    ...

    additional arguments passed to format.

    -

    +
    +

    +
    -


    -

    Method set_filter_state()

    -

    Sets active filter states.

    -

    Usage

    -

    FilteredData$set_filter_state(state)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Sets active filter states.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$set_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method remove_filter_state()

    -

    Removes one or more FilterState from a FilteredData object.

    -

    Usage

    -

    FilteredData$remove_filter_state(state)

    +
    +

    +
    +
    +

    Method remove_filter_state() +

    +

    Removes one or more FilterState from a FilteredData object.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$remove_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices) specifying FilterState objects to remove; teal_slices may contain only dataname and varname, other elements are ignored.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method clear_filter_states()

    -

    Remove all FilterStates of a FilteredDataset or all FilterStates of a FilteredData object.

    -

    Usage

    -

    FilteredData$clear_filter_states(datanames = self$datanames(), force = FALSE)

    +
    +

    +
    +
    +

    Method clear_filter_states() +

    +

    Remove all FilterStates of a FilteredDataset or all FilterStates of a FilteredData object.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$clear_filter_states(datanames = self$datanames(), force = FALSE)
    +

    +
    -

    Arguments

    -

    datanames
    +

    Arguments +

    +

    +
    +
    +
    datanames

    (character) names of datasets for which to remove all filter states. Defaults to all datasets in this FilteredData object.

    @@ -495,24 +829,41 @@

    Arguments -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method ui_filter_panel()

    +
    +

    +
    +
    +

    Method ui_filter_panel() +

    top-level shiny module for the filter panel in the teal app. -Contains 1) filter overview panel, 2) filter active panel, and 3) add filters panel.

    -

    Usage

    -

    FilteredData$ui_filter_panel(id, active_datanames = self$datanames)

    +Contains 1) filter overview panel, 2) filter active panel, and 3) add filters panel.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$ui_filter_panel(id, active_datanames = self$datanames)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    @@ -522,23 +873,40 @@

    Arguments -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_filter_panel()

    -

    Server function for filter panel.

    -

    Usage

    -

    FilteredData$srv_filter_panel(id, active_datanames = self$datanames)

    +
    +

    +
    +
    +

    Method srv_filter_panel() +

    +

    Server function for filter panel.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$srv_filter_panel(id, active_datanames = self$datanames)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    @@ -551,23 +919,40 @@

    Arguments -

    Returns

    +

    Returns +

    NULL.

    -


    -

    Method ui_active()

    -

    Server module responsible for displaying active filters.

    -

    Usage

    -

    FilteredData$ui_active(id, active_datanames = self$datanames)

    +
    +

    +
    +
    +

    Method ui_active() +

    +

    Server module responsible for displaying active filters.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$ui_active(id, active_datanames = self$datanames)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    @@ -577,23 +962,40 @@

    Arguments -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_active()

    -

    Server module responsible for displaying active filters.

    -

    Usage

    -

    FilteredData$srv_active(id, active_datanames = self$datanames)

    +
    +

    +
    +
    +

    Method srv_active() +

    +

    Server module responsible for displaying active filters.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$srv_active(id, active_datanames = self$datanames)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    @@ -603,45 +1005,78 @@

    Arguments -

    Returns

    +

    Returns +

    NULL.

    -


    -

    Method ui_overview()

    +
    +

    +
    +
    +

    Method ui_overview() +

    Creates the UI definition for the module showing counts for each dataset contrasting the filtered to the full unfiltered dataset.

    Per dataset, it displays the number of rows/observations in each dataset, -the number of unique subjects.

    -

    Usage

    -

    FilteredData$ui_overview(id)

    +the number of unique subjects.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$ui_overview(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -


    -

    Method srv_overview()

    +
    +

    +
    +
    +

    Method srv_overview() +

    Server function to display the number of records in the filtered and unfiltered -data.

    -

    Usage

    -

    FilteredData$srv_overview(id, active_datanames = self$datanames)

    +data.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$srv_overview(id, active_datanames = self$datanames)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    @@ -654,41 +1089,73 @@

    Arguments -

    Returns

    +

    Returns +

    NULL.

    -


    -

    Method finalize()

    -

    Object and dependencies cleanup.

    • Destroy inputs and observers stored in private$session_bindings

    • +
    +

    +
    +
    +

    Method finalize() +

    +

    Object and dependencies cleanup.

    +
      +
    • Destroy inputs and observers stored in private$session_bindings

    • Finalize FilteredData stored in private$filtered_datasets

    • -
    -

    Usage

    -

    FilteredData$finalize()

    + +
    +

    Usage +

    +

    +
    +
    FilteredData$finalize()
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    FilteredData$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -696,7 +1163,8 @@

    Arguments -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     FilteredData <- getFromNamespace("FilteredData", "teal.slice")
     
    @@ -874,17 +1342,19 @@ 

    Examples

    + +
    - + +
    - + + diff --git a/main/reference/FilteredDataset.html b/main/reference/FilteredDataset.html index 6d8709ff2..639b87c52 100644 --- a/main/reference/FilteredDataset.html +++ b/main/reference/FilteredDataset.html @@ -1,13 +1,29 @@ - -FilteredDataset R6 class — FilteredDataset • teal.slice + + + + + +FilteredDataset R6 class — FilteredDataset • teal.slice + + + + + + + +components of the dataset."> + + + + Skip to contents @@ -23,24 +39,49 @@ + +
    @@ -48,7 +89,8 @@
    @@ -63,12 +105,15 @@

    FilteredDataset R6 class

    -

    Methods

    +

    Methods +


    -

    Method new()

    -

    Initializes this FilteredDataset object.

    -

    Usage

    -

    +

    +
    +
    +

    Method new() +

    +

    Initializes this FilteredDataset object.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$new(
       dataset,
       dataname,
       keys = character(0),
       label = attr(dataset, "label", exact = TRUE)
    -)

    +)
    +

    +
    -

    Arguments

    -

    dataset
    +

    Arguments +

    +

    +
    +
    +
    dataset

    any object

    @@ -119,23 +179,40 @@

    Arguments -

    Returns

    +

    Returns +

    Object of class FilteredDataset, invisibly.

    -


    -

    Method format()

    -

    Returns a formatted string representing this FilteredDataset object.

    -

    Usage

    -

    FilteredDataset$format(show_all = FALSE, trim_lines = TRUE)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns a formatted string representing this FilteredDataset object.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$format(show_all = FALSE, trim_lines = TRUE)
    +

    +
    -

    Arguments

    -

    show_all
    +

    Arguments +

    +

    +
    +
    +
    show_all

    (logical(1)) passed to format.teal_slice.

    @@ -143,186 +220,342 @@

    Arguments -

    Returns

    +

    Returns +

    The formatted character string.

    -


    -

    Method print()

    -

    Prints this FilteredDataset object.

    -

    Usage

    -

    FilteredDataset$print(...)

    +
    +

    +
    +
    +

    Method print() +

    +

    Prints this FilteredDataset object.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$print(...)
    +

    +
    -

    Arguments

    -

    ...
    +

    Arguments +

    +

    +
    +
    +
    ...

    additional arguments passed to format.

    -

    +
    +

    +
    -


    -

    Method clear_filter_states()

    -

    Removes all filter items applied to this dataset.

    -

    Usage

    -

    FilteredDataset$clear_filter_states(force = FALSE)

    +
    +

    +
    +
    +

    Method clear_filter_states() +

    +

    Removes all filter items applied to this dataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$clear_filter_states(force = FALSE)
    +

    +
    -

    Arguments

    -

    force
    +

    Arguments +

    +

    +
    +
    +
    force

    (logical(1)) flag specifying whether to include anchored filter states.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL.

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Gets a filter expression.

    This function returns filter calls equivalent to selected items within each of filter_states. Configuration of the calls is constant and -depends on filter_states type and order which are set during initialization.

    -

    Usage

    -

    FilteredDataset$get_call(sid = "")

    +depends on filter_states type and order which are set during initialization.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_call(sid = "")
    +

    +
    -

    Arguments

    -

    sid
    +

    Arguments +

    +

    +
    +
    +
    sid

    (character) when specified, the method returns code containing conditions calls of FilterState objects with sid different to this sid argument.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Either a list of filter calls, or NULL.

    -


    -

    Method get_filter_state()

    -

    Gets states of all contained FilterState objects.

    -

    Usage

    -

    FilteredDataset$get_filter_state()

    +
    +

    +
    +
    +

    Method get_filter_state() +

    +

    Gets states of all contained FilterState objects.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    A teal_slices object.

    -


    -

    Method set_filter_state()

    -

    Set filter state.

    -

    Usage

    -

    FilteredDataset$set_filter_state(state)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Set filter state.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$set_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Virtual method, returns nothing and raises error.

    -


    -

    Method get_dataname()

    -

    Gets the name of the dataset.

    -

    Usage

    -

    FilteredDataset$get_dataname()

    +
    +

    +
    +
    +

    Method get_dataname() +

    +

    Gets the name of the dataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_dataname()
    +

    +
    -

    Returns

    +

    Returns +

    A character string.

    -


    -

    Method get_dataset()

    -

    Gets the dataset object in this FilteredDataset.

    -

    Usage

    -

    FilteredDataset$get_dataset(filtered = FALSE)

    +
    +

    +
    +
    +

    Method get_dataset() +

    +

    Gets the dataset object in this FilteredDataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_dataset(filtered = FALSE)
    +

    +
    -

    Arguments

    -

    filtered
    +

    Arguments +

    +

    +
    +
    +
    filtered

    (logical(1))

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    The stored dataset. If data.frame or MultiAssayExperiment, either raw or as a reactive with current filters applied (depending on filtered).

    -


    -

    Method get_filter_overview()

    -

    Get filter overview of a dataset.

    -

    Usage

    -

    FilteredDataset$get_filter_overview()

    +
    +

    +
    +
    +

    Method get_filter_overview() +

    +

    Get filter overview of a dataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_filter_overview()
    +

    +
    -

    Returns

    +

    Returns +

    Virtual method, returns nothing and raises an error.

    -


    -

    Method get_keys()

    -

    Gets the key columns for this dataset.

    -

    Usage

    -

    FilteredDataset$get_keys()

    +
    +

    +
    +
    +

    Method get_keys() +

    +

    Gets the key columns for this dataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_keys()
    +

    +
    -

    Returns

    +

    Returns +

    Character vector of variable names

    -


    -

    Method get_dataset_label()

    -

    Gets the dataset label.

    -

    Usage

    -

    FilteredDataset$get_dataset_label()

    +
    +

    +
    +
    +

    Method get_dataset_label() +

    +

    Gets the dataset label.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_dataset_label()
    +

    +
    -

    Returns

    +

    Returns +

    Character string.

    -


    -

    Method ui_active()

    -

    shiny module containing active filters for a dataset, along with a title and a remove button.

    -

    Usage

    -

    FilteredDataset$ui_active(id, allow_add = TRUE)

    +
    +

    +
    +
    +

    Method ui_active() +

    +

    shiny module containing active filters for a dataset, along with a title and a remove button.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$ui_active(id, allow_add = TRUE)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    @@ -332,107 +565,190 @@

    Arguments -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_active()

    -

    Server module for a dataset active filters.

    -

    Usage

    -

    FilteredDataset$srv_active(id)

    +
    +

    +
    +
    +

    Method srv_active() +

    +

    Server module for a dataset active filters.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$srv_active(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL.

    -


    -

    Method ui_add()

    -

    UI module to add filter variable for this dataset.

    -

    Usage

    -

    FilteredDataset$ui_add(id)

    +
    +

    +
    +
    +

    Method ui_add() +

    +

    UI module to add filter variable for this dataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$ui_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Virtual method, returns nothing and raises error.

    -


    -

    Method srv_add()

    +
    +

    +
    +
    +

    Method srv_add() +

    Server module to add filter variable for this dataset. For this class srv_add calls multiple modules of the same name from FilterStates as MAEFilteredDataset -contains one FilterStates object for colData and one for each experiment.

    -

    Usage

    -

    FilteredDataset$srv_add(id)

    +contains one FilterStates object for colData and one for each experiment.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$srv_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL.

    -


    -

    Method finalize()

    -

    Object and dependencies cleanup.

    • Destroy inputs and observers stored in private$session_bindings

    • +
    +

    +
    +
    +

    Method finalize() +

    +

    Object and dependencies cleanup.

    +
      +
    • Destroy inputs and observers stored in private$session_bindings

    • Finalize FilterStates stored in private$filter_states

    • -
    -

    Usage

    -

    FilteredDataset$finalize()

    + +
    +

    Usage +

    +

    +
    +
    FilteredDataset$finalize()
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    FilteredDataset$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -440,17 +756,19 @@

    Arguments

    + +
    - + +
    - + + diff --git a/main/reference/LogicalFilterState.html b/main/reference/LogicalFilterState.html index 9a9f37085..6ae48e1a8 100644 --- a/main/reference/LogicalFilterState.html +++ b/main/reference/LogicalFilterState.html @@ -1,5 +1,21 @@ - -FilterState object for logical data — LogicalFilterState • teal.slice + + + + + + +FilterState object for logical data — LogicalFilterState • teal.slice + + + + + + + + + + + Skip to contents @@ -15,24 +31,49 @@ + +
    @@ -40,7 +81,8 @@
    @@ -51,40 +93,60 @@

    FilterState object for logical data

    -

    Super class

    +

    Super class +

    teal.slice::FilterState -> LogicalFilterState

    +

    Inherited methods


    -

    Method new()

    -

    Initialize a FilterState object.

    -

    Usage

    -

    LogicalFilterState$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterState object.

    +
    +

    Usage +

    +

    +
    +
    LogicalFilterState$new(
       x,
       x_reactive = reactive(NULL),
       extract_type = character(0),
       slice
    -)

    +)
    +

    +
    -

    Arguments

    -

    x
    +

    Arguments +

    +

    + -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection. -For LogicalFilterState it's a !<varname> or <varname> and optionally is.na(<varname>)

    -

    Usage

    -

    LogicalFilterState$get_call(dataname)

    +For LogicalFilterState it's a !<varname> or <varname> and optionally is.na(<varname>)

    +
    +

    Usage +

    +

    +
    +
    LogicalFilterState$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    name of data set; defaults to private$get_dataname()

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    call

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    LogicalFilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    LogicalFilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -163,7 +265,8 @@

    Arguments -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     include_css_files <- getFromNamespace("include_css_files", "teal.slice")
     include_js_files <- getFromNamespace("include_js_files", "teal.slice")
    @@ -251,17 +354,19 @@ 

    Examples

    + +
    - + +
    - + + diff --git a/main/reference/MAEFilterStates.html b/main/reference/MAEFilterStates.html index 4ec366899..f527c922c 100644 --- a/main/reference/MAEFilterStates.html +++ b/main/reference/MAEFilterStates.html @@ -1,5 +1,21 @@ - -FilterStates subclass for MultiAssayExperiments — MAEFilterStates • teal.slice + + + + + + +FilterStates subclass for MultiAssayExperiments — MAEFilterStates • teal.slice + + + + + + + + + + + Skip to contents @@ -15,24 +31,49 @@ + +
    @@ -40,7 +81,8 @@
    @@ -51,18 +93,25 @@

    FilterStates subclass for MultiAssayExperiments -

    Super class

    +

    Super class +

    teal.slice::FilterStates -> MAEFilterStates

    -

    Methods

    +

    Methods +

    Inherited methods +
    +

    Inherited methods


    -

    Method new()

    -

    Initialize MAEFilterStates object.

    -

    Usage

    -

    MAEFilterStates$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize MAEFilterStates object.

    +
    +

    Usage +

    +

    +
    +
    MAEFilterStates$new(
       data,
       data_reactive = function(sid = "") NULL,
       dataname,
       datalabel = "subjects",
       keys = character(0)
    -)

    +)
    +

    +
    -

    Arguments

    -

    data
    +

    Arguments +

    +

    +
    +
    +
    data

    (MultiAssayExperiment) the R object which MultiAssayExperiment::subsetByColData function is applied on.

    @@ -123,23 +185,41 @@

    Arguments
    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    MAEFilterStates$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    MAEFilterStates$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -147,17 +227,19 @@

    Arguments

    + +

    - + +
    - + + diff --git a/main/reference/MAEFilteredDataset.html b/main/reference/MAEFilteredDataset.html index 61bea24e1..160703c25 100644 --- a/main/reference/MAEFilteredDataset.html +++ b/main/reference/MAEFilteredDataset.html @@ -1,7 +1,23 @@ - -MAEFilteredDataset R6 class — MAEFilteredDataset • teal.slice + + + + + + +MAEFilteredDataset R6 class — MAEFilteredDataset • teal.slice + + + + + + + + + + + Skip to contents @@ -17,24 +33,49 @@ + +
    @@ -42,7 +83,8 @@
    @@ -54,22 +96,29 @@

    MAEFilteredDataset R6 class

    -

    Super class

    +

    Super class +

    teal.slice::FilteredDataset -> MAEFilteredDataset

    +

    Inherited methods


    -

    Method new()

    -

    Initialize MAEFilteredDataset object.

    -

    Usage

    -

    MAEFilteredDataset$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize MAEFilteredDataset object.

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$new(
       dataset,
       dataname,
       keys = character(0),
       label = character(0)
    -)

    +)
    +

    +
    -

    Arguments

    -

    dataset
    +

    Arguments +

    +

    +
    +
    +
    dataset

    (MulitiAssayExperiment) single MulitiAssayExperiment for which filters are rendered.

    @@ -116,102 +178,183 @@

    Arguments -

    Returns

    +

    Returns +

    Object of class MAEFilteredDataset, invisibly.

    -


    -

    Method set_filter_state()

    -

    Set filter state.

    -

    Usage

    -

    MAEFilteredDataset$set_filter_state(state)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Set filter state.

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$set_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method remove_filter_state()

    -

    Remove one or more FilterState of a MAEFilteredDataset.

    -

    Usage

    -

    MAEFilteredDataset$remove_filter_state(state)

    +
    +

    +
    +
    +

    Method remove_filter_state() +

    +

    Remove one or more FilterState of a MAEFilteredDataset.

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$remove_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices) specifying FilterState objects to remove; teal_slices may contain only dataname and varname, other elements are ignored.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method ui_add()

    -

    UI module to add filter variable for this dataset.

    -

    Usage

    -

    MAEFilteredDataset$ui_add(id)

    +
    +

    +
    +
    +

    Method ui_add() +

    +

    UI module to add filter variable for this dataset.

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$ui_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method get_filter_overview()

    -

    Creates row for filter overview in the form of
    dataname -- observations (remaining/total) -- subjects (remaining/total) - MAE

    -

    Usage

    -

    MAEFilteredDataset$get_filter_overview()

    +
    +

    +
    +
    +

    Method get_filter_overview() +

    +

    Creates row for filter overview in the form of
    dataname -- observations (remaining/total) -- subjects (remaining/total) - MAE

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$get_filter_overview()
    +

    +
    -

    Returns

    +

    Returns +

    A data.frame.

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    MAEFilteredDataset$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -219,7 +362,8 @@

    Arguments -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     MAEFilteredDataset <- getFromNamespace("MAEFilteredDataset", "teal.slice")
     
    @@ -291,17 +435,19 @@ 

    Examples

    + +
    - + +
    - + + diff --git a/main/reference/MatrixFilterStates.html b/main/reference/MatrixFilterStates.html index 24e5f41fc..0bc98ffec 100644 --- a/main/reference/MatrixFilterStates.html +++ b/main/reference/MatrixFilterStates.html @@ -1,5 +1,21 @@ - -FilterStates subclass for matrices — MatrixFilterStates • teal.slice + + + + + + +FilterStates subclass for matrices — MatrixFilterStates • teal.slice + + + + + + + + + + + Skip to contents @@ -15,24 +31,49 @@ + +
    @@ -40,7 +81,8 @@
    @@ -51,18 +93,25 @@

    FilterStates subclass for matrices

    -

    Super class

    +

    Super class +

    teal.slice::FilterStates -> MatrixFilterStates

    -

    Methods

    +

    Methods +

    Inherited methods +
    +

    Inherited methods


    -

    Method new()

    -

    Initialize MatrixFilterStates object.

    -

    Usage

    -

    MatrixFilterStates$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize MatrixFilterStates object.

    +
    +

    Usage +

    +

    +
    +
    MatrixFilterStates$new(
       data,
       data_reactive = function(sid = "") NULL,
       dataname,
       datalabel = NULL
    -)

    +)
    +

    +
    -

    Arguments

    -

    data
    +

    Arguments +

    +

    +
    +
    +
    data

    (matrix) the R object which subset function is applied on.

    @@ -112,23 +174,41 @@

    Arguments
    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    MatrixFilterStates$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    MatrixFilterStates$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -136,17 +216,19 @@

    Arguments

    + +

    - + +
    - + + diff --git a/main/reference/RangeFilterState.html b/main/reference/RangeFilterState.html index a587c23f8..ce62630f1 100644 --- a/main/reference/RangeFilterState.html +++ b/main/reference/RangeFilterState.html @@ -1,5 +1,21 @@ - -FilterState object for numeric data — RangeFilterState • teal.slice + + + + + + +FilterState object for numeric data — RangeFilterState • teal.slice + + + + + + + + + + + Skip to contents @@ -15,24 +31,49 @@ + +
    @@ -40,7 +81,8 @@
    @@ -51,41 +93,61 @@

    FilterState object for numeric data

    -

    Super class

    +

    Super class +

    teal.slice::FilterState -> RangeFilterState

    +

    Inherited methods


    -

    Method new()

    -

    Initialize a FilterState object for range selection.

    -

    Usage

    -

    RangeFilterState$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterState object for range selection.

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$new(
       x,
       x_reactive = reactive(NULL),
       extract_type = character(0),
       slice
    -)

    +)
    +

    +
    -

    Arguments

    -

    x
    +

    Arguments +

    +

    + -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection. For this class returned call looks like <varname> >= <min value> & <varname> <= <max value> with -optional is.na(<varname>) and is.finite(<varname>).

    -

    Usage

    -

    RangeFilterState$get_call(dataname)

    +optional is.na(<varname>) and is.finite(<varname>).

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    name of data set; defaults to private$get_dataname()

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    call

    -


    -

    Method get_keep_inf()

    -

    Returns current keep_inf selection.

    -

    Usage

    -

    RangeFilterState$get_keep_inf()

    +
    +

    +
    +
    +

    Method get_keep_inf() +

    +

    Returns current keep_inf selection.

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$get_keep_inf()
    +

    +
    -

    Returns

    +

    Returns +

    logical(1)

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    RangeFilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -178,7 +291,8 @@

    Arguments -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     include_css_files <- getFromNamespace("include_css_files", "teal.slice")
     include_js_files <- getFromNamespace("include_js_files", "teal.slice")
    @@ -294,17 +408,19 @@ 

    Examples

    + +
    - + +
    - + + diff --git a/main/reference/SEFilterStates.html b/main/reference/SEFilterStates.html index b7c6843c4..a61abda6b 100644 --- a/main/reference/SEFilterStates.html +++ b/main/reference/SEFilterStates.html @@ -1,5 +1,21 @@ - -FilterStates subclass for SummarizedExperiments — SEFilterStates • teal.slice + + + + + + +FilterStates subclass for SummarizedExperiments — SEFilterStates • teal.slice + + + + + + + + + + + Skip to contents @@ -15,24 +31,49 @@ + +
    @@ -40,7 +81,8 @@
    @@ -51,21 +93,28 @@

    FilterStates subclass for SummarizedExperiments -

    Super class

    +

    Super class +

    teal.slice::FilterStates -> SEFilterStates

    +

    Inherited methods


    -

    Method new()

    -

    Initialize SEFilterStates object.

    -

    Usage

    -

    SEFilterStates$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize SEFilterStates object.

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$new(
       data,
       data_reactive = function(sid = "") NULL,
       dataname,
       datalabel = NULL
    -)

    +)
    +

    +
    -

    Arguments

    -

    data
    +

    Arguments +

    +

    +
    +
    +
    data

    (SummarizedExperiment) the R object which subset function is applied on.

    @@ -112,92 +174,161 @@

    Arguments
    -

    Method set_filter_state()

    -

    Set filter state.

    -

    Usage

    -

    SEFilterStates$set_filter_state(state)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Set filter state.

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$set_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices) teal_slice objects should contain the field arg %in% c("subset", "select")

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method ui_add()

    -

    shiny UI module to add filter variable.

    -

    Usage

    -

    SEFilterStates$ui_add(id)

    +
    +

    +
    +
    +

    Method ui_add() +

    +

    shiny UI module to add filter variable.

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$ui_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_add()

    +
    +

    +
    +
    +

    Method srv_add() +

    shiny server module to add filter variable.

    Module controls available choices to select as a filter variable. Selected filter variable is being removed from available choices. Removed filter variable gets back to available choices. This module unlike other FilterStates classes manages two sets of filter variables - one for colData and another for -rowData.

    -

    Usage

    -

    SEFilterStates$srv_add(id)

    +rowData.

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$srv_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    SEFilterStates$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -205,17 +336,19 @@

    Arguments

    + +
    - + +
    - + + diff --git a/main/reference/calls_combine_by.html b/main/reference/calls_combine_by.html index 7729f027f..136628ffd 100644 --- a/main/reference/calls_combine_by.html +++ b/main/reference/calls_combine_by.html @@ -1,5 +1,21 @@ - -Compose predicates — calls_combine_by • teal.slice + + + + + + +Compose predicates — calls_combine_by • teal.slice + + + + + + + + + + + Skip to contents @@ -15,24 +31,49 @@ + +

    @@ -50,36 +91,45 @@

    Compose predicates

    -

    Usage

    +

    Usage +

    calls_combine_by(calls, operator)
    -

    Arguments

    +

    Arguments +

    -
    calls
    +
    +
    calls +

    (list) containing calls (or symbols) to be combined by operator

    -
    operator
    +
    operator +

    (character(1)) infix operator to use in predicate composition, e.g. "&"

    -
    + +
    -

    Value

    +

    Value +

    A call where elements of calls are composed with operator or NULL if calls is an empty list.

    -

    Details

    +

    Details +

    This function is used to combine logical predicates produced by FilterState objects to build a complete subset expression.

    -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     calls_combine_by <- getFromNamespace("calls_combine_by", "teal.slice")
     
    @@ -94,17 +144,19 @@ 

    Examples

    + +
    - + +
    - + + diff --git a/main/reference/choices_labeled.html b/main/reference/choices_labeled.html index d9d9d6167..d2255733e 100644 --- a/main/reference/choices_labeled.html +++ b/main/reference/choices_labeled.html @@ -1,7 +1,23 @@ - -Set "<choice>:<label>" type of names — choices_labeled • teal.slice + + + + + + +Set "<choice>:<label>" type of names — choices_labeled • teal.slice + + + + + + + + + + + Skip to contents @@ -17,24 +33,49 @@ + +
    @@ -53,55 +94,67 @@

    Set "<choice>:<label>" type of names

    -

    Usage

    +

    Usage +

    choices_labeled(choices, labels, subset = NULL, types = NULL)
    -

    Arguments

    +

    Arguments +

    -
    choices
    +
    +
    choices +

    (character or numeric or logical) vector

    -
    labels
    +
    labels +

    (character) vector containing labels to be applied to choices. If NA then "Label Missing" will be used.

    -
    subset
    +
    subset +

    a vector that is a subset of choices. This is useful if only a few variables need to be named. If this argument is used, the returned vector will match its order.

    -
    types
    +
    types +

    vector containing the types of the columns.

    -
    + +
    -

    Value

    +

    Value +

    A named character vector.

    -

    Details

    +

    Details +

    If either choices or labels are factors, they are coerced to character. Duplicated elements from choices get removed.

    + +
    - + +
    - + + diff --git a/main/reference/coalesce_r.html b/main/reference/coalesce_r.html index d6a37c3aa..f78821151 100644 --- a/main/reference/coalesce_r.html +++ b/main/reference/coalesce_r.html @@ -1,5 +1,21 @@ - -Recursively coalesce list elements. — coalesce_r • teal.slice + + + + + + +Recursively coalesce list elements. — coalesce_r • teal.slice + + + + + + + + + + + Skip to contents @@ -15,24 +31,49 @@ + +
    @@ -50,24 +91,31 @@

    Recursively coalesce list elements.

    -

    Usage

    +

    Usage +

    coalesce_r(x)
    -

    Arguments

    +

    Arguments +

    -
    x
    +
    +
    x +

    (list), either of atomic vectors or of named lists

    -
    + +
    -

    Value

    +

    Value +

    Either an atomic vector of length 1 or a (potentially nested) list.

    -

    Details

    +

    Details +

    Given a list of atomic vectors, the first non-null element is returned. Given a list of lists, for all names found in all elements of the list the first non-null element of a given name is returned.

    @@ -75,17 +123,19 @@

    Details

    + +
    - + +
    - + + diff --git a/main/reference/countBar.html b/main/reference/countBar.html index a465992cc..04bc52f15 100644 --- a/main/reference/countBar.html +++ b/main/reference/countBar.html @@ -1,5 +1,21 @@ - -Progress bar with label — countBar • teal.slice + + + + + + +Progress bar with label — countBar • teal.slice + + + + + + + + + + + Skip to contents @@ -15,24 +31,49 @@ + +
    @@ -50,7 +91,8 @@

    Progress bar with label

    -

    Usage

    +

    Usage +

    countBar(inputId, label, countmax, countnow = NULL, counttotal = countmax)
     
     updateCountBar(
    @@ -72,56 +114,72 @@ 

    Usage

    -

    Arguments

    +

    Arguments +

    -
    inputId
    +
    +
    inputId +

    (character(1)) shiny id of the parent element (e.g. a check-box group input).

    -
    label
    +
    label +

    (character(1)) Text to display followed by counts.

    -
    countmax
    +
    countmax +

    (numeric(1)) Maximum count for a single element.

    -
    countnow
    +
    countnow +

    (numeric(1)) Current count for a single element.

    -
    counttotal
    +
    counttotal +

    (numeric(1)) Sum total of maximum counts of all elements, see Details.

    -
    session
    +
    session +

    (session) shiny session object passed to function given to shinyServer.

    -
    + +
    -

    Value

    +

    Value +

    shiny.tag object with a progress bar and a label.

    -

    Details

    -

    A progress bar is created to visualize the number of counts in a variable, with filling and a text label.

    • progress bar width is derived as a fraction of the container width: style = "width: <countmax> / <counttotal>%",

    • +

      Details +

      +

      A progress bar is created to visualize the number of counts in a variable, with filling and a text label.

      +
        +
      • progress bar width is derived as a fraction of the container width: style = "width: <countmax> / <counttotal>%",

      • progress bar is filled up to the fraction <countnow> / <countmax>,

      • text label is obtained by <label> (<countnow> / <countmax>).

      • -
    + +
    + +
    - + +
    - + + diff --git a/main/reference/countBars.html b/main/reference/countBars.html index 32054addb..46f07df27 100644 --- a/main/reference/countBars.html +++ b/main/reference/countBars.html @@ -1,5 +1,21 @@ - -Progress bars with labels — countBars • teal.slice + + + + + + +Progress bars with labels — countBars • teal.slice + + + + + + + + + + + Skip to contents @@ -15,24 +31,49 @@ + +
    @@ -50,7 +91,8 @@

    Progress bars with labels

    -

    Usage

    +

    Usage +

    countBars(inputId, choices, countsmax, countsnow = NULL)
     
     updateCountBars(
    @@ -63,31 +105,40 @@ 

    Usage

    -

    Arguments

    +

    Arguments +

    -
    inputId
    +
    +
    inputId +

    (character(1)) shiny id of the parent element (e.g. a check-box group input).

    -
    choices
    +
    choices +

    (vector) Available values. Used to determine label text.

    -
    countsmax
    +
    countsmax +

    (numeric) Maximum counts of each element. Must be the same length choices.

    -
    countsnow
    +
    countsnow +

    (numeric) Current counts of each element. Must be the same length choices.

    -
    session
    +
    session +

    (session) shiny session object passed to function given to shinyServer.

    -
    + +
    -

    Value

    +

    Value +

    List of shiny.tags.

    Creates a number of progress bar elements, one for each value of choices. The widths of all progress bars add up to the full width of the container. @@ -99,7 +150,8 @@

    Value

    -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     include_js_files <- getFromNamespace("include_js_files", "teal.slice")
     include_css_files <- getFromNamespace("include_css_files", "teal.slice")
    @@ -151,17 +203,19 @@ 

    Examples

    + +
    - + +
    - + + diff --git a/main/reference/data_choices_labeled.html b/main/reference/data_choices_labeled.html index 525031052..10604e1df 100644 --- a/main/reference/data_choices_labeled.html +++ b/main/reference/data_choices_labeled.html @@ -1,5 +1,21 @@ - -Returns a choices_labeled object — data_choices_labeled • teal.slice + + + + + + +Returns a choices_labeled object — data_choices_labeled • teal.slice + + + + + + + + + + + Skip to contents @@ -15,24 +31,49 @@ + +
    @@ -50,7 +91,8 @@

    Returns a choices_labeled object

    -

    Usage

    +

    Usage +

    data_choices_labeled(
       data,
       choices,
    @@ -60,47 +102,57 @@ 

    Usage

    -

    Arguments

    +

    Arguments +

    -
    data
    +
    +
    data +

    (data.frame or DFrame or list) where labels can be taken from in case when varlabels is not specified. data must be specified if varlabels is not specified.

    -
    choices
    +
    choices +

    (character) the vector of chosen variables

    -
    varlabels
    +
    varlabels +

    (character) the labels of variables in data

    -
    keys
    +
    keys +

    (character) the names of the key columns in data

    -
    + +
    -

    Value

    +

    Value +

    character(0) if choices are empty; a choices_labeled object otherwise

    + +
    - + +
    - + + diff --git a/main/reference/dot-finalize_session_bindings.html b/main/reference/dot-finalize_session_bindings.html index 141b419ba..946d13cf8 100644 --- a/main/reference/dot-finalize_session_bindings.html +++ b/main/reference/dot-finalize_session_bindings.html @@ -1,11 +1,27 @@ - -Destroys inputs and observers stored in private$session_bindings — .finalize_session_bindings • teal.slice + + + + + +Destroys inputs and observers stored in private$session_bindings — .finalize_session_bindings • teal.slice + + + + + + + +store callback destroy function for inputs which removes bindings from a session."> + + + + Skip to contents @@ -21,24 +37,49 @@ + +
    @@ -46,7 +87,8 @@
    @@ -59,35 +101,43 @@

    Destroys inputs and observers stored in private$session_bindings
    -

    Usage

    +

    Usage +

    .finalize_session_bindings(self, private)
    -

    Arguments

    +

    Arguments +

    -
    self, private
    +
    +
    self, private +

    slots of a R6 class

    -
    + +

    -

    Value

    +

    Value +

    NULL invisibly

    + + - + + - + + diff --git a/main/reference/dot-table.html b/main/reference/dot-table.html index 709131bff..4f4168ab1 100644 --- a/main/reference/dot-table.html +++ b/main/reference/dot-table.html @@ -1,5 +1,21 @@ - -table handling POSIXlt — .table • teal.slice + + + + + + +table handling POSIXlt — .table • teal.slice + + + + + + + + + + + Skip to contents @@ -15,24 +31,49 @@ + + @@ -40,7 +81,9 @@
    @@ -50,35 +93,43 @@

    table handling POSIXlt

    -

    Usage

    +

    Usage +

    .table(x)
    -

    Arguments

    +

    Arguments +

    -
    x
    +
    +
    x +

    (vector) variable to get counts from.

    -
    + +
    -

    Value

    +

    Value +

    vector of counts named by unique values of x.

    + + - + + - + + diff --git a/main/reference/eval_expr_with_msg.html b/main/reference/eval_expr_with_msg.html index 188a8bc8e..f5c52e125 100644 --- a/main/reference/eval_expr_with_msg.html +++ b/main/reference/eval_expr_with_msg.html @@ -1,9 +1,25 @@ - -Evaluate expression with meaningful message — eval_expr_with_msg • teal.slice + + + + + +Evaluate expression with meaningful message — eval_expr_with_msg • teal.slice + + + + + + + +all necessary bindings."> + + + + Skip to contents @@ -19,24 +35,49 @@ + + @@ -56,39 +97,48 @@

    Evaluate expression with meaningful message

    -

    Usage

    +

    Usage +

    eval_expr_with_msg(expr, env)
    -

    Arguments

    +

    Arguments +

    -
    expr
    +
    +
    expr +

    (language)

    -
    env
    +
    env +

    (environment) where expression is evaluated.

    -
    + +
    -

    Value

    +

    Value +

    NULL, invisibly.

    + + - + + - + + diff --git a/main/reference/fetch_bs_color.html b/main/reference/fetch_bs_color.html index a7c9f8c3a..ed8d69823 100644 --- a/main/reference/fetch_bs_color.html +++ b/main/reference/fetch_bs_color.html @@ -1,5 +1,21 @@ - -Get hex code of the current Bootstrap theme color. — fetch_bs_color • teal.slice + + + + + + +Get hex code of the current Bootstrap theme color. — fetch_bs_color • teal.slice + + + + + + + + + + + Skip to contents @@ -15,24 +31,49 @@ + + @@ -50,31 +91,39 @@

    Get hex code of the current Bootstrap theme color.

    -

    Usage

    +

    Usage +

    fetch_bs_color(color, alpha = NULL)
    -

    Arguments

    +

    Arguments +

    -
    color
    +
    +
    color +

    (character(1)) naming one of the available theme colors

    -
    alpha
    +
    alpha +

    either a numeric(1) or character(1) specifying transparency in the range of 0-1 or a hexadecimal value 00-ff, respectively; set to NULL to omit adding the alpha channel

    -
    + +
    -

    Value

    +

    Value +

    Named character(1) containing a hexadecimal color representation.

    -

    Examples

    +

    Examples +

    fetch_bs_color <- getFromNamespace("fetch_bs_color", "teal.slice")
     fetch_bs_color("primary")
     #> [1] "#0d6efd"
    @@ -86,17 +135,19 @@ 

    Examples

    + +
    - + + - + + diff --git a/main/reference/filter_state_api.html b/main/reference/filter_state_api.html index d1315d3c2..9b0ad2638 100644 --- a/main/reference/filter_state_api.html +++ b/main/reference/filter_state_api.html @@ -1,7 +1,23 @@ - -Managing FilteredData states — filter_state_api • teal.slice + + + + + + +Managing FilteredData states — filter_state_api • teal.slice + + + + + + + + + + + Skip to contents @@ -17,24 +33,49 @@ + + @@ -53,7 +94,8 @@

    Managing FilteredData states

    -

    Usage

    +

    Usage +

    set_filter_state(datasets, filter)
     
     get_filter_state(datasets)
    @@ -64,39 +106,52 @@ 

    Usage

    -

    Arguments

    +

    Arguments +

    -
    datasets
    -

    (FilteredData) +

    +
    datasets +
    +
    +

    (FilteredData) object to store filter state and filtered datasets, shared across modules

    -

    see FilteredData for details

    +

    see FilteredData for details

    +
    -
    filter
    +
    filter +

    (teal_slices) specify filters in place on app start-up

    -
    force
    +
    force +

    (logical(1)) flag specifying whether to include anchored filter states.

    -
    + +
    -

    Value

    +

    Value +

    -
    • set_*, remove_* and clear_filter_state return NULL invisibly

    • +
        +
      • set_*, remove_* and clear_filter_state return NULL invisibly

      • get_filter_state returns a named teal_slices object containing a teal_slice for every existing FilterState

      • -
    + +
    -

    See also

    +

    See also +

    -

    Examples

    +

    Examples +

    datasets <- init_filtered_data(list(iris = iris, mtcars = mtcars))
     fs <- teal_slices(
       teal_slice(dataname = "iris", varname = "Species", selected = c("setosa", "versicolor")),
    @@ -239,17 +294,19 @@ 

    Examples

    + +
    - + + - + + diff --git a/main/reference/format_time.html b/main/reference/format_time.html index caafc67fe..6f86f02f0 100644 --- a/main/reference/format_time.html +++ b/main/reference/format_time.html @@ -1,5 +1,21 @@ - -Format POSIXt for storage — format_time • teal.slice + + + + + + +Format POSIXt for storage — format_time • teal.slice + + + + + + + + + + + Skip to contents @@ -15,24 +31,49 @@ + + @@ -50,40 +91,49 @@

    Format POSIXt for storage

    -

    Usage

    +

    Usage +

    format_time(x)
    -

    Arguments

    +

    Arguments +

    -
    x
    +
    +
    x +

    (POSIXt) vector of date time values or anything else

    -
    + +
    -

    Value

    +

    Value +

    If x is of class POSIXt, a character vector, otherwise x itself.

    -

    Details

    +

    Details +

    Date times are stored as string representations expressed in the UTC time zone. The storage format is YYYY-MM-DD HH:MM:SS.

    + + - + + - + + diff --git a/main/reference/get_default_slice_id.html b/main/reference/get_default_slice_id.html index 1f98e26b5..2a31ad2a3 100644 --- a/main/reference/get_default_slice_id.html +++ b/main/reference/get_default_slice_id.html @@ -1,5 +1,21 @@ - -Default teal_slice id — get_default_slice_id • teal.slice + + + + + + +Default teal_slice id — get_default_slice_id • teal.slice + + + + + + + + + + + Skip to contents @@ -15,24 +31,49 @@ + + @@ -50,48 +91,60 @@

    Default teal_slice id

    -

    Usage

    +

    Usage +

    get_default_slice_id(x)
    -

    Arguments

    +

    Arguments +

    -
    x
    +
    +
    x +

    (teal_slice or list)

    -
    + +
    -

    Value

    +

    Value +

    (character(1)) id for a teal_slice object.

    -

    Details

    +

    Details +

    Function returns a default id for a teal_slice object which needs to be distinct from other teal_slice objects created for any FilterStates object. Returned id can be treated as a location of -a vector on which FilterState is built:

    • for a data.frame id concatenates dataname and varname.

    • +a vector on which FilterState is built:

      +
        +
      • for a data.frame id concatenates dataname and varname.

      • for a MultiAssayExperiment id concatenates dataname, varname, experiment and arg, so that one can add teal_slice for a varname which exists in multiple SummarizedExperiments or exists in both colData and rowData of given experiment. For such a vector teal.slice doesn't allow to activate more than one filters. In case of teal_slice_expr id is mandatory and must be unique.

      • -
    + + + + - + + - + + diff --git a/main/reference/get_filter_expr.html b/main/reference/get_filter_expr.html index 2748a6b9d..f0fafb825 100644 --- a/main/reference/get_filter_expr.html +++ b/main/reference/get_filter_expr.html @@ -1,7 +1,23 @@ - -Gets filter expression for multiple datanames taking into account its order. — get_filter_expr • teal.slice + + + + + + +Gets filter expression for multiple datanames taking into account its order. — get_filter_expr • teal.slice + + + + + + + + + + + Skip to contents @@ -17,24 +33,49 @@ + + @@ -53,39 +94,48 @@

    Gets filter expression for multiple datanames taking into accou
    -

    Usage

    +

    Usage +

    get_filter_expr(datasets, datanames = datasets$datanames())
    -

    Arguments

    +

    Arguments +

    -
    datasets
    +
    +
    datasets +

    (FilteredData)

    -
    datanames
    +
    datanames +

    (character) vector of dataset names

    -
    + +
    -

    Value

    +

    Value +

    A character string containing all subset expressions.

    + + - + + - + + diff --git a/main/reference/get_supported_filter_varnames.html b/main/reference/get_supported_filter_varnames.html index 525907efb..30ff4da22 100644 --- a/main/reference/get_supported_filter_varnames.html +++ b/main/reference/get_supported_filter_varnames.html @@ -1,7 +1,23 @@ - -Gets supported filterable variable names — get_supported_filter_varnames • teal.slice + + + + + + +Gets supported filterable variable names — get_supported_filter_varnames • teal.slice + + + + + + + + + + + Skip to contents @@ -17,24 +33,49 @@ + + @@ -53,25 +94,32 @@

    Gets supported filterable variable names

    -

    Usage

    +

    Usage +

    get_supported_filter_varnames(data)
    -

    Arguments

    +

    Arguments +

    -
    data
    +
    +
    data +

    the R object containing elements which class can be checked through vapply or apply.

    -
    + +
    -

    Value

    +

    Value +

    character vector of variable names.

    -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     get_supported_filter_varnames <- getFromNamespace("get_supported_filter_varnames", "teal.slice")
     
    @@ -87,17 +135,19 @@ 

    Examples

    + +
    - + + - + + diff --git a/main/reference/include_css_files.html b/main/reference/include_css_files.html index e62d1dacf..367eaa5b0 100644 --- a/main/reference/include_css_files.html +++ b/main/reference/include_css_files.html @@ -1,9 +1,25 @@ - -Include CSS files from /inst/css/ package directory to application header — include_css_files • teal.slice + + + + + +Include CSS files from /inst/css/ package directory to application header — include_css_files • teal.slice + + + + + + + +as needed. Thus, we do not export this method."> + + + + Skip to contents @@ -19,24 +35,49 @@ + + @@ -56,35 +97,43 @@

    Include CSS files from /inst/css/ package director
    -

    Usage

    +

    Usage +

    include_css_files(pattern = "*")
    -

    Arguments

    +

    Arguments +

    -
    pattern
    +
    +
    pattern +

    (character) pattern of files to be included

    -
    + +
    -

    Value

    +

    Value +

    HTML code that includes CSS files

    + + - + + - + + diff --git a/main/reference/include_js_files.html b/main/reference/include_js_files.html index 23db3c212..569376abc 100644 --- a/main/reference/include_js_files.html +++ b/main/reference/include_js_files.html @@ -1,9 +1,25 @@ - -Include JS files from /inst/js/ package directory to application header — include_js_files • teal.slice + + + + + +Include JS files from /inst/js/ package directory to application header — include_js_files • teal.slice + + + + + + + +as needed. Thus, we do not export this method."> + + + + Skip to contents @@ -19,24 +35,49 @@ + + @@ -56,35 +97,43 @@

    Include JS files from /inst/js/ package directory
    -

    Usage

    +

    Usage +

    include_js_files(pattern)
    -

    Arguments

    +

    Arguments +

    -
    pattern
    +
    +
    pattern +

    (character) pattern of files to be included, passed to system.file

    -
    + +
    -

    Value

    +

    Value +

    HTML code that includes JS files

    + + - + + - + + diff --git a/main/reference/index.html b/main/reference/index.html index 5278969ab..df33bfd86 100644 --- a/main/reference/index.html +++ b/main/reference/index.html @@ -1,5 +1,19 @@ - -Package index • teal.slice + + + + + + +Package index • teal.slice + + + + + + + + + Skip to contents @@ -15,24 +29,49 @@ + + @@ -44,106 +83,139 @@

    Package index

    -

    teal filter-panel API

    +

    +teal filter-panel API +

    Functions used initialize filter-panel and to modify its states.

    -
    +
    +
    -
    +
    +
    init_filtered_data()
    -
    Initialize FilteredData
    -
    +
    Initialize FilteredData +
    +
    +
    +
    set_filter_state() get_filter_state() remove_filter_state() clear_filter_states() experimental
    Managing FilteredData states
    -
    +
    +
    +
    get_filter_expr() stable
    Gets filter expression for multiple datanames taking into account its order.
    -
    +
    +
    +
    teal_slice()
    Specify single filter
    -
    +
    +
    +
    teal_slices()
    Complete filter specification
    -
    -

    For developers

    + +
    +
    +

    For developers +

    Abstract and concrete classes used to build teal functionality.

    -
    +
    +
    -

    R6 Classes

    +

    R6 Classes +

    Abstract and concrete classes used to build teal functionality.

    -
    +
    +
    -
    +
    +
    FilteredData
    Class to encapsulate filtered datasets
    -
    +
    +
    +
    FilteredDataset
    -
    FilteredDataset R6 class
    -
    +
    +FilteredDataset R6 class
    +
    +
    +
    FilterPanelAPI
    Class to encapsulate the API of the filter panel of a teal app
    -
    +
    +
    +
    DataframeFilteredDataset
    The DataframeFilteredDataset R6 class
    -
    +
    +
    +
    MAEFilteredDataset
    -
    MAEFilteredDataset R6 class
    -
    +
    +MAEFilteredDataset R6 class
    + + + + - + + - + + diff --git a/main/reference/init_filter_state.html b/main/reference/init_filter_state.html index f6beb58d0..bbe3d1d30 100644 --- a/main/reference/init_filter_state.html +++ b/main/reference/init_filter_state.html @@ -1,5 +1,21 @@ - -Initialize FilterState — init_filter_state • teal.slice + + + + + + +Initialize FilterState — init_filter_state • teal.slice + + + + + + + + + + + Skip to contents @@ -15,24 +31,49 @@ + + @@ -40,7 +81,8 @@
    @@ -50,7 +92,8 @@

    Initialize FilterState

    -

    Usage

    +

    Usage +

    init_filter_state(
       x,
       x_reactive = reactive(NULL),
    @@ -60,15 +103,19 @@ 

    Usage

    -

    Arguments

    +

    Arguments +

    -
    x
    +
    +
    x +

    (vector) variable to be filtered.

    -
    x_reactive
    +
    x_reactive +

    (reactive) returning vector of the same type as x. Is used to update counts following the change in values of the filtered dataset. @@ -76,7 +123,8 @@

    Argumentsslice +
    slice +

    (teal_slice) specification of this filter state. teal_slice is stored in the object and set_state directly manipulates values within teal_slice. @@ -85,21 +133,29 @@

    Argumentsextract_type -

    (character) -specifying whether condition calls should be prefixed by dataname. Possible values:

    • character(0) (default) varname in the condition call will not be prefixed

    • +
      extract_type +
      +
      +

      (character) +specifying whether condition calls should be prefixed by dataname. Possible values:

      +
        +
      • character(0) (default) varname in the condition call will not be prefixed

      • "list" varname in the condition call will be returned as <dataname>$<varname>

      • "matrix" varname in the condition call will be returned as <dataname>[, <varname>]

      • -
      +
    +
    -

    + +
    -

    Value

    +

    Value +

    FilterState object

    -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     init_filter_state <- getFromNamespace("init_filter_state", "teal.slice")
     
    @@ -139,17 +195,19 @@ 

    Examples

    + +
    - + + - + + diff --git a/main/reference/init_filter_state_expr.html b/main/reference/init_filter_state_expr.html index 51793c2a7..d2ffa4f1f 100644 --- a/main/reference/init_filter_state_expr.html +++ b/main/reference/init_filter_state_expr.html @@ -1,5 +1,21 @@ - -Initialize a FilterStateExpr object — init_filter_state_expr • teal.slice + + + + + + +Initialize a FilterStateExpr object — init_filter_state_expr • teal.slice + + + + + + + + + + + Skip to contents @@ -15,24 +31,49 @@ + + @@ -50,36 +91,44 @@

    Initialize a FilterStateExpr object

    -

    Usage

    +

    Usage +

    init_filter_state_expr(slice)
    -

    Arguments

    +

    Arguments +

    -
    slice
    +
    +
    slice +

    (teal_slice_expr) specifying this filter state.

    -
    + +
    -

    Value

    +

    Value +

    FilterStateExpr object

    + + - + + - + + diff --git a/main/reference/init_filter_states.html b/main/reference/init_filter_states.html index 370f762dd..c7443fb91 100644 --- a/main/reference/init_filter_states.html +++ b/main/reference/init_filter_states.html @@ -1,5 +1,21 @@ - -Initialize FilterStates object — init_filter_states • teal.slice + + + + + + +Initialize FilterStates object — init_filter_states • teal.slice + + + + + + + + + + + Skip to contents @@ -15,24 +31,49 @@ + + @@ -50,7 +91,8 @@

    Initialize FilterStates object

    -

    Usage

    +

    Usage +

    init_filter_states(
       data,
       data_reactive = reactive(NULL),
    @@ -61,15 +103,19 @@ 

    Usage

    -

    Arguments

    +

    Arguments +

    -
    data
    +
    +
    data +

    (data.frame or MultiAssayExperiment or SummarizedExperiment or matrix) object to subset.

    -
    data_reactive
    +
    data_reactive +

    (function(sid)) should return an object of the same type as data or NULL. This function is needed for the FilterState shiny module to update counts if filtered data changes. @@ -77,29 +123,35 @@

    Argumentsdataname +
    dataname +

    (character(1)) name of the data used in the subset expression, passed to the function argument attached to this FilterStates.

    -
    datalabel
    +
    datalabel +

    (character(1)) optional text label.

    -
    ...
    +
    ... +

    optional, additional arguments for specific classes: keys.

    -

    + +
    -

    Value

    +

    Value +

    Object of class FilterStates.

    -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     init_filter_states <- getFromNamespace("init_filter_states", "teal.slice")
     
    @@ -138,17 +190,19 @@ 

    Examples

    + +
    - + + - + + diff --git a/main/reference/init_filtered_data.html b/main/reference/init_filtered_data.html index be8d800c5..98fd63bf1 100644 --- a/main/reference/init_filtered_data.html +++ b/main/reference/init_filtered_data.html @@ -1,5 +1,21 @@ - -Initialize FilteredData — init_filtered_data • teal.slice + + + + + + +Initialize FilteredData — init_filtered_data • teal.slice + + + + + + + + + + + Skip to contents @@ -15,24 +31,49 @@ + + @@ -40,7 +81,8 @@
    @@ -50,37 +92,47 @@

    Initialize FilteredData

    -

    Usage

    +

    Usage +

    init_filtered_data(x, join_keys = teal.data::join_keys(), code, check)
    -

    Arguments

    +

    Arguments +

    -
    x
    +
    +
    x +

    (named list) of datasets.

    -
    join_keys
    +
    join_keys +

    (join_keys) see teal.data::join_keys().

    -
    code
    +
    code +

    [Deprecated]

    -
    check
    +
    check +

    [Deprecated]

    -
    + +
    -

    Value

    +

    Value +

    Object of class FilteredData.

    -

    Examples

    +

    Examples +

    datasets <- init_filtered_data(list(iris = iris, mtcars = mtcars))
     datasets
     #> FilteredData:
    @@ -99,17 +151,19 @@ 

    Examples

    + +
    - + + - + + diff --git a/main/reference/init_filtered_dataset.html b/main/reference/init_filtered_dataset.html index 78902f7f9..bda77e107 100644 --- a/main/reference/init_filtered_dataset.html +++ b/main/reference/init_filtered_dataset.html @@ -1,5 +1,21 @@ - -Initialize FilteredDataset — init_filtered_dataset • teal.slice + + + + + + +Initialize FilteredDataset — init_filtered_dataset • teal.slice + + + + + + + + + + + Skip to contents @@ -15,24 +31,49 @@ + + @@ -40,7 +81,8 @@
    @@ -50,7 +92,8 @@

    Initialize FilteredDataset

    -

    Usage

    +

    Usage +

    init_filtered_dataset(
       dataset,
       dataname,
    @@ -63,52 +106,64 @@ 

    Usage

    -

    Arguments

    +

    Arguments +

    -
    dataset
    +
    +
    dataset +

    any object

    -
    dataname
    +
    dataname +

    (character(1)) syntactically valid name given to the dataset.

    -
    keys
    +
    keys +

    (character) optional vector of primary key column names.

    -
    parent_name
    +
    parent_name +

    (character(1)) name of the parent dataset.

    -
    parent
    +
    parent +

    (reactive) that returns a filtered data.frame from other FilteredDataset named parent_name. Passing parent results in a reactive link that causes re-filtering of this dataset based on the changes in parent.

    -
    join_keys
    +
    join_keys +

    (character) vector of names of columns in this dataset to join with parent dataset. If column names in the parent do not match these, they should be given as the names of this vector.

    -
    label
    +
    label +

    (character(1)) label to describe the dataset.

    -
    + +
    -

    Value

    +

    Value +

    Object of class FilteredDataset.

    -

    Warning

    +

    Warning +

    This function is exported to allow other packages to extend teal.slice but it is treated as internal. @@ -117,7 +172,8 @@

    Warning
    -

    Examples

    +

    Examples +

    # DataframeFilteredDataset example
     library(shiny)
     
    @@ -173,17 +229,19 @@ 

    Examples

    + +

    - + + - + + diff --git a/main/reference/jsonify.html b/main/reference/jsonify.html index 66db0b009..f686fbe2b 100644 --- a/main/reference/jsonify.html +++ b/main/reference/jsonify.html @@ -1,9 +1,25 @@ - -Convert a list to a justified JSON string — jsonify • teal.slice + + + + + +Convert a list to a justified JSON string — jsonify • teal.slice + + + + + + + +and trimmed to easier fit in the console when printing."> + + + + Skip to contents @@ -19,24 +35,49 @@ + + @@ -56,39 +97,48 @@

    Convert a list to a justified JSON string

    -

    Usage

    +

    Usage +

    jsonify(x, trim_lines)
    -

    Arguments

    +

    Arguments +

    -
    x
    +
    +
    x +

    (list), possibly recursive, obtained from teal_slice or teal_slices.

    -
    trim_lines
    +
    trim_lines +

    (logical(1)) flag specifying whether to trim lines of the JSON string.

    -
    + +
    -

    Value

    +

    Value +

    A JSON string representation of the input list.

    + + - + + - + + diff --git a/main/reference/justify_json.html b/main/reference/justify_json.html index 89a68d736..faef4b550 100644 --- a/main/reference/justify_json.html +++ b/main/reference/justify_json.html @@ -1,7 +1,23 @@ - -Justify colons in JSON string — justify_json • teal.slice + + + + + + +Justify colons in JSON string — justify_json • teal.slice + + + + + + + + + + + Skip to contents @@ -17,24 +33,49 @@ + + @@ -53,35 +94,43 @@

    Justify colons in JSON string

    -

    Usage

    +

    Usage +

    justify_json(json)
    -

    Arguments

    +

    Arguments +

    -
    json
    +
    +
    json +

    (character(1)) a JSON string.

    -
    + +
    -

    Value

    +

    Value +

    A list of character strings, which can be collapsed into a JSON string.

    + + - + + - + + diff --git a/main/reference/make_c_call.html b/main/reference/make_c_call.html index 36b11f910..494d0f6ba 100644 --- a/main/reference/make_c_call.html +++ b/main/reference/make_c_call.html @@ -1,7 +1,23 @@ - -Build concatenating call — make_c_call • teal.slice + + + + + + +Build concatenating call — make_c_call • teal.slice + + + + + + + + + + + Skip to contents @@ -17,24 +33,49 @@ + + @@ -53,25 +94,32 @@

    Build concatenating call

    -

    Usage

    +

    Usage +

    make_c_call(choices)
    -

    Arguments

    +

    Arguments +

    -
    choices
    +
    +
    choices +

    A vector of values.

    -
    + +
    -

    Value

    +

    Value +

    A c call.

    -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     make_c_call <- getFromNamespace("make_c_call", "teal.slice")
     make_c_call(1:3)
    @@ -82,17 +130,19 @@ 

    Examples

    + +
    - + + - + + diff --git a/main/reference/make_count_text.html b/main/reference/make_count_text.html index 40ce0e892..ea1b75460 100644 --- a/main/reference/make_count_text.html +++ b/main/reference/make_count_text.html @@ -1,13 +1,29 @@ - -Build count text — make_count_text • teal.slice + + + + + +Build count text — make_count_text • teal.slice + + + + + + + +"> + + + + Skip to contents @@ -23,24 +39,49 @@ + + @@ -54,48 +95,61 @@

    Build count text

    -

    Returns a text label describing filtered counts. The text is composed in the following way:

    • when countnow is not NULL: <label> (<countnow>/<countmax>)

    • +

      Returns a text label describing filtered counts. The text is composed in the following way:

      +
        +
      • when countnow is not NULL: <label> (<countnow>/<countmax>)

      • when countnow is NULL: <label> (<countmax>)

      • -
    + +
    -

    Usage

    +

    Usage +

    make_count_text(label, countmax, countnow = NULL)
    -

    Arguments

    +

    Arguments +

    -
    label
    +
    +
    label +

    (character(1)) Text displayed before counts.

    -
    countmax
    +
    countmax +

    (numeric(1)) Number of unfiltered counts.

    -
    countnow
    +
    countnow +

    (numeric(1)) Number of filtered counts.

    -
    + +
    -

    Value

    +

    Value +

    A character string.

    + + - + + - + + diff --git a/main/reference/pair_counts.html b/main/reference/pair_counts.html index e50a2edc4..68ccb1a3d 100644 --- a/main/reference/pair_counts.html +++ b/main/reference/pair_counts.html @@ -1,5 +1,21 @@ - -Adjust counts to match choices — pair_counts • teal.slice + + + + + + +Adjust counts to match choices — pair_counts • teal.slice + + + + + + + + + + + Skip to contents @@ -15,24 +31,49 @@ + + @@ -50,35 +91,43 @@

    Adjust counts to match choices

    -

    Usage

    +

    Usage +

    pair_counts(choices, counts)
    -

    Arguments

    +

    Arguments +

    -
    choices
    +
    +
    choices +

    (character) Choices to match.

    -
    counts
    +
    counts +

    (named numeric) Counts to adjust.

    -
    + + + + - + + - + + diff --git a/main/reference/sanitize_id.html b/main/reference/sanitize_id.html index cdf797b37..a3ae379f5 100644 --- a/main/reference/sanitize_id.html +++ b/main/reference/sanitize_id.html @@ -1,13 +1,29 @@ - -Encodes ids to be used in JavaScript and Shiny — sanitize_id • teal.slice + +resulting id.'> + + + + Skip to contents @@ -23,24 +39,49 @@ + + @@ -62,35 +103,43 @@

    Encodes ids to be used in JavaScript and Shiny

    -

    Usage

    +

    Usage +

    sanitize_id(id)
    -

    Arguments

    +

    Arguments +

    -
    id
    +
    +
    id +

    (character(1)) The id string.

    -
    + +
    -

    Value

    +

    Value +

    Sanitized string that removes special characters and spaces.

    + + - + + - + + diff --git a/main/reference/setdiff_teal_slices.html b/main/reference/setdiff_teal_slices.html index 66f3d884c..ba08554c0 100644 --- a/main/reference/setdiff_teal_slices.html +++ b/main/reference/setdiff_teal_slices.html @@ -1,5 +1,21 @@ - -setdiff method for teal_slices — setdiff_teal_slices • teal.slice + + + + + + +setdiff method for teal_slices — setdiff_teal_slices • teal.slice + + + + + + + + + + + Skip to contents @@ -15,24 +31,49 @@ + + @@ -40,7 +81,9 @@
    @@ -50,35 +93,43 @@

    setdiff method for teal_slices

    -

    Usage

    +

    Usage +

    setdiff_teal_slices(x, y)
    -

    Arguments

    +

    Arguments +

    -
    x, y
    +
    +
    x, y +

    (teal_slices)

    -
    + +
    -

    Value

    +

    Value +

    teal_slices

    + + - + + - + + diff --git a/main/reference/teal.slice-package.html b/main/reference/teal.slice-package.html index 360328ce2..4ab8e8eda 100644 --- a/main/reference/teal.slice-package.html +++ b/main/reference/teal.slice-package.html @@ -1,5 +1,21 @@ - -teal.slice: Interactive Exploration of Clinical Trials Data — teal.slice-package • teal.slice + + + + + + +teal.slice: Interactive Exploration of Clinical Trials Data — teal.slice-package • teal.slice + + + + + + + + + + + Skip to contents @@ -15,24 +31,49 @@ + + @@ -40,7 +81,8 @@
    @@ -51,16 +93,24 @@

    teal.slice: Interactive Exploration of Clinical Trials Data

    -

    See also

    -
    -

    Author

    +

    Author +

    Maintainer: Dawid Kaledkowski dawid.kaledkowski@roche.com (ORCID)

    -

    Authors:

    + + + + - + + - + + diff --git a/main/reference/teal_slice-utilities.html b/main/reference/teal_slice-utilities.html index 45be5e44c..d71701054 100644 --- a/main/reference/teal_slice-utilities.html +++ b/main/reference/teal_slice-utilities.html @@ -1,5 +1,21 @@ - -teal_slice utility functions — teal_slice-utilities • teal.slice + + + + + + +teal_slice utility functions — teal_slice-utilities • teal.slice + + + + + + + + + + + Skip to contents @@ -15,24 +31,49 @@ + + @@ -40,7 +81,8 @@
    @@ -50,7 +92,8 @@

    teal_slice utility functions

    -

    Usage

    +

    Usage +

    is.teal_slice(x)
     
     as.teal_slice(x)
    @@ -66,29 +109,37 @@ 

    Usage

    -

    Arguments

    +

    Arguments +

    -
    x
    +
    +
    x +

    (teal.slice)

    -
    ...
    +
    ... +

    additional arguments passed to other functions.

    -
    show_all
    +
    show_all +

    (logical(1)) indicating whether to show all fields. If set to FALSE, only non-NULL elements will be printed.

    -
    trim_lines
    +
    trim_lines +

    (logical(1)) indicating whether to trim lines when printing.

    -
    + +
    -

    Examples

    +

    Examples +

    x1 <- teal_slice(
       dataname = "data",
       id = "Female adults",
    @@ -165,17 +216,19 @@ 

    Examples

    + +
    - + + - + + diff --git a/main/reference/teal_slice.html b/main/reference/teal_slice.html index fccf1a8ba..376cabb05 100644 --- a/main/reference/teal_slice.html +++ b/main/reference/teal_slice.html @@ -1,7 +1,23 @@ - -Specify single filter — teal_slice • teal.slice + + + + + + +Specify single filter — teal_slice • teal.slice + + + + + + + + + + + Skip to contents @@ -17,24 +33,49 @@ + + @@ -53,7 +94,8 @@

    Specify single filter

    -

    Usage

    +

    Usage +

    teal_slice(
       dataname,
       varname,
    @@ -72,76 +114,94 @@ 

    Usage

    -

    Arguments

    +

    Arguments +

    -
    dataname
    +
    +
    dataname +

    (character(1)) name of data set

    -
    varname
    +
    varname +

    (character(1)) name of variable

    -
    id
    +
    id +

    (character(1)) identifier of the filter. Must be specified when expr is set. When varname is specified then id is set to "{dataname} {varname}" by default.

    -
    expr
    +
    expr +

    (character(1)) string providing a logical expression. Must be a valid R expression which can be evaluated in the context of the data set. For a data.frame var == "x" is sufficient, but MultiAssayExperiment::subsetByColData requires dataname prefix, e.g. data$var == "x".

    -
    choices
    +
    choices +

    (vector) optional, specifies allowed choices; When specified it should be a subset of values in variable denoted by varname; Type and size depends on variable type. Factors are coerced to character.

    -
    selected
    +
    selected +

    (vector) optional, specifies selected values from choices; Type and size depends on variable type. Factors are coerced to character.

    -
    keep_na
    +
    keep_na +

    (logical(1)) optional flag specifying whether to keep missing values

    -
    keep_inf
    +
    keep_inf +

    (logical(1)) optional flag specifying whether to keep infinite values

    -
    fixed
    +
    fixed +

    (logical(1)) flag specifying whether to fix this filter state (forbid setting state)

    -
    anchored
    +
    anchored +

    (logical(1)) flag specifying whether to lock this filter state (forbid removing and inactivating)

    -
    multiple
    +
    multiple +

    (logical(1)) optional flag specifying whether more than one value can be selected; only applicable to ChoicesFilterState and LogicalFilterState

    -
    title
    +
    title +

    (character(1)) optional title of the filter. Ignored when varname is set.

    -
    ...
    +
    ... +

    additional arguments which can be handled by extensions of teal.slice classes.

    -
    + +
    -

    Value

    +

    Value +

    A teal.slice object. Depending on whether varname or expr was specified, the resulting teal_slice also receives class teal_slice_var or teal_slice_expr, respectively.

    -

    Details

    +

    Details +

    teal_slice object fully describes filter state and can be used to create, modify, and delete a filter state. A teal_slice contains a number of common fields (all named arguments of teal_slice), some of which are mandatory, but only @@ -150,7 +210,9 @@

    DetailsSetting any of the other values to NULL means that those properties will not be modified (when setting an existing state) or that they will be determined by data (when creating new a new one). Entire object is FilterState class member and can be accessed with FilterState$get_state().

    -

    A teal_slice can come in two flavors:

    1. teal_slice_var - +

      A teal_slice can come in two flavors:

      +
        +
      1. teal_slice_var - this describes a typical interactive filter that refers to a single variable, managed by the FilterState class. This class is created when varname is specified. The object retains all fields specified in the call. id can be created by default and need not be specified.

      2. @@ -160,7 +222,8 @@

        Detailsexpr is specified. dataname and anchored are retained, fixed is set to TRUE, id becomes mandatory, title remains optional, while other arguments are disregarded.

        -

      A teal_slice can be passed FilterState/FilterStateExpr constructors to instantiate an object. +

    +

    A teal_slice can be passed FilterState/FilterStateExpr constructors to instantiate an object. It can also be passed to FilterState$set_state to modify the state. However, once a FilterState is created, only the mutable features can be set with a teal_slice: selected, keep_na and keep_inf.

    @@ -172,11 +235,13 @@

    DetailsFilterState instantiated with anchored = TRUE cannot be removed.

    -

    Note

    +

    Note +

    Date time objects of POSIX*t classes are printed as strings after converting to UTC timezone.

    -

    Filters in SumarizedExperiment and MultiAssayExperiment objects

    +

    Filters in SumarizedExperiment and MultiAssayExperiment objects +

    @@ -190,13 +255,15 @@

    Filters in order to determine whether the filter refers to the SE's rowData or colData.

    -

    Examples

    +

    Examples +

    x1 <- teal_slice(
       dataname = "data",
       id = "Female adults",
    @@ -273,17 +340,19 @@ 

    Examples

    + +
    - + + - + + diff --git a/main/reference/teal_slices-utilities.html b/main/reference/teal_slices-utilities.html index 503ba8856..d1a8928e8 100644 --- a/main/reference/teal_slices-utilities.html +++ b/main/reference/teal_slices-utilities.html @@ -1,5 +1,21 @@ - -teal_slices utility functions — teal_slices-utilities • teal.slice + + + + + + +teal_slices utility functions — teal_slices-utilities • teal.slice + + + + + + + + + + + Skip to contents @@ -15,24 +31,49 @@ + + @@ -40,7 +81,8 @@
    @@ -50,7 +92,8 @@

    teal_slices utility functions

    -

    Usage

    +

    Usage +

    is.teal_slices(x)
     
     as.teal_slices(x)
    @@ -72,36 +115,46 @@ 

    Usage

    -

    Arguments

    +

    Arguments +

    -
    x
    +
    +
    x +

    object to test for teal_slices, object to convert to teal_slices or a teal_slices object

    -
    recursive
    +
    recursive +

    (logical(1)) flag specifying whether to also convert to list the elements of this teal_slices

    -
    ...
    +
    ... +

    additional arguments passed to other functions.

    -
    i
    +
    i +

    (character or numeric or logical) indicating which elements to extract

    -
    show_all
    +
    show_all +

    (logical(1)) whether to display non-null elements of constituent teal_slice objects

    -
    trim_lines
    +
    trim_lines +

    (logical(1)) whether to trim lines

    -
    + +
    -

    Examples

    +

    Examples +

    filter_1 <- teal_slice(
       dataname = "dataname1",
       varname = "varname1",
    @@ -314,17 +367,19 @@ 

    Examples

    + +
    - + + - + + diff --git a/main/reference/teal_slices.html b/main/reference/teal_slices.html index 15dc9b05c..7e54d65ff 100644 --- a/main/reference/teal_slices.html +++ b/main/reference/teal_slices.html @@ -1,7 +1,23 @@ - -Complete filter specification — teal_slices • teal.slice + + + + + + +Complete filter specification — teal_slices • teal.slice + + + + + + + + + + + Skip to contents @@ -17,24 +33,49 @@ + + @@ -53,7 +94,8 @@

    Complete filter specification

    -

    Usage

    +

    Usage +

    teal_slices(
       ...,
       exclude_varnames = NULL,
    @@ -64,41 +106,54 @@ 

    Usage

    -

    Arguments

    +

    Arguments +

    -
    ...
    +
    +
    ... +

    any number of teal_slice objects.

    -
    include_varnames, exclude_varnames
    +
    include_varnames, exclude_varnames +

    (named lists of character) where list names match names of data sets and vector elements match variable names in respective data sets; specify which variables are allowed to be filtered; see Details.

    -
    count_type
    -

    [Experimental] +

    count_type +
    +
    +

    [Experimental] This is a new feature. Do kindly share your opinions on teal.slice's GitHub repository.

    (character(1)) string specifying how observations are tallied by these filter states. -Possible options:

    • "none" (default) to have counts of single FilterState to show unfiltered number only.

    • +Possible options:

      +
        +
      • "none" (default) to have counts of single FilterState to show unfiltered number only.

      • "all" to have counts of single FilterState to show number of observation in filtered and unfiltered dataset. Note, that issues were reported when using this option with MultiAssayExperiment. Please make sure that adding new filters doesn't fail on target platform before deploying for production.

      • -
    + + -
    allow_add
    +
    allow_add +

    (logical(1)) logical flag specifying whether the user will be able to add new filters

    -
    + +
    -

    Value

    +

    Value +

    teal_slices, which is an unnamed list of teal_slice objects.

    -

    Details

    +

    Details +

    teal_slices() collates multiple teal_slice objects into a teal_slices object, a complete filter specification. This is used by all classes above FilterState as well as filter_panel_api wrapper functions. @@ -109,17 +164,21 @@

    Detailsteal_slices.

    -

    See also

    +

    See also +

    -
    + +
    -

    Examples

    +

    Examples +

    filter_1 <- teal_slice(
       dataname = "dataname1",
       varname = "varname1",
    @@ -332,17 +391,19 @@ 

    Examples

    + +
    - + + - + + diff --git a/main/reference/to_json.html b/main/reference/to_json.html index f21406317..2bbbeaa4c 100644 --- a/main/reference/to_json.html +++ b/main/reference/to_json.html @@ -1,9 +1,25 @@ - -Converts a list to a JSON string — to_json • teal.slice + + + + + +Converts a list to a JSON string — to_json • teal.slice + + + + + + + +This function is used by the format methods for teal_slice and teal_slices."> + + + + Skip to contents @@ -19,24 +35,49 @@ + + @@ -56,35 +97,43 @@

    Converts a list to a JSON string

    -

    Usage

    +

    Usage +

    to_json(x)
    -

    Arguments

    +

    Arguments +

    -
    x
    +
    +
    x +

    (list) representation of teal_slices object.

    -
    + +
    -

    Value

    +

    Value +

    A JSON string.

    + + - + + - + + diff --git a/main/reference/toggle_button.html b/main/reference/toggle_button.html index 8add391f8..1356cbc95 100644 --- a/main/reference/toggle_button.html +++ b/main/reference/toggle_button.html @@ -1,5 +1,21 @@ - -Toggle button properties. — toggle_button • teal.slice + + + + + + +Toggle button properties. — toggle_button • teal.slice + + + + + + + + + + + Skip to contents @@ -15,24 +31,49 @@ + + @@ -50,36 +91,45 @@

    Toggle button properties.

    -

    Usage

    +

    Usage +

    toggle_icon(input_id, icons, one_way = FALSE)
     
     toggle_title(input_id, titles, one_way = FALSE)
    -

    Arguments

    +

    Arguments +

    -
    input_id
    +
    +
    input_id +

    (character(1)) (name-spaced) id of the button

    -
    icons, titles
    +
    icons, titles +

    (character(2)) vector specifying values between which to toggle

    -
    one_way
    +
    one_way +

    (logical(1)) flag specifying whether to keep toggling; if TRUE, the target will be changed from the first element of icons/titles to the second

    -
    + +
    -

    Value

    +

    Value +

    NULL, invisibly.

    -

    Details

    +

    Details +

    Wrapper functions that use shinyjs::runjs to change button properties in response to events, typically clicking those very buttons. shiny's actionButton and actionLink create <a> tags, @@ -90,7 +140,8 @@

    Details
    -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     toggle_icon <- getFromNamespace("toggle_icon", "teal.slice")
     
    @@ -145,17 +196,19 @@ 

    Examples

    + +

    - + + - + + diff --git a/main/reference/topological_sort.html b/main/reference/topological_sort.html index 13937c3d9..ffd1b6bb6 100644 --- a/main/reference/topological_sort.html +++ b/main/reference/topological_sort.html @@ -1,7 +1,23 @@ - -Topological graph sort — topological_sort • teal.slice + + + + + + +Topological graph sort — topological_sort • teal.slice + + + + + + + + + + + Skip to contents @@ -17,24 +33,49 @@ + + @@ -53,25 +94,32 @@

    Topological graph sort

    -

    Usage

    +

    Usage +

    topological_sort(graph)
    -

    Arguments

    +

    Arguments +

    -
    graph
    +
    +
    graph +

    (named list) with node vector elements

    -
    + +
    -

    Details

    +

    Details +

    Implementation of Kahn algorithm with a modification to maintain the order of input elements.

    -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     topological_sort <- getFromNamespace("topological_sort", "teal.slice")
     
    @@ -117,17 +165,19 @@ 

    Examples

    + +
    - + + - + + diff --git a/main/reference/trim_lines_json.html b/main/reference/trim_lines_json.html index d6be725e4..f1b8ed581 100644 --- a/main/reference/trim_lines_json.html +++ b/main/reference/trim_lines_json.html @@ -1,7 +1,23 @@ - -Trim lines in JSON string — trim_lines_json • teal.slice + + + + + + +Trim lines in JSON string — trim_lines_json • teal.slice + + + + + + + + + + + Skip to contents @@ -17,24 +33,49 @@ + + @@ -53,35 +94,43 @@

    Trim lines in JSON string

    -

    Usage

    +

    Usage +

    trim_lines_json(x)
    -

    Arguments

    +

    Arguments +

    -
    x
    +
    +
    x +

    (character)

    -
    + +
    -

    Value

    +

    Value +

    A character string trimmed after a certain hard-coded number of characters in the value portion.

    + + - + + - + + diff --git a/main/reference/variable_types.html b/main/reference/variable_types.html index e12668b04..df8ba6969 100644 --- a/main/reference/variable_types.html +++ b/main/reference/variable_types.html @@ -1,5 +1,21 @@ - -Get classes of selected columns from dataset — variable_types • teal.slice + + + + + + +Get classes of selected columns from dataset — variable_types • teal.slice + + + + + + + + + + + Skip to contents @@ -15,24 +31,49 @@ + + @@ -50,30 +91,38 @@

    Get classes of selected columns from dataset

    -

    Usage

    +

    Usage +

    variable_types(data, columns = NULL)
    -

    Arguments

    +

    Arguments +

    -
    data
    +
    +
    data +

    (data.frame or DataFrame or matrix) Object in which to determine variable types.

    -
    columns
    +
    columns +

    (character) Vector of columns in data for which to get types. Set to NULL to get types of all columns.

    -
    + +
    -

    Value

    +

    Value +

    Character vector of classes of columns from provided data.

    -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     variable_types <- getFromNamespace("variable_types", "teal.slice")
     
    @@ -109,17 +158,19 @@ 

    Examples

    + +
    - + + - + + diff --git a/main/search.json b/main/search.json index a380c43d8..b010967fe 100644 --- a/main/search.json +++ b/main/search.json @@ -1 +1 @@ -[{"path":[]},{"path":"https://insightsengineering.github.io/teal.slice/CODE_OF_CONDUCT.html","id":"our-pledge","dir":"","previous_headings":"","what":"Our Pledge","title":"Contributor Covenant Code of Conduct","text":"members, contributors, leaders pledge make participation community harassment-free experience everyone, regardless age, body size, visible invisible disability, ethnicity, sex characteristics, gender identity expression, level experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, sexual identity orientation. pledge act interact ways contribute open, welcoming, diverse, inclusive, healthy community.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/CODE_OF_CONDUCT.html","id":"our-standards","dir":"","previous_headings":"","what":"Our Standards","title":"Contributor Covenant Code of Conduct","text":"Examples behavior contributes positive environment community include: Demonstrating empathy kindness toward people respectful differing opinions, viewpoints, experiences Giving gracefully accepting constructive feedback Accepting responsibility apologizing affected mistakes, learning experience Focusing best just us individuals, overall community Examples unacceptable behavior include: use sexualized language imagery, sexual attention advances kind Trolling, insulting derogatory comments, personal political attacks Public private harassment Publishing others’ private information, physical email address, without explicit permission conduct reasonably considered inappropriate professional setting","code":""},{"path":"https://insightsengineering.github.io/teal.slice/CODE_OF_CONDUCT.html","id":"enforcement-responsibilities","dir":"","previous_headings":"","what":"Enforcement Responsibilities","title":"Contributor Covenant Code of Conduct","text":"Community leaders responsible clarifying enforcing standards acceptable behavior take appropriate fair corrective action response behavior deem inappropriate, threatening, offensive, harmful. Community leaders right responsibility remove, edit, reject comments, commits, code, wiki edits, issues, contributions aligned Code Conduct, communicate reasons moderation decisions appropriate.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/CODE_OF_CONDUCT.html","id":"scope","dir":"","previous_headings":"","what":"Scope","title":"Contributor Covenant Code of Conduct","text":"Code Conduct applies within community spaces, also applies individual officially representing community public spaces. Examples representing community include using official e-mail address, posting via official social media account, acting appointed representative online offline event.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/CODE_OF_CONDUCT.html","id":"enforcement","dir":"","previous_headings":"","what":"Enforcement","title":"Contributor Covenant Code of Conduct","text":"Instances abusive, harassing, otherwise unacceptable behavior may reported community leaders responsible enforcement [INSERT CONTACT METHOD]. complaints reviewed investigated promptly fairly. community leaders obligated respect privacy security reporter incident.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/CODE_OF_CONDUCT.html","id":"enforcement-guidelines","dir":"","previous_headings":"","what":"Enforcement Guidelines","title":"Contributor Covenant Code of Conduct","text":"Community leaders follow Community Impact Guidelines determining consequences action deem violation Code Conduct:","code":""},{"path":"https://insightsengineering.github.io/teal.slice/CODE_OF_CONDUCT.html","id":"id_1-correction","dir":"","previous_headings":"Enforcement Guidelines","what":"1. Correction","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Use inappropriate language behavior deemed unprofessional unwelcome community. Consequence: private, written warning community leaders, providing clarity around nature violation explanation behavior inappropriate. public apology may requested.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/CODE_OF_CONDUCT.html","id":"id_2-warning","dir":"","previous_headings":"Enforcement Guidelines","what":"2. Warning","title":"Contributor Covenant Code of Conduct","text":"Community Impact: violation single incident series actions. Consequence: warning consequences continued behavior. interaction people involved, including unsolicited interaction enforcing Code Conduct, specified period time. includes avoiding interactions community spaces well external channels like social media. Violating terms may lead temporary permanent ban.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/CODE_OF_CONDUCT.html","id":"id_3-temporary-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"3. Temporary Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: serious violation community standards, including sustained inappropriate behavior. Consequence: temporary ban sort interaction public communication community specified period time. public private interaction people involved, including unsolicited interaction enforcing Code Conduct, allowed period. Violating terms may lead permanent ban.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/CODE_OF_CONDUCT.html","id":"id_4-permanent-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"4. Permanent Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Demonstrating pattern violation community standards, including sustained inappropriate behavior, harassment individual, aggression toward disparagement classes individuals. Consequence: permanent ban sort public interaction within community.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/CODE_OF_CONDUCT.html","id":"attribution","dir":"","previous_headings":"","what":"Attribution","title":"Contributor Covenant Code of Conduct","text":"Code Conduct adapted Contributor Covenant, version 2.1, available https://www.contributor-covenant.org/version/2/1/code_of_conduct.html. Community Impact Guidelines inspired Mozilla’s code conduct enforcement ladder. answers common questions code conduct, see FAQ https://www.contributor-covenant.org/faq. Translations available https://www.contributor-covenant.org/translations.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/CONTRIBUTING.html","id":null,"dir":"","previous_headings":"","what":"Contribution Guidelines","title":"Contribution Guidelines","text":"🙏 Thank taking time contribute! input deeply valued, whether issue, pull request, even feedback, regardless size, content scope.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/CONTRIBUTING.html","id":"table-of-contents","dir":"","previous_headings":"","what":"Table of contents","title":"Contribution Guidelines","text":"👶 Getting started 📔 Code Conduct 🗃 License 📜 Issues 🚩 Pull requests 💻 Coding guidelines 🏆 Recognition model ❓ Questions","code":""},{"path":"https://insightsengineering.github.io/teal.slice/CONTRIBUTING.html","id":"getting-started","dir":"","previous_headings":"","what":"Getting started","title":"Contribution Guidelines","text":"Please refer project documentation brief introduction. Please also see articles within project documentation additional information.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/CONTRIBUTING.html","id":"code-of-conduct","dir":"","previous_headings":"","what":"Code of Conduct","title":"Contribution Guidelines","text":"Code Conduct governs project. Participants contributors expected follow rules outlined therein.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/CONTRIBUTING.html","id":"license","dir":"","previous_headings":"","what":"License","title":"Contribution Guidelines","text":"contributions covered project’s license.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/CONTRIBUTING.html","id":"issues","dir":"","previous_headings":"","what":"Issues","title":"Contribution Guidelines","text":"use GitHub track issues, feature requests, bugs. submitting new issue, please check issue already reported. issue already exists, please upvote existing issue 👍. new feature requests, please elaborate context benefit feature users, developers, relevant personas.","code":""},{"path":[]},{"path":"https://insightsengineering.github.io/teal.slice/CONTRIBUTING.html","id":"github-flow","dir":"","previous_headings":"Pull requests","what":"GitHub Flow","title":"Contribution Guidelines","text":"repository uses GitHub Flow model collaboration. submit pull request: Create branch Please see branch naming convention . don’t write access repository, please fork . Make changes Make sure code passes checks imposed GitHub Actions well documented well tested unit tests sufficiently covering changes introduced Create pull request (PR) pull request description, please link relevant issue (), provide detailed description change, include assumptions. Address review comments, Post approval Merge PR write access. Otherwise, reviewer merge PR behalf. Pat back Congratulations! 🎉 now official contributor project! grateful contribution.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/CONTRIBUTING.html","id":"branch-naming-convention","dir":"","previous_headings":"Pull requests","what":"Branch naming convention","title":"Contribution Guidelines","text":"Suppose changes related current issue current project; please name branch follows: _. Please use underscore (_) delimiter word separation. example, 420_fix_ui_bug suitable branch name change resolving UI-related bug reported issue number 420 current project. change affects multiple repositories, please name branches follows: __. example, 69_awesomeproject_fix_spelling_error reference issue 69 reported project awesomeproject aims resolve one spelling errors multiple (likely related) repositories.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/CONTRIBUTING.html","id":"monorepo-and-stageddependencies","dir":"","previous_headings":"Pull requests","what":"monorepo and staged.dependencies","title":"Contribution Guidelines","text":"Sometimes might need change upstream dependent package(s) able submit meaningful change. using staged.dependencies functionality simulate monorepo behavior. dependency configuration already specified project’s staged_dependencies.yaml file. need name feature branches appropriately. exception branch naming convention described . Please refer staged.dependencies package documentation details.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/CONTRIBUTING.html","id":"coding-guidelines","dir":"","previous_headings":"","what":"Coding guidelines","title":"Contribution Guidelines","text":"repository follows unified processes standards adopted maintainers ensure software development carried consistently within teams cohesively across repositories.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/CONTRIBUTING.html","id":"style-guide","dir":"","previous_headings":"Coding guidelines","what":"Style guide","title":"Contribution Guidelines","text":"repository follows standard tidyverse style guide uses lintr lint checks. Customized lint configurations available repository’s .lintr file.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/CONTRIBUTING.html","id":"dependency-management","dir":"","previous_headings":"Coding guidelines","what":"Dependency management","title":"Contribution Guidelines","text":"Lightweight right weight. repository follows tinyverse recommendations limiting dependencies minimum.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/CONTRIBUTING.html","id":"dependency-version-management","dir":"","previous_headings":"Coding guidelines","what":"Dependency version management","title":"Contribution Guidelines","text":"code compatible (!) historical versions given dependency package, required specify minimal version DESCRIPTION file. particular: development version requires (imports) development version another package - required put abc (>= 1.2.3.9000).","code":""},{"path":[]},{"path":"https://insightsengineering.github.io/teal.slice/CONTRIBUTING.html","id":"r--package-versions","dir":"","previous_headings":"Coding guidelines > Recommended development environment & tools","what":"R & package versions","title":"Contribution Guidelines","text":"continuously test packages newest R version along recent dependencies CRAN BioConductor. recommend working environment also set way. can find details R version packages used R CMD check GitHub Action execution log - step prints R sessionInfo(). discover bugs older R versions older set dependencies, please create relevant bug reports.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/CONTRIBUTING.html","id":"pre-commit","dir":"","previous_headings":"Coding guidelines > Recommended development environment & tools","what":"pre-commit","title":"Contribution Guidelines","text":"highly recommend use pre-commit tool combined R hooks pre-commit execute checks committing pushing changes. Pre-commit hooks already available repository’s .pre-commit-config.yaml file.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/CONTRIBUTING.html","id":"recognition-model","dir":"","previous_headings":"","what":"Recognition model","title":"Contribution Guidelines","text":"mentioned previously, contributions deeply valued appreciated. contribution data available part repository insights, recognize significant contribution hence add contributor package authors list, following rules enforced: Minimum 5% lines code authored* (determined git blame query) top 5 contributors terms number commits lines added lines removed* *Excluding auto-generated code, including limited roxygen comments renv.lock files. package maintainer also reserves right adjust criteria recognize contributions.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/CONTRIBUTING.html","id":"questions","dir":"","previous_headings":"","what":"Questions","title":"Contribution Guidelines","text":"questions regarding contribution guidelines, please contact package/repository maintainer.","code":""},{"path":[]},{"path":"https://insightsengineering.github.io/teal.slice/SECURITY.html","id":"reporting-security-issues","dir":"","previous_headings":"","what":"Reporting Security Issues","title":"Security Policy","text":"believe found security vulnerability repositories organization, please report us coordinated disclosure. Please report security vulnerabilities public GitHub issues, discussions, pull requests. Instead, please send email vulnerability.management[@]roche.com. Please include much information listed can help us better understand resolve issue: type issue (e.g., buffer overflow, SQL injection, cross-site scripting) Full paths source file(s) related manifestation issue location affected source code (tag/branch/commit direct URL) special configuration required reproduce issue Step--step instructions reproduce issue Proof--concept exploit code (possible) Impact issue, including attacker might exploit issue information help us triage report quickly.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/SECURITY.html","id":"data-security-standards-dss","dir":"","previous_headings":"","what":"Data Security Standards (DSS)","title":"Security Policy","text":"Please make sure reporting issues form bug, feature, pull request, sensitive information PII, PHI, PCI completely removed text attachments, including pictures videos.","code":""},{"path":[]},{"path":"https://insightsengineering.github.io/teal.slice/articles/filter-panel-for-developers.html","id":"getting-and-setting-filter-states","dir":"Articles","previous_headings":"Filter Panel API","what":"Getting and setting filter states","title":"Filter Panel for Developers","text":"filter panel classes dedicated methods set get current filter state. methods include: get_filter_state - returns current state filters teal_slices object set_filter_state - adds modifies filters based teal_slices object remove_filter_state - removes particular filter states based teal_slices object clear_filter_states - removes filter states Setting getting filter states done teal_slices object collection teal_slice objects. Think teal_slice quantum information fully describes filter state one variable. order tell FilteredData set filter specific variable, one must call set_filter_state method teal_slices object containing teal_slice refers variable interest. remove particular FilterState object, one must call remove_filter_state method using teal_slices containing teal_slice refers respective variable. teal_slice object contains information necessary : Determine column data set apply filter expression: dataname - name data set varname - name column experiment (MultiAssayExperiment objects) - name experiment arg (SummarizedExperiment objects, e.g within MultiAssayExperiment) - name argument call subset (subset select) Express store current selection state: selected - selected values limits selected range keep_inf - determines Inf values dropped keep_na - determines NA values dropped expr - explicit logical expression Control behavior appearance FilterState object: choices - determines set values range can selected multiple (ChoiceFilterState) - allows multiple values selected fixed - forbids changing state FilterState anchored - forbids removing FilterState title - displayed title filter card addition, every teal_slice object id. impossible create FilteredData slices duplicated ids. filter states created modified set_filter_state method two consecutive calls set_filter_state passed teal_slice id, first call instantiate FilterState, second call modify . Creating teal_slices slices duplicated ids forbidden raise error.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/articles/filter-panel-for-developers.html","id":"setting-the-filter-state","dir":"Articles","previous_headings":"Filter Panel API > Getting and setting filter states","what":"1. Setting the filter state","title":"Filter Panel for Developers","text":"","code":"library(teal.slice) datasets <- init_filtered_data(list(iris = iris, mtcars = mtcars)) set_filter_state( datasets = datasets, filter = teal_slices( teal_slice(dataname = \"iris\", varname = \"Species\", selected = \"virginica\", keep_na = FALSE), teal_slice(dataname = \"mtcars\", id = \"4 cyl\", title = \"4 Cylinders\", expr = \"cyl == 4\"), teal_slice(dataname = \"mtcars\", varname = \"mpg\", selected = c(20.0, 25.0), keep_na = FALSE, keep_inf = FALSE), include_varnames = list(iris = c(\"Species\", \"Sepal.Length\")), exclude_varnames = list(mtcars = \"cyl\") ) )"},{"path":"https://insightsengineering.github.io/teal.slice/articles/filter-panel-for-developers.html","id":"updating-filter-states--works-only-in-the-shiny-reactive-context-","dir":"Articles","previous_headings":"Filter Panel API > Getting and setting filter states","what":"2. Updating filter states. *Works only in the shiny reactive context.","title":"Filter Panel for Developers","text":"","code":"set_filter_state( datasets = datasets, filter = teal_slices( teal_slice(dataname = \"mtcars\", varname = \"mpg\", selected = c(22.0, 25.0)) ) )"},{"path":"https://insightsengineering.github.io/teal.slice/articles/filter-panel-for-developers.html","id":"getting-the-filter-state","dir":"Articles","previous_headings":"Filter Panel API > Getting and setting filter states","what":"3. Getting the filter state","title":"Filter Panel for Developers","text":"","code":"get_filter_state(datasets) ## { ## \"slices\": [ ## { ## \"dataname\" : \"iris\", ## \"varname\" : \"Species\", ## \"id\" : \"iris Species\", ## \"choices\" : [\"setosa\", \"versicolor\", \"virgin... ## \"selected\" : [\"virginica\"], ## \"keep_na\" : false, ## \"fixed\" : false, ## \"anchored\" : false, ## \"multiple\" : true ## }, ## { ## \"dataname\" : \"mtcars\", ## \"id\" : \"4 cyl\", ## \"expr\" : \"cyl == 4\", ## \"fixed\" : true, ## \"anchored\" : false, ## \"title\" : \"4 Cylinders\" ## }, ## { ## \"dataname\" : \"mtcars\", ## \"varname\" : \"mpg\", ## \"id\" : \"mtcars mpg\", ## \"choices\" : [10.4, 34], ## \"selected\" : [22, 25], ## \"keep_na\" : false, ## \"keep_inf\" : false, ## \"fixed\" : false, ## \"anchored\" : false, ## \"multiple\" : true ## } ## ], ## \"attributes\": { ## \"exclude_varnames\" : { ## \"mtcars\" : \"cyl\" ## }, ## \"include_varnames\" : { ## \"iris\" : [\"Species\", \"Sepal.Length\"] ## }, ## \"count_type\" : \"none\", ## \"allow_add\" : true ## } ## }"},{"path":"https://insightsengineering.github.io/teal.slice/articles/filter-panel-for-developers.html","id":"removing-filter-states","dir":"Articles","previous_headings":"Filter Panel API > Getting and setting filter states","what":"4. Removing filter states","title":"Filter Panel for Developers","text":"","code":"remove_filter_state( datasets = datasets, filter = teal_slices( teal_slice(dataname = \"iris\", varname = \"Species\") ) )"},{"path":"https://insightsengineering.github.io/teal.slice/articles/filter-panel-for-developers.html","id":"clearing-the-filter-state","dir":"Articles","previous_headings":"Filter Panel API > Getting and setting filter states","what":"5. Clearing the filter state","title":"Filter Panel for Developers","text":"","code":"clear_filter_states(datasets)"},{"path":"https://insightsengineering.github.io/teal.slice/articles/filter-panel-for-developers.html","id":"controlling-settings-of-the-filter-panel","dir":"Articles","previous_headings":"Filter Panel API","what":"Controlling settings of the filter panel","title":"Filter Panel for Developers","text":"addition controlling individual filter states set_filter_state, one can also manage general behaviors whole filter panel. can done arguments teal_slices function: include_varnames defines columns used data sets allowed filtered . following example two columns iris two columns mtcars able filters set. exclude_varnames defines columns used data sets allowed filtered . following example variables except four available choose . count_type defines observation counts displayed filter cards allow_add determines whether “Add Filter Variables” module displayed allow user add new filters.","code":"set_filter_state( datasets, teal_slices( include_varnames = list( iris = c(\"Species\", \"Sepal.Length\"), mtcard = c(\"cyl\", \"mpg\") ) ) ) set_filter_state( datasets, teal_slices( exclude_varnames = list( iris = c(\"Species\", \"Sepal.Length\"), mtcard = c(\"cyl\", \"mpg\") ) ) )"},{"path":"https://insightsengineering.github.io/teal.slice/articles/filter-panel-for-developers.html","id":"filter-panel-as-a-module","dir":"Articles","previous_headings":"","what":"Filter panel as a module","title":"Filter Panel for Developers","text":"instructions herein can utilized build shiny app.","code":"library(shiny) # initializing FilteredData datasets <- init_filtered_data(list(iris = iris, mtcars = mtcars)) # setting initial filters set_filter_state( datasets = datasets, filter = teal_slices( teal_slice(dataname = \"iris\", varname = \"Species\", selected = \"virginica\", keep_na = FALSE), teal_slice(dataname = \"mtcars\", id = \"4 cyl\", title = \"4 Cylinders\", expr = \"cyl == 4\"), teal_slice(dataname = \"mtcars\", varname = \"mpg\", selected = c(20.0, 25.0), keep_na = FALSE, keep_inf = FALSE), include_varnames = list(iris = c(\"Species\", \"Sepal.Length\")), exclude_varnames = list(mtcars = \"cyl\"), count_type = \"all\", allow_add = TRUE ) ) ui <- fluidPage( shinyjs::useShinyjs(), fluidRow( column( width = 9, id = \"teal_primary_col\", tagList( actionButton(\"add_species_filter\", \"Set iris$Species filter\"), actionButton(\"remove_species_filter\", \"Remove iris$Species filter\"), actionButton(\"remove_all_filters\", \"Remove all filters\"), verbatimTextOutput(\"rcode\"), verbatimTextOutput(\"filter_state\") ) ), column( width = 3, id = \"teal_secondary_col\", datasets$ui_filter_panel(\"filter_panel\") ) ) ) server <- function(input, output, session) { # calling filter panel module datasets$srv_filter_panel(\"filter_panel\") # displaying actual filter states output$filter_state <- renderPrint(print(get_filter_state(datasets), trim = FALSE)) # displaying reproducible filter call output$rcode <- renderText( paste( sapply(c(\"iris\", \"mtcars\"), datasets$get_call), collapse = \"\\n\" ) ) # programmatic interaction with FilteredData observeEvent(input$add_species_filter, { set_filter_state( datasets, teal_slices( teal_slice(dataname = \"iris\", varname = \"Species\", selected = c(\"setosa\", \"versicolor\")) ) ) }) # programmatic removal of the FilterState observeEvent(input$remove_species_filter, { remove_filter_state( datasets, teal_slices( teal_slice(dataname = \"iris\", varname = \"Species\") ) ) }) observeEvent(input$remove_all_filters, clear_filter_states(datasets)) } if (interactive()) { shinyApp(ui, server) }"},{"path":"https://insightsengineering.github.io/teal.slice/articles/teal-slice-classes.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"teal.slice Classes","text":"teal.slice package composed multiple classes, whose primary purpose provide shiny module managing displaying filters. top class structure FilteredData. modules app can interact FilteredData make filter calls obtain filtered data. FilteredData object contains one FilteredDataset objects. FilteredData manages entire filter panel, FilteredDataset responsible filtering single data set. FilteredDataset contains one FilterStates objects, corresponding one data structure like data.frame, SummarizedExperiment, MultiAssayExperiment. FilterStates holds collection FilterState objects, representing single filter condition applied one variable. FilterStates can also hold FilterStateExpr objects. variation FilterStates focuses filter expression regardless underlying data. expression can refer one several variables. FilteredData, FilteredDataset, FilterStates, FilterState/FilterStateExpr R6 classes objects classes form hierarchy inheritance . FilterState/FilterStateExpr object contains one teal_slice object. teal_slice stores information necessary define filter. R6 class, innate methods behaviors produce shiny modules. sole purpose store filter information.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/articles/teal-slice-classes.html","id":"initialization","dir":"Articles","previous_headings":"","what":"Initialization","title":"teal.slice Classes","text":"part teal workflow, FilteredData, FilteredDataset, FilterStates created instantly data loaded remain unchanged. One FilteredData object initialized list objects (e.g. data.frame, MAE). FilteredDataset initialized data set. One FilterStates initialized, depending type data set. hand, FilterState initialized time new filter added. values FilterState can changed, can also removed added . key mechanism new filter panel FilterStates class. One can think FilterStates equivalent single, possibly compound, subset call made one data structure. FilterState represents logical predicate one vector, e.g SEX == \"F\", FilterStates compose predicates member FilterState objects call subsetting function, e.g. data <- subset(data, SEX == \"F\" & RACE == \"CAUCASIAN\"). case data.frame, single dplyr::filter call sufficient subset whole data set. MultiAssayExperiment hand contains patient data @colData slot multiple experiments @ExperimentList slot, objects filtered separate subsetting calls. Therefore, subclasses FilterStates exist handle different kinds data structures use different subsetting functions.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/articles/teal-slice-classes.html","id":"class-description","dir":"Articles","previous_headings":"","what":"Class Description","title":"teal.slice Classes","text":"section provides detailed description classes make filter panel structure.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/articles/teal-slice-classes.html","id":"filtereddata","dir":"Articles","previous_headings":"Class Description","what":"FilteredData","title":"teal.slice Classes","text":"FilteredData object responsible managing filter panel. sits top class structure handles shiny modules subclasses. FilteredData provides several API methods can used access reproducible subsetting calls resulting filtered data. also allows external modules manage filter states functions get_filter_state, set_filter_state, remove_filter_state, clear_filter_state.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/articles/teal-slice-classes.html","id":"filtereddataset","dir":"Articles","previous_headings":"Class Description","what":"FilteredDataset","title":"teal.slice Classes","text":"FilteredDataset class keeps unfiltered data returns filtered data based filter call derived contained FilterStates. FilteredDataset class objects initialized FilteredData, one data set. FilteredDataset contains single data object one--many FilterStates depending type object. FilteredDataset stores data set attributes, joins keys data sets, also combines executes subsetting calls taken FilterStates. following FilteredDataset child classes currently implemented: DataframeFilteredDataset data.frame. MAEFilteredDataset MultiAssayExperiment. DefaultFilteredDataset remaining (unsupported) classes - subclass different others provides filtering, purpose hold return object filtering supported.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/articles/teal-slice-classes.html","id":"filterstates","dir":"Articles","previous_headings":"Class Description","what":"FilterStates","title":"teal.slice Classes","text":"app starts, FilteredDataset initializes one FilterStates objects, one component underlying data set. Every FilterStates object responsible making one subset call. example, MAEFilteredDataset create one FilterStates colData one FilterStates experiments. Every FilterStates return separate subsetting call, used subset entire MultiAssayExperiment. following FilteredStates child classes currently implemented: DFFilterStates data.frame; uses dplyr::filter filter columns. MAEFilterStates forMultiAssayExperiment; uses MultiAssayExperiment::subsetByColData filter columns DataFrame @colData slot. SEFilterStates SummarizedExperiment; uses subset method SummarizedExperiment filter columns DataFrames @colData @rowData slots. MatrixFilterStates matrix; uses [ operator filter columns. FilterStates serves two shiny-related purposes: ui/srv_add allows adding FilterState selected variable. variables included module filterable column names provided data set. Selecting variable adds FilterState reactiveVal stored private$state_list private field. subtype created FilterState automatically determined based class selected column. ui/srv_active displays cards currently existing FilterState objects. Every FilterState object serves remove button FilterStates reacts clicking button removing respective FilterState private$state_list destroying observers. ui/srv_active also contains remove button removes FilterState objects within FilterStates.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/articles/teal-slice-classes.html","id":"filterstate","dir":"Articles","previous_headings":"Class Description","what":"FilterState","title":"teal.slice Classes","text":"class controls single filter card returns condition call depends selection state. FilterState initialized time FilterStates adds new filter. Different classes data require different handling choices several FilterState subclasses exist presents different user interface generates different subsetting call. FilterState created follows: FilterStates creates teal_slice dataname based parent data set varname based selected variable teal_slice wrapped teal_slices passed FilterStates$set_filter_state FilterStates$set_filter_state_impl called FilterStates$set_filter_state_impl calls init_filter_state, passing appropriate variable x init_filter_states generic function dispatches x, teal_slice, arguments respective child class constructor: LogicalFilterState logical variables. Presents checkbox group. Call example: !variable. RangeFilterState numeric variables. Presents interactive plot well two numeric inputs. Selection always two values represent inclusive interval limits. Call example: variable >= selection[1] & variable <= selection[2] DateFilterState Date variables. Presents two date inputs. Selection two values determine inclusive interval limits. Call example: variable >= selection[1] & variable <= selection[2]. DatetimeFilterState POSIXct POSIXlt variables. Similar DateFilterState. ChoicesFilterState character factor values. Additionally, classes passed ChoicesFilterState number unique values lower getOption(\"teal.threshold_slider_vs_checkboxgroup\"). Presents either checkbox group drop-menu. Depending settings, allows either one number values selected. Call examples: variable == selection, variable %% selection. EmptyFilterState variables contain missing values. return calls. child classes handle missing values, RangedFilterState also handles infinite values. FilterState constructor also takes extract_type argument, determines call constructed extract_type can unspecified, \"matrix\" \"list\" value corresponds type variable prefix returned condition call. extract_type \"list\", variable condition call $, \"matrix\" [, \"\"].","code":""},{"path":"https://insightsengineering.github.io/teal.slice/articles/teal-slice-classes.html","id":"filterstateexpr","dir":"Articles","previous_headings":"Class Description","what":"FilterStateExpr","title":"teal.slice Classes","text":"Similarly FilterState, FilterStateExpr controls single filter card returns logical expression. However, FilterState generates call based selection state, FilterStateExpr call must specified manually must valid R expression.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/articles/teal-slice-classes.html","id":"teal_slice","dir":"Articles","previous_headings":"Class Description","what":"teal_slice","title":"teal.slice Classes","text":"teal_slice simple object storing filter information. can thought quantum information. teal_slice object passed directly FilterState$initialize stored inside FilterState keep current state filter. Technically, values used generate call teal_slice. FilterState can described wrapper around teal_slice provides additional methods handle filter state. also contains actual data (single column). teal_slice R6 object encode behaviors, implemented around reactiveValues object allow shared state advanced teal applications. See ?teal_slice detailed explanation.","code":""},{"path":[]},{"path":"https://insightsengineering.github.io/teal.slice/articles/teal-slice-classes.html","id":"overview","dir":"Articles","previous_headings":"Making a reproducible filter call","what":"Overview","title":"teal.slice Classes","text":"diagram presents filter panel classes responsibilities composing filter calls. Code generated nested execution get_call methods. FilteredData$get_call calls FilteredDataset$get_call, calls FilterStates$get_call turn calls FilterState$get_call. FilterState$get_call() returns single subsetting expression (logical predicate). FilterStates$get_call() returns single complete subsetting call extracting expressions FilterState objects combining & operator. FilteredDataset$get_call() returns list calls extracted FilterStates objects. FilteredData$get_call() returns list calls extracted specified FilteredDataset.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/articles/teal-slice-classes.html","id":"example","dir":"Articles","previous_headings":"Making a reproducible filter call","what":"Example","title":"teal.slice Classes","text":"Calling datasets$get_call() teal modules executes chain calls filter panel classes. Consider following scenario: FilteredData contains three data sets: ADSL, ADTTE, MAE, stored FiteredDataset object ADSL data.frame can filtered single dplyr::filter call. data set stored DataframeFilteredDataset, holds single FilterStates object. FilterStates constructs dplyr::filter call based FilterState objects present private$state_list. FilterStates$set_filter_state adds new teal_slice, FilterState created added private$state_list FilterStates. FilterStates gathers logical expressions FilterState objects composes dplyr::filter(ADSL, ...) call. Two new filters added: SEX AGE. causes initialization appropriate FilterState subclasses: ChoiceFilterState RangeFilterState. FilterState produces subsetting expression: SEX == \"F\" AGE >= 20 & AGE <= 60. expressions combined & passed dplyr::filter, producing ADSL <- dplyr::filter(ADSL, SEX == \"F\" & AGE >= 20 & AGE <= 60). DataframeFilteredDataset puts call list returns FilteredData. ADTTE also data.frame FilteredDataset stores works much one ADSL. one difference dplyr::filter call ADTTE followed dplyr::inner_join call merge filtering result parent data set (ADSL) key columns remain consistent. Note done join_keys specified - otherwise ADTTE treated separate data set filtered independently. MAE data set MultiAssayExperiment, contains multiple sub-objects can filtered . One ADSL-like patient data, stored DataFrame MAE@colData, others experiments, typically SummarizedExperiment objects, stored MAE@ExperimentList, can extracted using MAE[[\"experiment name\"]]. Therefore, MAEFilteredDataset multiple FilterStates objects: one subject data one experiment. MAEFilterStates object initialized subject data object MultiAssayExperiment::subsetByColData function applied. MultiAssayExperiment::subsetByColData two arguments: x (data) y (conditions). Since filter expressions passed one argument, MAEFilterStates one state_list, just like DFFilterStates. Adding new filters triggers actions described (4). SummarizedExperiment complicated observations can filtered based rowData colData slots, contain DataFrames. Subsetting done dedicated S4 subset method, takes two key arguments: subset takes logical expressions applied rowData, select takes logical expressions applied colData. teal_slice objects specify filters SummarizedExperiment must contain arg element, either \"subset\" \"select\", reflect slot experiment refer . SEFilterStates gathers logical expressions member FilterState objects, groups arg element, builds call subset two combined logical expressions passed subset select arguments.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/articles/teal-slice-classes.html","id":"filter-panel-modules","dir":"Articles","previous_headings":"","what":"Filter panel modules","title":"teal.slice Classes","text":"FilteredData object uses filter_panel_ui filter_panel_srv methods put filter panel can used application. teal applications placed right-hand side. filter panel module return anything. Data, subsetting calls, filter states accessible specific public methods: get_data, get_call, get_filter_state, respectively. Typically, filter panel consists three modules: ui/srv_overview displays observation counts filtered vs unfiltered data ui/srv_active displays active filter cards, created FilterState objects ui/srv_add allows adding filters FilteredData handle data sets directly may different types, rather, calls respective methods lower-level classes. new filter added using “Add Filter Variable” module FilterStates, new FilterState object initialized added private$state_list. FilterStates$srv_active observes private$state_list (reactiveVal) state list changes (filter added removed), calls FilterState$server uses renderUI display FilterState$ui.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/articles/teal-slice.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Introduction to teal.slice","text":"teal.slice package provides filter panel shiny applications. teal.slice creates filter panel module allows interactive filtering data stored data.frame MultiAssayExperiment objects. also displays filtered unfiltered observation counts.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/articles/teal-slice.html","id":"information-for-users-of-the-filter-panel-in-applications","dir":"Articles","previous_headings":"","what":"Information for users of the filter panel in applications","title":"Introduction to teal.slice","text":"filter panel contains three panels: top panel displays number records (observations) remain filters applied. relational data (join_keys specified), number unique subjects remaining filtered data set also shown. middle panel displays current active filters allows user change state. bottom panel allows add new filters columns data sets app. Note multiple filters data set combined operator possible apply hierarchical filters. example filter panel use shown image . iris data set 50 versicolor records removed, leaving 100 observations. mtcars data set filtered records (gear = 3 gear = 5) (disp [205, 295]). Depending data type selected variable, different filters shown, example date pickers, range sliders, checkbox inputs. relational data (join_keys specified), filters specified parent data set (.e. ADSL) apply child data sets, whereas filters child data set can specified columns found data set’s parent. general relational data filter panel treats data set independently, irrespective relationships data sets. filter panel also supports filtering MultiAssayExperiment objects, filters can applied subject data, stored colData slot accessed colData(MAE), well experiments, stored ExperimentList slot accessed MAE[[\"experiment name\"]].","code":""},{"path":"https://insightsengineering.github.io/teal.slice/articles/teal-slice.html","id":"information-for-r-developers-using-the-filter-panel","dir":"Articles","previous_headings":"","what":"Information for R developers using the filter panel","title":"Introduction to teal.slice","text":"example app shows embed filter panel inside shiny application. filter panel entirely contained within FilteredData object. FilteredData R6 class stores data sets, tracks filter states, constructs applies filter calls, can output filtered data. also contains shiny modules (UI server functions) make panel . teal application FilteredData object (datasets) created automatically teal’s init function filter panel components automatically placed right-hand side page. Note example uses shiny::dataTableOutput shiny::renderDataTable. can lead issues Bootstrap, especially version 4. recommend using DT::dataTableOutput DT::renderDataTable possible. See shiny DT documentation information. facilitate communication FilteredData, provide filter panel API. example uses set_filter_state function set state state specified teal_slices teal_slice functions. details please see Filter panel developers vignette.","code":"library(shiny) library(teal.slice) # create a FilteredData object datasets <- init_filtered_data(list(iris = iris, mtcars = mtcars)) # setting initial state set_filter_state( datasets = datasets, filter = teal_slices( teal_slice(dataname = \"iris\", varname = \"Species\", selected = \"virginica\", keep_na = FALSE), teal_slice(dataname = \"mtcars\", id = \"4 cyl\", title = \"4 Cylinders\", expr = \"cyl == 4\"), teal_slice(dataname = \"mtcars\", varname = \"mpg\", selected = c(20.0, 25.0), keep_na = FALSE, keep_inf = FALSE), include_varnames = list(iris = c(\"Species\", \"Sepal.Length\")), exclude_varnames = list(mtcars = \"cyl\"), count_type = \"all\", allow_add = TRUE ) ) ui <- fluidPage( fluidRow( column( width = 9, tabsetPanel( tabPanel(title = \"iris\", dataTableOutput(\"iris_table\")), tabPanel(title = \"mtcars\", dataTableOutput(\"mtcars_table\")) ) ), # ui for the filter panel column(width = 3, datasets$ui_filter_panel(\"filter_panel\")) ) ) ## `shiny::dataTableOutput()` is deprecated as of shiny 1.8.1. ## Please use `DT::DTOutput()` instead. ## Since you have a suitable version of DT (>= v0.32.1), shiny::dataTableOutput() will automatically use DT::DTOutput() under-the-hood. ## If this happens to break your app, set `options(shiny.legacy.datatable = TRUE)` to get the legacy datatable implementation (or `FALSE` to squelch this message). ## See for more information. ## `shiny::dataTableOutput()` is deprecated as of shiny 1.8.1. ## Please use `DT::DTOutput()` instead. ## Since you have a suitable version of DT (>= v0.32.1), shiny::dataTableOutput() will automatically use DT::DTOutput() under-the-hood. ## If this happens to break your app, set `options(shiny.legacy.datatable = TRUE)` to get the legacy datatable implementation (or `FALSE` to squelch this message). ## See for more information. server <- function(input, output, session) { # this is the shiny server function for the filter panel and the datasets # object can now be used inside the application datasets$srv_filter_panel(\"filter_panel\") # get the filtered datasets and put them inside reactives for analysis iris_filtered_data <- reactive(datasets$get_data(dataname = \"iris\", filtered = TRUE)) mtcars_filtered_data <- reactive(datasets$get_data(dataname = \"mtcars\", filtered = TRUE)) output$iris_table <- renderDataTable(iris_filtered_data()) output$mtcars_table <- renderDataTable(mtcars_filtered_data()) } if (interactive()) { shinyApp(ui, server) }"},{"path":"https://insightsengineering.github.io/teal.slice/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Dawid Kaledkowski. Author, maintainer. Pawel Rucki. Author. Aleksander Chlebowski. Author. Andre Verissimo. Author. Kartikeya Kirar. Author. Marcin Kosinski. Author. Chendi Liao. Reviewer. Dony Unardi. Reviewer. Andrew Bates. Author. Mahmoud Hallal. Author. Nikolas Burkoff. Author. Maciej Nasinski. Author. Konrad Pagacz. Author. Junlue Zhao. Author. F. Hoffmann-La Roche AG. Copyright holder, funder.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Kaledkowski D, Rucki P, Chlebowski , Verissimo , Kirar K, Kosinski M, Bates , Hallal M, Burkoff N, Nasinski M, Pagacz K, Zhao J (2024). teal.slice: Filter Module 'teal' Applications. R package version 0.5.1.9014, https://github.com/insightsengineering/teal.slice/, https://insightsengineering.github.io/teal.slice/.","code":"@Manual{, title = {teal.slice: Filter Module for 'teal' Applications}, author = {Dawid Kaledkowski and Pawel Rucki and Aleksander Chlebowski and Andre Verissimo and Kartikeya Kirar and Marcin Kosinski and Andrew Bates and Mahmoud Hallal and Nikolas Burkoff and Maciej Nasinski and Konrad Pagacz and Junlue Zhao}, year = {2024}, note = {R package version 0.5.1.9014, https://github.com/insightsengineering/teal.slice/}, url = {https://insightsengineering.github.io/teal.slice/}, }"},{"path":"https://insightsengineering.github.io/teal.slice/index.html","id":"tealslice","dir":"","previous_headings":"","what":"Filter Module for teal Applications","title":"Filter Module for teal Applications","text":"teal.slice R library used development teal shiny modules. provides: class accepting array data.frames input, supporting basic dplyr operations data, method returning code needed slice data desired way, set shiny modules helping acquire desired slice data using shiny GUI.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Filter Module for teal Applications","text":"Alternatively, might want use development version.","code":"install.packages('teal.slice') # install.packages(\"pak\") pak::pak(\"insightsengineering/teal.slice\")"},{"path":"https://insightsengineering.github.io/teal.slice/index.html","id":"usage","dir":"","previous_headings":"","what":"Usage","title":"Filter Module for teal Applications","text":"understand use package, please refer Introduction teal.slice article, provides multiple examples code implementation.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/index.html","id":"getting-help","dir":"","previous_headings":"","what":"Getting help","title":"Filter Module for teal Applications","text":"encounter bug feature request, please file issue. questions, discussions, updates, use teal channel pharmaverse slack workspace.","code":""},{"path":[]},{"path":[]},{"path":[]},{"path":[]},{"path":"https://insightsengineering.github.io/teal.slice/reference/ChoicesFilterState.html","id":null,"dir":"Reference","previous_headings":"","what":"FilterState object for categorical data — ChoicesFilterState","title":"FilterState object for categorical data — ChoicesFilterState","text":"Manages choosing elements set.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/ChoicesFilterState.html","id":"super-class","dir":"Reference","previous_headings":"","what":"Super class","title":"FilterState object for categorical data — ChoicesFilterState","text":"teal.slice::FilterState -> ChoicesFilterState","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/ChoicesFilterState.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"FilterState object for categorical data — ChoicesFilterState","text":"teal.slice::FilterState$finalize() teal.slice::FilterState$format() teal.slice::FilterState$get_state() teal.slice::FilterState$print() teal.slice::FilterState$server() teal.slice::FilterState$set_state() teal.slice::FilterState$ui()","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/ChoicesFilterState.html","id":"public-methods","dir":"Reference","previous_headings":"","what":"Public methods","title":"FilterState object for categorical data — ChoicesFilterState","text":"ChoicesFilterState$new() ChoicesFilterState$get_call() ChoicesFilterState$clone()","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/ChoicesFilterState.html","id":"method-new-","dir":"Reference","previous_headings":"","what":"Method new()","title":"FilterState object for categorical data — ChoicesFilterState","text":"Initialize FilterState object.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/ChoicesFilterState.html","id":"usage","dir":"Reference","previous_headings":"","what":"Usage","title":"FilterState object for categorical data — ChoicesFilterState","text":"","code":"ChoicesFilterState$new( x, x_reactive = reactive(NULL), slice, extract_type = character(0) )"},{"path":"https://insightsengineering.github.io/teal.slice/reference/ChoicesFilterState.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"FilterState object for categorical data — ChoicesFilterState","text":"x (character) variable filtered. x_reactive (reactive) returning vector type x. used update counts following change values filtered dataset. set reactive(NULL) counts based filtered dataset shown. slice (teal_slice) specification filter state. teal_slice stored object set_state directly manipulates values within teal_slice. get_state returns teal_slice object can reused places. Note teal_slice reactiveValues, means reference semantics, .e. changes made object automatically reflected places refer teal_slice. extract_type (character) specifying whether condition calls prefixed dataname. Possible values: character(0) (default) varname condition call prefixed \"list\" varname condition call returned $ \"matrix\" varname condition call returned [, ]","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/ChoicesFilterState.html","id":"returns","dir":"Reference","previous_headings":"","what":"Returns","title":"FilterState object for categorical data — ChoicesFilterState","text":"Object class ChoicesFilterState, invisibly.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/ChoicesFilterState.html","id":"method-get-call-","dir":"Reference","previous_headings":"","what":"Method get_call()","title":"FilterState object for categorical data — ChoicesFilterState","text":"Returns reproducible condition call current selection. class returned call looks like %% c() optional .na().","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/ChoicesFilterState.html","id":"usage-1","dir":"Reference","previous_headings":"","what":"Usage","title":"FilterState object for categorical data — ChoicesFilterState","text":"","code":"ChoicesFilterState$get_call(dataname)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/ChoicesFilterState.html","id":"arguments-1","dir":"Reference","previous_headings":"","what":"Arguments","title":"FilterState object for categorical data — ChoicesFilterState","text":"dataname (character(1)) name data set; defaults private$get_dataname()","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/ChoicesFilterState.html","id":"returns-1","dir":"Reference","previous_headings":"","what":"Returns","title":"FilterState object for categorical data — ChoicesFilterState","text":"call NULL","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/ChoicesFilterState.html","id":"method-clone-","dir":"Reference","previous_headings":"","what":"Method clone()","title":"FilterState object for categorical data — ChoicesFilterState","text":"objects class cloneable method.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/ChoicesFilterState.html","id":"usage-2","dir":"Reference","previous_headings":"","what":"Usage","title":"FilterState object for categorical data — ChoicesFilterState","text":"","code":"ChoicesFilterState$clone(deep = FALSE)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/ChoicesFilterState.html","id":"arguments-2","dir":"Reference","previous_headings":"","what":"Arguments","title":"FilterState object for categorical data — ChoicesFilterState","text":"deep Whether make deep clone.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/ChoicesFilterState.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"FilterState object for categorical data — ChoicesFilterState","text":"","code":"# use non-exported function from teal.slice include_css_files <- getFromNamespace(\"include_css_files\", \"teal.slice\") include_js_files <- getFromNamespace(\"include_js_files\", \"teal.slice\") ChoicesFilterState <- getFromNamespace(\"ChoicesFilterState\", \"teal.slice\") library(shiny) filter_state <- ChoicesFilterState$new( x = c(LETTERS, NA), slice = teal_slice(varname = \"var\", dataname = \"data\") ) isolate(filter_state$get_call()) #> NULL filter_state$set_state( teal_slice( dataname = \"data\", varname = \"var\", selected = \"A\", keep_na = TRUE ) ) isolate(filter_state$get_call()) #> is.na(var) | var == \"A\" # working filter in an app library(shinyjs) #> #> Attaching package: ‘shinyjs’ #> The following object is masked from ‘package:shiny’: #> #> runExample #> The following objects are masked from ‘package:methods’: #> #> removeClass, show data_choices <- c(sample(letters[1:4], 100, replace = TRUE), NA) attr(data_choices, \"label\") <- \"lowercase letters\" fs <- ChoicesFilterState$new( x = data_choices, slice = teal_slice( dataname = \"data\", varname = \"variable\", selected = c(\"a\", \"c\"), keep_na = TRUE ) ) ui <- fluidPage( useShinyjs(), include_css_files(pattern = \"filter-panel\"), include_js_files(pattern = \"count-bar-labels\"), column(4, tags$div( tags$h4(\"ChoicesFilterState\"), fs$ui(\"fs\") )), column(4, tags$div( tags$h4(\"Condition (i.e. call)\"), # display the condition call generated by this FilterState textOutput(\"condition_choices\"), tags$br(), tags$h4(\"Unformatted state\"), # display raw filter state textOutput(\"unformatted_choices\"), tags$br(), tags$h4(\"Formatted state\"), # display human readable filter state textOutput(\"formatted_choices\"), tags$br() )), column(4, tags$div( tags$h4(\"Programmatic filter control\"), actionButton(\"button1_choices\", \"set drop NA\", width = \"100%\"), tags$br(), actionButton(\"button2_choices\", \"set keep NA\", width = \"100%\"), tags$br(), actionButton(\"button3_choices\", \"set selection: a, b\", width = \"100%\"), tags$br(), actionButton(\"button4_choices\", \"deselect all\", width = \"100%\"), tags$br(), actionButton(\"button0_choices\", \"set initial state\", width = \"100%\"), tags$br() )) ) server <- function(input, output, session) { fs$server(\"fs\") output$condition_choices <- renderPrint(fs$get_call()) output$formatted_choices <- renderText(fs$format()) output$unformatted_choices <- renderPrint(fs$get_state()) # modify filter state programmatically observeEvent( input$button1_choices, fs$set_state( teal_slice(dataname = \"data\", varname = \"variable\", keep_na = FALSE) ) ) observeEvent( input$button2_choices, fs$set_state( teal_slice(dataname = \"data\", varname = \"variable\", keep_na = TRUE) ) ) observeEvent( input$button3_choices, fs$set_state( teal_slice(dataname = \"data\", varname = \"variable\", selected = c(\"a\", \"b\")) ) ) observeEvent( input$button4_choices, fs$set_state( teal_slice(dataname = \"data\", varname = \"variable\", selected = character(0), keep_na = TRUE) ) ) observeEvent( input$button0_choices, fs$set_state( teal_slice(dataname = \"data\", varname = \"variable\", selected = c(\"a\", \"c\"), keep_na = TRUE) ) ) } if (interactive()) { shinyApp(ui, server) }"},{"path":"https://insightsengineering.github.io/teal.slice/reference/DFFilterStates.html","id":null,"dir":"Reference","previous_headings":"","what":"FilterStates subclass for data frames — DFFilterStates","title":"FilterStates subclass for data frames — DFFilterStates","text":"Handles filter states data.frame.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DFFilterStates.html","id":"super-class","dir":"Reference","previous_headings":"","what":"Super class","title":"FilterStates subclass for data frames — DFFilterStates","text":"teal.slice::FilterStates -> DFFilterStates","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DFFilterStates.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"FilterStates subclass for data frames — DFFilterStates","text":"teal.slice::FilterStates$clear_filter_states() teal.slice::FilterStates$finalize() teal.slice::FilterStates$format() teal.slice::FilterStates$get_call() teal.slice::FilterStates$get_filter_state() teal.slice::FilterStates$print() teal.slice::FilterStates$remove_filter_state() teal.slice::FilterStates$set_filter_state() teal.slice::FilterStates$srv_active() teal.slice::FilterStates$srv_add() teal.slice::FilterStates$ui_active() teal.slice::FilterStates$ui_add()","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DFFilterStates.html","id":"public-methods","dir":"Reference","previous_headings":"","what":"Public methods","title":"FilterStates subclass for data frames — DFFilterStates","text":"DFFilterStates$new() DFFilterStates$clone()","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DFFilterStates.html","id":"method-new-","dir":"Reference","previous_headings":"","what":"Method new()","title":"FilterStates subclass for data frames — DFFilterStates","text":"Initializes DFFilterStates object setting dataname initializing state_list (shiny::reactiveVal). class contains single state_list specified name, means calling subset function associated class (dplyr::filter), list conditions passed unnamed arguments (...).","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DFFilterStates.html","id":"usage","dir":"Reference","previous_headings":"","what":"Usage","title":"FilterStates subclass for data frames — DFFilterStates","text":"","code":"DFFilterStates$new( data, data_reactive = function(sid = \"\") NULL, dataname, datalabel = NULL, keys = character(0) )"},{"path":"https://insightsengineering.github.io/teal.slice/reference/DFFilterStates.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"FilterStates subclass for data frames — DFFilterStates","text":"data (data.frame) R object dplyr::filter function applied . data_reactive (function(sid)) return data.frame object NULL. object needed FilterState counts updated change filters. function returns NULL filtered counts shown. Function sid argument character. dataname (character) name data used subset expression. Passed function argument attached FilterStates. datalabel (character(1)) optional text label. keys (character) key column names.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DFFilterStates.html","id":"method-clone-","dir":"Reference","previous_headings":"","what":"Method clone()","title":"FilterStates subclass for data frames — DFFilterStates","text":"objects class cloneable method.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DFFilterStates.html","id":"usage-1","dir":"Reference","previous_headings":"","what":"Usage","title":"FilterStates subclass for data frames — DFFilterStates","text":"","code":"DFFilterStates$clone(deep = FALSE)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/DFFilterStates.html","id":"arguments-1","dir":"Reference","previous_headings":"","what":"Arguments","title":"FilterStates subclass for data frames — DFFilterStates","text":"deep Whether make deep clone.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DFFilterStates.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"FilterStates subclass for data frames — DFFilterStates","text":"","code":"# use non-exported function from teal.slice include_css_files <- getFromNamespace(\"include_css_files\", \"teal.slice\") include_js_files <- getFromNamespace(\"include_js_files\", \"teal.slice\") init_filter_states <- getFromNamespace(\"init_filter_states\", \"teal.slice\") library(shiny) library(shinyjs) # create data frame to filter data_df <- data.frame( NUM1 = 1:100, NUM2 = round(runif(100, min = 20, max = 23)), CHAR1 = sample(LETTERS[1:6], size = 100, replace = TRUE), CHAR2 = sample(c(\"M\", \"F\"), size = 100, replace = TRUE), DATE = seq(as.Date(\"2020-01-01\"), by = 1, length.out = 100), DATETIME = as.POSIXct(seq(as.Date(\"2020-01-01\"), by = 1, length.out = 100)) ) data_na <- data.frame( NUM1 = NA, NUM2 = NA, CHAR1 = NA, CHAR2 = NA, DATE = NA, DATETIME = NA ) data_df <- rbind(data_df, data_na) # initiate `FilterStates` object filter_states_df <- init_filter_states( data = data_df, dataname = \"dataset\", datalabel = (\"label\") ) ui <- fluidPage( useShinyjs(), include_css_files(pattern = \"filter-panel\"), include_js_files(pattern = \"count-bar-labels\"), column(4, tags$div( tags$h4(\"Active filters\"), filter_states_df$ui_active(\"fsdf\") )), column(4, tags$div( tags$h4(\"Manual filter control\"), filter_states_df$ui_add(\"add_filters\"), tags$br(), tags$h4(\"Condition (i.e. call)\"), # display the subset expression generated by this FilterStates textOutput(\"call_df\"), tags$br(), tags$h4(\"Formatted state\"), # display human readable filter state textOutput(\"formatted_df\"), tags$br() )), column(4, tags$div( tags$h4(\"Programmatic filter control\"), actionButton(\"button1_df\", \"set NUM1 < 30\", width = \"100%\"), tags$br(), actionButton(\"button2_df\", \"set NUM2 %in% c(20, 21)\", width = \"100%\"), tags$br(), actionButton(\"button3_df\", \"set CHAR1 %in% c(\\\"B\\\", \\\"C\\\", \\\"D\\\")\", width = \"100%\"), tags$br(), actionButton(\"button4_df\", \"set CHAR2 == \\\"F\\\"\", width = \"100%\"), tags$br(), actionButton(\"button5_df\", \"set DATE <= 2020-02-02\", width = \"100%\"), tags$br(), actionButton(\"button6_df\", \"set DATETIME <= 2020-02-02\", width = \"100%\"), tags$br(), tags$hr(), actionButton(\"button7_df\", \"remove NUM1\", width = \"100%\"), tags$br(), actionButton(\"button8_df\", \"remove NUM2\", width = \"100%\"), tags$br(), actionButton(\"button9_df\", \"remove CHAR1\", width = \"100%\"), tags$br(), actionButton(\"button10_df\", \"remove CHAR2\", width = \"100%\"), tags$br(), actionButton(\"button11_df\", \"remove DATE\", width = \"100%\"), tags$br(), actionButton(\"button12_df\", \"remove DATETIME\", width = \"100%\"), tags$br(), tags$hr(), actionButton(\"button0_df\", \"clear all filters\", width = \"100%\"), tags$br() )) ) server <- function(input, output, session) { filter_states_df$srv_add(\"add_filters\") filter_states_df$srv_active(\"fsdf\") output$call_df <- renderPrint(filter_states_df$get_call()) output$formatted_df <- renderText(filter_states_df$format()) observeEvent(input$button1_df, { filter_state <- teal_slices(teal_slice(\"dataset\", \"NUM1\", selected = c(0, 30))) filter_states_df$set_filter_state(state = filter_state) }) observeEvent(input$button2_df, { filter_state <- teal_slices(teal_slice(\"dataset\", \"NUM2\", selected = c(20, 21))) filter_states_df$set_filter_state(state = filter_state) }) observeEvent(input$button3_df, { filter_state <- teal_slices(teal_slice(\"dataset\", \"CHAR1\", selected = c(\"B\", \"C\", \"D\"))) filter_states_df$set_filter_state(state = filter_state) }) observeEvent(input$button4_df, { filter_state <- teal_slices(teal_slice(\"dataset\", \"CHAR2\", selected = c(\"F\"))) filter_states_df$set_filter_state(state = filter_state) }) observeEvent(input$button5_df, { filter_state <- teal_slices( teal_slice(\"dataset\", \"DATE\", selected = c(\"2020-01-01\", \"2020-02-02\")) ) filter_states_df$set_filter_state(state = filter_state) }) observeEvent(input$button6_df, { filter_state <- teal_slices( teal_slice(\"dataset\", \"DATETIME\", selected = as.POSIXct(c(\"2020-01-01\", \"2020-02-02\"))) ) filter_states_df$set_filter_state(state = filter_state) }) observeEvent(input$button7_df, { filter_state <- teal_slices(teal_slice(\"dataset\", \"NUM1\")) filter_states_df$remove_filter_state(filter_state) }) observeEvent(input$button8_df, { filter_state <- teal_slices(teal_slice(\"dataset\", \"NUM2\")) filter_states_df$remove_filter_state(filter_state) }) observeEvent(input$button9_df, { filter_state <- teal_slices(teal_slice(\"dataset\", \"CHAR1\")) filter_states_df$remove_filter_state(filter_state) }) observeEvent(input$button10_df, { filter_state <- teal_slices(teal_slice(\"dataset\", \"CHAR2\")) filter_states_df$remove_filter_state(filter_state) }) observeEvent(input$button11_df, { filter_state <- teal_slices( teal_slice(\"dataset\", \"DATE\") ) filter_states_df$remove_filter_state(filter_state) }) observeEvent(input$button12_df, { filter_state <- teal_slices( teal_slice(\"dataset\", \"DATETIME\", selected = as.POSIXct(c(\"2020-01-01\", \"2020-02-02\"))) ) filter_states_df$remove_filter_state(filter_state) }) observeEvent(input$button0_df, filter_states_df$clear_filter_states()) } if (interactive()) { shinyApp(ui, server) }"},{"path":"https://insightsengineering.github.io/teal.slice/reference/DataframeFilteredDataset.html","id":null,"dir":"Reference","previous_headings":"","what":"The DataframeFilteredDataset R6 class — DataframeFilteredDataset","title":"The DataframeFilteredDataset R6 class — DataframeFilteredDataset","text":"DataframeFilteredDataset R6 class DataframeFilteredDataset R6 class","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DataframeFilteredDataset.html","id":"super-class","dir":"Reference","previous_headings":"","what":"Super class","title":"The DataframeFilteredDataset R6 class — DataframeFilteredDataset","text":"teal.slice::FilteredDataset -> DataframeFilteredDataset","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DataframeFilteredDataset.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"The DataframeFilteredDataset R6 class — DataframeFilteredDataset","text":"teal.slice::FilteredDataset$clear_filter_states() teal.slice::FilteredDataset$finalize() teal.slice::FilteredDataset$format() teal.slice::FilteredDataset$get_dataname() teal.slice::FilteredDataset$get_dataset() teal.slice::FilteredDataset$get_dataset_label() teal.slice::FilteredDataset$get_filter_state() teal.slice::FilteredDataset$get_keys() teal.slice::FilteredDataset$print() teal.slice::FilteredDataset$srv_active() teal.slice::FilteredDataset$srv_add() teal.slice::FilteredDataset$ui_active()","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DataframeFilteredDataset.html","id":"public-methods","dir":"Reference","previous_headings":"","what":"Public methods","title":"The DataframeFilteredDataset R6 class — DataframeFilteredDataset","text":"DataframeFilteredDataset$new() DataframeFilteredDataset$get_call() DataframeFilteredDataset$set_filter_state() DataframeFilteredDataset$remove_filter_state() DataframeFilteredDataset$ui_add() DataframeFilteredDataset$get_filter_overview() DataframeFilteredDataset$clone()","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DataframeFilteredDataset.html","id":"method-new-","dir":"Reference","previous_headings":"","what":"Method new()","title":"The DataframeFilteredDataset R6 class — DataframeFilteredDataset","text":"Initializes DataframeFilteredDataset object.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DataframeFilteredDataset.html","id":"usage","dir":"Reference","previous_headings":"","what":"Usage","title":"The DataframeFilteredDataset R6 class — DataframeFilteredDataset","text":"","code":"DataframeFilteredDataset$new( dataset, dataname, keys = character(0), parent_name = character(0), parent = NULL, join_keys = character(0), label = character(0) )"},{"path":"https://insightsengineering.github.io/teal.slice/reference/DataframeFilteredDataset.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"The DataframeFilteredDataset R6 class — DataframeFilteredDataset","text":"dataset (data.frame) single data.frame filters rendered. dataname (character(1)) syntactically valid name given dataset. keys (character) optional vector primary key column names. parent_name (character(1)) name parent dataset. parent (reactive) returns filtered data.frame FilteredDataset named parent_name. Passing parent results reactive link causes re-filtering dataset based changes parent. join_keys (character) vector names columns dataset join parent dataset. column names parent match , given names vector. label (character(1)) label describe dataset.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DataframeFilteredDataset.html","id":"returns","dir":"Reference","previous_headings":"","what":"Returns","title":"The DataframeFilteredDataset R6 class — DataframeFilteredDataset","text":"Object class DataframeFilteredDataset, invisibly.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DataframeFilteredDataset.html","id":"method-get-call-","dir":"Reference","previous_headings":"","what":"Method get_call()","title":"The DataframeFilteredDataset R6 class — DataframeFilteredDataset","text":"Gets subset expression. function returns subset expressions equivalent selected items within filter_states. Configuration expressions constant depends filter_states type order set initialization. class contains single FilterStates contains single state_list FilterState objects apply one argument (...) dplyr::filter call.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DataframeFilteredDataset.html","id":"usage-1","dir":"Reference","previous_headings":"","what":"Usage","title":"The DataframeFilteredDataset R6 class — DataframeFilteredDataset","text":"","code":"DataframeFilteredDataset$get_call(sid = \"\")"},{"path":"https://insightsengineering.github.io/teal.slice/reference/DataframeFilteredDataset.html","id":"arguments-1","dir":"Reference","previous_headings":"","what":"Arguments","title":"The DataframeFilteredDataset R6 class — DataframeFilteredDataset","text":"sid (character) specified, method returns code containing conditions calls FilterState objects sid different sid argument.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DataframeFilteredDataset.html","id":"returns-1","dir":"Reference","previous_headings":"","what":"Returns","title":"The DataframeFilteredDataset R6 class — DataframeFilteredDataset","text":"Either list length 1 containing filter call, NULL.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DataframeFilteredDataset.html","id":"method-set-filter-state-","dir":"Reference","previous_headings":"","what":"Method set_filter_state()","title":"The DataframeFilteredDataset R6 class — DataframeFilteredDataset","text":"Set filter state.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DataframeFilteredDataset.html","id":"usage-2","dir":"Reference","previous_headings":"","what":"Usage","title":"The DataframeFilteredDataset R6 class — DataframeFilteredDataset","text":"","code":"DataframeFilteredDataset$set_filter_state(state)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/DataframeFilteredDataset.html","id":"arguments-2","dir":"Reference","previous_headings":"","what":"Arguments","title":"The DataframeFilteredDataset R6 class — DataframeFilteredDataset","text":"state (teal_slices)","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DataframeFilteredDataset.html","id":"returns-2","dir":"Reference","previous_headings":"","what":"Returns","title":"The DataframeFilteredDataset R6 class — DataframeFilteredDataset","text":"NULL, invisibly.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DataframeFilteredDataset.html","id":"method-remove-filter-state-","dir":"Reference","previous_headings":"","what":"Method remove_filter_state()","title":"The DataframeFilteredDataset R6 class — DataframeFilteredDataset","text":"Remove one FilterState form FilteredDataset.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DataframeFilteredDataset.html","id":"usage-3","dir":"Reference","previous_headings":"","what":"Usage","title":"The DataframeFilteredDataset R6 class — DataframeFilteredDataset","text":"","code":"DataframeFilteredDataset$remove_filter_state(state)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/DataframeFilteredDataset.html","id":"arguments-3","dir":"Reference","previous_headings":"","what":"Arguments","title":"The DataframeFilteredDataset R6 class — DataframeFilteredDataset","text":"state (teal_slices) specifying FilterState objects remove; teal_slices may contain dataname varname, elements ignored","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DataframeFilteredDataset.html","id":"returns-3","dir":"Reference","previous_headings":"","what":"Returns","title":"The DataframeFilteredDataset R6 class — DataframeFilteredDataset","text":"NULL, invisibly.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DataframeFilteredDataset.html","id":"method-ui-add-","dir":"Reference","previous_headings":"","what":"Method ui_add()","title":"The DataframeFilteredDataset R6 class — DataframeFilteredDataset","text":"UI module add filter variable dataset.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DataframeFilteredDataset.html","id":"usage-4","dir":"Reference","previous_headings":"","what":"Usage","title":"The DataframeFilteredDataset R6 class — DataframeFilteredDataset","text":"","code":"DataframeFilteredDataset$ui_add(id)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/DataframeFilteredDataset.html","id":"arguments-4","dir":"Reference","previous_headings":"","what":"Arguments","title":"The DataframeFilteredDataset R6 class — DataframeFilteredDataset","text":"id (character(1)) shiny module instance id.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DataframeFilteredDataset.html","id":"returns-4","dir":"Reference","previous_headings":"","what":"Returns","title":"The DataframeFilteredDataset R6 class — DataframeFilteredDataset","text":"shiny.tag","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DataframeFilteredDataset.html","id":"method-get-filter-overview-","dir":"Reference","previous_headings":"","what":"Method get_filter_overview()","title":"The DataframeFilteredDataset R6 class — DataframeFilteredDataset","text":"Creates row filter overview form dataname -- observations (remaining/total) - data.frame","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DataframeFilteredDataset.html","id":"usage-5","dir":"Reference","previous_headings":"","what":"Usage","title":"The DataframeFilteredDataset R6 class — DataframeFilteredDataset","text":"","code":"DataframeFilteredDataset$get_filter_overview()"},{"path":"https://insightsengineering.github.io/teal.slice/reference/DataframeFilteredDataset.html","id":"returns-5","dir":"Reference","previous_headings":"","what":"Returns","title":"The DataframeFilteredDataset R6 class — DataframeFilteredDataset","text":"data.frame.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DataframeFilteredDataset.html","id":"method-clone-","dir":"Reference","previous_headings":"","what":"Method clone()","title":"The DataframeFilteredDataset R6 class — DataframeFilteredDataset","text":"objects class cloneable method.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DataframeFilteredDataset.html","id":"usage-6","dir":"Reference","previous_headings":"","what":"Usage","title":"The DataframeFilteredDataset R6 class — DataframeFilteredDataset","text":"","code":"DataframeFilteredDataset$clone(deep = FALSE)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/DataframeFilteredDataset.html","id":"arguments-5","dir":"Reference","previous_headings":"","what":"Arguments","title":"The DataframeFilteredDataset R6 class — DataframeFilteredDataset","text":"deep Whether make deep clone.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DataframeFilteredDataset.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"The DataframeFilteredDataset R6 class — DataframeFilteredDataset","text":"","code":"# use non-exported function from teal.slice DataframeFilteredDataset <- getFromNamespace(\"DataframeFilteredDataset\", \"teal.slice\") library(shiny) ds <- DataframeFilteredDataset$new(iris, \"iris\") ds$set_filter_state( teal_slices( teal_slice(dataname = \"iris\", varname = \"Species\", selected = \"virginica\"), teal_slice(dataname = \"iris\", varname = \"Petal.Length\", selected = c(2.0, 5)) ) ) isolate(ds$get_filter_state()) #> { #> \"slices\": [ #> { #> \"dataname\" : \"iris\", #> \"varname\" : \"Species\", #> \"id\" : \"iris Species\", #> \"choices\" : [\"setosa\", \"versicolor\", \"virgin... #> \"selected\" : [\"virginica\"], #> \"fixed\" : false, #> \"anchored\" : false, #> \"multiple\" : true #> }, #> { #> \"dataname\" : \"iris\", #> \"varname\" : \"Petal.Length\", #> \"id\" : \"iris Petal.Length\", #> \"choices\" : [1, 6.9000000000000004], #> \"selected\" : [2, 5], #> \"fixed\" : false, #> \"anchored\" : false, #> \"multiple\" : true #> } #> ], #> \"attributes\": { #> \"include_varnames\" : { #> \"iris\" : [\"Sepal.Length\", \"Sepal.Width\", ... #> }, #> \"count_type\" : \"none\", #> \"allow_add\" : true #> } #> } isolate(ds$get_call()) #> $filter #> iris <- dplyr::filter(iris, Species == \"virginica\" & (Petal.Length >= #> 2 & Petal.Length <= 5)) #> ## set_filter_state dataset <- DataframeFilteredDataset$new(iris, \"iris\") fs <- teal_slices( teal_slice(dataname = \"iris\", varname = \"Species\", selected = \"virginica\"), teal_slice(dataname = \"iris\", varname = \"Petal.Length\", selected = c(2.0, 5)) ) dataset$set_filter_state(state = fs) isolate(dataset$get_filter_state()) #> { #> \"slices\": [ #> { #> \"dataname\" : \"iris\", #> \"varname\" : \"Species\", #> \"id\" : \"iris Species\", #> \"choices\" : [\"setosa\", \"versicolor\", \"virgin... #> \"selected\" : [\"virginica\"], #> \"fixed\" : false, #> \"anchored\" : false, #> \"multiple\" : true #> }, #> { #> \"dataname\" : \"iris\", #> \"varname\" : \"Petal.Length\", #> \"id\" : \"iris Petal.Length\", #> \"choices\" : [1, 6.9000000000000004], #> \"selected\" : [2, 5], #> \"fixed\" : false, #> \"anchored\" : false, #> \"multiple\" : true #> } #> ], #> \"attributes\": { #> \"include_varnames\" : { #> \"iris\" : [\"Sepal.Length\", \"Sepal.Width\", ... #> }, #> \"count_type\" : \"none\", #> \"allow_add\" : true #> } #> }"},{"path":"https://insightsengineering.github.io/teal.slice/reference/DateFilterState.html","id":null,"dir":"Reference","previous_headings":"","what":"FilterState object for Date data — DateFilterState","title":"FilterState object for Date data — DateFilterState","text":"Manages choosing range Dates.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DateFilterState.html","id":"super-class","dir":"Reference","previous_headings":"","what":"Super class","title":"FilterState object for Date data — DateFilterState","text":"teal.slice::FilterState -> DateFilterState","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DateFilterState.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"FilterState object for Date data — DateFilterState","text":"teal.slice::FilterState$finalize() teal.slice::FilterState$format() teal.slice::FilterState$get_state() teal.slice::FilterState$print() teal.slice::FilterState$server() teal.slice::FilterState$set_state() teal.slice::FilterState$ui()","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DateFilterState.html","id":"public-methods","dir":"Reference","previous_headings":"","what":"Public methods","title":"FilterState object for Date data — DateFilterState","text":"DateFilterState$new() DateFilterState$get_call() DateFilterState$clone()","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DateFilterState.html","id":"method-new-","dir":"Reference","previous_headings":"","what":"Method new()","title":"FilterState object for Date data — DateFilterState","text":"Initialize FilterState object.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DateFilterState.html","id":"usage","dir":"Reference","previous_headings":"","what":"Usage","title":"FilterState object for Date data — DateFilterState","text":"","code":"DateFilterState$new( x, x_reactive = reactive(NULL), slice, extract_type = character(0) )"},{"path":"https://insightsengineering.github.io/teal.slice/reference/DateFilterState.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"FilterState object for Date data — DateFilterState","text":"x (Date) variable filtered. x_reactive (reactive) returning vector type x. used update counts following change values filtered dataset. set reactive(NULL) counts based filtered dataset shown. slice (teal_slice) specification filter state. teal_slice stored object set_state directly manipulates values within teal_slice. get_state returns teal_slice object can reused places. Note teal_slice reactiveValues, means reference semantics, .e. changes made object automatically reflected places refer teal_slice. extract_type (character) specifying whether condition calls prefixed dataname. Possible values: character(0) (default) varname condition call prefixed \"list\" varname condition call returned $ \"matrix\" varname condition call returned [, ]","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DateFilterState.html","id":"returns","dir":"Reference","previous_headings":"","what":"Returns","title":"FilterState object for Date data — DateFilterState","text":"Object class DateFilterState, invisibly.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DateFilterState.html","id":"method-get-call-","dir":"Reference","previous_headings":"","what":"Method get_call()","title":"FilterState object for Date data — DateFilterState","text":"Returns reproducible condition call current selection. class returned call looks like >= & <= optional .na().","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DateFilterState.html","id":"usage-1","dir":"Reference","previous_headings":"","what":"Usage","title":"FilterState object for Date data — DateFilterState","text":"","code":"DateFilterState$get_call(dataname)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/DateFilterState.html","id":"arguments-1","dir":"Reference","previous_headings":"","what":"Arguments","title":"FilterState object for Date data — DateFilterState","text":"dataname (character(1)) containing possibly prefixed name data set","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DateFilterState.html","id":"returns-1","dir":"Reference","previous_headings":"","what":"Returns","title":"FilterState object for Date data — DateFilterState","text":"call NULL","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DateFilterState.html","id":"method-clone-","dir":"Reference","previous_headings":"","what":"Method clone()","title":"FilterState object for Date data — DateFilterState","text":"objects class cloneable method.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DateFilterState.html","id":"usage-2","dir":"Reference","previous_headings":"","what":"Usage","title":"FilterState object for Date data — DateFilterState","text":"","code":"DateFilterState$clone(deep = FALSE)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/DateFilterState.html","id":"arguments-2","dir":"Reference","previous_headings":"","what":"Arguments","title":"FilterState object for Date data — DateFilterState","text":"deep Whether make deep clone.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DateFilterState.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"FilterState object for Date data — DateFilterState","text":"","code":"# use non-exported function from teal.slice include_css_files <- getFromNamespace(\"include_css_files\", \"teal.slice\") include_js_files <- getFromNamespace(\"include_js_files\", \"teal.slice\") DateFilterState <- getFromNamespace(\"DateFilterState\", \"teal.slice\") library(shiny) filter_state <- DateFilterState$new( x = c(Sys.Date() + seq(1:10), NA), slice = teal_slice(varname = \"x\", dataname = \"data\"), extract_type = character(0) ) isolate(filter_state$get_call()) #> NULL filter_state$set_state( teal_slice( dataname = \"data\", varname = \"x\", selected = c(Sys.Date() + 3L, Sys.Date() + 8L), keep_na = TRUE ) ) isolate(filter_state$get_call()) #> is.na(x) | x >= as.Date(\"2024-11-04\") & x <= as.Date(\"2024-11-09\") # working filter in an app library(shinyjs) dates <- c(Sys.Date() - 100, Sys.Date()) data_date <- c(seq(from = dates[1], to = dates[2], length.out = 100), NA) fs <- DateFilterState$new( x = data_date, slice = teal_slice( dataname = \"data\", varname = \"x\", selected = data_date[c(47, 98)], keep_na = TRUE ) ) ui <- fluidPage( useShinyjs(), include_css_files(pattern = \"filter-panel\"), include_js_files(pattern = \"count-bar-labels\"), column(4, tags$div( tags$h4(\"DateFilterState\"), fs$ui(\"fs\") )), column(4, tags$div( id = \"outputs\", # div id is needed for toggling the element tags$h4(\"Condition (i.e. call)\"), # display the condition call generated by this FilterState textOutput(\"condition_date\"), tags$br(), tags$h4(\"Unformatted state\"), # display raw filter state textOutput(\"unformatted_date\"), tags$br(), tags$h4(\"Formatted state\"), # display human readable filter state textOutput(\"formatted_date\"), tags$br() )), column(4, tags$div( tags$h4(\"Programmatic filter control\"), actionButton(\"button1_date\", \"set drop NA\", width = \"100%\"), tags$br(), actionButton(\"button2_date\", \"set keep NA\", width = \"100%\"), tags$br(), actionButton(\"button3_date\", \"set a range\", width = \"100%\"), tags$br(), actionButton(\"button4_date\", \"set full range\", width = \"100%\"), tags$br(), actionButton(\"button0_date\", \"set initial state\", width = \"100%\"), tags$br() )) ) server <- function(input, output, session) { fs$server(\"fs\") output$condition_date <- renderPrint(fs$get_call()) output$formatted_date <- renderText(fs$format()) output$unformatted_date <- renderPrint(fs$get_state()) # modify filter state programmatically observeEvent( input$button1_date, fs$set_state(teal_slice(dataname = \"data\", varname = \"x\", keep_na = FALSE)) ) observeEvent( input$button2_date, fs$set_state(teal_slice(dataname = \"data\", varname = \"x\", keep_na = TRUE)) ) observeEvent( input$button3_date, fs$set_state(teal_slice(dataname = \"data\", varname = \"x\", selected = data_date[c(34, 56)])) ) observeEvent( input$button4_date, fs$set_state(teal_slice(dataname = \"data\", varname = \"x\", selected = dates)) ) observeEvent( input$button0_date, fs$set_state( teal_slice(\"data\", \"variable\", selected = data_date[c(47, 98)], keep_na = TRUE) ) ) } if (interactive()) { shinyApp(ui, server) }"},{"path":"https://insightsengineering.github.io/teal.slice/reference/DatetimeFilterState.html","id":null,"dir":"Reference","previous_headings":"","what":"FilterState object for date time data — DatetimeFilterState","title":"FilterState object for date time data — DatetimeFilterState","text":"Manages choosing range date-times.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DatetimeFilterState.html","id":"super-class","dir":"Reference","previous_headings":"","what":"Super class","title":"FilterState object for date time data — DatetimeFilterState","text":"teal.slice::FilterState -> DatetimeFilterState","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DatetimeFilterState.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"FilterState object for date time data — DatetimeFilterState","text":"teal.slice::FilterState$finalize() teal.slice::FilterState$format() teal.slice::FilterState$get_state() teal.slice::FilterState$print() teal.slice::FilterState$server() teal.slice::FilterState$set_state() teal.slice::FilterState$ui()","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DatetimeFilterState.html","id":"public-methods","dir":"Reference","previous_headings":"","what":"Public methods","title":"FilterState object for date time data — DatetimeFilterState","text":"DatetimeFilterState$new() DatetimeFilterState$get_call() DatetimeFilterState$clone()","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DatetimeFilterState.html","id":"method-new-","dir":"Reference","previous_headings":"","what":"Method new()","title":"FilterState object for date time data — DatetimeFilterState","text":"Initialize FilterState object. class extra field, private$timezone, set Sys.timezone() default. However, case using module teal app, one needs timezone app user. App user timezone taken session$userData$timezone set object initialized shiny.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DatetimeFilterState.html","id":"usage","dir":"Reference","previous_headings":"","what":"Usage","title":"FilterState object for date time data — DatetimeFilterState","text":"","code":"DatetimeFilterState$new( x, x_reactive = reactive(NULL), extract_type = character(0), slice )"},{"path":"https://insightsengineering.github.io/teal.slice/reference/DatetimeFilterState.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"FilterState object for date time data — DatetimeFilterState","text":"x (POSIXct POSIXlt) variable filtered. x_reactive (reactive) returning vector type x. used update counts following change values filtered dataset. set reactive(NULL) counts based filtered dataset shown. extract_type (character) specifying whether condition calls prefixed dataname. Possible values: character(0) (default) varname condition call prefixed \"list\" varname condition call returned $ \"matrix\" varname condition call returned [, ] slice (teal_slice) specification filter state. teal_slice stored object set_state directly manipulates values within teal_slice. get_state returns teal_slice object can reused places. Note teal_slice reactiveValues, means reference semantics, .e. changes made object automatically reflected places refer teal_slice.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DatetimeFilterState.html","id":"returns","dir":"Reference","previous_headings":"","what":"Returns","title":"FilterState object for date time data — DatetimeFilterState","text":"Object class DatetimeFilterState, invisibly.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DatetimeFilterState.html","id":"method-get-call-","dir":"Reference","previous_headings":"","what":"Method get_call()","title":"FilterState object for date time data — DatetimeFilterState","text":"Returns reproducible condition call current selection. class returned call looks like >= .POSIXct() & <= ) optional .na().","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DatetimeFilterState.html","id":"usage-1","dir":"Reference","previous_headings":"","what":"Usage","title":"FilterState object for date time data — DatetimeFilterState","text":"","code":"DatetimeFilterState$get_call(dataname)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/DatetimeFilterState.html","id":"arguments-1","dir":"Reference","previous_headings":"","what":"Arguments","title":"FilterState object for date time data — DatetimeFilterState","text":"dataname name data set; defaults private$get_dataname()","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DatetimeFilterState.html","id":"returns-1","dir":"Reference","previous_headings":"","what":"Returns","title":"FilterState object for date time data — DatetimeFilterState","text":"call","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DatetimeFilterState.html","id":"method-clone-","dir":"Reference","previous_headings":"","what":"Method clone()","title":"FilterState object for date time data — DatetimeFilterState","text":"objects class cloneable method.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DatetimeFilterState.html","id":"usage-2","dir":"Reference","previous_headings":"","what":"Usage","title":"FilterState object for date time data — DatetimeFilterState","text":"","code":"DatetimeFilterState$clone(deep = FALSE)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/DatetimeFilterState.html","id":"arguments-2","dir":"Reference","previous_headings":"","what":"Arguments","title":"FilterState object for date time data — DatetimeFilterState","text":"deep Whether make deep clone.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DatetimeFilterState.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"FilterState object for date time data — DatetimeFilterState","text":"","code":"# use non-exported function from teal.slice include_css_files <- getFromNamespace(\"include_css_files\", \"teal.slice\") include_js_files <- getFromNamespace(\"include_js_files\", \"teal.slice\") DatetimeFilterState <- getFromNamespace(\"DatetimeFilterState\", \"teal.slice\") library(shiny) filter_state <- DatetimeFilterState$new( x = c(Sys.time() + seq(0, by = 3600, length.out = 10), NA), slice = teal_slice(varname = \"x\", dataname = \"data\"), extract_type = character(0) ) isolate(filter_state$get_call()) #> is.na(x) | x >= as.POSIXct(\"2024-11-01 20:01:39\", tz = \"Etc/UTC\") & #> x < as.POSIXct(\"2024-11-02 05:01:40\", tz = \"Etc/UTC\") filter_state$set_state( teal_slice( dataname = \"data\", varname = \"x\", selected = c(Sys.time() + 3L, Sys.time() + 8L), keep_na = TRUE ) ) isolate(filter_state$get_call()) #> is.na(x) | x >= as.POSIXct(\"2024-11-01 20:01:42.383762\", tz = \"Etc/UTC\") & #> x < as.POSIXct(\"2024-11-01 20:01:48.383801\", tz = \"Etc/UTC\") # working filter in an app library(shinyjs) datetimes <- as.POSIXct(c(\"2012-01-01 12:00:00\", \"2020-01-01 12:00:00\")) data_datetime <- c(seq(from = datetimes[1], to = datetimes[2], length.out = 100), NA) fs <- DatetimeFilterState$new( x = data_datetime, slice = teal_slice( varname = \"x\", dataname = \"data\", selected = data_datetime[c(47, 98)], keep_na = TRUE ) ) ui <- fluidPage( useShinyjs(), include_css_files(pattern = \"filter-panel\"), include_js_files(pattern = \"count-bar-labels\"), column(4, tags$div( tags$h4(\"DatetimeFilterState\"), fs$ui(\"fs\") )), column(4, tags$div( id = \"outputs\", # div id is needed for toggling the element tags$h4(\"Condition (i.e. call)\"), # display the condition call generated by this FilterState textOutput(\"condition_datetime\"), tags$br(), tags$h4(\"Unformatted state\"), # display raw filter state textOutput(\"unformatted_datetime\"), tags$br(), tags$h4(\"Formatted state\"), # display human readable filter state textOutput(\"formatted_datetime\"), tags$br() )), column(4, tags$div( tags$h4(\"Programmatic filter control\"), actionButton(\"button1_datetime\", \"set drop NA\", width = \"100%\"), tags$br(), actionButton(\"button2_datetime\", \"set keep NA\", width = \"100%\"), tags$br(), actionButton(\"button3_datetime\", \"set a range\", width = \"100%\"), tags$br(), actionButton(\"button4_datetime\", \"set full range\", width = \"100%\"), tags$br(), actionButton(\"button0_datetime\", \"set initial state\", width = \"100%\"), tags$br() )) ) server <- function(input, output, session) { fs$server(\"fs\") output$condition_datetime <- renderPrint(fs$get_call()) output$formatted_datetime <- renderText(fs$format()) output$unformatted_datetime <- renderPrint(fs$get_state()) # modify filter state programmatically observeEvent( input$button1_datetime, fs$set_state(teal_slice(dataname = \"data\", varname = \"x\", keep_na = FALSE)) ) observeEvent( input$button2_datetime, fs$set_state(teal_slice(dataname = \"data\", varname = \"x\", keep_na = TRUE)) ) observeEvent( input$button3_datetime, fs$set_state( teal_slice(dataname = \"data\", varname = \"x\", selected = data_datetime[c(34, 56)]) ) ) observeEvent( input$button4_datetime, fs$set_state( teal_slice(dataname = \"data\", varname = \"x\", selected = datetimes) ) ) observeEvent( input$button0_datetime, fs$set_state( teal_slice( dataname = \"data\", varname = \"x\", selected = data_datetime[c(47, 98)], keep_na = TRUE ) ) ) } if (interactive()) { shinyApp(ui, server) }"},{"path":"https://insightsengineering.github.io/teal.slice/reference/DefaultFilteredDataset.html","id":null,"dir":"Reference","previous_headings":"","what":"DefaultFilteredDataset R6 class — DefaultFilteredDataset","title":"DefaultFilteredDataset R6 class — DefaultFilteredDataset","text":"Stores object inert entity. Filtering supported.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DefaultFilteredDataset.html","id":"super-class","dir":"Reference","previous_headings":"","what":"Super class","title":"DefaultFilteredDataset R6 class — DefaultFilteredDataset","text":"teal.slice::FilteredDataset -> DefaultFilteredDataset","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DefaultFilteredDataset.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"DefaultFilteredDataset R6 class — DefaultFilteredDataset","text":"teal.slice::FilteredDataset$finalize() teal.slice::FilteredDataset$get_dataname() teal.slice::FilteredDataset$get_dataset() teal.slice::FilteredDataset$get_dataset_label() teal.slice::FilteredDataset$get_keys() teal.slice::FilteredDataset$print() teal.slice::FilteredDataset$srv_active() teal.slice::FilteredDataset$srv_add()","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DefaultFilteredDataset.html","id":"public-methods","dir":"Reference","previous_headings":"","what":"Public methods","title":"DefaultFilteredDataset R6 class — DefaultFilteredDataset","text":"DefaultFilteredDataset$new() DefaultFilteredDataset$format() DefaultFilteredDataset$get_call() DefaultFilteredDataset$get_filter_state() DefaultFilteredDataset$set_filter_state() DefaultFilteredDataset$clear_filter_states() DefaultFilteredDataset$get_filter_overview() DefaultFilteredDataset$ui_active() DefaultFilteredDataset$ui_add() DefaultFilteredDataset$clone()","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DefaultFilteredDataset.html","id":"method-new-","dir":"Reference","previous_headings":"","what":"Method new()","title":"DefaultFilteredDataset R6 class — DefaultFilteredDataset","text":"Initializes DefaultFilteredDataset object.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DefaultFilteredDataset.html","id":"usage","dir":"Reference","previous_headings":"","what":"Usage","title":"DefaultFilteredDataset R6 class — DefaultFilteredDataset","text":"","code":"DefaultFilteredDataset$new(dataset, dataname, label = character(0))"},{"path":"https://insightsengineering.github.io/teal.slice/reference/DefaultFilteredDataset.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"DefaultFilteredDataset R6 class — DefaultFilteredDataset","text":"dataset type object; filtered. dataname (character(1)) syntactically valid name given dataset. label (character(1)) label describe dataset.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DefaultFilteredDataset.html","id":"returns","dir":"Reference","previous_headings":"","what":"Returns","title":"DefaultFilteredDataset R6 class — DefaultFilteredDataset","text":"Object class DefaultFilteredDataset, invisibly.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DefaultFilteredDataset.html","id":"method-format-","dir":"Reference","previous_headings":"","what":"Method format()","title":"DefaultFilteredDataset R6 class — DefaultFilteredDataset","text":"Returns formatted string representing DefaultFilteredDataset object.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DefaultFilteredDataset.html","id":"usage-1","dir":"Reference","previous_headings":"","what":"Usage","title":"DefaultFilteredDataset R6 class — DefaultFilteredDataset","text":"","code":"DefaultFilteredDataset$format(show_all, trim_lines = FALSE)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/DefaultFilteredDataset.html","id":"arguments-1","dir":"Reference","previous_headings":"","what":"Arguments","title":"DefaultFilteredDataset R6 class — DefaultFilteredDataset","text":"show_all (logical(1)) method consistency, ignored. trim_lines (logical(1)) flag specifying whether trim lines class names long.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DefaultFilteredDataset.html","id":"returns-1","dir":"Reference","previous_headings":"","what":"Returns","title":"DefaultFilteredDataset R6 class — DefaultFilteredDataset","text":"formatted string.","code":""},{"path":[]},{"path":"https://insightsengineering.github.io/teal.slice/reference/DefaultFilteredDataset.html","id":"usage-2","dir":"Reference","previous_headings":"","what":"Usage","title":"DefaultFilteredDataset R6 class — DefaultFilteredDataset","text":"","code":"DefaultFilteredDataset$get_call(sid)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/DefaultFilteredDataset.html","id":"arguments-2","dir":"Reference","previous_headings":"","what":"Arguments","title":"DefaultFilteredDataset R6 class — DefaultFilteredDataset","text":"sid (character(1)) method consistency, ignored.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DefaultFilteredDataset.html","id":"returns-2","dir":"Reference","previous_headings":"","what":"Returns","title":"DefaultFilteredDataset R6 class — DefaultFilteredDataset","text":"NULL, invisibly.","code":""},{"path":[]},{"path":"https://insightsengineering.github.io/teal.slice/reference/DefaultFilteredDataset.html","id":"usage-3","dir":"Reference","previous_headings":"","what":"Usage","title":"DefaultFilteredDataset R6 class — DefaultFilteredDataset","text":"","code":"DefaultFilteredDataset$get_filter_state()"},{"path":"https://insightsengineering.github.io/teal.slice/reference/DefaultFilteredDataset.html","id":"returns-3","dir":"Reference","previous_headings":"","what":"Returns","title":"DefaultFilteredDataset R6 class — DefaultFilteredDataset","text":"NULL, invisibly.","code":""},{"path":[]},{"path":"https://insightsengineering.github.io/teal.slice/reference/DefaultFilteredDataset.html","id":"usage-4","dir":"Reference","previous_headings":"","what":"Usage","title":"DefaultFilteredDataset R6 class — DefaultFilteredDataset","text":"","code":"DefaultFilteredDataset$set_filter_state(state)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/DefaultFilteredDataset.html","id":"arguments-3","dir":"Reference","previous_headings":"","what":"Arguments","title":"DefaultFilteredDataset R6 class — DefaultFilteredDataset","text":"state (teal_slices) method consistency, ignored.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DefaultFilteredDataset.html","id":"returns-4","dir":"Reference","previous_headings":"","what":"Returns","title":"DefaultFilteredDataset R6 class — DefaultFilteredDataset","text":"NULL, invisibly.","code":""},{"path":[]},{"path":"https://insightsengineering.github.io/teal.slice/reference/DefaultFilteredDataset.html","id":"usage-5","dir":"Reference","previous_headings":"","what":"Usage","title":"DefaultFilteredDataset R6 class — DefaultFilteredDataset","text":"","code":"DefaultFilteredDataset$clear_filter_states(force)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/DefaultFilteredDataset.html","id":"arguments-4","dir":"Reference","previous_headings":"","what":"Arguments","title":"DefaultFilteredDataset R6 class — DefaultFilteredDataset","text":"force (logical(1)) method consistency, ignored.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DefaultFilteredDataset.html","id":"returns-5","dir":"Reference","previous_headings":"","what":"Returns","title":"DefaultFilteredDataset R6 class — DefaultFilteredDataset","text":"NULL, invisibly.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DefaultFilteredDataset.html","id":"method-get-filter-overview-","dir":"Reference","previous_headings":"","what":"Method get_filter_overview()","title":"DefaultFilteredDataset R6 class — DefaultFilteredDataset","text":"Creates row filter overview form dataname - unsupported data class","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DefaultFilteredDataset.html","id":"usage-6","dir":"Reference","previous_headings":"","what":"Usage","title":"DefaultFilteredDataset R6 class — DefaultFilteredDataset","text":"","code":"DefaultFilteredDataset$get_filter_overview()"},{"path":"https://insightsengineering.github.io/teal.slice/reference/DefaultFilteredDataset.html","id":"returns-6","dir":"Reference","previous_headings":"","what":"Returns","title":"DefaultFilteredDataset R6 class — DefaultFilteredDataset","text":"data.frame.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DefaultFilteredDataset.html","id":"method-ui-active-","dir":"Reference","previous_headings":"","what":"Method ui_active()","title":"DefaultFilteredDataset R6 class — DefaultFilteredDataset","text":"Overwrites parent method.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DefaultFilteredDataset.html","id":"usage-7","dir":"Reference","previous_headings":"","what":"Usage","title":"DefaultFilteredDataset R6 class — DefaultFilteredDataset","text":"","code":"DefaultFilteredDataset$ui_active(id, allow_add)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/DefaultFilteredDataset.html","id":"arguments-5","dir":"Reference","previous_headings":"","what":"Arguments","title":"DefaultFilteredDataset R6 class — DefaultFilteredDataset","text":"id (character(1)) shiny module instance id. allow_add (ignored)","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DefaultFilteredDataset.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"DefaultFilteredDataset R6 class — DefaultFilteredDataset","text":"Blank UI module list active filter states dataset.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DefaultFilteredDataset.html","id":"returns-7","dir":"Reference","previous_headings":"","what":"Returns","title":"DefaultFilteredDataset R6 class — DefaultFilteredDataset","text":"empty div.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DefaultFilteredDataset.html","id":"method-ui-add-","dir":"Reference","previous_headings":"","what":"Method ui_add()","title":"DefaultFilteredDataset R6 class — DefaultFilteredDataset","text":"Overwrites parent method.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DefaultFilteredDataset.html","id":"usage-8","dir":"Reference","previous_headings":"","what":"Usage","title":"DefaultFilteredDataset R6 class — DefaultFilteredDataset","text":"","code":"DefaultFilteredDataset$ui_add(id)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/DefaultFilteredDataset.html","id":"arguments-6","dir":"Reference","previous_headings":"","what":"Arguments","title":"DefaultFilteredDataset R6 class — DefaultFilteredDataset","text":"id (character(1)) shiny module instance id.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DefaultFilteredDataset.html","id":"details-1","dir":"Reference","previous_headings":"","what":"Details","title":"DefaultFilteredDataset R6 class — DefaultFilteredDataset","text":"Blank UI module list active filter states dataset.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DefaultFilteredDataset.html","id":"returns-8","dir":"Reference","previous_headings":"","what":"Returns","title":"DefaultFilteredDataset R6 class — DefaultFilteredDataset","text":"empty div.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DefaultFilteredDataset.html","id":"method-clone-","dir":"Reference","previous_headings":"","what":"Method clone()","title":"DefaultFilteredDataset R6 class — DefaultFilteredDataset","text":"objects class cloneable method.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DefaultFilteredDataset.html","id":"usage-9","dir":"Reference","previous_headings":"","what":"Usage","title":"DefaultFilteredDataset R6 class — DefaultFilteredDataset","text":"","code":"DefaultFilteredDataset$clone(deep = FALSE)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/DefaultFilteredDataset.html","id":"arguments-7","dir":"Reference","previous_headings":"","what":"Arguments","title":"DefaultFilteredDataset R6 class — DefaultFilteredDataset","text":"deep Whether make deep clone.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/DefaultFilteredDataset.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"DefaultFilteredDataset R6 class — DefaultFilteredDataset","text":"","code":"# use non-exported function from teal.slice DefaultFilteredDataset <- getFromNamespace(\"DefaultFilteredDataset\", \"teal.slice\") library(shiny) ds <- DefaultFilteredDataset$new(letters, \"letters\") isolate(ds$get_filter_state()) isolate(ds$get_call())"},{"path":"https://insightsengineering.github.io/teal.slice/reference/EmptyFilterState.html","id":null,"dir":"Reference","previous_headings":"","what":"FilterState object for empty variables — EmptyFilterState","title":"FilterState object for empty variables — EmptyFilterState","text":"FilterState subclass representing empty variable.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/EmptyFilterState.html","id":"super-class","dir":"Reference","previous_headings":"","what":"Super class","title":"FilterState object for empty variables — EmptyFilterState","text":"teal.slice::FilterState -> EmptyFilterState","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/EmptyFilterState.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"FilterState object for empty variables — EmptyFilterState","text":"teal.slice::FilterState$finalize() teal.slice::FilterState$format() teal.slice::FilterState$get_state() teal.slice::FilterState$print() teal.slice::FilterState$server() teal.slice::FilterState$set_state() teal.slice::FilterState$ui()","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/EmptyFilterState.html","id":"public-methods","dir":"Reference","previous_headings":"","what":"Public methods","title":"FilterState object for empty variables — EmptyFilterState","text":"EmptyFilterState$new() EmptyFilterState$get_call() EmptyFilterState$clone()","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/EmptyFilterState.html","id":"method-new-","dir":"Reference","previous_headings":"","what":"Method new()","title":"FilterState object for empty variables — EmptyFilterState","text":"Initialize EmptyFilterState object.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/EmptyFilterState.html","id":"usage","dir":"Reference","previous_headings":"","what":"Usage","title":"FilterState object for empty variables — EmptyFilterState","text":"","code":"EmptyFilterState$new( x, x_reactive = reactive(NULL), extract_type = character(0), slice )"},{"path":"https://insightsengineering.github.io/teal.slice/reference/EmptyFilterState.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"FilterState object for empty variables — EmptyFilterState","text":"x (vector) variable filtered, x_reactive (reactive) returning vector type x. used update counts following change values filtered dataset. set reactive(NULL) counts based filtered dataset shown. extract_type (character) specifying whether condition calls prefixed dataname. Possible values: character(0) (default) varname condition call prefixed \"list\" varname condition call returned $ \"matrix\" varname condition call returned [, ] slice (teal_slice) specification filter state. teal_slice stored object set_state directly manipulates values within teal_slice. get_state returns teal_slice object can reused places. Note teal_slice reactiveValues, means reference semantics, .e. changes made object automatically reflected places refer teal_slice.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/EmptyFilterState.html","id":"returns","dir":"Reference","previous_headings":"","what":"Returns","title":"FilterState object for empty variables — EmptyFilterState","text":"Object class EmptyFilterState, invisibly.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/EmptyFilterState.html","id":"method-get-call-","dir":"Reference","previous_headings":"","what":"Method get_call()","title":"FilterState object for empty variables — EmptyFilterState","text":"Returns reproducible condition call current selection relevant selected variable type. Uses internal reactive values, hence must called reactive isolated context.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/EmptyFilterState.html","id":"usage-1","dir":"Reference","previous_headings":"","what":"Usage","title":"FilterState object for empty variables — EmptyFilterState","text":"","code":"EmptyFilterState$get_call(dataname)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/EmptyFilterState.html","id":"arguments-1","dir":"Reference","previous_headings":"","what":"Arguments","title":"FilterState object for empty variables — EmptyFilterState","text":"dataname name data set; defaults private$get_dataname()","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/EmptyFilterState.html","id":"returns-1","dir":"Reference","previous_headings":"","what":"Returns","title":"FilterState object for empty variables — EmptyFilterState","text":"logical(1)","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/EmptyFilterState.html","id":"method-clone-","dir":"Reference","previous_headings":"","what":"Method clone()","title":"FilterState object for empty variables — EmptyFilterState","text":"objects class cloneable method.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/EmptyFilterState.html","id":"usage-2","dir":"Reference","previous_headings":"","what":"Usage","title":"FilterState object for empty variables — EmptyFilterState","text":"","code":"EmptyFilterState$clone(deep = FALSE)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/EmptyFilterState.html","id":"arguments-2","dir":"Reference","previous_headings":"","what":"Arguments","title":"FilterState object for empty variables — EmptyFilterState","text":"deep Whether make deep clone.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/EmptyFilterState.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"FilterState object for empty variables — EmptyFilterState","text":"","code":"# use non-exported function from teal.slice include_js_files <- getFromNamespace(\"include_js_files\", \"teal.slice\") EmptyFilterState <- getFromNamespace(\"EmptyFilterState\", \"teal.slice\") library(shiny) filter_state <- EmptyFilterState$new( x = NA, slice = teal_slice(varname = \"x\", dataname = \"data\"), extract_type = character(0) ) isolate(filter_state$get_call()) #> NULL filter_state$set_state(teal_slice(dataname = \"data\", varname = \"x\", keep_na = TRUE)) isolate(filter_state$get_call()) #> NULL"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterPanelAPI.html","id":null,"dir":"Reference","previous_headings":"","what":"Class to encapsulate the API of the filter panel of a teal app — FilterPanelAPI","title":"Class to encapsulate the API of the filter panel of a teal app — FilterPanelAPI","text":"API class managing filter states teal application's filter panel.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterPanelAPI.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Class to encapsulate the API of the filter panel of a teal app — FilterPanelAPI","text":"purpose class encapsulate API filter panel new class FilterPanelAPI can passed used server call module instead passing whole FilteredData object. class supported methods set, get, remove filter states filter panel API.","code":""},{"path":[]},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterPanelAPI.html","id":"public-methods","dir":"Reference","previous_headings":"","what":"Public methods","title":"Class to encapsulate the API of the filter panel of a teal app — FilterPanelAPI","text":"FilterPanelAPI$new() FilterPanelAPI$get_filter_state() FilterPanelAPI$set_filter_state() FilterPanelAPI$remove_filter_state() FilterPanelAPI$clear_filter_states() FilterPanelAPI$clone()","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterPanelAPI.html","id":"method-new-","dir":"Reference","previous_headings":"","what":"Method new()","title":"Class to encapsulate the API of the filter panel of a teal app — FilterPanelAPI","text":"Initialize FilterPanelAPI object.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterPanelAPI.html","id":"usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Class to encapsulate the API of the filter panel of a teal app — FilterPanelAPI","text":"","code":"FilterPanelAPI$new(datasets)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterPanelAPI.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Class to encapsulate the API of the filter panel of a teal app — FilterPanelAPI","text":"datasets (FilteredData)","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterPanelAPI.html","id":"method-get-filter-state-","dir":"Reference","previous_headings":"","what":"Method get_filter_state()","title":"Class to encapsulate the API of the filter panel of a teal app — FilterPanelAPI","text":"Gets reactive values active FilterState objects FilteredData object. Gets active filters form nested list. output list compatible input set_filter_state.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterPanelAPI.html","id":"usage-1","dir":"Reference","previous_headings":"","what":"Usage","title":"Class to encapsulate the API of the filter panel of a teal app — FilterPanelAPI","text":"","code":"FilterPanelAPI$get_filter_state()"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterPanelAPI.html","id":"returns","dir":"Reference","previous_headings":"","what":"Returns","title":"Class to encapsulate the API of the filter panel of a teal app — FilterPanelAPI","text":"list named elements corresponding FilteredDataset objects active filters.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterPanelAPI.html","id":"method-set-filter-state-","dir":"Reference","previous_headings":"","what":"Method set_filter_state()","title":"Class to encapsulate the API of the filter panel of a teal app — FilterPanelAPI","text":"Sets active filter states.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterPanelAPI.html","id":"usage-2","dir":"Reference","previous_headings":"","what":"Usage","title":"Class to encapsulate the API of the filter panel of a teal app — FilterPanelAPI","text":"","code":"FilterPanelAPI$set_filter_state(filter)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterPanelAPI.html","id":"arguments-1","dir":"Reference","previous_headings":"","what":"Arguments","title":"Class to encapsulate the API of the filter panel of a teal app — FilterPanelAPI","text":"filter (teal_slices)","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterPanelAPI.html","id":"returns-1","dir":"Reference","previous_headings":"","what":"Returns","title":"Class to encapsulate the API of the filter panel of a teal app — FilterPanelAPI","text":"NULL, invisibly.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterPanelAPI.html","id":"method-remove-filter-state-","dir":"Reference","previous_headings":"","what":"Method remove_filter_state()","title":"Class to encapsulate the API of the filter panel of a teal app — FilterPanelAPI","text":"Remove one FilterState FilteredDataset FilteredData object.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterPanelAPI.html","id":"usage-3","dir":"Reference","previous_headings":"","what":"Usage","title":"Class to encapsulate the API of the filter panel of a teal app — FilterPanelAPI","text":"","code":"FilterPanelAPI$remove_filter_state(filter)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterPanelAPI.html","id":"arguments-2","dir":"Reference","previous_headings":"","what":"Arguments","title":"Class to encapsulate the API of the filter panel of a teal app — FilterPanelAPI","text":"filter (teal_slices) specifying FilterState objects remove; teal_slices may contain dataname varname, elements ignored","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterPanelAPI.html","id":"returns-2","dir":"Reference","previous_headings":"","what":"Returns","title":"Class to encapsulate the API of the filter panel of a teal app — FilterPanelAPI","text":"NULL, invisibly.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterPanelAPI.html","id":"method-clear-filter-states-","dir":"Reference","previous_headings":"","what":"Method clear_filter_states()","title":"Class to encapsulate the API of the filter panel of a teal app — FilterPanelAPI","text":"Remove FilterStates FilteredData object.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterPanelAPI.html","id":"usage-4","dir":"Reference","previous_headings":"","what":"Usage","title":"Class to encapsulate the API of the filter panel of a teal app — FilterPanelAPI","text":"","code":"FilterPanelAPI$clear_filter_states(datanames)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterPanelAPI.html","id":"arguments-3","dir":"Reference","previous_headings":"","what":"Arguments","title":"Class to encapsulate the API of the filter panel of a teal app — FilterPanelAPI","text":"datanames (character) datanames remove FilterStates; omit remove FilterStates FilteredData object","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterPanelAPI.html","id":"returns-3","dir":"Reference","previous_headings":"","what":"Returns","title":"Class to encapsulate the API of the filter panel of a teal app — FilterPanelAPI","text":"NULL, invisibly.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterPanelAPI.html","id":"method-clone-","dir":"Reference","previous_headings":"","what":"Method clone()","title":"Class to encapsulate the API of the filter panel of a teal app — FilterPanelAPI","text":"objects class cloneable method.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterPanelAPI.html","id":"usage-5","dir":"Reference","previous_headings":"","what":"Usage","title":"Class to encapsulate the API of the filter panel of a teal app — FilterPanelAPI","text":"","code":"FilterPanelAPI$clone(deep = FALSE)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterPanelAPI.html","id":"arguments-4","dir":"Reference","previous_headings":"","what":"Arguments","title":"Class to encapsulate the API of the filter panel of a teal app — FilterPanelAPI","text":"deep Whether make deep clone.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterPanelAPI.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Class to encapsulate the API of the filter panel of a teal app — FilterPanelAPI","text":"","code":"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()) #> { #> \"slices\": [], #> \"attributes\": { #> \"include_varnames\" : { #> \"iris\" : [\"Sepal.Length\", \"Sepal.Width\", ... #> }, #> \"count_type\" : \"none\", #> \"allow_add\" : true #> } #> } # 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()) #> { #> \"slices\": [ #> { #> \"dataname\" : \"iris\", #> \"varname\" : \"Species\", #> \"id\" : \"iris Species\", #> \"choices\" : [\"setosa\", \"versicolor\", \"virgin... #> \"selected\" : [\"setosa\"], #> \"keep_na\" : true, #> \"fixed\" : false, #> \"anchored\" : false, #> \"multiple\" : true #> } #> ], #> \"attributes\": { #> \"include_varnames\" : { #> \"iris\" : [\"Sepal.Length\", \"Sepal.Width\", ... #> }, #> \"count_type\" : \"none\", #> \"allow_add\" : true #> } #> } # remove all_filter_states fpa$clear_filter_states() # get the actual filter state --> empty named list isolate(fpa$get_filter_state()) #> { #> \"slices\": [], #> \"attributes\": { #> \"include_varnames\" : { #> \"iris\" : [\"Sepal.Length\", \"Sepal.Width\", ... #> }, #> \"count_type\" : \"none\", #> \"allow_add\" : true #> } #> }"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterState.html","id":null,"dir":"Reference","previous_headings":"","what":"FilterState abstract class — FilterState","title":"FilterState abstract class — FilterState","text":"Abstract class encapsulate single filter state.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterState.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"FilterState abstract class — FilterState","text":"class responsible managing single filter item within FilteredData object outputs condition call (logical predicate) subsetting one variable. Filter states depend variable type: (logical, integer, numeric, character, factor, Date, POSIXct, POSIXlt) FilterState subclasses exist correspond types. logical: class = LogicalFilterState integer: class = RangeFilterState numeric: class = RangeFilterState character: class = ChoicesFilterState factor: class = ChoicesFilterState Date: class = DateFilterState POSIXct, POSIXlt: class = DatetimeFilterState NA entries: class: FilterState, filtered default: FilterState, filtered variable's filter state R6 object keeps variable filtered, teal_slice object describes filter state, well shiny module (UI server) allows user alter filter state. Changes filter state cause observations omitted trigger get_call method every R function call reactive chain.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterState.html","id":"modifying-state","dir":"Reference","previous_headings":"","what":"Modifying state","title":"FilterState abstract class — FilterState","text":"Modifying FilterState object possible three scenarios: interactive session, passing appropriate teal_slice set_state method. running application, changing appropriate inputs. running application, using filter_state_api directly uses set_state method FilterState object.","code":""},{"path":[]},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterState.html","id":"public-methods","dir":"Reference","previous_headings":"","what":"Public methods","title":"FilterState abstract class — FilterState","text":"FilterState$new() FilterState$format() FilterState$print() FilterState$set_state() FilterState$get_state() FilterState$get_call() FilterState$server() FilterState$ui() FilterState$finalize() FilterState$clone()","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterState.html","id":"method-new-","dir":"Reference","previous_headings":"","what":"Method new()","title":"FilterState abstract class — FilterState","text":"Initialize FilterState object.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterState.html","id":"usage","dir":"Reference","previous_headings":"","what":"Usage","title":"FilterState abstract class — FilterState","text":"","code":"FilterState$new( x, x_reactive = reactive(NULL), slice, extract_type = character(0) )"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterState.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"FilterState abstract class — FilterState","text":"x (vector) variable filtered. x_reactive (reactive) returning vector type x. used update counts following change values filtered dataset. set reactive(NULL) counts based filtered dataset shown. slice (teal_slice) specification filter state. teal_slice stored object set_state directly manipulates values within teal_slice. get_state returns teal_slice object can reused places. Note teal_slice reactiveValues, means reference semantics, .e. changes made object automatically reflected places refer teal_slice. extract_type (character) specifying whether condition calls prefixed dataname. Possible values: character(0) (default) varname condition call prefixed \"list\" varname condition call returned $ \"matrix\" varname condition call returned [, ]","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterState.html","id":"returns","dir":"Reference","previous_headings":"","what":"Returns","title":"FilterState abstract class — FilterState","text":"Object class FilterState, invisibly.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterState.html","id":"method-format-","dir":"Reference","previous_headings":"","what":"Method format()","title":"FilterState abstract class — FilterState","text":"Returns formatted string representing FilterState object.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterState.html","id":"usage-1","dir":"Reference","previous_headings":"","what":"Usage","title":"FilterState abstract class — FilterState","text":"","code":"FilterState$format(show_all = FALSE, trim_lines = TRUE)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterState.html","id":"arguments-1","dir":"Reference","previous_headings":"","what":"Arguments","title":"FilterState abstract class — FilterState","text":"show_all (logical(1)) passed format.teal_slice trim_lines (logical(1)) passed format.teal_slice","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterState.html","id":"returns-1","dir":"Reference","previous_headings":"","what":"Returns","title":"FilterState abstract class — FilterState","text":"character(1) formatted string","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterState.html","id":"method-print-","dir":"Reference","previous_headings":"","what":"Method print()","title":"FilterState abstract class — FilterState","text":"Prints FilterState object.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterState.html","id":"usage-2","dir":"Reference","previous_headings":"","what":"Usage","title":"FilterState abstract class — FilterState","text":"","code":"FilterState$print(...)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterState.html","id":"arguments-2","dir":"Reference","previous_headings":"","what":"Arguments","title":"FilterState abstract class — FilterState","text":"... additional arguments","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterState.html","id":"method-set-state-","dir":"Reference","previous_headings":"","what":"Method set_state()","title":"FilterState abstract class — FilterState","text":"Sets mutable parameters filter state. fixed state prevented changing state anchored state prevented removing state","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterState.html","id":"usage-3","dir":"Reference","previous_headings":"","what":"Usage","title":"FilterState abstract class — FilterState","text":"","code":"FilterState$set_state(state)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterState.html","id":"arguments-3","dir":"Reference","previous_headings":"","what":"Arguments","title":"FilterState abstract class — FilterState","text":"state (teal_slice)","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterState.html","id":"returns-2","dir":"Reference","previous_headings":"","what":"Returns","title":"FilterState abstract class — FilterState","text":"self invisibly","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterState.html","id":"method-get-state-","dir":"Reference","previous_headings":"","what":"Method get_state()","title":"FilterState abstract class — FilterState","text":"Returns complete description filter state.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterState.html","id":"usage-4","dir":"Reference","previous_headings":"","what":"Usage","title":"FilterState abstract class — FilterState","text":"","code":"FilterState$get_state()"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterState.html","id":"returns-3","dir":"Reference","previous_headings":"","what":"Returns","title":"FilterState abstract class — FilterState","text":"teal_slice object.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterState.html","id":"method-get-call-","dir":"Reference","previous_headings":"","what":"Method get_call()","title":"FilterState abstract class — FilterState","text":"Returns reproducible condition call current selection relevant selected variable type. Method using internal reactive values makes reactive must executed reactive isolated context.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterState.html","id":"usage-5","dir":"Reference","previous_headings":"","what":"Usage","title":"FilterState abstract class — FilterState","text":"","code":"FilterState$get_call()"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterState.html","id":"method-server-","dir":"Reference","previous_headings":"","what":"Method server()","title":"FilterState abstract class — FilterState","text":"shiny module server.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterState.html","id":"usage-6","dir":"Reference","previous_headings":"","what":"Usage","title":"FilterState abstract class — FilterState","text":"","code":"FilterState$server(id, remove_callback)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterState.html","id":"arguments-4","dir":"Reference","previous_headings":"","what":"Arguments","title":"FilterState abstract class — FilterState","text":"id (character(1)) shiny module instance id. remove_callback (function) callback handle removal FilterState object state_list","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterState.html","id":"returns-4","dir":"Reference","previous_headings":"","what":"Returns","title":"FilterState abstract class — FilterState","text":"Reactive expression signaling remove button clicked.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterState.html","id":"method-ui-","dir":"Reference","previous_headings":"","what":"Method ui()","title":"FilterState abstract class — FilterState","text":"shiny UI module. UI class contains simple message stating supported.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterState.html","id":"usage-7","dir":"Reference","previous_headings":"","what":"Usage","title":"FilterState abstract class — FilterState","text":"","code":"FilterState$ui(id, parent_id = \"cards\")"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterState.html","id":"arguments-5","dir":"Reference","previous_headings":"","what":"Arguments","title":"FilterState abstract class — FilterState","text":"id (character(1)) shiny module instance id. parent_id (character(1)) id FilterStates card container","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterState.html","id":"method-finalize-","dir":"Reference","previous_headings":"","what":"Method finalize()","title":"FilterState abstract class — FilterState","text":"Destroy inputs observers stored private$session_bindings.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterState.html","id":"usage-8","dir":"Reference","previous_headings":"","what":"Usage","title":"FilterState abstract class — FilterState","text":"","code":"FilterState$finalize()"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterState.html","id":"returns-5","dir":"Reference","previous_headings":"","what":"Returns","title":"FilterState abstract class — FilterState","text":"NULL, invisibly.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterState.html","id":"method-clone-","dir":"Reference","previous_headings":"","what":"Method clone()","title":"FilterState abstract class — FilterState","text":"objects class cloneable method.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterState.html","id":"usage-9","dir":"Reference","previous_headings":"","what":"Usage","title":"FilterState abstract class — FilterState","text":"","code":"FilterState$clone(deep = FALSE)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterState.html","id":"arguments-6","dir":"Reference","previous_headings":"","what":"Arguments","title":"FilterState abstract class — FilterState","text":"deep Whether make deep clone.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStateExpr.html","id":null,"dir":"Reference","previous_headings":"","what":"FilterStateExpr R6 class — FilterStateExpr","title":"FilterStateExpr R6 class — FilterStateExpr","text":"Sister class FilterState handles arbitrary filter expressions.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStateExpr.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"FilterStateExpr R6 class — FilterStateExpr","text":"Creates filter state around predefined condition call (logical predicate). condition call independent data filter card allows interaction (filter always fixed).","code":""},{"path":[]},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStateExpr.html","id":"public-methods","dir":"Reference","previous_headings":"","what":"Public methods","title":"FilterStateExpr R6 class — FilterStateExpr","text":"FilterStateExpr$new() FilterStateExpr$format() FilterStateExpr$print() FilterStateExpr$get_state() FilterStateExpr$set_state() FilterStateExpr$get_call() FilterStateExpr$finalize() FilterStateExpr$server() FilterStateExpr$ui() FilterStateExpr$clone()","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStateExpr.html","id":"method-new-","dir":"Reference","previous_headings":"","what":"Method new()","title":"FilterStateExpr R6 class — FilterStateExpr","text":"Initialize FilterStateExpr object.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStateExpr.html","id":"usage","dir":"Reference","previous_headings":"","what":"Usage","title":"FilterStateExpr R6 class — FilterStateExpr","text":"","code":"FilterStateExpr$new(slice)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStateExpr.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"FilterStateExpr R6 class — FilterStateExpr","text":"slice (teal_slice_expr)","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStateExpr.html","id":"returns","dir":"Reference","previous_headings":"","what":"Returns","title":"FilterStateExpr R6 class — FilterStateExpr","text":"Object class FilterStateExpr, invisibly.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStateExpr.html","id":"method-format-","dir":"Reference","previous_headings":"","what":"Method format()","title":"FilterStateExpr R6 class — FilterStateExpr","text":"Returns formatted string representing FilterStateExpr object.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStateExpr.html","id":"usage-1","dir":"Reference","previous_headings":"","what":"Usage","title":"FilterStateExpr R6 class — FilterStateExpr","text":"","code":"FilterStateExpr$format(show_all = FALSE, trim_lines = TRUE)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStateExpr.html","id":"arguments-1","dir":"Reference","previous_headings":"","what":"Arguments","title":"FilterStateExpr R6 class — FilterStateExpr","text":"show_all (logical(1)) passed format.teal_slice trim_lines (logical(1)) passed format.teal_slice","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStateExpr.html","id":"returns-1","dir":"Reference","previous_headings":"","what":"Returns","title":"FilterStateExpr R6 class — FilterStateExpr","text":"character(1) formatted string","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStateExpr.html","id":"method-print-","dir":"Reference","previous_headings":"","what":"Method print()","title":"FilterStateExpr R6 class — FilterStateExpr","text":"Prints FilterStateExpr object.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStateExpr.html","id":"usage-2","dir":"Reference","previous_headings":"","what":"Usage","title":"FilterStateExpr R6 class — FilterStateExpr","text":"","code":"FilterStateExpr$print(...)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStateExpr.html","id":"arguments-2","dir":"Reference","previous_headings":"","what":"Arguments","title":"FilterStateExpr R6 class — FilterStateExpr","text":"... arguments passed format method","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStateExpr.html","id":"returns-2","dir":"Reference","previous_headings":"","what":"Returns","title":"FilterStateExpr R6 class — FilterStateExpr","text":"NULL, invisibly.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStateExpr.html","id":"method-get-state-","dir":"Reference","previous_headings":"","what":"Method get_state()","title":"FilterStateExpr R6 class — FilterStateExpr","text":"Returns complete description filter state.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStateExpr.html","id":"usage-3","dir":"Reference","previous_headings":"","what":"Usage","title":"FilterStateExpr R6 class — FilterStateExpr","text":"","code":"FilterStateExpr$get_state()"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStateExpr.html","id":"returns-3","dir":"Reference","previous_headings":"","what":"Returns","title":"FilterStateExpr R6 class — FilterStateExpr","text":"teal_slice object.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStateExpr.html","id":"method-set-state-","dir":"Reference","previous_headings":"","what":"Method set_state()","title":"FilterStateExpr R6 class — FilterStateExpr","text":"nothing. Exists compatibility.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStateExpr.html","id":"usage-4","dir":"Reference","previous_headings":"","what":"Usage","title":"FilterStateExpr R6 class — FilterStateExpr","text":"","code":"FilterStateExpr$set_state(state)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStateExpr.html","id":"arguments-3","dir":"Reference","previous_headings":"","what":"Arguments","title":"FilterStateExpr R6 class — FilterStateExpr","text":"state (teal_slice)","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStateExpr.html","id":"returns-4","dir":"Reference","previous_headings":"","what":"Returns","title":"FilterStateExpr R6 class — FilterStateExpr","text":"self, invisibly.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStateExpr.html","id":"method-get-call-","dir":"Reference","previous_headings":"","what":"Method get_call()","title":"FilterStateExpr R6 class — FilterStateExpr","text":"Get reproducible call.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStateExpr.html","id":"usage-5","dir":"Reference","previous_headings":"","what":"Usage","title":"FilterStateExpr R6 class — FilterStateExpr","text":"","code":"FilterStateExpr$get_call(dataname)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStateExpr.html","id":"arguments-4","dir":"Reference","previous_headings":"","what":"Arguments","title":"FilterStateExpr R6 class — FilterStateExpr","text":"dataname (ignored) consistency FilterState Returns reproducible condition call current selection relevant selected variable type. Method using internal reactive values makes reactive must executed reactive isolated context.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStateExpr.html","id":"returns-5","dir":"Reference","previous_headings":"","what":"Returns","title":"FilterStateExpr R6 class — FilterStateExpr","text":"call NULL","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStateExpr.html","id":"method-finalize-","dir":"Reference","previous_headings":"","what":"Method finalize()","title":"FilterStateExpr R6 class — FilterStateExpr","text":"Destroy inputs observers stored private$session_bindings.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStateExpr.html","id":"usage-6","dir":"Reference","previous_headings":"","what":"Usage","title":"FilterStateExpr R6 class — FilterStateExpr","text":"","code":"FilterStateExpr$finalize()"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStateExpr.html","id":"returns-6","dir":"Reference","previous_headings":"","what":"Returns","title":"FilterStateExpr R6 class — FilterStateExpr","text":"NULL, invisibly.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStateExpr.html","id":"method-server-","dir":"Reference","previous_headings":"","what":"Method server()","title":"FilterStateExpr R6 class — FilterStateExpr","text":"shiny module server.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStateExpr.html","id":"usage-7","dir":"Reference","previous_headings":"","what":"Usage","title":"FilterStateExpr R6 class — FilterStateExpr","text":"","code":"FilterStateExpr$server(id, remove_callback)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStateExpr.html","id":"arguments-5","dir":"Reference","previous_headings":"","what":"Arguments","title":"FilterStateExpr R6 class — FilterStateExpr","text":"id (character(1)) shiny module instance id. remove_callback (function) callback handle removal FilterState object state_list","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStateExpr.html","id":"returns-7","dir":"Reference","previous_headings":"","what":"Returns","title":"FilterStateExpr R6 class — FilterStateExpr","text":"Reactive expression signaling remove button clicked.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStateExpr.html","id":"method-ui-","dir":"Reference","previous_headings":"","what":"Method ui()","title":"FilterStateExpr R6 class — FilterStateExpr","text":"shiny module UI. UI class contains simple message stating supported.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStateExpr.html","id":"usage-8","dir":"Reference","previous_headings":"","what":"Usage","title":"FilterStateExpr R6 class — FilterStateExpr","text":"","code":"FilterStateExpr$ui(id, parent_id = \"cards\")"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStateExpr.html","id":"arguments-6","dir":"Reference","previous_headings":"","what":"Arguments","title":"FilterStateExpr R6 class — FilterStateExpr","text":"id (character(1)) shiny module instance id. parent_id (character(1)) id FilterStates card container.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStateExpr.html","id":"method-clone-","dir":"Reference","previous_headings":"","what":"Method clone()","title":"FilterStateExpr R6 class — FilterStateExpr","text":"objects class cloneable method.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStateExpr.html","id":"usage-9","dir":"Reference","previous_headings":"","what":"Usage","title":"FilterStateExpr R6 class — FilterStateExpr","text":"","code":"FilterStateExpr$clone(deep = FALSE)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStateExpr.html","id":"arguments-7","dir":"Reference","previous_headings":"","what":"Arguments","title":"FilterStateExpr R6 class — FilterStateExpr","text":"deep Whether make deep clone.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStateExpr.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"FilterStateExpr R6 class — FilterStateExpr","text":"","code":"# use non-exported function from teal.slice include_js_files <- getFromNamespace(\"include_js_files\", \"teal.slice\") include_css_files <- getFromNamespace(\"include_css_files\", \"teal.slice\") FilterStateExpr <- getFromNamespace(\"FilterStateExpr\", \"teal.slice\") filter_state <- FilterStateExpr$new( slice = teal_slice( dataname = \"x\", id = \"FA\", title = \"Adult females\", expr = \"sex == 'F' & age >= 18\" ) ) filter_state$get_call() #> sex == \"F\" & age >= 18 # working filter in an app library(shiny) library(shinyjs) ui <- fluidPage( useShinyjs(), include_css_files(pattern = \"filter-panel\"), include_js_files(pattern = \"count-bar-labels\"), column(4, tags$div( tags$h4(\"ChoicesFilterState\"), filter_state$ui(\"fs\") )), column(8, tags$div( tags$h4(\"Condition (i.e. call)\"), # display the condition call generated by this FilterState textOutput(\"condition_choices\"), tags$br(), tags$h4(\"Unformatted state\"), # display raw filter state textOutput(\"unformatted_choices\"), tags$br(), tags$h4(\"Formatted state\"), # display human readable filter state textOutput(\"formatted_choices\"), tags$br() )) ) server <- function(input, output, session) { filter_state$server(\"fs\") output$condition_choices <- renderPrint(filter_state$get_call()) output$formatted_choices <- renderText(filter_state$format()) output$unformatted_choices <- renderPrint(filter_state$get_state()) } if (interactive()) { shinyApp(ui, server) }"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStates.html","id":null,"dir":"Reference","previous_headings":"","what":"FilterStates R6 class — FilterStates","title":"FilterStates R6 class — FilterStates","text":"Abstract class manages adding removing FilterState objects builds subset expression. FilterStates object tracks condition calls (logical predicates limit observations) associated given dataset composes single reproducible R expression assign subset original data new variable. expression hereafter referred subset expression. subset expression constructed differently different classes underlying data object FilterStates sub-classes. Currently implemented data.frame, matrix, SummarizedExperiment, MultiAssayExperiment.","code":""},{"path":[]},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStates.html","id":"public-methods","dir":"Reference","previous_headings":"","what":"Public methods","title":"FilterStates R6 class — FilterStates","text":"FilterStates$new() FilterStates$format() FilterStates$get_call() FilterStates$print() FilterStates$remove_filter_state() FilterStates$get_filter_state() FilterStates$set_filter_state() FilterStates$clear_filter_states() FilterStates$ui_active() FilterStates$srv_active() FilterStates$ui_add() FilterStates$srv_add() FilterStates$finalize() FilterStates$clone()","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStates.html","id":"method-new-","dir":"Reference","previous_headings":"","what":"Method new()","title":"FilterStates R6 class — FilterStates","text":"Initializes FilterStates object setting dataname, datalabel.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStates.html","id":"usage","dir":"Reference","previous_headings":"","what":"Usage","title":"FilterStates R6 class — FilterStates","text":"","code":"FilterStates$new( data, data_reactive = function(sid = \"\") NULL, dataname, datalabel = NULL )"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStates.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"FilterStates R6 class — FilterStates","text":"data (data.frame MultiAssayExperiment SummarizedExperiment matrix) R object subset function applied . data_reactive (function(sid)) return object type data object NULL. object needed FilterState counts updated change filters. function returns NULL filtered counts shown. Function sid argument character. dataname (character(1)) name dataset, used subset expression. Passed function argument attached FilterStates. datalabel (character(1)) optional text label.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStates.html","id":"returns","dir":"Reference","previous_headings":"","what":"Returns","title":"FilterStates R6 class — FilterStates","text":"Object class FilterStates, invisibly.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStates.html","id":"method-format-","dir":"Reference","previous_headings":"","what":"Method format()","title":"FilterStates R6 class — FilterStates","text":"Returns formatted string representing FilterStates object.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStates.html","id":"usage-1","dir":"Reference","previous_headings":"","what":"Usage","title":"FilterStates R6 class — FilterStates","text":"","code":"FilterStates$format(show_all = FALSE, trim_lines = TRUE)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStates.html","id":"arguments-1","dir":"Reference","previous_headings":"","what":"Arguments","title":"FilterStates R6 class — FilterStates","text":"show_all (logical(1)) passed format.teal_slices trim_lines (logical(1)) passed format.teal_slices","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStates.html","id":"returns-1","dir":"Reference","previous_headings":"","what":"Returns","title":"FilterStates R6 class — FilterStates","text":"character(1) formatted string","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStates.html","id":"method-get-call-","dir":"Reference","previous_headings":"","what":"Method get_call()","title":"FilterStates R6 class — FilterStates","text":"Filter call Builds subset expression condition calls generated FilterState. lhs expression dataname_prefixed, word prefixed refers situation call evaluated elements original data, example dataname[[x]]. default dataname_prefixed = dataname alterable class methods. Customization private$dataname_prefixed done inheriting classes. rhs call private$fun following arguments: dataname_prefixed list logical expressions generated FilterState objects stored private$state_list. logical predicate combined & operator. Variables logical expressions default prefixed can changed setting private$extract_type (change similar way dataname_prefixed) Possible call outputs depending custom fields/options: filters applied, NULL returned avoid -op calls dataname <- dataname.","code":"# default dataname <- subset(dataname, col == \"x\") # fun = dplyr::filter dataname <- dplyr::filter(dataname, col == \"x\") # fun = MultiAssayExperiment::subsetByColData; extract_type = \"list\" dataname <- MultiAssayExperiment::subsetByColData(dataname, dataname$col == \"x\") # teal_slice objects having `arg = \"subset\"` and `arg = \"select\"` dataname <- subset(dataname, subset = row_col == \"x\", select = col_col == \"x\") # dataname = dataname[[element]] dataname[[element]] <- subset(dataname[[element]], subset = col == \"x\")"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStates.html","id":"usage-2","dir":"Reference","previous_headings":"","what":"Usage","title":"FilterStates R6 class — FilterStates","text":"","code":"FilterStates$get_call(sid = \"\")"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStates.html","id":"arguments-2","dir":"Reference","previous_headings":"","what":"Arguments","title":"FilterStates R6 class — FilterStates","text":"sid (character) specified method returns code containing condition calls (logical predicates) FilterState objects \"sid\" attribute different sid argument.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStates.html","id":"returns-2","dir":"Reference","previous_headings":"","what":"Returns","title":"FilterStates R6 class — FilterStates","text":"call NULL","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStates.html","id":"method-print-","dir":"Reference","previous_headings":"","what":"Method print()","title":"FilterStates R6 class — FilterStates","text":"Prints FilterStates object.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStates.html","id":"usage-3","dir":"Reference","previous_headings":"","what":"Usage","title":"FilterStates R6 class — FilterStates","text":"","code":"FilterStates$print(...)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStates.html","id":"arguments-3","dir":"Reference","previous_headings":"","what":"Arguments","title":"FilterStates R6 class — FilterStates","text":"... additional arguments passed format.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStates.html","id":"method-remove-filter-state-","dir":"Reference","previous_headings":"","what":"Method remove_filter_state()","title":"FilterStates R6 class — FilterStates","text":"Remove one FilterStates state_list along UI elements.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStates.html","id":"usage-4","dir":"Reference","previous_headings":"","what":"Usage","title":"FilterStates R6 class — FilterStates","text":"","code":"FilterStates$remove_filter_state(state)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStates.html","id":"arguments-4","dir":"Reference","previous_headings":"","what":"Arguments","title":"FilterStates R6 class — FilterStates","text":"state (teal_slices) specifying FilterState objects remove; teal_slices may contain dataname varname, elements ignored","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStates.html","id":"returns-3","dir":"Reference","previous_headings":"","what":"Returns","title":"FilterStates R6 class — FilterStates","text":"NULL, invisibly.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStates.html","id":"method-get-filter-state-","dir":"Reference","previous_headings":"","what":"Method get_filter_state()","title":"FilterStates R6 class — FilterStates","text":"Gets reactive values active FilterState objects. Get active filter state FilterState objects stored state_list(s). output list compatible input self$set_filter_state.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStates.html","id":"usage-5","dir":"Reference","previous_headings":"","what":"Usage","title":"FilterStates R6 class — FilterStates","text":"","code":"FilterStates$get_filter_state()"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStates.html","id":"returns-4","dir":"Reference","previous_headings":"","what":"Returns","title":"FilterStates R6 class — FilterStates","text":"Object class teal_slices.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStates.html","id":"method-set-filter-state-","dir":"Reference","previous_headings":"","what":"Method set_filter_state()","title":"FilterStates R6 class — FilterStates","text":"Sets active FilterState objects.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStates.html","id":"usage-6","dir":"Reference","previous_headings":"","what":"Usage","title":"FilterStates R6 class — FilterStates","text":"","code":"FilterStates$set_filter_state(state)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStates.html","id":"arguments-5","dir":"Reference","previous_headings":"","what":"Arguments","title":"FilterStates R6 class — FilterStates","text":"state (teal_slices)","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStates.html","id":"returns-5","dir":"Reference","previous_headings":"","what":"Returns","title":"FilterStates R6 class — FilterStates","text":"Function raises error.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStates.html","id":"method-clear-filter-states-","dir":"Reference","previous_headings":"","what":"Method clear_filter_states()","title":"FilterStates R6 class — FilterStates","text":"Remove FilterState objects FilterStates object.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStates.html","id":"usage-7","dir":"Reference","previous_headings":"","what":"Usage","title":"FilterStates R6 class — FilterStates","text":"","code":"FilterStates$clear_filter_states(force = FALSE)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStates.html","id":"arguments-6","dir":"Reference","previous_headings":"","what":"Arguments","title":"FilterStates R6 class — FilterStates","text":"force (logical(1)) flag specifying whether include anchored filter states.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStates.html","id":"returns-6","dir":"Reference","previous_headings":"","what":"Returns","title":"FilterStates R6 class — FilterStates","text":"NULL, invisibly.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStates.html","id":"method-ui-active-","dir":"Reference","previous_headings":"","what":"Method ui_active()","title":"FilterStates R6 class — FilterStates","text":"shiny UI definition stores FilterState UI elements. Populated elements created renderUI module server.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStates.html","id":"usage-8","dir":"Reference","previous_headings":"","what":"Usage","title":"FilterStates R6 class — FilterStates","text":"","code":"FilterStates$ui_active(id)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStates.html","id":"arguments-7","dir":"Reference","previous_headings":"","what":"Arguments","title":"FilterStates R6 class — FilterStates","text":"id (character(1)) shiny module instance id.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStates.html","id":"returns-7","dir":"Reference","previous_headings":"","what":"Returns","title":"FilterStates R6 class — FilterStates","text":"shiny.tag","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStates.html","id":"method-srv-active-","dir":"Reference","previous_headings":"","what":"Method srv_active()","title":"FilterStates R6 class — FilterStates","text":"shiny server module.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStates.html","id":"usage-9","dir":"Reference","previous_headings":"","what":"Usage","title":"FilterStates R6 class — FilterStates","text":"","code":"FilterStates$srv_active(id)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStates.html","id":"arguments-8","dir":"Reference","previous_headings":"","what":"Arguments","title":"FilterStates R6 class — FilterStates","text":"id (character(1)) shiny module instance id.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStates.html","id":"returns-8","dir":"Reference","previous_headings":"","what":"Returns","title":"FilterStates R6 class — FilterStates","text":"NULL.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStates.html","id":"method-ui-add-","dir":"Reference","previous_headings":"","what":"Method ui_add()","title":"FilterStates R6 class — FilterStates","text":"shiny UI module add filter variable.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStates.html","id":"usage-10","dir":"Reference","previous_headings":"","what":"Usage","title":"FilterStates R6 class — FilterStates","text":"","code":"FilterStates$ui_add(id)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStates.html","id":"arguments-9","dir":"Reference","previous_headings":"","what":"Arguments","title":"FilterStates R6 class — FilterStates","text":"id (character(1)) shiny module instance id.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStates.html","id":"returns-9","dir":"Reference","previous_headings":"","what":"Returns","title":"FilterStates R6 class — FilterStates","text":"shiny.tag","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStates.html","id":"method-srv-add-","dir":"Reference","previous_headings":"","what":"Method srv_add()","title":"FilterStates R6 class — FilterStates","text":"shiny server module add filter variable. module controls available choices select filter variable. selected, variable removed available choices. Removing filter variable adds back available choices.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStates.html","id":"usage-11","dir":"Reference","previous_headings":"","what":"Usage","title":"FilterStates R6 class — FilterStates","text":"","code":"FilterStates$srv_add(id)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStates.html","id":"arguments-10","dir":"Reference","previous_headings":"","what":"Arguments","title":"FilterStates R6 class — FilterStates","text":"id (character(1)) shiny module instance id.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStates.html","id":"returns-10","dir":"Reference","previous_headings":"","what":"Returns","title":"FilterStates R6 class — FilterStates","text":"NULL.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStates.html","id":"method-finalize-","dir":"Reference","previous_headings":"","what":"Method finalize()","title":"FilterStates R6 class — FilterStates","text":"Object cleanup. Destroy inputs observers stored private$session_bindings Clean state_list","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStates.html","id":"usage-12","dir":"Reference","previous_headings":"","what":"Usage","title":"FilterStates R6 class — FilterStates","text":"","code":"FilterStates$finalize()"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStates.html","id":"returns-11","dir":"Reference","previous_headings":"","what":"Returns","title":"FilterStates R6 class — FilterStates","text":"NULL, invisibly.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStates.html","id":"method-clone-","dir":"Reference","previous_headings":"","what":"Method clone()","title":"FilterStates R6 class — FilterStates","text":"objects class cloneable method.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStates.html","id":"usage-13","dir":"Reference","previous_headings":"","what":"Usage","title":"FilterStates R6 class — FilterStates","text":"","code":"FilterStates$clone(deep = FALSE)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilterStates.html","id":"arguments-11","dir":"Reference","previous_headings":"","what":"Arguments","title":"FilterStates R6 class — FilterStates","text":"deep Whether make deep clone.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":null,"dir":"Reference","previous_headings":"","what":"Class to encapsulate filtered datasets — FilteredData","title":"Class to encapsulate filtered datasets — FilteredData","text":"Manages filtering datasets application module.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Class to encapsulate filtered datasets — FilteredData","text":"main purpose class provide collection reactive datasets, dataset filter state determines filtered. dataset, get_filter_expr returns call filter dataset according filter state. data can obtained get_data. datasets filtered lazily, .e. requested / needed shiny app. design, dataname set set_dataset removed code may already depend . workaround, underlying data can set NULL. class currently supports variables following types within datasets: choices: variable type factor, e.g. ADSL$COUNTRY, iris$Species zero options can selected, variable factor logical: variable type logical, e.g. ADSL$TRT_FLAG exactly one option must selected, TRUE FALSE ranges: variable type numeric, e.g. ADSL$AGE, iris$Sepal.Length numerical range, range within range can selected dates: variable type Date, POSIXlt variables used filtering data class. Common arguments : filtered: whether return filtered result dataname: name one datasets FilteredData object varname: one columns dataset","code":""},{"path":[]},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"public-methods","dir":"Reference","previous_headings":"","what":"Public methods","title":"Class to encapsulate filtered datasets — FilteredData","text":"FilteredData$new() FilteredData$datanames() FilteredData$get_datalabel() FilteredData$set_available_teal_slices() FilteredData$get_available_teal_slices() FilteredData$get_call() FilteredData$get_data() FilteredData$get_join_keys() FilteredData$get_filter_overview() FilteredData$get_keys() FilteredData$set_dataset() FilteredData$set_join_keys() FilteredData$get_filter_state() FilteredData$format() FilteredData$print() FilteredData$set_filter_state() FilteredData$remove_filter_state() FilteredData$clear_filter_states() FilteredData$ui_filter_panel() FilteredData$srv_filter_panel() FilteredData$ui_active() FilteredData$srv_active() FilteredData$ui_overview() FilteredData$srv_overview() FilteredData$finalize() FilteredData$clone()","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"method-new-","dir":"Reference","previous_headings":"","what":"Method new()","title":"Class to encapsulate filtered datasets — FilteredData","text":"Initialize FilteredData object.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Class to encapsulate filtered datasets — FilteredData","text":"","code":"FilteredData$new(data_objects, join_keys = teal.data::join_keys())"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Class to encapsulate filtered datasets — FilteredData","text":"data_objects (named list) List data objects. Names list used dataname respective datasets. join_keys (join_keys) optional joining keys, see teal.data::join_keys().","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"method-datanames-","dir":"Reference","previous_headings":"","what":"Method datanames()","title":"Class to encapsulate filtered datasets — FilteredData","text":"Gets datanames.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"usage-1","dir":"Reference","previous_headings":"","what":"Usage","title":"Class to encapsulate filtered datasets — FilteredData","text":"","code":"FilteredData$datanames()"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"details-1","dir":"Reference","previous_headings":"","what":"Details","title":"Class to encapsulate filtered datasets — FilteredData","text":"datanames returned order must evaluated (case dependencies).","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"returns","dir":"Reference","previous_headings":"","what":"Returns","title":"Class to encapsulate filtered datasets — FilteredData","text":"Character vector.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"method-get-datalabel-","dir":"Reference","previous_headings":"","what":"Method get_datalabel()","title":"Class to encapsulate filtered datasets — FilteredData","text":"Gets data label dataset. Useful display Show R Code.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"usage-2","dir":"Reference","previous_headings":"","what":"Usage","title":"Class to encapsulate filtered datasets — FilteredData","text":"","code":"FilteredData$get_datalabel(dataname)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"arguments-1","dir":"Reference","previous_headings":"","what":"Arguments","title":"Class to encapsulate filtered datasets — FilteredData","text":"dataname (character(1)) name dataset","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"returns-1","dir":"Reference","previous_headings":"","what":"Returns","title":"Class to encapsulate filtered datasets — FilteredData","text":"Character string.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"method-set-available-teal-slices-","dir":"Reference","previous_headings":"","what":"Method set_available_teal_slices()","title":"Class to encapsulate filtered datasets — FilteredData","text":"Set list external filter states available activation.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"usage-3","dir":"Reference","previous_headings":"","what":"Usage","title":"Class to encapsulate filtered datasets — FilteredData","text":"","code":"FilteredData$set_available_teal_slices(x)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"arguments-2","dir":"Reference","previous_headings":"","what":"Arguments","title":"Class to encapsulate filtered datasets — FilteredData","text":"x (reactive) return teal_slices","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"details-2","dir":"Reference","previous_headings":"","what":"Details","title":"Class to encapsulate filtered datasets — FilteredData","text":"Unlike adding new filter column, filters can come prespecified settings. teal_slices wrapped reactive can updated elsewhere app. Filters passed x limited can set FilteredData object, .e. correct dataname varname (waived teal_slice_fixed varname). List accessible ui/srv_active ui/srv_available_filters.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"returns-2","dir":"Reference","previous_headings":"","what":"Returns","title":"Class to encapsulate filtered datasets — FilteredData","text":"NULL, invisibly.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"method-get-available-teal-slices-","dir":"Reference","previous_headings":"","what":"Method get_available_teal_slices()","title":"Class to encapsulate filtered datasets — FilteredData","text":"Get list filter states available object.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"usage-4","dir":"Reference","previous_headings":"","what":"Usage","title":"Class to encapsulate filtered datasets — FilteredData","text":"","code":"FilteredData$get_available_teal_slices()"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"details-3","dir":"Reference","previous_headings":"","what":"Details","title":"Class to encapsulate filtered datasets — FilteredData","text":"teal_slice objects created since beginning app session stored one teal_slices object. returns subset teal_slices, describing filter states can set object.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"returns-3","dir":"Reference","previous_headings":"","what":"Returns","title":"Class to encapsulate filtered datasets — FilteredData","text":"reactive returns teal_slices.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"method-get-call-","dir":"Reference","previous_headings":"","what":"Method get_call()","title":"Class to encapsulate filtered datasets — FilteredData","text":"Gets call filter dataset according filter state.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"usage-5","dir":"Reference","previous_headings":"","what":"Usage","title":"Class to encapsulate filtered datasets — FilteredData","text":"","code":"FilteredData$get_call(dataname)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"arguments-3","dir":"Reference","previous_headings":"","what":"Arguments","title":"Class to encapsulate filtered datasets — FilteredData","text":"dataname (character(1)) name dataset","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"details-4","dir":"Reference","previous_headings":"","what":"Details","title":"Class to encapsulate filtered datasets — FilteredData","text":"returns call filter dataset , assuming (filtered) datasets depends available. Together self$datanames() returns datasets correct evaluation order, generates whole filter code, see function FilteredData$get_filter_code. return type, note rlang::is_expression returns TRUE return type, base R expressions calls (single expression, capturing function call). filtered dataset name given self$filtered_dataname(dataname) can used Show R Code generation.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"returns-4","dir":"Reference","previous_headings":"","what":"Returns","title":"Class to encapsulate filtered datasets — FilteredData","text":"list calls.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"method-get-data-","dir":"Reference","previous_headings":"","what":"Method get_data()","title":"Class to encapsulate filtered datasets — FilteredData","text":"Gets filtered unfiltered dataset. filtered = FALSE, original data set set_data returned including attributes.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"usage-6","dir":"Reference","previous_headings":"","what":"Usage","title":"Class to encapsulate filtered datasets — FilteredData","text":"","code":"FilteredData$get_data(dataname, filtered = TRUE)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"arguments-4","dir":"Reference","previous_headings":"","what":"Arguments","title":"Class to encapsulate filtered datasets — FilteredData","text":"dataname (character(1)) name dataset. filtered (logical(1)) whether return filtered unfiltered dataset.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"returns-5","dir":"Reference","previous_headings":"","what":"Returns","title":"Class to encapsulate filtered datasets — FilteredData","text":"data object, data.frame MultiAssayExperiment.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"method-get-join-keys-","dir":"Reference","previous_headings":"","what":"Method get_join_keys()","title":"Class to encapsulate filtered datasets — FilteredData","text":"Get join keys two datasets.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"usage-7","dir":"Reference","previous_headings":"","what":"Usage","title":"Class to encapsulate filtered datasets — FilteredData","text":"","code":"FilteredData$get_join_keys()"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"returns-6","dir":"Reference","previous_headings":"","what":"Returns","title":"Class to encapsulate filtered datasets — FilteredData","text":"join_keys","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"method-get-filter-overview-","dir":"Reference","previous_headings":"","what":"Method get_filter_overview()","title":"Class to encapsulate filtered datasets — FilteredData","text":"Creates filter overview table displayed application. One row created per dataset, according get_filter_overview methods contained FilteredDataset objects.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"usage-8","dir":"Reference","previous_headings":"","what":"Usage","title":"Class to encapsulate filtered datasets — FilteredData","text":"","code":"FilteredData$get_filter_overview(datanames)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"arguments-5","dir":"Reference","previous_headings":"","what":"Arguments","title":"Class to encapsulate filtered datasets — FilteredData","text":"datanames (character) vector dataset names.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"returns-7","dir":"Reference","previous_headings":"","what":"Returns","title":"Class to encapsulate filtered datasets — FilteredData","text":"data.frame listing numbers observations datasets.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"method-get-keys-","dir":"Reference","previous_headings":"","what":"Method get_keys()","title":"Class to encapsulate filtered datasets — FilteredData","text":"Get keys dataset.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"usage-9","dir":"Reference","previous_headings":"","what":"Usage","title":"Class to encapsulate filtered datasets — FilteredData","text":"","code":"FilteredData$get_keys(dataname)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"arguments-6","dir":"Reference","previous_headings":"","what":"Arguments","title":"Class to encapsulate filtered datasets — FilteredData","text":"dataname (character(1)) name dataset.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"returns-8","dir":"Reference","previous_headings":"","what":"Returns","title":"Class to encapsulate filtered datasets — FilteredData","text":"Character vector key column names.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"method-set-dataset-","dir":"Reference","previous_headings":"","what":"Method set_dataset()","title":"Class to encapsulate filtered datasets — FilteredData","text":"Adds dataset FilteredData.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"usage-10","dir":"Reference","previous_headings":"","what":"Usage","title":"Class to encapsulate filtered datasets — FilteredData","text":"","code":"FilteredData$set_dataset(data, dataname)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"arguments-7","dir":"Reference","previous_headings":"","what":"Arguments","title":"Class to encapsulate filtered datasets — FilteredData","text":"data (data.frame MultiAssayExperiment) data filtered. dataname (character(1)) name dataset added object.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"details-5","dir":"Reference","previous_headings":"","what":"Details","title":"Class to encapsulate filtered datasets — FilteredData","text":"set_dataset creates FilteredDataset object keeps dataset filtering purpose. data parent specified join_keys object stored private$join_keys created FilteredDataset (child) gets linked FilteredDataset (parent). \"Child\" dataset return filtered data dependent reactive filtered data \"parent\". See documentation parent argument DataframeFilteredDataset constructor.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"returns-9","dir":"Reference","previous_headings":"","what":"Returns","title":"Class to encapsulate filtered datasets — FilteredData","text":"self, invisibly.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"method-set-join-keys-","dir":"Reference","previous_headings":"","what":"Method set_join_keys()","title":"Class to encapsulate filtered datasets — FilteredData","text":"Set join_keys.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"usage-11","dir":"Reference","previous_headings":"","what":"Usage","title":"Class to encapsulate filtered datasets — FilteredData","text":"","code":"FilteredData$set_join_keys(join_keys)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"arguments-8","dir":"Reference","previous_headings":"","what":"Arguments","title":"Class to encapsulate filtered datasets — FilteredData","text":"join_keys (join_keys), see teal.data::join_keys().","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"returns-10","dir":"Reference","previous_headings":"","what":"Returns","title":"Class to encapsulate filtered datasets — FilteredData","text":"self, invisibly.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"method-get-filter-state-","dir":"Reference","previous_headings":"","what":"Method get_filter_state()","title":"Class to encapsulate filtered datasets — FilteredData","text":"Gets states contained FilterState objects.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"usage-12","dir":"Reference","previous_headings":"","what":"Usage","title":"Class to encapsulate filtered datasets — FilteredData","text":"","code":"FilteredData$get_filter_state()"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"returns-11","dir":"Reference","previous_headings":"","what":"Returns","title":"Class to encapsulate filtered datasets — FilteredData","text":"teal_slices object.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"method-format-","dir":"Reference","previous_headings":"","what":"Method format()","title":"Class to encapsulate filtered datasets — FilteredData","text":"Returns formatted string representing FilteredData object.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"usage-13","dir":"Reference","previous_headings":"","what":"Usage","title":"Class to encapsulate filtered datasets — FilteredData","text":"","code":"FilteredData$format(show_all = FALSE, trim_lines = TRUE)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"arguments-9","dir":"Reference","previous_headings":"","what":"Arguments","title":"Class to encapsulate filtered datasets — FilteredData","text":"show_all (logical(1)) passed format.teal_slice. trim_lines (logical(1)) passed format.teal_slice.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"returns-12","dir":"Reference","previous_headings":"","what":"Returns","title":"Class to encapsulate filtered datasets — FilteredData","text":"character(1) formatted string.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"method-print-","dir":"Reference","previous_headings":"","what":"Method print()","title":"Class to encapsulate filtered datasets — FilteredData","text":"Prints FilteredData object.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"usage-14","dir":"Reference","previous_headings":"","what":"Usage","title":"Class to encapsulate filtered datasets — FilteredData","text":"","code":"FilteredData$print(...)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"arguments-10","dir":"Reference","previous_headings":"","what":"Arguments","title":"Class to encapsulate filtered datasets — FilteredData","text":"... additional arguments passed format.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"method-set-filter-state-","dir":"Reference","previous_headings":"","what":"Method set_filter_state()","title":"Class to encapsulate filtered datasets — FilteredData","text":"Sets active filter states.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"usage-15","dir":"Reference","previous_headings":"","what":"Usage","title":"Class to encapsulate filtered datasets — FilteredData","text":"","code":"FilteredData$set_filter_state(state)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"arguments-11","dir":"Reference","previous_headings":"","what":"Arguments","title":"Class to encapsulate filtered datasets — FilteredData","text":"state (teal_slices)","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"returns-13","dir":"Reference","previous_headings":"","what":"Returns","title":"Class to encapsulate filtered datasets — FilteredData","text":"NULL, invisibly.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"method-remove-filter-state-","dir":"Reference","previous_headings":"","what":"Method remove_filter_state()","title":"Class to encapsulate filtered datasets — FilteredData","text":"Removes one FilterState FilteredData object.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"usage-16","dir":"Reference","previous_headings":"","what":"Usage","title":"Class to encapsulate filtered datasets — FilteredData","text":"","code":"FilteredData$remove_filter_state(state)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"arguments-12","dir":"Reference","previous_headings":"","what":"Arguments","title":"Class to encapsulate filtered datasets — FilteredData","text":"state (teal_slices) specifying FilterState objects remove; teal_slices may contain dataname varname, elements ignored.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"returns-14","dir":"Reference","previous_headings":"","what":"Returns","title":"Class to encapsulate filtered datasets — FilteredData","text":"NULL, invisibly.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"method-clear-filter-states-","dir":"Reference","previous_headings":"","what":"Method clear_filter_states()","title":"Class to encapsulate filtered datasets — FilteredData","text":"Remove FilterStates FilteredDataset FilterStates FilteredData object.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"usage-17","dir":"Reference","previous_headings":"","what":"Usage","title":"Class to encapsulate filtered datasets — FilteredData","text":"","code":"FilteredData$clear_filter_states(datanames = self$datanames(), force = FALSE)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"arguments-13","dir":"Reference","previous_headings":"","what":"Arguments","title":"Class to encapsulate filtered datasets — FilteredData","text":"datanames (character) names datasets remove filter states. Defaults datasets FilteredData object. force (logical(1)) flag specifying whether include anchored filter states.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"returns-15","dir":"Reference","previous_headings":"","what":"Returns","title":"Class to encapsulate filtered datasets — FilteredData","text":"NULL, invisibly.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"method-ui-filter-panel-","dir":"Reference","previous_headings":"","what":"Method ui_filter_panel()","title":"Class to encapsulate filtered datasets — FilteredData","text":"top-level shiny module filter panel teal app. Contains 1) filter overview panel, 2) filter active panel, 3) add filters panel.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"usage-18","dir":"Reference","previous_headings":"","what":"Usage","title":"Class to encapsulate filtered datasets — FilteredData","text":"","code":"FilteredData$ui_filter_panel(id, active_datanames = self$datanames)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"arguments-14","dir":"Reference","previous_headings":"","what":"Arguments","title":"Class to encapsulate filtered datasets — FilteredData","text":"id (character(1)) shiny module instance id. active_datanames (reactive) defining subset self$datanames() displayed.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"returns-16","dir":"Reference","previous_headings":"","what":"Returns","title":"Class to encapsulate filtered datasets — FilteredData","text":"shiny.tag","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"method-srv-filter-panel-","dir":"Reference","previous_headings":"","what":"Method srv_filter_panel()","title":"Class to encapsulate filtered datasets — FilteredData","text":"Server function filter panel.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"usage-19","dir":"Reference","previous_headings":"","what":"Usage","title":"Class to encapsulate filtered datasets — FilteredData","text":"","code":"FilteredData$srv_filter_panel(id, active_datanames = self$datanames)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"arguments-15","dir":"Reference","previous_headings":"","what":"Arguments","title":"Class to encapsulate filtered datasets — FilteredData","text":"id (character(1)) shiny module instance id. active_datanames (function reactive) returning datanames shown filter panel. Must subset datanames FilteredData. function returns NULL (opposed character(0)), filter panel hidden.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"returns-17","dir":"Reference","previous_headings":"","what":"Returns","title":"Class to encapsulate filtered datasets — FilteredData","text":"NULL.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"method-ui-active-","dir":"Reference","previous_headings":"","what":"Method ui_active()","title":"Class to encapsulate filtered datasets — FilteredData","text":"Server module responsible displaying active filters.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"usage-20","dir":"Reference","previous_headings":"","what":"Usage","title":"Class to encapsulate filtered datasets — FilteredData","text":"","code":"FilteredData$ui_active(id, active_datanames = self$datanames)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"arguments-16","dir":"Reference","previous_headings":"","what":"Arguments","title":"Class to encapsulate filtered datasets — FilteredData","text":"id (character(1)) shiny module instance id. active_datanames (reactive) defining subset self$datanames() displayed.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"returns-18","dir":"Reference","previous_headings":"","what":"Returns","title":"Class to encapsulate filtered datasets — FilteredData","text":"shiny.tag","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"method-srv-active-","dir":"Reference","previous_headings":"","what":"Method srv_active()","title":"Class to encapsulate filtered datasets — FilteredData","text":"Server module responsible displaying active filters.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"usage-21","dir":"Reference","previous_headings":"","what":"Usage","title":"Class to encapsulate filtered datasets — FilteredData","text":"","code":"FilteredData$srv_active(id, active_datanames = self$datanames)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"arguments-17","dir":"Reference","previous_headings":"","what":"Arguments","title":"Class to encapsulate filtered datasets — FilteredData","text":"id (character(1)) shiny module instance id. active_datanames (reactive) defining subset self$datanames() displayed.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"returns-19","dir":"Reference","previous_headings":"","what":"Returns","title":"Class to encapsulate filtered datasets — FilteredData","text":"NULL.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"method-ui-overview-","dir":"Reference","previous_headings":"","what":"Method ui_overview()","title":"Class to encapsulate filtered datasets — FilteredData","text":"Creates UI definition module showing counts dataset contrasting filtered full unfiltered dataset. Per dataset, displays number rows/observations dataset, number unique subjects.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"usage-22","dir":"Reference","previous_headings":"","what":"Usage","title":"Class to encapsulate filtered datasets — FilteredData","text":"","code":"FilteredData$ui_overview(id)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"arguments-18","dir":"Reference","previous_headings":"","what":"Arguments","title":"Class to encapsulate filtered datasets — FilteredData","text":"id (character(1)) shiny module instance id.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"method-srv-overview-","dir":"Reference","previous_headings":"","what":"Method srv_overview()","title":"Class to encapsulate filtered datasets — FilteredData","text":"Server function display number records filtered unfiltered data.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"usage-23","dir":"Reference","previous_headings":"","what":"Usage","title":"Class to encapsulate filtered datasets — FilteredData","text":"","code":"FilteredData$srv_overview(id, active_datanames = self$datanames)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"arguments-19","dir":"Reference","previous_headings":"","what":"Arguments","title":"Class to encapsulate filtered datasets — FilteredData","text":"id (character(1)) shiny module instance id. active_datanames (reactive) returning datanames shown filter panel, must subset datanames argument provided ui_filter_panel; function returns NULL (opposed character(0)), filter panel hidden.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"returns-20","dir":"Reference","previous_headings":"","what":"Returns","title":"Class to encapsulate filtered datasets — FilteredData","text":"NULL.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"method-finalize-","dir":"Reference","previous_headings":"","what":"Method finalize()","title":"Class to encapsulate filtered datasets — FilteredData","text":"Object dependencies cleanup. Destroy inputs observers stored private$session_bindings Finalize FilteredData stored private$filtered_datasets","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"usage-24","dir":"Reference","previous_headings":"","what":"Usage","title":"Class to encapsulate filtered datasets — FilteredData","text":"","code":"FilteredData$finalize()"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"returns-21","dir":"Reference","previous_headings":"","what":"Returns","title":"Class to encapsulate filtered datasets — FilteredData","text":"NULL, invisibly.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"method-clone-","dir":"Reference","previous_headings":"","what":"Method clone()","title":"Class to encapsulate filtered datasets — FilteredData","text":"objects class cloneable method.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"usage-25","dir":"Reference","previous_headings":"","what":"Usage","title":"Class to encapsulate filtered datasets — FilteredData","text":"","code":"FilteredData$clone(deep = FALSE)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"arguments-20","dir":"Reference","previous_headings":"","what":"Arguments","title":"Class to encapsulate filtered datasets — FilteredData","text":"deep Whether make deep clone.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredData.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Class to encapsulate filtered datasets — FilteredData","text":"","code":"# use non-exported function from teal.slice FilteredData <- getFromNamespace(\"FilteredData\", \"teal.slice\") library(shiny) datasets <- FilteredData$new(list(iris = iris, mtcars = mtcars)) # get datanames datasets$datanames() #> [1] \"iris\" \"mtcars\" datasets$set_filter_state( teal_slices(teal_slice(dataname = \"iris\", varname = \"Species\", selected = \"virginica\")) ) isolate(datasets$get_call(\"iris\")) #> $filter #> iris <- dplyr::filter(iris, Species == \"virginica\") #> datasets$set_filter_state( teal_slices(teal_slice(dataname = \"mtcars\", varname = \"mpg\", selected = c(15, 20))) ) isolate(datasets$get_filter_state()) #> { #> \"slices\": [ #> { #> \"dataname\" : \"iris\", #> \"varname\" : \"Species\", #> \"id\" : \"iris Species\", #> \"choices\" : [\"setosa\", \"versicolor\", \"virgin... #> \"selected\" : [\"virginica\"], #> \"fixed\" : false, #> \"anchored\" : false, #> \"multiple\" : true #> }, #> { #> \"dataname\" : \"mtcars\", #> \"varname\" : \"mpg\", #> \"id\" : \"mtcars mpg\", #> \"choices\" : [10.4, 34], #> \"selected\" : [15, 20], #> \"fixed\" : false, #> \"anchored\" : false, #> \"multiple\" : true #> } #> ], #> \"attributes\": { #> \"include_varnames\" : { #> \"iris\" : [\"Sepal.Length\", \"Sepal.Width\", ... #> \"mtcars\" : [\"mpg\", \"cyl\", \"disp\", \"hp\", \"dr... #> }, #> \"count_type\" : \"none\", #> \"allow_add\" : true #> } #> } isolate(datasets$get_call(\"iris\")) #> $filter #> iris <- dplyr::filter(iris, Species == \"virginica\") #> isolate(datasets$get_call(\"mtcars\")) #> $filter #> mtcars <- dplyr::filter(mtcars, mpg >= 15 & mpg <= 20) #> ### set_filter_state library(shiny) data(miniACC, package = \"MultiAssayExperiment\") datasets <- FilteredData$new(list(iris = iris, mae = miniACC)) fs <- teal_slices( teal_slice( dataname = \"iris\", varname = \"Sepal.Length\", selected = c(5.1, 6.4), keep_na = TRUE, keep_inf = FALSE ), teal_slice( dataname = \"iris\", varname = \"Species\", selected = c(\"setosa\", \"versicolor\"), keep_na = FALSE ), teal_slice( dataname = \"mae\", varname = \"years_to_birth\", selected = c(30, 50), keep_na = TRUE, keep_inf = FALSE ), teal_slice(dataname = \"mae\", varname = \"vital_status\", selected = \"1\", keep_na = FALSE), teal_slice(dataname = \"mae\", varname = \"gender\", selected = \"female\", keep_na = TRUE), teal_slice( dataname = \"mae\", varname = \"ARRAY_TYPE\", selected = \"\", keep_na = TRUE, experiment = \"RPPAArray\", arg = \"subset\" ) ) datasets$set_filter_state(state = fs) isolate(datasets$get_filter_state()) #> { #> \"slices\": [ #> { #> \"dataname\" : \"iris\", #> \"varname\" : \"Sepal.Length\", #> \"id\" : \"iris Sepal.Length\", #> \"choices\" : [4.2999999999999998, 7.900000000... #> \"selected\" : [5.0999999999999996, 6.400000000... #> \"keep_na\" : true, #> \"keep_inf\" : false, #> \"fixed\" : false, #> \"anchored\" : false, #> \"multiple\" : true #> }, #> { #> \"dataname\" : \"iris\", #> \"varname\" : \"Species\", #> \"id\" : \"iris Species\", #> \"choices\" : [\"setosa\", \"versicolor\", \"virgin... #> \"selected\" : [\"setosa\", \"versicolor\"], #> \"keep_na\" : false, #> \"fixed\" : false, #> \"anchored\" : false, #> \"multiple\" : true #> }, #> { #> \"dataname\" : \"mae\", #> \"varname\" : \"years_to_birth\", #> \"id\" : \"mae years_to_birth\", #> \"choices\" : [14, 83], #> \"selected\" : [30, 50], #> \"keep_na\" : true, #> \"keep_inf\" : false, #> \"fixed\" : false, #> \"anchored\" : false, #> \"multiple\" : true #> }, #> { #> \"dataname\" : \"mae\", #> \"varname\" : \"vital_status\", #> \"id\" : \"mae vital_status\", #> \"choices\" : [\"0\", \"1\"], #> \"selected\" : [\"1\"], #> \"keep_na\" : false, #> \"fixed\" : false, #> \"anchored\" : false, #> \"multiple\" : true #> }, #> { #> \"dataname\" : \"mae\", #> \"varname\" : \"gender\", #> \"id\" : \"mae gender\", #> \"choices\" : [\"female\", \"male\"], #> \"selected\" : [\"female\"], #> \"keep_na\" : true, #> \"fixed\" : false, #> \"anchored\" : false, #> \"multiple\" : true #> }, #> { #> \"dataname\" : \"mae\", #> \"varname\" : \"ARRAY_TYPE\", #> \"id\" : \"mae ARRAY_TYPE RPPAArray subset.. #> \"choices\" : [\"\", \"protein_level\"], #> \"selected\" : [\"\"], #> \"keep_na\" : true, #> \"fixed\" : false, #> \"anchored\" : false, #> \"multiple\" : true, #> \"arg\" : \"subset\", #> \"experiment\" : \"RPPAArray\" #> } #> ], #> \"attributes\": { #> \"include_varnames\" : { #> \"iris\" : [\"Sepal.Length\", \"Sepal.Width\", ... #> \"mae\" : [\"patientID\", \"years_to_birth\", ... #> }, #> \"count_type\" : \"none\", #> \"allow_add\" : true #> } #> }"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredDataset.html","id":null,"dir":"Reference","previous_headings":"","what":"FilteredDataset R6 class — FilteredDataset","title":"FilteredDataset R6 class — FilteredDataset","text":"FilteredDataset class renders/controls FilterStates(s) FilteredDataset contains filter_states field - list contains one (data.frame) multiple (MultiAssayExperiment) FilterStates objects. FilterStates responsible one filter/subset expression applied specific components dataset.","code":""},{"path":[]},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredDataset.html","id":"public-methods","dir":"Reference","previous_headings":"","what":"Public methods","title":"FilteredDataset R6 class — FilteredDataset","text":"FilteredDataset$new() FilteredDataset$format() FilteredDataset$print() FilteredDataset$clear_filter_states() FilteredDataset$get_call() FilteredDataset$get_filter_state() FilteredDataset$set_filter_state() FilteredDataset$get_dataname() FilteredDataset$get_dataset() FilteredDataset$get_filter_overview() FilteredDataset$get_keys() FilteredDataset$get_dataset_label() FilteredDataset$ui_active() FilteredDataset$srv_active() FilteredDataset$ui_add() FilteredDataset$srv_add() FilteredDataset$finalize() FilteredDataset$clone()","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredDataset.html","id":"method-new-","dir":"Reference","previous_headings":"","what":"Method new()","title":"FilteredDataset R6 class — FilteredDataset","text":"Initializes FilteredDataset object.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredDataset.html","id":"usage","dir":"Reference","previous_headings":"","what":"Usage","title":"FilteredDataset R6 class — FilteredDataset","text":"","code":"FilteredDataset$new( dataset, dataname, keys = character(0), label = attr(dataset, \"label\", exact = TRUE) )"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredDataset.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"FilteredDataset R6 class — FilteredDataset","text":"dataset object dataname (character(1)) syntactically valid name given dataset. keys (character) optional vector primary key column names. label (character(1)) label describe dataset.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredDataset.html","id":"returns","dir":"Reference","previous_headings":"","what":"Returns","title":"FilteredDataset R6 class — FilteredDataset","text":"Object class FilteredDataset, invisibly.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredDataset.html","id":"method-format-","dir":"Reference","previous_headings":"","what":"Method format()","title":"FilteredDataset R6 class — FilteredDataset","text":"Returns formatted string representing FilteredDataset object.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredDataset.html","id":"usage-1","dir":"Reference","previous_headings":"","what":"Usage","title":"FilteredDataset R6 class — FilteredDataset","text":"","code":"FilteredDataset$format(show_all = FALSE, trim_lines = TRUE)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredDataset.html","id":"arguments-1","dir":"Reference","previous_headings":"","what":"Arguments","title":"FilteredDataset R6 class — FilteredDataset","text":"show_all (logical(1)) passed format.teal_slice. trim_lines (logical(1)) passed format.teal_slice.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredDataset.html","id":"returns-1","dir":"Reference","previous_headings":"","what":"Returns","title":"FilteredDataset R6 class — FilteredDataset","text":"formatted character string.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredDataset.html","id":"method-print-","dir":"Reference","previous_headings":"","what":"Method print()","title":"FilteredDataset R6 class — FilteredDataset","text":"Prints FilteredDataset object.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredDataset.html","id":"usage-2","dir":"Reference","previous_headings":"","what":"Usage","title":"FilteredDataset R6 class — FilteredDataset","text":"","code":"FilteredDataset$print(...)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredDataset.html","id":"arguments-2","dir":"Reference","previous_headings":"","what":"Arguments","title":"FilteredDataset R6 class — FilteredDataset","text":"... additional arguments passed format.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredDataset.html","id":"method-clear-filter-states-","dir":"Reference","previous_headings":"","what":"Method clear_filter_states()","title":"FilteredDataset R6 class — FilteredDataset","text":"Removes filter items applied dataset.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredDataset.html","id":"usage-3","dir":"Reference","previous_headings":"","what":"Usage","title":"FilteredDataset R6 class — FilteredDataset","text":"","code":"FilteredDataset$clear_filter_states(force = FALSE)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredDataset.html","id":"arguments-3","dir":"Reference","previous_headings":"","what":"Arguments","title":"FilteredDataset R6 class — FilteredDataset","text":"force (logical(1)) flag specifying whether include anchored filter states.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredDataset.html","id":"returns-2","dir":"Reference","previous_headings":"","what":"Returns","title":"FilteredDataset R6 class — FilteredDataset","text":"NULL.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredDataset.html","id":"method-get-call-","dir":"Reference","previous_headings":"","what":"Method get_call()","title":"FilteredDataset R6 class — FilteredDataset","text":"Gets filter expression. function returns filter calls equivalent selected items within filter_states. Configuration calls constant depends filter_states type order set initialization.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredDataset.html","id":"usage-4","dir":"Reference","previous_headings":"","what":"Usage","title":"FilteredDataset R6 class — FilteredDataset","text":"","code":"FilteredDataset$get_call(sid = \"\")"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredDataset.html","id":"arguments-4","dir":"Reference","previous_headings":"","what":"Arguments","title":"FilteredDataset R6 class — FilteredDataset","text":"sid (character) specified, method returns code containing conditions calls FilterState objects sid different sid argument.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredDataset.html","id":"returns-3","dir":"Reference","previous_headings":"","what":"Returns","title":"FilteredDataset R6 class — FilteredDataset","text":"Either list filter calls, NULL.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredDataset.html","id":"method-get-filter-state-","dir":"Reference","previous_headings":"","what":"Method get_filter_state()","title":"FilteredDataset R6 class — FilteredDataset","text":"Gets states contained FilterState objects.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredDataset.html","id":"usage-5","dir":"Reference","previous_headings":"","what":"Usage","title":"FilteredDataset R6 class — FilteredDataset","text":"","code":"FilteredDataset$get_filter_state()"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredDataset.html","id":"returns-4","dir":"Reference","previous_headings":"","what":"Returns","title":"FilteredDataset R6 class — FilteredDataset","text":"teal_slices object.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredDataset.html","id":"method-set-filter-state-","dir":"Reference","previous_headings":"","what":"Method set_filter_state()","title":"FilteredDataset R6 class — FilteredDataset","text":"Set filter state.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredDataset.html","id":"usage-6","dir":"Reference","previous_headings":"","what":"Usage","title":"FilteredDataset R6 class — FilteredDataset","text":"","code":"FilteredDataset$set_filter_state(state)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredDataset.html","id":"arguments-5","dir":"Reference","previous_headings":"","what":"Arguments","title":"FilteredDataset R6 class — FilteredDataset","text":"state (teal_slices)","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredDataset.html","id":"returns-5","dir":"Reference","previous_headings":"","what":"Returns","title":"FilteredDataset R6 class — FilteredDataset","text":"Virtual method, returns nothing raises error.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredDataset.html","id":"method-get-dataname-","dir":"Reference","previous_headings":"","what":"Method get_dataname()","title":"FilteredDataset R6 class — FilteredDataset","text":"Gets name dataset.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredDataset.html","id":"usage-7","dir":"Reference","previous_headings":"","what":"Usage","title":"FilteredDataset R6 class — FilteredDataset","text":"","code":"FilteredDataset$get_dataname()"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredDataset.html","id":"returns-6","dir":"Reference","previous_headings":"","what":"Returns","title":"FilteredDataset R6 class — FilteredDataset","text":"character string.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredDataset.html","id":"method-get-dataset-","dir":"Reference","previous_headings":"","what":"Method get_dataset()","title":"FilteredDataset R6 class — FilteredDataset","text":"Gets dataset object FilteredDataset.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredDataset.html","id":"usage-8","dir":"Reference","previous_headings":"","what":"Usage","title":"FilteredDataset R6 class — FilteredDataset","text":"","code":"FilteredDataset$get_dataset(filtered = FALSE)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredDataset.html","id":"arguments-6","dir":"Reference","previous_headings":"","what":"Arguments","title":"FilteredDataset R6 class — FilteredDataset","text":"filtered (logical(1))","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredDataset.html","id":"returns-7","dir":"Reference","previous_headings":"","what":"Returns","title":"FilteredDataset R6 class — FilteredDataset","text":"stored dataset. data.frame MultiAssayExperiment, either raw reactive current filters applied (depending filtered).","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredDataset.html","id":"method-get-filter-overview-","dir":"Reference","previous_headings":"","what":"Method get_filter_overview()","title":"FilteredDataset R6 class — FilteredDataset","text":"Get filter overview dataset.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredDataset.html","id":"usage-9","dir":"Reference","previous_headings":"","what":"Usage","title":"FilteredDataset R6 class — FilteredDataset","text":"","code":"FilteredDataset$get_filter_overview()"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredDataset.html","id":"returns-8","dir":"Reference","previous_headings":"","what":"Returns","title":"FilteredDataset R6 class — FilteredDataset","text":"Virtual method, returns nothing raises error.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredDataset.html","id":"method-get-keys-","dir":"Reference","previous_headings":"","what":"Method get_keys()","title":"FilteredDataset R6 class — FilteredDataset","text":"Gets key columns dataset.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredDataset.html","id":"usage-10","dir":"Reference","previous_headings":"","what":"Usage","title":"FilteredDataset R6 class — FilteredDataset","text":"","code":"FilteredDataset$get_keys()"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredDataset.html","id":"returns-9","dir":"Reference","previous_headings":"","what":"Returns","title":"FilteredDataset R6 class — FilteredDataset","text":"Character vector variable names","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredDataset.html","id":"method-get-dataset-label-","dir":"Reference","previous_headings":"","what":"Method get_dataset_label()","title":"FilteredDataset R6 class — FilteredDataset","text":"Gets dataset label.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredDataset.html","id":"usage-11","dir":"Reference","previous_headings":"","what":"Usage","title":"FilteredDataset R6 class — FilteredDataset","text":"","code":"FilteredDataset$get_dataset_label()"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredDataset.html","id":"returns-10","dir":"Reference","previous_headings":"","what":"Returns","title":"FilteredDataset R6 class — FilteredDataset","text":"Character string.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredDataset.html","id":"method-ui-active-","dir":"Reference","previous_headings":"","what":"Method ui_active()","title":"FilteredDataset R6 class — FilteredDataset","text":"shiny module containing active filters dataset, along title remove button.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredDataset.html","id":"usage-12","dir":"Reference","previous_headings":"","what":"Usage","title":"FilteredDataset R6 class — FilteredDataset","text":"","code":"FilteredDataset$ui_active(id, allow_add = TRUE)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredDataset.html","id":"arguments-7","dir":"Reference","previous_headings":"","what":"Arguments","title":"FilteredDataset R6 class — FilteredDataset","text":"id (character(1)) shiny module instance id. allow_add (logical(1)) logical flag specifying whether user able add new filters","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredDataset.html","id":"returns-11","dir":"Reference","previous_headings":"","what":"Returns","title":"FilteredDataset R6 class — FilteredDataset","text":"shiny.tag","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredDataset.html","id":"method-srv-active-","dir":"Reference","previous_headings":"","what":"Method srv_active()","title":"FilteredDataset R6 class — FilteredDataset","text":"Server module dataset active filters.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredDataset.html","id":"usage-13","dir":"Reference","previous_headings":"","what":"Usage","title":"FilteredDataset R6 class — FilteredDataset","text":"","code":"FilteredDataset$srv_active(id)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredDataset.html","id":"arguments-8","dir":"Reference","previous_headings":"","what":"Arguments","title":"FilteredDataset R6 class — FilteredDataset","text":"id (character(1)) shiny module instance id.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredDataset.html","id":"returns-12","dir":"Reference","previous_headings":"","what":"Returns","title":"FilteredDataset R6 class — FilteredDataset","text":"NULL.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredDataset.html","id":"method-ui-add-","dir":"Reference","previous_headings":"","what":"Method ui_add()","title":"FilteredDataset R6 class — FilteredDataset","text":"UI module add filter variable dataset.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredDataset.html","id":"usage-14","dir":"Reference","previous_headings":"","what":"Usage","title":"FilteredDataset R6 class — FilteredDataset","text":"","code":"FilteredDataset$ui_add(id)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredDataset.html","id":"arguments-9","dir":"Reference","previous_headings":"","what":"Arguments","title":"FilteredDataset R6 class — FilteredDataset","text":"id (character(1)) shiny module instance id.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredDataset.html","id":"returns-13","dir":"Reference","previous_headings":"","what":"Returns","title":"FilteredDataset R6 class — FilteredDataset","text":"Virtual method, returns nothing raises error.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredDataset.html","id":"method-srv-add-","dir":"Reference","previous_headings":"","what":"Method srv_add()","title":"FilteredDataset R6 class — FilteredDataset","text":"Server module add filter variable dataset. class srv_add calls multiple modules name FilterStates MAEFilteredDataset contains one FilterStates object colData one experiment.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredDataset.html","id":"usage-15","dir":"Reference","previous_headings":"","what":"Usage","title":"FilteredDataset R6 class — FilteredDataset","text":"","code":"FilteredDataset$srv_add(id)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredDataset.html","id":"arguments-10","dir":"Reference","previous_headings":"","what":"Arguments","title":"FilteredDataset R6 class — FilteredDataset","text":"id (character(1)) shiny module instance id.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredDataset.html","id":"returns-14","dir":"Reference","previous_headings":"","what":"Returns","title":"FilteredDataset R6 class — FilteredDataset","text":"NULL.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredDataset.html","id":"method-finalize-","dir":"Reference","previous_headings":"","what":"Method finalize()","title":"FilteredDataset R6 class — FilteredDataset","text":"Object dependencies cleanup. Destroy inputs observers stored private$session_bindings Finalize FilterStates stored private$filter_states","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredDataset.html","id":"usage-16","dir":"Reference","previous_headings":"","what":"Usage","title":"FilteredDataset R6 class — FilteredDataset","text":"","code":"FilteredDataset$finalize()"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredDataset.html","id":"returns-15","dir":"Reference","previous_headings":"","what":"Returns","title":"FilteredDataset R6 class — FilteredDataset","text":"NULL, invisibly.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredDataset.html","id":"method-clone-","dir":"Reference","previous_headings":"","what":"Method clone()","title":"FilteredDataset R6 class — FilteredDataset","text":"objects class cloneable method.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredDataset.html","id":"usage-17","dir":"Reference","previous_headings":"","what":"Usage","title":"FilteredDataset R6 class — FilteredDataset","text":"","code":"FilteredDataset$clone(deep = FALSE)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/FilteredDataset.html","id":"arguments-11","dir":"Reference","previous_headings":"","what":"Arguments","title":"FilteredDataset R6 class — FilteredDataset","text":"deep Whether make deep clone.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/LogicalFilterState.html","id":null,"dir":"Reference","previous_headings":"","what":"FilterState object for logical data — LogicalFilterState","title":"FilterState object for logical data — LogicalFilterState","text":"Manages choosing logical state.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/LogicalFilterState.html","id":"super-class","dir":"Reference","previous_headings":"","what":"Super class","title":"FilterState object for logical data — LogicalFilterState","text":"teal.slice::FilterState -> LogicalFilterState","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/LogicalFilterState.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"FilterState object for logical data — LogicalFilterState","text":"teal.slice::FilterState$finalize() teal.slice::FilterState$format() teal.slice::FilterState$get_state() teal.slice::FilterState$print() teal.slice::FilterState$server() teal.slice::FilterState$set_state() teal.slice::FilterState$ui()","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/LogicalFilterState.html","id":"public-methods","dir":"Reference","previous_headings":"","what":"Public methods","title":"FilterState object for logical data — LogicalFilterState","text":"LogicalFilterState$new() LogicalFilterState$get_call() LogicalFilterState$clone()","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/LogicalFilterState.html","id":"method-new-","dir":"Reference","previous_headings":"","what":"Method new()","title":"FilterState object for logical data — LogicalFilterState","text":"Initialize FilterState object.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/LogicalFilterState.html","id":"usage","dir":"Reference","previous_headings":"","what":"Usage","title":"FilterState object for logical data — LogicalFilterState","text":"","code":"LogicalFilterState$new( x, x_reactive = reactive(NULL), extract_type = character(0), slice )"},{"path":"https://insightsengineering.github.io/teal.slice/reference/LogicalFilterState.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"FilterState object for logical data — LogicalFilterState","text":"x (logical) variable filtered. x_reactive (reactive) returning vector type x. used update counts following change values filtered dataset. set reactive(NULL) counts based filtered dataset shown. extract_type (character) specifying whether condition calls prefixed dataname. Possible values: character(0) (default) varname condition call prefixed \"list\" varname condition call returned $ \"matrix\" varname condition call returned [, ] slice (teal_slice) specification filter state. teal_slice stored object set_state directly manipulates values within teal_slice. get_state returns teal_slice object can reused places. Note teal_slice reactiveValues, means reference semantics, .e. changes made object automatically reflected places refer teal_slice.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/LogicalFilterState.html","id":"returns","dir":"Reference","previous_headings":"","what":"Returns","title":"FilterState object for logical data — LogicalFilterState","text":"Object class LogicalFilterState, invisibly.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/LogicalFilterState.html","id":"method-get-call-","dir":"Reference","previous_headings":"","what":"Method get_call()","title":"FilterState object for logical data — LogicalFilterState","text":"Returns reproducible condition call current selection. LogicalFilterState ! optionally .na()","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/LogicalFilterState.html","id":"usage-1","dir":"Reference","previous_headings":"","what":"Usage","title":"FilterState object for logical data — LogicalFilterState","text":"","code":"LogicalFilterState$get_call(dataname)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/LogicalFilterState.html","id":"arguments-1","dir":"Reference","previous_headings":"","what":"Arguments","title":"FilterState object for logical data — LogicalFilterState","text":"dataname name data set; defaults private$get_dataname()","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/LogicalFilterState.html","id":"returns-1","dir":"Reference","previous_headings":"","what":"Returns","title":"FilterState object for logical data — LogicalFilterState","text":"call","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/LogicalFilterState.html","id":"method-clone-","dir":"Reference","previous_headings":"","what":"Method clone()","title":"FilterState object for logical data — LogicalFilterState","text":"objects class cloneable method.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/LogicalFilterState.html","id":"usage-2","dir":"Reference","previous_headings":"","what":"Usage","title":"FilterState object for logical data — LogicalFilterState","text":"","code":"LogicalFilterState$clone(deep = FALSE)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/LogicalFilterState.html","id":"arguments-2","dir":"Reference","previous_headings":"","what":"Arguments","title":"FilterState object for logical data — LogicalFilterState","text":"deep Whether make deep clone.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/LogicalFilterState.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"FilterState object for logical data — LogicalFilterState","text":"","code":"# use non-exported function from teal.slice include_css_files <- getFromNamespace(\"include_css_files\", \"teal.slice\") include_js_files <- getFromNamespace(\"include_js_files\", \"teal.slice\") LogicalFilterState <- getFromNamespace(\"LogicalFilterState\", \"teal.slice\") library(shiny) filter_state <- LogicalFilterState$new( x = sample(c(TRUE, FALSE, NA), 10, replace = TRUE), slice = teal_slice(varname = \"x\", dataname = \"data\") ) isolate(filter_state$get_call()) #> is.na(x) | x %in% c(TRUE, FALSE) filter_state$set_state( teal_slice(dataname = \"data\", varname = \"x\", selected = TRUE, keep_na = TRUE) ) isolate(filter_state$get_call()) #> is.na(x) | x # working filter in an app library(shinyjs) data_logical <- c(sample(c(TRUE, FALSE), 10, replace = TRUE), NA) fs <- LogicalFilterState$new( x = data_logical, slice = teal_slice(dataname = \"data\", varname = \"x\", selected = FALSE, keep_na = TRUE) ) ui <- fluidPage( useShinyjs(), include_css_files(pattern = \"filter-panel\"), include_js_files(pattern = \"count-bar-labels\"), column(4, tags$div( tags$h4(\"LogicalFilterState\"), fs$ui(\"fs\") )), column(4, tags$div( id = \"outputs\", # div id is needed for toggling the element tags$h4(\"Condition (i.e. call)\"), # display the condition call generated by this FilterState textOutput(\"condition_logical\"), tags$br(), tags$h4(\"Unformatted state\"), # display raw filter state textOutput(\"unformatted_logical\"), tags$br(), tags$h4(\"Formatted state\"), # display human readable filter state textOutput(\"formatted_logical\"), tags$br() )), column(4, tags$div( tags$h4(\"Programmatic filter control\"), actionButton(\"button1_logical\", \"set drop NA\", width = \"100%\"), tags$br(), actionButton(\"button2_logical\", \"set keep NA\", width = \"100%\"), tags$br(), actionButton(\"button3_logical\", \"set a selection\", width = \"100%\"), tags$br(), actionButton(\"button0_logical\", \"set initial state\", width = \"100%\"), tags$br() )) ) server <- function(input, output, session) { fs$server(\"fs\") output$condition_logical <- renderPrint(fs$get_call()) output$formatted_logical <- renderText(fs$format()) output$unformatted_logical <- renderPrint(fs$get_state()) # modify filter state programmatically observeEvent( input$button1_logical, fs$set_state(teal_slice(dataname = \"data\", varname = \"x\", keep_na = FALSE)) ) observeEvent( input$button2_logical, fs$set_state(teal_slice(dataname = \"data\", varname = \"x\", keep_na = TRUE)) ) observeEvent( input$button3_logical, fs$set_state(teal_slice(dataname = \"data\", varname = \"x\", selected = TRUE)) ) observeEvent( input$button0_logical, fs$set_state( teal_slice(dataname = \"data\", varname = \"x\", selected = FALSE, keep_na = TRUE) ) ) } if (interactive()) { shinyApp(ui, server) }"},{"path":"https://insightsengineering.github.io/teal.slice/reference/MAEFilterStates.html","id":null,"dir":"Reference","previous_headings":"","what":"FilterStates subclass for MultiAssayExperiments — MAEFilterStates","title":"FilterStates subclass for MultiAssayExperiments — MAEFilterStates","text":"Handles filter states MultiAssayExperiment.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/MAEFilterStates.html","id":"super-class","dir":"Reference","previous_headings":"","what":"Super class","title":"FilterStates subclass for MultiAssayExperiments — MAEFilterStates","text":"teal.slice::FilterStates -> MAEFilterStates","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/MAEFilterStates.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"FilterStates subclass for MultiAssayExperiments — MAEFilterStates","text":"teal.slice::FilterStates$clear_filter_states() teal.slice::FilterStates$finalize() teal.slice::FilterStates$format() teal.slice::FilterStates$get_call() teal.slice::FilterStates$get_filter_state() teal.slice::FilterStates$print() teal.slice::FilterStates$remove_filter_state() teal.slice::FilterStates$set_filter_state() teal.slice::FilterStates$srv_active() teal.slice::FilterStates$srv_add() teal.slice::FilterStates$ui_active() teal.slice::FilterStates$ui_add()","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/MAEFilterStates.html","id":"public-methods","dir":"Reference","previous_headings":"","what":"Public methods","title":"FilterStates subclass for MultiAssayExperiments — MAEFilterStates","text":"MAEFilterStates$new() MAEFilterStates$clone()","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/MAEFilterStates.html","id":"method-new-","dir":"Reference","previous_headings":"","what":"Method new()","title":"FilterStates subclass for MultiAssayExperiments — MAEFilterStates","text":"Initialize MAEFilterStates object.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/MAEFilterStates.html","id":"usage","dir":"Reference","previous_headings":"","what":"Usage","title":"FilterStates subclass for MultiAssayExperiments — MAEFilterStates","text":"","code":"MAEFilterStates$new( data, data_reactive = function(sid = \"\") NULL, dataname, datalabel = \"subjects\", keys = character(0) )"},{"path":"https://insightsengineering.github.io/teal.slice/reference/MAEFilterStates.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"FilterStates subclass for MultiAssayExperiments — MAEFilterStates","text":"data (MultiAssayExperiment) R object MultiAssayExperiment::subsetByColData function applied . data_reactive (function(sid)) return MultiAssayExperiment object NULL. object needed FilterState counts updated change filters. function returns NULL filtered counts shown. Function sid argument character. dataname (character(1)) name data used subset expression. Passed function argument attached FilterStates. datalabel (character(1)) optional text label. keys (character) key column names. varlabels (character) labels variables used object.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/MAEFilterStates.html","id":"method-clone-","dir":"Reference","previous_headings":"","what":"Method clone()","title":"FilterStates subclass for MultiAssayExperiments — MAEFilterStates","text":"objects class cloneable method.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/MAEFilterStates.html","id":"usage-1","dir":"Reference","previous_headings":"","what":"Usage","title":"FilterStates subclass for MultiAssayExperiments — MAEFilterStates","text":"","code":"MAEFilterStates$clone(deep = FALSE)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/MAEFilterStates.html","id":"arguments-1","dir":"Reference","previous_headings":"","what":"Arguments","title":"FilterStates subclass for MultiAssayExperiments — MAEFilterStates","text":"deep Whether make deep clone.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/MAEFilteredDataset.html","id":null,"dir":"Reference","previous_headings":"","what":"MAEFilteredDataset R6 class — MAEFilteredDataset","title":"MAEFilteredDataset R6 class — MAEFilteredDataset","text":"MAEFilteredDataset R6 class MAEFilteredDataset R6 class","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/MAEFilteredDataset.html","id":"super-class","dir":"Reference","previous_headings":"","what":"Super class","title":"MAEFilteredDataset R6 class — MAEFilteredDataset","text":"teal.slice::FilteredDataset -> MAEFilteredDataset","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/MAEFilteredDataset.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"MAEFilteredDataset R6 class — MAEFilteredDataset","text":"teal.slice::FilteredDataset$clear_filter_states() teal.slice::FilteredDataset$finalize() teal.slice::FilteredDataset$format() teal.slice::FilteredDataset$get_call() teal.slice::FilteredDataset$get_dataname() teal.slice::FilteredDataset$get_dataset() teal.slice::FilteredDataset$get_dataset_label() teal.slice::FilteredDataset$get_filter_state() teal.slice::FilteredDataset$get_keys() teal.slice::FilteredDataset$print() teal.slice::FilteredDataset$srv_active() teal.slice::FilteredDataset$srv_add() teal.slice::FilteredDataset$ui_active()","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/MAEFilteredDataset.html","id":"public-methods","dir":"Reference","previous_headings":"","what":"Public methods","title":"MAEFilteredDataset R6 class — MAEFilteredDataset","text":"MAEFilteredDataset$new() MAEFilteredDataset$set_filter_state() MAEFilteredDataset$remove_filter_state() MAEFilteredDataset$ui_add() MAEFilteredDataset$get_filter_overview() MAEFilteredDataset$clone()","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/MAEFilteredDataset.html","id":"method-new-","dir":"Reference","previous_headings":"","what":"Method new()","title":"MAEFilteredDataset R6 class — MAEFilteredDataset","text":"Initialize MAEFilteredDataset object.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/MAEFilteredDataset.html","id":"usage","dir":"Reference","previous_headings":"","what":"Usage","title":"MAEFilteredDataset R6 class — MAEFilteredDataset","text":"","code":"MAEFilteredDataset$new( dataset, dataname, keys = character(0), label = character(0) )"},{"path":"https://insightsengineering.github.io/teal.slice/reference/MAEFilteredDataset.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"MAEFilteredDataset R6 class — MAEFilteredDataset","text":"dataset (MulitiAssayExperiment) single MulitiAssayExperiment filters rendered. dataname (character(1)) syntactically valid name given dataset. keys (character) optional vector primary key column names. label (character(1)) label describe dataset.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/MAEFilteredDataset.html","id":"returns","dir":"Reference","previous_headings":"","what":"Returns","title":"MAEFilteredDataset R6 class — MAEFilteredDataset","text":"Object class MAEFilteredDataset, invisibly.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/MAEFilteredDataset.html","id":"method-set-filter-state-","dir":"Reference","previous_headings":"","what":"Method set_filter_state()","title":"MAEFilteredDataset R6 class — MAEFilteredDataset","text":"Set filter state.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/MAEFilteredDataset.html","id":"usage-1","dir":"Reference","previous_headings":"","what":"Usage","title":"MAEFilteredDataset R6 class — MAEFilteredDataset","text":"","code":"MAEFilteredDataset$set_filter_state(state)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/MAEFilteredDataset.html","id":"arguments-1","dir":"Reference","previous_headings":"","what":"Arguments","title":"MAEFilteredDataset R6 class — MAEFilteredDataset","text":"state (teal_slices)","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/MAEFilteredDataset.html","id":"returns-1","dir":"Reference","previous_headings":"","what":"Returns","title":"MAEFilteredDataset R6 class — MAEFilteredDataset","text":"NULL, invisibly.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/MAEFilteredDataset.html","id":"method-remove-filter-state-","dir":"Reference","previous_headings":"","what":"Method remove_filter_state()","title":"MAEFilteredDataset R6 class — MAEFilteredDataset","text":"Remove one FilterState MAEFilteredDataset.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/MAEFilteredDataset.html","id":"usage-2","dir":"Reference","previous_headings":"","what":"Usage","title":"MAEFilteredDataset R6 class — MAEFilteredDataset","text":"","code":"MAEFilteredDataset$remove_filter_state(state)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/MAEFilteredDataset.html","id":"arguments-2","dir":"Reference","previous_headings":"","what":"Arguments","title":"MAEFilteredDataset R6 class — MAEFilteredDataset","text":"state (teal_slices) specifying FilterState objects remove; teal_slices may contain dataname varname, elements ignored.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/MAEFilteredDataset.html","id":"returns-2","dir":"Reference","previous_headings":"","what":"Returns","title":"MAEFilteredDataset R6 class — MAEFilteredDataset","text":"NULL, invisibly.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/MAEFilteredDataset.html","id":"method-ui-add-","dir":"Reference","previous_headings":"","what":"Method ui_add()","title":"MAEFilteredDataset R6 class — MAEFilteredDataset","text":"UI module add filter variable dataset.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/MAEFilteredDataset.html","id":"usage-3","dir":"Reference","previous_headings":"","what":"Usage","title":"MAEFilteredDataset R6 class — MAEFilteredDataset","text":"","code":"MAEFilteredDataset$ui_add(id)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/MAEFilteredDataset.html","id":"arguments-3","dir":"Reference","previous_headings":"","what":"Arguments","title":"MAEFilteredDataset R6 class — MAEFilteredDataset","text":"id (character(1)) shiny module instance id.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/MAEFilteredDataset.html","id":"returns-3","dir":"Reference","previous_headings":"","what":"Returns","title":"MAEFilteredDataset R6 class — MAEFilteredDataset","text":"shiny.tag","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/MAEFilteredDataset.html","id":"method-get-filter-overview-","dir":"Reference","previous_headings":"","what":"Method get_filter_overview()","title":"MAEFilteredDataset R6 class — MAEFilteredDataset","text":"Creates row filter overview form dataname -- observations (remaining/total) -- subjects (remaining/total) - MAE","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/MAEFilteredDataset.html","id":"usage-4","dir":"Reference","previous_headings":"","what":"Usage","title":"MAEFilteredDataset R6 class — MAEFilteredDataset","text":"","code":"MAEFilteredDataset$get_filter_overview()"},{"path":"https://insightsengineering.github.io/teal.slice/reference/MAEFilteredDataset.html","id":"returns-4","dir":"Reference","previous_headings":"","what":"Returns","title":"MAEFilteredDataset R6 class — MAEFilteredDataset","text":"data.frame.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/MAEFilteredDataset.html","id":"method-clone-","dir":"Reference","previous_headings":"","what":"Method clone()","title":"MAEFilteredDataset R6 class — MAEFilteredDataset","text":"objects class cloneable method.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/MAEFilteredDataset.html","id":"usage-5","dir":"Reference","previous_headings":"","what":"Usage","title":"MAEFilteredDataset R6 class — MAEFilteredDataset","text":"","code":"MAEFilteredDataset$clone(deep = FALSE)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/MAEFilteredDataset.html","id":"arguments-4","dir":"Reference","previous_headings":"","what":"Arguments","title":"MAEFilteredDataset R6 class — MAEFilteredDataset","text":"deep Whether make deep clone.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/MAEFilteredDataset.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"MAEFilteredDataset R6 class — MAEFilteredDataset","text":"","code":"# use non-exported function from teal.slice MAEFilteredDataset <- getFromNamespace(\"MAEFilteredDataset\", \"teal.slice\") data(miniACC, package = \"MultiAssayExperiment\") dataset <- MAEFilteredDataset$new(miniACC, \"MAE\") fs <- teal_slices( teal_slice( dataname = \"MAE\", varname = \"years_to_birth\", selected = c(30, 50), keep_na = TRUE ), teal_slice( dataname = \"MAE\", varname = \"vital_status\", selected = \"1\", keep_na = FALSE ), teal_slice( dataname = \"MAE\", varname = \"gender\", selected = \"female\", keep_na = TRUE ), teal_slice( dataname = \"MAE\", varname = \"ARRAY_TYPE\", selected = \"\", keep_na = TRUE ) ) dataset$set_filter_state(state = fs) #> Warning: filters for columns: ARRAY_TYPE excluded from MAE library(shiny) isolate(dataset$get_filter_state()) #> { #> \"slices\": [ #> { #> \"dataname\" : \"MAE\", #> \"varname\" : \"years_to_birth\", #> \"id\" : \"MAE years_to_birth\", #> \"choices\" : [14, 83], #> \"selected\" : [30, 50], #> \"keep_na\" : true, #> \"fixed\" : false, #> \"anchored\" : false, #> \"multiple\" : true #> }, #> { #> \"dataname\" : \"MAE\", #> \"varname\" : \"vital_status\", #> \"id\" : \"MAE vital_status\", #> \"choices\" : [\"0\", \"1\"], #> \"selected\" : [\"1\"], #> \"keep_na\" : false, #> \"fixed\" : false, #> \"anchored\" : false, #> \"multiple\" : true #> }, #> { #> \"dataname\" : \"MAE\", #> \"varname\" : \"gender\", #> \"id\" : \"MAE gender\", #> \"choices\" : [\"female\", \"male\"], #> \"selected\" : [\"female\"], #> \"keep_na\" : true, #> \"fixed\" : false, #> \"anchored\" : false, #> \"multiple\" : true #> } #> ], #> \"attributes\": { #> \"include_varnames\" : { #> \"MAE\" : [\"patientID\", \"years_to_birth\", ... #> }, #> \"count_type\" : \"none\", #> \"allow_add\" : true #> } #> }"},{"path":"https://insightsengineering.github.io/teal.slice/reference/MatrixFilterStates.html","id":null,"dir":"Reference","previous_headings":"","what":"FilterStates subclass for matrices — MatrixFilterStates","title":"FilterStates subclass for matrices — MatrixFilterStates","text":"Handles filter states matrix.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/MatrixFilterStates.html","id":"super-class","dir":"Reference","previous_headings":"","what":"Super class","title":"FilterStates subclass for matrices — MatrixFilterStates","text":"teal.slice::FilterStates -> MatrixFilterStates","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/MatrixFilterStates.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"FilterStates subclass for matrices — MatrixFilterStates","text":"teal.slice::FilterStates$clear_filter_states() teal.slice::FilterStates$finalize() teal.slice::FilterStates$format() teal.slice::FilterStates$get_call() teal.slice::FilterStates$get_filter_state() teal.slice::FilterStates$print() teal.slice::FilterStates$remove_filter_state() teal.slice::FilterStates$set_filter_state() teal.slice::FilterStates$srv_active() teal.slice::FilterStates$srv_add() teal.slice::FilterStates$ui_active() teal.slice::FilterStates$ui_add()","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/MatrixFilterStates.html","id":"public-methods","dir":"Reference","previous_headings":"","what":"Public methods","title":"FilterStates subclass for matrices — MatrixFilterStates","text":"MatrixFilterStates$new() MatrixFilterStates$clone()","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/MatrixFilterStates.html","id":"method-new-","dir":"Reference","previous_headings":"","what":"Method new()","title":"FilterStates subclass for matrices — MatrixFilterStates","text":"Initialize MatrixFilterStates object.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/MatrixFilterStates.html","id":"usage","dir":"Reference","previous_headings":"","what":"Usage","title":"FilterStates subclass for matrices — MatrixFilterStates","text":"","code":"MatrixFilterStates$new( data, data_reactive = function(sid = \"\") NULL, dataname, datalabel = NULL )"},{"path":"https://insightsengineering.github.io/teal.slice/reference/MatrixFilterStates.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"FilterStates subclass for matrices — MatrixFilterStates","text":"data (matrix) R object subset function applied . data_reactive (function(sid)) return matrix object NULL. object needed FilterState counts updated change filters. function returns NULL filtered counts shown. Function sid argument character. dataname (character(1)) name data used subset expression. Passed function argument attached FilterStates. datalabel (character(1)) optional text label. name experiment.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/MatrixFilterStates.html","id":"method-clone-","dir":"Reference","previous_headings":"","what":"Method clone()","title":"FilterStates subclass for matrices — MatrixFilterStates","text":"objects class cloneable method.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/MatrixFilterStates.html","id":"usage-1","dir":"Reference","previous_headings":"","what":"Usage","title":"FilterStates subclass for matrices — MatrixFilterStates","text":"","code":"MatrixFilterStates$clone(deep = FALSE)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/MatrixFilterStates.html","id":"arguments-1","dir":"Reference","previous_headings":"","what":"Arguments","title":"FilterStates subclass for matrices — MatrixFilterStates","text":"deep Whether make deep clone.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/RangeFilterState.html","id":null,"dir":"Reference","previous_headings":"","what":"FilterState object for numeric data — RangeFilterState","title":"FilterState object for numeric data — RangeFilterState","text":"Manages choosing numeric range.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/RangeFilterState.html","id":"super-class","dir":"Reference","previous_headings":"","what":"Super class","title":"FilterState object for numeric data — RangeFilterState","text":"teal.slice::FilterState -> RangeFilterState","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/RangeFilterState.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"FilterState object for numeric data — RangeFilterState","text":"teal.slice::FilterState$finalize() teal.slice::FilterState$format() teal.slice::FilterState$get_state() teal.slice::FilterState$print() teal.slice::FilterState$server() teal.slice::FilterState$set_state() teal.slice::FilterState$ui()","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/RangeFilterState.html","id":"public-methods","dir":"Reference","previous_headings":"","what":"Public methods","title":"FilterState object for numeric data — RangeFilterState","text":"RangeFilterState$new() RangeFilterState$get_call() RangeFilterState$get_keep_inf() RangeFilterState$clone()","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/RangeFilterState.html","id":"method-new-","dir":"Reference","previous_headings":"","what":"Method new()","title":"FilterState object for numeric data — RangeFilterState","text":"Initialize FilterState object range selection.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/RangeFilterState.html","id":"usage","dir":"Reference","previous_headings":"","what":"Usage","title":"FilterState object for numeric data — RangeFilterState","text":"","code":"RangeFilterState$new( x, x_reactive = reactive(NULL), extract_type = character(0), slice )"},{"path":"https://insightsengineering.github.io/teal.slice/reference/RangeFilterState.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"FilterState object for numeric data — RangeFilterState","text":"x (numeric) variable filtered. x_reactive (reactive) returning vector type x. used update counts following change values filtered dataset. set reactive(NULL) counts based filtered dataset shown. extract_type (character) specifying whether condition calls prefixed dataname. Possible values: character(0) (default) varname condition call prefixed \"list\" varname condition call returned $ \"matrix\" varname condition call returned [, ] slice (teal_slice) specification filter state. teal_slice stored object set_state directly manipulates values within teal_slice. get_state returns teal_slice object can reused places. Note teal_slice reactiveValues, means reference semantics, .e. changes made object automatically reflected places refer teal_slice.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/RangeFilterState.html","id":"returns","dir":"Reference","previous_headings":"","what":"Returns","title":"FilterState object for numeric data — RangeFilterState","text":"Object class RangeFilterState, invisibly.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/RangeFilterState.html","id":"method-get-call-","dir":"Reference","previous_headings":"","what":"Method get_call()","title":"FilterState object for numeric data — RangeFilterState","text":"Returns reproducible condition call current selection. class returned call looks like >= & <= optional .na() .finite().","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/RangeFilterState.html","id":"usage-1","dir":"Reference","previous_headings":"","what":"Usage","title":"FilterState object for numeric data — RangeFilterState","text":"","code":"RangeFilterState$get_call(dataname)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/RangeFilterState.html","id":"arguments-1","dir":"Reference","previous_headings":"","what":"Arguments","title":"FilterState object for numeric data — RangeFilterState","text":"dataname name data set; defaults private$get_dataname()","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/RangeFilterState.html","id":"returns-1","dir":"Reference","previous_headings":"","what":"Returns","title":"FilterState object for numeric data — RangeFilterState","text":"call","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/RangeFilterState.html","id":"method-get-keep-inf-","dir":"Reference","previous_headings":"","what":"Method get_keep_inf()","title":"FilterState object for numeric data — RangeFilterState","text":"Returns current keep_inf selection.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/RangeFilterState.html","id":"usage-2","dir":"Reference","previous_headings":"","what":"Usage","title":"FilterState object for numeric data — RangeFilterState","text":"","code":"RangeFilterState$get_keep_inf()"},{"path":"https://insightsengineering.github.io/teal.slice/reference/RangeFilterState.html","id":"returns-2","dir":"Reference","previous_headings":"","what":"Returns","title":"FilterState object for numeric data — RangeFilterState","text":"logical(1)","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/RangeFilterState.html","id":"method-clone-","dir":"Reference","previous_headings":"","what":"Method clone()","title":"FilterState object for numeric data — RangeFilterState","text":"objects class cloneable method.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/RangeFilterState.html","id":"usage-3","dir":"Reference","previous_headings":"","what":"Usage","title":"FilterState object for numeric data — RangeFilterState","text":"","code":"RangeFilterState$clone(deep = FALSE)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/RangeFilterState.html","id":"arguments-2","dir":"Reference","previous_headings":"","what":"Arguments","title":"FilterState object for numeric data — RangeFilterState","text":"deep Whether make deep clone.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/RangeFilterState.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"FilterState object for numeric data — RangeFilterState","text":"","code":"# use non-exported function from teal.slice include_css_files <- getFromNamespace(\"include_css_files\", \"teal.slice\") include_js_files <- getFromNamespace(\"include_js_files\", \"teal.slice\") RangeFilterState <- getFromNamespace(\"RangeFilterState\", \"teal.slice\") library(shiny) filter_state <- RangeFilterState$new( x = c(NA, Inf, seq(1:10)), slice = teal_slice(varname = \"x\", dataname = \"data\") ) isolate(filter_state$get_call()) #> NULL filter_state$set_state( teal_slice( dataname = \"data\", varname = \"x\", selected = c(3L, 8L), keep_na = TRUE, keep_inf = TRUE ) ) isolate(filter_state$get_call()) #> is.na(x) | (is.infinite(x) | x >= 3 & x <= 8) # working filter in an app library(shinyjs) data_range <- c(runif(100, 0, 1), NA, Inf) fs <- RangeFilterState$new( x = data_range, slice = teal_slice( dataname = \"data\", varname = \"x\", selected = c(0.15, 0.93), keep_na = TRUE, keep_inf = TRUE ) ) ui <- fluidPage( useShinyjs(), include_css_files(pattern = \"filter-panel\"), include_js_files(pattern = \"count-bar-labels\"), column(4, tags$div( tags$h4(\"RangeFilterState\"), fs$ui(\"fs\") )), column(4, tags$div( id = \"outputs\", # div id is needed for toggling the element tags$h4(\"Condition (i.e. call)\"), # display the condition call generated by this FilterState textOutput(\"condition_range\"), tags$br(), tags$h4(\"Unformatted state\"), # display raw filter state textOutput(\"unformatted_range\"), tags$br(), tags$h4(\"Formatted state\"), # display human readable filter state textOutput(\"formatted_range\"), tags$br() )), column(4, tags$div( tags$h4(\"Programmatic filter control\"), actionButton(\"button1_range\", \"set drop NA\", width = \"100%\"), tags$br(), actionButton(\"button2_range\", \"set keep NA\", width = \"100%\"), tags$br(), actionButton(\"button3_range\", \"set drop Inf\", width = \"100%\"), tags$br(), actionButton(\"button4_range\", \"set keep Inf\", width = \"100%\"), tags$br(), actionButton(\"button5_range\", \"set a range\", width = \"100%\"), tags$br(), actionButton(\"button6_range\", \"set full range\", width = \"100%\"), tags$br(), actionButton(\"button0_range\", \"set initial state\", width = \"100%\"), tags$br() )) ) server <- function(input, output, session) { fs$server(\"fs\") output$condition_range <- renderPrint(fs$get_call()) output$formatted_range <- renderText(fs$format()) output$unformatted_range <- renderPrint(fs$get_state()) # modify filter state programmatically observeEvent( input$button1_range, fs$set_state(teal_slice(dataname = \"data\", varname = \"x\", keep_na = FALSE)) ) observeEvent( input$button2_range, fs$set_state(teal_slice(dataname = \"data\", varname = \"x\", keep_na = TRUE)) ) observeEvent( input$button3_range, fs$set_state(teal_slice(dataname = \"data\", varname = \"x\", keep_inf = FALSE)) ) observeEvent( input$button4_range, fs$set_state(teal_slice(dataname = \"data\", varname = \"x\", keep_inf = TRUE)) ) observeEvent( input$button5_range, fs$set_state( teal_slice(dataname = \"data\", varname = \"x\", selected = c(0.2, 0.74)) ) ) observeEvent( input$button6_range, fs$set_state(teal_slice(dataname = \"data\", varname = \"x\", selected = c(0, 1))) ) observeEvent( input$button0_range, fs$set_state( teal_slice(\"data\", \"variable\", selected = c(0.15, 0.93), keep_na = TRUE, keep_inf = TRUE) ) ) } if (interactive()) { shinyApp(ui, server) }"},{"path":"https://insightsengineering.github.io/teal.slice/reference/SEFilterStates.html","id":null,"dir":"Reference","previous_headings":"","what":"FilterStates subclass for SummarizedExperiments — SEFilterStates","title":"FilterStates subclass for SummarizedExperiments — SEFilterStates","text":"Handles filter states SummaryExperiment.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/SEFilterStates.html","id":"super-class","dir":"Reference","previous_headings":"","what":"Super class","title":"FilterStates subclass for SummarizedExperiments — SEFilterStates","text":"teal.slice::FilterStates -> SEFilterStates","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/SEFilterStates.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"FilterStates subclass for SummarizedExperiments — SEFilterStates","text":"teal.slice::FilterStates$clear_filter_states() teal.slice::FilterStates$finalize() teal.slice::FilterStates$format() teal.slice::FilterStates$get_call() teal.slice::FilterStates$get_filter_state() teal.slice::FilterStates$print() teal.slice::FilterStates$remove_filter_state() teal.slice::FilterStates$srv_active() teal.slice::FilterStates$ui_active()","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/SEFilterStates.html","id":"public-methods","dir":"Reference","previous_headings":"","what":"Public methods","title":"FilterStates subclass for SummarizedExperiments — SEFilterStates","text":"SEFilterStates$new() SEFilterStates$set_filter_state() SEFilterStates$ui_add() SEFilterStates$srv_add() SEFilterStates$clone()","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/SEFilterStates.html","id":"method-new-","dir":"Reference","previous_headings":"","what":"Method new()","title":"FilterStates subclass for SummarizedExperiments — SEFilterStates","text":"Initialize SEFilterStates object.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/SEFilterStates.html","id":"usage","dir":"Reference","previous_headings":"","what":"Usage","title":"FilterStates subclass for SummarizedExperiments — SEFilterStates","text":"","code":"SEFilterStates$new( data, data_reactive = function(sid = \"\") NULL, dataname, datalabel = NULL )"},{"path":"https://insightsengineering.github.io/teal.slice/reference/SEFilterStates.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"FilterStates subclass for SummarizedExperiments — SEFilterStates","text":"data (SummarizedExperiment) R object subset function applied . data_reactive (function(sid)) return SummarizedExperiment object NULL. object needed FilterState counts updated change filters. function returns NULL filtered counts shown. Function sid argument character. dataname (character(1)) name data used expression specified function argument attached FilterStates. datalabel (character(1)) optional text label. name experiment.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/SEFilterStates.html","id":"method-set-filter-state-","dir":"Reference","previous_headings":"","what":"Method set_filter_state()","title":"FilterStates subclass for SummarizedExperiments — SEFilterStates","text":"Set filter state.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/SEFilterStates.html","id":"usage-1","dir":"Reference","previous_headings":"","what":"Usage","title":"FilterStates subclass for SummarizedExperiments — SEFilterStates","text":"","code":"SEFilterStates$set_filter_state(state)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/SEFilterStates.html","id":"arguments-1","dir":"Reference","previous_headings":"","what":"Arguments","title":"FilterStates subclass for SummarizedExperiments — SEFilterStates","text":"state (teal_slices) teal_slice objects contain field arg %% c(\"subset\", \"select\")","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/SEFilterStates.html","id":"returns","dir":"Reference","previous_headings":"","what":"Returns","title":"FilterStates subclass for SummarizedExperiments — SEFilterStates","text":"NULL, invisibly.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/SEFilterStates.html","id":"method-ui-add-","dir":"Reference","previous_headings":"","what":"Method ui_add()","title":"FilterStates subclass for SummarizedExperiments — SEFilterStates","text":"shiny UI module add filter variable.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/SEFilterStates.html","id":"usage-2","dir":"Reference","previous_headings":"","what":"Usage","title":"FilterStates subclass for SummarizedExperiments — SEFilterStates","text":"","code":"SEFilterStates$ui_add(id)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/SEFilterStates.html","id":"arguments-2","dir":"Reference","previous_headings":"","what":"Arguments","title":"FilterStates subclass for SummarizedExperiments — SEFilterStates","text":"id (character(1)) shiny module instance id.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/SEFilterStates.html","id":"returns-1","dir":"Reference","previous_headings":"","what":"Returns","title":"FilterStates subclass for SummarizedExperiments — SEFilterStates","text":"shiny.tag","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/SEFilterStates.html","id":"method-srv-add-","dir":"Reference","previous_headings":"","what":"Method srv_add()","title":"FilterStates subclass for SummarizedExperiments — SEFilterStates","text":"shiny server module add filter variable. Module controls available choices select filter variable. Selected filter variable removed available choices. Removed filter variable gets back available choices. module unlike FilterStates classes manages two sets filter variables - one colData another rowData.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/SEFilterStates.html","id":"usage-3","dir":"Reference","previous_headings":"","what":"Usage","title":"FilterStates subclass for SummarizedExperiments — SEFilterStates","text":"","code":"SEFilterStates$srv_add(id)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/SEFilterStates.html","id":"arguments-3","dir":"Reference","previous_headings":"","what":"Arguments","title":"FilterStates subclass for SummarizedExperiments — SEFilterStates","text":"id (character(1)) shiny module instance id.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/SEFilterStates.html","id":"returns-2","dir":"Reference","previous_headings":"","what":"Returns","title":"FilterStates subclass for SummarizedExperiments — SEFilterStates","text":"NULL","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/SEFilterStates.html","id":"method-clone-","dir":"Reference","previous_headings":"","what":"Method clone()","title":"FilterStates subclass for SummarizedExperiments — SEFilterStates","text":"objects class cloneable method.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/SEFilterStates.html","id":"usage-4","dir":"Reference","previous_headings":"","what":"Usage","title":"FilterStates subclass for SummarizedExperiments — SEFilterStates","text":"","code":"SEFilterStates$clone(deep = FALSE)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/SEFilterStates.html","id":"arguments-4","dir":"Reference","previous_headings":"","what":"Arguments","title":"FilterStates subclass for SummarizedExperiments — SEFilterStates","text":"deep Whether make deep clone.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/calls_combine_by.html","id":null,"dir":"Reference","previous_headings":"","what":"Compose predicates — calls_combine_by","title":"Compose predicates — calls_combine_by","text":"Combines calls logical operator.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/calls_combine_by.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compose predicates — calls_combine_by","text":"","code":"calls_combine_by(calls, operator)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/calls_combine_by.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compose predicates — calls_combine_by","text":"calls (list) containing calls (symbols) combined operator operator (character(1)) infix operator use predicate composition, e.g. \"&\"","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/calls_combine_by.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Compose predicates — calls_combine_by","text":"call elements calls composed operator NULL calls empty list.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/calls_combine_by.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Compose predicates — calls_combine_by","text":"function used combine logical predicates produced FilterState objects build complete subset expression.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/calls_combine_by.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Compose predicates — calls_combine_by","text":"","code":"# use non-exported function from teal.slice calls_combine_by <- getFromNamespace(\"calls_combine_by\", \"teal.slice\") calls <- list( quote(SEX == \"F\"), # subsetting on factor quote(AGE >= 20 & AGE <= 50), # subsetting on range quote(!SURV) # subsetting on logical ) calls_combine_by(calls, \"&\") #> SEX == \"F\" & (AGE >= 20 & AGE <= 50) & !SURV"},{"path":"https://insightsengineering.github.io/teal.slice/reference/choices_labeled.html","id":null,"dir":"Reference","previous_headings":"","what":"Set ","title":"Set ","text":"often useful marks drop-boxes shiny::selectInput().","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/choices_labeled.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set ","text":"","code":"choices_labeled(choices, labels, subset = NULL, types = NULL)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/choices_labeled.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Set ","text":"choices (character numeric logical) vector labels (character) vector containing labels applied choices. NA \"Label Missing\" used. subset vector subset choices. useful variables need named. argument used, returned vector match order. types vector containing types columns.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/choices_labeled.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Set ","text":"named character vector.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/choices_labeled.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Set ","text":"either choices labels factors, coerced character. Duplicated elements choices get removed.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/coalesce_r.html","id":null,"dir":"Reference","previous_headings":"","what":"Recursively coalesce list elements. — coalesce_r","title":"Recursively coalesce list elements. — coalesce_r","text":"Returns first element list NULL, recursively.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/coalesce_r.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Recursively coalesce list elements. — coalesce_r","text":"","code":"coalesce_r(x)"},{"path":"https://insightsengineering.github.io/teal.slice/reference/coalesce_r.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Recursively coalesce list elements. — coalesce_r","text":"x (list), either atomic vectors named lists","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/coalesce_r.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Recursively coalesce list elements. — coalesce_r","text":"Either atomic vector length 1 (potentially nested) list.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/coalesce_r.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Recursively coalesce list elements. — coalesce_r","text":"Given list atomic vectors, first non-null element returned. Given list lists, names found elements list first non-null element given name returned. function used internally c.teal_slices manage teal_slices attributes.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/countBar.html","id":null,"dir":"Reference","previous_headings":"","what":"Progress bar with label — countBar","title":"Progress bar with label — countBar","text":"shiny element displaying progress bar observation count.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/countBar.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Progress bar with label — countBar","text":"","code":"countBar(inputId, label, countmax, countnow = NULL, counttotal = countmax) updateCountBar( session = getDefaultReactiveDomain(), inputId, label, countmax, countnow = NULL, counttotal ) updateCountText( session = getDefaultReactiveDomain(), inputId, label, countmax, countnow )"},{"path":"https://insightsengineering.github.io/teal.slice/reference/countBar.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Progress bar with label — countBar","text":"inputId (character(1)) shiny id parent element (e.g. check-box group input). label (character(1)) Text display followed counts. countmax (numeric(1)) Maximum count single element. countnow (numeric(1)) Current count single element. counttotal (numeric(1)) Sum total maximum counts elements, see Details. session (session) shiny session object passed function given shinyServer.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/countBar.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Progress bar with label — countBar","text":"shiny.tag object progress bar label.","code":""},{"path":"https://insightsengineering.github.io/teal.slice/reference/countBar.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Progress bar with label — countBar","text":"progress bar created visualize number counts variable, filling text label. progress bar width derived fraction container width: style = \"width: / %\", progress bar filled fraction / , text label obtained
    -

    Details

    +

    Details +

    The CDISCFilteredData class implements logic to filter a relational dataset by inheriting from FilteredData. A dataset can have up to one parent dataset. Rows are identified by the foreign @@ -86,20 +109,25 @@

    Detailsiris).

    -

    See also

    +

    See also +

    FilteredData class

    -

    Super class

    +

    Super class +

    teal.slice::FilteredData -> CDISCFilteredData

    +

    Inherited methods


    -

    Method datanames()

    +

    +
    +
    +

    Method datanames() +

    Get datanames

    The datanames are returned in the order in which they must be -evaluated (in case of dependencies).

    -

    Usage

    -

    CDISCFilteredData$datanames()

    +evaluated (in case of dependencies).

    +
    +

    Usage +

    +

    +
    +
    CDISCFilteredData$datanames()
    +

    +
    -

    Returns

    +

    Returns +

    (character vector) of datanames

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns the filter call to filter a single dataset including the inner_join with its parent dataset. It assumes that the filtered datasets it depends -on are available.

    -

    Usage

    -

    CDISCFilteredData$get_call(dataname)

    +on are available.

    +
    +

    Usage +

    +

    +
    +
    CDISCFilteredData$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (call or list of calls ) to filter dataset

    -


    -

    Method get_filterable_datanames()

    -

    Get names of datasets available for filtering

    -

    Usage

    -

    CDISCFilteredData$get_filterable_datanames(dataname)

    +
    +

    +
    +
    +

    Method get_filterable_datanames() +

    +

    Get names of datasets available for filtering

    +
    +

    Usage +

    +

    +
    +
    CDISCFilteredData$get_filterable_datanames(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character vector) names of the dataset

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (character vector) of dataset names

    -


    -

    Method get_filterable_varnames()

    -

    Gets variable names of a given dataname for the filtering. This excludes parent dataset variable names.

    -

    Usage

    -

    CDISCFilteredData$get_filterable_varnames(dataname)

    +
    +

    +
    +
    +

    Method get_filterable_varnames() +

    +

    Gets variable names of a given dataname for the filtering. This excludes parent dataset variable names.

    +
    +

    Usage +

    +

    +
    +
    CDISCFilteredData$get_filterable_varnames(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (character vector) of variable names

    -


    -

    Method get_filter_overview()

    +
    +

    +
    +
    +

    Method get_filter_overview() +

    Get filter overview table in form of X (filtered) / Y (non-filtered)

    -

    This is intended to be presented in the application.

    -

    Usage

    -

    CDISCFilteredData$get_filter_overview(datanames)

    +

    This is intended to be presented in the application.

    +
    +

    Usage +

    +

    +
    +
    CDISCFilteredData$get_filter_overview(datanames)
    +

    +
    -

    Arguments

    -

    datanames
    +

    Arguments +

    +

    +
    +
    +
    datanames

    (character vector) names of the dataset (or "all")

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (matrix) matrix of observations and subjects of all datasets

    -


    -

    Method get_parentname()

    -

    Get parent dataset name

    -

    Usage

    -

    CDISCFilteredData$get_parentname(dataname)

    +
    +

    +
    +
    +

    Method get_parentname() +

    +

    Get parent dataset name

    +
    +

    Usage +

    +

    +
    +
    CDISCFilteredData$get_parentname(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (character) name of parent dataset

    -


    -

    Method set_dataset()

    +
    +

    +
    +
    +

    Method set_dataset() +

    Add dataset

    Add dataset and preserve all attributes attached to this object. Technically set_dataset created FilteredDataset which keeps -dataset for filtering purpose.

    -

    Usage

    -

    CDISCFilteredData$set_dataset(dataset_args, dataname)

    +dataset for filtering purpose.

    +
    +

    Usage +

    +

    +
    +
    CDISCFilteredData$set_dataset(dataset_args, dataname)
    +

    +
    -

    Arguments

    -

    dataset_args
    +

    Arguments +

    +

    +
    +
    +
    dataset_args

    (list)
    containing the arguments except (dataname) needed by init_filtered_dataset (can also @@ -273,27 +413,46 @@

    Arguments -

    Returns

    +

    Returns +

    (self) object of this class

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    CDISCFilteredData$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    CDISCFilteredData$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -301,7 +460,8 @@

    Arguments -

    Examples

    +

    Examples +

    library(scda)
     #> 
     library(teal.data)
    @@ -382,17 +542,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/reference/ChoicesFilterState.html b/reference/ChoicesFilterState.html index 598f68fcc..66c14e176 100644 --- a/reference/ChoicesFilterState.html +++ b/reference/ChoicesFilterState.html @@ -1,10 +1,26 @@ - -FilterState object for factor or character variable — ChoicesFilterState • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + + -
    + +
    @@ -79,21 +102,26 @@
    -

    Note

    +

    Note +

    Casts the passed object to character before validating the input making it possible to pass any object coercible to character to this method.

    -

    Super class

    +

    Super class +

    teal.slice::FilterState -> ChoicesFilterState

    +

    Inherited methods


    -

    Method new()

    -

    Initialize a FilterState object

    -

    Usage

    -

    ChoicesFilterState$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterState object

    +
    +

    Usage +

    +

    +
    +
    ChoicesFilterState$new(
       x,
       varname,
       varlabel = character(0),
       input_dataname = NULL,
       extract_type = character(0)
    -)

    +)
    +

    +
    -

    Arguments

    -

    -


    -

    Method is_any_filtered()

    -

    Answers the question of whether the current settings and values selected actually filters out any values.

    -

    Usage

    -

    ChoicesFilterState$is_any_filtered()

    +
    +

    +
    +
    +

    Method is_any_filtered() +

    +

    Answers the question of whether the current settings and values selected actually filters out any values.

    +
    +

    Usage +

    +

    +
    +
    ChoicesFilterState$is_any_filtered()
    +

    +
    -

    Returns

    +

    Returns +

    logical scalar

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection. For this class returned call looks like <varname> %in% c(<values selected>) with -optional is.na(<varname>).

    -

    Usage

    -

    ChoicesFilterState$get_call()

    +optional is.na(<varname>).

    +
    +

    Usage +

    +

    +
    +
    ChoicesFilterState$get_call()
    +

    +
    -

    Returns

    +

    Returns +

    (call)

    -


    -

    Method ui()

    +
    +

    +
    +
    +

    Method ui() +

    UI Module for ChoicesFilterState. This UI element contains available choices selection and -checkbox whether to keep or not keep the NA values.

    -

    Usage

    -

    ChoicesFilterState$ui(id)

    +checkbox whether to keep or not keep the NA values.

    +
    +

    Usage +

    +

    +
    +
    ChoicesFilterState$ui(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    id of shiny element

    -

    +
    +

    +
    -


    -

    Method server()

    -

    Server module

    -

    Usage

    -

    ChoicesFilterState$server(id)

    +
    +

    +
    +
    +

    Method server() +

    +

    Server module

    +
    +

    Usage +

    +

    +
    +
    ChoicesFilterState$server(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    an ID string that corresponds with the ID used to call the module's UI function.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    moduleServer function which returns NULL

    -


    -

    Method set_state()

    -

    Set state

    -

    Usage

    -

    ChoicesFilterState$set_state(state)

    +
    +

    +
    +
    +

    Method set_state() +

    +

    Set state

    +
    +

    Usage +

    +

    +
    +
    ChoicesFilterState$set_state(state)
    +

    +
    -

    Arguments

    -

    state
    -

    (list)
    -contains fields relevant for a specific class

    • selected defines initial selection

    • +

      Arguments +

      +

      +
      +
      +
      state
      +
      +

      (list)
      +contains fields relevant for a specific class

      +
        +
      • selected defines initial selection

      • keep_na (logical) defines whether to keep or remove NA values

      • -
      +
    +
    -

    + +

    +
    -


    -

    Method set_state_reactive()

    -

    Set state when using set_filter_state

    -

    Usage

    -

    ChoicesFilterState$set_state_reactive(state)

    +
    +

    +
    +
    +

    Method set_state_reactive() +

    +

    Set state when using set_filter_state

    +
    +

    Usage +

    +

    +
    +
    ChoicesFilterState$set_state_reactive(state)
    +

    +
    -

    Arguments

    -

    state
    -

    (list)
    -contains fields relevant for a specific class

    • selected defines initial selection

    • +

      Arguments +

      +

      +
      +
      +
      state
      +
      +

      (list)
      +contains fields relevant for a specific class

      +
        +
      • selected defines initial selection

      • keep_na (logical) defines whether to keep or remove NA values

      • -
      +
    +
    -

    + +

    +
    -


    -

    Method set_selected()

    -

    Sets the selected values of this ChoicesFilterState.

    -

    Usage

    -

    ChoicesFilterState$set_selected(value)

    +
    +

    +
    +
    +

    Method set_selected() +

    +

    Sets the selected values of this ChoicesFilterState.

    +
    +

    Usage +

    +

    +
    +
    ChoicesFilterState$set_selected(value)
    +

    +
    -

    Arguments

    -

    value
    +

    Arguments +

    +

    +
    +
    +
    value

    (character) the array of the selected choices. Must not contain NA values.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    invisibly NULL

    -

    Examples

    -

    filter <- teal.slice:::ChoicesFilterState$new(c("a", "b", "c"), varname = "name")
    -filter$set_selected(c("c", "a"))

    +

    Examples +

    +

    +
    +
    filter <- teal.slice:::ChoicesFilterState$new(c("a", "b", "c"), varname = "name")
    +filter$set_selected(c("c", "a"))
    +

    +
    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    ChoicesFilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    ChoicesFilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -314,7 +497,8 @@

    Arguments -

    Examples

    +

    Examples +

    filter_state <- teal.slice:::ChoicesFilterState$new(
       c(LETTERS, NA),
       varname = "x",
    @@ -339,17 +523,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/reference/DFFilterStates.html b/reference/DFFilterStates.html index 11aca913e..28ed98130 100644 --- a/reference/DFFilterStates.html +++ b/reference/DFFilterStates.html @@ -1,8 +1,24 @@ - -DFFFilterStates — DFFilterStates • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + + -
    + +
    @@ -76,16 +98,20 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterStates -> DFFilterStates

    +

    Inherited methods


    -

    Method new()

    +

    +
    +
    +

    Method new() +

    Initializes DFFilterStates object

    Initializes DFFilterStates object by setting input_dataname, output_dataname and initializing ReactiveQueue. This class contains a single ReactiveQueue with no specified name which means that when calling the function associated to this class (dplyr::filter), a list of -conditions are passed to unnamed arguments (...).

    -

    Usage

    -

    DFFilterStates$new(input_dataname, output_dataname, datalabel, varlabels, keys)

    +conditions are passed to unnamed arguments (...).

    +
    +

    Usage +

    +

    +
    +
    DFFilterStates$new(input_dataname, output_dataname, datalabel, varlabels, keys)
    +

    +
    -

    Arguments

    -

    input_dataname
    +

    Arguments +

    +

    +
    +
    +
    input_dataname

    (character(1) or name or call)
    name of the data used on lhs of the expression specified to the function argument attached to this FilterStates.

    @@ -144,93 +186,165 @@

    Arguments
    -

    Method format()

    -

    Returns the formatted string representing this FilterStates object.

    -

    Usage

    -

    DFFilterStates$format(indent = 0)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns the formatted string representing this FilterStates object.

    +
    +

    Usage +

    +

    +
    +
    DFFilterStates$format(indent = 0)
    +

    +
    -

    Arguments

    -

    indent
    +

    Arguments +

    +

    +
    +
    +
    indent

    (numeric(1)) the number of spaces before each line of the representation

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    character(1) the formatted string

    -


    -

    Method get_fun()

    +
    +

    +
    +
    +

    Method get_fun() +

    Get function name

    Get function name used to create filter call. -For DFFilterStates dplyr::filter is used

    -

    Usage

    -

    DFFilterStates$get_fun()

    +For DFFilterStates dplyr::filter is used

    +
    +

    Usage +

    +

    +
    +
    DFFilterStates$get_fun()
    +

    +
    -

    Returns

    +

    Returns +

    character(1)

    -


    -

    Method server()

    -

    Server module

    -

    Usage

    -

    DFFilterStates$server(id)

    +
    +

    +
    +
    +

    Method server() +

    +

    Server module

    +
    +

    Usage +

    +

    +
    +
    DFFilterStates$server(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    an ID string that corresponds with the ID used to call the module's UI function.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    moduleServer function which returns NULL

    -


    +

    +
    +
    +

    Method get_filter_state() +

    Gets the reactive values from the active FilterState objects.

    Get active filter state from the FilterState objects kept in ReactiveQueue. -The output list is a compatible input to self$set_filter_state.

    -

    Usage

    -

    DFFilterStates$get_filter_state()

    +The output list is a compatible input to self$set_filter_state.

    +
    +

    Usage +

    +

    +
    +
    DFFilterStates$get_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    list with named elements corresponding to FilterState in the ReactiveQueue.

    -


    -

    Method set_filter_state()

    -

    Set filter state

    -

    Usage

    -

    DFFilterStates$set_filter_state(
    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Set filter state

    +
    +

    Usage +

    +

    +
    +
    DFFilterStates$set_filter_state(
       data,
       state,
       vars_include = get_filterable_varnames(data = data),
       ...
    -)

    +)
    +

    +
    -

    Arguments

    -

    data
    +

    Arguments +

    +

    +
    +
    +
    data

    (data.frame)
    data which are supposed to be filtered.

    @@ -251,15 +365,21 @@

    Arguments -

    Returns

    +

    Returns +

    NULL

    -

    Examples

    -

    dffs <- teal.slice:::DFFilterStates$new(
    +

    Examples +

    +

    +
    +
    dffs <- teal.slice:::DFFilterStates$new(
       input_dataname = "iris",
       output_dataname = "iris_filtered",
       datalabel = character(0),
    @@ -271,40 +391,73 @@ 

    Examples= list(selected = c("setosa", "versicolor"), keep_na = FALSE) ) dffs$set_filter_state(state = fs, data = iris) -shiny::isolate(dffs$get_filter_state())

    +shiny::isolate(dffs$get_filter_state())
    +

    +
    -


    -

    Method remove_filter_state()

    -

    Remove a FilterState from the ReactiveQueue.

    -

    Usage

    -

    DFFilterStates$remove_filter_state(element_id)

    +
    +

    +
    +
    +

    Method remove_filter_state() +

    +

    Remove a FilterState from the ReactiveQueue.

    +
    +

    Usage +

    +

    +
    +
    DFFilterStates$remove_filter_state(element_id)
    +

    +
    -

    Arguments

    -

    element_id
    +

    Arguments +

    +

    +
    +
    +
    element_id

    (character(1))
    name of ReactiveQueue element.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL

    -


    -

    Method ui_add_filter_state()

    -

    Shiny UI module to add filter variable

    -

    Usage

    -

    DFFilterStates$ui_add_filter_state(id, data)

    +
    +

    +
    +
    +

    Method ui_add_filter_state() +

    +

    Shiny UI module to add filter variable

    +
    +

    Usage +

    +

    +
    +
    DFFilterStates$ui_add_filter_state(id, data)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    id of shiny module

    @@ -314,31 +467,48 @@

    Arguments -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_add_filter_state()

    +
    +

    +
    +
    +

    Method srv_add_filter_state() +

    Shiny server module to add filter variable

    Module controls available choices to select as a filter variable. Selected filter variable is being removed from available choices. -Removed filter variable gets back to available choices.

    -

    Usage

    -

    DFFilterStates$srv_add_filter_state(
    +Removed filter variable gets back to available choices.

    +
    +

    Usage +

    +

    +
    +
    DFFilterStates$srv_add_filter_state(
       id,
       data,
       vars_include = get_filterable_varnames(data = data),
       ...
    -)

    +)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    an ID string that corresponds with the ID used to call the module's UI function.

    @@ -357,10 +527,13 @@

    Arguments -

    Returns

    +

    Returns +

    moduleServer function which returns NULL description Get label of specific variable. In case when variable label is missing @@ -370,20 +543,36 @@

    Returns
    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    DFFilterStates$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    DFFilterStates$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -391,7 +580,8 @@

    Arguments -

    Examples

    +

    Examples +

    
     ## ------------------------------------------------
     ## Method `DFFilterStates$set_filter_state`
    @@ -434,17 +624,19 @@ 

    Examples

    + +

    + +
    - - + + diff --git a/reference/DateFilterState.html b/reference/DateFilterState.html index 20666d20e..d065fcc2c 100644 --- a/reference/DateFilterState.html +++ b/reference/DateFilterState.html @@ -1,10 +1,26 @@ - -FilterState object for Date variable — DateFilterState • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + + -
    + +
    @@ -79,21 +102,26 @@
    -

    Note

    +

    Note +

    Casts the passed object to Date before validating the input making it possible to pass any object coercible to Date to this method.

    -

    Super class

    +

    Super class +

    teal.slice::FilterState -> DateFilterState

    +

    Inherited methods


    -

    Method new()

    -

    Initialize a FilterState object

    -

    Usage

    -

    DateFilterState$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterState object

    +
    +

    Usage +

    +

    +
    +
    DateFilterState$new(
       x,
       varname,
       varlabel = character(0),
       input_dataname = NULL,
       extract_type = character(0)
    -)

    +)
    +

    +
    -


    -

    Method format()

    -

    Returns a formatted string representing this DateFilterState.

    -

    Usage

    -

    DateFilterState$format(indent = 0)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns a formatted string representing this DateFilterState.

    +
    +

    Usage +

    +

    +
    +
    DateFilterState$format(indent = 0)
    +

    +
    -

    Arguments

    -

    indent
    +

    Arguments +

    +

    +
    +
    +
    indent

    (numeric(1)) the number of spaces before after each new line character of the formatted string. Default: 0

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    character(1) the formatted string

    -


    -

    Method is_any_filtered()

    -

    Answers the question of whether the current settings and values selected actually filters out any values.

    -

    Usage

    -

    DateFilterState$is_any_filtered()

    +
    +

    +
    +
    +

    Method is_any_filtered() +

    +

    Answers the question of whether the current settings and values selected actually filters out any values.

    +
    +

    Usage +

    +

    +
    +
    DateFilterState$is_any_filtered()
    +

    +
    -

    Returns

    +

    Returns +

    logical scalar

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection. For this class returned call looks like <varname> >= <min value> & <varname> <= <max value> with -optional is.na(<varname>).

    -

    Usage

    -

    DateFilterState$get_call()

    +optional is.na(<varname>).

    +
    +

    Usage +

    +

    +
    +
    DateFilterState$get_call()
    +

    +
    -

    Returns

    +

    Returns +

    (call)

    -


    -

    Method ui()

    +
    +

    +
    +
    +

    Method ui() +

    UI Module for DateFilterState. This UI element contains two date selections for min and max -of the range and a checkbox whether to keep the NA values.

    -

    Usage

    -

    DateFilterState$ui(id)

    +of the range and a checkbox whether to keep the NA values.

    +
    +

    Usage +

    +

    +
    +
    DateFilterState$ui(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    id of shiny element

    -

    +
    +

    +
    -


    -

    Method server()

    -

    Server module

    -

    Usage

    -

    DateFilterState$server(id)

    +
    +

    +
    +
    +

    Method server() +

    +

    Server module

    +
    +

    Usage +

    +

    +
    +
    DateFilterState$server(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    an ID string that corresponds with the ID used to call the module's UI function.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    moduleServer function which returns NULL

    -


    -

    Method set_selected()

    -

    Sets the selected time frame of this DateFilterState.

    -

    Usage

    -

    DateFilterState$set_selected(value)

    +
    +

    +
    +
    +

    Method set_selected() +

    +

    Sets the selected time frame of this DateFilterState.

    +
    +

    Usage +

    +

    +
    +
    DateFilterState$set_selected(value)
    +

    +
    -

    Arguments

    -

    value
    +

    Arguments +

    +

    +
    +
    +
    value

    (Date(2)) the lower and the upper bound of the selected time frame. Must not contain NA values.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    invisibly NULL.

    -

    Examples

    -

    date <- as.Date("13/09/2021")
    +

    Examples +

    +

    +
    +
    date <- as.Date("13/09/2021")
     filter <- teal.slice:::DateFilterState$new(
       c(date, date + 1, date + 2, date + 3),
       varname = "name"
     )
    -filter$set_selected(c(date + 1, date + 2))

    +filter$set_selected(c(date + 1, date + 2))
    +

    +
    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    DateFilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    DateFilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -301,7 +461,8 @@

    Arguments -

    Examples

    +

    Examples +

    filter_state <- teal.slice:::DateFilterState$new(
       c(Sys.Date() + seq(1:10), NA),
       varname = "x",
    @@ -329,17 +490,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/reference/DatetimeFilterState.html b/reference/DatetimeFilterState.html index 27ceddd0c..3f4633f0c 100644 --- a/reference/DatetimeFilterState.html +++ b/reference/DatetimeFilterState.html @@ -1,10 +1,26 @@ - -FilterState object for POSIXct variable — DatetimeFilterState • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + + -
    + +
    @@ -79,21 +102,26 @@
    -

    Note

    +

    Note +

    Casts the passed object to POSIXct before validating the input making it possible to pass any object coercible to POSIXct to this method.

    -

    Super class

    +

    Super class +

    teal.slice::FilterState -> DatetimeFilterState

    +

    Inherited methods


    -

    Method new()

    +

    +
    +
    +

    Method new() +

    Initialize a FilterState object. This class has an extra field, private$timezone, which is set to Sys.timezone() by default. However, in case when using this module in teal app, one needs timezone of the app user. App user timezone is taken from session$userData$timezone -and is set only if object is initialized in shiny.

    -

    Usage

    -

    DatetimeFilterState$new(
    +and is set only if object is initialized in shiny.

    +
    +

    Usage +

    +

    +
    +
    DatetimeFilterState$new(
       x,
       varname,
       varlabel = character(0),
       input_dataname = NULL,
       extract_type = character(0)
    -)

    +)
    +

    +
    -

    Arguments

    -

    -


    -

    Method format()

    -

    Returns a formatted string representing this DatetimeFilterState.

    -

    Usage

    -

    DatetimeFilterState$format(indent = 0)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns a formatted string representing this DatetimeFilterState.

    +
    +

    Usage +

    +

    +
    +
    DatetimeFilterState$format(indent = 0)
    +

    +
    -

    Arguments

    -

    indent
    +

    Arguments +

    +

    +
    +
    +
    indent

    (numeric(1)) the number of spaces before after each new line character of the formatted string. Default: 0

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    character(1) the formatted string

    -


    -

    Method is_any_filtered()

    -

    Answers the question of whether the current settings and values selected actually filters out any values.

    -

    Usage

    -

    DatetimeFilterState$is_any_filtered()

    +
    +

    +
    +
    +

    Method is_any_filtered() +

    +

    Answers the question of whether the current settings and values selected actually filters out any values.

    +
    +

    Usage +

    +

    +
    +
    DatetimeFilterState$is_any_filtered()
    +

    +
    -

    Returns

    +

    Returns +

    logical scalar

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection. For this class returned call looks like <varname> >= as.POSIXct(<min>, tz = <timezone>) & <varname> <= <max>, tz = <timezone>) -with optional is.na(<varname>).

    -

    Usage

    -

    DatetimeFilterState$get_call()

    +with optional is.na(<varname>).

    +
    +

    Usage +

    +

    +
    +
    DatetimeFilterState$get_call()
    +

    +
    -


    -

    Method ui()

    +
    +

    +
    +
    +

    Method ui() +

    UI Module for DatetimeFilterState. This UI element contains two date-time selections for min and max -of the range and a checkbox whether to keep the NA values.

    -

    Usage

    -

    DatetimeFilterState$ui(id)

    +of the range and a checkbox whether to keep the NA values.

    +
    +

    Usage +

    +

    +
    +
    DatetimeFilterState$ui(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    id of shiny element

    -

    +
    +

    +
    -


    -

    Method server()

    -

    Server module

    -

    Usage

    -

    DatetimeFilterState$server(id)

    +
    +

    +
    +
    +

    Method server() +

    +

    Server module

    +
    +

    Usage +

    +

    +
    +
    DatetimeFilterState$server(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    an ID string that corresponds with the ID used to call the module's UI function.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    moduleServer function which returns NULL

    -


    -

    Method set_selected()

    -

    Sets the selected time frame of this DatetimeFilterState.

    -

    Usage

    -

    DatetimeFilterState$set_selected(value)

    +
    +

    +
    +
    +

    Method set_selected() +

    +

    Sets the selected time frame of this DatetimeFilterState.

    +
    +

    Usage +

    +

    +
    +
    DatetimeFilterState$set_selected(value)
    +

    +
    -

    Arguments

    -

    value
    +

    Arguments +

    +

    +
    +
    +
    value

    (POSIX(2)) the lower and the upper bound of the selected time frame. Must not contain NA values.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    invisibly NULL.

    -

    Examples

    -

    date <- as.POSIXct(1, origin = "01/01/1970")
    +

    Examples +

    +

    +
    +
    date <- as.POSIXct(1, origin = "01/01/1970")
     filter <- teal.slice:::DatetimeFilterState$new(
       c(date, date + 1, date + 2, date + 3),
       varname = "name"
     )
    -filter$set_selected(c(date + 1, date + 2))

    +filter$set_selected(c(date + 1, date + 2))
    +

    +
    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    DatetimeFilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    DatetimeFilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -301,7 +460,8 @@

    Arguments -

    Examples

    +

    Examples +

    filter_state <- teal.slice:::DatetimeFilterState$new(
       c(Sys.time() + seq(0, by = 3600, length.out = 10), NA),
       varname = "x",
    @@ -331,17 +491,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/reference/DefaultFilteredDataset.html b/reference/DefaultFilteredDataset.html index ab06509db..6a2abe201 100644 --- a/reference/DefaultFilteredDataset.html +++ b/reference/DefaultFilteredDataset.html @@ -1,10 +1,26 @@ - -The DefaultFilteredDataset R6 class — DefaultFilteredDataset • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + + -
    + +
    @@ -79,16 +101,20 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilteredDataset -> DefaultFilteredDataset

    +

    Inherited methods


    -

    Method new()

    -

    Initializes this DefaultFilteredDataset object

    -

    Usage

    -

    DefaultFilteredDataset$new(
    +

    +
    +
    +

    Method new() +

    +

    Initializes this DefaultFilteredDataset object

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$new(
       dataset,
       dataname,
       keys = character(0),
       label = character(0),
       metadata = NULL
    -)

    +)
    +

    +
    -

    Arguments

    -

    dataset
    +

    Arguments +

    +

    +
    +
    +
    dataset

    (data.frame)
    single data.frame for which filters are rendered

    @@ -154,52 +196,90 @@

    Arguments
    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Gets the filter expression

    This functions returns filter calls equivalent to selected items within each of filter_states. Configuration of the calls is constant and depends on filter_states type and order which are set during initialization. This class contains single FilterStates which contains single ReactiveQueue and all FilterState objects -applies to one argument (...) in dplyr::filter call.

    -

    Usage

    -

    DefaultFilteredDataset$get_call()

    +applies to one argument (...) in dplyr::filter call.

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$get_call()
    +

    +
    -

    Returns

    +

    Returns +

    filter call or list of filter calls

    -


    +

    +
    +
    +

    Method get_filter_state() +

    Gets the reactive values from the active FilterState objects.

    Get all active filters from this dataset in form of the nested list. -The output list is a compatible input to self$set_filter_state.

    -

    Usage

    -

    DefaultFilteredDataset$get_filter_state()

    +The output list is a compatible input to self$set_filter_state.

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$get_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    list with named elements corresponding to FilterState objects (active filters).

    -


    -

    Method set_filter_state()

    -

    Set filter state

    -

    Usage

    -

    DefaultFilteredDataset$set_filter_state(state, ...)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Set filter state

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$set_filter_state(state, ...)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (named list)
    containing values of the initial filter. Values should be relevant to the referred column.

    @@ -209,81 +289,137 @@

    Arguments -

    Returns

    +

    Returns +

    NULL

    -

    Examples

    -

    dataset <- teal.slice:::DefaultFilteredDataset$new(iris, "iris")
    +

    Examples +

    +

    +
    +
    dataset <- teal.slice:::DefaultFilteredDataset$new(iris, "iris")
     fs <- list(
       Sepal.Length = list(selected = c(5.1, 6.4), keep_na = TRUE, keep_inf = TRUE),
       Species = list(selected = c("setosa", "versicolor"), keep_na = FALSE)
     )
     dataset$set_filter_state(state = fs)
    -shiny::isolate(dataset$get_filter_state())

    +shiny::isolate(dataset$get_filter_state())
    +

    +
    -


    -

    Method remove_filter_state()

    -

    Remove one or more FilterState of a FilteredDataset

    -

    Usage

    -

    DefaultFilteredDataset$remove_filter_state(element_id)

    +
    +

    +
    +
    +

    Method remove_filter_state() +

    +

    Remove one or more FilterState of a FilteredDataset

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$remove_filter_state(element_id)
    +

    +
    -

    Arguments

    -

    element_id
    +

    Arguments +

    +

    +
    +
    +
    element_id

    (character)
    Vector of character names of variables to remove their FilterState.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL

    -


    -

    Method ui_add_filter_state()

    +
    +

    +
    +
    +

    Method ui_add_filter_state() +

    +

    UI module to add filter variable for this dataset

    UI module to add filter variable for this dataset

    -

    UI module to add filter variable for this dataset

    -

    Usage

    -

    DefaultFilteredDataset$ui_add_filter_state(id)

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$ui_add_filter_state(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    identifier of the element - preferably containing dataset name

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    function - shiny UI module

    -


    -

    Method srv_add_filter_state()

    +
    +

    +
    +
    +

    Method srv_add_filter_state() +

    Server module to add filter variable for this dataset

    Server module to add filter variable for this dataset. For this class srv_add_filter_state calls single module srv_add_filter_state from FilterStates (DefaultFilteredDataset -contains single FilterStates)

    -

    Usage

    -

    DefaultFilteredDataset$srv_add_filter_state(id, ...)

    +contains single FilterStates)

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$srv_add_filter_state(id, ...)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    an ID string that corresponds with the ID used to call the module's UI function.

    @@ -292,28 +428,45 @@

    Arguments -

    Returns

    +

    Returns +

    moduleServer function which returns NULL

    -


    -

    Method get_filter_overview_nsubjs()

    +
    +

    +
    +
    +

    Method get_filter_overview_nsubjs() +

    Get number of observations based on given keys The output shows the comparison between filtered_dataset -function parameter and the dataset inside self

    -

    Usage

    -

    DefaultFilteredDataset$get_filter_overview_nsubjs(
    +function parameter and the dataset inside self

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$get_filter_overview_nsubjs(
       filtered_dataset = self$get_dataset(),
       subject_keys = NULL
    -)

    +)
    +

    +
    -

    Arguments

    -

    filtered_dataset
    +

    Arguments +

    +

    +
    +
    +
    filtered_dataset

    comparison object, of the same class as self$get_dataset(), if NULL then self$get_dataset() is used.

    @@ -324,27 +477,46 @@

    Arguments -

    Returns

    +

    Returns +

    list containing character #filtered/#not_filtered

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    DefaultFilteredDataset$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -352,7 +524,8 @@

    Arguments -

    Examples

    +

    Examples +

    library(shiny)
     ds <- teal.slice:::DefaultFilteredDataset$new(iris, "iris")
     ds$set_filter_state(
    @@ -423,17 +596,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/reference/EmptyFilterState.html b/reference/EmptyFilterState.html index 973568979..28627b0d7 100644 --- a/reference/EmptyFilterState.html +++ b/reference/EmptyFilterState.html @@ -1,10 +1,26 @@ - -FilterState object for empty variable — EmptyFilterState • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + + -
    + +
    @@ -79,16 +102,20 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterState -> EmptyFilterState

    +

    Inherited methods


    -

    Method new()

    -

    Initialize EmptyFilterState object

    -

    Usage

    -

    EmptyFilterState$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize EmptyFilterState object

    +
    +

    Usage +

    +

    +
    +
    EmptyFilterState$new(
       x,
       varname,
       varlabel = character(0),
       input_dataname = NULL,
       extract_type = character(0)
    -)

    +)
    +

    +
    -


    -

    Method is_any_filtered()

    -

    Answers the question of whether the current settings and values selected actually filters out any values.

    -

    Usage

    -

    EmptyFilterState$is_any_filtered()

    +
    +

    +
    +
    +

    Method is_any_filtered() +

    +

    Answers the question of whether the current settings and values selected actually filters out any values.

    +
    +

    Usage +

    +

    +
    +
    EmptyFilterState$is_any_filtered()
    +

    +
    -

    Returns

    +

    Returns +

    logical scalar

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection relevant for selected variable type. Method is using internal reactive values which makes it reactive -and must be executed in reactive or isolated context.

    -

    Usage

    -

    EmptyFilterState$get_call()

    +and must be executed in reactive or isolated context.

    +
    +

    Usage +

    +

    +
    +
    EmptyFilterState$get_call()
    +

    +
    -


    -

    Method get_state()

    -

    Returns the filtering state.

    -

    Usage

    -

    EmptyFilterState$get_state()

    +
    +

    +
    +
    +

    Method get_state() +

    +

    Returns the filtering state.

    +
    +

    Usage +

    +

    +
    +
    EmptyFilterState$get_state()
    +

    +
    -

    Returns

    -

    list containing values taken from the reactive fields:

    • keep_na (logical(1)) whether NA should be kept.

    • -
    +

    Returns +

    +

    list containing values taken from the reactive fields:

    +
      +
    • keep_na (logical(1)) whether NA should be kept.

    • +
    +
    -


    -

    Method ui()

    +
    +

    +
    +
    +

    Method ui() +

    UI Module for EmptyFilterState. This UI element contains checkbox input to -filter or keep missing values.

    -

    Usage

    -

    EmptyFilterState$ui(id)

    +filter or keep missing values.

    +
    +

    Usage +

    +

    +
    +
    EmptyFilterState$ui(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    id of shiny element

    -

    +
    +

    +
    -


    -

    Method server()

    -

    Controls selection of keep_na checkbox input

    -

    Usage

    -

    EmptyFilterState$server(id)

    +
    +

    +
    +
    +

    Method server() +

    +

    Controls selection of keep_na checkbox input

    +
    +

    Usage +

    +

    +
    +
    EmptyFilterState$server(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    an ID string that corresponds with the ID used to call the module's UI function.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    moduleServer function which returns NULL

    -


    -

    Method set_state()

    -

    Set state

    -

    Usage

    -

    EmptyFilterState$set_state(state)

    - +

    +
    +
    +

    Method set_state() +

    +

    Set state

    -

    Arguments

    -

    state
    -

    (list)
    -contains fields relevant for a specific class

    • keep_na (logical) defines whether to keep or remove NA values

    • -
    - +

    Usage +

    +

    +
    +
    EmptyFilterState$set_state(state)
    +

    +
    +
    -

    +
    +

    Arguments +

    +

    +
    +
    +
    state
    +
    +

    (list)
    +contains fields relevant for a specific class

    +
      +
    • keep_na (logical) defines whether to keep or remove NA values

    • +
    +
    + + +
    +

    +
    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    EmptyFilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    EmptyFilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -270,7 +423,8 @@

    Arguments -

    Examples

    +

    Examples +

    filter_state <- teal.slice:::EmptyFilterState$new(
       NA,
       varname = "x",
    @@ -284,17 +438,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/reference/FilterState.html b/reference/FilterState.html index 5844006e3..3631c1a6d 100644 --- a/reference/FilterState.html +++ b/reference/FilterState.html @@ -1,10 +1,26 @@ - -Abstract class to encapsulate filter states — FilterState • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + + -
    + +
    @@ -79,13 +101,16 @@
    -

    Details

    +

    Details +

    This class is responsible for managing single filter item within FilteredData class. Filter states depend on the variable type: (logical, integer, numeric, factor, character, Date, POSIXct, POSIXlt) and returns FilterState object with class corresponding to input variable. Class controls single filter entry in module_single_filter_item and returns -code relevant to selected values.

    • factor, character: class = ChoicesFilterState

    • +code relevant to selected values.

      +
    + +
    -

    Modifying state

    +

    Modifying state +

    Modifying a FilterState object is possible in three scenarios depicted below: -Figure: filter_state_reactivity.jpg

    • In the interactive session by directly specifying values of selected, +Figure: filter_state_reactivity.jpg

      +
        +
      • In the interactive session by directly specifying values of selected, keep_na or keep_inf using set_state method (to update all at once), or using set_selected, set_keep_na or set_keep_inf

      • In a teal application by changing appropriate inputs

      • Using methods set_selected_reactive, set_keep_na_reactive, set_keep_inf_reactive which serves as a programmatic API.

      • -
    + +
    -

    Methods

    +

    Methods +


    -

    Method new()

    -

    Initialize a FilterState object

    -

    Usage

    -

    FilterState$new(
    +
    +
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterState object

    +
    +

    Usage +

    +

    +
    +
    FilterState$new(
       x,
       varname,
       varlabel = character(0),
       input_dataname = NULL,
       extract_type = character(0)
    -)

    +)
    +

    +
    -


    -

    Method destroy_observers()

    -

    Destroy observers stored in private$observers.

    -

    Usage

    -

    FilterState$destroy_observers()

    +
    +

    +
    +
    +

    Method destroy_observers() +

    +

    Destroy observers stored in private$observers.

    +
    +

    Usage +

    +

    +
    +
    FilterState$destroy_observers()
    +

    +
    -


    -

    Method format()

    -

    Returns a formatted string representing this FilterState.

    -

    Usage

    -

    FilterState$format(indent = 0)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns a formatted string representing this FilterState.

    +
    +

    Usage +

    +

    +
    +
    FilterState$format(indent = 0)
    +

    +
    -

    Arguments

    -

    indent
    +

    Arguments +

    +

    +
    +
    +
    indent

    (numeric(1)) the number of spaces before after each new line character of the formatted string. Default: 0

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    character(1) the formatted string

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection relevant for selected variable type. Method is using internal reactive values which makes it reactive -and must be executed in reactive or isolated context.

    -

    Usage

    -

    FilterState$get_call()

    +and must be executed in reactive or isolated context.

    +
    +

    Usage +

    +

    +
    +
    FilterState$get_call()
    +

    +
    -


    -

    Method get_dataname()

    -

    Returns dataname

    -

    Usage

    -

    FilterState$get_dataname(deparse = TRUE)

    +
    +

    +
    +
    +

    Method get_dataname() +

    +

    Returns dataname

    +
    +

    Usage +

    +

    +
    +
    FilterState$get_dataname(deparse = TRUE)
    +

    +
    -

    Arguments

    -

    deparse
    +

    Arguments +

    +

    +
    +
    +
    deparse

    (logical(1))
    whether dataname should be deparsed. TRUE by default

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (name or character(1))

    -


    -

    Method get_keep_na()

    -

    Returns current keep_na selection

    -

    Usage

    -

    FilterState$get_keep_na()

    +
    +

    +
    +
    +

    Method get_keep_na() +

    +

    Returns current keep_na selection

    +
    +

    Usage +

    +

    +
    +
    FilterState$get_keep_na()
    +

    +
    -

    Returns

    +

    Returns +

    (logical(1))

    -


    -

    Method get_varlabel()

    -

    Returns variable label

    -

    Usage

    -

    FilterState$get_varlabel()

    +
    +

    +
    +
    +

    Method get_varlabel() +

    +

    Returns variable label

    +
    +

    Usage +

    +

    +
    +
    FilterState$get_varlabel()
    +

    +
    -

    Returns

    +

    Returns +

    (character(1))

    -


    -

    Method get_varname()

    -

    Get variable name

    -

    Usage

    -

    FilterState$get_varname(deparse = FALSE)

    +
    +

    +
    +
    +

    Method get_varname() +

    +

    Get variable name

    +
    +

    Usage +

    +

    +
    +
    FilterState$get_varname(deparse = FALSE)
    +

    +
    -

    Arguments

    -

    deparse
    +

    Arguments +

    +

    +
    +
    +
    deparse

    (logical(1))
    whether variable name should be deparsed. FALSE by default

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (name or character(1))

    -


    -

    Method get_selected()

    -

    Get selected values from FilterState

    -

    Usage

    -

    FilterState$get_selected()

    +
    +

    +
    +
    +

    Method get_selected() +

    +

    Get selected values from FilterState

    +
    +

    Usage +

    +

    +
    +
    FilterState$get_selected()
    +

    +
    -

    Returns

    +

    Returns +

    class of the returned object depends of class of the FilterState

    -


    -

    Method get_state()

    -

    Returns the filtering state.

    -

    Usage

    -

    FilterState$get_state()

    +
    +

    +
    +
    +

    Method get_state() +

    +

    Returns the filtering state.

    +
    +

    Usage +

    +

    +
    +
    FilterState$get_state()
    +

    +
    -

    Returns

    -

    list containing values taken from the reactive fields:

    • selected (atomic) length depends on a FilterState variant.

    • +

      Returns +

      +

      list containing values taken from the reactive fields:

      +
        +
      • selected (atomic) length depends on a FilterState variant.

      • keep_na (logical(1)) whether NA should be kept.

      • -
    + +
    -


    -

    Method print()

    -

    Prints this FilterState object

    -

    Usage

    -

    FilterState$print(...)

    +
    +

    +
    +
    +

    Method print() +

    +

    Prints this FilterState object

    +
    +

    Usage +

    +

    +
    +
    FilterState$print(...)
    +

    +
    -

    Arguments

    -

    ...
    +

    Arguments +

    +

    +
    +
    +
    ...

    additional arguments to this method

    -

    +
    +

    +
    -


    -

    Method set_keep_na()

    -

    Set if NA should be kept

    -

    Usage

    -

    FilterState$set_keep_na(value)

    +
    +

    +
    +
    +

    Method set_keep_na() +

    +

    Set if NA should be kept

    +
    +

    Usage +

    +

    +
    +
    FilterState$set_keep_na(value)
    +

    +
    -

    Arguments

    -

    value
    +

    Arguments +

    +

    +
    +
    +
    value

    (logical(1))
    value(s) which come from the filter selection. Value is set in server modules after selecting check-box-input in the shiny interface. Values are set to private$keep_na which is reactive.

    -

    +
    +

    +
    -


    -

    Method set_keep_na_reactive()

    -

    Set if NA should be kept when using set_filter_state

    -

    Usage

    -

    FilterState$set_keep_na_reactive(value)

    +
    +

    +
    +
    +

    Method set_keep_na_reactive() +

    +

    Set if NA should be kept when using set_filter_state

    +
    +

    Usage +

    +

    +
    +
    FilterState$set_keep_na_reactive(value)
    +

    +
    -

    Arguments

    -

    value
    +

    Arguments +

    +

    +
    +
    +
    value

    (logical(1))
    value(s) which come from the filter selection. Value is set in server modules when using set_filter_state instead of the shiny interface. Values are set to private$keep_na_reactive which is reactive.

    -

    +
    +

    +
    -


    -

    Method set_na_rm()

    +
    +

    +
    +
    +

    Method set_na_rm() +

    Some methods needs additional !is.na(varame) condition to not include missing values. When private$na_rm = TRUE is set, self$get_call returns -condition extended by !is.na condition.

    -

    Usage

    -

    FilterState$set_na_rm(value)

    +condition extended by !is.na condition.

    +
    +

    Usage +

    +

    +
    +
    FilterState$set_na_rm(value)
    +

    +
    -

    Arguments

    -

    value
    +

    Arguments +

    +

    +
    +
    +
    value

    (logical(1)) when TRUE, FilterState$get_call appends an expression removing NA values to the filter expression returned by get_call

    -

    +
    +

    +
    -


    -

    Method set_selected()

    -

    Set selection

    -

    Usage

    -

    FilterState$set_selected(value)

    +
    +

    +
    +
    +

    Method set_selected() +

    +

    Set selection

    +
    +

    Usage +

    +

    +
    +
    FilterState$set_selected(value)
    +

    +
    -

    Arguments

    -

    value
    +

    Arguments +

    +

    +
    +
    +
    value

    (vector)
    value(s) which come from the filter selection. Values are set in server module after choosing value in app interface. Values are set to @@ -409,19 +659,35 @@

    Arguments
    -

    Method set_selected_reactive()

    -

    Set selection when using set_filter_state

    -

    Usage

    -

    FilterState$set_selected_reactive(value)

    +
    +

    +
    +
    +

    Method set_selected_reactive() +

    +

    Set selection when using set_filter_state

    +
    +

    Usage +

    +

    +
    +
    FilterState$set_selected_reactive(value)
    +

    +
    -

    Arguments

    -

    value
    +

    Arguments +

    +

    +
    +
    +
    value

    (vector)
    value(s) which come from the filters set by the user. Values are set in server modules after setting filters in set_filter_state. Values are set to @@ -429,79 +695,153 @@

    Arguments
    -

    Method set_state()

    -

    Set state

    -

    Usage

    -

    FilterState$set_state(state)

    +
    +

    +
    +
    +

    Method set_state() +

    +

    Set state

    +
    +

    Usage +

    +

    +
    +
    FilterState$set_state(state)
    +

    +
    -

    Arguments

    -

    state
    -

    (list)
    -contains fields relevant for a specific class

    • selected defines initial selection

    • +

      Arguments +

      +

      +
      +
      +
      state
      +
      +

      (list)
      +contains fields relevant for a specific class

      +
        +
      • selected defines initial selection

      • keep_na (logical) defines whether to keep or remove NA values

      • -
      +
    +
    -

    +

    +

    +
    -


    -

    Method set_state_reactive()

    -

    Set state when using set_filter_state

    -

    Usage

    -

    FilterState$set_state_reactive(state)

    +
    +

    +
    +
    +

    Method set_state_reactive() +

    +

    Set state when using set_filter_state

    +
    +

    Usage +

    +

    +
    +
    FilterState$set_state_reactive(state)
    +

    +
    -

    Arguments

    -

    state
    -

    (list)
    -contains fields relevant for a specific class

    • selected defines initial selection

    • +

      Arguments +

      +

      +
      +
      +
      state
      +
      +

      (list)
      +contains fields relevant for a specific class

      +
        +
      • selected defines initial selection

      • keep_na (logical) defines whether to keep or remove NA values

      • -
      +
    +
    -

    +

    +

    +
    -


    -

    Method server()

    -

    Server module

    -

    Usage

    -

    FilterState$server(id)

    +
    +

    +
    +
    +

    Method server() +

    +

    Server module

    +
    +

    Usage +

    +

    +
    +
    FilterState$server(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    an ID string that corresponds with the ID used to call the module's UI function.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    moduleServer function which returns NULL

    -


    -

    Method ui()

    -

    UI Module

    -

    Usage

    -

    FilterState$ui(id)

    +
    +

    +
    +
    +

    Method ui() +

    +

    UI Module

    +
    +

    Usage +

    +

    +
    +
    FilterState$ui(id)
    +

    +
    -

    Arguments

    -

    id
    -

    (character(1))
    +

    Arguments +

    +

    +
    +
    +
    id
    +
    +

    (character(1))
    id of shiny element. UI for this class contains simple message informing that it's not supported description @@ -527,26 +867,45 @@

    Arguments
    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    FilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    FilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -554,17 +913,19 @@

    Arguments

    + +

    + +
    - - + + diff --git a/reference/FilterStates.html b/reference/FilterStates.html index 2bb35e777..7db8fb44b 100644 --- a/reference/FilterStates.html +++ b/reference/FilterStates.html @@ -1,18 +1,34 @@ - - + + + + + +FilterStates R6 class — FilterStates • teal.slice +FilterStates R6 class — FilterStates • teal.slice + + + + + + + + + + Skip to contents @@ -28,7 +44,8 @@ + + + -
    + +
    @@ -91,17 +114,21 @@
    -

    Note

    +

    Note +

    throws an exception if the length of x does not match the length of element_id

    -

    Methods

    +

    Methods +


    -

    Method new()

    -

    Initializes this FilterStates object.

    -

    Usage

    -

    FilterStates$new(input_dataname, output_dataname, datalabel)

    + +
    +

    +
    +
    +

    Method new() +

    +

    Initializes this FilterStates object.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$new(input_dataname, output_dataname, datalabel)
    +

    +
    -

    Arguments

    -

    input_dataname
    +

    Arguments +

    +

    +
    +
    +
    input_dataname

    (character(1) or name or call)
    name of the data used on lhs of the expression specified to the function argument attached to this FilterStates.

    @@ -144,43 +186,77 @@

    Arguments
    -

    Method get_datalabel()

    -

    Returns the label of the dataset

    -

    Usage

    -

    FilterStates$get_datalabel()

    +
    +

    +
    +
    +

    Method get_datalabel() +

    +

    Returns the label of the dataset

    +
    +

    Usage +

    +

    +
    +
    FilterStates$get_datalabel()
    +

    +
    -

    Returns

    +

    Returns +

    (character(1)) the label

    -


    -

    Method format()

    -

    Returns the formatted string representing this FilterStates object.

    -

    Usage

    -

    FilterStates$format(indent)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns the formatted string representing this FilterStates object.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$format(indent)
    +

    +
    -

    Arguments

    -

    indent
    +

    Arguments +

    +

    +
    +
    +
    indent

    (numeric(1)) the number of spaces before each line of the representation

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    character(1) the formatted string

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Filter call

    Makes a subset function call based on condition calls from FilterState objects selection. @@ -188,68 +264,127 @@

    Method get_call()self$get_fun() with private$input_dataname as argument and list of condition calls from FilterState. If input and output data-names are the same and no filters applied, method returns NULL to avoid -no-op call such as x <- x.

    -

    Usage

    -

    FilterStates$get_call()

    +no-op call such as x <- x.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$get_call()
    +

    +
    -

    Returns

    +

    Returns +

    call or NULL

    -


    -

    Method print()

    -

    Prints this FilterStates object

    -

    Usage

    -

    FilterStates$print(...)

    +
    +

    +
    +
    +

    Method print() +

    +

    Prints this FilterStates object

    +
    +

    Usage +

    +

    +
    +
    FilterStates$print(...)
    +

    +
    -

    Arguments

    -

    ...
    +

    Arguments +

    +

    +
    +
    +
    ...

    additional arguments to this method

    -

    +
    +

    +
    -


    -

    Method get_fun()

    +
    +

    +
    +
    +

    Method get_fun() +

    Gets the name of the function used to filter the data in this FilterStates.

    Get function name used to create filter call. By default it's a -"subset" but can be overridden by child class method.

    -

    Usage

    -

    FilterStates$get_fun()

    +"subset" but can be overridden by child class method.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$get_fun()
    +

    +
    -

    Returns

    +

    Returns +

    character(1) the name of the function

    -


    -

    Method queue_empty()

    -

    Remove all FilterState objects from all queues in this FilterStates.

    -

    Usage

    -

    FilterStates$queue_empty()

    +
    +

    +
    +
    +

    Method queue_empty() +

    +

    Remove all FilterState objects from all queues in this FilterStates.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$queue_empty()
    +

    +
    -

    Returns

    +

    Returns +

    NULL

    -


    -

    Method queue_get()

    -

    Returns a list of FilterState objects stored in this FilterStates.

    -

    Usage

    -

    FilterStates$queue_get(queue_index, element_id = character(0))

    +
    +

    +
    +
    +

    Method queue_get() +

    +

    Returns a list of FilterState objects stored in this FilterStates.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$queue_get(queue_index, element_id = character(0))
    +

    +
    -

    Arguments

    -

    queue_index
    +

    Arguments +

    +

    +
    +
    +
    queue_index

    (character(1), integer(1))
    index of the private$queue list where ReactiveQueue are kept.

    @@ -259,40 +394,73 @@

    Arguments -

    Returns

    +

    Returns +

    list of FilterState objects

    -


    -

    Method queue_initialize()

    -

    Sets ReactiveQueue objects.

    -

    Usage

    -

    FilterStates$queue_initialize(x)

    +
    +

    +
    +
    +

    Method queue_initialize() +

    +

    Sets ReactiveQueue objects.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$queue_initialize(x)
    +

    +
    -

    Arguments

    -

    x
    +

    Arguments +

    +

    +
    +
    +
    x

    (list of ReactiveQueue)
    must be a list even if single ReactiveQueue is set.

    -

    +
    +

    +
    -


    -

    Method queue_push()

    -

    Adds a new FilterState object to this FilterStates

    -

    Usage

    -

    FilterStates$queue_push(x, queue_index, element_id)

    +
    +

    +
    +
    +

    Method queue_push() +

    +

    Adds a new FilterState object to this FilterStates

    +
    +

    Usage +

    +

    +
    +
    FilterStates$queue_push(x, queue_index, element_id)
    +

    +
    -

    Arguments

    -

    x
    +

    Arguments +

    +

    +
    +
    +
    x

    (FilterState)
    object to be added to the queue

    @@ -307,24 +475,42 @@

    Arguments
    -

    Method queue_remove()

    +
    +

    +
    +
    +

    Method queue_remove() +

    Removes a single filter state

    Removes a single filter state with all shiny elements associated -with this state. It removes:

    • particular FilterState from private$queue

    • +with this state. It removes:

      +
        +
      • particular FilterState from private$queue

      • UI card created for this filter

      • observers listening selection and remove button

      • -
      -

      Usage

      -

      FilterStates$queue_remove(queue_index, element_id)

      +
    +
    +

    Usage +

    +

    +
    +
    FilterStates$queue_remove(queue_index, element_id)
    +

    +
    -

    Arguments

    -

    queue_index
    +

    Arguments +

    +

    +
    +
    +
    queue_index

    (character(1), logical(1))
    index of the private$queue list where ReactiveQueue are kept.

    @@ -334,57 +520,101 @@

    Arguments
    -

    Method ui()

    +
    +

    +
    +
    +

    Method ui() +

    Shiny UI module

    Shiny UI element being a container for FilterState elements. Content of this container is created using renderUI in -server module

    -

    Usage

    -

    FilterStates$ui(id)

    +server module

    +
    +

    Usage +

    +

    +
    +
    FilterStates$ui(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    id of the shiny element

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    +

    +
    +
    +

    Method get_filter_state() +

    Gets the reactive values from the active FilterState objects.

    Get active filter state from the FilterState objects kept in ReactiveQueue(s). -The output list is a compatible input to self$set_filter_state.

    -

    Usage

    -

    FilterStates$get_filter_state()

    +The output list is a compatible input to self$set_filter_state.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$get_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    list containing list per each FilterState in the ReactiveQueue

    -


    -

    Method set_filter_state()

    -

    Sets active FilterState objects.

    -

    Usage

    -

    FilterStates$set_filter_state(data, state)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Sets active FilterState objects.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$set_filter_state(data, state)
    +

    +
    -

    Arguments

    -

    data
    +

    Arguments +

    +

    +
    +
    +
    data

    (data.frame)
    data which are supposed to be filtered

    @@ -396,44 +626,78 @@

    Arguments -

    Returns

    +

    Returns +

    function which throws an error

    -


    -

    Method remove_filter_state()

    -

    Remove a single FilterState from the ReactiveQueue.

    -

    Usage

    -

    FilterStates$remove_filter_state(element_id)

    +
    +

    +
    +
    +

    Method remove_filter_state() +

    +

    Remove a single FilterState from the ReactiveQueue.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$remove_filter_state(element_id)
    +

    +
    -

    Arguments

    -

    element_id
    +

    Arguments +

    +

    +
    +
    +
    element_id

    (character)
    Name of variable to remove its FilterState.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL

    -


    -

    Method ui_add_filter_state()

    -

    Shiny UI module to add filter variable.

    -

    Usage

    -

    FilterStates$ui_add_filter_state(id, data)

    +
    +

    +
    +
    +

    Method ui_add_filter_state() +

    +

    Shiny UI module to add filter variable.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$ui_add_filter_state(id, data)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    id of shiny module

    @@ -443,23 +707,40 @@

    Arguments -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_add_filter_state()

    -

    Shiny server module to add filter variable

    -

    Usage

    -

    FilterStates$srv_add_filter_state(id, data, ...)

    +
    +

    +
    +
    +

    Method srv_add_filter_state() +

    +

    Shiny server module to add filter variable

    +
    +

    Usage +

    +

    +
    +
    FilterStates$srv_add_filter_state(id, data, ...)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    an ID string that corresponds with the ID used to call the module's UI function.

    @@ -473,10 +754,13 @@

    Arguments -

    Returns

    +

    Returns +

    moduleServer function which returns NULL Module to insert/remove FilterState UI

    This module adds the shiny UI of the newly added FilterState object to queue to the Active Filter @@ -493,20 +777,36 @@

    Returns
    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    FilterStates$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -514,7 +814,8 @@

    Arguments -

    Examples

    +

    Examples +

    library(shiny)
     filter_states <- teal.slice:::DFFilterStates$new(
       input_dataname = "data",
    @@ -543,17 +844,19 @@ 

    Examples

    + +

    + +
    - - + + diff --git a/reference/FilteredData.html b/reference/FilteredData.html index b009839e8..4c253bcdb 100644 --- a/reference/FilteredData.html +++ b/reference/FilteredData.html @@ -1,10 +1,26 @@ - -Class to encapsulate filtered datasets — FilteredData • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + + -
    + +
    @@ -79,7 +101,8 @@ + +
    -

    Methods

    +

    Methods +


    -

    Method new()

    -

    Initialize a FilteredData object

    -

    Usage

    -

    FilteredData$new(data_objects, join_keys = NULL, code = NULL, check = FALSE)

    -
    - -
    -

    Arguments

    -

    data_objects
    -

    (list) should contain.

    +
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilteredData object

    +
    +

    Usage +

    +

    +
    +
    FilteredData$new(data_objects, join_keys = NULL, code = NULL, check = FALSE)
    +

    +
    +
    + +
    +

    Arguments +

    +

    +
    +
    +
    data_objects
    +
    +

    (list) should contain.

    +
      +
    • dataset data object object supported by FilteredDataset.

    • metatada (optional) additional metadata attached to the dataset.

    • keys (optional) primary keys.

    • datalabel (optional) label describing the dataset.

    • parent (optional) which NULL is a parent of this one.

    • -
    + +
    join_keys
    @@ -168,88 +219,155 @@

    Arguments
    -

    Method datanames()

    +
    +

    +
    +
    +

    Method datanames() +

    Gets datanames

    The datanames are returned in the order in which they must be -evaluated (in case of dependencies).

    -

    Usage

    -

    FilteredData$datanames()

    +evaluated (in case of dependencies).

    +
    +

    Usage +

    +

    +
    +
    FilteredData$datanames()
    +

    +
    -

    Returns

    +

    Returns +

    (character vector) of datanames Gets data label for the dataset

    Useful to display in Show R Code.

    -


    -

    Method get_datalabel()

    +
    +

    +
    +
    +

    Method get_datalabel() +

    -

    Usage

    -

    FilteredData$get_datalabel(dataname)

    +

    Usage +

    +

    +
    +
    FilteredData$get_datalabel(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (character) keys of dataset

    -


    -

    Method get_filterable_datanames()

    -

    Gets dataset names of a given dataname for the filtering.

    -

    Usage

    -

    FilteredData$get_filterable_datanames(dataname)

    +
    +

    +
    +
    +

    Method get_filterable_datanames() +

    +

    Gets dataset names of a given dataname for the filtering.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_filterable_datanames(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character vector) names of the dataset

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (character vector) of dataset names

    -


    -

    Method get_filterable_varnames()

    -

    Gets variable names of a given dataname for the filtering.

    -

    Usage

    -

    FilteredData$get_filterable_varnames(dataname)

    +
    +

    +
    +
    +

    Method get_filterable_varnames() +

    +

    Gets variable names of a given dataname for the filtering.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_filterable_varnames(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (character vector) of variable names

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Gets a call to filter the dataset according to the filter state

    It returns a call to filter the dataset only, assuming the other (filtered) datasets it depends on are available.

    @@ -260,79 +378,140 @@

    Method get_call()

    The filtered dataset has the name given by self$filtered_dataname(dataname)

    -

    This can be used for the Show R Code generation.

    -

    Usage

    -

    FilteredData$get_call(dataname)

    +

    This can be used for the Show R Code generation.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (call or list of calls) to filter dataset calls

    -


    -

    Method get_code()

    -

    Gets the R preprocessing code string that generates the unfiltered datasets

    -

    Usage

    -

    FilteredData$get_code(dataname = self$datanames())

    +
    +

    +
    +
    +

    Method get_code() +

    +

    Gets the R preprocessing code string that generates the unfiltered datasets

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_code(dataname = self$datanames())
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name(s) of dataset(s)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (character(1)) deparsed code

    -


    -

    Method get_filtered_dataset()

    +
    +

    +
    +
    +

    Method get_filtered_dataset() +

    Gets FilteredDataset object which contains all informations -related to specific dataset.

    -

    Usage

    -

    FilteredData$get_filtered_dataset(dataname = character(0))

    +related to specific dataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_filtered_dataset(dataname = character(0))
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1))
    name of the dataset.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    FilteredDataset object or list of FilteredDataset

    -


    -

    Method get_data()

    +
    +

    +
    +
    +

    Method get_data() +

    Gets filtered or unfiltered dataset

    For filtered = FALSE, the original data set with -set_data is returned including all attributes.

    -

    Usage

    -

    FilteredData$get_data(dataname, filtered = TRUE)

    +set_data is returned including all attributes.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_data(dataname, filtered = TRUE)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset

    @@ -340,51 +519,95 @@

    Arguments
    -

    Method get_check()

    -

    Returns whether the datasets in the object have had a reproducibility check

    -

    Usage

    -

    FilteredData$get_check()

    +
    +

    +
    +
    +

    Method get_check() +

    +

    Returns whether the datasets in the object have had a reproducibility check

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_check()
    +

    +
    -

    Returns

    +

    Returns +

    logical

    -


    -

    Method get_metadata()

    -

    Gets metadata for a given dataset

    -

    Usage

    -

    FilteredData$get_metadata(dataname)

    +
    +

    +
    +
    +

    Method get_metadata() +

    +

    Gets metadata for a given dataset

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_metadata(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    value of metadata for given data (or NULL if it does not exist)

    -


    -

    Method get_join_keys()

    -

    Get join keys between two datasets.

    -

    Usage

    -

    FilteredData$get_join_keys(dataset_1, dataset_2)

    +
    +

    +
    +
    +

    Method get_join_keys() +

    +

    Get join keys between two datasets.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_join_keys(dataset_1, dataset_2)
    +

    +
    -

    Arguments

    -

    dataset_1
    +

    Arguments +

    +

    +
    +
    +
    dataset_1

    (character(1)) one dataset name

    @@ -392,70 +615,120 @@

    Arguments -

    Returns

    +

    Returns +

    (named character) vector with column names

    -


    -

    Method get_filter_overview()

    +
    +

    +
    +
    +

    Method get_filter_overview() +

    Get filter overview table in form of X (filtered) / Y (non-filtered)

    This is intended to be presented in the application. -The content for each of the data names is defined in get_filter_overview_info method.

    -

    Usage

    -

    FilteredData$get_filter_overview(datanames)

    +The content for each of the data names is defined in get_filter_overview_info method.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_filter_overview(datanames)
    +

    +
    -

    Arguments

    -

    datanames
    +

    Arguments +

    +

    +
    +
    +
    datanames

    (character vector) names of the dataset

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (matrix) matrix of observations and subjects of all datasets Get keys for the dataset

    -


    -

    Method get_keys()

    +
    +

    +
    +
    +

    Method get_keys() +

    -

    Usage

    -

    FilteredData$get_keys(dataname)

    +

    Usage +

    +

    +
    +
    FilteredData$get_keys(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (character) keys of dataset

    -


    -

    Method get_varlabels()

    +
    +

    +
    +
    +

    Method get_varlabels() +

    Gets labels of variables in the data

    Variables are the column names of the data. Either, all labels must have been provided for all variables -in set_data or NULL.

    -

    Usage

    -

    FilteredData$get_varlabels(dataname, variables = NULL)

    +in set_data or NULL.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_varlabels(dataname, variables = NULL)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset

    @@ -464,67 +737,117 @@

    Arguments -

    Returns

    +

    Returns +

    (character or NULL) variable labels, NULL if column_labels attribute does not exist for the data

    -


    -

    Method get_varnames()

    -

    Gets variable names

    -

    Usage

    -

    FilteredData$get_varnames(dataname)

    +
    +

    +
    +
    +

    Method get_varnames() +

    +

    Gets variable names

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_varnames(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character) the name of the dataset

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (character vector) of variable names When active_datanames is "all", sets them to all datanames otherwise, it makes sure that it is a subset of the available datanames

    -


    -

    Method handle_active_datanames()

    +
    +

    +
    +
    +

    Method handle_active_datanames() +

    -

    Usage

    -

    FilteredData$handle_active_datanames(datanames)

    +

    Usage +

    +

    +
    +
    FilteredData$handle_active_datanames(datanames)
    +

    +
    -

    Arguments

    -

    datanames
    +

    Arguments +

    +

    +
    +
    +
    datanames

    character vector datanames to pick

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    the intersection of self$datanames() and datanames

    -


    -

    Method set_dataset()

    -

    Adds a dataset to this FilteredData

    -

    Usage

    -

    FilteredData$set_dataset(dataset_args, dataname)

    +
    +

    +
    +
    +

    Method set_dataset() +

    +

    Adds a dataset to this FilteredData

    +
    +

    Usage +

    +

    +
    +
    FilteredData$set_dataset(dataset_args, dataname)
    +

    +
    -

    Arguments

    -

    dataset_args
    +

    Arguments +

    +

    +
    +
    +
    dataset_args

    (list)
    containing the arguments except (dataname) needed by init_filtered_dataset

    @@ -535,110 +858,190 @@

    Arguments -

    Details

    +

    Details +

    set_dataset creates a FilteredDataset object which keeps dataset for the filtering purpose.

    -

    Returns

    +

    Returns +

    (self) invisibly this FilteredData

    -


    -

    Method set_join_keys()

    -

    Set the join_keys

    -

    Usage

    -

    FilteredData$set_join_keys(join_keys)

    +
    +

    +
    +
    +

    Method set_join_keys() +

    +

    Set the join_keys

    +
    +

    Usage +

    +

    +
    +
    FilteredData$set_join_keys(join_keys)
    +

    +
    -

    Arguments

    -

    join_keys
    +

    Arguments +

    +

    +
    +
    +
    join_keys

    (JoinKeys) join_key (converted to a nested list)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (self) invisibly this FilteredData

    -


    -

    Method set_check()

    -

    sets whether the datasets in the object have had a reproducibility check

    -

    Usage

    -

    FilteredData$set_check(check)

    +
    +

    +
    +
    +

    Method set_check() +

    +

    sets whether the datasets in the object have had a reproducibility check

    +
    +

    Usage +

    +

    +
    +
    FilteredData$set_check(check)
    +

    +
    -

    Arguments

    -

    check
    +

    Arguments +

    +

    +
    +
    +
    check

    (logical) whether datasets have had reproducibility check

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (self)

    -


    -

    Method set_code()

    -

    Sets the R preprocessing code for single dataset

    -

    Usage

    -

    FilteredData$set_code(code)

    +
    +

    +
    +
    +

    Method set_code() +

    +

    Sets the R preprocessing code for single dataset

    +
    +

    Usage +

    +

    +
    +
    FilteredData$set_code(code)
    +

    +
    -

    Arguments

    -

    code
    +

    Arguments +

    +

    +
    +
    +
    code

    (CodeClass)
    preprocessing code that can be parsed to generate the unfiltered datasets

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (self)

    -


    +

    +
    +
    +

    Method get_filter_state() +

    Gets the reactive values from the active FilterState objects.

    Gets all active filters in the form of a nested list. -The output list is a compatible input to self$set_filter_state.

    -

    Usage

    -

    FilteredData$get_filter_state()

    +The output list is a compatible input to self$set_filter_state.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    list with named elements corresponding to FilteredDataset objects with active filters.

    -


    -

    Method get_formatted_filter_state()

    -

    Returns the filter state formatted for printing to an IO device.

    -

    Usage

    -

    FilteredData$get_formatted_filter_state()

    +
    +

    +
    +
    +

    Method get_formatted_filter_state() +

    +

    Returns the filter state formatted for printing to an IO device.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_formatted_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    character the pre-formatted filter state

    -

    Examples

    -

    utils::data(miniACC, package = "MultiAssayExperiment")
    +

    Examples +

    +

    +
    +
    utils::data(miniACC, package = "MultiAssayExperiment")
     datasets <- teal.slice:::FilteredData$new(
       list(iris = list(dataset = iris),
            mae = list(dataset = miniACC)
    @@ -662,33 +1065,55 @@ 

    Examples) ) datasets$set_filter_state(state = fs) -cat(shiny::isolate(datasets$get_formatted_filter_state()))

    +cat(shiny::isolate(datasets$get_formatted_filter_state()))
    +

    +
    -


    -

    Method set_filter_state()

    -

    Sets active filter states.

    -

    Usage

    -

    FilteredData$set_filter_state(state)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Sets active filter states.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$set_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (named list)
    nested list of filter selections applied to datasets.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL

    -

    Examples

    -

    utils::data(miniACC, package = "MultiAssayExperiment")
    +

    Examples +

    +

    +
    +
    utils::data(miniACC, package = "MultiAssayExperiment")
     
     datasets <- teal.slice:::FilteredData$new(
       list(iris = list(dataset = iris),
    @@ -713,115 +1138,197 @@ 

    Examples) ) datasets$set_filter_state(state = fs) -shiny::isolate(datasets$get_filter_state())

    +shiny::isolate(datasets$get_filter_state())
    +

    +
    -


    -

    Method remove_filter_state()

    -

    Remove one or more FilterState of a FilteredDataset in a FilteredData object

    -

    Usage

    -

    FilteredData$remove_filter_state(state)

    +
    +

    +
    +
    +

    Method remove_filter_state() +

    +

    Remove one or more FilterState of a FilteredDataset in a FilteredData object

    +
    +

    Usage +

    +

    +
    +
    FilteredData$remove_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (named list)
    nested list of filter selections applied to datasets.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL

    -


    -

    Method remove_all_filter_states()

    -

    Remove all FilterStates of a FilteredDataset or all FilterStates of a FilteredData object

    -

    Usage

    -

    FilteredData$remove_all_filter_states(datanames = self$datanames())

    +
    +

    +
    +
    +

    Method remove_all_filter_states() +

    +

    Remove all FilterStates of a FilteredDataset or all FilterStates of a FilteredData object

    +
    +

    Usage +

    +

    +
    +
    FilteredData$remove_all_filter_states(datanames = self$datanames())
    +

    +
    -

    Arguments

    -

    datanames
    +

    Arguments +

    +

    +
    +
    +
    datanames

    (character)
    datanames to remove their FilterStates or empty which removes all FilterStates in the FilteredData object.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL

    -


    -

    Method restore_state_from_bookmark()

    +
    +

    +
    +
    +

    Method restore_state_from_bookmark() +

    Sets this object from a bookmarked state

    Only sets the filter state, does not set the data and the preprocessing code. The data should already have been set. Also checks the preprocessing code is identical if provided in the state.

    Since this function is used from the end-user part, its error messages are more verbose. We don't call the Shiny modals from here because this -class may be used outside of a Shiny app.

    -

    Usage

    -

    FilteredData$restore_state_from_bookmark(state, check_data_hash = TRUE)

    +class may be used outside of a Shiny app.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$restore_state_from_bookmark(state, check_data_hash = TRUE)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (named list)
    containing fields data_hash, filter_states and preproc_code.

    check_data_hash
    -

    (logical) whether to check that md5sums agree +

    +

    (logical) whether to check that md5sums agree for the data; may not make sense with randomly generated data per session Module for the right filter panel in the teal app with a filter overview panel and a filter variable panel.

    This panel contains info about the number of observations left in -the (active) datasets and allows to filter the datasets.

    +the (active) datasets and allows to filter the datasets.

    + -

    +
    +

    +
    -


    -

    Method ui_filter_panel()

    +
    +

    +
    +
    +

    Method ui_filter_panel() +

    -

    Usage

    -

    FilteredData$ui_filter_panel(id)

    +

    Usage +

    +

    +
    +
    FilteredData$ui_filter_panel(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    module id Server function for filter panel

    -

    +
    +

    +
    -


    -

    Method srv_filter_panel()

    +
    +

    +
    +
    +

    Method srv_filter_panel() +

    -

    Usage

    -

    FilteredData$srv_filter_panel(id, active_datanames = function() "all")

    +

    Usage +

    +

    +
    +
    FilteredData$srv_filter_panel(id, active_datanames = function() "all")
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    an ID string that corresponds with the ID used to call the module's UI function.

    @@ -834,10 +1341,13 @@

    Arguments -

    Returns

    +

    Returns +

    moduleServer function which returns NULL Creates the UI for the module showing counts for each dataset contrasting the filtered to the full unfiltered dataset

    @@ -846,36 +1356,64 @@

    Returns
    -

    Method ui_filter_overview()

    +
    +

    +
    +
    +

    Method ui_filter_overview() +

    -

    Usage

    -

    FilteredData$ui_filter_overview(id)

    +

    Usage +

    +

    +
    +
    FilteredData$ui_filter_overview(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    module id Server function to display the number of records in the filtered and unfiltered data

    -

    +
    +

    +
    -


    -

    Method srv_filter_overview()

    +
    +

    +
    +
    +

    Method srv_filter_overview() +

    -

    Usage

    -

    FilteredData$srv_filter_overview(id, active_datanames = function() "all")

    +

    Usage +

    +

    +
    +
    FilteredData$srv_filter_overview(id, active_datanames = function() "all")
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    an ID string that corresponds with the ID used to call the module's UI function.

    @@ -888,27 +1426,46 @@

    Arguments -

    Returns

    +

    Returns +

    moduleServer function which returns NULL

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    FilteredData$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -916,7 +1473,8 @@

    Arguments -

    Examples

    +

    Examples +

    library(shiny)
     datasets <- teal.slice:::FilteredData$new(
       list(
    @@ -1357,17 +1915,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/reference/FilteredDataset.html b/reference/FilteredDataset.html index 5dcf5b9e8..0a01f57fc 100644 --- a/reference/FilteredDataset.html +++ b/reference/FilteredDataset.html @@ -1,16 +1,32 @@ - - + + + + + +FilterStates R6 class — FilteredDataset • teal.slice +FilterStates R6 class — FilteredDataset • teal.slice + + + + + + + + + + Skip to contents @@ -26,7 +42,8 @@ + + + -

    + +
    @@ -88,12 +111,15 @@
    -

    Methods

    +

    Methods +


    -

    Method new()

    -

    Initializes this FilteredDataset object

    -

    Usage

    -

    +

    +
    +
    +

    Method new() +

    +

    Initializes this FilteredDataset object

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$new(
       dataset,
       dataname,
       keys = character(0),
       label = attr(dataset, "label"),
       metadata = NULL
    -)

    +)
    +

    +
    -

    Arguments

    -

    dataset
    +

    Arguments +

    +

    +
    +
    +
    dataset

    (data.frame or MultiAssayExperiment)
    single dataset for which filters are rendered

    @@ -156,235 +197,422 @@

    Arguments
    -

    Method get_formatted_filter_state()

    -

    Returns a string representation of the filter state in this FilteredDataset.

    -

    Usage

    -

    FilteredDataset$get_formatted_filter_state()

    +
    +

    +
    +
    +

    Method get_formatted_filter_state() +

    +

    Returns a string representation of the filter state in this FilteredDataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_formatted_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    character(1) the formatted string representing the filter state

    -


    -

    Method queues_empty()

    -

    Removes all active filter items applied to this dataset

    -

    Usage

    -

    FilteredDataset$queues_empty()

    +
    +

    +
    +
    +

    Method queues_empty() +

    +

    Removes all active filter items applied to this dataset

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$queues_empty()
    +

    +
    -

    Returns

    +

    Returns +

    NULL

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Gets a filter expression

    This functions returns filter calls equivalent to selected items within each of filter_states. Configuration of the calls is constant and -depends on filter_states type and order which are set during initialization.

    -

    Usage

    -

    FilteredDataset$get_call()

    +depends on filter_states type and order which are set during initialization.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_call()
    +

    +
    -

    Returns

    +

    Returns +

    filter call or list of filter calls Gets the reactive values from the active FilterState objects.

    Get all active filters from this dataset in form of the nested list. The output list is a compatible input to self$set_filter_state.

    -


    +

    +
    +
    +

    Method get_filter_state() +

    -

    Usage

    -

    FilteredDataset$get_filter_state()

    +

    Usage +

    +

    +
    +
    FilteredDataset$get_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    list with named elements corresponding to FilterStates objects with active filters.

    -


    -

    Method get_filter_states()

    -

    Gets the active FilterStates objects.

    -

    Usage

    -

    FilteredDataset$get_filter_states(id = character(0))

    +
    +

    +
    +
    +

    Method get_filter_states() +

    +

    Gets the active FilterStates objects.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_filter_states(id = character(0))
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1), character(0))
    the id of the private$filter_states list element where FilterStates is kept.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    FilterStates or list of FilterStates objects.

    -


    -

    Method get_dataname()

    +
    +

    +
    +
    +

    Method get_dataname() +

    +

    Get name of the dataset

    Get name of the dataset

    -

    Get name of the dataset

    -

    Usage

    -

    FilteredDataset$get_dataname()

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_dataname()
    +

    +
    -

    Returns

    +

    Returns +

    character(1) as a name of this dataset

    -


    -

    Method get_dataset()

    -

    Gets the dataset object in this FilteredDataset

    -

    Usage

    -

    FilteredDataset$get_dataset()

    +
    +

    +
    +
    +

    Method get_dataset() +

    +

    Gets the dataset object in this FilteredDataset

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_dataset()
    +

    +
    -

    Returns

    +

    Returns +

    data.frame or MultiAssayExperiment

    -


    -

    Method get_metadata()

    -

    Gets the metadata for the dataset in this FilteredDataset

    -

    Usage

    -

    FilteredDataset$get_metadata()

    +
    +

    +
    +
    +

    Method get_metadata() +

    +

    Gets the metadata for the dataset in this FilteredDataset

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_metadata()
    +

    +
    -

    Returns

    +

    Returns +

    named list or NULL

    -


    -

    Method get_filter_overview_info()

    +
    +

    +
    +
    +

    Method get_filter_overview_info() +

    Get filter overview rows of a dataset The output shows the comparison between filtered_dataset -function parameter and the dataset inside self

    -

    Usage

    -

    FilteredDataset$get_filter_overview_info(filtered_dataset = self$get_dataset())

    +function parameter and the dataset inside self

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_filter_overview_info(filtered_dataset = self$get_dataset())
    +

    +
    -

    Arguments

    -

    filtered_dataset
    +

    Arguments +

    +

    +
    +
    +
    filtered_dataset

    comparison object, of the same class as self$get_dataset(), if NULL then self$get_dataset() is used.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (matrix) matrix of observations and subjects

    -


    -

    Method get_hash()

    -

    Returns the hash of the dataset

    -

    Usage

    -

    FilteredDataset$get_hash()

    +
    +

    +
    +
    +

    Method get_hash() +

    +

    Returns the hash of the dataset

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_hash()
    +

    +
    -

    Returns

    +

    Returns +

    (character(1)) the hash

    -


    -

    Method get_keys()

    -

    Gets the keys for the dataset of this FilteredDataset

    -

    Usage

    -

    FilteredDataset$get_keys()

    +
    +

    +
    +
    +

    Method get_keys() +

    +

    Gets the keys for the dataset of this FilteredDataset

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_keys()
    +

    +
    -

    Returns

    +

    Returns +

    (character) the keys of dataset

    -


    -

    Method get_varlabels()

    +
    +

    +
    +
    +

    Method get_varlabels() +

    Gets labels of variables in the data

    Variables are the column names of the data. Either, all labels must have been provided for all variables -in set_data or NULL.

    -

    Usage

    -

    FilteredDataset$get_varlabels(variables = NULL)

    +in set_data or NULL.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_varlabels(variables = NULL)
    +

    +
    -

    Arguments

    -

    variables
    +

    Arguments +

    +

    +
    +
    +
    variables

    (character vector) variables to get labels for; if NULL, for all variables in data

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (character or NULL) variable labels, NULL if column_labels attribute does not exist for the data

    -


    -

    Method get_dataset_label()

    -

    Gets the dataset label

    -

    Usage

    -

    FilteredDataset$get_dataset_label()

    +
    +

    +
    +
    +

    Method get_dataset_label() +

    +

    Gets the dataset label

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_dataset_label()
    +

    +
    -

    Returns

    +

    Returns +

    (character) the dataset label

    -


    -

    Method get_varnames()

    -

    Gets variable names from dataset

    -

    Usage

    -

    FilteredDataset$get_varnames()

    +
    +

    +
    +
    +

    Method get_varnames() +

    +

    Gets variable names from dataset

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_varnames()
    +

    +
    -

    Returns

    +

    Returns +

    character the variable names

    -


    -

    Method get_filtered_dataname()

    +
    +

    +
    +
    +

    Method get_filtered_dataname() +

    Gets the suffixed dataname Used when filtering the data to get <dataname>_FILTERED, -<dataname>_FILTERED_ALONE or any other name.

    -

    Usage

    -

    FilteredDataset$get_filtered_dataname(
    +<dataname>_FILTERED_ALONE or any other name.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_filtered_dataname(
       dataname = self$get_dataname(),
       suffix = "_FILTERED"
    -)

    +)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) dataname

    @@ -392,103 +620,182 @@

    Arguments -

    Returns

    +

    Returns +

    character(1)

    -


    -

    Method get_filterable_varnames()

    -

    Gets variable names for the filtering.

    -

    Usage

    -

    FilteredDataset$get_filterable_varnames()

    +
    +

    +
    +
    +

    Method get_filterable_varnames() +

    +

    Gets variable names for the filtering.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_filterable_varnames()
    +

    +
    -

    Returns

    +

    Returns +

    (character vector) of variable names

    -


    -

    Method ui()

    +
    +

    +
    +
    +

    Method ui() +

    UI module for dataset active filters

    UI module containing dataset active filters along with -title and remove button.

    -

    Usage

    -

    FilteredDataset$ui(id)

    +title and remove button.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$ui(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    identifier of the element - preferably containing dataset name

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    function - shiny UI module

    -


    -

    Method server()

    +
    +

    +
    +
    +

    Method server() +

    Server module for a dataset active filters

    -

    Server module managing a active filters.

    -

    Usage

    -

    FilteredDataset$server(id)

    +

    Server module managing a active filters.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$server(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    an ID string that corresponds with the ID used to call the module's UI function.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    moduleServer function which returns NULL

    -


    -

    Method ui_add_filter_state()

    +
    +

    +
    +
    +

    Method ui_add_filter_state() +

    UI module to add filter variable for this dataset

    -

    UI module to add filter variable for this dataset

    -

    Usage

    -

    FilteredDataset$ui_add_filter_state(id)

    +

    UI module to add filter variable for this dataset

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$ui_add_filter_state(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    identifier of the element - preferably containing dataset name

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    function - shiny UI module

    -


    -

    Method srv_add_filter_state()

    +
    +

    +
    +
    +

    Method srv_add_filter_state() +

    Server module to add filter variable for this dataset

    -

    Server module to add filter variable for this dataset

    -

    Usage

    -

    FilteredDataset$srv_add_filter_state(id, ...)

    +

    Server module to add filter variable for this dataset

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$srv_add_filter_state(id, ...)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    an ID string that corresponds with the ID used to call the module's UI function.

    @@ -497,27 +804,46 @@

    Arguments -

    Returns

    +

    Returns +

    moduleServer function.

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    FilteredDataset$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -525,17 +851,19 @@

    Arguments

    + +
    + +
    - - + + diff --git a/reference/LogicalFilterState.html b/reference/LogicalFilterState.html index 28692c797..01aaf7331 100644 --- a/reference/LogicalFilterState.html +++ b/reference/LogicalFilterState.html @@ -1,10 +1,26 @@ - -FilterState object for logical variable — LogicalFilterState • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + + -
    + +
    @@ -79,34 +102,43 @@
    -

    Value

    +

    Value +

    invisibly NULL.

    -

    Note

    +

    Note +

    Casts the passed object to logical before validating the input making it possible to pass any object coercible to logical to this method.

    -

    Super class

    +

    Super class +

    teal.slice::FilterState -> LogicalFilterState

    +

    Inherited methods


    -

    Method new()

    -

    Initialize a FilterState object

    -

    Usage

    -

    LogicalFilterState$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterState object

    +
    +

    Usage +

    +

    +
    +
    LogicalFilterState$new(
       x,
       varname,
       varlabel = character(0),
       input_dataname = NULL,
       extract_type = character(0)
    -)

    +)
    +

    +
    -


    -

    Method is_any_filtered()

    -

    Answers the question of whether the current settings and values selected actually filters out any values.

    -

    Usage

    -

    LogicalFilterState$is_any_filtered()

    +
    +

    +
    +
    +

    Method is_any_filtered() +

    +

    Answers the question of whether the current settings and values selected actually filters out any values.

    +
    +

    Usage +

    +

    +
    +
    LogicalFilterState$is_any_filtered()
    +

    +
    -

    Returns

    +

    Returns +

    logical scalar

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection. For LogicalFilterState it's a !<varname> or <varname> and optionally -is.na(<varname>)

    -

    Usage

    -

    LogicalFilterState$get_call()

    +is.na(<varname>)

    +
    +

    Usage +

    +

    +
    +
    LogicalFilterState$get_call()
    +

    +
    -


    -

    Method ui()

    +
    +

    +
    +
    +

    Method ui() +

    UI Module for EmptyFilterState. This UI element contains available choices selection and -checkbox whether to keep or not keep the NA values.

    -

    Usage

    -

    LogicalFilterState$ui(id)

    +checkbox whether to keep or not keep the NA values.

    +
    +

    Usage +

    +

    +
    +
    LogicalFilterState$ui(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    id of shiny element

    -

    +
    +

    +
    -


    -

    Method server()

    -

    Server module

    -

    Usage

    -

    LogicalFilterState$server(id)

    +
    +

    +
    +
    +

    Method server() +

    +

    Server module

    +
    +

    Usage +

    +

    +
    +
    LogicalFilterState$server(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    an ID string that corresponds with the ID used to call the module's UI function.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    moduleServer function which returns NULL

    -


    -

    Method set_selected()

    -

    Sets the selected values of this LogicalFilterState.

    -

    Usage

    -

    LogicalFilterState$set_selected(value)

    +
    +

    +
    +
    +

    Method set_selected() +

    +

    Sets the selected values of this LogicalFilterState.

    +
    +

    Usage +

    +

    +
    +
    LogicalFilterState$set_selected(value)
    +

    +
    -

    Arguments

    -

    value
    +

    Arguments +

    +

    +
    +
    +
    value

    (logical(1))
    the value to set. Must not contain the NA value.

    -

    +
    +

    +
    -

    Examples

    -

    filter <- teal.slice:::LogicalFilterState$new(c(TRUE), varname = "name")
    -filter$set_selected(TRUE)

    +

    Examples +

    +

    +
    +
    filter <- teal.slice:::LogicalFilterState$new(c(TRUE), varname = "name")
    +filter$set_selected(TRUE)
    +

    +
    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    LogicalFilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    LogicalFilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -273,7 +415,8 @@

    Arguments -

    Examples

    +

    Examples +

    filter_state <- teal.slice:::LogicalFilterState$new(
       sample(c(TRUE, FALSE, NA), 10, replace = TRUE),
       varname = "x",
    @@ -297,17 +440,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/reference/MAEFilterStates.html b/reference/MAEFilterStates.html index d7329b037..28e67ba3f 100644 --- a/reference/MAEFilterStates.html +++ b/reference/MAEFilterStates.html @@ -1,8 +1,24 @@ - -MAEFilterStates — MAEFilterStates • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + + -
    + +
    @@ -76,16 +98,20 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterStates -> MAEFilterStates

    +

    Inherited methods


    -

    Method new()

    +

    +
    +
    +

    Method new() +

    Initializes MAEFilterStates object

    -

    Initialize MAEFilterStates object

    -

    Usage

    -

    MAEFilterStates$new(
    +

    Initialize MAEFilterStates object

    +
    +

    Usage +

    +

    +
    +
    MAEFilterStates$new(
       input_dataname,
       output_dataname,
       datalabel,
       varlabels,
       keys
    -)

    +)
    +

    +
    -

    Arguments

    -

    input_dataname
    +

    Arguments +

    +

    +
    +
    +
    input_dataname

    (character(1) or name or call)
    name of the data used on lhs of the expression specified to the function argument attached to this FilterStates.

    @@ -146,87 +188,159 @@

    Arguments
    -

    Method format()

    -

    Returns the formatted string representing this MAEFilterStates object.

    -

    Usage

    -

    MAEFilterStates$format(indent = 0)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns the formatted string representing this MAEFilterStates object.

    +
    +

    Usage +

    +

    +
    +
    MAEFilterStates$format(indent = 0)
    +

    +
    -

    Arguments

    -

    indent
    +

    Arguments +

    +

    +
    +
    +
    indent

    (numeric(1)) the number of spaces before each line of the representation

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    character(1) the formatted string

    -


    -

    Method get_fun()

    +
    +

    +
    +
    +

    Method get_fun() +

    Returns function name used to create filter call. -For MAEFilterStates MultiAssayExperiment::subsetByColData is used.

    -

    Usage

    -

    MAEFilterStates$get_fun()

    +For MAEFilterStates MultiAssayExperiment::subsetByColData is used.

    +
    +

    Usage +

    +

    +
    +
    MAEFilterStates$get_fun()
    +

    +
    -

    Returns

    +

    Returns +

    character(1)

    -


    -

    Method server()

    -

    Server module

    -

    Usage

    -

    MAEFilterStates$server(id)

    +
    +

    +
    +
    +

    Method server() +

    +

    Server module

    +
    +

    Usage +

    +

    +
    +
    MAEFilterStates$server(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    an ID string that corresponds with the ID used to call the module's UI function.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    moduleServer function which returns NULL

    -


    +

    +
    +
    +

    Method get_filter_state() +

    Returns active FilterState objects.

    Gets all active filters from this dataset in form of the nested list. -The output list can be used as input to self$set_filter_state.

    -

    Usage

    -

    MAEFilterStates$get_filter_state()

    +The output list can be used as input to self$set_filter_state.

    +
    +

    Usage +

    +

    +
    +
    MAEFilterStates$get_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    list with elements number equal number of FilterStates.

    -


    -

    Method set_filter_state()

    -

    Set filter state

    -

    Usage

    -

    MAEFilterStates$set_filter_state(data, state, ...)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Set filter state

    +
    +

    Usage +

    +

    +
    +
    MAEFilterStates$set_filter_state(data, state, ...)
    +

    +
    -

    Arguments

    -

    data
    +

    Arguments +

    +

    +
    +
    +
    data

    (MultiAssayExperiment)
    data which are supposed to be filtered.

    @@ -242,43 +356,77 @@

    Arguments -

    Returns

    +

    Returns +

    NULL

    -


    -

    Method remove_filter_state()

    -

    Removes a variable from the ReactiveQueue and its corresponding UI element.

    -

    Usage

    -

    MAEFilterStates$remove_filter_state(element_id)

    +
    +

    +
    +
    +

    Method remove_filter_state() +

    +

    Removes a variable from the ReactiveQueue and its corresponding UI element.

    +
    +

    Usage +

    +

    +
    +
    MAEFilterStates$remove_filter_state(element_id)
    +

    +
    -

    Arguments

    -

    element_id
    +

    Arguments +

    +

    +
    +
    +
    element_id

    (character(1))
    name of ReactiveQueue element.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL

    -


    -

    Method ui_add_filter_state()

    -

    Shiny UI module to add filter variable

    -

    Usage

    -

    MAEFilterStates$ui_add_filter_state(id, data)

    +
    +

    +
    +
    +

    Method ui_add_filter_state() +

    +

    Shiny UI module to add filter variable

    +
    +

    Usage +

    +

    +
    +
    MAEFilterStates$ui_add_filter_state(id, data)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    id of shiny module

    @@ -289,26 +437,43 @@

    Arguments -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_add_filter_state()

    +
    +

    +
    +
    +

    Method srv_add_filter_state() +

    Shiny server module to add filter variable.

    Module controls available choices to select as a filter variable. Selected filter variable is being removed from available choices. -Removed filter variable gets back to available choices.

    -

    Usage

    -

    MAEFilterStates$srv_add_filter_state(id, data, ...)

    +Removed filter variable gets back to available choices.

    +
    +

    Usage +

    +

    +
    +
    MAEFilterStates$srv_add_filter_state(id, data, ...)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    an ID string that corresponds with the ID used to call the module's UI function.

    @@ -323,10 +488,13 @@

    Arguments -

    Returns

    +

    Returns +

    moduleServer function which returns NULL description Get label of specific variable. In case when variable label is missing @@ -336,20 +504,36 @@

    Returns
    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    MAEFilterStates$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    MAEFilterStates$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -357,17 +541,19 @@

    Arguments

    + +

    + +
    - - + + diff --git a/reference/MAEFilteredDataset.html b/reference/MAEFilteredDataset.html index 3a0918405..44e8d4ced 100644 --- a/reference/MAEFilteredDataset.html +++ b/reference/MAEFilteredDataset.html @@ -1,10 +1,26 @@ - -MAEFilteredDataset R6 class — MAEFilteredDataset • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + + -
    + +
    @@ -79,16 +102,20 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilteredDataset -> MAEFilteredDataset

    +

    Inherited methods


    -

    Method new()

    -

    Initialize MAEFilteredDataset object

    -

    Usage

    -

    MAEFilteredDataset$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize MAEFilteredDataset object

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$new(
       dataset,
       dataname,
       keys = character(0),
       label = character(0),
       metadata = NULL
    -)

    +)
    +

    +
    -

    Arguments

    -

    dataset
    +

    Arguments +

    +

    +
    +
    +
    dataset

    (MulitiAssayExperiment)
    single MultiAssayExperiment for which filters are rendered

    @@ -154,98 +197,172 @@

    Arguments
    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Get filter expression

    This functions returns filter calls equivalent to selected items within each of filter_states. Configuration of the calls is constant and depends on filter_states type and order which are set during initialization. -This class contains multiple FilterStates:

    • colData(dataset)for this object single MAEFilterStates +This class contains multiple FilterStates:

      +
        +
      • colData(dataset)for this object single MAEFilterStates which returns subsetByColData call

      • experimentsfor each experiment single SEFilterStates and FilterStates_matrix, both returns subset call

      • -
      -

      Usage

      -

      MAEFilteredDataset$get_call()

      +
    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$get_call()
    +

    +
    -

    Returns

    +

    Returns +

    filter call or list of filter calls

    -


    -

    Method get_varlabels()

    +
    +

    +
    +
    +

    Method get_varlabels() +

    Gets labels of variables in the data

    Variables are the column names of the data. Either, all labels must have been provided for all variables -in set_data or NULL.

    -

    Usage

    -

    MAEFilteredDataset$get_varlabels(variables = NULL)

    +in set_data or NULL.

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$get_varlabels(variables = NULL)
    +

    +
    -

    Arguments

    -

    variables
    +

    Arguments +

    +

    +
    +
    +
    variables

    (character vector) variables to get labels for; if NULL, for all variables in data

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (character or NULL) variable labels, NULL if column_labels attribute does not exist for the data

    -


    -

    Method get_filter_overview_info()

    -

    Get filter overview rows of a dataset

    -

    Usage

    -

    MAEFilteredDataset$get_filter_overview_info(
    +
    +

    +
    +
    +

    Method get_filter_overview_info() +

    +

    Get filter overview rows of a dataset

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$get_filter_overview_info(
       filtered_dataset = self$get_dataset()
    -)

    +)
    +

    +
    -

    Arguments

    -

    filtered_dataset
    +

    Arguments +

    +

    +
    +
    +
    filtered_dataset

    (MultiAssayExperiment) object to calculate filter overview statistics on.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (matrix) matrix of observations and subjects

    -


    -

    Method get_filterable_varnames()

    -

    Gets variable names for the filtering.

    -

    Usage

    -

    MAEFilteredDataset$get_filterable_varnames()

    +
    +

    +
    +
    +

    Method get_filterable_varnames() +

    +

    Gets variable names for the filtering.

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$get_filterable_varnames()
    +

    +
    -

    Returns

    +

    Returns +

    (character(0))

    -


    -

    Method set_filter_state()

    -

    Set filter state

    -

    Usage

    -

    MAEFilteredDataset$set_filter_state(state, ...)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Set filter state

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$set_filter_state(state, ...)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (named list)
    names of the list should correspond to the names of the initialized FilterStates kept in private$filter_states. For this object they are "subjects" and @@ -257,15 +374,21 @@

    Arguments -

    Returns

    +

    Returns +

    NULL

    -

    Examples

    -

    utils::data(miniACC, package = "MultiAssayExperiment")
    +

    Examples +

    +

    +
    +
    utils::data(miniACC, package = "MultiAssayExperiment")
     dataset <- teal.slice:::MAEFilteredDataset$new(miniACC, "MAE")
     fs <- list(
       subjects = list(
    @@ -278,68 +401,118 @@ 

    Examples) ) dataset$set_filter_state(state = fs) -shiny::isolate(dataset$get_filter_state())

    +shiny::isolate(dataset$get_filter_state())
    +

    +
    -


    -

    Method remove_filter_state()

    -

    Remove one or more FilterState of a MAEFilteredDataset

    -

    Usage

    -

    MAEFilteredDataset$remove_filter_state(element_id)

    +
    +

    +
    +
    +

    Method remove_filter_state() +

    +

    Remove one or more FilterState of a MAEFilteredDataset

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$remove_filter_state(element_id)
    +

    +
    -

    Arguments

    -

    element_id
    +

    Arguments +

    +

    +
    +
    +
    element_id

    (list)
    Named list of variables to remove their FilterState.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL

    -


    -

    Method ui_add_filter_state()

    +
    +

    +
    +
    +

    Method ui_add_filter_state() +

    UI module to add filter variable for this dataset

    -

    UI module to add filter variable for this dataset

    -

    Usage

    -

    MAEFilteredDataset$ui_add_filter_state(id)

    +

    UI module to add filter variable for this dataset

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$ui_add_filter_state(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    identifier of the element - preferably containing dataset name

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    function - shiny UI module

    -


    -

    Method srv_add_filter_state()

    +
    +

    +
    +
    +

    Method srv_add_filter_state() +

    Server module to add filter variable for this dataset

    Server module to add filter variable for this dataset. For this class srv_add_filter_state calls multiple modules of the same name from FilterStates as MAEFilteredDataset contains one FilterStates object for colData and one for each -experiment.

    -

    Usage

    -

    MAEFilteredDataset$srv_add_filter_state(id, ...)

    +experiment.

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$srv_add_filter_state(id, ...)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    an ID string that corresponds with the ID used to call the module's UI function.

    @@ -348,26 +521,43 @@

    Arguments -

    Returns

    +

    Returns +

    moduleServer function which returns NULL

    -


    -

    Method get_filter_overview_nsubjs()

    -

    Gets filter overview subjects number

    -

    Usage

    -

    MAEFilteredDataset$get_filter_overview_nsubjs(
    +
    +

    +
    +
    +

    Method get_filter_overview_nsubjs() +

    +

    Gets filter overview subjects number

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$get_filter_overview_nsubjs(
       filtered_dataset = self$get_dataset(),
       subject_keys
    -)

    +)
    +

    +
    -

    Arguments

    -

    filtered_dataset
    +

    Arguments +

    +

    +
    +
    +
    filtered_dataset

    (MultiAssayExperiment) object to calculate filter overview statistics on.

    @@ -375,27 +565,46 @@

    Arguments -

    Returns

    +

    Returns +

    list with the number of subjects of filtered/non-filtered datasets.

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    MAEFilteredDataset$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -403,7 +612,8 @@

    Arguments -

    Examples

    +

    Examples +

    
     ## ------------------------------------------------
     ## Method `MAEFilteredDataset$set_filter_state`
    @@ -468,17 +678,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/reference/MatrixFilterStates.html b/reference/MatrixFilterStates.html index 1dfd54c12..a9d9a9dbe 100644 --- a/reference/MatrixFilterStates.html +++ b/reference/MatrixFilterStates.html @@ -1,8 +1,24 @@ - -MatrixFilterStates — MatrixFilterStates • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + + -
    + +
    @@ -76,16 +98,20 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterStates -> MatrixFilterStates

    +

    Inherited methods


    -

    Method new()

    +

    +
    +
    +

    Method new() +

    +

    Initialize MatrixFilterStates object

    Initialize MatrixFilterStates object

    -

    Initialize MatrixFilterStates object

    -

    Usage

    -

    MatrixFilterStates$new(input_dataname, output_dataname, datalabel)

    +
    +

    Usage +

    +

    +
    +
    MatrixFilterStates$new(input_dataname, output_dataname, datalabel)
    +

    +
    -

    Arguments

    -

    input_dataname
    +

    Arguments +

    +

    +
    +
    +
    input_dataname

    (character(1) or name or call)
    name of the data used on lhs of the expression specified to the function argument attached to this FilterStates.

    @@ -130,74 +172,135 @@

    Arguments
    -

    Method format()

    -

    Returns the formatted string representing this MatrixFilterStates object.

    -

    Usage

    -

    MatrixFilterStates$format(indent = 0)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns the formatted string representing this MatrixFilterStates object.

    +
    +

    Usage +

    +

    +
    +
    MatrixFilterStates$format(indent = 0)
    +

    +
    -

    Arguments

    -

    indent
    +

    Arguments +

    +

    +
    +
    +
    indent

    (numeric(1)) the number of spaces before each line of the representation

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    character(1) the formatted string

    -


    -

    Method server()

    -

    Server module

    -

    Usage

    -

    MatrixFilterStates$server(id)

    +
    +

    +
    +
    +

    Method server() +

    +

    Server module

    +
    +

    Usage +

    +

    +
    +
    MatrixFilterStates$server(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    an ID string that corresponds with the ID used to call the module's UI function.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    moduleServer function which returns NULL

    -


    +

    +
    +
    +

    Method get_filter_state() +

    Returns active FilterState objects.

    Gets all active filters from this dataset in form of the nested list. -The output list can be used as input to self$set_filter_state.

    -

    Usage

    -

    MatrixFilterStates$get_filter_state()

    +The output list can be used as input to self$set_filter_state.

    +
    +

    Usage +

    +

    +
    +
    MatrixFilterStates$get_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    list containing list with selected values for each FilterState.

    -


    -

    Method set_filter_state()

    -

    Sets a filter state

    -

    Usage

    -

    MatrixFilterStates$set_filter_state(data, state, ...)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Sets a filter state

    +
    +

    Usage +

    +

    +
    +
    MatrixFilterStates$set_filter_state(data, state, ...)
    +

    +
    -

    Arguments

    -

    data
    +

    Arguments +

    +

    +
    +
    +
    data

    (matrix)
    data which are supposed to be filtered.

    @@ -213,43 +316,77 @@

    Arguments -

    Returns

    +

    Returns +

    NULL

    -


    -

    Method remove_filter_state()

    -

    Remove a variable from the ReactiveQueue and its corresponding UI element.

    -

    Usage

    -

    MatrixFilterStates$remove_filter_state(element_id)

    +
    +

    +
    +
    +

    Method remove_filter_state() +

    +

    Remove a variable from the ReactiveQueue and its corresponding UI element.

    +
    +

    Usage +

    +

    +
    +
    MatrixFilterStates$remove_filter_state(element_id)
    +

    +
    -

    Arguments

    -

    element_id
    +

    Arguments +

    +

    +
    +
    +
    element_id

    (character(1))
    name of ReactiveQueue element.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL

    -


    -

    Method ui_add_filter_state()

    -

    Shiny UI module to add filter variable

    -

    Usage

    -

    MatrixFilterStates$ui_add_filter_state(id, data)

    +
    +

    +
    +
    +

    Method ui_add_filter_state() +

    +

    Shiny UI module to add filter variable

    +
    +

    Usage +

    +

    +
    +
    MatrixFilterStates$ui_add_filter_state(id, data)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    id of shiny module

    @@ -259,26 +396,43 @@

    Arguments -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_add_filter_state()

    +
    +

    +
    +
    +

    Method srv_add_filter_state() +

    Shiny server module to add filter variable

    Module controls available choices to select as a filter variable. Selected filter variable is being removed from available choices. -Removed filter variable gets back to available choices.

    -

    Usage

    -

    MatrixFilterStates$srv_add_filter_state(id, data, ...)

    +Removed filter variable gets back to available choices.

    +
    +

    Usage +

    +

    +
    +
    MatrixFilterStates$srv_add_filter_state(id, data, ...)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    an ID string that corresponds with the ID used to call the module's UI function.

    @@ -292,27 +446,46 @@

    Arguments -

    Returns

    +

    Returns +

    moduleServer function which returns NULL

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    MatrixFilterStates$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    MatrixFilterStates$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -320,17 +493,19 @@

    Arguments

    + +
    + +
    - - + + diff --git a/reference/Queue.html b/reference/Queue.html index 4f0b15515..485558caa 100644 --- a/reference/Queue.html +++ b/reference/Queue.html @@ -1,12 +1,28 @@ - - + + + + + +R6 Class - A First-In-First-Out Abstract Data Type — Queue • teal.slice +R6 Class - A First-In-First-Out Abstract Data Type — Queue • teal.slice + + + + + + + + + + Skip to contents @@ -22,7 +38,8 @@ + + + -
    + +
    @@ -82,12 +104,15 @@
    -

    Methods

    +

    Methods +

    -

    Public methods

    +

    Public methods +

    -


    -

    Method push()

    -

    Adds another element to this queue.

    -

    Usage

    -

    Queue$push(new_elements)

    + +
    +

    +
    +
    +

    Method push() +

    +

    Adds another element to this queue.

    +
    +

    Usage +

    +

    +
    +
    Queue$push(new_elements)
    +

    +
    -

    Arguments

    -

    new_elements
    +

    Arguments +

    +

    +
    +
    +
    new_elements

    the elements to be added to this queue

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    invisibly self

    -


    -

    Method pop()

    +
    +

    +
    +
    +

    Method pop() +

    Returns the first added element to this queue and removes it -from this queue.

    -

    Usage

    -

    Queue$pop()

    +from this queue.

    +
    +

    Usage +

    +

    +
    +
    Queue$pop()
    +

    +
    -

    Returns

    +

    Returns +

    the first added element to this queue or NULL if this queue is empty

    -


    -

    Method empty()

    -

    Removes all elements from this queue.

    -

    Usage

    -

    Queue$empty()

    +
    +

    +
    +
    +

    Method empty() +

    +

    Removes all elements from this queue.

    +
    +

    Usage +

    +

    +
    +
    Queue$empty()
    +

    +
    -

    Returns

    +

    Returns +

    invisibly self

    -


    -

    Method size()

    -

    Returns the number of elements in this queue.

    -

    Usage

    -

    Queue$size()

    +
    +

    +
    +
    +

    Method size() +

    +

    Returns the number of elements in this queue.

    +
    +

    Usage +

    +

    +
    +
    Queue$size()
    +

    +
    -

    Returns

    +

    Returns +

    the number of elements in this queue

    -


    -

    Method get()

    +
    +

    +
    +
    +

    Method get() +

    Returns an array of elements in this queue. The order of elements is chronological: -the first elements in the returned array is the oldest element added to this queue.

    -

    Usage

    -

    Queue$get(reversed = FALSE)

    +the first elements in the returned array is the oldest element added to this queue.

    +
    +

    Usage +

    +

    +
    +
    Queue$get(reversed = FALSE)
    +

    +
    -

    Arguments

    -

    reversed
    +

    Arguments +

    +

    +
    +
    +
    reversed

    (logical)
    if TRUE then returns the First-In-First-Out order; otherwise returns the Last-In-First-Out order. Default: FALSE

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    the array of elements in this queue

    -


    -

    Method remove()

    +
    +

    +
    +
    +

    Method remove() +

    Removes the eldest occurrence of elements from this queue. Relies on implicit -conversions of R types to compare a removed element with elements in this queue.

    -

    Usage

    -

    Queue$remove(elements)

    +conversions of R types to compare a removed element with elements in this queue.

    +
    +

    Usage +

    +

    +
    +
    Queue$remove(elements)
    +

    +
    -

    Arguments

    -

    elements
    +

    Arguments +

    +

    +
    +
    +
    elements

    the elements to remove from this queue

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    invisibly self

    -


    -

    Method print()

    -

    Prints this queue.

    -

    Usage

    -

    Queue$print(...)

    +
    +

    +
    +
    +

    Method print() +

    +

    Prints this queue.

    +
    +

    Usage +

    +

    +
    +
    Queue$print(...)
    +

    +
    -

    Arguments

    -

    ...
    +

    Arguments +

    +

    +
    +
    +
    ...

    the additional arguments to this method, ignored

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    invisibly self

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    Queue$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    Queue$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -237,17 +380,19 @@

    Arguments

    + +
    + +
    - - + + diff --git a/reference/RangeFilterState.html b/reference/RangeFilterState.html index 10f5c589a..ffaddecd8 100644 --- a/reference/RangeFilterState.html +++ b/reference/RangeFilterState.html @@ -1,10 +1,26 @@ - -FilterState object for numeric variable — RangeFilterState • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + + -
    + +
    @@ -79,7 +102,8 @@
    -

    Value

    +

    Value +

    invisibly NULL

    @@ -87,21 +111,26 @@

    Value

    -

    Note

    +

    Note +

    Casts the passed object to numeric before validating the input making it possible to pass any object coercible to numeric to this method.

    -

    Super class

    +

    Super class +

    teal.slice::FilterState -> RangeFilterState

    +

    Inherited methods


    -

    Method new()

    -

    Initialize a FilterState object

    -

    Usage

    -

    RangeFilterState$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterState object

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$new(
       x,
       varname,
       varlabel = character(0),
       input_dataname = NULL,
       extract_type = character(0)
    -)

    +)
    +

    +
    -


    -

    Method format()

    -

    Returns a formatted string representing this LogicalFilterState.

    -

    Usage

    -

    RangeFilterState$format(indent = 0)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns a formatted string representing this LogicalFilterState.

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$format(indent = 0)
    +

    +
    -

    Arguments

    -

    indent
    +

    Arguments +

    +

    +
    +
    +
    indent

    (numeric(1)) the number of spaces before after each new line character of the formatted string. Default: 0

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    character(1) the formatted string

    -


    -

    Method is_any_filtered()

    -

    Answers the question of whether the current settings and values selected actually filters out any values.

    -

    Usage

    -

    RangeFilterState$is_any_filtered()

    +
    +

    +
    +
    +

    Method is_any_filtered() +

    +

    Answers the question of whether the current settings and values selected actually filters out any values.

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$is_any_filtered()
    +

    +
    -

    Returns

    +

    Returns +

    logical scalar

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection. For this class returned call looks like <varname> >= <min value> & <varname> <= <max value> with -optional is.na(<varname>) and is.finite(<varname>).

    -

    Usage

    -

    RangeFilterState$get_call()

    +optional is.na(<varname>) and is.finite(<varname>).

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$get_call()
    +

    +
    -

    Returns

    +

    Returns +

    (call)

    -


    -

    Method get_keep_inf()

    -

    Returns current keep_inf selection

    -

    Usage

    -

    RangeFilterState$get_keep_inf()

    +
    +

    +
    +
    +

    Method get_keep_inf() +

    +

    Returns current keep_inf selection

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$get_keep_inf()
    +

    +
    -

    Returns

    +

    Returns +

    (logical(1))

    -


    -

    Method get_state()

    -

    Returns the filtering state.

    -

    Usage

    -

    RangeFilterState$get_state()

    +
    +

    +
    +
    +

    Method get_state() +

    +

    Returns the filtering state.

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$get_state()
    +

    +
    -

    Returns

    -

    list containing values taken from the reactive fields:

    • selected (numeric(2)) range of the filter.

    • +

      Returns +

      +

      list containing values taken from the reactive fields:

      +
        +
      • selected (numeric(2)) range of the filter.

      • keep_na (logical(1)) whether NA should be kept.

      • keep_inf (logical(1)) whether Inf should be kept. UI Module for RangeFilterState. This UI element contains two values for min and max of the range and two checkboxes whether to keep the NA or Inf values.

      • -
    + +
    -


    -

    Method ui()

    +
    +

    +
    +
    +

    Method ui() +

    -

    Usage

    -

    RangeFilterState$ui(id)

    +

    Usage +

    +

    +
    +
    RangeFilterState$ui(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    id of shiny element

    -

    +
    +

    +
    -


    -

    Method server()

    -

    Server module

    -

    Usage

    -

    RangeFilterState$server(id)

    +
    +

    +
    +
    +

    Method server() +

    +

    Server module

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$server(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    an ID string that corresponds with the ID used to call the module's UI function.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    moduleServer function which returns NULL

    -


    -

    Method set_keep_inf()

    -

    Set if Inf should be kept

    -

    Usage

    -

    RangeFilterState$set_keep_inf(value)

    +
    +

    +
    +
    +

    Method set_keep_inf() +

    +

    Set if Inf should be kept

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$set_keep_inf(value)
    +

    +
    -

    Arguments

    -

    value
    +

    Arguments +

    +

    +
    +
    +
    value

    (logical(1))
    Value(s) which come from the filter selection. Value is set in server modules after selecting check-box-input in the shiny interface. Values are set to private$keep_inf which is reactive.

    -

    +
    +

    +
    -


    -

    Method set_keep_inf_reactive()

    -

    Set if Inf should be kept when passing filters using set_filter_state

    -

    Usage

    -

    RangeFilterState$set_keep_inf_reactive(value)

    +
    +

    +
    +
    +

    Method set_keep_inf_reactive() +

    +

    Set if Inf should be kept when passing filters using set_filter_state

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$set_keep_inf_reactive(value)
    +

    +
    -

    Arguments

    -

    value
    +

    Arguments +

    +

    +
    +
    +
    value

    (logical(1))
    Value(s) which come from the filter set by the user. Value is set in server modules after setting the filters using set_filter_state. Values are set to private$keep_inf_reactive which is reactive.

    -

    +
    +

    +
    -


    -

    Method set_state()

    -

    Set state

    -

    Usage

    -

    RangeFilterState$set_state(state)

    +
    +

    +
    +
    +

    Method set_state() +

    +

    Set state

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$set_state(state)
    +

    +
    -

    Arguments

    -

    state
    -

    (list)
    -contains fields relevant for a specific class

    • selected defines initial selection

    • +

      Arguments +

      +

      +
      +
      +
      state
      +
      +

      (list)
      +contains fields relevant for a specific class

      +
        +
      • selected defines initial selection

      • keep_na (logical) defines whether to keep or remove NA values

      • keep_inf (logical) defines whether to keep or remove Inf values

      • -
      +
    +
    -

    +

    +

    +
    -


    -

    Method set_state_reactive()

    -

    Set state when using set_filter_state

    -

    Usage

    -

    RangeFilterState$set_state_reactive(state)

    +
    +

    +
    +
    +

    Method set_state_reactive() +

    +

    Set state when using set_filter_state

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$set_state_reactive(state)
    +

    +
    -

    Arguments

    -

    state
    -

    (list)
    -contains fields relevant for a specific class

    • selected defines initial selection

    • +

      Arguments +

      +

      +
      +
      +
      state
      +
      +

      (list)
      +contains fields relevant for a specific class

      +
        +
      • selected defines initial selection

      • keep_na (logical) defines whether to keep or remove NA values

      • keep_inf (logical) defines whether to keep or remove Inf values

      • -
      +
    +
    -

    +

    +

    +
    -


    -

    Method set_selected()

    -

    Sets the selected values of this RangeFilterState.

    -

    Usage

    -

    RangeFilterState$set_selected(value)

    +
    +

    +
    +
    +

    Method set_selected() +

    +

    Sets the selected values of this RangeFilterState.

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$set_selected(value)
    +

    +
    -

    Arguments

    -

    value
    +

    Arguments +

    +

    +
    +
    +
    value

    (numeric(2)) the two-elements array of the lower and upper bound of the selected range. Must not contain NA values.

    -

    +
    +

    +
    -

    Examples

    -

    filter <- teal.slice:::RangeFilterState$new(c(1, 2, 3, 4), varname = "name")
    -filter$set_selected(c(2, 3))

    +

    Examples +

    +

    +
    +
    filter <- teal.slice:::RangeFilterState$new(c(1, 2, 3, 4), varname = "name")
    +filter$set_selected(c(2, 3))
    +

    +
    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    RangeFilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -410,7 +666,8 @@

    Arguments -

    Examples

    +

    Examples +

    filter_state <- teal.slice:::RangeFilterState$new(
       c(NA, Inf, seq(1:10)),
       varname = "x",
    @@ -435,17 +692,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/reference/ReactiveQueue.html b/reference/ReactiveQueue.html index 42a165338..773575803 100644 --- a/reference/ReactiveQueue.html +++ b/reference/ReactiveQueue.html @@ -1,10 +1,26 @@ - -Reactive extension of Queue class — ReactiveQueue • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + + -
    + +
    @@ -79,68 +101,117 @@
    -

    Super class

    +

    Super class +

    teal.slice::Queue -> ReactiveQueue

    -

    Methods

    +

    Methods +

    Inherited methods +
    +

    Inherited methods


    -

    Method new()

    -

    Initializes ReactiveQueue by setting empty reactiveVal

    -

    Usage

    -

    +

    +
    +
    +

    Method new() +

    +

    Initializes ReactiveQueue by setting empty reactiveVal

    +
    +

    Usage +

    +

    +
    + +

    +
    -


    -

    Method get()

    -

    Get queue

    -

    Usage

    -

    ReactiveQueue$get(reversed = FALSE)

    +
    +

    +
    +
    +

    Method get() +

    +

    Get queue

    +
    +

    Usage +

    +

    +
    +
    ReactiveQueue$get(reversed = FALSE)
    +

    +
    -

    Arguments

    -

    reversed
    +

    Arguments +

    +

    +
    +
    +
    reversed

    (logical(1))
    whether order of elements in the queue should be reversed. FALSE by default

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    values stored in the queue

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    ReactiveQueue$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    ReactiveQueue$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -148,17 +219,19 @@

    Arguments

    + +
    + +
    - - + + diff --git a/reference/SEFilterStates.html b/reference/SEFilterStates.html index b442479bf..bf3c4fa95 100644 --- a/reference/SEFilterStates.html +++ b/reference/SEFilterStates.html @@ -1,8 +1,24 @@ - -SEFilterStates — SEFilterStates • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + + -
    + +
    @@ -76,16 +98,20 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterStates -> SEFilterStates

    +

    Inherited methods


    -

    Method new()

    +

    +
    +
    +

    Method new() +

    +

    Initialize SEFilterStates object

    Initialize SEFilterStates object

    -

    Initialize SEFilterStates object

    -

    Usage

    -

    SEFilterStates$new(input_dataname, output_dataname, datalabel)

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$new(input_dataname, output_dataname, datalabel)
    +

    +
    -

    Arguments

    -

    input_dataname
    +

    Arguments +

    +

    +
    +
    +
    input_dataname

    (character(1) or name or call)
    name of the data used on lhs of the expression specified to the function argument attached to this FilterStates.

    @@ -130,76 +172,137 @@

    Arguments
    -

    Method format()

    -

    Returns the formatted string representing this MAEFilterStates object.

    -

    Usage

    -

    SEFilterStates$format(indent = 0)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns the formatted string representing this MAEFilterStates object.

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$format(indent = 0)
    +

    +
    -

    Arguments

    -

    indent
    +

    Arguments +

    +

    +
    +
    +
    indent

    (numeric(1)) the number of spaces before each line of the representation

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    character(1) the formatted string

    -


    -

    Method server()

    -

    Server module

    -

    Usage

    -

    SEFilterStates$server(id)

    +
    +

    +
    +
    +

    Method server() +

    +

    Server module

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$server(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    an ID string that corresponds with the ID used to call the module's UI function.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    moduleServer function which returns NULL

    -


    +

    +
    +
    +

    Method get_filter_state() +

    Gets the reactive values from the active FilterState objects.

    Gets all active filters from this dataset in form of the nested list. -The output list is a compatible input to self$set_filter_state.

    -

    Usage

    -

    SEFilterStates$get_filter_state()

    +The output list is a compatible input to self$set_filter_state.

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$get_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    list containing one or two lists depending on the number of ReactiveQueue object (I.e. if rowData and colData exist). Each list contains elements number equal to number of active filter variables.

    -


    -

    Method set_filter_state()

    -

    Set filter state

    -

    Usage

    -

    SEFilterStates$set_filter_state(data, state, ...)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Set filter state

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$set_filter_state(data, state, ...)
    +

    +
    -

    Arguments

    -

    data
    +

    Arguments +

    +

    +
    +
    +
    data

    (SummarizedExperiment)
    data which are supposed to be filtered.

    @@ -216,43 +319,77 @@

    Arguments -

    Returns

    +

    Returns +

    NULL

    -


    -

    Method remove_filter_state()

    -

    Remove a variable from the ReactiveQueue and its corresponding UI element.

    -

    Usage

    -

    SEFilterStates$remove_filter_state(element_id)

    +
    +

    +
    +
    +

    Method remove_filter_state() +

    +

    Remove a variable from the ReactiveQueue and its corresponding UI element.

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$remove_filter_state(element_id)
    +

    +
    -

    Arguments

    -

    element_id
    +

    Arguments +

    +

    +
    +
    +
    element_id

    (character(1))
    name of ReactiveQueue element.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL

    -


    -

    Method ui_add_filter_state()

    -

    Shiny UI module to add filter variable

    -

    Usage

    -

    SEFilterStates$ui_add_filter_state(id, data)

    +
    +

    +
    +
    +

    Method ui_add_filter_state() +

    +

    Shiny UI module to add filter variable

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$ui_add_filter_state(id, data)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    id of shiny module

    @@ -264,29 +401,46 @@

    Arguments -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_add_filter_state()

    +
    +

    +
    +
    +

    Method srv_add_filter_state() +

    Shiny server module to add filter variable

    Module controls available choices to select as a filter variable. Selected filter variable is being removed from available choices. Removed filter variable gets back to available choices. This module unlike other FilterStates classes manages two sets of filter variables - one for colData and another for -rowData.

    -

    Usage

    -

    SEFilterStates$srv_add_filter_state(id, data, ...)

    +rowData.

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$srv_add_filter_state(id, data, ...)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    an ID string that corresponds with the ID used to call the module's UI function.

    @@ -302,27 +456,46 @@

    Arguments -

    Returns

    +

    Returns +

    moduleServer function which returns NULL

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    SEFilterStates$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -330,17 +503,19 @@

    Arguments

    + +
    + +
    - - + + diff --git a/reference/call_check_parse_varname.html b/reference/call_check_parse_varname.html index f1a8be230..ace91c784 100644 --- a/reference/call_check_parse_varname.html +++ b/reference/call_check_parse_varname.html @@ -1,8 +1,24 @@ - -Checks varname argument and convert to call — call_check_parse_varname • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + + -
    + +
    @@ -75,30 +97,36 @@
    -

    Usage

    +

    Usage +

    call_check_parse_varname(varname)
    -

    Arguments

    -
    varname
    +

    Arguments +

    +
    +
    varname

    (name, call or character(1))
    name of the variable

    -
    +

    +

    + +
    + +
    - - + + diff --git a/reference/call_condition_choice.html b/reference/call_condition_choice.html index 3499fe78b..c52fd199c 100644 --- a/reference/call_condition_choice.html +++ b/reference/call_condition_choice.html @@ -1,8 +1,24 @@ - -Choices condition call — call_condition_choice • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + + -
    + +
    @@ -75,32 +97,41 @@
    -

    Usage

    +

    Usage +

    call_condition_choice(varname, choices)
    -

    Arguments

    -
    varname
    +

    Arguments +

    +
    +
    varname

    (name, call or character(1))
    name of the variable

    choices
    -

    (vector)
    varname values to match using the == (single value) or +

    +

    (vector)
    varname values to match using the == (single value) or %in% (vector) condition. choices can be vector of any type -but for some output might be converted:

    • factor call is composed on choices converted to character

    • +but for some output might be converted:

      +
        +
      • factor call is composed on choices converted to character

      • Date call is composed on choices converted to character using format(choices)

      • POSIXct, POSIXlt Call is composed on choices converted to character using format(choices). One has to be careful here as formatted date-time variable might loose some precision (see format argument in format.POSIXlt) and output call could be insufficient for exact comparison. In this case one should specify varname = trunc(<varname>) and possibly convert choices to character)

      • -
    + + -
    +

    +
    -

    Value

    +

    Value +

    a call

    @@ -109,7 +140,8 @@

    Value

    -

    Examples

    +

    Examples +

    teal.slice:::call_condition_choice("SEX", choices = c(1, 2))
     #> SEX %in% c(1, 2)
     teal.slice:::call_condition_choice(as.name("SEX"), choices = "F")
    @@ -125,17 +157,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/reference/call_condition_logical.html b/reference/call_condition_logical.html index 247b212d1..b0c0efe70 100644 --- a/reference/call_condition_logical.html +++ b/reference/call_condition_logical.html @@ -1,8 +1,24 @@ - -logical variable condition call — call_condition_logical • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + + -
    + +
    @@ -75,13 +98,16 @@
    -

    Usage

    +

    Usage +

    call_condition_logical(varname, choice)
    -

    Arguments

    -
    varname
    +

    Arguments +

    +
    +
    varname

    (name or character(1))
    name of the variable

    @@ -90,9 +116,11 @@

    Arguments -

    Value

    +

    Value +

    call

    @@ -104,7 +132,8 @@

    Value

    -

    Examples

    +

    Examples +

    teal.slice:::call_condition_logical("event", choice = TRUE)
     #> event
     teal.slice:::call_condition_logical("event", choice = FALSE)
    @@ -112,17 +141,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/reference/call_condition_range.html b/reference/call_condition_range.html index e0d3ab1e2..1e57a6d6c 100644 --- a/reference/call_condition_range.html +++ b/reference/call_condition_range.html @@ -1,8 +1,24 @@ - -numeric range condition call — call_condition_range • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + + -
    + +
    @@ -75,13 +98,16 @@
    -

    Usage

    +

    Usage +

    call_condition_range(varname, range)
    -

    Arguments

    -
    varname
    +

    Arguments +

    +
    +
    varname

    (name or character(1))
    name of the variable

    @@ -90,9 +116,11 @@

    Arguments -

    Value

    +

    Value +

    call

    @@ -104,7 +132,8 @@

    Value

    -

    Examples

    +

    Examples +

    teal.slice:::call_condition_range("AGE", range = c(1, 2))
     #> AGE >= 1 & AGE <= 2
     teal.slice:::call_condition_range(as.name("AGE"), range = c(-1.2, 2.1))
    @@ -117,17 +146,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/reference/call_condition_range_date.html b/reference/call_condition_range_date.html index 717aa5d10..25508766f 100644 --- a/reference/call_condition_range_date.html +++ b/reference/call_condition_range_date.html @@ -1,8 +1,24 @@ - -Date range condition call — call_condition_range_date • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + + -
    + +
    @@ -75,13 +98,16 @@
    -

    Usage

    +

    Usage +

    call_condition_range_date(varname, range)
    -

    Arguments

    -
    varname
    +

    Arguments +

    +
    +
    varname

    (name or character(1))
    name of the variable

    @@ -90,9 +116,11 @@

    Arguments -

    Value

    +

    Value +

    a call

    @@ -101,7 +129,8 @@

    Value

    -

    Examples

    +

    Examples +

    teal.slice:::call_condition_range_date(
       as.name("date"),
       range = c(Sys.Date(), Sys.Date() + 1)
    @@ -110,17 +139,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/reference/call_condition_range_posixct.html b/reference/call_condition_range_posixct.html index 93a753fb7..a42de9d2f 100644 --- a/reference/call_condition_range_posixct.html +++ b/reference/call_condition_range_posixct.html @@ -1,8 +1,24 @@ - -POSIXct range condition call — call_condition_range_posixct • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + + -
    + +
    @@ -75,13 +98,16 @@
    -

    Usage

    +

    Usage +

    call_condition_range_posixct(varname, range, timezone = Sys.timezone())
    -

    Arguments

    -
    varname
    +

    Arguments +

    +
    +
    varname

    (name or character(1))
    name of the variable

    @@ -98,9 +124,11 @@

    ArgumentsSys.timezone() is used.

    -

    +

    +
    -

    Value

    +

    Value +

    a call

    @@ -109,7 +137,8 @@

    Value

    -

    Examples

    +

    Examples +

    teal.slice:::call_condition_range_posixct(
       varname = as.name("datetime"),
       range = c(Sys.time(), Sys.time() + 1),
    @@ -120,17 +149,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/reference/call_extract_array.html b/reference/call_extract_array.html index 0b0dd23ed..96362da41 100644 --- a/reference/call_extract_array.html +++ b/reference/call_extract_array.html @@ -1,8 +1,24 @@ - -Get call to subset and select array — call_extract_array • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + + -
    + +
    @@ -75,13 +97,16 @@
    -

    Usage

    +

    Usage +

    call_extract_array(dataname = ".", row = NULL, column = NULL, aisle = NULL)
    -

    Arguments

    -
    dataname
    +

    Arguments +

    +
    +
    dataname

    (character(1) or name)

    @@ -99,9 +124,11 @@

    Arguments -

    Value

    +

    Value +

    [ call with all conditions included

    @@ -113,7 +140,8 @@

    Value

    -

    Examples

    +

    Examples +

    teal.slice:::call_extract_array(
       dataname = "my_array",
       row = teal.slice:::call_condition_choice("my_array$SEX", "M"),
    @@ -129,17 +157,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/reference/call_extract_list.html b/reference/call_extract_list.html index a1d60d634..488300c70 100644 --- a/reference/call_extract_list.html +++ b/reference/call_extract_list.html @@ -1,8 +1,24 @@ - -Compose extract call with $ operator — call_extract_list • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + + -

    + +
    @@ -75,13 +97,16 @@
    -

    Usage

    +

    Usage +

    call_extract_list(dataname, varname, dollar = TRUE)
    -

    Arguments

    -
    dataname
    +

    Arguments +

    +
    +
    dataname

    (character(1) or name)
    name of the object

    @@ -95,16 +120,19 @@

    Arguments -

    Value

    +

    Value +

    $ or [[ call

    -

    Examples

    +

    Examples +

    teal.slice:::call_extract_list("ADSL", "SEX")
     #> ADSL$SEX
     teal.slice:::call_extract_list("ADSL", "named element")
    @@ -118,17 +146,19 @@ 

    Examples

    + +

    + +
    - - + + diff --git a/reference/call_extract_matrix.html b/reference/call_extract_matrix.html index 4d43cac67..55960fe3f 100644 --- a/reference/call_extract_matrix.html +++ b/reference/call_extract_matrix.html @@ -1,8 +1,24 @@ - -Get call to subset and select matrix — call_extract_matrix • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + + -
    + +
    @@ -75,13 +97,16 @@
    -

    Usage

    +

    Usage +

    call_extract_matrix(dataname = ".", row = NULL, column = NULL)
    -

    Arguments

    -
    dataname
    +

    Arguments +

    +
    +
    dataname

    (character(1) or name)

    @@ -94,9 +119,11 @@

    Arguments -

    Value

    +

    Value +

    [ call with all conditions included

    @@ -108,7 +135,8 @@

    Value

    -

    Examples

    +

    Examples +

    teal.slice:::call_extract_matrix(
       dataname = "my_array",
       row = teal.slice:::call_condition_choice("my_array$SEX", "M"),
    @@ -123,17 +151,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/reference/call_with_colon.html b/reference/call_with_colon.html index 8c1529030..dd73f1765 100644 --- a/reference/call_with_colon.html +++ b/reference/call_with_colon.html @@ -1,8 +1,24 @@ - -Create a call using a function in a given namespace — call_with_colon • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + + -
    + +
    @@ -75,13 +97,16 @@
    -

    Usage

    +

    Usage +

    call_with_colon(name, ..., unlist_args = list())
    -

    Arguments

    -
    name
    +

    Arguments +

    +
    +
    name

    character function name, possibly using namespace colon ::, also works with ::: (sometimes needed, but strongly discouraged)

    @@ -94,10 +119,12 @@

    Arguments -

    Examples

    +

    Examples +

    
     print_call_and_eval <- function(x) {
       eval(print(x))
    @@ -138,17 +165,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/reference/calls_combine_by.html b/reference/calls_combine_by.html index bff0f7005..809efbe4b 100644 --- a/reference/calls_combine_by.html +++ b/reference/calls_combine_by.html @@ -1,8 +1,24 @@ - -Combine calls by operator — calls_combine_by • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + + -
    + +

    @@ -75,13 +97,16 @@
    -

    Usage

    +

    Usage +

    calls_combine_by(operator, calls)
    -

    Arguments

    -
    operator
    +

    Arguments +

    +
    +
    operator

    (character(1) or name)
    name/symbol of the operator.

    @@ -90,9 +115,11 @@

    Arguments -

    Value

    +

    Value +

    call

    @@ -104,7 +131,8 @@

    Value

    -

    Examples

    +

    Examples +

    teal.slice:::calls_combine_by(
       "&",
       calls = list(
    @@ -118,17 +146,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/reference/check_ellipsis.html b/reference/check_ellipsis.html index 3518ad724..dcfaa05c9 100644 --- a/reference/check_ellipsis.html +++ b/reference/check_ellipsis.html @@ -1,12 +1,28 @@ - - + + + + + +Ensure the ellipsis, ..., in method arguments are empty — check_ellipsis • teal.slice +Ensure the ellipsis, ..., in method arguments are empty — check_ellipsis • teal.slice + + + + + + + + + + Skip to contents @@ -22,7 +38,8 @@ + + + -

    + +
    @@ -81,13 +103,16 @@
    -

    Usage

    +

    Usage +

    check_ellipsis(..., stop = FALSE, allowed_args = character(0))
    -

    Arguments

    -
    ...
    +

    Arguments +

    +
    +
    ...

    it should literally just be ...

    @@ -99,16 +124,19 @@

    Arguments -

    +

    +
    -

    Value

    +

    Value +

    NULL if ... is empty

    -

    Examples

    +

    Examples +

    method.class <- function(a, b, c, ...) {
       check_ellipsis(...)
     }
    @@ -118,17 +146,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/reference/check_in_range.html b/reference/check_in_range.html index 45cef9f69..a27ea8eb9 100644 --- a/reference/check_in_range.html +++ b/reference/check_in_range.html @@ -1,8 +1,24 @@ - -Check that a given range is valid — check_in_range • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + + -
    + +
    @@ -75,13 +97,16 @@
    -

    Usage

    +

    Usage +

    check_in_range(subinterval, range, pre_msg = "")
    -

    Arguments

    -
    subinterval
    +

    Arguments +

    +
    +
    subinterval

    (numeric or date)
    vector of length 2 to be compared against the full range.

    @@ -92,16 +117,19 @@

    Arguments -

    Value

    +

    Value +

    NULL if subinterval is a valid range or error with message otherwise.

    -

    Examples

    +

    Examples +

    if (FALSE) {
     check_in_range(c(3, 1), c(1, 3))
     check_in_range(c(0, 3), c(1, 3))
    @@ -113,17 +141,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/reference/check_in_subset.html b/reference/check_in_subset.html index b517ebdca..06c855a36 100644 --- a/reference/check_in_subset.html +++ b/reference/check_in_subset.html @@ -1,8 +1,24 @@ - -Check that one set is a subset of another — check_in_subset • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + + -
    + +
    @@ -75,13 +97,16 @@
    -

    Usage

    +

    Usage +

    check_in_subset(subset, choices, pre_msg = "")
    -

    Arguments

    -
    subset
    +

    Arguments +

    +
    +
    subset

    collection-like should be a subset of the second argument choices

    @@ -92,10 +117,12 @@

    Arguments -

    Examples

    +

    Examples +

    check_in_subset <- teal.slice:::check_in_subset
     check_in_subset(c("a", "b"), c("a", "b", "c"))
     if (FALSE) {
    @@ -106,17 +133,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/reference/check_simple_name.html b/reference/check_simple_name.html index b73456b9a..10f2149c5 100644 --- a/reference/check_simple_name.html +++ b/reference/check_simple_name.html @@ -1,14 +1,30 @@ - - + + + + + +Whether the variable name is good to use within Show R Code — check_simple_name • teal.slice +Whether the variable name is good to use within Show R Code — check_simple_name • teal.slice + + + + + + + + + + Skip to contents @@ -24,7 +40,8 @@ + + + -
    + +
    @@ -84,24 +106,30 @@
    -

    Usage

    +

    Usage +

    check_simple_name(name)
    -

    Arguments

    -
    name
    +

    Arguments +

    +
    +
    name

    character, single or vector name to check

    -
    +

    +
    -

    Note

    +

    Note +

    The suffix '_FILTERED' is reserved for filtered data and is not allowed in the dataset name.

    -

    Examples

    +

    Examples +

    teal.slice:::check_simple_name("aas2df")
     teal.slice:::check_simple_name("ADSL")
     teal.slice:::check_simple_name("ADSLmodified")
    @@ -118,17 +146,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/reference/choices_labeled.html b/reference/choices_labeled.html index 61f3d677a..12e382814 100644 --- a/reference/choices_labeled.html +++ b/reference/choices_labeled.html @@ -1,10 +1,26 @@ - -Set "<choice>:<label>" type of Names — choices_labeled • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + + -
    + +
    @@ -78,13 +100,16 @@
    -

    Usage

    +

    Usage +

    choices_labeled(choices, labels, subset = NULL, types = NULL)
    -

    Arguments

    -
    choices
    +

    Arguments +

    +
    +
    choices

    a character / numeric / logical vector

    @@ -102,31 +127,36 @@

    Arguments -

    Value

    +

    Value +

    a named character vector

    -

    Details

    +

    Details +

    If either choices or labels are factors, they are coerced to character. Duplicated elements from choices get removed.

    + +
    + +
    - - + + diff --git a/reference/data_choices_labeled.html b/reference/data_choices_labeled.html index 7c2a8a2f6..5e392bb26 100644 --- a/reference/data_choices_labeled.html +++ b/reference/data_choices_labeled.html @@ -1,8 +1,24 @@ - -Returns a choices_labeled object — data_choices_labeled • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + + -
    + +
    @@ -75,7 +97,8 @@
    -

    Usage

    +

    Usage +

    data_choices_labeled(
       data,
       choices,
    @@ -85,8 +108,10 @@ 

    Usage

    -

    Arguments

    -
    data
    +

    Arguments +

    +
    +
    data

    (data.frame, DFrame, list)
    where labels can be taken from in case when varlabels is not specified. data must be specified if varlabels is not specified.

    @@ -106,26 +131,30 @@

    Arguments -

    Value

    +

    Value +

    character(0) if choices are empty; a choices_labeled object otherwise

    + + + + - - + + diff --git a/reference/filter_state_api.html b/reference/filter_state_api.html index f76f424a5..c6a104df4 100644 --- a/reference/filter_state_api.html +++ b/reference/filter_state_api.html @@ -1,10 +1,26 @@ - -Managing FilteredData states — filter_state_api • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + + - + @@ -78,7 +100,8 @@
    -

    Usage

    +

    Usage +

    set_filter_state(datasets, filter)
     
     get_filter_state(datasets)
    @@ -89,35 +112,56 @@ 

    Usage

    -

    Arguments

    -
    datasets
    +

    Arguments +

    +
    +
    datasets

    (FilteredData)
    object to store filter state and filtered datasets, shared across modules. For more details see FilteredData

    filter
    -

    (list)
    +

    +

    (list)
    You can define filters that show when the app starts. List names should be named according to datanames passed to the data argument. In case of data.frame` the list should be composed as follows:

    -

    list(<dataname1> = list(<varname1> = ..., <varname2> = ...),
    +

    +
    +
    list(<dataname1> = list(<varname1> = ..., <varname2> = ...),
          <dataname2> = list(...),
          ...)
    -

    +
    +

    +

    For example, filters for variable Sepal.Length in iris can be specified as follows:

    -

    list(iris = list(Sepal.Length = list(selected = c(5.0, 7.0))))
    +

    +
    +
    list(iris = list(Sepal.Length = list(selected = c(5.0, 7.0))))
     # or
    -list(iris = list(Sepal.Length = c(5.0, 7.0)))

    +list(iris = list(Sepal.Length = c(5.0, 7.0)))
    +

    +

    In case developer would like to include NA and Inf values in the filtered dataset.

    -

    list(Species = list(selected = c(5.0, 7.0), keep_na = TRUE, keep_inf = TRUE))
    -list(Species = c(c(5.0, 7.0), NA, Inf))

    +

    +
    +
    list(Species = list(selected = c(5.0, 7.0), keep_na = TRUE, keep_inf = TRUE))
    +list(Species = c(c(5.0, 7.0), NA, Inf))
    +

    +

    To initialize with specific variable filter with all values on start, one can use

    -

    list(Species = list())

    -

    filter should be set with respect to the class of the column:

    • numeric: selected should be a two elements vector defining the range +

      +
      +
      list(Species = list())
      +

      +
      +

      filter should be set with respect to the class of the column:

      +
        +
      • numeric: selected should be a two elements vector defining the range of the filter.

      • Date: selected should be a two elements vector defining the date-range of the filter

      • @@ -131,7 +175,10 @@

        ArgumentsMultiAssayExperiment::ExperimentList()), filter list should be named in the following name.

        -

      list(
      +
    +

    +
    +
    list(
       <MAE dataname> = list(
         subjects = list(<column in colData> = ..., <column in colData> = ...),
         <experiment name> = list(
    @@ -141,20 +188,28 @@ 

    Arguments <column in colData of experiment> = ...) ) ) -)

    -

    filter is ignored if the app is restored from a bookmarked state.

    +) +

    +
    +

    filter is ignored if the app is restored from a bookmarked state.

    + -
    + +
    -

    Value

    +

    Value +

    -
    • set, remove and clear returns NULL

    • +
        +
      • set, remove and clear returns NULL

      • get returns named list of the same structure as described in filter argument.

      • -
    + +
    -

    Examples

    +

    Examples +

    utils::data(miniACC, package = "MultiAssayExperiment")
     
     datasets <- init_filtered_data(
    @@ -271,17 +326,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/reference/get_filter_expr.html b/reference/get_filter_expr.html index a765b1345..8ab152759 100644 --- a/reference/get_filter_expr.html +++ b/reference/get_filter_expr.html @@ -1,10 +1,26 @@ - -Gets filter expression for multiple datanames taking into account its order. — get_filter_expr • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + + - + @@ -78,39 +100,46 @@
    -

    Usage

    +

    Usage +

    get_filter_expr(datasets, datanames = datasets$datanames())
    -

    Arguments

    -
    datasets
    +

    Arguments +

    +
    +
    datasets

    (FilteredData)

    datanames

    (character) vector of dataset names

    -
    + +
    -

    Value

    +

    Value +

    (expression)

    + + + + - - + + diff --git a/reference/get_filterable_varnames.html b/reference/get_filterable_varnames.html index 8fb17feaf..6ca3ec3e5 100644 --- a/reference/get_filterable_varnames.html +++ b/reference/get_filterable_varnames.html @@ -1,10 +1,26 @@ - -Gets filterable variable names — get_filterable_varnames • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + + - + @@ -78,26 +100,32 @@
    -

    Usage

    +

    Usage +

    get_filterable_varnames(data)
    -

    Arguments

    -
    data
    +

    Arguments +

    +
    +
    data

    (object)
    the R object containing elements which class can be checked through vapply or apply.

    -
    + +
    -

    Value

    +

    Value +

    character the array of the matched element names

    -

    Examples

    +

    Examples +

    df <- data.frame(
       a = letters[1:3],
       b = 1:3,
    @@ -110,17 +138,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/reference/include_css_files.html b/reference/include_css_files.html index a5950508a..8781cfb57 100644 --- a/reference/include_css_files.html +++ b/reference/include_css_files.html @@ -1,12 +1,28 @@ - - + + + + + +Include CSS files from /inst/css/ package directory to application header — include_css_files • teal.slice +Include CSS files from /inst/css/ package directory to application header — include_css_files • teal.slice + + + + + + + + + + Skip to contents @@ -22,7 +38,8 @@ + + + - + @@ -81,35 +103,42 @@
    -

    Usage

    +

    Usage +

    include_css_files(pattern = "*")
    -

    Arguments

    -
    pattern
    +

    Arguments +

    +
    +
    pattern

    (character) pattern of files to be included

    -
    + +
    -

    Value

    +

    Value +

    HTML code that includes CSS files

    + + + + - - + + diff --git a/reference/index.html b/reference/index.html index 3bd677717..c43a98728 100644 --- a/reference/index.html +++ b/reference/index.html @@ -1,8 +1,22 @@ - -Function reference • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + + - + @@ -69,107 +89,146 @@
    -

    Teal filter-panel API

    +

    Teal filter-panel API +

    -

    Functions used initialize filter-panel and to modify its states.

    +

    +

    Functions used initialize filter-panel and to modify its states.

    -
    +
    +
    -
    +
    +
    init_filtered_data()
    -
    Initialize FilteredData
    -
    +
    Initialize FilteredData +
    +
    +
    +
    set_filter_state() get_filter_state() remove_filter_state() clear_filter_states()
    Managing FilteredData states
    -
    -

    Helpers

    + +
    +
    +

    Helpers +

    -

    Other useful functions for users and developers.

    +

    +

    Other useful functions for users and developers.

    -
    +
    +
    -
    +
    +
    choices_labeled()
    Set "<choice>:<label>" type of Names
    -
    +
    +
    +
    get_filter_expr()
    Gets filter expression for multiple datanames taking into account its order.
    -
    -

    For Developers

    + +
    +
    +

    For Developers +

    -

    Abstract and concrete classes used to build teal functionality.

    +

    +

    Abstract and concrete classes used to build teal functionality.

    -
    +
    +
    -

    R6 Classes

    -

    Abstract and concrete classes used to build teal functionality.

    +

    R6 Classes +

    +

    +

    Abstract and concrete classes used to build teal functionality.

    -
    +
    +
    -
    +
    +
    CDISCFilteredData
    Class to encapsulate relational filtered datasets with its parents.
    -
    +
    +
    +
    DefaultFilteredDataset
    The DefaultFilteredDataset R6 class
    -
    +
    +
    +
    FilteredData
    Class to encapsulate filtered datasets
    -
    +
    +
    +
    FilteredDataset
    -
    FilterStates R6 class
    -
    +
    +FilterStates R6 class
    +
    +
    +
    MAEFilteredDataset
    -
    MAEFilteredDataset R6 class
    -
    +
    +MAEFilteredDataset R6 class
    +
    +
    +
    Queue
    R6 Class - A First-In-First-Out Abstract Data Type
    -
    + + + + + + - - + + diff --git a/reference/init_filter_state.html b/reference/init_filter_state.html index cdf5e24e6..d3638fee8 100644 --- a/reference/init_filter_state.html +++ b/reference/init_filter_state.html @@ -1,8 +1,24 @@ - -Initializes FilterState — init_filter_state • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + + - +
    @@ -75,7 +98,8 @@
    -

    Usage

    +

    Usage +

    init_filter_state(
       x,
       varname,
    @@ -86,8 +110,10 @@ 

    Usage

    + +
    -

    Value

    +

    Value +

    FilterState object

    -

    Examples

    +

    Examples +

    filter_state <- teal.slice:::RangeFilterState$new(
       c(1:10, NA, Inf),
       varname = "x",
    @@ -157,17 +190,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/reference/init_filter_states.html b/reference/init_filter_states.html index 5e9969a0c..d434f3118 100644 --- a/reference/init_filter_states.html +++ b/reference/init_filter_states.html @@ -1,8 +1,24 @@ - -Initialize FilterStates object — init_filter_states • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + + - + @@ -75,7 +97,8 @@
    -

    Usage

    +

    Usage +

    init_filter_states(
       data,
       input_dataname,
    @@ -86,8 +109,10 @@ 

    Usage

    -

    Arguments

    -
    data
    +

    Arguments +

    +
    +
    data

    (data.frame, MultiAssayExperiment, SummarizedExperiment, matrix)
    the R object which subset function is applied on.

    @@ -112,10 +137,12 @@

    Arguments -

    Examples

    +

    Examples +

    df <- data.frame(
       character = letters,
       numeric = seq_along(letters),
    @@ -151,17 +178,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/reference/init_filtered_data.html b/reference/init_filtered_data.html index b869d6869..148ae1a65 100644 --- a/reference/init_filtered_data.html +++ b/reference/init_filtered_data.html @@ -1,8 +1,24 @@ - -Initialize FilteredData — init_filtered_data • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + + - +
    @@ -75,20 +98,27 @@
    -

    Usage

    +

    Usage +

    init_filtered_data(x, join_keys, code, cdisc, check)
    -

    Arguments

    -
    x
    -

    (named list or TealData) In case of TealData see teal.data::teal_data(). -If the list is provided, it should contain list(s) containing following fields:

    • dataset data object object supported by FilteredDataset.

    • +

      Arguments +

      +
      +
      x
      +
      +

      (named list or TealData) In case of TealData see teal.data::teal_data(). +If the list is provided, it should contain list(s) containing following fields:

      +
        +
      • dataset data object object supported by FilteredDataset.

      • metatada (optional) additional metadata attached to the dataset.

      • keys (optional) primary keys.

      • datalabel (optional) label describing the dataset.

      • parent (optional) which dataset is a parent of this one.

      • -
      +
    +
    join_keys
    @@ -106,10 +136,12 @@

    Arguments -

    Examples

    +

    Examples +

    library(shiny)
     datasets <- teal.slice::init_filtered_data(
       x = list(
    @@ -120,17 +152,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/reference/init_filtered_dataset.html b/reference/init_filtered_dataset.html index b9053d2d4..439358fb1 100644 --- a/reference/init_filtered_dataset.html +++ b/reference/init_filtered_dataset.html @@ -1,8 +1,24 @@ - -Initializes FilteredDataset — init_filtered_dataset • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + + - +
    @@ -75,7 +98,8 @@
    -

    Usage

    +

    Usage +

    init_filtered_dataset(
       dataset,
       dataname,
    @@ -86,8 +110,10 @@ 

    Usage

    -

    Arguments

    -
    dataset
    +

    Arguments +

    +
    +
    dataset

    (data.frame or MultiAssayExperiment)

    @@ -111,10 +137,12 @@

    Arguments -

    Examples

    +

    Examples +

    # DefaultFilteredDataset example
     iris_fd <- teal.slice:::init_filtered_dataset(
       iris,
    @@ -177,17 +205,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/reference/resolve_state.html b/reference/resolve_state.html index 272e169ee..07d8380d1 100644 --- a/reference/resolve_state.html +++ b/reference/resolve_state.html @@ -1,16 +1,32 @@ - - + + + + + +Resolve list of filter states — resolve_state • teal.slice +Resolve list of filter states — resolve_state • teal.slice + + + + + + + + + + Skip to contents @@ -26,7 +42,8 @@ + + + - + @@ -87,7 +109,8 @@
    -

    Usage

    +

    Usage +

    resolve_state(x)
     
     # S3 method for default
    @@ -101,19 +124,28 @@ 

    Usage

    -

    Arguments

    -
    x
    -

    (list,vector)
    +

    Arguments +

    +
    +
    x
    +
    +

    (list,vector)
    values of the variable used in filter. Depending on the FilterState type -list must contain these fields:

    • selected defines initial selection. See notes for more details

    • +list must contain these fields:

      +
        +
      • selected defines initial selection. See notes for more details

      • keep_na (logical) defines whether to keep or remove NA values

      • keep_inf (logical) defines whether to keep or remove Inf values

      • -

      If vector is provided then keep_na and keep_inf can be specified -adding NA and Inf to the selection vector.

    + +

    If vector is provided then keep_na and keep_inf can be specified +adding NA and Inf to the selection vector.

    +
    -
    + +
    -

    Value

    +

    Value +

    list containing selected, keep_na and keep_inf

    @@ -121,23 +153,28 @@

    Value

    -

    Note

    +

    Note +

    The value of the x$selected needs to be modified according to the type of the passed filter_state.

    -

    Examples

    +

    Examples +

    teal.slice:::resolve_state(list(c(1, 2), keep_na = FALSE, keep_inf = TRUE))
     #> $selected
     #> [1] 1 2
    @@ -160,17 +197,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/reference/set_state.html b/reference/set_state.html index 006ba5faf..87f053238 100644 --- a/reference/set_state.html +++ b/reference/set_state.html @@ -1,18 +1,34 @@ - -Set state of FilterState — set_state • teal.slice +Set state of FilterState — set_state • teal.slice + + + + + + + + + + Skip to contents @@ -28,7 +44,8 @@ + + + - +
    -

    Set state of FilterState. Function can change states in FilterState in two ways:

    • changing reactive state fields which triggers observers in the FilterState.

    • +

      Set state of FilterState. Function can change states in FilterState in two ways:

      +
        +
      • changing reactive state fields which triggers observers in the FilterState.

      • change state directly.

      • -

      For more, please see section "Modifying state" in FilterState

      +
    +

    For more, please see section "Modifying state" in FilterState

    -

    Usage

    +

    Usage +

    set_state(x, value, is_reactive = shiny::isRunning())
    -

    Arguments

    -
    x
    +

    Arguments +

    +
    +
    x

    (vector)
    values of the variable used in filter

    @@ -103,13 +132,19 @@

    Arguments -

    Value

    +

    Value +

    invisible NULL

    @@ -118,17 +153,19 @@

    Value

    + +
    + + - - + + diff --git a/reference/teal.slice-package.html b/reference/teal.slice-package.html index b45109493..4eaf3c46f 100644 --- a/reference/teal.slice-package.html +++ b/reference/teal.slice-package.html @@ -1,8 +1,24 @@ - -teal.slice: Interactive Exploration of Clinical Trials Data — teal.slice-package • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + + - + @@ -76,28 +98,37 @@
    -

    Author

    +

    Author +

    Maintainer: Dawid Kaledkowski dawid.kaledkowski@roche.com

    -

    Authors:

    + +

    Other contributors:

    +
      +
    • F. Hoffmann-La Roche AG [copyright holder, funder]

    • +
    + - + + + + - - + + diff --git a/reference/topological_sort.html b/reference/topological_sort.html index 60e8d7c42..aa3b8991b 100644 --- a/reference/topological_sort.html +++ b/reference/topological_sort.html @@ -1,10 +1,26 @@ - -Topological graph sort — topological_sort • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + + - + @@ -78,23 +100,29 @@
    -

    Usage

    +

    Usage +

    topological_sort(graph)
    -

    Arguments

    -
    graph
    +

    Arguments +

    +
    +
    graph

    (named list) list with node vector elements

    -
    + +
    -

    Details

    +

    Details +

    Implementation of Kahn algorithm with a modification to maintain the order of input elements.

    -

    Examples

    +

    Examples +

    teal.slice:::topological_sort(list(A = c(), B = c("A"), C = c("B"), D = c("A")))
     #> [[1]]
     #> [1] "A"
    @@ -137,17 +165,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/reference/validate_dataset_args.html b/reference/validate_dataset_args.html index b54f4d2c4..6a2eac702 100644 --- a/reference/validate_dataset_args.html +++ b/reference/validate_dataset_args.html @@ -1,8 +1,24 @@ - -Validate dataset arguments — validate_dataset_args • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + + - + @@ -75,13 +97,16 @@
    -

    Usage

    +

    Usage +

    validate_dataset_args(dataset_args, dataname, allowed_parent = FALSE)
    -

    Arguments

    -
    dataset_args
    +

    Arguments +

    +
    +
    dataset_args

    (list)
    containing the arguments except (dataname) needed by init_filtered_dataset

    @@ -96,26 +121,30 @@

    Arguments -

    Value

    +

    Value +

    (NULL or throws an error)

    + + + + - - + + diff --git a/reference/variable_types.html b/reference/variable_types.html index d1fcf8e33..7c656c37c 100644 --- a/reference/variable_types.html +++ b/reference/variable_types.html @@ -1,8 +1,24 @@ - -Get classes of selected columns from dataset — variable_types • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + + - + @@ -75,13 +97,16 @@
    -

    Usage

    +

    Usage +

    variable_types(data, columns = NULL)
    -

    Arguments

    -
    data
    +

    Arguments +

    +
    +
    data

    (data.frame) data to determine variable types from

    @@ -89,9 +114,11 @@

    Arguments -

    Value

    +

    Value +

    (atomic vector of character) classes of columns from provided data

    @@ -100,7 +127,8 @@

    Value

    -

    Examples

    +

    Examples +

    teal.slice:::variable_types(
       data.frame(
         x = 1:3, y = factor(c("a", "b", "a")), z = c("h1", "h2", "h3"),
    @@ -129,17 +157,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/release-candidate/404.html b/release-candidate/404.html index d78b51333..465f0b5da 100644 --- a/release-candidate/404.html +++ b/release-candidate/404.html @@ -1,5 +1,4 @@ - - + @@ -50,22 +49,7 @@ - - + - + + diff --git a/release-candidate/CODE_OF_CONDUCT.html b/release-candidate/CODE_OF_CONDUCT.html index ce1ca96bd..5676a050f 100644 --- a/release-candidate/CODE_OF_CONDUCT.html +++ b/release-candidate/CODE_OF_CONDUCT.html @@ -1,8 +1,22 @@ - -Contributor Covenant Code of Conduct • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -80,65 +100,80 @@
    -

    Our Pledge

    +

    Our Pledge +

    We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.

    We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.

    -

    Our Standards

    +

    Our Standards +

    Examples of behavior that contributes to a positive environment for our community include:

    -
    • Demonstrating empathy and kindness toward other people
    • +
        +
      • Demonstrating empathy and kindness toward other people
      • Being respectful of differing opinions, viewpoints, and experiences
      • Giving and gracefully accepting constructive feedback
      • Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
      • Focusing on what is best not just for us as individuals, but for the overall community
      • -

      Examples of unacceptable behavior include:

      -
      • The use of sexualized language or imagery, and sexual attention or advances of any kind
      • +
      +

      Examples of unacceptable behavior include:

      +
        +
      • The use of sexualized language or imagery, and sexual attention or advances of any kind
      • Trolling, insulting or derogatory comments, and personal or political attacks
      • Public or private harassment
      • Publishing others’ private information, such as a physical or email address, without their explicit permission
      • Other conduct which could reasonably be considered inappropriate in a professional setting
      • -
    + +
    -

    Enforcement Responsibilities

    +

    Enforcement Responsibilities +

    Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.

    Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.

    -

    Scope

    +

    Scope +

    This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.

    -

    Enforcement

    +

    Enforcement +

    Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [INSERT CONTACT METHOD]. All complaints will be reviewed and investigated promptly and fairly.

    All community leaders are obligated to respect the privacy and security of the reporter of any incident.

    -

    Enforcement Guidelines

    +

    Enforcement Guidelines +

    Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:

    -

    1. Correction

    +

    1. Correction +

    Community Impact: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.

    Consequence: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.

    -

    2. Warning

    +

    2. Warning +

    Community Impact: A violation through a single incident or series of actions.

    Consequence: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.

    -

    3. Temporary Ban

    +

    3. Temporary Ban +

    Community Impact: A serious violation of community standards, including sustained inappropriate behavior.

    Consequence: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.

    -

    4. Permanent Ban

    +

    4. Permanent Ban +

    Community Impact: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.

    Consequence: A permanent ban from any sort of public interaction within the community.

    -

    Attribution

    +

    Attribution +

    This Code of Conduct is adapted from the Contributor Covenant, version 2.1, available at https://www.contributor-covenant.org/version/2/1/code_of_conduct.html.

    Community Impact Guidelines were inspired by Mozilla’s code of conduct enforcement ladder.

    For answers to common questions about this code of conduct, see the FAQ at https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.

    @@ -146,17 +181,19 @@

    Attribution

    + + + + - - + + diff --git a/release-candidate/CONTRIBUTING.html b/release-candidate/CONTRIBUTING.html index 3690a5c9a..c61674ed4 100644 --- a/release-candidate/CONTRIBUTING.html +++ b/release-candidate/CONTRIBUTING.html @@ -1,8 +1,22 @@ - -Contribution Guidelines • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -82,7 +102,8 @@

    🙏 Thank you for taking the time to contribute!

    Your input is deeply valued, whether an issue, a pull request, or even feedback, regardless of size, content or scope.

    -

    Table of contents

    +

    Table of contents +

    👶 Getting started

    📔 Code of Conduct

    🗃 License

    @@ -93,38 +114,47 @@

    Table of contents❓ Questions

    -

    Getting started

    +

    Getting started +

    Please refer the project documentation for a brief introduction. Please also see other articles within the project documentation for additional information.

    -

    Code of Conduct

    +

    Code of Conduct +

    A Code of Conduct governs this project. Participants and contributors are expected to follow the rules outlined therein.

    -

    License

    +

    License +

    All your contributions will be covered by this project’s license.

    -

    Issues

    +

    Issues +

    We use GitHub to track issues, feature requests, and bugs. Before submitting a new issue, please check if the issue has already been reported. If the issue already exists, please upvote the existing issue 👍.

    For new feature requests, please elaborate on the context and the benefit the feature will have for users, developers, or other relevant personas.

    -

    Pull requests

    +

    Pull requests +

    -

    GitHub Flow

    +

    GitHub Flow +

    This repository uses the GitHub Flow model for collaboration. To submit a pull request:

    -
    1. +
        +
      1. Create a branch

        Please see the branch naming convention below. If you don’t have write access to this repository, please fork it.

      2. Make changes

        Make sure your code

        -
        • passes all checks imposed by GitHub Actions
        • +
            +
          • passes all checks imposed by GitHub Actions
          • is well documented
          • is well tested with unit tests sufficiently covering the changes introduced
          • -
          +
        +
      3. Create a pull request (PR)

        In the pull request description, please link the relevant issue (if any), provide a detailed description of the change, and include any assumptions.

        @@ -138,76 +168,93 @@

        GitHub Flow -

        Branch naming convention

        +

        Branch naming convention +

        Suppose your changes are related to a current issue in the current project; please name your branch as follows: <issue_id>_<short_description>. Please use underscore (_) as a delimiter for word separation. For example, 420_fix_ui_bug would be a suitable branch name if your change is resolving and UI-related bug reported in issue number 420 in the current project.

        If your change affects multiple repositories, please name your branches as follows: <issue_id>_<issue_repo>_<short description>. For example, 69_awesomeproject_fix_spelling_error would reference issue 69 reported in project awesomeproject and aims to resolve one or more spelling errors in multiple (likely related) repositories.

    monorepo and staged.dependencies -

    + +

    Sometimes you might need to change upstream dependent package(s) to be able to submit a meaningful change. We are using staged.dependencies functionality to simulate a monorepo behavior. The dependency configuration is already specified in this project’s staged_dependencies.yaml file. You need to name the feature branches appropriately. This is the only exception from the branch naming convention described above.

    Please refer to the staged.dependencies package documentation for more details.

    -

    Coding guidelines

    +

    Coding guidelines +

    This repository follows some unified processes and standards adopted by its maintainers to ensure software development is carried out consistently within teams and cohesively across other repositories.

    -

    Style guide

    +

    Style guide +

    This repository follows the standard tidyverse style guide and uses lintr for lint checks. Customized lint configurations are available in this repository’s .lintr file.

    -

    Dependency management

    +

    Dependency management +

    Lightweight is the right weight. This repository follows tinyverse recommendations of limiting dependencies to minimum.

    -

    Dependency version management

    +

    Dependency version management +

    If the code is not compatible with all (!) historical versions of a given dependency package, it is required to specify minimal version in the DESCRIPTION file. In particular: if the development version requires (imports) the development version of another package - it is required to put abc (>= 1.2.3.9000).

    - +
    -

    R & package versions

    +

    R & package versions +

    We continuously test our packages against the newest R version along with the most recent dependencies from CRAN and BioConductor. We recommend that your working environment is also set up in the same way. You can find the details about the R version and packages used in the R CMD check GitHub Action execution log - there is a step that prints out the R sessionInfo().

    If you discover bugs on older R versions or with an older set of dependencies, please create the relevant bug reports.

    -

    pre-commit

    +

    +pre-commit +

    We highly recommend that you use the pre-commit tool combined with R hooks for pre-commit to execute some of the checks before committing and pushing your changes.

    Pre-commit hooks are already available in this repository’s .pre-commit-config.yaml file.

    -

    Recognition model

    +

    Recognition model +

    As mentioned previously, all contributions are deeply valued and appreciated. While all contribution data is available as part of the repository insights, to recognize a significant contribution and hence add the contributor to the package authors list, the following rules are enforced:

    -
    • Minimum 5% of lines of code authored* (determined by git blame query) OR
    • +
        +
      • Minimum 5% of lines of code authored* (determined by git blame query) OR
      • Being at the top 5 contributors in terms of number of commits OR lines added OR lines removed*
      • -

      *Excluding auto-generated code, including but not limited to roxygen comments or renv.lock files.

      +
    +

    *Excluding auto-generated code, including but not limited to roxygen comments or renv.lock files.

    The package maintainer also reserves the right to adjust the criteria to recognize contributions.

    -

    Questions

    +

    Questions +

    If you have further questions regarding the contribution guidelines, please contact the package/repository maintainer.

    + + + + - - + + diff --git a/release-candidate/LICENSE-text.html b/release-candidate/LICENSE-text.html index de80e9399..e10520d89 100644 --- a/release-candidate/LICENSE-text.html +++ b/release-candidate/LICENSE-text.html @@ -1,8 +1,22 @@ - -License • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -92,17 +112,19 @@ limitations under the License. - + + + + - - + + diff --git a/release-candidate/SECURITY.html b/release-candidate/SECURITY.html index f6f263475..c74550f27 100644 --- a/release-candidate/SECURITY.html +++ b/release-candidate/SECURITY.html @@ -1,8 +1,22 @@ - -Security Policy • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -80,38 +100,44 @@
    -

    Reporting Security Issues

    +

    Reporting Security Issues +

    If you believe you have found a security vulnerability in any of the repositories in this organization, please report it to us through coordinated disclosure.

    Please do not report security vulnerabilities through public GitHub issues, discussions, or pull requests.

    Instead, please send an email to vulnerability.management[@]roche.com.

    Please include as much of the information listed below as you can to help us better understand and resolve the issue:

    -
    • The type of issue (e.g., buffer overflow, SQL injection, or cross-site scripting)
    • +
        +
      • The type of issue (e.g., buffer overflow, SQL injection, or cross-site scripting)
      • Full paths of source file(s) related to the manifestation of the issue
      • The location of the affected source code (tag/branch/commit or direct URL)
      • Any special configuration required to reproduce the issue
      • Step-by-step instructions to reproduce the issue
      • Proof-of-concept or exploit code (if possible)
      • Impact of the issue, including how an attacker might exploit the issue
      • -

      This information will help us triage your report more quickly.

      +
    +

    This information will help us triage your report more quickly.

    -

    Data Security Standards (DSS)

    +

    Data Security Standards (DSS) +

    Please make sure that while reporting issues in the form a bug, feature, or pull request, all sensitive information such as PII, PHI, and PCI is completely removed from any text and attachments, including pictures and videos.

    + + + + - - + + diff --git a/release-candidate/articles/filter-panel-for-developers.html b/release-candidate/articles/filter-panel-for-developers.html index 986ec9cce..34dc283f9 100644 --- a/release-candidate/articles/filter-panel-for-developers.html +++ b/release-candidate/articles/filter-panel-for-developers.html @@ -1,5 +1,4 @@ - - + @@ -52,22 +51,7 @@ - - + - + + diff --git a/release-candidate/articles/index.html b/release-candidate/articles/index.html index 236a4f07e..5cc494abd 100644 --- a/release-candidate/articles/index.html +++ b/release-candidate/articles/index.html @@ -1,8 +1,22 @@ - -Articles • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -80,24 +100,31 @@

    All vignettes

    -
    Filter Panel for Developers
    +
    +
    Filter Panel for Developers
    -
    teal.slice Classes
    + +
    teal.slice Classes
    -
    Introduction to teal.slice
    + +
    Introduction to teal.slice
    -
    - + +
    + + + + + - - + + diff --git a/release-candidate/articles/teal-slice-classes.html b/release-candidate/articles/teal-slice-classes.html index 6c98d7032..1f7434bb9 100644 --- a/release-candidate/articles/teal-slice-classes.html +++ b/release-candidate/articles/teal-slice-classes.html @@ -1,5 +1,4 @@ - - + @@ -52,22 +51,7 @@ - - + - + + diff --git a/release-candidate/articles/teal-slice.html b/release-candidate/articles/teal-slice.html index f1b965356..c19605cfd 100644 --- a/release-candidate/articles/teal-slice.html +++ b/release-candidate/articles/teal-slice.html @@ -1,5 +1,4 @@ - - + @@ -52,22 +51,7 @@ - - + - + + diff --git a/release-candidate/authors.html b/release-candidate/authors.html index b1b4c129b..136084e67 100644 --- a/release-candidate/authors.html +++ b/release-candidate/authors.html @@ -1,8 +1,22 @@ - -Authors and Citation • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -79,7 +99,8 @@

    Authors

    -
    • +
        +
      • Dawid Kaledkowski. Author, maintainer.

      • @@ -139,7 +160,8 @@

        Authors

        F. Hoffmann-La Roche AG. Copyright holder, funder.

        -
    + +

    Citation

    @@ -160,17 +182,19 @@

    Citation

    }
    + + + + - - + + diff --git a/release-candidate/coverage-report/index.html b/release-candidate/coverage-report/index.html index 4e7845e92..e5c3b9350 100644 --- a/release-candidate/coverage-report/index.html +++ b/release-candidate/coverage-report/index.html @@ -1,23 +1,22 @@ - - + - + - + - - + + - + - + - - - + + + @@ -852,7 +851,8 @@

    teal.slice coverage - 65.92%

    106 - 67x + 67x +
          checkmate::assert_list(data_objects, any.missing = FALSE, min.len = 0, names = "unique")
    @@ -866,14 +866,16 @@

    teal.slice coverage - 65.92%

    108 - 67x + 67x +
          data_objects <- lapply(data_objects, function(dataset) {
    109 - 101x + 101x +
            if (is.list(dataset) && "dataset" %in% names(dataset)) {
    @@ -894,7 +896,8 @@

    teal.slice coverage - 65.92%

    112 - 101x + 101x +
              dataset
    @@ -929,49 +932,56 @@

    teal.slice coverage - 65.92%

    117 - 67x + 67x +
          checkmate::assert_class(join_keys, "join_keys")
    118 - 66x + 66x +
          self$set_join_keys(join_keys)
    119 - 66x + 66x +
          child_parent <- sapply(
    120 - 66x + 66x +
            names(data_objects),
    121 - 66x + 66x +
            function(i) teal.data::parent(join_keys, i),
    122 - 66x + 66x +
            USE.NAMES = TRUE,
    123 - 66x + 66x +
            simplify = FALSE
    @@ -985,14 +995,16 @@

    teal.slice coverage - 65.92%

    125 - 66x + 66x +
          ordered_datanames <- topological_sort(child_parent)
    126 - 66x + 66x +
          ordered_datanames <- intersect(ordered_datanames, names(data_objects))
    @@ -1006,21 +1018,24 @@

    teal.slice coverage - 65.92%

    128 - 66x + 66x +
          for (dataname in ordered_datanames) {
    129 - 100x + 100x +
            ds_object <- data_objects[[dataname]]
    130 - 100x + 100x +
            self$set_dataset(data = ds_object, dataname = dataname)
    @@ -1041,7 +1056,8 @@

    teal.slice coverage - 65.92%

    133 - 66x + 66x +
          self$set_available_teal_slices(x = reactive(NULL))
    @@ -1055,7 +1071,8 @@

    teal.slice coverage - 65.92%

    135 - 66x + 66x +
          invisible(self)
    @@ -1118,7 +1135,8 @@

    teal.slice coverage - 65.92%

    144 - 118x + 118x +
          names(private$filtered_datasets)
    @@ -1188,7 +1206,8 @@

    teal.slice coverage - 65.92%

    154 - 1x + 1x +
          private$get_filtered_dataset(dataname)$get_dataset_label()
    @@ -1293,14 +1312,16 @@

    teal.slice coverage - 65.92%

    169 - 67x + 67x +
          checkmate::assert_class(x, "reactive")
    170 - 67x + 67x +
          private$available_teal_slices <- reactive({
    @@ -1314,49 +1335,56 @@

    teal.slice coverage - 65.92%

    172 - 4x + 4x +
            current_state <- isolate(self$get_filter_state())
    173 - 4x + 4x +
            allowed <- attr(current_state, "include_varnames")
    174 - 4x + 4x +
            forbidden <- attr(current_state, "exclude_varnames")
    175 - 4x + 4x +
            foo <- function(slice) {
    176 - 13x + 13x +
              if (slice$dataname %in% self$datanames()) {
    177 - 13x + 13x +
                if (slice$fixed) {
    178 - 4x + 4x +
                  TRUE
    @@ -1370,14 +1398,16 @@

    teal.slice coverage - 65.92%

    180 - 9x + 9x +
                  isTRUE(slice$varname %in% allowed[[slice$dataname]]) ||
    181 - 9x + 9x +
                    isFALSE(slice$varname %in% forbidden[[slice$dataname]])
    @@ -1419,7 +1449,8 @@

    teal.slice coverage - 65.92%

    187 - 4x + 4x +
            Filter(foo, x())
    @@ -1433,7 +1464,8 @@

    teal.slice coverage - 65.92%

    189 - 67x + 67x +
          invisible(NULL)
    @@ -1510,7 +1542,8 @@

    teal.slice coverage - 65.92%

    200 - 4x + 4x +
          private$available_teal_slices
    @@ -1706,14 +1739,16 @@

    teal.slice coverage - 65.92%

    228 - 10x + 10x +
          checkmate::assert_subset(dataname, self$datanames())
    229 - 9x + 9x +
          private$get_filtered_dataset(dataname)$get_call()
    @@ -1811,28 +1846,32 @@

    teal.slice coverage - 65.92%

    243 - 24x + 24x +
          checkmate::assert_subset(dataname, self$datanames())
    244 - 23x + 23x +
          checkmate::assert_flag(filtered)
    245 - 22x + 22x +
          data <- private$get_filtered_dataset(dataname)$get_dataset(filtered)
    246 - 3x + 3x +
          if (filtered) data() else data
    @@ -1895,7 +1934,8 @@

    teal.slice coverage - 65.92%

    255 - 2x + 2x +
          private$join_keys
    @@ -1986,28 +2026,32 @@

    teal.slice coverage - 65.92%

    268 - 9x + 9x +
          rows <- lapply(
    269 - 9x + 9x +
            datanames,
    270 - 9x + 9x +
            function(dataname) {
    271 - 11x + 11x +
              private$get_filtered_dataset(dataname)$get_filter_overview()
    @@ -2028,14 +2072,16 @@

    teal.slice coverage - 65.92%

    274 - 5x + 5x +
          unssuported_idx <- vapply(rows, function(x) all(is.na(x[-1])), logical(1))
    275 - 5x + 5x +
          dplyr::bind_rows(c(rows[!unssuported_idx], rows[unssuported_idx]))
    @@ -2112,7 +2158,8 @@

    teal.slice coverage - 65.92%

    286 - 1x + 1x +
          private$get_filtered_dataset(dataname)$get_keys()
    @@ -2266,14 +2313,16 @@

    teal.slice coverage - 65.92%

    308 - 105x + 105x +
          checkmate::assert_string(dataname)
    309 - 105x + 105x +
          logger::log_trace("FilteredData$set_dataset setting dataset, name: { dataname }")
    @@ -2294,7 +2343,8 @@

    teal.slice coverage - 65.92%

    312 - 105x + 105x +
          check_simple_name(dataname)
    @@ -2308,21 +2358,24 @@

    teal.slice coverage - 65.92%

    314 - 105x + 105x +
          parent_dataname <- teal.data::parent(private$join_keys, dataname)
    315 - 105x + 105x +
          keys <- private$join_keys[dataname, dataname]
    316 - 104x + 104x +
          if (is.null(keys)) keys <- character(0)
    @@ -2336,35 +2389,40 @@

    teal.slice coverage - 65.92%

    318 - 105x + 105x +
          if (length(parent_dataname) == 0) {
    319 - 95x + 95x +
            private$filtered_datasets[[dataname]] <- init_filtered_dataset(
    320 - 95x + 95x +
              dataset = data,
    321 - 95x + 95x +
              dataname = dataname,
    322 - 95x + 95x +
              keys = keys
    @@ -2385,7 +2443,8 @@

    teal.slice coverage - 65.92%

    325 - 10x + 10x +
            join_keys <- private$join_keys[dataname, parent_dataname]
    @@ -2399,49 +2458,56 @@

    teal.slice coverage - 65.92%

    327 - 10x + 10x +
            private$filtered_datasets[[dataname]] <- init_filtered_dataset(
    328 - 10x + 10x +
              dataset = data,
    329 - 10x + 10x +
              dataname = dataname,
    330 - 10x + 10x +
              keys = keys,
    331 - 10x + 10x +
              parent_name = parent_dataname,
    332 - 10x + 10x +
              parent = reactive(self$get_data(parent_dataname, filtered = TRUE)),
    333 - 10x + 10x +
              join_keys = join_keys
    @@ -2469,7 +2535,8 @@

    teal.slice coverage - 65.92%

    337 - 105x + 105x +
          invisible(self)
    @@ -2546,21 +2613,24 @@

    teal.slice coverage - 65.92%

    348 - 66x + 66x +
          checkmate::assert_class(join_keys, "join_keys")
    349 - 66x + 66x +
          private$join_keys <- join_keys
    350 - 66x + 66x +
          invisible(self)
    @@ -2637,35 +2707,40 @@

    teal.slice coverage - 65.92%

    361 - 53x + 53x +
          states <- unname(lapply(private$filtered_datasets, function(x) x$get_filter_state()))
    362 - 53x + 53x +
          slices <- Filter(Negate(is.null), states)
    363 - 53x + 53x +
          slices <- do.call(c, slices)
    364 - 53x + 53x +
          if (!is.null(slices)) {
    365 - 53x + 53x +
            attr(slices, "allow_add") <- private$allow_add
    @@ -2679,7 +2754,8 @@

    teal.slice coverage - 65.92%

    367 - 53x + 53x +
          slices
    @@ -2763,35 +2839,40 @@

    teal.slice coverage - 65.92%

    379 - 5x + 5x +
          datasets <- lapply(self$datanames(), private$get_filtered_dataset)
    380 - 5x + 5x +
          ind <- vapply(datasets, inherits, logical(1L), what = "DefaultFilteredDataset")
    381 - 5x + 5x +
          states <- do.call(c, lapply(datasets[!ind], function(ds) ds$get_filter_state()))
    382 - 5x + 5x +
          states_fmt <- format(states, show_all = show_all, trim_lines = trim_lines)
    383 - 5x + 5x +
          holders_fmt <- vapply(datasets[ind], format, character(1L), show_all = show_all, trim_lines = trim_lines)
    @@ -2805,28 +2886,32 @@

    teal.slice coverage - 65.92%

    385 - 5x + 5x +
          sprintf(
    386 - 5x + 5x +
            "%s:\n%s",
    387 - 5x + 5x +
            class(self)[1],
    388 - 5x + 5x +
            paste(c(states_fmt, holders_fmt), collapse = "\n")
    @@ -2966,42 +3051,48 @@

    teal.slice coverage - 65.92%

    408 - 31x + 31x +
          isolate({
    409 - 31x + 31x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initializing")
    410 - 31x + 31x +
            checkmate::assert_class(state, "teal_slices")
    411 - 31x + 31x +
            allow_add <- attr(state, "allow_add")
    412 - 31x + 31x +
            if (!is.null(allow_add)) {
    413 - 31x + 31x +
              private$allow_add <- allow_add
    @@ -3022,21 +3113,24 @@

    teal.slice coverage - 65.92%

    416 - 31x + 31x +
            lapply(self$datanames(), function(dataname) {
    417 - 63x + 63x +
              states <- Filter(function(x) identical(x$dataname, dataname), state)
    418 - 63x + 63x +
              private$get_filtered_dataset(dataname)$set_filter_state(states)
    @@ -3057,7 +3151,8 @@

    teal.slice coverage - 65.92%

    421 - 31x + 31x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initialized")
    @@ -3078,7 +3173,8 @@

    teal.slice coverage - 65.92%

    424 - 31x + 31x +
          invisible(NULL)
    @@ -3169,28 +3265,32 @@

    teal.slice coverage - 65.92%

    437 - 8x + 8x +
          isolate({
    438 - 8x + 8x +
            checkmate::assert_class(state, "teal_slices")
    439 - 8x + 8x +
            datanames <- unique(vapply(state, "[[", character(1L), "dataname"))
    440 - 8x + 8x +
            checkmate::assert_subset(datanames, self$datanames())
    @@ -3204,14 +3304,16 @@

    teal.slice coverage - 65.92%

    442 - 8x + 8x +
            logger::log_trace(
    443 - 8x + 8x +
              "{ class(self)[1] }$remove_filter_state removing filter(s), dataname: { private$dataname }"
    @@ -3232,21 +3334,24 @@

    teal.slice coverage - 65.92%

    446 - 8x + 8x +
            lapply(datanames, function(dataname) {
    447 - 9x + 9x +
              slices <- Filter(function(x) identical(x$dataname, dataname), state)
    448 - 9x + 9x +
              private$get_filtered_dataset(dataname)$remove_filter_state(slices)
    @@ -3267,14 +3372,16 @@

    teal.slice coverage - 65.92%

    451 - 8x + 8x +
            logger::log_trace(
    452 - 8x + 8x +
              "{ class(self)[1] }$remove_filter_state removed filter(s), dataname: { private$dataname }"
    @@ -3302,7 +3409,8 @@

    teal.slice coverage - 65.92%

    456 - 8x + 8x +
          invisible(NULL)
    @@ -3407,14 +3515,16 @@

    teal.slice coverage - 65.92%

    471 - 7x + 7x +
          logger::log_trace(
    472 - 7x + 7x +
            "FilteredData$clear_filter_states called, datanames: { toString(datanames) }"
    @@ -3435,21 +3545,24 @@

    teal.slice coverage - 65.92%

    475 - 7x + 7x +
          for (dataname in datanames) {
    476 - 12x + 12x +
            fdataset <- private$get_filtered_dataset(dataname = dataname)
    477 - 12x + 12x +
            fdataset$clear_filter_states(force)
    @@ -3470,28 +3583,32 @@

    teal.slice coverage - 65.92%

    480 - 7x + 7x +
          logger::log_trace(
    481 - 7x + 7x +
            paste(
    482 - 7x + 7x +
              "FilteredData$clear_filter_states removed all non-anchored FilterStates,",
    483 - 7x + 7x +
              "datanames: { toString(datanames) }"
    @@ -3519,7 +3636,8 @@

    teal.slice coverage - 65.92%

    487 - 7x + 7x +
          invisible(NULL)
    @@ -3785,35 +3903,40 @@

    teal.slice coverage - 65.92%

    525 - 1x + 1x +
          checkmate::assert_function(active_datanames)
    526 - 1x + 1x +
          moduleServer(
    527 - 1x + 1x +
            id = id,
    528 - 1x + 1x +
            function(input, output, session) {
    529 - 1x + 1x +
              logger::log_trace("FilteredData$srv_filter_panel initializing")
    @@ -3827,14 +3950,16 @@

    teal.slice coverage - 65.92%

    531 - 1x + 1x +
              active_datanames_resolved <- reactive({
    532 - 1x + 1x +
                checkmate::assert_subset(active_datanames(), self$datanames())
    @@ -3862,28 +3987,32 @@

    teal.slice coverage - 65.92%

    536 - 1x + 1x +
              self$srv_overview("overview", active_datanames_resolved)
    537 - 1x + 1x +
              self$srv_active("active", active_datanames_resolved)
    538 - 1x + 1x +
              if (private$allow_add) {
    539 - 1x + 1x +
                self$srv_add("add", active_datanames_resolved)
    @@ -3904,14 +4033,16 @@

    teal.slice coverage - 65.92%

    542 - 1x + 1x +
              logger::log_trace("FilteredData$srv_filter_panel initialized")
    543 - 1x + 1x +
              NULL
    @@ -4352,21 +4483,24 @@

    teal.slice coverage - 65.92%

    606 - 3x + 3x +
          checkmate::assert_function(active_datanames)
    607 - 3x + 3x +
          moduleServer(id, function(input, output, session) {
    608 - 3x + 3x +
            logger::log_trace("FilteredData$srv_active initializing")
    @@ -4380,7 +4514,8 @@

    teal.slice coverage - 65.92%

    610 - 3x + 3x +
            private$srv_available_filters("available_filters")
    @@ -4394,7 +4529,8 @@

    teal.slice coverage - 65.92%

    612 - 3x + 3x +
            observeEvent(input$minimise_filter_active, {
    @@ -4443,42 +4579,48 @@

    teal.slice coverage - 65.92%

    619 - 3x + 3x +
            observeEvent(private$get_filter_count(), {
    620 - 3x + 3x +
              shinyjs::toggle("remove_all_filters", condition = private$get_filter_count() != 0)
    621 - 3x + 3x +
              shinyjs::show("filter_active_vars_contents")
    622 - 3x + 3x +
              shinyjs::hide("filters_active_count")
    623 - 3x + 3x +
              toggle_icon(session$ns("minimise_filter_active"), c("fa-angle-right", "fa-angle-down"), TRUE)
    624 - 3x + 3x +
              toggle_title(session$ns("minimise_filter_active"), c("Restore panel", "Minimise Panel"), TRUE)
    @@ -4499,28 +4641,32 @@

    teal.slice coverage - 65.92%

    627 - 3x + 3x +
            observeEvent(active_datanames(), {
    628 - 2x + 2x +
              lapply(self$datanames(), function(dataname) {
    629 - 4x + 4x +
                if (dataname %in% active_datanames()) {
    630 - 4x + 4x +
                  shinyjs::show(dataname)
    @@ -4583,35 +4729,40 @@

    teal.slice coverage - 65.92%

    639 - 3x + 3x +
            lapply(
    640 - 3x + 3x +
              self$datanames(),
    641 - 3x + 3x +
              function(dataname) {
    642 - 6x + 6x +
                fdataset <- private$get_filtered_dataset(dataname)
    643 - 6x + 6x +
                fdataset$srv_active(id = dataname)
    @@ -4639,49 +4790,56 @@

    teal.slice coverage - 65.92%

    647 - 3x + 3x +
            output$teal_filters_count <- renderText({
    648 - 3x + 3x +
              n_filters_active <- private$get_filter_count()
    649 - 3x + 3x +
              req(n_filters_active > 0L)
    650 - 2x + 2x +
              sprintf(
    651 - 2x + 2x +
                "%s filter%s applied across datasets",
    652 - 2x + 2x +
                n_filters_active,
    653 - 2x + 2x +
                ifelse(n_filters_active == 1, "", "s")
    @@ -4709,28 +4867,32 @@

    teal.slice coverage - 65.92%

    657 - 3x + 3x +
            observeEvent(input$remove_all_filters, {
    658 - 1x + 1x +
              logger::log_trace("FilteredData$srv_filter_panel@1 removing all non-anchored filters")
    659 - 1x + 1x +
              self$clear_filter_states()
    660 - 1x + 1x +
              logger::log_trace("FilteredData$srv_filter_panel@1 removed all non-anchored filters")
    @@ -4744,14 +4906,16 @@

    teal.slice coverage - 65.92%

    662 - 3x + 3x +
            logger::log_trace("FilteredData$srv_active initialized")
    663 - 3x + 3x +
            NULL
    @@ -5129,28 +5293,32 @@

    teal.slice coverage - 65.92%

    717 - 1x + 1x +
          checkmate::assert_class(active_datanames, "reactive")
    718 - 1x + 1x +
          moduleServer(id, function(input, output, session) {
    719 - 1x + 1x +
            logger::log_trace("FilteredData$srv_add initializing")
    720 - 1x + 1x +
            observeEvent(input$minimise_filter_add_vars, {
    @@ -5192,7 +5360,8 @@

    teal.slice coverage - 65.92%

    726 - 1x + 1x +
            observeEvent(active_datanames(), {
    @@ -5276,35 +5445,40 @@

    teal.slice coverage - 65.92%

    738 - 1x + 1x +
            lapply(
    739 - 1x + 1x +
              self$datanames(),
    740 - 1x + 1x +
              function(dataname) {
    741 - 2x + 2x +
                fdataset <- private$get_filtered_dataset(dataname)
    742 - 2x + 2x +
                fdataset$srv_add(id = dataname)
    @@ -5325,14 +5499,16 @@

    teal.slice coverage - 65.92%

    745 - 1x + 1x +
            logger::log_trace("FilteredData$srv_filter_panel initialized")
    746 - 1x + 1x +
            NULL
    @@ -5752,35 +5928,40 @@

    teal.slice coverage - 65.92%

    806 - 1x + 1x +
          checkmate::assert_class(active_datanames, "reactive")
    807 - 1x + 1x +
          moduleServer(
    808 - 1x + 1x +
            id = id,
    809 - 1x + 1x +
            function(input, output, session) {
    810 - 1x + 1x +
              logger::log_trace("FilteredData$srv_filter_overview initializing")
    @@ -5794,7 +5975,8 @@

    teal.slice coverage - 65.92%

    812 - 1x + 1x +
              observeEvent(input$minimise_filter_overview, {
    @@ -5836,7 +6018,8 @@

    teal.slice coverage - 65.92%

    818 - 1x + 1x +
              output$table <- renderUI({
    @@ -6410,14 +6593,16 @@

    teal.slice coverage - 65.92%

    900 - 1x + 1x +
              logger::log_trace("FilteredData$srv_filter_overview initialized")
    901 - 1x + 1x +
              NULL
    @@ -6676,7 +6861,8 @@

    teal.slice coverage - 65.92%

    938 - 147x + 147x +
          if (length(dataname) == 0) {
    @@ -6697,7 +6883,8 @@

    teal.slice coverage - 65.92%

    941 - 147x + 147x +
            private$filtered_datasets[[dataname]]
    @@ -6781,7 +6968,8 @@

    teal.slice coverage - 65.92%

    953 - 11x + 11x +
          length(self$get_filter_state())
    @@ -7047,28 +7235,32 @@

    teal.slice coverage - 65.92%

    991 - 4x + 4x +
          moduleServer(id, function(input, output, session) {
    992 - 4x + 4x +
            slices_available <- self$get_available_teal_slices()
    993 - 4x + 4x +
            slices_interactive <- reactive(
    994 - 4x + 4x +
              Filter(function(slice) isFALSE(slice$fixed), slices_available())
    @@ -7082,14 +7274,16 @@

    teal.slice coverage - 65.92%

    996 - 4x + 4x +
            slices_fixed <- reactive(
    997 - 4x + 4x +
              Filter(function(slice) isTRUE(slice$fixed), slices_available())
    @@ -7103,21 +7297,24 @@

    teal.slice coverage - 65.92%

    999 - 4x + 4x +
            available_slices_id <- reactive(vapply(slices_available(), `[[`, character(1), "id"))
    1000 - 4x + 4x +
            active_slices_id <- reactive(vapply(self$get_filter_state(), `[[`, character(1), "id"))
    1001 - 4x + 4x +
            duplicated_slice_references <- reactive({
    @@ -7131,35 +7328,40 @@

    teal.slice coverage - 65.92%

    1003 - 8x + 8x +
              slice_reference <- vapply(slices_available(), get_default_slice_id, character(1))
    1004 - 8x + 8x +
              is_duplicated_reference <- duplicated(slice_reference) | duplicated(slice_reference, fromLast = TRUE)
    1005 - 8x + 8x +
              is_active <- available_slices_id() %in% active_slices_id()
    1006 - 8x + 8x +
              is_not_expr <- !vapply(slices_available(), inherits, logical(1), "teal_slice_expr")
    1007 - 8x + 8x +
              slice_reference[is_duplicated_reference & is_active & is_not_expr]
    @@ -7180,70 +7382,80 @@

    teal.slice coverage - 65.92%

    1010 - 4x + 4x +
            checkbox_group_element <- function(name, value, label, checked, disabled = FALSE) {
    1011 - 35x + 35x +
              tags$div(
    1012 - 35x + 35x +
                class = "checkbox available-filters",
    1013 - 35x + 35x +
                tags$label(
    1014 - 35x + 35x +
                  tags$input(
    1015 - 35x + 35x +
                    type = "checkbox",
    1016 - 35x + 35x +
                    name = name,
    1017 - 35x + 35x +
                    value = value,
    1018 - 35x + 35x +
                    checked = checked,
    1019 - 35x + 35x +
                    disabled = if (disabled) "disabled"
    @@ -7257,7 +7469,8 @@

    teal.slice coverage - 65.92%

    1021 - 35x + 35x +
                  tags$span(label, disabled = if (disabled) disabled)
    @@ -7292,42 +7505,48 @@

    teal.slice coverage - 65.92%

    1026 - 4x + 4x +
            output$checkbox <- renderUI({
    1027 - 8x + 8x +
              checkbox <- checkboxGroupInput(
    1028 - 8x + 8x +
                session$ns("available_slices_id"),
    1029 - 8x + 8x +
                label = NULL,
    1030 - 8x + 8x +
                choices = NULL,
    1031 - 8x + 8x +
                selected = NULL
    @@ -7341,14 +7560,16 @@

    teal.slice coverage - 65.92%

    1033 - 8x + 8x +
              active_slices_ids <- active_slices_id()
    1034 - 8x + 8x +
              duplicated_slice_refs <- duplicated_slice_references()
    @@ -7362,7 +7583,8 @@

    teal.slice coverage - 65.92%

    1036 - 8x + 8x +
              checkbox_group_slice <- function(slice) {
    @@ -7376,63 +7598,72 @@

    teal.slice coverage - 65.92%

    1038 - 35x + 35x +
                isolate({
    1039 - 35x + 35x +
                  checkbox_group_element(
    1040 - 35x + 35x +
                    name = session$ns("available_slices_id"),
    1041 - 35x + 35x +
                    value = slice$id,
    1042 - 35x + 35x +
                    label = slice$id,
    1043 - 35x + 35x +
                    checked = if (slice$id %in% active_slices_ids) "checked",
    1044 - 35x + 35x +
                    disabled = slice$anchored ||
    1045 - 35x + 35x +
                      get_default_slice_id(slice) %in% duplicated_slice_refs &&
    1046 - 35x + 35x +
                        !slice$id %in% active_slices_ids
    @@ -7467,14 +7698,16 @@

    teal.slice coverage - 65.92%

    1051 - 8x + 8x +
              interactive_choice_mock <- lapply(slices_interactive(), checkbox_group_slice)
    1052 - 8x + 8x +
              non_interactive_choice_mock <- lapply(slices_fixed(), checkbox_group_slice)
    @@ -7488,63 +7721,72 @@

    teal.slice coverage - 65.92%

    1054 - 8x + 8x +
              htmltools::tagInsertChildren(
    1055 - 8x + 8x +
                checkbox,
    1056 - 8x + 8x +
                tags$br(),
    1057 - 8x + 8x +
                if (length(non_interactive_choice_mock)) tags$strong("Fixed filters"),
    1058 - 8x + 8x +
                non_interactive_choice_mock,
    1059 - 8x + 8x +
                if (length(interactive_choice_mock)) tags$strong("Interactive filters"),
    1060 - 8x + 8x +
                interactive_choice_mock,
    1061 - 8x + 8x +
                .cssSelector = "div.shiny-options-group",
    1062 - 8x + 8x +
                after = 0
    @@ -7572,49 +7814,56 @@

    teal.slice coverage - 65.92%

    1066 - 4x + 4x +
            observeEvent(input$available_slices_id, ignoreNULL = FALSE, ignoreInit = TRUE, {
    1067 - 5x + 5x +
              new_slices_id <- setdiff(input$available_slices_id, active_slices_id())
    1068 - 5x + 5x +
              removed_slices_id <- setdiff(active_slices_id(), input$available_slices_id)
    1069 - 5x + 5x +
              if (length(new_slices_id)) {
    1070 - 3x + 3x +
                new_teal_slices <- Filter(
    1071 - 3x + 3x +
                  function(slice) slice$id %in% new_slices_id,
    1072 - 3x + 3x +
                  private$available_teal_slices()
    @@ -7628,7 +7877,8 @@

    teal.slice coverage - 65.92%

    1074 - 3x + 3x +
                self$set_filter_state(new_teal_slices)
    @@ -7649,28 +7899,32 @@

    teal.slice coverage - 65.92%

    1077 - 5x + 5x +
              if (length(removed_slices_id)) {
    1078 - 4x + 4x +
                removed_teal_slices <- Filter(
    1079 - 4x + 4x +
                  function(slice) slice$id %in% removed_slices_id,
    1080 - 4x + 4x +
                  self$get_filter_state()
    @@ -7684,7 +7938,8 @@

    teal.slice coverage - 65.92%

    1082 - 4x + 4x +
                self$remove_filter_state(removed_teal_slices)
    @@ -7712,21 +7967,24 @@

    teal.slice coverage - 65.92%

    1086 - 4x + 4x +
            observeEvent(private$available_teal_slices(), ignoreNULL = FALSE, {
    1087 - 3x + 3x +
              if (length(private$available_teal_slices())) {
    1088 - 1x + 1x +
                shinyjs::show("available_menu")
    @@ -7740,7 +7998,8 @@

    teal.slice coverage - 65.92%

    1090 - 2x + 2x +
                shinyjs::hide("available_menu")
    @@ -8887,56 +9146,64 @@

    teal.slice coverage - 65.92%

    157 - 121x + 121x +
          isolate({
    158 - 121x + 121x +
            checkmate::assert_numeric(x, all.missing = FALSE)
    159 - 2x + 2x +
            if (!any(is.finite(x))) stop("\"x\" contains no finite values")
    160 - 118x + 118x +
            super$initialize(x = x, x_reactive = x_reactive, slice = slice, extract_type = extract_type)
    161 - 118x + 118x +
            private$is_integer <- checkmate::test_integerish(x)
    162 - 118x + 118x +
            private$inf_count <- sum(is.infinite(x))
    163 - 118x + 118x +
            private$inf_filtered_count <- reactive(
    164 - 118x + 118x +
              if (!is.null(private$x_reactive())) sum(is.infinite(private$x_reactive()))
    @@ -8957,14 +9224,16 @@

    teal.slice coverage - 65.92%

    167 - 118x + 118x +
            checkmate::assert_numeric(slice$choices, null.ok = TRUE)
    168 - 3x + 3x +
            if (is.null(slice$keep_inf) && any(is.infinite(x))) slice$keep_inf <- TRUE
    @@ -8978,21 +9247,24 @@

    teal.slice coverage - 65.92%

    170 - 117x + 117x +
            private$set_choices(slice$choices)
    171 - 42x + 42x +
            if (is.null(slice$selected)) slice$selected <- slice$choices
    172 - 117x + 117x +
            private$set_selected(slice$selected)
    @@ -9006,21 +9278,24 @@

    teal.slice coverage - 65.92%

    174 - 114x + 114x +
            private$is_integer <- checkmate::test_integerish(x)
    175 - 114x + 114x +
            private$inf_filtered_count <- reactive(
    176 - 114x + 114x +
              if (!is.null(private$x_reactive())) sum(is.infinite(private$x_reactive()))
    @@ -9034,7 +9309,8 @@

    teal.slice coverage - 65.92%

    178 - 114x + 114x +
            private$inf_count <- sum(is.infinite(x))
    @@ -9048,63 +9324,72 @@

    teal.slice coverage - 65.92%

    180 - 114x + 114x +
            private$plot_data <- list(
    181 - 114x + 114x +
              type = "histogram",
    182 - 114x + 114x +
              nbinsx = 50,
    183 - 114x + 114x +
              x = Filter(Negate(is.na), Filter(is.finite, private$x)),
    184 - 114x + 114x +
              color = I(fetch_bs_color("secondary")),
    185 - 114x + 114x +
              alpha = 0.2,
    186 - 114x + 114x +
              bingroup = 1,
    187 - 114x + 114x +
              showlegend = FALSE,
    188 - 114x + 114x +
              hoverinfo = "none"
    @@ -9118,21 +9403,24 @@

    teal.slice coverage - 65.92%

    190 - 114x + 114x +
            private$plot_mask <- list(list(
    191 - 114x + 114x +
              type = "rect", fillcolor = rgb(1, 1, 1, .65), line = list(width = 0),
    192 - 114x + 114x +
              x0 = -0.5, x1 = 1.5, y0 = -0.5, y1 = 1.5, xref = "paper", yref = "paper"
    @@ -9146,84 +9434,96 @@

    teal.slice coverage - 65.92%

    194 - 114x + 114x +
            private$plot_layout <- reactive({
    195 - 5x + 5x +
              shapes <- private$get_shape_properties(private$get_selected())
    196 - 5x + 5x +
              list(
    197 - 5x + 5x +
                barmode = "overlay",
    198 - 5x + 5x +
                xaxis = list(
    199 - 5x + 5x +
                  range = private$get_choices() * c(0.995, 1.005),
    200 - 5x + 5x +
                  rangeslider = list(thickness = 0),
    201 - 5x + 5x +
                  showticklabels = TRUE,
    202 - 5x + 5x +
                  ticks = "outside",
    203 - 5x + 5x +
                  ticklen = 1.5,
    204 - 5x + 5x +
                  tickmode = "auto",
    205 - 5x + 5x +
                  nticks = 10
    @@ -9237,35 +9537,40 @@

    teal.slice coverage - 65.92%

    207 - 5x + 5x +
                yaxis = list(showgrid = FALSE, showticklabels = FALSE),
    208 - 5x + 5x +
                margin = list(b = 17, l = 0, r = 0, t = 0, autoexpand = FALSE),
    209 - 5x + 5x +
                plot_bgcolor = "#FFFFFF00",
    210 - 5x + 5x +
                paper_bgcolor = "#FFFFFF00",
    211 - 5x + 5x +
                shapes = shapes
    @@ -9286,35 +9591,40 @@

    teal.slice coverage - 65.92%

    214 - 114x + 114x +
            private$plot_config <- reactive({
    215 - 5x + 5x +
              list(
    216 - 5x + 5x +
                doubleClick = "reset",
    217 - 5x + 5x +
                displayModeBar = FALSE,
    218 - 5x + 5x +
                edits = list(shapePosition = TRUE)
    @@ -9335,49 +9645,56 @@

    teal.slice coverage - 65.92%

    221 - 114x + 114x +
            private$plot_filtered <- reactive({
    222 - 5x + 5x +
              finite_values <- Filter(is.finite, private$x_reactive())
    223 - 5x + 5x +
              if (!identical(finite_values, numeric(0))) {
    224 - 5x + 5x +
                list(
    225 - 5x + 5x +
                  x = finite_values,
    226 - 5x + 5x +
                  bingroup = 1,
    227 - 5x + 5x +
                  color = I(fetch_bs_color("primary"))
    @@ -9405,7 +9722,8 @@

    teal.slice coverage - 65.92%

    231 - 114x + 114x +
            invisible(self)
    @@ -9496,14 +9814,16 @@

    teal.slice coverage - 65.92%

    244 - 35x + 35x +
          if (isFALSE(private$is_any_filtered())) {
    245 - 1x + 1x +
            return(NULL)
    @@ -9517,28 +9837,32 @@

    teal.slice coverage - 65.92%

    247 - 4x + 4x +
          if (missing(dataname)) dataname <- private$get_dataname()
    248 - 34x + 34x +
          varname <- private$get_varname_prefixed(dataname)
    249 - 34x + 34x +
          filter_call <-
    250 - 34x + 34x +
            call(
    @@ -9552,14 +9876,16 @@

    teal.slice coverage - 65.92%

    252 - 34x + 34x +
              call(">=", varname, private$get_selected()[1L]),
    253 - 34x + 34x +
              call("<=", varname, private$get_selected()[2L])
    @@ -9573,7 +9899,8 @@

    teal.slice coverage - 65.92%

    255 - 34x + 34x +
          private$add_keep_na_call(private$add_keep_inf_call(filter_call, varname), varname)
    @@ -9755,21 +10082,24 @@

    teal.slice coverage - 65.92%

    281 - 117x + 117x +
          x <- private$x[is.finite(private$x)]
    282 - 117x + 117x +
          if (is.null(choices)) {
    283 - 105x + 105x +
            choices <- range(x)
    @@ -9783,35 +10113,40 @@

    teal.slice coverage - 65.92%

    285 - 12x + 12x +
            choices_adjusted <- c(max(choices[1L], min(x)), min(choices[2L], max(x)))
    286 - 12x + 12x +
            if (any(choices != choices_adjusted)) {
    287 - 1x + 1x +
              warning(sprintf(
    288 - 1x + 1x +
                "Choices adjusted (some values outside of variable range). Varname: %s, dataname: %s.",
    289 - 1x + 1x +
                private$get_varname(), private$get_dataname()
    @@ -9825,7 +10160,8 @@

    teal.slice coverage - 65.92%

    291 - 1x + 1x +
              choices <- choices_adjusted
    @@ -9839,35 +10175,40 @@

    teal.slice coverage - 65.92%

    293 - 12x + 12x +
            if (choices[1L] > choices[2L]) {
    294 - 1x + 1x +
              warning(sprintf(
    295 - 1x + 1x +
                "Invalid choices: lower is higher / equal to upper, or not in range of variable values.
    296 - 1x + 1x +
                Setting defaults. Varname: %s, dataname: %s.",
    297 - 1x + 1x +
                private$get_varname(), private$get_dataname()
    @@ -9881,7 +10222,8 @@

    teal.slice coverage - 65.92%

    299 - 1x + 1x +
              choices <- range(x)
    @@ -9909,21 +10251,24 @@

    teal.slice coverage - 65.92%

    303 - 117x + 117x +
          private$set_is_choice_limited(private$x, choices)
    304 - 117x + 117x +
          private$x <- private$x[
    305 - 117x + 117x +
            (private$x >= choices[1L] & private$x <= choices[2L]) | is.na(private$x) | !is.finite(private$x)
    @@ -9944,7 +10289,8 @@

    teal.slice coverage - 65.92%

    308 - 117x + 117x +
          x_range <- range(private$x, finite = TRUE)
    @@ -9965,14 +10311,16 @@

    teal.slice coverage - 65.92%

    311 - 117x + 117x +
          if (identical(diff(x_range), 0)) {
    312 - 2x + 2x +
            choices <- x_range
    @@ -9986,21 +10334,24 @@

    teal.slice coverage - 65.92%

    314 - 115x + 115x +
            x_pretty <- pretty(x_range, 100L)
    315 - 115x + 115x +
            choices <- range(x_pretty)
    316 - 115x + 115x +
            private$numeric_step <- signif(private$get_pretty_range_step(x_pretty), digits = 10)
    @@ -10014,14 +10365,16 @@

    teal.slice coverage - 65.92%

    318 - 117x + 117x +
          private$teal_slice$choices <- choices
    319 - 117x + 117x +
          invisible(NULL)
    @@ -10063,28 +10416,32 @@

    teal.slice coverage - 65.92%

    325 - 117x + 117x +
          xl <- xl[!is.na(xl)]
    326 - 117x + 117x +
          xl <- xl[is.finite(xl)]
    327 - 117x + 117x +
          private$is_choice_limited <- (any(xl < choices[1L]) | any(xl > choices[2L]))
    328 - 117x + 117x +
          invisible(NULL)
    @@ -10126,14 +10483,16 @@

    teal.slice coverage - 65.92%

    334 - 34x + 34x +
          if (isTRUE(private$get_keep_inf())) {
    335 - 2x + 2x +
            call("|", call("is.infinite", varname), filter_call)
    @@ -10147,7 +10506,8 @@

    teal.slice coverage - 65.92%

    337 - 32x + 32x +
            filter_call
    @@ -10210,14 +10570,16 @@

    teal.slice coverage - 65.92%

    346 - 117x + 117x +
          if (private$is_integer && diff(range(pretty_range) > 2)) {
    347 - 46x + 46x +
            return(1L)
    @@ -10231,14 +10593,16 @@

    teal.slice coverage - 65.92%

    349 - 71x + 71x +
            n_steps <- length(pretty_range) - 1
    350 - 71x + 71x +
            return(signif(digits = 10, (max(pretty_range) - min(pretty_range)) / n_steps))
    @@ -10266,35 +10630,40 @@

    teal.slice coverage - 65.92%

    354 - 133x + 133x +
          tryCatch(
    355 - 133x + 133x +
            expr = {
    356 - 133x + 133x +
              values <- as.numeric(values)
    357 - 4x + 4x +
              if (anyNA(values)) stop()
    358 - 129x + 129x +
              values
    @@ -10308,7 +10677,8 @@

    teal.slice coverage - 65.92%

    360 - 133x + 133x +
            error = function(e) stop("Vector of set values must contain values coercible to numeric")
    @@ -10343,21 +10713,24 @@

    teal.slice coverage - 65.92%

    365 - 2x + 2x +
          if (length(values) != 2L) stop("Vector of set values must have length two.")
    366 - 2x + 2x +
          if (values[1L] > values[2L]) stop("Vector of set values must be sorted.")
    367 - 125x + 125x +
          values
    @@ -10385,21 +10758,24 @@

    teal.slice coverage - 65.92%

    371 - 2x + 2x +
          if (values[1L] < private$get_choices()[1L]) values[1L] <- private$get_choices()[1L]
    372 - 2x + 2x +
          if (values[2L] > private$get_choices()[2L]) values[2L] <- private$get_choices()[2L]
    373 - 125x + 125x +
          values
    @@ -10441,35 +10817,40 @@

    teal.slice coverage - 65.92%

    379 - 35x + 35x +
          if (private$is_choice_limited) {
    380 - 1x + 1x +
            TRUE
    381 - 34x + 34x +
          } else if (!isTRUE(all.equal(private$get_selected(), private$get_choices()))) {
    382 - 32x + 32x +
            TRUE
    383 - 2x + 2x +
          } else if (!isTRUE(private$get_keep_inf()) && private$inf_count > 0) {
    @@ -10483,14 +10864,16 @@

    teal.slice coverage - 65.92%

    385 - 2x + 2x +
          } else if (!isTRUE(private$get_keep_na()) && private$na_count > 0) {
    386 - 1x + 1x +
            TRUE
    @@ -10504,7 +10887,8 @@

    teal.slice coverage - 65.92%

    388 - 1x + 1x +
            FALSE
    @@ -10553,21 +10937,24 @@

    teal.slice coverage - 65.92%

    395 - 5x + 5x +
          list(
    396 - 5x + 5x +
            list(type = "line", x0 = values[1], x1 = values[1], y0 = -100, y1 = 100, yref = "paper"),
    397 - 5x + 5x +
            list(type = "line", x0 = values[2], x1 = values[2], y0 = -100, y1 = 100, yref = "paper")
    @@ -10644,70 +11031,80 @@

    teal.slice coverage - 65.92%

    408 - 5x + 5x +
          ns <- NS(id)
    409 - 5x + 5x +
          isolate({
    410 - 5x + 5x +
            ui_input <- shinyWidgets::numericRangeInput(
    411 - 5x + 5x +
              inputId = ns("selection_manual"),
    412 - 5x + 5x +
              label = NULL,
    413 - 5x + 5x +
              min = private$get_choices()[1L],
    414 - 5x + 5x +
              max = private$get_choices()[2L],
    415 - 5x + 5x +
              value = private$get_selected(),
    416 - 5x + 5x +
              step = private$numeric_step,
    417 - 5x + 5x +
              width = "100%"
    @@ -10721,28 +11118,32 @@

    teal.slice coverage - 65.92%

    419 - 5x + 5x +
            tagList(
    420 - 5x + 5x +
              tags$div(
    421 - 5x + 5x +
                class = "choices_state",
    422 - 5x + 5x +
                tags$head(tags$script(
    @@ -10770,21 +11171,24 @@

    teal.slice coverage - 65.92%

    426 - 5x + 5x +
                  HTML(
    427 - 5x + 5x +
                    '$(document).ready(function() {
    428 - 5x + 5x +
                      $("[data-toggle=\'popover\']").popover();
    @@ -10798,35 +11202,40 @@

    teal.slice coverage - 65.92%

    430 - 5x + 5x +
                      $(document).on("click", function (e) {
    431 - 5x + 5x +
                        if (!$("[data-toggle=\'popover\']").is(e.target) &&
    432 - 5x + 5x +
                            $("[data-toggle=\'popover\']").has(e.target).length === 0 &&
    433 - 5x + 5x +
                            $(".popover").has(e.target).length === 0) {
    434 - 5x + 5x +
                          $("[data-toggle=\'popover\']").popover("hide");
    @@ -10868,105 +11277,120 @@

    teal.slice coverage - 65.92%

    440 - 5x + 5x +
                tags$div(
    441 - 5x + 5x +
                  actionLink(
    442 - 5x + 5x +
                    ns("plotly_info"),
    443 - 5x + 5x +
                    label = NULL,
    444 - 5x + 5x +
                    icon = icon("question-circle"),
    445 - 5x + 5x +
                    "data-toggle" = "popover",
    446 - 5x + 5x +
                    "data-html" = "true",
    447 - 5x + 5x +
                    "data-placement" = "left",
    448 - 5x + 5x +
                    "data-trigger" = "click",
    449 - 5x + 5x +
                    "data-title" = "Plot actions",
    450 - 5x + 5x +
                    "data-content" = "<p>
    451 - 5x + 5x +
                                      Drag vertical lines to set selection.<br>
    452 - 5x + 5x +
                                      Drag across plot to zoom in.<br>
    453 - 5x + 5x +
                                      Drag axis to pan.<br>
    454 - 5x + 5x +
                                      Double click to zoom out."
    @@ -10980,7 +11404,8 @@

    teal.slice coverage - 65.92%

    456 - 5x + 5x +
                  style = "text-align: right; font-size: 0.7em; margin-bottom: -1em; position: relative; z-index: 9;"
    @@ -10994,35 +11419,40 @@

    teal.slice coverage - 65.92%

    458 - 5x + 5x +
                shinycssloaders::withSpinner(
    459 - 5x + 5x +
                  plotly::plotlyOutput(ns("plot"), height = "50px"),
    460 - 5x + 5x +
                  type = 4,
    461 - 5x + 5x +
                  size = 0.25,
    462 - 5x + 5x +
                  hide.ui = FALSE
    @@ -11036,7 +11466,8 @@

    teal.slice coverage - 65.92%

    464 - 5x + 5x +
                ui_input
    @@ -11050,28 +11481,32 @@

    teal.slice coverage - 65.92%

    466 - 5x + 5x +
              tags$div(
    467 - 5x + 5x +
                class = "filter-card-body-keep-na-inf",
    468 - 5x + 5x +
                private$keep_inf_ui(ns("keep_inf")),
    469 - 5x + 5x +
                private$keep_na_ui(ns("keep_na"))
    @@ -11148,28 +11583,32 @@

    teal.slice coverage - 65.92%

    480 - 5x + 5x +
          moduleServer(
    481 - 5x + 5x +
            id = id,
    482 - 5x + 5x +
            function(input, output, session) {
    483 - 5x + 5x +
              logger::log_trace("RangeFilterState$server initializing, id: { private$get_id() }")
    @@ -11190,7 +11629,8 @@

    teal.slice coverage - 65.92%

    486 - 5x + 5x +
              selection_manual <- debounce(reactive(input$selection_manual), 200)
    @@ -11211,7 +11651,8 @@

    teal.slice coverage - 65.92%

    489 - 5x + 5x +
              plot_data <- c(private$plot_data, source = session$ns("histogram_plot"))
    @@ -11232,42 +11673,48 @@

    teal.slice coverage - 65.92%

    492 - 5x + 5x +
              output$plot <- plotly::renderPlotly({
    493 - 5x + 5x +
                histogram <- do.call(plotly::plot_ly, plot_data)
    494 - 5x + 5x +
                histogram <- do.call(plotly::layout, c(list(p = histogram), private$plot_layout()))
    495 - 5x + 5x +
                histogram <- do.call(plotly::config, c(list(p = histogram), private$plot_config()))
    496 - 5x + 5x +
                histogram <- do.call(plotly::add_histogram, c(list(p = histogram), private$plot_filtered()))
    497 - 5x + 5x +
                histogram
    @@ -11295,63 +11742,72 @@

    teal.slice coverage - 65.92%

    501 - 5x + 5x +
              private$observers$relayout <-
    502 - 5x + 5x +
                observeEvent(
    503 - 5x + 5x +
                  ignoreNULL = FALSE,
    504 - 5x + 5x +
                  ignoreInit = TRUE,
    505 - 5x + 5x +
                  eventExpr = plotly::event_data("plotly_relayout", source = session$ns("histogram_plot")),
    506 - 5x + 5x +
                  handlerExpr = {
    507 - 1x + 1x +
                    logger::log_trace("RangeFilterState$server@1 selection changed, id: { private$get_id() }")
    508 - 1x + 1x +
                    event <- plotly::event_data("plotly_relayout", source = session$ns("histogram_plot"))
    509 - 1x + 1x +
                    if (any(grepl("shapes", names(event)))) {
    @@ -11540,42 +11996,48 @@

    teal.slice coverage - 65.92%

    536 - 5x + 5x +
              private$observers$selection_api <-
    537 - 5x + 5x +
                observeEvent(
    538 - 5x + 5x +
                  ignoreNULL = FALSE,
    539 - 5x + 5x +
                  ignoreInit = TRUE,
    540 - 5x + 5x +
                  eventExpr = private$get_selected(),
    541 - 5x + 5x +
                  handlerExpr = {
    @@ -11666,35 +12128,40 @@

    teal.slice coverage - 65.92%

    554 - 5x + 5x +
              private$observers$selection_manual <- observeEvent(
    555 - 5x + 5x +
                ignoreNULL = FALSE,
    556 - 5x + 5x +
                ignoreInit = TRUE,
    557 - 5x + 5x +
                eventExpr = selection_manual(),
    558 - 5x + 5x +
                handlerExpr = {
    @@ -11960,14 +12427,16 @@

    teal.slice coverage - 65.92%

    596 - 5x + 5x +
              private$keep_inf_srv("keep_inf")
    597 - 5x + 5x +
              private$keep_na_srv("keep_na")
    @@ -11981,14 +12450,16 @@

    teal.slice coverage - 65.92%

    599 - 5x + 5x +
              logger::log_trace("RangeFilterState$server initialized, id: { private$get_id() }")
    600 - 5x + 5x +
              NULL
    @@ -12275,42 +12746,48 @@

    teal.slice coverage - 65.92%

    641 - 5x + 5x +
          selection <- private$get_selected()
    642 - 5x + 5x +
          tagList(
    643 - 5x + 5x +
            tags$span(HTML(selection[1], "&ndash;", selection[2]), class = "filter-card-summary-value"),
    644 - 5x + 5x +
            tags$span(
    645 - 5x + 5x +
              class = "filter-card-summary-controls",
    646 - 5x + 5x +
              if (private$na_count > 0) {
    @@ -12331,7 +12808,8 @@

    teal.slice coverage - 65.92%

    649 - 5x + 5x +
              if (private$inf_count > 0) {
    @@ -12415,7 +12893,8 @@

    teal.slice coverage - 65.92%

    661 - 5x + 5x +
          ns <- NS(id)
    @@ -12429,7 +12908,8 @@

    teal.slice coverage - 65.92%

    663 - 5x + 5x +
          if (private$inf_count > 0) {
    @@ -12569,7 +13049,8 @@

    teal.slice coverage - 65.92%

    683 - 5x + 5x +
            NULL
    @@ -12646,7 +13127,8 @@

    teal.slice coverage - 65.92%

    694 - 5x + 5x +
          moduleServer(id, function(input, output, session) {
    @@ -12674,42 +13156,48 @@

    teal.slice coverage - 65.92%

    698 - 5x + 5x +
            output$trigger_visible <- renderUI({
    699 - 5x + 5x +
              updateCountText(
    700 - 5x + 5x +
                inputId = "count_label",
    701 - 5x + 5x +
                label = "Keep Inf",
    702 - 5x + 5x +
                countmax = private$inf_count,
    703 - 5x + 5x +
                countnow = private$inf_filtered_count()
    @@ -12723,7 +13211,8 @@

    teal.slice coverage - 65.92%

    705 - 5x + 5x +
              NULL
    @@ -12765,35 +13254,40 @@

    teal.slice coverage - 65.92%

    711 - 5x + 5x +
            private$observers$keep_inf_api <- observeEvent(
    712 - 5x + 5x +
              ignoreNULL = TRUE, # its not possible for range that NULL is selected
    713 - 5x + 5x +
              ignoreInit = TRUE, # ignoreInit: should not matter because we set the UI with the desired initial state
    714 - 5x + 5x +
              eventExpr = private$get_keep_inf(),
    715 - 5x + 5x +
              handlerExpr = {
    @@ -12870,35 +13364,40 @@

    teal.slice coverage - 65.92%

    726 - 5x + 5x +
            private$observers$keep_inf <- observeEvent(
    727 - 5x + 5x +
              ignoreNULL = TRUE, # it's not possible for range that NULL is selected
    728 - 5x + 5x +
              ignoreInit = TRUE, # ignoreInit: should not matter because we set the UI with the desired initial state
    729 - 5x + 5x +
              eventExpr = input$value,
    730 - 5x + 5x +
              handlerExpr = {
    @@ -12947,7 +13446,8 @@

    teal.slice coverage - 65.92%

    737 - 5x + 5x +
            invisible(NULL)
    @@ -13366,7 +13866,8 @@

    teal.slice coverage - 65.92%

    55 - 23x + 23x +
          if (!requireNamespace("MultiAssayExperiment", quietly = TRUE)) {
    @@ -13387,21 +13888,24 @@

    teal.slice coverage - 65.92%

    58 - 23x + 23x +
          checkmate::assert_class(dataset, "MultiAssayExperiment")
    59 - 21x + 21x +
          super$initialize(dataset, dataname, keys, label)
    60 - 21x + 21x +
          experiment_names <- names(dataset)
    @@ -13422,49 +13926,56 @@

    teal.slice coverage - 65.92%

    63 - 21x + 21x +
          private$add_filter_states(
    64 - 21x + 21x +
            filter_states = init_filter_states(
    65 - 21x + 21x +
              data = dataset,
    66 - 21x + 21x +
              data_reactive = private$data_filtered_fun,
    67 - 21x + 21x +
              dataname = dataname,
    68 - 21x + 21x +
              datalabel = "subjects",
    69 - 21x + 21x +
              keys = self$get_keys()
    @@ -13478,7 +13989,8 @@

    teal.slice coverage - 65.92%

    71 - 21x + 21x +
            id = "subjects"
    @@ -13513,70 +14025,80 @@

    teal.slice coverage - 65.92%

    76 - 21x + 21x +
          lapply(
    77 - 21x + 21x +
            experiment_names,
    78 - 21x + 21x +
            function(experiment_name) {
    79 - 105x + 105x +
              data_reactive <- function(sid = "") private$data_filtered_fun(sid)[[experiment_name]]
    80 - 105x + 105x +
              private$add_filter_states(
    81 - 105x + 105x +
                filter_states = init_filter_states(
    82 - 105x + 105x +
                  data = dataset[[experiment_name]],
    83 - 105x + 105x +
                  data_reactive = data_reactive,
    84 - 105x + 105x +
                  dataname = dataname,
    85 - 105x + 105x +
                  datalabel = experiment_name
    @@ -13590,7 +14112,8 @@

    teal.slice coverage - 65.92%

    87 - 105x + 105x +
                id = experiment_name
    @@ -13681,35 +14204,40 @@

    teal.slice coverage - 65.92%

    100 - 15x + 15x +
          isolate({
    101 - 15x + 15x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initializing, dataname: { private$dataname }")
    102 - 15x + 15x +
            checkmate::assert_class(state, "teal_slices")
    103 - 14x + 14x +
            lapply(state, function(x) {
    104 - 52x + 52x +
              checkmate::assert_true(x$dataname == private$dataname, .var.name = "dataname matches private$dataname")
    @@ -13737,14 +14265,16 @@

    teal.slice coverage - 65.92%

    108 - 14x + 14x +
            subject_state <- Filter(function(x) is.null(x$experiment), state)
    109 - 14x + 14x +
            private$get_filter_states()[["subjects"]]$set_filter_state(subject_state)
    @@ -13772,28 +14302,32 @@

    teal.slice coverage - 65.92%

    113 - 14x + 14x +
            experiments <- unique(unlist(lapply(state, "[[", "experiment")))
    114 - 14x + 14x +
            available_experiments <- setdiff(names(private$get_filter_states()), "subjects")
    115 - 14x + 14x +
            excluded_filters <- setdiff(experiments, available_experiments)
    116 - 14x + 14x +
            if (length(excluded_filters)) {
    @@ -13863,21 +14397,24 @@

    teal.slice coverage - 65.92%

    126 - 14x + 14x +
            lapply(available_experiments, function(experiment) {
    127 - 70x + 70x +
              slices <- Filter(function(x) identical(x$experiment, experiment), state)
    128 - 70x + 70x +
              private$get_filter_states()[[experiment]]$set_filter_state(slices)
    @@ -13898,7 +14435,8 @@

    teal.slice coverage - 65.92%

    131 - 14x + 14x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initialized, dataname: { private$dataname }")
    @@ -13912,7 +14450,8 @@

    teal.slice coverage - 65.92%

    133 - 14x + 14x +
            invisible(NULL)
    @@ -14010,7 +14549,8 @@

    teal.slice coverage - 65.92%

    147 - 1x + 1x +
          checkmate::assert_class(state, "teal_slices")
    @@ -14024,14 +14564,16 @@

    teal.slice coverage - 65.92%

    149 - 1x + 1x +
          isolate({
    150 - 1x + 1x +
            logger::log_trace("{ class(self)[1] }$remove_filter_state removing filter(s), dataname: { private$dataname }")
    @@ -14045,14 +14587,16 @@

    teal.slice coverage - 65.92%

    152 - 1x + 1x +
            subject_state <- Filter(function(x) is.null(x$experiment), state)
    153 - 1x + 1x +
            private$get_filter_states()[["subjects"]]$remove_filter_state(subject_state)
    @@ -14080,28 +14624,32 @@

    teal.slice coverage - 65.92%

    157 - 1x + 1x +
            experiments <- unique(unlist(lapply(state, "[[", "experiment")))
    158 - 1x + 1x +
            available_experiments <- setdiff(names(private$get_filter_states()), "subjects")
    159 - 1x + 1x +
            excluded_filters <- setdiff(experiments, available_experiments)
    160 - 1x + 1x +
            if (length(excluded_filters)) {
    @@ -14164,7 +14712,8 @@

    teal.slice coverage - 65.92%

    169 - 1x + 1x +
            lapply(experiments, function(experiment) {
    @@ -14206,7 +14755,8 @@

    teal.slice coverage - 65.92%

    175 - 1x + 1x +
            logger::log_trace("{ class(self)[1] }$remove_filter_state removed filter(s), dataname: { private$dataname }")
    @@ -14227,7 +14777,8 @@

    teal.slice coverage - 65.92%

    178 - 1x + 1x +
          invisible(NULL)
    @@ -14514,21 +15065,24 @@

    teal.slice coverage - 65.92%

    219 - 2x + 2x +
          data <- self$get_dataset()
    220 - 2x + 2x +
          data_filtered <- self$get_dataset(TRUE)
    221 - 2x + 2x +
          experiment_names <- names(data)
    @@ -14542,28 +15096,32 @@

    teal.slice coverage - 65.92%

    223 - 2x + 2x +
          mae_info <- data.frame(
    224 - 2x + 2x +
            dataname = private$dataname,
    225 - 2x + 2x +
            subjects = nrow(SummarizedExperiment::colData(data)),
    226 - 2x + 2x +
            subjects_filtered = nrow(SummarizedExperiment::colData(data_filtered()))
    @@ -14584,49 +15142,56 @@

    teal.slice coverage - 65.92%

    229 - 2x + 2x +
          experiment_obs_info <- do.call("rbind", lapply(
    230 - 2x + 2x +
            experiment_names,
    231 - 2x + 2x +
            function(experiment_name) {
    232 - 10x + 10x +
              data.frame(
    233 - 10x + 10x +
                dataname = sprintf("- %s", experiment_name),
    234 - 10x + 10x +
                obs = nrow(data[[experiment_name]]),
    235 - 10x + 10x +
                obs_filtered = nrow(data_filtered()[[experiment_name]])
    @@ -14661,21 +15226,24 @@

    teal.slice coverage - 65.92%

    240 - 2x + 2x +
          get_experiment_keys <- function(mae, experiment) {
    241 - 20x + 20x +
            sample_subset <- subset(MultiAssayExperiment::sampleMap(mae), colname %in% colnames(experiment))
    242 - 20x + 20x +
            length(unique(sample_subset$primary))
    @@ -14696,42 +15264,48 @@

    teal.slice coverage - 65.92%

    245 - 2x + 2x +
          experiment_subjects_info <- do.call("rbind", lapply(
    246 - 2x + 2x +
            experiment_names,
    247 - 2x + 2x +
            function(experiment_name) {
    248 - 10x + 10x +
              data.frame(
    249 - 10x + 10x +
                subjects = get_experiment_keys(data, data[[experiment_name]]),
    250 - 10x + 10x +
                subjects_filtered = get_experiment_keys(data_filtered(), data_filtered()[[experiment_name]])
    @@ -14766,14 +15340,16 @@

    teal.slice coverage - 65.92%

    255 - 2x + 2x +
          experiment_info <- cbind(experiment_obs_info, experiment_subjects_info)
    256 - 2x + 2x +
          dplyr::bind_rows(mae_info, experiment_info)
    @@ -15668,21 +16244,24 @@

    teal.slice coverage - 65.92%

    124 - 580x + 580x +
      checkmate::assert_string(dataname)
    125 - 573x + 573x +
      checkmate::assert_flag(fixed)
    126 - 571x + 571x +
      checkmate::assert_flag(anchored)
    @@ -15696,7 +16275,8 @@

    teal.slice coverage - 65.92%

    128 - 569x + 569x +
      formal_args <- as.list(environment())
    @@ -15710,7 +16290,8 @@

    teal.slice coverage - 65.92%

    130 - 569x + 569x +
      if (!missing(expr) && !missing(varname)) {
    @@ -15724,28 +16305,32 @@

    teal.slice coverage - 65.92%

    132 - 569x + 569x +
      } else if (!missing(expr)) {
    133 - 30x + 30x +
        checkmate::assert_string(id)
    134 - 27x + 27x +
        checkmate::assert_string(title)
    135 - 24x + 24x +
        checkmate::assert_string(expr)
    @@ -15759,84 +16344,96 @@

    teal.slice coverage - 65.92%

    137 - 23x + 23x +
        formal_args$fixed <- TRUE
    138 - 23x + 23x +
        ts_expr_args <- c("dataname", "id", "expr", "fixed", "anchored", "title")
    139 - 23x + 23x +
        formal_args <- formal_args[ts_expr_args]
    140 - 23x + 23x +
        ans <- do.call(reactiveValues, c(formal_args, list(...)))
    141 - 23x + 23x +
        class(ans) <- c("teal_slice_expr", "teal_slice", class(ans))
    142 - 539x + 539x +
      } else if (!missing(varname)) {
    143 - 538x + 538x +
        checkmate::assert_string(varname)
    144 - 535x + 535x +
        checkmate::assert_multi_class(choices, .filterable_class, null.ok = TRUE)
    145 - 534x + 534x +
        checkmate::assert_multi_class(selected, .filterable_class, null.ok = TRUE)
    146 - 532x + 532x +
        checkmate::assert_flag(keep_na, null.ok = TRUE)
    147 - 531x + 531x +
        checkmate::assert_flag(keep_inf, null.ok = TRUE)
    148 - 530x + 530x +
        checkmate::assert_flag(multiple)
    @@ -15850,21 +16447,24 @@

    teal.slice coverage - 65.92%

    150 - 530x + 530x +
        ts_var_args <- c(
    151 - 530x + 530x +
          "dataname", "varname", "id", "choices", "selected", "keep_na", "keep_inf",
    152 - 530x + 530x +
          "fixed", "anchored", "multiple"
    @@ -15878,42 +16478,48 @@

    teal.slice coverage - 65.92%

    154 - 530x + 530x +
        formal_args <- formal_args[ts_var_args]
    155 - 530x + 530x +
        args <- c(formal_args, list(...))
    156 - 530x + 530x +
        args[c("choices", "selected")] <-
    157 - 530x + 530x +
          lapply(args[c("choices", "selected")], function(x) if (is.factor(x)) as.character(x) else x)
    158 - 530x + 530x +
        if (missing(id)) {
    159 - 521x + 521x +
          args$id <- get_default_slice_id(args)
    @@ -15927,7 +16533,8 @@

    teal.slice coverage - 65.92%

    161 - 9x + 9x +
          checkmate::assert_string(id)
    @@ -15941,14 +16548,16 @@

    teal.slice coverage - 65.92%

    163 - 527x + 527x +
        ans <- do.call(reactiveValues, args)
    164 - 527x + 527x +
        class(ans) <- c("teal_slice_var", "teal_slice", class(ans))
    @@ -15962,7 +16571,8 @@

    teal.slice coverage - 65.92%

    166 - 1x + 1x +
        stop("Must provide either `expr` or `varname`.")
    @@ -15983,7 +16593,8 @@

    teal.slice coverage - 65.92%

    169 - 550x + 550x +
      ans
    @@ -16116,7 +16727,8 @@

    teal.slice coverage - 65.92%

    188 - 4x + 4x +
      inherits(x, "teal_slice")
    @@ -16221,7 +16833,8 @@

    teal.slice coverage - 65.92%

    203 - 283x + 283x +
      formal_args <- setdiff(names(formals(teal_slice)), "...")
    @@ -16235,7 +16848,8 @@

    teal.slice coverage - 65.92%

    205 - 283x + 283x +
      x <- if (isRunning()) {
    @@ -16256,7 +16870,8 @@

    teal.slice coverage - 65.92%

    208 - 283x + 283x +
        isolate(reactiveValuesToList(x))
    @@ -16277,14 +16892,16 @@

    teal.slice coverage - 65.92%

    211 - 283x + 283x +
      formal_args <- intersect(formal_args, names(x))
    212 - 283x + 283x +
      extra_args <- rev(setdiff(names(x), formal_args))
    @@ -16298,7 +16915,8 @@

    teal.slice coverage - 65.92%

    214 - 283x + 283x +
      x[c(formal_args, extra_args)]
    @@ -16354,14 +16972,16 @@

    teal.slice coverage - 65.92%

    222 - 116x + 116x +
      checkmate::assert_flag(show_all)
    223 - 92x + 92x +
      checkmate::assert_flag(trim_lines)
    @@ -16375,14 +16995,16 @@

    teal.slice coverage - 65.92%

    225 - 86x + 86x +
      x_list <- as.list(x)
    226 - 47x + 47x +
      if (!show_all) x_list <- Filter(Negate(is.null), x_list)
    @@ -16396,7 +17018,8 @@

    teal.slice coverage - 65.92%

    228 - 86x + 86x +
      jsonify(x_list, trim_lines)
    @@ -16445,7 +17068,8 @@

    teal.slice coverage - 65.92%

    235 - 15x + 15x +
      cat(format(x, ...))
    @@ -16571,7 +17195,8 @@

    teal.slice coverage - 65.92%

    253 - 131x + 131x +
      checkmate::assert_list(x)
    @@ -16585,28 +17210,32 @@

    teal.slice coverage - 65.92%

    255 - 131x + 131x +
      x_json <- to_json(x)
    256 - 131x + 131x +
      x_json_justified <- justify_json(x_json)
    257 - 121x + 121x +
      if (trim_lines) x_json_justified <- trim_lines_json(x_json_justified)
    258 - 131x + 131x +
      paste(x_json_justified, collapse = "\n")
    @@ -16711,35 +17340,40 @@

    teal.slice coverage - 65.92%

    273 - 131x + 131x +
      no_unbox <- function(x) {
    274 - 2390x + 2390x +
        vars <- c("selected", "choices")
    275 - 2390x + 2390x +
        if (is.list(x)) {
    276 - 385x + 385x +
          for (var in vars) {
    277 - 307x + 307x +
            if (!is.null(x[[var]])) x[[var]] <- I(format_time(x[[var]]))
    @@ -16753,7 +17387,8 @@

    teal.slice coverage - 65.92%

    279 - 385x + 385x +
          lapply(x, no_unbox)
    @@ -16767,7 +17402,8 @@

    teal.slice coverage - 65.92%

    281 - 2005x + 2005x +
          x
    @@ -16795,7 +17431,8 @@

    teal.slice coverage - 65.92%

    285 - 131x + 131x +
      jsonlite::toJSON(no_unbox(x), pretty = TRUE, auto_unbox = TRUE, digits = 16, null = "null")
    @@ -16907,14 +17544,16 @@

    teal.slice coverage - 65.92%

    301 - 307x + 307x +
      if ("POSIXt" %in% class(x)) {
    302 - 20x + 20x +
        format(x, format = "%Y-%m-%d %H:%M:%S", usetz = TRUE, tz = "UTC")
    @@ -16928,7 +17567,8 @@

    teal.slice coverage - 65.92%

    304 - 287x + 287x +
        x
    @@ -17033,35 +17673,40 @@

    teal.slice coverage - 65.92%

    319 - 131x + 131x +
      format_name <- function(name, name_width) {
    320 - 2775x + 2775x +
        if (nchar(name) == 1 || nchar(gsub("\\s", "", name)) <= 2) {
    321 - 630x + 630x +
          return(name)
    322 - 2145x + 2145x +
        } else if (grepl("slices|attributes", name)) {
    323 - 90x + 90x +
          paste0(name, ":")
    @@ -17075,7 +17720,8 @@

    teal.slice coverage - 65.92%

    325 - 2055x + 2055x +
          paste(format(name, width = name_width), ":")
    @@ -17096,28 +17742,32 @@

    teal.slice coverage - 65.92%

    328 - 131x + 131x +
      json_lines <- strsplit(json, "\n")[[1]]
    329 - 131x + 131x +
      json_lines_split <- regmatches(json_lines, regexpr(":", json_lines), invert = TRUE)
    330 - 131x + 131x +
      name_width <- max(unlist(regexpr(":", json_lines))) - 1
    331 - 131x + 131x +
      vapply(json_lines_split, function(x) paste0(format_name(x[1], name_width), stats::na.omit(x[2])), character(1))
    @@ -17222,35 +17872,40 @@

    teal.slice coverage - 65.92%

    346 - 121x + 121x +
      name_width <- max(unlist(gregexpr(":", x))) - 1
    347 - 121x + 121x +
      trim_position <- name_width + 37L
    348 - 121x + 121x +
      x_trim <- substr(x, 1, trim_position)
    349 - 121x + 121x +
      substr(x_trim, trim_position - 2, trim_position) <- "..."
    350 - 121x + 121x +
      x_trim
    @@ -17418,28 +18073,32 @@

    teal.slice coverage - 65.92%

    374 - 610x + 610x +
      checkmate::assert_multi_class(x, c("teal_slice", "list"))
    375 - 610x + 610x +
      isolate({
    376 - 610x + 610x +
        if (inherits(x, "teal_slice_expr") || is.null(x$varname)) {
    377 - 10x + 10x +
          x$id
    @@ -17453,28 +18112,32 @@

    teal.slice coverage - 65.92%

    379 - 600x + 600x +
          paste(
    380 - 600x + 600x +
            Filter(
    381 - 600x + 600x +
              length,
    382 - 600x + 600x +
              as.list(x)[c("dataname", "varname", "experiment", "arg")]
    @@ -17488,7 +18151,8 @@

    teal.slice coverage - 65.92%

    384 - 600x + 600x +
            collapse = " "
    @@ -18019,14 +18683,16 @@

    teal.slice coverage - 65.92%

    71 - 103x + 103x +
          checkmate::assert_data_frame(dataset)
    72 - 101x + 101x +
          super$initialize(dataset, dataname, keys, label)
    @@ -18047,21 +18713,24 @@

    teal.slice coverage - 65.92%

    75 - 99x + 99x +
          if (!is.null(parent)) {
    76 - 10x + 10x +
            checkmate::assert_character(parent_name, len = 1)
    77 - 10x + 10x +
            checkmate::assert_character(join_keys, min.len = 1)
    @@ -18075,14 +18744,16 @@

    teal.slice coverage - 65.92%

    79 - 10x + 10x +
            private$parent_name <- parent_name
    80 - 10x + 10x +
            private$join_keys <- join_keys
    @@ -18096,28 +18767,32 @@

    teal.slice coverage - 65.92%

    82 - 10x + 10x +
            private$data_filtered_fun <- function(sid = "") {
    83 - 8x + 8x +
              checkmate::assert_character(sid)
    84 - 8x + 8x +
              if (length(sid)) {
    85 - 8x + 8x +
                logger::log_trace("filtering data dataname: { dataname }, sid: { sid }")
    @@ -18145,42 +18820,48 @@

    teal.slice coverage - 65.92%

    89 - 8x + 8x +
              env <- new.env(parent = parent.env(globalenv()))
    90 - 8x + 8x +
              env[[dataname]] <- private$dataset
    91 - 8x + 8x +
              env[[parent_name]] <- parent()
    92 - 8x + 8x +
              filter_call <- self$get_call(sid)
    93 - 8x + 8x +
              eval_expr_with_msg(filter_call, env)
    94 - 8x + 8x +
              get(x = dataname, envir = env)
    @@ -18208,42 +18889,48 @@

    teal.slice coverage - 65.92%

    98 - 99x + 99x +
          private$add_filter_states(
    99 - 99x + 99x +
            filter_states = init_filter_states(
    100 - 99x + 99x +
              data = dataset,
    101 - 99x + 99x +
              data_reactive = private$data_filtered_fun,
    102 - 99x + 99x +
              dataname = dataname,
    103 - 99x + 99x +
              keys = self$get_keys()
    @@ -18257,7 +18944,8 @@

    teal.slice coverage - 65.92%

    105 - 99x + 99x +
            id = "filter"
    @@ -18285,35 +18973,40 @@

    teal.slice coverage - 65.92%

    109 - 99x + 99x +
          if (!is.null(parent)) {
    110 - 10x + 10x +
            fs <- teal_slices(
    111 - 10x + 10x +
              exclude_varnames = structure(
    112 - 10x + 10x +
                list(intersect(colnames(dataset), colnames(isolate(parent())))),
    113 - 10x + 10x +
                names = private$dataname
    @@ -18334,7 +19027,8 @@

    teal.slice coverage - 65.92%

    116 - 10x + 10x +
            self$set_filter_state(fs)
    @@ -18355,7 +19049,8 @@

    teal.slice coverage - 65.92%

    119 - 99x + 99x +
          invisible(self)
    @@ -18481,28 +19176,32 @@

    teal.slice coverage - 65.92%

    137 - 42x + 42x +
          logger::log_trace("DataframeFilteredDataset$get_call initializing for dataname: { private$dataname }")
    138 - 42x + 42x +
          filter_call <- super$get_call(sid)
    139 - 42x + 42x +
          dataname <- private$dataname
    140 - 42x + 42x +
          parent_dataname <- private$parent_name
    @@ -18516,28 +19215,32 @@

    teal.slice coverage - 65.92%

    142 - 42x + 42x +
          if (!identical(parent_dataname, character(0))) {
    143 - 9x + 9x +
            join_keys <- private$join_keys
    144 - 9x + 9x +
            parent_keys <- unname(join_keys)
    145 - 9x + 9x +
            dataset_keys <- names(join_keys)
    @@ -18551,7 +19254,8 @@

    teal.slice coverage - 65.92%

    147 - 9x + 9x +
            y_arg <- if (length(parent_keys) == 0L) {
    @@ -18572,28 +19276,32 @@

    teal.slice coverage - 65.92%

    150 - 9x + 9x +
              sprintf(
    151 - 9x + 9x +
                "%s[, c(%s), drop = FALSE]",
    152 - 9x + 9x +
                parent_dataname,
    153 - 9x + 9x +
                toString(dQuote(parent_keys, q = FALSE))
    @@ -18621,7 +19329,8 @@

    teal.slice coverage - 65.92%

    157 - 9x + 9x +
            more_args <- if (length(parent_keys) == 0 || length(dataset_keys) == 0) {
    @@ -18635,14 +19344,16 @@

    teal.slice coverage - 65.92%

    159 - 9x + 9x +
            } else if (identical(parent_keys, dataset_keys)) {
    160 - 7x + 7x +
              list(by = parent_keys)
    @@ -18656,7 +19367,8 @@

    teal.slice coverage - 65.92%

    162 - 2x + 2x +
              list(by = stats::setNames(parent_keys, dataset_keys))
    @@ -18677,7 +19389,8 @@

    teal.slice coverage - 65.92%

    165 - 9x + 9x +
            merge_call <- call(
    @@ -18691,49 +19404,56 @@

    teal.slice coverage - 65.92%

    167 - 9x + 9x +
              as.name(dataname),
    168 - 9x + 9x +
              as.call(
    169 - 9x + 9x +
                c(
    170 - 9x + 9x +
                  str2lang("dplyr::inner_join"),
    171 - 9x + 9x +
                  x = as.name(dataname),
    172 - 9x + 9x +
                  y = str2lang(y_arg),
    173 - 9x + 9x +
                  more_args
    @@ -18768,7 +19488,8 @@

    teal.slice coverage - 65.92%

    178 - 9x + 9x +
            filter_call <- c(filter_call, merge_call)
    @@ -18782,14 +19503,16 @@

    teal.slice coverage - 65.92%

    180 - 42x + 42x +
          logger::log_trace("DataframeFilteredDataset$get_call initializing for dataname: { private$dataname }")
    181 - 42x + 42x +
          filter_call
    @@ -18859,35 +19582,40 @@

    teal.slice coverage - 65.92%

    191 - 81x + 81x +
          isolate({
    192 - 81x + 81x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initializing, dataname: { private$dataname }")
    193 - 81x + 81x +
            checkmate::assert_class(state, "teal_slices")
    194 - 80x + 80x +
            lapply(state, function(slice) {
    195 - 97x + 97x +
              checkmate::assert_true(slice$dataname == private$dataname)
    @@ -18901,14 +19629,16 @@

    teal.slice coverage - 65.92%

    197 - 80x + 80x +
            private$get_filter_states()[[1L]]$set_filter_state(state = state)
    198 - 80x + 80x +
            invisible(NULL)
    @@ -19006,7 +19736,8 @@

    teal.slice coverage - 65.92%

    212 - 11x + 11x +
          checkmate::assert_class(state, "teal_slices")
    @@ -19020,14 +19751,16 @@

    teal.slice coverage - 65.92%

    214 - 11x + 11x +
          isolate({
    215 - 11x + 11x +
            logger::log_trace("{ class(self)[1] }$remove_filter_state removing filter(s), dataname: { private$dataname }")
    @@ -19041,14 +19774,16 @@

    teal.slice coverage - 65.92%

    217 - 11x + 11x +
            varnames <- unique(unlist(lapply(state, "[[", "varname")))
    218 - 11x + 11x +
            private$get_filter_states()[[1]]$remove_filter_state(state)
    @@ -19062,7 +19797,8 @@

    teal.slice coverage - 65.92%

    220 - 11x + 11x +
            logger::log_trace("{ class(self)[1] }$remove_filter_state removed filter(s), dataname: { private$dataname }")
    @@ -19083,7 +19819,8 @@

    teal.slice coverage - 65.92%

    223 - 11x + 11x +
          invisible(NULL)
    @@ -19244,7 +19981,8 @@

    teal.slice coverage - 65.92%

    246 - 12x + 12x +
          logger::log_trace("FilteredDataset$srv_filter_overview initialized")
    @@ -19265,14 +20003,16 @@

    teal.slice coverage - 65.92%

    249 - 12x + 12x +
          subject_keys <- if (length(private$parent_name) > 0) {
    250 - 1x + 1x +
            names(private$join_keys)
    @@ -19286,7 +20026,8 @@

    teal.slice coverage - 65.92%

    252 - 11x + 11x +
            self$get_keys()
    @@ -19300,49 +20041,56 @@

    teal.slice coverage - 65.92%

    254 - 12x + 12x +
          dataset <- self$get_dataset()
    255 - 12x + 12x +
          data_filtered <- self$get_dataset(TRUE)
    256 - 12x + 12x +
          if (length(subject_keys) == 0) {
    257 - 10x + 10x +
            data.frame(
    258 - 10x + 10x +
              dataname = private$dataname,
    259 - 10x + 10x +
              obs = nrow(dataset),
    260 - 10x + 10x +
              obs_filtered = nrow(data_filtered())
    @@ -19363,42 +20111,48 @@

    teal.slice coverage - 65.92%

    263 - 2x + 2x +
            data.frame(
    264 - 2x + 2x +
              dataname = private$dataname,
    265 - 2x + 2x +
              obs = nrow(dataset),
    266 - 2x + 2x +
              obs_filtered = nrow(data_filtered()),
    267 - 2x + 2x +
              subjects = nrow(unique(dataset[subject_keys])),
    268 - 2x + 2x +
              subjects_filtered = nrow(unique(data_filtered()[subject_keys]))
    @@ -20566,21 +21320,24 @@

    teal.slice coverage - 65.92%

    155 - 25x + 25x +
          isolate({
    156 - 25x + 25x +
            checkmate::assert_multi_class(x, c("POSIXct", "POSIXlt"))
    157 - 24x + 24x +
            checkmate::assert_class(x_reactive, "reactive")
    @@ -20594,35 +21351,40 @@

    teal.slice coverage - 65.92%

    159 - 24x + 24x +
            super$initialize(
    160 - 24x + 24x +
              x = x,
    161 - 24x + 24x +
              x_reactive = x_reactive,
    162 - 24x + 24x +
              slice = slice,
    163 - 24x + 24x +
              extract_type = extract_type
    @@ -20636,28 +21398,32 @@

    teal.slice coverage - 65.92%

    165 - 24x + 24x +
            checkmate::assert_multi_class(slice$choices, c("POSIXct", "POSIXlt"), null.ok = TRUE)
    166 - 23x + 23x +
            private$set_choices(slice$choices)
    167 - 15x + 15x +
            if (is.null(slice$selected)) slice$selected <- slice$choices
    168 - 23x + 23x +
            private$set_selected(slice$selected)
    @@ -20678,7 +21444,8 @@

    teal.slice coverage - 65.92%

    171 - 22x + 22x +
          invisible(self)
    @@ -20755,14 +21522,16 @@

    teal.slice coverage - 65.92%

    182 - 7x + 7x +
          if (isFALSE(private$is_any_filtered())) {
    183 - 1x + 1x +
            return(NULL)
    @@ -20776,63 +21545,72 @@

    teal.slice coverage - 65.92%

    185 - 4x + 4x +
          if (missing(dataname)) dataname <- private$get_dataname()
    186 - 6x + 6x +
          varname <- private$get_varname_prefixed(dataname)
    187 - 6x + 6x +
          choices <- private$get_selected()
    188 - 6x + 6x +
          tzone <- Find(function(x) x != "", attr(as.POSIXlt(choices), "tzone"))
    189 - 6x + 6x +
          class <- class(choices)[1L]
    190 - 6x + 6x +
          date_fun <- as.name(
    191 - 6x + 6x +
            switch(class,
    192 - 6x + 6x +
              "POSIXct" = "as.POSIXct",
    193 - 6x + 6x +
              "POSIXlt" = "as.POSIXlt"
    @@ -20853,21 +21631,24 @@

    teal.slice coverage - 65.92%

    196 - 6x + 6x +
          choices <- as.character(choices + c(0, 1))
    197 - 6x + 6x +
          filter_call <-
    198 - 6x + 6x +
            call(
    @@ -20881,7 +21662,8 @@

    teal.slice coverage - 65.92%

    200 - 6x + 6x +
              call(
    @@ -20895,14 +21677,16 @@

    teal.slice coverage - 65.92%

    202 - 6x + 6x +
                varname,
    203 - 6x + 6x +
                as.call(list(date_fun, choices[1L], tz = tzone))
    @@ -20916,7 +21700,8 @@

    teal.slice coverage - 65.92%

    205 - 6x + 6x +
              call(
    @@ -20930,14 +21715,16 @@

    teal.slice coverage - 65.92%

    207 - 6x + 6x +
                varname,
    208 - 6x + 6x +
                as.call(list(date_fun, choices[2L], tz = tzone))
    @@ -20958,7 +21745,8 @@

    teal.slice coverage - 65.92%

    211 - 6x + 6x +
          private$add_keep_na_call(filter_call, varname)
    @@ -21021,14 +21809,16 @@

    teal.slice coverage - 65.92%

    220 - 23x + 23x +
          if (is.null(choices)) {
    221 - 20x + 20x +
            choices <- as.POSIXct(trunc(range(private$x, na.rm = TRUE), units = "secs"))
    @@ -21042,28 +21832,32 @@

    teal.slice coverage - 65.92%

    223 - 3x + 3x +
            choices <- as.POSIXct(choices, units = "secs")
    224 - 3x + 3x +
            choices_adjusted <- c(
    225 - 3x + 3x +
              max(choices[1L], min(as.POSIXct(private$x), na.rm = TRUE)),
    226 - 3x + 3x +
              min(choices[2L], max(as.POSIXct(private$x), na.rm = TRUE))
    @@ -21077,28 +21871,32 @@

    teal.slice coverage - 65.92%

    228 - 3x + 3x +
            if (any(choices != choices_adjusted)) {
    229 - 1x + 1x +
              warning(sprintf(
    230 - 1x + 1x +
                "Choices adjusted (some values outside of variable range). Varname: %s, dataname: %s.",
    231 - 1x + 1x +
                private$get_varname(), private$get_dataname()
    @@ -21112,7 +21910,8 @@

    teal.slice coverage - 65.92%

    233 - 1x + 1x +
              choices <- choices_adjusted
    @@ -21126,35 +21925,40 @@

    teal.slice coverage - 65.92%

    235 - 3x + 3x +
            if (choices[1L] >= choices[2L]) {
    236 - 1x + 1x +
              warning(sprintf(
    237 - 1x + 1x +
                "Invalid choices: lower is higher / equal to upper, or not in range of variable values.
    238 - 1x + 1x +
                Setting defaults. Varname: %s, dataname: %s.",
    239 - 1x + 1x +
                private$get_varname(), private$get_dataname()
    @@ -21168,7 +21972,8 @@

    teal.slice coverage - 65.92%

    241 - 1x + 1x +
              choices <- range(private$x, na.rm = TRUE)
    @@ -21196,14 +22001,16 @@

    teal.slice coverage - 65.92%

    245 - 23x + 23x +
          private$set_is_choice_limited(private$x, choices)
    246 - 23x + 23x +
          private$x <- private$x[
    @@ -21217,21 +22024,24 @@

    teal.slice coverage - 65.92%

    248 - 23x + 23x +
              as.POSIXct(trunc(private$x, units = "secs")) >= choices[1L] &
    249 - 23x + 23x +
                as.POSIXct(trunc(private$x, units = "secs")) <= choices[2L]
    250 - 23x + 23x +
            ) | is.na(private$x)
    @@ -21245,14 +22055,16 @@

    teal.slice coverage - 65.92%

    252 - 23x + 23x +
          private$teal_slice$choices <- choices
    253 - 23x + 23x +
          invisible(NULL)
    @@ -21294,14 +22106,16 @@

    teal.slice coverage - 65.92%

    259 - 23x + 23x +
          private$is_choice_limited <- (any(xl < choices[1L], na.rm = TRUE) | any(xl > choices[2L], na.rm = TRUE))
    260 - 23x + 23x +
          invisible(NULL)
    @@ -21322,21 +22136,24 @@

    teal.slice coverage - 65.92%

    263 - 34x + 34x +
          tryCatch(
    264 - 34x + 34x +
            expr = {
    265 - 34x + 34x +
              values <- as.POSIXct(values, origin = "1970-01-01 00:00:00")
    @@ -21350,7 +22167,8 @@

    teal.slice coverage - 65.92%

    267 - 31x + 31x +
              values
    @@ -21364,7 +22182,8 @@

    teal.slice coverage - 65.92%

    269 - 34x + 34x +
            error = function(e) stop("Vector of set values must contain values coercible to POSIX.")
    @@ -21392,42 +22211,48 @@

    teal.slice coverage - 65.92%

    273 - 1x + 1x +
          if (length(values) != 2) stop("Vector of set values must have length two.")
    274 - 30x + 30x +
          if (values[1] > values[2]) {
    275 - 1x + 1x +
            warning(
    276 - 1x + 1x +
              sprintf(
    277 - 1x + 1x +
                "Start date '%s' is set after the end date '%s', the values will be replaced by a default datetime range.",
    278 - 1x + 1x +
                values[1], values[2]
    @@ -21448,7 +22273,8 @@

    teal.slice coverage - 65.92%

    281 - 1x + 1x +
            values <- isolate(private$get_choices())
    @@ -21462,7 +22288,8 @@

    teal.slice coverage - 65.92%

    283 - 30x + 30x +
          values
    @@ -21483,42 +22310,48 @@

    teal.slice coverage - 65.92%

    286 - 30x + 30x +
          choices <- private$get_choices()
    287 - 30x + 30x +
          if (values[1] < choices[1L] || values[1] > choices[2L]) {
    288 - 5x + 5x +
            warning(
    289 - 5x + 5x +
              sprintf(
    290 - 5x + 5x +
                "Value: %s is outside of the range for the column '%s' in dataset '%s', setting minimum possible value.",
    291 - 5x + 5x +
                values[1], private$get_varname(), toString(private$get_dataname())
    @@ -21539,7 +22372,8 @@

    teal.slice coverage - 65.92%

    294 - 5x + 5x +
            values[1] <- choices[1L]
    @@ -21560,35 +22394,40 @@

    teal.slice coverage - 65.92%

    297 - 30x + 30x +
          if (values[2] > choices[2L] | values[2] < choices[1L]) {
    298 - 5x + 5x +
            warning(
    299 - 5x + 5x +
              sprintf(
    300 - 5x + 5x +
                "Value: '%s' is outside of the range for the column '%s' in dataset '%s', setting maximum possible value.",
    301 - 5x + 5x +
                values[2], private$get_varname(), toString(private$get_dataname())
    @@ -21609,7 +22448,8 @@

    teal.slice coverage - 65.92%

    304 - 5x + 5x +
            values[2] <- choices[2L]
    @@ -21630,7 +22470,8 @@

    teal.slice coverage - 65.92%

    307 - 30x + 30x +
          values
    @@ -23813,35 +24654,40 @@

    teal.slice coverage - 65.92%

    66 - 195x + 195x +
      checkmate::assert_class(x_reactive, "reactive")
    67 - 194x + 194x +
      checkmate::assert_character(extract_type, max.len = 1, any.missing = FALSE)
    68 - 194x + 194x +
      checkmate::assert_class(slice, "teal_slice")
    69 - 193x + 193x +
      if (length(extract_type) == 1) {
    70 - 43x + 43x +
        checkmate::assert_choice(extract_type, choices = c("list", "matrix"))
    @@ -23862,42 +24708,48 @@

    teal.slice coverage - 65.92%

    73 - 192x + 192x +
      if (all(is.na(x))) {
    74 - 1x + 1x +
        EmptyFilterState$new(
    75 - 1x + 1x +
          x = x,
    76 - 1x + 1x +
          x_reactive = x_reactive,
    77 - 1x + 1x +
          slice = slice,
    78 - 1x + 1x +
          extract_type = extract_type
    @@ -23918,7 +24770,8 @@

    teal.slice coverage - 65.92%

    81 - 191x + 191x +
        UseMethod("init_filter_state")
    @@ -23988,35 +24841,40 @@

    teal.slice coverage - 65.92%

    91 - 1x + 1x +
      args <- list(
    92 - 1x + 1x +
        x = x,
    93 - 1x + 1x +
        x_reactive = x_reactive,
    94 - 1x + 1x +
        extract_type = extract_type,
    95 - 1x + 1x +
        slice
    @@ -24037,7 +24895,8 @@

    teal.slice coverage - 65.92%

    98 - 1x + 1x +
      do.call(FilterState$new, args)
    @@ -24100,35 +24959,40 @@

    teal.slice coverage - 65.92%

    107 - 1x + 1x +
      LogicalFilterState$new(
    108 - 1x + 1x +
        x = x,
    109 - 1x + 1x +
        x_reactive = x_reactive,
    110 - 1x + 1x +
        slice = slice,
    111 - 1x + 1x +
        extract_type = extract_type
    @@ -24198,35 +25062,40 @@

    teal.slice coverage - 65.92%

    121 - 120x + 120x +
      args <- list(
    122 - 120x + 120x +
        x = x,
    123 - 120x + 120x +
        x_reactive = x_reactive,
    124 - 120x + 120x +
        slice = slice,
    125 - 120x + 120x +
        extract_type = extract_type
    @@ -24247,14 +25116,16 @@

    teal.slice coverage - 65.92%

    128 - 120x + 120x +
      if (length(unique(x[!is.na(x)])) < getOption("teal.threshold_slider_vs_checkboxgroup")) {
    129 - 28x + 28x +
        do.call(ChoicesFilterState$new, args)
    @@ -24268,7 +25139,8 @@

    teal.slice coverage - 65.92%

    131 - 92x + 92x +
        do.call(RangeFilterState$new, args)
    @@ -24338,35 +25210,40 @@

    teal.slice coverage - 65.92%

    141 - 31x + 31x +
      ChoicesFilterState$new(
    142 - 31x + 31x +
        x = x,
    143 - 31x + 31x +
        x_reactive = x_reactive,
    144 - 31x + 31x +
        slice = slice,
    145 - 31x + 31x +
        extract_type = extract_type
    @@ -24436,35 +25313,40 @@

    teal.slice coverage - 65.92%

    155 - 32x + 32x +
      ChoicesFilterState$new(
    156 - 32x + 32x +
        x = x,
    157 - 32x + 32x +
        x_reactive = x_reactive,
    158 - 32x + 32x +
        slice = slice,
    159 - 32x + 32x +
        extract_type = extract_type
    @@ -24534,35 +25416,40 @@

    teal.slice coverage - 65.92%

    169 - 2x + 2x +
      args <- list(
    170 - 2x + 2x +
        x = x,
    171 - 2x + 2x +
        x_reactive = x_reactive,
    172 - 2x + 2x +
        slice = slice,
    173 - 2x + 2x +
        extract_type = extract_type
    @@ -24583,14 +25470,16 @@

    teal.slice coverage - 65.92%

    176 - 2x + 2x +
      if (length(unique(x[!is.na(x)])) < getOption("teal.threshold_slider_vs_checkboxgroup")) {
    177 - 1x + 1x +
        do.call(ChoicesFilterState$new, args)
    @@ -24604,7 +25493,8 @@

    teal.slice coverage - 65.92%

    179 - 1x + 1x +
        do.call(DateFilterState$new, args)
    @@ -24674,35 +25564,40 @@

    teal.slice coverage - 65.92%

    189 - 2x + 2x +
      args <- list(
    190 - 2x + 2x +
        x = x,
    191 - 2x + 2x +
        x_reactive = x_reactive,
    192 - 2x + 2x +
        slice = slice,
    193 - 2x + 2x +
        extract_type = extract_type
    @@ -24723,14 +25618,16 @@

    teal.slice coverage - 65.92%

    196 - 2x + 2x +
      if (length(unique(x[!is.na(x)])) < getOption("teal.threshold_slider_vs_checkboxgroup")) {
    197 - 1x + 1x +
        do.call(ChoicesFilterState$new, args)
    @@ -24744,7 +25641,8 @@

    teal.slice coverage - 65.92%

    199 - 1x + 1x +
        do.call(DatetimeFilterState$new, args)
    @@ -24814,35 +25712,40 @@

    teal.slice coverage - 65.92%

    209 - 2x + 2x +
      args <- list(
    210 - 2x + 2x +
        x = x,
    211 - 2x + 2x +
        x_reactive = x_reactive,
    212 - 2x + 2x +
        slice = slice,
    213 - 2x + 2x +
        extract_type = extract_type
    @@ -24863,14 +25766,16 @@

    teal.slice coverage - 65.92%

    216 - 2x + 2x +
      if (length(unique(x[!is.na(x)])) < getOption("teal.threshold_slider_vs_checkboxgroup")) {
    217 - 1x + 1x +
        do.call(ChoicesFilterState$new, args)
    @@ -24884,7 +25789,8 @@

    teal.slice coverage - 65.92%

    219 - 1x + 1x +
        do.call(DatetimeFilterState$new, args)
    @@ -24975,7 +25881,8 @@

    teal.slice coverage - 65.92%

    232 - 6x + 6x +
      FilterStateExpr$new(slice)
    @@ -25143,28 +26050,32 @@

    teal.slice coverage - 65.92%

    256 - 119x + 119x +
      checkmate::assert_string(color)
    257 - 119x + 119x +
      checkmate::assert(
    258 - 119x + 119x +
        checkmate::check_number(alpha, lower = 0, upper = 1, null.ok = TRUE),
    259 - 119x + 119x +
        checkmate::check_string(alpha, pattern = "[0-9a-f]{2}", null.ok = TRUE)
    @@ -25192,7 +26103,8 @@

    teal.slice coverage - 65.92%

    263 - 119x + 119x +
      sass_file <- if (utils::packageVersion("bslib") < as.package_version("0.5.1.9000")) {
    @@ -25213,7 +26125,8 @@

    teal.slice coverage - 65.92%

    266 - 119x + 119x +
        bslib::bs_theme()[["layers"]][[2]][["defaults"]][[1]][[1]]
    @@ -25227,7 +26140,8 @@

    teal.slice coverage - 65.92%

    268 - 119x + 119x +
      sass_file <- attr(sass_file, "sass_file_path")
    @@ -25248,7 +26162,8 @@

    teal.slice coverage - 65.92%

    271 - 119x + 119x +
      variables_file <- readLines(sass_file)
    @@ -25262,14 +26177,16 @@

    teal.slice coverage - 65.92%

    273 - 119x + 119x +
      ind <- grep("// scss-docs-(start|end) theme-color-variables", variables_file)
    274 - 119x + 119x +
      color_definitions <- variables_file[(ind[1] + 1L):(ind[2] - 1L)]
    @@ -25290,7 +26207,8 @@

    teal.slice coverage - 65.92%

    277 - 119x + 119x +
      color_names <- sub("(\\$)(\\w.+)(:.+)", "\\2", color_definitions)
    @@ -25311,7 +26229,8 @@

    teal.slice coverage - 65.92%

    280 - 119x + 119x +
      checkmate::assert_choice(color, color_names)
    @@ -25332,7 +26251,8 @@

    teal.slice coverage - 65.92%

    283 - 119x + 119x +
      color_references <- sub("(\\$)(\\w.+)(:\\s.+\\$)(\\w.+)(\\s.+)", "\\4", color_definitions)
    @@ -25353,42 +26273,48 @@

    teal.slice coverage - 65.92%

    286 - 119x + 119x +
      color_specification <- structure(color_references, names = color_names)
    287 - 119x + 119x +
      color_specification <- vapply(color_specification, function(x) {
    288 - 952x + 952x +
        line <- grep(sprintf("^\\$%s:\\s+#\\w{6}\\s+!default", x), variables_file, value = TRUE)
    289 - 952x + 952x +
        code <- sub("(.+)(#\\w{6})(\\s+.+)", "\\2", line)
    290 - 952x + 952x +
        code
    291 - 119x + 119x +
      }, character(1L))
    @@ -25402,7 +26328,8 @@

    teal.slice coverage - 65.92%

    293 - 119x + 119x +
      if (!is.null(alpha)) {
    @@ -25430,7 +26357,8 @@

    teal.slice coverage - 65.92%

    297 - 119x + 119x +
      paste0(color_specification[color], alpha)
    @@ -26500,42 +27428,48 @@

    teal.slice coverage - 65.92%

    151 - 160x + 160x +
          isolate({
    152 - 160x + 160x +
            checkmate::assert(
    153 - 160x + 160x +
              is.character(x),
    154 - 160x + 160x +
              is.factor(x),
    155 - 160x + 160x +
              length(unique(x[!is.na(x)])) < getOption("teal.threshold_slider_vs_checkboxgroup"),
    156 - 160x + 160x +
              combine = "or"
    @@ -26549,35 +27483,40 @@

    teal.slice coverage - 65.92%

    158 - 160x + 160x +
            super$initialize(
    159 - 160x + 160x +
              x = x,
    160 - 160x + 160x +
              x_reactive = x_reactive,
    161 - 160x + 160x +
              slice = slice,
    162 - 160x + 160x +
              extract_type = extract_type
    @@ -26591,63 +27530,72 @@

    teal.slice coverage - 65.92%

    164 - 160x + 160x +
            private$set_choices(slice$choices)
    165 - 160x + 160x +
            if (is.null(slice$selected) && slice$multiple) {
    166 - 42x + 42x +
              slice$selected <- private$get_choices()
    167 - 118x + 118x +
            } else if (is.null(slice$selected)) {
    168 - 1x + 1x +
              slice$selected <- private$get_choices()[1]
    169 - 117x + 117x +
            } else if (length(slice$selected) > 1 && !slice$multiple) {
    170 - 1x + 1x +
              warning(
    171 - 1x + 1x +
                "ChoicesFilterState allows \"selected\" to be of length 1 when \"multiple\" is FALSE. ",
    172 - 1x + 1x +
                "Only the first value will be used."
    @@ -26661,7 +27609,8 @@

    teal.slice coverage - 65.92%

    174 - 1x + 1x +
              slice$selected <- slice$selected[1]
    @@ -26675,21 +27624,24 @@

    teal.slice coverage - 65.92%

    176 - 160x + 160x +
            private$set_selected(slice$selected)
    177 - 160x + 160x +
            if (inherits(x, "POSIXt")) {
    178 - 9x + 9x +
              private$tzone <- Find(function(x) x != "", attr(as.POSIXlt(x), "tzone"))
    @@ -26710,7 +27662,8 @@

    teal.slice coverage - 65.92%

    181 - 160x + 160x +
          invisible(self)
    @@ -26787,14 +27740,16 @@

    teal.slice coverage - 65.92%

    192 - 61x + 61x +
          if (isFALSE(private$is_any_filtered())) {
    193 - 7x + 7x +
            return(NULL)
    @@ -26808,49 +27763,56 @@

    teal.slice coverage - 65.92%

    195 - 30x + 30x +
          if (missing(dataname)) dataname <- private$get_dataname()
    196 - 54x + 54x +
          varname <- private$get_varname_prefixed(dataname)
    197 - 54x + 54x +
          choices <- private$get_choices()
    198 - 54x + 54x +
          selected <- private$get_selected()
    199 - 54x + 54x +
          fun_compare <- if (length(selected) == 1L) "==" else "%in%"
    200 - 54x + 54x +
          filter_call <- if (length(selected) == 0) {
    201 - 6x + 6x +
            call("!", call(fun_compare, varname, make_c_call(as.character(choices))))
    @@ -26864,70 +27826,80 @@

    teal.slice coverage - 65.92%

    203 - 48x + 48x +
            if (setequal(selected, choices) && !private$is_choice_limited) {
    204 - 2x + 2x +
              NULL
    205 - 46x + 46x +
            } else if (inherits(private$x, "Date")) {
    206 - 1x + 1x +
              call(fun_compare, varname, call("as.Date", make_c_call(as.character(selected))))
    207 - 45x + 45x +
            } else if (inherits(private$x, c("POSIXct", "POSIXlt"))) {
    208 - 2x + 2x +
              class <- class(private$x)[1L]
    209 - 2x + 2x +
              date_fun <- as.name(
    210 - 2x + 2x +
                switch(class,
    211 - 2x + 2x +
                  "POSIXct" = "as.POSIXct",
    212 - 2x + 2x +
                  "POSIXlt" = "as.POSIXlt"
    @@ -26948,28 +27920,32 @@

    teal.slice coverage - 65.92%

    215 - 2x + 2x +
              call(
    216 - 2x + 2x +
                fun_compare,
    217 - 2x + 2x +
                varname,
    218 - 2x + 2x +
                as.call(list(date_fun, make_c_call(as.character(selected)), tz = private$tzone))
    @@ -26983,14 +27959,16 @@

    teal.slice coverage - 65.92%

    220 - 43x + 43x +
            } else if (is.numeric(private$x)) {
    221 - 7x + 7x +
              call(fun_compare, varname, make_c_call(as.numeric(selected)))
    @@ -27011,7 +27989,8 @@

    teal.slice coverage - 65.92%

    224 - 36x + 36x +
              call(fun_compare, varname, make_c_call(selected))
    @@ -27032,7 +28011,8 @@

    teal.slice coverage - 65.92%

    227 - 54x + 54x +
          private$add_keep_na_call(filter_call, varname)
    @@ -27144,28 +28124,32 @@

    teal.slice coverage - 65.92%

    243 - 160x + 160x +
          ordered_counts <- .table(private$x)
    244 - 160x + 160x +
          possible_choices <- names(ordered_counts)
    245 - 160x + 160x +
          if (is.null(choices)) {
    246 - 145x + 145x +
            choices <- possible_choices
    @@ -27179,49 +28163,56 @@

    teal.slice coverage - 65.92%

    248 - 15x + 15x +
            choices <- as.character(choices)
    249 - 15x + 15x +
            choices_adjusted <- choices[choices %in% possible_choices]
    250 - 15x + 15x +
            if (length(setdiff(choices, choices_adjusted)) > 0L) {
    251 - 2x + 2x +
              warning(
    252 - 2x + 2x +
                sprintf(
    253 - 2x + 2x +
                  "Some choices not found in data. Adjusting. Filter id: %s.",
    254 - 2x + 2x +
                  private$get_id()
    @@ -27242,7 +28233,8 @@

    teal.slice coverage - 65.92%

    257 - 2x + 2x +
              choices <- choices_adjusted
    @@ -27256,35 +28248,40 @@

    teal.slice coverage - 65.92%

    259 - 15x + 15x +
            if (length(choices) == 0) {
    260 - 1x + 1x +
              warning(
    261 - 1x + 1x +
                sprintf(
    262 - 1x + 1x +
                  "None of the choices were found in data. Setting defaults. Filter id: %s.",
    263 - 1x + 1x +
                  private$get_id()
    @@ -27305,7 +28302,8 @@

    teal.slice coverage - 65.92%

    266 - 1x + 1x +
              choices <- possible_choices
    @@ -27326,28 +28324,32 @@

    teal.slice coverage - 65.92%

    269 - 160x + 160x +
          private$set_choices_counts(unname(ordered_counts[choices]))
    270 - 160x + 160x +
          private$set_is_choice_limited(possible_choices, choices)
    271 - 160x + 160x +
          private$teal_slice$choices <- choices
    272 - 160x + 160x +
          invisible(NULL)
    @@ -27382,21 +28384,24 @@

    teal.slice coverage - 65.92%

    277 - 160x + 160x +
          xl <- x[!is.na(x)]
    278 - 160x + 160x +
          private$is_choice_limited <- length(setdiff(xl, choices)) > 0L
    279 - 160x + 160x +
          invisible(NULL)
    @@ -27431,14 +28436,16 @@

    teal.slice coverage - 65.92%

    284 - 160x + 160x +
          private$choices_counts <- choices_counts
    285 - 160x + 160x +
          invisible(NULL)
    @@ -27473,7 +28480,8 @@

    teal.slice coverage - 65.92%

    290 - 23x + 23x +
          length(private$get_choices()) <= getOption("teal.threshold_slider_vs_checkboxgroup")
    @@ -27494,21 +28502,24 @@

    teal.slice coverage - 65.92%

    293 - 189x + 189x +
          tryCatch(
    294 - 189x + 189x +
            expr = {
    295 - 189x + 189x +
              values <- as.character(values)
    @@ -27529,7 +28540,8 @@

    teal.slice coverage - 65.92%

    298 - 189x + 189x +
            error = function(e) stop("The vector of set values must contain values coercible to character.")
    @@ -27543,7 +28555,8 @@

    teal.slice coverage - 65.92%

    300 - 189x + 189x +
          values
    @@ -27571,28 +28584,32 @@

    teal.slice coverage - 65.92%

    304 - 189x + 189x +
          if (!private$is_multiple() && length(values) > 1) {
    305 - 1x + 1x +
            warning(
    306 - 1x + 1x +
              sprintf("Selection: %s is not a vector of length one. ", toString(values, width = 360)),
    307 - 1x + 1x +
              "Maintaining previous selection."
    @@ -27606,7 +28623,8 @@

    teal.slice coverage - 65.92%

    309 - 1x + 1x +
            values <- isolate(private$get_selected())
    @@ -27620,7 +28638,8 @@

    teal.slice coverage - 65.92%

    311 - 189x + 189x +
          values
    @@ -27641,35 +28660,40 @@

    teal.slice coverage - 65.92%

    314 - 189x + 189x +
          in_choices_mask <- values %in% private$get_choices()
    315 - 189x + 189x +
          if (length(values[!in_choices_mask]) > 0) {
    316 - 17x + 17x +
            warning(paste(
    317 - 17x + 17x +
              "Values:", toString(values[!in_choices_mask], width = 360),
    318 - 17x + 17x +
              "are not in choices of column", private$get_varname(), "in dataset", private$get_dataname(), "."
    @@ -27690,7 +28714,8 @@

    teal.slice coverage - 65.92%

    321 - 189x + 189x +
          values[in_choices_mask]
    @@ -27767,7 +28792,8 @@

    teal.slice coverage - 65.92%

    332 - 7x + 7x +
          ns <- NS(id)
    @@ -27788,21 +28814,24 @@

    teal.slice coverage - 65.92%

    335 - 7x + 7x +
          isolate({
    336 - 7x + 7x +
            countsmax <- private$choices_counts
    337 - 7x + 7x +
            countsnow <- if (!is.null(private$x_reactive())) {
    @@ -27844,42 +28873,48 @@

    teal.slice coverage - 65.92%

    343 - 7x + 7x +
            ui_input <- if (private$is_checkboxgroup()) {
    344 - 7x + 7x +
              labels <- countBars(
    345 - 7x + 7x +
                inputId = ns("labels"),
    346 - 7x + 7x +
                choices = private$get_choices(),
    347 - 7x + 7x +
                countsnow = countsnow,
    348 - 7x + 7x +
                countsmax = countsmax
    @@ -27893,70 +28928,80 @@

    teal.slice coverage - 65.92%

    350 - 6x + 6x +
              tags$div(
    351 - 6x + 6x +
                class = "choices_state",
    352 - 6x + 6x +
                if (private$is_multiple()) {
    353 - 6x + 6x +
                  checkboxGroupInput(
    354 - 6x + 6x +
                    inputId = ns("selection"),
    355 - 6x + 6x +
                    label = NULL,
    356 - 6x + 6x +
                    selected = private$get_selected(),
    357 - 6x + 6x +
                    choiceNames = labels,
    358 - 6x + 6x +
                    choiceValues = private$get_choices(),
    359 - 6x + 6x +
                    width = "100%"
    @@ -28187,28 +29232,32 @@

    teal.slice coverage - 65.92%

    392 - 6x + 6x +
            tags$div(
    393 - 6x + 6x +
              uiOutput(ns("trigger_visible")),
    394 - 6x + 6x +
              ui_input,
    395 - 6x + 6x +
              private$keep_na_ui(ns("keep_na"))
    @@ -28278,28 +29327,32 @@

    teal.slice coverage - 65.92%

    405 - 7x + 7x +
          moduleServer(
    406 - 7x + 7x +
            id = id,
    407 - 7x + 7x +
            function(input, output, session) {
    408 - 7x + 7x +
              logger::log_trace("ChoicesFilterState$server_inputs initializing, id: { private$get_id() }")
    @@ -28334,21 +29387,24 @@

    teal.slice coverage - 65.92%

    413 - 7x + 7x +
              non_missing_values <- reactive(Filter(Negate(is.na), private$x_reactive()))
    414 - 7x + 7x +
              output$trigger_visible <- renderUI({
    415 - 7x + 7x +
                logger::log_trace("ChoicesFilterState$server_inputs@1 updating count labels, id: { private$get_id() }")
    @@ -28362,7 +29418,8 @@

    teal.slice coverage - 65.92%

    417 - 7x + 7x +
                countsnow <- if (!is.null(private$x_reactive())) {
    @@ -28411,49 +29468,56 @@

    teal.slice coverage - 65.92%

    424 - 7x + 7x +
                isolate({
    425 - 7x + 7x +
                  if (private$is_checkboxgroup()) {
    426 - 7x + 7x +
                    updateCountBars(
    427 - 7x + 7x +
                      inputId = "labels",
    428 - 7x + 7x +
                      choices = private$get_choices(),
    429 - 7x + 7x +
                      countsmax = private$choices_counts,
    430 - 7x + 7x +
                      countsnow = countsnow
    @@ -28565,7 +29629,8 @@

    teal.slice coverage - 65.92%

    446 - 6x + 6x +
                  NULL
    @@ -28593,42 +29658,48 @@

    teal.slice coverage - 65.92%

    450 - 7x + 7x +
              if (private$is_checkboxgroup()) {
    451 - 7x + 7x +
                private$observers$selection <- observeEvent(
    452 - 7x + 7x +
                  ignoreNULL = FALSE,
    453 - 7x + 7x +
                  ignoreInit = TRUE, # ignoreInit: should not matter because we set the UI with the desired initial state
    454 - 7x + 7x +
                  eventExpr = input$selection,
    455 - 7x + 7x +
                  handlerExpr = {
    @@ -28950,7 +30021,8 @@

    teal.slice coverage - 65.92%

    501 - 7x + 7x +
              private$keep_na_srv("keep_na")
    @@ -28985,7 +30057,8 @@

    teal.slice coverage - 65.92%

    506 - 7x + 7x +
              private$observers$selection_api <- observeEvent(private$get_selected(), {
    @@ -29006,49 +30079,56 @@

    teal.slice coverage - 65.92%

    509 - 2x + 2x +
                if (!setequal(input$selection, private$get_selected())) {
    510 - 2x + 2x +
                  logger::log_trace("ChoicesFilterState$server@1 state changed, id: { private$get_id() }")
    511 - 2x + 2x +
                  if (private$is_checkboxgroup()) {
    512 - 2x + 2x +
                    if (private$is_multiple()) {
    513 - 2x + 2x +
                      updateCheckboxGroupInput(
    514 - 2x + 2x +
                        inputId = "selection",
    515 - 2x + 2x +
                        selected = private$get_selected()
    @@ -29167,14 +30247,16 @@

    teal.slice coverage - 65.92%

    532 - 7x + 7x +
              logger::log_trace("ChoicesFilterState$server_inputs initialized, id: { private$get_id() }")
    533 - 7x + 7x +
              NULL
    @@ -29440,21 +30522,24 @@

    teal.slice coverage - 65.92%

    571 - 7x + 7x +
          selected <- private$get_selected()
    572 - 7x + 7x +
          selected_text <-
    573 - 7x + 7x +
            if (length(selected) == 0L) {
    @@ -29475,14 +30560,16 @@

    teal.slice coverage - 65.92%

    576 - 7x + 7x +
              if (sum(nchar(selected)) <= 40L) {
    577 - 7x + 7x +
                paste(selected, collapse = ", ")
    @@ -29517,28 +30604,32 @@

    teal.slice coverage - 65.92%

    582 - 7x + 7x +
          tagList(
    583 - 7x + 7x +
            tags$span(
    584 - 7x + 7x +
              class = "filter-card-summary-value",
    585 - 7x + 7x +
              selected_text
    @@ -29552,21 +30643,24 @@

    teal.slice coverage - 65.92%

    587 - 7x + 7x +
            tags$span(
    588 - 7x + 7x +
              class = "filter-card-summary-controls",
    589 - 7x + 7x +
              if (private$na_count > 0) {
    @@ -29678,21 +30772,24 @@

    teal.slice coverage - 65.92%

    605 - 160x + 160x +
      table(
    606 - 160x + 160x +
        if (is.factor(x)) {
    607 - 36x + 36x +
          x
    @@ -29706,7 +30803,8 @@

    teal.slice coverage - 65.92%

    609 - 124x + 124x +
          as.character(x)
    @@ -30104,28 +31202,32 @@

    teal.slice coverage - 65.92%

    53 - 274x + 274x +
          checkmate::assert_string(dataname)
    54 - 272x + 272x +
          logger::log_trace("Instantiating { class(self)[1] }, dataname: { dataname }")
    55 - 272x + 272x +
          checkmate::assert_function(data_reactive, args = "sid")
    56 - 272x + 272x +
          checkmate::assert_string(datalabel, null.ok = TRUE)
    @@ -30139,42 +31241,48 @@

    teal.slice coverage - 65.92%

    58 - 272x + 272x +
          private$dataname <- dataname
    59 - 272x + 272x +
          private$datalabel <- datalabel
    60 - 272x + 272x +
          private$dataname_prefixed <- dataname
    61 - 272x + 272x +
          private$data <- data
    62 - 272x + 272x +
          private$data_reactive <- data_reactive
    63 - 272x + 272x +
          private$state_list <- reactiveVal()
    @@ -30188,14 +31296,16 @@

    teal.slice coverage - 65.92%

    65 - 272x + 272x +
          logger::log_trace("Instantiated { class(self)[1] }, dataname: { private$dataname }")
    66 - 272x + 272x +
          invisible(self)
    @@ -30622,7 +31732,8 @@

    teal.slice coverage - 65.92%

    127 - 88x + 88x +
          logger::log_trace("FilterStates$get_call initializing")
    @@ -30657,21 +31768,24 @@

    teal.slice coverage - 65.92%

    132 - 88x + 88x +
          states_list <- private$state_list_get()
    133 - 88x + 88x +
          if (length(states_list) == 0) {
    134 - 52x + 52x +
            return(NULL)
    @@ -30685,35 +31799,40 @@

    teal.slice coverage - 65.92%

    136 - 36x + 36x +
          args <- vapply(
    137 - 36x + 36x +
            states_list,
    138 - 36x + 36x +
            function(x) {
    139 - 57x + 57x +
              arg <- x$get_state()$arg
    140 - 7x + 7x +
              `if`(is.null(arg), "", arg) # converting NULL -> "" to enable tapply.
    @@ -30727,7 +31846,8 @@

    teal.slice coverage - 65.92%

    142 - 36x + 36x +
            character(1)
    @@ -30748,35 +31868,40 @@

    teal.slice coverage - 65.92%

    145 - 36x + 36x +
          filter_items <- tapply(
    146 - 36x + 36x +
            X = states_list,
    147 - 36x + 36x +
            INDEX = args,
    148 - 36x + 36x +
            simplify = FALSE,
    149 - 36x + 36x +
            function(items) {
    @@ -30790,14 +31915,16 @@

    teal.slice coverage - 65.92%

    151 - 38x + 38x +
              other_filter_idx <- !names(items) %in% sid
    152 - 38x + 38x +
              filtered_items <- items[other_filter_idx]
    @@ -30811,42 +31938,48 @@

    teal.slice coverage - 65.92%

    154 - 38x + 38x +
              calls <- Filter(
    155 - 38x + 38x +
                Negate(is.null),
    156 - 38x + 38x +
                lapply(
    157 - 38x + 38x +
                  filtered_items,
    158 - 38x + 38x +
                  function(state) {
    159 - 51x + 51x +
                    state$get_call(dataname = private$dataname_prefixed)
    @@ -30874,7 +32007,8 @@

    teal.slice coverage - 65.92%

    163 - 38x + 38x +
              calls_combine_by(calls, operator = "&")
    @@ -30895,21 +32029,24 @@

    teal.slice coverage - 65.92%

    166 - 36x + 36x +
          filter_items <- Filter(
    167 - 36x + 36x +
            x = filter_items,
    168 - 36x + 36x +
            f = Negate(is.null)
    @@ -30923,49 +32060,56 @@

    teal.slice coverage - 65.92%

    170 - 36x + 36x +
          if (length(filter_items) > 0L) {
    171 - 35x + 35x +
            filter_function <- private$fun
    172 - 35x + 35x +
            data_name <- str2lang(private$dataname_prefixed)
    173 - 35x + 35x +
            substitute(
    174 - 35x + 35x +
              env = list(
    175 - 35x + 35x +
                lhs = data_name,
    176 - 35x + 35x +
                rhs = as.call(c(filter_function, c(list(data_name), filter_items)))
    @@ -30979,7 +32123,8 @@

    teal.slice coverage - 65.92%

    178 - 35x + 35x +
              expr = lhs <- rhs
    @@ -31007,7 +32152,8 @@

    teal.slice coverage - 65.92%

    182 - 1x + 1x +
            NULL
    @@ -31161,35 +32307,40 @@

    teal.slice coverage - 65.92%

    204 - 17x + 17x +
          checkmate::assert_class(state, "teal_slices")
    205 - 17x + 17x +
          isolate({
    206 - 17x + 17x +
            state_ids <- vapply(state, `[[`, character(1), "id")
    207 - 17x + 17x +
            logger::log_trace("{ class(self)[1] }$remove_filter_state removing filters, state_id: { toString(state_ids) }")
    208 - 17x + 17x +
            private$state_list_remove(state_ids)
    @@ -31203,7 +32354,8 @@

    teal.slice coverage - 65.92%

    210 - 17x + 17x +
          invisible(NULL)
    @@ -31287,14 +32439,16 @@

    teal.slice coverage - 65.92%

    222 - 364x + 364x +
          slices <- unname(lapply(private$state_list(), function(x) x$get_state()))
    223 - 364x + 364x +
          fs <- do.call(teal_slices, c(slices, list(count_type = private$count_type)))
    @@ -31308,35 +32462,40 @@

    teal.slice coverage - 65.92%

    225 - 364x + 364x +
          include_varnames <- private$include_varnames
    226 - 364x + 364x +
          if (length(include_varnames)) {
    227 - 214x + 214x +
            attr(fs, "include_varnames") <- structure(
    228 - 214x + 214x +
              list(include_varnames),
    229 - 214x + 214x +
              names = private$dataname
    @@ -31364,35 +32523,40 @@

    teal.slice coverage - 65.92%

    233 - 364x + 364x +
          exclude_varnames <- private$exclude_varnames
    234 - 364x + 364x +
          if (length(exclude_varnames)) {
    235 - 9x + 9x +
            attr(fs, "exclude_varnames") <- structure(
    236 - 9x + 9x +
              list(exclude_varnames),
    237 - 9x + 9x +
              names = private$dataname
    @@ -31420,7 +32584,8 @@

    teal.slice coverage - 65.92%

    241 - 364x + 364x +
          fs
    @@ -31476,49 +32641,56 @@

    teal.slice coverage - 65.92%

    249 - 135x + 135x +
          isolate({
    250 - 135x + 135x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initializing, dataname: { private$dataname }")
    251 - 135x + 135x +
            checkmate::assert_class(state, "teal_slices")
    252 - 135x + 135x +
            lapply(state, function(x) {
    253 - 177x + 177x +
              checkmate::assert_true(
    254 - 177x + 177x +
                x$dataname == private$dataname,
    255 - 177x + 177x +
                .var.name = "dataname matches private$dataname"
    @@ -31546,21 +32718,24 @@

    teal.slice coverage - 65.92%

    259 - 135x + 135x +
            private$set_filterable_varnames(
    260 - 135x + 135x +
              include_varnames = attr(state, "include_varnames")[[private$dataname]],
    261 - 135x + 135x +
              exclude_varnames = attr(state, "exclude_varnames")[[private$dataname]]
    @@ -31574,21 +32749,24 @@

    teal.slice coverage - 65.92%

    263 - 135x + 135x +
            count_type <- attr(state, "count_type")
    264 - 135x + 135x +
            if (length(count_type)) {
    265 - 21x + 21x +
              private$count_type <- count_type
    @@ -31616,35 +32794,40 @@

    teal.slice coverage - 65.92%

    269 - 135x + 135x +
            varnames <- unique(unlist(lapply(state, "[[", "varname")))
    270 - 135x + 135x +
            excluded_varnames <- setdiff(varnames, private$get_filterable_varnames())
    271 - 135x + 135x +
            if (length(excluded_varnames)) {
    272 - 3x + 3x +
              state <- Filter(function(x) !isTRUE(x$varname %in% excluded_varnames), state)
    273 - 3x + 3x +
              warning(sprintf("filters for columns: %s excluded from %s", toString(excluded_varnames), private$dataname))
    @@ -31665,35 +32848,40 @@

    teal.slice coverage - 65.92%

    276 - 135x + 135x +
            if (length(state) > 0) {
    277 - 93x + 93x +
              private$set_filter_state_impl(
    278 - 93x + 93x +
                state = state,
    279 - 93x + 93x +
                data = private$data,
    280 - 93x + 93x +
                data_reactive = private$data_reactive
    @@ -31714,7 +32902,8 @@

    teal.slice coverage - 65.92%

    283 - 135x + 135x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initialized, dataname: { private$dataname }")
    @@ -31735,7 +32924,8 @@

    teal.slice coverage - 65.92%

    286 - 135x + 135x +
          invisible(NULL)
    @@ -31819,14 +33009,16 @@

    teal.slice coverage - 65.92%

    298 - 25x + 25x +
          private$state_list_empty(force)
    299 - 25x + 25x +
          invisible(NULL)
    @@ -32078,49 +33270,56 @@

    teal.slice coverage - 65.92%

    335 - 12x + 12x +
          moduleServer(
    336 - 12x + 12x +
            id = id,
    337 - 12x + 12x +
            function(input, output, session) {
    338 - 12x + 12x +
              logger::log_trace("FilterState$srv_active initializing, dataname: { private$dataname }")
    339 - 12x + 12x +
              current_state <- reactive(private$state_list_get())
    340 - 12x + 12x +
              previous_state <- reactiveVal(NULL) # FilterState list
    341 - 12x + 12x +
              added_states <- reactiveVal(NULL) # FilterState list
    @@ -32141,21 +33340,24 @@

    teal.slice coverage - 65.92%

    344 - 12x + 12x +
              fs_to_shiny_ns <- function(x) {
    345 - 24x + 24x +
                checkmate::assert_multi_class(x, c("FilterState", "FilterStateExpr"))
    346 - 24x + 24x +
                gsub("[^[:alnum:]]+", "_", get_default_slice_id(x$get_state()))
    @@ -32176,28 +33378,32 @@

    teal.slice coverage - 65.92%

    349 - 12x + 12x +
              output$trigger_visible_state_change <- renderUI({
    350 - 14x + 14x +
                current_state()
    351 - 14x + 14x +
                isolate({
    352 - 14x + 14x +
                  logger::log_trace("FilterStates$srv_active@1 determining added and removed filter states")
    @@ -32211,21 +33417,24 @@

    teal.slice coverage - 65.92%

    354 - 14x + 14x +
                  added_states(setdiff_teal_slices(current_state(), previous_state()))
    355 - 14x + 14x +
                  previous_state(current_state())
    356 - 14x + 14x +
                  NULL
    @@ -32253,42 +33462,48 @@

    teal.slice coverage - 65.92%

    360 - 12x + 12x +
              output[["cards"]] <- renderUI({
    361 - 14x + 14x +
                lapply(
    362 - 14x + 14x +
                  current_state(), # observes only if added/removed
    363 - 14x + 14x +
                  function(state) {
    364 - 12x + 12x +
                    isolate( # isolates when existing state changes
    365 - 12x + 12x +
                      state$ui(id = session$ns(fs_to_shiny_ns(state)), parent_id = session$ns("cards"))
    @@ -32330,21 +33545,24 @@

    teal.slice coverage - 65.92%

    371 - 12x + 12x +
              observeEvent(
    372 - 12x + 12x +
                added_states(), # we want to call FilterState module only once when it's added
    373 - 12x + 12x +
                ignoreNULL = TRUE,
    @@ -32358,63 +33576,72 @@

    teal.slice coverage - 65.92%

    375 - 10x + 10x +
                  added_state_names <- vapply(added_states(), function(x) x$get_state()$id, character(1L))
    376 - 10x + 10x +
                  logger::log_trace("FilterStates$srv_active@2 triggered by added states: { toString(added_state_names) }")
    377 - 10x + 10x +
                  lapply(added_states(), function(state) {
    378 - 12x + 12x +
                    fs_callback <- state$server(id = fs_to_shiny_ns(state))
    379 - 12x + 12x +
                    observeEvent(
    380 - 12x + 12x +
                      once = TRUE, # remove button can be called once, should be destroyed afterwards
    381 - 12x + 12x +
                      ignoreInit = TRUE, # ignoreInit: should not matter because we destroy the previous input set of the UI
    382 - 12x + 12x +
                      eventExpr = fs_callback(), # when remove button is clicked in the FilterState ui
    383 - 12x + 12x +
                      handlerExpr = private$state_list_remove(state$get_state()$id)
    @@ -32435,7 +33662,8 @@

    teal.slice coverage - 65.92%

    386 - 10x + 10x +
                  added_states(NULL)
    @@ -32463,7 +33691,8 @@

    teal.slice coverage - 65.92%

    390 - 12x + 12x +
              NULL
    @@ -32561,14 +33790,16 @@

    teal.slice coverage - 65.92%

    404 - 1x + 1x +
          checkmate::assert_string(id)
    405 - 1x + 1x +
          data <- private$data
    @@ -32582,7 +33813,8 @@

    teal.slice coverage - 65.92%

    407 - 1x + 1x +
          ns <- NS(id)
    @@ -32596,14 +33828,16 @@

    teal.slice coverage - 65.92%

    409 - 1x + 1x +
          if (ncol(data) == 0) {
    410 - 1x + 1x +
            tags$div("no sample variables available")
    @@ -32743,28 +33977,32 @@

    teal.slice coverage - 65.92%

    430 - 8x + 8x +
          moduleServer(
    431 - 8x + 8x +
            id = id,
    432 - 8x + 8x +
            function(input, output, session) {
    433 - 8x + 8x +
              logger::log_trace("FilterStates$srv_add initializing, dataname: { private$dataname }")
    @@ -32785,42 +34023,48 @@

    teal.slice coverage - 65.92%

    436 - 8x + 8x +
              avail_column_choices <- reactive({
    437 - 9x + 9x +
                data <- private$data
    438 - 9x + 9x +
                vars_include <- private$get_filterable_varnames()
    439 - 9x + 9x +
                active_filter_vars <- unique(unlist(lapply(self$get_filter_state(), "[[", "varname")))
    440 - 9x + 9x +
                choices <- setdiff(vars_include, active_filter_vars)
    441 - 9x + 9x +
                varlabels <- get_varlabels(data)
    @@ -32834,35 +34078,40 @@

    teal.slice coverage - 65.92%

    443 - 9x + 9x +
                data_choices_labeled(
    444 - 9x + 9x +
                  data = data,
    445 - 9x + 9x +
                  choices = choices,
    446 - 9x + 9x +
                  varlabels = varlabels,
    447 - 9x + 9x +
                  keys = private$keys
    @@ -32897,21 +34146,24 @@

    teal.slice coverage - 65.92%

    452 - 8x + 8x +
              output$add_filter <- renderUI({
    453 - 6x + 6x +
                logger::log_trace(
    454 - 6x + 6x +
                  "FilterStates$srv_add@1 updating available column choices, dataname: { private$dataname }"
    @@ -32925,7 +34177,8 @@

    teal.slice coverage - 65.92%

    456 - 6x + 6x +
                if (length(avail_column_choices()) == 0) {
    @@ -32946,56 +34199,64 @@

    teal.slice coverage - 65.92%

    459 - 6x + 6x +
                  tags$div(
    460 - 6x + 6x +
                    teal.widgets::optionalSelectInput(
    461 - 6x + 6x +
                      session$ns("var_to_add"),
    462 - 6x + 6x +
                      choices = avail_column_choices(),
    463 - 6x + 6x +
                      selected = NULL,
    464 - 6x + 6x +
                      options = shinyWidgets::pickerOptions(
    465 - 6x + 6x +
                        liveSearch = TRUE,
    466 - 6x + 6x +
                        noneSelectedText = "Select variable to filter"
    @@ -33044,56 +34305,64 @@

    teal.slice coverage - 65.92%

    473 - 8x + 8x +
              observeEvent(
    474 - 8x + 8x +
                eventExpr = input$var_to_add,
    475 - 8x + 8x +
                handlerExpr = {
    476 - 3x + 3x +
                  logger::log_trace(
    477 - 3x + 3x +
                    sprintf(
    478 - 3x + 3x +
                      "FilterStates$srv_add@2 adding FilterState of variable %s, dataname: %s",
    479 - 3x + 3x +
                      input$var_to_add,
    480 - 3x + 3x +
                      private$dataname
    @@ -33114,21 +34383,24 @@

    teal.slice coverage - 65.92%

    483 - 3x + 3x +
                  self$set_filter_state(
    484 - 3x + 3x +
                    teal_slices(
    485 - 3x + 3x +
                      teal_slice(dataname = private$dataname, varname = input$var_to_add)
    @@ -33149,35 +34421,40 @@

    teal.slice coverage - 65.92%

    488 - 3x + 3x +
                  logger::log_trace(
    489 - 3x + 3x +
                    sprintf(
    490 - 3x + 3x +
                      "FilterStates$srv_add@2 added FilterState of variable %s, dataname: %s",
    491 - 3x + 3x +
                      input$var_to_add,
    492 - 3x + 3x +
                      private$dataname
    @@ -33219,14 +34496,16 @@

    teal.slice coverage - 65.92%

    498 - 8x + 8x +
              logger::log_trace("FilterStates$srv_add initialized, dataname: { private$dataname }")
    499 - 8x + 8x +
              NULL
    @@ -33485,14 +34764,16 @@

    teal.slice coverage - 65.92%

    536 - 288x + 288x +
          if ((length(include_varnames) + length(exclude_varnames)) == 0L) {
    537 - 113x + 113x +
            return(invisible(NULL))
    @@ -33506,21 +34787,24 @@

    teal.slice coverage - 65.92%

    539 - 175x + 175x +
          checkmate::assert_character(include_varnames, any.missing = FALSE, min.len = 0L, null.ok = TRUE)
    540 - 175x + 175x +
          checkmate::assert_character(exclude_varnames, any.missing = FALSE, min.len = 0L, null.ok = TRUE)
    541 - 175x + 175x +
          if (length(include_varnames) && length(exclude_varnames)) {
    @@ -33569,28 +34853,32 @@

    teal.slice coverage - 65.92%

    548 - 175x + 175x +
          supported_vars <- get_supported_filter_varnames(private$data)
    549 - 175x + 175x +
          if (length(include_varnames)) {
    550 - 161x + 161x +
            private$include_varnames <- intersect(include_varnames, supported_vars)
    551 - 161x + 161x +
            private$exclude_varnames <- character(0)
    @@ -33604,14 +34892,16 @@

    teal.slice coverage - 65.92%

    553 - 14x + 14x +
            private$exclude_varnames <- exclude_varnames
    554 - 14x + 14x +
            private$include_varnames <- character(0)
    @@ -33625,7 +34915,8 @@

    teal.slice coverage - 65.92%

    556 - 175x + 175x +
          invisible(NULL)
    @@ -33702,14 +34993,16 @@

    teal.slice coverage - 65.92%

    567 - 144x + 144x +
          if (length(private$include_varnames)) {
    568 - 97x + 97x +
            private$include_varnames
    @@ -33723,14 +35016,16 @@

    teal.slice coverage - 65.92%

    570 - 47x + 47x +
            supported_varnames <- get_supported_filter_varnames(private$data)
    571 - 47x + 47x +
            setdiff(supported_varnames, private$exclude_varnames)
    @@ -33835,7 +35130,8 @@

    teal.slice coverage - 65.92%

    586 - 212x + 212x +
          checkmate::assert_string(state_id, null.ok = TRUE)
    @@ -33849,14 +35145,16 @@

    teal.slice coverage - 65.92%

    588 - 212x + 212x +
          if (is.null(state_id)) {
    589 - 212x + 212x +
            private$state_list()
    @@ -33982,49 +35280,56 @@

    teal.slice coverage - 65.92%

    607 - 183x + 183x +
          logger::log_trace("{ class(self)[1] } pushing into state_list, dataname: { private$dataname }")
    608 - 183x + 183x +
          checkmate::assert_string(state_id)
    609 - 183x + 183x +
          checkmate::assert_multi_class(x, c("FilterState", "FilterStateExpr"))
    610 - 183x + 183x +
          state <- stats::setNames(list(x), state_id)
    611 - 183x + 183x +
          new_state_list <- c(
    612 - 183x + 183x +
            isolate(private$state_list()),
    613 - 183x + 183x +
            state
    @@ -34038,7 +35343,8 @@

    teal.slice coverage - 65.92%

    615 - 183x + 183x +
          isolate(private$state_list(new_state_list))
    @@ -34052,14 +35358,16 @@

    teal.slice coverage - 65.92%

    617 - 183x + 183x +
          logger::log_trace("{ class(self)[1] } pushed into queue, dataname: { private$dataname }")
    618 - 183x + 183x +
          invisible(NULL)
    @@ -34178,14 +35486,16 @@

    teal.slice coverage - 65.92%

    635 - 32x + 32x +
          checkmate::assert_character(state_id)
    636 - 32x + 32x +
          logger::log_trace("{ class(self)[1] } removing a filter, state_id: { toString(state_id) }")
    @@ -34199,63 +35509,72 @@

    teal.slice coverage - 65.92%

    638 - 32x + 32x +
          isolate({
    639 - 32x + 32x +
            current_state_ids <- vapply(private$state_list(), function(x) x$get_state()$id, character(1))
    640 - 32x + 32x +
            to_remove <- state_id %in% current_state_ids
    641 - 32x + 32x +
            if (any(to_remove)) {
    642 - 31x + 31x +
              new_state_list <- Filter(
    643 - 31x + 31x +
                function(state) {
    644 - 68x + 68x +
                  if (state$get_state()$id %in% state_id) {
    645 - 54x + 54x +
                    if (state$get_state()$anchored && !force) {
    646 - 7x + 7x +
                      return(TRUE)
    @@ -34269,14 +35588,16 @@

    teal.slice coverage - 65.92%

    648 - 47x + 47x +
                      state$destroy_observers()
    649 - 47x + 47x +
                      FALSE
    @@ -34297,7 +35618,8 @@

    teal.slice coverage - 65.92%

    652 - 14x + 14x +
                    TRUE
    @@ -34318,7 +35640,8 @@

    teal.slice coverage - 65.92%

    655 - 31x + 31x +
                private$state_list()
    @@ -34332,7 +35655,8 @@

    teal.slice coverage - 65.92%

    657 - 31x + 31x +
              private$state_list(new_state_list)
    @@ -34346,7 +35670,8 @@

    teal.slice coverage - 65.92%

    659 - 1x + 1x +
              warning(sprintf("\"%s\" not found in state list", state_id))
    @@ -34374,7 +35699,8 @@

    teal.slice coverage - 65.92%

    663 - 32x + 32x +
          invisible(NULL)
    @@ -34444,21 +35770,24 @@

    teal.slice coverage - 65.92%

    673 - 25x + 25x +
          isolate({
    674 - 25x + 25x +
            logger::log_trace(
    675 - 25x + 25x +
              "{ class(self)[1] }$state_list_empty removing all non-anchored filters for dataname: { private$dataname }"
    @@ -34479,28 +35808,32 @@

    teal.slice coverage - 65.92%

    678 - 25x + 25x +
            state_list <- private$state_list()
    679 - 25x + 25x +
            if (length(state_list)) {
    680 - 15x + 15x +
              state_ids <- vapply(state_list, function(x) x$get_state()$id, character(1))
    681 - 15x + 15x +
              private$state_list_remove(state_ids, force)
    @@ -34528,7 +35861,8 @@

    teal.slice coverage - 65.92%

    685 - 25x + 25x +
          invisible(NULL)
    @@ -34654,35 +35988,40 @@

    teal.slice coverage - 65.92%

    703 - 211x + 211x +
          checkmate::assert_class(state, "teal_slices")
    704 - 211x + 211x +
          checkmate::assert_multi_class(data, c("data.frame", "matrix", "DataFrame", "HermesData"))
    705 - 211x + 211x +
          checkmate::assert_function(data_reactive, args = "sid")
    706 - 211x + 211x +
          if (length(state) == 0L) {
    707 - 101x + 101x +
            return(invisible(NULL))
    @@ -34703,14 +36042,16 @@

    teal.slice coverage - 65.92%

    710 - 110x + 110x +
          slices_hashed <- vapply(state, `[[`, character(1L), "id")
    711 - 110x + 110x +
          if (any(duplicated(slices_hashed))) {
    @@ -34759,28 +36100,32 @@

    teal.slice coverage - 65.92%

    718 - 110x + 110x +
          state_list <- isolate(private$state_list_get())
    719 - 110x + 110x +
          lapply(state, function(slice) {
    720 - 191x + 191x +
            state_id <- slice$id
    721 - 191x + 191x +
            if (state_id %in% names(state_list)) {
    @@ -34794,7 +36139,8 @@

    teal.slice coverage - 65.92%

    723 - 8x + 8x +
              state_list[[state_id]]$set_state(slice)
    @@ -34808,7 +36154,8 @@

    teal.slice coverage - 65.92%

    725 - 183x + 183x +
              if (inherits(slice, "teal_slice_expr")) {
    @@ -34822,7 +36169,8 @@

    teal.slice coverage - 65.92%

    727 - 6x + 6x +
                fstate <- init_filter_state_expr(slice)
    @@ -34843,14 +36191,16 @@

    teal.slice coverage - 65.92%

    730 - 177x + 177x +
                fstate <- init_filter_state(
    731 - 177x + 177x +
                  x = data[, slice$varname, drop = TRUE],
    @@ -34899,14 +36249,16 @@

    teal.slice coverage - 65.92%

    738 - 177x + 177x +
                  x_reactive = if (private$count_type == "none") {
    739 - 171x + 171x +
                    reactive(NULL)
    @@ -34920,7 +36272,8 @@

    teal.slice coverage - 65.92%

    741 - 6x + 6x +
                    reactive(data_reactive(state_id)[, slice$varname, drop = TRUE])
    @@ -34934,14 +36287,16 @@

    teal.slice coverage - 65.92%

    743 - 177x + 177x +
                  slice = slice,
    744 - 177x + 177x +
                  extract_type = private$extract_type
    @@ -34962,7 +36317,8 @@

    teal.slice coverage - 65.92%

    747 - 183x + 183x +
              private$state_list_push(x = fstate, state_id = state_id)
    @@ -34990,7 +36346,8 @@

    teal.slice coverage - 65.92%

    751 - 110x + 110x +
          invisible(NULL)
    @@ -35542,35 +36899,40 @@

    teal.slice coverage - 65.92%

    75 - 369x + 369x +
          checkmate::assert_class(x_reactive, "reactive")
    76 - 368x + 368x +
          checkmate::assert_class(slice, "teal_slice")
    77 - 366x + 366x +
          checkmate::assert_character(extract_type, max.len = 1, any.missing = FALSE)
    78 - 366x + 366x +
          if (length(extract_type) == 1) {
    79 - 53x + 53x +
            checkmate::assert_choice(extract_type, choices = c("list", "matrix"))
    @@ -35598,14 +36960,16 @@

    teal.slice coverage - 65.92%

    83 - 365x + 365x +
          private$x <- x
    84 - 365x + 365x +
          private$x_reactive <- x_reactive
    @@ -35619,21 +36983,24 @@

    teal.slice coverage - 65.92%

    86 - 365x + 365x +
          private$na_count <- sum(is.na(x))
    87 - 365x + 365x +
          private$filtered_na_count <- reactive(
    88 - 365x + 365x +
            if (!is.null(private$x_reactive())) {
    @@ -35668,7 +37035,8 @@

    teal.slice coverage - 65.92%

    93 - 365x + 365x +
          private$extract_type <- extract_type
    @@ -35689,14 +37057,16 @@

    teal.slice coverage - 65.92%

    96 - 18x + 18x +
          if (is.null(isolate(slice$keep_na)) && anyNA(x)) slice$keep_na <- TRUE
    97 - 365x + 365x +
          private$teal_slice <- slice
    @@ -35710,7 +37080,8 @@

    teal.slice coverage - 65.92%

    99 - 365x + 365x +
          varlabel <- attr(x, "label", exact = TRUE)
    @@ -35724,21 +37095,24 @@

    teal.slice coverage - 65.92%

    101 - 365x + 365x +
          private$varlabel <-
    102 - 365x + 365x +
            if (is.null(varlabel) || identical(varlabel, private$get_varname())) {
    103 - 364x + 364x +
              character(0)
    @@ -35752,7 +37126,8 @@

    teal.slice coverage - 65.92%

    105 - 1x + 1x +
              varlabel
    @@ -35773,7 +37148,8 @@

    teal.slice coverage - 65.92%

    108 - 365x + 365x +
          private$state_history <- reactiveVal(list())
    @@ -35787,7 +37163,8 @@

    teal.slice coverage - 65.92%

    110 - 365x + 365x +
          logger::log_trace("Instantiated FilterState object id: { private$get_id() }")
    @@ -35801,7 +37178,8 @@

    teal.slice coverage - 65.92%

    112 - 365x + 365x +
          invisible(self)
    @@ -35885,28 +37263,32 @@

    teal.slice coverage - 65.92%

    124 - 68x + 68x +
          sprintf(
    125 - 68x + 68x +
            "%s:\n%s",
    126 - 68x + 68x +
            class(self)[1],
    127 - 68x + 68x +
            format(self$get_state(), show_all = show_all, trim_lines = trim_lines)
    @@ -35976,7 +37358,8 @@

    teal.slice coverage - 65.92%

    137 - 14x + 14x +
          cat(isolate(self$format(...)))
    @@ -36067,21 +37450,24 @@

    teal.slice coverage - 65.92%

    150 - 89x + 89x +
          checkmate::assert_class(state, "teal_slice")
    151 - 88x + 88x +
          if (private$is_fixed()) {
    152 - 1x + 1x +
            warning("attempt to set state on fixed filter aborted id: ", private$get_id())
    @@ -36095,28 +37481,32 @@

    teal.slice coverage - 65.92%

    154 - 87x + 87x +
            logger::log_trace("{ class(self)[1] }$set_state setting state of filter id: { private$get_id() }")
    155 - 87x + 87x +
            isolate({
    156 - 87x + 87x +
              if (!is.null(state$selected)) {
    157 - 78x + 78x +
                private$set_selected(state$selected)
    @@ -36130,14 +37520,16 @@

    teal.slice coverage - 65.92%

    159 - 75x + 75x +
              if (!is.null(state$keep_na)) {
    160 - 16x + 16x +
                private$set_keep_na(state$keep_na)
    @@ -36151,14 +37543,16 @@

    teal.slice coverage - 65.92%

    162 - 75x + 75x +
              if (!is.null(state$keep_inf)) {
    163 - 9x + 9x +
                private$set_keep_inf(state$keep_inf)
    @@ -36172,35 +37566,40 @@

    teal.slice coverage - 65.92%

    165 - 75x + 75x +
              current_state <- sprintf(
    166 - 75x + 75x +
                "selected: %s; keep_na: %s; keep_inf: %s",
    167 - 75x + 75x +
                toString(private$get_selected()),
    168 - 75x + 75x +
                private$get_keep_na(),
    169 - 75x + 75x +
                private$get_keep_inf()
    @@ -36235,7 +37634,8 @@

    teal.slice coverage - 65.92%

    174 - 76x + 76x +
          invisible(self)
    @@ -36305,7 +37705,8 @@

    teal.slice coverage - 65.92%

    184 - 747x + 747x +
          private$teal_slice
    @@ -36375,7 +37776,8 @@

    teal.slice coverage - 65.92%

    194 - 1x + 1x +
          stop("this is a virtual method")
    @@ -36459,42 +37861,48 @@

    teal.slice coverage - 65.92%

    206 - 12x + 12x +
          moduleServer(
    207 - 12x + 12x +
            id = id,
    208 - 12x + 12x +
            function(input, output, session) {
    209 - 12x + 12x +
              logger::log_trace("FilterState$server initializing module for slice: { private$get_id() } ")
    210 - 12x + 12x +
              private$server_summary("summary")
    211 - 12x + 12x +
              if (private$is_fixed()) {
    @@ -36515,7 +37923,8 @@

    teal.slice coverage - 65.92%

    214 - 12x + 12x +
                private$server_inputs("inputs")
    @@ -36536,49 +37945,56 @@

    teal.slice coverage - 65.92%

    217 - 12x + 12x +
              private$observers$state <- observeEvent(
    218 - 12x + 12x +
                eventExpr = list(private$get_selected(), private$get_keep_na(), private$get_keep_inf()),
    219 - 12x + 12x +
                handlerExpr = {
    220 - 4x + 4x +
                  current_state <- as.list(self$get_state())
    221 - 4x + 4x +
                  history <- private$state_history()
    222 - 4x + 4x +
                  history_update <- c(history, list(current_state))
    223 - 4x + 4x +
                  private$state_history(history_update)
    @@ -36606,21 +38022,24 @@

    teal.slice coverage - 65.92%

    227 - 12x + 12x +
              private$observers$back <- observeEvent(
    228 - 12x + 12x +
                eventExpr = input$back,
    229 - 12x + 12x +
                handlerExpr = {
    @@ -36683,21 +38102,24 @@

    teal.slice coverage - 65.92%

    238 - 12x + 12x +
              private$observers$reset <- observeEvent(
    239 - 12x + 12x +
                eventExpr = input$reset,
    240 - 12x + 12x +
                handlerExpr = {
    @@ -36753,56 +38175,64 @@

    teal.slice coverage - 65.92%

    248 - 12x + 12x +
              private$observers$state_history <- observeEvent(
    249 - 12x + 12x +
                eventExpr = private$state_history(),
    250 - 12x + 12x +
                handlerExpr = {
    251 - 4x + 4x +
                  shinyjs::disable(id = "back")
    252 - 4x + 4x +
                  shinyjs::disable(id = "reset")
    253 - 4x + 4x +
                  shinyjs::delay(
    254 - 4x + 4x +
                    ms = 100,
    255 - 4x + 4x +
                    expr = {
    @@ -36837,21 +38267,24 @@

    teal.slice coverage - 65.92%

    260 - 4x + 4x +
                  shinyjs::delay(
    261 - 4x + 4x +
                    ms = 100,
    262 - 4x + 4x +
                    expr = {
    @@ -36907,14 +38340,16 @@

    teal.slice coverage - 65.92%

    270 - 12x + 12x +
              private$destroy_shiny <- function() {
    271 - 8x + 8x +
                logger::log_trace("Destroying FilterState inputs and observers; id: { private$get_id() }")
    @@ -36928,7 +38363,8 @@

    teal.slice coverage - 65.92%

    273 - 8x + 8x +
                lapply(session$ns(names(input)), .subset2(input, "impl")$.values$remove)
    @@ -36949,7 +38385,8 @@

    teal.slice coverage - 65.92%

    276 - 8x + 8x +
                lapply(private$observers, function(x) x$destroy())
    @@ -36970,7 +38407,8 @@

    teal.slice coverage - 65.92%

    279 - 12x + 12x +
              reactive(input$remove)
    @@ -37054,7 +38492,8 @@

    teal.slice coverage - 65.92%

    291 - 12x + 12x +
          ns <- NS(id)
    @@ -37110,84 +38549,96 @@

    teal.slice coverage - 65.92%

    299 - 12x + 12x +
          tags$div(
    300 - 12x + 12x +
            id = id,
    301 - 12x + 12x +
            class = "panel filter-card",
    302 - 12x + 12x +
            include_js_files("count-bar-labels.js"),
    303 - 12x + 12x +
            tags$div(
    304 - 12x + 12x +
              class = "filter-card-header",
    305 - 12x + 12x +
              `data-toggle` = "collapse",
    306 - 12x + 12x +
              `data-bs-toggle` = "collapse",
    307 - 12x + 12x +
              href = paste0("#", ns("body")),
    308 - 12x + 12x +
              tags$div(
    309 - 12x + 12x +
                class = "filter-card-title",
    310 - 12x + 12x +
                if (private$is_anchored() && private$is_fixed()) {
    @@ -37201,7 +38652,8 @@

    teal.slice coverage - 65.92%

    312 - 12x + 12x +
                } else if (private$is_anchored() && !private$is_fixed()) {
    @@ -37215,7 +38667,8 @@

    teal.slice coverage - 65.92%

    314 - 12x + 12x +
                } else if (!private$is_anchored() && private$is_fixed()) {
    @@ -37236,28 +38689,32 @@

    teal.slice coverage - 65.92%

    317 - 12x + 12x +
                tags$div(class = "filter-card-varname", tags$strong(private$get_varname())),
    318 - 12x + 12x +
                tags$div(class = "filter-card-varlabel", private$get_varlabel()),
    319 - 12x + 12x +
                tags$div(
    320 - 12x + 12x +
                  class = "filter-card-controls",
    @@ -37278,7 +38735,8 @@

    teal.slice coverage - 65.92%

    323 - 12x + 12x +
                  onclick = "event.stopPropagation();event.preventDefault();",
    @@ -37292,70 +38750,80 @@

    teal.slice coverage - 65.92%

    325 - 12x + 12x +
                  `data-bs-toggle` = "collapse",
    326 - 12x + 12x +
                  `data-bs-target` = NULL,
    327 - 12x + 12x +
                  if (isFALSE(private$is_fixed())) {
    328 - 12x + 12x +
                    actionLink(
    329 - 12x + 12x +
                      inputId = ns("back"),
    330 - 12x + 12x +
                      label = NULL,
    331 - 12x + 12x +
                      icon = icon("circle-arrow-left", lib = "font-awesome"),
    332 - 12x + 12x +
                      title = "Rewind state",
    333 - 12x + 12x +
                      class = "filter-card-back",
    334 - 12x + 12x +
                      style = "display: none"
    @@ -37376,56 +38844,64 @@

    teal.slice coverage - 65.92%

    337 - 12x + 12x +
                  if (isFALSE(private$is_fixed())) {
    338 - 12x + 12x +
                    actionLink(
    339 - 12x + 12x +
                      inputId = ns("reset"),
    340 - 12x + 12x +
                      label = NULL,
    341 - 12x + 12x +
                      icon = icon("circle-arrow-up", lib = "font-awesome"),
    342 - 12x + 12x +
                      title = "Restore original state",
    343 - 12x + 12x +
                      class = "filter-card-back",
    344 - 12x + 12x +
                      style = "display: none"
    @@ -37446,42 +38922,48 @@

    teal.slice coverage - 65.92%

    347 - 12x + 12x +
                  if (isFALSE(private$is_anchored())) {
    348 - 12x + 12x +
                    actionLink(
    349 - 12x + 12x +
                      inputId = ns("remove"),
    350 - 12x + 12x +
                      label = icon("circle-xmark", lib = "font-awesome"),
    351 - 12x + 12x +
                      title = "Remove filter",
    352 - 12x + 12x +
                      class = "filter-card-remove"
    @@ -37516,7 +38998,8 @@

    teal.slice coverage - 65.92%

    357 - 12x + 12x +
              tags$div(class = "filter-card-summary", private$ui_summary(ns("summary")))
    @@ -37530,56 +39013,64 @@

    teal.slice coverage - 65.92%

    359 - 12x + 12x +
            tags$div(
    360 - 12x + 12x +
              id = ns("body"),
    361 - 12x + 12x +
              class = "collapse out",
    362 - 12x + 12x +
              `data-parent` = paste0("#", parent_id),
    363 - 12x + 12x +
              `data-bs-parent` = paste0("#", parent_id),
    364 - 12x + 12x +
              tags$div(
    365 - 12x + 12x +
                class = "filter-card-body",
    366 - 12x + 12x +
                if (private$is_fixed()) {
    @@ -37600,7 +39091,8 @@

    teal.slice coverage - 65.92%

    369 - 12x + 12x +
                  private$ui_inputs(ns("inputs"))
    @@ -37691,14 +39183,16 @@

    teal.slice coverage - 65.92%

    382 - 47x + 47x +
          if (!is.null(private$destroy_shiny)) {
    383 - 8x + 8x +
            private$destroy_shiny()
    @@ -37992,35 +39486,40 @@

    teal.slice coverage - 65.92%

    425 - 421x + 421x +
          logger::log_trace(
    426 - 421x + 421x +
            sprintf(
    427 - 421x + 421x +
              "%s$set_selected setting selection of id: %s",
    428 - 421x + 421x +
              class(self)[1],
    429 - 421x + 421x +
              private$get_id()
    @@ -38041,35 +39540,40 @@

    teal.slice coverage - 65.92%

    432 - 421x + 421x +
          isolate({
    433 - 421x + 421x +
            value <- private$cast_and_validate(value)
    434 - 410x + 410x +
            value <- private$check_length(value)
    435 - 404x + 404x +
            value <- private$remove_out_of_bounds_values(value)
    436 - 404x + 404x +
            private$teal_slice$selected <- value
    @@ -38083,35 +39587,40 @@

    teal.slice coverage - 65.92%

    438 - 404x + 404x +
          logger::log_trace(
    439 - 404x + 404x +
            sprintf(
    440 - 404x + 404x +
              "%s$set_selected selection of id: %s",
    441 - 404x + 404x +
              class(self)[1],
    442 - 404x + 404x +
              private$get_id()
    @@ -38139,7 +39648,8 @@

    teal.slice coverage - 65.92%

    446 - 404x + 404x +
          invisible(NULL)
    @@ -38223,56 +39733,64 @@

    teal.slice coverage - 65.92%

    458 - 16x + 16x +
          checkmate::assert_flag(value)
    459 - 16x + 16x +
          private$teal_slice$keep_na <- value
    460 - 16x + 16x +
          logger::log_trace(
    461 - 16x + 16x +
            sprintf(
    462 - 16x + 16x +
              "%s$set_keep_na set for filter %s to %s.",
    463 - 16x + 16x +
              class(self)[1],
    464 - 16x + 16x +
              private$get_id(),
    465 - 16x + 16x +
              value
    @@ -38293,7 +39811,8 @@

    teal.slice coverage - 65.92%

    468 - 16x + 16x +
          invisible(NULL)
    @@ -38377,56 +39896,64 @@

    teal.slice coverage - 65.92%

    480 - 9x + 9x +
          checkmate::assert_flag(value)
    481 - 9x + 9x +
          private$teal_slice$keep_inf <- value
    482 - 9x + 9x +
          logger::log_trace(
    483 - 9x + 9x +
            sprintf(
    484 - 9x + 9x +
              "%s$set_keep_inf of filter %s set to %s",
    485 - 9x + 9x +
              class(self)[1],
    486 - 9x + 9x +
              private$get_id(),
    487 - 9x + 9x +
              value
    @@ -38454,7 +39981,8 @@

    teal.slice coverage - 65.92%

    491 - 9x + 9x +
          invisible(NULL)
    @@ -38517,7 +40045,8 @@

    teal.slice coverage - 65.92%

    500 - 88x + 88x +
          isolate(private$teal_slice$dataname)
    @@ -38566,7 +40095,8 @@

    teal.slice coverage - 65.92%

    507 - 166x + 166x +
          isolate(private$teal_slice$varname)
    @@ -38615,7 +40145,8 @@

    teal.slice coverage - 65.92%

    514 - 4x + 4x +
          isolate(private$teal_slice$id)
    @@ -38671,7 +40202,8 @@

    teal.slice coverage - 65.92%

    522 - 772x + 772x +
          isolate(private$teal_slice$choices)
    @@ -38727,7 +40259,8 @@

    teal.slice coverage - 65.92%

    530 - 364x + 364x +
          private$teal_slice$selected
    @@ -38776,7 +40309,8 @@

    teal.slice coverage - 65.92%

    537 - 129x + 129x +
          private$teal_slice$keep_na
    @@ -38825,7 +40359,8 @@

    teal.slice coverage - 65.92%

    544 - 117x + 117x +
          private$teal_slice$keep_inf
    @@ -38867,7 +40402,8 @@

    teal.slice coverage - 65.92%

    550 - 148x + 148x +
          isolate(isTRUE(private$teal_slice$fixed))
    @@ -38909,7 +40445,8 @@

    teal.slice coverage - 65.92%

    556 - 48x + 48x +
          isolate(isTRUE(private$teal_slice$anchored))
    @@ -38951,7 +40488,8 @@

    teal.slice coverage - 65.92%

    562 - 217x + 217x +
          isolate(isTRUE(private$teal_slice$multiple))
    @@ -39014,7 +40552,8 @@

    teal.slice coverage - 65.92%

    571 - 12x + 12x +
          private$varlabel
    @@ -39063,49 +40602,56 @@

    teal.slice coverage - 65.92%

    578 - 109x + 109x +
          varname <- private$get_varname()
    579 - 109x + 109x +
          varname_backticked <- sprintf("`%s`", varname)
    580 - 109x + 109x +
          ans <-
    581 - 109x + 109x +
            if (isTRUE(private$extract_type == "list")) {
    582 - 16x + 16x +
              sprintf("%s$%s", dataname, varname_backticked)
    583 - 109x + 109x +
            } else if (isTRUE(private$extract_type == "matrix")) {
    584 - 7x + 7x +
              sprintf("%s[, \"%s\"]", dataname, varname)
    @@ -39119,7 +40665,8 @@

    teal.slice coverage - 65.92%

    586 - 86x + 86x +
              varname_backticked
    @@ -39133,7 +40680,8 @@

    teal.slice coverage - 65.92%

    588 - 109x + 109x +
          str2lang(ans)
    @@ -39203,14 +40751,16 @@

    teal.slice coverage - 65.92%

    598 - 108x + 108x +
          if (private$na_count == 0L) {
    599 - 87x + 87x +
            return(filter_call)
    @@ -39231,42 +40781,48 @@

    teal.slice coverage - 65.92%

    602 - 21x + 21x +
          if (is.null(filter_call) && isFALSE(private$get_keep_na())) {
    603 - 2x + 2x +
            call("!", call("is.na", varname))
    604 - 19x + 19x +
          } else if (!is.null(filter_call) && isTRUE(private$get_keep_na())) {
    605 - 12x + 12x +
            call("|", call("is.na", varname), filter_call)
    606 - 7x + 7x +
          } else if (!is.null(filter_call) && isFALSE(private$get_keep_na())) {
    607 - 7x + 7x +
            call("&", call("!", call("is.na", varname)), filter_call)
    @@ -39343,7 +40899,8 @@

    teal.slice coverage - 65.92%

    618 - 11x + 11x +
          values
    @@ -39378,7 +40935,8 @@

    teal.slice coverage - 65.92%

    623 - 11x + 11x +
          values
    @@ -39441,7 +40999,8 @@

    teal.slice coverage - 65.92%

    632 - 31x + 31x +
          values
    @@ -39539,42 +41098,48 @@

    teal.slice coverage - 65.92%

    646 - 75x + 75x +
          if (private$is_choice_limited) {
    647 - 3x + 3x +
            TRUE
    648 - 72x + 72x +
          } else if (!setequal(private$get_selected(), private$get_choices())) {
    649 - 59x + 59x +
            TRUE
    650 - 13x + 13x +
          } else if (!isTRUE(private$get_keep_na()) && private$na_count > 0) {
    651 - 4x + 4x +
            TRUE
    @@ -39588,7 +41153,8 @@

    teal.slice coverage - 65.92%

    653 - 9x + 9x +
            FALSE
    @@ -39658,14 +41224,16 @@

    teal.slice coverage - 65.92%

    663 - 12x + 12x +
          ns <- NS(id)
    664 - 12x + 12x +
          uiOutput(ns("summary"), class = "filter-card-summary")
    @@ -39721,28 +41289,32 @@

    teal.slice coverage - 65.92%

    672 - 12x + 12x +
          moduleServer(
    673 - 12x + 12x +
            id = id,
    674 - 12x + 12x +
            function(input, output, session) {
    675 - 12x + 12x +
              output$summary <- renderUI(private$content_summary())
    @@ -40008,14 +41580,16 @@

    teal.slice coverage - 65.92%

    713 - 11x + 11x +
          ns <- NS(id)
    714 - 11x + 11x +
          if (private$na_count > 0) {
    @@ -40169,7 +41743,8 @@

    teal.slice coverage - 65.92%

    736 - 11x + 11x +
            NULL
    @@ -40246,7 +41821,8 @@

    teal.slice coverage - 65.92%

    747 - 12x + 12x +
          moduleServer(id, function(input, output, session) {
    @@ -40274,42 +41850,48 @@

    teal.slice coverage - 65.92%

    751 - 12x + 12x +
            output$trigger_visible <- renderUI({
    752 - 12x + 12x +
              updateCountText(
    753 - 12x + 12x +
                inputId = "count_label",
    754 - 12x + 12x +
                label = "Keep NA",
    755 - 12x + 12x +
                countmax = private$na_count,
    756 - 12x + 12x +
                countnow = private$filtered_na_count()
    @@ -40323,7 +41905,8 @@

    teal.slice coverage - 65.92%

    758 - 12x + 12x +
              NULL
    @@ -40365,35 +41948,40 @@

    teal.slice coverage - 65.92%

    764 - 12x + 12x +
            private$observers$keep_na_api <- observeEvent(
    765 - 12x + 12x +
              ignoreNULL = FALSE, # nothing selected is possible for NA
    766 - 12x + 12x +
              ignoreInit = TRUE, # ignoreInit: should not matter because we set the UI with the desired initial state
    767 - 12x + 12x +
              eventExpr = private$get_keep_na(),
    768 - 12x + 12x +
              handlerExpr = {
    @@ -40470,35 +42058,40 @@

    teal.slice coverage - 65.92%

    779 - 12x + 12x +
            private$observers$keep_na <- observeEvent(
    780 - 12x + 12x +
              ignoreNULL = FALSE, # ignoreNULL: we don't want to ignore NULL when nothing is selected in the `selectInput`
    781 - 12x + 12x +
              ignoreInit = TRUE, # ignoreInit: should not matter because we set the UI with the desired initial state
    782 - 12x + 12x +
              eventExpr = input$value,
    783 - 12x + 12x +
              handlerExpr = {
    @@ -40568,7 +42161,8 @@

    teal.slice coverage - 65.92%

    793 - 12x + 12x +
            invisible(NULL)
    @@ -40847,7 +42441,8 @@

    teal.slice coverage - 65.92%

    35 - 92x + 92x +
          if (!requireNamespace("SummarizedExperiment", quietly = TRUE)) {
    @@ -40868,35 +42463,40 @@

    teal.slice coverage - 65.92%

    38 - 92x + 92x +
          checkmate::assert_function(data_reactive, args = "sid")
    39 - 92x + 92x +
          checkmate::assert_class(data, "SummarizedExperiment")
    40 - 91x + 91x +
          super$initialize(data, data_reactive, dataname, datalabel)
    41 - 91x + 91x +
          if (!is.null(datalabel)) {
    42 - 84x + 84x +
            private$dataname_prefixed <- sprintf("%s[['%s']]", dataname, datalabel)
    @@ -40987,35 +42587,40 @@

    teal.slice coverage - 65.92%

    55 - 61x + 61x +
          isolate({
    56 - 61x + 61x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initializing, dataname: { private$dataname }")
    57 - 61x + 61x +
            checkmate::assert_class(state, "teal_slices")
    58 - 59x + 59x +
            lapply(state, function(x) {
    59 - 17x + 17x +
              checkmate::assert_choice(x$arg, choices = c("subset", "select"), null.ok = TRUE, .var.name = "teal_slice$arg")
    @@ -41029,21 +42634,24 @@

    teal.slice coverage - 65.92%

    61 - 59x + 59x +
            count_type <- attr(state, "count_type")
    62 - 59x + 59x +
            if (length(count_type)) {
    63 - 8x + 8x +
              private$count_type <- count_type
    @@ -41064,35 +42672,40 @@

    teal.slice coverage - 65.92%

    66 - 59x + 59x +
            subset_states <- Filter(function(x) x$arg == "subset", state)
    67 - 59x + 59x +
            private$set_filter_state_impl(
    68 - 59x + 59x +
              state = subset_states,
    69 - 59x + 59x +
              data = SummarizedExperiment::rowData(private$data),
    70 - 59x + 59x +
              data_reactive = function(sid = "") {
    @@ -41148,35 +42761,40 @@

    teal.slice coverage - 65.92%

    78 - 59x + 59x +
            select_states <- Filter(function(x) x$arg == "select", state)
    79 - 59x + 59x +
            private$set_filter_state_impl(
    80 - 59x + 59x +
              state = select_states,
    81 - 59x + 59x +
              data = SummarizedExperiment::colData(private$data),
    82 - 59x + 59x +
              data_reactive = function(sid = "") {
    @@ -41232,14 +42850,16 @@

    teal.slice coverage - 65.92%

    90 - 59x + 59x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initialized, dataname: { private$dataname }")
    91 - 59x + 59x +
            invisible(NULL)
    @@ -41309,49 +42929,56 @@

    teal.slice coverage - 65.92%

    101 - 2x + 2x +
          data <- private$data
    102 - 2x + 2x +
          checkmate::assert_string(id)
    103 - 2x + 2x +
          ns <- NS(id)
    104 - 2x + 2x +
          row_input <- if (ncol(SummarizedExperiment::rowData(data)) == 0) {
    105 - 1x + 1x +
            tags$div("no sample variables available")
    106 - 2x + 2x +
          } else if (nrow(SummarizedExperiment::rowData(data)) == 0) {
    107 - 1x + 1x +
            tags$div("no samples available")
    @@ -41435,28 +43062,32 @@

    teal.slice coverage - 65.92%

    119 - 2x + 2x +
          col_input <- if (ncol(SummarizedExperiment::colData(data)) == 0) {
    120 - 1x + 1x +
            tags$div("no sample variables available")
    121 - 2x + 2x +
          } else if (nrow(SummarizedExperiment::colData(data)) == 0) {
    122 - 1x + 1x +
            tags$div("no samples available")
    @@ -41540,21 +43171,24 @@

    teal.slice coverage - 65.92%

    134 - 2x + 2x +
          tags$div(
    135 - 2x + 2x +
            row_input,
    136 - 2x + 2x +
            col_input
    @@ -42974,7 +44608,8 @@

    teal.slice coverage - 65.92%

    33 - 153x + 153x +
          logger::log_trace("Instantiating { class(self)[1] }, dataname: { dataname }")
    @@ -42995,21 +44630,24 @@

    teal.slice coverage - 65.92%

    36 - 153x + 153x +
          check_simple_name(dataname)
    37 - 151x + 151x +
          checkmate::assert_character(keys, any.missing = FALSE)
    38 - 151x + 151x +
          checkmate::assert_character(label, null.ok = TRUE)
    @@ -43023,35 +44661,40 @@

    teal.slice coverage - 65.92%

    40 - 151x + 151x +
          logger::log_trace("Instantiating { class(self)[1] }, dataname: { dataname }")
    41 - 151x + 151x +
          private$dataset <- dataset
    42 - 151x + 151x +
          private$dataname <- dataname
    43 - 151x + 151x +
          private$keys <- keys
    44 - 151x + 151x +
          private$label <- if (is.null(label)) character(0) else label
    @@ -43072,28 +44715,32 @@

    teal.slice coverage - 65.92%

    47 - 151x + 151x +
          private$data_filtered_fun <- function(sid = "") {
    48 - 24x + 24x +
            checkmate::assert_character(sid)
    49 - 24x + 24x +
            if (length(sid)) {
    50 - 24x + 24x +
              logger::log_trace("filtering data dataname: { dataname }, sid: { sid }")
    @@ -43121,35 +44768,40 @@

    teal.slice coverage - 65.92%

    54 - 24x + 24x +
            env <- new.env(parent = parent.env(globalenv()))
    55 - 24x + 24x +
            env[[dataname]] <- private$dataset
    56 - 24x + 24x +
            filter_call <- self$get_call(sid)
    57 - 24x + 24x +
            eval_expr_with_msg(filter_call, env)
    58 - 24x + 24x +
            get(x = dataname, envir = env)
    @@ -43170,21 +44822,24 @@

    teal.slice coverage - 65.92%

    61 - 151x + 151x +
          private$data_filtered <- reactive(private$data_filtered_fun())
    62 - 151x + 151x +
          logger::log_trace("Instantiated { class(self)[1] }, dataname: { private$dataname }")
    63 - 151x + 151x +
          invisible(self)
    @@ -43268,28 +44923,32 @@

    teal.slice coverage - 65.92%

    75 - 24x + 24x +
          sprintf(
    76 - 24x + 24x +
            "%s:\n%s",
    77 - 24x + 24x +
            class(self)[1],
    78 - 24x + 24x +
            format(self$get_filter_state(), show_all = show_all, trim_lines = trim_lines)
    @@ -43359,7 +45018,8 @@

    teal.slice coverage - 65.92%

    88 - 10x + 10x +
          cat(isolate(self$format(...)), "\n")
    @@ -43436,28 +45096,32 @@

    teal.slice coverage - 65.92%

    99 - 14x + 14x +
          logger::log_trace("Removing filters from FilteredDataset: { deparse1(self$get_dataname()) }")
    100 - 14x + 14x +
          lapply(
    101 - 14x + 14x +
            private$get_filter_states(),
    102 - 14x + 14x +
            function(filter_states) filter_states$clear_filter_states(force)
    @@ -43471,14 +45135,16 @@

    teal.slice coverage - 65.92%

    104 - 14x + 14x +
          logger::log_trace("Removed filters from FilteredDataset: { deparse1(self$get_dataname()) }")
    105 - 14x + 14x +
          NULL
    @@ -43611,21 +45277,24 @@

    teal.slice coverage - 65.92%

    124 - 47x + 47x +
          filter_call <- Filter(
    125 - 47x + 47x +
            f = Negate(is.null),
    126 - 47x + 47x +
            x = lapply(private$get_filter_states(), function(x) x$get_call(sid))
    @@ -43639,14 +45308,16 @@

    teal.slice coverage - 65.92%

    128 - 47x + 47x +
          if (length(filter_call) == 0) {
    129 - 29x + 29x +
            return(NULL)
    @@ -43660,7 +45331,8 @@

    teal.slice coverage - 65.92%

    131 - 18x + 18x +
          filter_call
    @@ -43723,14 +45395,16 @@

    teal.slice coverage - 65.92%

    140 - 184x + 184x +
          states <- unname(lapply(private$get_filter_states(), function(x) x$get_filter_state()))
    141 - 184x + 184x +
          do.call(c, states)
    @@ -43856,7 +45530,8 @@

    teal.slice coverage - 65.92%

    159 - 16x + 16x +
          length(self$get_filter_state())
    @@ -43912,7 +45587,8 @@

    teal.slice coverage - 65.92%

    167 - 8x + 8x +
          private$dataname
    @@ -44003,14 +45679,16 @@

    teal.slice coverage - 65.92%

    180 - 51x + 51x +
          if (filtered) {
    181 - 33x + 33x +
            private$data_filtered
    @@ -44024,7 +45702,8 @@

    teal.slice coverage - 65.92%

    183 - 18x + 18x +
            private$dataset
    @@ -44129,7 +45808,8 @@

    teal.slice coverage - 65.92%

    198 - 133x + 133x +
          private$keys
    @@ -44178,7 +45858,8 @@

    teal.slice coverage - 65.92%

    205 - 2x + 2x +
          private$label
    @@ -44724,77 +46405,88 @@

    teal.slice coverage - 65.92%

    283 - 7x + 7x +
          moduleServer(
    284 - 7x + 7x +
            id = id,
    285 - 7x + 7x +
            function(input, output, session) {
    286 - 7x + 7x +
              dataname <- self$get_dataname()
    287 - 7x + 7x +
              logger::log_trace("FilteredDataset$srv_active initializing, dataname: { dataname }")
    288 - 7x + 7x +
              checkmate::assert_string(dataname)
    289 - 7x + 7x +
              output$filter_count <- renderText(
    290 - 7x + 7x +
                sprintf(
    291 - 7x + 7x +
                  "%d filter%s applied",
    292 - 7x + 7x +
                  self$get_filter_count(),
    293 - 7x + 7x +
                  if (self$get_filter_count() != 1) "s" else ""
    @@ -44822,28 +46514,32 @@

    teal.slice coverage - 65.92%

    297 - 7x + 7x +
              lapply(
    298 - 7x + 7x +
                names(private$get_filter_states()),
    299 - 7x + 7x +
                function(x) {
    300 - 12x + 12x +
                  private$get_filter_states()[[x]]$srv_active(id = x)
    @@ -44871,35 +46567,40 @@

    teal.slice coverage - 65.92%

    304 - 7x + 7x +
              observeEvent(self$get_filter_state(), {
    305 - 8x + 8x +
                shinyjs::hide("filter_count_ui")
    306 - 8x + 8x +
                shinyjs::show("filters")
    307 - 8x + 8x +
                shinyjs::toggle("remove_filters", condition = length(self$get_filter_state()) != 0)
    308 - 8x + 8x +
                shinyjs::toggle("collapse", condition = length(self$get_filter_state()) != 0)
    @@ -44920,7 +46621,8 @@

    teal.slice coverage - 65.92%

    311 - 7x + 7x +
              observeEvent(input$collapse, {
    @@ -44962,28 +46664,32 @@

    teal.slice coverage - 65.92%

    317 - 7x + 7x +
              observeEvent(input$remove_filters, {
    318 - 1x + 1x +
                logger::log_trace("FilteredDataset$srv_active@1 removing all non-anchored filters, dataname: { dataname }")
    319 - 1x + 1x +
                self$clear_filter_states()
    320 - 1x + 1x +
                logger::log_trace("FilteredDataset$srv_active@1 removed all non-anchored filters, dataname: { dataname }")
    @@ -45004,7 +46710,8 @@

    teal.slice coverage - 65.92%

    323 - 7x + 7x +
              logger::log_trace("FilteredDataset$initialized, dataname: { dataname }")
    @@ -45018,7 +46725,8 @@

    teal.slice coverage - 65.92%

    325 - 7x + 7x +
              NULL
    @@ -45109,7 +46817,8 @@

    teal.slice coverage - 65.92%

    338 - 1x + 1x +
          stop("Pure virtual method")
    @@ -45207,63 +46916,72 @@

    teal.slice coverage - 65.92%

    352 - 2x + 2x +
          moduleServer(
    353 - 2x + 2x +
            id = id,
    354 - 2x + 2x +
            function(input, output, session) {
    355 - 2x + 2x +
              logger::log_trace("MAEFilteredDataset$srv_add initializing, dataname: { deparse1(self$get_dataname()) }")
    356 - 2x + 2x +
              elems <- private$get_filter_states()
    357 - 2x + 2x +
              elem_names <- names(private$get_filter_states())
    358 - 2x + 2x +
              lapply(
    359 - 2x + 2x +
                elem_names,
    360 - 2x + 2x +
                function(elem_name) elems[[elem_name]]$srv_add(elem_name)
    @@ -45277,14 +46995,16 @@

    teal.slice coverage - 65.92%

    362 - 2x + 2x +
              logger::log_trace("MAEFilteredDataset$srv_add initialized, dataname: { deparse1(self$get_dataname()) }")
    363 - 2x + 2x +
              NULL
    @@ -45424,28 +47144,32 @@

    teal.slice coverage - 65.92%

    383 - 225x + 225x +
          checkmate::assert_class(filter_states, "FilterStates")
    384 - 225x + 225x +
          checkmate::assert_string(id)
    385 - 225x + 225x +
          x <- stats::setNames(list(filter_states), id)
    386 - 225x + 225x +
          private$filter_states <- c(private$get_filter_states(), x)
    @@ -45494,7 +47218,8 @@

    teal.slice coverage - 65.92%

    393 - 684x + 684x +
          private$filter_states
    @@ -45962,42 +47687,48 @@

    teal.slice coverage - 65.92%

    63 - 6x + 6x +
          isolate({
    64 - 6x + 6x +
            super$initialize(
    65 - 6x + 6x +
              x = x,
    66 - 6x + 6x +
              x_reactive = x_reactive,
    67 - 6x + 6x +
              slice = slice,
    68 - 6x + 6x +
              extract_type = extract_type
    @@ -46011,14 +47742,16 @@

    teal.slice coverage - 65.92%

    70 - 6x + 6x +
            private$set_choices(slice$choices)
    71 - 6x + 6x +
            private$set_selected(slice$selected)
    @@ -46039,7 +47772,8 @@

    teal.slice coverage - 65.92%

    74 - 6x + 6x +
          invisible(self)
    @@ -46109,14 +47843,16 @@

    teal.slice coverage - 65.92%

    84 - 2x + 2x +
          if (isFALSE(private$is_any_filtered())) {
    85 - 1x + 1x +
            return(NULL)
    @@ -46130,14 +47866,16 @@

    teal.slice coverage - 65.92%

    87 - 1x + 1x +
          if (missing(dataname)) dataname <- private$get_dataname()
    88 - 1x + 1x +
          filter_call <- if (isTRUE(private$get_keep_na())) {
    @@ -46158,7 +47896,8 @@

    teal.slice coverage - 65.92%

    91 - 1x + 1x +
            substitute(!is.na(varname), list(varname = private$get_varname_prefixed(dataname)))
    @@ -46270,14 +48009,16 @@

    teal.slice coverage - 65.92%

    107 - 6x + 6x +
          private$teal_slice$choices <- choices
    108 - 6x + 6x +
          invisible(NULL)
    @@ -46333,7 +48074,8 @@

    teal.slice coverage - 65.92%

    116 - 2x + 2x +
          if (private$is_choice_limited) {
    @@ -46354,7 +48096,8 @@

    teal.slice coverage - 65.92%

    119 - 2x + 2x +
            !isTRUE(private$get_keep_na())
    @@ -47256,42 +48999,48 @@

    teal.slice coverage - 65.92%

    75 - 25x + 25x +
      checkmate::assert_string(inputId)
    76 - 21x + 21x +
      checkmate::assert_vector(choices)
    77 - 20x + 20x +
      checkmate::assert_numeric(countsmax, len = length(choices))
    78 - 17x + 17x +
      checkmate::assert_numeric(countsnow, len = length(choices), null.ok = TRUE)
    79 - 15x + 15x +
      if (!is.null(countsnow)) {
    80 - 7x + 7x +
        checkmate::assert_true(all(countsnow <= countsmax))
    @@ -47312,7 +49061,8 @@

    teal.slice coverage - 65.92%

    83 - 14x + 14x +
      ns <- NS(inputId)
    @@ -47326,56 +49076,64 @@

    teal.slice coverage - 65.92%

    85 - 14x + 14x +
      mapply(
    86 - 14x + 14x +
        countBar,
    87 - 14x + 14x +
        inputId = ns(seq_along(choices)),
    88 - 14x + 14x +
        label = as.character(choices),
    89 - 14x + 14x +
        countmax = countsmax,
    90 - 14x + 14x +
        countnow = if (is.null(countsnow)) rep(list(NULL), length(choices)) else countsnow,
    91 - 14x + 14x +
        MoreArgs = list(
    92 - 14x + 14x +
          counttotal = sum(countsmax)
    @@ -47389,7 +49147,8 @@

    teal.slice coverage - 65.92%

    94 - 14x + 14x +
        SIMPLIFY = FALSE, USE.NAMES = FALSE
    @@ -47564,35 +49323,40 @@

    teal.slice coverage - 65.92%

    119 - 61x + 61x +
      checkmate::assert_string(inputId)
    120 - 57x + 57x +
      checkmate::assert_string(label)
    121 - 54x + 54x +
      checkmate::assert_number(countmax)
    122 - 51x + 51x +
      checkmate::assert_number(countnow, null.ok = TRUE, upper = countmax)
    123 - 49x + 49x +
      checkmate::assert_number(counttotal, lower = countmax)
    @@ -47606,35 +49370,40 @@

    teal.slice coverage - 65.92%

    125 - 47x + 47x +
      label <- make_count_text(label, countmax = countmax, countnow = countnow)
    126 - 47x + 47x +
      ns <- NS(inputId)
    127 - 24x + 24x +
      if (is.null(countnow)) countnow <- 0
    128 - 47x + 47x +
      tags$div(
    129 - 47x + 47x +
        class = "progress state-count-container",
    @@ -47648,42 +49417,48 @@

    teal.slice coverage - 65.92%

    131 - 47x + 47x +
        tags$div(
    132 - 47x + 47x +
          id = ns("count_bar_filtered"),
    133 - 47x + 47x +
          class = "progress-bar state-count-bar-filtered",
    134 - 47x + 47x +
          style = sprintf("width: %s%%", countnow / counttotal * 100),
    135 - 47x + 47x +
          role = "progressbar",
    136 - 47x + 47x +
          label
    @@ -47697,35 +49472,40 @@

    teal.slice coverage - 65.92%

    138 - 47x + 47x +
        tags$div(
    139 - 47x + 47x +
          id = ns("count_bar_unfiltered"),
    140 - 47x + 47x +
          class = "progress-bar state-count-bar-unfiltered",
    141 - 47x + 47x +
          style = sprintf("width: %s%%", (countmax - countnow) / counttotal * 100),
    142 - 47x + 47x +
          role = "progressbar"
    @@ -47774,28 +49554,32 @@

    teal.slice coverage - 65.92%

    149 - 7x + 7x +
      checkmate::assert_string(inputId)
    150 - 7x + 7x +
      checkmate::assert_vector(choices)
    151 - 7x + 7x +
      checkmate::assert_numeric(countsmax, len = length(choices))
    152 - 7x + 7x +
      checkmate::assert_numeric(countsnow, len = length(choices), null.ok = TRUE)
    @@ -47809,63 +49593,72 @@

    teal.slice coverage - 65.92%

    154 - 7x + 7x +
      ns <- NS(inputId)
    155 - 7x + 7x +
      mapply(
    156 - 7x + 7x +
        updateCountBar,
    157 - 7x + 7x +
        inputId = ns(seq_along(choices)),
    158 - 7x + 7x +
        label = choices,
    159 - 7x + 7x +
        countmax = countsmax,
    160 - 7x + 7x +
        countnow = if (is.null(countsnow)) rep(list(NULL), length(choices)) else countsnow,
    161 - 7x + 7x +
        MoreArgs = list(
    162 - 7x + 7x +
          counttotal = sum(countsmax)
    @@ -47886,7 +49679,8 @@

    teal.slice coverage - 65.92%

    165 - 6x + 6x +
      invisible(NULL)
    @@ -47921,35 +49715,40 @@

    teal.slice coverage - 65.92%

    170 - 17x + 17x +
      checkmate::assert_string(inputId)
    171 - 17x + 17x +
      checkmate::assert_string(label)
    172 - 17x + 17x +
      checkmate::assert_number(countmax)
    173 - 16x + 16x +
      checkmate::assert_number(countnow, null.ok = TRUE)
    174 - 16x + 16x +
      checkmate::assert_number(counttotal)
    @@ -47963,70 +49762,80 @@

    teal.slice coverage - 65.92%

    176 - 16x + 16x +
      label <- make_count_text(label, countmax = countmax, countnow = countnow)
    177 - 16x + 16x +
      if (is.null(countnow)) countnow <- countmax
    178 - 16x + 16x +
      session$sendCustomMessage(
    179 - 16x + 16x +
        type = "updateCountBar",
    180 - 16x + 16x +
        message = list(
    181 - 16x + 16x +
          id = session$ns(inputId),
    182 - 16x + 16x +
          label = label,
    183 - 16x + 16x +
          countmax = countmax,
    184 - 16x + 16x +
          countnow = countnow,
    185 - 16x + 16x +
          counttotal = counttotal
    @@ -48054,7 +49863,8 @@

    teal.slice coverage - 65.92%

    189 - 16x + 16x +
      invisible(NULL)
    @@ -48089,70 +49899,80 @@

    teal.slice coverage - 65.92%

    194 - 17x + 17x +
      checkmate::assert_string(inputId)
    195 - 17x + 17x +
      checkmate::assert_string(label)
    196 - 17x + 17x +
      checkmate::assert_number(countmax)
    197 - 17x + 17x +
      checkmate::assert_number(countnow, null.ok = TRUE)
    198 - 17x + 17x +
      label <- make_count_text(label, countmax = countmax, countnow = countnow)
    199 - 17x + 17x +
      session$sendCustomMessage(
    200 - 17x + 17x +
        type = "updateCountText",
    201 - 17x + 17x +
        message = list(
    202 - 17x + 17x +
          id = session$ns(inputId),
    203 - 17x + 17x +
          label = label
    @@ -48292,56 +50112,64 @@

    teal.slice coverage - 65.92%

    223 - 92x + 92x +
      checkmate::assert_string(label)
    224 - 90x + 90x +
      checkmate::assert_number(countmax)
    225 - 88x + 88x +
      checkmate::assert_number(countnow, null.ok = TRUE)
    226 - 86x + 86x +
      sprintf(
    227 - 86x + 86x +
        "%s (%s%s)",
    228 - 86x + 86x +
        label,
    229 - 86x + 86x +
        if (is.null(countnow)) "" else sprintf("%s/", countnow),
    230 - 86x + 86x +
        countmax
    @@ -48648,7 +50476,8 @@

    teal.slice coverage - 65.92%

    41 - 24x + 24x +
          super$initialize(dataset = dataset, dataname = dataname, label = label)
    @@ -48732,35 +50561,40 @@

    teal.slice coverage - 65.92%

    53 - 4x + 4x +
          class_string <- toString(class(private$dataset))
    54 - 4x + 4x +
          if (trim_lines) {
    55 - 2x + 2x +
            trim_position <- 37L
    56 - 2x + 2x +
            class_string <- strtrim(class_string, trim_position)
    57 - 2x + 2x +
            substr(class_string, 35L, 37L) <- "..."
    @@ -48774,7 +50608,8 @@

    teal.slice coverage - 65.92%

    59 - 4x + 4x +
          sprintf(" - unfiltered dataset:\t\"%s\":   %s", private$dataname, class_string)
    @@ -48816,7 +50651,8 @@

    teal.slice coverage - 65.92%

    65 - 1x + 1x +
          invisible(NULL)
    @@ -48844,7 +50680,8 @@

    teal.slice coverage - 65.92%

    69 - 2x + 2x +
          invisible(NULL)
    @@ -48879,14 +50716,16 @@

    teal.slice coverage - 65.92%

    74 - 3x + 3x +
          if (length(state) != 0L) {
    75 - 1x + 1x +
            warning("DefaultFilterState cannot set state")
    @@ -48900,7 +50739,8 @@

    teal.slice coverage - 65.92%

    77 - 3x + 3x +
          invisible(NULL)
    @@ -48935,7 +50775,8 @@

    teal.slice coverage - 65.92%

    82 - 1x + 1x +
          invisible(NULL)
    @@ -48991,7 +50832,8 @@

    teal.slice coverage - 65.92%

    90 - 1x + 1x +
          data.frame(dataname = private$dataname, obs = NA, obs_filtered = NA)
    @@ -49676,7 +51518,8 @@

    teal.slice coverage - 65.92%

    64 - 229x + 229x +
      UseMethod("init_filter_states")
    @@ -49753,42 +51596,48 @@

    teal.slice coverage - 65.92%

    75 - 100x + 100x +
      DFFilterStates$new(
    76 - 100x + 100x +
        data = data,
    77 - 100x + 100x +
        data_reactive = data_reactive,
    78 - 100x + 100x +
        dataname = dataname,
    79 - 100x + 100x +
        datalabel = datalabel,
    80 - 100x + 100x +
        keys = keys
    @@ -49865,35 +51714,40 @@

    teal.slice coverage - 65.92%

    91 - 22x + 22x +
      MatrixFilterStates$new(
    92 - 22x + 22x +
        data = data,
    93 - 22x + 22x +
        data_reactive = data_reactive,
    94 - 22x + 22x +
        dataname = dataname,
    95 - 22x + 22x +
        datalabel = datalabel
    @@ -49977,7 +51831,8 @@

    teal.slice coverage - 65.92%

    107 - 22x + 22x +
      if (!requireNamespace("MultiAssayExperiment", quietly = TRUE)) {
    @@ -49998,42 +51853,48 @@

    teal.slice coverage - 65.92%

    110 - 22x + 22x +
      MAEFilterStates$new(
    111 - 22x + 22x +
        data = data,
    112 - 22x + 22x +
        data_reactive = data_reactive,
    113 - 22x + 22x +
        dataname = dataname,
    114 - 22x + 22x +
        datalabel = datalabel,
    115 - 22x + 22x +
        keys = keys
    @@ -50110,7 +51971,8 @@

    teal.slice coverage - 65.92%

    126 - 85x + 85x +
      if (!requireNamespace("SummarizedExperiment", quietly = TRUE)) {
    @@ -50131,35 +51993,40 @@

    teal.slice coverage - 65.92%

    129 - 85x + 85x +
      SEFilterStates$new(
    130 - 85x + 85x +
        data = data,
    131 - 85x + 85x +
        data_reactive = data_reactive,
    132 - 85x + 85x +
        dataname = dataname,
    133 - 85x + 85x +
        datalabel = datalabel
    @@ -50341,7 +52208,8 @@

    teal.slice coverage - 65.92%

    159 - 227x + 227x +
      UseMethod("get_supported_filter_varnames")
    @@ -50383,28 +52251,32 @@

    teal.slice coverage - 65.92%

    165 - 198x + 198x +
      is_expected_class <- vapply(
    166 - 198x + 198x +
        X = data,
    167 - 198x + 198x +
        FUN = function(x) any(class(x) %in% .filterable_class),
    168 - 198x + 198x +
        FUN.VALUE = logical(1)
    @@ -50418,7 +52290,8 @@

    teal.slice coverage - 65.92%

    170 - 198x + 198x +
      names(is_expected_class[is_expected_class])
    @@ -50467,21 +52340,24 @@

    teal.slice coverage - 65.92%

    177 - 29x + 29x +
      is_expected_class <- class(data[, 1]) %in% .filterable_class
    178 - 29x + 29x +
      if (is_expected_class && !is.null(colnames(data))) {
    179 - 26x + 26x +
        colnames(data)
    @@ -50495,7 +52371,8 @@

    teal.slice coverage - 65.92%

    181 - 3x + 3x +
        character(0)
    @@ -50733,7 +52610,8 @@

    teal.slice coverage - 65.92%

    215 - 9x + 9x +
      if (length(choices) == 0) {
    @@ -50754,14 +52632,16 @@

    teal.slice coverage - 65.92%

    218 - 9x + 9x +
      choice_types <- variable_types(data = data, columns = choices)
    219 - 9x + 9x +
      choice_types[keys] <- "primary_key"
    @@ -50775,28 +52655,32 @@

    teal.slice coverage - 65.92%

    221 - 9x + 9x +
      choices_labeled(
    222 - 9x + 9x +
        choices = choices,
    223 - 9x + 9x +
        labels = unname(varlabels[choices]),
    224 - 9x + 9x +
        types = choice_types[choices]
    @@ -50845,49 +52729,56 @@

    teal.slice coverage - 65.92%

    231 - 9x + 9x +
      if (!is.array(data)) {
    232 - 9x + 9x +
        vapply(
    233 - 9x + 9x +
          colnames(data),
    234 - 9x + 9x +
          FUN = function(x) {
    235 - 42x + 42x +
            label <- attr(data[[x]], "label")
    236 - 42x + 42x +
            if (is.null(label)) {
    237 - 40x + 40x +
              x
    @@ -50901,7 +52792,8 @@

    teal.slice coverage - 65.92%

    239 - 2x + 2x +
              label
    @@ -50922,7 +52814,8 @@

    teal.slice coverage - 65.92%

    242 - 9x + 9x +
          FUN.VALUE = character(1)
    @@ -51131,7 +53024,8 @@

    teal.slice coverage - 65.92%

    24 - 9x + 9x +
      if (is.factor(choices)) {
    @@ -51159,35 +53053,40 @@

    teal.slice coverage - 65.92%

    28 - 9x + 9x +
      stopifnot(
    29 - 9x + 9x +
        is.character(choices) ||
    30 - 9x + 9x +
          is.numeric(choices) ||
    31 - 9x + 9x +
          is.logical(choices) ||
    32 - 9x + 9x +
          (length(choices) == 1 && is.na(choices))
    @@ -51208,7 +53107,8 @@

    teal.slice coverage - 65.92%

    35 - 9x + 9x +
      if (is.factor(labels)) {
    @@ -51236,14 +53136,16 @@

    teal.slice coverage - 65.92%

    39 - 9x + 9x +
      checkmate::assert_character(labels[!is.na(labels)], any.missing = FALSE)
    40 - 9x + 9x +
      if (length(choices) != length(labels)) {
    @@ -51264,14 +53166,16 @@

    teal.slice coverage - 65.92%

    43 - 9x + 9x +
      stopifnot(is.null(subset) || is.vector(subset))
    44 - 9x + 9x +
      stopifnot(is.null(types) || is.vector(types))
    @@ -51285,14 +53189,16 @@

    teal.slice coverage - 65.92%

    46 - 9x + 9x +
      if (is.vector(types)) {
    47 - 9x + 9x +
        stopifnot(length(choices) == length(types))
    @@ -51313,7 +53219,8 @@

    teal.slice coverage - 65.92%

    50 - 9x + 9x +
      if (!is.null(subset)) {
    @@ -51376,56 +53283,64 @@

    teal.slice coverage - 65.92%

    59 - 9x + 9x +
      is_dupl <- duplicated(choices)
    60 - 9x + 9x +
      choices <- choices[!is_dupl]
    61 - 9x + 9x +
      labels <- labels[!is_dupl]
    62 - 9x + 9x +
      types <- types[!is_dupl]
    63 - 9x + 9x +
      labels[is.na(labels)] <- "Label Missing"
    64 - 9x + 9x +
      raw_labels <- labels
    65 - 9x + 9x +
      combined_labels <- if (length(choices) > 0) {
    66 - 9x + 9x +
        paste0(choices, ": ", labels)
    @@ -51460,7 +53375,8 @@

    teal.slice coverage - 65.92%

    71 - 9x + 9x +
      if (!is.null(subset)) {
    @@ -51509,49 +53425,56 @@

    teal.slice coverage - 65.92%

    78 - 9x + 9x +
      choices <- structure(
    79 - 9x + 9x +
        choices,
    80 - 9x + 9x +
        names = combined_labels,
    81 - 9x + 9x +
        raw_labels = raw_labels,
    82 - 9x + 9x +
        combined_labels = combined_labels,
    83 - 9x + 9x +
        class = c("choices_labeled", "character"),
    84 - 9x + 9x +
        types = types
    @@ -51572,7 +53495,8 @@

    teal.slice coverage - 65.92%

    87 - 9x + 9x +
      choices
    @@ -52600,21 +54524,24 @@

    teal.slice coverage - 65.92%

    145 - 24x + 24x +
          isolate({
    146 - 24x + 24x +
            checkmate::assert_date(x)
    147 - 23x + 23x +
            checkmate::assert_class(x_reactive, "reactive")
    @@ -52628,35 +54555,40 @@

    teal.slice coverage - 65.92%

    149 - 23x + 23x +
            super$initialize(
    150 - 23x + 23x +
              x = x,
    151 - 23x + 23x +
              x_reactive = x_reactive,
    152 - 23x + 23x +
              slice = slice,
    153 - 23x + 23x +
              extract_type = extract_type
    @@ -52670,28 +54602,32 @@

    teal.slice coverage - 65.92%

    155 - 23x + 23x +
            checkmate::assert_date(slice$choices, null.ok = TRUE)
    156 - 22x + 22x +
            private$set_choices(slice$choices)
    157 - 14x + 14x +
            if (is.null(slice$selected)) slice$selected <- slice$choices
    158 - 22x + 22x +
            private$set_selected(slice$selected)
    @@ -52712,7 +54648,8 @@

    teal.slice coverage - 65.92%

    161 - 21x + 21x +
          invisible(self)
    @@ -52789,14 +54726,16 @@

    teal.slice coverage - 65.92%

    172 - 7x + 7x +
          if (isFALSE(private$is_any_filtered())) {
    173 - 1x + 1x +
            return(NULL)
    @@ -52810,28 +54749,32 @@

    teal.slice coverage - 65.92%

    175 - 6x + 6x +
          choices <- as.character(private$get_selected())
    176 - 6x + 6x +
          varname <- private$get_varname_prefixed(dataname)
    177 - 6x + 6x +
          filter_call <-
    178 - 6x + 6x +
            call(
    @@ -52845,14 +54788,16 @@

    teal.slice coverage - 65.92%

    180 - 6x + 6x +
              call(">=", varname, call("as.Date", choices[1L])),
    181 - 6x + 6x +
              call("<=", varname, call("as.Date", choices[2L]))
    @@ -52866,7 +54811,8 @@

    teal.slice coverage - 65.92%

    183 - 6x + 6x +
          private$add_keep_na_call(filter_call, varname)
    @@ -52922,14 +54868,16 @@

    teal.slice coverage - 65.92%

    191 - 22x + 22x +
          if (is.null(choices)) {
    192 - 19x + 19x +
            choices <- range(private$x, na.rm = TRUE)
    @@ -52943,21 +54891,24 @@

    teal.slice coverage - 65.92%

    194 - 3x + 3x +
            choices_adjusted <- c(
    195 - 3x + 3x +
              max(choices[1L], min(private$x, na.rm = TRUE)),
    196 - 3x + 3x +
              min(choices[2L], max(private$x, na.rm = TRUE))
    @@ -52971,28 +54922,32 @@

    teal.slice coverage - 65.92%

    198 - 3x + 3x +
            if (any(choices != choices_adjusted)) {
    199 - 1x + 1x +
              warning(sprintf(
    200 - 1x + 1x +
                "Choices adjusted (some values outside of variable range). Varname: %s, dataname: %s.",
    201 - 1x + 1x +
                private$get_varname(), private$get_dataname()
    @@ -53006,7 +54961,8 @@

    teal.slice coverage - 65.92%

    203 - 1x + 1x +
              choices <- choices_adjusted
    @@ -53020,35 +54976,40 @@

    teal.slice coverage - 65.92%

    205 - 3x + 3x +
            if (choices[1L] >= choices[2L]) {
    206 - 1x + 1x +
              warning(sprintf(
    207 - 1x + 1x +
                "Invalid choices: lower is higher / equal to upper, or not in range of variable values.
    208 - 1x + 1x +
                Setting defaults. Varname: %s, dataname: %s.",
    209 - 1x + 1x +
                private$get_varname(), private$get_dataname()
    @@ -53062,7 +55023,8 @@

    teal.slice coverage - 65.92%

    211 - 1x + 1x +
              choices <- range(private$x, na.rm = TRUE)
    @@ -53083,28 +55045,32 @@

    teal.slice coverage - 65.92%

    214 - 22x + 22x +
          private$set_is_choice_limited(private$x, choices)
    215 - 22x + 22x +
          private$x <- private$x[(private$x >= choices[1L] & private$x <= choices[2L]) | is.na(private$x)]
    216 - 22x + 22x +
          private$teal_slice$choices <- choices
    217 - 22x + 22x +
          invisible(NULL)
    @@ -53146,14 +55112,16 @@

    teal.slice coverage - 65.92%

    223 - 22x + 22x +
          private$is_choice_limited <- (any(xl < choices[1L], na.rm = TRUE) | any(xl > choices[2L], na.rm = TRUE))
    224 - 22x + 22x +
          invisible(NULL)
    @@ -53174,21 +55142,24 @@

    teal.slice coverage - 65.92%

    227 - 33x + 33x +
          tryCatch(
    228 - 33x + 33x +
            expr = {
    229 - 33x + 33x +
              values <- as.Date(values, origin = "1970-01-01")
    @@ -53202,7 +55173,8 @@

    teal.slice coverage - 65.92%

    231 - 30x + 30x +
              values
    @@ -53216,7 +55188,8 @@

    teal.slice coverage - 65.92%

    233 - 33x + 33x +
            error = function(e) stop("Vector of set values must contain values coercible to Date.")
    @@ -53244,42 +55217,48 @@

    teal.slice coverage - 65.92%

    237 - 1x + 1x +
          if (length(values) != 2) stop("Vector of set values must have length two.")
    238 - 29x + 29x +
          if (values[1] > values[2]) {
    239 - 1x + 1x +
            warning(
    240 - 1x + 1x +
              sprintf(
    241 - 1x + 1x +
                "Start date %s is set after the end date %s, the values will be replaced with a default date range.",
    242 - 1x + 1x +
                values[1], values[2]
    @@ -53300,7 +55279,8 @@

    teal.slice coverage - 65.92%

    245 - 1x + 1x +
            values <- isolate(private$get_choices())
    @@ -53314,7 +55294,8 @@

    teal.slice coverage - 65.92%

    247 - 29x + 29x +
          values
    @@ -53335,42 +55316,48 @@

    teal.slice coverage - 65.92%

    250 - 29x + 29x +
          choices <- private$get_choices()
    251 - 29x + 29x +
          if (values[1] < choices[1L] | values[1] > choices[2L]) {
    252 - 5x + 5x +
            warning(
    253 - 5x + 5x +
              sprintf(
    254 - 5x + 5x +
                "Value: %s is outside of the possible range for column %s of dataset %s, setting minimum possible value.",
    255 - 5x + 5x +
                values[1], private$get_varname(), private$get_dataname()
    @@ -53391,7 +55378,8 @@

    teal.slice coverage - 65.92%

    258 - 5x + 5x +
            values[1] <- choices[1L]
    @@ -53412,35 +55400,40 @@

    teal.slice coverage - 65.92%

    261 - 29x + 29x +
          if (values[2] > choices[2L] | values[2] < choices[1L]) {
    262 - 5x + 5x +
            warning(
    263 - 5x + 5x +
              sprintf(
    264 - 5x + 5x +
                "Value: %s is outside of the possible range for column %s of dataset %s, setting maximum possible value.",
    265 - 5x + 5x +
                values[2], private$get_varname(), private$get_dataname()
    @@ -53461,7 +55454,8 @@

    teal.slice coverage - 65.92%

    268 - 5x + 5x +
            values[2] <- choices[2L]
    @@ -53482,7 +55476,8 @@

    teal.slice coverage - 65.92%

    271 - 29x + 29x +
          values
    @@ -55595,28 +57590,32 @@

    teal.slice coverage - 65.92%

    130 - 16x + 16x +
          isolate({
    131 - 16x + 16x +
            checkmate::assert_logical(x)
    132 - 15x + 15x +
            checkmate::assert_logical(slice$selected, null.ok = TRUE)
    133 - 14x + 14x +
            super$initialize(x = x, x_reactive = x_reactive, slice = slice, extract_type = extract_type)
    @@ -55630,7 +57629,8 @@

    teal.slice coverage - 65.92%

    135 - 14x + 14x +
            private$set_choices(slice$choices)
    @@ -55644,28 +57644,32 @@

    teal.slice coverage - 65.92%

    137 - 14x + 14x +
            if (is.null(slice$selected) && slice$multiple) {
    138 - 7x + 7x +
              slice$selected <- private$get_choices()
    139 - 7x + 7x +
            } else if (length(slice$selected) != 1 && !slice$multiple) {
    140 - 3x + 3x +
              slice$selected <- TRUE
    @@ -55679,28 +57683,32 @@

    teal.slice coverage - 65.92%

    142 - 14x + 14x +
            private$set_selected(slice$selected)
    143 - 14x + 14x +
            df <- factor(x, levels = c(TRUE, FALSE))
    144 - 14x + 14x +
            tbl <- table(df)
    145 - 14x + 14x +
            private$set_choices_counts(tbl)
    @@ -55714,7 +57722,8 @@

    teal.slice coverage - 65.92%

    147 - 14x + 14x +
          invisible(self)
    @@ -55784,7 +57793,8 @@

    teal.slice coverage - 65.92%

    157 - 6x + 6x +
          if (isFALSE(private$is_any_filtered())) {
    @@ -55805,28 +57815,32 @@

    teal.slice coverage - 65.92%

    160 - 4x + 4x +
          if (missing(dataname)) dataname <- private$get_dataname()
    161 - 6x + 6x +
          varname <- private$get_varname_prefixed(dataname)
    162 - 6x + 6x +
          choices <- private$get_selected()
    163 - 6x + 6x +
          n_choices <- length(choices)
    @@ -55840,35 +57854,40 @@

    teal.slice coverage - 65.92%

    165 - 6x + 6x +
          filter_call <-
    166 - 6x + 6x +
            if (n_choices == 1 && choices) {
    167 - 1x + 1x +
              varname
    168 - 6x + 6x +
            } else if (n_choices == 1 && !choices) {
    169 - 4x + 4x +
              call("!", varname)
    @@ -55882,7 +57901,8 @@

    teal.slice coverage - 65.92%

    171 - 1x + 1x +
              call("%in%", varname, make_c_call(choices))
    @@ -55896,7 +57916,8 @@

    teal.slice coverage - 65.92%

    173 - 6x + 6x +
          private$add_keep_na_call(filter_call, varname)
    @@ -55966,14 +57987,16 @@

    teal.slice coverage - 65.92%

    183 - 14x + 14x +
          private$teal_slice$choices <- c(TRUE, FALSE)
    184 - 14x + 14x +
          invisible(NULL)
    @@ -56008,14 +58031,16 @@

    teal.slice coverage - 65.92%

    189 - 14x + 14x +
          private$choices_counts <- choices_counts
    190 - 14x + 14x +
          invisible(NULL)
    @@ -56036,35 +58061,40 @@

    teal.slice coverage - 65.92%

    193 - 21x + 21x +
          tryCatch(
    194 - 21x + 21x +
            expr = {
    195 - 21x + 21x +
              values <- as.logical(values)
    196 - 1x + 1x +
              if (anyNA(values)) stop()
    197 - 20x + 20x +
              values
    @@ -56078,7 +58108,8 @@

    teal.slice coverage - 65.92%

    199 - 21x + 21x +
            error = function(e) stop("Vector of set values must contain values coercible to logical.")
    @@ -56113,28 +58144,32 @@

    teal.slice coverage - 65.92%

    204 - 20x + 20x +
          if (!private$is_multiple() && length(values) > 1) {
    205 - 1x + 1x +
            warning(
    206 - 1x + 1x +
              sprintf("Selection: %s is not a vector of length one. ", toString(values, width = 360)),
    207 - 1x + 1x +
              "Maintaining previous selection."
    @@ -56148,7 +58183,8 @@

    teal.slice coverage - 65.92%

    209 - 1x + 1x +
            values <- isolate(private$get_selected())
    @@ -56162,7 +58198,8 @@

    teal.slice coverage - 65.92%

    211 - 20x + 20x +
          values
    @@ -56204,7 +58241,8 @@

    teal.slice coverage - 65.92%

    217 - 6x + 6x +
          if (private$is_choice_limited) {
    @@ -56218,14 +58256,16 @@

    teal.slice coverage - 65.92%

    219 - 6x + 6x +
          } else if (all(private$choices_counts > 0)) {
    220 - 6x + 6x +
            TRUE
    @@ -58219,49 +60259,56 @@

    teal.slice coverage - 65.92%

    95 - 764x + 764x +
      slices <- list(...)
    96 - 764x + 764x +
      checkmate::assert_list(slices, types = "teal_slice", any.missing = FALSE)
    97 - 763x + 763x +
      slices_id <- isolate(vapply(slices, `[[`, character(1L), "id"))
    98 - 763x + 763x +
      if (any(duplicated(slices_id))) {
    99 - 1x + 1x +
        stop(
    100 - 1x + 1x +
          "Some teal_slice objects have the same id:\n",
    101 - 1x + 1x +
          toString(unique(slices_id[duplicated(slices_id)]))
    @@ -58282,35 +60329,40 @@

    teal.slice coverage - 65.92%

    104 - 762x + 762x +
      checkmate::assert_list(exclude_varnames, names = "named", types = "character", null.ok = TRUE, min.len = 1)
    105 - 761x + 761x +
      checkmate::assert_list(include_varnames, names = "named", types = "character", null.ok = TRUE, min.len = 1)
    106 - 760x + 760x +
      checkmate::assert_character(count_type, len = 1, null.ok = TRUE)
    107 - 758x + 758x +
      checkmate::assert_subset(count_type, choices = c("all", "none"), empty.ok = TRUE)
    108 - 757x + 757x +
      checkmate::assert_logical(allow_add)
    @@ -58324,35 +60376,40 @@

    teal.slice coverage - 65.92%

    110 - 756x + 756x +
      duplicated_datasets <- intersect(names(include_varnames), names(exclude_varnames))
    111 - 756x + 756x +
      if (length(duplicated_datasets)) {
    112 - 1x + 1x +
        stop(
    113 - 1x + 1x +
          "Some datasets are specified in both, include_varnames and exclude_varnames:\n",
    114 - 1x + 1x +
          toString(duplicated_datasets)
    @@ -58380,49 +60437,56 @@

    teal.slice coverage - 65.92%

    118 - 755x + 755x +
      structure(
    119 - 755x + 755x +
        slices,
    120 - 755x + 755x +
        exclude_varnames = exclude_varnames,
    121 - 755x + 755x +
        include_varnames = include_varnames,
    122 - 755x + 755x +
        count_type = count_type,
    123 - 755x + 755x +
        allow_add = allow_add,
    124 - 755x + 755x +
        class = c("teal_slices", class(slices))
    @@ -58555,7 +60619,8 @@

    teal.slice coverage - 65.92%

    143 - 465x + 465x +
      inherits(x, "teal_slices")
    @@ -58695,21 +60760,24 @@

    teal.slice coverage - 65.92%

    163 - 1077x + 1077x +
      ans <- unclass(x)
    164 - 45x + 45x +
      if (recursive) ans[] <- lapply(ans, as.list)
    165 - 1077x + 1077x +
      ans
    @@ -58765,21 +60833,24 @@

    teal.slice coverage - 65.92%

    173 - 3x + 3x +
      if (missing(i)) i <- seq_along(x)
    174 - 506x + 506x +
      if (length(i) == 0L) {
    175 - 178x + 178x +
        return(x[0])
    @@ -58793,35 +60864,40 @@

    teal.slice coverage - 65.92%

    177 - 1x + 1x +
      if (is.logical(i) && length(i) > length(x)) stop("subscript out of bounds")
    178 - 1x + 1x +
      if (is.numeric(i) && max(i) > length(x)) stop("subscript out of bounds")
    179 - 326x + 326x +
      if (is.character(i)) {
    180 - 1x + 1x +
        if (!all(is.element(i, names(x)))) stop("subscript out of bounds")
    181 - 2x + 2x +
        i <- which(is.element(i, names(x)))
    @@ -58842,35 +60918,40 @@

    teal.slice coverage - 65.92%

    184 - 325x + 325x +
      y <- NextMethod("[")
    185 - 325x + 325x +
      attrs <- attributes(x)
    186 - 325x + 325x +
      attrs$names <- attrs$names[i]
    187 - 325x + 325x +
      attributes(y) <- attrs
    188 - 325x + 325x +
      y
    @@ -58926,14 +61007,16 @@

    teal.slice coverage - 65.92%

    196 - 252x + 252x +
      x <- list(...)
    197 - 252x + 252x +
      checkmate::assert_true(all(vapply(x, is.teal_slices, logical(1L))), .var.name = "all arguments are teal_slices")
    @@ -58947,21 +61030,24 @@

    teal.slice coverage - 65.92%

    199 - 251x + 251x +
      all_attributes <- lapply(x, attributes)
    200 - 251x + 251x +
      all_attributes <- coalesce_r(all_attributes)
    201 - 251x + 251x +
      all_attributes <- all_attributes[names(all_attributes) != "class"]
    @@ -58975,35 +61061,40 @@

    teal.slice coverage - 65.92%

    203 - 251x + 251x +
      do.call(
    204 - 251x + 251x +
        teal_slices,
    205 - 251x + 251x +
        c(
    206 - 251x + 251x +
          unique(unlist(x, recursive = FALSE)),
    207 - 251x + 251x +
          all_attributes
    @@ -59087,14 +61178,16 @@

    teal.slice coverage - 65.92%

    219 - 45x + 45x +
      checkmate::assert_flag(show_all)
    220 - 45x + 45x +
      checkmate::assert_flag(trim_lines)
    @@ -59108,35 +61201,40 @@

    teal.slice coverage - 65.92%

    222 - 45x + 45x +
      x <- as.list(x, recursive = TRUE)
    223 - 45x + 45x +
      attrs <- attributes(x)
    224 - 45x + 45x +
      attributes(x) <- NULL
    225 - 45x + 45x +
      slices_list <- list(slices = x, attributes = attrs)
    226 - 45x + 45x +
      slices_list <- Filter(Negate(is.null), slices_list) # drop attributes if empty
    @@ -59150,7 +61248,8 @@

    teal.slice coverage - 65.92%

    228 - 20x + 20x +
      if (!show_all) slices_list$slices <- lapply(slices_list$slices, function(slice) Filter(Negate(is.null), slice))
    @@ -59164,7 +61263,8 @@

    teal.slice coverage - 65.92%

    230 - 45x + 45x +
      jsonify(slices_list, trim_lines)
    @@ -59213,7 +61313,8 @@

    teal.slice coverage - 65.92%

    237 - 2x + 2x +
      cat(format(x, ...), "\n")
    @@ -59297,21 +61398,24 @@

    teal.slice coverage - 65.92%

    249 - 14x + 14x +
      Filter(
    250 - 14x + 14x +
        function(xx) {
    251 - 12x + 12x +
          !any(vapply(y, function(yy) identical(yy, xx), logical(1)))
    @@ -59325,7 +61429,8 @@

    teal.slice coverage - 65.92%

    253 - 14x + 14x +
        x
    @@ -59472,28 +61577,32 @@

    teal.slice coverage - 65.92%

    274 - 1569x + 1569x +
      checkmate::assert_list(x)
    275 - 1568x + 1568x +
      xnn <- Filter(Negate(is.null), x)
    276 - 1568x + 1568x +
      if (all(vapply(xnn, is.atomic, logical(1L)))) {
    277 - 1059x + 1059x +
        return(xnn[[1L]])
    @@ -59507,21 +61616,24 @@

    teal.slice coverage - 65.92%

    279 - 509x + 509x +
      lapply(x, checkmate::assert_list, names = "named", null.ok = TRUE, .var.name = "list element")
    280 - 508x + 508x +
      all_names <- unique(unlist(lapply(x, names)))
    281 - 508x + 508x +
      sapply(all_names, function(nm) coalesce_r(lapply(x, `[[`, nm)), simplify = FALSE)
    @@ -59660,21 +61772,24 @@

    teal.slice coverage - 65.92%

    18 - 7x + 7x +
      checkmate::assert_list(x, any.missing = FALSE, names = "unique")
    19 - 6x + 6x +
      checkmate::assert_class(join_keys, "join_keys")
    20 - 5x + 5x +
      if (!missing(code)) {
    @@ -59716,7 +61831,8 @@

    teal.slice coverage - 65.92%

    26 - 5x + 5x +
      if (!missing(check)) {
    @@ -59758,7 +61874,8 @@

    teal.slice coverage - 65.92%

    32 - 5x + 5x +
      FilteredData$new(x, join_keys = join_keys)
    @@ -59856,42 +61973,48 @@

    teal.slice coverage - 65.92%

    46 - 32x + 32x +
      lapply(
    47 - 32x + 32x +
        expr,
    48 - 32x + 32x +
        function(x) {
    49 - 19x + 19x +
          tryCatch(
    50 - 19x + 19x +
            eval(x, envir = env),
    51 - 19x + 19x +
            error = function(e) {
    @@ -59968,7 +62091,8 @@

    teal.slice coverage - 65.92%

    62 - 32x + 32x +
      invisible(NULL)
    @@ -60528,21 +62652,24 @@

    teal.slice coverage - 65.92%

    142 - 3x + 3x +
      checkmate::assert_string(input_id)
    143 - 3x + 3x +
      checkmate::assert_character(icons, len = 2L)
    144 - 3x + 3x +
      checkmate::assert_flag(one_way)
    @@ -60556,35 +62683,40 @@

    teal.slice coverage - 65.92%

    146 - 3x + 3x +
      expr <-
    147 - 3x + 3x +
        if (one_way) {
    148 - 3x + 3x +
          sprintf(
    149 - 3x + 3x +
            "$('#%s i').removeClass('%s').addClass('%s');",
    150 - 3x + 3x +
            input_id, icons[1], icons[2]
    @@ -60626,7 +62758,8 @@

    teal.slice coverage - 65.92%

    156 - 3x + 3x +
      shinyjs::runjs(expr)
    @@ -60640,7 +62773,8 @@

    teal.slice coverage - 65.92%

    158 - 3x + 3x +
      invisible(NULL)
    @@ -60682,21 +62816,24 @@

    teal.slice coverage - 65.92%

    164 - 3x + 3x +
      checkmate::assert_string(input_id)
    165 - 3x + 3x +
      checkmate::assert_character(titles, len = 2L)
    166 - 3x + 3x +
      checkmate::assert_flag(one_way)
    @@ -60710,35 +62847,40 @@

    teal.slice coverage - 65.92%

    168 - 3x + 3x +
      expr <-
    169 - 3x + 3x +
        if (one_way) {
    170 - 3x + 3x +
          sprintf(
    171 - 3x + 3x +
            "$('a#%s').attr('title', '%s');",
    172 - 3x + 3x +
            input_id, titles[2]
    @@ -60843,7 +62985,8 @@

    teal.slice coverage - 65.92%

    187 - 3x + 3x +
      shinyjs::runjs(expr)
    @@ -60857,7 +63000,8 @@

    teal.slice coverage - 65.92%

    189 - 3x + 3x +
      invisible(NULL)
    @@ -60948,7 +63092,8 @@

    teal.slice coverage - 65.92%

    202 - 66x + 66x +
      utils::getFromNamespace("topological_sort", ns = "teal.data")(graph)
    @@ -61493,21 +63638,24 @@

    teal.slice coverage - 65.92%

    76 - 15x + 15x +
          checkmate::assert_class(slice, "teal_slice_expr")
    77 - 14x + 14x +
          private$teal_slice <- slice
    78 - 14x + 14x +
          invisible(self)
    @@ -61591,28 +63739,32 @@

    teal.slice coverage - 65.92%

    90 - 12x + 12x +
          sprintf(
    91 - 12x + 12x +
            "%s:\n%s",
    92 - 12x + 12x +
            class(self)[1],
    93 - 12x + 12x +
            format(self$get_state(), show_all = show_all, trim_lines = trim_lines)
    @@ -61682,7 +63834,8 @@

    teal.slice coverage - 65.92%

    103 - 1x + 1x +
          cat(isolate(self$format(...)))
    @@ -61745,7 +63898,8 @@

    teal.slice coverage - 65.92%

    112 - 26x + 26x +
          private$teal_slice
    @@ -61822,14 +63976,16 @@

    teal.slice coverage - 65.92%

    123 - 1x + 1x +
          checkmate::assert_class(state, "teal_slice_expr")
    124 - 1x + 1x +
          invisible(self)
    @@ -61941,7 +64097,8 @@

    teal.slice coverage - 65.92%

    140 - 2x + 2x +
          isolate(str2lang(private$teal_slice$expr))
    @@ -63102,21 +65259,24 @@

    teal.slice coverage - 65.92%

    30 - 47x + 47x +
      checkmate::assert_list(calls)
    31 - 45x + 45x +
      if (length(calls) > 0L) checkmate::assert_list(calls, types = c("call", "name"))
    32 - 46x + 46x +
      checkmate::assert_string(operator)
    @@ -63130,21 +65290,24 @@

    teal.slice coverage - 65.92%

    34 - 44x + 44x +
      Reduce(
    35 - 44x + 44x +
        x = calls,
    36 - 44x + 44x +
        f = function(x, y) call(operator, x, y)
    @@ -63556,14 +65719,16 @@

    teal.slice coverage - 65.92%

    56 - 8x + 8x +
          checkmate::assert_class(datasets, "FilteredData")
    57 - 6x + 6x +
          private$filtered_data <- datasets
    @@ -63647,7 +65812,8 @@

    teal.slice coverage - 65.92%

    69 - 8x + 8x +
          private$filtered_data$get_filter_state()
    @@ -63717,14 +65883,16 @@

    teal.slice coverage - 65.92%

    79 - 5x + 5x +
          private$filtered_data$set_filter_state(filter)
    80 - 5x + 5x +
          invisible(NULL)
    @@ -63815,14 +65983,16 @@

    teal.slice coverage - 65.92%

    93 - 1x + 1x +
          private$filtered_data$remove_filter_state(filter)
    94 - 1x + 1x +
          invisible(NULL)
    @@ -63913,21 +66083,24 @@

    teal.slice coverage - 65.92%

    107 - 2x + 2x +
          datanames_to_remove <- if (missing(datanames)) private$filtered_data$datanames() else datanames
    108 - 2x + 2x +
          private$filtered_data$clear_filter_states(datanames = datanames_to_remove)
    109 - 2x + 2x +
          invisible(NULL)
    @@ -64626,7 +66799,8 @@

    teal.slice coverage - 65.92%

    92 - 107x + 107x +
      UseMethod("init_filtered_dataset")
    @@ -64710,56 +66884,64 @@

    teal.slice coverage - 65.92%

    104 - 83x + 83x +
      DataframeFilteredDataset$new(
    105 - 83x + 83x +
        dataset = dataset,
    106 - 83x + 83x +
        dataname = dataname,
    107 - 83x + 83x +
        keys = keys,
    108 - 83x + 83x +
        parent_name = parent_name,
    109 - 83x + 83x +
        parent = parent,
    110 - 83x + 83x +
        join_keys = join_keys,
    111 - 83x + 83x +
        label = label
    @@ -64850,7 +67032,8 @@

    teal.slice coverage - 65.92%

    124 - 7x + 7x +
      if (!requireNamespace("MultiAssayExperiment", quietly = TRUE)) {
    @@ -64871,35 +67054,40 @@

    teal.slice coverage - 65.92%

    127 - 7x + 7x +
      MAEFilteredDataset$new(
    128 - 7x + 7x +
        dataset = dataset,
    129 - 7x + 7x +
        dataname = dataname,
    130 - 7x + 7x +
        keys = keys,
    131 - 7x + 7x +
        label = label
    @@ -64990,28 +67178,32 @@

    teal.slice coverage - 65.92%

    144 - 17x + 17x +
      DefaultFilteredDataset$new(
    145 - 17x + 17x +
        dataset = dataset,
    146 - 17x + 17x +
        dataname = dataname,
    147 - 17x + 17x +
        label = label
    @@ -65878,28 +68070,32 @@

    teal.slice coverage - 65.92%

    121 - 3x + 3x +
      checkmate::assert_multi_class(datasets, c("FilteredData", "FilterPanelAPI"))
    122 - 3x + 3x +
      checkmate::assert_class(filter, "teal_slices")
    123 - 3x + 3x +
      datasets$set_filter_state(filter)
    124 - 3x + 3x +
      invisible(NULL)
    @@ -65941,14 +68137,16 @@

    teal.slice coverage - 65.92%

    130 - 4x + 4x +
      checkmate::assert_multi_class(datasets, c("FilteredData", "FilterPanelAPI"))
    131 - 4x + 4x +
      if (isRunning()) {
    @@ -65969,7 +68167,8 @@

    teal.slice coverage - 65.92%

    134 - 4x + 4x +
        isolate(datasets$get_filter_state())
    @@ -66018,14 +68217,16 @@

    teal.slice coverage - 65.92%

    141 - 1x + 1x +
      checkmate::assert_multi_class(datasets, c("FilteredData", "FilterPanelAPI"))
    142 - 1x + 1x +
      checkmate::assert_class(filter, "teal_slices")
    @@ -66039,14 +68240,16 @@

    teal.slice coverage - 65.92%

    144 - 1x + 1x +
      datasets$remove_filter_state(filter)
    145 - 1x + 1x +
      invisible(NULL)
    @@ -66088,21 +68291,24 @@

    teal.slice coverage - 65.92%

    151 - 1x + 1x +
      checkmate::assert_multi_class(datasets, c("FilteredData", "FilterPanelAPI"))
    152 - 1x + 1x +
      datasets$clear_filter_states(force = force)
    153 - 1x + 1x +
      invisible(NULL)
    @@ -66221,28 +68427,32 @@

    teal.slice coverage - 65.92%

    170 - 2x + 2x +
      checkmate::assert_character(datanames, min.len = 1, any.missing = FALSE)
    171 - 2x + 2x +
      stopifnot(
    172 - 2x + 2x +
        is(datasets, "FilteredData"),
    173 - 2x + 2x +
        all(datanames %in% datasets$datanames())
    @@ -66263,35 +68473,40 @@

    teal.slice coverage - 65.92%

    176 - 2x + 2x +
      paste(
    177 - 2x + 2x +
        unlist(lapply(
    178 - 2x + 2x +
          datanames,
    179 - 2x + 2x +
          function(dataname) {
    180 - 4x + 4x +
            datasets$get_call(dataname)
    @@ -66312,7 +68527,8 @@

    teal.slice coverage - 65.92%

    183 - 2x + 2x +
        collapse = "\n"
    @@ -66577,21 +68793,24 @@

    teal.slice coverage - 65.92%

    35 - 26x + 26x +
          checkmate::assert_matrix(data)
    36 - 25x + 25x +
          super$initialize(data, data_reactive, dataname, datalabel)
    37 - 25x + 25x +
          private$set_filterable_varnames(include_varnames = colnames(private$data))
    @@ -66744,49 +68963,56 @@

    teal.slice coverage - 65.92%

    15 - 273x + 273x +
      checkmate::assert_character(name, min.len = 1, any.missing = FALSE)
    16 - 271x + 271x +
      if (!grepl("^[[:alpha:]][a-zA-Z0-9_]*$", name, perl = TRUE)) {
    17 - 5x + 5x +
        stop(
    18 - 5x + 5x +
          "name '",
    19 - 5x + 5x +
          name,
    20 - 5x + 5x +
          "' must only contain alphanumeric characters (with underscores)",
    21 - 5x + 5x +
          " and the first character must be an alphabetic character"
    @@ -66898,35 +69124,40 @@

    teal.slice coverage - 65.92%

    37 - 12x + 12x +
      checkmate::assert_character(pattern, min.len = 1, null.ok = TRUE)
    38 - 12x + 12x +
      js_files <- list.files(
    39 - 12x + 12x +
        system.file("js", package = "teal.slice", mustWork = TRUE),
    40 - 12x + 12x +
        pattern = pattern,
    41 - 12x + 12x +
        full.names = TRUE
    @@ -66940,7 +69171,8 @@

    teal.slice coverage - 65.92%

    43 - 12x + 12x +
      singleton(lapply(js_files, includeScript))
    @@ -67080,14 +69312,16 @@

    teal.slice coverage - 65.92%

    63 - 55x + 55x +
      if (length(choices) > 1) {
    64 - 27x + 27x +
        do.call("call", append(list("c"), choices))
    @@ -67101,7 +69335,8 @@

    teal.slice coverage - 65.92%

    66 - 28x + 28x +
        choices
    @@ -67394,21 +69629,24 @@

    teal.slice coverage - 65.92%

    39 - 9x + 9x +
      checkmate::assert_multi_class(data, c("data.frame", "DataFrame", "matrix"))
    40 - 9x + 9x +
      checkmate::assert_character(columns, any.missing = FALSE, null.ok = TRUE)
    41 - 9x + 9x +
      checkmate::assert_subset(columns, colnames(data))
    @@ -67422,7 +69660,8 @@

    teal.slice coverage - 65.92%

    43 - 9x + 9x +
      if (is.matrix(data)) {
    @@ -67492,14 +69731,16 @@

    teal.slice coverage - 65.92%

    53 - 9x + 9x +
        types <- vapply(data, function(x) class(x)[1L], character(1L))
    54 - 9x + 9x +
        if (!is.null(columns)) types <- types[columns]
    @@ -67520,7 +69761,8 @@

    teal.slice coverage - 65.92%

    57 - 9x + 9x +
      types
    @@ -69205,35 +71447,40 @@

    teal.slice coverage - 65.92%

    187 - 103x + 103x +
          checkmate::assert_function(data_reactive, args = "sid")
    188 - 103x + 103x +
          checkmate::assert_data_frame(data)
    189 - 103x + 103x +
          super$initialize(data, data_reactive, dataname, datalabel)
    190 - 103x + 103x +
          private$keys <- keys
    191 - 103x + 103x +
          private$set_filterable_varnames(include_varnames = colnames(private$data))
    @@ -69568,7 +71815,8 @@

    teal.slice coverage - 65.92%

    39 - 26x + 26x +
          if (!requireNamespace("MultiAssayExperiment", quietly = TRUE)) {
    @@ -69589,14 +71837,16 @@

    teal.slice coverage - 65.92%

    42 - 26x + 26x +
          checkmate::assert_function(data_reactive, args = "sid")
    43 - 26x + 26x +
          checkmate::assert_class(data, "MultiAssayExperiment")
    @@ -69610,35 +71860,40 @@

    teal.slice coverage - 65.92%

    45 - 25x + 25x +
          data <- SummarizedExperiment::colData(data)
    46 - 25x + 25x +
          data_reactive <- function(sid = "") SummarizedExperiment::colData(data_reactive(sid = sid))
    47 - 25x + 25x +
          super$initialize(data, data_reactive, dataname, datalabel)
    48 - 25x + 25x +
          private$keys <- keys
    49 - 25x + 25x +
          private$set_filterable_varnames(include_varnames = colnames(data))
    @@ -69652,7 +71907,8 @@

    teal.slice coverage - 65.92%

    51 - 25x + 25x +
          invisible(self)
    @@ -69777,14 +72033,16 @@

    teal.slice coverage - 65.92%

    7 - 9x + 9x +
      isolate(
    8 - 9x + 9x +
        all(vapply(fields, function(x) identical(ts1[[x]], ts2[[x]]), logical(1L)))
    @@ -69847,35 +72105,40 @@

    teal.slice coverage - 65.92%

    17 - 34x + 34x +
      isolate({
    18 - 34x + 34x +
        testthat::expect_true(
    19 - 34x + 34x +
          setequal(
    20 - 34x + 34x +
            reactiveValuesToList(x),
    21 - 34x + 34x +
            reactiveValuesToList(y)
    @@ -69945,28 +72208,32 @@

    teal.slice coverage - 65.92%

    31 - 12x + 12x +
      isolate({
    32 - 12x + 12x +
        mapply(
    33 - 12x + 12x +
          function(x, y) {
    34 - 27x + 27x +
            expect_identical_slice(x, y)
    @@ -69980,14 +72247,16 @@

    teal.slice coverage - 65.92%

    36 - 12x + 12x +
          x = x,
    37 - 12x + 12x +
          y = y
    @@ -70001,7 +72270,8 @@

    teal.slice coverage - 65.92%

    39 - 12x + 12x +
        testthat::expect_identical(attributes(x), attributes(y))
    diff --git a/release-candidate/index.html b/release-candidate/index.html index d8c65f9ba..487ebe528 100644 --- a/release-candidate/index.html +++ b/release-candidate/index.html @@ -1,5 +1,4 @@ - - + @@ -52,22 +51,7 @@ - - + - + + diff --git a/release-candidate/news/index.html b/release-candidate/news/index.html index 92e409f43..7e75d3032 100644 --- a/release-candidate/news/index.html +++ b/release-candidate/news/index.html @@ -1,8 +1,22 @@ - -Changelog • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -78,49 +98,73 @@
    -

    teal.slice 0.5.1

    +

    teal.slice 0.5.1 +

    -

    Bug fixes

    -
    • Fix how the filter panel handles NA values in a Date column.
    • +

      Bug fixes +

      +
        +
      • Fix how the filter panel handles NA values in a Date column.
      • Fix filtering of ordered column to return the right call.
      • Ensure choices are sorted for factor and ordered data types.
      • -
    + +
    -

    Miscellaneous

    -
    • Added teal_slice and teal_slices to package index.
    • +

      Miscellaneous +

      +
        +
      • Added teal_slice and teal_slices to package index.
      • Implement mouse-over behavior for the filter card when it is selected.
      • -
    + +
    -

    teal.slice 0.5.0

    CRAN release: 2024-02-06

    +

    teal.slice 0.5.0 +

    +

    CRAN release: 2024-02-06

    -

    Enhancements

    -
    • Simplified init_filtered_data to accept a named list of datasets. init_filtered_data does not currently handle a list containing dataset, metadata, datalabel and code.
    • -
    +

    Enhancements +

    +
      +
    • Simplified init_filtered_data to accept a named list of datasets. init_filtered_data does not currently handle a list containing dataset, metadata, datalabel and code.
    • +
    +
    -

    Breaking changes

    -
    • +

      Breaking changes +

      +
        +
      • TealData object is no longer supported by teal.slice.
      • set_filter_state no longer accepts a nested list. Use teal_slices() and teal_slice() instead.
      • Renamed FilteredDataset subclass that handles data.frames from DefaultFilteredDataset to DataframeFilteredDataset. Added new class DefaultFilteredDataset that will store any type of object. Filtering will is not supported.
      • -
    + +
    -

    Bug fixes

    -
    • Performs an exact match when determining the default label of a dataset from attributes.
    • -
    +

    Bug fixes +

    +
      +
    • Performs an exact match when determining the default label of a dataset from attributes.
    • +
    +
    -

    Miscellaneous

    -
    • Specified minimal version of package dependencies.
    • +

      Miscellaneous +

      +
        +
      • Specified minimal version of package dependencies.
      • Removed storing and restoring of teal_slices objects.
      • Update documentation and code to reflect the changes due to the refactor of teal.data::JoinKeys into teal.data::join_keys.
      • -
    + +
    -

    teal.slice 0.4.0

    +

    teal.slice 0.4.0 +

    -

    New features

    -
    + +
    -

    Breaking changes

    -
    • Setting filters using a list is now deprecated. Use teal_slices and teal_slice instead.
    • +

      Breaking changes +

      +
        +
      • Setting filters using a list is now deprecated. Use teal_slices and teal_slice instead.
      • Removed CDISCFilteredData and CDISCFilteredDataset and implementing JoinKeys handling in their parent classes (FilteredData and DefaultFilteredDataset).
      • Specifying set of filterable columns is done through include_varnames and exclude_varnames in teal_slices. Specifying attr(, "filterable") is hard deprecated.
      • Removed private fields $code and $check from FilteredData class and made appropriate changes to constructor and init_filtered_data.
      • -
    + +
    -

    teal.slice 0.3.0

    -
    • Examples now use scda.2022 instead of scda.2021.
    • +

      teal.slice 0.3.0 +

      +
        +
      • Examples now use scda.2022 instead of scda.2021.
      • Transferred data hashing step in FilteredDataset to teal.
      • Removed constructor of Queue class.
      • -
      -

      New features

      -
      • Added a global turn on/off button for the Filter Panel.
      • +
      +
      +

      New features +

      +
        +
      • Added a global turn on/off button for the Filter Panel.
      • Added ability to collapse Active Filter Display panel.
      • Added ability to collapse all filters of an individual dataset.
      • Added fixed filter states.
      • -
      +
    +
    -

    Enhancements

    -
    • Improved filter state presentation in FilterState$format.
    • -
    +

    Enhancements +

    +
      +
    • Improved filter state presentation in FilterState$format.
    • +
    +
    -

    Bug fixes

    -
    • Fixed an error where the RangeFilterState produced an error when using bootstrap 4.
    • +

      Bug fixes +

      +
        +
      • Fixed an error where the RangeFilterState produced an error when using bootstrap 4.
      • Fixed a bug that caused the range slider to omit values selected by the filter API.
      • Fixed a bug where setting incorrect values for Date and Date time ranges caused the app to crash.
      • -
    + +
    -

    Miscellaneous

    -
    • Calculation of step in slider for RangeFilterState now uses checkmate::test_integerish instead of is.integer.
    • +

      Miscellaneous +

      +
        +
      • Calculation of step in slider for RangeFilterState now uses checkmate::test_integerish instead of is.integer.
      • Updated init_filtered_data to take into account the removal of CDISCTealData from teal.data package.
      • Added shinyvalidate validation for Date and Date time ranges.
      • Added examples apps for FilterState child classes and DFFilterStates.
      • -
    + +
    -

    teal.slice 0.2.0

    +

    teal.slice 0.2.0 +

    -

    New features

    -
    + +
    -

    Enhancements

    -
    • Redesigned the count bars for filter panel check box inputs.
    • +

      Enhancements +

      +
        +
      • Redesigned the count bars for filter panel check box inputs.
      • Redesigned the filter panel input for dates to use CSS flexbox.
      • Update icons to be compatible with Font Awesome 6.
      • Updates the FilteredData method get_formatted_filter_state so it no longer appends empty filters.
      • Added clearer installation instructions to README.
      • -
    + +
    -

    Breaking changes

    -
    • Renamed internal S3 method get_filterable_varnames to get_supported_filter_varnames.
    • -
    +

    Breaking changes +

    +
      +
    • Renamed internal S3 method get_filterable_varnames to get_supported_filter_varnames.
    • +
    +
    -

    Bug fixes

    -
    • Fixed a bug when the filter panel overview would not refresh if the panel was hidden during a transition between active modules.
    • +

      Bug fixes +

      +
        +
      • Fixed a bug when the filter panel overview would not refresh if the panel was hidden during a transition between active modules.
      • Fixed a bug in FilterState where sliderInput step values were too precise.
      • -
    + +
    -

    teal.slice 0.1.1

    +

    teal.slice 0.1.1 +

    -

    New features

    -
    • Added a formatting function for filter panel classes.
    • -
    +

    New features +

    +
      +
    • Added a formatting function for filter panel classes.
    • +
    +
    -

    Miscellaneous

    -
    • Added a template to the pkgdown site.
    • +

      Miscellaneous +

      +
        +
      • Added a template to the pkgdown site.
      • Updated package authors.
      • Added package vignettes.
      • -
    + +
    -

    Fix

    -
    • Fixed a bug in FilteredDataset, where launching a shiny application without FilteredData would not attach the appropriate CSS files.
    • -
    +

    Fix +

    +
      +
    • Fixed a bug in FilteredDataset, where launching a shiny application without FilteredData would not attach the appropriate CSS files.
    • +
    +
    -

    teal.slice 0.1.0

    -
    • Initial release of teal.slice - a package providing a filter module for teal applications.
    • -
    -

    Changes (from behavior when functionality was part of teal)

    +

    teal.slice 0.1.0 +

    +
      +
    • Initial release of teal.slice - a package providing a filter module for teal applications.
    • +
    +
    +

    Changes (from behavior when functionality was part of teal) +

    -

    Breaking changes

    -
    • +

      Breaking changes +

      +
        +
      • default_filter has been deprecated - use list() instead for a default filter.
      • -
    + +
    -

    Bug fixes

    -
    • Add counts to filtering categorical variables bar charts in the filtering panel in cases where they were missing.
    • +

      Bug fixes +

      +
        +
      • Add counts to filtering categorical variables bar charts in the filtering panel in cases where they were missing.
      • Fixed a bug causing an error when both sliders of RangeFilterState where put to either end of the allowed range in the UI.
      • -
    + +
    -

    Miscellaneous

    -
    • Added is_any_filtered method to all FilterState classes to detect if selected values actually filters out any data. This is used to decide if an explicit filter statement is added to the call.
    • +

      Miscellaneous +

      +
        +
      • Added is_any_filtered method to all FilterState classes to detect if selected values actually filters out any data. This is used to decide if an explicit filter statement is added to the call.
      • The filter panel now displays a helpful message when data has no rows or columns in place of an empty drop down widget.
      • FilteredData now stores whether its datasets had a reproducibility check or not via two new methods to its class: set_check and get_check.
      • -
    + +
    + + + + - - + + diff --git a/release-candidate/reference/ChoicesFilterState.html b/release-candidate/reference/ChoicesFilterState.html index 3e537436b..529e238bb 100644 --- a/release-candidate/reference/ChoicesFilterState.html +++ b/release-candidate/reference/ChoicesFilterState.html @@ -1,8 +1,24 @@ - -FilterState object for categorical data — ChoicesFilterState • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,40 +107,60 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterState -> ChoicesFilterState

    +

    Inherited methods


    -

    Method new()

    -

    Initialize a FilterState object.

    -

    Usage

    -

    ChoicesFilterState$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterState object.

    +
    +

    Usage +

    +

    +
    +
    ChoicesFilterState$new(
       x,
       x_reactive = reactive(NULL),
       slice,
       extract_type = character(0)
    -)

    +)
    +

    +
    -

    Returns

    +

    Returns +

    Object of class ChoicesFilterState, invisibly.

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection. For this class returned call looks like -<varname> %in% c(<values selected>) with optional is.na(<varname>).

    -

    Usage

    -

    ChoicesFilterState$get_call(dataname)

    +<varname> %in% c(<values selected>) with optional is.na(<varname>).

    +
    +

    Usage +

    +

    +
    +
    ChoicesFilterState$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of data set; defaults to private$get_dataname()

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    call or NULL

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    ChoicesFilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    ChoicesFilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -197,7 +280,8 @@

    Arguments -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     include_css_files <- getFromNamespace("include_css_files", "teal.slice")
     include_js_files <- getFromNamespace("include_js_files", "teal.slice")
    @@ -313,17 +397,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/release-candidate/reference/DFFilterStates.html b/release-candidate/reference/DFFilterStates.html index 6af7a032f..f0020eac4 100644 --- a/release-candidate/reference/DFFilterStates.html +++ b/release-candidate/reference/DFFilterStates.html @@ -1,8 +1,24 @@ - -FilterStates subclass for data frames — DFFilterStates • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,18 +107,25 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterStates -> DFFilterStates

    -

    Methods

    +

    Methods +

    -

    Public methods

    +

    Public methods +

    -

    Inherited methods +
    +

    Inherited methods


    -

    Method new()

    +

    +
    +
    +

    Method new() +

    Initializes DFFilterStates object by setting dataname and initializing state_list (shiny::reactiveVal). This class contains a single state_list with no specified name, which means that when calling the subset function associated with this class -(dplyr::filter), a list of conditions is passed to unnamed arguments (...).

    -

    Usage

    -

    DFFilterStates$new(
    +(dplyr::filter), a list of conditions is passed to unnamed arguments (...).

    +
    +

    Usage +

    +

    +
    +
    DFFilterStates$new(
       data,
       data_reactive = function(sid = "") NULL,
       dataname,
       datalabel = NULL,
       keys = character(0)
    -)

    +)
    +

    +
    -

    Arguments

    -

    data
    +

    Arguments +

    +

    +
    +
    +
    data

    (data.frame) the R object which dplyr::filter function will be applied on.

    @@ -154,23 +197,41 @@

    Arguments
    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    DFFilterStates$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    DFFilterStates$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -178,7 +239,8 @@

    Arguments -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     include_css_files <- getFromNamespace("include_css_files", "teal.slice")
     include_js_files <- getFromNamespace("include_js_files", "teal.slice")
    @@ -323,17 +385,19 @@ 

    Examples

    + +

    + +
    - - + + diff --git a/release-candidate/reference/DataframeFilteredDataset.html b/release-candidate/reference/DataframeFilteredDataset.html index 164f379e6..cc4f423b6 100644 --- a/release-candidate/reference/DataframeFilteredDataset.html +++ b/release-candidate/reference/DataframeFilteredDataset.html @@ -1,10 +1,26 @@ - -The DataframeFilteredDataset R6 class — DataframeFilteredDataset • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + +
    @@ -87,23 +109,30 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilteredDataset -> DataframeFilteredDataset

    +

    Inherited methods


    -

    Method new()

    -

    Initializes this DataframeFilteredDataset object.

    -

    Usage

    -

    DataframeFilteredDataset$new(
    +

    +
    +
    +

    Method new() +

    +

    Initializes this DataframeFilteredDataset object.

    +
    +

    Usage +

    +

    +
    +
    DataframeFilteredDataset$new(
       dataset,
       dataname,
       keys = character(0),
    @@ -127,12 +163,18 @@ 

    Usage

    parent = NULL, join_keys = character(0), label = character(0) -)

    +)
    +

    +
    -

    Arguments

    -

    dataset
    +

    Arguments +

    +

    +
    +
    +
    dataset

    (data.frame) single data.frame for which filters are rendered.

    @@ -170,129 +212,227 @@

    Arguments -

    Returns

    +

    Returns +

    Object of class DataframeFilteredDataset, invisibly.

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Gets the subset expression.

    This function returns subset expressions equivalent to selected items within each of filter_states. Configuration of the expressions is constant and depends on filter_states type and order which are set during initialization. This class contains single FilterStates which contains single state_list -and all FilterState objects apply to one argument (...) in a dplyr::filter call.

    -

    Usage

    -

    DataframeFilteredDataset$get_call(sid = "")

    +and all FilterState objects apply to one argument (...) in a dplyr::filter call.

    +
    +

    Usage +

    +

    +
    +
    DataframeFilteredDataset$get_call(sid = "")
    +

    +
    -

    Arguments

    -

    sid
    +

    Arguments +

    +

    +
    +
    +
    sid

    (character) when specified, the method returns code containing conditions calls of FilterState objects with sid different to that of this sid argument.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Either a list of length 1 containing a filter call, or NULL.

    -


    -

    Method set_filter_state()

    -

    Set filter state.

    -

    Usage

    -

    DataframeFilteredDataset$set_filter_state(state)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Set filter state.

    +
    +

    Usage +

    +

    +
    +
    DataframeFilteredDataset$set_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method remove_filter_state()

    -

    Remove one or more FilterState form a FilteredDataset.

    -

    Usage

    -

    DataframeFilteredDataset$remove_filter_state(state)

    +
    +

    +
    +
    +

    Method remove_filter_state() +

    +

    Remove one or more FilterState form a FilteredDataset.

    +
    +

    Usage +

    +

    +
    +
    DataframeFilteredDataset$remove_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices) specifying FilterState objects to remove; teal_slices may contain only dataname and varname, other elements are ignored

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method ui_add()

    -

    UI module to add filter variable for this dataset.

    -

    Usage

    -

    DataframeFilteredDataset$ui_add(id)

    +
    +

    +
    +
    +

    Method ui_add() +

    +

    UI module to add filter variable for this dataset.

    +
    +

    Usage +

    +

    +
    +
    DataframeFilteredDataset$ui_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method get_filter_overview()

    -

    Creates row for filter overview in the form of
    dataname -- observations (remaining/total) - data.frame

    -

    Usage

    -

    DataframeFilteredDataset$get_filter_overview()

    +
    +

    +
    +
    +

    Method get_filter_overview() +

    +

    Creates row for filter overview in the form of
    dataname -- observations (remaining/total) - data.frame

    +
    +

    Usage +

    +

    +
    +
    DataframeFilteredDataset$get_filter_overview()
    +

    +
    -

    Returns

    +

    Returns +

    A data.frame.

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    DataframeFilteredDataset$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    DataframeFilteredDataset$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -300,7 +440,8 @@

    Arguments -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     DataframeFilteredDataset <- getFromNamespace("DataframeFilteredDataset", "teal.slice")
     
    @@ -394,17 +535,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/release-candidate/reference/DateFilterState.html b/release-candidate/reference/DateFilterState.html index 0a13c994a..5a0f3b96c 100644 --- a/release-candidate/reference/DateFilterState.html +++ b/release-candidate/reference/DateFilterState.html @@ -1,8 +1,24 @@ - -FilterState object for Date data — DateFilterState • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,40 +107,60 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterState -> DateFilterState

    +

    Inherited methods


    -

    Method new()

    -

    Initialize a FilterState object.

    -

    Usage

    -

    DateFilterState$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterState object.

    +
    +

    Usage +

    +

    +
    +
    DateFilterState$new(
       x,
       x_reactive = reactive(NULL),
       slice,
       extract_type = character(0)
    -)

    +)
    +

    +
    -

    Returns

    +

    Returns +

    Object of class DateFilterState, invisibly.

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection. For this class returned call looks like -<varname> >= <min value> & <varname> <= <max value> with optional is.na(<varname>).

    -

    Usage

    -

    DateFilterState$get_call(dataname)

    +<varname> >= <min value> & <varname> <= <max value> with optional is.na(<varname>).

    +
    +

    Usage +

    +

    +
    +
    DateFilterState$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) containing possibly prefixed name of data set

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    call or NULL

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    DateFilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    DateFilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -197,7 +280,8 @@

    Arguments -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     include_css_files <- getFromNamespace("include_css_files", "teal.slice")
     include_js_files <- getFromNamespace("include_js_files", "teal.slice")
    @@ -299,17 +383,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/release-candidate/reference/DatetimeFilterState.html b/release-candidate/reference/DatetimeFilterState.html index 8a26246d1..1d57c988e 100644 --- a/release-candidate/reference/DatetimeFilterState.html +++ b/release-candidate/reference/DatetimeFilterState.html @@ -1,8 +1,24 @@ - -FilterState object for date time data — DatetimeFilterState • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,44 +107,64 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterState -> DatetimeFilterState

    +

    Inherited methods


    -

    Method new()

    +

    +
    +
    +

    Method new() +

    Initialize a FilterState object. This class has an extra field, private$timezone, which is set to Sys.timezone() by default. However, in case when using this module in teal app, one needs timezone of the app user. App user timezone is taken from session$userData$timezone -and is set only if object is initialized in shiny.

    -

    Usage

    -

    DatetimeFilterState$new(
    +and is set only if object is initialized in shiny.

    +
    +

    Usage +

    +

    +
    +
    DatetimeFilterState$new(
       x,
       x_reactive = reactive(NULL),
       extract_type = character(0),
       slice
    -)

    +)
    +

    +
    -

    Arguments

    -

    x
    +

    Arguments +

    +

    +
    +
    +
    x

    (POSIXct or POSIXlt) variable to be filtered.

    @@ -135,11 +178,15 @@

    Arguments varname in the condition call will be returned as <dataname>$<varname>

  • "matrix" varname in the condition call will be returned as <dataname>[, <varname>]

  • - + +
    slice
    @@ -151,49 +198,85 @@

    Arguments -

    Returns

    +

    Returns +

    Object of class DatetimeFilterState, invisibly.

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection. For this class returned call looks like -<varname> >= as.POSIXct(<min>) & <varname> <= <max>) with optional is.na(<varname>).

    -

    Usage

    -

    DatetimeFilterState$get_call(dataname)

    +<varname> >= as.POSIXct(<min>) & <varname> <= <max>) with optional is.na(<varname>).

    +
    +

    Usage +

    +

    +
    +
    DatetimeFilterState$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    name of data set; defaults to private$get_dataname()

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    call

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    DatetimeFilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    DatetimeFilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -201,7 +284,8 @@

    Arguments -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     include_css_files <- getFromNamespace("include_css_files", "teal.slice")
     include_js_files <- getFromNamespace("include_js_files", "teal.slice")
    @@ -311,17 +395,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/release-candidate/reference/DefaultFilteredDataset.html b/release-candidate/reference/DefaultFilteredDataset.html index 8efb5a58c..959a4abfc 100644 --- a/release-candidate/reference/DefaultFilteredDataset.html +++ b/release-candidate/reference/DefaultFilteredDataset.html @@ -1,8 +1,24 @@ - -DefaultFilteredDataset R6 class — DefaultFilteredDataset • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,16 +107,20 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilteredDataset -> DefaultFilteredDataset

    +

    Inherited methods


    -

    Method new()

    -

    Initializes this DefaultFilteredDataset object.

    -

    Usage

    -

    DefaultFilteredDataset$new(dataset, dataname, label = character(0))

    +

    +
    +
    +

    Method new() +

    +

    Initializes this DefaultFilteredDataset object.

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$new(dataset, dataname, label = character(0))
    +

    +
    -

    Arguments

    -

    dataset
    +

    Arguments +

    +

    +
    +
    +
    dataset

    any type of object; will not be filtered.

    @@ -134,23 +177,40 @@

    Arguments -

    Returns

    +

    Returns +

    Object of class DefaultFilteredDataset, invisibly.

    -


    -

    Method format()

    -

    Returns a formatted string representing this DefaultFilteredDataset object.

    -

    Usage

    -

    DefaultFilteredDataset$format(show_all, trim_lines = FALSE)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns a formatted string representing this DefaultFilteredDataset object.

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$format(show_all, trim_lines = FALSE)
    +

    +
    -

    Arguments

    -

    show_all
    +

    Arguments +

    +

    +
    +
    +
    show_all

    (logical(1)) for method consistency, ignored.

    @@ -158,167 +218,291 @@

    Arguments -

    Returns

    +

    Returns +

    The formatted string.

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    -

    Usage

    -

    DefaultFilteredDataset$get_call(sid)

    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$get_call(sid)
    +

    +
    -

    Arguments

    -

    sid
    +

    Arguments +

    +

    +
    +
    +
    sid

    (character(1)) for method consistency, ignored.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    +

    +
    +
    +

    Method get_filter_state() +

    -

    Usage

    -

    DefaultFilteredDataset$get_filter_state()

    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$get_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    +

    +
    +
    +

    Method set_filter_state() +

    -

    Usage

    -

    DefaultFilteredDataset$set_filter_state(state)

    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$set_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices) for method consistency, ignored.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    +

    +
    +
    +

    Method clear_filter_states() +

    -

    Usage

    -

    DefaultFilteredDataset$clear_filter_states(force)

    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$clear_filter_states(force)
    +

    +
    -

    Arguments

    -

    force
    +

    Arguments +

    +

    +
    +
    +
    force

    (logical(1)) for method consistency, ignored.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method get_filter_overview()

    -

    Creates row for filter overview in the form of
    dataname - unsupported data class

    -

    Usage

    -

    DefaultFilteredDataset$get_filter_overview()

    +
    +

    +
    +
    +

    Method get_filter_overview() +

    +

    Creates row for filter overview in the form of
    dataname - unsupported data class

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$get_filter_overview()
    +

    +
    -

    Returns

    +

    Returns +

    A data.frame.

    -


    -

    Method ui_active()

    -

    Overwrites parent method.

    -

    Usage

    -

    DefaultFilteredDataset$ui_active(id)

    +
    +

    +
    +
    +

    Method ui_active() +

    +

    Overwrites parent method.

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$ui_active(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Details

    +

    Details +

    Blank UI module that would list active filter states for this dataset.

    -

    Returns

    +

    Returns +

    An empty div.

    -


    -

    Method ui_add()

    -

    Overwrites parent method.

    -

    Usage

    -

    DefaultFilteredDataset$ui_add(id)

    +
    +

    +
    +
    +

    Method ui_add() +

    +

    Overwrites parent method.

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$ui_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Details

    +

    Details +

    Blank UI module that would list active filter states for this dataset.

    -

    Returns

    +

    Returns +

    An empty div.

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    DefaultFilteredDataset$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -326,7 +510,8 @@

    Arguments -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     DefaultFilteredDataset <- getFromNamespace("DefaultFilteredDataset", "teal.slice")
     
    @@ -339,17 +524,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/release-candidate/reference/EmptyFilterState.html b/release-candidate/reference/EmptyFilterState.html index f7dcadc62..0aed053cb 100644 --- a/release-candidate/reference/EmptyFilterState.html +++ b/release-candidate/reference/EmptyFilterState.html @@ -1,8 +1,24 @@ - -FilterState object for empty variables — EmptyFilterState • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,40 +107,60 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterState -> EmptyFilterState

    +

    Inherited methods


    -

    Method new()

    -

    Initialize EmptyFilterState object.

    -

    Usage

    -

    EmptyFilterState$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize EmptyFilterState object.

    +
    +

    Usage +

    +

    +
    +
    EmptyFilterState$new(
       x,
       x_reactive = reactive(NULL),
       extract_type = character(0),
       slice
    -)

    +)
    +

    +
    -

    Arguments

    -

    x
    +

    Arguments +

    +

    + -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection relevant for selected variable type. -Uses internal reactive values, hence must be called in reactive or isolated context.

    -

    Usage

    -

    EmptyFilterState$get_call(dataname)

    +Uses internal reactive values, hence must be called in reactive or isolated context.

    +
    +

    Usage +

    +

    +
    +
    EmptyFilterState$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    name of data set; defaults to private$get_dataname()

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    logical(1)

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    EmptyFilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    EmptyFilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -196,7 +279,8 @@

    Arguments -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     include_js_files <- getFromNamespace("include_js_files", "teal.slice")
     EmptyFilterState <- getFromNamespace("EmptyFilterState", "teal.slice")
    @@ -217,17 +301,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/release-candidate/reference/FilterPanelAPI.html b/release-candidate/reference/FilterPanelAPI.html index a2e99bf8a..4fbb75ada 100644 --- a/release-candidate/reference/FilterPanelAPI.html +++ b/release-candidate/reference/FilterPanelAPI.html @@ -1,8 +1,24 @@ - -Class to encapsulate the API of the filter panel of a teal app — FilterPanelAPI • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,7 +106,8 @@
    -

    Details

    +

    Details +

    The purpose of this class is to encapsulate the API of the filter panel in a new class FilterPanelAPI so that it can be passed and used in the server call of any module instead of passing the whole FilteredData object.

    @@ -92,125 +115,223 @@

    Details

    -

    Methods

    +

    Methods +


    -

    Method new()

    -

    Initialize a FilterPanelAPI object.

    -

    Usage

    -

    FilterPanelAPI$new(datasets)

    + +
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterPanelAPI object.

    +
    +

    Usage +

    +

    +
    +
    FilterPanelAPI$new(datasets)
    +

    +
    -

    Arguments

    -

    datasets
    +

    Arguments +

    +

    +
    +
    +
    datasets

    (FilteredData)

    -

    +
    +

    +
    -


    +

    +
    +
    +

    Method get_filter_state() +

    Gets the reactive values from the active FilterState objects of the FilteredData object.

    Gets all active filters in the form of a nested list. -The output list is a compatible input to set_filter_state.

    -

    Usage

    -

    FilterPanelAPI$get_filter_state()

    +The output list is a compatible input to set_filter_state.

    +
    +

    Usage +

    +

    +
    +
    FilterPanelAPI$get_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    list with named elements corresponding to FilteredDataset objects with active filters.

    -


    -

    Method set_filter_state()

    -

    Sets active filter states.

    -

    Usage

    -

    FilterPanelAPI$set_filter_state(filter)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Sets active filter states.

    +
    +

    Usage +

    +

    +
    +
    FilterPanelAPI$set_filter_state(filter)
    +

    +
    -

    Arguments

    -

    filter
    +

    Arguments +

    +

    +
    +
    +
    filter

    (teal_slices)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method remove_filter_state()

    -

    Remove one or more FilterState of a FilteredDataset in the FilteredData object.

    -

    Usage

    -

    FilterPanelAPI$remove_filter_state(filter)

    +
    +

    +
    +
    +

    Method remove_filter_state() +

    +

    Remove one or more FilterState of a FilteredDataset in the FilteredData object.

    +
    +

    Usage +

    +

    +
    +
    FilterPanelAPI$remove_filter_state(filter)
    +

    +
    -

    Arguments

    -

    filter
    +

    Arguments +

    +

    +
    +
    +
    filter

    (teal_slices) specifying FilterState objects to remove; teal_slices may contain only dataname and varname, other elements are ignored

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method clear_filter_states()

    -

    Remove all FilterStates of the FilteredData object.

    -

    Usage

    -

    FilterPanelAPI$clear_filter_states(datanames)

    +
    +

    +
    +
    +

    Method clear_filter_states() +

    +

    Remove all FilterStates of the FilteredData object.

    +
    +

    Usage +

    +

    +
    +
    FilterPanelAPI$clear_filter_states(datanames)
    +

    +
    -

    Arguments

    -

    datanames
    +

    Arguments +

    +

    +
    +
    +
    datanames

    (character) datanames to remove their FilterStates; omit to remove all FilterStates in the FilteredData object

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    FilterPanelAPI$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    FilterPanelAPI$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -218,7 +339,8 @@

    Arguments -

    Examples

    +

    Examples +

    library(shiny)
     
     fd <- init_filtered_data(list(iris = iris))
    @@ -289,17 +411,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/release-candidate/reference/FilterState.html b/release-candidate/reference/FilterState.html index 2ed9dd5b9..2156cd5b6 100644 --- a/release-candidate/reference/FilterState.html +++ b/release-candidate/reference/FilterState.html @@ -1,8 +1,24 @@ - -FilterState abstract class — FilterState • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,12 +107,15 @@
    -

    Details

    +

    Details +

    This class is responsible for managing a single filter item within a FilteredData object and outputs a condition call (logical predicate) for subsetting one variable. Filter states depend on the variable type: (logical, integer, numeric, character, factor, Date, POSIXct, POSIXlt) -and FilterState subclasses exist that correspond to those types.

    +

    Each variable's filter state is an R6 object keeps the variable that is filtered, a teal_slice object that describes the filter state, as well as a shiny module (UI and server) that allows the user to alter the filter state. Changes to the filter state that cause some observations to be omitted trigger the get_call method and every R function call up in the reactive chain.

    -

    Modifying state

    +

    Modifying state +

    -

    Modifying a FilterState object is possible in three scenarios:

    • In an interactive session, by passing an appropriate teal_slice to the set_state method.

    • +

      Modifying a FilterState object is possible in three scenarios:

      +
        +
      • In an interactive session, by passing an appropriate teal_slice to the set_state method.

      • In a running application, by changing appropriate inputs.

      • In a running application, by using filter_state_api which directly uses set_state method of the FilterState object.

      • -
    + +
    -

    Methods

    +

    Methods +


    -

    Method new()

    -

    Initialize a FilterState object.

    -

    Usage

    -

    FilterState$new(
    +
    +
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterState object.

    +
    +

    Usage +

    +

    +
    +
    FilterState$new(
       x,
       x_reactive = reactive(NULL),
       slice,
       extract_type = character(0)
    -)

    +)
    +

    +
    -

    Returns

    +

    Returns +

    Object of class FilterState, invisibly.

    -


    -

    Method format()

    -

    Returns a formatted string representing this FilterState object.

    -

    Usage

    -

    FilterState$format(show_all = FALSE, trim_lines = TRUE)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns a formatted string representing this FilterState object.

    +
    +

    Usage +

    +

    +
    +
    FilterState$format(show_all = FALSE, trim_lines = TRUE)
    +

    +
    -

    Arguments

    -

    show_all
    +

    Arguments +

    +

    +
    +
    +
    show_all

    (logical(1)) passed to format.teal_slice

    @@ -197,106 +267,196 @@

    Arguments -

    Returns

    +

    Returns +

    character(1) the formatted string

    -


    -

    Method print()

    -

    Prints this FilterState object.

    -

    Usage

    -

    FilterState$print(...)

    +
    +

    +
    +
    +

    Method print() +

    +

    Prints this FilterState object.

    +
    +

    Usage +

    +

    +
    +
    FilterState$print(...)
    +

    +
    -

    Arguments

    -

    ...
    +

    Arguments +

    +

    +
    +
    +
    ...

    additional arguments

    -

    +
    +

    +
    -


    -

    Method set_state()

    -

    Sets mutable parameters of the filter state.

    • fixed state is prevented from changing state

    • +
    +

    +
    +
    +

    Method set_state() +

    +

    Sets mutable parameters of the filter state.

    +
      +
    • fixed state is prevented from changing state

    • anchored state is prevented from removing state

    • -
    -

    Usage

    -

    FilterState$set_state(state)

    + +
    +

    Usage +

    +

    +
    +
    FilterState$set_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slice)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    self invisibly

    -


    -

    Method get_state()

    -

    Returns a complete description of the filter state.

    -

    Usage

    -

    FilterState$get_state()

    +
    +

    +
    +
    +

    Method get_state() +

    +

    Returns a complete description of the filter state.

    +
    +

    Usage +

    +

    +
    +
    FilterState$get_state()
    +

    +
    -

    Returns

    +

    Returns +

    A teal_slice object.

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection relevant for selected variable type. Method is using internal reactive values which makes it reactive -and must be executed in reactive or isolated context.

    -

    Usage

    -

    FilterState$get_call()

    +and must be executed in reactive or isolated context.

    +
    +

    Usage +

    +

    +
    +
    FilterState$get_call()
    +

    +
    -


    -

    Method server()

    -

    shiny module server.

    -

    Usage

    -

    FilterState$server(id)

    +
    +

    +
    +
    +

    Method server() +

    +

    shiny module server.

    +
    +

    Usage +

    +

    +
    +
    FilterState$server(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Reactive expression signaling that remove button has been clicked.

    -


    -

    Method ui()

    +
    +

    +
    +
    +

    Method ui() +

    shiny UI module. -The UI for this class contains simple message stating that it is not supported.

    -

    Usage

    -

    FilterState$ui(id, parent_id = "cards")

    +The UI for this class contains simple message stating that it is not supported.

    +
    +

    Usage +

    +

    +
    +
    FilterState$ui(id, parent_id = "cards")
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    @@ -305,35 +465,64 @@

    Arguments
    -

    Method destroy_observers()

    -

    Destroy observers stored in private$observers.

    -

    Usage

    -

    FilterState$destroy_observers()

    +
    +

    +
    +
    +

    Method destroy_observers() +

    +

    Destroy observers stored in private$observers.

    +
    +

    Usage +

    +

    +
    +
    FilterState$destroy_observers()
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    FilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    FilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -341,17 +530,19 @@

    Arguments

    + +

    + +
    - - + + diff --git a/release-candidate/reference/FilterStateExpr.html b/release-candidate/reference/FilterStateExpr.html index 6b5e6af54..f086f1df5 100644 --- a/release-candidate/reference/FilterStateExpr.html +++ b/release-candidate/reference/FilterStateExpr.html @@ -1,8 +1,24 @@ - -FilterStateExpr R6 class — FilterStateExpr • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,18 +107,22 @@
    -

    Details

    +

    Details +

    Creates a filter state around a predefined condition call (logical predicate). The condition call is independent of the data and the filter card allows no interaction (the filter is always fixed).

    -

    Methods

    +

    Methods +


    -

    Method new()

    -

    Initialize a FilterStateExpr object.

    -

    Usage

    -

    FilterStateExpr$new(slice)

    + +
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterStateExpr object.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$new(slice)
    +

    +
    -

    Arguments

    -

    slice
    +

    Arguments +

    +

    +
    +
    +
    slice

    (teal_slice_expr)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Object of class FilterStateExpr, invisibly.

    -


    -

    Method format()

    -

    Returns a formatted string representing this FilterStateExpr object.

    -

    Usage

    -

    FilterStateExpr$format(show_all = FALSE, trim_lines = TRUE)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns a formatted string representing this FilterStateExpr object.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$format(show_all = FALSE, trim_lines = TRUE)
    +

    +
    -

    Arguments

    -

    show_all
    +

    Arguments +

    +

    +
    +
    +
    show_all

    (logical(1)) passed to format.teal_slice

    @@ -142,133 +201,242 @@

    Arguments -

    Returns

    +

    Returns +

    character(1) the formatted string

    -


    -

    Method print()

    -

    Prints this FilterStateExpr object.

    -

    Usage

    -

    FilterStateExpr$print(...)

    +
    +

    +
    +
    +

    Method print() +

    +

    Prints this FilterStateExpr object.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$print(...)
    +

    +
    -

    Arguments

    -

    ...
    +

    Arguments +

    +

    +
    +
    +
    ...

    arguments passed to the format method

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method get_state()

    -

    Returns a complete description of this filter state.

    -

    Usage

    -

    FilterStateExpr$get_state()

    +
    +

    +
    +
    +

    Method get_state() +

    +

    Returns a complete description of this filter state.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$get_state()
    +

    +
    -

    Returns

    +

    Returns +

    A teal_slice object.

    -


    -

    Method set_state()

    -

    Does nothing. Exists for compatibility.

    -

    Usage

    -

    FilterStateExpr$set_state(state)

    +
    +

    +
    +
    +

    Method set_state() +

    +

    Does nothing. Exists for compatibility.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$set_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slice)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    self, invisibly.

    -


    -

    Method get_call()

    -

    Get reproducible call.

    -

    Usage

    -

    FilterStateExpr$get_call(dataname)

    +
    +

    +
    +
    +

    Method get_call() +

    +

    Get reproducible call.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    -

    (ignored) for a consistency with FilterState

    +

    Arguments +

    +

    +
    +
    +
    dataname
    +
    +

    (ignored) for a consistency with FilterState

    Returns reproducible condition call for current selection relevant for selected variable type. Method is using internal reactive values which makes it reactive -and must be executed in reactive or isolated context.

    +and must be executed in reactive or isolated context.

    +
    -

    + +

    +
    -

    Returns

    +

    Returns +

    call or NULL

    -


    -

    Method destroy_observers()

    -

    Destroy observers stored in private$observers.

    -

    Usage

    -

    FilterStateExpr$destroy_observers()

    +
    +

    +
    +
    +

    Method destroy_observers() +

    +

    Destroy observers stored in private$observers.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$destroy_observers()
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method server()

    -

    shiny module server.

    -

    Usage

    -

    FilterStateExpr$server(id)

    +
    +

    +
    +
    +

    Method server() +

    +

    shiny module server.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$server(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Reactive expression signaling that the remove button has been clicked.

    -


    -

    Method ui()

    +
    +

    +
    +
    +

    Method ui() +

    shiny module UI. -The UI for this class contains simple message stating that it is not supported.

    -

    Usage

    -

    FilterStateExpr$ui(id, parent_id = "cards")

    +The UI for this class contains simple message stating that it is not supported.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$ui(id, parent_id = "cards")
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    @@ -278,23 +446,41 @@

    Arguments
    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    FilterStateExpr$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -302,7 +488,8 @@

    Arguments -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     include_js_files <- getFromNamespace("include_js_files", "teal.slice")
     include_css_files <- getFromNamespace("include_css_files", "teal.slice")
    @@ -355,17 +542,19 @@ 

    Examples

    + +

    + +
    - - + + diff --git a/release-candidate/reference/FilterStates.html b/release-candidate/reference/FilterStates.html index 08f5f0b55..8ed054d79 100644 --- a/release-candidate/reference/FilterStates.html +++ b/release-candidate/reference/FilterStates.html @@ -1,5 +1,10 @@ - - + + + + + +FilterStates R6 class — FilterStates • teal.slice +FilterStates R6 class — FilterStates • teal.slice + + + + + + + + + + Skip to contents @@ -38,7 +54,8 @@ + +
    @@ -114,12 +137,15 @@
    -

    Methods

    +

    Methods +


    -

    Method new()

    + +
    +

    +
    +
    +

    Method new() +

    Initializes FilterStates object by setting -dataname, and datalabel.

    -

    Usage

    -

    FilterStates$new(
    +dataname, and datalabel.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$new(
       data,
       data_reactive = function(sid = "") NULL,
       dataname,
       datalabel = NULL
    -)

    +)
    +

    +
    -

    Arguments

    -

    data
    +

    Arguments +

    +

    +
    +
    +
    data

    (data.frame or MultiAssayExperiment or SummarizedExperiment or matrix) the R object which subset function is applied on.

    @@ -171,23 +212,40 @@

    Arguments -

    Returns

    +

    Returns +

    Object of class FilterStates, invisibly.

    -


    -

    Method format()

    -

    Returns a formatted string representing this FilterStates object.

    -

    Usage

    -

    FilterStates$format(show_all = FALSE, trim_lines = TRUE)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns a formatted string representing this FilterStates object.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$format(show_all = FALSE, trim_lines = TRUE)
    +

    +
    -

    Arguments

    -

    show_all
    +

    Arguments +

    +

    +
    +
    +
    show_all

    (logical(1)) passed to format.teal_slices

    @@ -195,28 +253,40 @@

    Arguments -

    Returns

    +

    Returns +

    character(1) the formatted string

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Filter call

    Builds subset expression from condition calls generated by FilterState. The lhs of the expression is a dataname_prefixed, where word prefixed refers to situation when call is evaluated on elements of the original data, for example dataname[[x]]. By default dataname_prefixed = dataname and it's not alterable through class methods. Customization of private$dataname_prefixed is done through inheriting classes.

    -

    The rhs is a call to private$fun with following arguments:

    • dataname_prefixed

    • +

      The rhs is a call to private$fun with following arguments:

      +
        +
      • dataname_prefixed

      • list of logical expressions generated by FilterState objects stored in private$state_list. Each logical predicate is combined with & operator. Variables in these logical expressions by default are not prefixed but this can be changed by setting private$extract_type (change in the similar way as dataname_prefixed) Possible call outputs depending on a custom fields/options:

      • -

      # default
      +
    +

    +
    +
    # default
     dataname <- subset(dataname, col == "x")
     
     # fun = dplyr::filter
    @@ -229,222 +299,399 @@ 

    Method get_call()dataname <- subset(dataname, subset = row_col == "x", select = col_col == "x") # dataname = dataname[[element]] -dataname[[element]] <- subset(dataname[[element]], subset = col == "x")

    -

    If no filters are applied, NULL is returned to avoid no-op calls such as dataname <- dataname.

    -

    Usage

    -

    FilterStates$get_call(sid = "")

    +dataname[[element]] <- subset(dataname[[element]], subset = col == "x")
    +

    +
    +

    If no filters are applied, NULL is returned to avoid no-op calls such as dataname <- dataname.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$get_call(sid = "")
    +

    +
    -

    Arguments

    -

    sid
    +

    Arguments +

    +

    +
    +
    +
    sid

    (character) when specified then method returns code containing condition calls (logical predicates) of FilterState objects which "sid" attribute is different than this sid argument.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    call or NULL

    -


    -

    Method print()

    -

    Prints this FilterStates object.

    -

    Usage

    -

    FilterStates$print(...)

    +
    +

    +
    +
    +

    Method print() +

    +

    Prints this FilterStates object.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$print(...)
    +

    +
    -

    Arguments

    -

    ...
    +

    Arguments +

    +

    +
    +
    +
    ...

    additional arguments passed to format.

    -

    +
    +

    +
    -


    -

    Method remove_filter_state()

    -

    Remove one or more FilterStates from the state_list along with their UI elements.

    -

    Usage

    -

    FilterStates$remove_filter_state(state)

    +
    +

    +
    +
    +

    Method remove_filter_state() +

    +

    Remove one or more FilterStates from the state_list along with their UI elements.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$remove_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices) specifying FilterState objects to remove; teal_slices may contain only dataname and varname, other elements are ignored

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    +

    +
    +
    +

    Method get_filter_state() +

    Gets reactive values from active FilterState objects.

    Get active filter state from FilterState objects stored in state_list(s). -The output is a list compatible with input to self$set_filter_state.

    -

    Usage

    -

    FilterStates$get_filter_state()

    +The output is a list compatible with input to self$set_filter_state.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$get_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    Object of class teal_slices.

    -


    -

    Method set_filter_state()

    -

    Sets active FilterState objects.

    -

    Usage

    -

    FilterStates$set_filter_state(state)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Sets active FilterState objects.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$set_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Function that raises an error.

    -


    -

    Method clear_filter_states()

    -

    Remove all FilterState objects from this FilterStates object.

    -

    Usage

    -

    FilterStates$clear_filter_states(force = FALSE)

    +
    +

    +
    +
    +

    Method clear_filter_states() +

    +

    Remove all FilterState objects from this FilterStates object.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$clear_filter_states(force = FALSE)
    +

    +
    -

    Arguments

    -

    force
    +

    Arguments +

    +

    +
    +
    +
    force

    (logical(1)) flag specifying whether to include anchored filter states.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method ui_active()

    +
    +

    +
    +
    +

    Method ui_active() +

    shiny UI definition that stores FilterState UI elements. -Populated with elements created with renderUI in the module server.

    -

    Usage

    -

    FilterStates$ui_active(id)

    +Populated with elements created with renderUI in the module server.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$ui_active(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_active()

    -

    shiny server module.

    -

    Usage

    -

    FilterStates$srv_active(id)

    +
    +

    +
    +
    +

    Method srv_active() +

    +

    shiny server module.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$srv_active(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL.

    -


    -

    Method ui_add()

    -

    shiny UI module to add filter variable.

    -

    Usage

    -

    FilterStates$ui_add(id)

    +
    +

    +
    +
    +

    Method ui_add() +

    +

    shiny UI module to add filter variable.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$ui_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_add()

    +
    +

    +
    +
    +

    Method srv_add() +

    shiny server module to add filter variable.

    This module controls available choices to select as a filter variable. Once selected, a variable is removed from available choices. -Removing a filter variable adds it back to available choices.

    -

    Usage

    -

    FilterStates$srv_add(id)

    +Removing a filter variable adds it back to available choices.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$srv_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL.

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    FilterStates$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -452,17 +699,19 @@

    Arguments

    + +
    + +
    - - + + diff --git a/release-candidate/reference/FilteredData.html b/release-candidate/reference/FilteredData.html index 5e690874d..cef5a5636 100644 --- a/release-candidate/reference/FilteredData.html +++ b/release-candidate/reference/FilteredData.html @@ -1,8 +1,24 @@ - -Class to encapsulate filtered datasets — FilteredData • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,7 +106,8 @@ + +
    -

    Methods

    +

    Methods +


    -

    Method new()

    -

    Initialize a FilteredData object.

    -

    Usage

    -

    FilteredData$new(data_objects, join_keys = teal.data::join_keys())

    + +
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilteredData object.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$new(data_objects, join_keys = teal.data::join_keys())
    +

    +
    -

    Arguments

    -

    data_objects
    +

    Arguments +

    +

    +
    +
    +
    data_objects

    (named list) List of data objects. Names of the list will be used as dataname for respective datasets.

    @@ -157,65 +204,113 @@

    Argumentsteal.data::join_keys().

    -

    +
    +

    +
    -


    -

    Method datanames()

    -

    Gets datanames.

    -

    Usage

    -

    FilteredData$datanames()

    +
    +

    +
    +
    +

    Method datanames() +

    +

    Gets datanames.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$datanames()
    +

    +
    -

    Details

    +

    Details +

    The datanames are returned in the order in which they must be evaluated (in case of dependencies).

    -

    Returns

    +

    Returns +

    Character vector.

    -


    -

    Method get_datalabel()

    +
    +

    +
    +
    +

    Method get_datalabel() +

    Gets data label for the dataset. -Useful to display in Show R Code.

    -

    Usage

    -

    FilteredData$get_datalabel(dataname)

    +Useful to display in Show R Code.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_datalabel(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Character string.

    -


    -

    Method set_available_teal_slices()

    -

    Set list of external filter states available for activation.

    -

    Usage

    -

    FilteredData$set_available_teal_slices(x)

    +
    +

    +
    +
    +

    Method set_available_teal_slices() +

    +

    Set list of external filter states available for activation.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$set_available_teal_slices(x)
    +

    +
    -

    Arguments

    -

    x
    +

    Arguments +

    +

    +
    +
    +
    x

    (reactive) should return teal_slices

    -

    +
    +

    +
    -

    Details

    +

    Details +

    Unlike adding new filter from the column, these filters can come with some prespecified settings. teal_slices are wrapped in a reactive so they can be updated from elsewhere in the app. Filters passed in x are limited to those that can be set for this FilteredData object, @@ -224,46 +319,76 @@

    Details -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method get_available_teal_slices()

    -

    Get list of filter states available for this object.

    -

    Usage

    -

    FilteredData$get_available_teal_slices()

    +
    +

    +
    +
    +

    Method get_available_teal_slices() +

    +

    Get list of filter states available for this object.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_available_teal_slices()
    +

    +
    -

    Details

    +

    Details +

    All teal_slice objects that have been created since the beginning of the app session are stored in one teal_slices object. This returns a subset of that teal_slices, describing filter states that can be set for this object.

    -

    Returns

    +

    Returns +

    reactive that returns teal_slices.

    -


    -

    Method get_call()

    -

    Gets a call to filter the dataset according to the filter state.

    -

    Usage

    -

    FilteredData$get_call(dataname)

    +
    +

    +
    +
    +

    Method get_call() +

    +

    Gets a call to filter the dataset according to the filter state.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset

    -

    +
    +

    +
    -

    Details

    +

    Details +

    It returns a call to filter the dataset only, assuming the other (filtered) datasets it depends on are available.

    Together with self$datanames() which returns the datasets in the correct @@ -277,21 +402,36 @@

    Details -

    Returns

    +

    Returns +

    A list of calls.

    -


    -

    Method get_data()

    +
    +

    +
    +
    +

    Method get_data() +

    Gets filtered or unfiltered dataset.

    -

    For filtered = FALSE, the original data set with set_data is returned including all attributes.

    -

    Usage

    -

    FilteredData$get_data(dataname, filtered = TRUE)

    +

    For filtered = FALSE, the original data set with set_data is returned including all attributes.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_data(dataname, filtered = TRUE)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset.

    @@ -299,77 +439,139 @@

    Arguments -

    Returns

    +

    Returns +

    A data object, a data.frame or a MultiAssayExperiment.

    -


    -

    Method get_join_keys()

    -

    Get join keys between two datasets.

    -

    Usage

    -

    FilteredData$get_join_keys()

    +
    +

    +
    +
    +

    Method get_join_keys() +

    +

    Get join keys between two datasets.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_join_keys()
    +

    +
    -

    Returns

    +

    Returns +

    join_keys

    -


    -

    Method get_filter_overview()

    +
    +

    +
    +
    +

    Method get_filter_overview() +

    Creates filter overview table to be displayed in the application. One row is created per dataset, according to the get_filter_overview methods -of the contained FilteredDataset objects.

    -

    Usage

    -

    FilteredData$get_filter_overview(datanames)

    +of the contained FilteredDataset objects.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_filter_overview(datanames)
    +

    +
    -

    Arguments

    -

    datanames
    +

    Arguments +

    +

    +
    +
    +
    datanames

    (character) vector of dataset names.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    A data.frame listing the numbers of observations in all datasets.

    -


    -

    Method get_keys()

    -

    Get keys for the dataset.

    -

    Usage

    -

    FilteredData$get_keys(dataname)

    +
    +

    +
    +
    +

    Method get_keys() +

    +

    Get keys for the dataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_keys(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Character vector of key column names.

    -


    -

    Method set_dataset()

    -

    Adds a dataset to this FilteredData.

    -

    Usage

    -

    FilteredData$set_dataset(data, dataname)

    +
    +

    +
    +
    +

    Method set_dataset() +

    +

    Adds a dataset to this FilteredData.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$set_dataset(data, dataname)
    +

    +
    -

    Arguments

    -

    data
    +

    Arguments +

    +

    +
    +
    +
    data

    (data.frame or MultiAssayExperiment) data to be filtered.

    @@ -379,10 +581,13 @@

    Arguments -

    Details

    +

    Details +

    set_dataset creates a FilteredDataset object which keeps dataset for the filtering purpose. If this data has a parent specified in the join_keys object stored in private$join_keys then created FilteredDataset (child) gets linked with other FilteredDataset (parent). @@ -391,52 +596,95 @@

    Details -

    Returns

    +

    Returns +

    self, invisibly.

    -


    -

    Method set_join_keys()

    -

    Set the join_keys.

    -

    Usage

    -

    FilteredData$set_join_keys(join_keys)

    +
    +

    +
    +
    +

    Method set_join_keys() +

    +

    Set the join_keys.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$set_join_keys(join_keys)
    +

    +
    -

    Arguments

    -

    join_keys
    +

    Arguments +

    +

    +
    +
    +
    join_keys

    (join_keys), see teal.data::join_keys().

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    self, invisibly.

    -


    -

    Method get_filter_state()

    -

    Gets states of all contained FilterState objects.

    -

    Usage

    -

    FilteredData$get_filter_state()

    +
    +

    +
    +
    +

    Method get_filter_state() +

    +

    Gets states of all contained FilterState objects.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    A teal_slices object.

    -


    -

    Method format()

    -

    Returns a formatted string representing this FilteredData object.

    -

    Usage

    -

    FilteredData$format(show_all = FALSE, trim_lines = TRUE)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns a formatted string representing this FilteredData object.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$format(show_all = FALSE, trim_lines = TRUE)
    +

    +
    -

    Arguments

    -

    show_all
    +

    Arguments +

    +

    +
    +
    +
    show_all

    (logical(1)) passed to format.teal_slice.

    @@ -444,81 +692,148 @@

    Arguments -

    Returns

    +

    Returns +

    character(1) the formatted string.

    -


    -

    Method print()

    -

    Prints this FilteredData object.

    -

    Usage

    -

    FilteredData$print(...)

    +
    +

    +
    +
    +

    Method print() +

    +

    Prints this FilteredData object.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$print(...)
    +

    +
    -

    Arguments

    -

    ...
    +

    Arguments +

    +

    +
    +
    +
    ...

    additional arguments passed to format.

    -

    +
    +

    +
    -


    -

    Method set_filter_state()

    -

    Sets active filter states.

    -

    Usage

    -

    FilteredData$set_filter_state(state)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Sets active filter states.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$set_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method remove_filter_state()

    -

    Removes one or more FilterState from a FilteredData object.

    -

    Usage

    -

    FilteredData$remove_filter_state(state)

    +
    +

    +
    +
    +

    Method remove_filter_state() +

    +

    Removes one or more FilterState from a FilteredData object.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$remove_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices) specifying FilterState objects to remove; teal_slices may contain only dataname and varname, other elements are ignored.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method clear_filter_states()

    -

    Remove all FilterStates of a FilteredDataset or all FilterStates of a FilteredData object.

    -

    Usage

    -

    FilteredData$clear_filter_states(datanames = self$datanames(), force = FALSE)

    +
    +

    +
    +
    +

    Method clear_filter_states() +

    +

    Remove all FilterStates of a FilteredDataset or all FilterStates of a FilteredData object.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$clear_filter_states(datanames = self$datanames(), force = FALSE)
    +

    +
    -

    Arguments

    -

    datanames
    +

    Arguments +

    +

    +
    +
    +
    datanames

    (character) names of datasets for which to remove all filter states. Defaults to all datasets in this FilteredData object.

    @@ -529,45 +844,79 @@

    Arguments -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method ui_filter_panel()

    +
    +

    +
    +
    +

    Method ui_filter_panel() +

    top-level shiny module for the filter panel in the teal app. -Contains 1) filter overview panel, 2) filter active panel, and 3) add filters panel.

    -

    Usage

    -

    FilteredData$ui_filter_panel(id)

    +Contains 1) filter overview panel, 2) filter active panel, and 3) add filters panel.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$ui_filter_panel(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_filter_panel()

    -

    Server function for filter panel.

    -

    Usage

    -

    FilteredData$srv_filter_panel(id, active_datanames = self$datanames)

    +
    +

    +
    +
    +

    Method srv_filter_panel() +

    +

    Server function for filter panel.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$srv_filter_panel(id, active_datanames = self$datanames)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    @@ -580,44 +929,78 @@

    Arguments -

    Returns

    +

    Returns +

    NULL.

    -


    -

    Method ui_active()

    -

    Server module responsible for displaying active filters.

    -

    Usage

    -

    FilteredData$ui_active(id)

    +
    +

    +
    +
    +

    Method ui_active() +

    +

    Server module responsible for displaying active filters.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$ui_active(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_active()

    -

    Server module responsible for displaying active filters.

    -

    Usage

    -

    FilteredData$srv_active(id, active_datanames = self$datanames)

    +
    +

    +
    +
    +

    Method srv_active() +

    +

    Server module responsible for displaying active filters.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$srv_active(id, active_datanames = self$datanames)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    @@ -627,44 +1010,78 @@

    Arguments -

    Returns

    +

    Returns +

    NULL.

    -


    -

    Method ui_add()

    -

    Server module responsible for displaying drop-downs with variables to add a filter.

    -

    Usage

    -

    FilteredData$ui_add(id)

    +
    +

    +
    +
    +

    Method ui_add() +

    +

    Server module responsible for displaying drop-downs with variables to add a filter.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$ui_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_add()

    -

    Server module responsible for displaying drop-downs with variables to add a filter.

    -

    Usage

    -

    FilteredData$srv_add(id, active_datanames = reactive(self$datanames()))

    +
    +

    +
    +
    +

    Method srv_add() +

    +

    Server module responsible for displaying drop-downs with variables to add a filter.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$srv_add(id, active_datanames = reactive(self$datanames()))
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    @@ -674,45 +1091,78 @@

    Arguments -

    Returns

    +

    Returns +

    NULL.

    -


    -

    Method ui_overview()

    +
    +

    +
    +
    +

    Method ui_overview() +

    Creates the UI definition for the module showing counts for each dataset contrasting the filtered to the full unfiltered dataset.

    Per dataset, it displays the number of rows/observations in each dataset, -the number of unique subjects.

    -

    Usage

    -

    FilteredData$ui_overview(id)

    +the number of unique subjects.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$ui_overview(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -


    -

    Method srv_overview()

    +
    +

    +
    +
    +

    Method srv_overview() +

    Server function to display the number of records in the filtered and unfiltered -data.

    -

    Usage

    -

    FilteredData$srv_overview(id, active_datanames = self$datanames)

    +data.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$srv_overview(id, active_datanames = self$datanames)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    @@ -725,27 +1175,46 @@

    Arguments -

    Returns

    +

    Returns +

    NULL.

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    FilteredData$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -753,7 +1222,8 @@

    Arguments -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     FilteredData <- getFromNamespace("FilteredData", "teal.slice")
     
    @@ -931,17 +1401,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/release-candidate/reference/FilteredDataset.html b/release-candidate/reference/FilteredDataset.html index e09e98053..ca6a3587c 100644 --- a/release-candidate/reference/FilteredDataset.html +++ b/release-candidate/reference/FilteredDataset.html @@ -1,16 +1,32 @@ - - + + + + + +FilteredDataset R6 class — FilteredDataset • teal.slice +FilteredDataset R6 class — FilteredDataset • teal.slice + + + + + + + + + + Skip to contents @@ -26,7 +42,8 @@ + +
    @@ -96,12 +119,15 @@
    -

    Methods

    +

    Methods +


    -

    Method new()

    -

    Initializes this FilteredDataset object.

    -

    Usage

    -

    +

    +
    +
    +

    Method new() +

    +

    Initializes this FilteredDataset object.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$new(
       dataset,
       dataname,
       keys = character(0),
       label = attr(dataset, "label", exact = TRUE)
    -)

    +)
    +

    +
    -

    Arguments

    -

    dataset
    +

    Arguments +

    +

    +
    +
    +
    dataset

    any object

    @@ -152,23 +193,40 @@

    Arguments -

    Returns

    +

    Returns +

    Object of class FilteredDataset, invisibly.

    -


    -

    Method format()

    -

    Returns a formatted string representing this FilteredDataset object.

    -

    Usage

    -

    FilteredDataset$format(show_all = FALSE, trim_lines = TRUE)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns a formatted string representing this FilteredDataset object.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$format(show_all = FALSE, trim_lines = TRUE)
    +

    +
    -

    Arguments

    -

    show_all
    +

    Arguments +

    +

    +
    +
    +
    show_all

    (logical(1)) passed to format.teal_slice.

    @@ -176,289 +234,526 @@

    Arguments -

    Returns

    +

    Returns +

    The formatted character string.

    -


    -

    Method print()

    -

    Prints this FilteredDataset object.

    -

    Usage

    -

    FilteredDataset$print(...)

    +
    +

    +
    +
    +

    Method print() +

    +

    Prints this FilteredDataset object.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$print(...)
    +

    +
    -

    Arguments

    -

    ...
    +

    Arguments +

    +

    +
    +
    +
    ...

    additional arguments passed to format.

    -

    +
    +

    +
    -


    -

    Method clear_filter_states()

    -

    Removes all filter items applied to this dataset.

    -

    Usage

    -

    FilteredDataset$clear_filter_states(force = FALSE)

    +
    +

    +
    +
    +

    Method clear_filter_states() +

    +

    Removes all filter items applied to this dataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$clear_filter_states(force = FALSE)
    +

    +
    -

    Arguments

    -

    force
    +

    Arguments +

    +

    +
    +
    +
    force

    (logical(1)) flag specifying whether to include anchored filter states.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL.

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Gets a filter expression.

    This function returns filter calls equivalent to selected items within each of filter_states. Configuration of the calls is constant and -depends on filter_states type and order which are set during initialization.

    -

    Usage

    -

    FilteredDataset$get_call(sid = "")

    +depends on filter_states type and order which are set during initialization.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_call(sid = "")
    +

    +
    -

    Arguments

    -

    sid
    +

    Arguments +

    +

    +
    +
    +
    sid

    (character) when specified, the method returns code containing conditions calls of FilterState objects with sid different to this sid argument.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Either a list of filter calls, or NULL.

    -


    -

    Method get_filter_state()

    -

    Gets states of all contained FilterState objects.

    -

    Usage

    -

    FilteredDataset$get_filter_state()

    +
    +

    +
    +
    +

    Method get_filter_state() +

    +

    Gets states of all contained FilterState objects.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    A teal_slices object.

    -


    -

    Method set_filter_state()

    -

    Set filter state.

    -

    Usage

    -

    FilteredDataset$set_filter_state(state)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Set filter state.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$set_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Virtual method, returns nothing and raises error.

    -


    -

    Method get_filter_count()

    -

    Gets the number of FilterState objects in all FilterStates in this FilteredDataset.

    -

    Usage

    -

    FilteredDataset$get_filter_count()

    +
    +

    +
    +
    +

    Method get_filter_count() +

    +

    Gets the number of FilterState objects in all FilterStates in this FilteredDataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_filter_count()
    +

    +
    -

    Returns

    +

    Returns +

    integer(1)

    -


    -

    Method get_dataname()

    -

    Gets the name of the dataset.

    -

    Usage

    -

    FilteredDataset$get_dataname()

    +
    +

    +
    +
    +

    Method get_dataname() +

    +

    Gets the name of the dataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_dataname()
    +

    +
    -

    Returns

    +

    Returns +

    A character string.

    -


    -

    Method get_dataset()

    -

    Gets the dataset object in this FilteredDataset.

    -

    Usage

    -

    FilteredDataset$get_dataset(filtered = FALSE)

    +
    +

    +
    +
    +

    Method get_dataset() +

    +

    Gets the dataset object in this FilteredDataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_dataset(filtered = FALSE)
    +

    +
    -

    Arguments

    -

    filtered
    +

    Arguments +

    +

    +
    +
    +
    filtered

    (logical(1))

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    The stored dataset. If data.frame or MultiAssayExperiment, either raw or as a reactive with current filters applied (depending on filtered).

    -


    -

    Method get_filter_overview()

    -

    Get filter overview of a dataset.

    -

    Usage

    -

    FilteredDataset$get_filter_overview()

    +
    +

    +
    +
    +

    Method get_filter_overview() +

    +

    Get filter overview of a dataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_filter_overview()
    +

    +
    -

    Returns

    +

    Returns +

    Virtual method, returns nothing and raises an error.

    -


    -

    Method get_keys()

    -

    Gets the key columns for this dataset.

    -

    Usage

    -

    FilteredDataset$get_keys()

    +
    +

    +
    +
    +

    Method get_keys() +

    +

    Gets the key columns for this dataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_keys()
    +

    +
    -

    Returns

    +

    Returns +

    Character vector of variable names

    -


    -

    Method get_dataset_label()

    -

    Gets the dataset label.

    -

    Usage

    -

    FilteredDataset$get_dataset_label()

    +
    +

    +
    +
    +

    Method get_dataset_label() +

    +

    Gets the dataset label.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_dataset_label()
    +

    +
    -

    Returns

    +

    Returns +

    Character string.

    -


    -

    Method ui_active()

    -

    shiny module containing active filters for a dataset, along with a title and a remove button.

    -

    Usage

    -

    FilteredDataset$ui_active(id)

    +
    +

    +
    +
    +

    Method ui_active() +

    +

    shiny module containing active filters for a dataset, along with a title and a remove button.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$ui_active(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_active()

    -

    Server module for a dataset active filters.

    -

    Usage

    -

    FilteredDataset$srv_active(id)

    +
    +

    +
    +
    +

    Method srv_active() +

    +

    Server module for a dataset active filters.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$srv_active(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL.

    -


    -

    Method ui_add()

    -

    UI module to add filter variable for this dataset.

    -

    Usage

    -

    FilteredDataset$ui_add(id)

    +
    +

    +
    +
    +

    Method ui_add() +

    +

    UI module to add filter variable for this dataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$ui_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Virtual method, returns nothing and raises error.

    -


    -

    Method srv_add()

    +
    +

    +
    +
    +

    Method srv_add() +

    Server module to add filter variable for this dataset. For this class srv_add calls multiple modules of the same name from FilterStates as MAEFilteredDataset -contains one FilterStates object for colData and one for each experiment.

    -

    Usage

    -

    FilteredDataset$srv_add(id)

    +contains one FilterStates object for colData and one for each experiment.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$srv_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL.

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    FilteredDataset$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -466,17 +761,19 @@

    Arguments

    + +
    + +
    - - + + diff --git a/release-candidate/reference/LogicalFilterState.html b/release-candidate/reference/LogicalFilterState.html index 68c34e73e..9e186e794 100644 --- a/release-candidate/reference/LogicalFilterState.html +++ b/release-candidate/reference/LogicalFilterState.html @@ -1,8 +1,24 @@ - -FilterState object for logical data — LogicalFilterState • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,40 +107,60 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterState -> LogicalFilterState

    +

    Inherited methods


    -

    Method new()

    -

    Initialize a FilterState object.

    -

    Usage

    -

    LogicalFilterState$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterState object.

    +
    +

    Usage +

    +

    +
    +
    LogicalFilterState$new(
       x,
       x_reactive = reactive(NULL),
       extract_type = character(0),
       slice
    -)

    +)
    +

    +
    -

    Arguments

    -

    x
    +

    Arguments +

    +

    + -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection. -For LogicalFilterState it's a !<varname> or <varname> and optionally is.na(<varname>)

    -

    Usage

    -

    LogicalFilterState$get_call(dataname)

    +For LogicalFilterState it's a !<varname> or <varname> and optionally is.na(<varname>)

    +
    +

    Usage +

    +

    +
    +
    LogicalFilterState$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    name of data set; defaults to private$get_dataname()

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    call

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    LogicalFilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    LogicalFilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -196,7 +279,8 @@

    Arguments -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     include_css_files <- getFromNamespace("include_css_files", "teal.slice")
     include_js_files <- getFromNamespace("include_js_files", "teal.slice")
    @@ -284,17 +368,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/release-candidate/reference/MAEFilterStates.html b/release-candidate/reference/MAEFilterStates.html index e234b346d..2a22f92b4 100644 --- a/release-candidate/reference/MAEFilterStates.html +++ b/release-candidate/reference/MAEFilterStates.html @@ -1,8 +1,24 @@ - -FilterStates subclass for MultiAssayExperiments — MAEFilterStates • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,18 +107,25 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterStates -> MAEFilterStates

    -

    Methods

    +

    Methods +

    Inherited methods +
    +

    Inherited methods


    -

    Method new()

    -

    Initialize MAEFilterStates object.

    -

    Usage

    -

    MAEFilterStates$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize MAEFilterStates object.

    +
    +

    Usage +

    +

    +
    +
    MAEFilterStates$new(
       data,
       data_reactive = function(sid = "") NULL,
       dataname,
       datalabel = "subjects",
       keys = character(0)
    -)

    +)
    +

    +
    -

    Arguments

    -

    data
    +

    Arguments +

    +

    +
    +
    +
    data

    (MultiAssayExperiment) the R object which MultiAssayExperiment::subsetByColData function is applied on.

    @@ -155,23 +198,41 @@

    Arguments
    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    MAEFilterStates$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    MAEFilterStates$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -179,17 +240,19 @@

    Arguments

    + +

    + +
    - - + + diff --git a/release-candidate/reference/MAEFilteredDataset.html b/release-candidate/reference/MAEFilteredDataset.html index 075ae5c20..de644fd92 100644 --- a/release-candidate/reference/MAEFilteredDataset.html +++ b/release-candidate/reference/MAEFilteredDataset.html @@ -1,10 +1,26 @@ - -MAEFilteredDataset R6 class — MAEFilteredDataset • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + +
    @@ -87,22 +110,29 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilteredDataset -> MAEFilteredDataset

    +

    Inherited methods


    -

    Method new()

    -

    Initialize MAEFilteredDataset object.

    -

    Usage

    -

    MAEFilteredDataset$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize MAEFilteredDataset object.

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$new(
       dataset,
       dataname,
       keys = character(0),
       label = character(0)
    -)

    +)
    +

    +
    -

    Arguments

    -

    dataset
    +

    Arguments +

    +

    +
    +
    +
    dataset

    (MulitiAssayExperiment) single MulitiAssayExperiment for which filters are rendered.

    @@ -149,102 +192,183 @@

    Arguments -

    Returns

    +

    Returns +

    Object of class MAEFilteredDataset, invisibly.

    -


    -

    Method set_filter_state()

    -

    Set filter state.

    -

    Usage

    -

    MAEFilteredDataset$set_filter_state(state)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Set filter state.

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$set_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method remove_filter_state()

    -

    Remove one or more FilterState of a MAEFilteredDataset.

    -

    Usage

    -

    MAEFilteredDataset$remove_filter_state(state)

    +
    +

    +
    +
    +

    Method remove_filter_state() +

    +

    Remove one or more FilterState of a MAEFilteredDataset.

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$remove_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices) specifying FilterState objects to remove; teal_slices may contain only dataname and varname, other elements are ignored.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method ui_add()

    -

    UI module to add filter variable for this dataset.

    -

    Usage

    -

    MAEFilteredDataset$ui_add(id)

    +
    +

    +
    +
    +

    Method ui_add() +

    +

    UI module to add filter variable for this dataset.

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$ui_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method get_filter_overview()

    -

    Creates row for filter overview in the form of
    dataname -- observations (remaining/total) -- subjects (remaining/total) - MAE

    -

    Usage

    -

    MAEFilteredDataset$get_filter_overview()

    +
    +

    +
    +
    +

    Method get_filter_overview() +

    +

    Creates row for filter overview in the form of
    dataname -- observations (remaining/total) -- subjects (remaining/total) - MAE

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$get_filter_overview()
    +

    +
    -

    Returns

    +

    Returns +

    A data.frame.

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    MAEFilteredDataset$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -252,7 +376,8 @@

    Arguments -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     MAEFilteredDataset <- getFromNamespace("MAEFilteredDataset", "teal.slice")
     
    @@ -324,17 +449,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/release-candidate/reference/MatrixFilterStates.html b/release-candidate/reference/MatrixFilterStates.html index 4745975bd..ae136b858 100644 --- a/release-candidate/reference/MatrixFilterStates.html +++ b/release-candidate/reference/MatrixFilterStates.html @@ -1,8 +1,24 @@ - -FilterStates subclass for matrices — MatrixFilterStates • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,18 +107,25 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterStates -> MatrixFilterStates

    -

    Methods

    +

    Methods +

    Inherited methods +
    +

    Inherited methods


    -

    Method new()

    -

    Initialize MatrixFilterStates object.

    -

    Usage

    -

    MatrixFilterStates$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize MatrixFilterStates object.

    +
    +

    Usage +

    +

    +
    +
    MatrixFilterStates$new(
       data,
       data_reactive = function(sid = "") NULL,
       dataname,
       datalabel = NULL
    -)

    +)
    +

    +
    -

    Arguments

    -

    data
    +

    Arguments +

    +

    +
    +
    +
    data

    (matrix) the R object which subset function is applied on.

    @@ -144,23 +187,41 @@

    Arguments
    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    MatrixFilterStates$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    MatrixFilterStates$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -168,17 +229,19 @@

    Arguments

    + +

    + +
    - - + + diff --git a/release-candidate/reference/RangeFilterState.html b/release-candidate/reference/RangeFilterState.html index be948086c..9220dd9be 100644 --- a/release-candidate/reference/RangeFilterState.html +++ b/release-candidate/reference/RangeFilterState.html @@ -1,8 +1,24 @@ - -FilterState object for numeric data — RangeFilterState • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,41 +107,61 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterState -> RangeFilterState

    +

    Inherited methods


    -

    Method new()

    -

    Initialize a FilterState object for range selection.

    -

    Usage

    -

    RangeFilterState$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterState object for range selection.

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$new(
       x,
       x_reactive = reactive(NULL),
       extract_type = character(0),
       slice
    -)

    +)
    +

    +
    -

    Arguments

    -

    x
    +

    Arguments +

    +

    + -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection. For this class returned call looks like <varname> >= <min value> & <varname> <= <max value> with -optional is.na(<varname>) and is.finite(<varname>).

    -

    Usage

    -

    RangeFilterState$get_call(dataname)

    +optional is.na(<varname>) and is.finite(<varname>).

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    name of data set; defaults to private$get_dataname()

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    call

    -


    -

    Method get_keep_inf()

    -

    Returns current keep_inf selection.

    -

    Usage

    -

    RangeFilterState$get_keep_inf()

    +
    +

    +
    +
    +

    Method get_keep_inf() +

    +

    Returns current keep_inf selection.

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$get_keep_inf()
    +

    +
    -

    Returns

    +

    Returns +

    logical(1)

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    RangeFilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -211,7 +305,8 @@

    Arguments -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     include_css_files <- getFromNamespace("include_css_files", "teal.slice")
     include_js_files <- getFromNamespace("include_js_files", "teal.slice")
    @@ -327,17 +422,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/release-candidate/reference/SEFilterStates.html b/release-candidate/reference/SEFilterStates.html index e1d50e7d4..2c9d32573 100644 --- a/release-candidate/reference/SEFilterStates.html +++ b/release-candidate/reference/SEFilterStates.html @@ -1,8 +1,24 @@ - -FilterStates subclass for SummarizedExperiments — SEFilterStates • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,21 +107,28 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterStates -> SEFilterStates

    +

    Inherited methods


    -

    Method new()

    -

    Initialize SEFilterStates object.

    -

    Usage

    -

    SEFilterStates$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize SEFilterStates object.

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$new(
       data,
       data_reactive = function(sid = "") NULL,
       dataname,
       datalabel = NULL
    -)

    +)
    +

    +
    -

    Arguments

    -

    data
    +

    Arguments +

    +

    +
    +
    +
    data

    (SummarizedExperiment) the R object which subset function is applied on.

    @@ -144,92 +187,161 @@

    Arguments
    -

    Method set_filter_state()

    -

    Set filter state.

    -

    Usage

    -

    SEFilterStates$set_filter_state(state)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Set filter state.

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$set_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices) teal_slice objects should contain the field arg %in% c("subset", "select")

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method ui_add()

    -

    shiny UI module to add filter variable.

    -

    Usage

    -

    SEFilterStates$ui_add(id)

    +
    +

    +
    +
    +

    Method ui_add() +

    +

    shiny UI module to add filter variable.

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$ui_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_add()

    +
    +

    +
    +
    +

    Method srv_add() +

    shiny server module to add filter variable.

    Module controls available choices to select as a filter variable. Selected filter variable is being removed from available choices. Removed filter variable gets back to available choices. This module unlike other FilterStates classes manages two sets of filter variables - one for colData and another for -rowData.

    -

    Usage

    -

    SEFilterStates$srv_add(id)

    +rowData.

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$srv_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    SEFilterStates$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -237,17 +349,19 @@

    Arguments

    + +
    + +
    - - + + diff --git a/release-candidate/reference/calls_combine_by.html b/release-candidate/reference/calls_combine_by.html index 65b87d277..692c31fa1 100644 --- a/release-candidate/reference/calls_combine_by.html +++ b/release-candidate/reference/calls_combine_by.html @@ -1,8 +1,24 @@ - -Compose predicates — calls_combine_by • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +

    @@ -83,13 +105,16 @@
    -

    Usage

    +

    Usage +

    calls_combine_by(calls, operator)
    -

    Arguments

    -
    calls
    +

    Arguments +

    +
    +
    calls

    (list) containing calls (or symbols) to be combined by operator

    @@ -98,21 +123,25 @@

    Arguments

    -

    + +
    -

    Value

    +

    Value +

    A call where elements of calls are composed with operator or NULL if calls is an empty list.

    -

    Details

    +

    Details +

    This function is used to combine logical predicates produced by FilterState objects to build a complete subset expression.

    -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     calls_combine_by <- getFromNamespace("calls_combine_by", "teal.slice")
     
    @@ -127,17 +156,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/release-candidate/reference/check_simple_name.html b/release-candidate/reference/check_simple_name.html index 07a32394b..68ee98b31 100644 --- a/release-candidate/reference/check_simple_name.html +++ b/release-candidate/reference/check_simple_name.html @@ -1,14 +1,30 @@ - - + + + + + +Test whether variable name can be used within Show R Code — check_simple_name • teal.slice +Test whether variable name can be used within Show R Code — check_simple_name • teal.slice + + + + + + + + + + Skip to contents @@ -24,7 +40,8 @@ + +
    @@ -92,35 +115,42 @@
    -

    Usage

    +

    Usage +

    check_simple_name(name)
    -

    Arguments

    -
    name
    +

    Arguments +

    +
    +
    name

    (character) vector of names to check

    -
    + +
    -

    Value

    +

    Value +

    Returns NULL or raises error.

    + +
    + +
    - - + + diff --git a/release-candidate/reference/choices_labeled.html b/release-candidate/reference/choices_labeled.html index 08bb980b8..0dc4ec4d3 100644 --- a/release-candidate/reference/choices_labeled.html +++ b/release-candidate/reference/choices_labeled.html @@ -1,10 +1,26 @@ - -Set "<choice>:<label>" type of names — choices_labeled • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + +
    @@ -86,13 +108,16 @@
    -

    Usage

    +

    Usage +

    choices_labeled(choices, labels, subset = NULL, types = NULL)
    -

    Arguments

    -
    choices
    +

    Arguments +

    +
    +
    choices

    (character or numeric or logical) vector

    @@ -110,31 +135,36 @@

    Arguments -

    Value

    +

    Value +

    A named character vector.

    -

    Details

    +

    Details +

    If either choices or labels are factors, they are coerced to character. Duplicated elements from choices get removed.

    + +
    + +
    - - + + diff --git a/release-candidate/reference/coalesce_r.html b/release-candidate/reference/coalesce_r.html index 100dd18d9..3af1e6887 100644 --- a/release-candidate/reference/coalesce_r.html +++ b/release-candidate/reference/coalesce_r.html @@ -1,8 +1,24 @@ - -Recursively coalesce list elements. — coalesce_r • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,24 +105,30 @@
    -

    Usage

    +

    Usage +

    coalesce_r(x)
    -

    Arguments

    -
    x
    +

    Arguments +

    +
    +
    x

    (list), either of atomic vectors or of named lists

    -
    + +
    -

    Value

    +

    Value +

    Either an atomic vector of length 1 or a (potentially nested) list.

    -

    Details

    +

    Details +

    Given a list of atomic vectors, the first non-null element is returned. Given a list of lists, for all names found in all elements of the list the first non-null element of a given name is returned.

    @@ -108,17 +136,19 @@

    Details

    + +
    + +
    - - + + diff --git a/release-candidate/reference/countBar.html b/release-candidate/reference/countBar.html index 64d821d2c..5e9c0487e 100644 --- a/release-candidate/reference/countBar.html +++ b/release-candidate/reference/countBar.html @@ -1,8 +1,24 @@ - -Progress bar with label — countBar • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,7 +105,8 @@
    -

    Usage

    +

    Usage +

    countBar(inputId, label, countmax, countnow = NULL, counttotal = countmax)
     
     updateCountBar(
    @@ -105,8 +128,10 @@ 

    Usage

    -

    Arguments

    -
    inputId
    +

    Arguments +

    +
    +
    inputId

    (character(1)) shiny id of the parent element (e.g. a check-box group input).

    @@ -129,32 +154,40 @@

    Arguments -

    Value

    +

    Value +

    shiny.tag object with a progress bar and a label.

    -

    Details

    -

    A progress bar is created to visualize the number of counts in a variable, with filling and a text label.

    • progress bar width is derived as a fraction of the container width: style = "width: <countmax> / <counttotal>%",

    • +

      Details +

      +

      A progress bar is created to visualize the number of counts in a variable, with filling and a text label.

      +
        +
      • progress bar width is derived as a fraction of the container width: style = "width: <countmax> / <counttotal>%",

      • progress bar is filled up to the fraction <countnow> / <countmax>,

      • text label is obtained by <label> (<countnow> / <countmax>).

      • -
    + +
    + +
    + +
    - - + + diff --git a/release-candidate/reference/countBars.html b/release-candidate/reference/countBars.html index 9a9ab86c1..0fc83c820 100644 --- a/release-candidate/reference/countBars.html +++ b/release-candidate/reference/countBars.html @@ -1,8 +1,24 @@ - -Progress bars with labels — countBars • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,7 +105,8 @@
    -

    Usage

    +

    Usage +

    countBars(inputId, choices, countsmax, countsnow = NULL)
     
     updateCountBars(
    @@ -96,8 +119,10 @@ 

    Usage

    -

    Arguments

    -
    inputId
    +

    Arguments +

    +
    +
    inputId

    (character(1)) shiny id of the parent element (e.g. a check-box group input).

    @@ -116,9 +141,11 @@

    Arguments -

    Value

    +

    Value +

    List of shiny.tags.

    @@ -138,7 +165,8 @@

    Value

    -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     include_js_files <- getFromNamespace("include_js_files", "teal.slice")
     include_css_files <- getFromNamespace("include_css_files", "teal.slice")
    @@ -190,17 +218,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/release-candidate/reference/data_choices_labeled.html b/release-candidate/reference/data_choices_labeled.html index c8b28de43..5ee5c15f3 100644 --- a/release-candidate/reference/data_choices_labeled.html +++ b/release-candidate/reference/data_choices_labeled.html @@ -1,8 +1,24 @@ - -Returns a choices_labeled object — data_choices_labeled • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,7 +105,8 @@
    -

    Usage

    +

    Usage +

    data_choices_labeled(
       data,
       choices,
    @@ -93,8 +116,10 @@ 

    Usage

    -

    Arguments

    -
    data
    +

    Arguments +

    +
    +
    data

    (data.frame or DFrame or list) where labels can be taken from in case when varlabels is not specified. data must be specified if varlabels is not specified.

    @@ -114,26 +139,30 @@

    Arguments -

    Value

    +

    Value +

    character(0) if choices are empty; a choices_labeled object otherwise

    + +
    + +
    - - + + diff --git a/release-candidate/reference/dot-table.html b/release-candidate/reference/dot-table.html index 1c69f977b..a2891a07b 100644 --- a/release-candidate/reference/dot-table.html +++ b/release-candidate/reference/dot-table.html @@ -1,8 +1,24 @@ - -table handling POSIXlt — .table • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,35 +107,42 @@
    -

    Usage

    +

    Usage +

    .table(x)
    -

    Arguments

    -
    x
    +

    Arguments +

    +
    +
    x

    (vector) variable to get counts from.

    -
    + +
    -

    Value

    +

    Value +

    vector of counts named by unique values of x.

    + +
    + + - - + + diff --git a/release-candidate/reference/eval_expr_with_msg.html b/release-candidate/reference/eval_expr_with_msg.html index ef4d0af0d..2b8f47f10 100644 --- a/release-candidate/reference/eval_expr_with_msg.html +++ b/release-candidate/reference/eval_expr_with_msg.html @@ -1,12 +1,28 @@ - - + + + + + +Evaluate expression with meaningful message — eval_expr_with_msg • teal.slice +Evaluate expression with meaningful message — eval_expr_with_msg • teal.slice + + + + + + + + + + Skip to contents @@ -22,7 +38,8 @@ + + @@ -89,39 +111,46 @@
    -

    Usage

    +

    Usage +

    eval_expr_with_msg(expr, env)
    -

    Arguments

    -
    expr
    +

    Arguments +

    +
    +
    expr

    (language)

    env

    (environment) where expression is evaluated.

    -
    + +
    -

    Value

    +

    Value +

    NULL, invisibly.

    + + + + - - + + diff --git a/release-candidate/reference/fetch_bs_color.html b/release-candidate/reference/fetch_bs_color.html index 8911cbc5c..e07252870 100644 --- a/release-candidate/reference/fetch_bs_color.html +++ b/release-candidate/reference/fetch_bs_color.html @@ -1,8 +1,24 @@ - -Get hex code of the current Bootstrap theme color. — fetch_bs_color • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -83,13 +105,16 @@
    -

    Usage

    +

    Usage +

    fetch_bs_color(color, alpha = NULL)
    -

    Arguments

    -
    color
    +

    Arguments +

    +
    +
    color

    (character(1)) naming one of the available theme colors

    @@ -98,16 +123,19 @@

    Arguments -

    Value

    +

    Value +

    Named character(1) containing a hexadecimal color representation.

    -

    Examples

    +

    Examples +

    fetch_bs_color <- getFromNamespace("fetch_bs_color", "teal.slice")
     fetch_bs_color("primary")
     #> [1] "#0d6efd"
    @@ -119,17 +147,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/release-candidate/reference/filter_state_api.html b/release-candidate/reference/filter_state_api.html index 377d718a1..6ae3e54ee 100644 --- a/release-candidate/reference/filter_state_api.html +++ b/release-candidate/reference/filter_state_api.html @@ -1,10 +1,26 @@ - -Managing FilteredData states — filter_state_api • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + @@ -86,7 +108,8 @@
    -

    Usage

    +

    Usage +

    set_filter_state(datasets, filter)
     
     get_filter_state(datasets)
    @@ -97,11 +120,15 @@ 

    Usage

    -

    Arguments

    -
    datasets
    -

    (FilteredData) +

    Arguments +

    +
    +
    datasets
    +
    +

    (FilteredData) object to store filter state and filtered datasets, shared across modules

    -

    see FilteredData for details

    +

    see FilteredData for details

    +
    filter
    @@ -113,22 +140,28 @@

    Arguments -

    Value

    +

    Value +

    -
    • set_*, remove_* and clear_filter_state return NULL invisibly

    • +
        +
      • set_*, remove_* and clear_filter_state return NULL invisibly

      • get_filter_state returns a named teal_slices object containing a teal_slice for every existing FilterState

      • -
    + +
    -

    See also

    +

    See also +

    -

    Examples

    +

    Examples +

    datasets <- init_filtered_data(list(iris = iris, mtcars = mtcars))
     fs <- teal_slices(
       teal_slice(dataname = "iris", varname = "Species", selected = c("setosa", "versicolor")),
    @@ -271,17 +304,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/release-candidate/reference/format_time.html b/release-candidate/reference/format_time.html index c948a2431..86a8744c8 100644 --- a/release-candidate/reference/format_time.html +++ b/release-candidate/reference/format_time.html @@ -1,8 +1,24 @@ - -Format POSIXt for storage — format_time • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -83,40 +105,48 @@
    -

    Usage

    +

    Usage +

    format_time(x)
    -

    Arguments

    -
    x
    +

    Arguments +

    +
    +
    x

    (POSIXt) vector of date time values or anything else

    -
    + +
    -

    Value

    +

    Value +

    If x is of class POSIXt, a character vector, otherwise x itself.

    -

    Details

    +

    Details +

    Date times are stored as string representations expressed in the UTC time zone. The storage format is YYYY-MM-DD HH:MM:SS.

    + + + + - - + + diff --git a/release-candidate/reference/get_default_slice_id.html b/release-candidate/reference/get_default_slice_id.html index a06a0a524..855a27f1c 100644 --- a/release-candidate/reference/get_default_slice_id.html +++ b/release-candidate/reference/get_default_slice_id.html @@ -1,8 +1,24 @@ - -Default teal_slice id — get_default_slice_id • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -83,48 +105,59 @@
    -

    Usage

    +

    Usage +

    get_default_slice_id(x)
    -

    Arguments

    -
    x
    +

    Arguments +

    +
    +
    x

    (teal_slice or list)

    -
    + +
    -

    Value

    +

    Value +

    (character(1)) id for a teal_slice object.

    -

    Details

    +

    Details +

    Function returns a default id for a teal_slice object which needs to be distinct from other teal_slice objects created for any FilterStates object. Returned id can be treated as a location of -a vector on which FilterState is built:

    • for a data.frame id concatenates dataname and varname.

    • +a vector on which FilterState is built:

      +
        +
      • for a data.frame id concatenates dataname and varname.

      • for a MultiAssayExperiment id concatenates dataname, varname, experiment and arg, so that one can add teal_slice for a varname which exists in multiple SummarizedExperiments or exists in both colData and rowData of given experiment. For such a vector teal.slice doesn't allow to activate more than one filters. In case of teal_slice_expr id is mandatory and must be unique.

      • -
    + + + + + + - - + + diff --git a/release-candidate/reference/get_filter_expr.html b/release-candidate/reference/get_filter_expr.html index 3ecb0168d..cbc3af0fd 100644 --- a/release-candidate/reference/get_filter_expr.html +++ b/release-candidate/reference/get_filter_expr.html @@ -1,10 +1,26 @@ - -Gets filter expression for multiple datanames taking into account its order. — get_filter_expr • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + @@ -86,39 +108,46 @@
    -

    Usage

    +

    Usage +

    get_filter_expr(datasets, datanames = datasets$datanames())
    -

    Arguments

    -
    datasets
    +

    Arguments +

    +
    +
    datasets

    (FilteredData)

    datanames

    (character) vector of dataset names

    -
    + +
    -

    Value

    +

    Value +

    A character string containing all subset expressions.

    + + + + - - + + diff --git a/release-candidate/reference/get_supported_filter_varnames.html b/release-candidate/reference/get_supported_filter_varnames.html index a0d5387b3..6c1cf1f32 100644 --- a/release-candidate/reference/get_supported_filter_varnames.html +++ b/release-candidate/reference/get_supported_filter_varnames.html @@ -1,10 +1,26 @@ - -Gets supported filterable variable names — get_supported_filter_varnames • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + @@ -86,25 +108,31 @@
    -

    Usage

    +

    Usage +

    get_supported_filter_varnames(data)
    -

    Arguments

    -
    data
    +

    Arguments +

    +
    +
    data

    the R object containing elements which class can be checked through vapply or apply.

    -
    + +
    -

    Value

    +

    Value +

    character vector of variable names.

    -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     get_supported_filter_varnames <- getFromNamespace("get_supported_filter_varnames", "teal.slice")
     
    @@ -120,17 +148,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/release-candidate/reference/include_css_files.html b/release-candidate/reference/include_css_files.html index f2bcc017b..3472b06fe 100644 --- a/release-candidate/reference/include_css_files.html +++ b/release-candidate/reference/include_css_files.html @@ -1,12 +1,28 @@ - - + + + + + +Include CSS files from /inst/css/ package directory to application header — include_css_files • teal.slice +Include CSS files from /inst/css/ package directory to application header — include_css_files • teal.slice + + + + + + + + + + Skip to contents @@ -22,7 +38,8 @@ + + @@ -89,35 +111,42 @@
    -

    Usage

    +

    Usage +

    include_css_files(pattern = "*")
    -

    Arguments

    -
    pattern
    +

    Arguments +

    +
    +
    pattern

    (character) pattern of files to be included

    -
    + +
    -

    Value

    +

    Value +

    HTML code that includes CSS files

    + + + + - - + + diff --git a/release-candidate/reference/include_js_files.html b/release-candidate/reference/include_js_files.html index 3013e1169..5aa882445 100644 --- a/release-candidate/reference/include_js_files.html +++ b/release-candidate/reference/include_js_files.html @@ -1,12 +1,28 @@ - - + + + + + +Include JS files from /inst/js/ package directory to application header — include_js_files • teal.slice +Include JS files from /inst/js/ package directory to application header — include_js_files • teal.slice + + + + + + + + + + Skip to contents @@ -22,7 +38,8 @@ + + @@ -89,35 +111,42 @@
    -

    Usage

    +

    Usage +

    include_js_files(pattern)
    -

    Arguments

    -
    pattern
    +

    Arguments +

    +
    +
    pattern

    (character) pattern of files to be included, passed to system.file

    -
    + +
    -

    Value

    +

    Value +

    HTML code that includes JS files

    + + + + - - + + diff --git a/release-candidate/reference/index.html b/release-candidate/reference/index.html index e753fa1f3..daa1c4f4c 100644 --- a/release-candidate/reference/index.html +++ b/release-candidate/reference/index.html @@ -1,8 +1,22 @@ - -Function reference • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -77,96 +97,129 @@
    -

    teal filter-panel API

    +

    +teal filter-panel API +

    Functions used initialize filter-panel and to modify its states.

    -
    +
    +
    -
    +
    +
    init_filtered_data()
    -
    Initialize FilteredData
    -
    +
    Initialize FilteredData +
    +
    +
    +
    set_filter_state() get_filter_state() remove_filter_state() clear_filter_states()
    Managing FilteredData states
    -
    +
    +
    +
    get_filter_expr()
    Gets filter expression for multiple datanames taking into account its order.
    -
    +
    +
    +
    teal_slice()
    Specify single filter
    -
    +
    +
    +
    teal_slices()
    Complete filter specification
    -
    -

    For developers

    + +
    +
    +

    For developers +

    Abstract and concrete classes used to build teal functionality.

    -
    +
    +
    -

    R6 Classes

    +

    R6 Classes +

    Abstract and concrete classes used to build teal functionality.

    -
    +
    +
    -
    +
    +
    FilteredData
    Class to encapsulate filtered datasets
    -
    +
    +
    +
    FilteredDataset
    -
    FilteredDataset R6 class
    -
    +
    +FilteredDataset R6 class
    +
    +
    +
    FilterPanelAPI
    Class to encapsulate the API of the filter panel of a teal app
    -
    +
    +
    +
    DataframeFilteredDataset
    The DataframeFilteredDataset R6 class
    -
    +
    +
    +
    MAEFilteredDataset
    -
    MAEFilteredDataset R6 class
    -
    +
    +MAEFilteredDataset R6 class
    + + + + + + - - + + diff --git a/release-candidate/reference/init_filter_state.html b/release-candidate/reference/init_filter_state.html index e60ece6fc..1e536bc6b 100644 --- a/release-candidate/reference/init_filter_state.html +++ b/release-candidate/reference/init_filter_state.html @@ -1,8 +1,24 @@ - -Initialize FilterState — init_filter_state • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,7 +106,8 @@
    -

    Usage

    +

    Usage +

    init_filter_state(
       x,
       x_reactive = reactive(NULL),
    @@ -93,8 +117,10 @@ 

    Usage

    + +
    -

    Value

    +

    Value +

    FilterState object

    -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     init_filter_state <- getFromNamespace("init_filter_state", "teal.slice")
     
    @@ -172,17 +205,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/release-candidate/reference/init_filter_state_expr.html b/release-candidate/reference/init_filter_state_expr.html index e922a4357..ef4524df9 100644 --- a/release-candidate/reference/init_filter_state_expr.html +++ b/release-candidate/reference/init_filter_state_expr.html @@ -1,8 +1,24 @@ - -Initialize a FilterStateExpr object — init_filter_state_expr • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -83,36 +105,43 @@
    -

    Usage

    +

    Usage +

    init_filter_state_expr(slice)
    -

    Arguments

    -
    slice
    +

    Arguments +

    +
    +
    slice

    (teal_slice_expr) specifying this filter state.

    -
    + +
    -

    Value

    +

    Value +

    FilterStateExpr object

    + + + + - - + + diff --git a/release-candidate/reference/init_filter_states.html b/release-candidate/reference/init_filter_states.html index e039d1e65..2d0a2b1bc 100644 --- a/release-candidate/reference/init_filter_states.html +++ b/release-candidate/reference/init_filter_states.html @@ -1,8 +1,24 @@ - -Initialize FilterStates object — init_filter_states • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -83,7 +105,8 @@
    -

    Usage

    +

    Usage +

    init_filter_states(
       data,
       data_reactive = reactive(NULL),
    @@ -94,8 +117,10 @@ 

    Usage

    -

    Arguments

    -
    data
    +

    Arguments +

    +
    +
    data

    (data.frame or MultiAssayExperiment or SummarizedExperiment or matrix) object to subset.

    @@ -123,16 +148,19 @@

    Arguments -

    Value

    +

    Value +

    Object of class FilterStates.

    -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     init_filter_states <- getFromNamespace("init_filter_states", "teal.slice")
     
    @@ -171,17 +199,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/release-candidate/reference/init_filtered_data.html b/release-candidate/reference/init_filtered_data.html index 86ecbae25..376b5c200 100644 --- a/release-candidate/reference/init_filtered_data.html +++ b/release-candidate/reference/init_filtered_data.html @@ -1,8 +1,24 @@ - -Initialize FilteredData — init_filtered_data • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,13 +106,16 @@
    -

    Usage

    +

    Usage +

    init_filtered_data(x, join_keys = teal.data::join_keys(), code, check)
    -

    Arguments

    -
    x
    +

    Arguments +

    +
    +
    x

    (named list) of datasets.

    @@ -104,16 +130,19 @@

    Arguments[Deprecated]

    -

    + +
    -

    Value

    +

    Value +

    Object of class FilteredData.

    -

    Examples

    +

    Examples +

    datasets <- init_filtered_data(list(iris = iris, mtcars = mtcars))
     datasets
     #> FilteredData:
    @@ -132,17 +161,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/release-candidate/reference/init_filtered_dataset.html b/release-candidate/reference/init_filtered_dataset.html index bfa701847..47cccbbfc 100644 --- a/release-candidate/reference/init_filtered_dataset.html +++ b/release-candidate/reference/init_filtered_dataset.html @@ -1,8 +1,24 @@ - -Initialize FilteredDataset — init_filtered_dataset • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,7 +106,8 @@
    -

    Usage

    +

    Usage +

    init_filtered_dataset(
       dataset,
       dataname,
    @@ -96,8 +120,10 @@ 

    Usage

    -

    Arguments

    -
    dataset
    +

    Arguments +

    +
    +
    dataset

    any object

    @@ -133,15 +159,18 @@

    Arguments -

    Value

    +

    Value +

    Object of class FilteredDataset.

    -

    Warning

    +

    Warning +

    This function is exported to allow other packages to extend teal.slice but it is treated as internal. @@ -150,7 +179,8 @@

    Warning
    -

    Examples

    +

    Examples +

    # DataframeFilteredDataset example
     library(shiny)
     
    @@ -206,17 +236,19 @@ 

    Examples

    + +

    + +
    - - + + diff --git a/release-candidate/reference/jsonify.html b/release-candidate/reference/jsonify.html index 92a7010d1..5cb32b26b 100644 --- a/release-candidate/reference/jsonify.html +++ b/release-candidate/reference/jsonify.html @@ -1,12 +1,28 @@ - - + + + + + +Convert a list to a justified JSON string — jsonify • teal.slice +Convert a list to a justified JSON string — jsonify • teal.slice + + + + + + + + + + Skip to contents @@ -22,7 +38,8 @@ + +
    @@ -89,39 +111,46 @@
    -

    Usage

    +

    Usage +

    jsonify(x, trim_lines)
    -

    Arguments

    -
    x
    +

    Arguments +

    +
    +
    x

    (list), possibly recursive, obtained from teal_slice or teal_slices.

    trim_lines

    (logical(1)) flag specifying whether to trim lines of the JSON string.

    -
    + +
    -

    Value

    +

    Value +

    A JSON string representation of the input list.

    + + + + - - + + diff --git a/release-candidate/reference/justify_json.html b/release-candidate/reference/justify_json.html index c4f6b1f09..d3b21bb06 100644 --- a/release-candidate/reference/justify_json.html +++ b/release-candidate/reference/justify_json.html @@ -1,10 +1,26 @@ - -Justify colons in JSON string — justify_json • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + @@ -86,35 +108,42 @@
    -

    Usage

    +

    Usage +

    justify_json(json)
    -

    Arguments

    -
    json
    +

    Arguments +

    +
    +
    json

    (character(1)) a JSON string.

    -
    + +
    -

    Value

    +

    Value +

    A list of character strings, which can be collapsed into a JSON string.

    + + + + - - + + diff --git a/release-candidate/reference/make_c_call.html b/release-candidate/reference/make_c_call.html index a0fffd855..75bccd7aa 100644 --- a/release-candidate/reference/make_c_call.html +++ b/release-candidate/reference/make_c_call.html @@ -1,10 +1,26 @@ - -Build concatenating call — make_c_call • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + @@ -86,25 +108,31 @@
    -

    Usage

    +

    Usage +

    make_c_call(choices)
    -

    Arguments

    -
    choices
    +

    Arguments +

    +
    +
    choices

    A vector of values.

    -
    + +
    -

    Value

    +

    Value +

    A c call.

    -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     make_c_call <- getFromNamespace("make_c_call", "teal.slice")
     make_c_call(1:3)
    @@ -115,17 +143,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/release-candidate/reference/make_count_text.html b/release-candidate/reference/make_count_text.html index d5a3d5ed4..c1ba190af 100644 --- a/release-candidate/reference/make_count_text.html +++ b/release-candidate/reference/make_count_text.html @@ -1,16 +1,32 @@ - - + + + + + +Build count text — make_count_text • teal.slice +Build count text — make_count_text • teal.slice + + + + + + + + + + Skip to contents @@ -26,7 +42,8 @@ + + @@ -87,18 +109,24 @@
    -

    Returns a text label describing filtered counts. The text is composed in the following way:

    • when countnow is not NULL: <label> (<countnow>/<countmax>)

    • +

      Returns a text label describing filtered counts. The text is composed in the following way:

      +
        +
      • when countnow is not NULL: <label> (<countnow>/<countmax>)

      • when countnow is NULL: <label> (<countmax>)

      • -
    + +
    -

    Usage

    +

    Usage +

    make_count_text(label, countmax, countnow = NULL)
    -

    Arguments

    -
    label
    +

    Arguments +

    +
    +
    label

    (character(1)) Text displayed before counts.

    @@ -109,26 +137,30 @@

    Arguments -

    Value

    +

    Value +

    A character string.

    + + + + - - + + diff --git a/release-candidate/reference/setdiff_teal_slices.html b/release-candidate/reference/setdiff_teal_slices.html index 0b2ac76cb..75aa55a8e 100644 --- a/release-candidate/reference/setdiff_teal_slices.html +++ b/release-candidate/reference/setdiff_teal_slices.html @@ -1,8 +1,24 @@ - -setdiff method for teal_slices — setdiff_teal_slices • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,18 +107,23 @@
    -

    Usage

    +

    Usage +

    setdiff_teal_slices(x, y)
    -

    Arguments

    -
    x, y
    +

    Arguments +

    +
    +
    x, y

    (teal_slices)

    -
    + +
    -

    Value

    +

    Value +

    teal_slices

    @@ -103,17 +132,19 @@

    Value

    + + + + - - + + diff --git a/release-candidate/reference/teal.slice-package.html b/release-candidate/reference/teal.slice-package.html index 3d179bedc..7d6de92e8 100644 --- a/release-candidate/reference/teal.slice-package.html +++ b/release-candidate/reference/teal.slice-package.html @@ -1,8 +1,24 @@ - -teal.slice: Interactive Exploration of Clinical Trials Data — teal.slice-package • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,16 +107,24 @@
    -

    Author

    +

    Author +

    Maintainer: Dawid Kaledkowski dawid.kaledkowski@roche.com (ORCID)

    -

    Authors:

    + +
    + + + + - - + + diff --git a/release-candidate/reference/teal_slice-utilities.html b/release-candidate/reference/teal_slice-utilities.html index 15eea9cc1..be6471f8c 100644 --- a/release-candidate/reference/teal_slice-utilities.html +++ b/release-candidate/reference/teal_slice-utilities.html @@ -1,8 +1,24 @@ - -teal_slice utility functions — teal_slice-utilities • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,7 +106,8 @@
    -

    Usage

    +

    Usage +

    is.teal_slice(x)
     
     as.teal_slice(x)
    @@ -99,8 +123,10 @@ 

    Usage

    -

    Arguments

    -
    x
    +

    Arguments +

    +
    +
    x

    (teal.slice)

    @@ -116,10 +142,12 @@

    Arguments -

    Examples

    +

    Examples +

    x1 <- teal_slice(
       dataname = "data",
       id = "Female adults",
    @@ -196,17 +224,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/release-candidate/reference/teal_slice.html b/release-candidate/reference/teal_slice.html index 333f9c1cb..26d9018d3 100644 --- a/release-candidate/reference/teal_slice.html +++ b/release-candidate/reference/teal_slice.html @@ -1,10 +1,26 @@ - -Specify single filter — teal_slice • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + @@ -86,7 +108,8 @@
    -

    Usage

    +

    Usage +

    teal_slice(
       dataname,
       varname,
    @@ -105,8 +128,10 @@ 

    Usage

    -

    Arguments

    -
    dataname
    +

    Arguments +

    +
    +
    dataname

    (character(1)) name of data set

    @@ -165,16 +190,19 @@

    Arguments -

    Value

    +

    Value +

    A teal.slice object. Depending on whether varname or expr was specified, the resulting teal_slice also receives class teal_slice_var or teal_slice_expr, respectively.

    -

    Details

    +

    Details +

    teal_slice object fully describes filter state and can be used to create, modify, and delete a filter state. A teal_slice contains a number of common fields (all named arguments of teal_slice), some of which are mandatory, but only @@ -183,7 +211,9 @@

    DetailsSetting any of the other values to NULL means that those properties will not be modified (when setting an existing state) or that they will be determined by data (when creating new a new one). Entire object is FilterState class member and can be accessed with FilterState$get_state().

    -

    A teal_slice can come in two flavors:

    1. teal_slice_var - +

      A teal_slice can come in two flavors:

      +
        +
      1. teal_slice_var - this describes a typical interactive filter that refers to a single variable, managed by the FilterState class. This class is created when varname is specified. The object retains all fields specified in the call. id can be created by default and need not be specified.

      2. @@ -193,7 +223,8 @@

        Detailsexpr is specified. dataname and anchored are retained, fixed is set to TRUE, id becomes mandatory, title remains optional, while other arguments are disregarded.

        -

      A teal_slice can be passed FilterState/FilterStateExpr constructors to instantiate an object. +

    +

    A teal_slice can be passed FilterState/FilterStateExpr constructors to instantiate an object. It can also be passed to FilterState$set_state to modify the state. However, once a FilterState is created, only the mutable features can be set with a teal_slice: selected, keep_na and keep_inf.

    @@ -205,11 +236,13 @@

    DetailsFilterState instantiated with anchored = TRUE cannot be removed.

    -

    Note

    +

    Note +

    Date time objects of POSIX*t classes are printed as strings after converting to UTC timezone.

    -

    Filters in SumarizedExperiment and MultiAssayExperiment objects

    +

    Filters in SumarizedExperiment and MultiAssayExperiment objects +

    @@ -223,13 +256,15 @@

    Filters in order to determine whether the filter refers to the SE's rowData or colData.

    -

    Examples

    +

    Examples +

    x1 <- teal_slice(
       dataname = "data",
       id = "Female adults",
    @@ -306,17 +341,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/release-candidate/reference/teal_slices-utilities.html b/release-candidate/reference/teal_slices-utilities.html index 0aea97630..d2478cac7 100644 --- a/release-candidate/reference/teal_slices-utilities.html +++ b/release-candidate/reference/teal_slices-utilities.html @@ -1,8 +1,24 @@ - -teal_slices utility functions — teal_slices-utilities • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,7 +106,8 @@
    -

    Usage

    +

    Usage +

    is.teal_slices(x)
     
     as.teal_slices(x)
    @@ -105,8 +129,10 @@ 

    Usage

    -

    Arguments

    -
    x
    +

    Arguments +

    +
    +
    x

    object to test for teal_slices, object to convert to teal_slices or a teal_slices object

    @@ -129,10 +155,12 @@

    Arguments -

    Examples

    +

    Examples +

    filter_1 <- teal_slice(
       dataname = "dataname1",
       varname = "varname1",
    @@ -345,17 +373,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/release-candidate/reference/teal_slices.html b/release-candidate/reference/teal_slices.html index 74f3eb340..3e0350dce 100644 --- a/release-candidate/reference/teal_slices.html +++ b/release-candidate/reference/teal_slices.html @@ -1,10 +1,26 @@ - -Complete filter specification — teal_slices • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + @@ -86,7 +108,8 @@
    -

    Usage

    +

    Usage +

    teal_slices(
       ...,
       exclude_varnames = NULL,
    @@ -97,8 +120,10 @@ 

    Usage

    -

    Arguments

    -
    ...
    +

    Arguments +

    +
    +
    ...

    any number of teal_slice objects.

    @@ -109,29 +134,36 @@

    Arguments[Experimental] +
    +

    [Experimental] This is a new feature. Do kindly share your opinions on teal.slice's GitHub repository.

    (character(1)) string specifying how observations are tallied by these filter states. -Possible options:

    • "none" (default) to have counts of single FilterState to show unfiltered number only.

    • +Possible options:

      +
        +
      • "none" (default) to have counts of single FilterState to show unfiltered number only.

      • "all" to have counts of single FilterState to show number of observation in filtered and unfiltered dataset. Note, that issues were reported when using this option with MultiAssayExperiment. Please make sure that adding new filters doesn't fail on target platform before deploying for production.

      • -
    + +
    allow_add

    (logical(1)) logical flag specifying whether the user will be able to add new filters

    -

    + +
    -

    Value

    +

    Value +

    teal_slices, which is an unnamed list of teal_slice objects.

    -

    Details

    +

    Details +

    teal_slices() collates multiple teal_slice objects into a teal_slices object, a complete filter specification. This is used by all classes above FilterState as well as filter_panel_api wrapper functions. @@ -142,17 +174,21 @@

    Detailsteal_slices.

    -

    See also

    +

    See also +

    -
    + +
    -

    Examples

    +

    Examples +

    filter_1 <- teal_slice(
       dataname = "dataname1",
       varname = "varname1",
    @@ -365,17 +401,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/release-candidate/reference/to_json.html b/release-candidate/reference/to_json.html index 766da7489..d77cc5611 100644 --- a/release-candidate/reference/to_json.html +++ b/release-candidate/reference/to_json.html @@ -1,12 +1,28 @@ - - + + + + + +Converts a list to a JSON string — to_json • teal.slice +Converts a list to a JSON string — to_json • teal.slice + + + + + + + + + + Skip to contents @@ -22,7 +38,8 @@ + + @@ -89,35 +111,42 @@
    -

    Usage

    +

    Usage +

    to_json(x)
    -

    Arguments

    -
    x
    +

    Arguments +

    +
    +
    x

    (list) representation of teal_slices object.

    -
    + +
    -

    Value

    +

    Value +

    A JSON string.

    + + + + - - + + diff --git a/release-candidate/reference/toggle_button.html b/release-candidate/reference/toggle_button.html index f87ce85e7..4a1b70d4e 100644 --- a/release-candidate/reference/toggle_button.html +++ b/release-candidate/reference/toggle_button.html @@ -1,8 +1,24 @@ - -Toggle button properties. — toggle_button • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -83,15 +105,18 @@
    -

    Usage

    +

    Usage +

    toggle_icon(input_id, icons, one_way = FALSE)
     
     toggle_title(input_id, titles, one_way = FALSE)
    -

    Arguments

    -
    input_id
    +

    Arguments +

    +
    +
    input_id

    (character(1)) (name-spaced) id of the button

    @@ -104,15 +129,18 @@

    Arguments -

    Value

    +

    Value +

    NULL, invisibly.

    -

    Details

    +

    Details +

    Wrapper functions that use shinyjs::runjs to change button properties in response to events, typically clicking those very buttons. shiny's actionButton and actionLink create <a> tags, @@ -123,7 +151,8 @@

    Details
    -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     toggle_icon <- getFromNamespace("toggle_icon", "teal.slice")
     
    @@ -178,17 +207,19 @@ 

    Examples

    + +

    + + - - + + diff --git a/release-candidate/reference/topological_sort.html b/release-candidate/reference/topological_sort.html index 85b576f21..76a94714b 100644 --- a/release-candidate/reference/topological_sort.html +++ b/release-candidate/reference/topological_sort.html @@ -1,10 +1,26 @@ - -Topological graph sort — topological_sort • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + @@ -86,23 +108,29 @@
    -

    Usage

    +

    Usage +

    topological_sort(graph)
    -

    Arguments

    -
    graph
    +

    Arguments +

    +
    +
    graph

    (named list) with node vector elements

    -
    + +
    -

    Details

    +

    Details +

    Implementation of Kahn algorithm with a modification to maintain the order of input elements.

    -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     topological_sort <- getFromNamespace("topological_sort", "teal.slice")
     
    @@ -148,17 +176,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/release-candidate/reference/trim_lines_json.html b/release-candidate/reference/trim_lines_json.html index 962b55ad5..b5f123b9a 100644 --- a/release-candidate/reference/trim_lines_json.html +++ b/release-candidate/reference/trim_lines_json.html @@ -1,10 +1,26 @@ - -Trim lines in JSON string — trim_lines_json • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + @@ -86,35 +108,42 @@
    -

    Usage

    +

    Usage +

    trim_lines_json(x)
    -

    Arguments

    -
    x
    +

    Arguments +

    +
    +
    x

    (character)

    -
    + +
    -

    Value

    +

    Value +

    A character string trimmed after a certain hard-coded number of characters in the value portion.

    + + + + - - + + diff --git a/release-candidate/reference/variable_types.html b/release-candidate/reference/variable_types.html index d27e6b158..05e7f0d79 100644 --- a/release-candidate/reference/variable_types.html +++ b/release-candidate/reference/variable_types.html @@ -1,8 +1,24 @@ - -Get classes of selected columns from dataset — variable_types • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -83,13 +105,16 @@
    -

    Usage

    +

    Usage +

    variable_types(data, columns = NULL)
    -

    Arguments

    -
    data
    +

    Arguments +

    +
    +
    data

    (data.frame or DataFrame or matrix) Object in which to determine variable types.

    @@ -97,16 +122,19 @@

    Arguments -

    Value

    +

    Value +

    Character vector of classes of columns from provided data.

    -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     variable_types <- getFromNamespace("variable_types", "teal.slice")
     
    @@ -142,17 +170,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/soft-dependencies@pre-release-cleanup@main/coverage-report/index.html b/soft-dependencies@pre-release-cleanup@main/coverage-report/index.html index c621a2a4f..f474cd76b 100644 --- a/soft-dependencies@pre-release-cleanup@main/coverage-report/index.html +++ b/soft-dependencies@pre-release-cleanup@main/coverage-report/index.html @@ -1,22 +1,21 @@ - - + - + - - + + - + - + - - - + + + @@ -1131,42 +1130,48 @@

    teal.slice coverage - 65.73%

    146 - 159x + 159x +
          shiny::isolate({
    147 - 159x + 159x +
            checkmate::assert(
    148 - 159x + 159x +
              is.character(x),
    149 - 159x + 159x +
              is.factor(x),
    150 - 159x + 159x +
              length(unique(x[!is.na(x)])) < getOption("teal.threshold_slider_vs_checkboxgroup"),
    151 - 159x + 159x +
              combine = "or"
    @@ -1187,28 +1192,32 @@

    teal.slice coverage - 65.73%

    154 - 159x + 159x +
            x_factor <- if (!is.factor(x)) {
    155 - 124x + 124x +
              structure(
    156 - 124x + 124x +
                factor(as.character(x), levels = as.character(sort(unique(x)))),
    157 - 124x + 124x +
                label = attr(x, "label")
    @@ -1229,7 +1238,8 @@

    teal.slice coverage - 65.73%

    160 - 35x + 35x +
              x
    @@ -1250,35 +1260,40 @@

    teal.slice coverage - 65.73%

    163 - 159x + 159x +
            super$initialize(
    164 - 159x + 159x +
              x = x_factor,
    165 - 159x + 159x +
              x_reactive = x_reactive,
    166 - 159x + 159x +
              slice = slice,
    167 - 159x + 159x +
              extract_type = extract_type
    @@ -1292,63 +1307,72 @@

    teal.slice coverage - 65.73%

    169 - 159x + 159x +
            private$set_choices(slice$choices)
    170 - 159x + 159x +
            if (is.null(slice$selected) && slice$multiple) {
    171 - 42x + 42x +
              slice$selected <- private$get_choices()
    172 - 117x + 117x +
            } else if (is.null(slice$selected)) {
    173 - 1x + 1x +
              slice$selected <- private$get_choices()[1]
    174 - 116x + 116x +
            } else if (length(slice$selected) > 1 && !slice$multiple) {
    175 - 1x + 1x +
              warning(
    176 - 1x + 1x +
                "ChoicesFilterState allows \"selected\" to be of length 1 when \"multiple\" is FALSE. ",
    177 - 1x + 1x +
                "Only the first value will be used."
    @@ -1362,7 +1386,8 @@

    teal.slice coverage - 65.73%

    179 - 1x + 1x +
              slice$selected <- slice$selected[1]
    @@ -1376,28 +1401,32 @@

    teal.slice coverage - 65.73%

    181 - 159x + 159x +
            private$set_selected(slice$selected)
    182 - 159x + 159x +
            private$data_class <- class(x)[1L]
    183 - 159x + 159x +
            if (inherits(x, "POSIXt")) {
    184 - 9x + 9x +
              private$tzone <- Find(function(x) x != "", attr(as.POSIXlt(x), "tzone"))
    @@ -1418,7 +1447,8 @@

    teal.slice coverage - 65.73%

    187 - 159x + 159x +
            private$set_choices_counts(unname(table(x_factor)))
    @@ -1432,7 +1462,8 @@

    teal.slice coverage - 65.73%

    189 - 159x + 159x +
          invisible(self)
    @@ -1516,14 +1547,16 @@

    teal.slice coverage - 65.73%

    201 - 60x + 60x +
          if (isFALSE(private$is_any_filtered())) {
    202 - 7x + 7x +
            return(NULL)
    @@ -1537,49 +1570,56 @@

    teal.slice coverage - 65.73%

    204 - 29x + 29x +
          if (missing(dataname)) dataname <- private$get_dataname()
    205 - 53x + 53x +
          varname <- private$get_varname_prefixed(dataname)
    206 - 53x + 53x +
          selected <- private$get_selected()
    207 - 53x + 53x +
          if (length(selected) == 0) {
    208 - 6x + 6x +
            choices <- private$get_choices()
    209 - 6x + 6x +
            fun_compare <- if (length(choices) == 1L) "==" else "%in%"
    210 - 6x + 6x +
            filter_call <- call("!", call(fun_compare, varname, make_c_call(as.character(choices))))
    @@ -1593,14 +1633,16 @@

    teal.slice coverage - 65.73%

    212 - 47x + 47x +
            if (setequal(na.omit(private$x), selected)) {
    213 - 3x + 3x +
              filter_call <- NULL
    @@ -1614,7 +1656,8 @@

    teal.slice coverage - 65.73%

    215 - 44x + 44x +
              fun_compare <- if (length(selected) == 1L) "==" else "%in%"
    @@ -1628,14 +1671,16 @@

    teal.slice coverage - 65.73%

    217 - 44x + 44x +
              if (private$data_class != "factor") {
    218 - 37x + 37x +
                selected <- do.call(sprintf("as.%s", private$data_class), list(x = selected))
    @@ -1656,63 +1701,72 @@

    teal.slice coverage - 65.73%

    221 - 44x + 44x +
              filter_call <-
    222 - 44x + 44x +
                if (inherits(selected, "Date")) {
    223 - 1x + 1x +
                  call(fun_compare, varname, call("as.Date", make_c_call(as.character(selected))))
    224 - 44x + 44x +
                } else if (inherits(selected, c("POSIXct", "POSIXlt"))) {
    225 - 2x + 2x +
                  class <- class(selected)[1L]
    226 - 2x + 2x +
                  date_fun <- as.name(
    227 - 2x + 2x +
                    switch(class,
    228 - 2x + 2x +
                      "POSIXct" = "as.POSIXct",
    229 - 2x + 2x +
                      "POSIXlt" = "as.POSIXlt"
    @@ -1733,28 +1787,32 @@

    teal.slice coverage - 65.73%

    232 - 2x + 2x +
                  call(
    233 - 2x + 2x +
                    fun_compare,
    234 - 2x + 2x +
                    varname,
    235 - 2x + 2x +
                    as.call(list(date_fun, make_c_call(as.character(selected)), tz = private$tzone))
    @@ -1782,7 +1840,8 @@

    teal.slice coverage - 65.73%

    239 - 41x + 41x +
                  call(fun_compare, varname, make_c_call(selected))
    @@ -1810,7 +1869,8 @@

    teal.slice coverage - 65.73%

    243 - 53x + 53x +
          private$add_keep_na_call(filter_call, varname)
    @@ -1929,14 +1989,16 @@

    teal.slice coverage - 65.73%

    260 - 159x + 159x +
          if (is.null(choices)) {
    261 - 144x + 144x +
            choices <- levels(private$x)
    @@ -1950,49 +2012,56 @@

    teal.slice coverage - 65.73%

    263 - 15x + 15x +
            choices <- as.character(choices)
    264 - 15x + 15x +
            choices_adjusted <- choices[choices %in% levels(private$x)]
    265 - 15x + 15x +
            if (length(setdiff(choices, choices_adjusted)) > 0L) {
    266 - 2x + 2x +
              warning(
    267 - 2x + 2x +
                sprintf(
    268 - 2x + 2x +
                  "Some choices not found in data. Adjusting. Filter id: %s.",
    269 - 2x + 2x +
                  private$get_id()
    @@ -2013,7 +2082,8 @@

    teal.slice coverage - 65.73%

    272 - 2x + 2x +
              choices <- choices_adjusted
    @@ -2027,35 +2097,40 @@

    teal.slice coverage - 65.73%

    274 - 15x + 15x +
            if (length(choices) == 0) {
    275 - 1x + 1x +
              warning(
    276 - 1x + 1x +
                sprintf(
    277 - 1x + 1x +
                  "None of the choices were found in data. Setting defaults. Filter id: %s.",
    278 - 1x + 1x +
                  private$get_id()
    @@ -2076,7 +2151,8 @@

    teal.slice coverage - 65.73%

    281 - 1x + 1x +
              choices <- levels(private$x)
    @@ -2097,35 +2173,40 @@

    teal.slice coverage - 65.73%

    284 - 159x + 159x +
          private$set_is_choice_limited(private$x, choices)
    285 - 159x + 159x +
          private$teal_slice$choices <- choices
    286 - 159x + 159x +
          private$x <- private$x[(private$x %in% private$get_choices()) | is.na(private$x)]
    287 - 159x + 159x +
          private$x <- droplevels(private$x)
    288 - 159x + 159x +
          invisible(NULL)
    @@ -2160,21 +2241,24 @@

    teal.slice coverage - 65.73%

    293 - 159x + 159x +
          xl <- x[!is.na(x)]
    294 - 159x + 159x +
          private$is_choice_limited <- length(setdiff(xl, choices)) > 0L
    295 - 159x + 159x +
          invisible(NULL)
    @@ -2209,14 +2293,16 @@

    teal.slice coverage - 65.73%

    300 - 159x + 159x +
          private$choices_counts <- choices_counts
    301 - 159x + 159x +
          invisible(NULL)
    @@ -2314,7 +2400,8 @@

    teal.slice coverage - 65.73%

    315 - 23x + 23x +
          length(private$get_choices()) <= getOption("teal.threshold_slider_vs_checkboxgroup")
    @@ -2335,21 +2422,24 @@

    teal.slice coverage - 65.73%

    318 - 188x + 188x +
          tryCatch(
    319 - 188x + 188x +
            expr = {
    320 - 188x + 188x +
              values <- as.character(values)
    @@ -2370,7 +2460,8 @@

    teal.slice coverage - 65.73%

    323 - 188x + 188x +
            error = function(e) stop("The vector of set values must contain values coercible to character.")
    @@ -2384,7 +2475,8 @@

    teal.slice coverage - 65.73%

    325 - 188x + 188x +
          values
    @@ -2412,28 +2504,32 @@

    teal.slice coverage - 65.73%

    329 - 188x + 188x +
          if (!private$is_multiple() && length(values) > 1) {
    330 - 1x + 1x +
            warning(
    331 - 1x + 1x +
              sprintf("Selection: %s is not a vector of length one. ", toString(values, width = 360)),
    332 - 1x + 1x +
              "Maintaining previous selection."
    @@ -2447,7 +2543,8 @@

    teal.slice coverage - 65.73%

    334 - 1x + 1x +
            values <- shiny::isolate(private$get_selected())
    @@ -2461,7 +2558,8 @@

    teal.slice coverage - 65.73%

    336 - 188x + 188x +
          values
    @@ -2482,35 +2580,40 @@

    teal.slice coverage - 65.73%

    339 - 188x + 188x +
          in_choices_mask <- values %in% private$get_choices()
    340 - 188x + 188x +
          if (length(values[!in_choices_mask]) > 0) {
    341 - 17x + 17x +
            warning(paste(
    342 - 17x + 17x +
              "Values:", toString(values[!in_choices_mask], width = 360),
    343 - 17x + 17x +
              "are not in choices of column", private$get_varname(), "in dataset", private$get_dataname(), "."
    @@ -2531,7 +2634,8 @@

    teal.slice coverage - 65.73%

    346 - 188x + 188x +
          values[in_choices_mask]
    @@ -2615,7 +2719,8 @@

    teal.slice coverage - 65.73%

    358 - 7x + 7x +
          ns <- NS(id)
    @@ -2636,21 +2741,24 @@

    teal.slice coverage - 65.73%

    361 - 7x + 7x +
          shiny::isolate({
    362 - 7x + 7x +
            countsmax <- private$choices_counts
    363 - 7x + 7x +
            countsnow <- if (!is.null(private$x_reactive())) {
    @@ -2671,7 +2779,8 @@

    teal.slice coverage - 65.73%

    366 - 7x + 7x +
              NULL
    @@ -2692,42 +2801,48 @@

    teal.slice coverage - 65.73%

    369 - 7x + 7x +
            ui_input <- if (private$is_checkboxgroup()) {
    370 - 7x + 7x +
              labels <- countBars(
    371 - 7x + 7x +
                inputId = ns("labels"),
    372 - 7x + 7x +
                choices = private$get_choices(),
    373 - 7x + 7x +
                countsnow = countsnow,
    374 - 7x + 7x +
                countsmax = countsmax
    @@ -2741,70 +2856,80 @@

    teal.slice coverage - 65.73%

    376 - 7x + 7x +
              div(
    377 - 7x + 7x +
                class = "choices_state",
    378 - 7x + 7x +
                if (private$is_multiple()) {
    379 - 7x + 7x +
                  checkboxGroupInput(
    380 - 7x + 7x +
                    inputId = ns("selection"),
    381 - 7x + 7x +
                    label = NULL,
    382 - 7x + 7x +
                    selected = private$get_selected(),
    383 - 7x + 7x +
                    choiceNames = labels,
    384 - 7x + 7x +
                    choiceValues = private$get_choices(),
    385 - 7x + 7x +
                    width = "100%"
    @@ -3035,28 +3160,32 @@

    teal.slice coverage - 65.73%

    418 - 7x + 7x +
            div(
    419 - 7x + 7x +
              uiOutput(ns("trigger_visible")),
    420 - 7x + 7x +
              ui_input,
    421 - 7x + 7x +
              private$keep_na_ui(ns("keep_na"))
    @@ -3133,28 +3262,32 @@

    teal.slice coverage - 65.73%

    432 - 7x + 7x +
          moduleServer(
    433 - 7x + 7x +
            id = id,
    434 - 7x + 7x +
            function(input, output, session) {
    435 - 7x + 7x +
              logger::log_trace("ChoicesFilterState$server_inputs initializing, id: { private$get_id() }")
    @@ -3189,21 +3322,24 @@

    teal.slice coverage - 65.73%

    440 - 7x + 7x +
              non_missing_values <- reactive(Filter(Negate(is.na), private$x_reactive()))
    441 - 7x + 7x +
              output$trigger_visible <- renderUI({
    442 - 7x + 7x +
                logger::log_trace("ChoicesFilterState$server_inputs@1 updating count labels, id: { private$get_id() }")
    @@ -3217,7 +3353,8 @@

    teal.slice coverage - 65.73%

    444 - 7x + 7x +
                countsnow <- if (!is.null(private$x_reactive())) {
    @@ -3238,7 +3375,8 @@

    teal.slice coverage - 65.73%

    447 - 7x + 7x +
                  NULL
    @@ -3266,49 +3404,56 @@

    teal.slice coverage - 65.73%

    451 - 7x + 7x +
                shiny::isolate({
    452 - 7x + 7x +
                  if (private$is_checkboxgroup()) {
    453 - 7x + 7x +
                    updateCountBars(
    454 - 7x + 7x +
                      inputId = "labels",
    455 - 7x + 7x +
                      choices = private$get_choices(),
    456 - 7x + 7x +
                      countsmax = private$choices_counts,
    457 - 7x + 7x +
                      countsnow = countsnow
    @@ -3420,7 +3565,8 @@

    teal.slice coverage - 65.73%

    473 - 7x + 7x +
                  NULL
    @@ -3448,42 +3594,48 @@

    teal.slice coverage - 65.73%

    477 - 7x + 7x +
              if (private$is_checkboxgroup()) {
    478 - 7x + 7x +
                private$observers$selection <- observeEvent(
    479 - 7x + 7x +
                  ignoreNULL = FALSE,
    480 - 7x + 7x +
                  ignoreInit = TRUE, # ignoreInit: should not matter because we set the UI with the desired initial state
    481 - 7x + 7x +
                  eventExpr = input$selection,
    482 - 7x + 7x +
                  handlerExpr = {
    @@ -3805,7 +3957,8 @@

    teal.slice coverage - 65.73%

    528 - 7x + 7x +
              private$keep_na_srv("keep_na")
    @@ -3840,7 +3993,8 @@

    teal.slice coverage - 65.73%

    533 - 7x + 7x +
              private$observers$selection_api <- observeEvent(private$get_selected(), {
    @@ -3861,49 +4015,56 @@

    teal.slice coverage - 65.73%

    536 - 2x + 2x +
                if (!setequal(input$selection, private$get_selected())) {
    537 - 2x + 2x +
                  logger::log_trace("ChoicesFilterState$server@1 state changed, id: { private$get_id() }")
    538 - 2x + 2x +
                  if (private$is_checkboxgroup()) {
    539 - 2x + 2x +
                    if (private$is_multiple()) {
    540 - 2x + 2x +
                      updateCheckboxGroupInput(
    541 - 2x + 2x +
                        inputId = "selection",
    542 - 2x + 2x +
                        selected = private$get_selected()
    @@ -4022,14 +4183,16 @@

    teal.slice coverage - 65.73%

    559 - 7x + 7x +
              logger::log_trace("ChoicesFilterState$server_inputs initialized, id: { private$get_id() }")
    560 - 7x + 7x +
              NULL
    @@ -4267,28 +4430,32 @@

    teal.slice coverage - 65.73%

    594 - 7x + 7x +
          selected <- private$get_selected()
    595 - 7x + 7x +
          selected_length <- nchar(paste0(selected, collapse = ""))
    596 - 7x + 7x +
          if (selected_length <= 40) {
    597 - 7x + 7x +
            selected_text <- paste0(selected, collapse = ", ")
    @@ -4323,28 +4490,32 @@

    teal.slice coverage - 65.73%

    602 - 7x + 7x +
          tagList(
    603 - 7x + 7x +
            tags$span(
    604 - 7x + 7x +
              class = "filter-card-summary-value",
    605 - 7x + 7x +
              selected_text
    @@ -4358,21 +4529,24 @@

    teal.slice coverage - 65.73%

    607 - 7x + 7x +
            tags$span(
    608 - 7x + 7x +
              class = "filter-card-summary-controls",
    609 - 7x + 7x +
              if (private$na_count > 0) {
    @@ -4637,7 +4811,8 @@

    teal.slice coverage - 65.73%

    30 - 24x + 24x +
          super$initialize(dataset = dataset, dataname = dataname, label = label)
    @@ -4721,35 +4896,40 @@

    teal.slice coverage - 65.73%

    42 - 4x + 4x +
          class_string <- toString(class(private$dataset))
    43 - 4x + 4x +
          if (trim_lines) {
    44 - 2x + 2x +
            trim_position <- 37L
    45 - 2x + 2x +
            class_string <- strtrim(class_string, trim_position)
    46 - 2x + 2x +
            substr(class_string, 35L, 37L) <- "..."
    @@ -4763,7 +4943,8 @@

    teal.slice coverage - 65.73%

    48 - 4x + 4x +
          sprintf(" - unfiltered dataset:\t\"%s\":   %s", private$dataname, class_string)
    @@ -4805,7 +4986,8 @@

    teal.slice coverage - 65.73%

    54 - 1x + 1x +
          invisible(NULL)
    @@ -4833,7 +5015,8 @@

    teal.slice coverage - 65.73%

    58 - 2x + 2x +
          invisible(NULL)
    @@ -4868,14 +5051,16 @@

    teal.slice coverage - 65.73%

    63 - 3x + 3x +
          if (length(state) != 0L) {
    64 - 1x + 1x +
            warning("DefaultFilterState cannot set state")
    @@ -4889,7 +5074,8 @@

    teal.slice coverage - 65.73%

    66 - 3x + 3x +
          invisible(NULL)
    @@ -4924,7 +5110,8 @@

    teal.slice coverage - 65.73%

    71 - 1x + 1x +
          invisible(NULL)
    @@ -4980,7 +5167,8 @@

    teal.slice coverage - 65.73%

    79 - 1x + 1x +
          data.frame(dataname = private$dataname, obs = NA, obs_filtered = NA)
    @@ -5574,28 +5762,32 @@

    teal.slice coverage - 65.73%

    51 - 274x + 274x +
          checkmate::assert_string(dataname)
    52 - 272x + 272x +
          logger::log_trace("Instantiating { class(self)[1] }, dataname: { dataname }")
    53 - 272x + 272x +
          checkmate::assert_function(data_reactive, args = "sid")
    54 - 272x + 272x +
          checkmate::assert_string(datalabel, null.ok = TRUE)
    @@ -5609,42 +5801,48 @@

    teal.slice coverage - 65.73%

    56 - 272x + 272x +
          private$dataname <- dataname
    57 - 272x + 272x +
          private$datalabel <- datalabel
    58 - 272x + 272x +
          private$dataname_prefixed <- dataname
    59 - 272x + 272x +
          private$data <- data
    60 - 272x + 272x +
          private$data_reactive <- data_reactive
    61 - 272x + 272x +
          private$state_list <- reactiveVal()
    @@ -5658,14 +5856,16 @@

    teal.slice coverage - 65.73%

    63 - 272x + 272x +
          logger::log_trace("Instantiated { class(self)[1] }, dataname: { private$dataname }")
    64 - 272x + 272x +
          invisible(self)
    @@ -6092,7 +6292,8 @@

    teal.slice coverage - 65.73%

    125 - 88x + 88x +
          logger::log_trace("FilterStates$get_call initializing")
    @@ -6127,21 +6328,24 @@

    teal.slice coverage - 65.73%

    130 - 88x + 88x +
          states_list <- private$state_list_get()
    131 - 88x + 88x +
          if (length(states_list) == 0) {
    132 - 52x + 52x +
            return(NULL)
    @@ -6155,35 +6359,40 @@

    teal.slice coverage - 65.73%

    134 - 36x + 36x +
          args <- vapply(
    135 - 36x + 36x +
            states_list,
    136 - 36x + 36x +
            function(x) {
    137 - 57x + 57x +
              arg <- x$get_state()$arg
    138 - 7x + 7x +
              `if`(is.null(arg), "", arg) # converting NULL -> "" to enable tapply.
    @@ -6197,7 +6406,8 @@

    teal.slice coverage - 65.73%

    140 - 36x + 36x +
            character(1)
    @@ -6218,35 +6428,40 @@

    teal.slice coverage - 65.73%

    143 - 36x + 36x +
          filter_items <- tapply(
    144 - 36x + 36x +
            X = states_list,
    145 - 36x + 36x +
            INDEX = args,
    146 - 36x + 36x +
            simplify = FALSE,
    147 - 36x + 36x +
            function(items) {
    @@ -6260,14 +6475,16 @@

    teal.slice coverage - 65.73%

    149 - 38x + 38x +
              other_filter_idx <- !names(items) %in% sid
    150 - 38x + 38x +
              filtered_items <- items[other_filter_idx]
    @@ -6281,42 +6498,48 @@

    teal.slice coverage - 65.73%

    152 - 38x + 38x +
              calls <- Filter(
    153 - 38x + 38x +
                Negate(is.null),
    154 - 38x + 38x +
                lapply(
    155 - 38x + 38x +
                  filtered_items,
    156 - 38x + 38x +
                  function(state) {
    157 - 51x + 51x +
                    state$get_call(dataname = private$dataname_prefixed)
    @@ -6344,7 +6567,8 @@

    teal.slice coverage - 65.73%

    161 - 38x + 38x +
              calls_combine_by(calls, operator = "&")
    @@ -6365,21 +6589,24 @@

    teal.slice coverage - 65.73%

    164 - 36x + 36x +
          filter_items <- Filter(
    165 - 36x + 36x +
            x = filter_items,
    166 - 36x + 36x +
            f = Negate(is.null)
    @@ -6393,49 +6620,56 @@

    teal.slice coverage - 65.73%

    168 - 36x + 36x +
          if (length(filter_items) > 0L) {
    169 - 35x + 35x +
            filter_function <- private$fun
    170 - 35x + 35x +
            data_name <- str2lang(private$dataname_prefixed)
    171 - 35x + 35x +
            substitute(
    172 - 35x + 35x +
              env = list(
    173 - 35x + 35x +
                lhs = data_name,
    174 - 35x + 35x +
                rhs = as.call(c(filter_function, c(list(data_name), filter_items)))
    @@ -6449,7 +6683,8 @@

    teal.slice coverage - 65.73%

    176 - 35x + 35x +
              expr = lhs <- rhs
    @@ -6477,7 +6712,8 @@

    teal.slice coverage - 65.73%

    180 - 1x + 1x +
            NULL
    @@ -6631,35 +6867,40 @@

    teal.slice coverage - 65.73%

    202 - 17x + 17x +
          checkmate::assert_class(state, "teal_slices")
    203 - 17x + 17x +
          shiny::isolate({
    204 - 17x + 17x +
            state_ids <- vapply(state, `[[`, character(1), "id")
    205 - 17x + 17x +
            logger::log_trace("{ class(self)[1] }$remove_filter_state removing filters, state_id: { toString(state_ids) }")
    206 - 17x + 17x +
            private$state_list_remove(state_ids)
    @@ -6673,7 +6914,8 @@

    teal.slice coverage - 65.73%

    208 - 17x + 17x +
          invisible(NULL)
    @@ -6757,14 +6999,16 @@

    teal.slice coverage - 65.73%

    220 - 364x + 364x +
          slices <- unname(lapply(private$state_list(), function(x) x$get_state()))
    221 - 364x + 364x +
          fs <- do.call(teal_slices, c(slices, list(count_type = private$count_type)))
    @@ -6778,35 +7022,40 @@

    teal.slice coverage - 65.73%

    223 - 364x + 364x +
          include_varnames <- private$include_varnames
    224 - 364x + 364x +
          if (length(include_varnames)) {
    225 - 214x + 214x +
            attr(fs, "include_varnames") <- structure(
    226 - 214x + 214x +
              list(include_varnames),
    227 - 214x + 214x +
              names = private$dataname
    @@ -6834,35 +7083,40 @@

    teal.slice coverage - 65.73%

    231 - 364x + 364x +
          exclude_varnames <- private$exclude_varnames
    232 - 364x + 364x +
          if (length(exclude_varnames)) {
    233 - 9x + 9x +
            attr(fs, "exclude_varnames") <- structure(
    234 - 9x + 9x +
              list(exclude_varnames),
    235 - 9x + 9x +
              names = private$dataname
    @@ -6890,7 +7144,8 @@

    teal.slice coverage - 65.73%

    239 - 364x + 364x +
          return(fs)
    @@ -6967,49 +7222,56 @@

    teal.slice coverage - 65.73%

    250 - 135x + 135x +
          shiny::isolate({
    251 - 135x + 135x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initializing, dataname: { private$dataname }")
    252 - 135x + 135x +
            checkmate::assert_class(state, "teal_slices")
    253 - 135x + 135x +
            lapply(state, function(x) {
    254 - 177x + 177x +
              checkmate::assert_true(
    255 - 177x + 177x +
                x$dataname == private$dataname,
    256 - 177x + 177x +
                .var.name = "dataname matches private$dataname"
    @@ -7037,21 +7299,24 @@

    teal.slice coverage - 65.73%

    260 - 135x + 135x +
            private$set_filterable_varnames(
    261 - 135x + 135x +
              include_varnames = attr(state, "include_varnames")[[private$dataname]],
    262 - 135x + 135x +
              exclude_varnames = attr(state, "exclude_varnames")[[private$dataname]]
    @@ -7065,21 +7330,24 @@

    teal.slice coverage - 65.73%

    264 - 135x + 135x +
            count_type <- attr(state, "count_type")
    265 - 135x + 135x +
            if (length(count_type)) {
    266 - 21x + 21x +
              private$count_type <- count_type
    @@ -7107,35 +7375,40 @@

    teal.slice coverage - 65.73%

    270 - 135x + 135x +
            varnames <- unique(unlist(lapply(state, "[[", "varname")))
    271 - 135x + 135x +
            excluded_varnames <- setdiff(varnames, private$get_filterable_varnames())
    272 - 135x + 135x +
            if (length(excluded_varnames)) {
    273 - 3x + 3x +
              state <- Filter(function(x) !isTRUE(x$varname %in% excluded_varnames), state)
    274 - 3x + 3x +
              logger::log_warn("filters for columns: { toString(excluded_varnames) } excluded from { private$dataname }")
    @@ -7156,35 +7429,40 @@

    teal.slice coverage - 65.73%

    277 - 135x + 135x +
            if (length(state) > 0) {
    278 - 93x + 93x +
              private$set_filter_state_impl(
    279 - 93x + 93x +
                state = state,
    280 - 93x + 93x +
                data = private$data,
    281 - 93x + 93x +
                data_reactive = private$data_reactive
    @@ -7205,7 +7483,8 @@

    teal.slice coverage - 65.73%

    284 - 135x + 135x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initialized, dataname: { private$dataname }")
    @@ -7226,7 +7505,8 @@

    teal.slice coverage - 65.73%

    287 - 135x + 135x +
          invisible(NULL)
    @@ -7310,14 +7590,16 @@

    teal.slice coverage - 65.73%

    299 - 25x + 25x +
          private$state_list_empty(force)
    300 - 25x + 25x +
          invisible(NULL)
    @@ -7583,49 +7865,56 @@

    teal.slice coverage - 65.73%

    338 - 12x + 12x +
          moduleServer(
    339 - 12x + 12x +
            id = id,
    340 - 12x + 12x +
            function(input, output, session) {
    341 - 12x + 12x +
              logger::log_trace("FilterState$srv_active initializing, dataname: { private$dataname }")
    342 - 12x + 12x +
              current_state <- reactive(private$state_list_get())
    343 - 12x + 12x +
              previous_state <- reactiveVal(NULL) # FilterState list
    344 - 12x + 12x +
              added_states <- reactiveVal(NULL) # FilterState list
    @@ -7646,21 +7935,24 @@

    teal.slice coverage - 65.73%

    347 - 12x + 12x +
              fs_to_shiny_ns <- function(x) {
    348 - 24x + 24x +
                checkmate::assert_multi_class(x, c("FilterState", "FilterStateExpr"))
    349 - 24x + 24x +
                gsub("[^[:alnum:]]+", "_", get_default_slice_id(x$get_state()))
    @@ -7681,28 +7973,32 @@

    teal.slice coverage - 65.73%

    352 - 12x + 12x +
              output$trigger_visible_state_change <- renderUI({
    353 - 14x + 14x +
                current_state()
    354 - 14x + 14x +
                isolate({
    355 - 14x + 14x +
                  logger::log_trace("FilterStates$srv_active@1 determining added and removed filter states")
    @@ -7716,21 +8012,24 @@

    teal.slice coverage - 65.73%

    357 - 14x + 14x +
                  added_states(setdiff_teal_slices(current_state(), previous_state()))
    358 - 14x + 14x +
                  previous_state(current_state())
    359 - 14x + 14x +
                  NULL
    @@ -7758,42 +8057,48 @@

    teal.slice coverage - 65.73%

    363 - 12x + 12x +
              output[["cards"]] <- shiny::renderUI({
    364 - 14x + 14x +
                lapply(
    365 - 14x + 14x +
                  current_state(), # observes only if added/removed
    366 - 14x + 14x +
                  function(state) {
    367 - 12x + 12x +
                    shiny::isolate( # isolates when existing state changes
    368 - 12x + 12x +
                      state$ui(id = session$ns(fs_to_shiny_ns(state)), parent_id = session$ns("cards"))
    @@ -7835,21 +8140,24 @@

    teal.slice coverage - 65.73%

    374 - 12x + 12x +
              observeEvent(
    375 - 12x + 12x +
                added_states(), # we want to call FilterState module only once when it's added
    376 - 12x + 12x +
                ignoreNULL = TRUE,
    @@ -7863,63 +8171,72 @@

    teal.slice coverage - 65.73%

    378 - 10x + 10x +
                  added_state_names <- vapply(added_states(), function(x) x$get_state()$id, character(1L))
    379 - 10x + 10x +
                  logger::log_trace("FilterStates$srv_active@2 triggered by added states: { toString(added_state_names) }")
    380 - 10x + 10x +
                  lapply(added_states(), function(state) {
    381 - 12x + 12x +
                    fs_callback <- state$server(id = fs_to_shiny_ns(state))
    382 - 12x + 12x +
                    observeEvent(
    383 - 12x + 12x +
                      once = TRUE, # remove button can be called once, should be destroyed afterwards
    384 - 12x + 12x +
                      ignoreInit = TRUE, # ignoreInit: should not matter because we destroy the previous input set of the UI
    385 - 12x + 12x +
                      eventExpr = fs_callback(), # when remove button is clicked in the FilterState ui
    386 - 12x + 12x +
                      handlerExpr = private$state_list_remove(state$get_state()$id)
    @@ -7940,7 +8257,8 @@

    teal.slice coverage - 65.73%

    389 - 10x + 10x +
                  added_states(NULL)
    @@ -7968,7 +8286,8 @@

    teal.slice coverage - 65.73%

    393 - 12x + 12x +
              NULL
    @@ -8066,14 +8385,16 @@

    teal.slice coverage - 65.73%

    407 - 1x + 1x +
          checkmate::assert_string(id)
    408 - 1x + 1x +
          data <- private$data
    @@ -8087,7 +8408,8 @@

    teal.slice coverage - 65.73%

    410 - 1x + 1x +
          ns <- NS(id)
    @@ -8101,14 +8423,16 @@

    teal.slice coverage - 65.73%

    412 - 1x + 1x +
          if (ncol(data) == 0) {
    413 - 1x + 1x +
            div("no sample variables available")
    @@ -8248,28 +8572,32 @@

    teal.slice coverage - 65.73%

    433 - 8x + 8x +
          moduleServer(
    434 - 8x + 8x +
            id = id,
    435 - 8x + 8x +
            function(input, output, session) {
    436 - 8x + 8x +
              logger::log_trace("FilterStates$srv_add initializing, dataname: { private$dataname }")
    @@ -8290,42 +8618,48 @@

    teal.slice coverage - 65.73%

    439 - 8x + 8x +
              avail_column_choices <- reactive({
    440 - 9x + 9x +
                data <- private$data
    441 - 9x + 9x +
                vars_include <- private$get_filterable_varnames()
    442 - 9x + 9x +
                active_filter_vars <- unique(unlist(lapply(self$get_filter_state(), "[[", "varname")))
    443 - 9x + 9x +
                choices <- setdiff(vars_include, active_filter_vars)
    444 - 9x + 9x +
                varlabels <- get_varlabels(data)
    @@ -8339,35 +8673,40 @@

    teal.slice coverage - 65.73%

    446 - 9x + 9x +
                data_choices_labeled(
    447 - 9x + 9x +
                  data = data,
    448 - 9x + 9x +
                  choices = choices,
    449 - 9x + 9x +
                  varlabels = varlabels,
    450 - 9x + 9x +
                  keys = private$keys
    @@ -8402,21 +8741,24 @@

    teal.slice coverage - 65.73%

    455 - 8x + 8x +
              output$add_filter <- renderUI({
    456 - 6x + 6x +
                logger::log_trace(
    457 - 6x + 6x +
                  "FilterStates$srv_add@1 updating available column choices, dataname: { private$dataname }"
    @@ -8430,7 +8772,8 @@

    teal.slice coverage - 65.73%

    459 - 6x + 6x +
                if (length(avail_column_choices()) == 0) {
    @@ -8451,56 +8794,64 @@

    teal.slice coverage - 65.73%

    462 - 6x + 6x +
                  div(
    463 - 6x + 6x +
                    teal.widgets::optionalSelectInput(
    464 - 6x + 6x +
                      session$ns("var_to_add"),
    465 - 6x + 6x +
                      choices = avail_column_choices(),
    466 - 6x + 6x +
                      selected = NULL,
    467 - 6x + 6x +
                      options = shinyWidgets::pickerOptions(
    468 - 6x + 6x +
                        liveSearch = TRUE,
    469 - 6x + 6x +
                        noneSelectedText = "Select variable to filter"
    @@ -8549,56 +8900,64 @@

    teal.slice coverage - 65.73%

    476 - 8x + 8x +
              observeEvent(
    477 - 8x + 8x +
                eventExpr = input$var_to_add,
    478 - 8x + 8x +
                handlerExpr = {
    479 - 3x + 3x +
                  logger::log_trace(
    480 - 3x + 3x +
                    sprintf(
    481 - 3x + 3x +
                      "FilterStates$srv_add@2 adding FilterState of variable %s, dataname: %s",
    482 - 3x + 3x +
                      input$var_to_add,
    483 - 3x + 3x +
                      private$dataname
    @@ -8619,21 +8978,24 @@

    teal.slice coverage - 65.73%

    486 - 3x + 3x +
                  self$set_filter_state(
    487 - 3x + 3x +
                    teal_slices(
    488 - 3x + 3x +
                      teal_slice(dataname = private$dataname, varname = input$var_to_add)
    @@ -8654,35 +9016,40 @@

    teal.slice coverage - 65.73%

    491 - 3x + 3x +
                  logger::log_trace(
    492 - 3x + 3x +
                    sprintf(
    493 - 3x + 3x +
                      "FilterStates$srv_add@2 added FilterState of variable %s, dataname: %s",
    494 - 3x + 3x +
                      input$var_to_add,
    495 - 3x + 3x +
                      private$dataname
    @@ -8724,14 +9091,16 @@

    teal.slice coverage - 65.73%

    501 - 8x + 8x +
              logger::log_trace("FilterStates$srv_add initialized, dataname: { private$dataname }")
    502 - 8x + 8x +
              NULL
    @@ -8990,14 +9359,16 @@

    teal.slice coverage - 65.73%

    539 - 288x + 288x +
          if ((length(include_varnames) + length(exclude_varnames)) == 0L) {
    540 - 113x + 113x +
            return(invisible(NULL))
    @@ -9011,21 +9382,24 @@

    teal.slice coverage - 65.73%

    542 - 175x + 175x +
          checkmate::assert_character(include_varnames, any.missing = FALSE, min.len = 0L, null.ok = TRUE)
    543 - 175x + 175x +
          checkmate::assert_character(exclude_varnames, any.missing = FALSE, min.len = 0L, null.ok = TRUE)
    544 - 175x + 175x +
          if (length(include_varnames) && length(exclude_varnames)) {
    @@ -9074,28 +9448,32 @@

    teal.slice coverage - 65.73%

    551 - 175x + 175x +
          supported_vars <- get_supported_filter_varnames(private$data)
    552 - 175x + 175x +
          if (length(include_varnames)) {
    553 - 161x + 161x +
            private$include_varnames <- intersect(include_varnames, supported_vars)
    554 - 161x + 161x +
            private$exclude_varnames <- character(0)
    @@ -9109,14 +9487,16 @@

    teal.slice coverage - 65.73%

    556 - 14x + 14x +
            private$exclude_varnames <- exclude_varnames
    557 - 14x + 14x +
            private$include_varnames <- character(0)
    @@ -9130,7 +9510,8 @@

    teal.slice coverage - 65.73%

    559 - 175x + 175x +
          invisible(NULL)
    @@ -9207,14 +9588,16 @@

    teal.slice coverage - 65.73%

    570 - 144x + 144x +
          if (length(private$include_varnames)) {
    571 - 97x + 97x +
            private$include_varnames
    @@ -9228,14 +9611,16 @@

    teal.slice coverage - 65.73%

    573 - 47x + 47x +
            supported_varnames <- get_supported_filter_varnames(private$data)
    574 - 47x + 47x +
            setdiff(supported_varnames, private$exclude_varnames)
    @@ -9340,7 +9725,8 @@

    teal.slice coverage - 65.73%

    589 - 212x + 212x +
          checkmate::assert_string(state_id, null.ok = TRUE)
    @@ -9354,14 +9740,16 @@

    teal.slice coverage - 65.73%

    591 - 212x + 212x +
          if (is.null(state_id)) {
    592 - 212x + 212x +
            private$state_list()
    @@ -9487,49 +9875,56 @@

    teal.slice coverage - 65.73%

    610 - 183x + 183x +
          logger::log_trace("{ class(self)[1] } pushing into state_list, dataname: { private$dataname }")
    611 - 183x + 183x +
          checkmate::assert_string(state_id)
    612 - 183x + 183x +
          checkmate::assert_multi_class(x, c("FilterState", "FilterStateExpr"))
    613 - 183x + 183x +
          state <- stats::setNames(list(x), state_id)
    614 - 183x + 183x +
          new_state_list <- c(
    615 - 183x + 183x +
            shiny::isolate(private$state_list()),
    616 - 183x + 183x +
            state
    @@ -9543,7 +9938,8 @@

    teal.slice coverage - 65.73%

    618 - 183x + 183x +
          shiny::isolate(private$state_list(new_state_list))
    @@ -9557,14 +9953,16 @@

    teal.slice coverage - 65.73%

    620 - 183x + 183x +
          logger::log_trace("{ class(self)[1] } pushed into queue, dataname: { private$dataname }")
    621 - 183x + 183x +
          invisible(NULL)
    @@ -9683,14 +10081,16 @@

    teal.slice coverage - 65.73%

    638 - 32x + 32x +
          checkmate::assert_character(state_id)
    639 - 32x + 32x +
          logger::log_trace("{ class(self)[1] } removing a filter, state_id: { toString(state_id) }")
    @@ -9704,63 +10104,72 @@

    teal.slice coverage - 65.73%

    641 - 32x + 32x +
          shiny::isolate({
    642 - 32x + 32x +
            current_state_ids <- vapply(private$state_list(), function(x) x$get_state()$id, character(1))
    643 - 32x + 32x +
            to_remove <- state_id %in% current_state_ids
    644 - 32x + 32x +
            if (any(to_remove)) {
    645 - 31x + 31x +
              new_state_list <- Filter(
    646 - 31x + 31x +
                function(state) {
    647 - 68x + 68x +
                  if (state$get_state()$id %in% state_id) {
    648 - 54x + 54x +
                    if (state$get_state()$anchored && !force) {
    649 - 7x + 7x +
                      return(TRUE)
    @@ -9774,14 +10183,16 @@

    teal.slice coverage - 65.73%

    651 - 47x + 47x +
                      state$destroy_observers()
    652 - 47x + 47x +
                      FALSE
    @@ -9802,7 +10213,8 @@

    teal.slice coverage - 65.73%

    655 - 14x + 14x +
                    TRUE
    @@ -9823,7 +10235,8 @@

    teal.slice coverage - 65.73%

    658 - 31x + 31x +
                private$state_list()
    @@ -9837,7 +10250,8 @@

    teal.slice coverage - 65.73%

    660 - 31x + 31x +
              private$state_list(new_state_list)
    @@ -9851,7 +10265,8 @@

    teal.slice coverage - 65.73%

    662 - 1x + 1x +
              warning(sprintf("\"%s\" not found in state list", state_id))
    @@ -9879,7 +10294,8 @@

    teal.slice coverage - 65.73%

    666 - 32x + 32x +
          invisible(NULL)
    @@ -9949,21 +10365,24 @@

    teal.slice coverage - 65.73%

    676 - 25x + 25x +
          shiny::isolate({
    677 - 25x + 25x +
            logger::log_trace(
    678 - 25x + 25x +
              "{ class(self)[1] }$state_list_empty removing all non-anchored filters for dataname: { private$dataname }"
    @@ -9984,28 +10403,32 @@

    teal.slice coverage - 65.73%

    681 - 25x + 25x +
            state_list <- private$state_list()
    682 - 25x + 25x +
            if (length(state_list)) {
    683 - 15x + 15x +
              state_ids <- vapply(state_list, function(x) x$get_state()$id, character(1))
    684 - 15x + 15x +
              private$state_list_remove(state_ids, force)
    @@ -10033,7 +10456,8 @@

    teal.slice coverage - 65.73%

    688 - 25x + 25x +
          invisible(NULL)
    @@ -10159,35 +10583,40 @@

    teal.slice coverage - 65.73%

    706 - 211x + 211x +
          checkmate::assert_class(state, "teal_slices")
    707 - 211x + 211x +
          checkmate::assert_multi_class(data, c("data.frame", "matrix", "DataFrame", "HermesData"))
    708 - 211x + 211x +
          checkmate::assert_function(data_reactive, args = "sid")
    709 - 211x + 211x +
          if (length(state) == 0L) {
    710 - 101x + 101x +
            return(invisible(NULL))
    @@ -10208,14 +10637,16 @@

    teal.slice coverage - 65.73%

    713 - 110x + 110x +
          slices_hashed <- vapply(state, `[[`, character(1L), "id")
    714 - 110x + 110x +
          if (any(duplicated(slices_hashed))) {
    @@ -10264,28 +10695,32 @@

    teal.slice coverage - 65.73%

    721 - 110x + 110x +
          state_list <- shiny::isolate(private$state_list_get())
    722 - 110x + 110x +
          lapply(state, function(slice) {
    723 - 191x + 191x +
            state_id <- slice$id
    724 - 191x + 191x +
            if (state_id %in% names(state_list)) {
    @@ -10299,7 +10734,8 @@

    teal.slice coverage - 65.73%

    726 - 8x + 8x +
              state_list[[state_id]]$set_state(slice)
    @@ -10313,7 +10749,8 @@

    teal.slice coverage - 65.73%

    728 - 183x + 183x +
              if (inherits(slice, "teal_slice_expr")) {
    @@ -10327,7 +10764,8 @@

    teal.slice coverage - 65.73%

    730 - 6x + 6x +
                fstate <- init_filter_state_expr(slice)
    @@ -10348,14 +10786,16 @@

    teal.slice coverage - 65.73%

    733 - 177x + 177x +
                fstate <- init_filter_state(
    734 - 177x + 177x +
                  x = data[, slice$varname, drop = TRUE],
    @@ -10404,14 +10844,16 @@

    teal.slice coverage - 65.73%

    741 - 177x + 177x +
                  x_reactive = if (private$count_type == "none") {
    742 - 171x + 171x +
                    reactive(NULL)
    @@ -10425,7 +10867,8 @@

    teal.slice coverage - 65.73%

    744 - 6x + 6x +
                    reactive(data_reactive(state_id)[, slice$varname, drop = TRUE])
    @@ -10439,14 +10882,16 @@

    teal.slice coverage - 65.73%

    746 - 177x + 177x +
                  slice = slice,
    747 - 177x + 177x +
                  extract_type = private$extract_type
    @@ -10467,7 +10912,8 @@

    teal.slice coverage - 65.73%

    750 - 183x + 183x +
              private$state_list_push(x = fstate, state_id = state_id)
    @@ -10495,7 +10941,8 @@

    teal.slice coverage - 65.73%

    754 - 110x + 110x +
          invisible(NULL)
    @@ -10571,14 +11018,16 @@

    teal.slice coverage - 65.73%

    7 - 9x + 9x +
      shiny::isolate(
    8 - 9x + 9x +
        all(vapply(fields, function(x) identical(ts1[[x]], ts2[[x]]), logical(1L)))
    @@ -10641,35 +11090,40 @@

    teal.slice coverage - 65.73%

    17 - 34x + 34x +
      shiny::isolate({
    18 - 34x + 34x +
        testthat::expect_true(
    19 - 34x + 34x +
          setequal(
    20 - 34x + 34x +
            reactiveValuesToList(x),
    21 - 34x + 34x +
            reactiveValuesToList(y)
    @@ -10739,28 +11193,32 @@

    teal.slice coverage - 65.73%

    31 - 12x + 12x +
      shiny::isolate({
    32 - 12x + 12x +
        mapply(
    33 - 12x + 12x +
          function(x, y) {
    34 - 27x + 27x +
            expect_identical_slice(x, y)
    @@ -10774,14 +11232,16 @@

    teal.slice coverage - 65.73%

    36 - 12x + 12x +
          x = x,
    37 - 12x + 12x +
          y = y
    @@ -10795,7 +11255,8 @@

    teal.slice coverage - 65.73%

    39 - 12x + 12x +
        testthat::expect_identical(attributes(x), attributes(y))
    @@ -11242,35 +11703,40 @@

    teal.slice coverage - 65.73%

    61 - 195x + 195x +
      checkmate::assert_class(x_reactive, "reactive")
    62 - 194x + 194x +
      checkmate::assert_character(extract_type, max.len = 1, any.missing = FALSE)
    63 - 194x + 194x +
      checkmate::assert_class(slice, "teal_slice")
    64 - 193x + 193x +
      if (length(extract_type) == 1) {
    65 - 43x + 43x +
        checkmate::assert_choice(extract_type, choices = c("list", "matrix"))
    @@ -11291,42 +11757,48 @@

    teal.slice coverage - 65.73%

    68 - 192x + 192x +
      if (all(is.na(x))) {
    69 - 1x + 1x +
        EmptyFilterState$new(
    70 - 1x + 1x +
          x = x,
    71 - 1x + 1x +
          x_reactive = x_reactive,
    72 - 1x + 1x +
          slice = slice,
    73 - 1x + 1x +
          extract_type = extract_type
    @@ -11347,7 +11819,8 @@

    teal.slice coverage - 65.73%

    76 - 191x + 191x +
        UseMethod("init_filter_state")
    @@ -11417,35 +11890,40 @@

    teal.slice coverage - 65.73%

    86 - 1x + 1x +
      args <- list(
    87 - 1x + 1x +
        x = x,
    88 - 1x + 1x +
        x_reactive = x_reactive,
    89 - 1x + 1x +
        extract_type = extract_type,
    90 - 1x + 1x +
        slice
    @@ -11466,7 +11944,8 @@

    teal.slice coverage - 65.73%

    93 - 1x + 1x +
      do.call(FilterState$new, args)
    @@ -11529,35 +12008,40 @@

    teal.slice coverage - 65.73%

    102 - 1x + 1x +
      LogicalFilterState$new(
    103 - 1x + 1x +
        x = x,
    104 - 1x + 1x +
        x_reactive = x_reactive,
    105 - 1x + 1x +
        slice = slice,
    106 - 1x + 1x +
        extract_type = extract_type
    @@ -11627,35 +12111,40 @@

    teal.slice coverage - 65.73%

    116 - 120x + 120x +
      args <- list(
    117 - 120x + 120x +
        x = x,
    118 - 120x + 120x +
        x_reactive = x_reactive,
    119 - 120x + 120x +
        slice = slice,
    120 - 120x + 120x +
        extract_type = extract_type
    @@ -11676,14 +12165,16 @@

    teal.slice coverage - 65.73%

    123 - 120x + 120x +
      if (length(unique(x[!is.na(x)])) < getOption("teal.threshold_slider_vs_checkboxgroup")) {
    124 - 28x + 28x +
        do.call(ChoicesFilterState$new, args)
    @@ -11697,7 +12188,8 @@

    teal.slice coverage - 65.73%

    126 - 92x + 92x +
        do.call(RangeFilterState$new, args)
    @@ -11767,35 +12259,40 @@

    teal.slice coverage - 65.73%

    136 - 31x + 31x +
      ChoicesFilterState$new(
    137 - 31x + 31x +
        x = x,
    138 - 31x + 31x +
        x_reactive = x_reactive,
    139 - 31x + 31x +
        slice = slice,
    140 - 31x + 31x +
        extract_type = extract_type
    @@ -11865,35 +12362,40 @@

    teal.slice coverage - 65.73%

    150 - 32x + 32x +
      ChoicesFilterState$new(
    151 - 32x + 32x +
        x = x,
    152 - 32x + 32x +
        x_reactive = x_reactive,
    153 - 32x + 32x +
        slice = slice,
    154 - 32x + 32x +
        extract_type = extract_type
    @@ -11963,35 +12465,40 @@

    teal.slice coverage - 65.73%

    164 - 2x + 2x +
      args <- list(
    165 - 2x + 2x +
        x = x,
    166 - 2x + 2x +
        x_reactive = x_reactive,
    167 - 2x + 2x +
        slice = slice,
    168 - 2x + 2x +
        extract_type = extract_type
    @@ -12012,14 +12519,16 @@

    teal.slice coverage - 65.73%

    171 - 2x + 2x +
      if (length(unique(x[!is.na(x)])) < getOption("teal.threshold_slider_vs_checkboxgroup")) {
    172 - 1x + 1x +
        do.call(ChoicesFilterState$new, args)
    @@ -12033,7 +12542,8 @@

    teal.slice coverage - 65.73%

    174 - 1x + 1x +
        do.call(DateFilterState$new, args)
    @@ -12103,35 +12613,40 @@

    teal.slice coverage - 65.73%

    184 - 2x + 2x +
      args <- list(
    185 - 2x + 2x +
        x = x,
    186 - 2x + 2x +
        x_reactive = x_reactive,
    187 - 2x + 2x +
        slice = slice,
    188 - 2x + 2x +
        extract_type = extract_type
    @@ -12152,14 +12667,16 @@

    teal.slice coverage - 65.73%

    191 - 2x + 2x +
      if (length(unique(x[!is.na(x)])) < getOption("teal.threshold_slider_vs_checkboxgroup")) {
    192 - 1x + 1x +
        do.call(ChoicesFilterState$new, args)
    @@ -12173,7 +12690,8 @@

    teal.slice coverage - 65.73%

    194 - 1x + 1x +
        do.call(DatetimeFilterState$new, args)
    @@ -12243,35 +12761,40 @@

    teal.slice coverage - 65.73%

    204 - 2x + 2x +
      args <- list(
    205 - 2x + 2x +
        x = x,
    206 - 2x + 2x +
        x_reactive = x_reactive,
    207 - 2x + 2x +
        slice = slice,
    208 - 2x + 2x +
        extract_type = extract_type
    @@ -12292,14 +12815,16 @@

    teal.slice coverage - 65.73%

    211 - 2x + 2x +
      if (length(unique(x[!is.na(x)])) < getOption("teal.threshold_slider_vs_checkboxgroup")) {
    212 - 1x + 1x +
        do.call(ChoicesFilterState$new, args)
    @@ -12313,7 +12838,8 @@

    teal.slice coverage - 65.73%

    214 - 1x + 1x +
        do.call(DatetimeFilterState$new, args)
    @@ -12439,7 +12965,8 @@

    teal.slice coverage - 65.73%

    232 - 6x + 6x +
      FilterStateExpr$new(slice)
    @@ -12558,28 +13085,32 @@

    teal.slice coverage - 65.73%

    249 - 119x + 119x +
      checkmate::assert_string(color)
    250 - 119x + 119x +
      checkmate::assert(
    251 - 119x + 119x +
        checkmate::check_number(alpha, lower = 0, upper = 1, null.ok = TRUE),
    252 - 119x + 119x +
        checkmate::check_string(alpha, pattern = "[0-9a-f]{2}", null.ok = TRUE)
    @@ -12614,7 +13145,8 @@

    teal.slice coverage - 65.73%

    257 - 119x + 119x +
      sass_file <- if (utils::packageVersion("bslib") < as.package_version("0.5.1.9000")) {
    @@ -12635,7 +13167,8 @@

    teal.slice coverage - 65.73%

    260 - 119x + 119x +
        bslib::bs_theme()[["layers"]][[2]][["defaults"]][[1]][[1]]
    @@ -12649,7 +13182,8 @@

    teal.slice coverage - 65.73%

    262 - 119x + 119x +
      sass_file <- attr(sass_file, "sass_file_path")
    @@ -12670,7 +13204,8 @@

    teal.slice coverage - 65.73%

    265 - 119x + 119x +
      variables_file <- readLines(sass_file)
    @@ -12684,14 +13219,16 @@

    teal.slice coverage - 65.73%

    267 - 119x + 119x +
      ind <- grep("// scss-docs-(start|end) theme-color-variables", variables_file)
    268 - 119x + 119x +
      color_definitions <- variables_file[(ind[1] + 1L):(ind[2] - 1L)]
    @@ -12712,7 +13249,8 @@

    teal.slice coverage - 65.73%

    271 - 119x + 119x +
      color_names <- sub("(\\$)(\\w.+)(:.+)", "\\2", color_definitions)
    @@ -12733,7 +13271,8 @@

    teal.slice coverage - 65.73%

    274 - 119x + 119x +
      checkmate::assert_choice(color, color_names)
    @@ -12754,7 +13293,8 @@

    teal.slice coverage - 65.73%

    277 - 119x + 119x +
      color_references <- sub("(\\$)(\\w.+)(:\\s.+\\$)(\\w.+)(\\s.+)", "\\4", color_definitions)
    @@ -12775,42 +13315,48 @@

    teal.slice coverage - 65.73%

    280 - 119x + 119x +
      color_specification <- structure(color_references, names = color_names)
    281 - 119x + 119x +
      color_specification <- vapply(color_specification, function(x) {
    282 - 952x + 952x +
        line <- grep(sprintf("^\\$%s:\\s+#\\w{6}\\s+!default", x), variables_file, value = TRUE)
    283 - 952x + 952x +
        code <- sub("(.+)(#\\w{6})(\\s+.+)", "\\2", line)
    284 - 952x + 952x +
        code
    285 - 119x + 119x +
      }, character(1L))
    @@ -12824,7 +13370,8 @@

    teal.slice coverage - 65.73%

    287 - 119x + 119x +
      if (!is.null(alpha)) {
    @@ -12852,7 +13399,8 @@

    teal.slice coverage - 65.73%

    291 - 119x + 119x +
      paste0(color_specification[color], alpha)
    @@ -13047,7 +13595,8 @@

    teal.slice coverage - 65.73%

    26 - 153x + 153x +
          logger::log_trace("Instantiating { class(self)[1] }, dataname: { dataname }")
    @@ -13068,21 +13617,24 @@

    teal.slice coverage - 65.73%

    29 - 153x + 153x +
          check_simple_name(dataname)
    30 - 151x + 151x +
          checkmate::assert_character(keys, any.missing = FALSE)
    31 - 151x + 151x +
          checkmate::assert_character(label, null.ok = TRUE)
    @@ -13096,35 +13648,40 @@

    teal.slice coverage - 65.73%

    33 - 151x + 151x +
          logger::log_trace("Instantiating { class(self)[1] }, dataname: { dataname }")
    34 - 151x + 151x +
          private$dataset <- dataset
    35 - 151x + 151x +
          private$dataname <- dataname
    36 - 151x + 151x +
          private$keys <- keys
    37 - 151x + 151x +
          private$label <- if (is.null(label)) character(0) else label
    @@ -13145,28 +13702,32 @@

    teal.slice coverage - 65.73%

    40 - 151x + 151x +
          private$data_filtered_fun <- function(sid = "") {
    41 - 24x + 24x +
            checkmate::assert_character(sid)
    42 - 24x + 24x +
            if (length(sid)) {
    43 - 24x + 24x +
              logger::log_trace("filtering data dataname: { dataname }, sid: { sid }")
    @@ -13194,35 +13755,40 @@

    teal.slice coverage - 65.73%

    47 - 24x + 24x +
            env <- new.env(parent = parent.env(globalenv()))
    48 - 24x + 24x +
            env[[dataname]] <- private$dataset
    49 - 24x + 24x +
            filter_call <- self$get_call(sid)
    50 - 24x + 24x +
            eval_expr_with_msg(filter_call, env)
    51 - 24x + 24x +
            get(x = dataname, envir = env)
    @@ -13243,21 +13809,24 @@

    teal.slice coverage - 65.73%

    54 - 151x + 151x +
          private$data_filtered <- reactive(private$data_filtered_fun())
    55 - 151x + 151x +
          logger::log_trace("Instantiated { class(self)[1] }, dataname: { private$dataname }")
    56 - 151x + 151x +
          invisible(self)
    @@ -13341,28 +13910,32 @@

    teal.slice coverage - 65.73%

    68 - 24x + 24x +
          sprintf(
    69 - 24x + 24x +
            "%s:\n%s",
    70 - 24x + 24x +
            class(self)[1],
    71 - 24x + 24x +
            format(self$get_filter_state(), show_all = show_all, trim_lines = trim_lines)
    @@ -13432,7 +14005,8 @@

    teal.slice coverage - 65.73%

    81 - 10x + 10x +
          cat(shiny::isolate(self$format(...)), "\n")
    @@ -13502,28 +14076,32 @@

    teal.slice coverage - 65.73%

    91 - 14x + 14x +
          logger::log_trace("Removing filters from FilteredDataset: { deparse1(self$get_dataname()) }")
    92 - 14x + 14x +
          lapply(
    93 - 14x + 14x +
            private$get_filter_states(),
    94 - 14x + 14x +
            function(filter_states) filter_states$clear_filter_states(force)
    @@ -13537,14 +14115,16 @@

    teal.slice coverage - 65.73%

    96 - 14x + 14x +
          logger::log_trace("Removed filters from FilteredDataset: { deparse1(self$get_dataname()) }")
    97 - 14x + 14x +
          NULL
    @@ -13677,21 +14257,24 @@

    teal.slice coverage - 65.73%

    116 - 47x + 47x +
          filter_call <- Filter(
    117 - 47x + 47x +
            f = Negate(is.null),
    118 - 47x + 47x +
            x = lapply(private$get_filter_states(), function(x) x$get_call(sid))
    @@ -13705,14 +14288,16 @@

    teal.slice coverage - 65.73%

    120 - 47x + 47x +
          if (length(filter_call) == 0) {
    121 - 29x + 29x +
            return(NULL)
    @@ -13726,7 +14311,8 @@

    teal.slice coverage - 65.73%

    123 - 18x + 18x +
          filter_call
    @@ -13789,14 +14375,16 @@

    teal.slice coverage - 65.73%

    132 - 184x + 184x +
          states <- unname(lapply(private$get_filter_states(), function(x) x$get_filter_state()))
    133 - 184x + 184x +
          do.call(c, states)
    @@ -13922,7 +14510,8 @@

    teal.slice coverage - 65.73%

    151 - 16x + 16x +
          length(self$get_filter_state())
    @@ -13978,7 +14567,8 @@

    teal.slice coverage - 65.73%

    159 - 8x + 8x +
          private$dataname
    @@ -14055,14 +14645,16 @@

    teal.slice coverage - 65.73%

    170 - 51x + 51x +
          if (filtered) {
    171 - 33x + 33x +
            private$data_filtered
    @@ -14076,7 +14668,8 @@

    teal.slice coverage - 65.73%

    173 - 18x + 18x +
            private$dataset
    @@ -14258,7 +14851,8 @@

    teal.slice coverage - 65.73%

    199 - 133x + 133x +
          private$keys
    @@ -14307,7 +14901,8 @@

    teal.slice coverage - 65.73%

    206 - 2x + 2x +
          private$label
    @@ -14881,77 +15476,88 @@

    teal.slice coverage - 65.73%

    288 - 7x + 7x +
          moduleServer(
    289 - 7x + 7x +
            id = id,
    290 - 7x + 7x +
            function(input, output, session) {
    291 - 7x + 7x +
              dataname <- self$get_dataname()
    292 - 7x + 7x +
              logger::log_trace("FilteredDataset$srv_active initializing, dataname: { dataname }")
    293 - 7x + 7x +
              checkmate::assert_string(dataname)
    294 - 7x + 7x +
              output$filter_count <- renderText(
    295 - 7x + 7x +
                sprintf(
    296 - 7x + 7x +
                  "%d filter%s applied",
    297 - 7x + 7x +
                  self$get_filter_count(),
    298 - 7x + 7x +
                  if (self$get_filter_count() != 1) "s" else ""
    @@ -14979,28 +15585,32 @@

    teal.slice coverage - 65.73%

    302 - 7x + 7x +
              lapply(
    303 - 7x + 7x +
                names(private$get_filter_states()),
    304 - 7x + 7x +
                function(x) {
    305 - 12x + 12x +
                  private$get_filter_states()[[x]]$srv_active(id = x)
    @@ -15028,35 +15638,40 @@

    teal.slice coverage - 65.73%

    309 - 7x + 7x +
              shiny::observeEvent(self$get_filter_state(), {
    310 - 8x + 8x +
                shinyjs::hide("filter_count_ui")
    311 - 8x + 8x +
                shinyjs::show("filters")
    312 - 8x + 8x +
                shinyjs::toggle("remove_filters", condition = length(self$get_filter_state()) != 0)
    313 - 8x + 8x +
                shinyjs::toggle("collapse", condition = length(self$get_filter_state()) != 0)
    @@ -15077,7 +15692,8 @@

    teal.slice coverage - 65.73%

    316 - 7x + 7x +
              shiny::observeEvent(input$collapse, {
    @@ -15119,28 +15735,32 @@

    teal.slice coverage - 65.73%

    322 - 7x + 7x +
              observeEvent(input$remove_filters, {
    323 - 1x + 1x +
                logger::log_trace("FilteredDataset$srv_active@1 removing all non-anchored filters, dataname: { dataname }")
    324 - 1x + 1x +
                self$clear_filter_states()
    325 - 1x + 1x +
                logger::log_trace("FilteredDataset$srv_active@1 removed all non-anchored filters, dataname: { dataname }")
    @@ -15161,7 +15781,8 @@

    teal.slice coverage - 65.73%

    328 - 7x + 7x +
              logger::log_trace("FilteredDataset$initialized, dataname: { dataname }")
    @@ -15175,7 +15796,8 @@

    teal.slice coverage - 65.73%

    330 - 7x + 7x +
              NULL
    @@ -15273,7 +15895,8 @@

    teal.slice coverage - 65.73%

    344 - 1x + 1x +
          stop("Pure virtual method")
    @@ -15399,63 +16022,72 @@

    teal.slice coverage - 65.73%

    362 - 2x + 2x +
          moduleServer(
    363 - 2x + 2x +
            id = id,
    364 - 2x + 2x +
            function(input, output, session) {
    365 - 2x + 2x +
              logger::log_trace("MAEFilteredDataset$srv_add initializing, dataname: { deparse1(self$get_dataname()) }")
    366 - 2x + 2x +
              elems <- private$get_filter_states()
    367 - 2x + 2x +
              elem_names <- names(private$get_filter_states())
    368 - 2x + 2x +
              lapply(
    369 - 2x + 2x +
                elem_names,
    370 - 2x + 2x +
                function(elem_name) elems[[elem_name]]$srv_add(elem_name)
    @@ -15469,14 +16101,16 @@

    teal.slice coverage - 65.73%

    372 - 2x + 2x +
              logger::log_trace("MAEFilteredDataset$srv_add initialized, dataname: { deparse1(self$get_dataname()) }")
    373 - 2x + 2x +
              NULL
    @@ -15616,28 +16250,32 @@

    teal.slice coverage - 65.73%

    393 - 225x + 225x +
          checkmate::assert_class(filter_states, "FilterStates")
    394 - 225x + 225x +
          checkmate::assert_string(id)
    395 - 225x + 225x +
          x <- stats::setNames(list(filter_states), id)
    396 - 225x + 225x +
          private$filter_states <- c(private$get_filter_states(), x)
    @@ -15700,7 +16338,8 @@

    teal.slice coverage - 65.73%

    405 - 684x + 684x +
          private$filter_states
    @@ -16707,21 +17346,24 @@

    teal.slice coverage - 65.73%

    140 - 24x + 24x +
          shiny::isolate({
    141 - 24x + 24x +
            checkmate::assert_date(x)
    142 - 23x + 23x +
            checkmate::assert_class(x_reactive, "reactive")
    @@ -16735,35 +17377,40 @@

    teal.slice coverage - 65.73%

    144 - 23x + 23x +
            super$initialize(
    145 - 23x + 23x +
              x = x,
    146 - 23x + 23x +
              x_reactive = x_reactive,
    147 - 23x + 23x +
              slice = slice,
    148 - 23x + 23x +
              extract_type = extract_type
    @@ -16777,28 +17424,32 @@

    teal.slice coverage - 65.73%

    150 - 23x + 23x +
            checkmate::assert_date(slice$choices, null.ok = TRUE)
    151 - 22x + 22x +
            private$set_choices(slice$choices)
    152 - 14x + 14x +
            if (is.null(slice$selected)) slice$selected <- slice$choices
    153 - 22x + 22x +
            private$set_selected(slice$selected)
    @@ -16819,7 +17470,8 @@

    teal.slice coverage - 65.73%

    156 - 21x + 21x +
          invisible(self)
    @@ -16903,14 +17555,16 @@

    teal.slice coverage - 65.73%

    168 - 7x + 7x +
          if (isFALSE(private$is_any_filtered())) {
    169 - 1x + 1x +
            return(NULL)
    @@ -16924,28 +17578,32 @@

    teal.slice coverage - 65.73%

    171 - 6x + 6x +
          choices <- as.character(private$get_selected())
    172 - 6x + 6x +
          varname <- private$get_varname_prefixed(dataname)
    173 - 6x + 6x +
          filter_call <-
    174 - 6x + 6x +
            call(
    @@ -16959,14 +17617,16 @@

    teal.slice coverage - 65.73%

    176 - 6x + 6x +
              call(">=", varname, call("as.Date", choices[1L])),
    177 - 6x + 6x +
              call("<=", varname, call("as.Date", choices[2L]))
    @@ -16980,7 +17640,8 @@

    teal.slice coverage - 65.73%

    179 - 6x + 6x +
          private$add_keep_na_call(filter_call, varname)
    @@ -17036,14 +17697,16 @@

    teal.slice coverage - 65.73%

    187 - 22x + 22x +
          if (is.null(choices)) {
    188 - 19x + 19x +
            choices <- range(private$x, na.rm = TRUE)
    @@ -17057,35 +17720,40 @@

    teal.slice coverage - 65.73%

    190 - 3x + 3x +
            choices_adjusted <- c(max(choices[1L], min(private$x)), min(choices[2L], max(private$x)))
    191 - 3x + 3x +
            if (any(choices != choices_adjusted)) {
    192 - 1x + 1x +
              warning(sprintf(
    193 - 1x + 1x +
                "Choices adjusted (some values outside of variable range). Varname: %s, dataname: %s.",
    194 - 1x + 1x +
                private$get_varname(), private$get_dataname()
    @@ -17099,7 +17767,8 @@

    teal.slice coverage - 65.73%

    196 - 1x + 1x +
              choices <- choices_adjusted
    @@ -17113,35 +17782,40 @@

    teal.slice coverage - 65.73%

    198 - 3x + 3x +
            if (choices[1L] >= choices[2L]) {
    199 - 1x + 1x +
              warning(sprintf(
    200 - 1x + 1x +
                "Invalid choices: lower is higher / equal to upper, or not in range of variable values.
    201 - 1x + 1x +
                Setting defaults. Varname: %s, dataname: %s.",
    202 - 1x + 1x +
                private$get_varname(), private$get_dataname()
    @@ -17155,7 +17829,8 @@

    teal.slice coverage - 65.73%

    204 - 1x + 1x +
              choices <- range(private$x, na.rm = TRUE)
    @@ -17176,28 +17851,32 @@

    teal.slice coverage - 65.73%

    207 - 22x + 22x +
          private$set_is_choice_limited(private$x, choices)
    208 - 22x + 22x +
          private$x <- private$x[(private$x >= choices[1L] & private$x <= choices[2L]) | is.na(private$x)]
    209 - 22x + 22x +
          private$teal_slice$choices <- choices
    210 - 22x + 22x +
          invisible(NULL)
    @@ -17239,14 +17918,16 @@

    teal.slice coverage - 65.73%

    216 - 22x + 22x +
          private$is_choice_limited <- (any(xl < choices[1L], na.rm = TRUE) | any(xl > choices[2L], na.rm = TRUE))
    217 - 22x + 22x +
          invisible(NULL)
    @@ -17267,21 +17948,24 @@

    teal.slice coverage - 65.73%

    220 - 33x + 33x +
          tryCatch(
    221 - 33x + 33x +
            expr = {
    222 - 33x + 33x +
              values <- as.Date(values, origin = "1970-01-01")
    @@ -17295,7 +17979,8 @@

    teal.slice coverage - 65.73%

    224 - 30x + 30x +
              values
    @@ -17309,7 +17994,8 @@

    teal.slice coverage - 65.73%

    226 - 33x + 33x +
            error = function(e) stop("Vector of set values must contain values coercible to Date.")
    @@ -17337,42 +18023,48 @@

    teal.slice coverage - 65.73%

    230 - 1x + 1x +
          if (length(values) != 2) stop("Vector of set values must have length two.")
    231 - 29x + 29x +
          if (values[1] > values[2]) {
    232 - 1x + 1x +
            warning(
    233 - 1x + 1x +
              sprintf(
    234 - 1x + 1x +
                "Start date %s is set after the end date %s, the values will be replaced with a default date range.",
    235 - 1x + 1x +
                values[1], values[2]
    @@ -17393,7 +18085,8 @@

    teal.slice coverage - 65.73%

    238 - 1x + 1x +
            values <- isolate(private$get_choices())
    @@ -17407,7 +18100,8 @@

    teal.slice coverage - 65.73%

    240 - 29x + 29x +
          values
    @@ -17428,42 +18122,48 @@

    teal.slice coverage - 65.73%

    243 - 29x + 29x +
          choices <- private$get_choices()
    244 - 29x + 29x +
          if (values[1] < choices[1L] | values[1] > choices[2L]) {
    245 - 5x + 5x +
            warning(
    246 - 5x + 5x +
              sprintf(
    247 - 5x + 5x +
                "Value: %s is outside of the possible range for column %s of dataset %s, setting minimum possible value.",
    248 - 5x + 5x +
                values[1], private$get_varname(), private$get_dataname()
    @@ -17484,7 +18184,8 @@

    teal.slice coverage - 65.73%

    251 - 5x + 5x +
            values[1] <- choices[1L]
    @@ -17505,35 +18206,40 @@

    teal.slice coverage - 65.73%

    254 - 29x + 29x +
          if (values[2] > choices[2L] | values[2] < choices[1L]) {
    255 - 5x + 5x +
            warning(
    256 - 5x + 5x +
              sprintf(
    257 - 5x + 5x +
                "Value: %s is outside of the possible range for column %s of dataset %s, setting maximum possible value.",
    258 - 5x + 5x +
                values[2], private$get_varname(), private$get_dataname()
    @@ -17554,7 +18260,8 @@

    teal.slice coverage - 65.73%

    261 - 5x + 5x +
            values[2] <- choices[2L]
    @@ -17575,7 +18282,8 @@

    teal.slice coverage - 65.73%

    264 - 29x + 29x +
          values
    @@ -19464,49 +20172,56 @@

    teal.slice coverage - 65.73%

    96 - 764x + 764x +
      slices <- list(...)
    97 - 764x + 764x +
      checkmate::assert_list(slices, types = "teal_slice", any.missing = FALSE)
    98 - 763x + 763x +
      slices_id <- shiny::isolate(vapply(slices, `[[`, character(1L), "id"))
    99 - 763x + 763x +
      if (any(duplicated(slices_id))) {
    100 - 1x + 1x +
        stop(
    101 - 1x + 1x +
          "Some teal_slice objects have the same id:\n",
    102 - 1x + 1x +
          toString(unique(slices_id[duplicated(slices_id)]))
    @@ -19527,35 +20242,40 @@

    teal.slice coverage - 65.73%

    105 - 762x + 762x +
      checkmate::assert_list(exclude_varnames, names = "named", types = "character", null.ok = TRUE, min.len = 1)
    106 - 761x + 761x +
      checkmate::assert_list(include_varnames, names = "named", types = "character", null.ok = TRUE, min.len = 1)
    107 - 760x + 760x +
      checkmate::assert_character(count_type, len = 1, null.ok = TRUE)
    108 - 758x + 758x +
      checkmate::assert_subset(count_type, choices = c("all", "none"), empty.ok = TRUE)
    109 - 757x + 757x +
      checkmate::assert_logical(allow_add)
    @@ -19569,35 +20289,40 @@

    teal.slice coverage - 65.73%

    111 - 756x + 756x +
      duplicated_datasets <- intersect(names(include_varnames), names(exclude_varnames))
    112 - 756x + 756x +
      if (length(duplicated_datasets)) {
    113 - 1x + 1x +
        stop(
    114 - 1x + 1x +
          "Some datasets are specified in both, include_varnames and exclude_varnames:\n",
    115 - 1x + 1x +
          toString(duplicated_datasets)
    @@ -19625,49 +20350,56 @@

    teal.slice coverage - 65.73%

    119 - 755x + 755x +
      structure(
    120 - 755x + 755x +
        slices,
    121 - 755x + 755x +
        exclude_varnames = exclude_varnames,
    122 - 755x + 755x +
        include_varnames = include_varnames,
    123 - 755x + 755x +
        count_type = count_type,
    124 - 755x + 755x +
        allow_add = allow_add,
    125 - 755x + 755x +
        class = c("teal_slices", class(slices))
    @@ -19737,7 +20469,8 @@

    teal.slice coverage - 65.73%

    135 - 465x + 465x +
      inherits(x, "teal_slices")
    @@ -19898,21 +20631,24 @@

    teal.slice coverage - 65.73%

    158 - 1077x + 1077x +
      ans <- unclass(x)
    159 - 45x + 45x +
      if (recursive) ans[] <- lapply(ans, as.list)
    160 - 1077x + 1077x +
      ans
    @@ -19975,21 +20711,24 @@

    teal.slice coverage - 65.73%

    169 - 3x + 3x +
      if (missing(i)) i <- seq_along(x)
    170 - 506x + 506x +
      if (length(i) == 0L) {
    171 - 178x + 178x +
        return(x[0])
    @@ -20003,35 +20742,40 @@

    teal.slice coverage - 65.73%

    173 - 1x + 1x +
      if (is.logical(i) && length(i) > length(x)) stop("subscript out of bounds")
    174 - 1x + 1x +
      if (is.numeric(i) && max(i) > length(x)) stop("subscript out of bounds")
    175 - 326x + 326x +
      if (is.character(i)) {
    176 - 1x + 1x +
        if (!all(is.element(i, names(x)))) stop("subscript out of bounds")
    177 - 2x + 2x +
        i <- which(is.element(i, names(x)))
    @@ -20052,35 +20796,40 @@

    teal.slice coverage - 65.73%

    180 - 325x + 325x +
      y <- NextMethod("[")
    181 - 325x + 325x +
      attrs <- attributes(x)
    182 - 325x + 325x +
      attrs$names <- attrs$names[i]
    183 - 325x + 325x +
      attributes(y) <- attrs
    184 - 325x + 325x +
      y
    @@ -20143,14 +20892,16 @@

    teal.slice coverage - 65.73%

    193 - 252x + 252x +
      x <- list(...)
    194 - 252x + 252x +
      checkmate::assert_true(all(vapply(x, is.teal_slices, logical(1L))), .var.name = "all arguments are teal_slices")
    @@ -20164,21 +20915,24 @@

    teal.slice coverage - 65.73%

    196 - 251x + 251x +
      all_attributes <- lapply(x, attributes)
    197 - 251x + 251x +
      all_attributes <- coalesce_r(all_attributes)
    198 - 251x + 251x +
      all_attributes <- all_attributes[names(all_attributes) != "class"]
    @@ -20192,35 +20946,40 @@

    teal.slice coverage - 65.73%

    200 - 251x + 251x +
      do.call(
    201 - 251x + 251x +
        teal_slices,
    202 - 251x + 251x +
        c(
    203 - 251x + 251x +
          unique(unlist(x, recursive = FALSE)),
    204 - 251x + 251x +
          all_attributes
    @@ -20311,14 +21070,16 @@

    teal.slice coverage - 65.73%

    217 - 45x + 45x +
      checkmate::assert_flag(show_all)
    218 - 45x + 45x +
      checkmate::assert_flag(trim_lines)
    @@ -20332,35 +21093,40 @@

    teal.slice coverage - 65.73%

    220 - 45x + 45x +
      x <- as.list(x, recursive = TRUE)
    221 - 45x + 45x +
      attrs <- attributes(x)
    222 - 45x + 45x +
      attributes(x) <- NULL
    223 - 45x + 45x +
      slices_list <- list(slices = x, attributes = attrs)
    224 - 45x + 45x +
      slices_list <- Filter(Negate(is.null), slices_list) # drop attributes if empty
    @@ -20374,7 +21140,8 @@

    teal.slice coverage - 65.73%

    226 - 20x + 20x +
      if (!show_all) slices_list$slices <- lapply(slices_list$slices, function(slice) Filter(Negate(is.null), slice))
    @@ -20388,7 +21155,8 @@

    teal.slice coverage - 65.73%

    228 - 45x + 45x +
      jsonify(slices_list, trim_lines)
    @@ -20444,7 +21212,8 @@

    teal.slice coverage - 65.73%

    236 - 2x + 2x +
      cat(format(x, ...), "\n")
    @@ -20528,21 +21297,24 @@

    teal.slice coverage - 65.73%

    248 - 14x + 14x +
      Filter(
    249 - 14x + 14x +
        function(xx) {
    250 - 12x + 12x +
          !any(vapply(y, function(yy) identical(yy, xx), logical(1)))
    @@ -20556,7 +21328,8 @@

    teal.slice coverage - 65.73%

    252 - 14x + 14x +
        x
    @@ -20703,28 +21476,32 @@

    teal.slice coverage - 65.73%

    273 - 1569x + 1569x +
      checkmate::assert_list(x)
    274 - 1568x + 1568x +
      xnn <- Filter(Negate(is.null), x)
    275 - 1568x + 1568x +
      if (all(vapply(xnn, is.atomic, logical(1L)))) {
    276 - 1059x + 1059x +
        return(xnn[[1L]])
    @@ -20738,21 +21515,24 @@

    teal.slice coverage - 65.73%

    278 - 509x + 509x +
      lapply(x, checkmate::assert_list, names = "named", null.ok = TRUE, .var.name = "list element")
    279 - 508x + 508x +
      all_names <- unique(unlist(lapply(x, names)))
    280 - 508x + 508x +
      sapply(all_names, function(nm) coalesce_r(lapply(x, `[[`, nm)), simplify = FALSE)
    @@ -21262,21 +22042,24 @@

    teal.slice coverage - 65.73%

    71 - 15x + 15x +
          checkmate::assert_class(slice, "teal_slice_expr")
    72 - 14x + 14x +
          private$teal_slice <- slice
    73 - 14x + 14x +
          invisible(self)
    @@ -21360,28 +22143,32 @@

    teal.slice coverage - 65.73%

    85 - 12x + 12x +
          sprintf(
    86 - 12x + 12x +
            "%s:\n%s",
    87 - 12x + 12x +
            class(self)[1],
    88 - 12x + 12x +
            format(self$get_state(), show_all = show_all, trim_lines = trim_lines)
    @@ -21444,7 +22231,8 @@

    teal.slice coverage - 65.73%

    97 - 1x + 1x +
          cat(shiny::isolate(self$format(...)))
    @@ -21507,7 +22295,8 @@

    teal.slice coverage - 65.73%

    106 - 26x + 26x +
          private$teal_slice
    @@ -21584,14 +22373,16 @@

    teal.slice coverage - 65.73%

    117 - 1x + 1x +
          checkmate::assert_class(state, "teal_slice_expr")
    118 - 1x + 1x +
          invisible(self)
    @@ -21689,7 +22480,8 @@

    teal.slice coverage - 65.73%

    132 - 2x + 2x +
          shiny::isolate(str2lang(private$teal_slice$expr))
    @@ -23711,56 +24503,64 @@

    teal.slice coverage - 65.73%

    152 - 121x + 121x +
          shiny::isolate({
    153 - 121x + 121x +
            checkmate::assert_numeric(x, all.missing = FALSE)
    154 - 2x + 2x +
            if (!any(is.finite(x))) stop("\"x\" contains no finite values")
    155 - 118x + 118x +
            super$initialize(x = x, x_reactive = x_reactive, slice = slice, extract_type = extract_type)
    156 - 118x + 118x +
            private$is_integer <- checkmate::test_integerish(x)
    157 - 118x + 118x +
            private$inf_count <- sum(is.infinite(x))
    158 - 118x + 118x +
            private$inf_filtered_count <- reactive(
    159 - 118x + 118x +
              if (!is.null(private$x_reactive())) sum(is.infinite(private$x_reactive()))
    @@ -23781,14 +24581,16 @@

    teal.slice coverage - 65.73%

    162 - 118x + 118x +
            checkmate::assert_numeric(slice$choices, null.ok = TRUE)
    163 - 3x + 3x +
            if (is.null(slice$keep_inf) && any(is.infinite(x))) slice$keep_inf <- TRUE
    @@ -23802,21 +24604,24 @@

    teal.slice coverage - 65.73%

    165 - 117x + 117x +
            private$set_choices(slice$choices)
    166 - 42x + 42x +
            if (is.null(slice$selected)) slice$selected <- slice$choices
    167 - 117x + 117x +
            private$set_selected(slice$selected)
    @@ -23830,21 +24635,24 @@

    teal.slice coverage - 65.73%

    169 - 114x + 114x +
            private$is_integer <- checkmate::test_integerish(x)
    170 - 114x + 114x +
            private$inf_filtered_count <- reactive(
    171 - 114x + 114x +
              if (!is.null(private$x_reactive())) sum(is.infinite(private$x_reactive()))
    @@ -23858,7 +24666,8 @@

    teal.slice coverage - 65.73%

    173 - 114x + 114x +
            private$inf_count <- sum(is.infinite(x))
    @@ -23872,63 +24681,72 @@

    teal.slice coverage - 65.73%

    175 - 114x + 114x +
            private$plot_data <- list(
    176 - 114x + 114x +
              type = "histogram",
    177 - 114x + 114x +
              nbinsx = 50,
    178 - 114x + 114x +
              x = Filter(Negate(is.na), Filter(is.finite, private$x)),
    179 - 114x + 114x +
              color = I(fetch_bs_color("secondary")),
    180 - 114x + 114x +
              alpha = 0.2,
    181 - 114x + 114x +
              bingroup = 1,
    182 - 114x + 114x +
              showlegend = FALSE,
    183 - 114x + 114x +
              hoverinfo = "none"
    @@ -23942,21 +24760,24 @@

    teal.slice coverage - 65.73%

    185 - 114x + 114x +
            private$plot_mask <- list(list(
    186 - 114x + 114x +
              type = "rect", fillcolor = rgb(1, 1, 1, .65), line = list(width = 0),
    187 - 114x + 114x +
              x0 = -0.5, x1 = 1.5, y0 = -0.5, y1 = 1.5, xref = "paper", yref = "paper"
    @@ -23970,84 +24791,96 @@

    teal.slice coverage - 65.73%

    189 - 114x + 114x +
            private$plot_layout <- reactive({
    190 - 5x + 5x +
              shapes <- private$get_shape_properties(private$get_selected())
    191 - 5x + 5x +
              list(
    192 - 5x + 5x +
                barmode = "overlay",
    193 - 5x + 5x +
                xaxis = list(
    194 - 5x + 5x +
                  range = private$get_choices() * c(0.995, 1.005),
    195 - 5x + 5x +
                  rangeslider = list(thickness = 0),
    196 - 5x + 5x +
                  showticklabels = TRUE,
    197 - 5x + 5x +
                  ticks = "outside",
    198 - 5x + 5x +
                  ticklen = 1.5,
    199 - 5x + 5x +
                  tickmode = "auto",
    200 - 5x + 5x +
                  nticks = 10
    @@ -24061,35 +24894,40 @@

    teal.slice coverage - 65.73%

    202 - 5x + 5x +
                yaxis = list(showgrid = FALSE, showticklabels = FALSE),
    203 - 5x + 5x +
                margin = list(b = 17, l = 0, r = 0, t = 0, autoexpand = FALSE),
    204 - 5x + 5x +
                plot_bgcolor = "#FFFFFF00",
    205 - 5x + 5x +
                paper_bgcolor = "#FFFFFF00",
    206 - 5x + 5x +
                shapes = shapes
    @@ -24110,35 +24948,40 @@

    teal.slice coverage - 65.73%

    209 - 114x + 114x +
            private$plot_config <- reactive({
    210 - 5x + 5x +
              list(
    211 - 5x + 5x +
                doubleClick = "reset",
    212 - 5x + 5x +
                displayModeBar = FALSE,
    213 - 5x + 5x +
                edits = list(shapePosition = TRUE)
    @@ -24159,49 +25002,56 @@

    teal.slice coverage - 65.73%

    216 - 114x + 114x +
            private$plot_filtered <- reactive({
    217 - 5x + 5x +
              finite_values <- Filter(is.finite, private$x_reactive())
    218 - 5x + 5x +
              if (!identical(finite_values, numeric(0))) {
    219 - 5x + 5x +
                list(
    220 - 5x + 5x +
                  x = finite_values,
    221 - 5x + 5x +
                  bingroup = 1,
    222 - 5x + 5x +
                  color = I(fetch_bs_color("primary"))
    @@ -24229,7 +25079,8 @@

    teal.slice coverage - 65.73%

    226 - 114x + 114x +
            invisible(self)
    @@ -24320,14 +25171,16 @@

    teal.slice coverage - 65.73%

    239 - 35x + 35x +
          if (isFALSE(private$is_any_filtered())) {
    240 - 1x + 1x +
            return(NULL)
    @@ -24341,28 +25194,32 @@

    teal.slice coverage - 65.73%

    242 - 4x + 4x +
          if (missing(dataname)) dataname <- private$get_dataname()
    243 - 34x + 34x +
          varname <- private$get_varname_prefixed(dataname)
    244 - 34x + 34x +
          filter_call <-
    245 - 34x + 34x +
            call(
    @@ -24376,14 +25233,16 @@

    teal.slice coverage - 65.73%

    247 - 34x + 34x +
              call(">=", varname, private$get_selected()[1L]),
    248 - 34x + 34x +
              call("<=", varname, private$get_selected()[2L])
    @@ -24397,7 +25256,8 @@

    teal.slice coverage - 65.73%

    250 - 34x + 34x +
          private$add_keep_na_call(private$add_keep_inf_call(filter_call, varname), varname)
    @@ -24579,21 +25439,24 @@

    teal.slice coverage - 65.73%

    276 - 117x + 117x +
          x <- private$x[is.finite(private$x)]
    277 - 117x + 117x +
          if (is.null(choices)) {
    278 - 105x + 105x +
            choices <- range(x)
    @@ -24607,35 +25470,40 @@

    teal.slice coverage - 65.73%

    280 - 12x + 12x +
            choices_adjusted <- c(max(choices[1L], min(x)), min(choices[2L], max(x)))
    281 - 12x + 12x +
            if (any(choices != choices_adjusted)) {
    282 - 1x + 1x +
              warning(sprintf(
    283 - 1x + 1x +
                "Choices adjusted (some values outside of variable range). Varname: %s, dataname: %s.",
    284 - 1x + 1x +
                private$get_varname(), private$get_dataname()
    @@ -24649,7 +25517,8 @@

    teal.slice coverage - 65.73%

    286 - 1x + 1x +
              choices <- choices_adjusted
    @@ -24663,35 +25532,40 @@

    teal.slice coverage - 65.73%

    288 - 12x + 12x +
            if (choices[1L] > choices[2L]) {
    289 - 1x + 1x +
              warning(sprintf(
    290 - 1x + 1x +
                "Invalid choices: lower is higher / equal to upper, or not in range of variable values.
    291 - 1x + 1x +
                Setting defaults. Varname: %s, dataname: %s.",
    292 - 1x + 1x +
                private$get_varname(), private$get_dataname()
    @@ -24705,7 +25579,8 @@

    teal.slice coverage - 65.73%

    294 - 1x + 1x +
              choices <- range(x)
    @@ -24733,21 +25608,24 @@

    teal.slice coverage - 65.73%

    298 - 117x + 117x +
          private$set_is_choice_limited(private$x, choices)
    299 - 117x + 117x +
          private$x <- private$x[
    300 - 117x + 117x +
            (private$x >= choices[1L] & private$x <= choices[2L]) | is.na(private$x) | !is.finite(private$x)
    @@ -24768,7 +25646,8 @@

    teal.slice coverage - 65.73%

    303 - 117x + 117x +
          x_range <- range(private$x, finite = TRUE)
    @@ -24789,14 +25668,16 @@

    teal.slice coverage - 65.73%

    306 - 117x + 117x +
          if (identical(diff(x_range), 0)) {
    307 - 2x + 2x +
            choices <- x_range
    @@ -24810,21 +25691,24 @@

    teal.slice coverage - 65.73%

    309 - 115x + 115x +
            x_pretty <- pretty(x_range, 100L)
    310 - 115x + 115x +
            choices <- range(x_pretty)
    311 - 115x + 115x +
            private$numeric_step <- signif(private$get_pretty_range_step(x_pretty), digits = 10)
    @@ -24838,14 +25722,16 @@

    teal.slice coverage - 65.73%

    313 - 117x + 117x +
          private$teal_slice$choices <- choices
    314 - 117x + 117x +
          invisible(NULL)
    @@ -24887,28 +25773,32 @@

    teal.slice coverage - 65.73%

    320 - 117x + 117x +
          xl <- xl[!is.na(xl)]
    321 - 117x + 117x +
          xl <- xl[is.finite(xl)]
    322 - 117x + 117x +
          private$is_choice_limited <- (any(xl < choices[1L]) | any(xl > choices[2L]))
    323 - 117x + 117x +
          invisible(NULL)
    @@ -24950,14 +25840,16 @@

    teal.slice coverage - 65.73%

    329 - 34x + 34x +
          if (isTRUE(private$get_keep_inf())) {
    330 - 2x + 2x +
            call("|", call("is.infinite", varname), filter_call)
    @@ -24971,7 +25863,8 @@

    teal.slice coverage - 65.73%

    332 - 32x + 32x +
            filter_call
    @@ -25034,14 +25927,16 @@

    teal.slice coverage - 65.73%

    341 - 117x + 117x +
          if (private$is_integer && diff(range(pretty_range) > 2)) {
    342 - 46x + 46x +
            return(1L)
    @@ -25055,21 +25950,24 @@

    teal.slice coverage - 65.73%

    344 - 71x + 71x +
            n_steps <- length(pretty_range) - 1
    345 - 71x + 71x +
            return(
    346 - 71x + 71x +
              signif(digits = 10, (max(pretty_range) - min(pretty_range)) / n_steps)
    @@ -25104,35 +26002,40 @@

    teal.slice coverage - 65.73%

    351 - 133x + 133x +
          tryCatch(
    352 - 133x + 133x +
            expr = {
    353 - 133x + 133x +
              values <- as.numeric(values)
    354 - 4x + 4x +
              if (anyNA(values)) stop()
    355 - 129x + 129x +
              values
    @@ -25146,7 +26049,8 @@

    teal.slice coverage - 65.73%

    357 - 133x + 133x +
            error = function(e) stop("Vector of set values must contain values coercible to numeric")
    @@ -25181,21 +26085,24 @@

    teal.slice coverage - 65.73%

    362 - 2x + 2x +
          if (length(values) != 2L) stop("Vector of set values must have length two.")
    363 - 2x + 2x +
          if (values[1L] > values[2L]) stop("Vector of set values must be sorted.")
    364 - 125x + 125x +
          values
    @@ -25223,21 +26130,24 @@

    teal.slice coverage - 65.73%

    368 - 2x + 2x +
          if (values[1L] < private$get_choices()[1L]) values[1L] <- private$get_choices()[1L]
    369 - 2x + 2x +
          if (values[2L] > private$get_choices()[2L]) values[2L] <- private$get_choices()[2L]
    370 - 125x + 125x +
          values
    @@ -25279,35 +26189,40 @@

    teal.slice coverage - 65.73%

    376 - 35x + 35x +
          if (private$is_choice_limited) {
    377 - 1x + 1x +
            TRUE
    378 - 34x + 34x +
          } else if (!isTRUE(all.equal(private$get_selected(), private$get_choices()))) {
    379 - 32x + 32x +
            TRUE
    380 - 2x + 2x +
          } else if (!isTRUE(private$get_keep_inf()) && private$inf_count > 0) {
    @@ -25321,14 +26236,16 @@

    teal.slice coverage - 65.73%

    382 - 2x + 2x +
          } else if (!isTRUE(private$get_keep_na()) && private$na_count > 0) {
    383 - 1x + 1x +
            TRUE
    @@ -25342,7 +26259,8 @@

    teal.slice coverage - 65.73%

    385 - 1x + 1x +
            FALSE
    @@ -25391,21 +26309,24 @@

    teal.slice coverage - 65.73%

    392 - 5x + 5x +
          list(
    393 - 5x + 5x +
            list(type = "line", x0 = values[1], x1 = values[1], y0 = -100, y1 = 100, yref = "paper"),
    394 - 5x + 5x +
            list(type = "line", x0 = values[2], x1 = values[2], y0 = -100, y1 = 100, yref = "paper")
    @@ -25489,70 +26410,80 @@

    teal.slice coverage - 65.73%

    406 - 5x + 5x +
          ns <- NS(id)
    407 - 5x + 5x +
          shiny::isolate({
    408 - 5x + 5x +
            ui_input <- shinyWidgets::numericRangeInput(
    409 - 5x + 5x +
              inputId = ns("selection_manual"),
    410 - 5x + 5x +
              label = NULL,
    411 - 5x + 5x +
              min = private$get_choices()[1L],
    412 - 5x + 5x +
              max = private$get_choices()[2L],
    413 - 5x + 5x +
              value = private$get_selected(),
    414 - 5x + 5x +
              step = private$numeric_step,
    415 - 5x + 5x +
              width = "100%"
    @@ -25566,28 +26497,32 @@

    teal.slice coverage - 65.73%

    417 - 5x + 5x +
            tagList(
    418 - 5x + 5x +
              div(
    419 - 5x + 5x +
                class = "choices_state",
    420 - 5x + 5x +
                tags$head(tags$script(
    @@ -25615,21 +26550,24 @@

    teal.slice coverage - 65.73%

    424 - 5x + 5x +
                  HTML(
    425 - 5x + 5x +
                    '$(document).ready(function() {
    426 - 5x + 5x +
                      $("[data-toggle=\'popover\']").popover();
    @@ -25643,35 +26581,40 @@

    teal.slice coverage - 65.73%

    428 - 5x + 5x +
                      $(document).on("click", function (e) {
    429 - 5x + 5x +
                        if (!$("[data-toggle=\'popover\']").is(e.target) &&
    430 - 5x + 5x +
                            $("[data-toggle=\'popover\']").has(e.target).length === 0 &&
    431 - 5x + 5x +
                            $(".popover").has(e.target).length === 0) {
    432 - 5x + 5x +
                          $("[data-toggle=\'popover\']").popover("hide");
    @@ -25713,105 +26656,120 @@

    teal.slice coverage - 65.73%

    438 - 5x + 5x +
                div(
    439 - 5x + 5x +
                  actionLink(
    440 - 5x + 5x +
                    ns("plotly_info"),
    441 - 5x + 5x +
                    label = NULL,
    442 - 5x + 5x +
                    icon = icon("question-circle"),
    443 - 5x + 5x +
                    "data-toggle" = "popover",
    444 - 5x + 5x +
                    "data-html" = "true",
    445 - 5x + 5x +
                    "data-placement" = "left",
    446 - 5x + 5x +
                    "data-trigger" = "click",
    447 - 5x + 5x +
                    "data-title" = "Plot actions",
    448 - 5x + 5x +
                    "data-content" = "<p>
    449 - 5x + 5x +
                                      Drag vertical lines to set selection.<br>
    450 - 5x + 5x +
                                      Drag across plot to zoom in.<br>
    451 - 5x + 5x +
                                      Drag axis to pan.<br>
    452 - 5x + 5x +
                                      Double click to zoom out."
    @@ -25825,7 +26783,8 @@

    teal.slice coverage - 65.73%

    454 - 5x + 5x +
                  style = "text-align: right; font-size: 0.7em; margin-bottom: -1em; position: relative; z-index: 9;"
    @@ -25839,35 +26798,40 @@

    teal.slice coverage - 65.73%

    456 - 5x + 5x +
                shinycssloaders::withSpinner(
    457 - 5x + 5x +
                  plotly::plotlyOutput(ns("plot"), height = "50px"),
    458 - 5x + 5x +
                  type = 4,
    459 - 5x + 5x +
                  size = 0.25,
    460 - 5x + 5x +
                  hide.ui = FALSE
    @@ -25881,7 +26845,8 @@

    teal.slice coverage - 65.73%

    462 - 5x + 5x +
                ui_input
    @@ -25895,28 +26860,32 @@

    teal.slice coverage - 65.73%

    464 - 5x + 5x +
              div(
    465 - 5x + 5x +
                class = "filter-card-body-keep-na-inf",
    466 - 5x + 5x +
                private$keep_inf_ui(ns("keep_inf")),
    467 - 5x + 5x +
                private$keep_na_ui(ns("keep_na"))
    @@ -26000,28 +26969,32 @@

    teal.slice coverage - 65.73%

    479 - 5x + 5x +
          moduleServer(
    480 - 5x + 5x +
            id = id,
    481 - 5x + 5x +
            function(input, output, session) {
    482 - 5x + 5x +
              logger::log_trace("RangeFilterState$server initializing, id: { private$get_id() }")
    @@ -26042,7 +27015,8 @@

    teal.slice coverage - 65.73%

    485 - 5x + 5x +
              selection_manual <- debounce(reactive(input$selection_manual), 200)
    @@ -26063,7 +27037,8 @@

    teal.slice coverage - 65.73%

    488 - 5x + 5x +
              plot_data <- c(private$plot_data, source = session$ns("histogram_plot"))
    @@ -26084,42 +27059,48 @@

    teal.slice coverage - 65.73%

    491 - 5x + 5x +
              output$plot <- plotly::renderPlotly({
    492 - 5x + 5x +
                histogram <- do.call(plotly::plot_ly, plot_data)
    493 - 5x + 5x +
                histogram <- do.call(plotly::layout, c(list(p = histogram), private$plot_layout()))
    494 - 5x + 5x +
                histogram <- do.call(plotly::config, c(list(p = histogram), private$plot_config()))
    495 - 5x + 5x +
                histogram <- do.call(plotly::add_histogram, c(list(p = histogram), private$plot_filtered()))
    496 - 5x + 5x +
                histogram
    @@ -26147,63 +27128,72 @@

    teal.slice coverage - 65.73%

    500 - 5x + 5x +
              private$observers$relayout <-
    501 - 5x + 5x +
                observeEvent(
    502 - 5x + 5x +
                  ignoreNULL = FALSE,
    503 - 5x + 5x +
                  ignoreInit = TRUE,
    504 - 5x + 5x +
                  eventExpr = plotly::event_data("plotly_relayout", source = session$ns("histogram_plot")),
    505 - 5x + 5x +
                  handlerExpr = {
    506 - 1x + 1x +
                    logger::log_trace("RangeFilterState$server@1 selection changed, id: { private$get_id() }")
    507 - 1x + 1x +
                    event <- plotly::event_data("plotly_relayout", source = session$ns("histogram_plot"))
    508 - 1x + 1x +
                    if (any(grepl("shapes", names(event)))) {
    @@ -26392,42 +27382,48 @@

    teal.slice coverage - 65.73%

    535 - 5x + 5x +
              private$observers$selection_api <-
    536 - 5x + 5x +
                observeEvent(
    537 - 5x + 5x +
                  ignoreNULL = FALSE,
    538 - 5x + 5x +
                  ignoreInit = TRUE,
    539 - 5x + 5x +
                  eventExpr = private$get_selected(),
    540 - 5x + 5x +
                  handlerExpr = {
    @@ -26518,35 +27514,40 @@

    teal.slice coverage - 65.73%

    553 - 5x + 5x +
              private$observers$selection_manual <- observeEvent(
    554 - 5x + 5x +
                ignoreNULL = FALSE,
    555 - 5x + 5x +
                ignoreInit = TRUE,
    556 - 5x + 5x +
                eventExpr = selection_manual(),
    557 - 5x + 5x +
                handlerExpr = {
    @@ -26812,14 +27813,16 @@

    teal.slice coverage - 65.73%

    595 - 5x + 5x +
              private$keep_inf_srv("keep_inf")
    596 - 5x + 5x +
              private$keep_na_srv("keep_na")
    @@ -26833,14 +27836,16 @@

    teal.slice coverage - 65.73%

    598 - 5x + 5x +
              logger::log_trace("RangeFilterState$server initialized, id: { private$get_id() }")
    599 - 5x + 5x +
              NULL
    @@ -27127,42 +28132,48 @@

    teal.slice coverage - 65.73%

    640 - 5x + 5x +
          selection <- private$get_selected()
    641 - 5x + 5x +
          tagList(
    642 - 5x + 5x +
            tags$span(shiny::HTML(selection[1], "&ndash;", selection[2]), class = "filter-card-summary-value"),
    643 - 5x + 5x +
            tags$span(
    644 - 5x + 5x +
              class = "filter-card-summary-controls",
    645 - 5x + 5x +
              if (private$na_count > 0) {
    @@ -27183,7 +28194,8 @@

    teal.slice coverage - 65.73%

    648 - 5x + 5x +
              if (private$inf_count > 0) {
    @@ -27274,7 +28286,8 @@

    teal.slice coverage - 65.73%

    661 - 5x + 5x +
          ns <- NS(id)
    @@ -27288,7 +28301,8 @@

    teal.slice coverage - 65.73%

    663 - 5x + 5x +
          if (private$inf_count > 0) {
    @@ -27428,7 +28442,8 @@

    teal.slice coverage - 65.73%

    683 - 5x + 5x +
            NULL
    @@ -27505,7 +28520,8 @@

    teal.slice coverage - 65.73%

    694 - 5x + 5x +
          moduleServer(id, function(input, output, session) {
    @@ -27533,42 +28549,48 @@

    teal.slice coverage - 65.73%

    698 - 5x + 5x +
            output$trigger_visible <- renderUI({
    699 - 5x + 5x +
              updateCountText(
    700 - 5x + 5x +
                inputId = "count_label",
    701 - 5x + 5x +
                label = "Keep Inf",
    702 - 5x + 5x +
                countmax = private$inf_count,
    703 - 5x + 5x +
                countnow = private$inf_filtered_count()
    @@ -27582,7 +28604,8 @@

    teal.slice coverage - 65.73%

    705 - 5x + 5x +
              NULL
    @@ -27624,35 +28647,40 @@

    teal.slice coverage - 65.73%

    711 - 5x + 5x +
            private$observers$keep_inf_api <- observeEvent(
    712 - 5x + 5x +
              ignoreNULL = TRUE, # its not possible for range that NULL is selected
    713 - 5x + 5x +
              ignoreInit = TRUE, # ignoreInit: should not matter because we set the UI with the desired initial state
    714 - 5x + 5x +
              eventExpr = private$get_keep_inf(),
    715 - 5x + 5x +
              handlerExpr = {
    @@ -27729,35 +28757,40 @@

    teal.slice coverage - 65.73%

    726 - 5x + 5x +
            private$observers$keep_inf <- observeEvent(
    727 - 5x + 5x +
              ignoreNULL = TRUE, # it's not possible for range that NULL is selected
    728 - 5x + 5x +
              ignoreInit = TRUE, # ignoreInit: should not matter because we set the UI with the desired initial state
    729 - 5x + 5x +
              eventExpr = input$value,
    730 - 5x + 5x +
              handlerExpr = {
    @@ -27806,7 +28839,8 @@

    teal.slice coverage - 65.73%

    737 - 5x + 5x +
            invisible(NULL)
    @@ -28358,35 +29392,40 @@

    teal.slice coverage - 65.73%

    74 - 368x + 368x +
          checkmate::assert_class(x_reactive, "reactive")
    75 - 367x + 367x +
          checkmate::assert_class(slice, "teal_slice")
    76 - 365x + 365x +
          checkmate::assert_character(extract_type, max.len = 1, any.missing = FALSE)
    77 - 365x + 365x +
          if (length(extract_type) == 1) {
    78 - 53x + 53x +
            checkmate::assert_choice(extract_type, choices = c("list", "matrix"))
    @@ -28414,14 +29453,16 @@

    teal.slice coverage - 65.73%

    82 - 364x + 364x +
          private$x <- x
    83 - 364x + 364x +
          private$x_reactive <- x_reactive
    @@ -28435,21 +29476,24 @@

    teal.slice coverage - 65.73%

    85 - 364x + 364x +
          private$na_count <- sum(is.na(x))
    86 - 364x + 364x +
          private$filtered_na_count <- reactive(
    87 - 364x + 364x +
            if (!is.null(private$x_reactive())) {
    @@ -28484,7 +29528,8 @@

    teal.slice coverage - 65.73%

    92 - 364x + 364x +
          private$extract_type <- extract_type
    @@ -28505,14 +29550,16 @@

    teal.slice coverage - 65.73%

    95 - 18x + 18x +
          if (is.null(shiny::isolate(slice$keep_na)) && anyNA(x)) slice$keep_na <- TRUE
    96 - 364x + 364x +
          private$teal_slice <- slice
    @@ -28526,7 +29573,8 @@

    teal.slice coverage - 65.73%

    98 - 364x + 364x +
          varlabel <- attr(x, "label")
    @@ -28540,21 +29588,24 @@

    teal.slice coverage - 65.73%

    100 - 364x + 364x +
          private$varlabel <-
    101 - 364x + 364x +
            if (is.null(varlabel) || identical(varlabel, private$get_varname())) {
    102 - 363x + 363x +
              character(0)
    @@ -28568,7 +29619,8 @@

    teal.slice coverage - 65.73%

    104 - 1x + 1x +
              varlabel
    @@ -28589,7 +29641,8 @@

    teal.slice coverage - 65.73%

    107 - 364x + 364x +
          private$state_history <- reactiveVal(list())
    @@ -28603,7 +29656,8 @@

    teal.slice coverage - 65.73%

    109 - 364x + 364x +
          logger::log_trace("Instantiated FilterState object id: { private$get_id() }")
    @@ -28617,7 +29671,8 @@

    teal.slice coverage - 65.73%

    111 - 364x + 364x +
          invisible(self)
    @@ -28701,28 +29756,32 @@

    teal.slice coverage - 65.73%

    123 - 68x + 68x +
          sprintf(
    124 - 68x + 68x +
            "%s:\n%s",
    125 - 68x + 68x +
            class(self)[1],
    126 - 68x + 68x +
            format(self$get_state(), show_all = show_all, trim_lines = trim_lines)
    @@ -28792,7 +29851,8 @@

    teal.slice coverage - 65.73%

    136 - 14x + 14x +
          cat(shiny::isolate(self$format(...)))
    @@ -28883,21 +29943,24 @@

    teal.slice coverage - 65.73%

    149 - 89x + 89x +
          checkmate::assert_class(state, "teal_slice")
    150 - 88x + 88x +
          if (private$is_fixed()) {
    151 - 1x + 1x +
            logger::log_warn("attempt to set state on fixed filter aborted id: { private$get_id() }")
    @@ -28911,28 +29974,32 @@

    teal.slice coverage - 65.73%

    153 - 87x + 87x +
            logger::log_trace("{ class(self)[1] }$set_state setting state of filter id: { private$get_id() }")
    154 - 87x + 87x +
            shiny::isolate({
    155 - 87x + 87x +
              if (!is.null(state$selected)) {
    156 - 78x + 78x +
                private$set_selected(state$selected)
    @@ -28946,14 +30013,16 @@

    teal.slice coverage - 65.73%

    158 - 75x + 75x +
              if (!is.null(state$keep_na)) {
    159 - 16x + 16x +
                private$set_keep_na(state$keep_na)
    @@ -28967,14 +30036,16 @@

    teal.slice coverage - 65.73%

    161 - 75x + 75x +
              if (!is.null(state$keep_inf)) {
    162 - 9x + 9x +
                private$set_keep_inf(state$keep_inf)
    @@ -28988,35 +30059,40 @@

    teal.slice coverage - 65.73%

    164 - 75x + 75x +
              current_state <- sprintf(
    165 - 75x + 75x +
                "selected: %s; keep_na: %s; keep_inf: %s",
    166 - 75x + 75x +
                toString(private$get_selected()),
    167 - 75x + 75x +
                private$get_keep_na(),
    168 - 75x + 75x +
                private$get_keep_inf()
    @@ -29051,7 +30127,8 @@

    teal.slice coverage - 65.73%

    173 - 76x + 76x +
          invisible(self)
    @@ -29121,7 +30198,8 @@

    teal.slice coverage - 65.73%

    183 - 747x + 747x +
          private$teal_slice
    @@ -29191,7 +30269,8 @@

    teal.slice coverage - 65.73%

    193 - 1x + 1x +
          stop("this is a virtual method")
    @@ -29282,42 +30361,48 @@

    teal.slice coverage - 65.73%

    206 - 12x + 12x +
          moduleServer(
    207 - 12x + 12x +
            id = id,
    208 - 12x + 12x +
            function(input, output, session) {
    209 - 12x + 12x +
              logger::log_trace("FilterState$server initializing module for slice: { private$get_id() } ")
    210 - 12x + 12x +
              private$server_summary("summary")
    211 - 12x + 12x +
              if (private$is_fixed()) {
    @@ -29338,7 +30423,8 @@

    teal.slice coverage - 65.73%

    214 - 12x + 12x +
                private$server_inputs("inputs")
    @@ -29359,49 +30445,56 @@

    teal.slice coverage - 65.73%

    217 - 12x + 12x +
              private$observers$state <- observeEvent(
    218 - 12x + 12x +
                eventExpr = list(private$get_selected(), private$get_keep_na(), private$get_keep_inf()),
    219 - 12x + 12x +
                handlerExpr = {
    220 - 4x + 4x +
                  current_state <- as.list(self$get_state())
    221 - 4x + 4x +
                  history <- private$state_history()
    222 - 4x + 4x +
                  history_update <- c(history, list(current_state))
    223 - 4x + 4x +
                  private$state_history(history_update)
    @@ -29429,21 +30522,24 @@

    teal.slice coverage - 65.73%

    227 - 12x + 12x +
              private$observers$back <- observeEvent(
    228 - 12x + 12x +
                eventExpr = input$back,
    229 - 12x + 12x +
                handlerExpr = {
    @@ -29506,21 +30602,24 @@

    teal.slice coverage - 65.73%

    238 - 12x + 12x +
              private$observers$reset <- observeEvent(
    239 - 12x + 12x +
                eventExpr = input$reset,
    240 - 12x + 12x +
                handlerExpr = {
    @@ -29576,56 +30675,64 @@

    teal.slice coverage - 65.73%

    248 - 12x + 12x +
              private$observers$state_history <- observeEvent(
    249 - 12x + 12x +
                eventExpr = private$state_history(),
    250 - 12x + 12x +
                handlerExpr = {
    251 - 4x + 4x +
                  shinyjs::disable(id = "back")
    252 - 4x + 4x +
                  shinyjs::disable(id = "reset")
    253 - 4x + 4x +
                  shinyjs::delay(
    254 - 4x + 4x +
                    ms = 100,
    255 - 4x + 4x +
                    expr = {
    @@ -29660,21 +30767,24 @@

    teal.slice coverage - 65.73%

    260 - 4x + 4x +
                  shinyjs::delay(
    261 - 4x + 4x +
                    ms = 100,
    262 - 4x + 4x +
                    expr = {
    @@ -29730,14 +30840,16 @@

    teal.slice coverage - 65.73%

    270 - 12x + 12x +
              private$destroy_shiny <- function() {
    271 - 8x + 8x +
                logger::log_trace("Destroying FilterState inputs and observers; id: { private$get_id() }")
    @@ -29751,7 +30863,8 @@

    teal.slice coverage - 65.73%

    273 - 8x + 8x +
                lapply(session$ns(names(input)), .subset2(input, "impl")$.values$remove)
    @@ -29772,7 +30885,8 @@

    teal.slice coverage - 65.73%

    276 - 8x + 8x +
                lapply(private$observers, function(x) x$destroy())
    @@ -29793,7 +30907,8 @@

    teal.slice coverage - 65.73%

    279 - 12x + 12x +
              reactive(input$remove)
    @@ -29884,7 +30999,8 @@

    teal.slice coverage - 65.73%

    292 - 12x + 12x +
          ns <- NS(id)
    @@ -29940,84 +31056,96 @@

    teal.slice coverage - 65.73%

    300 - 12x + 12x +
          div(
    301 - 12x + 12x +
            id = id,
    302 - 12x + 12x +
            class = "panel filter-card",
    303 - 12x + 12x +
            include_js_files("count-bar-labels.js"),
    304 - 12x + 12x +
            div(
    305 - 12x + 12x +
              class = "filter-card-header",
    306 - 12x + 12x +
              `data-toggle` = "collapse",
    307 - 12x + 12x +
              `data-bs-toggle` = "collapse",
    308 - 12x + 12x +
              href = paste0("#", ns("body")),
    309 - 12x + 12x +
              div(
    310 - 12x + 12x +
                class = "filter-card-title",
    311 - 12x + 12x +
                if (private$is_anchored() && private$is_fixed()) {
    @@ -30031,7 +31159,8 @@

    teal.slice coverage - 65.73%

    313 - 12x + 12x +
                } else if (private$is_anchored() && !private$is_fixed()) {
    @@ -30045,7 +31174,8 @@

    teal.slice coverage - 65.73%

    315 - 12x + 12x +
                } else if (!private$is_anchored() && private$is_fixed()) {
    @@ -30066,28 +31196,32 @@

    teal.slice coverage - 65.73%

    318 - 12x + 12x +
                div(class = "filter-card-varname", strong(private$get_varname())),
    319 - 12x + 12x +
                div(class = "filter-card-varlabel", private$get_varlabel()),
    320 - 12x + 12x +
                div(
    321 - 12x + 12x +
                  class = "filter-card-controls",
    @@ -30108,7 +31242,8 @@

    teal.slice coverage - 65.73%

    324 - 12x + 12x +
                  onclick = "event.stopPropagation();event.preventDefault();",
    @@ -30122,70 +31257,80 @@

    teal.slice coverage - 65.73%

    326 - 12x + 12x +
                  `data-bs-toggle` = "collapse",
    327 - 12x + 12x +
                  `data-bs-target` = NULL,
    328 - 12x + 12x +
                  if (isFALSE(private$is_fixed())) {
    329 - 12x + 12x +
                    actionLink(
    330 - 12x + 12x +
                      inputId = ns("back"),
    331 - 12x + 12x +
                      label = NULL,
    332 - 12x + 12x +
                      icon = icon("circle-arrow-left", lib = "font-awesome"),
    333 - 12x + 12x +
                      title = "Rewind state",
    334 - 12x + 12x +
                      class = "filter-card-back",
    335 - 12x + 12x +
                      style = "display: none"
    @@ -30206,56 +31351,64 @@

    teal.slice coverage - 65.73%

    338 - 12x + 12x +
                  if (isFALSE(private$is_fixed())) {
    339 - 12x + 12x +
                    actionLink(
    340 - 12x + 12x +
                      inputId = ns("reset"),
    341 - 12x + 12x +
                      label = NULL,
    342 - 12x + 12x +
                      icon = icon("circle-arrow-up", lib = "font-awesome"),
    343 - 12x + 12x +
                      title = "Restore original state",
    344 - 12x + 12x +
                      class = "filter-card-back",
    345 - 12x + 12x +
                      style = "display: none"
    @@ -30276,42 +31429,48 @@

    teal.slice coverage - 65.73%

    348 - 12x + 12x +
                  if (isFALSE(private$is_anchored())) {
    349 - 12x + 12x +
                    actionLink(
    350 - 12x + 12x +
                      inputId = ns("remove"),
    351 - 12x + 12x +
                      label = icon("circle-xmark", lib = "font-awesome"),
    352 - 12x + 12x +
                      title = "Remove filter",
    353 - 12x + 12x +
                      class = "filter-card-remove"
    @@ -30346,7 +31505,8 @@

    teal.slice coverage - 65.73%

    358 - 12x + 12x +
              div(class = "filter-card-summary", private$ui_summary(ns("summary")))
    @@ -30360,56 +31520,64 @@

    teal.slice coverage - 65.73%

    360 - 12x + 12x +
            div(
    361 - 12x + 12x +
              id = ns("body"),
    362 - 12x + 12x +
              class = "collapse out",
    363 - 12x + 12x +
              `data-parent` = paste0("#", parent_id),
    364 - 12x + 12x +
              `data-bs-parent` = paste0("#", parent_id),
    365 - 12x + 12x +
              div(
    366 - 12x + 12x +
                class = "filter-card-body",
    367 - 12x + 12x +
                if (private$is_fixed()) {
    @@ -30430,7 +31598,8 @@

    teal.slice coverage - 65.73%

    370 - 12x + 12x +
                  private$ui_inputs(ns("inputs"))
    @@ -30521,14 +31690,16 @@

    teal.slice coverage - 65.73%

    383 - 47x + 47x +
          if (!is.null(private$destroy_shiny)) {
    384 - 8x + 8x +
            private$destroy_shiny()
    @@ -30822,35 +31993,40 @@

    teal.slice coverage - 65.73%

    426 - 420x + 420x +
          logger::log_trace(
    427 - 420x + 420x +
            sprintf(
    428 - 420x + 420x +
              "%s$set_selected setting selection of id: %s",
    429 - 420x + 420x +
              class(self)[1],
    430 - 420x + 420x +
              private$get_id()
    @@ -30871,35 +32047,40 @@

    teal.slice coverage - 65.73%

    433 - 420x + 420x +
          shiny::isolate({
    434 - 420x + 420x +
            value <- private$cast_and_validate(value)
    435 - 409x + 409x +
            value <- private$check_length(value)
    436 - 403x + 403x +
            value <- private$remove_out_of_bounds_values(value)
    437 - 403x + 403x +
            private$teal_slice$selected <- value
    @@ -30913,35 +32094,40 @@

    teal.slice coverage - 65.73%

    439 - 403x + 403x +
          logger::log_trace(
    440 - 403x + 403x +
            sprintf(
    441 - 403x + 403x +
              "%s$set_selected selection of id: %s",
    442 - 403x + 403x +
              class(self)[1],
    443 - 403x + 403x +
              private$get_id()
    @@ -30969,7 +32155,8 @@

    teal.slice coverage - 65.73%

    447 - 403x + 403x +
          invisible(NULL)
    @@ -31067,56 +32254,64 @@

    teal.slice coverage - 65.73%

    461 - 16x + 16x +
          checkmate::assert_flag(value)
    462 - 16x + 16x +
          private$teal_slice$keep_na <- value
    463 - 16x + 16x +
          logger::log_trace(
    464 - 16x + 16x +
            sprintf(
    465 - 16x + 16x +
              "%s$set_keep_na set for filter %s to %s.",
    466 - 16x + 16x +
              class(self)[1],
    467 - 16x + 16x +
              private$get_id(),
    468 - 16x + 16x +
              value
    @@ -31137,7 +32332,8 @@

    teal.slice coverage - 65.73%

    471 - 16x + 16x +
          invisible(NULL)
    @@ -31221,56 +32417,64 @@

    teal.slice coverage - 65.73%

    483 - 9x + 9x +
          checkmate::assert_flag(value)
    484 - 9x + 9x +
          private$teal_slice$keep_inf <- value
    485 - 9x + 9x +
          logger::log_trace(
    486 - 9x + 9x +
            sprintf(
    487 - 9x + 9x +
              "%s$set_keep_inf of filter %s set to %s",
    488 - 9x + 9x +
              class(self)[1],
    489 - 9x + 9x +
              private$get_id(),
    490 - 9x + 9x +
              value
    @@ -31298,7 +32502,8 @@

    teal.slice coverage - 65.73%

    494 - 9x + 9x +
          invisible(NULL)
    @@ -31361,7 +32566,8 @@

    teal.slice coverage - 65.73%

    503 - 87x + 87x +
          shiny::isolate(private$teal_slice$dataname)
    @@ -31410,7 +32616,8 @@

    teal.slice coverage - 65.73%

    510 - 165x + 165x +
          shiny::isolate(private$teal_slice$varname)
    @@ -31459,7 +32666,8 @@

    teal.slice coverage - 65.73%

    517 - 4x + 4x +
          shiny::isolate(private$teal_slice$id)
    @@ -31508,7 +32716,8 @@

    teal.slice coverage - 65.73%

    524 - 882x + 882x +
          shiny::isolate(private$teal_slice$choices)
    @@ -31557,7 +32766,8 @@

    teal.slice coverage - 65.73%

    531 - 363x + 363x +
          private$teal_slice$selected
    @@ -31606,7 +32816,8 @@

    teal.slice coverage - 65.73%

    538 - 129x + 129x +
          private$teal_slice$keep_na
    @@ -31655,7 +32866,8 @@

    teal.slice coverage - 65.73%

    545 - 117x + 117x +
          private$teal_slice$keep_inf
    @@ -31697,7 +32909,8 @@

    teal.slice coverage - 65.73%

    551 - 148x + 148x +
          shiny::isolate(isTRUE(private$teal_slice$fixed))
    @@ -31739,7 +32952,8 @@

    teal.slice coverage - 65.73%

    557 - 48x + 48x +
          shiny::isolate(isTRUE(private$teal_slice$anchored))
    @@ -31781,7 +32995,8 @@

    teal.slice coverage - 65.73%

    563 - 217x + 217x +
          shiny::isolate(isTRUE(private$teal_slice$multiple))
    @@ -31844,7 +33059,8 @@

    teal.slice coverage - 65.73%

    572 - 12x + 12x +
          private$varlabel
    @@ -31907,49 +33123,56 @@

    teal.slice coverage - 65.73%

    581 - 108x + 108x +
          varname <- private$get_varname()
    582 - 108x + 108x +
          varname_backticked <- sprintf("`%s`", varname)
    583 - 108x + 108x +
          ans <-
    584 - 108x + 108x +
            if (isTRUE(private$extract_type == "list")) {
    585 - 16x + 16x +
              sprintf("%s$%s", dataname, varname_backticked)
    586 - 108x + 108x +
            } else if (isTRUE(private$extract_type == "matrix")) {
    587 - 7x + 7x +
              sprintf("%s[, \"%s\"]", dataname, varname)
    @@ -31963,7 +33186,8 @@

    teal.slice coverage - 65.73%

    589 - 85x + 85x +
              varname_backticked
    @@ -31977,7 +33201,8 @@

    teal.slice coverage - 65.73%

    591 - 108x + 108x +
          str2lang(ans)
    @@ -32061,14 +33286,16 @@

    teal.slice coverage - 65.73%

    603 - 107x + 107x +
          if (private$na_count == 0L) {
    604 - 86x + 86x +
            return(filter_call)
    @@ -32089,42 +33316,48 @@

    teal.slice coverage - 65.73%

    607 - 21x + 21x +
          if (is.null(filter_call) && isFALSE(private$get_keep_na())) {
    608 - 2x + 2x +
            call("!", call("is.na", varname))
    609 - 19x + 19x +
          } else if (!is.null(filter_call) && isTRUE(private$get_keep_na())) {
    610 - 12x + 12x +
            call("|", call("is.na", varname), filter_call)
    611 - 7x + 7x +
          } else if (!is.null(filter_call) && isFALSE(private$get_keep_na())) {
    612 - 7x + 7x +
            call("&", call("!", call("is.na", varname)), filter_call)
    @@ -32201,7 +33434,8 @@

    teal.slice coverage - 65.73%

    623 - 11x + 11x +
          values
    @@ -32236,7 +33470,8 @@

    teal.slice coverage - 65.73%

    628 - 11x + 11x +
          values
    @@ -32299,7 +33534,8 @@

    teal.slice coverage - 65.73%

    637 - 31x + 31x +
          values
    @@ -32397,42 +33633,48 @@

    teal.slice coverage - 65.73%

    651 - 74x + 74x +
          if (private$is_choice_limited) {
    652 - 3x + 3x +
            TRUE
    653 - 71x + 71x +
          } else if (!setequal(private$get_selected(), private$get_choices())) {
    654 - 58x + 58x +
            TRUE
    655 - 13x + 13x +
          } else if (!isTRUE(private$get_keep_na()) && private$na_count > 0) {
    656 - 4x + 4x +
            TRUE
    @@ -32446,7 +33688,8 @@

    teal.slice coverage - 65.73%

    658 - 9x + 9x +
            FALSE
    @@ -32516,14 +33759,16 @@

    teal.slice coverage - 65.73%

    668 - 12x + 12x +
          ns <- NS(id)
    669 - 12x + 12x +
          uiOutput(ns("summary"), class = "filter-card-summary")
    @@ -32579,28 +33824,32 @@

    teal.slice coverage - 65.73%

    677 - 12x + 12x +
          moduleServer(
    678 - 12x + 12x +
            id = id,
    679 - 12x + 12x +
            function(input, output, session) {
    680 - 12x + 12x +
              output$summary <- renderUI(private$content_summary())
    @@ -32887,14 +34136,16 @@

    teal.slice coverage - 65.73%

    721 - 12x + 12x +
          ns <- NS(id)
    722 - 12x + 12x +
          if (private$na_count > 0) {
    @@ -33048,7 +34299,8 @@

    teal.slice coverage - 65.73%

    744 - 12x + 12x +
            NULL
    @@ -33125,7 +34377,8 @@

    teal.slice coverage - 65.73%

    755 - 12x + 12x +
          moduleServer(id, function(input, output, session) {
    @@ -33153,42 +34406,48 @@

    teal.slice coverage - 65.73%

    759 - 12x + 12x +
            output$trigger_visible <- renderUI({
    760 - 12x + 12x +
              updateCountText(
    761 - 12x + 12x +
                inputId = "count_label",
    762 - 12x + 12x +
                label = "Keep NA",
    763 - 12x + 12x +
                countmax = private$na_count,
    764 - 12x + 12x +
                countnow = private$filtered_na_count()
    @@ -33202,7 +34461,8 @@

    teal.slice coverage - 65.73%

    766 - 12x + 12x +
              NULL
    @@ -33244,35 +34504,40 @@

    teal.slice coverage - 65.73%

    772 - 12x + 12x +
            private$observers$keep_na_api <- observeEvent(
    773 - 12x + 12x +
              ignoreNULL = FALSE, # nothing selected is possible for NA
    774 - 12x + 12x +
              ignoreInit = TRUE, # ignoreInit: should not matter because we set the UI with the desired initial state
    775 - 12x + 12x +
              eventExpr = private$get_keep_na(),
    776 - 12x + 12x +
              handlerExpr = {
    @@ -33349,35 +34614,40 @@

    teal.slice coverage - 65.73%

    787 - 12x + 12x +
            private$observers$keep_na <- observeEvent(
    788 - 12x + 12x +
              ignoreNULL = FALSE, # ignoreNULL: we don't want to ignore NULL when nothing is selected in the `selectInput`
    789 - 12x + 12x +
              ignoreInit = TRUE, # ignoreInit: should not matter because we set the UI with the desired initial state
    790 - 12x + 12x +
              eventExpr = input$value,
    791 - 12x + 12x +
              handlerExpr = {
    @@ -33447,7 +34717,8 @@

    teal.slice coverage - 65.73%

    801 - 12x + 12x +
            invisible(NULL)
    @@ -34328,28 +35599,32 @@

    teal.slice coverage - 65.73%

    121 - 3x + 3x +
      checkmate::assert_multi_class(datasets, c("FilteredData", "FilterPanelAPI"))
    122 - 3x + 3x +
      checkmate::assert_class(filter, "teal_slices")
    123 - 3x + 3x +
      datasets$set_filter_state(filter)
    124 - 3x + 3x +
      invisible(NULL)
    @@ -34391,14 +35666,16 @@

    teal.slice coverage - 65.73%

    130 - 4x + 4x +
      checkmate::assert_multi_class(datasets, c("FilteredData", "FilterPanelAPI"))
    131 - 4x + 4x +
      if (shiny::isRunning()) {
    @@ -34419,7 +35696,8 @@

    teal.slice coverage - 65.73%

    134 - 4x + 4x +
        shiny::isolate(datasets$get_filter_state())
    @@ -34468,14 +35746,16 @@

    teal.slice coverage - 65.73%

    141 - 1x + 1x +
      checkmate::assert_multi_class(datasets, c("FilteredData", "FilterPanelAPI"))
    142 - 1x + 1x +
      checkmate::assert_class(filter, "teal_slices")
    @@ -34489,14 +35769,16 @@

    teal.slice coverage - 65.73%

    144 - 1x + 1x +
      datasets$remove_filter_state(filter)
    145 - 1x + 1x +
      invisible(NULL)
    @@ -34538,21 +35820,24 @@

    teal.slice coverage - 65.73%

    151 - 1x + 1x +
      checkmate::assert_multi_class(datasets, c("FilteredData", "FilterPanelAPI"))
    152 - 1x + 1x +
      datasets$clear_filter_states(force = force)
    153 - 1x + 1x +
      invisible(NULL)
    @@ -34650,28 +35935,32 @@

    teal.slice coverage - 65.73%

    167 - 2x + 2x +
      checkmate::assert_character(datanames, min.len = 1, any.missing = FALSE)
    168 - 2x + 2x +
      stopifnot(
    169 - 2x + 2x +
        is(datasets, "FilteredData"),
    170 - 2x + 2x +
        all(datanames %in% datasets$datanames())
    @@ -34692,35 +35981,40 @@

    teal.slice coverage - 65.73%

    173 - 2x + 2x +
      paste(
    174 - 2x + 2x +
        unlist(lapply(
    175 - 2x + 2x +
          datanames,
    176 - 2x + 2x +
          function(dataname) {
    177 - 4x + 4x +
            datasets$get_call(dataname)
    @@ -34741,7 +36035,8 @@

    teal.slice coverage - 65.73%

    180 - 2x + 2x +
        collapse = "\n"
    @@ -34992,7 +36287,8 @@

    teal.slice coverage - 65.73%

    33 - 92x + 92x +
          if (!requireNamespace("SummarizedExperiment", quietly = TRUE)) {
    @@ -35013,35 +36309,40 @@

    teal.slice coverage - 65.73%

    36 - 92x + 92x +
          checkmate::assert_function(data_reactive, args = "sid")
    37 - 92x + 92x +
          checkmate::assert_class(data, "SummarizedExperiment")
    38 - 91x + 91x +
          super$initialize(data, data_reactive, dataname, datalabel)
    39 - 91x + 91x +
          if (!is.null(datalabel)) {
    40 - 84x + 84x +
            private$dataname_prefixed <- sprintf("%s[['%s']]", dataname, datalabel)
    @@ -35132,35 +36433,40 @@

    teal.slice coverage - 65.73%

    53 - 61x + 61x +
          shiny::isolate({
    54 - 61x + 61x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initializing, dataname: { private$dataname }")
    55 - 61x + 61x +
            checkmate::assert_class(state, "teal_slices")
    56 - 59x + 59x +
            lapply(state, function(x) {
    57 - 17x + 17x +
              checkmate::assert_choice(x$arg, choices = c("subset", "select"), null.ok = TRUE, .var.name = "teal_slice$arg")
    @@ -35174,21 +36480,24 @@

    teal.slice coverage - 65.73%

    59 - 59x + 59x +
            count_type <- attr(state, "count_type")
    60 - 59x + 59x +
            if (length(count_type)) {
    61 - 8x + 8x +
              private$count_type <- count_type
    @@ -35209,35 +36518,40 @@

    teal.slice coverage - 65.73%

    64 - 59x + 59x +
            subset_states <- Filter(function(x) x$arg == "subset", state)
    65 - 59x + 59x +
            private$set_filter_state_impl(
    66 - 59x + 59x +
              state = subset_states,
    67 - 59x + 59x +
              data = SummarizedExperiment::rowData(private$data),
    68 - 59x + 59x +
              data_reactive = function(sid = "") {
    @@ -35293,35 +36607,40 @@

    teal.slice coverage - 65.73%

    76 - 59x + 59x +
            select_states <- Filter(function(x) x$arg == "select", state)
    77 - 59x + 59x +
            private$set_filter_state_impl(
    78 - 59x + 59x +
              state = select_states,
    79 - 59x + 59x +
              data = SummarizedExperiment::colData(private$data),
    80 - 59x + 59x +
              data_reactive = function(sid = "") {
    @@ -35377,14 +36696,16 @@

    teal.slice coverage - 65.73%

    88 - 59x + 59x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initialized, dataname: { private$dataname }")
    89 - 59x + 59x +
            invisible(NULL)
    @@ -35454,49 +36775,56 @@

    teal.slice coverage - 65.73%

    99 - 2x + 2x +
          data <- private$data
    100 - 2x + 2x +
          checkmate::assert_string(id)
    101 - 2x + 2x +
          ns <- NS(id)
    102 - 2x + 2x +
          row_input <- if (ncol(SummarizedExperiment::rowData(data)) == 0) {
    103 - 1x + 1x +
            div("no sample variables available")
    104 - 2x + 2x +
          } else if (nrow(SummarizedExperiment::rowData(data)) == 0) {
    105 - 1x + 1x +
            div("no samples available")
    @@ -35580,28 +36908,32 @@

    teal.slice coverage - 65.73%

    117 - 2x + 2x +
          col_input <- if (ncol(SummarizedExperiment::colData(data)) == 0) {
    118 - 1x + 1x +
            div("no sample variables available")
    119 - 2x + 2x +
          } else if (nrow(SummarizedExperiment::colData(data)) == 0) {
    120 - 1x + 1x +
            div("no samples available")
    @@ -35685,21 +37017,24 @@

    teal.slice coverage - 65.73%

    132 - 2x + 2x +
          div(
    133 - 2x + 2x +
            row_input,
    134 - 2x + 2x +
            col_input
    @@ -37574,7 +38909,8 @@

    teal.slice coverage - 65.73%

    98 - 67x + 67x +
          checkmate::assert_list(data_objects, any.missing = FALSE, min.len = 0, names = "unique")
    @@ -37588,21 +38924,24 @@

    teal.slice coverage - 65.73%

    100 - 67x + 67x +
          data_objects <- lapply(data_objects, function(dataset) {
    101 - 101x + 101x +
            if (is.list(dataset) && "dataset" %in% names(dataset)) {
    102 - 76x + 76x +
              dataset$dataset
    @@ -37616,7 +38955,8 @@

    teal.slice coverage - 65.73%

    104 - 25x + 25x +
              dataset
    @@ -37651,49 +38991,56 @@

    teal.slice coverage - 65.73%

    109 - 67x + 67x +
          checkmate::assert_class(join_keys, "join_keys")
    110 - 66x + 66x +
          self$set_join_keys(join_keys)
    111 - 66x + 66x +
          child_parent <- sapply(
    112 - 66x + 66x +
            names(data_objects),
    113 - 66x + 66x +
            function(i) teal.data::parent(join_keys, i),
    114 - 66x + 66x +
            USE.NAMES = TRUE,
    115 - 66x + 66x +
            simplify = FALSE
    @@ -37707,14 +39054,16 @@

    teal.slice coverage - 65.73%

    117 - 66x + 66x +
          ordered_datanames <- topological_sort(child_parent)
    118 - 66x + 66x +
          ordered_datanames <- intersect(ordered_datanames, names(data_objects))
    @@ -37728,21 +39077,24 @@

    teal.slice coverage - 65.73%

    120 - 66x + 66x +
          for (dataname in ordered_datanames) {
    121 - 100x + 100x +
            ds_object <- data_objects[[dataname]]
    122 - 100x + 100x +
            self$set_dataset(data = ds_object, dataname = dataname)
    @@ -37763,7 +39115,8 @@

    teal.slice coverage - 65.73%

    125 - 66x + 66x +
          self$set_available_teal_slices(x = reactive(NULL))
    @@ -37777,7 +39130,8 @@

    teal.slice coverage - 65.73%

    127 - 66x + 66x +
          invisible(self)
    @@ -37847,7 +39201,8 @@

    teal.slice coverage - 65.73%

    137 - 118x + 118x +
          names(private$filtered_datasets)
    @@ -37917,7 +39272,8 @@

    teal.slice coverage - 65.73%

    147 - 1x + 1x +
          private$get_filtered_dataset(dataname)$get_dataset_label()
    @@ -38015,14 +39371,16 @@

    teal.slice coverage - 65.73%

    161 - 67x + 67x +
          checkmate::assert_class(x, "reactive")
    162 - 67x + 67x +
          private$available_teal_slices <- reactive({
    @@ -38036,49 +39394,56 @@

    teal.slice coverage - 65.73%

    164 - 4x + 4x +
            current_state <- isolate(self$get_filter_state())
    165 - 4x + 4x +
            allowed <- attr(current_state, "include_varnames")
    166 - 4x + 4x +
            forbidden <- attr(current_state, "exclude_varnames")
    167 - 4x + 4x +
            foo <- function(slice) {
    168 - 13x + 13x +
              if (slice$dataname %in% self$datanames()) {
    169 - 13x + 13x +
                if (slice$fixed) {
    170 - 4x + 4x +
                  TRUE
    @@ -38092,14 +39457,16 @@

    teal.slice coverage - 65.73%

    172 - 9x + 9x +
                  isTRUE(slice$varname %in% allowed[[slice$dataname]]) ||
    173 - 9x + 9x +
                    isFALSE(slice$varname %in% forbidden[[slice$dataname]])
    @@ -38141,7 +39508,8 @@

    teal.slice coverage - 65.73%

    179 - 4x + 4x +
            Filter(foo, x())
    @@ -38155,7 +39523,8 @@

    teal.slice coverage - 65.73%

    181 - 67x + 67x +
          invisible(NULL)
    @@ -38225,7 +39594,8 @@

    teal.slice coverage - 65.73%

    191 - 4x + 4x +
          private$available_teal_slices
    @@ -38421,14 +39791,16 @@

    teal.slice coverage - 65.73%

    219 - 10x + 10x +
          checkmate::assert_subset(dataname, self$datanames())
    220 - 9x + 9x +
          private$get_filtered_dataset(dataname)$get_call()
    @@ -38519,28 +39891,32 @@

    teal.slice coverage - 65.73%

    233 - 24x + 24x +
          checkmate::assert_subset(dataname, self$datanames())
    234 - 23x + 23x +
          checkmate::assert_flag(filtered)
    235 - 22x + 22x +
          data <- private$get_filtered_dataset(dataname)$get_dataset(filtered)
    236 - 3x + 3x +
          if (filtered) data() else data
    @@ -38603,7 +39979,8 @@

    teal.slice coverage - 65.73%

    245 - 2x + 2x +
          return(private$join_keys)
    @@ -38701,28 +40078,32 @@

    teal.slice coverage - 65.73%

    259 - 9x + 9x +
          rows <- lapply(
    260 - 9x + 9x +
            datanames,
    261 - 9x + 9x +
            function(dataname) {
    262 - 11x + 11x +
              private$get_filtered_dataset(dataname)$get_filter_overview()
    @@ -38743,14 +40124,16 @@

    teal.slice coverage - 65.73%

    265 - 5x + 5x +
          unssuported_idx <- vapply(rows, function(x) all(is.na(x[-1])), logical(1))
    266 - 5x + 5x +
          dplyr::bind_rows(c(rows[!unssuported_idx], rows[unssuported_idx]))
    @@ -38827,7 +40210,8 @@

    teal.slice coverage - 65.73%

    277 - 1x + 1x +
          private$get_filtered_dataset(dataname)$get_keys()
    @@ -38981,14 +40365,16 @@

    teal.slice coverage - 65.73%

    299 - 105x + 105x +
          checkmate::assert_string(dataname)
    300 - 105x + 105x +
          logger::log_trace("FilteredData$set_dataset setting dataset, name: { dataname }")
    @@ -39009,7 +40395,8 @@

    teal.slice coverage - 65.73%

    303 - 105x + 105x +
          check_simple_name(dataname)
    @@ -39023,21 +40410,24 @@

    teal.slice coverage - 65.73%

    305 - 105x + 105x +
          parent_dataname <- teal.data::parent(private$join_keys, dataname)
    306 - 105x + 105x +
          keys <- private$join_keys[dataname, dataname]
    307 - 104x + 104x +
          if (is.null(keys)) keys <- character(0)
    @@ -39051,35 +40441,40 @@

    teal.slice coverage - 65.73%

    309 - 105x + 105x +
          if (length(parent_dataname) == 0) {
    310 - 95x + 95x +
            private$filtered_datasets[[dataname]] <- init_filtered_dataset(
    311 - 95x + 95x +
              dataset = data,
    312 - 95x + 95x +
              dataname = dataname,
    313 - 95x + 95x +
              keys = keys
    @@ -39100,7 +40495,8 @@

    teal.slice coverage - 65.73%

    316 - 10x + 10x +
            join_keys <- private$join_keys[dataname, parent_dataname]
    @@ -39114,49 +40510,56 @@

    teal.slice coverage - 65.73%

    318 - 10x + 10x +
            private$filtered_datasets[[dataname]] <- init_filtered_dataset(
    319 - 10x + 10x +
              dataset = data,
    320 - 10x + 10x +
              dataname = dataname,
    321 - 10x + 10x +
              keys = keys,
    322 - 10x + 10x +
              parent_name = parent_dataname,
    323 - 10x + 10x +
              parent = reactive(self$get_data(parent_dataname, filtered = TRUE)),
    324 - 10x + 10x +
              join_keys = join_keys
    @@ -39184,7 +40587,8 @@

    teal.slice coverage - 65.73%

    328 - 105x + 105x +
          invisible(self)
    @@ -39261,21 +40665,24 @@

    teal.slice coverage - 65.73%

    339 - 66x + 66x +
          checkmate::assert_class(join_keys, "join_keys")
    340 - 66x + 66x +
          private$join_keys <- join_keys
    341 - 66x + 66x +
          invisible(self)
    @@ -39352,35 +40759,40 @@

    teal.slice coverage - 65.73%

    352 - 53x + 53x +
          states <- unname(lapply(private$filtered_datasets, function(x) x$get_filter_state()))
    353 - 53x + 53x +
          slices <- Filter(Negate(is.null), states)
    354 - 53x + 53x +
          slices <- do.call(c, slices)
    355 - 53x + 53x +
          if (!is.null(slices)) {
    356 - 53x + 53x +
            attr(slices, "allow_add") <- private$allow_add
    @@ -39394,7 +40806,8 @@

    teal.slice coverage - 65.73%

    358 - 53x + 53x +
          slices
    @@ -39478,35 +40891,40 @@

    teal.slice coverage - 65.73%

    370 - 5x + 5x +
          datasets <- lapply(self$datanames(), private$get_filtered_dataset)
    371 - 5x + 5x +
          ind <- vapply(datasets, inherits, logical(1L), what = "DefaultFilteredDataset")
    372 - 5x + 5x +
          states <- do.call(c, lapply(datasets[!ind], function(ds) ds$get_filter_state()))
    373 - 5x + 5x +
          states_fmt <- format(states, show_all = show_all, trim_lines = trim_lines)
    374 - 5x + 5x +
          holders_fmt <- vapply(datasets[ind], format, character(1L), show_all = show_all, trim_lines = trim_lines)
    @@ -39520,28 +40938,32 @@

    teal.slice coverage - 65.73%

    376 - 5x + 5x +
          sprintf(
    377 - 5x + 5x +
            "%s:\n%s",
    378 - 5x + 5x +
            class(self)[1],
    379 - 5x + 5x +
            paste(c(states_fmt, holders_fmt), collapse = "\n")
    @@ -39681,42 +41103,48 @@

    teal.slice coverage - 65.73%

    399 - 31x + 31x +
          shiny::isolate({
    400 - 31x + 31x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initializing")
    401 - 31x + 31x +
            checkmate::assert_class(state, "teal_slices")
    402 - 31x + 31x +
            allow_add <- attr(state, "allow_add")
    403 - 31x + 31x +
            if (!is.null(allow_add)) {
    404 - 31x + 31x +
              private$allow_add <- allow_add
    @@ -39737,21 +41165,24 @@

    teal.slice coverage - 65.73%

    407 - 31x + 31x +
            lapply(self$datanames(), function(dataname) {
    408 - 63x + 63x +
              states <- Filter(function(x) identical(x$dataname, dataname), state)
    409 - 63x + 63x +
              private$get_filtered_dataset(dataname)$set_filter_state(states)
    @@ -39772,7 +41203,8 @@

    teal.slice coverage - 65.73%

    412 - 31x + 31x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initialized")
    @@ -39793,7 +41225,8 @@

    teal.slice coverage - 65.73%

    415 - 31x + 31x +
          invisible(NULL)
    @@ -39884,28 +41317,32 @@

    teal.slice coverage - 65.73%

    428 - 8x + 8x +
          shiny::isolate({
    429 - 8x + 8x +
            checkmate::assert_class(state, "teal_slices")
    430 - 8x + 8x +
            datanames <- unique(vapply(state, "[[", character(1L), "dataname"))
    431 - 8x + 8x +
            checkmate::assert_subset(datanames, self$datanames())
    @@ -39919,14 +41356,16 @@

    teal.slice coverage - 65.73%

    433 - 8x + 8x +
            logger::log_trace(
    434 - 8x + 8x +
              "{ class(self)[1] }$remove_filter_state removing filter(s), dataname: { private$dataname }"
    @@ -39947,21 +41386,24 @@

    teal.slice coverage - 65.73%

    437 - 8x + 8x +
            lapply(datanames, function(dataname) {
    438 - 9x + 9x +
              slices <- Filter(function(x) identical(x$dataname, dataname), state)
    439 - 9x + 9x +
              private$get_filtered_dataset(dataname)$remove_filter_state(slices)
    @@ -39982,14 +41424,16 @@

    teal.slice coverage - 65.73%

    442 - 8x + 8x +
            logger::log_trace(
    443 - 8x + 8x +
              "{ class(self)[1] }$remove_filter_state removed filter(s), dataname: { private$dataname }"
    @@ -40017,7 +41461,8 @@

    teal.slice coverage - 65.73%

    447 - 8x + 8x +
          invisible(NULL)
    @@ -40129,14 +41574,16 @@

    teal.slice coverage - 65.73%

    463 - 7x + 7x +
          logger::log_trace(
    464 - 7x + 7x +
            "FilteredData$clear_filter_states called, datanames: { toString(datanames) }"
    @@ -40157,21 +41604,24 @@

    teal.slice coverage - 65.73%

    467 - 7x + 7x +
          for (dataname in datanames) {
    468 - 12x + 12x +
            fdataset <- private$get_filtered_dataset(dataname = dataname)
    469 - 12x + 12x +
            fdataset$clear_filter_states(force)
    @@ -40192,28 +41642,32 @@

    teal.slice coverage - 65.73%

    472 - 7x + 7x +
          logger::log_trace(
    473 - 7x + 7x +
            paste(
    474 - 7x + 7x +
              "FilteredData$clear_filter_states removed all non-anchored FilterStates,",
    475 - 7x + 7x +
              "datanames: { toString(datanames) }"
    @@ -40241,7 +41695,8 @@

    teal.slice coverage - 65.73%

    479 - 7x + 7x +
          invisible(NULL)
    @@ -40514,35 +41969,40 @@

    teal.slice coverage - 65.73%

    518 - 1x + 1x +
          checkmate::assert_function(active_datanames)
    519 - 1x + 1x +
          moduleServer(
    520 - 1x + 1x +
            id = id,
    521 - 1x + 1x +
            function(input, output, session) {
    522 - 1x + 1x +
              logger::log_trace("FilteredData$srv_filter_panel initializing")
    @@ -40556,14 +42016,16 @@

    teal.slice coverage - 65.73%

    524 - 1x + 1x +
              active_datanames_resolved <- reactive({
    525 - 1x + 1x +
                checkmate::assert_subset(active_datanames(), self$datanames())
    @@ -40591,28 +42053,32 @@

    teal.slice coverage - 65.73%

    529 - 1x + 1x +
              self$srv_overview("overview", active_datanames_resolved)
    530 - 1x + 1x +
              self$srv_active("active", active_datanames_resolved)
    531 - 1x + 1x +
              if (private$allow_add) {
    532 - 1x + 1x +
                self$srv_add("add", active_datanames_resolved)
    @@ -40633,14 +42099,16 @@

    teal.slice coverage - 65.73%

    535 - 1x + 1x +
              logger::log_trace("FilteredData$srv_filter_panel initialized")
    536 - 1x + 1x +
              NULL
    @@ -41081,21 +42549,24 @@

    teal.slice coverage - 65.73%

    599 - 3x + 3x +
          checkmate::assert_function(active_datanames)
    600 - 3x + 3x +
          shiny::moduleServer(id, function(input, output, session) {
    601 - 3x + 3x +
            logger::log_trace("FilteredData$srv_active initializing")
    @@ -41109,7 +42580,8 @@

    teal.slice coverage - 65.73%

    603 - 3x + 3x +
            private$srv_available_filters("available_filters")
    @@ -41123,7 +42595,8 @@

    teal.slice coverage - 65.73%

    605 - 3x + 3x +
            observeEvent(input$minimise_filter_active, {
    @@ -41172,42 +42645,48 @@

    teal.slice coverage - 65.73%

    612 - 3x + 3x +
            observeEvent(private$get_filter_count(), {
    613 - 3x + 3x +
              shinyjs::toggle("remove_all_filters", condition = private$get_filter_count() != 0)
    614 - 3x + 3x +
              shinyjs::show("filter_active_vars_contents")
    615 - 3x + 3x +
              shinyjs::hide("filters_active_count")
    616 - 3x + 3x +
              toggle_icon(session$ns("minimise_filter_active"), c("fa-angle-right", "fa-angle-down"), TRUE)
    617 - 3x + 3x +
              toggle_title(session$ns("minimise_filter_active"), c("Restore panel", "Minimise Panel"), TRUE)
    @@ -41228,28 +42707,32 @@

    teal.slice coverage - 65.73%

    620 - 3x + 3x +
            observeEvent(active_datanames(), {
    621 - 2x + 2x +
              lapply(self$datanames(), function(dataname) {
    622 - 4x + 4x +
                if (dataname %in% active_datanames()) {
    623 - 4x + 4x +
                  shinyjs::show(dataname)
    @@ -41312,35 +42795,40 @@

    teal.slice coverage - 65.73%

    632 - 3x + 3x +
            lapply(
    633 - 3x + 3x +
              self$datanames(),
    634 - 3x + 3x +
              function(dataname) {
    635 - 6x + 6x +
                fdataset <- private$get_filtered_dataset(dataname)
    636 - 6x + 6x +
                fdataset$srv_active(id = dataname)
    @@ -41368,49 +42856,56 @@

    teal.slice coverage - 65.73%

    640 - 3x + 3x +
            output$teal_filters_count <- shiny::renderText({
    641 - 3x + 3x +
              n_filters_active <- private$get_filter_count()
    642 - 3x + 3x +
              shiny::req(n_filters_active > 0L)
    643 - 2x + 2x +
              sprintf(
    644 - 2x + 2x +
                "%s filter%s applied across datasets",
    645 - 2x + 2x +
                n_filters_active,
    646 - 2x + 2x +
                ifelse(n_filters_active == 1, "", "s")
    @@ -41438,28 +42933,32 @@

    teal.slice coverage - 65.73%

    650 - 3x + 3x +
            observeEvent(input$remove_all_filters, {
    651 - 1x + 1x +
              logger::log_trace("FilteredData$srv_filter_panel@1 removing all non-anchored filters")
    652 - 1x + 1x +
              self$clear_filter_states()
    653 - 1x + 1x +
              logger::log_trace("FilteredData$srv_filter_panel@1 removed all non-anchored filters")
    @@ -41473,14 +42972,16 @@

    teal.slice coverage - 65.73%

    655 - 3x + 3x +
            logger::log_trace("FilteredData$srv_active initialized")
    656 - 3x + 3x +
            NULL
    @@ -41858,28 +43359,32 @@

    teal.slice coverage - 65.73%

    710 - 1x + 1x +
          checkmate::assert_class(active_datanames, "reactive")
    711 - 1x + 1x +
          moduleServer(id, function(input, output, session) {
    712 - 1x + 1x +
            logger::log_trace("FilteredData$srv_add initializing")
    713 - 1x + 1x +
            shiny::observeEvent(input$minimise_filter_add_vars, {
    @@ -41921,7 +43426,8 @@

    teal.slice coverage - 65.73%

    719 - 1x + 1x +
            observeEvent(active_datanames(), {
    @@ -42005,35 +43511,40 @@

    teal.slice coverage - 65.73%

    731 - 1x + 1x +
            lapply(
    732 - 1x + 1x +
              self$datanames(),
    733 - 1x + 1x +
              function(dataname) {
    734 - 2x + 2x +
                fdataset <- private$get_filtered_dataset(dataname)
    735 - 2x + 2x +
                fdataset$srv_add(id = dataname)
    @@ -42054,14 +43565,16 @@

    teal.slice coverage - 65.73%

    738 - 1x + 1x +
            logger::log_trace("FilteredData$srv_filter_panel initialized")
    739 - 1x + 1x +
            NULL
    @@ -42453,35 +43966,40 @@

    teal.slice coverage - 65.73%

    795 - 1x + 1x +
          checkmate::assert_class(active_datanames, "reactive")
    796 - 1x + 1x +
          moduleServer(
    797 - 1x + 1x +
            id = id,
    798 - 1x + 1x +
            function(input, output, session) {
    799 - 1x + 1x +
              logger::log_trace("FilteredData$srv_filter_overview initializing")
    @@ -42495,7 +44013,8 @@

    teal.slice coverage - 65.73%

    801 - 1x + 1x +
              shiny::observeEvent(input$minimise_filter_overview, {
    @@ -42537,7 +44056,8 @@

    teal.slice coverage - 65.73%

    807 - 1x + 1x +
              output$table <- renderUI({
    @@ -43041,14 +44561,16 @@

    teal.slice coverage - 65.73%

    879 - 1x + 1x +
              logger::log_trace("FilteredData$srv_filter_overview initialized")
    880 - 1x + 1x +
              NULL
    @@ -43307,7 +44829,8 @@

    teal.slice coverage - 65.73%

    917 - 147x + 147x +
          if (length(dataname) == 0) {
    @@ -43328,7 +44851,8 @@

    teal.slice coverage - 65.73%

    920 - 147x + 147x +
            private$filtered_datasets[[dataname]]
    @@ -43412,7 +44936,8 @@

    teal.slice coverage - 65.73%

    932 - 11x + 11x +
          length(self$get_filter_state())
    @@ -43678,28 +45203,32 @@

    teal.slice coverage - 65.73%

    970 - 4x + 4x +
          moduleServer(id, function(input, output, session) {
    971 - 4x + 4x +
            slices_available <- self$get_available_teal_slices()
    972 - 4x + 4x +
            slices_interactive <- reactive(
    973 - 4x + 4x +
              Filter(function(slice) isFALSE(slice$fixed), slices_available())
    @@ -43713,14 +45242,16 @@

    teal.slice coverage - 65.73%

    975 - 4x + 4x +
            slices_fixed <- reactive(
    976 - 4x + 4x +
              Filter(function(slice) isTRUE(slice$fixed), slices_available())
    @@ -43734,21 +45265,24 @@

    teal.slice coverage - 65.73%

    978 - 4x + 4x +
            available_slices_id <- reactive(vapply(slices_available(), `[[`, character(1), "id"))
    979 - 4x + 4x +
            active_slices_id <- reactive(vapply(self$get_filter_state(), `[[`, character(1), "id"))
    980 - 4x + 4x +
            duplicated_slice_references <- reactive({
    @@ -43762,35 +45296,40 @@

    teal.slice coverage - 65.73%

    982 - 8x + 8x +
              slice_reference <- vapply(slices_available(), get_default_slice_id, character(1))
    983 - 8x + 8x +
              is_duplicated_reference <- duplicated(slice_reference) | duplicated(slice_reference, fromLast = TRUE)
    984 - 8x + 8x +
              is_active <- available_slices_id() %in% active_slices_id()
    985 - 8x + 8x +
              is_not_expr <- !vapply(slices_available(), inherits, logical(1), "teal_slice_expr")
    986 - 8x + 8x +
              slice_reference[is_duplicated_reference & is_active & is_not_expr]
    @@ -43811,70 +45350,80 @@

    teal.slice coverage - 65.73%

    989 - 4x + 4x +
            checkbox_group_element <- function(name, value, label, checked, disabled = FALSE) {
    990 - 35x + 35x +
              tags$div(
    991 - 35x + 35x +
                class = "checkbox available-filters",
    992 - 35x + 35x +
                tags$label(
    993 - 35x + 35x +
                  tags$input(
    994 - 35x + 35x +
                    type = "checkbox",
    995 - 35x + 35x +
                    name = name,
    996 - 35x + 35x +
                    value = value,
    997 - 35x + 35x +
                    checked = checked,
    998 - 35x + 35x +
                    disabled = if (disabled) "disabled"
    @@ -43888,7 +45437,8 @@

    teal.slice coverage - 65.73%

    1000 - 35x + 35x +
                  tags$span(label, disabled = if (disabled) disabled)
    @@ -43923,42 +45473,48 @@

    teal.slice coverage - 65.73%

    1005 - 4x + 4x +
            output$checkbox <- renderUI({
    1006 - 8x + 8x +
              checkbox <- checkboxGroupInput(
    1007 - 8x + 8x +
                session$ns("available_slices_id"),
    1008 - 8x + 8x +
                label = NULL,
    1009 - 8x + 8x +
                choices = NULL,
    1010 - 8x + 8x +
                selected = NULL
    @@ -43972,14 +45528,16 @@

    teal.slice coverage - 65.73%

    1012 - 8x + 8x +
              active_slices_ids <- active_slices_id()
    1013 - 8x + 8x +
              duplicated_slice_refs <- duplicated_slice_references()
    @@ -43993,7 +45551,8 @@

    teal.slice coverage - 65.73%

    1015 - 8x + 8x +
              checkbox_group_slice <- function(slice) {
    @@ -44007,63 +45566,72 @@

    teal.slice coverage - 65.73%

    1017 - 35x + 35x +
                shiny::isolate({
    1018 - 35x + 35x +
                  checkbox_group_element(
    1019 - 35x + 35x +
                    name = session$ns("available_slices_id"),
    1020 - 35x + 35x +
                    value = slice$id,
    1021 - 35x + 35x +
                    label = slice$id,
    1022 - 35x + 35x +
                    checked = if (slice$id %in% active_slices_ids) "checked",
    1023 - 35x + 35x +
                    disabled = slice$anchored ||
    1024 - 35x + 35x +
                      get_default_slice_id(slice) %in% duplicated_slice_refs &&
    1025 - 35x + 35x +
                        !slice$id %in% active_slices_ids
    @@ -44098,14 +45666,16 @@

    teal.slice coverage - 65.73%

    1030 - 8x + 8x +
              interactive_choice_mock <- lapply(slices_interactive(), checkbox_group_slice)
    1031 - 8x + 8x +
              non_interactive_choice_mock <- lapply(slices_fixed(), checkbox_group_slice)
    @@ -44119,63 +45689,72 @@

    teal.slice coverage - 65.73%

    1033 - 8x + 8x +
              htmltools::tagInsertChildren(
    1034 - 8x + 8x +
                checkbox,
    1035 - 8x + 8x +
                br(),
    1036 - 8x + 8x +
                if (length(non_interactive_choice_mock)) tags$strong("Fixed filters"),
    1037 - 8x + 8x +
                non_interactive_choice_mock,
    1038 - 8x + 8x +
                if (length(interactive_choice_mock)) tags$strong("Interactive filters"),
    1039 - 8x + 8x +
                interactive_choice_mock,
    1040 - 8x + 8x +
                .cssSelector = "div.shiny-options-group",
    1041 - 8x + 8x +
                after = 0
    @@ -44203,49 +45782,56 @@

    teal.slice coverage - 65.73%

    1045 - 4x + 4x +
            observeEvent(input$available_slices_id, ignoreNULL = FALSE, ignoreInit = TRUE, {
    1046 - 5x + 5x +
              new_slices_id <- setdiff(input$available_slices_id, active_slices_id())
    1047 - 5x + 5x +
              removed_slices_id <- setdiff(active_slices_id(), input$available_slices_id)
    1048 - 5x + 5x +
              if (length(new_slices_id)) {
    1049 - 3x + 3x +
                new_teal_slices <- Filter(
    1050 - 3x + 3x +
                  function(slice) slice$id %in% new_slices_id,
    1051 - 3x + 3x +
                  private$available_teal_slices()
    @@ -44259,7 +45845,8 @@

    teal.slice coverage - 65.73%

    1053 - 3x + 3x +
                self$set_filter_state(new_teal_slices)
    @@ -44280,28 +45867,32 @@

    teal.slice coverage - 65.73%

    1056 - 5x + 5x +
              if (length(removed_slices_id)) {
    1057 - 4x + 4x +
                removed_teal_slices <- Filter(
    1058 - 4x + 4x +
                  function(slice) slice$id %in% removed_slices_id,
    1059 - 4x + 4x +
                  self$get_filter_state()
    @@ -44315,7 +45906,8 @@

    teal.slice coverage - 65.73%

    1061 - 4x + 4x +
                self$remove_filter_state(removed_teal_slices)
    @@ -44343,21 +45935,24 @@

    teal.slice coverage - 65.73%

    1065 - 4x + 4x +
            observeEvent(private$available_teal_slices(), ignoreNULL = FALSE, {
    1066 - 3x + 3x +
              if (length(private$available_teal_slices())) {
    1067 - 1x + 1x +
                shinyjs::show("available_menu")
    @@ -44371,7 +45966,8 @@

    teal.slice coverage - 65.73%

    1069 - 2x + 2x +
                shinyjs::hide("available_menu")
    @@ -45469,21 +47065,24 @@

    teal.slice coverage - 65.73%

    150 - 25x + 25x +
          shiny::isolate({
    151 - 25x + 25x +
            checkmate::assert_multi_class(x, c("POSIXct", "POSIXlt"))
    152 - 24x + 24x +
            checkmate::assert_class(x_reactive, "reactive")
    @@ -45497,35 +47096,40 @@

    teal.slice coverage - 65.73%

    154 - 24x + 24x +
            super$initialize(
    155 - 24x + 24x +
              x = x,
    156 - 24x + 24x +
              x_reactive = x_reactive,
    157 - 24x + 24x +
              slice = slice,
    158 - 24x + 24x +
              extract_type = extract_type
    @@ -45539,28 +47143,32 @@

    teal.slice coverage - 65.73%

    160 - 24x + 24x +
            checkmate::assert_multi_class(slice$choices, c("POSIXct", "POSIXlt"), null.ok = TRUE)
    161 - 23x + 23x +
            private$set_choices(slice$choices)
    162 - 15x + 15x +
            if (is.null(slice$selected)) slice$selected <- slice$choices
    163 - 23x + 23x +
            private$set_selected(slice$selected)
    @@ -45581,7 +47189,8 @@

    teal.slice coverage - 65.73%

    166 - 22x + 22x +
          invisible(self)
    @@ -45665,14 +47274,16 @@

    teal.slice coverage - 65.73%

    178 - 7x + 7x +
          if (isFALSE(private$is_any_filtered())) {
    179 - 1x + 1x +
            return(NULL)
    @@ -45686,63 +47297,72 @@

    teal.slice coverage - 65.73%

    181 - 4x + 4x +
          if (missing(dataname)) dataname <- private$get_dataname()
    182 - 6x + 6x +
          varname <- private$get_varname_prefixed(dataname)
    183 - 6x + 6x +
          choices <- private$get_selected()
    184 - 6x + 6x +
          tzone <- Find(function(x) x != "", attr(as.POSIXlt(choices), "tzone"))
    185 - 6x + 6x +
          class <- class(choices)[1L]
    186 - 6x + 6x +
          date_fun <- as.name(
    187 - 6x + 6x +
            switch(class,
    188 - 6x + 6x +
              "POSIXct" = "as.POSIXct",
    189 - 6x + 6x +
              "POSIXlt" = "as.POSIXlt"
    @@ -45763,21 +47383,24 @@

    teal.slice coverage - 65.73%

    192 - 6x + 6x +
          choices <- as.character(choices + c(0, 1))
    193 - 6x + 6x +
          filter_call <-
    194 - 6x + 6x +
            call(
    @@ -45791,7 +47414,8 @@

    teal.slice coverage - 65.73%

    196 - 6x + 6x +
              call(
    @@ -45805,14 +47429,16 @@

    teal.slice coverage - 65.73%

    198 - 6x + 6x +
                varname,
    199 - 6x + 6x +
                as.call(list(date_fun, choices[1L], tz = tzone))
    @@ -45826,7 +47452,8 @@

    teal.slice coverage - 65.73%

    201 - 6x + 6x +
              call(
    @@ -45840,14 +47467,16 @@

    teal.slice coverage - 65.73%

    203 - 6x + 6x +
                varname,
    204 - 6x + 6x +
                as.call(list(date_fun, choices[2L], tz = tzone))
    @@ -45868,7 +47497,8 @@

    teal.slice coverage - 65.73%

    207 - 6x + 6x +
          private$add_keep_na_call(filter_call, varname)
    @@ -45931,14 +47561,16 @@

    teal.slice coverage - 65.73%

    216 - 23x + 23x +
          if (is.null(choices)) {
    217 - 20x + 20x +
            choices <- as.POSIXct(trunc(range(private$x, na.rm = TRUE), units = "secs"))
    @@ -45952,28 +47584,32 @@

    teal.slice coverage - 65.73%

    219 - 3x + 3x +
            choices <- as.POSIXct(choices, units = "secs")
    220 - 3x + 3x +
            choices_adjusted <- c(
    221 - 3x + 3x +
              max(choices[1L], min(as.POSIXct(private$x), na.rm = TRUE)),
    222 - 3x + 3x +
              min(choices[2L], max(as.POSIXct(private$x), na.rm = TRUE))
    @@ -45987,28 +47623,32 @@

    teal.slice coverage - 65.73%

    224 - 3x + 3x +
            if (any(choices != choices_adjusted)) {
    225 - 1x + 1x +
              warning(sprintf(
    226 - 1x + 1x +
                "Choices adjusted (some values outside of variable range). Varname: %s, dataname: %s.",
    227 - 1x + 1x +
                private$get_varname(), private$get_dataname()
    @@ -46022,7 +47662,8 @@

    teal.slice coverage - 65.73%

    229 - 1x + 1x +
              choices <- choices_adjusted
    @@ -46036,35 +47677,40 @@

    teal.slice coverage - 65.73%

    231 - 3x + 3x +
            if (choices[1L] >= choices[2L]) {
    232 - 1x + 1x +
              warning(sprintf(
    233 - 1x + 1x +
                "Invalid choices: lower is higher / equal to upper, or not in range of variable values.
    234 - 1x + 1x +
                Setting defaults. Varname: %s, dataname: %s.",
    235 - 1x + 1x +
                private$get_varname(), private$get_dataname()
    @@ -46078,7 +47724,8 @@

    teal.slice coverage - 65.73%

    237 - 1x + 1x +
              choices <- range(private$x, na.rm = TRUE)
    @@ -46106,28 +47753,32 @@

    teal.slice coverage - 65.73%

    241 - 23x + 23x +
          private$set_is_choice_limited(private$x, choices)
    242 - 23x + 23x +
          private$x <- private$x[
    243 - 23x + 23x +
            (as.POSIXct(trunc(private$x, units = "secs")) >= choices[1L] &
    244 - 23x + 23x +
              as.POSIXct(trunc(private$x, units = "secs")) <= choices[2L]) | is.na(private$x)
    @@ -46141,14 +47792,16 @@

    teal.slice coverage - 65.73%

    246 - 23x + 23x +
          private$teal_slice$choices <- choices
    247 - 23x + 23x +
          invisible(NULL)
    @@ -46190,14 +47843,16 @@

    teal.slice coverage - 65.73%

    253 - 23x + 23x +
          private$is_choice_limited <- (any(xl < choices[1L], na.rm = TRUE) | any(xl > choices[2L], na.rm = TRUE))
    254 - 23x + 23x +
          invisible(NULL)
    @@ -46218,21 +47873,24 @@

    teal.slice coverage - 65.73%

    257 - 34x + 34x +
          tryCatch(
    258 - 34x + 34x +
            expr = {
    259 - 34x + 34x +
              values <- as.POSIXct(values, origin = "1970-01-01 00:00:00")
    @@ -46246,7 +47904,8 @@

    teal.slice coverage - 65.73%

    261 - 31x + 31x +
              values
    @@ -46260,7 +47919,8 @@

    teal.slice coverage - 65.73%

    263 - 34x + 34x +
            error = function(e) stop("Vector of set values must contain values coercible to POSIX.")
    @@ -46288,42 +47948,48 @@

    teal.slice coverage - 65.73%

    267 - 1x + 1x +
          if (length(values) != 2) stop("Vector of set values must have length two.")
    268 - 30x + 30x +
          if (values[1] > values[2]) {
    269 - 1x + 1x +
            warning(
    270 - 1x + 1x +
              sprintf(
    271 - 1x + 1x +
                "Start date '%s' is set after the end date '%s', the values will be replaced by a default datetime range.",
    272 - 1x + 1x +
                values[1], values[2]
    @@ -46344,7 +48010,8 @@

    teal.slice coverage - 65.73%

    275 - 1x + 1x +
            values <- isolate(private$get_choices())
    @@ -46358,7 +48025,8 @@

    teal.slice coverage - 65.73%

    277 - 30x + 30x +
          values
    @@ -46379,42 +48047,48 @@

    teal.slice coverage - 65.73%

    280 - 30x + 30x +
          choices <- private$get_choices()
    281 - 30x + 30x +
          if (values[1] < choices[1L] || values[1] > choices[2L]) {
    282 - 5x + 5x +
            warning(
    283 - 5x + 5x +
              sprintf(
    284 - 5x + 5x +
                "Value: %s is outside of the range for the column '%s' in dataset '%s', setting minimum possible value.",
    285 - 5x + 5x +
                values[1], private$get_varname(), toString(private$get_dataname())
    @@ -46435,7 +48109,8 @@

    teal.slice coverage - 65.73%

    288 - 5x + 5x +
            values[1] <- choices[1L]
    @@ -46456,35 +48131,40 @@

    teal.slice coverage - 65.73%

    291 - 30x + 30x +
          if (values[2] > choices[2L] | values[2] < choices[1L]) {
    292 - 5x + 5x +
            warning(
    293 - 5x + 5x +
              sprintf(
    294 - 5x + 5x +
                "Value: '%s' is outside of the range for the column '%s' in dataset '%s', setting maximum possible value.",
    295 - 5x + 5x +
                values[2], private$get_varname(), toString(private$get_dataname())
    @@ -46505,7 +48185,8 @@

    teal.slice coverage - 65.73%

    298 - 5x + 5x +
            values[2] <- choices[2L]
    @@ -46526,7 +48207,8 @@

    teal.slice coverage - 65.73%

    301 - 30x + 30x +
          values
    @@ -49143,28 +50825,32 @@

    teal.slice coverage - 65.73%

    126 - 16x + 16x +
          shiny::isolate({
    127 - 16x + 16x +
            checkmate::assert_logical(x)
    128 - 15x + 15x +
            checkmate::assert_logical(slice$selected, null.ok = TRUE)
    129 - 14x + 14x +
            super$initialize(x = x, x_reactive = x_reactive, slice = slice, extract_type = extract_type)
    @@ -49178,7 +50864,8 @@

    teal.slice coverage - 65.73%

    131 - 14x + 14x +
            private$set_choices(slice$choices)
    @@ -49192,28 +50879,32 @@

    teal.slice coverage - 65.73%

    133 - 14x + 14x +
            if (is.null(slice$selected) && slice$multiple) {
    134 - 7x + 7x +
              slice$selected <- private$get_choices()
    135 - 7x + 7x +
            } else if (length(slice$selected) != 1 && !slice$multiple) {
    136 - 3x + 3x +
              slice$selected <- TRUE
    @@ -49227,28 +50918,32 @@

    teal.slice coverage - 65.73%

    138 - 14x + 14x +
            private$set_selected(slice$selected)
    139 - 14x + 14x +
            df <- factor(x, levels = c(TRUE, FALSE))
    140 - 14x + 14x +
            tbl <- table(df)
    141 - 14x + 14x +
            private$set_choices_counts(tbl)
    @@ -49262,7 +50957,8 @@

    teal.slice coverage - 65.73%

    143 - 14x + 14x +
          invisible(self)
    @@ -49339,7 +51035,8 @@

    teal.slice coverage - 65.73%

    154 - 6x + 6x +
          if (isFALSE(private$is_any_filtered())) {
    @@ -49360,28 +51057,32 @@

    teal.slice coverage - 65.73%

    157 - 4x + 4x +
          if (missing(dataname)) dataname <- private$get_dataname()
    158 - 6x + 6x +
          varname <- private$get_varname_prefixed(dataname)
    159 - 6x + 6x +
          choices <- private$get_selected()
    160 - 6x + 6x +
          n_choices <- length(choices)
    @@ -49395,35 +51096,40 @@

    teal.slice coverage - 65.73%

    162 - 6x + 6x +
          filter_call <-
    163 - 6x + 6x +
            if (n_choices == 1 && choices) {
    164 - 1x + 1x +
              varname
    165 - 6x + 6x +
            } else if (n_choices == 1 && !choices) {
    166 - 4x + 4x +
              call("!", varname)
    @@ -49437,7 +51143,8 @@

    teal.slice coverage - 65.73%

    168 - 1x + 1x +
              call("%in%", varname, make_c_call(choices))
    @@ -49451,7 +51158,8 @@

    teal.slice coverage - 65.73%

    170 - 6x + 6x +
          private$add_keep_na_call(filter_call, varname)
    @@ -49521,14 +51229,16 @@

    teal.slice coverage - 65.73%

    180 - 14x + 14x +
          private$teal_slice$choices <- c(TRUE, FALSE)
    181 - 14x + 14x +
          invisible(NULL)
    @@ -49563,14 +51273,16 @@

    teal.slice coverage - 65.73%

    186 - 14x + 14x +
          private$choices_counts <- choices_counts
    187 - 14x + 14x +
          invisible(NULL)
    @@ -49591,35 +51303,40 @@

    teal.slice coverage - 65.73%

    190 - 21x + 21x +
          tryCatch(
    191 - 21x + 21x +
            expr = {
    192 - 21x + 21x +
              values <- as.logical(values)
    193 - 1x + 1x +
              if (anyNA(values)) stop()
    194 - 20x + 20x +
              values
    @@ -49633,7 +51350,8 @@

    teal.slice coverage - 65.73%

    196 - 21x + 21x +
            error = function(e) stop("Vector of set values must contain values coercible to logical.")
    @@ -49668,28 +51386,32 @@

    teal.slice coverage - 65.73%

    201 - 20x + 20x +
          if (!private$is_multiple() && length(values) > 1) {
    202 - 1x + 1x +
            warning(
    203 - 1x + 1x +
              sprintf("Selection: %s is not a vector of length one. ", toString(values, width = 360)),
    204 - 1x + 1x +
              "Maintaining previous selection."
    @@ -49703,7 +51425,8 @@

    teal.slice coverage - 65.73%

    206 - 1x + 1x +
            values <- shiny::isolate(private$get_selected())
    @@ -49717,7 +51440,8 @@

    teal.slice coverage - 65.73%

    208 - 20x + 20x +
          values
    @@ -49759,7 +51483,8 @@

    teal.slice coverage - 65.73%

    214 - 6x + 6x +
          if (private$is_choice_limited) {
    @@ -49773,14 +51498,16 @@

    teal.slice coverage - 65.73%

    216 - 6x + 6x +
          } else if (all(private$choices_counts > 0)) {
    217 - 6x + 6x +
            TRUE
    @@ -52012,21 +53739,24 @@

    teal.slice coverage - 65.73%

    128 - 579x + 579x +
      checkmate::assert_string(dataname)
    129 - 572x + 572x +
      checkmate::assert_flag(fixed)
    130 - 570x + 570x +
      checkmate::assert_flag(anchored)
    @@ -52040,7 +53770,8 @@

    teal.slice coverage - 65.73%

    132 - 568x + 568x +
      formal_args <- as.list(environment())
    @@ -52054,7 +53785,8 @@

    teal.slice coverage - 65.73%

    134 - 568x + 568x +
      if (!missing(expr) && !missing(varname)) {
    @@ -52068,28 +53800,32 @@

    teal.slice coverage - 65.73%

    136 - 568x + 568x +
      } else if (!missing(expr)) {
    137 - 30x + 30x +
        checkmate::assert_string(id)
    138 - 27x + 27x +
        checkmate::assert_string(title)
    139 - 24x + 24x +
        checkmate::assert_string(expr)
    @@ -52103,84 +53839,96 @@

    teal.slice coverage - 65.73%

    141 - 23x + 23x +
        formal_args$fixed <- TRUE
    142 - 23x + 23x +
        ts_expr_args <- c("dataname", "id", "expr", "fixed", "anchored", "title")
    143 - 23x + 23x +
        formal_args <- formal_args[ts_expr_args]
    144 - 23x + 23x +
        ans <- do.call(shiny::reactiveValues, c(formal_args, list(...)))
    145 - 23x + 23x +
        class(ans) <- c("teal_slice_expr", "teal_slice", class(ans))
    146 - 538x + 538x +
      } else if (!missing(varname)) {
    147 - 537x + 537x +
        checkmate::assert_string(varname)
    148 - 534x + 534x +
        checkmate::assert_multi_class(choices, .filterable_class, null.ok = TRUE)
    149 - 533x + 533x +
        checkmate::assert_multi_class(selected, .filterable_class, null.ok = TRUE)
    150 - 531x + 531x +
        checkmate::assert_flag(keep_na, null.ok = TRUE)
    151 - 530x + 530x +
        checkmate::assert_flag(keep_inf, null.ok = TRUE)
    152 - 529x + 529x +
        checkmate::assert_flag(multiple)
    @@ -52194,21 +53942,24 @@

    teal.slice coverage - 65.73%

    154 - 529x + 529x +
        ts_var_args <- c(
    155 - 529x + 529x +
          "dataname", "varname", "id", "choices", "selected", "keep_na", "keep_inf",
    156 - 529x + 529x +
          "fixed", "anchored", "multiple"
    @@ -52222,42 +53973,48 @@

    teal.slice coverage - 65.73%

    158 - 529x + 529x +
        formal_args <- formal_args[ts_var_args]
    159 - 529x + 529x +
        args <- c(formal_args, list(...))
    160 - 529x + 529x +
        args[c("choices", "selected")] <-
    161 - 529x + 529x +
          lapply(args[c("choices", "selected")], function(x) if (is.factor(x)) as.character(x) else x)
    162 - 529x + 529x +
        if (missing(id)) {
    163 - 520x + 520x +
          args$id <- get_default_slice_id(args)
    @@ -52271,7 +54028,8 @@

    teal.slice coverage - 65.73%

    165 - 9x + 9x +
          checkmate::assert_string(id)
    @@ -52285,14 +54043,16 @@

    teal.slice coverage - 65.73%

    167 - 526x + 526x +
        ans <- do.call(shiny::reactiveValues, args)
    168 - 526x + 526x +
        class(ans) <- c("teal_slice_var", "teal_slice", class(ans))
    @@ -52306,7 +54066,8 @@

    teal.slice coverage - 65.73%

    170 - 1x + 1x +
        stop("Must provide either `expr` or `varname`.")
    @@ -52327,7 +54088,8 @@

    teal.slice coverage - 65.73%

    173 - 549x + 549x +
      ans
    @@ -52383,7 +54145,8 @@

    teal.slice coverage - 65.73%

    181 - 4x + 4x +
      inherits(x, "teal_slice")
    @@ -52502,7 +54265,8 @@

    teal.slice coverage - 65.73%

    198 - 283x + 283x +
      formal_args <- setdiff(names(formals(teal_slice)), "...")
    @@ -52516,7 +54280,8 @@

    teal.slice coverage - 65.73%

    200 - 283x + 283x +
      x <- if (shiny::isRunning()) {
    @@ -52537,7 +54302,8 @@

    teal.slice coverage - 65.73%

    203 - 283x + 283x +
        shiny::isolate(shiny::reactiveValuesToList(x))
    @@ -52558,14 +54324,16 @@

    teal.slice coverage - 65.73%

    206 - 283x + 283x +
      formal_args <- intersect(formal_args, names(x))
    207 - 283x + 283x +
      extra_args <- rev(setdiff(names(x), formal_args))
    @@ -52579,7 +54347,8 @@

    teal.slice coverage - 65.73%

    209 - 283x + 283x +
      x[c(formal_args, extra_args)]
    @@ -52642,14 +54411,16 @@

    teal.slice coverage - 65.73%

    218 - 116x + 116x +
      checkmate::assert_flag(show_all)
    219 - 92x + 92x +
      checkmate::assert_flag(trim_lines)
    @@ -52663,14 +54434,16 @@

    teal.slice coverage - 65.73%

    221 - 86x + 86x +
      x_list <- as.list(x)
    222 - 47x + 47x +
      if (!show_all) x_list <- Filter(Negate(is.null), x_list)
    @@ -52684,7 +54457,8 @@

    teal.slice coverage - 65.73%

    224 - 86x + 86x +
      jsonify(x_list, trim_lines)
    @@ -52740,7 +54514,8 @@

    teal.slice coverage - 65.73%

    232 - 15x + 15x +
      cat(format(x, ...))
    @@ -52866,7 +54641,8 @@

    teal.slice coverage - 65.73%

    250 - 131x + 131x +
      checkmate::assert_list(x)
    @@ -52880,28 +54656,32 @@

    teal.slice coverage - 65.73%

    252 - 131x + 131x +
      x_json <- to_json(x)
    253 - 131x + 131x +
      x_json_justified <- justify_json(x_json)
    254 - 121x + 121x +
      if (trim_lines) x_json_justified <- trim_lines_json(x_json_justified)
    255 - 131x + 131x +
      paste(x_json_justified, collapse = "\n")
    @@ -53006,35 +54786,40 @@

    teal.slice coverage - 65.73%

    270 - 131x + 131x +
      no_unbox <- function(x) {
    271 - 2390x + 2390x +
        vars <- c("selected", "choices")
    272 - 2390x + 2390x +
        if (is.list(x)) {
    273 - 385x + 385x +
          for (var in vars) {
    274 - 307x + 307x +
            if (!is.null(x[[var]])) x[[var]] <- I(format_time(x[[var]]))
    @@ -53048,7 +54833,8 @@

    teal.slice coverage - 65.73%

    276 - 385x + 385x +
          lapply(x, no_unbox)
    @@ -53062,7 +54848,8 @@

    teal.slice coverage - 65.73%

    278 - 2005x + 2005x +
          x
    @@ -53090,7 +54877,8 @@

    teal.slice coverage - 65.73%

    282 - 131x + 131x +
      jsonlite::toJSON(no_unbox(x), pretty = TRUE, auto_unbox = TRUE, digits = 16, null = "null")
    @@ -53202,14 +54990,16 @@

    teal.slice coverage - 65.73%

    298 - 307x + 307x +
      if ("POSIXt" %in% class(x)) {
    299 - 20x + 20x +
        format(x, format = "%Y-%m-%d %H:%M:%S", usetz = TRUE, tz = "UTC")
    @@ -53223,7 +55013,8 @@

    teal.slice coverage - 65.73%

    301 - 287x + 287x +
        x
    @@ -53328,35 +55119,40 @@

    teal.slice coverage - 65.73%

    316 - 131x + 131x +
      format_name <- function(name, name_width) {
    317 - 2775x + 2775x +
        if (nchar(name) == 1 || nchar(gsub("\\s", "", name)) <= 2) {
    318 - 630x + 630x +
          return(name)
    319 - 2145x + 2145x +
        } else if (grepl("slices|attributes", name)) {
    320 - 90x + 90x +
          paste0(name, ":")
    @@ -53370,7 +55166,8 @@

    teal.slice coverage - 65.73%

    322 - 2055x + 2055x +
          paste(format(name, width = name_width), ":")
    @@ -53391,28 +55188,32 @@

    teal.slice coverage - 65.73%

    325 - 131x + 131x +
      json_lines <- strsplit(json, "\n")[[1]]
    326 - 131x + 131x +
      json_lines_split <- regmatches(json_lines, regexpr(":", json_lines), invert = TRUE)
    327 - 131x + 131x +
      name_width <- max(unlist(regexpr(":", json_lines))) - 1
    328 - 131x + 131x +
      vapply(json_lines_split, function(x) paste0(format_name(x[1], name_width), stats::na.omit(x[2])), character(1))
    @@ -53517,35 +55318,40 @@

    teal.slice coverage - 65.73%

    343 - 121x + 121x +
      name_width <- max(unlist(gregexpr(":", x))) - 1
    344 - 121x + 121x +
      trim_position <- name_width + 37L
    345 - 121x + 121x +
      x_trim <- substr(x, 1, trim_position)
    346 - 121x + 121x +
      substr(x_trim, trim_position - 2, trim_position) <- "..."
    347 - 121x + 121x +
      x_trim
    @@ -53713,28 +55519,32 @@

    teal.slice coverage - 65.73%

    371 - 609x + 609x +
      checkmate::assert_multi_class(x, c("teal_slice", "list"))
    372 - 609x + 609x +
      shiny::isolate({
    373 - 609x + 609x +
        if (inherits(x, "teal_slice_expr") || is.null(x$varname)) {
    374 - 10x + 10x +
          x$id
    @@ -53748,28 +55558,32 @@

    teal.slice coverage - 65.73%

    376 - 599x + 599x +
          paste(
    377 - 599x + 599x +
            Filter(
    378 - 599x + 599x +
              length,
    379 - 599x + 599x +
              as.list(x)[c("dataname", "varname", "experiment", "arg")]
    @@ -53783,7 +55597,8 @@

    teal.slice coverage - 65.73%

    381 - 599x + 599x +
            collapse = " "
    @@ -54076,7 +55891,8 @@

    teal.slice coverage - 65.73%

    37 - 9x + 9x +
      UseMethod("variable_types")
    @@ -54111,7 +55927,8 @@

    teal.slice coverage - 65.73%

    42 - 9x + 9x +
      checkmate::assert_character(columns, null.ok = TRUE, any.missing = FALSE)
    @@ -54125,7 +55942,8 @@

    teal.slice coverage - 65.73%

    44 - 9x + 9x +
      res <- if (is.null(columns)) {
    @@ -54174,49 +55992,56 @@

    teal.slice coverage - 65.73%

    51 - 9x + 9x +
      } else if (checkmate::test_character(columns, any.missing = FALSE)) {
    52 - 9x + 9x +
        stopifnot(all(columns %in% names(data) | vapply(columns, identical, logical(1L), "")))
    53 - 9x + 9x +
        vapply(
    54 - 9x + 9x +
          columns,
    55 - 9x + 9x +
          function(x) ifelse(x == "", "", class(data[[x]])[[1]]),
    56 - 9x + 9x +
          character(1),
    57 - 9x + 9x +
          USE.NAMES = FALSE
    @@ -54258,7 +56083,8 @@

    teal.slice coverage - 65.73%

    63 - 9x + 9x +
      return(res)
    @@ -54293,7 +56119,8 @@

    teal.slice coverage - 65.73%

    68 - 9x + 9x +
      variable_types.default(data, columns)
    @@ -54985,42 +56812,48 @@

    teal.slice coverage - 65.73%

    57 - 6x + 6x +
          shiny::isolate({
    58 - 6x + 6x +
            super$initialize(
    59 - 6x + 6x +
              x = x,
    60 - 6x + 6x +
              x_reactive = x_reactive,
    61 - 6x + 6x +
              slice = slice,
    62 - 6x + 6x +
              extract_type = extract_type
    @@ -55034,14 +56867,16 @@

    teal.slice coverage - 65.73%

    64 - 6x + 6x +
            private$set_choices(slice$choices)
    65 - 6x + 6x +
            private$set_selected(slice$selected)
    @@ -55062,7 +56897,8 @@

    teal.slice coverage - 65.73%

    68 - 6x + 6x +
          invisible(self)
    @@ -55146,14 +56982,16 @@

    teal.slice coverage - 65.73%

    80 - 2x + 2x +
          if (isFALSE(private$is_any_filtered())) {
    81 - 1x + 1x +
            return(NULL)
    @@ -55167,14 +57005,16 @@

    teal.slice coverage - 65.73%

    83 - 1x + 1x +
          if (missing(dataname)) dataname <- private$get_dataname()
    84 - 1x + 1x +
          filter_call <- if (isTRUE(private$get_keep_na())) {
    @@ -55195,7 +57035,8 @@

    teal.slice coverage - 65.73%

    87 - 1x + 1x +
            substitute(!is.na(varname), list(varname = private$get_varname_prefixed(dataname)))
    @@ -55307,14 +57148,16 @@

    teal.slice coverage - 65.73%

    103 - 6x + 6x +
          private$teal_slice$choices <- choices
    104 - 6x + 6x +
          invisible(NULL)
    @@ -55377,7 +57220,8 @@

    teal.slice coverage - 65.73%

    113 - 2x + 2x +
          if (private$is_choice_limited) {
    @@ -55398,7 +57242,8 @@

    teal.slice coverage - 65.73%

    116 - 2x + 2x +
            !isTRUE(private$get_keep_na())
    @@ -56139,14 +57984,16 @@

    teal.slice coverage - 65.73%

    49 - 8x + 8x +
          checkmate::assert_class(datasets, "FilteredData")
    50 - 6x + 6x +
          private$filtered_data <- datasets
    @@ -56230,7 +58077,8 @@

    teal.slice coverage - 65.73%

    62 - 8x + 8x +
          private$filtered_data$get_filter_state()
    @@ -56300,14 +58148,16 @@

    teal.slice coverage - 65.73%

    72 - 5x + 5x +
          private$filtered_data$set_filter_state(filter)
    73 - 5x + 5x +
          invisible(NULL)
    @@ -56398,14 +58248,16 @@

    teal.slice coverage - 65.73%

    86 - 1x + 1x +
          private$filtered_data$remove_filter_state(filter)
    87 - 1x + 1x +
          invisible(NULL)
    @@ -56489,21 +58341,24 @@

    teal.slice coverage - 65.73%

    99 - 2x + 2x +
          datanames_to_remove <- if (missing(datanames)) private$filtered_data$datanames() else datanames
    100 - 2x + 2x +
          private$filtered_data$clear_filter_states(datanames = datanames_to_remove)
    101 - 2x + 2x +
          invisible(NULL)
    @@ -57006,42 +58861,48 @@

    teal.slice coverage - 65.73%

    64 - 25x + 25x +
      checkmate::assert_string(inputId)
    65 - 21x + 21x +
      checkmate::assert_vector(choices)
    66 - 20x + 20x +
      checkmate::assert_numeric(countsmax, len = length(choices))
    67 - 17x + 17x +
      checkmate::assert_numeric(countsnow, len = length(choices), null.ok = TRUE)
    68 - 15x + 15x +
      if (!is.null(countsnow)) {
    69 - 7x + 7x +
        checkmate::assert_true(all(countsnow <= countsmax))
    @@ -57062,7 +58923,8 @@

    teal.slice coverage - 65.73%

    72 - 14x + 14x +
      ns <- NS(inputId)
    @@ -57076,56 +58938,64 @@

    teal.slice coverage - 65.73%

    74 - 14x + 14x +
      mapply(
    75 - 14x + 14x +
        countBar,
    76 - 14x + 14x +
        inputId = ns(seq_along(choices)),
    77 - 14x + 14x +
        label = as.character(choices),
    78 - 14x + 14x +
        countmax = countsmax,
    79 - 14x + 14x +
        countnow = if (is.null(countsnow)) rep(list(NULL), length(choices)) else countsnow,
    80 - 14x + 14x +
        MoreArgs = list(
    81 - 14x + 14x +
          counttotal = sum(countsmax)
    @@ -57139,7 +59009,8 @@

    teal.slice coverage - 65.73%

    83 - 14x + 14x +
        SIMPLIFY = FALSE, USE.NAMES = FALSE
    @@ -57265,35 +59136,40 @@

    teal.slice coverage - 65.73%

    101 - 62x + 62x +
      checkmate::assert_string(inputId)
    102 - 58x + 58x +
      checkmate::assert_string(label)
    103 - 55x + 55x +
      checkmate::assert_number(countmax)
    104 - 53x + 53x +
      checkmate::assert_number(countnow, null.ok = TRUE, upper = countmax)
    105 - 51x + 51x +
      checkmate::assert_number(counttotal, lower = countmax)
    @@ -57307,35 +59183,40 @@

    teal.slice coverage - 65.73%

    107 - 49x + 49x +
      label <- make_count_text(label, countmax = countmax, countnow = countnow)
    108 - 49x + 49x +
      ns <- NS(inputId)
    109 - 26x + 26x +
      if (is.null(countnow)) countnow <- 0
    110 - 49x + 49x +
      tags$div(
    111 - 49x + 49x +
        class = "progress state-count-container",
    @@ -57349,42 +59230,48 @@

    teal.slice coverage - 65.73%

    113 - 49x + 49x +
        tags$div(
    114 - 49x + 49x +
          id = ns("count_bar_filtered"),
    115 - 49x + 49x +
          class = "progress-bar state-count-bar-filtered",
    116 - 49x + 49x +
          style = sprintf("width: %s%%", countnow / counttotal * 100),
    117 - 49x + 49x +
          role = "progressbar",
    118 - 49x + 49x +
          label
    @@ -57398,35 +59285,40 @@

    teal.slice coverage - 65.73%

    120 - 49x + 49x +
        tags$div(
    121 - 49x + 49x +
          id = ns("count_bar_unfiltered"),
    122 - 49x + 49x +
          class = "progress-bar state-count-bar-unfiltered",
    123 - 49x + 49x +
          style = sprintf("width: %s%%", (countmax - countnow) / counttotal * 100),
    124 - 49x + 49x +
          role = "progressbar"
    @@ -57482,28 +59374,32 @@

    teal.slice coverage - 65.73%

    132 - 7x + 7x +
      checkmate::assert_string(inputId)
    133 - 7x + 7x +
      checkmate::assert_vector(choices)
    134 - 7x + 7x +
      checkmate::assert_numeric(countsmax, len = length(choices))
    135 - 7x + 7x +
      checkmate::assert_numeric(countsnow, len = length(choices), null.ok = TRUE)
    @@ -57517,63 +59413,72 @@

    teal.slice coverage - 65.73%

    137 - 7x + 7x +
      ns <- NS(inputId)
    138 - 7x + 7x +
      mapply(
    139 - 7x + 7x +
        updateCountBar,
    140 - 7x + 7x +
        inputId = ns(seq_along(choices)),
    141 - 7x + 7x +
        label = choices,
    142 - 7x + 7x +
        countmax = countsmax,
    143 - 7x + 7x +
        countnow = if (is.null(countsnow)) rep(list(NULL), length(choices)) else countsnow,
    144 - 7x + 7x +
        MoreArgs = list(
    145 - 7x + 7x +
          counttotal = sum(countsmax)
    @@ -57594,7 +59499,8 @@

    teal.slice coverage - 65.73%

    148 - 7x + 7x +
      invisible(NULL)
    @@ -57636,35 +59542,40 @@

    teal.slice coverage - 65.73%

    154 - 18x + 18x +
      checkmate::assert_string(inputId)
    155 - 18x + 18x +
      checkmate::assert_string(label)
    156 - 18x + 18x +
      checkmate::assert_number(countmax)
    157 - 18x + 18x +
      checkmate::assert_number(countnow, null.ok = TRUE)
    158 - 18x + 18x +
      checkmate::assert_number(counttotal)
    @@ -57678,70 +59589,80 @@

    teal.slice coverage - 65.73%

    160 - 18x + 18x +
      label <- make_count_text(label, countmax = countmax, countnow = countnow)
    161 - 18x + 18x +
      if (is.null(countnow)) countnow <- countmax
    162 - 18x + 18x +
      session$sendCustomMessage(
    163 - 18x + 18x +
        type = "updateCountBar",
    164 - 18x + 18x +
        message = list(
    165 - 18x + 18x +
          id = session$ns(inputId),
    166 - 18x + 18x +
          label = label,
    167 - 18x + 18x +
          countmax = countmax,
    168 - 18x + 18x +
          countnow = countnow,
    169 - 18x + 18x +
          counttotal = counttotal
    @@ -57769,7 +59690,8 @@

    teal.slice coverage - 65.73%

    173 - 18x + 18x +
      invisible(NULL)
    @@ -57804,70 +59726,80 @@

    teal.slice coverage - 65.73%

    178 - 17x + 17x +
      checkmate::assert_string(inputId)
    179 - 17x + 17x +
      checkmate::assert_string(label)
    180 - 17x + 17x +
      checkmate::assert_number(countmax)
    181 - 17x + 17x +
      checkmate::assert_number(countnow, null.ok = TRUE)
    182 - 17x + 17x +
      label <- make_count_text(label, countmax = countmax, countnow = countnow)
    183 - 17x + 17x +
      session$sendCustomMessage(
    184 - 17x + 17x +
        type = "updateCountText",
    185 - 17x + 17x +
        message = list(
    186 - 17x + 17x +
          id = session$ns(inputId),
    187 - 17x + 17x +
          label = label
    @@ -57979,56 +59911,64 @@

    teal.slice coverage - 65.73%

    203 - 96x + 96x +
      checkmate::assert_string(label)
    204 - 94x + 94x +
      checkmate::assert_number(countmax)
    205 - 92x + 92x +
      checkmate::assert_number(countnow, null.ok = TRUE)
    206 - 90x + 90x +
      sprintf(
    207 - 90x + 90x +
        "%s (%s%s)",
    208 - 90x + 90x +
        label,
    209 - 90x + 90x +
        if (is.null(countnow)) "" else sprintf("%s/", countnow),
    210 - 90x + 90x +
        countmax
    @@ -58370,7 +60310,8 @@

    teal.slice coverage - 65.73%

    46 - 23x + 23x +
          if (!requireNamespace("MultiAssayExperiment", quietly = TRUE)) {
    @@ -58391,21 +60332,24 @@

    teal.slice coverage - 65.73%

    49 - 23x + 23x +
          checkmate::assert_class(dataset, "MultiAssayExperiment")
    50 - 21x + 21x +
          super$initialize(dataset, dataname, keys, label)
    51 - 21x + 21x +
          experiment_names <- names(dataset)
    @@ -58426,49 +60370,56 @@

    teal.slice coverage - 65.73%

    54 - 21x + 21x +
          private$add_filter_states(
    55 - 21x + 21x +
            filter_states = init_filter_states(
    56 - 21x + 21x +
              data = dataset,
    57 - 21x + 21x +
              data_reactive = private$data_filtered_fun,
    58 - 21x + 21x +
              dataname = dataname,
    59 - 21x + 21x +
              datalabel = "subjects",
    60 - 21x + 21x +
              keys = self$get_keys()
    @@ -58482,7 +60433,8 @@

    teal.slice coverage - 65.73%

    62 - 21x + 21x +
            id = "subjects"
    @@ -58517,70 +60469,80 @@

    teal.slice coverage - 65.73%

    67 - 21x + 21x +
          lapply(
    68 - 21x + 21x +
            experiment_names,
    69 - 21x + 21x +
            function(experiment_name) {
    70 - 105x + 105x +
              data_reactive <- function(sid = "") private$data_filtered_fun(sid)[[experiment_name]]
    71 - 105x + 105x +
              private$add_filter_states(
    72 - 105x + 105x +
                filter_states = init_filter_states(
    73 - 105x + 105x +
                  data = dataset[[experiment_name]],
    74 - 105x + 105x +
                  data_reactive = data_reactive,
    75 - 105x + 105x +
                  dataname = dataname,
    76 - 105x + 105x +
                  datalabel = experiment_name
    @@ -58594,7 +60556,8 @@

    teal.slice coverage - 65.73%

    78 - 105x + 105x +
                id = experiment_name
    @@ -58685,35 +60648,40 @@

    teal.slice coverage - 65.73%

    91 - 15x + 15x +
          shiny::isolate({
    92 - 15x + 15x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initializing, dataname: { private$dataname }")
    93 - 15x + 15x +
            checkmate::assert_class(state, "teal_slices")
    94 - 14x + 14x +
            lapply(state, function(x) {
    95 - 52x + 52x +
              checkmate::assert_true(x$dataname == private$dataname, .var.name = "dataname matches private$dataname")
    @@ -58741,14 +60709,16 @@

    teal.slice coverage - 65.73%

    99 - 14x + 14x +
            subject_state <- Filter(function(x) is.null(x$experiment), state)
    100 - 14x + 14x +
            private$get_filter_states()[["subjects"]]$set_filter_state(subject_state)
    @@ -58776,28 +60746,32 @@

    teal.slice coverage - 65.73%

    104 - 14x + 14x +
            experiments <- unique(unlist(lapply(state, "[[", "experiment")))
    105 - 14x + 14x +
            available_experiments <- setdiff(names(private$get_filter_states()), "subjects")
    106 - 14x + 14x +
            excluded_filters <- setdiff(experiments, available_experiments)
    107 - 14x + 14x +
            if (length(excluded_filters)) {
    @@ -58867,21 +60841,24 @@

    teal.slice coverage - 65.73%

    117 - 14x + 14x +
            lapply(available_experiments, function(experiment) {
    118 - 70x + 70x +
              slices <- Filter(function(x) identical(x$experiment, experiment), state)
    119 - 70x + 70x +
              private$get_filter_states()[[experiment]]$set_filter_state(slices)
    @@ -58902,7 +60879,8 @@

    teal.slice coverage - 65.73%

    122 - 14x + 14x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initialized, dataname: { private$dataname }")
    @@ -58916,7 +60894,8 @@

    teal.slice coverage - 65.73%

    124 - 14x + 14x +
            invisible(NULL)
    @@ -59014,7 +60993,8 @@

    teal.slice coverage - 65.73%

    138 - 1x + 1x +
          checkmate::assert_class(state, "teal_slices")
    @@ -59028,14 +61008,16 @@

    teal.slice coverage - 65.73%

    140 - 1x + 1x +
          shiny::isolate({
    141 - 1x + 1x +
            logger::log_trace("{ class(self)[1] }$remove_filter_state removing filter(s), dataname: { private$dataname }")
    @@ -59049,14 +61031,16 @@

    teal.slice coverage - 65.73%

    143 - 1x + 1x +
            subject_state <- Filter(function(x) is.null(x$experiment), state)
    144 - 1x + 1x +
            private$get_filter_states()[["subjects"]]$remove_filter_state(subject_state)
    @@ -59084,28 +61068,32 @@

    teal.slice coverage - 65.73%

    148 - 1x + 1x +
            experiments <- unique(unlist(lapply(state, "[[", "experiment")))
    149 - 1x + 1x +
            available_experiments <- setdiff(names(private$get_filter_states()), "subjects")
    150 - 1x + 1x +
            excluded_filters <- setdiff(experiments, available_experiments)
    151 - 1x + 1x +
            if (length(excluded_filters)) {
    @@ -59168,7 +61156,8 @@

    teal.slice coverage - 65.73%

    160 - 1x + 1x +
            lapply(experiments, function(experiment) {
    @@ -59210,7 +61199,8 @@

    teal.slice coverage - 65.73%

    166 - 1x + 1x +
            logger::log_trace("{ class(self)[1] }$remove_filter_state removed filter(s), dataname: { private$dataname }")
    @@ -59231,7 +61221,8 @@

    teal.slice coverage - 65.73%

    169 - 1x + 1x +
          invisible(NULL)
    @@ -59525,21 +61516,24 @@

    teal.slice coverage - 65.73%

    211 - 2x + 2x +
          data <- self$get_dataset()
    212 - 2x + 2x +
          data_filtered <- self$get_dataset(TRUE)
    213 - 2x + 2x +
          experiment_names <- names(data)
    @@ -59553,28 +61547,32 @@

    teal.slice coverage - 65.73%

    215 - 2x + 2x +
          mae_info <- data.frame(
    216 - 2x + 2x +
            dataname = private$dataname,
    217 - 2x + 2x +
            subjects = nrow(SummarizedExperiment::colData(data)),
    218 - 2x + 2x +
            subjects_filtered = nrow(SummarizedExperiment::colData(data_filtered()))
    @@ -59595,49 +61593,56 @@

    teal.slice coverage - 65.73%

    221 - 2x + 2x +
          experiment_obs_info <- do.call("rbind", lapply(
    222 - 2x + 2x +
            experiment_names,
    223 - 2x + 2x +
            function(experiment_name) {
    224 - 10x + 10x +
              data.frame(
    225 - 10x + 10x +
                dataname = sprintf("- %s", experiment_name),
    226 - 10x + 10x +
                obs = nrow(data[[experiment_name]]),
    227 - 10x + 10x +
                obs_filtered = nrow(data_filtered()[[experiment_name]])
    @@ -59672,21 +61677,24 @@

    teal.slice coverage - 65.73%

    232 - 2x + 2x +
          get_experiment_keys <- function(mae, experiment) {
    233 - 20x + 20x +
            sample_subset <- subset(MultiAssayExperiment::sampleMap(mae), colname %in% colnames(experiment))
    234 - 20x + 20x +
            length(unique(sample_subset$primary))
    @@ -59707,42 +61715,48 @@

    teal.slice coverage - 65.73%

    237 - 2x + 2x +
          experiment_subjects_info <- do.call("rbind", lapply(
    238 - 2x + 2x +
            experiment_names,
    239 - 2x + 2x +
            function(experiment_name) {
    240 - 10x + 10x +
              data.frame(
    241 - 10x + 10x +
                subjects = get_experiment_keys(data, data[[experiment_name]]),
    242 - 10x + 10x +
                subjects_filtered = get_experiment_keys(data_filtered(), data_filtered()[[experiment_name]])
    @@ -59777,14 +61791,16 @@

    teal.slice coverage - 65.73%

    247 - 2x + 2x +
          experiment_info <- cbind(experiment_obs_info, experiment_subjects_info)
    248 - 2x + 2x +
          dplyr::bind_rows(mae_info, experiment_info)
    @@ -60252,14 +62268,16 @@

    teal.slice coverage - 65.73%

    63 - 103x + 103x +
          checkmate::assert_data_frame(dataset)
    64 - 101x + 101x +
          super$initialize(dataset, dataname, keys, label)
    @@ -60280,21 +62298,24 @@

    teal.slice coverage - 65.73%

    67 - 99x + 99x +
          if (!is.null(parent)) {
    68 - 10x + 10x +
            checkmate::assert_character(parent_name, len = 1)
    69 - 10x + 10x +
            checkmate::assert_character(join_keys, min.len = 1)
    @@ -60308,14 +62329,16 @@

    teal.slice coverage - 65.73%

    71 - 10x + 10x +
            private$parent_name <- parent_name
    72 - 10x + 10x +
            private$join_keys <- join_keys
    @@ -60329,28 +62352,32 @@

    teal.slice coverage - 65.73%

    74 - 10x + 10x +
            private$data_filtered_fun <- function(sid = "") {
    75 - 8x + 8x +
              checkmate::assert_character(sid)
    76 - 8x + 8x +
              if (length(sid)) {
    77 - 8x + 8x +
                logger::log_trace("filtering data dataname: { dataname }, sid: { sid }")
    @@ -60378,42 +62405,48 @@

    teal.slice coverage - 65.73%

    81 - 8x + 8x +
              env <- new.env(parent = parent.env(globalenv()))
    82 - 8x + 8x +
              env[[dataname]] <- private$dataset
    83 - 8x + 8x +
              env[[parent_name]] <- parent()
    84 - 8x + 8x +
              filter_call <- self$get_call(sid)
    85 - 8x + 8x +
              eval_expr_with_msg(filter_call, env)
    86 - 8x + 8x +
              get(x = dataname, envir = env)
    @@ -60441,42 +62474,48 @@

    teal.slice coverage - 65.73%

    90 - 99x + 99x +
          private$add_filter_states(
    91 - 99x + 99x +
            filter_states = init_filter_states(
    92 - 99x + 99x +
              data = dataset,
    93 - 99x + 99x +
              data_reactive = private$data_filtered_fun,
    94 - 99x + 99x +
              dataname = dataname,
    95 - 99x + 99x +
              keys = self$get_keys()
    @@ -60490,7 +62529,8 @@

    teal.slice coverage - 65.73%

    97 - 99x + 99x +
            id = "filter"
    @@ -60518,35 +62558,40 @@

    teal.slice coverage - 65.73%

    101 - 99x + 99x +
          if (!is.null(parent)) {
    102 - 10x + 10x +
            fs <- teal_slices(
    103 - 10x + 10x +
              exclude_varnames = structure(
    104 - 10x + 10x +
                list(intersect(colnames(dataset), colnames(isolate(parent())))),
    105 - 10x + 10x +
                names = private$dataname
    @@ -60567,7 +62612,8 @@

    teal.slice coverage - 65.73%

    108 - 10x + 10x +
            self$set_filter_state(fs)
    @@ -60588,7 +62634,8 @@

    teal.slice coverage - 65.73%

    111 - 99x + 99x +
          invisible(self)
    @@ -60721,28 +62768,32 @@

    teal.slice coverage - 65.73%

    130 - 42x + 42x +
          logger::log_trace("DataframeFilteredDataset$get_call initializing for dataname: { private$dataname }")
    131 - 42x + 42x +
          filter_call <- super$get_call(sid)
    132 - 42x + 42x +
          dataname <- private$dataname
    133 - 42x + 42x +
          parent_dataname <- private$parent_name
    @@ -60756,28 +62807,32 @@

    teal.slice coverage - 65.73%

    135 - 42x + 42x +
          if (!identical(parent_dataname, character(0))) {
    136 - 9x + 9x +
            join_keys <- private$join_keys
    137 - 9x + 9x +
            parent_keys <- unname(join_keys)
    138 - 9x + 9x +
            dataset_keys <- names(join_keys)
    @@ -60791,7 +62846,8 @@

    teal.slice coverage - 65.73%

    140 - 9x + 9x +
            y_arg <- if (length(parent_keys) == 0L) {
    @@ -60812,28 +62868,32 @@

    teal.slice coverage - 65.73%

    143 - 9x + 9x +
              sprintf(
    144 - 9x + 9x +
                "%s[, c(%s), drop = FALSE]",
    145 - 9x + 9x +
                parent_dataname,
    146 - 9x + 9x +
                toString(dQuote(parent_keys, q = FALSE))
    @@ -60861,7 +62921,8 @@

    teal.slice coverage - 65.73%

    150 - 9x + 9x +
            more_args <- if (length(parent_keys) == 0 || length(dataset_keys) == 0) {
    @@ -60875,14 +62936,16 @@

    teal.slice coverage - 65.73%

    152 - 9x + 9x +
            } else if (identical(parent_keys, dataset_keys)) {
    153 - 7x + 7x +
              list(by = parent_keys)
    @@ -60896,7 +62959,8 @@

    teal.slice coverage - 65.73%

    155 - 2x + 2x +
              list(by = stats::setNames(parent_keys, dataset_keys))
    @@ -60917,7 +62981,8 @@

    teal.slice coverage - 65.73%

    158 - 9x + 9x +
            merge_call <- call(
    @@ -60931,49 +62996,56 @@

    teal.slice coverage - 65.73%

    160 - 9x + 9x +
              as.name(dataname),
    161 - 9x + 9x +
              as.call(
    162 - 9x + 9x +
                c(
    163 - 9x + 9x +
                  str2lang("dplyr::inner_join"),
    164 - 9x + 9x +
                  x = as.name(dataname),
    165 - 9x + 9x +
                  y = str2lang(y_arg),
    166 - 9x + 9x +
                  more_args
    @@ -61008,7 +63080,8 @@

    teal.slice coverage - 65.73%

    171 - 9x + 9x +
            filter_call <- c(filter_call, merge_call)
    @@ -61022,14 +63095,16 @@

    teal.slice coverage - 65.73%

    173 - 42x + 42x +
          logger::log_trace("DataframeFilteredDataset$get_call initializing for dataname: { private$dataname }")
    174 - 42x + 42x +
          filter_call
    @@ -61099,35 +63174,40 @@

    teal.slice coverage - 65.73%

    184 - 81x + 81x +
          shiny::isolate({
    185 - 81x + 81x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initializing, dataname: { private$dataname }")
    186 - 81x + 81x +
            checkmate::assert_class(state, "teal_slices")
    187 - 80x + 80x +
            lapply(state, function(slice) {
    188 - 97x + 97x +
              checkmate::assert_true(slice$dataname == private$dataname)
    @@ -61141,14 +63221,16 @@

    teal.slice coverage - 65.73%

    190 - 80x + 80x +
            private$get_filter_states()[[1L]]$set_filter_state(state = state)
    191 - 80x + 80x +
            invisible(NULL)
    @@ -61246,7 +63328,8 @@

    teal.slice coverage - 65.73%

    205 - 11x + 11x +
          checkmate::assert_class(state, "teal_slices")
    @@ -61260,14 +63343,16 @@

    teal.slice coverage - 65.73%

    207 - 11x + 11x +
          shiny::isolate({
    208 - 11x + 11x +
            logger::log_trace("{ class(self)[1] }$remove_filter_state removing filter(s), dataname: { private$dataname }")
    @@ -61281,14 +63366,16 @@

    teal.slice coverage - 65.73%

    210 - 11x + 11x +
            varnames <- unique(unlist(lapply(state, "[[", "varname")))
    211 - 11x + 11x +
            private$get_filter_states()[[1]]$remove_filter_state(state)
    @@ -61302,7 +63389,8 @@

    teal.slice coverage - 65.73%

    213 - 11x + 11x +
            logger::log_trace("{ class(self)[1] }$remove_filter_state removed filter(s), dataname: { private$dataname }")
    @@ -61323,7 +63411,8 @@

    teal.slice coverage - 65.73%

    216 - 11x + 11x +
          invisible(NULL)
    @@ -61498,7 +63587,8 @@

    teal.slice coverage - 65.73%

    241 - 12x + 12x +
          logger::log_trace("FilteredDataset$srv_filter_overview initialized")
    @@ -61519,14 +63609,16 @@

    teal.slice coverage - 65.73%

    244 - 12x + 12x +
          subject_keys <- if (length(private$parent_name) > 0) {
    245 - 1x + 1x +
            names(private$join_keys)
    @@ -61540,7 +63632,8 @@

    teal.slice coverage - 65.73%

    247 - 11x + 11x +
            self$get_keys()
    @@ -61554,49 +63647,56 @@

    teal.slice coverage - 65.73%

    249 - 12x + 12x +
          dataset <- self$get_dataset()
    250 - 12x + 12x +
          data_filtered <- self$get_dataset(TRUE)
    251 - 12x + 12x +
          if (length(subject_keys) == 0) {
    252 - 10x + 10x +
            data.frame(
    253 - 10x + 10x +
              dataname = private$dataname,
    254 - 10x + 10x +
              obs = nrow(dataset),
    255 - 10x + 10x +
              obs_filtered = nrow(data_filtered())
    @@ -61617,42 +63717,48 @@

    teal.slice coverage - 65.73%

    258 - 2x + 2x +
            data.frame(
    259 - 2x + 2x +
              dataname = private$dataname,
    260 - 2x + 2x +
              obs = nrow(dataset),
    261 - 2x + 2x +
              obs_filtered = nrow(data_filtered()),
    262 - 2x + 2x +
              subjects = nrow(unique(dataset[subject_keys])),
    263 - 2x + 2x +
              subjects_filtered = nrow(unique(data_filtered()[subject_keys]))
    @@ -62176,7 +64282,8 @@

    teal.slice coverage - 65.73%

    63 - 229x + 229x +
      UseMethod("init_filter_states")
    @@ -62253,42 +64360,48 @@

    teal.slice coverage - 65.73%

    74 - 100x + 100x +
      DFFilterStates$new(
    75 - 100x + 100x +
        data = data,
    76 - 100x + 100x +
        data_reactive = data_reactive,
    77 - 100x + 100x +
        dataname = dataname,
    78 - 100x + 100x +
        datalabel = datalabel,
    79 - 100x + 100x +
        keys = keys
    @@ -62365,35 +64478,40 @@

    teal.slice coverage - 65.73%

    90 - 22x + 22x +
      MatrixFilterStates$new(
    91 - 22x + 22x +
        data = data,
    92 - 22x + 22x +
        data_reactive = data_reactive,
    93 - 22x + 22x +
        dataname = dataname,
    94 - 22x + 22x +
        datalabel = datalabel
    @@ -62477,7 +64595,8 @@

    teal.slice coverage - 65.73%

    106 - 22x + 22x +
      if (!requireNamespace("MultiAssayExperiment", quietly = TRUE)) {
    @@ -62498,42 +64617,48 @@

    teal.slice coverage - 65.73%

    109 - 22x + 22x +
      MAEFilterStates$new(
    110 - 22x + 22x +
        data = data,
    111 - 22x + 22x +
        data_reactive = data_reactive,
    112 - 22x + 22x +
        dataname = dataname,
    113 - 22x + 22x +
        datalabel = datalabel,
    114 - 22x + 22x +
        keys = keys
    @@ -62610,7 +64735,8 @@

    teal.slice coverage - 65.73%

    125 - 85x + 85x +
      if (!requireNamespace("SummarizedExperiment", quietly = TRUE)) {
    @@ -62631,35 +64757,40 @@

    teal.slice coverage - 65.73%

    128 - 85x + 85x +
      SEFilterStates$new(
    129 - 85x + 85x +
        data = data,
    130 - 85x + 85x +
        data_reactive = data_reactive,
    131 - 85x + 85x +
        dataname = dataname,
    132 - 85x + 85x +
        datalabel = datalabel
    @@ -62834,7 +64965,8 @@

    teal.slice coverage - 65.73%

    157 - 227x + 227x +
      UseMethod("get_supported_filter_varnames")
    @@ -62876,28 +65008,32 @@

    teal.slice coverage - 65.73%

    163 - 198x + 198x +
      is_expected_class <- vapply(
    164 - 198x + 198x +
        X = data,
    165 - 198x + 198x +
        FUN = function(x) any(class(x) %in% .filterable_class),
    166 - 198x + 198x +
        FUN.VALUE = logical(1)
    @@ -62911,7 +65047,8 @@

    teal.slice coverage - 65.73%

    168 - 198x + 198x +
      names(is_expected_class[is_expected_class])
    @@ -62960,21 +65097,24 @@

    teal.slice coverage - 65.73%

    175 - 29x + 29x +
      is_expected_class <- class(data[, 1]) %in% .filterable_class
    176 - 29x + 29x +
      if (is_expected_class && !is.null(colnames(data))) {
    177 - 26x + 26x +
        colnames(data)
    @@ -62988,7 +65128,8 @@

    teal.slice coverage - 65.73%

    179 - 3x + 3x +
        character(0)
    @@ -63226,7 +65367,8 @@

    teal.slice coverage - 65.73%

    213 - 9x + 9x +
      if (length(choices) == 0) {
    @@ -63247,14 +65389,16 @@

    teal.slice coverage - 65.73%

    216 - 9x + 9x +
      choice_types <- stats::setNames(variable_types(data = data, columns = choices), choices)
    217 - 9x + 9x +
      choice_types[keys] <- "primary_key"
    @@ -63268,28 +65412,32 @@

    teal.slice coverage - 65.73%

    219 - 9x + 9x +
      choices_labeled(
    220 - 9x + 9x +
        choices = choices,
    221 - 9x + 9x +
        labels = unname(varlabels[choices]),
    222 - 9x + 9x +
        types = choice_types[choices]
    @@ -63324,49 +65472,56 @@

    teal.slice coverage - 65.73%

    227 - 9x + 9x +
      if (!is.array(data)) {
    228 - 9x + 9x +
        vapply(
    229 - 9x + 9x +
          colnames(data),
    230 - 9x + 9x +
          FUN = function(x) {
    231 - 42x + 42x +
            label <- attr(data[[x]], "label")
    232 - 42x + 42x +
            if (is.null(label)) {
    233 - 40x + 40x +
              x
    @@ -63380,7 +65535,8 @@

    teal.slice coverage - 65.73%

    235 - 2x + 2x +
              label
    @@ -63401,7 +65557,8 @@

    teal.slice coverage - 65.73%

    238 - 9x + 9x +
          FUN.VALUE = character(1)
    @@ -63995,7 +66152,8 @@

    teal.slice coverage - 65.73%

    79 - 107x + 107x +
      UseMethod("init_filtered_dataset")
    @@ -64079,56 +66237,64 @@

    teal.slice coverage - 65.73%

    91 - 83x + 83x +
      DataframeFilteredDataset$new(
    92 - 83x + 83x +
        dataset = dataset,
    93 - 83x + 83x +
        dataname = dataname,
    94 - 83x + 83x +
        keys = keys,
    95 - 83x + 83x +
        parent_name = parent_name,
    96 - 83x + 83x +
        parent = parent,
    97 - 83x + 83x +
        join_keys = join_keys,
    98 - 83x + 83x +
        label = label
    @@ -64219,7 +66385,8 @@

    teal.slice coverage - 65.73%

    111 - 7x + 7x +
      if (!requireNamespace("MultiAssayExperiment", quietly = TRUE)) {
    @@ -64240,35 +66407,40 @@

    teal.slice coverage - 65.73%

    114 - 7x + 7x +
      MAEFilteredDataset$new(
    115 - 7x + 7x +
        dataset = dataset,
    116 - 7x + 7x +
        dataname = dataname,
    117 - 7x + 7x +
        keys = keys,
    118 - 7x + 7x +
        label = label
    @@ -64359,28 +66531,32 @@

    teal.slice coverage - 65.73%

    131 - 17x + 17x +
      DefaultFilteredDataset$new(
    132 - 17x + 17x +
        dataset = dataset,
    133 - 17x + 17x +
        dataname = dataname,
    134 - 17x + 17x +
        label = label
    @@ -64623,49 +66799,56 @@

    teal.slice coverage - 65.73%

    14 - 273x + 273x +
      checkmate::assert_character(name, min.len = 1, any.missing = FALSE)
    15 - 271x + 271x +
      if (!grepl("^[[:alpha:]][a-zA-Z0-9_]*$", name, perl = TRUE)) {
    16 - 5x + 5x +
        stop(
    17 - 5x + 5x +
          "name '",
    18 - 5x + 5x +
          name,
    19 - 5x + 5x +
          "' must only contain alphanumeric characters (with underscores)",
    20 - 5x + 5x +
          " and the first character must be an alphabetic character"
    @@ -64784,35 +66967,40 @@

    teal.slice coverage - 65.73%

    37 - 12x + 12x +
      checkmate::assert_character(pattern, min.len = 1, null.ok = TRUE)
    38 - 12x + 12x +
      js_files <- list.files(
    39 - 12x + 12x +
        system.file("js", package = "teal.slice", mustWork = TRUE),
    40 - 12x + 12x +
        pattern = pattern,
    41 - 12x + 12x +
        full.names = TRUE
    @@ -64826,7 +67014,8 @@

    teal.slice coverage - 65.73%

    43 - 12x + 12x +
      return(singleton(lapply(js_files, includeScript)))
    @@ -64966,14 +67155,16 @@

    teal.slice coverage - 65.73%

    63 - 53x + 53x +
      if (length(choices) > 1) {
    64 - 26x + 26x +
        do.call("call", append(list("c"), choices))
    @@ -64987,7 +67178,8 @@

    teal.slice coverage - 65.73%

    66 - 27x + 27x +
        choices
    @@ -65154,7 +67346,8 @@

    teal.slice coverage - 65.73%

    21 - 9x + 9x +
      if (is.factor(choices)) {
    @@ -65182,35 +67375,40 @@

    teal.slice coverage - 65.73%

    25 - 9x + 9x +
      stopifnot(
    26 - 9x + 9x +
        is.character(choices) ||
    27 - 9x + 9x +
          is.numeric(choices) ||
    28 - 9x + 9x +
          is.logical(choices) ||
    29 - 9x + 9x +
          (length(choices) == 1 && is.na(choices))
    @@ -65231,7 +67429,8 @@

    teal.slice coverage - 65.73%

    32 - 9x + 9x +
      if (is.factor(labels)) {
    @@ -65259,14 +67458,16 @@

    teal.slice coverage - 65.73%

    36 - 9x + 9x +
      checkmate::assert_character(labels[!is.na(labels)], any.missing = FALSE)
    37 - 9x + 9x +
      if (length(choices) != length(labels)) {
    @@ -65287,14 +67488,16 @@

    teal.slice coverage - 65.73%

    40 - 9x + 9x +
      stopifnot(is.null(subset) || is.vector(subset))
    41 - 9x + 9x +
      stopifnot(is.null(types) || is.vector(types))
    @@ -65308,14 +67511,16 @@

    teal.slice coverage - 65.73%

    43 - 9x + 9x +
      if (is.vector(types)) {
    44 - 9x + 9x +
        stopifnot(length(choices) == length(types))
    @@ -65336,7 +67541,8 @@

    teal.slice coverage - 65.73%

    47 - 9x + 9x +
      if (!is.null(subset)) {
    @@ -65399,56 +67605,64 @@

    teal.slice coverage - 65.73%

    56 - 9x + 9x +
      is_dupl <- duplicated(choices)
    57 - 9x + 9x +
      choices <- choices[!is_dupl]
    58 - 9x + 9x +
      labels <- labels[!is_dupl]
    59 - 9x + 9x +
      types <- types[!is_dupl]
    60 - 9x + 9x +
      labels[is.na(labels)] <- "Label Missing"
    61 - 9x + 9x +
      raw_labels <- labels
    62 - 9x + 9x +
      combined_labels <- if (length(choices) > 0) {
    63 - 9x + 9x +
        paste0(choices, ": ", labels)
    @@ -65483,7 +67697,8 @@

    teal.slice coverage - 65.73%

    68 - 9x + 9x +
      if (!is.null(subset)) {
    @@ -65532,49 +67747,56 @@

    teal.slice coverage - 65.73%

    75 - 9x + 9x +
      choices <- structure(
    76 - 9x + 9x +
        choices,
    77 - 9x + 9x +
        names = combined_labels,
    78 - 9x + 9x +
        raw_labels = raw_labels,
    79 - 9x + 9x +
        combined_labels = combined_labels,
    80 - 9x + 9x +
        class = c("choices_labeled", "character"),
    81 - 9x + 9x +
        types = types
    @@ -65595,7 +67817,8 @@

    teal.slice coverage - 65.73%

    84 - 9x + 9x +
      return(choices)
    @@ -66195,21 +68418,24 @@

    teal.slice coverage - 65.73%

    33 - 26x + 26x +
          checkmate::assert_matrix(data)
    34 - 25x + 25x +
          super$initialize(data, data_reactive, dataname, datalabel)
    35 - 25x + 25x +
          private$set_filterable_varnames(include_varnames = colnames(private$data))
    @@ -67524,35 +69750,40 @@

    teal.slice coverage - 65.73%

    181 - 103x + 103x +
          checkmate::assert_function(data_reactive, args = "sid")
    182 - 103x + 103x +
          checkmate::assert_data_frame(data)
    183 - 103x + 103x +
          super$initialize(data, data_reactive, dataname, datalabel)
    184 - 103x + 103x +
          private$keys <- keys
    185 - 103x + 103x +
          private$set_filterable_varnames(include_varnames = colnames(private$data))
    @@ -67824,21 +70055,24 @@

    teal.slice coverage - 65.73%

    30 - 47x + 47x +
      checkmate::assert_list(calls)
    31 - 45x + 45x +
      if (length(calls) > 0L) checkmate::assert_list(calls, types = c("call", "name"))
    32 - 46x + 46x +
      checkmate::assert_string(operator)
    @@ -67852,21 +70086,24 @@

    teal.slice coverage - 65.73%

    34 - 44x + 44x +
      Reduce(
    35 - 44x + 44x +
        x = calls,
    36 - 44x + 44x +
        f = function(x, y) call(operator, x, y)
    @@ -67977,21 +70214,24 @@

    teal.slice coverage - 65.73%

    13 - 7x + 7x +
      checkmate::assert_list(x, any.missing = FALSE, names = "unique")
    14 - 6x + 6x +
      checkmate::assert_class(join_keys, "join_keys")
    15 - 5x + 5x +
      if (!missing(code)) {
    @@ -68033,7 +70273,8 @@

    teal.slice coverage - 65.73%

    21 - 5x + 5x +
      if (!missing(check)) {
    @@ -68075,7 +70316,8 @@

    teal.slice coverage - 65.73%

    27 - 5x + 5x +
      FilteredData$new(x, join_keys = join_keys)
    @@ -68166,42 +70408,48 @@

    teal.slice coverage - 65.73%

    40 - 32x + 32x +
      lapply(
    41 - 32x + 32x +
        expr,
    42 - 32x + 32x +
        function(x) {
    43 - 19x + 19x +
          tryCatch(
    44 - 19x + 19x +
            eval(x, envir = env),
    45 - 19x + 19x +
            error = function(e) {
    @@ -68264,7 +70512,8 @@

    teal.slice coverage - 65.73%

    54 - 19x + 19x +
          return(invisible(NULL))
    @@ -68817,21 +71066,24 @@

    teal.slice coverage - 65.73%

    133 - 3x + 3x +
      checkmate::assert_string(input_id)
    134 - 3x + 3x +
      checkmate::assert_character(icons, len = 2L)
    135 - 3x + 3x +
      checkmate::assert_flag(one_way)
    @@ -68845,35 +71097,40 @@

    teal.slice coverage - 65.73%

    137 - 3x + 3x +
      expr <-
    138 - 3x + 3x +
        if (one_way) {
    139 - 3x + 3x +
          sprintf(
    140 - 3x + 3x +
            "$('#%s i').removeClass('%s').addClass('%s');",
    141 - 3x + 3x +
            input_id, icons[1], icons[2]
    @@ -68915,7 +71172,8 @@

    teal.slice coverage - 65.73%

    147 - 3x + 3x +
      shinyjs::runjs(expr)
    @@ -68929,7 +71187,8 @@

    teal.slice coverage - 65.73%

    149 - 3x + 3x +
      invisible(NULL)
    @@ -68971,21 +71230,24 @@

    teal.slice coverage - 65.73%

    155 - 3x + 3x +
      checkmate::assert_string(input_id)
    156 - 3x + 3x +
      checkmate::assert_character(titles, len = 2L)
    157 - 3x + 3x +
      checkmate::assert_flag(one_way)
    @@ -68999,35 +71261,40 @@

    teal.slice coverage - 65.73%

    159 - 3x + 3x +
      expr <-
    160 - 3x + 3x +
        if (one_way) {
    161 - 3x + 3x +
          sprintf(
    162 - 3x + 3x +
            "$('a#%s').attr('title', '%s');",
    163 - 3x + 3x +
            input_id, titles[2]
    @@ -69132,7 +71399,8 @@

    teal.slice coverage - 65.73%

    178 - 3x + 3x +
      shinyjs::runjs(expr)
    @@ -69146,7 +71414,8 @@

    teal.slice coverage - 65.73%

    180 - 3x + 3x +
      invisible(NULL)
    @@ -69286,7 +71555,8 @@

    teal.slice coverage - 65.73%

    200 - 66x + 66x +
      utils::getFromNamespace("topological_sort", ns = "teal.data")(graph)
    @@ -69565,7 +71835,8 @@

    teal.slice coverage - 65.73%

    38 - 26x + 26x +
          if (!requireNamespace("MultiAssayExperiment", quietly = TRUE)) {
    @@ -69586,56 +71857,64 @@

    teal.slice coverage - 65.73%

    41 - 26x + 26x +
          checkmate::assert_function(data_reactive, args = "sid")
    42 - 26x + 26x +
          checkmate::assert_class(data, "MultiAssayExperiment")
    43 - 25x + 25x +
          data <- SummarizedExperiment::colData(data)
    44 - 25x + 25x +
          data_reactive <- function(sid = "") SummarizedExperiment::colData(data_reactive(sid = sid))
    45 - 25x + 25x +
          super$initialize(data, data_reactive, dataname, datalabel)
    46 - 25x + 25x +
          private$keys <- keys
    47 - 25x + 25x +
          private$set_filterable_varnames(include_varnames = colnames(data))
    48 - 25x + 25x +
          return(invisible(self))
    diff --git a/v0.2.0/404.html b/v0.2.0/404.html index c4ef2ab97..84862fadb 100644 --- a/v0.2.0/404.html +++ b/v0.2.0/404.html @@ -1,5 +1,4 @@ - - + @@ -49,23 +48,24 @@ - - - +v0.2.0 + + + diff --git a/v0.2.0/CODE_OF_CONDUCT.html b/v0.2.0/CODE_OF_CONDUCT.html index e5d874f0b..ca3c7a8bf 100644 --- a/v0.2.0/CODE_OF_CONDUCT.html +++ b/v0.2.0/CODE_OF_CONDUCT.html @@ -1,8 +1,22 @@ - -Contributor Covenant Code of Conduct • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + + - + @@ -72,65 +92,80 @@
    -

    Our Pledge

    +

    Our Pledge +

    We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.

    We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.

    -

    Our Standards

    +

    Our Standards +

    Examples of behavior that contributes to a positive environment for our community include:

    -
    • Demonstrating empathy and kindness toward other people
    • +
        +
      • Demonstrating empathy and kindness toward other people
      • Being respectful of differing opinions, viewpoints, and experiences
      • Giving and gracefully accepting constructive feedback
      • Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
      • Focusing on what is best not just for us as individuals, but for the overall community
      • -

      Examples of unacceptable behavior include:

      -
      • The use of sexualized language or imagery, and sexual attention or advances of any kind
      • +
      +

      Examples of unacceptable behavior include:

      +
        +
      • The use of sexualized language or imagery, and sexual attention or advances of any kind
      • Trolling, insulting or derogatory comments, and personal or political attacks
      • Public or private harassment
      • Publishing others’ private information, such as a physical or email address, without their explicit permission
      • Other conduct which could reasonably be considered inappropriate in a professional setting
      • -
    + +
    -

    Enforcement Responsibilities

    +

    Enforcement Responsibilities +

    Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.

    Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.

    -

    Scope

    +

    Scope +

    This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.

    -

    Enforcement

    +

    Enforcement +

    Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [INSERT CONTACT METHOD]. All complaints will be reviewed and investigated promptly and fairly.

    All community leaders are obligated to respect the privacy and security of the reporter of any incident.

    -

    Enforcement Guidelines

    +

    Enforcement Guidelines +

    Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:

    -

    1. Correction

    +

    1. Correction +

    Community Impact: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.

    Consequence: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.

    -

    2. Warning

    +

    2. Warning +

    Community Impact: A violation through a single incident or series of actions.

    Consequence: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.

    -

    3. Temporary Ban

    +

    3. Temporary Ban +

    Community Impact: A serious violation of community standards, including sustained inappropriate behavior.

    Consequence: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.

    -

    4. Permanent Ban

    +

    4. Permanent Ban +

    Community Impact: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.

    Consequence: A permanent ban from any sort of public interaction within the community.

    -

    Attribution

    +

    Attribution +

    This Code of Conduct is adapted from the Contributor Covenant, version 2.1, available at https://www.contributor-covenant.org/version/2/1/code_of_conduct.html.

    Community Impact Guidelines were inspired by Mozilla’s code of conduct enforcement ladder.

    For answers to common questions about this code of conduct, see the FAQ at https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.

    @@ -138,17 +173,19 @@

    Attribution

    + + + + - - + + diff --git a/v0.2.0/CONTRIBUTING.html b/v0.2.0/CONTRIBUTING.html index 7f4eec178..bcc8f427d 100644 --- a/v0.2.0/CONTRIBUTING.html +++ b/v0.2.0/CONTRIBUTING.html @@ -1,8 +1,22 @@ - -Contribution Guidelines • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + + - + @@ -74,7 +94,8 @@

    🙏 Thank you for taking the time to contribute!

    Your input is deeply valued, whether an issue, a pull request, or even feedback, regardless of size, content or scope.

    -

    Table of contents

    +

    Table of contents +

    👶 Getting started

    📔 Code of Conduct

    🗃 License

    @@ -85,38 +106,47 @@

    Table of contents❓ Questions

    -

    Getting started

    +

    Getting started +

    Please refer the project documentation for a brief introduction. Please also see other articles within the project documentation for additional information.

    -

    Code of Conduct

    +

    Code of Conduct +

    A Code of Conduct governs this project. Participants and contributors are expected to follow the rules outlined therein.

    -

    License

    +

    License +

    All your contributions will be covered by this project’s license.

    -

    Issues

    +

    Issues +

    We use GitHub to track issues, feature requests, and bugs. Before submitting a new issue, please check if the issue has already been reported. If the issue already exists, please upvote the existing issue 👍.

    For new feature requests, please elaborate on the context and the benefit the feature will have for users, developers, or other relevant personas.

    -

    Pull requests

    +

    Pull requests +

    -

    Github flow

    +

    Github flow +

    This repository uses the Github flow model for collaboration. To submit a pull request:

    -
    1. +
        +
      1. Create a branch.

        Please see the branch naming convention below. If you don’t have write access to this repository, please fork it.

      2. Make changes.

        Make sure your code:

        -
        • passes all checks imposed by GitHub Actions
        • +
            +
          • passes all checks imposed by GitHub Actions
          • is well documented
          • is well tested with unit tests sufficiently covering the changes introduced
          • -
          +
        +
      3. Create a pull request (PR).

        In the pull request description, please link the relevant issue (if any), provide a detailed description of the change, and include any assumptions.

        @@ -130,64 +160,78 @@

        Github flow -

        Branch naming convention

        +

        Branch naming convention +

        Suppose your changes are related to a current issue in the current project; please name your branch as follows: <issue_id>_<short_description>. Please use underscore (_) as a delimiter for word separation. For example, 420_fix_ui_bug would be a suitable branch name if your change is resolving and UI-related bug reported in issue number 420 in the current project.

        If your change affects multiple repositories, please name your branches as follows: <issue_id>_<issue_repo>_<short description>. For example, 69_awesomeproject_fix_spelling_error would reference issue 69 reported in project awesomeproject and aims to resolve one or more spelling errors in multiple (likely related) repositories.

    monorepo and staged.dependencies -

    + +

    Sometimes you might need to change upstream dependent package(s) to be able to submit a meaningful change. We are using staged.dependencies functionality to simulate a monorepo behavior. The dependency configuration is already specified in this project’s staged_dependencies.yaml file. You need to name the feature branches appropriately. This is the only exception from the branch naming convention described above.

    Please refer to the staged.dependencies package documentation for more details.

    - +
    -

    R & package versions

    +

    R & package versions +

    We continuously test our packages against the newest R version along with the most recent dependencies from CRAN and BioConductor. We recommend that your working environment is also set up in the same way. You can find the details about the R version and packages used in the R CMD check GitHub Action execution log - there is a step that prints out the R sessionInfo().

    If you discover bugs on older R versions or with an older set of dependencies, please create the relevant bug reports.

    -

    pre-commit

    +

    +pre-commit +

    We highly recommend that you use the pre-commit tool combined with R hooks for pre-commit to execute some of the checks before committing and pushing your changes.

    Pre-commit hooks are already available in this repository’s .pre-commit-config.yaml file.

    -

    Style guide

    +

    Style guide +

    This repository follows the standard tidyverse style guide and uses lintr for lint checks. Customized lint configurations are available in this repository’s .lintr file.

    -

    Recognition model

    +

    Recognition model +

    As mentioned previously, all contributions are deeply valued and appreciated. While all contribution data is available as part of the repository insights, to recognize a significant contribution and hence add the contributor to the package authors list, the following rules are enforced:

    -
    • Minimum 5% of lines of code authored* (determined by git blame query) OR
    • +
        +
      • Minimum 5% of lines of code authored* (determined by git blame query) OR
      • Being at the top 5 contributors in terms of number of commits OR lines added OR lines removed*
      • -

      *Excluding auto-generated code, including but not limited to roxygen comments or renv.lock files.

      +
    +

    *Excluding auto-generated code, including but not limited to roxygen comments or renv.lock files.

    The package maintainer also reserves the right to adjust the criteria to recognize contributions.

    -

    Questions

    +

    Questions +

    If you have further questions regarding the contribution guidelines, please contact the package/repository maintainer.

    + + + + - - + + diff --git a/v0.2.0/LICENSE-text.html b/v0.2.0/LICENSE-text.html index ea1f23892..0bd7fb62b 100644 --- a/v0.2.0/LICENSE-text.html +++ b/v0.2.0/LICENSE-text.html @@ -1,8 +1,22 @@ - -License • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + + - + @@ -84,17 +104,19 @@ limitations under the License. - + + + + - - + + diff --git a/v0.2.0/SECURITY.html b/v0.2.0/SECURITY.html index 7ac632e4d..d5431462a 100644 --- a/v0.2.0/SECURITY.html +++ b/v0.2.0/SECURITY.html @@ -1,8 +1,22 @@ - -Security Policy • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + + - + @@ -72,38 +92,44 @@
    -

    Reporting Security Issues

    +

    Reporting Security Issues +

    If you believe you have found a security vulnerability in any of the repositories in this organization, please report it to us through coordinated disclosure.

    Please do not report security vulnerabilities through public GitHub issues, discussions, or pull requests.

    Instead, please send an email to vulnerability.management[@]roche.com.

    Please include as much of the information listed below as you can to help us better understand and resolve the issue:

    -
    • The type of issue (e.g., buffer overflow, SQL injection, or cross-site scripting)
    • +
        +
      • The type of issue (e.g., buffer overflow, SQL injection, or cross-site scripting)
      • Full paths of source file(s) related to the manifestation of the issue
      • The location of the affected source code (tag/branch/commit or direct URL)
      • Any special configuration required to reproduce the issue
      • Step-by-step instructions to reproduce the issue
      • Proof-of-concept or exploit code (if possible)
      • Impact of the issue, including how an attacker might exploit the issue
      • -

      This information will help us triage your report more quickly.

      +
    +

    This information will help us triage your report more quickly.

    -

    Data Security Standards (DSS)

    +

    Data Security Standards (DSS) +

    Please make sure that while reporting issues in the form a bug, feature, or pull request, all sensitive information such as PII, PHI, and PCI is completely removed from any text and attachments, including pictures and videos.

    + + + + - - + + diff --git a/v0.2.0/articles/filter-panel.html b/v0.2.0/articles/filter-panel.html index 8222da3b1..ca2e538fc 100644 --- a/v0.2.0/articles/filter-panel.html +++ b/v0.2.0/articles/filter-panel.html @@ -1,5 +1,4 @@ - - + @@ -51,23 +50,24 @@ - - - +v0.2.0 + + + diff --git a/v0.2.0/articles/index.html b/v0.2.0/articles/index.html index edce9de2e..abf356dc5 100644 --- a/v0.2.0/articles/index.html +++ b/v0.2.0/articles/index.html @@ -1,8 +1,22 @@ - -Articles • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + + - + @@ -72,22 +92,28 @@

    All vignettes

    -
    Filter panel for NEST developers
    +
    +
    Filter panel for NEST developers
    -
    Introduction to teal.slice
    + +
    Introduction to teal.slice
    -
    - + +
    + + + + + - - + + diff --git a/v0.2.0/articles/teal-slice.html b/v0.2.0/articles/teal-slice.html index 120c18110..14cd3b92c 100644 --- a/v0.2.0/articles/teal-slice.html +++ b/v0.2.0/articles/teal-slice.html @@ -1,5 +1,4 @@ - - + @@ -51,23 +50,24 @@ - - - +v0.2.0 + + + diff --git a/v0.2.0/authors.html b/v0.2.0/authors.html index 7ab135ebc..5b6e60688 100644 --- a/v0.2.0/authors.html +++ b/v0.2.0/authors.html @@ -1,8 +1,22 @@ - -Authors and Citation • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + + - + @@ -71,7 +91,8 @@

    Authors

    -
    • +
        +
      • Dawid Kaledkowski. Author, maintainer.

      • @@ -103,7 +124,8 @@

        Authors

        F. Hoffmann-La Roche AG. Copyright holder, funder.

        -
    + +

    Citation

    @@ -121,17 +143,19 @@

    Citation

    }
    + + + + - - + + diff --git a/v0.2.0/index.html b/v0.2.0/index.html index 4ec56c1bb..ac0adf360 100644 --- a/v0.2.0/index.html +++ b/v0.2.0/index.html @@ -1,5 +1,4 @@ - - + @@ -51,23 +50,24 @@ - - - +v0.2.0 + + + diff --git a/v0.2.0/news/index.html b/v0.2.0/news/index.html index f7174fbf0..a12c1a602 100644 --- a/v0.2.0/news/index.html +++ b/v0.2.0/news/index.html @@ -1,8 +1,22 @@ - -Changelog • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + + - + @@ -70,10 +90,13 @@
    -

    teal.slice 0.2.0

    +

    teal.slice 0.2.0 +

    -

    New features

    -
    + +
    -

    Enhancements

    -
    • Redesigned the count bars for filter panel check box inputs.
    • +

      Enhancements +

      +
        +
      • Redesigned the count bars for filter panel check box inputs.
      • Redesigned the filter panel input for dates to use CSS flexbox.
      • Update icons to be compatible with Font Awesome 6.
      • Updates the FilteredData method get_formatted_filter_state so it no longer appends empty filters.
      • Added clearer installation instructions to README.
      • -
    + +
    -

    Breaking changes

    -
    • Renamed internal S3 method get_filterable_varnames to get_supported_filter_varnames.
    • -
    +

    Breaking changes +

    +
      +
    • Renamed internal S3 method get_filterable_varnames to get_supported_filter_varnames.
    • +
    +
    -

    Bug fixes

    -
    • Fixed a bug when the filter panel overview would not refresh if the panel was hidden during a transition between active modules.
    • +

      Bug fixes +

      +
        +
      • Fixed a bug when the filter panel overview would not refresh if the panel was hidden during a transition between active modules.
      • Fixed a bug in FilterState where sliderInput step values were too precise.
      • -
    + +
    -

    teal.slice 0.1.1

    +

    teal.slice 0.1.1 +

    -

    New features

    -
    • Added a formatting function for filter panel classes.
    • -
    +

    New features +

    +
      +
    • Added a formatting function for filter panel classes.
    • +
    +
    -

    Miscellaneous

    -
    • Added a template to the pkgdown site.
    • +

      Miscellaneous +

      +
        +
      • Added a template to the pkgdown site.
      • Updated package authors.
      • Added package vignettes.
      • -
    + +
    -

    Fix

    -
    • Fixed a bug in FilteredDataset, where launching a shiny application without FilteredData would not attach the appropriate CSS files.
    • -
    +

    Fix +

    +
      +
    • Fixed a bug in FilteredDataset, where launching a shiny application without FilteredData would not attach the appropriate CSS files.
    • +
    +
    -

    teal.slice 0.1.0

    -
    • Initial release of teal.slice - a package providing a filter module for teal applications.
    • -
    -

    Changes (from behavior when functionality was part of teal)

    +

    teal.slice 0.1.0 +

    +
      +
    • Initial release of teal.slice - a package providing a filter module for teal applications.
    • +
    +
    +

    Changes (from behavior when functionality was part of teal) +

    -

    Breaking changes

    -
    • +

      Breaking changes +

      +
        +
      • default_filter has been deprecated - use list() instead for a default filter.
      • -
    + +
    -

    Bug fixes

    -
    • Add counts to filtering categorical variables bar charts in the filtering panel in cases where they were missing.
    • +

      Bug fixes +

      +
        +
      • Add counts to filtering categorical variables bar charts in the filtering panel in cases where they were missing.
      • Fixed a bug causing an error when both sliders of RangeFilterState where put to either end of the allowed range in the UI.
      • -
    + +
    -

    Miscellaneous

    -
    • Added is_any_filtered method to all FilterState classes to detect if selected values actually filters out any data. This is used to decide if an explicit filter statement is added to the call.
    • +

      Miscellaneous +

      +
        +
      • Added is_any_filtered method to all FilterState classes to detect if selected values actually filters out any data. This is used to decide if an explicit filter statement is added to the call.
      • The filter panel now displays a helpful message when data has no rows or columns in place of an empty drop down widget.
      • FilteredData now stores whether its datasets had a reproducibility check or not via two new methods to its class: set_check and get_check.
      • -
    + +
    + + + + - - + + diff --git a/v0.2.0/pull_request_template.html b/v0.2.0/pull_request_template.html index f40c3e45a..4bd439203 100644 --- a/v0.2.0/pull_request_template.html +++ b/v0.2.0/pull_request_template.html @@ -1,8 +1,22 @@ - -Pull Request • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + + - + @@ -75,17 +95,19 @@

    Fixes #nnn

    - + + + + - - + + diff --git a/v0.2.0/reference/CDISCFilteredData.html b/v0.2.0/reference/CDISCFilteredData.html index e862247f4..a7b67918d 100644 --- a/v0.2.0/reference/CDISCFilteredData.html +++ b/v0.2.0/reference/CDISCFilteredData.html @@ -1,8 +1,24 @@ - -Class to encapsulate relational filtered datasets with its parents. — CDISCFilteredData • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + + - + @@ -76,7 +98,8 @@
    -

    Details

    +

    Details +

    The CDISCFilteredData class implements logic to filter a relational dataset by inheriting from FilteredData. A dataset can have up to one parent dataset. Rows are identified by the foreign @@ -86,20 +109,25 @@

    Detailsiris).

    -

    See also

    +

    See also +

    FilteredData class

    -

    Super class

    +

    Super class +

    teal.slice::FilteredData -> CDISCFilteredData

    +

    Inherited methods


    -

    Method datanames()

    +

    +
    +
    +

    Method datanames() +

    Get datanames

    The datanames are returned in the order in which they must be -evaluated (in case of dependencies).

    -

    Usage

    -

    CDISCFilteredData$datanames()

    +evaluated (in case of dependencies).

    +
    +

    Usage +

    +

    +
    +
    CDISCFilteredData$datanames()
    +

    +
    -

    Returns

    +

    Returns +

    (character vector) of datanames

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns the filter call to filter a single dataset including the inner_join with its parent dataset. It assumes that the filtered datasets it depends -on are available.

    -

    Usage

    -

    CDISCFilteredData$get_call(dataname)

    +on are available.

    +
    +

    Usage +

    +

    +
    +
    CDISCFilteredData$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (call or list of calls ) to filter dataset

    -


    -

    Method get_filterable_datanames()

    -

    Get names of datasets available for filtering

    -

    Usage

    -

    CDISCFilteredData$get_filterable_datanames(dataname)

    +
    +

    +
    +
    +

    Method get_filterable_datanames() +

    +

    Get names of datasets available for filtering

    +
    +

    Usage +

    +

    +
    +
    CDISCFilteredData$get_filterable_datanames(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character vector) names of the dataset

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (character vector) of dataset names

    -


    -

    Method get_filterable_varnames()

    -

    Gets variable names of a given dataname for the filtering. This excludes parent dataset variable names.

    -

    Usage

    -

    CDISCFilteredData$get_filterable_varnames(dataname)

    +
    +

    +
    +
    +

    Method get_filterable_varnames() +

    +

    Gets variable names of a given dataname for the filtering. This excludes parent dataset variable names.

    +
    +

    Usage +

    +

    +
    +
    CDISCFilteredData$get_filterable_varnames(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (character vector) of variable names

    -


    -

    Method get_filter_overview()

    +
    +

    +
    +
    +

    Method get_filter_overview() +

    Get filter overview table in form of X (filtered) / Y (non-filtered)

    -

    This is intended to be presented in the application.

    -

    Usage

    -

    CDISCFilteredData$get_filter_overview(datanames)

    +

    This is intended to be presented in the application.

    +
    +

    Usage +

    +

    +
    +
    CDISCFilteredData$get_filter_overview(datanames)
    +

    +
    -

    Arguments

    -

    datanames
    +

    Arguments +

    +

    +
    +
    +
    datanames

    (character vector) names of the dataset (or "all")

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (matrix) matrix of observations and subjects of all datasets

    -


    -

    Method get_parentname()

    -

    Get parent dataset name

    -

    Usage

    -

    CDISCFilteredData$get_parentname(dataname)

    +
    +

    +
    +
    +

    Method get_parentname() +

    +

    Get parent dataset name

    +
    +

    Usage +

    +

    +
    +
    CDISCFilteredData$get_parentname(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (character) name of parent dataset

    -


    -

    Method set_dataset()

    +
    +

    +
    +
    +

    Method set_dataset() +

    Add dataset

    Add dataset and preserve all attributes attached to this object. Technically set_dataset created FilteredDataset which keeps -dataset for filtering purpose.

    -

    Usage

    -

    CDISCFilteredData$set_dataset(dataset_args, dataname)

    +dataset for filtering purpose.

    +
    +

    Usage +

    +

    +
    +
    CDISCFilteredData$set_dataset(dataset_args, dataname)
    +

    +
    -

    Arguments

    -

    dataset_args
    +

    Arguments +

    +

    +
    +
    +
    dataset_args

    (list)
    containing the arguments except (dataname) needed by init_filtered_dataset (can also @@ -274,27 +414,46 @@

    Arguments -

    Returns

    +

    Returns +

    (self) object of this class

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    CDISCFilteredData$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    CDISCFilteredData$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -302,7 +461,8 @@

    Arguments -

    Examples

    +

    Examples +

    library(scda)
     #> 
     library(teal.data)
    @@ -379,17 +539,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.2.0/reference/ChoicesFilterState.html b/v0.2.0/reference/ChoicesFilterState.html index 08facbc5e..5e4c82cc8 100644 --- a/v0.2.0/reference/ChoicesFilterState.html +++ b/v0.2.0/reference/ChoicesFilterState.html @@ -1,10 +1,26 @@ - -FilterState object for factor or character variable — ChoicesFilterState • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + + -
    + +
    @@ -79,21 +102,26 @@
    -

    Note

    +

    Note +

    Casts the passed object to character before validating the input making it possible to pass any object coercible to character to this method.

    -

    Super class

    +

    Super class +

    teal.slice::FilterState -> ChoicesFilterState

    +

    Inherited methods


    -

    Method new()

    -

    Initialize a FilterState object

    -

    Usage

    -

    ChoicesFilterState$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterState object

    +
    +

    Usage +

    +

    +
    +
    ChoicesFilterState$new(
       x,
       varname,
       varlabel = character(0),
       input_dataname = NULL,
       extract_type = character(0)
    -)

    +)
    +

    +
    -

    Arguments

    -

    -


    -

    Method is_any_filtered()

    -

    Answers the question of whether the current settings and values selected actually filters out any values.

    -

    Usage

    -

    ChoicesFilterState$is_any_filtered()

    +
    +

    +
    +
    +

    Method is_any_filtered() +

    +

    Answers the question of whether the current settings and values selected actually filters out any values.

    +
    +

    Usage +

    +

    +
    +
    ChoicesFilterState$is_any_filtered()
    +

    +
    -

    Returns

    +

    Returns +

    logical scalar

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection. For this class returned call looks like <varname> %in% c(<values selected>) with -optional is.na(<varname>).

    -

    Usage

    -

    ChoicesFilterState$get_call()

    +optional is.na(<varname>).

    +
    +

    Usage +

    +

    +
    +
    ChoicesFilterState$get_call()
    +

    +
    -

    Returns

    +

    Returns +

    (call)

    -


    -

    Method ui()

    +
    +

    +
    +
    +

    Method ui() +

    UI Module for ChoicesFilterState. This UI element contains available choices selection and -checkbox whether to keep or not keep the NA values.

    -

    Usage

    -

    ChoicesFilterState$ui(id)

    +checkbox whether to keep or not keep the NA values.

    +
    +

    Usage +

    +

    +
    +
    ChoicesFilterState$ui(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    id of shiny element

    -

    +
    +

    +
    -


    -

    Method server()

    -

    Server module

    -

    Usage

    -

    ChoicesFilterState$server(id)

    +
    +

    +
    +
    +

    Method server() +

    +

    Server module

    +
    +

    Usage +

    +

    +
    +
    ChoicesFilterState$server(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    an ID string that corresponds with the ID used to call the module's UI function.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    moduleServer function which returns NULL

    -


    -

    Method set_state()

    -

    Set state

    -

    Usage

    -

    ChoicesFilterState$set_state(state)

    +
    +

    +
    +
    +

    Method set_state() +

    +

    Set state

    +
    +

    Usage +

    +

    +
    +
    ChoicesFilterState$set_state(state)
    +

    +
    -

    Arguments

    -

    state
    -

    (list)
    -contains fields relevant for a specific class

    • selected defines initial selection

    • +

      Arguments +

      +

      +
      +
      +
      state
      +
      +

      (list)
      +contains fields relevant for a specific class

      +
        +
      • selected defines initial selection

      • keep_na (logical) defines whether to keep or remove NA values

      • -
      +
    +
    -

    + +

    +
    -


    -

    Method set_state_reactive()

    -

    Set state when using set_filter_state

    -

    Usage

    -

    ChoicesFilterState$set_state_reactive(state)

    +
    +

    +
    +
    +

    Method set_state_reactive() +

    +

    Set state when using set_filter_state

    +
    +

    Usage +

    +

    +
    +
    ChoicesFilterState$set_state_reactive(state)
    +

    +
    -

    Arguments

    -

    state
    -

    (list)
    -contains fields relevant for a specific class

    • selected defines initial selection

    • +

      Arguments +

      +

      +
      +
      +
      state
      +
      +

      (list)
      +contains fields relevant for a specific class

      +
        +
      • selected defines initial selection

      • keep_na (logical) defines whether to keep or remove NA values

      • -
      +
    +
    -

    + +

    +
    -


    -

    Method set_selected()

    -

    Sets the selected values of this ChoicesFilterState.

    -

    Usage

    -

    ChoicesFilterState$set_selected(value)

    +
    +

    +
    +
    +

    Method set_selected() +

    +

    Sets the selected values of this ChoicesFilterState.

    +
    +

    Usage +

    +

    +
    +
    ChoicesFilterState$set_selected(value)
    +

    +
    -

    Arguments

    -

    value
    +

    Arguments +

    +

    +
    +
    +
    value

    (character) the array of the selected choices. Must not contain NA values.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    invisibly NULL

    -

    Examples

    -

    filter <- teal.slice:::ChoicesFilterState$new(c("a", "b", "c"), varname = "name")
    -filter$set_selected(c("c", "a"))

    +

    Examples +

    +

    +
    +
    filter <- teal.slice:::ChoicesFilterState$new(c("a", "b", "c"), varname = "name")
    +filter$set_selected(c("c", "a"))
    +

    +
    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    ChoicesFilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    ChoicesFilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -314,7 +497,8 @@

    Arguments -

    Examples

    +

    Examples +

    filter_state <- teal.slice:::ChoicesFilterState$new(
       c(LETTERS, NA),
       varname = "x",
    @@ -339,17 +523,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.2.0/reference/DFFilterStates.html b/v0.2.0/reference/DFFilterStates.html index ac176dab3..1dea9afb8 100644 --- a/v0.2.0/reference/DFFilterStates.html +++ b/v0.2.0/reference/DFFilterStates.html @@ -1,8 +1,24 @@ - -DFFFilterStates — DFFilterStates • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + + -
    + +
    @@ -76,16 +98,20 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterStates -> DFFilterStates

    +

    Inherited methods


    -

    Method new()

    +

    +
    +
    +

    Method new() +

    Initializes DFFilterStates object

    Initializes DFFilterStates object by setting input_dataname, output_dataname and initializing ReactiveQueue. This class contains a single ReactiveQueue with no specified name which means that when calling the function associated to this class (dplyr::filter), a list of -conditions are passed to unnamed arguments (...).

    -

    Usage

    -

    DFFilterStates$new(input_dataname, output_dataname, datalabel, varlabels, keys)

    +conditions are passed to unnamed arguments (...).

    +
    +

    Usage +

    +

    +
    +
    DFFilterStates$new(input_dataname, output_dataname, datalabel, varlabels, keys)
    +

    +
    -

    Arguments

    -

    input_dataname
    +

    Arguments +

    +

    +
    +
    +
    input_dataname

    (character(1) or name or call)
    name of the data used on lhs of the expression specified to the function argument attached to this FilterStates.

    @@ -144,93 +186,165 @@

    Arguments
    -

    Method format()

    -

    Returns the formatted string representing this FilterStates object.

    -

    Usage

    -

    DFFilterStates$format(indent = 0)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns the formatted string representing this FilterStates object.

    +
    +

    Usage +

    +

    +
    +
    DFFilterStates$format(indent = 0)
    +

    +
    -

    Arguments

    -

    indent
    +

    Arguments +

    +

    +
    +
    +
    indent

    (numeric(1)) the number of spaces before each line of the representation

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    character(1) the formatted string

    -


    -

    Method get_fun()

    +
    +

    +
    +
    +

    Method get_fun() +

    Get function name

    Get function name used to create filter call. -For DFFilterStates dplyr::filter is used

    -

    Usage

    -

    DFFilterStates$get_fun()

    +For DFFilterStates dplyr::filter is used

    +
    +

    Usage +

    +

    +
    +
    DFFilterStates$get_fun()
    +

    +
    -

    Returns

    +

    Returns +

    character(1)

    -


    -

    Method server()

    -

    Server module

    -

    Usage

    -

    DFFilterStates$server(id)

    +
    +

    +
    +
    +

    Method server() +

    +

    Server module

    +
    +

    Usage +

    +

    +
    +
    DFFilterStates$server(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    an ID string that corresponds with the ID used to call the module's UI function.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    moduleServer function which returns NULL

    -


    +

    +
    +
    +

    Method get_filter_state() +

    Gets the reactive values from the active FilterState objects.

    Get active filter state from the FilterState objects kept in ReactiveQueue. -The output list is a compatible input to self$set_filter_state.

    -

    Usage

    -

    DFFilterStates$get_filter_state()

    +The output list is a compatible input to self$set_filter_state.

    +
    +

    Usage +

    +

    +
    +
    DFFilterStates$get_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    list with named elements corresponding to FilterState in the ReactiveQueue.

    -


    -

    Method set_filter_state()

    -

    Set filter state

    -

    Usage

    -

    DFFilterStates$set_filter_state(
    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Set filter state

    +
    +

    Usage +

    +

    +
    +
    DFFilterStates$set_filter_state(
       data,
       state,
       vars_include = get_supported_filter_varnames(data = data),
       ...
    -)

    +)
    +

    +
    -

    Arguments

    -

    data
    +

    Arguments +

    +

    +
    +
    +
    data

    (data.frame)
    data which are supposed to be filtered.

    @@ -251,15 +365,21 @@

    Arguments -

    Returns

    +

    Returns +

    NULL

    -

    Examples

    -

    dffs <- teal.slice:::DFFilterStates$new(
    +

    Examples +

    +

    +
    +
    dffs <- teal.slice:::DFFilterStates$new(
       input_dataname = "iris",
       output_dataname = "iris_filtered",
       datalabel = character(0),
    @@ -272,40 +392,73 @@ 

    Examples) dffs$set_filter_state(state = fs, data = iris) shiny::isolate(dffs$get_filter_state()) -

    +
    +

    +
    -


    -

    Method remove_filter_state()

    -

    Remove a FilterState from the ReactiveQueue.

    -

    Usage

    -

    DFFilterStates$remove_filter_state(element_id)

    +
    +

    +
    +
    +

    Method remove_filter_state() +

    +

    Remove a FilterState from the ReactiveQueue.

    +
    +

    Usage +

    +

    +
    +
    DFFilterStates$remove_filter_state(element_id)
    +

    +
    -

    Arguments

    -

    element_id
    +

    Arguments +

    +

    +
    +
    +
    element_id

    (character(1))
    name of ReactiveQueue element.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL

    -


    -

    Method ui_add_filter_state()

    -

    Shiny UI module to add filter variable

    -

    Usage

    -

    DFFilterStates$ui_add_filter_state(id, data)

    +
    +

    +
    +
    +

    Method ui_add_filter_state() +

    +

    Shiny UI module to add filter variable

    +
    +

    Usage +

    +

    +
    +
    DFFilterStates$ui_add_filter_state(id, data)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    id of shiny module

    @@ -315,31 +468,48 @@

    Arguments -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_add_filter_state()

    +
    +

    +
    +
    +

    Method srv_add_filter_state() +

    Shiny server module to add filter variable

    Module controls available choices to select as a filter variable. Selected filter variable is being removed from available choices. -Removed filter variable gets back to available choices.

    -

    Usage

    -

    DFFilterStates$srv_add_filter_state(
    +Removed filter variable gets back to available choices.

    +
    +

    Usage +

    +

    +
    +
    DFFilterStates$srv_add_filter_state(
       id,
       data,
       vars_include = get_supported_filter_varnames(data = data),
       ...
    -)

    +)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    an ID string that corresponds with the ID used to call the module's UI function.

    @@ -358,10 +528,13 @@

    Arguments -

    Returns

    +

    Returns +

    moduleServer function which returns NULL description Get label of specific variable. In case when variable label is missing @@ -371,20 +544,36 @@

    Returns
    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    DFFilterStates$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    DFFilterStates$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -392,7 +581,8 @@

    Arguments -

    Examples

    +

    Examples +

    
     ## ------------------------------------------------
     ## Method `DFFilterStates$set_filter_state`
    @@ -435,17 +625,19 @@ 

    Examples

    + +

    + +
    - - + + diff --git a/v0.2.0/reference/DateFilterState.html b/v0.2.0/reference/DateFilterState.html index bcbe22039..2dc925f23 100644 --- a/v0.2.0/reference/DateFilterState.html +++ b/v0.2.0/reference/DateFilterState.html @@ -1,10 +1,26 @@ - -FilterState object for Date variable — DateFilterState • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + + -
    + +
    @@ -79,21 +102,26 @@
    -

    Note

    +

    Note +

    Casts the passed object to Date before validating the input making it possible to pass any object coercible to Date to this method.

    -

    Super class

    +

    Super class +

    teal.slice::FilterState -> DateFilterState

    +

    Inherited methods


    -

    Method new()

    -

    Initialize a FilterState object

    -

    Usage

    -

    DateFilterState$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterState object

    +
    +

    Usage +

    +

    +
    +
    DateFilterState$new(
       x,
       varname,
       varlabel = character(0),
       input_dataname = NULL,
       extract_type = character(0)
    -)

    +)
    +

    +
    -


    -

    Method format()

    -

    Returns a formatted string representing this DateFilterState.

    -

    Usage

    -

    DateFilterState$format(indent = 0)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns a formatted string representing this DateFilterState.

    +
    +

    Usage +

    +

    +
    +
    DateFilterState$format(indent = 0)
    +

    +
    -

    Arguments

    -

    indent
    +

    Arguments +

    +

    +
    +
    +
    indent

    (numeric(1)) the number of spaces before after each new line character of the formatted string. Default: 0

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    character(1) the formatted string

    -


    -

    Method is_any_filtered()

    -

    Answers the question of whether the current settings and values selected actually filters out any values.

    -

    Usage

    -

    DateFilterState$is_any_filtered()

    +
    +

    +
    +
    +

    Method is_any_filtered() +

    +

    Answers the question of whether the current settings and values selected actually filters out any values.

    +
    +

    Usage +

    +

    +
    +
    DateFilterState$is_any_filtered()
    +

    +
    -

    Returns

    +

    Returns +

    logical scalar

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection. For this class returned call looks like <varname> >= <min value> & <varname> <= <max value> with -optional is.na(<varname>).

    -

    Usage

    -

    DateFilterState$get_call()

    +optional is.na(<varname>).

    +
    +

    Usage +

    +

    +
    +
    DateFilterState$get_call()
    +

    +
    -

    Returns

    +

    Returns +

    (call)

    -


    -

    Method ui()

    +
    +

    +
    +
    +

    Method ui() +

    UI Module for DateFilterState. This UI element contains two date selections for min and max -of the range and a checkbox whether to keep the NA values.

    -

    Usage

    -

    DateFilterState$ui(id)

    +of the range and a checkbox whether to keep the NA values.

    +
    +

    Usage +

    +

    +
    +
    DateFilterState$ui(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    id of shiny element

    -

    +
    +

    +
    -


    -

    Method server()

    -

    Server module

    -

    Usage

    -

    DateFilterState$server(id)

    +
    +

    +
    +
    +

    Method server() +

    +

    Server module

    +
    +

    Usage +

    +

    +
    +
    DateFilterState$server(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    an ID string that corresponds with the ID used to call the module's UI function.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    moduleServer function which returns NULL

    -


    -

    Method set_selected()

    -

    Sets the selected time frame of this DateFilterState.

    -

    Usage

    -

    DateFilterState$set_selected(value)

    +
    +

    +
    +
    +

    Method set_selected() +

    +

    Sets the selected time frame of this DateFilterState.

    +
    +

    Usage +

    +

    +
    +
    DateFilterState$set_selected(value)
    +

    +
    -

    Arguments

    -

    value
    +

    Arguments +

    +

    +
    +
    +
    value

    (Date(2)) the lower and the upper bound of the selected time frame. Must not contain NA values.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    invisibly NULL.

    -

    Examples

    -

    date <- as.Date("13/09/2021")
    +

    Examples +

    +

    +
    +
    date <- as.Date("13/09/2021")
     filter <- teal.slice:::DateFilterState$new(
       c(date, date + 1, date + 2, date + 3),
       varname = "name"
     )
    -filter$set_selected(c(date + 1, date + 2))

    +filter$set_selected(c(date + 1, date + 2))
    +

    +
    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    DateFilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    DateFilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -301,7 +461,8 @@

    Arguments -

    Examples

    +

    Examples +

    filter_state <- teal.slice:::DateFilterState$new(
       c(Sys.Date() + seq(1:10), NA),
       varname = "x",
    @@ -329,17 +490,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.2.0/reference/DatetimeFilterState.html b/v0.2.0/reference/DatetimeFilterState.html index 2ba212bee..0e1e55bea 100644 --- a/v0.2.0/reference/DatetimeFilterState.html +++ b/v0.2.0/reference/DatetimeFilterState.html @@ -1,10 +1,26 @@ - -FilterState object for POSIXct variable — DatetimeFilterState • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + + -
    + +
    @@ -79,21 +102,26 @@
    -

    Note

    +

    Note +

    Casts the passed object to POSIXct before validating the input making it possible to pass any object coercible to POSIXct to this method.

    -

    Super class

    +

    Super class +

    teal.slice::FilterState -> DatetimeFilterState

    +

    Inherited methods


    -

    Method new()

    +

    +
    +
    +

    Method new() +

    Initialize a FilterState object. This class has an extra field, private$timezone, which is set to Sys.timezone() by default. However, in case when using this module in teal app, one needs timezone of the app user. App user timezone is taken from session$userData$timezone -and is set only if object is initialized in shiny.

    -

    Usage

    -

    DatetimeFilterState$new(
    +and is set only if object is initialized in shiny.

    +
    +

    Usage +

    +

    +
    +
    DatetimeFilterState$new(
       x,
       varname,
       varlabel = character(0),
       input_dataname = NULL,
       extract_type = character(0)
    -)

    +)
    +

    +
    -

    Arguments

    -

    -


    -

    Method format()

    -

    Returns a formatted string representing this DatetimeFilterState.

    -

    Usage

    -

    DatetimeFilterState$format(indent = 0)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns a formatted string representing this DatetimeFilterState.

    +
    +

    Usage +

    +

    +
    +
    DatetimeFilterState$format(indent = 0)
    +

    +
    -

    Arguments

    -

    indent
    +

    Arguments +

    +

    +
    +
    +
    indent

    (numeric(1)) the number of spaces before after each new line character of the formatted string. Default: 0

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    character(1) the formatted string

    -


    -

    Method is_any_filtered()

    -

    Answers the question of whether the current settings and values selected actually filters out any values.

    -

    Usage

    -

    DatetimeFilterState$is_any_filtered()

    +
    +

    +
    +
    +

    Method is_any_filtered() +

    +

    Answers the question of whether the current settings and values selected actually filters out any values.

    +
    +

    Usage +

    +

    +
    +
    DatetimeFilterState$is_any_filtered()
    +

    +
    -

    Returns

    +

    Returns +

    logical scalar

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection. For this class returned call looks like <varname> >= as.POSIXct(<min>, tz = <timezone>) & <varname> <= <max>, tz = <timezone>) -with optional is.na(<varname>).

    -

    Usage

    -

    DatetimeFilterState$get_call()

    +with optional is.na(<varname>).

    +
    +

    Usage +

    +

    +
    +
    DatetimeFilterState$get_call()
    +

    +
    -


    -

    Method ui()

    +
    +

    +
    +
    +

    Method ui() +

    UI Module for DatetimeFilterState. This UI element contains two date-time selections for min and max -of the range and a checkbox whether to keep the NA values.

    -

    Usage

    -

    DatetimeFilterState$ui(id)

    +of the range and a checkbox whether to keep the NA values.

    +
    +

    Usage +

    +

    +
    +
    DatetimeFilterState$ui(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    id of shiny element

    -

    +
    +

    +
    -


    -

    Method server()

    -

    Server module

    -

    Usage

    -

    DatetimeFilterState$server(id)

    +
    +

    +
    +
    +

    Method server() +

    +

    Server module

    +
    +

    Usage +

    +

    +
    +
    DatetimeFilterState$server(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    an ID string that corresponds with the ID used to call the module's UI function.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    moduleServer function which returns NULL

    -


    -

    Method set_selected()

    -

    Sets the selected time frame of this DatetimeFilterState.

    -

    Usage

    -

    DatetimeFilterState$set_selected(value)

    +
    +

    +
    +
    +

    Method set_selected() +

    +

    Sets the selected time frame of this DatetimeFilterState.

    +
    +

    Usage +

    +

    +
    +
    DatetimeFilterState$set_selected(value)
    +

    +
    -

    Arguments

    -

    value
    +

    Arguments +

    +

    +
    +
    +
    value

    (POSIX(2)) the lower and the upper bound of the selected time frame. Must not contain NA values.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    invisibly NULL.

    -

    Examples

    -

    date <- as.POSIXct(1, origin = "01/01/1970")
    +

    Examples +

    +

    +
    +
    date <- as.POSIXct(1, origin = "01/01/1970")
     filter <- teal.slice:::DatetimeFilterState$new(
       c(date, date + 1, date + 2, date + 3),
       varname = "name"
     )
    -filter$set_selected(c(date + 1, date + 2))

    +filter$set_selected(c(date + 1, date + 2))
    +

    +
    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    DatetimeFilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    DatetimeFilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -301,7 +460,8 @@

    Arguments -

    Examples

    +

    Examples +

    filter_state <- teal.slice:::DatetimeFilterState$new(
       c(Sys.time() + seq(0, by = 3600, length.out = 10), NA),
       varname = "x",
    @@ -331,17 +491,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.2.0/reference/DefaultFilteredDataset.html b/v0.2.0/reference/DefaultFilteredDataset.html index 6e7c49490..3b10bf3d7 100644 --- a/v0.2.0/reference/DefaultFilteredDataset.html +++ b/v0.2.0/reference/DefaultFilteredDataset.html @@ -1,10 +1,26 @@ - -The DefaultFilteredDataset R6 class — DefaultFilteredDataset • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + + -
    + +
    @@ -79,16 +101,20 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilteredDataset -> DefaultFilteredDataset

    +

    Inherited methods


    -

    Method new()

    -

    Initializes this DefaultFilteredDataset object

    -

    Usage

    -

    DefaultFilteredDataset$new(
    +

    +
    +
    +

    Method new() +

    +

    Initializes this DefaultFilteredDataset object

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$new(
       dataset,
       dataname,
       keys = character(0),
       label = character(0),
       metadata = NULL
    -)

    +)
    +

    +
    -

    Arguments

    -

    dataset
    +

    Arguments +

    +

    +
    +
    +
    dataset

    (data.frame)
    single data.frame for which filters are rendered

    @@ -154,52 +196,90 @@

    Arguments
    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Gets the filter expression

    This functions returns filter calls equivalent to selected items within each of filter_states. Configuration of the calls is constant and depends on filter_states type and order which are set during initialization. This class contains single FilterStates which contains single ReactiveQueue and all FilterState objects -applies to one argument (...) in dplyr::filter call.

    -

    Usage

    -

    DefaultFilteredDataset$get_call()

    +applies to one argument (...) in dplyr::filter call.

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$get_call()
    +

    +
    -

    Returns

    +

    Returns +

    filter call or list of filter calls

    -


    +

    +
    +
    +

    Method get_filter_state() +

    Gets the reactive values from the active FilterState objects.

    Get all active filters from this dataset in form of the nested list. -The output list is a compatible input to self$set_filter_state.

    -

    Usage

    -

    DefaultFilteredDataset$get_filter_state()

    +The output list is a compatible input to self$set_filter_state.

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$get_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    list with named elements corresponding to FilterState objects (active filters).

    -


    -

    Method set_filter_state()

    -

    Set filter state

    -

    Usage

    -

    DefaultFilteredDataset$set_filter_state(state, ...)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Set filter state

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$set_filter_state(state, ...)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (named list)
    containing values of the initial filter. Values should be relevant to the referred column.

    @@ -209,82 +289,138 @@

    Arguments -

    Returns

    +

    Returns +

    NULL

    -

    Examples

    -

    dataset <- teal.slice:::DefaultFilteredDataset$new(iris, "iris")
    +

    Examples +

    +

    +
    +
    dataset <- teal.slice:::DefaultFilteredDataset$new(iris, "iris")
     fs <- list(
       Sepal.Length = list(selected = c(5.1, 6.4), keep_na = TRUE, keep_inf = TRUE),
       Species = list(selected = c("setosa", "versicolor"), keep_na = FALSE)
     )
     dataset$set_filter_state(state = fs)
     shiny::isolate(dataset$get_filter_state())
    -

    +
    +

    +
    -


    -

    Method remove_filter_state()

    -

    Remove one or more FilterState of a FilteredDataset

    -

    Usage

    -

    DefaultFilteredDataset$remove_filter_state(element_id)

    +
    +

    +
    +
    +

    Method remove_filter_state() +

    +

    Remove one or more FilterState of a FilteredDataset

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$remove_filter_state(element_id)
    +

    +
    -

    Arguments

    -

    element_id
    +

    Arguments +

    +

    +
    +
    +
    element_id

    (character)
    Vector of character names of variables to remove their FilterState.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL

    -


    -

    Method ui_add_filter_state()

    +
    +

    +
    +
    +

    Method ui_add_filter_state() +

    +

    UI module to add filter variable for this dataset

    UI module to add filter variable for this dataset

    -

    UI module to add filter variable for this dataset

    -

    Usage

    -

    DefaultFilteredDataset$ui_add_filter_state(id)

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$ui_add_filter_state(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    identifier of the element - preferably containing dataset name

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    function - shiny UI module

    -


    -

    Method srv_add_filter_state()

    +
    +

    +
    +
    +

    Method srv_add_filter_state() +

    Server module to add filter variable for this dataset

    Server module to add filter variable for this dataset. For this class srv_add_filter_state calls single module srv_add_filter_state from FilterStates (DefaultFilteredDataset -contains single FilterStates)

    -

    Usage

    -

    DefaultFilteredDataset$srv_add_filter_state(id, ...)

    +contains single FilterStates)

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$srv_add_filter_state(id, ...)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    an ID string that corresponds with the ID used to call the module's UI function.

    @@ -293,28 +429,45 @@

    Arguments -

    Returns

    +

    Returns +

    moduleServer function which returns NULL

    -


    -

    Method get_filter_overview_nsubjs()

    +
    +

    +
    +
    +

    Method get_filter_overview_nsubjs() +

    Get number of observations based on given keys The output shows the comparison between filtered_dataset -function parameter and the dataset inside self

    -

    Usage

    -

    DefaultFilteredDataset$get_filter_overview_nsubjs(
    +function parameter and the dataset inside self

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$get_filter_overview_nsubjs(
       filtered_dataset = self$get_dataset(),
       subject_keys = NULL
    -)

    +)
    +

    +
    -

    Arguments

    -

    filtered_dataset
    +

    Arguments +

    +

    +
    +
    +
    filtered_dataset

    comparison object, of the same class as self$get_dataset(), if NULL then self$get_dataset() is used.

    @@ -325,27 +478,46 @@

    Arguments -

    Returns

    +

    Returns +

    list containing character #filtered/#not_filtered

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    DefaultFilteredDataset$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -353,7 +525,8 @@

    Arguments -

    Examples

    +

    Examples +

    library(shiny)
     ds <- teal.slice:::DefaultFilteredDataset$new(iris, "iris")
     ds$set_filter_state(
    @@ -424,17 +597,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.2.0/reference/EmptyFilterState.html b/v0.2.0/reference/EmptyFilterState.html index b33e281a1..c8cfb08d9 100644 --- a/v0.2.0/reference/EmptyFilterState.html +++ b/v0.2.0/reference/EmptyFilterState.html @@ -1,10 +1,26 @@ - -FilterState object for empty variable — EmptyFilterState • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + + -
    + +
    @@ -79,16 +102,20 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterState -> EmptyFilterState

    +

    Inherited methods


    -

    Method new()

    -

    Initialize EmptyFilterState object

    -

    Usage

    -

    EmptyFilterState$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize EmptyFilterState object

    +
    +

    Usage +

    +

    +
    +
    EmptyFilterState$new(
       x,
       varname,
       varlabel = character(0),
       input_dataname = NULL,
       extract_type = character(0)
    -)

    +)
    +

    +
    -


    -

    Method is_any_filtered()

    -

    Answers the question of whether the current settings and values selected actually filters out any values.

    -

    Usage

    -

    EmptyFilterState$is_any_filtered()

    +
    +

    +
    +
    +

    Method is_any_filtered() +

    +

    Answers the question of whether the current settings and values selected actually filters out any values.

    +
    +

    Usage +

    +

    +
    +
    EmptyFilterState$is_any_filtered()
    +

    +
    -

    Returns

    +

    Returns +

    logical scalar

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection relevant for selected variable type. Method is using internal reactive values which makes it reactive -and must be executed in reactive or isolated context.

    -

    Usage

    -

    EmptyFilterState$get_call()

    +and must be executed in reactive or isolated context.

    +
    +

    Usage +

    +

    +
    +
    EmptyFilterState$get_call()
    +

    +
    -


    -

    Method get_state()

    -

    Returns the filtering state.

    -

    Usage

    -

    EmptyFilterState$get_state()

    +
    +

    +
    +
    +

    Method get_state() +

    +

    Returns the filtering state.

    +
    +

    Usage +

    +

    +
    +
    EmptyFilterState$get_state()
    +

    +
    -

    Returns

    -

    list containing values taken from the reactive fields:

    • keep_na (logical(1)) whether NA should be kept.

    • -
    +

    Returns +

    +

    list containing values taken from the reactive fields:

    +
      +
    • keep_na (logical(1)) whether NA should be kept.

    • +
    +
    -


    -

    Method ui()

    +
    +

    +
    +
    +

    Method ui() +

    UI Module for EmptyFilterState. This UI element contains checkbox input to -filter or keep missing values.

    -

    Usage

    -

    EmptyFilterState$ui(id)

    +filter or keep missing values.

    +
    +

    Usage +

    +

    +
    +
    EmptyFilterState$ui(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    id of shiny element

    -

    +
    +

    +
    -


    -

    Method server()

    -

    Controls selection of keep_na checkbox input

    -

    Usage

    -

    EmptyFilterState$server(id)

    +
    +

    +
    +
    +

    Method server() +

    +

    Controls selection of keep_na checkbox input

    +
    +

    Usage +

    +

    +
    +
    EmptyFilterState$server(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    an ID string that corresponds with the ID used to call the module's UI function.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    moduleServer function which returns NULL

    -


    -

    Method set_state()

    -

    Set state

    -

    Usage

    -

    EmptyFilterState$set_state(state)

    - +

    +
    +
    +

    Method set_state() +

    +

    Set state

    -

    Arguments

    -

    state
    -

    (list)
    -contains fields relevant for a specific class

    • keep_na (logical) defines whether to keep or remove NA values

    • -
    - +

    Usage +

    +

    +
    +
    EmptyFilterState$set_state(state)
    +

    +
    +
    -

    +
    +

    Arguments +

    +

    +
    +
    +
    state
    +
    +

    (list)
    +contains fields relevant for a specific class

    +
      +
    • keep_na (logical) defines whether to keep or remove NA values

    • +
    +
    + + +
    +

    +
    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    EmptyFilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    EmptyFilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -270,7 +423,8 @@

    Arguments -

    Examples

    +

    Examples +

    filter_state <- teal.slice:::EmptyFilterState$new(
       NA,
       varname = "x",
    @@ -284,17 +438,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.2.0/reference/FilterPanelAPI.html b/v0.2.0/reference/FilterPanelAPI.html index 5bce48f69..322535bad 100644 --- a/v0.2.0/reference/FilterPanelAPI.html +++ b/v0.2.0/reference/FilterPanelAPI.html @@ -1,10 +1,26 @@ - -Class to encapsulate the API of the filter panel of a teal app — FilterPanelAPI • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + + -
    + +
    @@ -79,131 +101,230 @@
    -

    Details

    +

    Details +

    The purpose of this class is to encapsulate the API of the filter panel in a new class FilterPanelAPI so that it can be passed and used in the server call of any module instead of passing the whole FilteredData object.

    This class is supported by methods to set, get, remove filter states in the filter panel API.

    -

    Methods

    +

    Methods +


    -

    Method new()

    -

    Initialize a FilterPanelAPI object

    -

    Usage

    -

    FilterPanelAPI$new(datasets)

    + +
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterPanelAPI object

    +
    +

    Usage +

    +

    +
    +
    FilterPanelAPI$new(datasets)
    +

    +
    -

    Arguments

    -

    datasets
    +

    Arguments +

    +

    +
    +
    +
    datasets

    (FilteredData) object.

    -

    +
    +

    +
    -


    +

    +
    +
    +

    Method get_filter_state() +

    Gets the reactive values from the active FilterState objects of the FilteredData object.

    Gets all active filters in the form of a nested list. -The output list is a compatible input to set_filter_state.

    -

    Usage

    -

    FilterPanelAPI$get_filter_state()

    +The output list is a compatible input to set_filter_state.

    +
    +

    Usage +

    +

    +
    +
    FilterPanelAPI$get_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    list with named elements corresponding to FilteredDataset objects with active filters.

    -


    -

    Method set_filter_state()

    -

    Sets active filter states.

    -

    Usage

    -

    FilterPanelAPI$set_filter_state(filter)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Sets active filter states.

    +
    +

    Usage +

    +

    +
    +
    FilterPanelAPI$set_filter_state(filter)
    +

    +
    -

    Arguments

    -

    filter
    +

    Arguments +

    +

    +
    +
    +
    filter

    (named list)
    nested list of filter selections applied to datasets.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL

    -


    -

    Method remove_filter_state()

    -

    Remove one or more FilterState of a FilteredDataset in the FilteredData object.

    -

    Usage

    -

    FilterPanelAPI$remove_filter_state(filter)

    +
    +

    +
    +
    +

    Method remove_filter_state() +

    +

    Remove one or more FilterState of a FilteredDataset in the FilteredData object.

    +
    +

    Usage +

    +

    +
    +
    FilterPanelAPI$remove_filter_state(filter)
    +

    +
    -

    Arguments

    -

    filter
    +

    Arguments +

    +

    +
    +
    +
    filter

    (named list)
    nested list of filter selections applied to datasets.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL

    -


    -

    Method remove_all_filter_states()

    -

    Remove all FilterStates of the FilteredData object.

    -

    Usage

    -

    FilterPanelAPI$remove_all_filter_states(datanames)

    +
    +

    +
    +
    +

    Method remove_all_filter_states() +

    +

    Remove all FilterStates of the FilteredData object.

    +
    +

    Usage +

    +

    +
    +
    FilterPanelAPI$remove_all_filter_states(datanames)
    +

    +
    -

    Arguments

    -

    datanames
    +

    Arguments +

    +

    +
    +
    +
    datanames

    (character)
    datanames to remove their FilterStates or empty which removes all FilterStates in the FilteredData object.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    FilterPanelAPI$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    FilterPanelAPI$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -211,7 +332,8 @@

    Arguments -

    Examples

    +

    Examples +

    library(teal.slice)
     fd <- teal.slice::init_filtered_data(list(iris = list(dataset = iris)))
     fpa <- FilterPanelAPI$new(fd)
    @@ -252,17 +374,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.2.0/reference/FilterState.html b/v0.2.0/reference/FilterState.html index b0f7ed8c6..8d2574ab2 100644 --- a/v0.2.0/reference/FilterState.html +++ b/v0.2.0/reference/FilterState.html @@ -1,10 +1,26 @@ - -Abstract class to encapsulate filter states — FilterState • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + + -
    + +
    @@ -79,13 +101,16 @@
    -

    Details

    +

    Details +

    This class is responsible for managing single filter item within FilteredData class. Filter states depend on the variable type: (logical, integer, numeric, factor, character, Date, POSIXct, POSIXlt) and returns FilterState object with class corresponding to input variable. Class controls single filter entry in module_single_filter_item and returns -code relevant to selected values.

    • factor, character: class = ChoicesFilterState

    • +code relevant to selected values.

      +
    + +
    -

    Modifying state

    +

    Modifying state +

    Modifying a FilterState object is possible in three scenarios depicted below: -Figure: filter_state_reactivity.jpg

    • In the interactive session by directly specifying values of selected, +Figure: filter_state_reactivity.jpg

      +
        +
      • In the interactive session by directly specifying values of selected, keep_na or keep_inf using set_state method (to update all at once), or using set_selected, set_keep_na or set_keep_inf

      • In a teal application by changing appropriate inputs

      • Using methods set_selected_reactive, set_keep_na_reactive, set_keep_inf_reactive which serves as a programmatic API.

      • -
    + +
    -

    Methods

    +

    Methods +


    -

    Method new()

    -

    Initialize a FilterState object

    -

    Usage

    -

    FilterState$new(
    +
    +
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterState object

    +
    +

    Usage +

    +

    +
    +
    FilterState$new(
       x,
       varname,
       varlabel = character(0),
       input_dataname = NULL,
       extract_type = character(0)
    -)

    +)
    +

    +
    -


    -

    Method destroy_observers()

    -

    Destroy observers stored in private$observers.

    -

    Usage

    -

    FilterState$destroy_observers()

    +
    +

    +
    +
    +

    Method destroy_observers() +

    +

    Destroy observers stored in private$observers.

    +
    +

    Usage +

    +

    +
    +
    FilterState$destroy_observers()
    +

    +
    -


    -

    Method format()

    -

    Returns a formatted string representing this FilterState.

    -

    Usage

    -

    FilterState$format(indent = 0)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns a formatted string representing this FilterState.

    +
    +

    Usage +

    +

    +
    +
    FilterState$format(indent = 0)
    +

    +
    -

    Arguments

    -

    indent
    +

    Arguments +

    +

    +
    +
    +
    indent

    (numeric(1)) the number of spaces before after each new line character of the formatted string. Default: 0

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    character(1) the formatted string

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection relevant for selected variable type. Method is using internal reactive values which makes it reactive -and must be executed in reactive or isolated context.

    -

    Usage

    -

    FilterState$get_call()

    +and must be executed in reactive or isolated context.

    +
    +

    Usage +

    +

    +
    +
    FilterState$get_call()
    +

    +
    -


    -

    Method get_dataname()

    -

    Returns dataname

    -

    Usage

    -

    FilterState$get_dataname(deparse = TRUE)

    +
    +

    +
    +
    +

    Method get_dataname() +

    +

    Returns dataname

    +
    +

    Usage +

    +

    +
    +
    FilterState$get_dataname(deparse = TRUE)
    +

    +
    -

    Arguments

    -

    deparse
    +

    Arguments +

    +

    +
    +
    +
    deparse

    (logical(1))
    whether dataname should be deparsed. TRUE by default

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (name or character(1))

    -


    -

    Method get_keep_na()

    -

    Returns current keep_na selection

    -

    Usage

    -

    FilterState$get_keep_na()

    +
    +

    +
    +
    +

    Method get_keep_na() +

    +

    Returns current keep_na selection

    +
    +

    Usage +

    +

    +
    +
    FilterState$get_keep_na()
    +

    +
    -

    Returns

    +

    Returns +

    (logical(1))

    -


    -

    Method get_varlabel()

    -

    Returns variable label

    -

    Usage

    -

    FilterState$get_varlabel()

    +
    +

    +
    +
    +

    Method get_varlabel() +

    +

    Returns variable label

    +
    +

    Usage +

    +

    +
    +
    FilterState$get_varlabel()
    +

    +
    -

    Returns

    +

    Returns +

    (character(1))

    -


    -

    Method get_varname()

    -

    Get variable name

    -

    Usage

    -

    FilterState$get_varname(deparse = FALSE)

    +
    +

    +
    +
    +

    Method get_varname() +

    +

    Get variable name

    +
    +

    Usage +

    +

    +
    +
    FilterState$get_varname(deparse = FALSE)
    +

    +
    -

    Arguments

    -

    deparse
    +

    Arguments +

    +

    +
    +
    +
    deparse

    (logical(1))
    whether variable name should be deparsed. FALSE by default

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (name or character(1))

    -


    -

    Method get_selected()

    -

    Get selected values from FilterState

    -

    Usage

    -

    FilterState$get_selected()

    +
    +

    +
    +
    +

    Method get_selected() +

    +

    Get selected values from FilterState

    +
    +

    Usage +

    +

    +
    +
    FilterState$get_selected()
    +

    +
    -

    Returns

    +

    Returns +

    class of the returned object depends of class of the FilterState

    -


    -

    Method get_state()

    -

    Returns the filtering state.

    -

    Usage

    -

    FilterState$get_state()

    +
    +

    +
    +
    +

    Method get_state() +

    +

    Returns the filtering state.

    +
    +

    Usage +

    +

    +
    +
    FilterState$get_state()
    +

    +
    -

    Returns

    -

    list containing values taken from the reactive fields:

    • selected (atomic) length depends on a FilterState variant.

    • +

      Returns +

      +

      list containing values taken from the reactive fields:

      +
        +
      • selected (atomic) length depends on a FilterState variant.

      • keep_na (logical(1)) whether NA should be kept.

      • -
    + +
    -


    -

    Method print()

    -

    Prints this FilterState object

    -

    Usage

    -

    FilterState$print(...)

    +
    +

    +
    +
    +

    Method print() +

    +

    Prints this FilterState object

    +
    +

    Usage +

    +

    +
    +
    FilterState$print(...)
    +

    +
    -

    Arguments

    -

    ...
    +

    Arguments +

    +

    +
    +
    +
    ...

    additional arguments to this method

    -

    +
    +

    +
    -


    -

    Method set_keep_na()

    -

    Set if NA should be kept

    -

    Usage

    -

    FilterState$set_keep_na(value)

    +
    +

    +
    +
    +

    Method set_keep_na() +

    +

    Set if NA should be kept

    +
    +

    Usage +

    +

    +
    +
    FilterState$set_keep_na(value)
    +

    +
    -

    Arguments

    -

    value
    +

    Arguments +

    +

    +
    +
    +
    value

    (logical(1))
    value(s) which come from the filter selection. Value is set in server modules after selecting check-box-input in the shiny interface. Values are set to private$keep_na which is reactive.

    -

    +
    +

    +
    -


    -

    Method set_keep_na_reactive()

    -

    Set if NA should be kept when using set_filter_state

    -

    Usage

    -

    FilterState$set_keep_na_reactive(value)

    +
    +

    +
    +
    +

    Method set_keep_na_reactive() +

    +

    Set if NA should be kept when using set_filter_state

    +
    +

    Usage +

    +

    +
    +
    FilterState$set_keep_na_reactive(value)
    +

    +
    -

    Arguments

    -

    value
    +

    Arguments +

    +

    +
    +
    +
    value

    (logical(1))
    value(s) which come from the filter selection. Value is set in server modules when using set_filter_state instead of the shiny interface. Values are set to private$keep_na_reactive which is reactive.

    -

    +
    +

    +
    -


    -

    Method set_na_rm()

    +
    +

    +
    +
    +

    Method set_na_rm() +

    Some methods needs additional !is.na(varame) condition to not include missing values. When private$na_rm = TRUE is set, self$get_call returns -condition extended by !is.na condition.

    -

    Usage

    -

    FilterState$set_na_rm(value)

    +condition extended by !is.na condition.

    +
    +

    Usage +

    +

    +
    +
    FilterState$set_na_rm(value)
    +

    +
    -

    Arguments

    -

    value
    +

    Arguments +

    +

    +
    +
    +
    value

    (logical(1)) when TRUE, FilterState$get_call appends an expression removing NA values to the filter expression returned by get_call

    -

    +
    +

    +
    -


    -

    Method set_selected()

    -

    Set selection

    -

    Usage

    -

    FilterState$set_selected(value)

    +
    +

    +
    +
    +

    Method set_selected() +

    +

    Set selection

    +
    +

    Usage +

    +

    +
    +
    FilterState$set_selected(value)
    +

    +
    -

    Arguments

    -

    value
    +

    Arguments +

    +

    +
    +
    +
    value

    (vector)
    value(s) which come from the filter selection. Values are set in server module after choosing value in app interface. Values are set to @@ -409,19 +659,35 @@

    Arguments
    -

    Method set_selected_reactive()

    -

    Set selection when using set_filter_state

    -

    Usage

    -

    FilterState$set_selected_reactive(value)

    +
    +

    +
    +
    +

    Method set_selected_reactive() +

    +

    Set selection when using set_filter_state

    +
    +

    Usage +

    +

    +
    +
    FilterState$set_selected_reactive(value)
    +

    +
    -

    Arguments

    -

    value
    +

    Arguments +

    +

    +
    +
    +
    value

    (vector)
    value(s) which come from the filters set by the user. Values are set in server modules after setting filters in set_filter_state. Values are set to @@ -429,79 +695,153 @@

    Arguments
    -

    Method set_state()

    -

    Set state

    -

    Usage

    -

    FilterState$set_state(state)

    +
    +

    +
    +
    +

    Method set_state() +

    +

    Set state

    +
    +

    Usage +

    +

    +
    +
    FilterState$set_state(state)
    +

    +
    -

    Arguments

    -

    state
    -

    (list)
    -contains fields relevant for a specific class

    • selected defines initial selection

    • +

      Arguments +

      +

      +
      +
      +
      state
      +
      +

      (list)
      +contains fields relevant for a specific class

      +
        +
      • selected defines initial selection

      • keep_na (logical) defines whether to keep or remove NA values

      • -
      +
    +
    -

    +

    +

    +
    -


    -

    Method set_state_reactive()

    -

    Set state when using set_filter_state

    -

    Usage

    -

    FilterState$set_state_reactive(state)

    +
    +

    +
    +
    +

    Method set_state_reactive() +

    +

    Set state when using set_filter_state

    +
    +

    Usage +

    +

    +
    +
    FilterState$set_state_reactive(state)
    +

    +
    -

    Arguments

    -

    state
    -

    (list)
    -contains fields relevant for a specific class

    • selected defines initial selection

    • +

      Arguments +

      +

      +
      +
      +
      state
      +
      +

      (list)
      +contains fields relevant for a specific class

      +
        +
      • selected defines initial selection

      • keep_na (logical) defines whether to keep or remove NA values

      • -
      +
    +
    -

    +

    +

    +
    -


    -

    Method server()

    -

    Server module

    -

    Usage

    -

    FilterState$server(id)

    +
    +

    +
    +
    +

    Method server() +

    +

    Server module

    +
    +

    Usage +

    +

    +
    +
    FilterState$server(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    an ID string that corresponds with the ID used to call the module's UI function.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    moduleServer function which returns NULL

    -


    -

    Method ui()

    -

    UI Module

    -

    Usage

    -

    FilterState$ui(id)

    +
    +

    +
    +
    +

    Method ui() +

    +

    UI Module

    +
    +

    Usage +

    +

    +
    +
    FilterState$ui(id)
    +

    +
    -

    Arguments

    -

    id
    -

    (character(1))
    +

    Arguments +

    +

    +
    +
    +
    id
    +
    +

    (character(1))
    id of shiny element. UI for this class contains simple message informing that it's not supported description @@ -527,26 +867,45 @@

    Arguments
    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    FilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    FilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -554,17 +913,19 @@

    Arguments

    + +

    + +
    - - + + diff --git a/v0.2.0/reference/FilterStates.html b/v0.2.0/reference/FilterStates.html index 11e8e4b38..9ee898238 100644 --- a/v0.2.0/reference/FilterStates.html +++ b/v0.2.0/reference/FilterStates.html @@ -1,18 +1,34 @@ - - + + + + + +FilterStates R6 class — FilterStates • teal.slice +FilterStates R6 class — FilterStates • teal.slice + + + + + + + + + + Skip to contents @@ -28,7 +44,8 @@ + + + -
    + +
    @@ -91,17 +114,21 @@
    -

    Note

    +

    Note +

    throws an exception if the length of x does not match the length of element_id

    -

    Methods

    +

    Methods +


    -

    Method new()

    -

    Initializes this FilterStates object.

    -

    Usage

    -

    FilterStates$new(input_dataname, output_dataname, datalabel)

    + +
    +

    +
    +
    +

    Method new() +

    +

    Initializes this FilterStates object.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$new(input_dataname, output_dataname, datalabel)
    +

    +
    -

    Arguments

    -

    input_dataname
    +

    Arguments +

    +

    +
    +
    +
    input_dataname

    (character(1) or name or call)
    name of the data used on lhs of the expression specified to the function argument attached to this FilterStates.

    @@ -144,43 +186,77 @@

    Arguments
    -

    Method get_datalabel()

    -

    Returns the label of the dataset

    -

    Usage

    -

    FilterStates$get_datalabel()

    +
    +

    +
    +
    +

    Method get_datalabel() +

    +

    Returns the label of the dataset

    +
    +

    Usage +

    +

    +
    +
    FilterStates$get_datalabel()
    +

    +
    -

    Returns

    +

    Returns +

    (character(1)) the label

    -


    -

    Method format()

    -

    Returns the formatted string representing this FilterStates object.

    -

    Usage

    -

    FilterStates$format(indent)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns the formatted string representing this FilterStates object.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$format(indent)
    +

    +
    -

    Arguments

    -

    indent
    +

    Arguments +

    +

    +
    +
    +
    indent

    (numeric(1)) the number of spaces before each line of the representation

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    character(1) the formatted string

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Filter call

    Makes a subset function call based on condition calls from FilterState objects selection. @@ -188,68 +264,127 @@

    Method get_call()self$get_fun() with private$input_dataname as argument and list of condition calls from FilterState. If input and output data-names are the same and no filters applied, method returns NULL to avoid -no-op call such as x <- x.

    -

    Usage

    -

    FilterStates$get_call()

    +no-op call such as x <- x.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$get_call()
    +

    +
    -

    Returns

    +

    Returns +

    call or NULL

    -


    -

    Method print()

    -

    Prints this FilterStates object

    -

    Usage

    -

    FilterStates$print(...)

    +
    +

    +
    +
    +

    Method print() +

    +

    Prints this FilterStates object

    +
    +

    Usage +

    +

    +
    +
    FilterStates$print(...)
    +

    +
    -

    Arguments

    -

    ...
    +

    Arguments +

    +

    +
    +
    +
    ...

    additional arguments to this method

    -

    +
    +

    +
    -


    -

    Method get_fun()

    +
    +

    +
    +
    +

    Method get_fun() +

    Gets the name of the function used to filter the data in this FilterStates.

    Get function name used to create filter call. By default it's a -"subset" but can be overridden by child class method.

    -

    Usage

    -

    FilterStates$get_fun()

    +"subset" but can be overridden by child class method.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$get_fun()
    +

    +
    -

    Returns

    +

    Returns +

    character(1) the name of the function

    -


    -

    Method queue_empty()

    -

    Remove all FilterState objects from all queues in this FilterStates.

    -

    Usage

    -

    FilterStates$queue_empty()

    +
    +

    +
    +
    +

    Method queue_empty() +

    +

    Remove all FilterState objects from all queues in this FilterStates.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$queue_empty()
    +

    +
    -

    Returns

    +

    Returns +

    NULL

    -


    -

    Method queue_get()

    -

    Returns a list of FilterState objects stored in this FilterStates.

    -

    Usage

    -

    FilterStates$queue_get(queue_index, element_id = character(0))

    +
    +

    +
    +
    +

    Method queue_get() +

    +

    Returns a list of FilterState objects stored in this FilterStates.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$queue_get(queue_index, element_id = character(0))
    +

    +
    -

    Arguments

    -

    queue_index
    +

    Arguments +

    +

    +
    +
    +
    queue_index

    (character(1), integer(1))
    index of the private$queue list where ReactiveQueue are kept.

    @@ -259,40 +394,73 @@

    Arguments -

    Returns

    +

    Returns +

    list of FilterState objects

    -


    -

    Method queue_initialize()

    -

    Sets ReactiveQueue objects.

    -

    Usage

    -

    FilterStates$queue_initialize(x)

    +
    +

    +
    +
    +

    Method queue_initialize() +

    +

    Sets ReactiveQueue objects.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$queue_initialize(x)
    +

    +
    -

    Arguments

    -

    x
    +

    Arguments +

    +

    +
    +
    +
    x

    (list of ReactiveQueue)
    must be a list even if single ReactiveQueue is set.

    -

    +
    +

    +
    -


    -

    Method queue_push()

    -

    Adds a new FilterState object to this FilterStates

    -

    Usage

    -

    FilterStates$queue_push(x, queue_index, element_id)

    +
    +

    +
    +
    +

    Method queue_push() +

    +

    Adds a new FilterState object to this FilterStates

    +
    +

    Usage +

    +

    +
    +
    FilterStates$queue_push(x, queue_index, element_id)
    +

    +
    -

    Arguments

    -

    x
    +

    Arguments +

    +

    +
    +
    +
    x

    (FilterState)
    object to be added to the queue

    @@ -307,24 +475,42 @@

    Arguments
    -

    Method queue_remove()

    +
    +

    +
    +
    +

    Method queue_remove() +

    Removes a single filter state

    Removes a single filter state with all shiny elements associated -with this state. It removes:

    • particular FilterState from private$queue

    • +with this state. It removes:

      +
        +
      • particular FilterState from private$queue

      • UI card created for this filter

      • observers listening selection and remove button

      • -
      -

      Usage

      -

      FilterStates$queue_remove(queue_index, element_id)

      +
    +
    +

    Usage +

    +

    +
    +
    FilterStates$queue_remove(queue_index, element_id)
    +

    +
    -

    Arguments

    -

    queue_index
    +

    Arguments +

    +

    +
    +
    +
    queue_index

    (character(1), logical(1))
    index of the private$queue list where ReactiveQueue are kept.

    @@ -334,57 +520,101 @@

    Arguments
    -

    Method ui()

    +
    +

    +
    +
    +

    Method ui() +

    Shiny UI module

    Shiny UI element being a container for FilterState elements. Content of this container is created using renderUI in -server module

    -

    Usage

    -

    FilterStates$ui(id)

    +server module

    +
    +

    Usage +

    +

    +
    +
    FilterStates$ui(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    id of the shiny element

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    +

    +
    +
    +

    Method get_filter_state() +

    Gets the reactive values from the active FilterState objects.

    Get active filter state from the FilterState objects kept in ReactiveQueue(s). -The output list is a compatible input to self$set_filter_state.

    -

    Usage

    -

    FilterStates$get_filter_state()

    +The output list is a compatible input to self$set_filter_state.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$get_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    list containing list per each FilterState in the ReactiveQueue

    -


    -

    Method set_filter_state()

    -

    Sets active FilterState objects.

    -

    Usage

    -

    FilterStates$set_filter_state(data, state)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Sets active FilterState objects.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$set_filter_state(data, state)
    +

    +
    -

    Arguments

    -

    data
    +

    Arguments +

    +

    +
    +
    +
    data

    (data.frame)
    data which are supposed to be filtered

    @@ -396,44 +626,78 @@

    Arguments -

    Returns

    +

    Returns +

    function which throws an error

    -


    -

    Method remove_filter_state()

    -

    Remove a single FilterState from the ReactiveQueue.

    -

    Usage

    -

    FilterStates$remove_filter_state(element_id)

    +
    +

    +
    +
    +

    Method remove_filter_state() +

    +

    Remove a single FilterState from the ReactiveQueue.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$remove_filter_state(element_id)
    +

    +
    -

    Arguments

    -

    element_id
    +

    Arguments +

    +

    +
    +
    +
    element_id

    (character)
    Name of variable to remove its FilterState.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL

    -


    -

    Method ui_add_filter_state()

    -

    Shiny UI module to add filter variable.

    -

    Usage

    -

    FilterStates$ui_add_filter_state(id, data)

    +
    +

    +
    +
    +

    Method ui_add_filter_state() +

    +

    Shiny UI module to add filter variable.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$ui_add_filter_state(id, data)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    id of shiny module

    @@ -443,23 +707,40 @@

    Arguments -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_add_filter_state()

    -

    Shiny server module to add filter variable

    -

    Usage

    -

    FilterStates$srv_add_filter_state(id, data, ...)

    +
    +

    +
    +
    +

    Method srv_add_filter_state() +

    +

    Shiny server module to add filter variable

    +
    +

    Usage +

    +

    +
    +
    FilterStates$srv_add_filter_state(id, data, ...)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    an ID string that corresponds with the ID used to call the module's UI function.

    @@ -473,10 +754,13 @@

    Arguments -

    Returns

    +

    Returns +

    moduleServer function which returns NULL Module to insert/remove FilterState UI

    This module adds the shiny UI of the newly added FilterState object to queue to the Active Filter @@ -493,20 +777,36 @@

    Returns
    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    FilterStates$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -514,7 +814,8 @@

    Arguments -

    Examples

    +

    Examples +

    library(shiny)
     filter_states <- teal.slice:::DFFilterStates$new(
       input_dataname = "data",
    @@ -543,17 +844,19 @@ 

    Examples

    + +

    + +
    - - + + diff --git a/v0.2.0/reference/FilteredData.html b/v0.2.0/reference/FilteredData.html index 4d0961bbe..80d615137 100644 --- a/v0.2.0/reference/FilteredData.html +++ b/v0.2.0/reference/FilteredData.html @@ -1,10 +1,26 @@ - -Class to encapsulate filtered datasets — FilteredData • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + + -
    + +
    @@ -79,7 +101,8 @@ + +
    -

    Methods

    +

    Methods +


    -

    Method new()

    -

    Initialize a FilteredData object

    -

    Usage

    -

    FilteredData$new(data_objects, join_keys = NULL, code = NULL, check = FALSE)

    -
    - -
    -

    Arguments

    -

    data_objects
    -

    (list) should contain.

    +
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilteredData object

    +
    +

    Usage +

    +

    +
    +
    FilteredData$new(data_objects, join_keys = NULL, code = NULL, check = FALSE)
    +

    +
    +
    + +
    +

    Arguments +

    +

    +
    +
    +
    data_objects
    +
    +

    (list) should contain.

    +
      +
    • dataset data object object supported by FilteredDataset.

    • metatada (optional) additional metadata attached to the dataset.

    • keys (optional) primary keys.

    • datalabel (optional) label describing the dataset.

    • parent (optional) which NULL is a parent of this one.

    • -
    + +
    join_keys
    @@ -169,96 +220,173 @@

    Arguments
    -

    Method datanames()

    +
    +

    +
    +
    +

    Method datanames() +

    Gets datanames

    The datanames are returned in the order in which they must be -evaluated (in case of dependencies).

    -

    Usage

    -

    FilteredData$datanames()

    +evaluated (in case of dependencies).

    +
    +

    Usage +

    +

    +
    +
    FilteredData$datanames()
    +

    +
    -

    Returns

    +

    Returns +

    (character vector) of datanames Gets data label for the dataset

    Useful to display in Show R Code.

    -


    -

    Method get_datalabel()

    +
    +

    +
    +
    +

    Method get_datalabel() +

    -

    Usage

    -

    FilteredData$get_datalabel(dataname)

    +

    Usage +

    +

    +
    +
    FilteredData$get_datalabel(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (character) keys of dataset

    -


    -

    Method get_filterable_datanames()

    -

    Gets dataset names of a given dataname for the filtering.

    -

    Usage

    -

    FilteredData$get_filterable_datanames(dataname)

    +
    +

    +
    +
    +

    Method get_filterable_datanames() +

    +

    Gets dataset names of a given dataname for the filtering.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_filterable_datanames(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character vector) names of the dataset

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (character vector) of dataset names

    -


    -

    Method get_filterable_varnames()

    -

    Gets variable names of a given dataname for the filtering.

    -

    Usage

    -

    FilteredData$get_filterable_varnames(dataname)

    +
    +

    +
    +
    +

    Method get_filterable_varnames() +

    +

    Gets variable names of a given dataname for the filtering.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_filterable_varnames(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (character vector) of variable names

    -


    -

    Method set_filterable_varnames()

    -

    Set the variable names of a given dataset for the filtering

    -

    Usage

    -

    FilteredData$set_filterable_varnames(dataname, varnames)

    +
    +

    +
    +
    +

    Method set_filterable_varnames() +

    +

    Set the variable names of a given dataset for the filtering

    +
    +

    Usage +

    +

    +
    +
    FilteredData$set_filterable_varnames(dataname, varnames)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset

    @@ -268,15 +396,22 @@

    Arguments -

    Returns

    +

    Returns +

    invisibly this FilteredData object

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Gets a call to filter the dataset according to the filter state

    It returns a call to filter the dataset only, assuming the other (filtered) datasets it depends on are available.

    @@ -287,79 +422,140 @@

    Method get_call()

    The filtered dataset has the name given by self$filtered_dataname(dataname)

    -

    This can be used for the Show R Code generation.

    -

    Usage

    -

    FilteredData$get_call(dataname)

    +

    This can be used for the Show R Code generation.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (call or list of calls) to filter dataset calls

    -


    -

    Method get_code()

    -

    Gets the R preprocessing code string that generates the unfiltered datasets

    -

    Usage

    -

    FilteredData$get_code(dataname = self$datanames())

    +
    +

    +
    +
    +

    Method get_code() +

    +

    Gets the R preprocessing code string that generates the unfiltered datasets

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_code(dataname = self$datanames())
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name(s) of dataset(s)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (character(1)) deparsed code

    -


    -

    Method get_filtered_dataset()

    +
    +

    +
    +
    +

    Method get_filtered_dataset() +

    Gets FilteredDataset object which contains all informations -related to specific dataset.

    -

    Usage

    -

    FilteredData$get_filtered_dataset(dataname = character(0))

    +related to specific dataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_filtered_dataset(dataname = character(0))
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1))
    name of the dataset.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    FilteredDataset object or list of FilteredDataset

    -


    -

    Method get_data()

    +
    +

    +
    +
    +

    Method get_data() +

    Gets filtered or unfiltered dataset

    For filtered = FALSE, the original data set with -set_data is returned including all attributes.

    -

    Usage

    -

    FilteredData$get_data(dataname, filtered = TRUE)

    +set_data is returned including all attributes.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_data(dataname, filtered = TRUE)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset

    @@ -367,110 +563,198 @@

    Arguments
    -

    Method get_check()

    -

    Returns whether the datasets in the object have had a reproducibility check

    -

    Usage

    -

    FilteredData$get_check()

    +
    +

    +
    +
    +

    Method get_check() +

    +

    Returns whether the datasets in the object have had a reproducibility check

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_check()
    +

    +
    -

    Returns

    +

    Returns +

    logical

    -


    -

    Method get_metadata()

    -

    Gets metadata for a given dataset

    -

    Usage

    -

    FilteredData$get_metadata(dataname)

    +
    +

    +
    +
    +

    Method get_metadata() +

    +

    Gets metadata for a given dataset

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_metadata(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    value of metadata for given data (or NULL if it does not exist)

    -


    -

    Method get_join_keys()

    -

    Get join keys between two datasets.

    -

    Usage

    -

    FilteredData$get_join_keys()

    +
    +

    +
    +
    +

    Method get_join_keys() +

    +

    Get join keys between two datasets.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_join_keys()
    +

    +
    -

    Returns

    +

    Returns +

    (JoinKeys)

    -


    -

    Method get_filter_overview()

    +
    +

    +
    +
    +

    Method get_filter_overview() +

    Get filter overview table in form of X (filtered) / Y (non-filtered)

    This is intended to be presented in the application. -The content for each of the data names is defined in get_filter_overview_info method.

    -

    Usage

    -

    FilteredData$get_filter_overview(datanames)

    +The content for each of the data names is defined in get_filter_overview_info method.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_filter_overview(datanames)
    +

    +
    -

    Arguments

    -

    datanames
    +

    Arguments +

    +

    +
    +
    +
    datanames

    (character vector) names of the dataset

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (matrix) matrix of observations and subjects of all datasets Get keys for the dataset

    -


    -

    Method get_keys()

    +
    +

    +
    +
    +

    Method get_keys() +

    -

    Usage

    -

    FilteredData$get_keys(dataname)

    +

    Usage +

    +

    +
    +
    FilteredData$get_keys(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (character) keys of dataset

    -


    -

    Method get_varlabels()

    +
    +

    +
    +
    +

    Method get_varlabels() +

    Gets labels of variables in the data

    Variables are the column names of the data. Either, all labels must have been provided for all variables -in set_data or NULL.

    -

    Usage

    -

    FilteredData$get_varlabels(dataname, variables = NULL)

    +in set_data or NULL.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_varlabels(dataname, variables = NULL)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset

    @@ -479,67 +763,117 @@

    Arguments -

    Returns

    +

    Returns +

    (character or NULL) variable labels, NULL if column_labels attribute does not exist for the data

    -


    -

    Method get_varnames()

    -

    Gets variable names

    -

    Usage

    -

    FilteredData$get_varnames(dataname)

    +
    +

    +
    +
    +

    Method get_varnames() +

    +

    Gets variable names

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_varnames(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character) the name of the dataset

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (character vector) of variable names When active_datanames is "all", sets them to all datanames otherwise, it makes sure that it is a subset of the available datanames

    -


    -

    Method handle_active_datanames()

    +
    +

    +
    +
    +

    Method handle_active_datanames() +

    -

    Usage

    -

    FilteredData$handle_active_datanames(datanames)

    +

    Usage +

    +

    +
    +
    FilteredData$handle_active_datanames(datanames)
    +

    +
    -

    Arguments

    -

    datanames
    +

    Arguments +

    +

    +
    +
    +
    datanames

    character vector datanames to pick

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    the intersection of self$datanames() and datanames

    -


    -

    Method set_dataset()

    -

    Adds a dataset to this FilteredData

    -

    Usage

    -

    FilteredData$set_dataset(dataset_args, dataname)

    +
    +

    +
    +
    +

    Method set_dataset() +

    +

    Adds a dataset to this FilteredData

    +
    +

    Usage +

    +

    +
    +
    FilteredData$set_dataset(dataset_args, dataname)
    +

    +
    -

    Arguments

    -

    dataset_args
    +

    Arguments +

    +

    +
    +
    +
    dataset_args

    (list)
    containing the arguments except (dataname) needed by init_filtered_dataset

    @@ -550,113 +884,193 @@

    Arguments -

    Details

    +

    Details +

    set_dataset creates a FilteredDataset object which keeps dataset for the filtering purpose.

    -

    Returns

    +

    Returns +

    (self) invisibly this FilteredData

    -


    -

    Method set_join_keys()

    -

    Set the join_keys

    -

    Usage

    -

    FilteredData$set_join_keys(join_keys)

    +
    +

    +
    +
    +

    Method set_join_keys() +

    +

    Set the join_keys

    +
    +

    Usage +

    +

    +
    +
    FilteredData$set_join_keys(join_keys)
    +

    +
    -

    Arguments

    -

    join_keys
    +

    Arguments +

    +

    +
    +
    +
    join_keys

    (JoinKeys) join_key (converted to a nested list)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (self) invisibly this FilteredData

    -


    -

    Method set_check()

    -

    sets whether the datasets in the object have had a reproducibility check

    -

    Usage

    -

    FilteredData$set_check(check)

    +
    +

    +
    +
    +

    Method set_check() +

    +

    sets whether the datasets in the object have had a reproducibility check

    +
    +

    Usage +

    +

    +
    +
    FilteredData$set_check(check)
    +

    +
    -

    Arguments

    -

    check
    +

    Arguments +

    +

    +
    +
    +
    check

    (logical) whether datasets have had reproducibility check

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (self)

    -


    -

    Method set_code()

    -

    Sets the R preprocessing code for single dataset

    -

    Usage

    -

    FilteredData$set_code(code)

    +
    +

    +
    +
    +

    Method set_code() +

    +

    Sets the R preprocessing code for single dataset

    +
    +

    Usage +

    +

    +
    +
    FilteredData$set_code(code)
    +

    +
    -

    Arguments

    -

    code
    +

    Arguments +

    +

    +
    +
    +
    code

    (CodeClass)
    preprocessing code that can be parsed to generate the unfiltered datasets

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (self)

    -


    +

    +
    +
    +

    Method get_filter_state() +

    Gets the reactive values from the active FilterState objects.

    Gets all active filters in the form of a nested list. The output list is a compatible input to self$set_filter_state. The attribute formatted renders the output of self$get_formatted_filter_state which -is a character formatting of the filter state.

    -

    Usage

    -

    FilteredData$get_filter_state()

    +is a character formatting of the filter state.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    list with named elements corresponding to FilteredDataset objects with active filters. Additionally, an attribute formatted holds the character format of the active filter states.

    -


    -

    Method get_formatted_filter_state()

    -

    Returns the filter state formatted for printing to an IO device.

    -

    Usage

    -

    FilteredData$get_formatted_filter_state()

    +
    +

    +
    +
    +

    Method get_formatted_filter_state() +

    +

    Returns the filter state formatted for printing to an IO device.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_formatted_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    character the pre-formatted filter state

    -

    Examples

    -

    utils::data(miniACC, package = "MultiAssayExperiment")
    +

    Examples +

    +

    +
    +
    utils::data(miniACC, package = "MultiAssayExperiment")
     datasets <- teal.slice:::FilteredData$new(
       list(iris = list(dataset = iris),
            mae = list(dataset = miniACC)
    @@ -681,33 +1095,55 @@ 

    Examples) datasets$set_filter_state(state = fs) cat(shiny::isolate(datasets$get_formatted_filter_state())) -

    +
    +

    +
    -


    -

    Method set_filter_state()

    -

    Sets active filter states.

    -

    Usage

    -

    FilteredData$set_filter_state(state)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Sets active filter states.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$set_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (named list)
    nested list of filter selections applied to datasets.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL

    -

    Examples

    -

    utils::data(miniACC, package = "MultiAssayExperiment")
    +

    Examples +

    +

    +
    +
    utils::data(miniACC, package = "MultiAssayExperiment")
     
     datasets <- teal.slice:::FilteredData$new(
       list(iris = list(dataset = iris),
    @@ -732,115 +1168,197 @@ 

    Examples) ) datasets$set_filter_state(state = fs) -shiny::isolate(datasets$get_filter_state())

    +shiny::isolate(datasets$get_filter_state())
    +

    +
    -


    -

    Method remove_filter_state()

    -

    Remove one or more FilterState of a FilteredDataset in a FilteredData object

    -

    Usage

    -

    FilteredData$remove_filter_state(state)

    +
    +

    +
    +
    +

    Method remove_filter_state() +

    +

    Remove one or more FilterState of a FilteredDataset in a FilteredData object

    +
    +

    Usage +

    +

    +
    +
    FilteredData$remove_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (named list)
    nested list of filter selections applied to datasets.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL

    -


    -

    Method remove_all_filter_states()

    -

    Remove all FilterStates of a FilteredDataset or all FilterStates of a FilteredData object

    -

    Usage

    -

    FilteredData$remove_all_filter_states(datanames = self$datanames())

    +
    +

    +
    +
    +

    Method remove_all_filter_states() +

    +

    Remove all FilterStates of a FilteredDataset or all FilterStates of a FilteredData object

    +
    +

    Usage +

    +

    +
    +
    FilteredData$remove_all_filter_states(datanames = self$datanames())
    +

    +
    -

    Arguments

    -

    datanames
    +

    Arguments +

    +

    +
    +
    +
    datanames

    (character)
    datanames to remove their FilterStates or empty which removes all FilterStates in the FilteredData object.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL

    -


    -

    Method restore_state_from_bookmark()

    +
    +

    +
    +
    +

    Method restore_state_from_bookmark() +

    Sets this object from a bookmarked state

    Only sets the filter state, does not set the data and the preprocessing code. The data should already have been set. Also checks the preprocessing code is identical if provided in the state.

    Since this function is used from the end-user part, its error messages are more verbose. We don't call the Shiny modals from here because this -class may be used outside of a Shiny app.

    -

    Usage

    -

    FilteredData$restore_state_from_bookmark(state, check_data_hash = TRUE)

    +class may be used outside of a Shiny app.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$restore_state_from_bookmark(state, check_data_hash = TRUE)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (named list)
    containing fields data_hash, filter_states and preproc_code.

    check_data_hash
    -

    (logical) whether to check that md5sums agree +

    +

    (logical) whether to check that md5sums agree for the data; may not make sense with randomly generated data per session Module for the right filter panel in the teal app with a filter overview panel and a filter variable panel.

    This panel contains info about the number of observations left in -the (active) datasets and allows to filter the datasets.

    +the (active) datasets and allows to filter the datasets.

    + -

    +
    +

    +
    -


    -

    Method ui_filter_panel()

    +
    +

    +
    +
    +

    Method ui_filter_panel() +

    -

    Usage

    -

    FilteredData$ui_filter_panel(id)

    +

    Usage +

    +

    +
    +
    FilteredData$ui_filter_panel(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    module id Server function for filter panel

    -

    +
    +

    +
    -


    -

    Method srv_filter_panel()

    +
    +

    +
    +
    +

    Method srv_filter_panel() +

    -

    Usage

    -

    FilteredData$srv_filter_panel(id, active_datanames = function() "all")

    +

    Usage +

    +

    +
    +
    FilteredData$srv_filter_panel(id, active_datanames = function() "all")
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    an ID string that corresponds with the ID used to call the module's UI function.

    @@ -853,10 +1371,13 @@

    Arguments -

    Returns

    +

    Returns +

    moduleServer function which returns NULL Creates the UI for the module showing counts for each dataset contrasting the filtered to the full unfiltered dataset

    @@ -865,36 +1386,64 @@

    Returns
    -

    Method ui_filter_overview()

    +
    +

    +
    +
    +

    Method ui_filter_overview() +

    -

    Usage

    -

    FilteredData$ui_filter_overview(id)

    +

    Usage +

    +

    +
    +
    FilteredData$ui_filter_overview(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    module id Server function to display the number of records in the filtered and unfiltered data

    -

    +
    +

    +
    -


    -

    Method srv_filter_overview()

    +
    +

    +
    +
    +

    Method srv_filter_overview() +

    -

    Usage

    -

    FilteredData$srv_filter_overview(id, active_datanames = function() "all")

    +

    Usage +

    +

    +
    +
    FilteredData$srv_filter_overview(id, active_datanames = function() "all")
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    an ID string that corresponds with the ID used to call the module's UI function.

    @@ -907,27 +1456,46 @@

    Arguments -

    Returns

    +

    Returns +

    moduleServer function which returns NULL

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    FilteredData$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -935,7 +1503,8 @@

    Arguments -

    Examples

    +

    Examples +

    library(shiny)
     datasets <- teal.slice:::FilteredData$new(
       list(
    @@ -1371,17 +1940,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.2.0/reference/FilteredDataset.html b/v0.2.0/reference/FilteredDataset.html index 1d301481c..93c5dacf3 100644 --- a/v0.2.0/reference/FilteredDataset.html +++ b/v0.2.0/reference/FilteredDataset.html @@ -1,16 +1,32 @@ - - + + + + + +FilterStates R6 class — FilteredDataset • teal.slice +FilterStates R6 class — FilteredDataset • teal.slice + + + + + + + + + + Skip to contents @@ -26,7 +42,8 @@ + + + -

    + +
    @@ -88,12 +111,15 @@
    -

    Methods

    +

    Methods +


    -

    Method new()

    -

    Initializes this FilteredDataset object

    -

    Usage

    -

    +

    +
    +
    +

    Method new() +

    +

    Initializes this FilteredDataset object

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$new(
       dataset,
       dataname,
       keys = character(0),
       label = attr(dataset, "label"),
       metadata = NULL
    -)

    +)
    +

    +
    -

    Arguments

    -

    dataset
    +

    Arguments +

    +

    +
    +
    +
    dataset

    (data.frame or MultiAssayExperiment)
    single dataset for which filters are rendered

    @@ -156,342 +197,609 @@

    Arguments
    -

    Method get_formatted_filter_state()

    -

    Returns a string representation of the filter state in this FilteredDataset.

    -

    Usage

    -

    FilteredDataset$get_formatted_filter_state()

    +
    +

    +
    +
    +

    Method get_formatted_filter_state() +

    +

    Returns a string representation of the filter state in this FilteredDataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_formatted_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    character(1) the formatted string representing the filter state or NULL if no filter state is present.

    -


    -

    Method queues_empty()

    -

    Removes all active filter items applied to this dataset

    -

    Usage

    -

    FilteredDataset$queues_empty()

    +
    +

    +
    +
    +

    Method queues_empty() +

    +

    Removes all active filter items applied to this dataset

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$queues_empty()
    +

    +
    -

    Returns

    +

    Returns +

    NULL

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Gets a filter expression

    This functions returns filter calls equivalent to selected items within each of filter_states. Configuration of the calls is constant and -depends on filter_states type and order which are set during initialization.

    -

    Usage

    -

    FilteredDataset$get_call()

    +depends on filter_states type and order which are set during initialization.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_call()
    +

    +
    -

    Returns

    +

    Returns +

    filter call or list of filter calls Gets the reactive values from the active FilterState objects.

    Get all active filters from this dataset in form of the nested list. The output list is a compatible input to self$set_filter_state.

    -


    +

    +
    +
    +

    Method get_filter_state() +

    -

    Usage

    -

    FilteredDataset$get_filter_state()

    +

    Usage +

    +

    +
    +
    FilteredDataset$get_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    list with named elements corresponding to FilterStates objects with active filters.

    -


    -

    Method get_filter_states()

    -

    Gets the active FilterStates objects.

    -

    Usage

    -

    FilteredDataset$get_filter_states(id = character(0))

    +
    +

    +
    +
    +

    Method get_filter_states() +

    +

    Gets the active FilterStates objects.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_filter_states(id = character(0))
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1), character(0))
    the id of the private$filter_states list element where FilterStates is kept.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    FilterStates or list of FilterStates objects.

    -


    -

    Method get_dataname()

    +
    +

    +
    +
    +

    Method get_dataname() +

    +

    Get name of the dataset

    Get name of the dataset

    -

    Get name of the dataset

    -

    Usage

    -

    FilteredDataset$get_dataname()

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_dataname()
    +

    +
    -

    Returns

    +

    Returns +

    character(1) as a name of this dataset

    -


    -

    Method get_dataset()

    -

    Gets the dataset object in this FilteredDataset

    -

    Usage

    -

    FilteredDataset$get_dataset()

    +
    +

    +
    +
    +

    Method get_dataset() +

    +

    Gets the dataset object in this FilteredDataset

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_dataset()
    +

    +
    -

    Returns

    +

    Returns +

    data.frame or MultiAssayExperiment

    -


    -

    Method get_metadata()

    -

    Gets the metadata for the dataset in this FilteredDataset

    -

    Usage

    -

    FilteredDataset$get_metadata()

    +
    +

    +
    +
    +

    Method get_metadata() +

    +

    Gets the metadata for the dataset in this FilteredDataset

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_metadata()
    +

    +
    -

    Returns

    +

    Returns +

    named list or NULL

    -


    -

    Method get_filter_overview_info()

    +
    +

    +
    +
    +

    Method get_filter_overview_info() +

    Get filter overview rows of a dataset The output shows the comparison between filtered_dataset -function parameter and the dataset inside self

    -

    Usage

    -

    FilteredDataset$get_filter_overview_info(filtered_dataset = self$get_dataset())

    +function parameter and the dataset inside self

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_filter_overview_info(filtered_dataset = self$get_dataset())
    +

    +
    -

    Arguments

    -

    filtered_dataset
    +

    Arguments +

    +

    +
    +
    +
    filtered_dataset

    comparison object, of the same class as self$get_dataset(), if NULL then self$get_dataset() is used.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (matrix) matrix of observations and subjects

    -


    -

    Method get_hash()

    -

    Returns the hash of the dataset

    -

    Usage

    -

    FilteredDataset$get_hash()

    +
    +

    +
    +
    +

    Method get_hash() +

    +

    Returns the hash of the dataset

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_hash()
    +

    +
    -

    Returns

    +

    Returns +

    (character(1)) the hash

    -


    -

    Method get_keys()

    -

    Gets the keys for the dataset of this FilteredDataset

    -

    Usage

    -

    FilteredDataset$get_keys()

    +
    +

    +
    +
    +

    Method get_keys() +

    +

    Gets the keys for the dataset of this FilteredDataset

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_keys()
    +

    +
    -

    Returns

    +

    Returns +

    (character) the keys of dataset

    -


    -

    Method get_varlabels()

    +
    +

    +
    +
    +

    Method get_varlabels() +

    Gets labels of variables in the data

    Variables are the column names of the data. Either, all labels must have been provided for all variables -in set_data or NULL.

    -

    Usage

    -

    FilteredDataset$get_varlabels(variables = NULL)

    +in set_data or NULL.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_varlabels(variables = NULL)
    +

    +
    -

    Arguments

    -

    variables
    +

    Arguments +

    +

    +
    +
    +
    variables

    (character vector) variables to get labels for; if NULL, for all variables in data

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (character or NULL) variable labels, NULL if column_labels attribute does not exist for the data

    -


    -

    Method get_dataset_label()

    -

    Gets the dataset label

    -

    Usage

    -

    FilteredDataset$get_dataset_label()

    +
    +

    +
    +
    +

    Method get_dataset_label() +

    +

    Gets the dataset label

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_dataset_label()
    +

    +
    -

    Returns

    +

    Returns +

    (character) the dataset label

    -


    -

    Method get_varnames()

    -

    Gets variable names from dataset

    -

    Usage

    -

    FilteredDataset$get_varnames()

    +
    +

    +
    +
    +

    Method get_varnames() +

    +

    Gets variable names from dataset

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_varnames()
    +

    +
    -

    Returns

    +

    Returns +

    character the variable names

    -


    -

    Method get_filterable_varnames()

    +
    +

    +
    +
    +

    Method get_filterable_varnames() +

    Gets variable names for the filtering.

    It takes the intersection of the column names of the data and private$filterable_varnames if -private$filterable_varnames has positive length

    -

    Usage

    -

    FilteredDataset$get_filterable_varnames()

    +private$filterable_varnames has positive length

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_filterable_varnames()
    +

    +
    -

    Returns

    +

    Returns +

    (character vector) of variable names

    -


    -

    Method set_filterable_varnames()

    -

    Set the allowed filterable variables

    -

    Usage

    -

    FilteredDataset$set_filterable_varnames(varnames)

    +
    +

    +
    +
    +

    Method set_filterable_varnames() +

    +

    Set the allowed filterable variables

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$set_filterable_varnames(varnames)
    +

    +
    -

    Arguments

    -

    varnames
    +

    Arguments +

    +

    +
    +
    +
    varnames

    (character or NULL) The variables which can be filtered See self$get_filterable_varnames for more details

    -

    +
    +

    +
    -

    Details

    +

    Details +

    When retrieving the filtered variables only those which have filtering supported (i.e. are of the permitted types) are included.

    -

    Returns

    +

    Returns +

    invisibly this FilteredDataset

    -


    -

    Method ui()

    +
    +

    +
    +
    +

    Method ui() +

    UI module for dataset active filters

    UI module containing dataset active filters along with -title and remove button.

    -

    Usage

    -

    FilteredDataset$ui(id)

    +title and remove button.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$ui(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    identifier of the element - preferably containing dataset name

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    function - shiny UI module

    -


    -

    Method server()

    +
    +

    +
    +
    +

    Method server() +

    Server module for a dataset active filters

    -

    Server module managing a active filters.

    -

    Usage

    -

    FilteredDataset$server(id)

    +

    Server module managing a active filters.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$server(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    an ID string that corresponds with the ID used to call the module's UI function.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    moduleServer function which returns NULL

    -


    -

    Method ui_add_filter_state()

    +
    +

    +
    +
    +

    Method ui_add_filter_state() +

    UI module to add filter variable for this dataset

    -

    UI module to add filter variable for this dataset

    -

    Usage

    -

    FilteredDataset$ui_add_filter_state(id)

    +

    UI module to add filter variable for this dataset

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$ui_add_filter_state(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    identifier of the element - preferably containing dataset name

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    function - shiny UI module

    -


    -

    Method srv_add_filter_state()

    +
    +

    +
    +
    +

    Method srv_add_filter_state() +

    Server module to add filter variable for this dataset

    -

    Server module to add filter variable for this dataset

    -

    Usage

    -

    FilteredDataset$srv_add_filter_state(id, ...)

    +

    Server module to add filter variable for this dataset

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$srv_add_filter_state(id, ...)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    an ID string that corresponds with the ID used to call the module's UI function.

    @@ -500,27 +808,46 @@

    Arguments -

    Returns

    +

    Returns +

    moduleServer function.

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    FilteredDataset$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -528,17 +855,19 @@

    Arguments

    + +
    + +
    - - + + diff --git a/v0.2.0/reference/LogicalFilterState.html b/v0.2.0/reference/LogicalFilterState.html index 650446c4c..ca628d490 100644 --- a/v0.2.0/reference/LogicalFilterState.html +++ b/v0.2.0/reference/LogicalFilterState.html @@ -1,10 +1,26 @@ - -FilterState object for logical variable — LogicalFilterState • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + + -
    + +
    @@ -79,34 +102,43 @@
    -

    Value

    +

    Value +

    invisibly NULL.

    -

    Note

    +

    Note +

    Casts the passed object to logical before validating the input making it possible to pass any object coercible to logical to this method.

    -

    Super class

    +

    Super class +

    teal.slice::FilterState -> LogicalFilterState

    +

    Inherited methods


    -

    Method new()

    -

    Initialize a FilterState object

    -

    Usage

    -

    LogicalFilterState$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterState object

    +
    +

    Usage +

    +

    +
    +
    LogicalFilterState$new(
       x,
       varname,
       varlabel = character(0),
       input_dataname = NULL,
       extract_type = character(0)
    -)

    +)
    +

    +
    -


    -

    Method is_any_filtered()

    -

    Answers the question of whether the current settings and values selected actually filters out any values.

    -

    Usage

    -

    LogicalFilterState$is_any_filtered()

    +
    +

    +
    +
    +

    Method is_any_filtered() +

    +

    Answers the question of whether the current settings and values selected actually filters out any values.

    +
    +

    Usage +

    +

    +
    +
    LogicalFilterState$is_any_filtered()
    +

    +
    -

    Returns

    +

    Returns +

    logical scalar

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection. For LogicalFilterState it's a !<varname> or <varname> and optionally -is.na(<varname>)

    -

    Usage

    -

    LogicalFilterState$get_call()

    +is.na(<varname>)

    +
    +

    Usage +

    +

    +
    +
    LogicalFilterState$get_call()
    +

    +
    -


    -

    Method ui()

    +
    +

    +
    +
    +

    Method ui() +

    UI Module for EmptyFilterState. This UI element contains available choices selection and -checkbox whether to keep or not keep the NA values.

    -

    Usage

    -

    LogicalFilterState$ui(id)

    +checkbox whether to keep or not keep the NA values.

    +
    +

    Usage +

    +

    +
    +
    LogicalFilterState$ui(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    id of shiny element

    -

    +
    +

    +
    -


    -

    Method server()

    -

    Server module

    -

    Usage

    -

    LogicalFilterState$server(id)

    +
    +

    +
    +
    +

    Method server() +

    +

    Server module

    +
    +

    Usage +

    +

    +
    +
    LogicalFilterState$server(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    an ID string that corresponds with the ID used to call the module's UI function.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    moduleServer function which returns NULL

    -


    -

    Method set_selected()

    -

    Sets the selected values of this LogicalFilterState.

    -

    Usage

    -

    LogicalFilterState$set_selected(value)

    +
    +

    +
    +
    +

    Method set_selected() +

    +

    Sets the selected values of this LogicalFilterState.

    +
    +

    Usage +

    +

    +
    +
    LogicalFilterState$set_selected(value)
    +

    +
    -

    Arguments

    -

    value
    +

    Arguments +

    +

    +
    +
    +
    value

    (logical(1))
    the value to set. Must not contain the NA value.

    -

    +
    +

    +
    -

    Examples

    -

    filter <- teal.slice:::LogicalFilterState$new(c(TRUE), varname = "name")
    -filter$set_selected(TRUE)

    +

    Examples +

    +

    +
    +
    filter <- teal.slice:::LogicalFilterState$new(c(TRUE), varname = "name")
    +filter$set_selected(TRUE)
    +

    +
    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    LogicalFilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    LogicalFilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -273,7 +415,8 @@

    Arguments -

    Examples

    +

    Examples +

    filter_state <- teal.slice:::LogicalFilterState$new(
       sample(c(TRUE, FALSE, NA), 10, replace = TRUE),
       varname = "x",
    @@ -297,17 +440,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.2.0/reference/MAEFilterStates.html b/v0.2.0/reference/MAEFilterStates.html index a93fb5bf9..08bcd8f49 100644 --- a/v0.2.0/reference/MAEFilterStates.html +++ b/v0.2.0/reference/MAEFilterStates.html @@ -1,8 +1,24 @@ - -MAEFilterStates — MAEFilterStates • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + + -
    + +
    @@ -76,16 +98,20 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterStates -> MAEFilterStates

    +

    Inherited methods


    -

    Method new()

    +

    +
    +
    +

    Method new() +

    Initializes MAEFilterStates object

    -

    Initialize MAEFilterStates object

    -

    Usage

    -

    MAEFilterStates$new(
    +

    Initialize MAEFilterStates object

    +
    +

    Usage +

    +

    +
    +
    MAEFilterStates$new(
       input_dataname,
       output_dataname,
       datalabel,
       varlabels,
       keys
    -)

    +)
    +

    +
    -

    Arguments

    -

    input_dataname
    +

    Arguments +

    +

    +
    +
    +
    input_dataname

    (character(1) or name or call)
    name of the data used on lhs of the expression specified to the function argument attached to this FilterStates.

    @@ -146,87 +188,159 @@

    Arguments
    -

    Method format()

    -

    Returns the formatted string representing this MAEFilterStates object.

    -

    Usage

    -

    MAEFilterStates$format(indent = 0)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns the formatted string representing this MAEFilterStates object.

    +
    +

    Usage +

    +

    +
    +
    MAEFilterStates$format(indent = 0)
    +

    +
    -

    Arguments

    -

    indent
    +

    Arguments +

    +

    +
    +
    +
    indent

    (numeric(1)) the number of spaces before each line of the representation

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    character(1) the formatted string

    -


    -

    Method get_fun()

    +
    +

    +
    +
    +

    Method get_fun() +

    Returns function name used to create filter call. -For MAEFilterStates MultiAssayExperiment::subsetByColData is used.

    -

    Usage

    -

    MAEFilterStates$get_fun()

    +For MAEFilterStates MultiAssayExperiment::subsetByColData is used.

    +
    +

    Usage +

    +

    +
    +
    MAEFilterStates$get_fun()
    +

    +
    -

    Returns

    +

    Returns +

    character(1)

    -


    -

    Method server()

    -

    Server module

    -

    Usage

    -

    MAEFilterStates$server(id)

    +
    +

    +
    +
    +

    Method server() +

    +

    Server module

    +
    +

    Usage +

    +

    +
    +
    MAEFilterStates$server(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    an ID string that corresponds with the ID used to call the module's UI function.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    moduleServer function which returns NULL

    -


    +

    +
    +
    +

    Method get_filter_state() +

    Returns active FilterState objects.

    Gets all active filters from this dataset in form of the nested list. -The output list can be used as input to self$set_filter_state.

    -

    Usage

    -

    MAEFilterStates$get_filter_state()

    +The output list can be used as input to self$set_filter_state.

    +
    +

    Usage +

    +

    +
    +
    MAEFilterStates$get_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    list with elements number equal number of FilterStates.

    -


    -

    Method set_filter_state()

    -

    Set filter state

    -

    Usage

    -

    MAEFilterStates$set_filter_state(data, state, ...)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Set filter state

    +
    +

    Usage +

    +

    +
    +
    MAEFilterStates$set_filter_state(data, state, ...)
    +

    +
    -

    Arguments

    -

    data
    +

    Arguments +

    +

    +
    +
    +
    data

    (MultiAssayExperiment)
    data which are supposed to be filtered.

    @@ -242,43 +356,77 @@

    Arguments -

    Returns

    +

    Returns +

    NULL

    -


    -

    Method remove_filter_state()

    -

    Removes a variable from the ReactiveQueue and its corresponding UI element.

    -

    Usage

    -

    MAEFilterStates$remove_filter_state(element_id)

    +
    +

    +
    +
    +

    Method remove_filter_state() +

    +

    Removes a variable from the ReactiveQueue and its corresponding UI element.

    +
    +

    Usage +

    +

    +
    +
    MAEFilterStates$remove_filter_state(element_id)
    +

    +
    -

    Arguments

    -

    element_id
    +

    Arguments +

    +

    +
    +
    +
    element_id

    (character(1))
    name of ReactiveQueue element.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL

    -


    -

    Method ui_add_filter_state()

    -

    Shiny UI module to add filter variable

    -

    Usage

    -

    MAEFilterStates$ui_add_filter_state(id, data)

    +
    +

    +
    +
    +

    Method ui_add_filter_state() +

    +

    Shiny UI module to add filter variable

    +
    +

    Usage +

    +

    +
    +
    MAEFilterStates$ui_add_filter_state(id, data)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    id of shiny module

    @@ -289,26 +437,43 @@

    Arguments -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_add_filter_state()

    +
    +

    +
    +
    +

    Method srv_add_filter_state() +

    Shiny server module to add filter variable.

    Module controls available choices to select as a filter variable. Selected filter variable is being removed from available choices. -Removed filter variable gets back to available choices.

    -

    Usage

    -

    MAEFilterStates$srv_add_filter_state(id, data, ...)

    +Removed filter variable gets back to available choices.

    +
    +

    Usage +

    +

    +
    +
    MAEFilterStates$srv_add_filter_state(id, data, ...)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    an ID string that corresponds with the ID used to call the module's UI function.

    @@ -323,10 +488,13 @@

    Arguments -

    Returns

    +

    Returns +

    moduleServer function which returns NULL description Get label of specific variable. In case when variable label is missing @@ -336,20 +504,36 @@

    Returns
    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    MAEFilterStates$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    MAEFilterStates$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -357,17 +541,19 @@

    Arguments

    + +

    + +
    - - + + diff --git a/v0.2.0/reference/MAEFilteredDataset.html b/v0.2.0/reference/MAEFilteredDataset.html index 3f00d1327..e3d8e7411 100644 --- a/v0.2.0/reference/MAEFilteredDataset.html +++ b/v0.2.0/reference/MAEFilteredDataset.html @@ -1,10 +1,26 @@ - -MAEFilteredDataset R6 class — MAEFilteredDataset • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + + -
    + +
    @@ -79,16 +102,20 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilteredDataset -> MAEFilteredDataset

    +

    Inherited methods


    -

    Method new()

    -

    Initialize MAEFilteredDataset object

    -

    Usage

    -

    MAEFilteredDataset$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize MAEFilteredDataset object

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$new(
       dataset,
       dataname,
       keys = character(0),
       label = character(0),
       metadata = NULL
    -)

    +)
    +

    +
    -

    Arguments

    -

    dataset
    +

    Arguments +

    +

    +
    +
    +
    dataset

    (MulitiAssayExperiment)
    single MultiAssayExperiment for which filters are rendered

    @@ -154,98 +197,172 @@

    Arguments
    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Get filter expression

    This functions returns filter calls equivalent to selected items within each of filter_states. Configuration of the calls is constant and depends on filter_states type and order which are set during initialization. -This class contains multiple FilterStates:

    • colData(dataset)for this object single MAEFilterStates +This class contains multiple FilterStates:

      +
        +
      • colData(dataset)for this object single MAEFilterStates which returns subsetByColData call

      • experimentsfor each experiment single SEFilterStates and FilterStates_matrix, both returns subset call

      • -
      -

      Usage

      -

      MAEFilteredDataset$get_call()

      +
    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$get_call()
    +

    +
    -

    Returns

    +

    Returns +

    filter call or list of filter calls

    -


    -

    Method get_varlabels()

    +
    +

    +
    +
    +

    Method get_varlabels() +

    Gets labels of variables in the data

    Variables are the column names of the data. Either, all labels must have been provided for all variables -in set_data or NULL.

    -

    Usage

    -

    MAEFilteredDataset$get_varlabels(variables = NULL)

    +in set_data or NULL.

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$get_varlabels(variables = NULL)
    +

    +
    -

    Arguments

    -

    variables
    +

    Arguments +

    +

    +
    +
    +
    variables

    (character vector) variables to get labels for; if NULL, for all variables in data

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (character or NULL) variable labels, NULL if column_labels attribute does not exist for the data

    -


    -

    Method get_filter_overview_info()

    -

    Get filter overview rows of a dataset

    -

    Usage

    -

    MAEFilteredDataset$get_filter_overview_info(
    +
    +

    +
    +
    +

    Method get_filter_overview_info() +

    +

    Get filter overview rows of a dataset

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$get_filter_overview_info(
       filtered_dataset = self$get_dataset()
    -)

    +)
    +

    +
    -

    Arguments

    -

    filtered_dataset
    +

    Arguments +

    +

    +
    +
    +
    filtered_dataset

    (MultiAssayExperiment) object to calculate filter overview statistics on.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (matrix) matrix of observations and subjects

    -


    -

    Method get_filterable_varnames()

    -

    Gets variable names for the filtering.

    -

    Usage

    -

    MAEFilteredDataset$get_filterable_varnames()

    +
    +

    +
    +
    +

    Method get_filterable_varnames() +

    +

    Gets variable names for the filtering.

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$get_filterable_varnames()
    +

    +
    -

    Returns

    +

    Returns +

    (character(0))

    -


    -

    Method set_filter_state()

    -

    Set filter state

    -

    Usage

    -

    MAEFilteredDataset$set_filter_state(state, ...)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Set filter state

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$set_filter_state(state, ...)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (named list)
    names of the list should correspond to the names of the initialized FilterStates kept in private$filter_states. For this object they are "subjects" and @@ -257,15 +374,21 @@

    Arguments -

    Returns

    +

    Returns +

    NULL

    -

    Examples

    -

    utils::data(miniACC, package = "MultiAssayExperiment")
    +

    Examples +

    +

    +
    +
    utils::data(miniACC, package = "MultiAssayExperiment")
     dataset <- teal.slice:::MAEFilteredDataset$new(miniACC, "MAE")
     fs <- list(
       subjects = list(
    @@ -278,68 +401,118 @@ 

    Examples ) ) dataset$set_filter_state(state = fs) -shiny::isolate(dataset$get_filter_state())

    +shiny::isolate(dataset$get_filter_state())
    +

    +
    -


    -

    Method remove_filter_state()

    -

    Remove one or more FilterState of a MAEFilteredDataset

    -

    Usage

    -

    MAEFilteredDataset$remove_filter_state(element_id)

    +
    +

    +
    +
    +

    Method remove_filter_state() +

    +

    Remove one or more FilterState of a MAEFilteredDataset

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$remove_filter_state(element_id)
    +

    +
    -

    Arguments

    -

    element_id
    +

    Arguments +

    +

    +
    +
    +
    element_id

    (list)
    Named list of variables to remove their FilterState.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL

    -


    -

    Method ui_add_filter_state()

    +
    +

    +
    +
    +

    Method ui_add_filter_state() +

    UI module to add filter variable for this dataset

    -

    UI module to add filter variable for this dataset

    -

    Usage

    -

    MAEFilteredDataset$ui_add_filter_state(id)

    +

    UI module to add filter variable for this dataset

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$ui_add_filter_state(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    identifier of the element - preferably containing dataset name

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    function - shiny UI module

    -


    -

    Method srv_add_filter_state()

    +
    +

    +
    +
    +

    Method srv_add_filter_state() +

    Server module to add filter variable for this dataset

    Server module to add filter variable for this dataset. For this class srv_add_filter_state calls multiple modules of the same name from FilterStates as MAEFilteredDataset contains one FilterStates object for colData and one for each -experiment.

    -

    Usage

    -

    MAEFilteredDataset$srv_add_filter_state(id, ...)

    +experiment.

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$srv_add_filter_state(id, ...)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    an ID string that corresponds with the ID used to call the module's UI function.

    @@ -348,26 +521,43 @@

    Arguments -

    Returns

    +

    Returns +

    moduleServer function which returns NULL

    -


    -

    Method get_filter_overview_nsubjs()

    -

    Gets filter overview subjects number

    -

    Usage

    -

    MAEFilteredDataset$get_filter_overview_nsubjs(
    +
    +

    +
    +
    +

    Method get_filter_overview_nsubjs() +

    +

    Gets filter overview subjects number

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$get_filter_overview_nsubjs(
       filtered_dataset = self$get_dataset(),
       subject_keys
    -)

    +)
    +

    +
    -

    Arguments

    -

    filtered_dataset
    +

    Arguments +

    +

    +
    +
    +
    filtered_dataset

    (MultiAssayExperiment) object to calculate filter overview statistics on.

    @@ -375,27 +565,46 @@

    Arguments -

    Returns

    +

    Returns +

    list with the number of subjects of filtered/non-filtered datasets.

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    MAEFilteredDataset$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -403,7 +612,8 @@

    Arguments -

    Examples

    +

    Examples +

    
     ## ------------------------------------------------
     ## Method `MAEFilteredDataset$set_filter_state`
    @@ -468,17 +678,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.2.0/reference/MatrixFilterStates.html b/v0.2.0/reference/MatrixFilterStates.html index a22c67ab9..ae475946a 100644 --- a/v0.2.0/reference/MatrixFilterStates.html +++ b/v0.2.0/reference/MatrixFilterStates.html @@ -1,8 +1,24 @@ - -MatrixFilterStates — MatrixFilterStates • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + + -
    + +
    @@ -76,16 +98,20 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterStates -> MatrixFilterStates

    +

    Inherited methods


    -

    Method new()

    +

    +
    +
    +

    Method new() +

    +

    Initialize MatrixFilterStates object

    Initialize MatrixFilterStates object

    -

    Initialize MatrixFilterStates object

    -

    Usage

    -

    MatrixFilterStates$new(input_dataname, output_dataname, datalabel)

    +
    +

    Usage +

    +

    +
    +
    MatrixFilterStates$new(input_dataname, output_dataname, datalabel)
    +

    +
    -

    Arguments

    -

    input_dataname
    +

    Arguments +

    +

    +
    +
    +
    input_dataname

    (character(1) or name or call)
    name of the data used on lhs of the expression specified to the function argument attached to this FilterStates.

    @@ -130,74 +172,135 @@

    Arguments
    -

    Method format()

    -

    Returns the formatted string representing this MatrixFilterStates object.

    -

    Usage

    -

    MatrixFilterStates$format(indent = 0)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns the formatted string representing this MatrixFilterStates object.

    +
    +

    Usage +

    +

    +
    +
    MatrixFilterStates$format(indent = 0)
    +

    +
    -

    Arguments

    -

    indent
    +

    Arguments +

    +

    +
    +
    +
    indent

    (numeric(1)) the number of spaces before each line of the representation

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    character(1) the formatted string

    -


    -

    Method server()

    -

    Server module

    -

    Usage

    -

    MatrixFilterStates$server(id)

    +
    +

    +
    +
    +

    Method server() +

    +

    Server module

    +
    +

    Usage +

    +

    +
    +
    MatrixFilterStates$server(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    an ID string that corresponds with the ID used to call the module's UI function.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    moduleServer function which returns NULL

    -


    +

    +
    +
    +

    Method get_filter_state() +

    Returns active FilterState objects.

    Gets all active filters from this dataset in form of the nested list. -The output list can be used as input to self$set_filter_state.

    -

    Usage

    -

    MatrixFilterStates$get_filter_state()

    +The output list can be used as input to self$set_filter_state.

    +
    +

    Usage +

    +

    +
    +
    MatrixFilterStates$get_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    list containing list with selected values for each FilterState.

    -


    -

    Method set_filter_state()

    -

    Sets a filter state

    -

    Usage

    -

    MatrixFilterStates$set_filter_state(data, state, ...)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Sets a filter state

    +
    +

    Usage +

    +

    +
    +
    MatrixFilterStates$set_filter_state(data, state, ...)
    +

    +
    -

    Arguments

    -

    data
    +

    Arguments +

    +

    +
    +
    +
    data

    (matrix)
    data which are supposed to be filtered.

    @@ -213,43 +316,77 @@

    Arguments -

    Returns

    +

    Returns +

    NULL

    -


    -

    Method remove_filter_state()

    -

    Remove a variable from the ReactiveQueue and its corresponding UI element.

    -

    Usage

    -

    MatrixFilterStates$remove_filter_state(element_id)

    +
    +

    +
    +
    +

    Method remove_filter_state() +

    +

    Remove a variable from the ReactiveQueue and its corresponding UI element.

    +
    +

    Usage +

    +

    +
    +
    MatrixFilterStates$remove_filter_state(element_id)
    +

    +
    -

    Arguments

    -

    element_id
    +

    Arguments +

    +

    +
    +
    +
    element_id

    (character(1))
    name of ReactiveQueue element.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL

    -


    -

    Method ui_add_filter_state()

    -

    Shiny UI module to add filter variable

    -

    Usage

    -

    MatrixFilterStates$ui_add_filter_state(id, data)

    +
    +

    +
    +
    +

    Method ui_add_filter_state() +

    +

    Shiny UI module to add filter variable

    +
    +

    Usage +

    +

    +
    +
    MatrixFilterStates$ui_add_filter_state(id, data)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    id of shiny module

    @@ -259,26 +396,43 @@

    Arguments -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_add_filter_state()

    +
    +

    +
    +
    +

    Method srv_add_filter_state() +

    Shiny server module to add filter variable

    Module controls available choices to select as a filter variable. Selected filter variable is being removed from available choices. -Removed filter variable gets back to available choices.

    -

    Usage

    -

    MatrixFilterStates$srv_add_filter_state(id, data, ...)

    +Removed filter variable gets back to available choices.

    +
    +

    Usage +

    +

    +
    +
    MatrixFilterStates$srv_add_filter_state(id, data, ...)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    an ID string that corresponds with the ID used to call the module's UI function.

    @@ -292,27 +446,46 @@

    Arguments -

    Returns

    +

    Returns +

    moduleServer function which returns NULL

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    MatrixFilterStates$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    MatrixFilterStates$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -320,17 +493,19 @@

    Arguments

    + +
    + +
    - - + + diff --git a/v0.2.0/reference/Queue.html b/v0.2.0/reference/Queue.html index 09139884b..7f80d735c 100644 --- a/v0.2.0/reference/Queue.html +++ b/v0.2.0/reference/Queue.html @@ -1,12 +1,28 @@ - - + + + + + +R6 Class - A First-In-First-Out Abstract Data Type — Queue • teal.slice +R6 Class - A First-In-First-Out Abstract Data Type — Queue • teal.slice + + + + + + + + + + Skip to contents @@ -22,7 +38,8 @@ + + + -
    + +
    @@ -82,12 +104,15 @@
    -

    Methods

    +

    Methods +

    -

    Public methods

    +

    Public methods +

    -


    -

    Method push()

    -

    Adds another element to this queue.

    -

    Usage

    -

    Queue$push(new_elements)

    + +
    +

    +
    +
    +

    Method push() +

    +

    Adds another element to this queue.

    +
    +

    Usage +

    +

    +
    +
    Queue$push(new_elements)
    +

    +
    -

    Arguments

    -

    new_elements
    +

    Arguments +

    +

    +
    +
    +
    new_elements

    the elements to be added to this queue

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    invisibly self

    -


    -

    Method pop()

    +
    +

    +
    +
    +

    Method pop() +

    Returns the first added element to this queue and removes it -from this queue.

    -

    Usage

    -

    Queue$pop()

    +from this queue.

    +
    +

    Usage +

    +

    +
    +
    Queue$pop()
    +

    +
    -

    Returns

    +

    Returns +

    the first added element to this queue or NULL if this queue is empty

    -


    -

    Method empty()

    -

    Removes all elements from this queue.

    -

    Usage

    -

    Queue$empty()

    +
    +

    +
    +
    +

    Method empty() +

    +

    Removes all elements from this queue.

    +
    +

    Usage +

    +

    +
    +
    Queue$empty()
    +

    +
    -

    Returns

    +

    Returns +

    invisibly self

    -


    -

    Method size()

    -

    Returns the number of elements in this queue.

    -

    Usage

    -

    Queue$size()

    +
    +

    +
    +
    +

    Method size() +

    +

    Returns the number of elements in this queue.

    +
    +

    Usage +

    +

    +
    +
    Queue$size()
    +

    +
    -

    Returns

    +

    Returns +

    the number of elements in this queue

    -


    -

    Method get()

    +
    +

    +
    +
    +

    Method get() +

    Returns an array of elements in this queue. The order of elements is chronological: -the first elements in the returned array is the oldest element added to this queue.

    -

    Usage

    -

    Queue$get(reversed = FALSE)

    +the first elements in the returned array is the oldest element added to this queue.

    +
    +

    Usage +

    +

    +
    +
    Queue$get(reversed = FALSE)
    +

    +
    -

    Arguments

    -

    reversed
    +

    Arguments +

    +

    +
    +
    +
    reversed

    (logical)
    if TRUE then returns the First-In-First-Out order; otherwise returns the Last-In-First-Out order. Default: FALSE

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    the array of elements in this queue

    -


    -

    Method remove()

    +
    +

    +
    +
    +

    Method remove() +

    Removes the eldest occurrence of elements from this queue. Relies on implicit -conversions of R types to compare a removed element with elements in this queue.

    -

    Usage

    -

    Queue$remove(elements)

    +conversions of R types to compare a removed element with elements in this queue.

    +
    +

    Usage +

    +

    +
    +
    Queue$remove(elements)
    +

    +
    -

    Arguments

    -

    elements
    +

    Arguments +

    +

    +
    +
    +
    elements

    the elements to remove from this queue

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    invisibly self

    -


    -

    Method print()

    -

    Prints this queue.

    -

    Usage

    -

    Queue$print(...)

    +
    +

    +
    +
    +

    Method print() +

    +

    Prints this queue.

    +
    +

    Usage +

    +

    +
    +
    Queue$print(...)
    +

    +
    -

    Arguments

    -

    ...
    +

    Arguments +

    +

    +
    +
    +
    ...

    the additional arguments to this method, ignored

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    invisibly self

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    Queue$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    Queue$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -237,17 +380,19 @@

    Arguments

    + +
    + +
    - - + + diff --git a/v0.2.0/reference/RangeFilterState.html b/v0.2.0/reference/RangeFilterState.html index a93e39964..42b4e3a67 100644 --- a/v0.2.0/reference/RangeFilterState.html +++ b/v0.2.0/reference/RangeFilterState.html @@ -1,10 +1,26 @@ - -FilterState object for numeric variable — RangeFilterState • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + + -
    + +
    @@ -79,7 +102,8 @@
    -

    Value

    +

    Value +

    invisibly NULL

    @@ -87,21 +111,26 @@

    Value

    -

    Note

    +

    Note +

    Casts the passed object to numeric before validating the input making it possible to pass any object coercible to numeric to this method.

    -

    Super class

    +

    Super class +

    teal.slice::FilterState -> RangeFilterState

    +

    Inherited methods


    -

    Method new()

    -

    Initialize a FilterState object

    -

    Usage

    -

    RangeFilterState$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterState object

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$new(
       x,
       varname,
       varlabel = character(0),
       input_dataname = NULL,
       extract_type = character(0)
    -)

    +)
    +

    +
    -


    -

    Method format()

    -

    Returns a formatted string representing this LogicalFilterState.

    -

    Usage

    -

    RangeFilterState$format(indent = 0)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns a formatted string representing this LogicalFilterState.

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$format(indent = 0)
    +

    +
    -

    Arguments

    -

    indent
    +

    Arguments +

    +

    +
    +
    +
    indent

    (numeric(1)) the number of spaces before after each new line character of the formatted string. Default: 0

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    character(1) the formatted string

    -


    -

    Method is_any_filtered()

    -

    Answers the question of whether the current settings and values selected actually filters out any values.

    -

    Usage

    -

    RangeFilterState$is_any_filtered()

    +
    +

    +
    +
    +

    Method is_any_filtered() +

    +

    Answers the question of whether the current settings and values selected actually filters out any values.

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$is_any_filtered()
    +

    +
    -

    Returns

    +

    Returns +

    logical scalar

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection. For this class returned call looks like <varname> >= <min value> & <varname> <= <max value> with -optional is.na(<varname>) and is.finite(<varname>).

    -

    Usage

    -

    RangeFilterState$get_call()

    +optional is.na(<varname>) and is.finite(<varname>).

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$get_call()
    +

    +
    -

    Returns

    +

    Returns +

    (call)

    -


    -

    Method get_keep_inf()

    -

    Returns current keep_inf selection

    -

    Usage

    -

    RangeFilterState$get_keep_inf()

    +
    +

    +
    +
    +

    Method get_keep_inf() +

    +

    Returns current keep_inf selection

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$get_keep_inf()
    +

    +
    -

    Returns

    +

    Returns +

    (logical(1))

    -


    -

    Method get_state()

    -

    Returns the filtering state.

    -

    Usage

    -

    RangeFilterState$get_state()

    +
    +

    +
    +
    +

    Method get_state() +

    +

    Returns the filtering state.

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$get_state()
    +

    +
    -

    Returns

    -

    list containing values taken from the reactive fields:

    • selected (numeric(2)) range of the filter.

    • +

      Returns +

      +

      list containing values taken from the reactive fields:

      +
        +
      • selected (numeric(2)) range of the filter.

      • keep_na (logical(1)) whether NA should be kept.

      • keep_inf (logical(1)) whether Inf should be kept. UI Module for RangeFilterState. This UI element contains two values for min and max of the range and two checkboxes whether to keep the NA or Inf values.

      • -
    + +
    -


    -

    Method ui()

    +
    +

    +
    +
    +

    Method ui() +

    -

    Usage

    -

    RangeFilterState$ui(id)

    +

    Usage +

    +

    +
    +
    RangeFilterState$ui(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    id of shiny element

    -

    +
    +

    +
    -


    -

    Method server()

    -

    Server module

    -

    Usage

    -

    RangeFilterState$server(id)

    +
    +

    +
    +
    +

    Method server() +

    +

    Server module

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$server(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    an ID string that corresponds with the ID used to call the module's UI function.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    moduleServer function which returns NULL

    -


    -

    Method set_keep_inf()

    -

    Set if Inf should be kept

    -

    Usage

    -

    RangeFilterState$set_keep_inf(value)

    +
    +

    +
    +
    +

    Method set_keep_inf() +

    +

    Set if Inf should be kept

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$set_keep_inf(value)
    +

    +
    -

    Arguments

    -

    value
    +

    Arguments +

    +

    +
    +
    +
    value

    (logical(1))
    Value(s) which come from the filter selection. Value is set in server modules after selecting check-box-input in the shiny interface. Values are set to private$keep_inf which is reactive.

    -

    +
    +

    +
    -


    -

    Method set_keep_inf_reactive()

    -

    Set if Inf should be kept when passing filters using set_filter_state

    -

    Usage

    -

    RangeFilterState$set_keep_inf_reactive(value)

    +
    +

    +
    +
    +

    Method set_keep_inf_reactive() +

    +

    Set if Inf should be kept when passing filters using set_filter_state

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$set_keep_inf_reactive(value)
    +

    +
    -

    Arguments

    -

    value
    +

    Arguments +

    +

    +
    +
    +
    value

    (logical(1))
    Value(s) which come from the filter set by the user. Value is set in server modules after setting the filters using set_filter_state. Values are set to private$keep_inf_reactive which is reactive.

    -

    +
    +

    +
    -


    -

    Method set_state()

    -

    Set state

    -

    Usage

    -

    RangeFilterState$set_state(state)

    +
    +

    +
    +
    +

    Method set_state() +

    +

    Set state

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$set_state(state)
    +

    +
    -

    Arguments

    -

    state
    -

    (list)
    -contains fields relevant for a specific class

    • selected defines initial selection

    • +

      Arguments +

      +

      +
      +
      +
      state
      +
      +

      (list)
      +contains fields relevant for a specific class

      +
        +
      • selected defines initial selection

      • keep_na (logical) defines whether to keep or remove NA values

      • keep_inf (logical) defines whether to keep or remove Inf values

      • -
      +
    +
    -

    +

    +

    +
    -


    -

    Method set_state_reactive()

    -

    Set state when using set_filter_state

    -

    Usage

    -

    RangeFilterState$set_state_reactive(state)

    +
    +

    +
    +
    +

    Method set_state_reactive() +

    +

    Set state when using set_filter_state

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$set_state_reactive(state)
    +

    +
    -

    Arguments

    -

    state
    -

    (list)
    -contains fields relevant for a specific class

    • selected defines initial selection

    • +

      Arguments +

      +

      +
      +
      +
      state
      +
      +

      (list)
      +contains fields relevant for a specific class

      +
        +
      • selected defines initial selection

      • keep_na (logical) defines whether to keep or remove NA values

      • keep_inf (logical) defines whether to keep or remove Inf values

      • -
      +
    +
    -

    +

    +

    +
    -


    -

    Method set_selected()

    -

    Sets the selected values of this RangeFilterState.

    -

    Usage

    -

    RangeFilterState$set_selected(value)

    +
    +

    +
    +
    +

    Method set_selected() +

    +

    Sets the selected values of this RangeFilterState.

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$set_selected(value)
    +

    +
    -

    Arguments

    -

    value
    +

    Arguments +

    +

    +
    +
    +
    value

    (numeric(2)) the two-elements array of the lower and upper bound of the selected range. Must not contain NA values.

    -

    +
    +

    +
    -

    Examples

    -

    filter <- teal.slice:::RangeFilterState$new(c(1, 2, 3, 4), varname = "name")
    +

    Examples +

    +

    +
    +
    filter <- teal.slice:::RangeFilterState$new(c(1, 2, 3, 4), varname = "name")
     filter$set_selected(c(2, 3))
    -

    +
    +

    +
    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    RangeFilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -411,7 +667,8 @@

    Arguments -

    Examples

    +

    Examples +

    filter_state <- teal.slice:::RangeFilterState$new(
       c(NA, Inf, seq(1:10)),
       varname = "x",
    @@ -436,17 +693,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.2.0/reference/ReactiveQueue.html b/v0.2.0/reference/ReactiveQueue.html index 8f452ac25..1271fb690 100644 --- a/v0.2.0/reference/ReactiveQueue.html +++ b/v0.2.0/reference/ReactiveQueue.html @@ -1,10 +1,26 @@ - -Reactive extension of Queue class — ReactiveQueue • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + + -
    + +
    @@ -79,68 +101,117 @@
    -

    Super class

    +

    Super class +

    teal.slice::Queue -> ReactiveQueue

    -

    Methods

    +

    Methods +

    Inherited methods +
    +

    Inherited methods


    -

    Method new()

    -

    Initializes ReactiveQueue by setting empty reactiveVal

    -

    Usage

    -

    +

    +
    +
    +

    Method new() +

    +

    Initializes ReactiveQueue by setting empty reactiveVal

    +
    +

    Usage +

    +

    +
    + +

    +
    -


    -

    Method get()

    -

    Get queue

    -

    Usage

    -

    ReactiveQueue$get(reversed = FALSE)

    +
    +

    +
    +
    +

    Method get() +

    +

    Get queue

    +
    +

    Usage +

    +

    +
    +
    ReactiveQueue$get(reversed = FALSE)
    +

    +
    -

    Arguments

    -

    reversed
    +

    Arguments +

    +

    +
    +
    +
    reversed

    (logical(1))
    whether order of elements in the queue should be reversed. FALSE by default

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    values stored in the queue

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    ReactiveQueue$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    ReactiveQueue$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -148,17 +219,19 @@

    Arguments

    + +
    + +
    - - + + diff --git a/v0.2.0/reference/SEFilterStates.html b/v0.2.0/reference/SEFilterStates.html index c53ef604c..3dfa32e3c 100644 --- a/v0.2.0/reference/SEFilterStates.html +++ b/v0.2.0/reference/SEFilterStates.html @@ -1,8 +1,24 @@ - -SEFilterStates — SEFilterStates • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + + -
    + +
    @@ -76,16 +98,20 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterStates -> SEFilterStates

    +

    Inherited methods


    -

    Method new()

    +

    +
    +
    +

    Method new() +

    +

    Initialize SEFilterStates object

    Initialize SEFilterStates object

    -

    Initialize SEFilterStates object

    -

    Usage

    -

    SEFilterStates$new(input_dataname, output_dataname, datalabel)

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$new(input_dataname, output_dataname, datalabel)
    +

    +
    -

    Arguments

    -

    input_dataname
    +

    Arguments +

    +

    +
    +
    +
    input_dataname

    (character(1) or name or call)
    name of the data used on lhs of the expression specified to the function argument attached to this FilterStates.

    @@ -130,76 +172,137 @@

    Arguments
    -

    Method format()

    -

    Returns the formatted string representing this MAEFilterStates object.

    -

    Usage

    -

    SEFilterStates$format(indent = 0)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns the formatted string representing this MAEFilterStates object.

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$format(indent = 0)
    +

    +
    -

    Arguments

    -

    indent
    +

    Arguments +

    +

    +
    +
    +
    indent

    (numeric(1)) the number of spaces before each line of the representation

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    character(1) the formatted string

    -


    -

    Method server()

    -

    Server module

    -

    Usage

    -

    SEFilterStates$server(id)

    +
    +

    +
    +
    +

    Method server() +

    +

    Server module

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$server(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    an ID string that corresponds with the ID used to call the module's UI function.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    moduleServer function which returns NULL

    -


    +

    +
    +
    +

    Method get_filter_state() +

    Gets the reactive values from the active FilterState objects.

    Gets all active filters from this dataset in form of the nested list. -The output list is a compatible input to self$set_filter_state.

    -

    Usage

    -

    SEFilterStates$get_filter_state()

    +The output list is a compatible input to self$set_filter_state.

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$get_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    list containing one or two lists depending on the number of ReactiveQueue object (I.e. if rowData and colData exist). Each list contains elements number equal to number of active filter variables.

    -


    -

    Method set_filter_state()

    -

    Set filter state

    -

    Usage

    -

    SEFilterStates$set_filter_state(data, state, ...)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Set filter state

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$set_filter_state(data, state, ...)
    +

    +
    -

    Arguments

    -

    data
    +

    Arguments +

    +

    +
    +
    +
    data

    (SummarizedExperiment)
    data which are supposed to be filtered.

    @@ -216,43 +319,77 @@

    Arguments -

    Returns

    +

    Returns +

    NULL

    -


    -

    Method remove_filter_state()

    -

    Remove a variable from the ReactiveQueue and its corresponding UI element.

    -

    Usage

    -

    SEFilterStates$remove_filter_state(element_id)

    +
    +

    +
    +
    +

    Method remove_filter_state() +

    +

    Remove a variable from the ReactiveQueue and its corresponding UI element.

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$remove_filter_state(element_id)
    +

    +
    -

    Arguments

    -

    element_id
    +

    Arguments +

    +

    +
    +
    +
    element_id

    (character(1))
    name of ReactiveQueue element.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL

    -


    -

    Method ui_add_filter_state()

    -

    Shiny UI module to add filter variable

    -

    Usage

    -

    SEFilterStates$ui_add_filter_state(id, data)

    +
    +

    +
    +
    +

    Method ui_add_filter_state() +

    +

    Shiny UI module to add filter variable

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$ui_add_filter_state(id, data)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    id of shiny module

    @@ -264,29 +401,46 @@

    Arguments -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_add_filter_state()

    +
    +

    +
    +
    +

    Method srv_add_filter_state() +

    Shiny server module to add filter variable

    Module controls available choices to select as a filter variable. Selected filter variable is being removed from available choices. Removed filter variable gets back to available choices. This module unlike other FilterStates classes manages two sets of filter variables - one for colData and another for -rowData.

    -

    Usage

    -

    SEFilterStates$srv_add_filter_state(id, data, ...)

    +rowData.

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$srv_add_filter_state(id, data, ...)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    an ID string that corresponds with the ID used to call the module's UI function.

    @@ -302,27 +456,46 @@

    Arguments -

    Returns

    +

    Returns +

    moduleServer function which returns NULL

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    SEFilterStates$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -330,17 +503,19 @@

    Arguments

    + +
    + +
    - - + + diff --git a/v0.2.0/reference/call_check_parse_varname.html b/v0.2.0/reference/call_check_parse_varname.html index 4ec691beb..72f1a3d54 100644 --- a/v0.2.0/reference/call_check_parse_varname.html +++ b/v0.2.0/reference/call_check_parse_varname.html @@ -1,8 +1,24 @@ - -Checks varname argument and convert to call — call_check_parse_varname • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + + -
    + +
    @@ -75,30 +97,36 @@
    -

    Usage

    +

    Usage +

    call_check_parse_varname(varname)
    -

    Arguments

    -
    varname
    +

    Arguments +

    +
    +
    varname

    (name, call or character(1))
    name of the variable

    -
    +

    +

    + +
    + +
    - - + + diff --git a/v0.2.0/reference/call_condition_choice.html b/v0.2.0/reference/call_condition_choice.html index 8ea5c3fd9..ce8c53d27 100644 --- a/v0.2.0/reference/call_condition_choice.html +++ b/v0.2.0/reference/call_condition_choice.html @@ -1,8 +1,24 @@ - -Choices condition call — call_condition_choice • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + + -
    + +
    @@ -75,32 +97,41 @@
    -

    Usage

    +

    Usage +

    call_condition_choice(varname, choices)
    -

    Arguments

    -
    varname
    +

    Arguments +

    +
    +
    varname

    (name, call or character(1))
    name of the variable

    choices
    -

    (vector)
    varname values to match using the == (single value) or +

    +

    (vector)
    varname values to match using the == (single value) or %in% (vector) condition. choices can be vector of any type -but for some output might be converted:

    • factor call is composed on choices converted to character

    • +but for some output might be converted:

      +
        +
      • factor call is composed on choices converted to character

      • Date call is composed on choices converted to character using format(choices)

      • POSIXct, POSIXlt Call is composed on choices converted to character using format(choices). One has to be careful here as formatted date-time variable might loose some precision (see format argument in format.POSIXlt) and output call could be insufficient for exact comparison. In this case one should specify varname = trunc(<varname>) and possibly convert choices to character)

      • -
    + + -
    +

    +
    -

    Value

    +

    Value +

    a call

    @@ -109,7 +140,8 @@

    Value

    -

    Examples

    +

    Examples +

    teal.slice:::call_condition_choice("SEX", choices = c(1, 2))
     #> SEX %in% c(1, 2)
     teal.slice:::call_condition_choice(as.name("SEX"), choices = "F")
    @@ -125,17 +157,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.2.0/reference/call_condition_logical.html b/v0.2.0/reference/call_condition_logical.html index e8ec471fe..72c57d880 100644 --- a/v0.2.0/reference/call_condition_logical.html +++ b/v0.2.0/reference/call_condition_logical.html @@ -1,8 +1,24 @@ - -logical variable condition call — call_condition_logical • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + + -
    + +
    @@ -75,13 +98,16 @@
    -

    Usage

    +

    Usage +

    call_condition_logical(varname, choice)
    -

    Arguments

    -
    varname
    +

    Arguments +

    +
    +
    varname

    (name or character(1))
    name of the variable

    @@ -90,9 +116,11 @@

    Arguments -

    Value

    +

    Value +

    call

    @@ -104,7 +132,8 @@

    Value

    -

    Examples

    +

    Examples +

    teal.slice:::call_condition_logical("event", choice = TRUE)
     #> event
     teal.slice:::call_condition_logical("event", choice = FALSE)
    @@ -112,17 +141,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.2.0/reference/call_condition_range.html b/v0.2.0/reference/call_condition_range.html index f21f30de7..d300c6b7a 100644 --- a/v0.2.0/reference/call_condition_range.html +++ b/v0.2.0/reference/call_condition_range.html @@ -1,8 +1,24 @@ - -numeric range condition call — call_condition_range • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + + -
    + +
    @@ -75,13 +98,16 @@
    -

    Usage

    +

    Usage +

    call_condition_range(varname, range)
    -

    Arguments

    -
    varname
    +

    Arguments +

    +
    +
    varname

    (name or character(1))
    name of the variable

    @@ -90,9 +116,11 @@

    Arguments -

    Value

    +

    Value +

    call

    @@ -104,7 +132,8 @@

    Value

    -

    Examples

    +

    Examples +

    teal.slice:::call_condition_range("AGE", range = c(1, 2))
     #> AGE >= 1 & AGE <= 2
     teal.slice:::call_condition_range(as.name("AGE"), range = c(-1.2, 2.1))
    @@ -117,17 +146,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.2.0/reference/call_condition_range_date.html b/v0.2.0/reference/call_condition_range_date.html index ebe9edb70..3a6a96781 100644 --- a/v0.2.0/reference/call_condition_range_date.html +++ b/v0.2.0/reference/call_condition_range_date.html @@ -1,8 +1,24 @@ - -Date range condition call — call_condition_range_date • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + + -
    + +
    @@ -75,13 +98,16 @@
    -

    Usage

    +

    Usage +

    call_condition_range_date(varname, range)
    -

    Arguments

    -
    varname
    +

    Arguments +

    +
    +
    varname

    (name or character(1))
    name of the variable

    @@ -90,9 +116,11 @@

    Arguments -

    Value

    +

    Value +

    a call

    @@ -101,7 +129,8 @@

    Value

    -

    Examples

    +

    Examples +

    teal.slice:::call_condition_range_date(
       as.name("date"),
       range = c(Sys.Date(), Sys.Date() + 1)
    @@ -110,17 +139,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.2.0/reference/call_condition_range_posixct.html b/v0.2.0/reference/call_condition_range_posixct.html index 051271b11..a55a352b3 100644 --- a/v0.2.0/reference/call_condition_range_posixct.html +++ b/v0.2.0/reference/call_condition_range_posixct.html @@ -1,8 +1,24 @@ - -POSIXct range condition call — call_condition_range_posixct • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + + -
    + +
    @@ -75,13 +98,16 @@
    -

    Usage

    +

    Usage +

    call_condition_range_posixct(varname, range, timezone = Sys.timezone())
    -

    Arguments

    -
    varname
    +

    Arguments +

    +
    +
    varname

    (name or character(1))
    name of the variable

    @@ -98,9 +124,11 @@

    ArgumentsSys.timezone() is used.

    -

    +

    +
    -

    Value

    +

    Value +

    a call

    @@ -109,7 +137,8 @@

    Value

    -

    Examples

    +

    Examples +

    teal.slice:::call_condition_range_posixct(
       varname = as.name("datetime"),
       range = c(Sys.time(), Sys.time() + 1),
    @@ -120,17 +149,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.2.0/reference/call_extract_array.html b/v0.2.0/reference/call_extract_array.html index b6f56b146..17cfb194d 100644 --- a/v0.2.0/reference/call_extract_array.html +++ b/v0.2.0/reference/call_extract_array.html @@ -1,8 +1,24 @@ - -Get call to subset and select array — call_extract_array • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + + -
    + +
    @@ -75,13 +97,16 @@
    -

    Usage

    +

    Usage +

    call_extract_array(dataname = ".", row = NULL, column = NULL, aisle = NULL)
    -

    Arguments

    -
    dataname
    +

    Arguments +

    +
    +
    dataname

    (character(1) or name)

    @@ -99,9 +124,11 @@

    Arguments -

    Value

    +

    Value +

    [ call with all conditions included

    @@ -113,7 +140,8 @@

    Value

    -

    Examples

    +

    Examples +

    teal.slice:::call_extract_array(
       dataname = "my_array",
       row = teal.slice:::call_condition_choice("my_array$SEX", "M"),
    @@ -129,17 +157,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.2.0/reference/call_extract_list.html b/v0.2.0/reference/call_extract_list.html index bfe771cc9..659f54bb1 100644 --- a/v0.2.0/reference/call_extract_list.html +++ b/v0.2.0/reference/call_extract_list.html @@ -1,8 +1,24 @@ - -Compose extract call with $ operator — call_extract_list • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + + -

    + +
    @@ -75,13 +97,16 @@
    -

    Usage

    +

    Usage +

    call_extract_list(dataname, varname, dollar = TRUE)
    -

    Arguments

    -
    dataname
    +

    Arguments +

    +
    +
    dataname

    (character(1) or name)
    name of the object

    @@ -95,16 +120,19 @@

    Arguments -

    Value

    +

    Value +

    $ or [[ call

    -

    Examples

    +

    Examples +

    teal.slice:::call_extract_list("ADSL", "SEX")
     #> ADSL$SEX
     teal.slice:::call_extract_list("ADSL", "named element")
    @@ -118,17 +146,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.2.0/reference/call_extract_matrix.html b/v0.2.0/reference/call_extract_matrix.html index 0c572c3b8..1d4b18d1f 100644 --- a/v0.2.0/reference/call_extract_matrix.html +++ b/v0.2.0/reference/call_extract_matrix.html @@ -1,8 +1,24 @@ - -Get call to subset and select matrix — call_extract_matrix • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + + -
    + +

    @@ -75,13 +97,16 @@
    -

    Usage

    +

    Usage +

    call_extract_matrix(dataname = ".", row = NULL, column = NULL)
    -

    Arguments

    -
    dataname
    +

    Arguments +

    +
    +
    dataname

    (character(1) or name)

    @@ -94,9 +119,11 @@

    Arguments -

    Value

    +

    Value +

    [ call with all conditions included

    @@ -108,7 +135,8 @@

    Value

    -

    Examples

    +

    Examples +

    teal.slice:::call_extract_matrix(
       dataname = "my_array",
       row = teal.slice:::call_condition_choice("my_array$SEX", "M"),
    @@ -123,17 +151,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.2.0/reference/call_with_colon.html b/v0.2.0/reference/call_with_colon.html index 13a1b63b6..f79310d64 100644 --- a/v0.2.0/reference/call_with_colon.html +++ b/v0.2.0/reference/call_with_colon.html @@ -1,8 +1,24 @@ - -Create a call using a function in a given namespace — call_with_colon • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + + -
    + +
    @@ -75,13 +97,16 @@
    -

    Usage

    +

    Usage +

    call_with_colon(name, ..., unlist_args = list())
    -

    Arguments

    -
    name
    +

    Arguments +

    +
    +
    name

    character function name, possibly using namespace colon ::, also works with ::: (sometimes needed, but strongly discouraged)

    @@ -94,10 +119,12 @@

    Arguments -

    Examples

    +

    Examples +

    
     print_call_and_eval <- function(x) {
       eval(print(x))
    @@ -138,17 +165,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.2.0/reference/calls_combine_by.html b/v0.2.0/reference/calls_combine_by.html index 23b2f4ef2..3e90cafc2 100644 --- a/v0.2.0/reference/calls_combine_by.html +++ b/v0.2.0/reference/calls_combine_by.html @@ -1,8 +1,24 @@ - -Combine calls by operator — calls_combine_by • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + + -
    + +
    @@ -75,13 +97,16 @@
    -

    Usage

    +

    Usage +

    calls_combine_by(operator, calls)
    -

    Arguments

    -
    operator
    +

    Arguments +

    +
    +
    operator

    (character(1) or name)
    name/symbol of the operator.

    @@ -90,9 +115,11 @@

    Arguments -

    Value

    +

    Value +

    call

    @@ -104,7 +131,8 @@

    Value

    -

    Examples

    +

    Examples +

    teal.slice:::calls_combine_by(
       "&",
       calls = list(
    @@ -118,17 +146,19 @@ 

    Examples

    + +
    + +

    - - + + diff --git a/v0.2.0/reference/check_ellipsis.html b/v0.2.0/reference/check_ellipsis.html index 132b839ee..f7a93c2c9 100644 --- a/v0.2.0/reference/check_ellipsis.html +++ b/v0.2.0/reference/check_ellipsis.html @@ -1,12 +1,28 @@ - - + + + + + +Ensure the ellipsis, ..., in method arguments are empty — check_ellipsis • teal.slice +Ensure the ellipsis, ..., in method arguments are empty — check_ellipsis • teal.slice + + + + + + + + + + Skip to contents @@ -22,7 +38,8 @@ + + + -
    + +
    @@ -81,13 +103,16 @@

    -

    Usage

    +

    Usage +

    check_ellipsis(..., stop = FALSE, allowed_args = character(0))
    -

    Arguments

    -
    ...
    +

    Arguments +

    +
    +
    ...

    it should literally just be ...

    @@ -99,16 +124,19 @@

    Arguments -

    +
    +
    -

    Value

    +

    Value +

    NULL if ... is empty

    -

    Examples

    +

    Examples +

    method.class <- function(a, b, c, ...) {
       check_ellipsis(...)
     }
    @@ -118,17 +146,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.2.0/reference/check_in_range.html b/v0.2.0/reference/check_in_range.html index 8275e0a0b..3604e51fb 100644 --- a/v0.2.0/reference/check_in_range.html +++ b/v0.2.0/reference/check_in_range.html @@ -1,8 +1,24 @@ - -Check that a given range is valid — check_in_range • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + + -
    + +
    @@ -75,13 +97,16 @@
    -

    Usage

    +

    Usage +

    check_in_range(subinterval, range, pre_msg = "")
    -

    Arguments

    -
    subinterval
    +

    Arguments +

    +
    +
    subinterval

    (numeric or date)
    vector of length 2 to be compared against the full range.

    @@ -92,16 +117,19 @@

    Arguments -

    Value

    +

    Value +

    NULL if subinterval is a valid range or error with message otherwise.

    -

    Examples

    +

    Examples +

    if (FALSE) {
     check_in_range(c(3, 1), c(1, 3))
     check_in_range(c(0, 3), c(1, 3))
    @@ -113,17 +141,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.2.0/reference/check_in_subset.html b/v0.2.0/reference/check_in_subset.html index 233173a8b..03ce10c02 100644 --- a/v0.2.0/reference/check_in_subset.html +++ b/v0.2.0/reference/check_in_subset.html @@ -1,8 +1,24 @@ - -Check that one set is a subset of another — check_in_subset • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + + -
    + +

    @@ -75,13 +97,16 @@
    -

    Usage

    +

    Usage +

    check_in_subset(subset, choices, pre_msg = "")
    -

    Arguments

    -
    subset
    +

    Arguments +

    +
    +
    subset

    collection-like should be a subset of the second argument choices

    @@ -92,10 +117,12 @@

    Arguments -

    Examples

    +

    Examples +

    check_in_subset <- teal.slice:::check_in_subset
     check_in_subset(c("a", "b"), c("a", "b", "c"))
     if (FALSE) {
    @@ -106,17 +133,19 @@ 

    Examples

    + +
    + +

    - - + + diff --git a/v0.2.0/reference/check_simple_name.html b/v0.2.0/reference/check_simple_name.html index 0428b7c98..81c39a4ac 100644 --- a/v0.2.0/reference/check_simple_name.html +++ b/v0.2.0/reference/check_simple_name.html @@ -1,14 +1,30 @@ - - + + + + + +Whether the variable name is good to use within Show R Code — check_simple_name • teal.slice +Whether the variable name is good to use within Show R Code — check_simple_name • teal.slice + + + + + + + + + + Skip to contents @@ -24,7 +40,8 @@ + + + -
    + +
    @@ -84,19 +106,24 @@
    -

    Usage

    +

    Usage +

    check_simple_name(name)
    -

    Arguments

    -
    name
    +

    Arguments +

    +
    +
    name

    character, single or vector name to check

    -
    +

    +
    -

    Examples

    +

    Examples +

    teal.slice:::check_simple_name("aas2df")
     teal.slice:::check_simple_name("ADSL")
     teal.slice:::check_simple_name("ADSLmodified")
    @@ -112,17 +139,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.2.0/reference/choices_labeled.html b/v0.2.0/reference/choices_labeled.html index bdf25178d..b3b1fb6b9 100644 --- a/v0.2.0/reference/choices_labeled.html +++ b/v0.2.0/reference/choices_labeled.html @@ -1,10 +1,26 @@ - -Set "<choice>:<label>" type of Names — choices_labeled • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + + -
    + +
    @@ -78,13 +100,16 @@
    -

    Usage

    +

    Usage +

    choices_labeled(choices, labels, subset = NULL, types = NULL)
    -

    Arguments

    -
    choices
    +

    Arguments +

    +
    +
    choices

    a character / numeric / logical vector

    @@ -102,31 +127,36 @@

    Arguments -

    Value

    +

    Value +

    a named character vector

    -

    Details

    +

    Details +

    If either choices or labels are factors, they are coerced to character. Duplicated elements from choices get removed.

    + +
    + +
    - - + + diff --git a/v0.2.0/reference/data_choices_labeled.html b/v0.2.0/reference/data_choices_labeled.html index 8e3707fbf..49d542829 100644 --- a/v0.2.0/reference/data_choices_labeled.html +++ b/v0.2.0/reference/data_choices_labeled.html @@ -1,8 +1,24 @@ - -Returns a choices_labeled object — data_choices_labeled • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + + -
    + +
    @@ -75,7 +97,8 @@
    -

    Usage

    +

    Usage +

    data_choices_labeled(
       data,
       choices,
    @@ -85,8 +108,10 @@ 

    Usage

    -

    Arguments

    -
    data
    +

    Arguments +

    +
    +
    data

    (data.frame, DFrame, list)
    where labels can be taken from in case when varlabels is not specified. data must be specified if varlabels is not specified.

    @@ -106,26 +131,30 @@

    Arguments -

    Value

    +

    Value +

    character(0) if choices are empty; a choices_labeled object otherwise

    + + + + - - + + diff --git a/v0.2.0/reference/filter_state_api.html b/v0.2.0/reference/filter_state_api.html index f8339787c..ee18a0f16 100644 --- a/v0.2.0/reference/filter_state_api.html +++ b/v0.2.0/reference/filter_state_api.html @@ -1,10 +1,26 @@ - -Managing FilteredData states — filter_state_api • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + + - + @@ -78,7 +100,8 @@
    -

    Usage

    +

    Usage +

    set_filter_state(datasets, filter)
     
     get_filter_state(datasets)
    @@ -89,35 +112,56 @@ 

    Usage

    -

    Arguments

    -
    datasets
    +

    Arguments +

    +
    +
    datasets

    (FilteredData)
    object to store filter state and filtered datasets, shared across modules. For more details see FilteredData

    filter
    -

    (list)
    +

    +

    (list)
    You can define filters that show when the app starts. List names should be named according to datanames passed to the data argument. In case of data.frame` the list should be composed as follows:

    -

    list(<dataname1> = list(<varname1> = ..., <varname2> = ...),
    +

    +
    +
    list(<dataname1> = list(<varname1> = ..., <varname2> = ...),
          <dataname2> = list(...),
          ...)
    -

    +
    +

    +

    For example, filters for variable Sepal.Length in iris can be specified as follows:

    -

    list(iris = list(Sepal.Length = list(selected = c(5.0, 7.0))))
    +

    +
    +
    list(iris = list(Sepal.Length = list(selected = c(5.0, 7.0))))
     # or
    -list(iris = list(Sepal.Length = c(5.0, 7.0)))

    +list(iris = list(Sepal.Length = c(5.0, 7.0)))
    +

    +

    In case developer would like to include NA and Inf values in the filtered dataset.

    -

    list(Species = list(selected = c(5.0, 7.0), keep_na = TRUE, keep_inf = TRUE))
    -list(Species = c(c(5.0, 7.0), NA, Inf))

    +

    +
    +
    list(Species = list(selected = c(5.0, 7.0), keep_na = TRUE, keep_inf = TRUE))
    +list(Species = c(c(5.0, 7.0), NA, Inf))
    +

    +

    To initialize with specific variable filter with all values on start, one can use

    -

    list(Species = list())

    -

    filter should be set with respect to the class of the column:

    • numeric: selected should be a two elements vector defining the range +

      +
      +
      list(Species = list())
      +

      +
      +

      filter should be set with respect to the class of the column:

      +
        +
      • numeric: selected should be a two elements vector defining the range of the filter.

      • Date: selected should be a two elements vector defining the date-range of the filter

      • @@ -131,7 +175,10 @@

        ArgumentsMultiAssayExperiment::ExperimentList()), filter list should be named in the following name.

        -

      list(
      +
    +

    +
    +
    list(
       <MAE dataname> = list(
         subjects = list(<column in colData> = ..., <column in colData> = ...),
         <experiment name> = list(
    @@ -141,20 +188,28 @@ 

    Arguments <column in colData of experiment> = ...) ) ) -)

    -

    filter is ignored if the app is restored from a bookmarked state.

    +) +

    +
    +

    filter is ignored if the app is restored from a bookmarked state.

    + -
    + +
    -

    Value

    +

    Value +

    -
    • set, remove and clear returns NULL

    • +
        +
      • set, remove and clear returns NULL

      • get returns named list of the same structure as described in filter argument.

      • -
    + +
    -

    Examples

    +

    Examples +

    utils::data(miniACC, package = "MultiAssayExperiment")
     
     datasets <- init_filtered_data(
    @@ -273,17 +328,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/v0.2.0/reference/get_filter_expr.html b/v0.2.0/reference/get_filter_expr.html index 34c9150e0..5b62da609 100644 --- a/v0.2.0/reference/get_filter_expr.html +++ b/v0.2.0/reference/get_filter_expr.html @@ -1,10 +1,26 @@ - -Gets filter expression for multiple datanames taking into account its order. — get_filter_expr • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + + - + @@ -78,39 +100,46 @@
    -

    Usage

    +

    Usage +

    get_filter_expr(datasets, datanames = datasets$datanames())
    -

    Arguments

    -
    datasets
    +

    Arguments +

    +
    +
    datasets

    (FilteredData)

    datanames

    (character) vector of dataset names

    -
    + +
    -

    Value

    +

    Value +

    (expression)

    + + + + - - + + diff --git a/v0.2.0/reference/get_supported_filter_varnames.html b/v0.2.0/reference/get_supported_filter_varnames.html index 97bf1f40d..c1667deb0 100644 --- a/v0.2.0/reference/get_supported_filter_varnames.html +++ b/v0.2.0/reference/get_supported_filter_varnames.html @@ -1,10 +1,26 @@ - -Gets supported filterable variable names — get_supported_filter_varnames • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + + - + @@ -78,26 +100,32 @@
    -

    Usage

    +

    Usage +

    get_supported_filter_varnames(data)
    -

    Arguments

    -
    data
    +

    Arguments +

    +
    +
    data

    (object)
    the R object containing elements which class can be checked through vapply or apply.

    -
    + +
    -

    Value

    +

    Value +

    character the array of the matched element names

    -

    Examples

    +

    Examples +

    df <- data.frame(
       a = letters[1:3],
       b = 1:3,
    @@ -110,17 +138,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/v0.2.0/reference/get_teal_bs_theme.html b/v0.2.0/reference/get_teal_bs_theme.html index 74f26e372..e20c3a1ab 100644 --- a/v0.2.0/reference/get_teal_bs_theme.html +++ b/v0.2.0/reference/get_teal_bs_theme.html @@ -1,8 +1,24 @@ - -Resolve the expected bootstrap theme — get_teal_bs_theme • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + + - + @@ -75,22 +97,25 @@
    -

    Usage

    +

    Usage +

    get_teal_bs_theme()
    - + + + + - - + + diff --git a/v0.2.0/reference/include_css_files.html b/v0.2.0/reference/include_css_files.html index 119c3f06c..a4b5e3929 100644 --- a/v0.2.0/reference/include_css_files.html +++ b/v0.2.0/reference/include_css_files.html @@ -1,12 +1,28 @@ - - + + + + + +Include CSS files from /inst/css/ package directory to application header — include_css_files • teal.slice +Include CSS files from /inst/css/ package directory to application header — include_css_files • teal.slice + + + + + + + + + + Skip to contents @@ -22,7 +38,8 @@ + + + - + @@ -81,35 +103,42 @@
    -

    Usage

    +

    Usage +

    include_css_files(pattern = "*")
    -

    Arguments

    -
    pattern
    +

    Arguments +

    +
    +
    pattern

    (character) pattern of files to be included

    -
    + +
    -

    Value

    +

    Value +

    HTML code that includes CSS files

    + + + + - - + + diff --git a/v0.2.0/reference/index.html b/v0.2.0/reference/index.html index 914138e5f..a83464a9b 100644 --- a/v0.2.0/reference/index.html +++ b/v0.2.0/reference/index.html @@ -1,8 +1,22 @@ - -Function reference • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + + - + @@ -69,112 +89,153 @@
    -

    Teal filter-panel API

    +

    Teal filter-panel API +

    -

    Functions used initialize filter-panel and to modify its states.

    +

    +

    Functions used initialize filter-panel and to modify its states.

    -
    +
    +
    -
    +
    +
    init_filtered_data()
    -
    Initialize FilteredData
    -
    +
    Initialize FilteredData +
    +
    +
    +
    set_filter_state() get_filter_state() remove_filter_state() clear_filter_states()
    Managing FilteredData states
    -
    -

    Helpers

    + +
    +
    +

    Helpers +

    -

    Other useful functions for users and developers.

    +

    +

    Other useful functions for users and developers.

    -
    +
    +
    -
    +
    +
    choices_labeled()
    Set "<choice>:<label>" type of Names
    -
    +
    +
    +
    get_filter_expr()
    Gets filter expression for multiple datanames taking into account its order.
    -
    -

    For Developers

    + +
    +
    +

    For Developers +

    -

    Abstract and concrete classes used to build teal functionality.

    +

    +

    Abstract and concrete classes used to build teal functionality.

    -
    +
    +
    -

    R6 Classes

    -

    Abstract and concrete classes used to build teal functionality.

    +

    R6 Classes +

    +

    +

    Abstract and concrete classes used to build teal functionality.

    -
    +
    +
    -
    +
    +
    CDISCFilteredData
    Class to encapsulate relational filtered datasets with its parents.
    -
    +
    +
    +
    DefaultFilteredDataset
    The DefaultFilteredDataset R6 class
    -
    +
    +
    +
    FilteredData
    Class to encapsulate filtered datasets
    -
    +
    +
    +
    FilteredDataset
    -
    FilterStates R6 class
    -
    +
    +FilterStates R6 class
    +
    +
    +
    FilterPanelAPI
    Class to encapsulate the API of the filter panel of a teal app
    -
    +
    +
    +
    MAEFilteredDataset
    -
    MAEFilteredDataset R6 class
    -
    +
    +MAEFilteredDataset R6 class
    +
    +
    +
    Queue
    R6 Class - A First-In-First-Out Abstract Data Type
    -
    + + + + + + - - + + diff --git a/v0.2.0/reference/init_filter_state.html b/v0.2.0/reference/init_filter_state.html index 30d8a0d1e..b129123b7 100644 --- a/v0.2.0/reference/init_filter_state.html +++ b/v0.2.0/reference/init_filter_state.html @@ -1,8 +1,24 @@ - -Initializes FilterState — init_filter_state • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + + - +
    @@ -75,7 +98,8 @@
    -

    Usage

    +

    Usage +

    init_filter_state(
       x,
       varname,
    @@ -86,8 +110,10 @@ 

    Usage

    + +
    -

    Value

    +

    Value +

    FilterState object

    -

    Examples

    +

    Examples +

    filter_state <- teal.slice:::RangeFilterState$new(
       c(1:10, NA, Inf),
       varname = "x",
    @@ -157,17 +190,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/v0.2.0/reference/init_filter_states.html b/v0.2.0/reference/init_filter_states.html index 659030e18..ada268d1e 100644 --- a/v0.2.0/reference/init_filter_states.html +++ b/v0.2.0/reference/init_filter_states.html @@ -1,8 +1,24 @@ - -Initialize FilterStates object — init_filter_states • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + + - + @@ -75,7 +97,8 @@
    -

    Usage

    +

    Usage +

    init_filter_states(
       data,
       input_dataname,
    @@ -86,8 +109,10 @@ 

    Usage

    -

    Arguments

    -
    data
    +

    Arguments +

    +
    +
    data

    (data.frame, MultiAssayExperiment, SummarizedExperiment, matrix)
    the R object which subset function is applied on.

    @@ -112,10 +137,12 @@

    Arguments -

    Examples

    +

    Examples +

    df <- data.frame(
       character = letters,
       numeric = seq_along(letters),
    @@ -151,17 +178,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/v0.2.0/reference/init_filtered_data.html b/v0.2.0/reference/init_filtered_data.html index 5e415843e..4a2d53ae5 100644 --- a/v0.2.0/reference/init_filtered_data.html +++ b/v0.2.0/reference/init_filtered_data.html @@ -1,8 +1,24 @@ - -Initialize FilteredData — init_filtered_data • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + + - +
    @@ -75,20 +98,27 @@
    -

    Usage

    +

    Usage +

    init_filtered_data(x, join_keys, code, cdisc, check)
    -

    Arguments

    -
    x
    -

    (named list or TealData) In case of TealData see teal.data::teal_data(). -If the list is provided, it should contain list(s) containing following fields:

    • dataset data object object supported by FilteredDataset.

    • +

      Arguments +

      +
      +
      x
      +
      +

      (named list or TealData) In case of TealData see teal.data::teal_data(). +If the list is provided, it should contain list(s) containing following fields:

      +
        +
      • dataset data object object supported by FilteredDataset.

      • metatada (optional) additional metadata attached to the dataset.

      • keys (optional) primary keys.

      • datalabel (optional) label describing the dataset.

      • parent (optional) which dataset is a parent of this one.

      • -
      +
    +
    join_keys
    @@ -106,10 +136,12 @@

    Arguments -

    Examples

    +

    Examples +

    library(shiny)
     datasets <- teal.slice::init_filtered_data(
       x = list(
    @@ -120,17 +152,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/v0.2.0/reference/init_filtered_dataset.html b/v0.2.0/reference/init_filtered_dataset.html index 6613e4c04..172ef3b19 100644 --- a/v0.2.0/reference/init_filtered_dataset.html +++ b/v0.2.0/reference/init_filtered_dataset.html @@ -1,8 +1,24 @@ - -Initializes FilteredDataset — init_filtered_dataset • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + + - +
    @@ -75,7 +98,8 @@
    -

    Usage

    +

    Usage +

    init_filtered_dataset(
       dataset,
       dataname,
    @@ -86,8 +110,10 @@ 

    Usage

    -

    Arguments

    -
    dataset
    +

    Arguments +

    +
    +
    dataset

    (data.frame or MultiAssayExperiment)

    @@ -111,10 +137,12 @@

    Arguments -

    Examples

    +

    Examples +

    # DefaultFilteredDataset example
     iris_fd <- teal.slice:::init_filtered_dataset(
       iris,
    @@ -177,17 +205,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.2.0/reference/resolve_state.html b/v0.2.0/reference/resolve_state.html index 9cffaaa8c..6acb5fe06 100644 --- a/v0.2.0/reference/resolve_state.html +++ b/v0.2.0/reference/resolve_state.html @@ -1,16 +1,32 @@ - - + + + + + +Resolve list of filter states — resolve_state • teal.slice +Resolve list of filter states — resolve_state • teal.slice + + + + + + + + + + Skip to contents @@ -26,7 +42,8 @@ + + + - + @@ -87,7 +109,8 @@
    -

    Usage

    +

    Usage +

    resolve_state(x)
     
     # S3 method for default
    @@ -101,19 +124,28 @@ 

    Usage

    -

    Arguments

    -
    x
    -

    (list,vector)
    +

    Arguments +

    +
    +
    x
    +
    +

    (list,vector)
    values of the variable used in filter. Depending on the FilterState type -list must contain these fields:

    • selected defines initial selection. See notes for more details

    • +list must contain these fields:

      +
        +
      • selected defines initial selection. See notes for more details

      • keep_na (logical) defines whether to keep or remove NA values

      • keep_inf (logical) defines whether to keep or remove Inf values

      • -

      If vector is provided then keep_na and keep_inf can be specified -adding NA and Inf to the selection vector.

    + +

    If vector is provided then keep_na and keep_inf can be specified +adding NA and Inf to the selection vector.

    +
    -
    + +
    -

    Value

    +

    Value +

    list containing selected, keep_na and keep_inf

    @@ -121,23 +153,28 @@

    Value

    -

    Note

    +

    Note +

    The value of the x$selected needs to be modified according to the type of the passed filter_state.

    -

    Examples

    +

    Examples +

    teal.slice:::resolve_state(list(c(1, 2), keep_na = FALSE, keep_inf = TRUE))
     #> $selected
     #> [1] 1 2
    @@ -160,17 +197,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/v0.2.0/reference/set_state.html b/v0.2.0/reference/set_state.html index af236d3f0..7917780c7 100644 --- a/v0.2.0/reference/set_state.html +++ b/v0.2.0/reference/set_state.html @@ -1,18 +1,34 @@ - -Set state of FilterState — set_state • teal.slice +Set state of FilterState — set_state • teal.slice + + + + + + + + + + Skip to contents @@ -28,7 +44,8 @@ + + + - +
    -

    Set state of FilterState. Function can change states in FilterState in two ways:

    • changing reactive state fields which triggers observers in the FilterState.

    • +

      Set state of FilterState. Function can change states in FilterState in two ways:

      +
        +
      • changing reactive state fields which triggers observers in the FilterState.

      • change state directly.

      • -

      For more, please see section "Modifying state" in FilterState

      +
    +

    For more, please see section "Modifying state" in FilterState

    -

    Usage

    +

    Usage +

    set_state(x, value, is_reactive = shiny::isRunning())
    -

    Arguments

    -
    x
    +

    Arguments +

    +
    +
    x

    (vector)
    values of the variable used in filter

    @@ -103,13 +132,19 @@

    Arguments -

    Value

    +

    Value +

    invisible NULL

    @@ -118,17 +153,19 @@

    Value

    + +
    + + - - + + diff --git a/v0.2.0/reference/teal.slice-package.html b/v0.2.0/reference/teal.slice-package.html index 8eba210c2..bbf7d397a 100644 --- a/v0.2.0/reference/teal.slice-package.html +++ b/v0.2.0/reference/teal.slice-package.html @@ -1,8 +1,24 @@ - -teal.slice: Interactive Exploration of Clinical Trials Data — teal.slice-package • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + + - + @@ -76,28 +98,37 @@
    -

    Author

    +

    Author +

    Maintainer: Dawid Kaledkowski dawid.kaledkowski@roche.com

    -

    Authors:

    + +

    Other contributors:

    +
      +
    • F. Hoffmann-La Roche AG [copyright holder, funder]

    • +
    + - + + + + - - + + diff --git a/v0.2.0/reference/topological_sort.html b/v0.2.0/reference/topological_sort.html index f22ff9887..b30857f61 100644 --- a/v0.2.0/reference/topological_sort.html +++ b/v0.2.0/reference/topological_sort.html @@ -1,10 +1,26 @@ - -Topological graph sort — topological_sort • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + + - + @@ -78,23 +100,29 @@
    -

    Usage

    +

    Usage +

    topological_sort(graph)
    -

    Arguments

    -
    graph
    +

    Arguments +

    +
    +
    graph

    (named list) list with node vector elements

    -
    + +
    -

    Details

    +

    Details +

    Implementation of Kahn algorithm with a modification to maintain the order of input elements.

    -

    Examples

    +

    Examples +

    teal.slice:::topological_sort(list(A = c(), B = c("A"), C = c("B"), D = c("A")))
     #> [[1]]
     #> [1] "A"
    @@ -137,17 +165,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/v0.2.0/reference/validate_dataset_args.html b/v0.2.0/reference/validate_dataset_args.html index a94975d92..b3f8ae591 100644 --- a/v0.2.0/reference/validate_dataset_args.html +++ b/v0.2.0/reference/validate_dataset_args.html @@ -1,8 +1,24 @@ - -Validate dataset arguments — validate_dataset_args • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + + - + @@ -75,13 +97,16 @@
    -

    Usage

    +

    Usage +

    validate_dataset_args(dataset_args, dataname, allowed_parent = FALSE)
    -

    Arguments

    -
    dataset_args
    +

    Arguments +

    +
    +
    dataset_args

    (list)
    containing the arguments except (dataname) needed by init_filtered_dataset

    @@ -96,26 +121,30 @@

    Arguments -

    Value

    +

    Value +

    (NULL or throws an error)

    + + + + - - + + diff --git a/v0.2.0/reference/variable_types.html b/v0.2.0/reference/variable_types.html index 85face7f4..ff266cc0f 100644 --- a/v0.2.0/reference/variable_types.html +++ b/v0.2.0/reference/variable_types.html @@ -1,8 +1,24 @@ - -Get classes of selected columns from dataset — variable_types • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + + - + @@ -75,13 +97,16 @@
    -

    Usage

    +

    Usage +

    variable_types(data, columns = NULL)
    -

    Arguments

    -
    data
    +

    Arguments +

    +
    +
    data

    (data.frame) data to determine variable types from

    @@ -89,9 +114,11 @@

    Arguments -

    Value

    +

    Value +

    (atomic vector of character) classes of columns from provided data

    @@ -100,7 +127,8 @@

    Value

    -

    Examples

    +

    Examples +

    teal.slice:::variable_types(
       data.frame(
         x = 1:3, y = factor(c("a", "b", "a")), z = c("h1", "h2", "h3"),
    @@ -129,17 +157,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/v0.3.0/404.html b/v0.3.0/404.html index 0892298dd..45002bd9c 100644 --- a/v0.3.0/404.html +++ b/v0.3.0/404.html @@ -1,5 +1,4 @@ - - + @@ -49,22 +48,7 @@ - - + - + + diff --git a/v0.3.0/CODE_OF_CONDUCT.html b/v0.3.0/CODE_OF_CONDUCT.html index e9de6c1c9..1f9bc9b2c 100644 --- a/v0.3.0/CODE_OF_CONDUCT.html +++ b/v0.3.0/CODE_OF_CONDUCT.html @@ -1,8 +1,22 @@ - -Contributor Covenant Code of Conduct • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -79,65 +99,80 @@
    -

    Our Pledge

    +

    Our Pledge +

    We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.

    We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.

    -

    Our Standards

    +

    Our Standards +

    Examples of behavior that contributes to a positive environment for our community include:

    -
    • Demonstrating empathy and kindness toward other people
    • +
        +
      • Demonstrating empathy and kindness toward other people
      • Being respectful of differing opinions, viewpoints, and experiences
      • Giving and gracefully accepting constructive feedback
      • Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
      • Focusing on what is best not just for us as individuals, but for the overall community
      • -

      Examples of unacceptable behavior include:

      -
      • The use of sexualized language or imagery, and sexual attention or advances of any kind
      • +
      +

      Examples of unacceptable behavior include:

      +
        +
      • The use of sexualized language or imagery, and sexual attention or advances of any kind
      • Trolling, insulting or derogatory comments, and personal or political attacks
      • Public or private harassment
      • Publishing others’ private information, such as a physical or email address, without their explicit permission
      • Other conduct which could reasonably be considered inappropriate in a professional setting
      • -
    + +
    -

    Enforcement Responsibilities

    +

    Enforcement Responsibilities +

    Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.

    Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.

    -

    Scope

    +

    Scope +

    This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.

    -

    Enforcement

    +

    Enforcement +

    Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [INSERT CONTACT METHOD]. All complaints will be reviewed and investigated promptly and fairly.

    All community leaders are obligated to respect the privacy and security of the reporter of any incident.

    -

    Enforcement Guidelines

    +

    Enforcement Guidelines +

    Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:

    -

    1. Correction

    +

    1. Correction +

    Community Impact: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.

    Consequence: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.

    -

    2. Warning

    +

    2. Warning +

    Community Impact: A violation through a single incident or series of actions.

    Consequence: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.

    -

    3. Temporary Ban

    +

    3. Temporary Ban +

    Community Impact: A serious violation of community standards, including sustained inappropriate behavior.

    Consequence: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.

    -

    4. Permanent Ban

    +

    4. Permanent Ban +

    Community Impact: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.

    Consequence: A permanent ban from any sort of public interaction within the community.

    -

    Attribution

    +

    Attribution +

    This Code of Conduct is adapted from the Contributor Covenant, version 2.1, available at https://www.contributor-covenant.org/version/2/1/code_of_conduct.html.

    Community Impact Guidelines were inspired by Mozilla’s code of conduct enforcement ladder.

    For answers to common questions about this code of conduct, see the FAQ at https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.

    @@ -145,17 +180,19 @@

    Attribution

    + + + + - - + + diff --git a/v0.3.0/CONTRIBUTING.html b/v0.3.0/CONTRIBUTING.html index 9d2799070..d8fb28450 100644 --- a/v0.3.0/CONTRIBUTING.html +++ b/v0.3.0/CONTRIBUTING.html @@ -1,8 +1,22 @@ - -Contribution Guidelines • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -81,7 +101,8 @@

    🙏 Thank you for taking the time to contribute!

    Your input is deeply valued, whether an issue, a pull request, or even feedback, regardless of size, content or scope.

    -

    Table of contents

    +

    Table of contents +

    👶 Getting started

    📔 Code of Conduct

    🗃 License

    @@ -92,38 +113,47 @@

    Table of contents❓ Questions

    -

    Getting started

    +

    Getting started +

    Please refer the project documentation for a brief introduction. Please also see other articles within the project documentation for additional information.

    -

    Code of Conduct

    +

    Code of Conduct +

    A Code of Conduct governs this project. Participants and contributors are expected to follow the rules outlined therein.

    -

    License

    +

    License +

    All your contributions will be covered by this project’s license.

    -

    Issues

    +

    Issues +

    We use GitHub to track issues, feature requests, and bugs. Before submitting a new issue, please check if the issue has already been reported. If the issue already exists, please upvote the existing issue 👍.

    For new feature requests, please elaborate on the context and the benefit the feature will have for users, developers, or other relevant personas.

    -

    Pull requests

    +

    Pull requests +

    -

    Github Flow

    +

    Github Flow +

    This repository uses the Github Flow model for collaboration. To submit a pull request:

    -
    1. +
        +
      1. Create a branch

        Please see the branch naming convention below. If you don’t have write access to this repository, please fork it.

      2. Make changes

        Make sure your code

        -
        • passes all checks imposed by GitHub Actions
        • +
            +
          • passes all checks imposed by GitHub Actions
          • is well documented
          • is well tested with unit tests sufficiently covering the changes introduced
          • -
          +
        +
      3. Create a pull request (PR)

        In the pull request description, please link the relevant issue (if any), provide a detailed description of the change, and include any assumptions.

        @@ -137,76 +167,93 @@

        Github Flow -

        Branch naming convention

        +

        Branch naming convention +

        Suppose your changes are related to a current issue in the current project; please name your branch as follows: <issue_id>_<short_description>. Please use underscore (_) as a delimiter for word separation. For example, 420_fix_ui_bug would be a suitable branch name if your change is resolving and UI-related bug reported in issue number 420 in the current project.

        If your change affects multiple repositories, please name your branches as follows: <issue_id>_<issue_repo>_<short description>. For example, 69_awesomeproject_fix_spelling_error would reference issue 69 reported in project awesomeproject and aims to resolve one or more spelling errors in multiple (likely related) repositories.

    monorepo and staged.dependencies -

    + +

    Sometimes you might need to change upstream dependent package(s) to be able to submit a meaningful change. We are using staged.dependencies functionality to simulate a monorepo behavior. The dependency configuration is already specified in this project’s staged_dependencies.yaml file. You need to name the feature branches appropriately. This is the only exception from the branch naming convention described above.

    Please refer to the staged.dependencies package documentation for more details.

    -

    Coding guidelines

    +

    Coding guidelines +

    This repository follows some unified processes and standards adopted by its maintainers to ensure software development is carried out consistently within teams and cohesively across other repositories.

    -

    Style guide

    +

    Style guide +

    This repository follows the standard tidyverse style guide and uses lintr for lint checks. Customized lint configurations are available in this repository’s .lintr file.

    -

    Dependency management

    +

    Dependency management +

    Lightweight is the right weight. This repository follows tinyverse recommedations of limiting dependencies to minimum.

    -

    Dependency version management

    +

    Dependency version management +

    If the code is not compatible with all (!) historical versions of a given dependenct package, it is required to specify minimal version in the DESCRIPTION file. In particular: if the development version requires (imports) the development version of another package - it is required to put abc (>= 1.2.3.9000).

    - +
    -

    R & package versions

    +

    R & package versions +

    We continuously test our packages against the newest R version along with the most recent dependencies from CRAN and BioConductor. We recommend that your working environment is also set up in the same way. You can find the details about the R version and packages used in the R CMD check GitHub Action execution log - there is a step that prints out the R sessionInfo().

    If you discover bugs on older R versions or with an older set of dependencies, please create the relevant bug reports.

    -

    pre-commit

    +

    +pre-commit +

    We highly recommend that you use the pre-commit tool combined with R hooks for pre-commit to execute some of the checks before committing and pushing your changes.

    Pre-commit hooks are already available in this repository’s .pre-commit-config.yaml file.

    -

    Recognition model

    +

    Recognition model +

    As mentioned previously, all contributions are deeply valued and appreciated. While all contribution data is available as part of the repository insights, to recognize a significant contribution and hence add the contributor to the package authors list, the following rules are enforced:

    -
    • Minimum 5% of lines of code authored* (determined by git blame query) OR
    • +
        +
      • Minimum 5% of lines of code authored* (determined by git blame query) OR
      • Being at the top 5 contributors in terms of number of commits OR lines added OR lines removed*
      • -

      *Excluding auto-generated code, including but not limited to roxygen comments or renv.lock files.

      +
    +

    *Excluding auto-generated code, including but not limited to roxygen comments or renv.lock files.

    The package maintainer also reserves the right to adjust the criteria to recognize contributions.

    -

    Questions

    +

    Questions +

    If you have further questions regarding the contribution guidelines, please contact the package/repository maintainer.

    + + + + - - + + diff --git a/v0.3.0/LICENSE-text.html b/v0.3.0/LICENSE-text.html index 632b1db26..a94045ab4 100644 --- a/v0.3.0/LICENSE-text.html +++ b/v0.3.0/LICENSE-text.html @@ -1,8 +1,22 @@ - -License • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -91,17 +111,19 @@ limitations under the License. - + + + + - - + + diff --git a/v0.3.0/SECURITY.html b/v0.3.0/SECURITY.html index dcdb33e07..9db39deee 100644 --- a/v0.3.0/SECURITY.html +++ b/v0.3.0/SECURITY.html @@ -1,8 +1,22 @@ - -Security Policy • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -79,38 +99,44 @@
    -

    Reporting Security Issues

    +

    Reporting Security Issues +

    If you believe you have found a security vulnerability in any of the repositories in this organization, please report it to us through coordinated disclosure.

    Please do not report security vulnerabilities through public GitHub issues, discussions, or pull requests.

    Instead, please send an email to vulnerability.management[@]roche.com.

    Please include as much of the information listed below as you can to help us better understand and resolve the issue:

    -
    • The type of issue (e.g., buffer overflow, SQL injection, or cross-site scripting)
    • +
        +
      • The type of issue (e.g., buffer overflow, SQL injection, or cross-site scripting)
      • Full paths of source file(s) related to the manifestation of the issue
      • The location of the affected source code (tag/branch/commit or direct URL)
      • Any special configuration required to reproduce the issue
      • Step-by-step instructions to reproduce the issue
      • Proof-of-concept or exploit code (if possible)
      • Impact of the issue, including how an attacker might exploit the issue
      • -

      This information will help us triage your report more quickly.

      +
    +

    This information will help us triage your report more quickly.

    -

    Data Security Standards (DSS)

    +

    Data Security Standards (DSS) +

    Please make sure that while reporting issues in the form a bug, feature, or pull request, all sensitive information such as PII, PHI, and PCI is completely removed from any text and attachments, including pictures and videos.

    + + + + - - + + diff --git a/v0.3.0/articles/filter-panel.html b/v0.3.0/articles/filter-panel.html index 4194bf41d..3b030b035 100644 --- a/v0.3.0/articles/filter-panel.html +++ b/v0.3.0/articles/filter-panel.html @@ -1,5 +1,4 @@ - - + @@ -51,22 +50,7 @@ - - + - + + diff --git a/v0.3.0/articles/index.html b/v0.3.0/articles/index.html index 968ade623..c961929a3 100644 --- a/v0.3.0/articles/index.html +++ b/v0.3.0/articles/index.html @@ -1,8 +1,22 @@ - -Articles • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -79,22 +99,28 @@

    All vignettes

    -
    Filter panel for NEST developers
    +
    +
    Filter panel for NEST developers
    -
    Introduction to teal.slice
    + +
    Introduction to teal.slice
    -
    - + +
    + + + + + - - + + diff --git a/v0.3.0/articles/teal-slice.html b/v0.3.0/articles/teal-slice.html index 37ccc5e1e..7b2128cf8 100644 --- a/v0.3.0/articles/teal-slice.html +++ b/v0.3.0/articles/teal-slice.html @@ -1,5 +1,4 @@ - - + @@ -51,22 +50,7 @@ - - + - + + diff --git a/v0.3.0/authors.html b/v0.3.0/authors.html index 388d4451f..acabebc6d 100644 --- a/v0.3.0/authors.html +++ b/v0.3.0/authors.html @@ -1,8 +1,22 @@ - -Authors and Citation • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -78,7 +98,8 @@

    Authors

    -
    • +
        +
      • Dawid Kaledkowski. Author, maintainer.

      • @@ -110,7 +131,8 @@

        Authors

        F. Hoffmann-La Roche AG. Copyright holder, funder.

        -
    + +

    Citation

    @@ -128,17 +150,19 @@

    Citation

    }
    + + + + - - + + diff --git a/v0.3.0/coverage-report/index.html b/v0.3.0/coverage-report/index.html index 94ba01223..cbfa11ab5 100644 --- a/v0.3.0/coverage-report/index.html +++ b/v0.3.0/coverage-report/index.html @@ -1,22 +1,21 @@ - - + - + - - + + - + - + - - - + + + @@ -312,7 +311,8 @@

    teal.slice coverage - 57.02%

    29 - 53x + 53x +
          if (!requireNamespace("MultiAssayExperiment", quietly = TRUE)) {
    @@ -333,35 +333,40 @@

    teal.slice coverage - 57.02%

    32 - 53x + 53x +
          super$initialize(dataname, datalabel)
    33 - 53x + 53x +
          private$keys <- keys
    34 - 53x + 53x +
          private$varlabels <- varlabels
    35 - 53x + 53x +
          private$state_list <- list(
    36 - 53x + 53x +
            y = reactiveVal()
    @@ -375,7 +380,8 @@

    teal.slice coverage - 57.02%

    38 - 53x + 53x +
          return(invisible(self))
    @@ -438,7 +444,8 @@

    teal.slice coverage - 57.02%

    47 - 7x + 7x +
          checkmate::assert_number(indent, finite = TRUE, lower = 0)
    @@ -452,28 +459,32 @@

    teal.slice coverage - 57.02%

    49 - 6x + 6x +
          if (length(self$state_list_get(1L)) > 0) {
    50 - 5x + 5x +
            formatted_states <- sprintf("%sSubject filters:", format("", width = indent))
    51 - 5x + 5x +
            for (state in self$state_list_get(1L)) {
    52 - 14x + 14x +
              formatted_states <- c(formatted_states, state$format(indent = indent + 2))
    @@ -487,7 +498,8 @@

    teal.slice coverage - 57.02%

    54 - 5x + 5x +
            paste(formatted_states, collapse = "\n")
    @@ -550,7 +562,8 @@

    teal.slice coverage - 57.02%

    63 - 11x + 11x +
          "MultiAssayExperiment::subsetByColData"
    @@ -613,42 +626,48 @@

    teal.slice coverage - 57.02%

    72 - 1x + 1x +
          moduleServer(
    73 - 1x + 1x +
            id = id,
    74 - 1x + 1x +
            function(input, output, session) {
    75 - 1x + 1x +
              previous_state <- reactiveVal(isolate(self$state_list_get("y")))
    76 - 1x + 1x +
              added_state_name <- reactiveVal(character(0))
    77 - 1x + 1x +
              removed_state_name <- reactiveVal(character(0))
    @@ -662,21 +681,24 @@

    teal.slice coverage - 57.02%

    79 - 1x + 1x +
              observeEvent(self$state_list_get("y"), {
    80 - 2x + 2x +
                added_state_name(setdiff(names(self$state_list_get("y")), names(previous_state())))
    81 - 2x + 2x +
                removed_state_name(setdiff(names(previous_state()), names(self$state_list_get("y"))))
    @@ -690,7 +712,8 @@

    teal.slice coverage - 57.02%

    83 - 2x + 2x +
                previous_state(self$state_list_get("y"))
    @@ -711,28 +734,32 @@

    teal.slice coverage - 57.02%

    86 - 1x + 1x +
              observeEvent(added_state_name(), ignoreNULL = TRUE, {
    87 - 1x + 1x +
                fstates <- self$state_list_get("y")
    88 - 1x + 1x +
                html_ids <- private$map_vars_to_html_ids(names(fstates))
    89 - 1x + 1x +
                for (fname in added_state_name()) {
    @@ -788,7 +815,8 @@

    teal.slice coverage - 57.02%

    97 - 1x + 1x +
                added_state_name(character(0))
    @@ -809,28 +837,32 @@

    teal.slice coverage - 57.02%

    100 - 1x + 1x +
              observeEvent(removed_state_name(), {
    101 - 3x + 3x +
                req(removed_state_name())
    102 - 1x + 1x +
                for (fname in removed_state_name()) {
    103 - 3x + 3x +
                  private$remove_filter_state_ui("y", fname, .input = input)
    @@ -844,7 +876,8 @@

    teal.slice coverage - 57.02%

    105 - 1x + 1x +
                removed_state_name(character(0))
    @@ -858,7 +891,8 @@

    teal.slice coverage - 57.02%

    107 - 1x + 1x +
              NULL
    @@ -949,7 +983,8 @@

    teal.slice coverage - 57.02%

    120 - 11x + 11x +
          lapply(self$state_list_get(state_list_index = "y"), function(x) x$get_state())
    @@ -1054,35 +1089,40 @@

    teal.slice coverage - 57.02%

    135 - 17x + 17x +
          checkmate::assert_class(data, "MultiAssayExperiment")
    136 - 17x + 17x +
          checkmate::assert(
    137 - 17x + 17x +
            checkmate::check_subset(names(state), names(SummarizedExperiment::colData(data))),
    138 - 17x + 17x +
            checkmate::check_class(state, "default_filter"),
    139 - 17x + 17x +
            combine = "or"
    @@ -1096,49 +1136,56 @@

    teal.slice coverage - 57.02%

    141 - 15x + 15x +
          logger::log_trace("MAEFilterState$set_filter_state initializing, dataname: { private$dataname }")
    142 - 15x + 15x +
          filter_states <- self$state_list_get("y")
    143 - 15x + 15x +
          for (varname in names(state)) {
    144 - 42x + 42x +
            value <- resolve_state(state[[varname]])
    145 - 42x + 42x +
            if (varname %in% names(filter_states)) {
    146 - 1x + 1x +
              fstate <- filter_states[[varname]]
    147 - 1x + 1x +
              fstate$set_state(value)
    @@ -1152,42 +1199,48 @@

    teal.slice coverage - 57.02%

    149 - 41x + 41x +
              fstate <- init_filter_state(
    150 - 41x + 41x +
                SummarizedExperiment::colData(data)[[varname]],
    151 - 41x + 41x +
                varname = varname,
    152 - 41x + 41x +
                varlabel = private$get_varlabels(varname),
    153 - 41x + 41x +
                dataname = private$dataname,
    154 - 41x + 41x +
                extract_type = "list"
    @@ -1201,42 +1254,48 @@

    teal.slice coverage - 57.02%

    156 - 41x + 41x +
              fstate$set_state(value)
    157 - 41x + 41x +
              fstate$set_na_rm(TRUE)
    158 - 41x + 41x +
              self$state_list_push(
    159 - 41x + 41x +
                x = fstate,
    160 - 41x + 41x +
                state_list_index = "y",
    161 - 41x + 41x +
                state_id = varname
    @@ -1264,14 +1323,16 @@

    teal.slice coverage - 57.02%

    165 - 15x + 15x +
          logger::log_trace("MAEFilterState$set_filter_state initialized, dataname: { private$dataname }")
    166 - 15x + 15x +
          NULL
    @@ -1348,42 +1409,48 @@

    teal.slice coverage - 57.02%

    177 - 3x + 3x +
          logger::log_trace(
    178 - 3x + 3x +
            sprintf(
    179 - 3x + 3x +
              "%s$remove_filter_state for %s called, dataname: %s",
    180 - 3x + 3x +
              class(self)[1],
    181 - 3x + 3x +
              state_id,
    182 - 3x + 3x +
              private$dataname
    @@ -1411,35 +1478,40 @@

    teal.slice coverage - 57.02%

    186 - 3x + 3x +
          if (!state_id %in% names(self$state_list_get("y"))) {
    187 - 1x + 1x +
            warning(paste(
    188 - 1x + 1x +
              "Variable:", state_id,
    189 - 1x + 1x +
              "is not present in the actual active filters of dataset: { private$dataname }",
    190 - 1x + 1x +
              "therefore no changes are applied."
    @@ -1453,28 +1525,32 @@

    teal.slice coverage - 57.02%

    192 - 1x + 1x +
            logger::log_warn(
    193 - 1x + 1x +
              paste(
    194 - 1x + 1x +
                "Variable:", state_id, "is not present in the actual active filters of dataset:",
    195 - 1x + 1x +
                "{ private$dataname } therefore no changes are applied."
    @@ -1502,49 +1578,56 @@

    teal.slice coverage - 57.02%

    199 - 2x + 2x +
            self$state_list_remove(state_list_index = "y", state_id = state_id)
    200 - 2x + 2x +
            logger::log_trace(
    201 - 2x + 2x +
              sprintf(
    202 - 2x + 2x +
                "%s$remove_filter_state for variable %s done, dataname: %s",
    203 - 2x + 2x +
                class(self)[1],
    204 - 2x + 2x +
                state_id,
    205 - 2x + 2x +
                private$dataname
    @@ -1677,14 +1760,16 @@

    teal.slice coverage - 57.02%

    224 - 2x + 2x +
          checkmate::assert_string(id)
    225 - 2x + 2x +
          stopifnot(is(data, "MultiAssayExperiment"))
    @@ -1698,7 +1783,8 @@

    teal.slice coverage - 57.02%

    227 - 2x + 2x +
          ns <- NS(id)
    @@ -1712,28 +1798,32 @@

    teal.slice coverage - 57.02%

    229 - 2x + 2x +
          if (ncol(SummarizedExperiment::colData(data)) == 0) {
    230 - 1x + 1x +
            div("no sample variables available")
    231 - 1x + 1x +
          } else if (nrow(SummarizedExperiment::colData(data)) == 0) {
    232 - 1x + 1x +
            div("no samples available")
    @@ -2706,14 +2796,16 @@

    teal.slice coverage - 57.02%

    371 - 41x + 41x +
          checkmate::assert_character(variables)
    372 - 41x + 41x +
          if (identical(variables, character(0))) {
    @@ -2734,28 +2826,32 @@

    teal.slice coverage - 57.02%

    375 - 41x + 41x +
            varlabels <- private$varlabels[variables]
    376 - 41x + 41x +
            missing_labels <- is.na(varlabels) | varlabels == ""
    377 - 41x + 41x +
            varlabels[missing_labels] <- variables[missing_labels]
    378 - 41x + 41x +
            varlabels
    @@ -2950,7 +3046,8 @@

    teal.slice coverage - 57.02%

    23 - 146x + 146x +
          if (!requireNamespace("SummarizedExperiment", quietly = TRUE)) {
    @@ -2971,28 +3068,32 @@

    teal.slice coverage - 57.02%

    26 - 146x + 146x +
          super$initialize(dataname, datalabel)
    27 - 146x + 146x +
          private$state_list <- list(
    28 - 146x + 146x +
            subset = reactiveVal(),
    29 - 146x + 146x +
            select = reactiveVal()
    @@ -3062,7 +3163,8 @@

    teal.slice coverage - 57.02%

    39 - 19x + 19x +
          checkmate::assert_number(indent, finite = TRUE, lower = 0)
    @@ -3076,42 +3178,48 @@

    teal.slice coverage - 57.02%

    41 - 18x + 18x +
          whitespace_indent <- format("", width = indent)
    42 - 18x + 18x +
          formatted_states <- c()
    43 - 18x + 18x +
          if (!is.null(self$state_list_get(state_list_index = "subset"))) {
    44 - 5x + 5x +
            formatted_states <- c(formatted_states, paste0(whitespace_indent, "  Subsetting:"))
    45 - 5x + 5x +
            for (state in self$state_list_get(state_list_index = "subset")) {
    46 - 5x + 5x +
              formatted_states <- c(formatted_states, state$format(indent = indent + 4))
    @@ -3139,28 +3247,32 @@

    teal.slice coverage - 57.02%

    50 - 18x + 18x +
          if (!is.null(self$state_list_get(state_list_index = "select"))) {
    51 - 1x + 1x +
            formatted_states <- c(formatted_states, paste0(whitespace_indent, "  Selecting:"))
    52 - 1x + 1x +
            for (state in self$state_list_get(state_list_index = "select")) {
    53 - 1x + 1x +
              formatted_states <- c(formatted_states, state$format(indent = indent + 4))
    @@ -3188,21 +3300,24 @@

    teal.slice coverage - 57.02%

    57 - 18x + 18x +
          if (length(formatted_states) > 0) {
    58 - 5x + 5x +
            formatted_states <- c(paste0(whitespace_indent, "Assay ", self$get_datalabel(), " filters:"), formatted_states)
    59 - 5x + 5x +
            paste(formatted_states, collapse = "\n")
    @@ -3272,42 +3387,48 @@

    teal.slice coverage - 57.02%

    69 - 4x + 4x +
          moduleServer(
    70 - 4x + 4x +
            id = id,
    71 - 4x + 4x +
            function(input, output, session) {
    72 - 4x + 4x +
              previous_state_subset <- reactiveVal(isolate(self$state_list_get("subset")))
    73 - 4x + 4x +
              added_state_name_subset <- reactiveVal(character(0))
    74 - 4x + 4x +
              removed_state_name_subset <- reactiveVal(character(0))
    @@ -3321,21 +3442,24 @@

    teal.slice coverage - 57.02%

    76 - 4x + 4x +
              observeEvent(self$state_list_get("subset"), {
    77 - 5x + 5x +
                added_state_name_subset(
    78 - 5x + 5x +
                  setdiff(names(self$state_list_get("subset")), names(previous_state_subset()))
    @@ -3349,14 +3473,16 @@

    teal.slice coverage - 57.02%

    80 - 5x + 5x +
                removed_state_name_subset(
    81 - 5x + 5x +
                  setdiff(names(previous_state_subset()), names(self$state_list_get("subset")))
    @@ -3370,7 +3496,8 @@

    teal.slice coverage - 57.02%

    83 - 5x + 5x +
                previous_state_subset(self$state_list_get("subset"))
    @@ -3391,28 +3518,32 @@

    teal.slice coverage - 57.02%

    86 - 4x + 4x +
              observeEvent(added_state_name_subset(), ignoreNULL = TRUE, {
    87 - 4x + 4x +
                fstates <- self$state_list_get("subset")
    88 - 4x + 4x +
                html_ids <- private$map_vars_to_html_ids(keys = names(fstates), prefix = "rowData")
    89 - 4x + 4x +
                for (fname in added_state_name_subset()) {
    @@ -3468,7 +3599,8 @@

    teal.slice coverage - 57.02%

    97 - 4x + 4x +
                added_state_name_subset(character(0))
    @@ -3489,28 +3621,32 @@

    teal.slice coverage - 57.02%

    100 - 4x + 4x +
              observeEvent(removed_state_name_subset(), {
    101 - 6x + 6x +
                req(removed_state_name_subset())
    102 - 1x + 1x +
                for (fname in removed_state_name_subset()) {
    103 - 1x + 1x +
                  private$remove_filter_state_ui("subset", fname, .input = input)
    @@ -3524,7 +3660,8 @@

    teal.slice coverage - 57.02%

    105 - 1x + 1x +
                removed_state_name_subset(character(0))
    @@ -3552,21 +3689,24 @@

    teal.slice coverage - 57.02%

    109 - 4x + 4x +
              previous_state_select <- reactiveVal(isolate(self$state_list_get("select")))
    110 - 4x + 4x +
              added_state_name_select <- reactiveVal(character(0))
    111 - 4x + 4x +
              removed_state_name_select <- reactiveVal(character(0))
    @@ -3580,7 +3720,8 @@

    teal.slice coverage - 57.02%

    113 - 4x + 4x +
              observeEvent(self$state_list_get("select"), {
    @@ -3594,14 +3735,16 @@

    teal.slice coverage - 57.02%

    115 - 4x + 4x +
                added_state_name_select(
    116 - 4x + 4x +
                  setdiff(names(self$state_list_get("select")), names(previous_state_select()))
    @@ -3615,14 +3758,16 @@

    teal.slice coverage - 57.02%

    118 - 4x + 4x +
                removed_state_name_select(
    119 - 4x + 4x +
                  setdiff(names(previous_state_select()), names(self$state_list_get("select")))
    @@ -3636,7 +3781,8 @@

    teal.slice coverage - 57.02%

    121 - 4x + 4x +
                previous_state_select(self$state_list_get("select"))
    @@ -3657,28 +3803,32 @@

    teal.slice coverage - 57.02%

    124 - 4x + 4x +
              observeEvent(added_state_name_select(), ignoreNULL = TRUE, {
    125 - 4x + 4x +
                fstates <- self$state_list_get("select")
    126 - 4x + 4x +
                html_ids <- private$map_vars_to_html_ids(keys = names(fstates), prefix = "colData")
    127 - 4x + 4x +
                for (fname in added_state_name_select()) {
    @@ -3734,7 +3884,8 @@

    teal.slice coverage - 57.02%

    135 - 4x + 4x +
                added_state_name_select(character(0))
    @@ -3755,14 +3906,16 @@

    teal.slice coverage - 57.02%

    138 - 4x + 4x +
              observeEvent(removed_state_name_select(), {
    139 - 4x + 4x +
                req(removed_state_name_select())
    @@ -3804,7 +3957,8 @@

    teal.slice coverage - 57.02%

    145 - 4x + 4x +
              NULL
    @@ -3909,35 +4063,40 @@

    teal.slice coverage - 57.02%

    160 - 40x + 40x +
          states <- sapply(
    161 - 40x + 40x +
            X = names(private$state_list),
    162 - 40x + 40x +
            simplify = FALSE,
    163 - 40x + 40x +
            function(x) {
    164 - 80x + 80x +
              lapply(self$state_list_get(state_list_index = x), function(xx) xx$get_state())
    @@ -3958,7 +4117,8 @@

    teal.slice coverage - 57.02%

    167 - 40x + 40x +
          Filter(function(x) length(x) > 0, states)
    @@ -4070,14 +4230,16 @@

    teal.slice coverage - 57.02%

    183 - 30x + 30x +
          checkmate::assert_class(data, "SummarizedExperiment")
    184 - 27x + 27x +
          checkmate::assert_class(state, "list")
    @@ -4091,28 +4253,32 @@

    teal.slice coverage - 57.02%

    186 - 26x + 26x +
          checkmate::assert(
    187 - 26x + 26x +
            checkmate::check_subset(names(state), c("subset", "select")),
    188 - 26x + 26x +
            checkmate::check_class(state, "default_filter"),
    189 - 26x + 26x +
            combine = "or"
    @@ -4126,42 +4292,48 @@

    teal.slice coverage - 57.02%

    191 - 25x + 25x +
          checkmate::assert(
    192 - 25x + 25x +
            checkmate::test_null(state$subset),
    193 - 25x + 25x +
            checkmate::assert(
    194 - 25x + 25x +
              checkmate::check_class(state$subset, "list"),
    195 - 25x + 25x +
              checkmate::check_subset(names(state$subset), names(SummarizedExperiment::rowData(data))),
    196 - 25x + 25x +
              combine = "and"
    @@ -4175,7 +4347,8 @@

    teal.slice coverage - 57.02%

    198 - 25x + 25x +
            combine = "or"
    @@ -4189,42 +4362,48 @@

    teal.slice coverage - 57.02%

    200 - 25x + 25x +
          checkmate::assert(
    201 - 25x + 25x +
            checkmate::test_null(state$select),
    202 - 25x + 25x +
            checkmate::assert(
    203 - 25x + 25x +
              checkmate::check_class(state$select, "list"),
    204 - 25x + 25x +
              checkmate::check_subset(names(state$select), names(SummarizedExperiment::colData(data))),
    205 - 25x + 25x +
              combine = "and"
    @@ -4238,7 +4417,8 @@

    teal.slice coverage - 57.02%

    207 - 25x + 25x +
            combine = "or"
    @@ -4259,42 +4439,48 @@

    teal.slice coverage - 57.02%

    210 - 25x + 25x +
          filter_states <- self$state_list_get("subset")
    211 - 25x + 25x +
          for (varname in names(state$subset)) {
    212 - 20x + 20x +
            value <- resolve_state(state$subset[[varname]])
    213 - 20x + 20x +
            if (varname %in% names(filter_states)) {
    214 - 2x + 2x +
              fstate <- filter_states[[varname]]
    215 - 2x + 2x +
              fstate$set_state(value)
    @@ -4308,28 +4494,32 @@

    teal.slice coverage - 57.02%

    217 - 18x + 18x +
              fstate <- init_filter_state(
    218 - 18x + 18x +
                SummarizedExperiment::rowData(data)[[varname]],
    219 - 18x + 18x +
                varname = varname,
    220 - 18x + 18x +
                dataname = private$dataname
    @@ -4343,35 +4533,40 @@

    teal.slice coverage - 57.02%

    222 - 18x + 18x +
              fstate$set_state(value)
    223 - 18x + 18x +
              self$state_list_push(
    224 - 18x + 18x +
                x = fstate,
    225 - 18x + 18x +
                state_list_index = "subset",
    226 - 18x + 18x +
                state_id = varname
    @@ -4406,42 +4601,48 @@

    teal.slice coverage - 57.02%

    231 - 25x + 25x +
          filter_states <- self$state_list_get("select")
    232 - 25x + 25x +
          for (varname in names(state$select)) {
    233 - 9x + 9x +
            value <- resolve_state(state$select[[varname]])
    234 - 9x + 9x +
            if (varname %in% names(filter_states)) {
    235 - 1x + 1x +
              fstate <- filter_states[[varname]]
    236 - 1x + 1x +
              fstate$set_state(value)
    @@ -4455,28 +4656,32 @@

    teal.slice coverage - 57.02%

    238 - 8x + 8x +
              fstate <- init_filter_state(
    239 - 8x + 8x +
                SummarizedExperiment::colData(data)[[varname]],
    240 - 8x + 8x +
                varname = varname,
    241 - 8x + 8x +
                dataname = private$dataname
    @@ -4490,35 +4695,40 @@

    teal.slice coverage - 57.02%

    243 - 8x + 8x +
              fstate$set_state(value)
    244 - 8x + 8x +
              self$state_list_push(
    245 - 8x + 8x +
                x = fstate,
    246 - 8x + 8x +
                state_list_index = "select",
    247 - 8x + 8x +
                state_id = varname
    @@ -4546,21 +4756,24 @@

    teal.slice coverage - 57.02%

    251 - 25x + 25x +
          logger::log_trace(paste(
    252 - 25x + 25x +
            "SEFilterState$set_filter_state initialized,",
    253 - 25x + 25x +
            "dataname: { private$dataname }"
    @@ -4574,7 +4787,8 @@

    teal.slice coverage - 57.02%

    255 - 25x + 25x +
          NULL
    @@ -4637,35 +4851,40 @@

    teal.slice coverage - 57.02%

    264 - 4x + 4x +
          logger::log_trace(
    265 - 4x + 4x +
            sprintf(
    266 - 4x + 4x +
              "%s$remove_filter_state called, dataname: %s",
    267 - 4x + 4x +
              class(self)[1],
    268 - 4x + 4x +
              private$dataname
    @@ -4693,28 +4912,32 @@

    teal.slice coverage - 57.02%

    272 - 4x + 4x +
          checkmate::assert(
    273 - 4x + 4x +
            !checkmate::test_null(names(state_id)),
    274 - 4x + 4x +
            checkmate::check_subset(names(state_id), c("subset", "select")),
    275 - 4x + 4x +
            combine = "and"
    @@ -4728,35 +4951,40 @@

    teal.slice coverage - 57.02%

    277 - 3x + 3x +
          for (varname in state_id$subset) {
    278 - 3x + 3x +
            if (!all(unlist(state_id$subset) %in% names(self$state_list_get("subset")))) {
    279 - 1x + 1x +
              warning(paste(
    280 - 1x + 1x +
                "Variable:", state_id, "is not present in the actual active subset filters of dataset:",
    281 - 1x + 1x +
                "{ private$dataname } therefore no changes are applied."
    @@ -4770,28 +4998,32 @@

    teal.slice coverage - 57.02%

    283 - 1x + 1x +
              logger::log_warn(
    284 - 1x + 1x +
                paste(
    285 - 1x + 1x +
                  "Variable:", state_id, "is not present in the actual active subset filters of dataset:",
    286 - 1x + 1x +
                  "{ private$dataname } therefore no changes are applied."
    @@ -4819,49 +5051,56 @@

    teal.slice coverage - 57.02%

    290 - 2x + 2x +
              self$state_list_remove(state_list_index = "subset", state_id = varname)
    291 - 2x + 2x +
              logger::log_trace(
    292 - 2x + 2x +
                sprintf(
    293 - 2x + 2x +
                  "%s$remove_filter_state for subset variable %s done, dataname: %s",
    294 - 2x + 2x +
                  class(self)[1],
    295 - 2x + 2x +
                  varname,
    296 - 2x + 2x +
                  private$dataname
    @@ -4903,14 +5142,16 @@

    teal.slice coverage - 57.02%

    302 - 3x + 3x +
          for (varname in state_id$select) {
    303 - 1x + 1x +
            if (!all(unlist(state_id$select) %in% names(self$state_list_get("select")))) {
    @@ -4994,42 +5235,48 @@

    teal.slice coverage - 57.02%

    315 - 1x + 1x +
              self$state_list_remove(state_list_index = "select", state_id = varname)
    316 - 1x + 1x +
              sprintf(
    317 - 1x + 1x +
                "%s$remove_filter_state for select variable %s done, dataname: %s",
    318 - 1x + 1x +
                class(self)[1],
    319 - 1x + 1x +
                varname,
    320 - 1x + 1x +
                private$dataname
    @@ -5155,14 +5402,16 @@

    teal.slice coverage - 57.02%

    338 - 2x + 2x +
          checkmate::assert_string(id)
    339 - 2x + 2x +
          stopifnot(is(data, "SummarizedExperiment"))
    @@ -5176,7 +5425,8 @@

    teal.slice coverage - 57.02%

    341 - 2x + 2x +
          ns <- NS(id)
    @@ -5190,28 +5440,32 @@

    teal.slice coverage - 57.02%

    343 - 2x + 2x +
          row_input <- if (ncol(SummarizedExperiment::rowData(data)) == 0) {
    344 - 1x + 1x +
            div("no sample variables available")
    345 - 2x + 2x +
          } else if (nrow(SummarizedExperiment::rowData(data)) == 0) {
    346 - 1x + 1x +
            div("no samples available")
    @@ -5295,28 +5549,32 @@

    teal.slice coverage - 57.02%

    358 - 2x + 2x +
          col_input <- if (ncol(SummarizedExperiment::colData(data)) == 0) {
    359 - 1x + 1x +
            div("no sample variables available")
    360 - 2x + 2x +
          } else if (nrow(SummarizedExperiment::colData(data)) == 0) {
    361 - 1x + 1x +
            div("no samples available")
    @@ -5400,21 +5658,24 @@

    teal.slice coverage - 57.02%

    373 - 2x + 2x +
          div(
    374 - 2x + 2x +
            row_input,
    375 - 2x + 2x +
            col_input
    @@ -7408,7 +7669,8 @@

    teal.slice coverage - 57.02%

    89 - 66x + 66x +
          checkmate::assert_list(data_objects, any.missing = FALSE, min.len = 0, names = "unique")
    @@ -7422,21 +7684,24 @@

    teal.slice coverage - 57.02%

    91 - 66x + 66x +
          checkmate::assert_class(join_keys, "JoinKeys", null.ok = TRUE)
    92 - 66x + 66x +
          checkmate::assert_class(code, "CodeClass", null.ok = TRUE)
    93 - 66x + 66x +
          checkmate::assert_flag(check)
    @@ -7450,21 +7715,24 @@

    teal.slice coverage - 57.02%

    95 - 66x + 66x +
          self$set_check(check)
    96 - 66x + 66x +
          if (!is.null(code)) {
    97 - 15x + 15x +
            self$set_code(code)
    @@ -7485,14 +7753,16 @@

    teal.slice coverage - 57.02%

    100 - 66x + 66x +
          for (dataname in names(data_objects)) {
    101 - 105x + 105x +
            self$set_dataset(data_objects[[dataname]], dataname)
    @@ -7513,14 +7783,16 @@

    teal.slice coverage - 57.02%

    104 - 66x + 66x +
          if (!is.null(join_keys)) {
    105 - 13x + 13x +
            self$set_join_keys(join_keys)
    @@ -7541,7 +7813,8 @@

    teal.slice coverage - 57.02%

    108 - 66x + 66x +
          invisible(self)
    @@ -7611,7 +7884,8 @@

    teal.slice coverage - 57.02%

    118 - 57x + 57x +
          names(private$filtered_datasets)
    @@ -7681,7 +7955,8 @@

    teal.slice coverage - 57.02%

    128 - 2x + 2x +
          self$get_filtered_dataset(dataname)$get_dataset_label()
    @@ -7835,7 +8110,8 @@

    teal.slice coverage - 57.02%

    150 - 36x + 36x +
          self$get_filtered_dataset(dataname)$get_filterable_varnames()
    @@ -7933,21 +8209,24 @@

    teal.slice coverage - 57.02%

    164 - 3x + 3x +
          private$check_data_varname_exists(dataname)
    165 - 3x + 3x +
          self$get_filtered_dataset(dataname)$set_filterable_varnames(varnames)
    166 - 3x + 3x +
          invisible(self)
    @@ -8136,14 +8415,16 @@

    teal.slice coverage - 57.02%

    193 - 24x + 24x +
          private$check_data_varname_exists(dataname)
    194 - 24x + 24x +
          self$get_filtered_dataset(dataname)$get_call()
    @@ -8220,14 +8501,16 @@

    teal.slice coverage - 57.02%

    205 - 2x + 2x +
          if (!is.null(private$code)) {
    206 - 1x + 1x +
            paste0(private$code$get_code(dataname), collapse = "\n")
    @@ -8241,7 +8524,8 @@

    teal.slice coverage - 57.02%

    208 - 1x + 1x +
            paste0("# No pre-processing code provided")
    @@ -8339,14 +8623,16 @@

    teal.slice coverage - 57.02%

    222 - 326x + 326x +
          if (length(dataname) == 0) {
    223 - 108x + 108x +
            private$filtered_datasets
    @@ -8360,7 +8646,8 @@

    teal.slice coverage - 57.02%

    225 - 218x + 218x +
            private$filtered_datasets[[dataname]]
    @@ -8458,21 +8745,24 @@

    teal.slice coverage - 57.02%

    239 - 29x + 29x +
          private$check_data_varname_exists(dataname)
    240 - 29x + 29x +
          checkmate::assert_flag(filtered)
    241 - 28x + 28x +
          if (filtered) {
    @@ -8507,21 +8797,24 @@

    teal.slice coverage - 57.02%

    246 - 26x + 26x +
            tryCatch(
    247 - 26x + 26x +
              private$reactive_data[[dataname]](),
    248 - 26x + 26x +
              error = function(error) {
    @@ -8584,7 +8877,8 @@

    teal.slice coverage - 57.02%

    257 - 2x + 2x +
            self$get_filtered_dataset(dataname)$get_dataset()
    @@ -8654,7 +8948,8 @@

    teal.slice coverage - 57.02%

    267 - 2x + 2x +
          private$.check
    @@ -8731,14 +9026,16 @@

    teal.slice coverage - 57.02%

    278 - 3x + 3x +
          private$check_data_varname_exists(dataname)
    279 - 2x + 2x +
          self$get_filtered_dataset(dataname)$get_metadata()
    @@ -8801,7 +9098,8 @@

    teal.slice coverage - 57.02%

    288 - 3x + 3x +
          return(private$keys)
    @@ -9074,7 +9372,8 @@

    teal.slice coverage - 57.02%

    327 - 2x + 2x +
          self$get_filtered_dataset(dataname)$get_keys()
    @@ -9200,7 +9499,8 @@

    teal.slice coverage - 57.02%

    345 - 4x + 4x +
          self$get_filtered_dataset(dataname)$get_varlabels(variables = variables)
    @@ -9277,7 +9577,8 @@

    teal.slice coverage - 57.02%

    356 - 1x + 1x +
          self$get_filtered_dataset(dataname)$get_varnames()
    @@ -9592,14 +9893,16 @@

    teal.slice coverage - 57.02%

    401 - 97x + 97x +
          logger::log_trace("FilteredData$set_dataset setting dataset, name: { dataname }")
    402 - 97x + 97x +
          validate_dataset_args(dataset_args, dataname)
    @@ -9613,14 +9916,16 @@

    teal.slice coverage - 57.02%

    404 - 97x + 97x +
          dataset <- dataset_args$dataset
    405 - 97x + 97x +
          dataset_args$dataset <- NULL
    @@ -9648,28 +9953,32 @@

    teal.slice coverage - 57.02%

    409 - 97x + 97x +
          check_simple_name(dataname)
    410 - 97x + 97x +
          private$filtered_datasets[[dataname]] <- do.call(
    411 - 97x + 97x +
            what = init_filtered_dataset,
    412 - 97x + 97x +
            args = c(list(dataset), dataset_args, list(dataname = dataname))
    @@ -9690,42 +9999,48 @@

    teal.slice coverage - 57.02%

    415 - 97x + 97x +
          private$reactive_data[[dataname]] <- reactive({
    416 - 14x + 14x +
            env <- new.env(parent = parent.env(globalenv()))
    417 - 14x + 14x +
            env[[dataname]] <- self$get_filtered_dataset(dataname)$get_dataset()
    418 - 14x + 14x +
            filter_call <- self$get_call(dataname)
    419 - 14x + 14x +
            eval_expr_with_msg(filter_call, env)
    420 - 14x + 14x +
            get(x = dataname, envir = env)
    @@ -9746,7 +10061,8 @@

    teal.slice coverage - 57.02%

    423 - 97x + 97x +
          invisible(self)
    @@ -9823,21 +10139,24 @@

    teal.slice coverage - 57.02%

    434 - 13x + 13x +
          checkmate::assert_class(join_keys, "JoinKeys")
    435 - 13x + 13x +
          private$keys <- join_keys
    436 - 13x + 13x +
          invisible(self)
    @@ -9914,21 +10233,24 @@

    teal.slice coverage - 57.02%

    447 - 66x + 66x +
          checkmate::assert_flag(check)
    448 - 66x + 66x +
          private$.check <- check
    449 - 66x + 66x +
          invisible(self)
    @@ -10012,28 +10334,32 @@

    teal.slice coverage - 57.02%

    461 - 15x + 15x +
          checkmate::assert_class(code, "CodeClass")
    462 - 15x + 15x +
          logger::log_trace("FilteredData$set_code setting code")
    463 - 15x + 15x +
          private$code <- code
    464 - 15x + 15x +
          invisible(self)
    @@ -10152,21 +10478,24 @@

    teal.slice coverage - 57.02%

    481 - 22x + 22x +
          states <- lapply(self$get_filtered_dataset(), function(x) x$get_filter_state())
    482 - 22x + 22x +
          filtered_states <- Filter(function(x) length(x) > 0, states)
    483 - 22x + 22x +
          structure(filtered_states, formatted = self$get_formatted_filter_state())
    @@ -10418,35 +10747,40 @@

    teal.slice coverage - 57.02%

    519 - 25x + 25x +
          out <-
    520 - 25x + 25x +
            unlist(sapply(
    521 - 25x + 25x +
              self$get_filtered_dataset(),
    522 - 25x + 25x +
              function(filtered_dataset) {
    523 - 45x + 45x +
                filtered_dataset$get_formatted_filter_state()
    @@ -10467,7 +10801,8 @@

    teal.slice coverage - 57.02%

    526 - 25x + 25x +
          paste(out, collapse = "\n")
    @@ -10747,21 +11082,24 @@

    teal.slice coverage - 57.02%

    566 - 23x + 23x +
          checkmate::assert_subset(names(state), self$datanames())
    567 - 22x + 22x +
          logger::log_trace(
    568 - 22x + 22x +
            "FilteredData$set_filter_state initializing, dataname: { paste(names(state), collapse = ' ') }"
    @@ -10775,21 +11113,24 @@

    teal.slice coverage - 57.02%

    570 - 22x + 22x +
          for (dataname in names(state)) {
    571 - 35x + 35x +
            fdataset <- self$get_filtered_dataset(dataname = dataname)
    572 - 35x + 35x +
            dataset_state <- state[[dataname]]
    @@ -10803,21 +11144,24 @@

    teal.slice coverage - 57.02%

    574 - 35x + 35x +
            fdataset$set_filter_state(
    575 - 35x + 35x +
              state = dataset_state,
    576 - 35x + 35x +
              vars_include = self$get_filterable_varnames(dataname)
    @@ -10838,14 +11182,16 @@

    teal.slice coverage - 57.02%

    579 - 21x + 21x +
          logger::log_trace(
    580 - 21x + 21x +
            "FilteredData$set_filter_state initialized, dataname: { paste(names(state), collapse = ' ') }"
    @@ -10866,7 +11212,8 @@

    teal.slice coverage - 57.02%

    583 - 21x + 21x +
          invisible(NULL)
    @@ -10950,7 +11297,8 @@

    teal.slice coverage - 57.02%

    595 - 2x + 2x +
          checkmate::assert_subset(names(state), self$datanames())
    @@ -10964,14 +11312,16 @@

    teal.slice coverage - 57.02%

    597 - 2x + 2x +
          logger::log_trace(
    598 - 2x + 2x +
            "FilteredData$remove_filter_state called, dataname: { paste(names(state), collapse = ' ') }"
    @@ -10992,21 +11342,24 @@

    teal.slice coverage - 57.02%

    601 - 2x + 2x +
          for (dataname in names(state)) {
    602 - 3x + 3x +
            fdataset <- self$get_filtered_dataset(dataname = dataname)
    603 - 3x + 3x +
            fdataset$remove_filter_state(state_id = state[[dataname]])
    @@ -11027,14 +11380,16 @@

    teal.slice coverage - 57.02%

    606 - 2x + 2x +
          logger::log_trace(
    607 - 2x + 2x +
            "FilteredData$remove_filter_state done, dataname: { paste(names(state), collapse = ' ') }"
    @@ -11055,7 +11410,8 @@

    teal.slice coverage - 57.02%

    610 - 2x + 2x +
          invisible(NULL)
    @@ -11153,14 +11509,16 @@

    teal.slice coverage - 57.02%

    624 - 9x + 9x +
          logger::log_trace(
    625 - 9x + 9x +
            "FilteredData$remove_all_filter_states called, datanames: { paste(datanames, collapse = ', ') }"
    @@ -11181,21 +11539,24 @@

    teal.slice coverage - 57.02%

    628 - 9x + 9x +
          for (dataname in datanames) {
    629 - 13x + 13x +
            fdataset <- self$get_filtered_dataset(dataname = dataname)
    630 - 13x + 13x +
            fdataset$state_lists_empty()
    @@ -11216,28 +11577,32 @@

    teal.slice coverage - 57.02%

    633 - 9x + 9x +
          logger::log_trace(
    634 - 9x + 9x +
            paste(
    635 - 9x + 9x +
              "FilteredData$remove_all_filter_states removed all FilterStates,",
    636 - 9x + 9x +
              "datanames: { paste(datanames, collapse = ', ') }"
    @@ -11265,7 +11630,8 @@

    teal.slice coverage - 57.02%

    640 - 9x + 9x +
          invisible(NULL)
    @@ -11405,7 +11771,8 @@

    teal.slice coverage - 57.02%

    660 - 1x + 1x +
          stop("Pure virtual method")
    @@ -11475,42 +11842,48 @@

    teal.slice coverage - 57.02%

    670 - 4x + 4x +
          private$filter_panel_active <- FALSE
    671 - 4x + 4x +
          shinyjs::disable("filter_add_vars")
    672 - 4x + 4x +
          shinyjs::disable("filter_active_vars")
    673 - 4x + 4x +
          private$cached_states <- self$get_filter_state()
    674 - 4x + 4x +
          self$remove_all_filter_states()
    675 - 4x + 4x +
          invisible(NULL)
    @@ -11573,35 +11946,40 @@

    teal.slice coverage - 57.02%

    684 - 3x + 3x +
          private$filter_panel_active <- TRUE
    685 - 3x + 3x +
          shinyjs::enable("filter_add_vars")
    686 - 3x + 3x +
          shinyjs::enable("filter_active_vars")
    687 - 3x + 3x +
          if (length(private$cached_states) && (length(self$get_filter_state()) == 0)) {
    688 - 1x + 1x +
            self$set_filter_state(private$cached_states)
    @@ -11615,7 +11993,8 @@

    teal.slice coverage - 57.02%

    690 - 3x + 3x +
          invisible(NULL)
    @@ -11664,7 +12043,8 @@

    teal.slice coverage - 57.02%

    697 - 18x + 18x +
          private$filter_panel_active
    @@ -11706,7 +12086,8 @@

    teal.slice coverage - 57.02%

    703 - 2x + 2x +
          private$filter_panel_ui_id
    @@ -12826,14 +13207,16 @@

    teal.slice coverage - 57.02%

    863 - 6x + 6x +
          stopifnot(
    864 - 6x + 6x +
            is.function(active_datanames) || is.reactive(active_datanames)
    @@ -12847,56 +13230,64 @@

    teal.slice coverage - 57.02%

    866 - 6x + 6x +
          moduleServer(
    867 - 6x + 6x +
            id = id,
    868 - 6x + 6x +
            function(input, output, session) {
    869 - 6x + 6x +
              logger::log_trace("FilteredData$srv_filter_panel initializing")
    870 - 6x + 6x +
              shiny::setBookmarkExclude("remove_all_filters")
    871 - 6x + 6x +
              self$srv_filter_overview(
    872 - 6x + 6x +
                id = "teal_filters_info",
    873 - 6x + 6x +
                active_datanames = active_datanames
    @@ -12917,7 +13308,8 @@

    teal.slice coverage - 57.02%

    876 - 6x + 6x +
              shiny::observeEvent(input$minimise_filter_overview, {
    @@ -12959,7 +13351,8 @@

    teal.slice coverage - 57.02%

    882 - 6x + 6x +
              shiny::observeEvent(input$minimise_filter_active, {
    @@ -13008,7 +13401,8 @@

    teal.slice coverage - 57.02%

    889 - 6x + 6x +
              shiny::observeEvent(private$get_filter_count(), {
    @@ -13064,7 +13458,8 @@

    teal.slice coverage - 57.02%

    897 - 6x + 6x +
              shiny::observeEvent(input$minimise_filter_add_vars, {
    @@ -13127,7 +13522,8 @@

    teal.slice coverage - 57.02%

    906 - 6x + 6x +
              isol_datanames <- isolate(self$datanames()) # they are already ordered
    @@ -13148,35 +13544,40 @@

    teal.slice coverage - 57.02%

    909 - 6x + 6x +
              lapply(
    910 - 6x + 6x +
                isol_datanames,
    911 - 6x + 6x +
                function(dataname) {
    912 - 8x + 8x +
                  fdataset <- self$get_filtered_dataset(dataname)
    913 - 8x + 8x +
                  fdataset$server(id = private$get_ui_id(dataname))
    @@ -13204,49 +13605,56 @@

    teal.slice coverage - 57.02%

    917 - 6x + 6x +
              lapply(
    918 - 6x + 6x +
                isol_datanames,
    919 - 6x + 6x +
                function(dataname) {
    920 - 8x + 8x +
                  fdataset <- self$get_filtered_dataset(dataname)
    921 - 8x + 8x +
                  fdataset$srv_add_filter_state(
    922 - 8x + 8x +
                    id = private$get_ui_add_filter_id(dataname),
    923 - 8x + 8x +
                    vars_include = self$get_filterable_varnames(dataname)
    @@ -13281,7 +13689,8 @@

    teal.slice coverage - 57.02%

    928 - 6x + 6x +
              output$teal_filters_count <- shiny::renderText({
    @@ -13351,28 +13760,32 @@

    teal.slice coverage - 57.02%

    938 - 6x + 6x +
              private$filter_panel_ui_id <- session$ns(NULL)
    939 - 6x + 6x +
              observeEvent(
    940 - 6x + 6x +
                eventExpr = input$filter_panel_active,
    941 - 6x + 6x +
                handlerExpr = {
    @@ -13428,7 +13841,8 @@

    teal.slice coverage - 57.02%

    949 - 6x + 6x +
                }, ignoreNULL = TRUE
    @@ -13449,21 +13863,24 @@

    teal.slice coverage - 57.02%

    952 - 6x + 6x +
              observeEvent(
    953 - 6x + 6x +
                eventExpr = active_datanames(),
    954 - 6x + 6x +
                handlerExpr = {
    @@ -13484,7 +13901,8 @@

    teal.slice coverage - 57.02%

    957 - 6x + 6x +
                priority = 1
    @@ -13505,7 +13923,8 @@

    teal.slice coverage - 57.02%

    960 - 6x + 6x +
              observeEvent(input$remove_all_filters, {
    @@ -13568,14 +13987,16 @@

    teal.slice coverage - 57.02%

    969 - 6x + 6x +
              logger::log_trace("FilteredData$srv_filter_panel initialized")
    970 - 6x + 6x +
              NULL
    @@ -13813,14 +14234,16 @@

    teal.slice coverage - 57.02%

    1004 - 6x + 6x +
          stopifnot(
    1005 - 6x + 6x +
            is.function(active_datanames) || is.reactive(active_datanames)
    @@ -13834,35 +14257,40 @@

    teal.slice coverage - 57.02%

    1007 - 6x + 6x +
          moduleServer(
    1008 - 6x + 6x +
            id = id,
    1009 - 6x + 6x +
            function(input, output, session) {
    1010 - 6x + 6x +
              logger::log_trace("FilteredData$srv_filter_overview initializing")
    1011 - 6x + 6x +
              output$table <- renderUI({
    @@ -14142,21 +14570,24 @@

    teal.slice coverage - 57.02%

    1051 - 6x + 6x +
              shiny::outputOptions(output, "table", suspendWhenHidden = FALSE)
    1052 - 6x + 6x +
              logger::log_trace("FilteredData$srv_filter_overview initialized")
    1053 - 6x + 6x +
              NULL
    @@ -14562,7 +14993,8 @@

    teal.slice coverage - 57.02%

    1111 - 8x + 8x +
          sprintf("%s_filter", dataname)
    @@ -14618,7 +15050,8 @@

    teal.slice coverage - 57.02%

    1119 - 8x + 8x +
          sprintf("add_%s_filter", dataname)
    @@ -14933,14 +15366,16 @@

    teal.slice coverage - 57.02%

    1164 - 59x + 59x +
          checkmate::assert_string(dataname)
    1165 - 59x + 59x +
          checkmate::assert_string(varname, null.ok = TRUE)
    @@ -14954,7 +15389,8 @@

    teal.slice coverage - 57.02%

    1167 - 59x + 59x +
          isolate({
    @@ -14975,7 +15411,8 @@

    teal.slice coverage - 57.02%

    1170 - 59x + 59x +
            if (!dataname %in% names(self$get_filtered_dataset())) {
    @@ -14989,7 +15426,8 @@

    teal.slice coverage - 57.02%

    1172 - 1x + 1x +
              stop(paste("data", dataname, "is not available"))
    @@ -15003,7 +15441,8 @@

    teal.slice coverage - 57.02%

    1174 - 58x + 58x +
            if (!is.null(varname) && !(varname %in% self$get_varnames(dataname = dataname))) {
    @@ -15038,7 +15477,8 @@

    teal.slice coverage - 57.02%

    1179 - 58x + 58x +
          return(invisible(NULL))
    @@ -15094,21 +15534,24 @@

    teal.slice coverage - 57.02%

    1187 - 4x + 4x +
          sum(vapply(self$datanames(), function(dataname) {
    1188 - 8x + 8x +
            self$get_filtered_dataset(dataname)$get_filter_count()
    1189 - 4x + 4x +
          }, numeric(1L)))
    @@ -15248,28 +15691,32 @@

    teal.slice coverage - 57.02%

    1209 - 1x + 1x +
      checkmate::assert_character(datanames, min.len = 1, any.missing = FALSE)
    1210 - 1x + 1x +
      stopifnot(
    1211 - 1x + 1x +
        is(datasets, "FilteredData"),
    1212 - 1x + 1x +
        all(datanames %in% datasets$datanames())
    @@ -15290,35 +15737,40 @@

    teal.slice coverage - 57.02%

    1215 - 1x + 1x +
      paste(
    1216 - 1x + 1x +
        unlist(lapply(
    1217 - 1x + 1x +
          datanames,
    1218 - 1x + 1x +
          function(dataname) {
    1219 - 2x + 2x +
            datasets$get_call(dataname)
    @@ -15339,7 +15791,8 @@

    teal.slice coverage - 57.02%

    1222 - 1x + 1x +
        collapse = "\n"
    @@ -15772,42 +16225,48 @@

    teal.slice coverage - 57.02%

    59 - 168x + 168x +
      checkmate::assert_string(varname)
    60 - 167x + 167x +
      checkmate::assert_character(varlabel, max.len = 1L, any.missing = FALSE, null.ok = TRUE)
    61 - 167x + 167x +
      checkmate::assert_string(dataname, null.ok = TRUE)
    62 - 167x + 167x +
      checkmate::assert_character(extract_type, max.len = 1L, any.missing = FALSE)
    63 - 167x + 167x +
      if (length(extract_type) == 1) {
    64 - 47x + 47x +
        checkmate::assert_choice(extract_type, choices = c("list", "matrix"))
    @@ -15821,14 +16280,16 @@

    teal.slice coverage - 57.02%

    66 - 167x + 167x +
      if (length(extract_type) == 1 && is.null(dataname)) {
    67 - 1x + 1x +
        stop("if extract_type is specified, dataname must also be specified")
    @@ -15849,7 +16310,8 @@

    teal.slice coverage - 57.02%

    70 - 45x + 45x +
      if (is.null(varlabel)) varlabel <- character(0L)
    @@ -15863,56 +16325,64 @@

    teal.slice coverage - 57.02%

    72 - 166x + 166x +
      if (all(is.na(x))) {
    73 - 1x + 1x +
        return(
    74 - 1x + 1x +
          EmptyFilterState$new(
    75 - 1x + 1x +
            x = x,
    76 - 1x + 1x +
            varname = varname,
    77 - 1x + 1x +
            varlabel = varlabel,
    78 - 1x + 1x +
            dataname = dataname,
    79 - 1x + 1x +
            extract_type = extract_type
    @@ -15940,7 +16410,8 @@

    teal.slice coverage - 57.02%

    83 - 165x + 165x +
      UseMethod("init_filter_state")
    @@ -16010,49 +16481,56 @@

    teal.slice coverage - 57.02%

    93 - 1x + 1x +
      if (is.null(varlabel)) varlabel <- character(0)
    94 - 1x + 1x +
      FilterState$new(
    95 - 1x + 1x +
        x = x,
    96 - 1x + 1x +
        varname = varname,
    97 - 1x + 1x +
        varlabel = varlabel,
    98 - 1x + 1x +
        dataname = dataname,
    99 - 1x + 1x +
        extract_type = extract_type
    @@ -16129,49 +16607,56 @@

    teal.slice coverage - 57.02%

    110 - 1x + 1x +
      if (is.null(varlabel)) varlabel <- character(0)
    111 - 1x + 1x +
      LogicalFilterState$new(
    112 - 1x + 1x +
        x = x,
    113 - 1x + 1x +
        varname = varname,
    114 - 1x + 1x +
        varlabel = varlabel,
    115 - 1x + 1x +
        dataname = dataname,
    116 - 1x + 1x +
        extract_type = extract_type
    @@ -16248,56 +16733,64 @@

    teal.slice coverage - 57.02%

    127 - 9x + 9x +
      if (is.null(varlabel)) varlabel <- character(0)
    128 - 89x + 89x +
      if (length(unique(x[!is.na(x)])) < getOption("teal.threshold_slider_vs_checkboxgroup")) {
    129 - 31x + 31x +
        ChoicesFilterState$new(
    130 - 31x + 31x +
          x = x,
    131 - 31x + 31x +
          varname = varname,
    132 - 31x + 31x +
          varlabel = varlabel,
    133 - 31x + 31x +
          dataname = dataname,
    134 - 31x + 31x +
          extract_type = extract_type
    @@ -16318,42 +16811,48 @@

    teal.slice coverage - 57.02%

    137 - 58x + 58x +
        RangeFilterState$new(
    138 - 58x + 58x +
          x = x,
    139 - 58x + 58x +
          varname = varname,
    140 - 58x + 58x +
          varlabel = varlabel,
    141 - 58x + 58x +
          dataname = dataname,
    142 - 58x + 58x +
          extract_type = extract_type
    @@ -16444,42 +16943,48 @@

    teal.slice coverage - 57.02%

    155 - 26x + 26x +
      ChoicesFilterState$new(
    156 - 26x + 26x +
        x = x,
    157 - 26x + 26x +
        varname = varname,
    158 - 26x + 26x +
        varlabel = varlabel,
    159 - 26x + 26x +
        dataname = dataname,
    160 - 26x + 26x +
        extract_type = extract_type
    @@ -16556,49 +17061,56 @@

    teal.slice coverage - 57.02%

    171 - 27x + 27x +
      if (is.null(varlabel)) varlabel <- character(0)
    172 - 42x + 42x +
      ChoicesFilterState$new(
    173 - 42x + 42x +
        x = x,
    174 - 42x + 42x +
        varname = varname,
    175 - 42x + 42x +
        varlabel = varlabel,
    176 - 42x + 42x +
        dataname = dataname,
    177 - 42x + 42x +
        extract_type = extract_type
    @@ -16675,56 +17187,64 @@

    teal.slice coverage - 57.02%

    188 - 2x + 2x +
      if (is.null(varlabel)) varlabel <- character(0)
    189 - 2x + 2x +
      if (length(unique(x[!is.na(x)])) < getOption("teal.threshold_slider_vs_checkboxgroup")) {
    190 - 1x + 1x +
        ChoicesFilterState$new(
    191 - 1x + 1x +
          x = x,
    192 - 1x + 1x +
          varname = varname,
    193 - 1x + 1x +
          varlabel = varlabel,
    194 - 1x + 1x +
          dataname = dataname,
    195 - 1x + 1x +
          extract_type = extract_type
    @@ -16745,42 +17265,48 @@

    teal.slice coverage - 57.02%

    198 - 1x + 1x +
        DateFilterState$new(
    199 - 1x + 1x +
          x = x,
    200 - 1x + 1x +
          varname = varname,
    201 - 1x + 1x +
          varlabel = varlabel,
    202 - 1x + 1x +
          dataname = dataname,
    203 - 1x + 1x +
          extract_type = extract_type
    @@ -16864,56 +17390,64 @@

    teal.slice coverage - 57.02%

    215 - 2x + 2x +
      if (is.null(varlabel)) varlabel <- character(0)
    216 - 2x + 2x +
      if (length(unique(x[!is.na(x)])) < getOption("teal.threshold_slider_vs_checkboxgroup")) {
    217 - 1x + 1x +
        ChoicesFilterState$new(
    218 - 1x + 1x +
          x = x,
    219 - 1x + 1x +
          varname = varname,
    220 - 1x + 1x +
          varlabel = varlabel,
    221 - 1x + 1x +
          dataname = dataname,
    222 - 1x + 1x +
          extract_type = extract_type
    @@ -16934,42 +17468,48 @@

    teal.slice coverage - 57.02%

    225 - 1x + 1x +
        DatetimeFilterState$new(
    226 - 1x + 1x +
          x = x,
    227 - 1x + 1x +
          varname = varname,
    228 - 1x + 1x +
          varlabel = varlabel,
    229 - 1x + 1x +
          dataname = dataname,
    230 - 1x + 1x +
          extract_type = extract_type
    @@ -17053,56 +17593,64 @@

    teal.slice coverage - 57.02%

    242 - 2x + 2x +
      if (is.null(varlabel)) varlabel <- character(0)
    243 - 2x + 2x +
      if (length(unique(x[!is.na(x)])) < getOption("teal.threshold_slider_vs_checkboxgroup")) {
    244 - 1x + 1x +
        ChoicesFilterState$new(
    245 - 1x + 1x +
          x = x,
    246 - 1x + 1x +
          varname = varname,
    247 - 1x + 1x +
          varlabel = varlabel,
    248 - 1x + 1x +
          dataname = dataname,
    249 - 1x + 1x +
          extract_type = extract_type
    @@ -17123,42 +17671,48 @@

    teal.slice coverage - 57.02%

    252 - 1x + 1x +
        DatetimeFilterState$new(
    253 - 1x + 1x +
          x = x,
    254 - 1x + 1x +
          varname = varname,
    255 - 1x + 1x +
          varlabel = varlabel,
    256 - 1x + 1x +
          dataname = dataname,
    257 - 1x + 1x +
          extract_type = extract_type
    @@ -17326,14 +17880,16 @@

    teal.slice coverage - 57.02%

    281 - 81x + 81x +
      epsilon <- .Machine$double.eps^0.5 # needed for floating point arithmetic; same value as in base::all.equal()
    282 - 81x + 81x +
      if ((length(subinterval) != 2)) {
    @@ -17396,42 +17952,48 @@

    teal.slice coverage - 57.02%

    291 - 81x + 81x +
      if (subinterval[[2]] + epsilon < subinterval[[1]]) {
    292 - 2x + 2x +
        stop(sprintf(
    293 - 2x + 2x +
          "%s unexpected: the upper bound of the range lower than the lower bound \n %s < %s",
    294 - 2x + 2x +
          pre_msg,
    295 - 2x + 2x +
          subinterval[[2]],
    296 - 2x + 2x +
          subinterval[[1]]
    @@ -17459,7 +18021,8 @@

    teal.slice coverage - 57.02%

    300 - 79x + 79x +
      if ((subinterval[[1]] + epsilon < range[[1]]) || (subinterval[[2]] - epsilon > range[[2]])) {
    @@ -17669,7 +18232,8 @@

    teal.slice coverage - 57.02%

    330 - 333x + 333x +
      checkmate::assert_string(pre_msg)
    @@ -17683,14 +18247,16 @@

    teal.slice coverage - 57.02%

    332 - 333x + 333x +
      subset <- unique(subset)
    333 - 333x + 333x +
      choices <- unique(choices)
    @@ -17704,49 +18270,56 @@

    teal.slice coverage - 57.02%

    335 - 333x + 333x +
      if (any(!(subset %in% choices))) {
    336 - 3x + 3x +
        stop(paste0(
    337 - 3x + 3x +
          pre_msg,
    338 - 3x + 3x +
          "(", toString(subset[!(subset %in% choices)], width = 30), ")",
    339 - 3x + 3x +
          " not in valid choices ",
    340 - 3x + 3x +
          "(", toString(choices, width = 30), ")"
    341 - 3x + 3x +
        ), call. = FALSE)
    @@ -17760,7 +18333,8 @@

    teal.slice coverage - 57.02%

    343 - 330x + 330x +
      return(invisible(NULL))
    @@ -18026,14 +18600,16 @@

    teal.slice coverage - 57.02%

    381 - 169x + 169x +
      checkmate::assert_numeric(x, len = 2L, any.missing = FALSE, sorted = TRUE)
    382 - 165x + 165x +
      checkmate::assert_numeric(range, min.len = 2L, any.missing = FALSE, sorted = TRUE)
    @@ -18047,21 +18623,24 @@

    teal.slice coverage - 57.02%

    384 - 161x + 161x +
      x[1] <- Find(function(i) i <= x[1], range, nomatch = min(range), right = TRUE)
    385 - 161x + 161x +
      x[2] <- Find(function(i) i >= x[2], range, nomatch = max(range))
    386 - 161x + 161x +
      x
    @@ -18543,14 +19122,16 @@

    teal.slice coverage - 57.02%

    67 - 392x + 392x +
          checkmate::assert_string(dataname)
    68 - 390x + 390x +
          checkmate::assert_character(datalabel, max.len = 1, any.missing = FALSE)
    @@ -18564,14 +19145,16 @@

    teal.slice coverage - 57.02%

    70 - 390x + 390x +
          private$dataname <- dataname
    71 - 390x + 390x +
          private$datalabel <- datalabel
    @@ -18585,14 +19168,16 @@

    teal.slice coverage - 57.02%

    73 - 390x + 390x +
          logger::log_trace("Instantiated { class(self)[1] }, dataname: { private$dataname }")
    74 - 390x + 390x +
          invisible(self)
    @@ -18655,7 +19240,8 @@

    teal.slice coverage - 57.02%

    83 - 5x + 5x +
          private$datalabel
    @@ -18907,84 +19493,96 @@

    teal.slice coverage - 57.02%

    119 - 120x + 120x +
          states_list <- private$state_list
    120 - 120x + 120x +
          filter_items <- sapply(
    121 - 120x + 120x +
            X = states_list,
    122 - 120x + 120x +
            USE.NAMES = TRUE,
    123 - 120x + 120x +
            simplify = FALSE,
    124 - 120x + 120x +
            function(state_list) {
    125 - 165x + 165x +
              items <- state_list()
    126 - 165x + 165x +
              filtered_items <- Filter(f = function(x) x$is_any_filtered(), x = items)
    127 - 165x + 165x +
              calls <- lapply(
    128 - 165x + 165x +
                filtered_items,
    129 - 165x + 165x +
                function(state) {
    130 - 68x + 68x +
                  state$get_call()
    @@ -19005,7 +19603,8 @@

    teal.slice coverage - 57.02%

    133 - 165x + 165x +
              calls_combine_by(calls, operator = "&")
    @@ -19026,21 +19625,24 @@

    teal.slice coverage - 57.02%

    136 - 120x + 120x +
          filter_items <- Filter(
    137 - 120x + 120x +
            x = filter_items,
    138 - 120x + 120x +
            f = Negate(is.null)
    @@ -19054,49 +19656,56 @@

    teal.slice coverage - 57.02%

    140 - 120x + 120x +
          if (length(filter_items) > 0L) {
    141 - 44x + 44x +
            filter_function <- str2lang(self$get_fun())
    142 - 44x + 44x +
            data_name <- str2lang(private$dataname)
    143 - 44x + 44x +
            substitute(
    144 - 44x + 44x +
              env = list(
    145 - 44x + 44x +
                lhs = data_name,
    146 - 44x + 44x +
                rhs = as.call(c(filter_function, c(list(data_name), filter_items)))
    @@ -19110,7 +19719,8 @@

    teal.slice coverage - 57.02%

    148 - 44x + 44x +
              expr = lhs <- rhs
    @@ -19138,7 +19748,8 @@

    teal.slice coverage - 57.02%

    152 - 76x + 76x +
            NULL
    @@ -19285,7 +19896,8 @@

    teal.slice coverage - 57.02%

    173 - 12x + 12x +
          "subset"
    @@ -19397,14 +20009,16 @@

    teal.slice coverage - 57.02%

    189 - 503x + 503x +
          private$validate_state_list_exists(state_list_index)
    190 - 501x + 501x +
          checkmate::assert_string(state_id, null.ok = TRUE)
    @@ -19418,14 +20032,16 @@

    teal.slice coverage - 57.02%

    192 - 501x + 501x +
          if (is.null(state_id)) {
    193 - 498x + 498x +
            private$state_list[[state_list_index]]()
    @@ -19439,7 +20055,8 @@

    teal.slice coverage - 57.02%

    195 - 3x + 3x +
            private$state_list[[state_list_index]]()[[state_id]]
    @@ -19565,14 +20182,16 @@

    teal.slice coverage - 57.02%

    213 - 206x + 206x +
          logger::log_trace(
    214 - 206x + 206x +
            "{ class(self)[1] } pushing into state_list, dataname: { private$dataname }"
    @@ -19586,14 +20205,16 @@

    teal.slice coverage - 57.02%

    216 - 206x + 206x +
          private$validate_state_list_exists(state_list_index)
    217 - 205x + 205x +
          checkmate::assert_string(state_id)
    @@ -19607,7 +20228,8 @@

    teal.slice coverage - 57.02%

    219 - 205x + 205x +
          states <- if (is.list(x)) {
    @@ -19628,7 +20250,8 @@

    teal.slice coverage - 57.02%

    222 - 205x + 205x +
            list(x)
    @@ -19649,21 +20272,24 @@

    teal.slice coverage - 57.02%

    225 - 205x + 205x +
          state <- stats::setNames(states, state_id)
    226 - 205x + 205x +
          new_state_list <- c(private$state_list[[state_list_index]](), state)
    227 - 205x + 205x +
          private$state_list[[state_list_index]](new_state_list)
    @@ -19677,14 +20303,16 @@

    teal.slice coverage - 57.02%

    229 - 205x + 205x +
          logger::log_trace(
    230 - 205x + 205x +
            "{ class(self)[1] } pushed into queue, dataname: { private$dataname }"
    @@ -19698,7 +20326,8 @@

    teal.slice coverage - 57.02%

    232 - 205x + 205x +
          invisible(NULL)
    @@ -19817,21 +20446,24 @@

    teal.slice coverage - 57.02%

    249 - 28x + 28x +
          logger::log_trace(paste(
    250 - 28x + 28x +
            "{ class(self)[1] } removing a filter from state_list { state_list_index },",
    251 - 28x + 28x +
            "dataname: { private$dataname }"
    @@ -19845,35 +20477,40 @@

    teal.slice coverage - 57.02%

    253 - 28x + 28x +
          private$validate_state_list_exists(state_list_index)
    254 - 27x + 27x +
          checkmate::assert_string(state_id)
    255 - 27x + 27x +
          checkmate::assert(
    256 - 27x + 27x +
            checkmate::check_string(state_list_index),
    257 - 27x + 27x +
            checkmate::check_int(state_list_index)
    @@ -19894,21 +20531,24 @@

    teal.slice coverage - 57.02%

    260 - 27x + 27x +
          new_state_list <- private$state_list[[state_list_index]]()
    261 - 27x + 27x +
          new_state_list[[state_id]] <- NULL
    262 - 27x + 27x +
          private$state_list[[state_list_index]](new_state_list)
    @@ -19922,21 +20562,24 @@

    teal.slice coverage - 57.02%

    264 - 27x + 27x +
          logger::log_trace(paste(
    265 - 27x + 27x +
            "{ class(self)[1] } removed from state_list { state_list_index },",
    266 - 27x + 27x +
            "dataname: { private$dataname }"
    @@ -19950,7 +20593,8 @@

    teal.slice coverage - 57.02%

    268 - 27x + 27x +
          invisible(NULL)
    @@ -20013,14 +20657,16 @@

    teal.slice coverage - 57.02%

    277 - 24x + 24x +
          logger::log_trace(
    278 - 24x + 24x +
            "{ class(self)[1] } emptying state_list, dataname: { private$dataname }"
    @@ -20041,14 +20687,16 @@

    teal.slice coverage - 57.02%

    281 - 24x + 24x +
          for (i in seq_along(private$state_list)) {
    282 - 28x + 28x +
            private$state_list[[i]](list())
    @@ -20069,14 +20717,16 @@

    teal.slice coverage - 57.02%

    285 - 24x + 24x +
          logger::log_trace(
    286 - 24x + 24x +
            "{ class(self)[1] } emptied state_list, dataname: { private$dataname }"
    @@ -20090,7 +20740,8 @@

    teal.slice coverage - 57.02%

    288 - 24x + 24x +
          invisible(NULL)
    @@ -20153,21 +20804,24 @@

    teal.slice coverage - 57.02%

    297 - 66x + 66x +
          sum(vapply(private$state_list, function(state_list) {
    298 - 103x + 103x +
            length(state_list())
    299 - 66x + 66x +
          }, FUN.VALUE = integer(1)))
    @@ -21693,28 +22347,32 @@

    teal.slice coverage - 57.02%

    517 - 4x + 4x +
          state_list_id <- sprintf("%s-%s", state_list_index, state_id)
    518 - 4x + 4x +
          removeUI(selector = sprintf("#%s", private$card_ids[state_list_id]))
    519 - 4x + 4x +
          private$card_ids <- private$card_ids[names(private$card_ids) != state_list_id]
    520 - 4x + 4x +
          if (length(private$observers[[state_list_id]]) > 0) {
    @@ -21756,35 +22414,40 @@

    teal.slice coverage - 57.02%

    526 - 4x + 4x +
          prefix <- paste0(gsub("cards$", "", private$cards_container_id))
    527 - 4x + 4x +
          invisible(
    528 - 4x + 4x +
            lapply(
    529 - 4x + 4x +
              unique(grep(state_id, names(.input), value = TRUE)),
    530 - 4x + 4x +
              function(i) {
    @@ -21847,21 +22510,24 @@

    teal.slice coverage - 57.02%

    539 - 737x + 737x +
          checkmate::assert(
    540 - 737x + 737x +
            checkmate::check_string(state_list_index),
    541 - 737x + 737x +
            checkmate::check_int(state_list_index)
    @@ -21889,21 +22555,24 @@

    teal.slice coverage - 57.02%

    545 - 737x + 737x +
              is.numeric(state_list_index) &&
    546 - 737x + 737x +
                all(state_list_index <= length(private$state_list) && state_list_index > 0) ||
    547 - 737x + 737x +
                is.character(state_list_index) && all(state_list_index %in% names(private$state_list))
    @@ -21924,42 +22593,48 @@

    teal.slice coverage - 57.02%

    550 - 4x + 4x +
            stop(
    551 - 4x + 4x +
              paste(
    552 - 4x + 4x +
                "Filter state list",
    553 - 4x + 4x +
                state_list_index,
    554 - 4x + 4x +
                "has not been initialized in FilterStates object belonging to the dataset",
    555 - 4x + 4x +
                private$datalabel
    @@ -22043,35 +22718,40 @@

    teal.slice coverage - 57.02%

    567 - 10x + 10x +
          checkmate::assert_character(keys, null.ok = TRUE)
    568 - 10x + 10x +
          checkmate::assert_character(prefix, len = 1)
    569 - 10x + 10x +
          sanitized_values <- make.unique(gsub("[^[:alnum:]]", perl = TRUE, replacement = "", x = keys))
    570 - 10x + 10x +
          sanitized_values <- paste(prefix, "var", sanitized_values, sep = "_")
    571 - 10x + 10x +
          stats::setNames(object = sanitized_values, nm = keys)
    @@ -22567,28 +23247,32 @@

    teal.slice coverage - 57.02%

    67 - 15x + 15x +
          datanames <- super$datanames()
    68 - 15x + 15x +
          child_parent <- sapply(datanames, function(i) self$get_parentname(i), USE.NAMES = TRUE, simplify = FALSE)
    69 - 15x + 15x +
          ordered_datanames <- topological_sort(child_parent)
    70 - 15x + 15x +
          return(as.character(intersect(as.character(ordered_datanames), datanames)))
    @@ -22672,7 +23356,8 @@

    teal.slice coverage - 57.02%

    82 - 13x + 13x +
          parent_dataname <- self$get_parentname(dataname)
    @@ -22686,14 +23371,16 @@

    teal.slice coverage - 57.02%

    84 - 13x + 13x +
          if (length(parent_dataname) == 0) {
    85 - 12x + 12x +
            super$get_call(dataname)
    @@ -22707,42 +23394,48 @@

    teal.slice coverage - 57.02%

    87 - 1x + 1x +
            dataset <- self$get_filtered_dataset(dataname)
    88 - 1x + 1x +
            premerge_call <- Filter(
    89 - 1x + 1x +
              f = Negate(is.null),
    90 - 1x + 1x +
              x = lapply(
    91 - 1x + 1x +
                dataset$get_filter_states(),
    92 - 1x + 1x +
                function(x) x$get_call()
    @@ -22770,28 +23463,32 @@

    teal.slice coverage - 57.02%

    96 - 1x + 1x +
            join_keys <- self$get_join_keys()
    97 - 1x + 1x +
            keys <-
    98 - 1x + 1x +
              if (!is.null(join_keys)) {
    99 - 1x + 1x +
                join_keys$get(parent_dataname, dataname)
    @@ -22819,14 +23516,16 @@

    teal.slice coverage - 57.02%

    103 - 1x + 1x +
            parent_keys <- names(keys)
    104 - 1x + 1x +
            dataset_keys <- unname(keys)
    @@ -22840,14 +23539,16 @@

    teal.slice coverage - 57.02%

    106 - 1x + 1x +
            y_arg <-
    107 - 1x + 1x +
              if (length(parent_keys) == 0L) {
    @@ -22868,7 +23569,8 @@

    teal.slice coverage - 57.02%

    110 - 1x + 1x +
                sprintf("%s[, c(%s), drop = FALSE]", parent_dataname, toString(dQuote(parent_keys, q = FALSE)))
    @@ -22882,14 +23584,16 @@

    teal.slice coverage - 57.02%

    112 - 1x + 1x +
            more_args <-
    113 - 1x + 1x +
              if (length(parent_keys) == 0 || length(dataset_keys) == 0) {
    @@ -22903,14 +23607,16 @@

    teal.slice coverage - 57.02%

    115 - 1x + 1x +
              } else if (identical(parent_keys, dataset_keys)) {
    116 - 1x + 1x +
                list(by = parent_keys)
    @@ -22945,7 +23651,8 @@

    teal.slice coverage - 57.02%

    121 - 1x + 1x +
            merge_call <- call(
    @@ -22959,49 +23666,56 @@

    teal.slice coverage - 57.02%

    123 - 1x + 1x +
              as.name(dataname),
    124 - 1x + 1x +
              as.call(
    125 - 1x + 1x +
                c(
    126 - 1x + 1x +
                  str2lang("dplyr::inner_join"),
    127 - 1x + 1x +
                  x = as.name(dataname),
    128 - 1x + 1x +
                  y = str2lang(y_arg),
    129 - 1x + 1x +
                  more_args
    @@ -23036,7 +23750,8 @@

    teal.slice coverage - 57.02%

    134 - 1x + 1x +
            c(premerge_call, merge_call)
    @@ -23232,21 +23947,24 @@

    teal.slice coverage - 57.02%

    162 - 8x + 8x +
          varnames <- self$get_filtered_dataset(dataname)$get_filterable_varnames()
    163 - 8x + 8x +
          parent_dataname <- self$get_parentname(dataname)
    164 - 8x + 8x +
          parent_varnames <- if (length(parent_dataname) > 0) {
    @@ -23267,7 +23985,8 @@

    teal.slice coverage - 57.02%

    167 - 5x + 5x +
            get_supported_filter_varnames(self$get_filtered_dataset(parent_dataname))
    @@ -23281,7 +24000,8 @@

    teal.slice coverage - 57.02%

    169 - 8x + 8x +
          setdiff(varnames, parent_varnames)
    @@ -23365,14 +24085,16 @@

    teal.slice coverage - 57.02%

    181 - 10x + 10x +
          if (identical(datanames, "all")) {
    182 - 1x + 1x +
            datanames <- self$datanames()
    @@ -23386,7 +24108,8 @@

    teal.slice coverage - 57.02%

    184 - 9x + 9x +
          check_in_subset(datanames, self$datanames(), "Some datasets are not available: ")
    @@ -23400,42 +24123,48 @@

    teal.slice coverage - 57.02%

    186 - 6x + 6x +
          rows <- lapply(
    187 - 6x + 6x +
            datanames,
    188 - 6x + 6x +
            function(dataname) {
    189 - 12x + 12x +
              obs <- self$get_filtered_dataset(dataname)$get_filter_overview_info(
    190 - 12x + 12x +
                filtered_dataset = self$get_data(dataname = dataname, filtered = TRUE)
    191 - 12x + 12x +
              )[, 1]
    @@ -23449,7 +24178,8 @@

    teal.slice coverage - 57.02%

    193 - 12x + 12x +
              subs <- private$get_filter_overview_nsubjs(dataname)
    @@ -23463,14 +24193,16 @@

    teal.slice coverage - 57.02%

    195 - 12x + 12x +
              df <- cbind(
    196 - 12x + 12x +
                obs, subs
    @@ -23491,14 +24223,16 @@

    teal.slice coverage - 57.02%

    199 - 12x + 12x +
              rownames(df) <- if (!is.null(names(obs))) {
    200 - 4x + 4x +
                names(obs)
    @@ -23512,7 +24246,8 @@

    teal.slice coverage - 57.02%

    202 - 8x + 8x +
                dataname
    @@ -23526,14 +24261,16 @@

    teal.slice coverage - 57.02%

    204 - 12x + 12x +
              colnames(df) <- c("Obs", "Subjects")
    205 - 12x + 12x +
              df
    @@ -23561,7 +24298,8 @@

    teal.slice coverage - 57.02%

    209 - 6x + 6x +
          do.call(rbind, rows)
    @@ -23624,7 +24362,8 @@

    teal.slice coverage - 57.02%

    218 - 77x + 77x +
          private$parents[[dataname]]
    @@ -23750,14 +24489,16 @@

    teal.slice coverage - 57.02%

    236 - 40x + 40x +
          logger::log_trace("CDISCFilteredData$set_dataset setting dataset, name: { dataname }")
    237 - 40x + 40x +
          validate_dataset_args(dataset_args, dataname, allowed_parent = TRUE)
    @@ -23771,21 +24512,24 @@

    teal.slice coverage - 57.02%

    239 - 40x + 40x +
          parent_dataname <- dataset_args[["parent"]]
    240 - 40x + 40x +
          dataset_args[["parent"]] <- NULL
    241 - 40x + 40x +
          private$parents[[dataname]] <- parent_dataname
    @@ -23799,14 +24543,16 @@

    teal.slice coverage - 57.02%

    243 - 40x + 40x +
          if (length(parent_dataname) == 0) {
    244 - 30x + 30x +
            super$set_dataset(dataset_args, dataname)
    @@ -23820,14 +24566,16 @@

    teal.slice coverage - 57.02%

    246 - 10x + 10x +
            dataset <- dataset_args[["dataset"]]
    247 - 10x + 10x +
            dataset_args[["dataset"]] <- NULL
    @@ -23848,28 +24596,32 @@

    teal.slice coverage - 57.02%

    250 - 10x + 10x +
            check_simple_name(dataname)
    251 - 10x + 10x +
            private$filtered_datasets[[dataname]] <- do.call(
    252 - 10x + 10x +
              what = init_filtered_dataset,
    253 - 10x + 10x +
              args = c(list(dataset), dataset_args, list(dataname = dataname))
    @@ -23890,7 +24642,8 @@

    teal.slice coverage - 57.02%

    256 - 10x + 10x +
            private$reactive_data[[dataname]] <- reactive({
    @@ -23974,7 +24727,8 @@

    teal.slice coverage - 57.02%

    268 - 40x + 40x +
          invisible(self)
    @@ -24128,7 +24882,8 @@

    teal.slice coverage - 57.02%

    290 - 12x + 12x +
          subject_keys <- if (length(self$get_parentname(dataname)) > 0) {
    @@ -24149,7 +24904,8 @@

    teal.slice coverage - 57.02%

    293 - 12x + 12x +
            self$get_filtered_dataset(dataname)$get_keys()
    @@ -24170,21 +24926,24 @@

    teal.slice coverage - 57.02%

    296 - 12x + 12x +
          self$get_filtered_dataset(dataname)$get_filter_overview_nsubjs(
    297 - 12x + 12x +
            self$get_data(dataname = dataname, filtered = TRUE),
    298 - 12x + 12x +
            subject_keys
    @@ -24352,35 +25111,40 @@

    teal.slice coverage - 57.02%

    322 - 15x + 15x +
      in_degrees <- list()
    323 - 15x + 15x +
      for (node in names(graph)) {
    324 - 42x + 42x +
        in_degrees[[node]] <- 0
    325 - 42x + 42x +
        for (to_edge in graph[[node]]) {
    326 - 3x + 3x +
          in_degrees[[to_edge]] <- 0
    @@ -24408,21 +25172,24 @@

    teal.slice coverage - 57.02%

    330 - 15x + 15x +
      for (node in graph) {
    331 - 42x + 42x +
        for (to_edge in node) {
    332 - 3x + 3x +
          in_degrees[[to_edge]] <- in_degrees[[to_edge]] + 1
    @@ -24457,35 +25224,40 @@

    teal.slice coverage - 57.02%

    337 - 15x + 15x +
      visited <- 0
    338 - 15x + 15x +
      sorted <- list()
    339 - 15x + 15x +
      zero_in <- list()
    340 - 15x + 15x +
      for (node in names(in_degrees)) {
    341 - 39x + 39x +
        if (in_degrees[[node]] == 0) zero_in <- append(zero_in, node)
    @@ -24499,7 +25271,8 @@

    teal.slice coverage - 57.02%

    343 - 15x + 15x +
      zero_in <- rev(zero_in)
    @@ -24513,49 +25286,56 @@

    teal.slice coverage - 57.02%

    345 - 15x + 15x +
      while (length(zero_in) != 0) {
    346 - 42x + 42x +
        visited <- visited + 1
    347 - 42x + 42x +
        sorted <- c(zero_in[[1]], sorted)
    348 - 42x + 42x +
        for (edge_to in graph[[zero_in[[1]]]]) {
    349 - 3x + 3x +
          in_degrees[[edge_to]] <- in_degrees[[edge_to]] - 1
    350 - 3x + 3x +
          if (in_degrees[[edge_to]] == 0) {
    351 - 3x + 3x +
            zero_in <- append(zero_in, edge_to, 1)
    @@ -24576,7 +25356,8 @@

    teal.slice coverage - 57.02%

    354 - 42x + 42x +
        zero_in[[1]] <- NULL
    @@ -24597,7 +25378,8 @@

    teal.slice coverage - 57.02%

    357 - 15x + 15x +
      if (visited != length(in_degrees)) {
    @@ -24639,7 +25421,8 @@

    teal.slice coverage - 57.02%

    363 - 15x + 15x +
        return(sorted)
    @@ -25177,42 +25960,48 @@

    teal.slice coverage - 57.02%

    74 - 356x + 356x +
          checkmate::assert_string(varname)
    75 - 353x + 353x +
          checkmate::assert_character(varlabel, max.len = 1, any.missing = FALSE)
    76 - 353x + 353x +
          checkmate::assert_string(dataname, null.ok = TRUE)
    77 - 353x + 353x +
          checkmate::assert_character(extract_type, max.len = 1, any.missing = FALSE)
    78 - 353x + 353x +
          if (length(extract_type) == 1) {
    79 - 53x + 53x +
            checkmate::assert_choice(extract_type, choices = c("list", "matrix"))
    @@ -25226,14 +26015,16 @@

    teal.slice coverage - 57.02%

    81 - 353x + 353x +
          if (length(extract_type) == 1 && is.null(dataname)) {
    82 - 1x + 1x +
            stop("if extract_type is specified, dataname must also be specified")
    @@ -25254,21 +26045,24 @@

    teal.slice coverage - 57.02%

    85 - 352x + 352x +
          private$dataname <- dataname
    86 - 352x + 352x +
          private$varname <- varname
    87 - 352x + 352x +
          private$varlabel <- if (identical(varlabel, as.character(varname))) {
    @@ -25282,7 +26076,8 @@

    teal.slice coverage - 57.02%

    89 - 41x + 41x +
            character(0)
    @@ -25296,7 +26091,8 @@

    teal.slice coverage - 57.02%

    91 - 311x + 311x +
            varlabel
    @@ -25310,70 +26106,80 @@

    teal.slice coverage - 57.02%

    93 - 352x + 352x +
          private$extract_type <- extract_type
    94 - 352x + 352x +
          private$selected <- reactiveVal(NULL)
    95 - 352x + 352x +
          private$na_count <- sum(is.na(x))
    96 - 352x + 352x +
          private$keep_na <- reactiveVal(FALSE)
    97 - 352x + 352x +
          logger::log_trace(
    98 - 352x + 352x +
            sprintf(
    99 - 352x + 352x +
              "Instantiated %s with variable %s, dataname: %s",
    100 - 352x + 352x +
              class(self)[1],
    101 - 352x + 352x +
              private$varname,
    102 - 352x + 352x +
              private$dataname
    @@ -25394,7 +26200,8 @@

    teal.slice coverage - 57.02%

    105 - 352x + 352x +
          invisible(self)
    @@ -25576,14 +26383,16 @@

    teal.slice coverage - 57.02%

    131 - 50x + 50x +
          checkmate::assert_number(indent, finite = TRUE, lower = 0L)
    132 - 49x + 49x +
          checkmate::assert_number(wrap_width, finite = TRUE, lower = 30L, upper = 120L)
    @@ -25604,42 +26413,48 @@

    teal.slice coverage - 57.02%

    135 - 48x + 48x +
          values <- paste(format(self$get_selected(), nsmall = 3L, justify = "none"), collapse = ", ")
    136 - 48x + 48x +
          paste(c(
    137 - 48x + 48x +
            strwrap(
    138 - 48x + 48x +
              sprintf("Filtering on: %s", private$varname),
    139 - 48x + 48x +
              width = wrap_width,
    140 - 48x + 48x +
              indent = indent
    @@ -25660,35 +26475,40 @@

    teal.slice coverage - 57.02%

    143 - 48x + 48x +
            strwrap(
    144 - 48x + 48x +
              sprintf("Selected values: %s", values),
    145 - 48x + 48x +
              width = wrap_width,
    146 - 48x + 48x +
              indent = indent + 2L,
    147 - 48x + 48x +
              exdent = indent + 4L
    @@ -25702,28 +26522,32 @@

    teal.slice coverage - 57.02%

    149 - 48x + 48x +
            strwrap(
    150 - 48x + 48x +
              sprintf("Include missing values: %s", self$get_keep_na()),
    151 - 48x + 48x +
              width = wrap_width,
    152 - 48x + 48x +
              indent = indent + 2L
    @@ -25737,7 +26561,8 @@

    teal.slice coverage - 57.02%

    154 - 48x + 48x +
          ), collapse = "\n")
    @@ -25807,7 +26632,8 @@

    teal.slice coverage - 57.02%

    164 - 1x + 1x +
          NULL
    @@ -25870,14 +26696,16 @@

    teal.slice coverage - 57.02%

    173 - 409x + 409x +
          if (!is.null(private$dataname)) {
    174 - 221x + 221x +
            private$dataname
    @@ -25891,7 +26719,8 @@

    teal.slice coverage - 57.02%

    176 - 188x + 188x +
            character(1)
    @@ -25961,7 +26790,8 @@

    teal.slice coverage - 57.02%

    186 - 335x + 335x +
          private$keep_na()
    @@ -26024,7 +26854,8 @@

    teal.slice coverage - 57.02%

    195 - 2x + 2x +
          private$varlabel
    @@ -26087,7 +26918,8 @@

    teal.slice coverage - 57.02%

    204 - 423x + 423x +
          private$varname
    @@ -26150,7 +26982,8 @@

    teal.slice coverage - 57.02%

    213 - 428x + 428x +
          private$selected()
    @@ -26227,21 +27060,24 @@

    teal.slice coverage - 57.02%

    224 - 38x + 38x +
          list(
    225 - 38x + 38x +
            selected = self$get_selected(),
    226 - 38x + 38x +
            keep_na = self$get_keep_na()
    @@ -26409,56 +27245,64 @@

    teal.slice coverage - 57.02%

    250 - 117x + 117x +
          checkmate::assert_flag(value)
    251 - 117x + 117x +
          private$keep_na(value)
    252 - 117x + 117x +
          logger::log_trace(
    253 - 117x + 117x +
            sprintf(
    254 - 117x + 117x +
              "%s$set_keep_na set for variable %s to %s.",
    255 - 117x + 117x +
              class(self)[1],
    256 - 117x + 117x +
              private$varname,
    257 - 117x + 117x +
              value
    @@ -26479,7 +27323,8 @@

    teal.slice coverage - 57.02%

    260 - 117x + 117x +
          invisible(NULL)
    @@ -26584,21 +27429,24 @@

    teal.slice coverage - 57.02%

    275 - 48x + 48x +
          checkmate::assert_flag(value)
    276 - 48x + 48x +
          private$na_rm <- value
    277 - 48x + 48x +
          invisible(NULL)
    @@ -26703,42 +27551,48 @@

    teal.slice coverage - 57.02%

    292 - 580x + 580x +
          logger::log_trace(
    293 - 580x + 580x +
            sprintf(
    294 - 580x + 580x +
              "%s$set_selected setting selection of variable %s, dataname: %s.",
    295 - 580x + 580x +
              class(self)[1],
    296 - 580x + 580x +
              private$varname,
    297 - 580x + 580x +
              private$dataname
    @@ -26759,63 +27613,72 @@

    teal.slice coverage - 57.02%

    300 - 580x + 580x +
          value <- private$cast_and_validate(value)
    301 - 577x + 577x +
          value <- private$remove_out_of_bound_values(value)
    302 - 577x + 577x +
          private$validate_selection(value)
    303 - 573x + 573x +
          private$selected(value)
    304 - 573x + 573x +
          logger::log_trace(sprintf(
    305 - 573x + 573x +
            "%s$set_selected selection of variable %s set, dataname: %s",
    306 - 573x + 573x +
            class(self)[1],
    307 - 573x + 573x +
            private$varname,
    308 - 573x + 573x +
            private$dataname
    @@ -26829,7 +27692,8 @@

    teal.slice coverage - 57.02%

    310 - 573x + 573x +
          invisible(NULL)
    @@ -26941,49 +27805,56 @@

    teal.slice coverage - 57.02%

    326 - 191x + 191x +
          logger::log_trace(sprintf(
    327 - 191x + 191x +
            "%s$set_state, dataname: %s setting state of variable %s to: selected=%s, keep_na=%s",
    328 - 191x + 191x +
            class(self)[1],
    329 - 191x + 191x +
            private$dataname,
    330 - 191x + 191x +
            private$varname,
    331 - 191x + 191x +
            paste(state$selected, collapse = " "),
    332 - 191x + 191x +
            state$keep_na
    @@ -26997,21 +27868,24 @@

    teal.slice coverage - 57.02%

    334 - 191x + 191x +
          stopifnot(is.list(state) && all(names(state) %in% c("selected", "keep_na")))
    335 - 187x + 187x +
          if (!is.null(state$keep_na)) {
    336 - 68x + 68x +
            self$set_keep_na(state$keep_na)
    @@ -27025,14 +27899,16 @@

    teal.slice coverage - 57.02%

    338 - 187x + 187x +
          if (!is.null(state$selected)) {
    339 - 182x + 182x +
            self$set_selected(state$selected)
    @@ -27046,42 +27922,48 @@

    teal.slice coverage - 57.02%

    341 - 187x + 187x +
          logger::log_trace(
    342 - 187x + 187x +
            sprintf(
    343 - 187x + 187x +
              "%s$set_state, dataname: %s done setting state for variable %s",
    344 - 187x + 187x +
              class(self)[1],
    345 - 187x + 187x +
              private$dataname,
    346 - 187x + 187x +
              private$varname
    @@ -27102,7 +27984,8 @@

    teal.slice coverage - 57.02%

    349 - 187x + 187x +
          invisible(NULL)
    @@ -27690,35 +28573,40 @@

    teal.slice coverage - 57.02%

    433 - 191x + 191x +
          ans <-
    434 - 191x + 191x +
            if (isTRUE(private$extract_type == "list")) {
    435 - 25x + 25x +
              sprintf("%s$%s", private$dataname, private$varname)
    436 - 191x + 191x +
            } else if (isTRUE(private$extract_type == "matrix")) {
    437 - 5x + 5x +
              sprintf("%s[, \"%s\"]", private$dataname, private$varname)
    @@ -27732,7 +28620,8 @@

    teal.slice coverage - 57.02%

    439 - 161x + 161x +
              private$varname
    @@ -27746,7 +28635,8 @@

    teal.slice coverage - 57.02%

    441 - 191x + 191x +
          str2lang(ans)
    @@ -27809,28 +28699,32 @@

    teal.slice coverage - 57.02%

    450 - 123x + 123x +
          if (isTRUE(self$get_keep_na())) {
    451 - 13x + 13x +
            call("|", call("is.na", private$get_varname_prefixed()), filter_call)
    452 - 110x + 110x +
          } else if (isTRUE(private$na_rm) && private$na_count > 0L) {
    453 - 5x + 5x +
            call(
    @@ -27844,14 +28738,16 @@

    teal.slice coverage - 57.02%

    455 - 5x + 5x +
              call("!", call("is.na", private$get_varname_prefixed())),
    456 - 5x + 5x +
              filter_call
    @@ -27872,7 +28768,8 @@

    teal.slice coverage - 57.02%

    459 - 105x + 105x +
            filter_call
    @@ -27998,14 +28895,16 @@

    teal.slice coverage - 57.02%

    477 - 295x + 295x +
          private$choices <- choices
    478 - 295x + 295x +
          invisible(NULL)
    @@ -28054,7 +28953,8 @@

    teal.slice coverage - 57.02%

    485 - 13x + 13x +
          invisible(NULL)
    @@ -28124,7 +29024,8 @@

    teal.slice coverage - 57.02%

    495 - 57x + 57x +
          values
    @@ -28215,7 +29116,8 @@

    teal.slice coverage - 57.02%

    508 - 13x + 13x +
          values
    @@ -29180,7 +30082,8 @@

    teal.slice coverage - 57.02%

    56 - 275x + 275x +
      UseMethod("init_filter_states")
    @@ -29257,35 +30160,40 @@

    teal.slice coverage - 57.02%

    67 - 110x + 110x +
      DFFilterStates$new(
    68 - 110x + 110x +
        dataname = dataname,
    69 - 110x + 110x +
        datalabel = datalabel,
    70 - 110x + 110x +
        varlabels = varlabels,
    71 - 110x + 110x +
        keys = keys
    @@ -29355,21 +30263,24 @@

    teal.slice coverage - 57.02%

    81 - 28x + 28x +
      MatrixFilterStates$new(
    82 - 28x + 28x +
        dataname = dataname,
    83 - 28x + 28x +
        datalabel = datalabel
    @@ -29453,7 +30364,8 @@

    teal.slice coverage - 57.02%

    95 - 28x + 28x +
      if (!requireNamespace("MultiAssayExperiment", quietly = TRUE)) {
    @@ -29474,35 +30386,40 @@

    teal.slice coverage - 57.02%

    98 - 28x + 28x +
      MAEFilterStates$new(
    99 - 28x + 28x +
        dataname = dataname,
    100 - 28x + 28x +
        datalabel = datalabel,
    101 - 28x + 28x +
        varlabels = varlabels,
    102 - 28x + 28x +
        keys = keys
    @@ -29572,7 +30489,8 @@

    teal.slice coverage - 57.02%

    112 - 109x + 109x +
      if (!requireNamespace("SummarizedExperiment", quietly = TRUE)) {
    @@ -29593,21 +30511,24 @@

    teal.slice coverage - 57.02%

    115 - 109x + 109x +
      SEFilterStates$new(
    116 - 109x + 109x +
        dataname = dataname,
    117 - 109x + 109x +
        datalabel = datalabel
    @@ -29768,7 +30689,8 @@

    teal.slice coverage - 57.02%

    140 - 133x + 133x +
      UseMethod("get_supported_filter_varnames")
    @@ -29810,28 +30732,32 @@

    teal.slice coverage - 57.02%

    146 - 75x + 75x +
      is_expected_class <- vapply(
    147 - 75x + 75x +
        X = data,
    148 - 75x + 75x +
        FUN = function(x) any(class(x) %in% .filterable_class),
    149 - 75x + 75x +
        FUN.VALUE = logical(1)
    @@ -29845,7 +30771,8 @@

    teal.slice coverage - 57.02%

    151 - 75x + 75x +
      names(is_expected_class[is_expected_class])
    @@ -29894,14 +30821,16 @@

    teal.slice coverage - 57.02%

    158 - 3x + 3x +
      is_expected_class <- class(data[, 1]) %in% .filterable_class
    159 - 3x + 3x +
      if (is_expected_class && !is.null(names(data))) {
    @@ -29922,7 +30851,8 @@

    teal.slice coverage - 57.02%

    162 - 3x + 3x +
        character(0)
    @@ -29971,7 +30901,8 @@

    teal.slice coverage - 57.02%

    169 - 54x + 54x +
      get_supported_filter_varnames(data$get_dataset())
    @@ -30013,7 +30944,8 @@

    teal.slice coverage - 57.02%

    175 - 1x + 1x +
      character(0)
    @@ -30139,14 +31071,16 @@

    teal.slice coverage - 57.02%

    193 - 10x + 10x +
      if (length(choices) == 0) {
    194 - 1x + 1x +
        return(character(0))
    @@ -30167,49 +31101,56 @@

    teal.slice coverage - 57.02%

    197 - 9x + 9x +
      choice_labels <- if (identical(varlabels, character(0))) {
    198 - 2x + 2x +
        vapply(
    199 - 2x + 2x +
          X = data,
    200 - 2x + 2x +
          FUN.VALUE = character(1),
    201 - 2x + 2x +
          FUN = function(x) {
    202 - 3x + 3x +
            label <- attr(x, "label")
    203 - 3x + 3x +
            if (length(label) != 1) {
    @@ -30251,7 +31192,8 @@

    teal.slice coverage - 57.02%

    209 - 2x + 2x +
        )[choices]
    @@ -30265,7 +31207,8 @@

    teal.slice coverage - 57.02%

    211 - 7x + 7x +
        varlabels
    @@ -30286,21 +31229,24 @@

    teal.slice coverage - 57.02%

    214 - 9x + 9x +
      if (!identical(choice_labels, character(0))) {
    215 - 9x + 9x +
        choice_labels[is.na(choice_labels) | choice_labels == ""] <- names(
    216 - 9x + 9x +
          choice_labels[is.na(choice_labels) | choice_labels == ""]
    @@ -30314,14 +31260,16 @@

    teal.slice coverage - 57.02%

    218 - 9x + 9x +
        choice_types <- setNames(variable_types(data = data, columns = choices), choices)
    219 - 9x + 9x +
        choice_types[keys] <- "primary_key"
    @@ -30335,28 +31283,32 @@

    teal.slice coverage - 57.02%

    221 - 9x + 9x +
        choices_labeled(
    222 - 9x + 9x +
          choices = choices,
    223 - 9x + 9x +
          labels = unname(choice_labels[choices]),
    224 - 9x + 9x +
          types = choice_types[choices]
    @@ -30523,7 +31475,8 @@

    teal.slice coverage - 57.02%

    18 - 9x + 9x +
      if (is.factor(choices)) {
    @@ -30551,35 +31504,40 @@

    teal.slice coverage - 57.02%

    22 - 9x + 9x +
      stopifnot(
    23 - 9x + 9x +
        is.character(choices) ||
    24 - 9x + 9x +
          is.numeric(choices) ||
    25 - 9x + 9x +
          is.logical(choices) ||
    26 - 9x + 9x +
          (length(choices) == 1 && is.na(choices))
    @@ -30600,7 +31558,8 @@

    teal.slice coverage - 57.02%

    29 - 9x + 9x +
      if (is.factor(labels)) {
    @@ -30628,14 +31587,16 @@

    teal.slice coverage - 57.02%

    33 - 9x + 9x +
      checkmate::assert_character(labels[!is.na(labels)], any.missing = FALSE)
    34 - 9x + 9x +
      if (length(choices) != length(labels)) {
    @@ -30656,14 +31617,16 @@

    teal.slice coverage - 57.02%

    37 - 9x + 9x +
      stopifnot(is.null(subset) || is.vector(subset))
    38 - 9x + 9x +
      stopifnot(is.null(types) || is.vector(types))
    @@ -30677,14 +31640,16 @@

    teal.slice coverage - 57.02%

    40 - 9x + 9x +
      if (is.vector(types)) {
    41 - 9x + 9x +
        stopifnot(length(choices) == length(types))
    @@ -30705,7 +31670,8 @@

    teal.slice coverage - 57.02%

    44 - 9x + 9x +
      if (!is.null(subset)) {
    @@ -30768,56 +31734,64 @@

    teal.slice coverage - 57.02%

    53 - 9x + 9x +
      is_dupl <- duplicated(choices)
    54 - 9x + 9x +
      choices <- choices[!is_dupl]
    55 - 9x + 9x +
      labels <- labels[!is_dupl]
    56 - 9x + 9x +
      types <- types[!is_dupl]
    57 - 9x + 9x +
      labels[is.na(labels)] <- "Label Missing"
    58 - 9x + 9x +
      raw_labels <- labels
    59 - 9x + 9x +
      combined_labels <- if (length(choices) > 0) {
    60 - 9x + 9x +
        paste0(choices, ": ", labels)
    @@ -30852,7 +31826,8 @@

    teal.slice coverage - 57.02%

    65 - 9x + 9x +
      if (!is.null(subset)) {
    @@ -30901,49 +31876,56 @@

    teal.slice coverage - 57.02%

    72 - 9x + 9x +
      choices <- structure(
    73 - 9x + 9x +
        choices,
    74 - 9x + 9x +
        names = combined_labels,
    75 - 9x + 9x +
        raw_labels = raw_labels,
    76 - 9x + 9x +
        combined_labels = combined_labels,
    77 - 9x + 9x +
        class = c("choices_labeled", "character"),
    78 - 9x + 9x +
        types = types
    @@ -30964,7 +31946,8 @@

    teal.slice coverage - 57.02%

    81 - 9x + 9x +
      return(choices)
    @@ -31236,21 +32219,24 @@

    teal.slice coverage - 57.02%

    37 - 109x + 109x +
          checkmate::assert_class(dataset, "data.frame")
    38 - 109x + 109x +
          super$initialize(dataset, dataname, keys, label, metadata)
    39 - 109x + 109x +
          dataname <- self$get_dataname()
    @@ -31264,42 +32250,48 @@

    teal.slice coverage - 57.02%

    41 - 109x + 109x +
          private$add_filter_states(
    42 - 109x + 109x +
            filter_states = init_filter_states(
    43 - 109x + 109x +
              data = self$get_dataset(),
    44 - 109x + 109x +
              dataname = dataname,
    45 - 109x + 109x +
              varlabels = self$get_varlabels(),
    46 - 109x + 109x +
              keys = self$get_keys()
    @@ -31313,7 +32305,8 @@

    teal.slice coverage - 57.02%

    48 - 109x + 109x +
            id = "filter"
    @@ -31327,7 +32320,8 @@

    teal.slice coverage - 57.02%

    50 - 109x + 109x +
          invisible(self)
    @@ -31425,35 +32419,40 @@

    teal.slice coverage - 57.02%

    64 - 26x + 26x +
          filter_call <- Filter(
    65 - 26x + 26x +
            f = Negate(is.null),
    66 - 26x + 26x +
            x = lapply(
    67 - 26x + 26x +
              self$get_filter_states(),
    68 - 26x + 26x +
              function(x) x$get_call()
    @@ -31474,14 +32473,16 @@

    teal.slice coverage - 57.02%

    71 - 26x + 26x +
          if (length(filter_call) == 0) {
    72 - 17x + 17x +
            return(NULL)
    @@ -31495,7 +32496,8 @@

    teal.slice coverage - 57.02%

    74 - 9x + 9x +
          filter_call
    @@ -31572,7 +32574,8 @@

    teal.slice coverage - 57.02%

    85 - 36x + 36x +
          self$get_filter_states("filter")$get_filter_state()
    @@ -31719,42 +32722,48 @@

    teal.slice coverage - 57.02%

    106 - 40x + 40x +
          checkmate::assert_list(state)
    107 - 40x + 40x +
          logger::log_trace(
    108 - 40x + 40x +
            sprintf(
    109 - 40x + 40x +
              "DefaultFilteredDataset$set_filter_state setting up filters of variables %s, dataname: %s",
    110 - 40x + 40x +
              paste(names(state), collapse = ", "),
    111 - 40x + 40x +
              self$get_dataname()
    @@ -31782,56 +32791,64 @@

    teal.slice coverage - 57.02%

    115 - 40x + 40x +
          data <- self$get_dataset()
    116 - 40x + 40x +
          fs <- self$get_filter_states()[[1]]
    117 - 40x + 40x +
          fs$set_filter_state(state = state, data = data, ...)
    118 - 38x + 38x +
          logger::log_trace(
    119 - 38x + 38x +
            sprintf(
    120 - 38x + 38x +
              "DefaultFilteredDataset$set_filter_state done setting up filters of variables %s, dataname: %s",
    121 - 38x + 38x +
              paste(names(state), collapse = ", "),
    122 - 38x + 38x +
              self$get_dataname()
    @@ -31852,7 +32869,8 @@

    teal.slice coverage - 57.02%

    125 - 38x + 38x +
          NULL
    @@ -31922,35 +32940,40 @@

    teal.slice coverage - 57.02%

    135 - 5x + 5x +
          logger::log_trace(
    136 - 5x + 5x +
            sprintf(
    137 - 5x + 5x +
              "DefaultFilteredDataset$remove_filter_state removing filters of variable %s, dataname: %s",
    138 - 5x + 5x +
              state_id,
    139 - 5x + 5x +
              self$get_dataname()
    @@ -31978,21 +33001,24 @@

    teal.slice coverage - 57.02%

    143 - 5x + 5x +
          fdata_filter_state <- self$get_filter_states()[[1]]
    144 - 5x + 5x +
          for (element in state_id) {
    145 - 7x + 7x +
            fdata_filter_state$remove_filter_state(element)
    @@ -32006,35 +33032,40 @@

    teal.slice coverage - 57.02%

    147 - 5x + 5x +
          logger::log_trace(
    148 - 5x + 5x +
            sprintf(
    149 - 5x + 5x +
              "DefaultFilteredDataset$remove_filter_state done removing filters of variable %s, dataname: %s",
    150 - 5x + 5x +
              state_id,
    151 - 5x + 5x +
              self$get_dataname()
    @@ -32055,7 +33086,8 @@

    teal.slice coverage - 57.02%

    154 - 5x + 5x +
          invisible(NULL)
    @@ -32307,42 +33339,48 @@

    teal.slice coverage - 57.02%

    190 - 8x + 8x +
          check_ellipsis(..., stop = FALSE, allowed_args = "vars_include")
    191 - 8x + 8x +
          moduleServer(
    192 - 8x + 8x +
            id = id,
    193 - 8x + 8x +
            function(input, output, session) {
    194 - 8x + 8x +
              logger::log_trace(
    195 - 8x + 8x +
                "DefaultFilteredDataset$srv_add_filter_state initializing, dataname: { deparse1(self$get_dataname()) }"
    @@ -32356,28 +33394,32 @@

    teal.slice coverage - 57.02%

    197 - 8x + 8x +
              data <- self$get_dataset()
    198 - 8x + 8x +
              self$get_filter_states(id = "filter")$srv_add_filter_state(
    199 - 8x + 8x +
                id = "filter",
    200 - 8x + 8x +
                data = data,
    @@ -32398,14 +33440,16 @@

    teal.slice coverage - 57.02%

    203 - 8x + 8x +
              logger::log_trace(
    204 - 8x + 8x +
                "DefaultFilteredDataset$srv_add_filter_state initialized, dataname: { deparse1(self$get_dataname()) }"
    @@ -32419,7 +33463,8 @@

    teal.slice coverage - 57.02%

    206 - 8x + 8x +
              NULL
    @@ -32531,14 +33576,16 @@

    teal.slice coverage - 57.02%

    222 - 8x + 8x +
          checkmate::assert_class(filtered_dataset, classes = class(self$get_dataset()))
    223 - 8x + 8x +
          checkmate::assert_character(subject_keys, null.ok = TRUE, any.missing = FALSE)
    @@ -32552,14 +33599,16 @@

    teal.slice coverage - 57.02%

    225 - 8x + 8x +
          f_rows <- if (length(subject_keys) == 0) {
    226 - 4x + 4x +
            dplyr::n_distinct(filtered_dataset)
    @@ -32573,7 +33622,8 @@

    teal.slice coverage - 57.02%

    228 - 4x + 4x +
            dplyr::n_distinct(filtered_dataset[subject_keys])
    @@ -32594,14 +33644,16 @@

    teal.slice coverage - 57.02%

    231 - 8x + 8x +
          nf_rows <- if (length(subject_keys) == 0) {
    232 - 4x + 4x +
            dplyr::n_distinct(self$get_dataset())
    @@ -32615,7 +33667,8 @@

    teal.slice coverage - 57.02%

    234 - 4x + 4x +
            dplyr::n_distinct(self$get_dataset()[subject_keys])
    @@ -32636,7 +33689,8 @@

    teal.slice coverage - 57.02%

    237 - 8x + 8x +
          list(paste0(f_rows, "/", nf_rows))
    @@ -32685,28 +33739,32 @@

    teal.slice coverage - 57.02%

    244 - 10x + 10x +
          f_rows <- nrow(filtered_dataset)
    245 - 10x + 10x +
          nf_rows <- nrow(self$get_dataset())
    246 - 10x + 10x +
          list(
    247 - 10x + 10x +
            paste0(f_rows, "/", nf_rows)
    @@ -33314,7 +34372,8 @@

    teal.slice coverage - 57.02%

    82 - 109x + 109x +
      UseMethod("init_filtered_dataset")
    @@ -33384,7 +34443,8 @@

    teal.slice coverage - 57.02%

    92 - 98x + 98x +
      DefaultFilteredDataset$new(dataset, dataname, keys, label, metadata)
    @@ -33454,7 +34514,8 @@

    teal.slice coverage - 57.02%

    102 - 11x + 11x +
      if (!requireNamespace("MultiAssayExperiment", quietly = TRUE)) {
    @@ -33475,7 +34536,8 @@

    teal.slice coverage - 57.02%

    105 - 11x + 11x +
      MAEFilteredDataset$new(dataset, dataname, keys, label, metadata)
    @@ -33706,28 +34768,32 @@

    teal.slice coverage - 57.02%

    138 - 153x + 153x +
          check_simple_name(dataname)
    139 - 153x + 153x +
          checkmate::assert_character(keys, any.missing = FALSE)
    140 - 153x + 153x +
          checkmate::assert_character(label, null.ok = TRUE)
    141 - 153x + 153x +
          teal.data::validate_metadata(metadata)
    @@ -33741,49 +34807,56 @@

    teal.slice coverage - 57.02%

    143 - 153x + 153x +
          logger::log_trace("Instantiating { class(self)[1] }, dataname: { dataname }")
    144 - 153x + 153x +
          private$dataset <- dataset
    145 - 153x + 153x +
          private$dataname <- dataname
    146 - 153x + 153x +
          private$keys <- keys
    147 - 153x + 153x +
          private$label <- if (is.null(label)) character(0) else label
    148 - 153x + 153x +
          private$metadata <- metadata
    149 - 153x + 153x +
          invisible(self)
    @@ -33860,42 +34933,48 @@

    teal.slice coverage - 57.02%

    160 - 46x + 46x +
          out <- Filter(
    161 - 46x + 46x +
            function(x) x != "",
    162 - 46x + 46x +
            sapply(
    163 - 46x + 46x +
              self$get_filter_states(),
    164 - 46x + 46x +
              function(states) {
    165 - 66x + 66x +
                states$format(indent = 2)
    @@ -33923,21 +35002,24 @@

    teal.slice coverage - 57.02%

    169 - 46x + 46x +
          if (length(out) > 0) {
    170 - 25x + 25x +
            header <- paste0("Filters for dataset: ", self$get_dataname())
    171 - 25x + 25x +
            paste(c(header, out), collapse = "\n")
    @@ -33993,28 +35075,32 @@

    teal.slice coverage - 57.02%

    179 - 14x + 14x +
          logger::log_trace("Removing all filters from FilteredDataset: { deparse1(self$get_dataname()) }")
    180 - 14x + 14x +
          lapply(
    181 - 14x + 14x +
            self$get_filter_states(),
    182 - 14x + 14x +
            function(state_list) state_list$state_list_empty()
    @@ -34028,14 +35114,16 @@

    teal.slice coverage - 57.02%

    184 - 14x + 14x +
          logger::log_trace("Removed all filters from FilteredDataset: { deparse1(self$get_dataname()) }")
    185 - 14x + 14x +
          NULL
    @@ -34203,14 +35291,16 @@

    teal.slice coverage - 57.02%

    209 - 9x + 9x +
          states <- lapply(self$get_filter_states(), function(x) x$get_filter_state())
    210 - 9x + 9x +
          Filter(function(x) length(x) > 0, states)
    @@ -34273,14 +35363,16 @@

    teal.slice coverage - 57.02%

    219 - 526x + 526x +
          if (length(id) == 0) {
    220 - 463x + 463x +
            private$filter_states
    @@ -34294,7 +35386,8 @@

    teal.slice coverage - 57.02%

    222 - 63x + 63x +
            private$filter_states[[id]]
    @@ -34350,21 +35443,24 @@

    teal.slice coverage - 57.02%

    230 - 12x + 12x +
          sum(vapply(private$filter_states,
    231 - 12x + 12x +
            function(state) state$get_filter_count(),
    232 - 12x + 12x +
            FUN.VALUE = integer(1)
    @@ -34434,7 +35530,8 @@

    teal.slice coverage - 57.02%

    242 - 160x + 160x +
          private$dataname
    @@ -34483,7 +35580,8 @@

    teal.slice coverage - 57.02%

    249 - 301x + 301x +
          private$dataset
    @@ -34532,7 +35630,8 @@

    teal.slice coverage - 57.02%

    256 - 4x + 4x +
          private$metadata
    @@ -34616,35 +35715,40 @@

    teal.slice coverage - 57.02%

    268 - 10x + 10x +
          checkmate::assert_class(filtered_dataset, classes = class(self$get_dataset()))
    269 - 10x + 10x +
          df <- cbind(private$get_filter_overview_nobs(filtered_dataset), "")
    270 - 10x + 10x +
          rownames(df) <- self$get_dataname()
    271 - 10x + 10x +
          colnames(df) <- c("Obs", "Subjects")
    272 - 10x + 10x +
          df
    @@ -34693,7 +35797,8 @@

    teal.slice coverage - 57.02%

    279 - 151x + 151x +
          private$keys
    @@ -34798,7 +35903,8 @@

    teal.slice coverage - 57.02%

    294 - 115x + 115x +
          checkmate::assert_character(variables, null.ok = TRUE, any.missing = FALSE)
    @@ -34812,14 +35918,16 @@

    teal.slice coverage - 57.02%

    296 - 115x + 115x +
          labels <- formatters::var_labels(private$dataset, fill = FALSE)
    297 - 115x + 115x +
          if (is.null(labels)) {
    @@ -34840,14 +35948,16 @@

    teal.slice coverage - 57.02%

    300 - 2x + 2x +
          if (!is.null(variables)) labels <- labels[intersect(self$get_varnames(), variables)]
    301 - 115x + 115x +
          labels
    @@ -34896,7 +36006,8 @@

    teal.slice coverage - 57.02%

    308 - 3x + 3x +
          private$label
    @@ -34945,7 +36056,8 @@

    teal.slice coverage - 57.02%

    315 - 4x + 4x +
          colnames(self$get_dataset())
    @@ -35029,21 +36141,24 @@

    teal.slice coverage - 57.02%

    327 - 49x + 49x +
          varnames <- get_supported_filter_varnames(self)
    328 - 49x + 49x +
          if (length(private$filterable_varnames) > 0) {
    329 - 4x + 4x +
            return(intersect(private$filterable_varnames, varnames))
    @@ -35057,7 +36172,8 @@

    teal.slice coverage - 57.02%

    331 - 45x + 45x +
          return(varnames)
    @@ -35162,21 +36278,24 @@

    teal.slice coverage - 57.02%

    346 - 10x + 10x +
          checkmate::assert_character(varnames, any.missing = FALSE, null.ok = TRUE)
    347 - 7x + 7x +
          private$filterable_varnames <- varnames
    348 - 7x + 7x +
          return(invisible(self))
    @@ -35750,49 +36869,56 @@

    teal.slice coverage - 57.02%

    430 - 9x + 9x +
          moduleServer(
    431 - 9x + 9x +
            id = id,
    432 - 9x + 9x +
            function(input, output, session) {
    433 - 9x + 9x +
              dataname <- self$get_dataname()
    434 - 9x + 9x +
              logger::log_trace("FilteredDataset$server initializing, dataname: { dataname }")
    435 - 9x + 9x +
              checkmate::assert_string(dataname)
    436 - 9x + 9x +
              shiny::setBookmarkExclude("remove_filters")
    @@ -35806,35 +36932,40 @@

    teal.slice coverage - 57.02%

    438 - 9x + 9x +
              output$filter_count <- renderText(
    439 - 9x + 9x +
                sprintf(
    440 - 9x + 9x +
                  "%d filter%s applied",
    441 - 9x + 9x +
                  self$get_filter_count(),
    442 - 9x + 9x +
                  if (self$get_filter_count() != 1) "s" else ""
    @@ -35862,28 +36993,32 @@

    teal.slice coverage - 57.02%

    446 - 9x + 9x +
              lapply(
    447 - 9x + 9x +
                names(self$get_filter_states()),
    448 - 9x + 9x +
                function(x) {
    449 - 14x + 14x +
                  self$get_filter_states(id = x)$server(id = x)
    @@ -35911,35 +37046,40 @@

    teal.slice coverage - 57.02%

    453 - 9x + 9x +
              shiny::observeEvent(self$get_filter_state(), {
    454 - 2x + 2x +
                shinyjs::hide("filter_count_ui")
    455 - 2x + 2x +
                shinyjs::show("filters")
    456 - 2x + 2x +
                shinyjs::toggle("remove_filters", condition = length(self$get_filter_state()) != 0)
    457 - 2x + 2x +
                shinyjs::toggle("collapse", condition = length(self$get_filter_state()) != 0)
    @@ -35960,7 +37100,8 @@

    teal.slice coverage - 57.02%

    460 - 9x + 9x +
              shiny::observeEvent(input$collapse, {
    @@ -36002,35 +37143,40 @@

    teal.slice coverage - 57.02%

    466 - 9x + 9x +
              observeEvent(input$remove_filters, {
    467 - 1x + 1x +
                logger::log_trace("FilteredDataset$server@1 removing filters, dataname: { dataname }")
    468 - 1x + 1x +
                lapply(
    469 - 1x + 1x +
                  self$get_filter_states(),
    470 - 1x + 1x +
                  function(x) x$state_list_empty()
    @@ -36044,7 +37190,8 @@

    teal.slice coverage - 57.02%

    472 - 1x + 1x +
                logger::log_trace("FilteredDataset$server@1 removed filters, dataname: { dataname }")
    @@ -36065,14 +37212,16 @@

    teal.slice coverage - 57.02%

    475 - 9x + 9x +
              logger::log_trace("FilteredDataset$initialized, dataname: { dataname }")
    476 - 9x + 9x +
              NULL
    @@ -36170,7 +37319,8 @@

    teal.slice coverage - 57.02%

    490 - 1x + 1x +
          stop("Pure virtual method")
    @@ -36443,14 +37593,16 @@

    teal.slice coverage - 57.02%

    529 - 271x + 271x +
          stopifnot(is(filter_states, "FilterStates"))
    530 - 271x + 271x +
          checkmate::assert_string(id)
    @@ -36464,14 +37616,16 @@

    teal.slice coverage - 57.02%

    532 - 271x + 271x +
          x <- setNames(list(filter_states), id)
    533 - 271x + 271x +
          private$filter_states <- c(self$get_filter_states(), x)
    @@ -36827,7 +37981,8 @@

    teal.slice coverage - 57.02%

    25 - 35x + 35x +
      UseMethod("init_filtered_data")
    @@ -36897,21 +38052,24 @@

    teal.slice coverage - 57.02%

    35 - 12x + 12x +
      cdisc <- length(join_keys$get_parents()) > 0
    36 - 12x + 12x +
      data_objects <- lapply(x$get_datanames(), function(dataname) {
    37 - 23x + 23x +
        dataset <- x$get_dataset(dataname)
    @@ -36925,7 +38083,8 @@

    teal.slice coverage - 57.02%

    39 - 23x + 23x +
        parent <- if (cdisc) join_keys$get_parent(dataname) else NULL
    @@ -36939,35 +38098,40 @@

    teal.slice coverage - 57.02%

    41 - 23x + 23x +
        return_list <- list(
    42 - 23x + 23x +
          dataset = dataset$get_raw_data(),
    43 - 23x + 23x +
          keys = dataset$get_keys(),
    44 - 23x + 23x +
          metadata = dataset$get_metadata(),
    45 - 23x + 23x +
          label = dataset$get_dataset_label()
    @@ -36988,14 +38152,16 @@

    teal.slice coverage - 57.02%

    48 - 22x + 22x +
        if (cdisc) return_list[["parent"]] <- parent
    49 - 23x + 23x +
        return_list
    @@ -37016,7 +38182,8 @@

    teal.slice coverage - 57.02%

    52 - 12x + 12x +
      names(data_objects) <- x$get_datanames()
    @@ -37030,42 +38197,48 @@

    teal.slice coverage - 57.02%

    54 - 12x + 12x +
      init_filtered_data(
    55 - 12x + 12x +
        x = data_objects,
    56 - 12x + 12x +
        join_keys = join_keys,
    57 - 12x + 12x +
        code = code,
    58 - 12x + 12x +
        check = check,
    59 - 12x + 12x +
        cdisc = cdisc
    @@ -37114,35 +38287,40 @@

    teal.slice coverage - 57.02%

    66 - 23x + 23x +
      checkmate::assert_list(x, any.missing = FALSE, names = "unique")
    67 - 22x + 22x +
      mapply(validate_dataset_args, x, names(x), MoreArgs = list(allowed_parent = cdisc))
    68 - 21x + 21x +
      checkmate::assert_class(code, "CodeClass", null.ok = TRUE)
    69 - 20x + 20x +
      checkmate::assert_class(join_keys, "JoinKeys", null.ok = TRUE)
    70 - 19x + 19x +
      checkmate::assert_flag(check)
    @@ -37156,14 +38334,16 @@

    teal.slice coverage - 57.02%

    72 - 18x + 18x +
      datasets <- if (cdisc) {
    73 - 11x + 11x +
        CDISCFilteredData$new(x, join_keys = join_keys, code = code, check = check)
    @@ -37177,7 +38357,8 @@

    teal.slice coverage - 57.02%

    75 - 7x + 7x +
        FilteredData$new(x, join_keys = join_keys, code = code, check = check)
    @@ -37296,21 +38477,24 @@

    teal.slice coverage - 57.02%

    92 - 173x + 173x +
      check_simple_name(dataname)
    93 - 173x + 173x +
      checkmate::assert_flag(allowed_parent)
    94 - 172x + 172x +
      checkmate::assert_list(dataset_args, names = "unique")
    @@ -37324,21 +38508,24 @@

    teal.slice coverage - 57.02%

    96 - 172x + 172x +
      allowed_names <- c("dataset", "keys", "label", "metadata")
    97 - 172x + 172x +
      if (allowed_parent) {
    98 - 62x + 62x +
        allowed_names <- c(allowed_names, "parent")
    @@ -37359,7 +38546,8 @@

    teal.slice coverage - 57.02%

    101 - 172x + 172x +
      checkmate::assert_subset(names(dataset_args), choices = allowed_names)
    @@ -37373,35 +38561,40 @@

    teal.slice coverage - 57.02%

    103 - 172x + 172x +
      checkmate::assert_multi_class(dataset_args[["dataset"]], classes = c("data.frame", "MultiAssayExperiment"))
    104 - 172x + 172x +
      checkmate::assert_character(dataset_args[["keys"]], null.ok = TRUE)
    105 - 172x + 172x +
      teal.data::validate_metadata(dataset_args[["metadata"]])
    106 - 172x + 172x +
      checkmate::assert_character(dataset_args[["label"]], null.ok = TRUE, min.len = 0, max.len = 1)
    107 - 172x + 172x +
      checkmate::assert_character(dataset_args[["parent"]], null.ok = TRUE, min.len = 0, max.len = 1)
    @@ -37492,42 +38685,48 @@

    teal.slice coverage - 57.02%

    120 - 14x + 14x +
      lapply(
    121 - 14x + 14x +
        expr,
    122 - 14x + 14x +
        function(x) {
    123 - 2x + 2x +
          tryCatch(
    124 - 2x + 2x +
            eval(x, envir = env),
    125 - 2x + 2x +
            error = function(e) {
    @@ -37590,7 +38789,8 @@

    teal.slice coverage - 57.02%

    134 - 2x + 2x +
          return(invisible(NULL))
    @@ -39507,35 +40707,40 @@

    teal.slice coverage - 57.02%

    143 - 140x + 140x +
          super$initialize(dataname, datalabel)
    144 - 140x + 140x +
          private$varlabels <- varlabels
    145 - 140x + 140x +
          private$keys <- keys
    146 - 140x + 140x +
          private$state_list <- list(
    147 - 140x + 140x +
            reactiveVal()
    @@ -39619,7 +40824,8 @@

    teal.slice coverage - 57.02%

    159 - 46x + 46x +
          checkmate::assert_number(indent, finite = TRUE, lower = 0)
    @@ -39633,21 +40839,24 @@

    teal.slice coverage - 57.02%

    161 - 45x + 45x +
          formatted_states <- vapply(
    162 - 45x + 45x +
            self$state_list_get(1L), function(state) state$format(indent = indent),
    163 - 45x + 45x +
            USE.NAMES = FALSE, FUN.VALUE = character(1)
    @@ -39661,7 +40870,8 @@

    teal.slice coverage - 57.02%

    165 - 45x + 45x +
          paste(formatted_states, collapse = "\n")
    @@ -39738,7 +40948,8 @@

    teal.slice coverage - 57.02%

    176 - 26x + 26x +
          "dplyr::filter"
    @@ -39822,42 +41033,48 @@

    teal.slice coverage - 57.02%

    188 - 8x + 8x +
          moduleServer(
    189 - 8x + 8x +
            id = id,
    190 - 8x + 8x +
            function(input, output, session) {
    191 - 8x + 8x +
              previous_state <- reactiveVal(isolate(self$state_list_get(1L)))
    192 - 8x + 8x +
              added_state_name <- reactiveVal(character(0))
    193 - 8x + 8x +
              removed_state_name <- reactiveVal(character(0))
    @@ -39871,7 +41088,8 @@

    teal.slice coverage - 57.02%

    195 - 8x + 8x +
              observeEvent(self$state_list_get(1L), {
    @@ -39913,7 +41131,8 @@

    teal.slice coverage - 57.02%

    201 - 8x + 8x +
              observeEvent(added_state_name(), ignoreNULL = TRUE, {
    @@ -40011,7 +41230,8 @@

    teal.slice coverage - 57.02%

    215 - 8x + 8x +
              observeEvent(removed_state_name(), {
    @@ -40060,7 +41280,8 @@

    teal.slice coverage - 57.02%

    222 - 8x + 8x +
              NULL
    @@ -40158,7 +41379,8 @@

    teal.slice coverage - 57.02%

    236 - 38x + 38x +
          lapply(self$state_list_get(1L), function(x) x$get_state())
    @@ -40382,35 +41604,40 @@

    teal.slice coverage - 57.02%

    268 - 50x + 50x +
          checkmate::assert_data_frame(data)
    269 - 50x + 50x +
          checkmate::assert(
    270 - 50x + 50x +
            checkmate::check_subset(names(state), names(data)),
    271 - 50x + 50x +
            checkmate::check_class(state, "default_filter"),
    272 - 50x + 50x +
            combine = "or"
    @@ -40424,14 +41651,16 @@

    teal.slice coverage - 57.02%

    274 - 47x + 47x +
          logger::log_trace(
    275 - 47x + 47x +
            "{ class(self)[1] }$set_filter_state initializing, dataname: { private$dataname }"
    @@ -40452,70 +41681,80 @@

    teal.slice coverage - 57.02%

    278 - 47x + 47x +
          filter_states <- self$state_list_get(1L)
    279 - 47x + 47x +
          state_names <- names(state)
    280 - 47x + 47x +
          excluded_vars <- setdiff(state_names, vars_include)
    281 - 47x + 47x +
          if (length(excluded_vars) > 0) {
    282 - 1x + 1x +
            warning(
    283 - 1x + 1x +
              paste(
    284 - 1x + 1x +
                "These columns filters were excluded:",
    285 - 1x + 1x +
                paste(excluded_vars, collapse = ", "),
    286 - 1x + 1x +
                "from dataset",
    287 - 1x + 1x +
                private$dataname
    @@ -40536,28 +41775,32 @@

    teal.slice coverage - 57.02%

    290 - 1x + 1x +
            logger::log_warn(
    291 - 1x + 1x +
              paste(
    292 - 1x + 1x +
                "Columns filters { paste(excluded_vars, collapse = ', ') } were excluded",
    293 - 1x + 1x +
                "from { private$dataname }"
    @@ -40592,7 +41835,8 @@

    teal.slice coverage - 57.02%

    298 - 47x + 47x +
          filters_to_apply <- state_names[state_names %in% vars_include]
    @@ -40606,35 +41850,40 @@

    teal.slice coverage - 57.02%

    300 - 47x + 47x +
          for (varname in filters_to_apply) {
    301 - 80x + 80x +
            value <- resolve_state(state[[varname]])
    302 - 80x + 80x +
            if (varname %in% names(filter_states)) {
    303 - 8x + 8x +
              fstate <- filter_states[[varname]]
    304 - 8x + 8x +
              fstate$set_state(value)
    @@ -40648,35 +41897,40 @@

    teal.slice coverage - 57.02%

    306 - 72x + 72x +
              fstate <- init_filter_state(
    307 - 72x + 72x +
                data[[varname]],
    308 - 72x + 72x +
                varname = varname,
    309 - 72x + 72x +
                varlabel = private$get_varlabels(varname),
    310 - 72x + 72x +
                dataname = private$dataname
    @@ -40690,14 +41944,16 @@

    teal.slice coverage - 57.02%

    312 - 72x + 72x +
              fstate$set_state(value)
    313 - 72x + 72x +
              self$state_list_push(x = fstate, state_list_index = 1L, state_id = varname)
    @@ -40718,14 +41974,16 @@

    teal.slice coverage - 57.02%

    316 - 47x + 47x +
          logger::log_trace(
    317 - 47x + 47x +
            "{ class(self)[1] }$set_filter_state initialized, dataname: { private$dataname }"
    @@ -40739,7 +41997,8 @@

    teal.slice coverage - 57.02%

    319 - 47x + 47x +
          NULL
    @@ -40809,42 +42068,48 @@

    teal.slice coverage - 57.02%

    329 - 9x + 9x +
          logger::log_trace(
    330 - 9x + 9x +
            sprintf(
    331 - 9x + 9x +
              "%s$remove_filter_state for variable %s called, dataname: %s",
    332 - 9x + 9x +
              class(self)[1],
    333 - 9x + 9x +
              state_id,
    334 - 9x + 9x +
              private$dataname
    @@ -40872,35 +42137,40 @@

    teal.slice coverage - 57.02%

    338 - 9x + 9x +
          if (!state_id %in% names(self$state_list_get(1L))) {
    339 - 1x + 1x +
            warning(paste(
    340 - 1x + 1x +
              "Variable:", state_id,
    341 - 1x + 1x +
              "is not present in the actual active filters of dataset: { private$dataname }",
    342 - 1x + 1x +
              "therefore no changes are applied."
    @@ -40914,28 +42184,32 @@

    teal.slice coverage - 57.02%

    344 - 1x + 1x +
            logger::log_warn(
    345 - 1x + 1x +
              paste(
    346 - 1x + 1x +
                "Variable:", state_id, "is not present in the actual active filters of dataset:",
    347 - 1x + 1x +
                "{ private$dataname } therefore no changes are applied."
    @@ -40963,49 +42237,56 @@

    teal.slice coverage - 57.02%

    351 - 8x + 8x +
            self$state_list_remove(state_list_index = 1L, state_id = state_id)
    352 - 8x + 8x +
            logger::log_trace(
    353 - 8x + 8x +
              sprintf(
    354 - 8x + 8x +
                "%s$remove_filter_state for variable %s done, dataname: %s",
    355 - 8x + 8x +
                class(self)[1],
    356 - 8x + 8x +
                state_id,
    357 - 8x + 8x +
                private$dataname
    @@ -41138,14 +42419,16 @@

    teal.slice coverage - 57.02%

    376 - 2x + 2x +
          checkmate::assert_string(id)
    377 - 2x + 2x +
          checkmate::assert_data_frame(data)
    @@ -41159,7 +42442,8 @@

    teal.slice coverage - 57.02%

    379 - 2x + 2x +
          ns <- NS(id)
    @@ -41173,28 +42457,32 @@

    teal.slice coverage - 57.02%

    381 - 2x + 2x +
          if (ncol(data) == 0) {
    382 - 1x + 1x +
            div("no sample variables available")
    383 - 1x + 1x +
          } else if (nrow(data) == 0) {
    384 - 1x + 1x +
            div("no samples available")
    @@ -41425,49 +42713,56 @@

    teal.slice coverage - 57.02%

    417 - 11x + 11x +
          stopifnot(is.data.frame(data))
    418 - 11x + 11x +
          check_ellipsis(..., stop = FALSE)
    419 - 11x + 11x +
          moduleServer(
    420 - 11x + 11x +
            id = id,
    421 - 11x + 11x +
            function(input, output, session) {
    422 - 11x + 11x +
              logger::log_trace(
    423 - 11x + 11x +
                "DFFilterStates$srv_add_filter_state initializing, dataname: { private$dataname }"
    @@ -41481,42 +42776,48 @@

    teal.slice coverage - 57.02%

    425 - 11x + 11x +
              shiny::setBookmarkExclude(c("var_to_add"))
    426 - 11x + 11x +
              active_filter_vars <- reactive({
    427 - 6x + 6x +
                vapply(
    428 - 6x + 6x +
                  X = self$state_list_get(state_list_index = 1L),
    429 - 6x + 6x +
                  FUN.VALUE = character(1),
    430 - 6x + 6x +
                  FUN = function(x) x$get_varname()
    @@ -41551,14 +42852,16 @@

    teal.slice coverage - 57.02%

    435 - 11x + 11x +
              avail_column_choices <- reactive({
    436 - 6x + 6x +
                choices <- setdiff(vars_include, active_filter_vars())
    @@ -41572,35 +42875,40 @@

    teal.slice coverage - 57.02%

    438 - 6x + 6x +
                data_choices_labeled(
    439 - 6x + 6x +
                  data = data,
    440 - 6x + 6x +
                  choices = choices,
    441 - 6x + 6x +
                  varlabels = private$get_varlabels(choices),
    442 - 6x + 6x +
                  keys = private$keys
    @@ -41621,49 +42929,56 @@

    teal.slice coverage - 57.02%

    445 - 11x + 11x +
              observeEvent(
    446 - 11x + 11x +
                avail_column_choices(),
    447 - 11x + 11x +
                ignoreNULL = TRUE,
    448 - 11x + 11x +
                handlerExpr = {
    449 - 6x + 6x +
                  logger::log_trace(paste(
    450 - 6x + 6x +
                    "DFFilterStates$srv_add_filter_state@1 updating available column choices,",
    451 - 6x + 6x +
                    "dataname: { private$dataname }"
    @@ -41677,7 +42992,8 @@

    teal.slice coverage - 57.02%

    453 - 6x + 6x +
                  if (is.null(avail_column_choices())) {
    @@ -41698,7 +43014,8 @@

    teal.slice coverage - 57.02%

    456 - 6x + 6x +
                    shinyjs::show("var_to_add")
    @@ -41712,28 +43029,32 @@

    teal.slice coverage - 57.02%

    458 - 6x + 6x +
                  teal.widgets::updateOptionalSelectInput(
    459 - 6x + 6x +
                    session,
    460 - 6x + 6x +
                    "var_to_add",
    461 - 6x + 6x +
                    choices = avail_column_choices()
    @@ -41747,21 +43068,24 @@

    teal.slice coverage - 57.02%

    463 - 6x + 6x +
                  logger::log_trace(paste(
    464 - 6x + 6x +
                    "DFFilterStates$srv_add_filter_state@1 updated available column choices,",
    465 - 6x + 6x +
                    "dataname: { private$dataname }"
    @@ -41796,56 +43120,64 @@

    teal.slice coverage - 57.02%

    470 - 11x + 11x +
              observeEvent(
    471 - 11x + 11x +
                eventExpr = input$var_to_add,
    472 - 11x + 11x +
                handlerExpr = {
    473 - 3x + 3x +
                  logger::log_trace(
    474 - 3x + 3x +
                    sprintf(
    475 - 3x + 3x +
                      "DFFilterStates$srv_add_filter_state@2 adding FilterState of variable %s, dataname: %s",
    476 - 3x + 3x +
                      input$var_to_add,
    477 - 3x + 3x +
                      private$dataname
    @@ -41866,42 +43198,48 @@

    teal.slice coverage - 57.02%

    480 - 3x + 3x +
                  self$state_list_push(
    481 - 3x + 3x +
                    x = init_filter_state(
    482 - 3x + 3x +
                      data[[input$var_to_add]],
    483 - 3x + 3x +
                      varname = input$var_to_add,
    484 - 3x + 3x +
                      varlabel = private$get_varlabels(input$var_to_add),
    485 - 3x + 3x +
                      dataname = private$dataname
    @@ -41915,14 +43253,16 @@

    teal.slice coverage - 57.02%

    487 - 3x + 3x +
                    state_list_index = 1L,
    488 - 3x + 3x +
                    state_id = input$var_to_add
    @@ -41936,35 +43276,40 @@

    teal.slice coverage - 57.02%

    490 - 3x + 3x +
                  logger::log_trace(
    491 - 3x + 3x +
                    sprintf(
    492 - 3x + 3x +
                      "DFFilterStates$srv_add_filter_state@2 added FilterState of variable %s, dataname: %s",
    493 - 3x + 3x +
                      input$var_to_add,
    494 - 3x + 3x +
                      private$dataname
    @@ -42006,14 +43351,16 @@

    teal.slice coverage - 57.02%

    500 - 11x + 11x +
              logger::log_trace(
    501 - 11x + 11x +
                "DFFilterStates$srv_add_filter_state initialized, dataname: { private$dataname }"
    @@ -42027,7 +43374,8 @@

    teal.slice coverage - 57.02%

    503 - 11x + 11x +
              NULL
    @@ -42153,14 +43501,16 @@

    teal.slice coverage - 57.02%

    521 - 81x + 81x +
          checkmate::assert_character(variables)
    522 - 81x + 81x +
          if (identical(variables, character(0))) {
    @@ -42181,28 +43531,32 @@

    teal.slice coverage - 57.02%

    525 - 81x + 81x +
            varlabels <- private$varlabels[variables]
    526 - 81x + 81x +
            missing_labels <- is.na(varlabels) | varlabels == ""
    527 - 81x + 81x +
            varlabels[missing_labels] <- variables[missing_labels]
    528 - 81x + 81x +
            varlabels
    @@ -42397,21 +43751,24 @@

    teal.slice coverage - 57.02%

    23 - 45x + 45x +
          super$initialize(dataname, datalabel)
    24 - 45x + 45x +
          private$state_list <- list(
    25 - 45x + 45x +
            subset = reactiveVal()
    @@ -42481,7 +43838,8 @@

    teal.slice coverage - 57.02%

    35 - 4x + 4x +
          checkmate::assert_number(indent, finite = TRUE, lower = 0)
    @@ -42495,14 +43853,16 @@

    teal.slice coverage - 57.02%

    37 - 4x + 4x +
          formatted_states <- c()
    38 - 4x + 4x +
          for (state in self$state_list_get(state_list_index = "subset")) {
    @@ -42523,7 +43883,8 @@

    teal.slice coverage - 57.02%

    41 - 4x + 4x +
          paste(formatted_states, collapse = "\n")
    @@ -42586,42 +43947,48 @@

    teal.slice coverage - 57.02%

    50 - 1x + 1x +
          moduleServer(
    51 - 1x + 1x +
            id = id,
    52 - 1x + 1x +
            function(input, output, session) {
    53 - 1x + 1x +
              previous_state <- reactiveVal(isolate(self$state_list_get("subset")))
    54 - 1x + 1x +
              added_state_name <- reactiveVal(character(0))
    55 - 1x + 1x +
              removed_state_name <- reactiveVal(character(0))
    @@ -42635,21 +44002,24 @@

    teal.slice coverage - 57.02%

    57 - 1x + 1x +
              observeEvent(self$state_list_get("subset"), {
    58 - 1x + 1x +
                added_state_name(
    59 - 1x + 1x +
                  setdiff(names(self$state_list_get("subset")), names(previous_state()))
    @@ -42663,14 +44033,16 @@

    teal.slice coverage - 57.02%

    61 - 1x + 1x +
                removed_state_name(
    62 - 1x + 1x +
                  setdiff(names(previous_state()), names(self$state_list_get("subset")))
    @@ -42684,7 +44056,8 @@

    teal.slice coverage - 57.02%

    64 - 1x + 1x +
                previous_state(self$state_list_get("subset"))
    @@ -42705,28 +44078,32 @@

    teal.slice coverage - 57.02%

    67 - 1x + 1x +
              observeEvent(added_state_name(), ignoreNULL = TRUE, {
    68 - 1x + 1x +
                fstates <- self$state_list_get("subset")
    69 - 1x + 1x +
                html_ids <- private$map_vars_to_html_ids(keys = names(fstates))
    70 - 1x + 1x +
                for (fname in added_state_name()) {
    @@ -42782,7 +44159,8 @@

    teal.slice coverage - 57.02%

    78 - 1x + 1x +
                added_state_name(character(0))
    @@ -42803,14 +44181,16 @@

    teal.slice coverage - 57.02%

    81 - 1x + 1x +
              observeEvent(removed_state_name(), {
    82 - 1x + 1x +
                req(removed_state_name())
    @@ -42859,7 +44239,8 @@

    teal.slice coverage - 57.02%

    89 - 1x + 1x +
              NULL
    @@ -42950,7 +44331,8 @@

    teal.slice coverage - 57.02%

    102 - 9x + 9x +
          lapply(self$state_list_get(state_list_index = "subset"), function(x) x$get_state())
    @@ -43055,42 +44437,48 @@

    teal.slice coverage - 57.02%

    117 - 4x + 4x +
          checkmate::assert_class(data, "matrix")
    118 - 4x + 4x +
          checkmate::assert(
    119 - 4x + 4x +
            checkmate::assert(
    120 - 4x + 4x +
              !checkmate::test_null(names(state)),
    121 - 4x + 4x +
              checkmate::check_subset(names(state), colnames(data)),
    122 - 4x + 4x +
              combine = "and"
    @@ -43104,14 +44492,16 @@

    teal.slice coverage - 57.02%

    124 - 4x + 4x +
            checkmate::check_class(state, "default_filter"),
    125 - 4x + 4x +
            combine = "or"
    @@ -43125,21 +44515,24 @@

    teal.slice coverage - 57.02%

    127 - 3x + 3x +
          logger::log_trace(paste(
    128 - 3x + 3x +
            "MatrixFilterState$set_filter_state initializing,",
    129 - 3x + 3x +
            "dataname: { private$dataname }"
    @@ -43153,28 +44546,32 @@

    teal.slice coverage - 57.02%

    131 - 3x + 3x +
          filter_states <- self$state_list_get("subset")
    132 - 3x + 3x +
          for (varname in names(state)) {
    133 - 3x + 3x +
            value <- resolve_state(state[[varname]])
    134 - 3x + 3x +
            if (varname %in% names(filter_states)) {
    @@ -43202,42 +44599,48 @@

    teal.slice coverage - 57.02%

    138 - 3x + 3x +
              fstate <- init_filter_state(
    139 - 3x + 3x +
                data[, varname],
    140 - 3x + 3x +
                varname = varname,
    141 - 3x + 3x +
                varlabel = varname,
    142 - 3x + 3x +
                dataname = private$dataname,
    143 - 3x + 3x +
                extract_type = "matrix"
    @@ -43251,35 +44654,40 @@

    teal.slice coverage - 57.02%

    145 - 3x + 3x +
              fstate$set_state(value)
    146 - 3x + 3x +
              self$state_list_push(
    147 - 3x + 3x +
                x = fstate,
    148 - 3x + 3x +
                state_list_index = "subset",
    149 - 3x + 3x +
                state_id = varname
    @@ -43307,21 +44715,24 @@

    teal.slice coverage - 57.02%

    153 - 3x + 3x +
          logger::log_trace(paste(
    154 - 3x + 3x +
            "MatrixFilterState$set_filter_state initialized,",
    155 - 3x + 3x +
            "dataname: { private$dataname }"
    @@ -43335,7 +44746,8 @@

    teal.slice coverage - 57.02%

    157 - 3x + 3x +
          NULL
    @@ -43398,42 +44810,48 @@

    teal.slice coverage - 57.02%

    166 - 2x + 2x +
          logger::log_trace(
    167 - 2x + 2x +
            sprintf(
    168 - 2x + 2x +
              "%s$remove_filter_state of variable %s, dataname: %s",
    169 - 2x + 2x +
              class(self)[1],
    170 - 2x + 2x +
              state_id,
    171 - 2x + 2x +
              private$dataname
    @@ -43461,28 +44879,32 @@

    teal.slice coverage - 57.02%

    175 - 2x + 2x +
          if (!state_id %in% names(self$state_list_get("subset"))) {
    176 - 1x + 1x +
            warning(paste(
    177 - 1x + 1x +
              "Variable:", state_id, "is not present in the actual active filters of dataset:",
    178 - 1x + 1x +
              "{ private$dataname } therefore no changes are applied."
    @@ -43496,28 +44918,32 @@

    teal.slice coverage - 57.02%

    180 - 1x + 1x +
            logger::log_warn(
    181 - 1x + 1x +
              paste(
    182 - 1x + 1x +
                "Variable:", state_id, "is not present in the actual active filters of dataset:",
    183 - 1x + 1x +
                "{ private$dataname } therefore no changes are applied."
    @@ -43545,49 +44971,56 @@

    teal.slice coverage - 57.02%

    187 - 1x + 1x +
            self$state_list_remove(state_list_index = "subset", state_id = state_id)
    188 - 1x + 1x +
            logger::log_trace(
    189 - 1x + 1x +
              sprintf(
    190 - 1x + 1x +
                "%s$remove_filter_state of variable %s done, dataname: %s",
    191 - 1x + 1x +
                class(self)[1],
    192 - 1x + 1x +
                state_id,
    193 - 1x + 1x +
                private$dataname
    @@ -43720,14 +45153,16 @@

    teal.slice coverage - 57.02%

    212 - 2x + 2x +
          checkmate::assert_string(id)
    213 - 2x + 2x +
          stopifnot(is.matrix(data))
    @@ -43741,7 +45176,8 @@

    teal.slice coverage - 57.02%

    215 - 2x + 2x +
          ns <- NS(id)
    @@ -43755,28 +45191,32 @@

    teal.slice coverage - 57.02%

    217 - 2x + 2x +
          if (ncol(data) == 0) {
    218 - 1x + 1x +
            div("no sample variables available")
    219 - 1x + 1x +
          } else if (nrow(data) == 0) {
    220 - 1x + 1x +
            div("no samples available")
    @@ -45420,14 +46860,16 @@

    teal.slice coverage - 57.02%

    111 - 88x + 88x +
          checkmate::assert_numeric(x, all.missing = FALSE)
    112 - 2x + 2x +
          if (!any(is.finite(x))) stop("\"x\" contains no finite values")
    @@ -45441,28 +46883,32 @@

    teal.slice coverage - 57.02%

    114 - 86x + 86x +
          super$initialize(x, varname, varlabel, dataname, extract_type)
    115 - 86x + 86x +
          private$inf_count <- sum(is.infinite(x))
    116 - 86x + 86x +
          private$is_integer <- checkmate::test_integerish(x)
    117 - 86x + 86x +
          private$keep_inf <- reactiveVal(FALSE)
    @@ -45476,14 +46922,16 @@

    teal.slice coverage - 57.02%

    119 - 86x + 86x +
          x_range <- range(x, finite = TRUE)
    120 - 86x + 86x +
          x_pretty <- pretty(x_range, 100L)
    @@ -45497,35 +46945,40 @@

    teal.slice coverage - 57.02%

    122 - 86x + 86x +
          if (identical(diff(x_range), 0)) {
    123 - 11x + 11x +
            private$set_choices(x_range)
    124 - 11x + 11x +
            private$slider_ticks <- signif(x_range, digits = 10)
    125 - 11x + 11x +
            private$slider_step <- NULL
    126 - 11x + 11x +
            self$set_selected(x_range)
    @@ -45539,28 +46992,32 @@

    teal.slice coverage - 57.02%

    128 - 75x + 75x +
            private$set_choices(range(x_pretty))
    129 - 75x + 75x +
            private$slider_ticks <- signif(x_pretty, digits = 10)
    130 - 75x + 75x +
            private$slider_step <- signif(private$get_pretty_range_step(x_pretty), digits = 10)
    131 - 75x + 75x +
            self$set_selected(range(x_pretty))
    @@ -45581,21 +47038,24 @@

    teal.slice coverage - 57.02%

    134 - 86x + 86x +
          private$histogram_data <- if (sum(is.finite(x)) >= 2) {
    135 - 75x + 75x +
            as.data.frame(
    136 - 75x + 75x +
              stats::density(x, na.rm = TRUE, n = 100)[c("x", "y")] # 100 bins only
    @@ -45616,7 +47076,8 @@

    teal.slice coverage - 57.02%

    139 - 11x + 11x +
            data.frame(x = NA_real_, y = NA_real_)
    @@ -45637,7 +47098,8 @@

    teal.slice coverage - 57.02%

    142 - 86x + 86x +
          return(invisible(self))
    @@ -45721,7 +47183,8 @@

    teal.slice coverage - 57.02%

    154 - 33x + 33x +
          checkmate::assert_number(indent, finite = TRUE, lower = 0)
    @@ -45735,56 +47198,64 @@

    teal.slice coverage - 57.02%

    156 - 32x + 32x +
          vals <- self$get_selected()
    157 - 32x + 32x +
          sprintf(
    158 - 32x + 32x +
            "%sFiltering on: %s\n%1$s  Selected range: %s - %s\n%1$s  Include missing values: %s",
    159 - 32x + 32x +
            format("", width = indent),
    160 - 32x + 32x +
            private$varname,
    161 - 32x + 32x +
            format(vals[1], nsmall = 3),
    162 - 32x + 32x +
            format(vals[2], nsmall = 3),
    163 - 32x + 32x +
            format(self$get_keep_na())
    @@ -45840,42 +47311,48 @@

    teal.slice coverage - 57.02%

    171 - 29x + 29x +
          if (!isTRUE(all.equal(self$get_selected(), private$choices))) {
    172 - 20x + 20x +
            TRUE
    173 - 9x + 9x +
          } else if (!isTRUE(self$get_keep_inf()) && private$inf_count > 0) {
    174 - 2x + 2x +
            TRUE
    175 - 7x + 7x +
          } else if (!isTRUE(self$get_keep_na()) && private$na_count > 0) {
    176 - 2x + 2x +
            TRUE
    @@ -45889,7 +47366,8 @@

    teal.slice coverage - 57.02%

    178 - 5x + 5x +
            FALSE
    @@ -45966,14 +47444,16 @@

    teal.slice coverage - 57.02%

    189 - 31x + 31x +
          filter_call <-
    190 - 31x + 31x +
            call(
    @@ -45987,14 +47467,16 @@

    teal.slice coverage - 57.02%

    192 - 31x + 31x +
              call(">=", private$get_varname_prefixed(), self$get_selected()[1L]),
    193 - 31x + 31x +
              call("<=", private$get_varname_prefixed(), self$get_selected()[2L])
    @@ -46008,7 +47490,8 @@

    teal.slice coverage - 57.02%

    195 - 31x + 31x +
          private$add_keep_na_call(private$add_keep_inf_call(filter_call))
    @@ -46057,7 +47540,8 @@

    teal.slice coverage - 57.02%

    202 - 70x + 70x +
          private$keep_inf()
    @@ -46134,28 +47618,32 @@

    teal.slice coverage - 57.02%

    213 - 28x + 28x +
          list(
    214 - 28x + 28x +
            selected = self$get_selected(),
    215 - 28x + 28x +
            keep_na = self$get_keep_na(),
    216 - 28x + 28x +
            keep_inf = self$get_keep_inf()
    @@ -46232,63 +47720,72 @@

    teal.slice coverage - 57.02%

    227 - 36x + 36x +
          checkmate::assert_flag(value)
    228 - 36x + 36x +
          private$keep_inf(value)
    229 - 36x + 36x +
          logger::log_trace(
    230 - 36x + 36x +
            sprintf(
    231 - 36x + 36x +
              "%s$set_keep_inf of variable %s set to %s, dataname: %s.",
    232 - 36x + 36x +
              class(self)[1],
    233 - 36x + 36x +
              private$varname,
    234 - 36x + 36x +
              value,
    235 - 36x + 36x +
              private$dataname
    @@ -46393,21 +47890,24 @@

    teal.slice coverage - 57.02%

    250 - 67x + 67x +
          stopifnot(is.list(state) && all(names(state) %in% c("selected", "keep_na", "keep_inf")))
    251 - 66x + 66x +
          if (!is.null(state$keep_inf)) {
    252 - 27x + 27x +
            self$set_keep_inf(state$keep_inf)
    @@ -46421,14 +47921,16 @@

    teal.slice coverage - 57.02%

    254 - 66x + 66x +
          super$set_state(state[names(state) %in% c("selected", "keep_na")])
    255 - 66x + 66x +
          invisible(NULL)
    @@ -46561,7 +48063,8 @@

    teal.slice coverage - 57.02%

    274 - 158x + 158x +
          super$set_selected(value)
    @@ -46680,14 +48183,16 @@

    teal.slice coverage - 57.02%

    291 - 31x + 31x +
          if (isTRUE(self$get_keep_inf())) {
    292 - 3x + 3x +
            call("|", call("is.infinite", private$get_varname_prefixed()), filter_call)
    @@ -46701,7 +48206,8 @@

    teal.slice coverage - 57.02%

    294 - 28x + 28x +
            filter_call
    @@ -46764,14 +48270,16 @@

    teal.slice coverage - 57.02%

    303 - 77x + 77x +
          if (private$is_integer && diff(range(pretty_range) > 2)) {
    304 - 12x + 12x +
            return(1L)
    @@ -46785,21 +48293,24 @@

    teal.slice coverage - 57.02%

    306 - 65x + 65x +
            n_steps <- length(pretty_range) - 1
    307 - 65x + 65x +
            return(
    308 - 65x + 65x +
              signif(digits = 10, (max(pretty_range) - min(pretty_range)) / n_steps)
    @@ -46848,7 +48359,8 @@

    teal.slice coverage - 57.02%

    315 - 157x + 157x +
          if (!is.numeric(value)) {
    @@ -46911,7 +48423,8 @@

    teal.slice coverage - 57.02%

    324 - 157x + 157x +
          invisible(NULL)
    @@ -46953,14 +48466,16 @@

    teal.slice coverage - 57.02%

    330 - 1x + 1x +
          if (!is.atomic(values)) stop("Values to set must be an atomic vector.")
    331 - 157x + 157x +
          values <- as.numeric(values)
    @@ -46988,42 +48503,48 @@

    teal.slice coverage - 57.02%

    335 - 157x + 157x +
          values_adjusted <- contain_interval(values, private$slider_ticks)
    336 - 157x + 157x +
          if (!isTRUE(all.equal(values, values_adjusted))) {
    337 - 1x + 1x +
            logger::log_warn(sprintf(
    338 - 1x + 1x +
              paste(
    339 - 1x + 1x +
                "Programmatic range specification on %s was adjusted to existing slider ticks.",
    340 - 1x + 1x +
                "It is now broader in order to contain the specified values."
    @@ -47037,7 +48558,8 @@

    teal.slice coverage - 57.02%

    342 - 1x + 1x +
              private$varname
    @@ -47058,7 +48580,8 @@

    teal.slice coverage - 57.02%

    345 - 157x + 157x +
          values_adjusted
    @@ -47086,7 +48609,8 @@

    teal.slice coverage - 57.02%

    349 - 157x + 157x +
          values
    @@ -49101,14 +50625,16 @@

    teal.slice coverage - 57.02%

    116 - 23x + 23x +
          checkmate::assert_multi_class(x, c("POSIXct", "POSIXlt"))
    117 - 23x + 23x +
          super$initialize(x, varname, varlabel, dataname, extract_type)
    @@ -49122,21 +50648,24 @@

    teal.slice coverage - 57.02%

    119 - 23x + 23x +
          var_range <- as.POSIXct(trunc(range(x, na.rm = TRUE), units = "secs"))
    120 - 23x + 23x +
          private$set_choices(var_range)
    121 - 23x + 23x +
          self$set_selected(var_range)
    @@ -49150,7 +50679,8 @@

    teal.slice coverage - 57.02%

    123 - 23x + 23x +
          return(invisible(self))
    @@ -49227,7 +50757,8 @@

    teal.slice coverage - 57.02%

    134 - 6x + 6x +
          checkmate::assert_number(indent, finite = TRUE, lower = 0)
    @@ -49248,56 +50779,64 @@

    teal.slice coverage - 57.02%

    137 - 5x + 5x +
          vals <- self$get_selected()
    138 - 5x + 5x +
          sprintf(
    139 - 5x + 5x +
            "%sFiltering on: %s\n%1$s  Selected range: %s - %s\n%1$s  Include missing values: %s",
    140 - 5x + 5x +
            format("", width = indent),
    141 - 5x + 5x +
            private$varname,
    142 - 5x + 5x +
            format(vals[1], nsmall = 3),
    143 - 5x + 5x +
            format(vals[2], nsmall = 3),
    144 - 5x + 5x +
            format(self$get_keep_na())
    @@ -49353,28 +50892,32 @@

    teal.slice coverage - 57.02%

    152 - 6x + 6x +
          if (!setequal(self$get_selected(), private$choices)) {
    153 - 4x + 4x +
            TRUE
    154 - 2x + 2x +
          } else if (!isTRUE(self$get_keep_na()) && private$na_count > 0) {
    155 - 1x + 1x +
            TRUE
    @@ -49388,7 +50931,8 @@

    teal.slice coverage - 57.02%

    157 - 1x + 1x +
            FALSE
    @@ -49458,42 +51002,48 @@

    teal.slice coverage - 57.02%

    167 - 10x + 10x +
          choices <- self$get_selected()
    168 - 10x + 10x +
          tzone <- Find(function(x) x != "", attr(as.POSIXlt(choices), "tzone"))
    169 - 10x + 10x +
          class <- class(choices)[1L]
    170 - 10x + 10x +
          date_fun <- as.name(switch(class,
    171 - 10x + 10x +
            "POSIXct" = "as.POSIXct",
    172 - 10x + 10x +
            "POSIXlt" = "as.POSIXlt"
    @@ -49507,21 +51057,24 @@

    teal.slice coverage - 57.02%

    174 - 10x + 10x +
          choices <- as.character(choices + c(0, 1))
    175 - 10x + 10x +
          filter_call <-
    176 - 10x + 10x +
            call(
    @@ -49535,7 +51088,8 @@

    teal.slice coverage - 57.02%

    178 - 10x + 10x +
              call(
    @@ -49549,14 +51103,16 @@

    teal.slice coverage - 57.02%

    180 - 10x + 10x +
                private$get_varname_prefixed(),
    181 - 10x + 10x +
                as.call(list(date_fun, choices[1L], tz = tzone))
    @@ -49570,7 +51126,8 @@

    teal.slice coverage - 57.02%

    183 - 10x + 10x +
              call(
    @@ -49584,14 +51141,16 @@

    teal.slice coverage - 57.02%

    185 - 10x + 10x +
                private$get_varname_prefixed(),
    186 - 10x + 10x +
                as.call(list(date_fun, choices[2L], tz = tzone))
    @@ -49612,7 +51171,8 @@

    teal.slice coverage - 57.02%

    189 - 10x + 10x +
          private$add_keep_na_call(filter_call)
    @@ -49766,7 +51326,8 @@

    teal.slice coverage - 57.02%

    211 - 41x + 41x +
          super$set_selected(value)
    @@ -49829,7 +51390,8 @@

    teal.slice coverage - 57.02%

    220 - 40x + 40x +
          if (!(is(value, "POSIXct") || is(value, "POSIXlt"))) {
    @@ -49899,28 +51461,32 @@

    teal.slice coverage - 57.02%

    230 - 40x + 40x +
          pre_msg <- sprintf(
    231 - 40x + 40x +
            "dataset '%s', variable '%s': ",
    232 - 40x + 40x +
            self$get_dataname(),
    233 - 40x + 40x +
            self$get_varname()
    @@ -49934,7 +51500,8 @@

    teal.slice coverage - 57.02%

    235 - 40x + 40x +
          check_in_range(value, private$choices, pre_msg = pre_msg)
    @@ -49955,21 +51522,24 @@

    teal.slice coverage - 57.02%

    238 - 41x + 41x +
          tryCatch(
    239 - 41x + 41x +
            expr = {
    240 - 41x + 41x +
              values <- as.POSIXct(values)
    @@ -49990,7 +51560,8 @@

    teal.slice coverage - 57.02%

    243 - 41x + 41x +
            error = function(error) stop("The array of set values must contain values coercible to POSIX.")
    @@ -50011,7 +51582,8 @@

    teal.slice coverage - 57.02%

    246 - 40x + 40x +
          values
    @@ -50032,28 +51604,32 @@

    teal.slice coverage - 57.02%

    249 - 40x + 40x +
          if (values[1] < private$choices[1]) {
    250 - 4x + 4x +
            warning(paste(
    251 - 4x + 4x +
              "Value:", values[1], "is outside of the possible range for column", private$varname,
    252 - 4x + 4x +
              "of dataset", private$dataname, "."
    @@ -50067,7 +51643,8 @@

    teal.slice coverage - 57.02%

    254 - 4x + 4x +
            values[1] <- private$choices[1]
    @@ -50088,28 +51665,32 @@

    teal.slice coverage - 57.02%

    257 - 40x + 40x +
          if (values[2] > private$choices[2]) {
    258 - 5x + 5x +
            warning(paste(
    259 - 5x + 5x +
              "Value:", values[2], "is outside of the possible range for column", private$varname,
    260 - 5x + 5x +
              "of dataset", private$dataname, "."
    @@ -50123,7 +51704,8 @@

    teal.slice coverage - 57.02%

    262 - 5x + 5x +
            values[2] <- private$choices[2]
    @@ -50137,7 +51719,8 @@

    teal.slice coverage - 57.02%

    264 - 40x + 40x +
          values
    @@ -52250,35 +53833,40 @@

    teal.slice coverage - 57.02%

    109 - 144x + 144x +
          checkmate::assert(
    110 - 144x + 144x +
            is.character(x),
    111 - 144x + 144x +
            is.factor(x),
    112 - 144x + 144x +
            length(unique(x[!is.na(x)])) < getOption("teal.threshold_slider_vs_checkboxgroup"),
    113 - 144x + 144x +
            combine = "or"
    @@ -52292,7 +53880,8 @@

    teal.slice coverage - 57.02%

    115 - 144x + 144x +
          super$initialize(x, varname, varlabel, dataname, extract_type)
    @@ -52306,21 +53895,24 @@

    teal.slice coverage - 57.02%

    117 - 144x + 144x +
          private$data_class <- class(x)[1L]
    118 - 144x + 144x +
          if (inherits(x, "POSIXt")) {
    119 - 12x + 12x +
            private$tzone <- Find(function(x) x != "", attr(as.POSIXlt(x), "tzone"))
    @@ -52341,14 +53933,16 @@

    teal.slice coverage - 57.02%

    122 - 144x + 144x +
          if (!is.factor(x)) {
    123 - 113x + 113x +
            x <- factor(as.character(x), levels = as.character(sort(unique(x))))
    @@ -52362,28 +53956,32 @@

    teal.slice coverage - 57.02%

    125 - 144x + 144x +
          x <- droplevels(x)
    126 - 144x + 144x +
          tbl <- table(x)
    127 - 144x + 144x +
          choices <- names(tbl)
    128 - 144x + 144x +
          names(choices) <- tbl
    @@ -52404,35 +54002,40 @@

    teal.slice coverage - 57.02%

    131 - 144x + 144x +
          private$set_choices(as.list(choices))
    132 - 144x + 144x +
          self$set_selected(unname(choices))
    133 - 144x + 144x +
          private$histogram_data <- data.frame(
    134 - 144x + 144x +
            x = levels(x),
    135 - 144x + 144x +
            y = tabulate(x)
    @@ -52453,7 +54056,8 @@

    teal.slice coverage - 57.02%

    138 - 144x + 144x +
          return(invisible(self))
    @@ -52502,28 +54106,32 @@

    teal.slice coverage - 57.02%

    145 - 44x + 44x +
          if (!setequal(self$get_selected(), private$choices)) {
    146 - 37x + 37x +
            TRUE
    147 - 7x + 7x +
          } else if (!isTRUE(self$get_keep_na()) && private$na_count > 0) {
    148 - 3x + 3x +
            TRUE
    @@ -52537,7 +54145,8 @@

    teal.slice coverage - 57.02%

    150 - 4x + 4x +
            FALSE
    @@ -52614,28 +54223,32 @@

    teal.slice coverage - 57.02%

    161 - 61x + 61x +
          varname <- private$get_varname_prefixed()
    162 - 61x + 61x +
          choices <- self$get_selected()
    163 - 61x + 61x +
          if (private$data_class != "factor") {
    164 - 50x + 50x +
            choices <- do.call(sprintf("as.%s", private$data_class), list(x = choices))
    @@ -52649,63 +54262,72 @@

    teal.slice coverage - 57.02%

    166 - 61x + 61x +
          fun_compare <- if (length(choices) == 1L) "==" else "%in%"
    167 - 61x + 61x +
          filter_call <-
    168 - 61x + 61x +
            if (inherits(choices, "Date")) {
    169 - 4x + 4x +
              call(fun_compare, varname, call("as.Date", as.character(choices)))
    170 - 61x + 61x +
            } else if (inherits(choices, c("POSIXct", "POSIXlt"))) {
    171 - 8x + 8x +
              class <- class(choices)[1L]
    172 - 8x + 8x +
              date_fun <- as.name(switch(class,
    173 - 8x + 8x +
                "POSIXct" = "as.POSIXct",
    174 - 8x + 8x +
                "POSIXlt" = "as.POSIXlt"
    @@ -52719,7 +54341,8 @@

    teal.slice coverage - 57.02%

    176 - 8x + 8x +
              call(fun_compare, varname, as.call(list(date_fun, as.character(choices), tz = private$tzone)))
    @@ -52740,7 +54363,8 @@

    teal.slice coverage - 57.02%

    179 - 49x + 49x +
              call(fun_compare, varname, choices)
    @@ -52754,7 +54378,8 @@

    teal.slice coverage - 57.02%

    181 - 61x + 61x +
          private$add_keep_na_call(filter_call)
    @@ -52838,14 +54463,16 @@

    teal.slice coverage - 57.02%

    193 - 100x + 100x +
          if (!is.null(state$selected)) {
    194 - 100x + 100x +
            state$selected <- as.character(state$selected)
    @@ -52859,14 +54486,16 @@

    teal.slice coverage - 57.02%

    196 - 100x + 100x +
          super$set_state(state)
    197 - 99x + 99x +
          invisible(NULL)
    @@ -52992,7 +54621,8 @@

    teal.slice coverage - 57.02%

    215 - 282x + 282x +
          super$set_selected(value)
    @@ -53083,7 +54713,8 @@

    teal.slice coverage - 57.02%

    228 - 282x + 282x +
          if (!is.character(value)) {
    @@ -53146,28 +54777,32 @@

    teal.slice coverage - 57.02%

    237 - 282x + 282x +
          pre_msg <- sprintf(
    238 - 282x + 282x +
            "data '%s', variable '%s': ",
    239 - 282x + 282x +
            self$get_dataname(),
    240 - 282x + 282x +
            self$get_varname()
    @@ -53181,7 +54816,8 @@

    teal.slice coverage - 57.02%

    242 - 282x + 282x +
          check_in_subset(value, private$choices, pre_msg = pre_msg)
    @@ -53202,21 +54838,24 @@

    teal.slice coverage - 57.02%

    245 - 282x + 282x +
          tryCatch(
    246 - 282x + 282x +
            expr = {
    247 - 282x + 282x +
              values <- as.character(values)
    @@ -53237,7 +54876,8 @@

    teal.slice coverage - 57.02%

    250 - 282x + 282x +
            error = function(error) stop("The array of set values must contain values coercible to character.")
    @@ -53251,7 +54891,8 @@

    teal.slice coverage - 57.02%

    252 - 282x + 282x +
          values
    @@ -53272,35 +54913,40 @@

    teal.slice coverage - 57.02%

    255 - 282x + 282x +
          in_choices_mask <- values %in% private$choices
    256 - 282x + 282x +
          if (length(values[!in_choices_mask]) > 0) {
    257 - 18x + 18x +
            warning(paste(
    258 - 18x + 18x +
              "Values:", strtrim(paste(values[!in_choices_mask], collapse = ", "), 360),
    259 - 18x + 18x +
              "are not in choices of column", private$varname, "in dataset", private$dataname, "."
    @@ -53321,7 +54967,8 @@

    teal.slice coverage - 57.02%

    262 - 282x + 282x +
          values[in_choices_mask]
    @@ -54874,49 +56521,56 @@

    teal.slice coverage - 57.02%

    105 - 16x + 16x +
          stopifnot(is.logical(x))
    106 - 16x + 16x +
          super$initialize(x, varname, varlabel, dataname, extract_type)
    107 - 16x + 16x +
          df <- as.factor(x)
    108 - 16x + 16x +
          if (length(levels(df)) != 2) {
    109 - 6x + 6x +
            if (levels(df) %in% c(TRUE, FALSE)) {
    110 - 6x + 6x +
              choices_not_included <- c(TRUE, FALSE)[!c(TRUE, FALSE) %in% levels(df)]
    111 - 6x + 6x +
              levels(df) <- c(levels(df), choices_not_included)
    @@ -54944,7 +56598,8 @@

    teal.slice coverage - 57.02%

    115 - 16x + 16x +
          tbl <- table(df)
    @@ -54958,63 +56613,72 @@

    teal.slice coverage - 57.02%

    117 - 16x + 16x +
          choices <- as.logical(names(tbl))
    118 - 16x + 16x +
          names(choices) <- tbl
    119 - 16x + 16x +
          private$set_choices(as.list(choices))
    120 - 16x + 16x +
          self$set_selected(unname(choices)[1])
    121 - 16x + 16x +
          private$histogram_data <- data.frame(
    122 - 16x + 16x +
            x = sprintf(
    123 - 16x + 16x +
              "%s (%s)",
    124 - 16x + 16x +
              choices,
    125 - 16x + 16x +
              names(choices)
    @@ -55028,7 +56692,8 @@

    teal.slice coverage - 57.02%

    127 - 16x + 16x +
            y = as.vector(tbl)
    @@ -55049,7 +56714,8 @@

    teal.slice coverage - 57.02%

    130 - 16x + 16x +
          invisible(self)
    @@ -55098,56 +56764,64 @@

    teal.slice coverage - 57.02%

    137 - 20x + 20x +
          if (!isTRUE(self$get_keep_na()) && private$na_count > 0) {
    138 - 9x + 9x +
            TRUE
    139 - 11x + 11x +
          } else if (all(private$histogram_data$y > 0)) {
    140 - 6x + 6x +
            TRUE
    141 - 5x + 5x +
          } else if (self$get_selected() == FALSE && "FALSE (0)" %in% private$histogram_data$x) {
    142 - 1x + 1x +
            TRUE
    143 - 4x + 4x +
          } else if (self$get_selected() == TRUE && "TRUE (0)" %in% private$histogram_data$x) {
    144 - 1x + 1x +
            TRUE
    @@ -55161,7 +56835,8 @@

    teal.slice coverage - 57.02%

    146 - 3x + 3x +
            FALSE
    @@ -55224,21 +56899,24 @@

    teal.slice coverage - 57.02%

    155 - 8x + 8x +
          filter_call <-
    156 - 8x + 8x +
            if (self$get_selected()) {
    157 - 2x + 2x +
              private$get_varname_prefixed()
    @@ -55252,7 +56930,8 @@

    teal.slice coverage - 57.02%

    159 - 6x + 6x +
              call("!", private$get_varname_prefixed())
    @@ -55266,7 +56945,8 @@

    teal.slice coverage - 57.02%

    161 - 8x + 8x +
          private$add_keep_na_call(filter_call)
    @@ -55392,7 +57072,8 @@

    teal.slice coverage - 57.02%

    179 - 44x + 44x +
          super$set_selected(value)
    @@ -55476,42 +57157,48 @@

    teal.slice coverage - 57.02%

    191 - 44x + 44x +
          if (!(checkmate::test_logical(value, max.len = 1, any.missing = FALSE))) {
    192 - 2x + 2x +
            stop(
    193 - 2x + 2x +
              sprintf(
    194 - 2x + 2x +
                "value of the selection for `%s` in `%s` should be a logical scalar (TRUE or FALSE)",
    195 - 2x + 2x +
                self$get_varname(),
    196 - 2x + 2x +
                self$get_dataname()
    @@ -55546,28 +57233,32 @@

    teal.slice coverage - 57.02%

    201 - 42x + 42x +
          pre_msg <- sprintf(
    202 - 42x + 42x +
            "dataset '%s', variable '%s': ",
    203 - 42x + 42x +
            self$get_dataname(),
    204 - 42x + 42x +
            self$get_varname()
    @@ -55581,7 +57272,8 @@

    teal.slice coverage - 57.02%

    206 - 42x + 42x +
          check_in_subset(value, private$choices, pre_msg = pre_msg)
    @@ -55602,21 +57294,24 @@

    teal.slice coverage - 57.02%

    209 - 44x + 44x +
          tryCatch(
    210 - 44x + 44x +
            expr = {
    211 - 44x + 44x +
              values_logical <- as.logical(values)
    @@ -55637,7 +57332,8 @@

    teal.slice coverage - 57.02%

    214 - 44x + 44x +
            error = function(cond) stop("The array of set values must contain values coercible to logical.")
    @@ -55651,7 +57347,8 @@

    teal.slice coverage - 57.02%

    216 - 44x + 44x +
          values_logical
    @@ -56742,14 +58439,16 @@

    teal.slice coverage - 57.02%

    48 - 10x + 10x +
          checkmate::assert_class(datasets, "FilteredData")
    49 - 8x + 8x +
          private$filtered_data <- datasets
    @@ -56826,7 +58525,8 @@

    teal.slice coverage - 57.02%

    60 - 7x + 7x +
          private$filtered_data$get_filter_state()
    @@ -56896,14 +58596,16 @@

    teal.slice coverage - 57.02%

    70 - 8x + 8x +
          if (private$filtered_data$get_filter_panel_active()) {
    71 - 6x + 6x +
            private$filtered_data$set_filter_state(filter)
    @@ -56917,7 +58619,8 @@

    teal.slice coverage - 57.02%

    73 - 2x + 2x +
            warning(private$deactivated_msg)
    @@ -56931,7 +58634,8 @@

    teal.slice coverage - 57.02%

    75 - 8x + 8x +
          invisible(NULL)
    @@ -57001,14 +58705,16 @@

    teal.slice coverage - 57.02%

    85 - 1x + 1x +
          if (private$filtered_data$get_filter_panel_active()) {
    86 - 1x + 1x +
            private$filtered_data$remove_filter_state(filter)
    @@ -57036,7 +58742,8 @@

    teal.slice coverage - 57.02%

    90 - 1x + 1x +
          invisible(NULL)
    @@ -57120,21 +58827,24 @@

    teal.slice coverage - 57.02%

    102 - 5x + 5x +
          if (private$filtered_data$get_filter_panel_active()) {
    103 - 3x + 3x +
            datanames_to_remove <- if (missing(datanames)) private$filtered_data$datanames() else datanames
    104 - 3x + 3x +
            private$filtered_data$remove_all_filter_states(datanames = datanames_to_remove)
    @@ -57148,7 +58858,8 @@

    teal.slice coverage - 57.02%

    106 - 2x + 2x +
            warning(private$deactivated_msg)
    @@ -57162,7 +58873,8 @@

    teal.slice coverage - 57.02%

    108 - 5x + 5x +
          invisible(NULL)
    @@ -57532,7 +59244,8 @@

    teal.slice coverage - 57.02%

    27 - 28x + 28x +
          if (!requireNamespace("MultiAssayExperiment", quietly = TRUE)) {
    @@ -57553,21 +59266,24 @@

    teal.slice coverage - 57.02%

    30 - 28x + 28x +
          checkmate::assert_class(dataset, "MultiAssayExperiment")
    31 - 27x + 27x +
          super$initialize(dataset, dataname, keys, label, metadata)
    32 - 27x + 27x +
          experiment_names <- names(dataset)
    @@ -57588,49 +59304,56 @@

    teal.slice coverage - 57.02%

    35 - 27x + 27x +
          private$add_filter_states(
    36 - 27x + 27x +
            filter_states = init_filter_states(
    37 - 27x + 27x +
              data = dataset,
    38 - 27x + 27x +
              dataname = dataname,
    39 - 27x + 27x +
              varlabels = self$get_varlabels(),
    40 - 27x + 27x +
              datalabel = "subjects",
    41 - 27x + 27x +
              keys = self$get_keys()
    @@ -57644,7 +59367,8 @@

    teal.slice coverage - 57.02%

    43 - 27x + 27x +
            id = "subjects"
    @@ -57679,56 +59403,64 @@

    teal.slice coverage - 57.02%

    48 - 27x + 27x +
          lapply(
    49 - 27x + 27x +
            experiment_names,
    50 - 27x + 27x +
            function(experiment_name) {
    51 - 135x + 135x +
              private$add_filter_states(
    52 - 135x + 135x +
                filter_states = init_filter_states(
    53 - 135x + 135x +
                  data = dataset[[experiment_name]],
    54 - 135x + 135x +
                  dataname = sprintf('%s[["%s"]]', dataname, experiment_name),
    55 - 135x + 135x +
                  datalabel = experiment_name
    @@ -57742,7 +59474,8 @@

    teal.slice coverage - 57.02%

    57 - 135x + 135x +
                id = experiment_name
    @@ -57889,35 +59622,40 @@

    teal.slice coverage - 57.02%

    78 - 10x + 10x +
          filter_call <- Filter(
    79 - 10x + 10x +
            f = Negate(is.null),
    80 - 10x + 10x +
            x = lapply(
    81 - 10x + 10x +
              self$get_filter_states(),
    82 - 10x + 10x +
              function(x) x$get_call()
    @@ -57938,14 +59676,16 @@

    teal.slice coverage - 57.02%

    85 - 10x + 10x +
          if (length(filter_call) == 0) {
    86 - 5x + 5x +
            return(NULL)
    @@ -57959,7 +59699,8 @@

    teal.slice coverage - 57.02%

    88 - 5x + 5x +
          filter_call
    @@ -58064,7 +59805,8 @@

    teal.slice coverage - 57.02%

    103 - 28x + 28x +
          checkmate::assert_character(variables, null.ok = TRUE, any.missing = FALSE)
    @@ -58078,49 +59820,56 @@

    teal.slice coverage - 57.02%

    105 - 28x + 28x +
          labels <- vapply(
    106 - 28x + 28x +
            X = SummarizedExperiment::colData(private$dataset),
    107 - 28x + 28x +
            FUN.VALUE = character(1),
    108 - 28x + 28x +
            FUN = function(x) {
    109 - 840x + 840x +
              label <- attr(x, "label")
    110 - 840x + 840x +
              if (length(label) != 1) {
    111 - 28x + 28x +
                NA_character_
    @@ -58134,7 +59883,8 @@

    teal.slice coverage - 57.02%

    113 - 2x + 2x +
                label
    @@ -58169,7 +59919,8 @@

    teal.slice coverage - 57.02%

    118 - 28x + 28x +
          if (is.null(labels)) {
    @@ -58190,14 +59941,16 @@

    teal.slice coverage - 57.02%

    121 - 1x + 1x +
          if (!is.null(variables)) labels <- labels[names(labels) %in% variables]
    122 - 28x + 28x +
          labels
    @@ -58253,14 +60006,16 @@

    teal.slice coverage - 57.02%

    130 - 6x + 6x +
          names_exps <- paste0("- ", names(self$get_dataset()))
    131 - 6x + 6x +
          mae_and_exps <- c(self$get_dataname(), names_exps)
    @@ -58274,21 +60029,24 @@

    teal.slice coverage - 57.02%

    133 - 6x + 6x +
          df <- cbind(
    134 - 6x + 6x +
            private$get_filter_overview_nobs(filtered_dataset),
    135 - 6x + 6x +
            self$get_filter_overview_nsubjs(filtered_dataset)
    @@ -58309,14 +60067,16 @@

    teal.slice coverage - 57.02%

    138 - 6x + 6x +
          rownames(df) <- mae_and_exps
    139 - 6x + 6x +
          colnames(df) <- c("Obs", "Subjects")
    @@ -58330,7 +60090,8 @@

    teal.slice coverage - 57.02%

    141 - 6x + 6x +
          df
    @@ -58386,7 +60147,8 @@

    teal.slice coverage - 57.02%

    149 - 1x + 1x +
          character(0)
    @@ -58589,14 +60351,16 @@

    teal.slice coverage - 57.02%

    178 - 11x + 11x +
          checkmate::assert_list(state)
    179 - 10x + 10x +
          checkmate::assert_subset(names(state), c(names(self$get_filter_states())))
    @@ -58610,35 +60374,40 @@

    teal.slice coverage - 57.02%

    181 - 9x + 9x +
          logger::log_trace(
    182 - 9x + 9x +
            sprintf(
    183 - 9x + 9x +
              "MAEFilteredDataset$set_filter_state setting up filters of variable %s, dataname: %s",
    184 - 9x + 9x +
              paste(names(state), collapse = ", "),
    185 - 9x + 9x +
              self$get_dataname()
    @@ -58659,42 +60428,48 @@

    teal.slice coverage - 57.02%

    188 - 9x + 9x +
          data <- self$get_dataset()
    189 - 9x + 9x +
          for (fs_name in names(state)) {
    190 - 17x + 17x +
            fs <- self$get_filter_states()[[fs_name]]
    191 - 17x + 17x +
            fs$set_filter_state(
    192 - 17x + 17x +
              state = state[[fs_name]],
    193 - 17x + 17x +
              data = `if`(fs_name == "subjects", data, data[[fs_name]])
    @@ -58722,35 +60497,40 @@

    teal.slice coverage - 57.02%

    197 - 8x + 8x +
          logger::log_trace(
    198 - 8x + 8x +
            sprintf(
    199 - 8x + 8x +
              "MAEFilteredDataset$set_filter_state done setting filters of variable %s, dataname: %s",
    200 - 8x + 8x +
              paste(names(state), collapse = ", "),
    201 - 8x + 8x +
              self$get_dataname()
    @@ -58771,7 +60551,8 @@

    teal.slice coverage - 57.02%

    204 - 8x + 8x +
          NULL
    @@ -58848,14 +60629,16 @@

    teal.slice coverage - 57.02%

    215 - 2x + 2x +
          checkmate::assert_list(state_id, names = "unique")
    216 - 1x + 1x +
          checkmate::assert_subset(names(state_id), c(names(self$get_filter_states())))
    @@ -58869,35 +60652,40 @@

    teal.slice coverage - 57.02%

    218 - 1x + 1x +
          logger::log_trace(
    219 - 1x + 1x +
            sprintf(
    220 - 1x + 1x +
              "MAEFilteredDataset$remove_filter_state removing filters of variable %s, dataname: %s",
    221 - 1x + 1x +
              state_id,
    222 - 1x + 1x +
              self$get_dataname()
    @@ -58925,28 +60713,32 @@

    teal.slice coverage - 57.02%

    226 - 1x + 1x +
          for (fs_name in names(state_id)) {
    227 - 1x + 1x +
            fdata_filter_state <- self$get_filter_states()[[fs_name]]
    228 - 1x + 1x +
            fdata_filter_state$remove_filter_state(
    229 - 1x + 1x +
              `if`(fs_name == "subjects", state_id[[fs_name]][[1]], state_id[[fs_name]])
    @@ -58967,35 +60759,40 @@

    teal.slice coverage - 57.02%

    232 - 1x + 1x +
          logger::log_trace(
    233 - 1x + 1x +
            sprintf(
    234 - 1x + 1x +
              "MAEFilteredDataset$remove_filter_state done removing filters of variable %s, dataname: %s",
    235 - 1x + 1x +
              state_id,
    236 - 1x + 1x +
              self$get_dataname()
    @@ -59016,7 +60813,8 @@

    teal.slice coverage - 57.02%

    239 - 1x + 1x +
          invisible(NULL)
    @@ -59695,21 +61493,24 @@

    teal.slice coverage - 57.02%

    336 - 10x + 10x +
          data_f <- filtered_dataset
    337 - 10x + 10x +
          data_nf <- self$get_dataset()
    338 - 10x + 10x +
          experiment_names <- names(data_nf)
    @@ -59723,21 +61524,24 @@

    teal.slice coverage - 57.02%

    340 - 10x + 10x +
          data_f_subjects_info <- nrow(SummarizedExperiment::colData(data_f))
    341 - 10x + 10x +
          data_nf_subjects_info <- nrow(SummarizedExperiment::colData(data_nf))
    342 - 10x + 10x +
          mae_total_subjects_info <- paste0(data_f_subjects_info, "/", data_nf_subjects_info)
    @@ -59751,21 +61555,24 @@

    teal.slice coverage - 57.02%

    344 - 10x + 10x +
          get_experiment_rows <- function(mae, experiment) {
    345 - 100x + 100x +
            sample_subset <- subset(MultiAssayExperiment::sampleMap(mae), colname %in% colnames(experiment))
    346 - 100x + 100x +
            length(unique(sample_subset$primary))
    @@ -59786,35 +61593,40 @@

    teal.slice coverage - 57.02%

    349 - 10x + 10x +
          subjects_info <- lapply(
    350 - 10x + 10x +
            experiment_names,
    351 - 10x + 10x +
            function(experiment_name) {
    352 - 50x + 50x +
              subjects_f_rows <- get_experiment_rows(data_f, data_f[[experiment_name]])
    353 - 50x + 50x +
              subjects_nf_rows <- get_experiment_rows(data_nf, data_nf[[experiment_name]])
    @@ -59828,14 +61640,16 @@

    teal.slice coverage - 57.02%

    355 - 50x + 50x +
              subjects_info <- paste0(subjects_f_rows, "/", subjects_nf_rows)
    356 - 50x + 50x +
              subjects_info
    @@ -59863,21 +61677,24 @@

    teal.slice coverage - 57.02%

    360 - 10x + 10x +
          append(
    361 - 10x + 10x +
            list(mae_total_subjects_info),
    362 - 10x + 10x +
            subjects_info
    @@ -59954,28 +61771,32 @@

    teal.slice coverage - 57.02%

    373 - 6x + 6x +
          data_f <- filtered_dataset
    374 - 6x + 6x +
          data_nf <- self$get_dataset()
    375 - 6x + 6x +
          experiment_names <- names(data_nf)
    376 - 6x + 6x +
          mae_total_data_info <- ""
    @@ -59989,35 +61810,40 @@

    teal.slice coverage - 57.02%

    378 - 6x + 6x +
          data_info <- lapply(
    379 - 6x + 6x +
            experiment_names,
    380 - 6x + 6x +
            function(experiment_name) {
    381 - 30x + 30x +
              data_f_rows <- ncol(data_f[[experiment_name]])
    382 - 30x + 30x +
              data_nf_rows <- ncol(data_nf[[experiment_name]])
    @@ -60031,14 +61857,16 @@

    teal.slice coverage - 57.02%

    384 - 30x + 30x +
              data_info <- paste0(data_f_rows, "/", data_nf_rows)
    385 - 30x + 30x +
              data_info
    @@ -60066,21 +61894,24 @@

    teal.slice coverage - 57.02%

    389 - 6x + 6x +
          append(
    390 - 6x + 6x +
            list(mae_total_data_info),
    391 - 6x + 6x +
            data_info
    @@ -60464,21 +62295,24 @@

    teal.slice coverage - 57.02%

    50 - 6x + 6x +
          super$initialize(x, varname, varlabel, dataname, extract_type)
    51 - 6x + 6x +
          private$set_choices(list())
    52 - 6x + 6x +
          self$set_selected(list())
    @@ -60492,7 +62326,8 @@

    teal.slice coverage - 57.02%

    54 - 6x + 6x +
          return(invisible(self))
    @@ -60555,7 +62390,8 @@

    teal.slice coverage - 57.02%

    63 - 2x + 2x +
          !isTRUE(self$get_keep_na())
    @@ -60639,14 +62475,16 @@

    teal.slice coverage - 57.02%

    75 - 2x + 2x +
          filter_call <- if (isTRUE(self$get_keep_na())) {
    76 - 1x + 1x +
            call("is.na", private$get_varname_prefixed())
    @@ -60660,7 +62498,8 @@

    teal.slice coverage - 57.02%

    78 - 1x + 1x +
            FALSE
    @@ -60737,14 +62576,16 @@

    teal.slice coverage - 57.02%

    89 - 1x + 1x +
          list(
    90 - 1x + 1x +
            keep_na = self$get_keep_na()
    @@ -60849,42 +62690,48 @@

    teal.slice coverage - 57.02%

    105 - 4x + 4x +
          if (!is.null(state$selected)) {
    106 - 1x + 1x +
            stop(
    107 - 1x + 1x +
              sprintf(
    108 - 1x + 1x +
                "All values in variable '%s' are `NA`. Unable to apply filter values \n  %s",
    109 - 1x + 1x +
                private$varname,
    110 - 1x + 1x +
                paste(state$selected, collapse = ", ")
    @@ -60912,21 +62759,24 @@

    teal.slice coverage - 57.02%

    114 - 3x + 3x +
          stopifnot(is.list(state) && all(names(state) == "keep_na"))
    115 - 2x + 2x +
          if (!is.null(state$keep_na)) {
    116 - 2x + 2x +
            self$set_keep_na(state$keep_na)
    @@ -60940,7 +62790,8 @@

    teal.slice coverage - 57.02%

    118 - 2x + 2x +
          invisible(NULL)
    @@ -62031,14 +63882,16 @@

    teal.slice coverage - 57.02%

    112 - 20x + 20x +
          stopifnot(is(x, "Date"))
    113 - 20x + 20x +
          super$initialize(x, varname, varlabel, dataname, extract_type)
    @@ -62052,21 +63905,24 @@

    teal.slice coverage - 57.02%

    115 - 20x + 20x +
          var_range <- range(x, na.rm = TRUE)
    116 - 20x + 20x +
          private$set_choices(var_range)
    117 - 20x + 20x +
          self$set_selected(var_range)
    @@ -62080,7 +63936,8 @@

    teal.slice coverage - 57.02%

    119 - 20x + 20x +
          return(invisible(self))
    @@ -62157,7 +64014,8 @@

    teal.slice coverage - 57.02%

    130 - 6x + 6x +
          checkmate::assert_number(indent, finite = TRUE, lower = 0)
    @@ -62171,56 +64029,64 @@

    teal.slice coverage - 57.02%

    132 - 5x + 5x +
          vals <- self$get_selected()
    133 - 5x + 5x +
          sprintf(
    134 - 5x + 5x +
            "%sFiltering on: %s\n%1$s  Selected range: %s - %s\n%1$s  Include missing values: %s",
    135 - 5x + 5x +
            format("", width = indent),
    136 - 5x + 5x +
            private$varname,
    137 - 5x + 5x +
            format(vals[1], nsmall = 3),
    138 - 5x + 5x +
            format(vals[2], nsmall = 3),
    139 - 5x + 5x +
            format(self$get_keep_na())
    @@ -62276,28 +64142,32 @@

    teal.slice coverage - 57.02%

    147 - 8x + 8x +
          if (!setequal(self$get_selected(), private$choices)) {
    148 - 6x + 6x +
            TRUE
    149 - 2x + 2x +
          } else if (!isTRUE(self$get_keep_na()) && private$na_count > 0) {
    150 - 1x + 1x +
            TRUE
    @@ -62311,7 +64181,8 @@

    teal.slice coverage - 57.02%

    152 - 1x + 1x +
            FALSE
    @@ -62388,21 +64259,24 @@

    teal.slice coverage - 57.02%

    163 - 9x + 9x +
          choices <- as.character(self$get_selected())
    164 - 9x + 9x +
          filter_call <-
    165 - 9x + 9x +
            call(
    @@ -62416,14 +64290,16 @@

    teal.slice coverage - 57.02%

    167 - 9x + 9x +
              call(">=", private$get_varname_prefixed(), call("as.Date", choices[1L])),
    168 - 9x + 9x +
              call("<=", private$get_varname_prefixed(), call("as.Date", choices[2L]))
    @@ -62437,7 +64313,8 @@

    teal.slice coverage - 57.02%

    170 - 9x + 9x +
          private$add_keep_na_call(filter_call)
    @@ -62591,7 +64468,8 @@

    teal.slice coverage - 57.02%

    192 - 42x + 42x +
          super$set_selected(value)
    @@ -62647,7 +64525,8 @@

    teal.slice coverage - 57.02%

    200 - 41x + 41x +
          if (!is(value, "Date")) {
    @@ -62710,28 +64589,32 @@

    teal.slice coverage - 57.02%

    209 - 41x + 41x +
          pre_msg <- sprintf(
    210 - 41x + 41x +
            "dataset '%s', variable '%s': ",
    211 - 41x + 41x +
            self$get_dataname(),
    212 - 41x + 41x +
            self$get_varname()
    @@ -62745,7 +64628,8 @@

    teal.slice coverage - 57.02%

    214 - 41x + 41x +
          check_in_range(value, private$choices, pre_msg = pre_msg)
    @@ -62766,21 +64650,24 @@

    teal.slice coverage - 57.02%

    217 - 42x + 42x +
          tryCatch(
    218 - 42x + 42x +
            expr = {
    219 - 42x + 42x +
              values <- as.Date(values)
    @@ -62801,7 +64688,8 @@

    teal.slice coverage - 57.02%

    222 - 42x + 42x +
            error = function(error) stop("The array of set values must contain values coercible to Date.")
    @@ -62822,7 +64710,8 @@

    teal.slice coverage - 57.02%

    225 - 41x + 41x +
          values
    @@ -62843,28 +64732,32 @@

    teal.slice coverage - 57.02%

    228 - 41x + 41x +
          if (values[1] < private$choices[1]) {
    229 - 4x + 4x +
            warning(paste(
    230 - 4x + 4x +
              "Value:", values[1], "is outside of the possible range for column", private$varname,
    231 - 4x + 4x +
              "of dataset", private$dataname, "."
    @@ -62878,7 +64771,8 @@

    teal.slice coverage - 57.02%

    233 - 4x + 4x +
            values[1] <- private$choices[1]
    @@ -62899,28 +64793,32 @@

    teal.slice coverage - 57.02%

    236 - 41x + 41x +
          if (values[2] > private$choices[2]) {
    237 - 4x + 4x +
            warning(paste(
    238 - 4x + 4x +
              "Value:", values[2], "is outside of the possible range for column", private$varname,
    239 - 4x + 4x +
              "of dataset", private$dataname, "."
    @@ -62934,7 +64832,8 @@

    teal.slice coverage - 57.02%

    241 - 4x + 4x +
            values[2] <- private$choices[2]
    @@ -62948,7 +64847,8 @@

    teal.slice coverage - 57.02%

    243 - 41x + 41x +
          values
    @@ -64039,49 +65939,56 @@

    teal.slice coverage - 57.02%

    24 - 37x + 37x +
      if (!missing(...)) {
    25 - 24x + 24x +
        checkmate::assert_flag(stop)
    26 - 24x + 24x +
        checkmate::assert_character(allowed_args, min.len = 0, null.ok = TRUE, any.missing = FALSE)
    27 - 24x + 24x +
        args <- list(...)
    28 - 24x + 24x +
        arg_names <- names(args)
    29 - 24x + 24x +
        if (is.null(arg_names)) {
    30 - 4x + 4x +
          arg_names <- rep("", length(args))
    @@ -64095,21 +66002,24 @@

    teal.slice coverage - 57.02%

    32 - 24x + 24x +
        extra_args <- arg_names[!is.element(arg_names, allowed_args)]
    33 - 24x + 24x +
        if (length(extra_args) == 0) {
    34 - 12x + 12x +
          return(invisible(NULL))
    @@ -64123,7 +66033,8 @@

    teal.slice coverage - 57.02%

    36 - 12x + 12x +
        message <- paste(length(extra_args), "total unused argument(s).")
    @@ -64137,28 +66048,32 @@

    teal.slice coverage - 57.02%

    38 - 12x + 12x +
        named_extra_args <- extra_args[!vapply(extra_args, identical, logical(1), "")]
    39 - 12x + 12x +
        if (length(named_extra_args) > 0) {
    40 - 9x + 9x +
          message <- paste0(
    41 - 9x + 9x +
            message,
    @@ -64172,21 +66087,24 @@

    teal.slice coverage - 57.02%

    43 - 9x + 9x +
            length(named_extra_args),
    44 - 9x + 9x +
            " with name(s): ",
    45 - 9x + 9x +
            paste(named_extra_args, collapse = ", "),
    @@ -64214,14 +66132,16 @@

    teal.slice coverage - 57.02%

    49 - 12x + 12x +
        if (stop) {
    50 - 8x + 8x +
          stop(message)
    @@ -64235,7 +66155,8 @@

    teal.slice coverage - 57.02%

    52 - 4x + 4x +
          warning(message)
    @@ -64452,49 +66373,56 @@

    teal.slice coverage - 57.02%

    83 - 448x + 448x +
      checkmate::assert_character(name, min.len = 1, any.missing = FALSE)
    84 - 448x + 448x +
      if (!grepl("^[[:alpha:]][a-zA-Z0-9_]*$", name, perl = TRUE)) {
    85 - 5x + 5x +
        stop(
    86 - 5x + 5x +
          "name '",
    87 - 5x + 5x +
          name,
    88 - 5x + 5x +
          "' must only contain alphanumeric characters (with underscores)",
    89 - 5x + 5x +
          " and the first character must be an alphabetic character"
    @@ -64550,28 +66478,32 @@

    teal.slice coverage - 57.02%

    97 - 2x + 2x +
      bs_theme <- getOption("teal.bs_theme")
    98 - 2x + 2x +
      if (is.null(bs_theme)) {
    99 - 1x + 1x +
        NULL
    100 - 1x + 1x +
      } else if (!inherits(bs_theme, "bs_theme")) {
    @@ -64599,7 +66531,8 @@

    teal.slice coverage - 57.02%

    104 - 1x + 1x +
        bs_theme
    @@ -64857,7 +66790,8 @@

    teal.slice coverage - 57.02%

    34 - 9x + 9x +
      UseMethod("variable_types")
    @@ -64892,7 +66826,8 @@

    teal.slice coverage - 57.02%

    39 - 9x + 9x +
      checkmate::assert_character(columns, null.ok = TRUE, any.missing = FALSE)
    @@ -64906,7 +66841,8 @@

    teal.slice coverage - 57.02%

    41 - 9x + 9x +
      res <- if (is.null(columns)) {
    @@ -64955,49 +66891,56 @@

    teal.slice coverage - 57.02%

    48 - 9x + 9x +
      } else if (checkmate::test_character(columns, any.missing = FALSE)) {
    49 - 9x + 9x +
        stopifnot(all(columns %in% names(data) | vapply(columns, identical, logical(1L), "")))
    50 - 9x + 9x +
        vapply(
    51 - 9x + 9x +
          columns,
    52 - 9x + 9x +
          function(x) ifelse(x == "", "", class(data[[x]])[[1]]),
    53 - 9x + 9x +
          character(1),
    54 - 9x + 9x +
          USE.NAMES = FALSE
    @@ -65039,7 +66982,8 @@

    teal.slice coverage - 57.02%

    60 - 9x + 9x +
      return(res)
    @@ -65074,7 +67018,8 @@

    teal.slice coverage - 57.02%

    65 - 8x + 8x +
      variable_types.default(data, columns)
    @@ -65640,7 +67585,8 @@

    teal.slice coverage - 57.02%

    39 - 165x + 165x +
      UseMethod("resolve_state")
    @@ -65689,21 +67635,24 @@

    teal.slice coverage - 57.02%

    46 - 86x + 86x +
      state <- list()
    47 - 86x + 86x +
      if (length(x[!(is.infinite(x) | is.na(x))]) > 0) {
    48 - 86x + 86x +
        state$selected <- x[!(is.infinite(x) | is.na(x))]
    @@ -65724,14 +67673,16 @@

    teal.slice coverage - 57.02%

    51 - 86x + 86x +
      if (any(is.na(x))) {
    52 - 1x + 1x +
        state$keep_na <- TRUE
    @@ -65752,14 +67703,16 @@

    teal.slice coverage - 57.02%

    55 - 86x + 86x +
      if (any(is.infinite(x))) {
    56 - 1x + 1x +
        state$keep_inf <- TRUE
    @@ -65780,7 +67733,8 @@

    teal.slice coverage - 57.02%

    59 - 86x + 86x +
      state
    @@ -65829,7 +67783,8 @@

    teal.slice coverage - 57.02%

    66 - 1x + 1x +
      list()
    @@ -65878,14 +67833,16 @@

    teal.slice coverage - 57.02%

    73 - 78x + 78x +
      if (identical(x, list())) {
    74 - 6x + 6x +
        return(x)
    @@ -65899,14 +67856,16 @@

    teal.slice coverage - 57.02%

    76 - 72x + 72x +
      if (is.null(names(x))) {
    77 - 10x + 10x +
        names(x) <- rep("", length(x))
    @@ -65920,42 +67879,48 @@

    teal.slice coverage - 57.02%

    79 - 72x + 72x +
      x_names <- names(x)
    80 - 72x + 72x +
      if (sum(x_names == "") > 1) {
    81 - 1x + 1x +
        stop("More than one element of filter state is unnamed.")
    82 - 71x + 71x +
      } else if (sum(x_names == "") == 1) {
    83 - 11x + 11x +
        if ("selected" %in% x_names) {
    84 - 1x + 1x +
          stop("Unnamed element of filter state cannot be intepreted as 'selected' because it already exists.")
    @@ -65969,14 +67934,16 @@

    teal.slice coverage - 57.02%

    86 - 10x + 10x +
          x_idx <- which(x_names == "")
    87 - 10x + 10x +
          names(x)[[x_idx]] <- "selected"
    @@ -65997,7 +67964,8 @@

    teal.slice coverage - 57.02%

    90 - 70x + 70x +
      x
    @@ -66310,21 +68278,24 @@

    teal.slice coverage - 57.02%

    25 - 174x + 174x +
      checkmate::assert_list(calls)
    26 - 53x + 53x +
      if (length(calls) > 0L) checkmate::assert_list(calls, types = c("call", "name"))
    27 - 173x + 173x +
      checkmate::assert_string(operator)
    @@ -66338,21 +68309,24 @@

    teal.slice coverage - 57.02%

    29 - 171x + 171x +
      Reduce(
    30 - 171x + 171x +
        x = calls,
    31 - 171x + 171x +
        f = function(x, y) call(operator, x, y)
    diff --git a/v0.3.0/index.html b/v0.3.0/index.html index 20d32662b..909e9f769 100644 --- a/v0.3.0/index.html +++ b/v0.3.0/index.html @@ -1,5 +1,4 @@ - - + @@ -51,22 +50,7 @@ - - + - + + diff --git a/v0.3.0/news/index.html b/v0.3.0/news/index.html index 6116e9190..13b336e5d 100644 --- a/v0.3.0/news/index.html +++ b/v0.3.0/news/index.html @@ -1,8 +1,22 @@ - -Changelog • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -77,37 +97,55 @@
    -

    teal.slice 0.3.0

    -
    • Examples now use scda.2022 instead of scda.2021.
    • +

      teal.slice 0.3.0 +

      +
        +
      • Examples now use scda.2022 instead of scda.2021.
      • Transferred data hashing step in FilteredDataset to teal.
      • Removed constructor of Queue class.
      • -
      -

      New features

      -
      • Added a global turn on/off button for the Filter Panel.
      • +
      +
      +

      New features +

      +
        +
      • Added a global turn on/off button for the Filter Panel.
      • Added ability to collapse Active Filter Display panel.
      • Added ability to collapse all filters of an individual dataset.
      • -
      +
    +
    -

    Enhancements

    -
    • Improved filter state presentation in FilterState$format.
    • -
    +

    Enhancements +

    +
      +
    • Improved filter state presentation in FilterState$format.
    • +
    +
    -

    Bug fixes

    -
    • Fixed an error where the RangeFilterState produced an error when using bootstrap 4.
    • +

      Bug fixes +

      +
        +
      • Fixed an error where the RangeFilterState produced an error when using bootstrap 4.
      • Fixed a bug that caused the range slider to omit values selected programmatically through the filter API.
      • -
    + +
    -

    Miscellaneous

    -
    • Calculation of step in slider for RangeFilterState now uses checkmate::test_integerish instead of is.integer.
    • +

      Miscellaneous +

      +
        +
      • Calculation of step in slider for RangeFilterState now uses checkmate::test_integerish instead of is.integer.
      • Updated init_filtered_data to take into account the removal of CDISCTealData from teal.data package.
      • Added examples apps for ChoicesFilterState and DFFilterStates.
      • -
    + +
    -

    teal.slice 0.2.0

    +

    teal.slice 0.2.0 +

    -

    New features

    -
    + +
    -

    Enhancements

    -
    • Redesigned the count bars for filter panel check box inputs.
    • +

      Enhancements +

      +
        +
      • Redesigned the count bars for filter panel check box inputs.
      • Redesigned the filter panel input for dates to use CSS flexbox.
      • Update icons to be compatible with Font Awesome 6.
      • Updates the FilteredData method get_formatted_filter_state so it no longer appends empty filters.
      • Added clearer installation instructions to README.
      • -
    + +
    -

    Breaking changes

    -
    • Renamed internal S3 method get_filterable_varnames to get_supported_filter_varnames.
    • -
    +

    Breaking changes +

    +
      +
    • Renamed internal S3 method get_filterable_varnames to get_supported_filter_varnames.
    • +
    +
    -

    Bug fixes

    -
    • Fixed a bug when the filter panel overview would not refresh if the panel was hidden during a transition between active modules.
    • +

      Bug fixes +

      +
        +
      • Fixed a bug when the filter panel overview would not refresh if the panel was hidden during a transition between active modules.
      • Fixed a bug in FilterState where sliderInput step values were too precise.
      • -
    + +
    -

    teal.slice 0.1.1

    +

    teal.slice 0.1.1 +

    -

    New features

    -
    • Added a formatting function for filter panel classes.
    • -
    +

    New features +

    +
      +
    • Added a formatting function for filter panel classes.
    • +
    +
    -

    Miscellaneous

    -
    • Added a template to the pkgdown site.
    • +

      Miscellaneous +

      +
        +
      • Added a template to the pkgdown site.
      • Updated package authors.
      • Added package vignettes.
      • -
    + +
    -

    Fix

    -
    • Fixed a bug in FilteredDataset, where launching a shiny application without FilteredData would not attach the appropriate CSS files.
    • -
    +

    Fix +

    +
      +
    • Fixed a bug in FilteredDataset, where launching a shiny application without FilteredData would not attach the appropriate CSS files.
    • +
    +
    -

    teal.slice 0.1.0

    -
    • Initial release of teal.slice - a package providing a filter module for teal applications.
    • -
    -

    Changes (from behavior when functionality was part of teal)

    +

    teal.slice 0.1.0 +

    +
      +
    • Initial release of teal.slice - a package providing a filter module for teal applications.
    • +
    +
    +

    Changes (from behavior when functionality was part of teal) +

    -

    Breaking changes

    -
    • +

      Breaking changes +

      +
        +
      • default_filter has been deprecated - use list() instead for a default filter.
      • -
    + +
    -

    Bug fixes

    -
    • Add counts to filtering categorical variables bar charts in the filtering panel in cases where they were missing.
    • +

      Bug fixes +

      +
        +
      • Add counts to filtering categorical variables bar charts in the filtering panel in cases where they were missing.
      • Fixed a bug causing an error when both sliders of RangeFilterState where put to either end of the allowed range in the UI.
      • -
    + +
    -

    Miscellaneous

    -
    • Added is_any_filtered method to all FilterState classes to detect if selected values actually filters out any data. This is used to decide if an explicit filter statement is added to the call.
    • +

      Miscellaneous +

      +
        +
      • Added is_any_filtered method to all FilterState classes to detect if selected values actually filters out any data. This is used to decide if an explicit filter statement is added to the call.
      • The filter panel now displays a helpful message when data has no rows or columns in place of an empty drop down widget.
      • FilteredData now stores whether its datasets had a reproducibility check or not via two new methods to its class: set_check and get_check.
      • -
    + +
    + + + + - - + + diff --git a/v0.3.0/pull_request_template.html b/v0.3.0/pull_request_template.html index ed52df7cc..f007efd59 100644 --- a/v0.3.0/pull_request_template.html +++ b/v0.3.0/pull_request_template.html @@ -1,8 +1,22 @@ - -Pull Request • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -82,17 +102,19 @@

    Fixes #nnn

    - + + + + - - + + diff --git a/v0.3.0/reference/CDISCFilteredData.html b/v0.3.0/reference/CDISCFilteredData.html index 93d5c6f34..e884a69a4 100644 --- a/v0.3.0/reference/CDISCFilteredData.html +++ b/v0.3.0/reference/CDISCFilteredData.html @@ -1,8 +1,24 @@ - -Class to encapsulate relational filtered datasets with its parents. — CDISCFilteredData • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -83,7 +105,8 @@
    -

    Details

    +

    Details +

    The CDISCFilteredData class implements logic to filter a relational dataset by inheriting from FilteredData. A dataset can have up to one parent dataset. Rows are identified by the foreign @@ -93,20 +116,25 @@

    Detailsiris).

    -

    See also

    +

    See also +

    FilteredData class

    -

    Super class

    +

    Super class +

    teal.slice::FilteredData -> CDISCFilteredData

    +

    Inherited methods


    -

    Method datanames()

    +

    +
    +
    +

    Method datanames() +

    Get datanames

    The datanames are returned in the order in which they must be -evaluated (in case of dependencies).

    -

    Usage

    -

    CDISCFilteredData$datanames()

    +evaluated (in case of dependencies).

    +
    +

    Usage +

    +

    +
    +
    CDISCFilteredData$datanames()
    +

    +
    -

    Returns

    +

    Returns +

    (character vector) of datanames

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Produces language required to filter a single dataset and merge it with its parent. -The datasets in question are assumed to be available.

    -

    Usage

    -

    CDISCFilteredData$get_call(dataname)

    +The datasets in question are assumed to be available.

    +
    +

    Usage +

    +

    +
    +
    CDISCFilteredData$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (call or list of calls ) to filter dataset

    -


    -

    Method get_filterable_datanames()

    -

    Get names of datasets available for filtering

    -

    Usage

    -

    CDISCFilteredData$get_filterable_datanames(dataname)

    +
    +

    +
    +
    +

    Method get_filterable_datanames() +

    +

    Get names of datasets available for filtering

    +
    +

    Usage +

    +

    +
    +
    CDISCFilteredData$get_filterable_datanames(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character vector) names of the dataset

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (character vector) of dataset names

    -


    -

    Method get_filterable_varnames()

    -

    Gets variable names of a given dataname for the filtering. This excludes parent dataset variable names.

    -

    Usage

    -

    CDISCFilteredData$get_filterable_varnames(dataname)

    +
    +

    +
    +
    +

    Method get_filterable_varnames() +

    +

    Gets variable names of a given dataname for the filtering. This excludes parent dataset variable names.

    +
    +

    Usage +

    +

    +
    +
    CDISCFilteredData$get_filterable_varnames(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (character vector) of variable names

    -


    -

    Method get_filter_overview()

    +
    +

    +
    +
    +

    Method get_filter_overview() +

    Get filter overview table in form of X (filtered) / Y (non-filtered)

    -

    This is intended to be presented in the application.

    -

    Usage

    -

    CDISCFilteredData$get_filter_overview(datanames)

    +

    This is intended to be presented in the application.

    +
    +

    Usage +

    +

    +
    +
    CDISCFilteredData$get_filter_overview(datanames)
    +

    +
    -

    Arguments

    -

    datanames
    +

    Arguments +

    +

    +
    +
    +
    datanames

    (character vector) names of the dataset (or "all")

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (matrix) matrix of observations and subjects of all datasets

    -


    -

    Method get_parentname()

    -

    Get parent dataset name

    -

    Usage

    -

    CDISCFilteredData$get_parentname(dataname)

    +
    +

    +
    +
    +

    Method get_parentname() +

    +

    Get parent dataset name

    +
    +

    Usage +

    +

    +
    +
    CDISCFilteredData$get_parentname(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (character) name of parent dataset

    -


    -

    Method set_dataset()

    +
    +

    +
    +
    +

    Method set_dataset() +

    Add dataset

    Add dataset and preserve all attributes attached to this object. Technically set_dataset created FilteredDataset which keeps -dataset for filtering purpose.

    -

    Usage

    -

    CDISCFilteredData$set_dataset(dataset_args, dataname)

    +dataset for filtering purpose.

    +
    +

    Usage +

    +

    +
    +
    CDISCFilteredData$set_dataset(dataset_args, dataname)
    +

    +
    -

    Arguments

    -

    dataset_args
    +

    Arguments +

    +

    +
    +
    +
    dataset_args

    (list)
    containing the arguments except (dataname) needed by init_filtered_dataset (can also @@ -284,27 +424,46 @@

    Arguments -

    Returns

    +

    Returns +

    (self) object of this class

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    CDISCFilteredData$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    CDISCFilteredData$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -312,7 +471,8 @@

    Arguments -

    Examples

    +

    Examples +

    library(scda)
     #> 
     library(teal.data)
    @@ -389,17 +549,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.3.0/reference/ChoicesFilterState.html b/v0.3.0/reference/ChoicesFilterState.html index 6c485b69f..6e515bfda 100644 --- a/v0.3.0/reference/ChoicesFilterState.html +++ b/v0.3.0/reference/ChoicesFilterState.html @@ -1,8 +1,24 @@ - -FilterState object for factor or character variable — ChoicesFilterState • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,27 +106,35 @@
    -

    Note

    +

    Note +

    Casts the passed object to character before validating the input making it possible to pass any object coercible to character to this method.

    -

    Super class

    +

    Super class +

    teal.slice::FilterState -> ChoicesFilterState

    +

    Inherited methods


    -

    Method new()

    -

    Initialize a FilterState object

    -

    Usage

    -

    ChoicesFilterState$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterState object

    +
    +

    Usage +

    +

    +
    +
    ChoicesFilterState$new(
       x,
       varname,
       varlabel = character(0),
       dataname = NULL,
       extract_type = character(0)
    -)

    +)
    +

    +
    -

    Arguments

    -

    x
    +

    Arguments +

    +

    + +
    +

    +
    -


    -

    Method is_any_filtered()

    -

    Answers the question of whether the current settings and values selected actually filters out any values.

    -

    Usage

    -

    ChoicesFilterState$is_any_filtered()

    +
    +

    +
    +
    +

    Method is_any_filtered() +

    +

    Answers the question of whether the current settings and values selected actually filters out any values.

    +
    +

    Usage +

    +

    +
    +
    ChoicesFilterState$is_any_filtered()
    +

    +
    -

    Returns

    +

    Returns +

    logical scalar

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection. For this class returned call looks like <varname> %in% c(<values selected>) with -optional is.na(<varname>).

    -

    Usage

    -

    ChoicesFilterState$get_call()

    +optional is.na(<varname>).

    +
    +

    Usage +

    +

    +
    +
    ChoicesFilterState$get_call()
    +

    +
    -

    Returns

    +

    Returns +

    (call)

    -


    -

    Method set_state()

    -

    Set state

    -

    Usage

    -

    ChoicesFilterState$set_state(state)

    +
    +

    +
    +
    +

    Method set_state() +

    +

    Set state

    +
    +

    Usage +

    +

    +
    +
    ChoicesFilterState$set_state(state)
    +

    +
    -

    Arguments

    -

    state
    -

    (list)
    -contains fields relevant for a specific class

    • selected defines initial selection

    • +

      Arguments +

      +

      +
      +
      +
      state
      +
      +

      (list)
      +contains fields relevant for a specific class

      +
        +
      • selected defines initial selection

      • keep_na (logical) defines whether to keep or remove NA values

      • -
      +
    +
    -

    + +

    +
    -


    -

    Method set_selected()

    -

    Sets the selected values of this ChoicesFilterState.

    -

    Usage

    -

    ChoicesFilterState$set_selected(value)

    +
    +

    +
    +
    +

    Method set_selected() +

    +

    Sets the selected values of this ChoicesFilterState.

    +
    +

    Usage +

    +

    +
    +
    ChoicesFilterState$set_selected(value)
    +

    +
    -

    Arguments

    -

    value
    +

    Arguments +

    +

    +
    +
    +
    value

    (character) the array of the selected choices. Must not contain NA values.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    invisibly NULL

    -

    Examples

    -

    filter <- teal.slice:::ChoicesFilterState$new(c("a", "b", "c"), varname = "name")
    -filter$set_selected(c("c", "a"))

    +

    Examples +

    +

    +
    +
    filter <- teal.slice:::ChoicesFilterState$new(c("a", "b", "c"), varname = "name")
    +filter$set_selected(c("c", "a"))
    +

    +
    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    ChoicesFilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    ChoicesFilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -256,7 +386,8 @@

    Arguments -

    Examples

    +

    Examples +

    filter_state <- teal.slice:::ChoicesFilterState$new(
       c(LETTERS, NA),
       varname = "x",
    @@ -341,17 +472,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.3.0/reference/DFFilterStates.html b/v0.3.0/reference/DFFilterStates.html index 90a6cede3..22efd8633 100644 --- a/v0.3.0/reference/DFFilterStates.html +++ b/v0.3.0/reference/DFFilterStates.html @@ -1,8 +1,24 @@ - -FilterStates subclass for data frames — DFFilterStates • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,16 +106,20 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterStates -> DFFilterStates

    +

    Inherited methods


    -

    Method new()

    +

    +
    +
    +

    Method new() +

    Initializes DFFilterStates object.

    Initializes DFFilterStates object by setting dataname and initializing state_list (shiny::reactiveVal). This class contains a single state_list with no specified name, which means that when calling the subset function associated with this class -(dplyr::filter), a list of conditions is passed to unnamed arguments (...).

    -

    Usage

    -

    DFFilterStates$new(dataname, datalabel, varlabels, keys)

    +(dplyr::filter), a list of conditions is passed to unnamed arguments (...).

    +
    +

    Usage +

    +

    +
    +
    DFFilterStates$new(dataname, datalabel, varlabels, keys)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1))
    name of the data used in the subset expression specified to the function argument attached to this FilterStates

    @@ -146,93 +189,165 @@

    Arguments
    -

    Method format()

    -

    Returns a formatted string representing this FilterStates object.

    -

    Usage

    -

    DFFilterStates$format(indent = 0)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns a formatted string representing this FilterStates object.

    +
    +

    Usage +

    +

    +
    +
    DFFilterStates$format(indent = 0)
    +

    +
    -

    Arguments

    -

    indent
    +

    Arguments +

    +

    +
    +
    +
    indent

    (numeric(1)) the number of spaces prepended to each line of the output

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    character(1) the formatted string

    -


    -

    Method get_fun()

    +
    +

    +
    +
    +

    Method get_fun() +

    Gets the name of the function used to filter the data in this FilterStates.

    Get name of function used to create the subset expression. -For DFFilterStates this is dplyr::filter.

    -

    Usage

    -

    DFFilterStates$get_fun()

    +For DFFilterStates this is dplyr::filter.

    +
    +

    Usage +

    +

    +
    +
    DFFilterStates$get_fun()
    +

    +
    -

    Returns

    +

    Returns +

    character(1)

    -


    -

    Method server()

    -

    Shiny server module.

    -

    Usage

    -

    DFFilterStates$server(id)

    +
    +

    +
    +
    +

    Method server() +

    +

    Shiny server module.

    +
    +

    Usage +

    +

    +
    +
    DFFilterStates$server(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    shiny module instance id

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    moduleServer function which returns NULL

    -


    +

    +
    +
    +

    Method get_filter_state() +

    Gets the reactive values from the active FilterState objects.

    Get active filter state from the FilterState objects kept in state_list. -The output list is a compatible input to self$set_filter_state.

    -

    Usage

    -

    DFFilterStates$get_filter_state()

    +The output list is a compatible input to self$set_filter_state.

    +
    +

    Usage +

    +

    +
    +
    DFFilterStates$get_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    list with named elements corresponding to FilterState in the state_list.

    -


    -

    Method set_filter_state()

    -

    Set filter state.

    -

    Usage

    -

    DFFilterStates$set_filter_state(
    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Set filter state.

    +
    +

    Usage +

    +

    +
    +
    DFFilterStates$set_filter_state(
       data,
       state,
       vars_include = get_supported_filter_varnames(data = data),
       ...
    -)

    +)
    +

    +
    -

    Arguments

    -

    data
    +

    Arguments +

    +

    +
    +
    +
    data

    (data.frame)
    data object for which to define a subset

    @@ -252,15 +367,21 @@

    Arguments -

    Returns

    +

    Returns +

    NULL

    -

    Examples

    -

    dffs <- teal.slice:::DFFilterStates$new(
    +

    Examples +

    +

    +
    +
    dffs <- teal.slice:::DFFilterStates$new(
       dataname = "iris",
       datalabel = character(0),
       varlabels = character(0),
    @@ -272,40 +393,73 @@ 

    Examples) shiny::isolate(dffs$set_filter_state(state = fs, data = iris)) shiny::isolate(dffs$get_filter_state()) -

    +
    +

    +
    -


    -

    Method remove_filter_state()

    -

    Remove a FilterState from the state_list.

    -

    Usage

    -

    DFFilterStates$remove_filter_state(state_id)

    +
    +

    +
    +
    +

    Method remove_filter_state() +

    +

    Remove a FilterState from the state_list.

    +
    +

    Usage +

    +

    +
    +
    DFFilterStates$remove_filter_state(state_id)
    +

    +
    -

    Arguments

    -

    state_id
    +

    Arguments +

    +

    +
    +
    +
    state_id

    (character(1))
    name of state_list element

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL

    -


    -

    Method ui_add_filter_state()

    -

    Shiny UI module to add filter variable.

    -

    Usage

    -

    DFFilterStates$ui_add_filter_state(id, data)

    +
    +

    +
    +
    +

    Method ui_add_filter_state() +

    +

    Shiny UI module to add filter variable.

    +
    +

    Usage +

    +

    +
    +
    DFFilterStates$ui_add_filter_state(id, data)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    shiny element (module instance) id

    @@ -315,31 +469,48 @@

    Arguments -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_add_filter_state()

    +
    +

    +
    +
    +

    Method srv_add_filter_state() +

    Shiny server module to add filter variable.

    This module controls available choices to select as a filter variable. Once selected, a variable is removed from available choices. -Removing a filter variable adds it back to available choices.

    -

    Usage

    -

    DFFilterStates$srv_add_filter_state(
    +Removing a filter variable adds it back to available choices.

    +
    +

    Usage +

    +

    +
    +
    DFFilterStates$srv_add_filter_state(
       id,
       data,
       vars_include = get_supported_filter_varnames(data = data),
       ...
    -)

    +)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    shiny module instance id

    @@ -358,27 +529,46 @@

    Arguments -

    Returns

    +

    Returns +

    moduleServer function which returns NULL

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    DFFilterStates$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    DFFilterStates$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -386,7 +576,8 @@

    Arguments -

    Examples

    +

    Examples +

    if (FALSE) {
     # working filters in an app
     
    @@ -539,17 +730,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.3.0/reference/DateFilterState.html b/v0.3.0/reference/DateFilterState.html index cd9710022..38e04f402 100644 --- a/v0.3.0/reference/DateFilterState.html +++ b/v0.3.0/reference/DateFilterState.html @@ -1,8 +1,24 @@ - -FilterState object for Date variable — DateFilterState • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,27 +106,35 @@
    -

    Note

    +

    Note +

    Casts the passed object to Date before validating the input making it possible to pass any object coercible to Date to this method.

    -

    Super class

    +

    Super class +

    teal.slice::FilterState -> DateFilterState

    +

    Inherited methods


    -

    Method new()

    -

    Initialize a FilterState object

    -

    Usage

    -

    DateFilterState$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterState object

    +
    +

    Usage +

    +

    +
    +
    DateFilterState$new(
       x,
       varname,
       varlabel = character(0),
       dataname = NULL,
       extract_type = character(0)
    -)

    +)
    +

    +
    -

    Arguments

    -

    -


    -

    Method format()

    -

    Returns a formatted string representing this DateFilterState.

    -

    Usage

    -

    DateFilterState$format(indent = 0)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns a formatted string representing this DateFilterState.

    +
    +

    Usage +

    +

    +
    +
    DateFilterState$format(indent = 0)
    +

    +
    -

    Arguments

    -

    indent
    +

    Arguments +

    +

    +
    +
    +
    indent

    (numeric(1)) the number of spaces before after each new line character of the formatted string. Default: 0

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    character(1) the formatted string

    -


    -

    Method is_any_filtered()

    -

    Answers the question of whether the current settings and values selected actually filters out any values.

    -

    Usage

    -

    DateFilterState$is_any_filtered()

    +
    +

    +
    +
    +

    Method is_any_filtered() +

    +

    Answers the question of whether the current settings and values selected actually filters out any values.

    +
    +

    Usage +

    +

    +
    +
    DateFilterState$is_any_filtered()
    +

    +
    -

    Returns

    +

    Returns +

    logical scalar

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection. For this class returned call looks like <varname> >= <min value> & <varname> <= <max value> with -optional is.na(<varname>).

    -

    Usage

    -

    DateFilterState$get_call()

    +optional is.na(<varname>).

    +
    +

    Usage +

    +

    +
    +
    DateFilterState$get_call()
    +

    +
    -

    Returns

    +

    Returns +

    (call)

    -


    -

    Method set_selected()

    -

    Sets the selected time frame of this DateFilterState.

    -

    Usage

    -

    DateFilterState$set_selected(value)

    +
    +

    +
    +
    +

    Method set_selected() +

    +

    Sets the selected time frame of this DateFilterState.

    +
    +

    Usage +

    +

    +
    +
    DateFilterState$set_selected(value)
    +

    +
    -

    Arguments

    -

    value
    +

    Arguments +

    +

    +
    +
    +
    value

    (Date(2)) the lower and the upper bound of the selected time frame. Must not contain NA values.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    invisibly NULL.

    -

    Examples

    -

    date <- as.Date("13/09/2021")
    +

    Examples +

    +

    +
    +
    date <- as.Date("13/09/2021")
     filter <- teal.slice:::DateFilterState$new(
       c(date, date + 1, date + 2, date + 3),
       varname = "name"
     )
    -filter$set_selected(c(date + 1, date + 2))

    +filter$set_selected(c(date + 1, date + 2))
    +

    +
    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    DateFilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    DateFilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -262,7 +389,8 @@

    Arguments -

    Examples

    +

    Examples +

    filter_state <- teal.slice:::DateFilterState$new(
       c(Sys.Date() + seq(1:10), NA),
       varname = "x",
    @@ -352,17 +480,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.3.0/reference/DatetimeFilterState.html b/v0.3.0/reference/DatetimeFilterState.html index 05ed9dfc7..3148a2a2f 100644 --- a/v0.3.0/reference/DatetimeFilterState.html +++ b/v0.3.0/reference/DatetimeFilterState.html @@ -1,8 +1,24 @@ - -FilterState object for POSIXct variable — DatetimeFilterState • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,27 +106,35 @@
    -

    Note

    +

    Note +

    Casts the passed object to POSIXct before validating the input making it possible to pass any object coercible to POSIXct to this method.

    -

    Super class

    +

    Super class +

    teal.slice::FilterState -> DatetimeFilterState

    +

    Inherited methods


    -

    Method new()

    +

    +
    +
    +

    Method new() +

    Initialize a FilterState object. This class has an extra field, private$timezone, which is set to Sys.timezone() by default. However, in case when using this module in teal app, one needs timezone of the app user. App user timezone is taken from session$userData$timezone -and is set only if object is initialized in shiny.

    -

    Usage

    -

    DatetimeFilterState$new(
    +and is set only if object is initialized in shiny.

    +
    +

    Usage +

    +

    +
    +
    DatetimeFilterState$new(
       x,
       varname,
       varlabel = character(0),
       dataname = NULL,
       extract_type = character(0)
    -)

    +)
    +

    +
    -

    Arguments

    -

    x
    +

    Arguments +

    +

    + +
    +

    +
    -


    -

    Method format()

    -

    Returns a formatted string representing this DatetimeFilterState.

    -

    Usage

    -

    DatetimeFilterState$format(indent = 0)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns a formatted string representing this DatetimeFilterState.

    +
    +

    Usage +

    +

    +
    +
    DatetimeFilterState$format(indent = 0)
    +

    +
    -

    Arguments

    -

    indent
    +

    Arguments +

    +

    +
    +
    +
    indent

    (numeric(1)) the number of spaces before after each new line character of the formatted string. Default: 0

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    character(1) the formatted string

    -


    -

    Method is_any_filtered()

    -

    Answers the question of whether the current settings and values selected actually filters out any values.

    -

    Usage

    -

    DatetimeFilterState$is_any_filtered()

    +
    +

    +
    +
    +

    Method is_any_filtered() +

    +

    Answers the question of whether the current settings and values selected actually filters out any values.

    +
    +

    Usage +

    +

    +
    +
    DatetimeFilterState$is_any_filtered()
    +

    +
    -

    Returns

    +

    Returns +

    logical scalar

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection. For this class returned call looks like <varname> >= as.POSIXct(<min>) & <varname> <= <max>) -with optional is.na(<varname>).

    -

    Usage

    -

    DatetimeFilterState$get_call()

    +with optional is.na(<varname>).

    +
    +

    Usage +

    +

    +
    +
    DatetimeFilterState$get_call()
    +

    +
    -


    -

    Method set_selected()

    -

    Sets the selected time frame of this DatetimeFilterState.

    -

    Usage

    -

    DatetimeFilterState$set_selected(value)

    +
    +

    +
    +
    +

    Method set_selected() +

    +

    Sets the selected time frame of this DatetimeFilterState.

    +
    +

    Usage +

    +

    +
    +
    DatetimeFilterState$set_selected(value)
    +

    +
    -

    Arguments

    -

    value
    +

    Arguments +

    +

    +
    +
    +
    value

    (POSIX(2)) the lower and the upper bound of the selected time frame. Must not contain NA values.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    invisibly NULL.

    -

    Examples

    -

    date <- as.POSIXct(1, origin = "01/01/1970")
    +

    Examples +

    +

    +
    +
    date <- as.POSIXct(1, origin = "01/01/1970")
     filter <- teal.slice:::DatetimeFilterState$new(
       c(date, date + 1, date + 2, date + 3),
       varname = "name"
     )
    -filter$set_selected(c(date + 1, date + 2))

    +filter$set_selected(c(date + 1, date + 2))
    +

    +
    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    DatetimeFilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    DatetimeFilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -262,7 +388,8 @@

    Arguments -

    Examples

    +

    Examples +

    filter_state <- teal.slice:::DatetimeFilterState$new(
       c(Sys.time() + seq(0, by = 3600, length.out = 10), NA),
       varname = "x",
    @@ -354,17 +481,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.3.0/reference/DefaultFilteredDataset.html b/v0.3.0/reference/DefaultFilteredDataset.html index 9dd4105d4..16f310a6a 100644 --- a/v0.3.0/reference/DefaultFilteredDataset.html +++ b/v0.3.0/reference/DefaultFilteredDataset.html @@ -1,10 +1,26 @@ - -The DefaultFilteredDataset R6 class — DefaultFilteredDataset • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + +
    @@ -86,16 +108,20 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilteredDataset -> DefaultFilteredDataset

    +

    Inherited methods


    -

    Method new()

    -

    Initializes this DefaultFilteredDataset object

    -

    Usage

    -

    DefaultFilteredDataset$new(
    +

    +
    +
    +

    Method new() +

    +

    Initializes this DefaultFilteredDataset object

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$new(
       dataset,
       dataname,
       keys = character(0),
       label = character(0),
       metadata = NULL
    -)

    +)
    +

    +
    -

    Arguments

    -

    dataset
    +

    Arguments +

    +

    +
    +
    +
    dataset

    (data.frame)
    single data.frame for which filters are rendered

    @@ -161,52 +203,90 @@

    Arguments
    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Gets the filter expression

    This functions returns filter calls equivalent to selected items within each of filter_states. Configuration of the calls is constant and depends on filter_states type and order which are set during initialization. This class contains single FilterStates which contains single state_list and all FilterState objects -applies to one argument (...) in dplyr::filter call.

    -

    Usage

    -

    DefaultFilteredDataset$get_call()

    +applies to one argument (...) in dplyr::filter call.

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$get_call()
    +

    +
    -

    Returns

    +

    Returns +

    filter call or list of filter calls

    -


    +

    +
    +
    +

    Method get_filter_state() +

    Gets the reactive values from the active FilterState objects.

    Get all active filters from this dataset in form of the nested list. -The output list is a compatible input to self$set_filter_state.

    -

    Usage

    -

    DefaultFilteredDataset$get_filter_state()

    +The output list is a compatible input to self$set_filter_state.

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$get_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    list with named elements corresponding to FilterState objects (active filters).

    -


    -

    Method set_filter_state()

    -

    Set filter state

    -

    Usage

    -

    DefaultFilteredDataset$set_filter_state(state, ...)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Set filter state

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$set_filter_state(state, ...)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (named list)
    containing values of the initial filter. Values should be relevant to the referred column.

    @@ -216,82 +296,138 @@

    Arguments -

    Returns

    +

    Returns +

    NULL

    -

    Examples

    -

    dataset <- teal.slice:::DefaultFilteredDataset$new(iris, "iris")
    +

    Examples +

    +

    +
    +
    dataset <- teal.slice:::DefaultFilteredDataset$new(iris, "iris")
     fs <- list(
       Sepal.Length = list(selected = c(5.1, 6.4), keep_na = TRUE, keep_inf = TRUE),
       Species = list(selected = c("setosa", "versicolor"), keep_na = FALSE)
     )
     shiny::isolate(dataset$set_filter_state(state = fs))
     shiny::isolate(dataset$get_filter_state())
    -

    +
    +

    +
    -


    -

    Method remove_filter_state()

    -

    Remove one or more FilterState of a FilteredDataset

    -

    Usage

    -

    DefaultFilteredDataset$remove_filter_state(state_id)

    +
    +

    +
    +
    +

    Method remove_filter_state() +

    +

    Remove one or more FilterState of a FilteredDataset

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$remove_filter_state(state_id)
    +

    +
    -

    Arguments

    -

    state_id
    +

    Arguments +

    +

    +
    +
    +
    state_id

    (character)
    Vector of character names of variables to remove their FilterState.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL

    -


    -

    Method ui_add_filter_state()

    +
    +

    +
    +
    +

    Method ui_add_filter_state() +

    +

    UI module to add filter variable for this dataset

    UI module to add filter variable for this dataset

    -

    UI module to add filter variable for this dataset

    -

    Usage

    -

    DefaultFilteredDataset$ui_add_filter_state(id)

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$ui_add_filter_state(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    identifier of the element - preferably containing dataset name

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    function - shiny UI module

    -


    -

    Method srv_add_filter_state()

    +
    +

    +
    +
    +

    Method srv_add_filter_state() +

    Server module to add filter variable for this dataset

    Server module to add filter variable for this dataset. For this class srv_add_filter_state calls single module srv_add_filter_state from FilterStates (DefaultFilteredDataset -contains single FilterStates)

    -

    Usage

    -

    DefaultFilteredDataset$srv_add_filter_state(id, ...)

    +contains single FilterStates)

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$srv_add_filter_state(id, ...)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    an ID string that corresponds with the ID used to call the module's UI function.

    @@ -300,28 +436,45 @@

    Arguments -

    Returns

    +

    Returns +

    moduleServer function which returns NULL

    -


    -

    Method get_filter_overview_nsubjs()

    +
    +

    +
    +
    +

    Method get_filter_overview_nsubjs() +

    Get number of observations based on given keys The output shows the comparison between filtered_dataset -function parameter and the dataset inside self

    -

    Usage

    -

    DefaultFilteredDataset$get_filter_overview_nsubjs(
    +function parameter and the dataset inside self

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$get_filter_overview_nsubjs(
       filtered_dataset = self$get_dataset(),
       subject_keys = NULL
    -)

    +)
    +

    +
    -

    Arguments

    -

    filtered_dataset
    +

    Arguments +

    +

    +
    +
    +
    filtered_dataset

    comparison object, of the same class as self$get_dataset(), if NULL then self$get_dataset() is used.

    @@ -332,27 +485,46 @@

    Arguments -

    Returns

    +

    Returns +

    list containing character #filtered/#not_filtered

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    DefaultFilteredDataset$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -360,7 +532,8 @@

    Arguments -

    Examples

    +

    Examples +

    library(shiny)
     ds <- teal.slice:::DefaultFilteredDataset$new(iris, "iris")
     isolate(
    @@ -433,17 +606,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.3.0/reference/EmptyFilterState.html b/v0.3.0/reference/EmptyFilterState.html index 6f51cb3c4..d88071c63 100644 --- a/v0.3.0/reference/EmptyFilterState.html +++ b/v0.3.0/reference/EmptyFilterState.html @@ -1,8 +1,24 @@ - -FilterState object for empty variable — EmptyFilterState • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,22 +106,29 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterState -> EmptyFilterState

    +

    Inherited methods


    -

    Method new()

    -

    Initialize EmptyFilterState object.

    -

    Usage

    -

    EmptyFilterState$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize EmptyFilterState object.

    +
    +

    Usage +

    +

    +
    +
    EmptyFilterState$new(
       x,
       varname,
       varlabel = character(0),
       dataname = NULL,
       extract_type = character(0)
    -)

    +)
    +

    +
    -

    Arguments

    -

    -


    -

    Method is_any_filtered()

    -

    Reports whether the current state filters out any values.(?)

    -

    Usage

    -

    EmptyFilterState$is_any_filtered()

    +
    +

    +
    +
    +

    Method is_any_filtered() +

    +

    Reports whether the current state filters out any values.(?)

    +
    +

    Usage +

    +

    +
    +
    EmptyFilterState$is_any_filtered()
    +

    +
    -

    Returns

    +

    Returns +

    logical(1)

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection relevant for selected variable type. Uses internal reactive values, hence must be called -in reactive or isolated context.

    -

    Usage

    -

    EmptyFilterState$get_call()

    +in reactive or isolated context.

    +
    +

    Usage +

    +

    +
    +
    EmptyFilterState$get_call()
    +

    +
    -

    Returns

    +

    Returns +

    logical(1)

    -


    -

    Method get_state()

    -

    Returns the filtering state.

    -

    Usage

    -

    EmptyFilterState$get_state()

    - +

    +
    +
    +

    Method get_state() +

    +

    Returns the filtering state.

    -

    Returns

    -

    list containing values taken from the reactive fields:

    • keep_na (logical(1)) whether NA should be kept.

    • -
    - -


    -

    Method set_state()

    -

    Set state.

    -

    Usage

    -

    EmptyFilterState$set_state(state)

    +

    Usage +

    +

    +
    +
    EmptyFilterState$get_state()
    +

    +
    -

    Arguments

    -

    state
    -

    (list)
    -contains fields relevant for specific class:

    • keep_na (logical) defines whether to keep or remove NA values

    • -
    +

    Returns +

    +

    list containing values taken from the reactive fields:

    +
      +
    • keep_na (logical(1)) whether NA should be kept.

    • +
    +
    +
    +

    +
    +
    +

    Method set_state() +

    +

    Set state.

    +
    +

    Usage +

    +

    +
    +
    EmptyFilterState$set_state(state)
    +

    +
    +
    -

    +
    +

    Arguments +

    +

    +
    +
    +
    state
    +
    +

    (list)
    +contains fields relevant for specific class:

    +
      +
    • keep_na (logical) defines whether to keep or remove NA values

    • +
    +
    + + +
    +

    +
    -

    Returns

    +

    Returns +

    NULL invisibly

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    EmptyFilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    EmptyFilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -239,7 +361,8 @@

    Arguments -

    Examples

    +

    Examples +

    filter_state <- teal.slice:::EmptyFilterState$new(
       NA,
       varname = "x",
    @@ -254,17 +377,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.3.0/reference/FilterPanelAPI.html b/v0.3.0/reference/FilterPanelAPI.html index f2f47fc54..a46195480 100644 --- a/v0.3.0/reference/FilterPanelAPI.html +++ b/v0.3.0/reference/FilterPanelAPI.html @@ -1,10 +1,26 @@ - -Class to encapsulate the API of the filter panel of a teal app — FilterPanelAPI • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + +
    @@ -86,149 +108,259 @@
    -

    Details

    +

    Details +

    The purpose of this class is to encapsulate the API of the filter panel in a new class FilterPanelAPI so that it can be passed and used in the server call of any module instead of passing the whole FilteredData object.

    This class is supported by methods to set, get, remove filter states in the filter panel API.

    -

    Methods

    +

    Methods +


    -

    Method new()

    -

    Initialize a FilterPanelAPI object

    -

    Usage

    -

    FilterPanelAPI$new(datasets)

    + +
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterPanelAPI object

    +
    +

    Usage +

    +

    +
    +
    FilterPanelAPI$new(datasets)
    +

    +
    -

    Arguments

    -

    datasets
    +

    Arguments +

    +

    +
    +
    +
    datasets

    (FilteredData) object.

    -

    +
    +

    +
    -


    +

    +
    +
    +

    Method get_filter_state() +

    Gets the reactive values from the active FilterState objects of the FilteredData object.

    Gets all active filters in the form of a nested list. -The output list is a compatible input to set_filter_state.

    -

    Usage

    -

    FilterPanelAPI$get_filter_state()

    +The output list is a compatible input to set_filter_state.

    +
    +

    Usage +

    +

    +
    +
    FilterPanelAPI$get_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    list with named elements corresponding to FilteredDataset objects with active filters.

    -


    -

    Method set_filter_state()

    -

    Sets active filter states.

    -

    Usage

    -

    FilterPanelAPI$set_filter_state(filter)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Sets active filter states.

    +
    +

    Usage +

    +

    +
    +
    FilterPanelAPI$set_filter_state(filter)
    +

    +
    -

    Arguments

    -

    filter
    +

    Arguments +

    +

    +
    +
    +
    filter

    (named list)
    nested list of filter selections applied to datasets.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL

    -


    -

    Method remove_filter_state()

    -

    Remove one or more FilterState of a FilteredDataset in the FilteredData object.

    -

    Usage

    -

    FilterPanelAPI$remove_filter_state(filter)

    +
    +

    +
    +
    +

    Method remove_filter_state() +

    +

    Remove one or more FilterState of a FilteredDataset in the FilteredData object.

    +
    +

    Usage +

    +

    +
    +
    FilterPanelAPI$remove_filter_state(filter)
    +

    +
    -

    Arguments

    -

    filter
    +

    Arguments +

    +

    +
    +
    +
    filter

    (named list)
    nested list of filter selections applied to datasets.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL

    -


    -

    Method remove_all_filter_states()

    -

    Remove all FilterStates of the FilteredData object.

    -

    Usage

    -

    FilterPanelAPI$remove_all_filter_states(datanames)

    +
    +

    +
    +
    +

    Method remove_all_filter_states() +

    +

    Remove all FilterStates of the FilteredData object.

    +
    +

    Usage +

    +

    +
    +
    FilterPanelAPI$remove_all_filter_states(datanames)
    +

    +
    -

    Arguments

    -

    datanames
    +

    Arguments +

    +

    +
    +
    +
    datanames

    (character)
    datanames to remove their FilterStates; omit to remove all FilterStates in the FilteredData object

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL

    -


    -

    Method filter_panel_toggle()

    +
    +

    +
    +
    +

    Method filter_panel_toggle() +

    Toggle the state of the global Filter Panel button by running javascript code to click the toggle button with the filter_panel_active id suffix. The button id is prefixed with the Filter Panel shiny namespace. This button is observed in srv_filter_panel method that executes -filter_panel_enable() or filter_panel_disable() method depending on the toggle state.

    -

    Usage

    -

    FilterPanelAPI$filter_panel_toggle()

    +filter_panel_enable() or filter_panel_disable() method depending on the toggle state.

    +
    +

    Usage +

    +

    +
    +
    FilterPanelAPI$filter_panel_toggle()
    +

    +
    -

    Returns

    +

    Returns +

    NULL

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    FilterPanelAPI$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    FilterPanelAPI$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -236,7 +368,8 @@

    Arguments -

    Examples

    +

    Examples +

    library(teal.slice)
     fd <- teal.slice::init_filtered_data(list(iris = list(dataset = iris)))
     fpa <- FilterPanelAPI$new(fd)
    @@ -282,17 +415,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.3.0/reference/FilterState.html b/v0.3.0/reference/FilterState.html index 869fe2a84..fa4201b22 100644 --- a/v0.3.0/reference/FilterState.html +++ b/v0.3.0/reference/FilterState.html @@ -1,8 +1,24 @@ - -FilterState Abstract Class — FilterState • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,13 +105,16 @@
    -

    Details

    +

    Details +

    This class is responsible for managing single filter item within FilteredData class. Filter states depend on the variable type: (logical, integer, numeric, factor, character, Date, POSIXct, POSIXlt) and returns FilterState object with class corresponding to input variable. Class controls single filter entry in module_single_filter_item and returns -code relevant to selected values.

    • factor, character: class = ChoicesFilterState

    • +code relevant to selected values.

      +
    + +
    -

    Modifying state

    +

    Modifying state +

    -

    Modifying a FilterState object is possible in three scenarios:

    • In the interactive session by directly specifying values of selected, +

      Modifying a FilterState object is possible in three scenarios:

      +
        +
      • In the interactive session by directly specifying values of selected, keep_na or keep_inf using set_state method (to update all at once), or using set_selected, set_keep_na or set_keep_inf

      • In a running application by changing appropriate inputs

      • In a running application by using filter_state_api which directly uses set_state method of the FilterState object.

      • -
    + +
    -

    Methods

    +

    Methods +


    -

    Method new()

    -

    Initialize a FilterState object

    -

    Usage

    -

    FilterState$new(
    +
    +
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterState object

    +
    +

    Usage +

    +

    +
    +
    FilterState$new(
       x,
       varname,
       varlabel = character(0),
       dataname = NULL,
       extract_type = character(0)
    -)

    +)
    +

    +
    -

    Arguments

    -

    -

    Returns

    +

    Returns +

    self invisibly

    -


    -

    Method destroy_observers()

    -

    Destroy observers stored in private$observers.

    -

    Usage

    -

    FilterState$destroy_observers()

    +
    +

    +
    +
    +

    Method destroy_observers() +

    +

    Destroy observers stored in private$observers.

    +
    +

    Usage +

    +

    +
    +
    FilterState$destroy_observers()
    +

    +
    -

    Returns

    +

    Returns +

    NULL invisibly

    -


    -

    Method format()

    -

    Returns a formatted string representing this FilterState.

    -

    Usage

    -

    FilterState$format(indent = 0L, wrap_width = 76L)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns a formatted string representing this FilterState.

    +
    +

    Usage +

    +

    +
    +
    FilterState$format(indent = 0L, wrap_width = 76L)
    +

    +
    -

    Arguments

    -

    indent
    +

    Arguments +

    +

    +
    +
    +
    indent

    (numeric(1)) number of spaces before after each new line character of the formatted string; defaults to 0

    @@ -225,170 +305,316 @@

    Arguments -

    Returns

    +

    Returns +

    character(1) the formatted string

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection relevant for selected variable type. Method is using internal reactive values which makes it reactive -and must be executed in reactive or isolated context.

    -

    Usage

    -

    FilterState$get_call()

    +and must be executed in reactive or isolated context.

    +
    +

    Usage +

    +

    +
    +
    FilterState$get_call()
    +

    +
    -


    -

    Method get_dataname()

    -

    Returns dataname or "NULL" if dataname is NULL.

    -

    Usage

    -

    FilterState$get_dataname()

    +
    +

    +
    +
    +

    Method get_dataname() +

    +

    Returns dataname or "NULL" if dataname is NULL.

    +
    +

    Usage +

    +

    +
    +
    FilterState$get_dataname()
    +

    +
    -

    Returns

    +

    Returns +

    character(1)

    -


    -

    Method get_keep_na()

    -

    Returns current keep_na selection.

    -

    Usage

    -

    FilterState$get_keep_na()

    +
    +

    +
    +
    +

    Method get_keep_na() +

    +

    Returns current keep_na selection.

    +
    +

    Usage +

    +

    +
    +
    FilterState$get_keep_na()
    +

    +
    -

    Returns

    +

    Returns +

    logical(1)

    -


    -

    Method get_varlabel()

    -

    Returns variable label.

    -

    Usage

    -

    FilterState$get_varlabel()

    +
    +

    +
    +
    +

    Method get_varlabel() +

    +

    Returns variable label.

    +
    +

    Usage +

    +

    +
    +
    FilterState$get_varlabel()
    +

    +
    -

    Returns

    +

    Returns +

    character(1)

    -


    -

    Method get_varname()

    -

    Get variable name.

    -

    Usage

    -

    FilterState$get_varname()

    +
    +

    +
    +
    +

    Method get_varname() +

    +

    Get variable name.

    +
    +

    Usage +

    +

    +
    +
    FilterState$get_varname()
    +

    +
    -

    Returns

    +

    Returns +

    character(1)

    -


    -

    Method get_selected()

    -

    Get selected values from FilterState.

    -

    Usage

    -

    FilterState$get_selected()

    +
    +

    +
    +
    +

    Method get_selected() +

    +

    Get selected values from FilterState.

    +
    +

    Usage +

    +

    +
    +
    FilterState$get_selected()
    +

    +
    -

    Returns

    +

    Returns +

    class of the returned object depends of class of the FilterState

    -


    -

    Method get_state()

    -

    Returns the filtering state.

    -

    Usage

    -

    FilterState$get_state()

    +
    +

    +
    +
    +

    Method get_state() +

    +

    Returns the filtering state.

    +
    +

    Usage +

    +

    +
    +
    FilterState$get_state()
    +

    +
    -

    Returns

    -

    list containing values taken from the reactive fields:

    • selected (atomic) length depends on a FilterState variant.

    • +

      Returns +

      +

      list containing values taken from the reactive fields:

      +
        +
      • selected (atomic) length depends on a FilterState variant.

      • keep_na (logical(1)) whether NA should be kept.

      • -
    + +
    -


    -

    Method print()

    -

    Prints this FilterState object.

    -

    Usage

    -

    FilterState$print(...)

    +
    +

    +
    +
    +

    Method print() +

    +

    Prints this FilterState object.

    +
    +

    Usage +

    +

    +
    +
    FilterState$print(...)
    +

    +
    -

    Arguments

    -

    ...
    +

    Arguments +

    +

    +
    +
    +
    ...

    additional arguments to this method

    -

    +
    +

    +
    -


    -

    Method set_keep_na()

    -

    Set whether to keep NAs.

    -

    Usage

    -

    FilterState$set_keep_na(value)

    +
    +

    +
    +
    +

    Method set_keep_na() +

    +

    Set whether to keep NAs.

    +
    +

    Usage +

    +

    +
    +
    FilterState$set_keep_na(value)
    +

    +
    -

    Arguments

    -

    value
    +

    Arguments +

    +

    +
    +
    +
    value

    logical(1)
    value(s) which come from the filter selection. Value is set in server modules after selecting check-box-input in the shiny interface. Values are set to private$keep_na which is reactive.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL invisibly

    -


    -

    Method set_na_rm()

    +
    +

    +
    +
    +

    Method set_na_rm() +

    Some methods need an additional !is.na(varame) condition to drop missing values. When private$na_rm = TRUE, self$get_call returns -condition extended by !is.na.

    -

    Usage

    -

    FilterState$set_na_rm(value)

    +condition extended by !is.na.

    +
    +

    Usage +

    +

    +
    +
    FilterState$set_na_rm(value)
    +

    +
    -

    Arguments

    -

    value
    +

    Arguments +

    +

    +
    +
    +
    value

    logical(1)
    when TRUE, FilterState$get_call appends an expression removing NA values to the filter expression returned by get_call

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL invisibly

    -


    -

    Method set_selected()

    -

    Set selection.

    -

    Usage

    -

    FilterState$set_selected(value)

    +
    +

    +
    +
    +

    Method set_selected() +

    +

    Set selection.

    +
    +

    Usage +

    +

    +
    +
    FilterState$set_selected(value)
    +

    +
    -

    Arguments

    -

    value
    +

    Arguments +

    +

    +
    +
    +
    value

    (vector)
    value(s) that come from filter selection; values are set in the module server after a selection is made in the app interface; @@ -396,90 +622,163 @@

    Arguments -

    Returns

    +

    Returns +

    NULL invisibly

    -


    -

    Method set_state()

    -

    Set state.

    -

    Usage

    -

    FilterState$set_state(state)

    +
    +

    +
    +
    +

    Method set_state() +

    +

    Set state.

    +
    +

    Usage +

    +

    +
    +
    FilterState$set_state(state)
    +

    +
    -

    Arguments

    -

    state
    -

    (list)
    -contains fields relevant for a specific class:

    • selected defines initial selection

    • +

      Arguments +

      +

      +
      +
      +
      state
      +
      +

      (list)
      +contains fields relevant for a specific class:

      +
        +
      • selected defines initial selection

      • keep_na (logical) defines whether to keep or remove NA values

      • -
      +
    +
    -

    +

    +

    +
    -

    Returns

    +

    Returns +

    NULL invisibly

    -


    -

    Method server()

    -

    Shiny module server.

    -

    Usage

    -

    FilterState$server(id)

    +
    +

    +
    +
    +

    Method server() +

    +

    Shiny module server.

    +
    +

    Usage +

    +

    +
    +
    FilterState$server(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    shiny module instance id

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    moduleServer function which returns reactive value signaling that remove button has been clicked

    -


    -

    Method ui()

    -

    Shiny module UI.

    -

    Usage

    -

    FilterState$ui(id)

    +
    +

    +
    +
    +

    Method ui() +

    +

    Shiny module UI.

    +
    +

    Usage +

    +

    +
    +
    FilterState$ui(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    shiny element (module instance) id; the UI for this class contains simple message stating that it is not supported

    -

    +
    +

    +
    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    FilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    FilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -487,17 +786,19 @@

    Arguments

    + +
    + +
    - - + + diff --git a/v0.3.0/reference/FilterStates.html b/v0.3.0/reference/FilterStates.html index 5c7305c01..98808babd 100644 --- a/v0.3.0/reference/FilterStates.html +++ b/v0.3.0/reference/FilterStates.html @@ -1,5 +1,10 @@ - - + + + + + +FilterStates R6 class — FilterStates • teal.slice +FilterStates R6 class — FilterStates • teal.slice + + + + + + + + + + Skip to contents @@ -38,7 +54,8 @@ + +
    @@ -113,12 +136,15 @@
    -

    Methods

    +

    Methods +


    -

    Method new()

    + +
    +

    +
    +
    +

    Method new() +

    Initializes FilterStates object.

    Initializes FilterStates object by setting -dataname, and datalabel.

    -

    Usage

    -

    FilterStates$new(dataname, datalabel)

    +dataname, and datalabel.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$new(dataname, datalabel)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1))
    name of the data used in the expression specified to the function argument attached to this FilterStates

    @@ -158,47 +199,82 @@

    Arguments -

    Returns

    +

    Returns +

    self invisibly

    -


    -

    Method get_datalabel()

    -

    Returns the label of the dataset.

    -

    Usage

    -

    FilterStates$get_datalabel()

    +
    +

    +
    +
    +

    Method get_datalabel() +

    +

    Returns the label of the dataset.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$get_datalabel()
    +

    +
    -

    Returns

    +

    Returns +

    character(1) the data label

    -


    -

    Method format()

    -

    Returns a formatted string representing this FilterStates object.

    -

    Usage

    -

    FilterStates$format(indent)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns a formatted string representing this FilterStates object.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$format(indent)
    +

    +
    -

    Arguments

    -

    indent
    +

    Arguments +

    +

    +
    +
    +
    indent

    (numeric(1)) the number of spaces prepended to each line of the output

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    character(1) the formatted string

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Filter call

    Builds subset expression from condition calls stored in FilterState objects selection. The lhs of the expression is private$dataname. @@ -206,56 +282,104 @@

    Method get_call()FilterState objects stored in private$state_list. If no filters are applied, -NULL is returned to avoid no-op calls such as x <- x.

    -

    Usage

    -

    FilterStates$get_call()

    +NULL is returned to avoid no-op calls such as x <- x.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$get_call()
    +

    +
    -

    Returns

    +

    Returns +

    call or NULL

    -


    -

    Method print()

    -

    Prints this FilterStates object.

    -

    Usage

    -

    FilterStates$print(...)

    +
    +

    +
    +
    +

    Method print() +

    +

    Prints this FilterStates object.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$print(...)
    +

    +
    -

    Arguments

    -

    ...
    +

    Arguments +

    +

    +
    +
    +
    ...

    additional arguments to this method

    -

    +
    +

    +
    -


    -

    Method get_fun()

    +
    +

    +
    +
    +

    Method get_fun() +

    Gets the name of the function used to filter the data in this FilterStates.

    Get name of function used to create the subset expression. -Defaults to "subset" but can be overridden by child class method.

    -

    Usage

    -

    FilterStates$get_fun()

    +Defaults to "subset" but can be overridden by child class method.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$get_fun()
    +

    +
    -

    Returns

    +

    Returns +

    character(1) the name of the function

    -


    -

    Method state_list_get()

    -

    Returns a list of FilterState objects stored in this FilterStates.

    -

    Usage

    -

    FilterStates$state_list_get(state_list_index, state_id = NULL)

    +
    +

    +
    +
    +

    Method state_list_get() +

    +

    Returns a list of FilterState objects stored in this FilterStates.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$state_list_get(state_list_index, state_id = NULL)
    +

    +
    -

    Arguments

    -

    state_list_index
    +

    Arguments +

    +

    +
    +
    +
    state_list_index

    (character(1), integer(1))
    index on the list in private$state_list where filter states are kept

    @@ -265,24 +389,41 @@

    Arguments -

    Returns

    +

    Returns +

    list of FilterState objects

    -


    -

    Method state_list_push()

    +
    +

    +
    +
    +

    Method state_list_push() +

    Adds a new FilterState object to this FilterStates.
    -Raises error if the length of x does not match the length of state_id.

    -

    Usage

    -

    FilterStates$state_list_push(x, state_list_index, state_id)

    +Raises error if the length of x does not match the length of state_id.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$state_list_push(x, state_list_index, state_id)
    +

    +
    -

    Arguments

    -

    x
    +

    Arguments +

    +

    +
    +
    +
    x

    (FilterState)
    object to be added to filter state list

    @@ -297,26 +438,45 @@

    Arguments -

    Returns

    +

    Returns +

    NULL

    -


    -

    Method state_list_remove()

    -

    Removes a single filter state with all associated shiny elements:

    • specified FilterState from private$state_list

    • +
    +

    +
    +
    +

    Method state_list_remove() +

    +

    Removes a single filter state with all associated shiny elements:

    +
      +
    • specified FilterState from private$state_list

    • UI card created for this filter

    • observers tracking the selection and remove button

    • -
    -

    Usage

    -

    FilterStates$state_list_remove(state_list_index, state_id)

    + +
    +

    Usage +

    +

    +
    +
    FilterStates$state_list_remove(state_list_index, state_id)
    +

    +
    -

    Arguments

    -

    state_list_index
    +

    Arguments +

    +

    +
    +
    +
    state_list_index

    (character(1), integer(1))
    index on the list in private$state_list where filter states are kept

    @@ -326,105 +486,189 @@

    Arguments -

    Returns

    +

    Returns +

    NULL

    -


    -

    Method state_list_empty()

    -

    Remove all FilterState objects from this FilterStates object.

    -

    Usage

    -

    FilterStates$state_list_empty()

    +
    +

    +
    +
    +

    Method state_list_empty() +

    +

    Remove all FilterState objects from this FilterStates object.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$state_list_empty()
    +

    +
    -

    Returns

    +

    Returns +

    NULL

    -


    -

    Method get_filter_count()

    -

    Gets the number of active FilterState objects in this FilterStates object.

    -

    Usage

    -

    FilterStates$get_filter_count()

    +
    +

    +
    +
    +

    Method get_filter_count() +

    +

    Gets the number of active FilterState objects in this FilterStates object.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$get_filter_count()
    +

    +
    -

    Returns

    +

    Returns +

    integer(1)

    -


    -

    Method remove_filter_state()

    -

    Remove a single FilterState from state_list.

    -

    Usage

    -

    FilterStates$remove_filter_state(state_id)

    +
    +

    +
    +
    +

    Method remove_filter_state() +

    +

    Remove a single FilterState from state_list.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$remove_filter_state(state_id)
    +

    +
    -

    Arguments

    -

    state_id
    +

    Arguments +

    +

    +
    +
    +
    state_id

    (character)
    name of variable for which to remove FilterState

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL

    -


    -

    Method ui()

    +
    +

    +
    +
    +

    Method ui() +

    Shiny module UI

    Shiny UI element that stores FilterState UI elements. -Populated with elements created with renderUI in the module server.

    -

    Usage

    -

    FilterStates$ui(id)

    +Populated with elements created with renderUI in the module server.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$ui(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    shiny element (module instance) id

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    +

    +
    +
    +

    Method get_filter_state() +

    Gets reactive values from active FilterState objects.

    Get active filter state from FilterState objects stored in state_list(s). -The output is a list compatible with input to self$set_filter_state.

    -

    Usage

    -

    FilterStates$get_filter_state()

    +The output is a list compatible with input to self$set_filter_state.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$get_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    list containing list per FilterState in the state_list

    -


    -

    Method set_filter_state()

    -

    Sets active FilterState objects.

    -

    Usage

    -

    FilterStates$set_filter_state(data, state, filtered_dataset)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Sets active FilterState objects.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$set_filter_state(data, state, filtered_dataset)
    +

    +
    -

    Arguments

    -

    data
    +

    Arguments +

    +

    +
    +
    +
    data

    (data.frame)
    data object for which to define a subset

    @@ -439,19 +683,35 @@

    Arguments
    -

    Method ui_add_filter_state()

    -

    Shiny module UI that adds a filter variable.

    -

    Usage

    -

    FilterStates$ui_add_filter_state(id, data)

    +
    +

    +
    +
    +

    Method ui_add_filter_state() +

    +

    Shiny module UI that adds a filter variable.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$ui_add_filter_state(id, data)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    shiny element (module instance) id

    @@ -461,23 +721,40 @@

    Arguments -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_add_filter_state()

    -

    Shiny module server that adds a filter variable.

    -

    Usage

    -

    FilterStates$srv_add_filter_state(id, data, ...)

    +
    +

    +
    +
    +

    Method srv_add_filter_state() +

    +

    Shiny module server that adds a filter variable.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$srv_add_filter_state(id, data, ...)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    shiny module instance id

    @@ -491,27 +768,46 @@

    Arguments -

    Returns

    +

    Returns +

    moduleServer function which returns NULL

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    FilterStates$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -519,7 +815,8 @@

    Arguments -

    Examples

    +

    Examples +

    library(shiny)
     filter_states <- teal.slice:::DFFilterStates$new(
       dataname = "data",
    @@ -549,17 +846,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.3.0/reference/FilteredData.html b/v0.3.0/reference/FilteredData.html index c40ff0c96..dc43e108c 100644 --- a/v0.3.0/reference/FilteredData.html +++ b/v0.3.0/reference/FilteredData.html @@ -1,10 +1,26 @@ - -Class to encapsulate filtered datasets — FilteredData • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + +
    @@ -86,7 +108,8 @@ + +
    -

    Methods

    +

    Methods +


    -

    Method new()

    -

    Initialize a FilteredData object

    -

    Usage

    -

    FilteredData$new(data_objects, join_keys = NULL, code = NULL, check = FALSE)

    -
    - -
    -

    Arguments

    -

    data_objects
    -

    (list) should contain.

    +
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilteredData object

    +
    +

    Usage +

    +

    +
    +
    FilteredData$new(data_objects, join_keys = NULL, code = NULL, check = FALSE)
    +

    +
    +
    + +
    +

    Arguments +

    +

    +
    +
    +
    data_objects
    +
    +

    (list) should contain.

    +
      +
    • dataset data object object supported by FilteredDataset.

    • metatada (optional) additional metadata attached to the dataset.

    • keys (optional) primary keys.

    • datalabel (optional) label describing the dataset.

    • parent (optional) which NULL is a parent of this one.

    • -
    + +
    join_keys
    @@ -180,96 +231,173 @@

    Arguments
    -

    Method datanames()

    +
    +

    +
    +
    +

    Method datanames() +

    Gets datanames

    The datanames are returned in the order in which they must be -evaluated (in case of dependencies).

    -

    Usage

    -

    FilteredData$datanames()

    +evaluated (in case of dependencies).

    +
    +

    Usage +

    +

    +
    +
    FilteredData$datanames()
    +

    +
    -

    Returns

    +

    Returns +

    (character vector) of datanames Gets data label for the dataset

    Useful to display in Show R Code.

    -


    -

    Method get_datalabel()

    +
    +

    +
    +
    +

    Method get_datalabel() +

    -

    Usage

    -

    FilteredData$get_datalabel(dataname)

    +

    Usage +

    +

    +
    +
    FilteredData$get_datalabel(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (character) keys of dataset

    -


    -

    Method get_filterable_datanames()

    -

    Gets dataset names of a given dataname for the filtering.

    -

    Usage

    -

    FilteredData$get_filterable_datanames(dataname)

    +
    +

    +
    +
    +

    Method get_filterable_datanames() +

    +

    Gets dataset names of a given dataname for the filtering.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_filterable_datanames(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character vector) names of the dataset

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (character vector) of dataset names

    -


    -

    Method get_filterable_varnames()

    -

    Gets variable names of a given dataname for the filtering.

    -

    Usage

    -

    FilteredData$get_filterable_varnames(dataname)

    +
    +

    +
    +
    +

    Method get_filterable_varnames() +

    +

    Gets variable names of a given dataname for the filtering.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_filterable_varnames(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (character vector) of variable names

    -


    -

    Method set_filterable_varnames()

    -

    Set the variable names of a given dataset for the filtering.

    -

    Usage

    -

    FilteredData$set_filterable_varnames(dataname, varnames)

    +
    +

    +
    +
    +

    Method set_filterable_varnames() +

    +

    Set the variable names of a given dataset for the filtering.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$set_filterable_varnames(dataname, varnames)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset

    @@ -279,15 +407,22 @@

    Arguments -

    Returns

    +

    Returns +

    this FilteredData object invisibly

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Gets a call to filter the dataset according to the filter state.

    It returns a call to filter the dataset only, assuming the other (filtered) datasets it depends on are available.

    @@ -298,78 +433,139 @@

    Method get_call()

    The filtered dataset has the name given by self$filtered_dataname(dataname)

    -

    This can be used for the Show R Code generation.

    -

    Usage

    -

    FilteredData$get_call(dataname)

    +

    This can be used for the Show R Code generation.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (call or list of calls) to filter dataset calls

    -


    -

    Method get_code()

    -

    Gets the R preprocessing code string that generates the unfiltered datasets.

    -

    Usage

    -

    FilteredData$get_code(dataname = self$datanames())

    +
    +

    +
    +
    +

    Method get_code() +

    +

    Gets the R preprocessing code string that generates the unfiltered datasets.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_code(dataname = self$datanames())
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name(s) of dataset(s)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (character(1)) deparsed code

    -


    -

    Method get_filtered_dataset()

    +
    +

    +
    +
    +

    Method get_filtered_dataset() +

    Gets FilteredDataset object which contains all information -pertaining to the specified dataset.

    -

    Usage

    -

    FilteredData$get_filtered_dataset(dataname = character(0))

    +pertaining to the specified dataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_filtered_dataset(dataname = character(0))
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1))
    name of the dataset

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    FilteredDataset object or list of FilteredDatasets

    -


    -

    Method get_data()

    +
    +

    +
    +
    +

    Method get_data() +

    Gets filtered or unfiltered dataset.

    For filtered = FALSE, the original data set with -set_data is returned including all attributes.

    -

    Usage

    -

    FilteredData$get_data(dataname, filtered = TRUE)

    +set_data is returned including all attributes.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_data(dataname, filtered = TRUE)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset

    @@ -377,108 +573,197 @@

    Arguments
    -

    Method get_check()

    -

    Returns whether the datasets in the object has undergone a reproducibility check.

    -

    Usage

    -

    FilteredData$get_check()

    +
    +

    +
    +
    +

    Method get_check() +

    +

    Returns whether the datasets in the object has undergone a reproducibility check.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_check()
    +

    +
    -

    Returns

    +

    Returns +

    logical

    -


    -

    Method get_metadata()

    -

    Gets metadata for a given dataset.

    -

    Usage

    -

    FilteredData$get_metadata(dataname)

    +
    +

    +
    +
    +

    Method get_metadata() +

    +

    Gets metadata for a given dataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_metadata(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    value of metadata for given data (or NULL if it does not exist)

    -


    -

    Method get_join_keys()

    -

    Get join keys between two datasets.

    -

    Usage

    -

    FilteredData$get_join_keys()

    +
    +

    +
    +
    +

    Method get_join_keys() +

    +

    Get join keys between two datasets.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_join_keys()
    +

    +
    -

    Returns

    +

    Returns +

    (JoinKeys)

    -


    -

    Method get_filter_overview()

    +
    +

    +
    +
    +

    Method get_filter_overview() +

    Get filter overview table in form of X (filtered) / Y (non-filtered).

    This is intended to be presented in the application. -The content for each of the data names is defined in get_filter_overview_info method.

    -

    Usage

    -

    FilteredData$get_filter_overview(datanames)

    +The content for each of the data names is defined in get_filter_overview_info method.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_filter_overview(datanames)
    +

    +
    -

    Arguments

    -

    datanames
    +

    Arguments +

    +

    +
    +
    +
    datanames

    (character vector) names of the dataset

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (matrix) matrix of observations and subjects of all datasets

    -


    -

    Method get_keys()

    -

    Get keys for the dataset.

    -

    Usage

    -

    FilteredData$get_keys(dataname)

    +
    +

    +
    +
    +

    Method get_keys() +

    +

    Get keys for the dataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_keys(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (character) keys of dataset

    -


    -

    Method get_varlabels()

    +
    +

    +
    +
    +

    Method get_varlabels() +

    Gets labels of variables in the data.

    Variables are the column names of the data. Either, all labels must have been provided for all variables -in set_data or NULL.

    -

    Usage

    -

    FilteredData$get_varlabels(dataname, variables = NULL)

    +in set_data or NULL.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_varlabels(dataname, variables = NULL)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset

    @@ -487,65 +772,116 @@

    Arguments -

    Returns

    +

    Returns +

    (character or NULL) variable labels, NULL if column_labels attribute does not exist for the data

    -


    -

    Method get_varnames()

    -

    Gets variable names.

    -

    Usage

    -

    FilteredData$get_varnames(dataname)

    +
    +

    +
    +
    +

    Method get_varnames() +

    +

    Gets variable names.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_varnames(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character) the name of the dataset

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (character vector) of variable names

    -


    -

    Method handle_active_datanames()

    +
    +

    +
    +
    +

    Method handle_active_datanames() +

    When active_datanames is "all", sets them to all datanames, -otherwise, it makes sure that it is a subset of the available datanames.

    -

    Usage

    -

    FilteredData$handle_active_datanames(datanames)

    +otherwise, it makes sure that it is a subset of the available datanames.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$handle_active_datanames(datanames)
    +

    +
    -

    Arguments

    -

    datanames
    +

    Arguments +

    +

    +
    +
    +
    datanames

    character vector datanames to pick

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    the intersection of self$datanames() and datanames

    -


    -

    Method set_dataset()

    -

    Adds a dataset to this FilteredData.

    -

    Usage

    -

    FilteredData$set_dataset(dataset_args, dataname)

    +
    +

    +
    +
    +

    Method set_dataset() +

    +

    Adds a dataset to this FilteredData.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$set_dataset(dataset_args, dataname)
    +

    +
    -

    Arguments

    -

    dataset_args
    +

    Arguments +

    +

    +
    +
    +
    dataset_args

    (list)
    containing the arguments except (dataname) needed by init_filtered_dataset

    @@ -556,112 +892,192 @@

    Arguments -

    Details

    +

    Details +

    set_dataset creates a FilteredDataset object which keeps dataset for the filtering purpose.

    -

    Returns

    +

    Returns +

    (self) invisibly this FilteredData

    -


    -

    Method set_join_keys()

    -

    Set the join_keys.

    -

    Usage

    -

    FilteredData$set_join_keys(join_keys)

    +
    +

    +
    +
    +

    Method set_join_keys() +

    +

    Set the join_keys.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$set_join_keys(join_keys)
    +

    +
    -

    Arguments

    -

    join_keys
    +

    Arguments +

    +

    +
    +
    +
    join_keys

    (JoinKeys) join_key (converted to a nested list)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (self) invisibly this FilteredData

    -


    -

    Method set_check()

    -

    Sets whether the datasets in the object have undergone a reproducibility check.

    -

    Usage

    -

    FilteredData$set_check(check)

    +
    +

    +
    +
    +

    Method set_check() +

    +

    Sets whether the datasets in the object have undergone a reproducibility check.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$set_check(check)
    +

    +
    -

    Arguments

    -

    check
    +

    Arguments +

    +

    +
    +
    +
    check

    (logical) whether datasets have undergone reproducibility check

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (self)

    -


    -

    Method set_code()

    -

    Sets the R preprocessing code for single dataset.

    -

    Usage

    -

    FilteredData$set_code(code)

    +
    +

    +
    +
    +

    Method set_code() +

    +

    Sets the R preprocessing code for single dataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$set_code(code)
    +

    +
    -

    Arguments

    -

    code
    +

    Arguments +

    +

    +
    +
    +
    code

    (CodeClass)
    preprocessing code that can be parsed to generate the unfiltered datasets

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (self)

    -


    +

    +
    +
    +

    Method get_filter_state() +

    Gets the reactive values from the active FilterState objects.

    Gets all active filters in the form of a nested list. The output list is a compatible input to self$set_filter_state. The attribute formatted renders the output of self$get_formatted_filter_state, -which is a character formatting of the filter state.

    -

    Usage

    -

    FilteredData$get_filter_state()

    +which is a character formatting of the filter state.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    named list with elements corresponding to FilteredDataset objects with active filters. In addition, the formatted attribute holds the character format of the active filter states.

    -


    -

    Method get_formatted_filter_state()

    -

    Returns the filter state formatted for printing to an IO device.

    -

    Usage

    -

    FilteredData$get_formatted_filter_state()

    +
    +

    +
    +
    +

    Method get_formatted_filter_state() +

    +

    Returns the filter state formatted for printing to an IO device.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_formatted_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    character the pre-formatted filter state

    -

    Examples

    -

    utils::data(miniACC, package = "MultiAssayExperiment")
    +

    Examples +

    +

    +
    +
    utils::data(miniACC, package = "MultiAssayExperiment")
     datasets <- teal.slice:::FilteredData$new(
       list(iris = list(dataset = iris),
            mae = list(dataset = miniACC)
    @@ -686,33 +1102,55 @@ 

    Examples) isolate(datasets$set_filter_state(state = fs)) cat(shiny::isolate(datasets$get_formatted_filter_state())) -

    +
    +

    +
    -


    -

    Method set_filter_state()

    -

    Sets active filter states.

    -

    Usage

    -

    FilteredData$set_filter_state(state)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Sets active filter states.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$set_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (named list)
    nested list of filter selections applied to datasets

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL

    -

    Examples

    -

    utils::data(miniACC, package = "MultiAssayExperiment")
    +

    Examples +

    +

    +
    +
    utils::data(miniACC, package = "MultiAssayExperiment")
     
     datasets <- teal.slice:::FilteredData$new(
       list(iris = list(dataset = iris),
    @@ -738,70 +1176,120 @@ 

    Examples) shiny::isolate(datasets$set_filter_state(state = fs)) shiny::isolate(datasets$get_filter_state()) -

    +
    +

    +
    -


    -

    Method remove_filter_state()

    -

    Removes one or more FilterState of a FilteredDataset in a FilteredData object.

    -

    Usage

    -

    FilteredData$remove_filter_state(state)

    +
    +

    +
    +
    +

    Method remove_filter_state() +

    +

    Removes one or more FilterState of a FilteredDataset in a FilteredData object.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$remove_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (named list)
    nested list of filter selections applied to datasets

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL invisibly

    -


    -

    Method remove_all_filter_states()

    +
    +

    +
    +
    +

    Method remove_all_filter_states() +

    Remove all FilterStates of a FilteredDataset or all FilterStates -of a FilteredData object.

    -

    Usage

    -

    FilteredData$remove_all_filter_states(datanames = self$datanames())

    +of a FilteredData object.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$remove_all_filter_states(datanames = self$datanames())
    +

    +
    -

    Arguments

    -

    datanames
    +

    Arguments +

    +

    +
    +
    +
    datanames

    (character)
    datanames to remove their FilterStates or empty which removes all FilterStates in the FilteredData object

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL invisibly

    -


    -

    Method restore_state_from_bookmark()

    +
    +

    +
    +
    +

    Method restore_state_from_bookmark() +

    Sets this object from a bookmarked state.

    Only sets the filter state, does not set the data and the preprocessing code. The data should already have been set. Also checks the preprocessing code is identical if provided in the state.

    Since this function is used from the end-user part, its error messages are more verbose. We don't call the Shiny modals from here because this -class may be used outside of a Shiny app.

    -

    Usage

    -

    FilteredData$restore_state_from_bookmark(state, check_data_hash = TRUE)

    +class may be used outside of a Shiny app.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$restore_state_from_bookmark(state, check_data_hash = TRUE)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (named list)
    containing fields data_hash, filter_states and preproc_code

    @@ -811,81 +1299,151 @@

    Arguments
    -

    Method filter_panel_disable()

    +
    +

    +
    +
    +

    Method filter_panel_disable() +

    Disable the filter panel by adding disable class to filter_add_vars and filter_panel_active_vars tags in the User Interface. In addition, it will store the existing filter states in a private field called cached_states -before removing all filter states from the object.

    -

    Usage

    -

    FilteredData$filter_panel_disable()

    +before removing all filter states from the object.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$filter_panel_disable()
    +

    +
    -


    -

    Method filter_panel_enable()

    +
    +

    +
    +
    +

    Method filter_panel_enable() +

    enable the filter panel Enable the filter panel by adding enable class to filter_add_vars and filter_active_vars tags in the User Interface. -In addition, it will restore the filter states from a private field called cached_states.

    -

    Usage

    -

    FilteredData$filter_panel_enable()

    +In addition, it will restore the filter states from a private field called cached_states.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$filter_panel_enable()
    +

    +
    -


    -

    Method get_filter_panel_active()

    -

    Gets the state of filter panel, if activated.

    -

    Usage

    -

    FilteredData$get_filter_panel_active()

    +
    +

    +
    +
    +

    Method get_filter_panel_active() +

    +

    Gets the state of filter panel, if activated.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_filter_panel_active()
    +

    +
    -


    -

    Method get_filter_panel_ui_id()

    +
    +

    +
    +
    +

    Method get_filter_panel_ui_id() +

    Gets the id of the filter panel UI. Module for the right filter panel in the teal app with a filter overview panel and a filter variable panel.

    This panel contains info about the number of observations left in -the (active) datasets and allows to filter the datasets.

    -

    Usage

    -

    FilteredData$get_filter_panel_ui_id()

    +the (active) datasets and allows to filter the datasets.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_filter_panel_ui_id()
    +

    +
    -


    -

    Method ui_filter_panel()

    +
    +

    +
    +
    +

    Method ui_filter_panel() +

    -

    Usage

    -

    FilteredData$ui_filter_panel(id)

    +

    Usage +

    +

    +
    +
    FilteredData$ui_filter_panel(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    module id Server function for filter panel

    -

    +
    +

    +
    -


    -

    Method srv_filter_panel()

    +
    +

    +
    +
    +

    Method srv_filter_panel() +

    -

    Usage

    -

    FilteredData$srv_filter_panel(id, active_datanames = function() "all")

    +

    Usage +

    +

    +
    +
    FilteredData$srv_filter_panel(id, active_datanames = function() "all")
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    an ID string that corresponds with the ID used to call the module's UI function.

    @@ -898,10 +1456,13 @@

    Arguments -

    Returns

    +

    Returns +

    moduleServer function which returns NULL Creates the UI for the module showing counts for each dataset contrasting the filtered to the full unfiltered dataset

    @@ -910,36 +1471,64 @@

    Returns
    -

    Method ui_filter_overview()

    +
    +

    +
    +
    +

    Method ui_filter_overview() +

    -

    Usage

    -

    FilteredData$ui_filter_overview(id)

    +

    Usage +

    +

    +
    +
    FilteredData$ui_filter_overview(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    module id Server function to display the number of records in the filtered and unfiltered data

    -

    +
    +

    +
    -


    -

    Method srv_filter_overview()

    +
    +

    +
    +
    +

    Method srv_filter_overview() +

    -

    Usage

    -

    FilteredData$srv_filter_overview(id, active_datanames = function() "all")

    +

    Usage +

    +

    +
    +
    FilteredData$srv_filter_overview(id, active_datanames = function() "all")
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    an ID string that corresponds with the ID used to call the module's UI function.

    @@ -952,27 +1541,46 @@

    Arguments -

    Returns

    +

    Returns +

    moduleServer function which returns NULL

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    FilteredData$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -980,7 +1588,8 @@

    Arguments -

    Examples

    +

    Examples +

    library(shiny)
     datasets <- teal.slice:::FilteredData$new(
       list(
    @@ -1421,17 +2030,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.3.0/reference/FilteredDataset.html b/v0.3.0/reference/FilteredDataset.html index 62cbf3c81..a5b46faa5 100644 --- a/v0.3.0/reference/FilteredDataset.html +++ b/v0.3.0/reference/FilteredDataset.html @@ -1,16 +1,32 @@ - - + + + + + +FilterStates R6 class — FilteredDataset • teal.slice +FilterStates R6 class — FilteredDataset • teal.slice + + + + + + + + + + Skip to contents @@ -26,7 +42,8 @@ + +

    @@ -95,12 +118,15 @@
    -

    Methods

    +

    Methods +


    -

    Method new()

    -

    Initializes this FilteredDataset object

    -

    Usage

    -

    +

    +
    +
    +

    Method new() +

    +

    Initializes this FilteredDataset object

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$new(
       dataset,
       dataname,
       keys = character(0),
       label = attr(dataset, "label"),
       metadata = NULL
    -)

    +)
    +

    +
    -

    Arguments

    -

    dataset
    +

    Arguments +

    +

    +
    +
    +
    dataset

    (data.frame or MultiAssayExperiment)
    single dataset for which filters are rendered

    @@ -163,342 +204,609 @@

    Arguments
    -

    Method get_formatted_filter_state()

    -

    Returns a string representation of the filter state in this FilteredDataset.

    -

    Usage

    -

    FilteredDataset$get_formatted_filter_state()

    +
    +

    +
    +
    +

    Method get_formatted_filter_state() +

    +

    Returns a string representation of the filter state in this FilteredDataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_formatted_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    character(1) the formatted string representing the filter state or NULL if no filter state is present.

    -


    -

    Method state_lists_empty()

    -

    Removes all active filter items applied to this dataset

    -

    Usage

    -

    FilteredDataset$state_lists_empty()

    +
    +

    +
    +
    +

    Method state_lists_empty() +

    +

    Removes all active filter items applied to this dataset

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$state_lists_empty()
    +

    +
    -

    Returns

    +

    Returns +

    NULL

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Gets a filter expression

    This functions returns filter calls equivalent to selected items within each of filter_states. Configuration of the calls is constant and -depends on filter_states type and order which are set during initialization.

    -

    Usage

    -

    FilteredDataset$get_call()

    +depends on filter_states type and order which are set during initialization.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_call()
    +

    +
    -

    Returns

    +

    Returns +

    filter call or list of filter calls Gets the reactive values from the active FilterState objects.

    Get all active filters from this dataset in form of the nested list. The output list is a compatible input to self$set_filter_state.

    -


    +

    +
    +
    +

    Method get_filter_state() +

    -

    Usage

    -

    FilteredDataset$get_filter_state()

    +

    Usage +

    +

    +
    +
    FilteredDataset$get_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    list with named elements corresponding to FilterStates objects with active filters.

    -


    -

    Method get_filter_states()

    -

    Gets the active FilterStates objects.

    -

    Usage

    -

    FilteredDataset$get_filter_states(id = character(0))

    +
    +

    +
    +
    +

    Method get_filter_states() +

    +

    Gets the active FilterStates objects.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_filter_states(id = character(0))
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1), character(0))
    the id of the private$filter_states list element where FilterStates is kept.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    FilterStates or list of FilterStates objects.

    -


    -

    Method get_filter_count()

    -

    Gets the number of active FilterState objects in all FilterStates in this FilteredDataset.

    -

    Usage

    -

    FilteredDataset$get_filter_count()

    +
    +

    +
    +
    +

    Method get_filter_count() +

    +

    Gets the number of active FilterState objects in all FilterStates in this FilteredDataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_filter_count()
    +

    +
    -

    Returns

    +

    Returns +

    integer(1)

    -


    -

    Method get_dataname()

    +
    +

    +
    +
    +

    Method get_dataname() +

    +

    Get name of the dataset

    Get name of the dataset

    -

    Get name of the dataset

    -

    Usage

    -

    FilteredDataset$get_dataname()

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_dataname()
    +

    +
    -

    Returns

    +

    Returns +

    character(1) as a name of this dataset

    -


    -

    Method get_dataset()

    -

    Gets the dataset object in this FilteredDataset

    -

    Usage

    -

    FilteredDataset$get_dataset()

    +
    +

    +
    +
    +

    Method get_dataset() +

    +

    Gets the dataset object in this FilteredDataset

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_dataset()
    +

    +
    -

    Returns

    +

    Returns +

    data.frame or MultiAssayExperiment

    -


    -

    Method get_metadata()

    -

    Gets the metadata for the dataset in this FilteredDataset

    -

    Usage

    -

    FilteredDataset$get_metadata()

    +
    +

    +
    +
    +

    Method get_metadata() +

    +

    Gets the metadata for the dataset in this FilteredDataset

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_metadata()
    +

    +
    -

    Returns

    +

    Returns +

    named list or NULL

    -


    -

    Method get_filter_overview_info()

    +
    +

    +
    +
    +

    Method get_filter_overview_info() +

    Get filter overview rows of a dataset The output shows the comparison between filtered_dataset -function parameter and the dataset inside self

    -

    Usage

    -

    FilteredDataset$get_filter_overview_info(filtered_dataset = self$get_dataset())

    +function parameter and the dataset inside self

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_filter_overview_info(filtered_dataset = self$get_dataset())
    +

    +
    -

    Arguments

    -

    filtered_dataset
    +

    Arguments +

    +

    +
    +
    +
    filtered_dataset

    comparison object, of the same class as self$get_dataset(), if NULL then self$get_dataset() is used.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (matrix) matrix of observations and subjects

    -


    -

    Method get_keys()

    -

    Gets the keys for the dataset of this FilteredDataset

    -

    Usage

    -

    FilteredDataset$get_keys()

    +
    +

    +
    +
    +

    Method get_keys() +

    +

    Gets the keys for the dataset of this FilteredDataset

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_keys()
    +

    +
    -

    Returns

    +

    Returns +

    (character) the keys of dataset

    -


    -

    Method get_varlabels()

    +
    +

    +
    +
    +

    Method get_varlabels() +

    Gets labels of variables in the data

    Variables are the column names of the data. Either, all labels must have been provided for all variables -in set_data or NULL.

    -

    Usage

    -

    FilteredDataset$get_varlabels(variables = NULL)

    +in set_data or NULL.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_varlabels(variables = NULL)
    +

    +
    -

    Arguments

    -

    variables
    +

    Arguments +

    +

    +
    +
    +
    variables

    (character vector) variables to get labels for; if NULL, for all variables in data

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (character or NULL) variable labels, NULL if column_labels attribute does not exist for the data

    -


    -

    Method get_dataset_label()

    -

    Gets the dataset label

    -

    Usage

    -

    FilteredDataset$get_dataset_label()

    +
    +

    +
    +
    +

    Method get_dataset_label() +

    +

    Gets the dataset label

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_dataset_label()
    +

    +
    -

    Returns

    +

    Returns +

    (character) the dataset label

    -


    -

    Method get_varnames()

    -

    Gets variable names from dataset

    -

    Usage

    -

    FilteredDataset$get_varnames()

    +
    +

    +
    +
    +

    Method get_varnames() +

    +

    Gets variable names from dataset

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_varnames()
    +

    +
    -

    Returns

    +

    Returns +

    character the variable names

    -


    -

    Method get_filterable_varnames()

    +
    +

    +
    +
    +

    Method get_filterable_varnames() +

    Gets variable names for the filtering.

    It takes the intersection of the column names of the data and private$filterable_varnames if -private$filterable_varnames has positive length

    -

    Usage

    -

    FilteredDataset$get_filterable_varnames()

    +private$filterable_varnames has positive length

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_filterable_varnames()
    +

    +
    -

    Returns

    +

    Returns +

    (character vector) of variable names

    -


    -

    Method set_filterable_varnames()

    -

    Set the allowed filterable variables

    -

    Usage

    -

    FilteredDataset$set_filterable_varnames(varnames)

    +
    +

    +
    +
    +

    Method set_filterable_varnames() +

    +

    Set the allowed filterable variables

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$set_filterable_varnames(varnames)
    +

    +
    -

    Arguments

    -

    varnames
    +

    Arguments +

    +

    +
    +
    +
    varnames

    (character or NULL) The variables which can be filtered See self$get_filterable_varnames for more details

    -

    +
    +

    +
    -

    Details

    +

    Details +

    When retrieving the filtered variables only those which have filtering supported (i.e. are of the permitted types) are included.

    -

    Returns

    +

    Returns +

    invisibly this FilteredDataset

    -


    -

    Method ui()

    +
    +

    +
    +
    +

    Method ui() +

    UI module for dataset active filters

    UI module containing dataset active filters along with -title and remove button.

    -

    Usage

    -

    FilteredDataset$ui(id)

    +title and remove button.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$ui(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    identifier of the element - preferably containing dataset name

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    function - shiny UI module

    -


    -

    Method server()

    +
    +

    +
    +
    +

    Method server() +

    Server module for a dataset active filters

    -

    Server module managing a active filters.

    -

    Usage

    -

    FilteredDataset$server(id)

    +

    Server module managing a active filters.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$server(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    an ID string that corresponds with the ID used to call the module's UI function.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    moduleServer function which returns NULL

    -


    -

    Method ui_add_filter_state()

    +
    +

    +
    +
    +

    Method ui_add_filter_state() +

    +

    UI module to add filter variable for this dataset

    UI module to add filter variable for this dataset

    -

    UI module to add filter variable for this dataset

    -

    Usage

    -

    FilteredDataset$ui_add_filter_state(id)

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$ui_add_filter_state(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    identifier of the element - preferably containing dataset name

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    function - shiny UI module

    -


    -

    Method srv_add_filter_state()

    +
    +

    +
    +
    +

    Method srv_add_filter_state() +

    +

    Server module to add filter variable for this dataset

    Server module to add filter variable for this dataset

    -

    Server module to add filter variable for this dataset

    -

    Usage

    -

    FilteredDataset$srv_add_filter_state(id, ...)

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$srv_add_filter_state(id, ...)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    an ID string that corresponds with the ID used to call the module's UI function.

    @@ -507,27 +815,46 @@

    Arguments -

    Returns

    +

    Returns +

    moduleServer function.

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    FilteredDataset$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -535,17 +862,19 @@

    Arguments

    + +
    + +
    - - + + diff --git a/v0.3.0/reference/LogicalFilterState.html b/v0.3.0/reference/LogicalFilterState.html index 055ddba4a..b49bb7b29 100644 --- a/v0.3.0/reference/LogicalFilterState.html +++ b/v0.3.0/reference/LogicalFilterState.html @@ -1,8 +1,24 @@ - -FilterState object for logical variable — LogicalFilterState • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,32 +106,41 @@
    -

    Value

    +

    Value +

    invisibly NULL.

    -

    Note

    +

    Note +

    Casts the passed object to logical before validating the input making it possible to pass any object coercible to logical to this method.

    -

    Super class

    +

    Super class +

    teal.slice::FilterState -> LogicalFilterState

    +

    Inherited methods


    -

    Method new()

    -

    Initialize a FilterState object

    -

    Usage

    -

    LogicalFilterState$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterState object

    +
    +

    Usage +

    +

    +
    +
    LogicalFilterState$new(
       x,
       varname,
       varlabel = character(0),
       dataname = NULL,
       extract_type = character(0)
    -)

    +)
    +

    +
    -

    Arguments

    -

    -


    -

    Method is_any_filtered()

    -

    Answers the question of whether the current settings and values selected actually filters out any values.

    -

    Usage

    -

    LogicalFilterState$is_any_filtered()

    +
    +

    +
    +
    +

    Method is_any_filtered() +

    +

    Answers the question of whether the current settings and values selected actually filters out any values.

    +
    +

    Usage +

    +

    +
    +
    LogicalFilterState$is_any_filtered()
    +

    +
    -

    Returns

    +

    Returns +

    logical scalar

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection. For LogicalFilterState it's a !<varname> or <varname> and optionally -is.na(<varname>)

    -

    Usage

    -

    LogicalFilterState$get_call()

    +is.na(<varname>)

    +
    +

    Usage +

    +

    +
    +
    LogicalFilterState$get_call()
    +

    +
    -


    -

    Method set_selected()

    -

    Sets the selected values of this LogicalFilterState.

    -

    Usage

    -

    LogicalFilterState$set_selected(value)

    +
    +

    +
    +
    +

    Method set_selected() +

    +

    Sets the selected values of this LogicalFilterState.

    +
    +

    Usage +

    +

    +
    +
    LogicalFilterState$set_selected(value)
    +

    +
    -

    Arguments

    -

    value
    +

    Arguments +

    +

    +
    +
    +
    value

    (logical(1))
    the value to set. Must not contain the NA value.

    -

    +
    +

    +
    -

    Examples

    -

    filter <- teal.slice:::LogicalFilterState$new(c(TRUE), varname = "name")
    -filter$set_selected(TRUE)

    +

    Examples +

    +

    +
    +
    filter <- teal.slice:::LogicalFilterState$new(c(TRUE), varname = "name")
    +filter$set_selected(TRUE)
    +

    +
    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    LogicalFilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    LogicalFilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -234,7 +343,8 @@

    Arguments -

    Examples

    +

    Examples +

    filter_state <- teal.slice:::LogicalFilterState$new(
       sample(c(TRUE, FALSE, NA), 10, replace = TRUE),
       varname = "x",
    @@ -314,17 +424,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.3.0/reference/MAEFilterStates.html b/v0.3.0/reference/MAEFilterStates.html index 4f713d7bd..408af4f6f 100644 --- a/v0.3.0/reference/MAEFilterStates.html +++ b/v0.3.0/reference/MAEFilterStates.html @@ -1,8 +1,24 @@ - -FilterStates subclass for MultiAssayExperiments — MAEFilterStates • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,16 +106,20 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterStates -> MAEFilterStates

    +

    Inherited methods


    -

    Method new()

    +

    +
    +
    +

    Method new() +

    Initializes MAEFilterStates object

    -

    Initialize MAEFilterStates object

    -

    Usage

    -

    MAEFilterStates$new(dataname, datalabel, varlabels, keys)

    +

    Initialize MAEFilterStates object

    +
    +

    Usage +

    +

    +
    +
    MAEFilterStates$new(dataname, datalabel, varlabels, keys)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1))
    name of the data used in the expression specified to the function argument attached to this FilterStates.

    @@ -142,87 +185,159 @@

    Arguments
    -

    Method format()

    -

    Returns the formatted string representing this MAEFilterStates object.

    -

    Usage

    -

    MAEFilterStates$format(indent = 0)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns the formatted string representing this MAEFilterStates object.

    +
    +

    Usage +

    +

    +
    +
    MAEFilterStates$format(indent = 0)
    +

    +
    -

    Arguments

    -

    indent
    +

    Arguments +

    +

    +
    +
    +
    indent

    (numeric(1)) the number of spaces before each line of the representation

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    character(1) the formatted string

    -


    -

    Method get_fun()

    +
    +

    +
    +
    +

    Method get_fun() +

    Returns function name used to create filter call. -For MAEFilterStates MultiAssayExperiment::subsetByColData is used.

    -

    Usage

    -

    MAEFilterStates$get_fun()

    +For MAEFilterStates MultiAssayExperiment::subsetByColData is used.

    +
    +

    Usage +

    +

    +
    +
    MAEFilterStates$get_fun()
    +

    +
    -

    Returns

    +

    Returns +

    character(1)

    -


    -

    Method server()

    -

    Server module

    -

    Usage

    -

    MAEFilterStates$server(id)

    +
    +

    +
    +
    +

    Method server() +

    +

    Server module

    +
    +

    Usage +

    +

    +
    +
    MAEFilterStates$server(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    an ID string that corresponds with the ID used to call the module's UI function.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    moduleServer function which returns NULL

    -


    +

    +
    +
    +

    Method get_filter_state() +

    Returns active FilterState objects.

    Gets all active filters from this dataset in form of the nested list. -The output list can be used as input to self$set_filter_state.

    -

    Usage

    -

    MAEFilterStates$get_filter_state()

    +The output list can be used as input to self$set_filter_state.

    +
    +

    Usage +

    +

    +
    +
    MAEFilterStates$get_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    list with elements number equal number of FilterStates.

    -


    -

    Method set_filter_state()

    -

    Set filter state

    -

    Usage

    -

    MAEFilterStates$set_filter_state(data, state, ...)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Set filter state

    +
    +

    Usage +

    +

    +
    +
    MAEFilterStates$set_filter_state(data, state, ...)
    +

    +
    -

    Arguments

    -

    data
    +

    Arguments +

    +

    +
    +
    +
    data

    (MultiAssayExperiment)
    data which are supposed to be filtered.

    @@ -238,43 +353,77 @@

    Arguments -

    Returns

    +

    Returns +

    NULL

    -


    -

    Method remove_filter_state()

    -

    Removes a variable from the state_list and its corresponding UI element.

    -

    Usage

    -

    MAEFilterStates$remove_filter_state(state_id)

    +
    +

    +
    +
    +

    Method remove_filter_state() +

    +

    Removes a variable from the state_list and its corresponding UI element.

    +
    +

    Usage +

    +

    +
    +
    MAEFilterStates$remove_filter_state(state_id)
    +

    +
    -

    Arguments

    -

    state_id
    +

    Arguments +

    +

    +
    +
    +
    state_id

    (character(1))
    name of state_list element.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL

    -


    -

    Method ui_add_filter_state()

    -

    Shiny UI module to add filter variable

    -

    Usage

    -

    MAEFilterStates$ui_add_filter_state(id, data)

    +
    +

    +
    +
    +

    Method ui_add_filter_state() +

    +

    Shiny UI module to add filter variable

    +
    +

    Usage +

    +

    +
    +
    MAEFilterStates$ui_add_filter_state(id, data)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    id of shiny module

    @@ -285,26 +434,43 @@

    Arguments -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_add_filter_state()

    +
    +

    +
    +
    +

    Method srv_add_filter_state() +

    Shiny server module to add filter variable.

    Module controls available choices to select as a filter variable. Selected filter variable is being removed from available choices. -Removed filter variable gets back to available choices.

    -

    Usage

    -

    MAEFilterStates$srv_add_filter_state(id, data, ...)

    +Removed filter variable gets back to available choices.

    +
    +

    Usage +

    +

    +
    +
    MAEFilterStates$srv_add_filter_state(id, data, ...)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    an ID string that corresponds with the ID used to call the module's UI function.

    @@ -319,10 +485,13 @@

    Arguments -

    Returns

    +

    Returns +

    moduleServer function which returns NULL

    description Get label of specific variable. In case when variable label is missing @@ -332,20 +501,36 @@

    Returns
    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    MAEFilterStates$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    MAEFilterStates$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -353,17 +538,19 @@

    Arguments

    + +

    + +
    - - + + diff --git a/v0.3.0/reference/MAEFilteredDataset.html b/v0.3.0/reference/MAEFilteredDataset.html index 94b2f84a3..7c6503be9 100644 --- a/v0.3.0/reference/MAEFilteredDataset.html +++ b/v0.3.0/reference/MAEFilteredDataset.html @@ -1,10 +1,26 @@ - -MAEFilteredDataset R6 class — MAEFilteredDataset • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + +
    @@ -86,16 +109,20 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilteredDataset -> MAEFilteredDataset

    +

    Inherited methods


    -

    Method new()

    -

    Initialize MAEFilteredDataset object

    -

    Usage

    -

    MAEFilteredDataset$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize MAEFilteredDataset object

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$new(
       dataset,
       dataname,
       keys = character(0),
       label = character(0),
       metadata = NULL
    -)

    +)
    +

    +
    -

    Arguments

    -

    dataset
    +

    Arguments +

    +

    +
    +
    +
    dataset

    (MulitiAssayExperiment)
    a single MultiAssayExperiment for which to define a subset

    @@ -161,98 +204,172 @@

    Arguments
    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Get filter expression

    This functions returns filter calls equivalent to selected items within each of filter_states. Configuration of the calls is constant and depends on filter_states type and order which are set during initialization. -This class contains multiple FilterStates:

    • colData(dataset)for this object single MAEFilterStates +This class contains multiple FilterStates:

      +
        +
      • colData(dataset)for this object single MAEFilterStates which returns subsetByColData call

      • experimentsfor each experiment single SEFilterStates and FilterStates_matrix, both returns subset call

      • -
      -

      Usage

      -

      MAEFilteredDataset$get_call()

      +
    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$get_call()
    +

    +
    -

    Returns

    +

    Returns +

    filter call or list of filter calls

    -


    -

    Method get_varlabels()

    +
    +

    +
    +
    +

    Method get_varlabels() +

    Gets labels of variables in the data

    Variables are the column names of the data. Either, all labels must have been provided for all variables -in set_data or NULL.

    -

    Usage

    -

    MAEFilteredDataset$get_varlabels(variables = NULL)

    +in set_data or NULL.

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$get_varlabels(variables = NULL)
    +

    +
    -

    Arguments

    -

    variables
    +

    Arguments +

    +

    +
    +
    +
    variables

    (character vector) variables to get labels for; if NULL, for all variables in data

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (character or NULL) variable labels, NULL if column_labels attribute does not exist for the data

    -


    -

    Method get_filter_overview_info()

    -

    Get filter overview rows of a dataset

    -

    Usage

    -

    MAEFilteredDataset$get_filter_overview_info(
    +
    +

    +
    +
    +

    Method get_filter_overview_info() +

    +

    Get filter overview rows of a dataset

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$get_filter_overview_info(
       filtered_dataset = self$get_dataset()
    -)

    +)
    +

    +
    -

    Arguments

    -

    filtered_dataset
    +

    Arguments +

    +

    +
    +
    +
    filtered_dataset

    (MultiAssayExperiment) object to calculate filter overview statistics on.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (matrix) matrix of observations and subjects

    -


    -

    Method get_filterable_varnames()

    -

    Gets variable names for the filtering.

    -

    Usage

    -

    MAEFilteredDataset$get_filterable_varnames()

    +
    +

    +
    +
    +

    Method get_filterable_varnames() +

    +

    Gets variable names for the filtering.

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$get_filterable_varnames()
    +

    +
    -

    Returns

    +

    Returns +

    (character(0))

    -


    -

    Method set_filter_state()

    -

    Set filter state

    -

    Usage

    -

    MAEFilteredDataset$set_filter_state(state, ...)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Set filter state

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$set_filter_state(state, ...)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (named list)
    names of the list should correspond to the names of the initialized FilterStates kept in private$filter_states. For this object they are "subjects" and @@ -264,15 +381,21 @@

    Arguments -

    Returns

    +

    Returns +

    NULL

    -

    Examples

    -

    utils::data(miniACC, package = "MultiAssayExperiment")
    +

    Examples +

    +

    +
    +
    utils::data(miniACC, package = "MultiAssayExperiment")
     dataset <- teal.slice:::MAEFilteredDataset$new(miniACC, "MAE")
     fs <- list(
       subjects = list(
    @@ -285,68 +408,118 @@ 

    Examples ) ) shiny::isolate(dataset$set_filter_state(state = fs)) -shiny::isolate(dataset$get_filter_state())

    +shiny::isolate(dataset$get_filter_state())
    +

    +
    -


    -

    Method remove_filter_state()

    -

    Remove one or more FilterState of a MAEFilteredDataset

    -

    Usage

    -

    MAEFilteredDataset$remove_filter_state(state_id)

    +
    +

    +
    +
    +

    Method remove_filter_state() +

    +

    Remove one or more FilterState of a MAEFilteredDataset

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$remove_filter_state(state_id)
    +

    +
    -

    Arguments

    -

    state_id
    +

    Arguments +

    +

    +
    +
    +
    state_id

    (list)
    Named list of variables to remove their FilterState.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL

    -


    -

    Method ui_add_filter_state()

    +
    +

    +
    +
    +

    Method ui_add_filter_state() +

    UI module to add filter variable for this dataset

    -

    UI module to add filter variable for this dataset

    -

    Usage

    -

    MAEFilteredDataset$ui_add_filter_state(id)

    +

    UI module to add filter variable for this dataset

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$ui_add_filter_state(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    identifier of the element - preferably containing dataset name

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    function - shiny UI module

    -


    -

    Method srv_add_filter_state()

    +
    +

    +
    +
    +

    Method srv_add_filter_state() +

    Server module to add filter variable for this dataset

    Server module to add filter variable for this dataset. For this class srv_add_filter_state calls multiple modules of the same name from FilterStates as MAEFilteredDataset contains one FilterStates object for colData and one for each -experiment.

    -

    Usage

    -

    MAEFilteredDataset$srv_add_filter_state(id, ...)

    +experiment.

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$srv_add_filter_state(id, ...)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    an ID string that corresponds with the ID used to call the module's UI function.

    @@ -355,26 +528,43 @@

    Arguments -

    Returns

    +

    Returns +

    moduleServer function which returns NULL

    -


    -

    Method get_filter_overview_nsubjs()

    -

    Gets filter overview subjects number

    -

    Usage

    -

    MAEFilteredDataset$get_filter_overview_nsubjs(
    +
    +

    +
    +
    +

    Method get_filter_overview_nsubjs() +

    +

    Gets filter overview subjects number

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$get_filter_overview_nsubjs(
       filtered_dataset = self$get_dataset(),
       subject_keys
    -)

    +)
    +

    +
    -

    Arguments

    -

    filtered_dataset
    +

    Arguments +

    +

    +
    +
    +
    filtered_dataset

    (MultiAssayExperiment) object to calculate filter overview statistics on.

    @@ -382,27 +572,46 @@

    Arguments -

    Returns

    +

    Returns +

    list with the number of subjects of filtered/non-filtered datasets.

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    MAEFilteredDataset$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -410,7 +619,8 @@

    Arguments -

    Examples

    +

    Examples +

    
     ## ------------------------------------------------
     ## Method `MAEFilteredDataset$set_filter_state`
    @@ -475,17 +685,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.3.0/reference/MatrixFilterStates.html b/v0.3.0/reference/MatrixFilterStates.html index 146c63748..f58ebe357 100644 --- a/v0.3.0/reference/MatrixFilterStates.html +++ b/v0.3.0/reference/MatrixFilterStates.html @@ -1,8 +1,24 @@ - -FilterStates subclass for matrices — MatrixFilterStates • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,16 +106,20 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterStates -> MatrixFilterStates

    +

    Inherited methods


    -

    Method new()

    +

    +
    +
    +

    Method new() +

    +

    Initialize MatrixFilterStates object

    Initialize MatrixFilterStates object

    -

    Initialize MatrixFilterStates object

    -

    Usage

    -

    MatrixFilterStates$new(dataname, datalabel)

    +
    +

    Usage +

    +

    +
    +
    MatrixFilterStates$new(dataname, datalabel)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1))
    name of the data used in the expression specified to the function argument attached to this FilterStates.

    @@ -132,74 +175,135 @@

    Arguments
    -

    Method format()

    -

    Returns the formatted string representing this MatrixFilterStates object.

    -

    Usage

    -

    MatrixFilterStates$format(indent = 0)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns the formatted string representing this MatrixFilterStates object.

    +
    +

    Usage +

    +

    +
    +
    MatrixFilterStates$format(indent = 0)
    +

    +
    -

    Arguments

    -

    indent
    +

    Arguments +

    +

    +
    +
    +
    indent

    (numeric(1)) the number of spaces before each line of the representation

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    character(1) the formatted string

    -


    -

    Method server()

    -

    Server module

    -

    Usage

    -

    MatrixFilterStates$server(id)

    +
    +

    +
    +
    +

    Method server() +

    +

    Server module

    +
    +

    Usage +

    +

    +
    +
    MatrixFilterStates$server(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    an ID string that corresponds with the ID used to call the module's UI function.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    moduleServer function which returns NULL

    -


    +

    +
    +
    +

    Method get_filter_state() +

    Returns active FilterState objects.

    Gets all active filters from this dataset in form of the nested list. -The output list can be used as input to self$set_filter_state.

    -

    Usage

    -

    MatrixFilterStates$get_filter_state()

    +The output list can be used as input to self$set_filter_state.

    +
    +

    Usage +

    +

    +
    +
    MatrixFilterStates$get_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    list containing list with selected values for each FilterState.

    -


    -

    Method set_filter_state()

    -

    Sets a filter state

    -

    Usage

    -

    MatrixFilterStates$set_filter_state(data, state, ...)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Sets a filter state

    +
    +

    Usage +

    +

    +
    +
    MatrixFilterStates$set_filter_state(data, state, ...)
    +

    +
    -

    Arguments

    -

    data
    +

    Arguments +

    +

    +
    +
    +
    data

    (matrix)
    data which are supposed to be filtered.

    @@ -215,43 +319,77 @@

    Arguments -

    Returns

    +

    Returns +

    NULL

    -


    -

    Method remove_filter_state()

    -

    Remove a variable from the state_list and its corresponding UI element.

    -

    Usage

    -

    MatrixFilterStates$remove_filter_state(state_id)

    +
    +

    +
    +
    +

    Method remove_filter_state() +

    +

    Remove a variable from the state_list and its corresponding UI element.

    +
    +

    Usage +

    +

    +
    +
    MatrixFilterStates$remove_filter_state(state_id)
    +

    +
    -

    Arguments

    -

    state_id
    +

    Arguments +

    +

    +
    +
    +
    state_id

    (character(1))
    name of state_list element.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL

    -


    -

    Method ui_add_filter_state()

    -

    Shiny UI module to add filter variable.

    -

    Usage

    -

    MatrixFilterStates$ui_add_filter_state(id, data)

    +
    +

    +
    +
    +

    Method ui_add_filter_state() +

    +

    Shiny UI module to add filter variable.

    +
    +

    Usage +

    +

    +
    +
    MatrixFilterStates$ui_add_filter_state(id, data)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    id of shiny module

    @@ -261,26 +399,43 @@

    Arguments -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_add_filter_state()

    +
    +

    +
    +
    +

    Method srv_add_filter_state() +

    Shiny server module to add filter variable

    Module controls available choices to select as a filter variable. Selected filter variable is being removed from available choices. -Removed filter variable gets back to available choices.

    -

    Usage

    -

    MatrixFilterStates$srv_add_filter_state(id, data, ...)

    +Removed filter variable gets back to available choices.

    +
    +

    Usage +

    +

    +
    +
    MatrixFilterStates$srv_add_filter_state(id, data, ...)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    shiny module instance id

    @@ -294,27 +449,46 @@

    Arguments -

    Returns

    +

    Returns +

    moduleServer function which returns NULL

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    MatrixFilterStates$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    MatrixFilterStates$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -322,17 +496,19 @@

    Arguments

    + +
    + +
    - - + + diff --git a/v0.3.0/reference/RangeFilterState.html b/v0.3.0/reference/RangeFilterState.html index 54ebb2d2c..791c1fcd3 100644 --- a/v0.3.0/reference/RangeFilterState.html +++ b/v0.3.0/reference/RangeFilterState.html @@ -1,8 +1,24 @@ - -FilterState object for numeric variable — RangeFilterState • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,7 +106,8 @@
    -

    Value

    +

    Value +

    invisibly NULL

    @@ -91,21 +115,26 @@

    Value

    -

    Note

    +

    Note +

    Casts the passed object to numeric before validating the input making it possible to pass any object coercible to numeric to this method.

    -

    Super class

    +

    Super class +

    teal.slice::FilterState -> RangeFilterState

    +

    Inherited methods


    -

    Method new()

    -

    Initialize a FilterState object

    -

    Usage

    -

    RangeFilterState$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterState object

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$new(
       x,
       varname,
       varlabel = character(0),
       dataname = NULL,
       extract_type = character(0)
    -)

    +)
    +

    +
    -

    Arguments

    -

    -


    -

    Method format()

    -

    Returns a formatted string representing this RangeFilterState.

    -

    Usage

    -

    RangeFilterState$format(indent = 0)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns a formatted string representing this RangeFilterState.

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$format(indent = 0)
    +

    +
    -

    Arguments

    -

    indent
    +

    Arguments +

    +

    +
    +
    +
    indent

    (numeric(1)) the number of spaces before after each new line character of the formatted string. Default: 0

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    character(1) the formatted string

    -


    -

    Method is_any_filtered()

    -

    Answers the question of whether the current settings and values selected actually filters out any values.

    -

    Usage

    -

    RangeFilterState$is_any_filtered()

    +
    +

    +
    +
    +

    Method is_any_filtered() +

    +

    Answers the question of whether the current settings and values selected actually filters out any values.

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$is_any_filtered()
    +

    +
    -

    Returns

    +

    Returns +

    logical scalar

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection. For this class returned call looks like <varname> >= <min value> & <varname> <= <max value> with -optional is.na(<varname>) and is.finite(<varname>).

    -

    Usage

    -

    RangeFilterState$get_call()

    +optional is.na(<varname>) and is.finite(<varname>).

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$get_call()
    +

    +
    -

    Returns

    +

    Returns +

    (call)

    -


    -

    Method get_keep_inf()

    -

    Returns current keep_inf selection

    -

    Usage

    -

    RangeFilterState$get_keep_inf()

    +
    +

    +
    +
    +

    Method get_keep_inf() +

    +

    Returns current keep_inf selection

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$get_keep_inf()
    +

    +
    -

    Returns

    +

    Returns +

    (logical(1))

    -


    -

    Method get_state()

    -

    Returns the filtering state.

    -

    Usage

    -

    RangeFilterState$get_state()

    +
    +

    +
    +
    +

    Method get_state() +

    +

    Returns the filtering state.

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$get_state()
    +

    +
    -

    Returns

    -

    list containing values taken from the reactive fields:

    • selected (numeric(2)) range of the filter.

    • +

      Returns +

      +

      list containing values taken from the reactive fields:

      +
        +
      • selected (numeric(2)) range of the filter.

      • keep_na (logical(1)) whether NA should be kept.

      • keep_inf (logical(1)) whether Inf should be kept.

      • -
    + +
    -


    -

    Method set_keep_inf()

    -

    Set if Inf should be kept

    -

    Usage

    -

    RangeFilterState$set_keep_inf(value)

    +
    +

    +
    +
    +

    Method set_keep_inf() +

    +

    Set if Inf should be kept

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$set_keep_inf(value)
    +

    +
    -

    Arguments

    -

    value
    +

    Arguments +

    +

    +
    +
    +
    value

    (logical(1))
    Value(s) which come from the filter selection. Value is set in server modules after selecting check-box-input in the shiny interface. Values are set to private$keep_inf which is reactive.

    -

    +
    +

    +
    -


    -

    Method set_state()

    -

    Set state

    -

    Usage

    -

    RangeFilterState$set_state(state)

    +
    +

    +
    +
    +

    Method set_state() +

    +

    Set state

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$set_state(state)
    +

    +
    -

    Arguments

    -

    state
    -

    (list)
    -contains fields relevant for a specific class

    • selected defines initial selection

    • +

      Arguments +

      +

      +
      +
      +
      state
      +
      +

      (list)
      +contains fields relevant for a specific class

      +
        +
      • selected defines initial selection

      • keep_na (logical) defines whether to keep or remove NA values

      • keep_inf (logical) defines whether to keep or remove Inf values

      • -
      +
    +
    -

    +

    +

    +
    -


    -

    Method set_selected()

    -

    Sets the selected values of this RangeFilterState.

    -

    Usage

    -

    RangeFilterState$set_selected(value)

    +
    +

    +
    +
    +

    Method set_selected() +

    +

    Sets the selected values of this RangeFilterState.

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$set_selected(value)
    +

    +
    -

    Arguments

    -

    value
    +

    Arguments +

    +

    +
    +
    +
    value

    (numeric(2)) the two-elements array of the lower and upper bound of the selected range. Must not contain NA values.

    -

    +
    +

    +
    -

    Examples

    -

    filter <- teal.slice:::RangeFilterState$new(c(1, 2, 3, 4), varname = "name")
    +

    Examples +

    +

    +
    +
    filter <- teal.slice:::RangeFilterState$new(c(1, 2, 3, 4), varname = "name")
     filter$set_selected(c(2, 3))
    -

    +
    +

    +
    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    RangeFilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -331,7 +519,8 @@

    Arguments -

    Examples

    +

    Examples +

    filter_state <- teal.slice:::RangeFilterState$new(
       c(NA, Inf, seq(1:10)),
       varname = "x",
    @@ -418,17 +607,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.3.0/reference/SEFilterStates.html b/v0.3.0/reference/SEFilterStates.html index 31bc85076..db3262639 100644 --- a/v0.3.0/reference/SEFilterStates.html +++ b/v0.3.0/reference/SEFilterStates.html @@ -1,8 +1,24 @@ - -FilterStates subclass for SummarizedExperiments — SEFilterStates • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,16 +106,20 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterStates -> SEFilterStates

    +

    Inherited methods


    -

    Method new()

    +

    +
    +
    +

    Method new() +

    +

    Initialize SEFilterStates object

    Initialize SEFilterStates object

    -

    Initialize SEFilterStates object

    -

    Usage

    -

    SEFilterStates$new(dataname, datalabel)

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$new(dataname, datalabel)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1))
    name of the data used in the expression specified to the function argument attached to this FilterStates.

    @@ -132,76 +175,137 @@

    Arguments
    -

    Method format()

    -

    Returns the formatted string representing this MAEFilterStates object.

    -

    Usage

    -

    SEFilterStates$format(indent = 0)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns the formatted string representing this MAEFilterStates object.

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$format(indent = 0)
    +

    +
    -

    Arguments

    -

    indent
    +

    Arguments +

    +

    +
    +
    +
    indent

    (numeric(1)) the number of spaces before each line of the representation

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    character(1) the formatted string

    -


    -

    Method server()

    -

    Server module

    -

    Usage

    -

    SEFilterStates$server(id)

    +
    +

    +
    +
    +

    Method server() +

    +

    Server module

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$server(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    an ID string that corresponds with the ID used to call the module's UI function.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    moduleServer function which returns NULL

    -


    +

    +
    +
    +

    Method get_filter_state() +

    Gets the reactive values from the active FilterState objects.

    Gets all active filters from this dataset in form of the nested list. -The output list is a compatible input to self$set_filter_state.

    -

    Usage

    -

    SEFilterStates$get_filter_state()

    +The output list is a compatible input to self$set_filter_state.

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$get_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    list containing one or two lists depending on the number of state_list object (I.e. if rowData and colData exist). Each list contains elements number equal to number of active filter variables.

    -


    -

    Method set_filter_state()

    -

    Set filter state

    -

    Usage

    -

    SEFilterStates$set_filter_state(data, state, ...)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Set filter state

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$set_filter_state(data, state, ...)
    +

    +
    -

    Arguments

    -

    data
    +

    Arguments +

    +

    +
    +
    +
    data

    (SummarizedExperiment)
    data which are supposed to be filtered.

    @@ -218,43 +322,77 @@

    Arguments -

    Returns

    +

    Returns +

    NULL

    -


    -

    Method remove_filter_state()

    -

    Remove a variable from the state_list and its corresponding UI element.

    -

    Usage

    -

    SEFilterStates$remove_filter_state(state_id)

    +
    +

    +
    +
    +

    Method remove_filter_state() +

    +

    Remove a variable from the state_list and its corresponding UI element.

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$remove_filter_state(state_id)
    +

    +
    -

    Arguments

    -

    state_id
    +

    Arguments +

    +

    +
    +
    +
    state_id

    (character(1))
    name of state_list element.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL

    -


    -

    Method ui_add_filter_state()

    -

    Shiny UI module to add filter variable

    -

    Usage

    -

    SEFilterStates$ui_add_filter_state(id, data)

    +
    +

    +
    +
    +

    Method ui_add_filter_state() +

    +

    Shiny UI module to add filter variable

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$ui_add_filter_state(id, data)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    id of shiny module

    @@ -266,29 +404,46 @@

    Arguments -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_add_filter_state()

    +
    +

    +
    +
    +

    Method srv_add_filter_state() +

    Shiny server module to add filter variable

    Module controls available choices to select as a filter variable. Selected filter variable is being removed from available choices. Removed filter variable gets back to available choices. This module unlike other FilterStates classes manages two sets of filter variables - one for colData and another for -rowData.

    -

    Usage

    -

    SEFilterStates$srv_add_filter_state(id, data, ...)

    +rowData.

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$srv_add_filter_state(id, data, ...)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    an ID string that corresponds with the ID used to call the module's UI function.

    @@ -304,27 +459,46 @@

    Arguments -

    Returns

    +

    Returns +

    moduleServer function which returns NULL

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    SEFilterStates$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -332,17 +506,19 @@

    Arguments

    + +
    + +
    - - + + diff --git a/v0.3.0/reference/calls_combine_by.html b/v0.3.0/reference/calls_combine_by.html index b97367546..ee82c3551 100644 --- a/v0.3.0/reference/calls_combine_by.html +++ b/v0.3.0/reference/calls_combine_by.html @@ -1,8 +1,24 @@ - -Combine calls by operator — calls_combine_by • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -82,13 +104,16 @@
    -

    Usage

    +

    Usage +

    calls_combine_by(calls, operator)
    -

    Arguments

    -
    calls
    +

    Arguments +

    +
    +
    calls

    (list of calls)
    list containing calls to be combined by operator; if empty, NULL is returned

    @@ -98,9 +123,11 @@

    Arguments -

    Value

    +

    Value +

    call or NULL, if calls is an empty list

    @@ -112,7 +139,8 @@

    Value

    -

    Examples

    +

    Examples +

    if (FALSE) {
     calls <- list(
       quote(SEX == "F"), # subsetting on factor
    @@ -124,17 +152,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.3.0/reference/check_ellipsis.html b/v0.3.0/reference/check_ellipsis.html index a2c0e122a..b397fb74f 100644 --- a/v0.3.0/reference/check_ellipsis.html +++ b/v0.3.0/reference/check_ellipsis.html @@ -1,12 +1,28 @@ - - + + + + + +Ensure the ellipsis, ..., in method arguments are empty — check_ellipsis • teal.slice +Ensure the ellipsis, ..., in method arguments are empty — check_ellipsis • teal.slice + + + + + + + + + + Skip to contents @@ -22,7 +38,8 @@ + +
    @@ -88,13 +110,16 @@
    -

    Usage

    +

    Usage +

    check_ellipsis(..., stop = FALSE, allowed_args = character(0))
    -

    Arguments

    -
    ...
    +

    Arguments +

    +
    +
    ...

    it should literally just be ...

    @@ -106,16 +131,19 @@

    Arguments -

    +

    +
    -

    Value

    +

    Value +

    NULL if ... is empty

    -

    Examples

    +

    Examples +

    method.class <- function(a, b, c, ...) {
       check_ellipsis(...)
     }
    @@ -125,17 +153,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.3.0/reference/check_in_range.html b/v0.3.0/reference/check_in_range.html index 7c83c52ec..47dc6f220 100644 --- a/v0.3.0/reference/check_in_range.html +++ b/v0.3.0/reference/check_in_range.html @@ -1,8 +1,24 @@ - -Check that a given range is valid — check_in_range • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -82,13 +104,16 @@
    -

    Usage

    +

    Usage +

    check_in_range(subinterval, range, pre_msg = "")
    -

    Arguments

    -
    subinterval
    +

    Arguments +

    +
    +
    subinterval

    (numeric or date)
    vector of length 2 to be compared against the full range.

    @@ -99,16 +124,19 @@

    Arguments -

    Value

    +

    Value +

    NULL if subinterval is a valid range or error with message otherwise.

    -

    Examples

    +

    Examples +

    if (FALSE) {
     check_in_range(c(3, 1), c(1, 3))
     check_in_range(c(0, 3), c(1, 3))
    @@ -120,17 +148,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.3.0/reference/check_in_subset.html b/v0.3.0/reference/check_in_subset.html index 3fa53f346..20e6f2c19 100644 --- a/v0.3.0/reference/check_in_subset.html +++ b/v0.3.0/reference/check_in_subset.html @@ -1,8 +1,24 @@ - -Check that one set is a subset of another — check_in_subset • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -82,13 +104,16 @@
    -

    Usage

    +

    Usage +

    check_in_subset(subset, choices, pre_msg = "")
    -

    Arguments

    -
    subset
    +

    Arguments +

    +
    +
    subset

    collection-like should be a subset of the second argument choices

    @@ -99,24 +124,28 @@

    Arguments -

    Examples

    +

    Examples +

    + +
    + +
    - - + + diff --git a/v0.3.0/reference/check_simple_name.html b/v0.3.0/reference/check_simple_name.html index c20a227bd..ed1a8242d 100644 --- a/v0.3.0/reference/check_simple_name.html +++ b/v0.3.0/reference/check_simple_name.html @@ -1,14 +1,30 @@ - - + + + + + +Whether the variable name is good to use within Show R Code — check_simple_name • teal.slice +Whether the variable name is good to use within Show R Code — check_simple_name • teal.slice + + + + + + + + + + Skip to contents @@ -24,7 +40,8 @@ + +
    @@ -91,19 +113,24 @@
    -

    Usage

    +

    Usage +

    check_simple_name(name)
    -

    Arguments

    -
    name
    +

    Arguments +

    +
    +
    name

    character, single or vector name to check

    -
    +

    +
    -

    Examples

    +

    Examples +

    teal.slice:::check_simple_name("aas2df")
     teal.slice:::check_simple_name("ADSL")
     teal.slice:::check_simple_name("ADSLmodified")
    @@ -119,17 +146,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.3.0/reference/choices_labeled.html b/v0.3.0/reference/choices_labeled.html index e048a7b02..4289e075a 100644 --- a/v0.3.0/reference/choices_labeled.html +++ b/v0.3.0/reference/choices_labeled.html @@ -1,10 +1,26 @@ - -Set "<choice>:<label>" type of Names — choices_labeled • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + +
    @@ -85,13 +107,16 @@
    -

    Usage

    +

    Usage +

    choices_labeled(choices, labels, subset = NULL, types = NULL)
    -

    Arguments

    -
    choices
    +

    Arguments +

    +
    +
    choices

    a character / numeric / logical vector

    @@ -109,31 +134,36 @@

    Arguments -

    Value

    +

    Value +

    a named character vector

    -

    Details

    +

    Details +

    If either choices or labels are factors, they are coerced to character. Duplicated elements from choices get removed.

    + +
    + +
    - - + + diff --git a/v0.3.0/reference/contain_interval.html b/v0.3.0/reference/contain_interval.html index d991e32c0..a9ad246f5 100644 --- a/v0.3.0/reference/contain_interval.html +++ b/v0.3.0/reference/contain_interval.html @@ -1,10 +1,26 @@ - -Find containing limits for interval. — contain_interval • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + +
    @@ -85,28 +107,34 @@
    -

    Usage

    +

    Usage +

    contain_interval(x, range)
    -

    Arguments

    -
    x
    +

    Arguments +

    +
    +
    x

    numeric(2) interval to contain

    range

    numeric(>=2) vector of values to contain x in

    -
    +

    +
    -

    Value

    +

    Value +

    Numeric vector of length 2 that lies within range.

    -

    Details

    +

    Details +

    This is a helper function for RangeFilterState that modifies slider selection so that the subsetting call includes the value specified by the filter API call.

    Regardless of the underlying numeric data, the slider always presents 100 steps. @@ -119,7 +147,8 @@

    Details
    -

    Examples

    +

    Examples +

    if (FALSE) {
     ticks <- 1:10
     values1 <- c(3, 5)
    @@ -132,17 +161,19 @@ 

    Examples

    + +

    + +
    - - + + diff --git a/v0.3.0/reference/data_choices_labeled.html b/v0.3.0/reference/data_choices_labeled.html index a8ed9b0ee..4d1006ff5 100644 --- a/v0.3.0/reference/data_choices_labeled.html +++ b/v0.3.0/reference/data_choices_labeled.html @@ -1,8 +1,24 @@ - -Returns a choices_labeled object — data_choices_labeled • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -82,7 +104,8 @@
    -

    Usage

    +

    Usage +

    data_choices_labeled(
       data,
       choices,
    @@ -92,8 +115,10 @@ 

    Usage

    -

    Arguments

    -
    data
    +

    Arguments +

    +
    +
    data

    (data.frame, DFrame, list)
    where labels can be taken from in case when varlabels is not specified. data must be specified if varlabels is not specified.

    @@ -113,26 +138,30 @@

    Arguments -

    Value

    +

    Value +

    character(0) if choices are empty; a choices_labeled object otherwise

    + +
    + +
    - - + + diff --git a/v0.3.0/reference/eval_expr_with_msg.html b/v0.3.0/reference/eval_expr_with_msg.html index d3ea5cc21..b2f24173c 100644 --- a/v0.3.0/reference/eval_expr_with_msg.html +++ b/v0.3.0/reference/eval_expr_with_msg.html @@ -1,12 +1,28 @@ - - + + + + + +Evaluate expression with meaningful message — eval_expr_with_msg • teal.slice +Evaluate expression with meaningful message — eval_expr_with_msg • teal.slice + + + + + + + + + + Skip to contents @@ -22,7 +38,8 @@ + +
    @@ -88,39 +110,46 @@
    -

    Usage

    +

    Usage +

    eval_expr_with_msg(expr, env)
    -

    Arguments

    -
    expr
    +

    Arguments +

    +
    +
    expr

    (language)

    env

    (environment) where expression is evaluated.

    -
    +

    +
    -

    Value

    +

    Value +

    invisible NULL.

    + +
    + +
    - - + + diff --git a/v0.3.0/reference/filter_state_api.html b/v0.3.0/reference/filter_state_api.html index 6085db519..d2afb122b 100644 --- a/v0.3.0/reference/filter_state_api.html +++ b/v0.3.0/reference/filter_state_api.html @@ -1,10 +1,26 @@ - -Managing FilteredData states — filter_state_api • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + +
    @@ -85,7 +107,8 @@
    -

    Usage

    +

    Usage +

    set_filter_state(datasets, filter)
     
     get_filter_state(datasets)
    @@ -96,35 +119,56 @@ 

    Usage

    -

    Arguments

    -
    datasets
    +

    Arguments +

    +
    +
    datasets

    (FilteredData)
    object to store filter state and filtered datasets, shared across modules. For more details see FilteredData

    filter
    -

    (list)
    +

    +

    (list)
    You can define filters that show when the app starts. List names should be named according to datanames passed to the data argument. In case of data.frame` the list should be composed as follows:

    -

    list(<dataname1> = list(<varname1> = ..., <varname2> = ...),
    +

    +
    +
    list(<dataname1> = list(<varname1> = ..., <varname2> = ...),
          <dataname2> = list(...),
          ...)
    -

    +
    +

    +

    For example, filters for variable Sepal.Length in iris can be specified as follows:

    -

    list(iris = list(Sepal.Length = list(selected = c(5.0, 7.0))))
    +

    +
    +
    list(iris = list(Sepal.Length = list(selected = c(5.0, 7.0))))
     # or
    -list(iris = list(Sepal.Length = c(5.0, 7.0)))

    +list(iris = list(Sepal.Length = c(5.0, 7.0)))
    +

    +

    In case developer would like to include NA and Inf values in the filtered dataset.

    -

    list(Species = list(selected = c(5.0, 7.0), keep_na = TRUE, keep_inf = TRUE))
    -list(Species = c(c(5.0, 7.0), NA, Inf))

    +

    +
    +
    list(Species = list(selected = c(5.0, 7.0), keep_na = TRUE, keep_inf = TRUE))
    +list(Species = c(c(5.0, 7.0), NA, Inf))
    +

    +

    To initialize with specific variable filter with all values on start, one can use

    -

    list(Species = list())

    -

    filter should be set with respect to the class of the column:

    • numeric: selected should be a two elements vector defining the range +

      +
      +
      list(Species = list())
      +

      +
      +

      filter should be set with respect to the class of the column:

      +
        +
      • numeric: selected should be a two elements vector defining the range of the filter.

      • Date: selected should be a two elements vector defining the date-range of the filter

      • @@ -138,7 +182,10 @@

        ArgumentsMultiAssayExperiment::ExperimentList()), filter list should be named in the following name.

        -

      list(
      +
    +

    +
    +
    list(
       <MAE dataname> = list(
         subjects = list(<column in colData> = ..., <column in colData> = ...),
         <experiment name> = list(
    @@ -148,20 +195,28 @@ 

    Arguments <column in colData of experiment> = ...) ) ) -)

    -

    filter is ignored if the app is restored from a bookmarked state.

    +) +

    +
    +

    filter is ignored if the app is restored from a bookmarked state.

    + -
    + +
    -

    Value

    +

    Value +

    -
    • set, remove and clear returns NULL

    • +
        +
      • set, remove and clear returns NULL

      • get returns named list of the same structure as described in filter argument.

      • -
    + +
    -

    Examples

    +

    Examples +

    utils::data(miniACC, package = "MultiAssayExperiment")
     
     datasets <- init_filtered_data(
    @@ -283,17 +338,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.3.0/reference/get_filter_expr.html b/v0.3.0/reference/get_filter_expr.html index 06cddad1f..062b18008 100644 --- a/v0.3.0/reference/get_filter_expr.html +++ b/v0.3.0/reference/get_filter_expr.html @@ -1,10 +1,26 @@ - -Gets filter expression for multiple datanames taking into account its order. — get_filter_expr • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + @@ -85,39 +107,46 @@
    -

    Usage

    +

    Usage +

    get_filter_expr(datasets, datanames = datasets$datanames())
    -

    Arguments

    -
    datasets
    +

    Arguments +

    +
    +
    datasets

    (FilteredData)

    datanames

    (character) vector of dataset names

    -
    + +
    -

    Value

    +

    Value +

    (expression)

    + + + + - - + + diff --git a/v0.3.0/reference/get_supported_filter_varnames.html b/v0.3.0/reference/get_supported_filter_varnames.html index 4fbc8766c..3cf0330d6 100644 --- a/v0.3.0/reference/get_supported_filter_varnames.html +++ b/v0.3.0/reference/get_supported_filter_varnames.html @@ -1,10 +1,26 @@ - -Gets supported filterable variable names — get_supported_filter_varnames • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + @@ -85,26 +107,32 @@
    -

    Usage

    +

    Usage +

    get_supported_filter_varnames(data)
    -

    Arguments

    -
    data
    +

    Arguments +

    +
    +
    data

    (object)
    the R object containing elements which class can be checked through vapply or apply.

    -
    + +
    -

    Value

    +

    Value +

    character the array of the matched element names

    -

    Examples

    +

    Examples +

    df <- data.frame(
       a = letters[1:3],
       b = 1:3,
    @@ -117,17 +145,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/v0.3.0/reference/get_teal_bs_theme.html b/v0.3.0/reference/get_teal_bs_theme.html index a81a1cdfd..abb03d470 100644 --- a/v0.3.0/reference/get_teal_bs_theme.html +++ b/v0.3.0/reference/get_teal_bs_theme.html @@ -1,8 +1,24 @@ - -Resolve the expected bootstrap theme — get_teal_bs_theme • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -82,22 +104,25 @@
    -

    Usage

    +

    Usage +

    get_teal_bs_theme()
    - + + + + - - + + diff --git a/v0.3.0/reference/include_css_files.html b/v0.3.0/reference/include_css_files.html index 101623232..84ff27f57 100644 --- a/v0.3.0/reference/include_css_files.html +++ b/v0.3.0/reference/include_css_files.html @@ -1,12 +1,28 @@ - - + + + + + +Include CSS files from /inst/css/ package directory to application header — include_css_files • teal.slice +Include CSS files from /inst/css/ package directory to application header — include_css_files • teal.slice + + + + + + + + + + Skip to contents @@ -22,7 +38,8 @@ + + @@ -88,35 +110,42 @@
    -

    Usage

    +

    Usage +

    include_css_files(pattern = "*")
    -

    Arguments

    -
    pattern
    +

    Arguments +

    +
    +
    pattern

    (character) pattern of files to be included

    -
    + +
    -

    Value

    +

    Value +

    HTML code that includes CSS files

    + + + + - - + + diff --git a/v0.3.0/reference/index.html b/v0.3.0/reference/index.html index 62cc98823..97afd178f 100644 --- a/v0.3.0/reference/index.html +++ b/v0.3.0/reference/index.html @@ -1,8 +1,22 @@ - -Function reference • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -76,112 +96,153 @@
    -

    Teal filter-panel API

    +

    Teal filter-panel API +

    -

    Functions used initialize filter-panel and to modify its states.

    +

    +

    Functions used initialize filter-panel and to modify its states.

    -
    +
    +
    -
    +
    +
    init_filtered_data()
    -
    Initialize FilteredData
    -
    +
    Initialize FilteredData +
    +
    +
    +
    set_filter_state() get_filter_state() remove_filter_state() clear_filter_states()
    Managing FilteredData states
    -
    -

    Helpers

    + +
    +
    +

    Helpers +

    -

    Other useful functions for users and developers.

    +

    +

    Other useful functions for users and developers.

    -
    +
    +
    -
    +
    +
    choices_labeled()
    Set "<choice>:<label>" type of Names
    -
    +
    +
    +
    get_filter_expr()
    Gets filter expression for multiple datanames taking into account its order.
    -
    +
    +
    +
    toggle_icon() toggle_title()
    Toggle button properties.
    -
    -

    For Developers

    + +
    +
    +

    For Developers +

    -

    Abstract and concrete classes used to build teal functionality.

    +

    +

    Abstract and concrete classes used to build teal functionality.

    -
    +
    +
    -

    R6 Classes

    -

    Abstract and concrete classes used to build teal functionality.

    +

    R6 Classes +

    +

    +

    Abstract and concrete classes used to build teal functionality.

    -
    +
    +
    -
    +
    +
    CDISCFilteredData
    Class to encapsulate relational filtered datasets with its parents.
    -
    +
    +
    +
    DefaultFilteredDataset
    The DefaultFilteredDataset R6 class
    -
    +
    +
    +
    FilteredData
    Class to encapsulate filtered datasets
    -
    +
    +
    +
    FilteredDataset
    -
    FilterStates R6 class
    -
    +
    +FilterStates R6 class
    +
    +
    +
    FilterPanelAPI
    Class to encapsulate the API of the filter panel of a teal app
    -
    +
    +
    +
    MAEFilteredDataset
    -
    MAEFilteredDataset R6 class
    -
    +
    +MAEFilteredDataset R6 class
    + + + + + + - - + + diff --git a/v0.3.0/reference/init_filter_state.html b/v0.3.0/reference/init_filter_state.html index 4163a3900..10770b0b3 100644 --- a/v0.3.0/reference/init_filter_state.html +++ b/v0.3.0/reference/init_filter_state.html @@ -1,8 +1,24 @@ - -Initializes FilterState — init_filter_state • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -82,7 +105,8 @@
    -

    Usage

    +

    Usage +

    init_filter_state(
       x,
       varname,
    @@ -93,8 +117,10 @@ 

    Usage

    + +
    -

    Value

    +

    Value +

    FilterState object

    -

    Examples

    +

    Examples +

    filter_state <- teal.slice:::RangeFilterState$new(
       c(1:10, NA, Inf),
       varname = "x",
    @@ -164,17 +197,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/v0.3.0/reference/init_filter_states.html b/v0.3.0/reference/init_filter_states.html index c687cdf73..3e2659336 100644 --- a/v0.3.0/reference/init_filter_states.html +++ b/v0.3.0/reference/init_filter_states.html @@ -1,8 +1,24 @@ - -Initialize FilterStates object — init_filter_states • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -82,13 +104,16 @@
    -

    Usage

    +

    Usage +

    init_filter_states(data, dataname, datalabel = character(0), ...)
    -

    Arguments

    -
    data
    +

    Arguments +

    +
    +
    data

    (data.frame, MultiAssayExperiment, SummarizedExperiment, matrix)
    the R object which subset function is applied on.

    @@ -108,10 +133,12 @@

    Arguments -

    Examples

    +

    Examples +

    df <- data.frame(
       character = letters,
       numeric = seq_along(letters),
    @@ -146,17 +173,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/v0.3.0/reference/init_filtered_data.html b/v0.3.0/reference/init_filtered_data.html index f57e0be9a..67d5fea57 100644 --- a/v0.3.0/reference/init_filtered_data.html +++ b/v0.3.0/reference/init_filtered_data.html @@ -1,8 +1,24 @@ - -Initialize FilteredData — init_filtered_data • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -82,20 +105,27 @@
    -

    Usage

    +

    Usage +

    init_filtered_data(x, join_keys, code, cdisc, check)
    -

    Arguments

    -
    x
    -

    (named list or TealData) In case of TealData see teal.data::teal_data(). -If the list is provided, it should contain list(s) containing following fields:

    • dataset data object object supported by FilteredDataset.

    • +

      Arguments +

      +
      +
      x
      +
      +

      (named list or TealData) In case of TealData see teal.data::teal_data(). +If the list is provided, it should contain list(s) containing following fields:

      +
        +
      • dataset data object object supported by FilteredDataset.

      • metatada (optional) additional metadata attached to the dataset.

      • keys (optional) primary keys.

      • datalabel (optional) label describing the dataset.

      • parent (optional) which dataset is a parent of this one.

      • -
      +
    +
    join_keys
    @@ -113,10 +143,12 @@

    Arguments -

    Examples

    +

    Examples +

    library(shiny)
     datasets <- teal.slice::init_filtered_data(
       x = list(
    @@ -127,17 +159,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/v0.3.0/reference/init_filtered_dataset.html b/v0.3.0/reference/init_filtered_dataset.html index d29b10405..8ce7981ee 100644 --- a/v0.3.0/reference/init_filtered_dataset.html +++ b/v0.3.0/reference/init_filtered_dataset.html @@ -1,8 +1,24 @@ - -Initializes FilteredDataset — init_filtered_dataset • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -82,7 +105,8 @@
    -

    Usage

    +

    Usage +

    init_filtered_dataset(
       dataset,
       dataname,
    @@ -93,8 +117,10 @@ 

    Usage

    -

    Arguments

    -
    dataset
    +

    Arguments +

    +
    +
    dataset

    (data.frame or MultiAssayExperiment)

    @@ -118,15 +144,18 @@

    Arguments -

    Note

    +

    Note +

    Although this function is exported for use in other packages, it may be changed or removed in a future release at which point any code which relies on this exported function will need to be changed.

    -

    Examples

    +

    Examples +

    # DefaultFilteredDataset example
     iris_fd <- teal.slice:::init_filtered_dataset(
       iris,
    @@ -189,17 +218,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.3.0/reference/resolve_state.html b/v0.3.0/reference/resolve_state.html index 700e7cf04..3c3ff8048 100644 --- a/v0.3.0/reference/resolve_state.html +++ b/v0.3.0/reference/resolve_state.html @@ -1,14 +1,30 @@ - - + + + + + +Resolve list of filter states — resolve_state • teal.slice +Resolve list of filter states — resolve_state • teal.slice + + + + + + + + + + Skip to contents @@ -24,7 +40,8 @@ + + @@ -91,7 +113,8 @@
    -

    Usage

    +

    Usage +

    resolve_state(x)
     
     # S3 method for default
    @@ -105,19 +128,28 @@ 

    Usage

    -

    Arguments

    -
    x
    -

    (list,vector)
    +

    Arguments +

    +
    +
    x
    +
    +

    (list,vector)
    values of the variable used in filter. Depending on the FilterState type -list must contain these fields:

    • selected defines initial selection. See notes for more details

    • +list must contain these fields:

      +
        +
      • selected defines initial selection. See notes for more details

      • keep_na (logical) defines whether to keep or remove NA values

      • keep_inf (logical) defines whether to keep or remove Inf values

      • -

      If vector is provided then keep_na and keep_inf can be specified -adding NA and Inf to the selection vector.

    + +

    If vector is provided then keep_na and keep_inf can be specified +adding NA and Inf to the selection vector.

    +
    -
    + +
    -

    Value

    +

    Value +

    list containing selected, keep_na and keep_inf

    @@ -125,23 +157,28 @@

    Value

    -

    Note

    +

    Note +

    The value of the x$selected needs to be modified according to the type of the passed filter_state.

    -

    Examples

    +

    Examples +

    teal.slice:::resolve_state(list(c(1, 2), keep_na = FALSE, keep_inf = TRUE))
     #> $selected
     #> [1] 1 2
    @@ -164,17 +201,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/v0.3.0/reference/teal.slice-package.html b/v0.3.0/reference/teal.slice-package.html index cab6c4d7c..03e1c7133 100644 --- a/v0.3.0/reference/teal.slice-package.html +++ b/v0.3.0/reference/teal.slice-package.html @@ -1,8 +1,24 @@ - -teal.slice: Interactive Exploration of Clinical Trials Data — teal.slice-package • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -83,28 +105,37 @@
    -

    Author

    +

    Author +

    Maintainer: Dawid Kaledkowski dawid.kaledkowski@roche.com

    -

    Authors:

    + +

    Other contributors:

    +
      +
    • F. Hoffmann-La Roche AG [copyright holder, funder]

    • +
    + - + + + + - - + + diff --git a/v0.3.0/reference/toggle_button.html b/v0.3.0/reference/toggle_button.html index 8c031556d..e848d17d3 100644 --- a/v0.3.0/reference/toggle_button.html +++ b/v0.3.0/reference/toggle_button.html @@ -1,8 +1,24 @@ - -Toggle button properties. — toggle_button • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -82,15 +104,18 @@
    -

    Usage

    +

    Usage +

    toggle_icon(input_id, icons, one_way = FALSE)
     
     toggle_title(input_id, titles, one_way = FALSE)
    -

    Arguments

    -
    input_id
    +

    Arguments +

    +
    +
    input_id

    character(1) (namespaced) id of the button

    @@ -103,15 +128,18 @@

    Arguments -

    Value

    +

    Value +

    Invisible NULL.

    -

    Details

    +

    Details +

    Wrapper functions that use shinyjs::runjs to change button properties in response to events, typically clicking those very buttons. shiny's actionButton and actionLink create <a> tags, @@ -122,7 +150,8 @@

    Details
    -

    Examples

    +

    Examples +

    if (FALSE) {
     
     # continuously switch between right- and down-pointing chevrons
    @@ -176,17 +205,19 @@ 

    Examples

    + +

    + + - - + + diff --git a/v0.3.0/reference/topological_sort.html b/v0.3.0/reference/topological_sort.html index 968b1f44f..4cd0b47dc 100644 --- a/v0.3.0/reference/topological_sort.html +++ b/v0.3.0/reference/topological_sort.html @@ -1,10 +1,26 @@ - -Topological graph sort — topological_sort • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + @@ -85,23 +107,29 @@
    -

    Usage

    +

    Usage +

    topological_sort(graph)
    -

    Arguments

    -
    graph
    +

    Arguments +

    +
    +
    graph

    (named list) list with node vector elements

    -
    + +
    -

    Details

    +

    Details +

    Implementation of Kahn algorithm with a modification to maintain the order of input elements.

    -

    Examples

    +

    Examples +

    if (FALSE) {
     topological_sort(list(A = c(), B = c("A"), C = c("B"), D = c("A")))
     topological_sort(list(D = c("A"), A = c(), B = c("A"), C = c("B")))
    @@ -110,17 +138,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/v0.3.0/reference/validate_dataset_args.html b/v0.3.0/reference/validate_dataset_args.html index 261291821..d402f99df 100644 --- a/v0.3.0/reference/validate_dataset_args.html +++ b/v0.3.0/reference/validate_dataset_args.html @@ -1,8 +1,24 @@ - -Validate dataset arguments — validate_dataset_args • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -82,13 +104,16 @@
    -

    Usage

    +

    Usage +

    validate_dataset_args(dataset_args, dataname, allowed_parent = FALSE)
    -

    Arguments

    -
    dataset_args
    +

    Arguments +

    +
    +
    dataset_args

    (list)
    containing the arguments except (dataname) needed by init_filtered_dataset

    @@ -103,26 +128,30 @@

    Arguments -

    Value

    +

    Value +

    (NULL or throws an error)

    + + + + - - + + diff --git a/v0.3.0/reference/variable_types.html b/v0.3.0/reference/variable_types.html index 78ab3bf82..7d87c1a33 100644 --- a/v0.3.0/reference/variable_types.html +++ b/v0.3.0/reference/variable_types.html @@ -1,8 +1,24 @@ - -Get classes of selected columns from dataset — variable_types • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -82,13 +104,16 @@
    -

    Usage

    +

    Usage +

    variable_types(data, columns = NULL)
    -

    Arguments

    -
    data
    +

    Arguments +

    +
    +
    data

    (data.frame) data to determine variable types from

    @@ -96,9 +121,11 @@

    Arguments -

    Value

    +

    Value +

    (atomic vector of character) classes of columns from provided data

    @@ -107,7 +134,8 @@

    Value

    -

    Examples

    +

    Examples +

    teal.slice:::variable_types(
       data.frame(
         x = 1:3, y = factor(c("a", "b", "a")), z = c("h1", "h2", "h3"),
    @@ -136,17 +164,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/v0.4.0/404.html b/v0.4.0/404.html index 931987325..12e3c5dd3 100644 --- a/v0.4.0/404.html +++ b/v0.4.0/404.html @@ -1,5 +1,4 @@ - - + @@ -50,22 +49,7 @@ - - + - + + diff --git a/v0.4.0/CODE_OF_CONDUCT.html b/v0.4.0/CODE_OF_CONDUCT.html index aef4a7f8d..e559ec2a1 100644 --- a/v0.4.0/CODE_OF_CONDUCT.html +++ b/v0.4.0/CODE_OF_CONDUCT.html @@ -1,8 +1,22 @@ - -Contributor Covenant Code of Conduct • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -80,65 +100,80 @@
    -

    Our Pledge

    +

    Our Pledge +

    We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.

    We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.

    -

    Our Standards

    +

    Our Standards +

    Examples of behavior that contributes to a positive environment for our community include:

    -
    • Demonstrating empathy and kindness toward other people
    • +
        +
      • Demonstrating empathy and kindness toward other people
      • Being respectful of differing opinions, viewpoints, and experiences
      • Giving and gracefully accepting constructive feedback
      • Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
      • Focusing on what is best not just for us as individuals, but for the overall community
      • -

      Examples of unacceptable behavior include:

      -
      • The use of sexualized language or imagery, and sexual attention or advances of any kind
      • +
      +

      Examples of unacceptable behavior include:

      +
        +
      • The use of sexualized language or imagery, and sexual attention or advances of any kind
      • Trolling, insulting or derogatory comments, and personal or political attacks
      • Public or private harassment
      • Publishing others’ private information, such as a physical or email address, without their explicit permission
      • Other conduct which could reasonably be considered inappropriate in a professional setting
      • -
    + +
    -

    Enforcement Responsibilities

    +

    Enforcement Responsibilities +

    Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.

    Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.

    -

    Scope

    +

    Scope +

    This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.

    -

    Enforcement

    +

    Enforcement +

    Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [INSERT CONTACT METHOD]. All complaints will be reviewed and investigated promptly and fairly.

    All community leaders are obligated to respect the privacy and security of the reporter of any incident.

    -

    Enforcement Guidelines

    +

    Enforcement Guidelines +

    Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:

    -

    1. Correction

    +

    1. Correction +

    Community Impact: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.

    Consequence: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.

    -

    2. Warning

    +

    2. Warning +

    Community Impact: A violation through a single incident or series of actions.

    Consequence: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.

    -

    3. Temporary Ban

    +

    3. Temporary Ban +

    Community Impact: A serious violation of community standards, including sustained inappropriate behavior.

    Consequence: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.

    -

    4. Permanent Ban

    +

    4. Permanent Ban +

    Community Impact: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.

    Consequence: A permanent ban from any sort of public interaction within the community.

    -

    Attribution

    +

    Attribution +

    This Code of Conduct is adapted from the Contributor Covenant, version 2.1, available at https://www.contributor-covenant.org/version/2/1/code_of_conduct.html.

    Community Impact Guidelines were inspired by Mozilla’s code of conduct enforcement ladder.

    For answers to common questions about this code of conduct, see the FAQ at https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.

    @@ -146,17 +181,19 @@

    Attribution

    + + + + - - + + diff --git a/v0.4.0/CONTRIBUTING.html b/v0.4.0/CONTRIBUTING.html index 1ce50613c..dbf9aaf48 100644 --- a/v0.4.0/CONTRIBUTING.html +++ b/v0.4.0/CONTRIBUTING.html @@ -1,8 +1,22 @@ - -Contribution Guidelines • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -82,7 +102,8 @@

    🙏 Thank you for taking the time to contribute!

    Your input is deeply valued, whether an issue, a pull request, or even feedback, regardless of size, content or scope.

    -

    Table of contents

    +

    Table of contents +

    👶 Getting started

    📔 Code of Conduct

    🗃 License

    @@ -93,38 +114,47 @@

    Table of contents❓ Questions

    -

    Getting started

    +

    Getting started +

    Please refer the project documentation for a brief introduction. Please also see other articles within the project documentation for additional information.

    -

    Code of Conduct

    +

    Code of Conduct +

    A Code of Conduct governs this project. Participants and contributors are expected to follow the rules outlined therein.

    -

    License

    +

    License +

    All your contributions will be covered by this project’s license.

    -

    Issues

    +

    Issues +

    We use GitHub to track issues, feature requests, and bugs. Before submitting a new issue, please check if the issue has already been reported. If the issue already exists, please upvote the existing issue 👍.

    For new feature requests, please elaborate on the context and the benefit the feature will have for users, developers, or other relevant personas.

    -

    Pull requests

    +

    Pull requests +

    -

    GitHub Flow

    +

    GitHub Flow +

    This repository uses the GitHub Flow model for collaboration. To submit a pull request:

    -
    1. +
        +
      1. Create a branch

        Please see the branch naming convention below. If you don’t have write access to this repository, please fork it.

      2. Make changes

        Make sure your code

        -
        • passes all checks imposed by GitHub Actions
        • +
            +
          • passes all checks imposed by GitHub Actions
          • is well documented
          • is well tested with unit tests sufficiently covering the changes introduced
          • -
          +
        +
      3. Create a pull request (PR)

        In the pull request description, please link the relevant issue (if any), provide a detailed description of the change, and include any assumptions.

        @@ -138,76 +168,93 @@

        GitHub Flow -

        Branch naming convention

        +

        Branch naming convention +

        Suppose your changes are related to a current issue in the current project; please name your branch as follows: <issue_id>_<short_description>. Please use underscore (_) as a delimiter for word separation. For example, 420_fix_ui_bug would be a suitable branch name if your change is resolving and UI-related bug reported in issue number 420 in the current project.

        If your change affects multiple repositories, please name your branches as follows: <issue_id>_<issue_repo>_<short description>. For example, 69_awesomeproject_fix_spelling_error would reference issue 69 reported in project awesomeproject and aims to resolve one or more spelling errors in multiple (likely related) repositories.

    monorepo and staged.dependencies -

    + +

    Sometimes you might need to change upstream dependent package(s) to be able to submit a meaningful change. We are using staged.dependencies functionality to simulate a monorepo behavior. The dependency configuration is already specified in this project’s staged_dependencies.yaml file. You need to name the feature branches appropriately. This is the only exception from the branch naming convention described above.

    Please refer to the staged.dependencies package documentation for more details.

    -

    Coding guidelines

    +

    Coding guidelines +

    This repository follows some unified processes and standards adopted by its maintainers to ensure software development is carried out consistently within teams and cohesively across other repositories.

    -

    Style guide

    +

    Style guide +

    This repository follows the standard tidyverse style guide and uses lintr for lint checks. Customized lint configurations are available in this repository’s .lintr file.

    -

    Dependency management

    +

    Dependency management +

    Lightweight is the right weight. This repository follows tinyverse recommedations of limiting dependencies to minimum.

    -

    Dependency version management

    +

    Dependency version management +

    If the code is not compatible with all (!) historical versions of a given dependenct package, it is required to specify minimal version in the DESCRIPTION file. In particular: if the development version requires (imports) the development version of another package - it is required to put abc (>= 1.2.3.9000).

    - +
    -

    R & package versions

    +

    R & package versions +

    We continuously test our packages against the newest R version along with the most recent dependencies from CRAN and BioConductor. We recommend that your working environment is also set up in the same way. You can find the details about the R version and packages used in the R CMD check GitHub Action execution log - there is a step that prints out the R sessionInfo().

    If you discover bugs on older R versions or with an older set of dependencies, please create the relevant bug reports.

    -

    pre-commit

    +

    +pre-commit +

    We highly recommend that you use the pre-commit tool combined with R hooks for pre-commit to execute some of the checks before committing and pushing your changes.

    Pre-commit hooks are already available in this repository’s .pre-commit-config.yaml file.

    -

    Recognition model

    +

    Recognition model +

    As mentioned previously, all contributions are deeply valued and appreciated. While all contribution data is available as part of the repository insights, to recognize a significant contribution and hence add the contributor to the package authors list, the following rules are enforced:

    -
    • Minimum 5% of lines of code authored* (determined by git blame query) OR
    • +
        +
      • Minimum 5% of lines of code authored* (determined by git blame query) OR
      • Being at the top 5 contributors in terms of number of commits OR lines added OR lines removed*
      • -

      *Excluding auto-generated code, including but not limited to roxygen comments or renv.lock files.

      +
    +

    *Excluding auto-generated code, including but not limited to roxygen comments or renv.lock files.

    The package maintainer also reserves the right to adjust the criteria to recognize contributions.

    -

    Questions

    +

    Questions +

    If you have further questions regarding the contribution guidelines, please contact the package/repository maintainer.

    + + + + - - + + diff --git a/v0.4.0/LICENSE-text.html b/v0.4.0/LICENSE-text.html index 58d5cb5ac..5fc58108f 100644 --- a/v0.4.0/LICENSE-text.html +++ b/v0.4.0/LICENSE-text.html @@ -1,8 +1,22 @@ - -License • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -92,17 +112,19 @@ limitations under the License. - + + + + - - + + diff --git a/v0.4.0/SECURITY.html b/v0.4.0/SECURITY.html index 51b0b31d7..b721f4d6e 100644 --- a/v0.4.0/SECURITY.html +++ b/v0.4.0/SECURITY.html @@ -1,8 +1,22 @@ - -Security Policy • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -80,38 +100,44 @@
    -

    Reporting Security Issues

    +

    Reporting Security Issues +

    If you believe you have found a security vulnerability in any of the repositories in this organization, please report it to us through coordinated disclosure.

    Please do not report security vulnerabilities through public GitHub issues, discussions, or pull requests.

    Instead, please send an email to vulnerability.management[@]roche.com.

    Please include as much of the information listed below as you can to help us better understand and resolve the issue:

    -
    • The type of issue (e.g., buffer overflow, SQL injection, or cross-site scripting)
    • +
        +
      • The type of issue (e.g., buffer overflow, SQL injection, or cross-site scripting)
      • Full paths of source file(s) related to the manifestation of the issue
      • The location of the affected source code (tag/branch/commit or direct URL)
      • Any special configuration required to reproduce the issue
      • Step-by-step instructions to reproduce the issue
      • Proof-of-concept or exploit code (if possible)
      • Impact of the issue, including how an attacker might exploit the issue
      • -

      This information will help us triage your report more quickly.

      +
    +

    This information will help us triage your report more quickly.

    -

    Data Security Standards (DSS)

    +

    Data Security Standards (DSS) +

    Please make sure that while reporting issues in the form a bug, feature, or pull request, all sensitive information such as PII, PHI, and PCI is completely removed from any text and attachments, including pictures and videos.

    + + + + - - + + diff --git a/v0.4.0/articles/filter-panel-for-developers.html b/v0.4.0/articles/filter-panel-for-developers.html index 82e745b5b..0b1087475 100644 --- a/v0.4.0/articles/filter-panel-for-developers.html +++ b/v0.4.0/articles/filter-panel-for-developers.html @@ -1,5 +1,4 @@ - - + @@ -52,22 +51,7 @@ - - + - + + diff --git a/v0.4.0/articles/index.html b/v0.4.0/articles/index.html index 4e8acb1e2..5118d517a 100644 --- a/v0.4.0/articles/index.html +++ b/v0.4.0/articles/index.html @@ -1,8 +1,22 @@ - -Articles • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -80,24 +100,31 @@

    All vignettes

    -
    Filter panel for developers
    +
    +
    Filter panel for developers
    -
    teal.slice classes
    + +
    teal.slice classes
    -
    Introduction to teal.slice
    + +
    Introduction to teal.slice
    -
    - + +
    + + + + + - - + + diff --git a/v0.4.0/articles/teal-slice-classes.html b/v0.4.0/articles/teal-slice-classes.html index 250f5426a..dfc920c02 100644 --- a/v0.4.0/articles/teal-slice-classes.html +++ b/v0.4.0/articles/teal-slice-classes.html @@ -1,5 +1,4 @@ - - + @@ -52,22 +51,7 @@ - - + - + + diff --git a/v0.4.0/articles/teal-slice.html b/v0.4.0/articles/teal-slice.html index 34b8be57d..8d002a24f 100644 --- a/v0.4.0/articles/teal-slice.html +++ b/v0.4.0/articles/teal-slice.html @@ -1,5 +1,4 @@ - - + @@ -52,22 +51,7 @@ - - + - + + diff --git a/v0.4.0/authors.html b/v0.4.0/authors.html index ca454e392..8374a5d2d 100644 --- a/v0.4.0/authors.html +++ b/v0.4.0/authors.html @@ -1,8 +1,22 @@ - -Authors and Citation • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -79,7 +99,8 @@

    Authors

    -
    • +
        +
      • Dawid Kaledkowski. Author, maintainer.

      • @@ -135,7 +156,8 @@

        Authors

        F. Hoffmann-La Roche AG. Copyright holder, funder.

        -
    + +

    Citation

    @@ -153,17 +175,19 @@

    Citation

    }
    + + + + - - + + diff --git a/v0.4.0/coverage-report/index.html b/v0.4.0/coverage-report/index.html index 7694a842c..7e6e9e8ba 100644 --- a/v0.4.0/coverage-report/index.html +++ b/v0.4.0/coverage-report/index.html @@ -1,22 +1,21 @@ - - + - + - - + + - + - + - - - + + + @@ -788,7 +787,8 @@

    teal.slice coverage - 66.06%

    97 - 104x + 104x +
      UseMethod("init_filtered_dataset")
    @@ -879,63 +879,72 @@

    teal.slice coverage - 66.06%

    110 - 95x + 95x +
      DefaultFilteredDataset$new(
    111 - 95x + 95x +
        dataset = dataset,
    112 - 95x + 95x +
        dataname = dataname,
    113 - 95x + 95x +
        keys = keys,
    114 - 95x + 95x +
        parent_name = parent_name,
    115 - 95x + 95x +
        parent = parent,
    116 - 95x + 95x +
        join_keys = join_keys,
    117 - 95x + 95x +
        label = label,
    118 - 95x + 95x +
        metadata = metadata
    @@ -1033,7 +1042,8 @@

    teal.slice coverage - 66.06%

    132 - 9x + 9x +
      if (!requireNamespace("MultiAssayExperiment", quietly = TRUE)) {
    @@ -1054,42 +1064,48 @@

    teal.slice coverage - 66.06%

    135 - 9x + 9x +
      MAEFilteredDataset$new(
    136 - 9x + 9x +
        dataset = dataset,
    137 - 9x + 9x +
        dataname = dataname,
    138 - 9x + 9x +
        keys = keys,
    139 - 9x + 9x +
        label = label,
    140 - 9x + 9x +
        metadata = metadata
    @@ -1627,35 +1643,40 @@

    teal.slice coverage - 66.06%

    74 - 379x + 379x +
          checkmate::assert_class(x_reactive, "reactive")
    75 - 378x + 378x +
          checkmate::assert_class(slice, "teal_slice")
    76 - 376x + 376x +
          checkmate::assert_character(extract_type, max.len = 1, any.missing = FALSE)
    77 - 376x + 376x +
          if (length(extract_type) == 1) {
    78 - 59x + 59x +
            checkmate::assert_choice(extract_type, choices = c("list", "matrix"))
    @@ -1683,14 +1704,16 @@

    teal.slice coverage - 66.06%

    82 - 375x + 375x +
          private$x <- x
    83 - 375x + 375x +
          private$x_reactive <- x_reactive
    @@ -1704,21 +1727,24 @@

    teal.slice coverage - 66.06%

    85 - 375x + 375x +
          private$na_count <- sum(is.na(x))
    86 - 375x + 375x +
          private$filtered_na_count <- reactive(
    87 - 375x + 375x +
            if (!is.null(private$x_reactive())) {
    @@ -1753,7 +1779,8 @@

    teal.slice coverage - 66.06%

    92 - 375x + 375x +
          private$extract_type <- extract_type
    @@ -1774,14 +1801,16 @@

    teal.slice coverage - 66.06%

    95 - 18x + 18x +
          if (is.null(shiny::isolate(slice$keep_na)) && anyNA(x)) slice$keep_na <- TRUE
    96 - 375x + 375x +
          private$teal_slice <- slice
    @@ -1795,7 +1824,8 @@

    teal.slice coverage - 66.06%

    98 - 375x + 375x +
          varlabel <- attr(x, "label")
    @@ -1809,21 +1839,24 @@

    teal.slice coverage - 66.06%

    100 - 375x + 375x +
          private$varlabel <-
    101 - 375x + 375x +
            if (is.null(varlabel) || identical(varlabel, private$get_varname())) {
    102 - 374x + 374x +
              character(0)
    @@ -1837,7 +1870,8 @@

    teal.slice coverage - 66.06%

    104 - 1x + 1x +
              varlabel
    @@ -1858,7 +1892,8 @@

    teal.slice coverage - 66.06%

    107 - 375x + 375x +
          private$state_history <- reactiveVal(list())
    @@ -1872,7 +1907,8 @@

    teal.slice coverage - 66.06%

    109 - 375x + 375x +
          logger::log_trace("Instantiated FilterState object id: { private$get_id() }")
    @@ -1886,7 +1922,8 @@

    teal.slice coverage - 66.06%

    111 - 375x + 375x +
          invisible(self)
    @@ -1970,28 +2007,32 @@

    teal.slice coverage - 66.06%

    123 - 68x + 68x +
          sprintf(
    124 - 68x + 68x +
            "%s:\n%s",
    125 - 68x + 68x +
            class(self)[1],
    126 - 68x + 68x +
            format(self$get_state(), show_all = show_all, trim_lines = trim_lines)
    @@ -2061,7 +2102,8 @@

    teal.slice coverage - 66.06%

    136 - 14x + 14x +
          cat(shiny::isolate(self$format(...)))
    @@ -2152,21 +2194,24 @@

    teal.slice coverage - 66.06%

    149 - 89x + 89x +
          checkmate::assert_class(state, "teal_slice")
    150 - 88x + 88x +
          if (private$is_fixed()) {
    151 - 1x + 1x +
            logger::log_warn("attempt to set state on fixed filter aborted id: { private$get_id() }")
    @@ -2180,28 +2225,32 @@

    teal.slice coverage - 66.06%

    153 - 87x + 87x +
            logger::log_trace("{ class(self)[1] }$set_state setting state of filter id: { private$get_id() }")
    154 - 87x + 87x +
            shiny::isolate({
    155 - 87x + 87x +
              if (!is.null(state$selected)) {
    156 - 78x + 78x +
                private$set_selected(state$selected)
    @@ -2215,14 +2264,16 @@

    teal.slice coverage - 66.06%

    158 - 75x + 75x +
              if (!is.null(state$keep_na)) {
    159 - 16x + 16x +
                private$set_keep_na(state$keep_na)
    @@ -2236,14 +2287,16 @@

    teal.slice coverage - 66.06%

    161 - 75x + 75x +
              if (!is.null(state$keep_inf)) {
    162 - 9x + 9x +
                private$set_keep_inf(state$keep_inf)
    @@ -2257,35 +2310,40 @@

    teal.slice coverage - 66.06%

    164 - 75x + 75x +
              current_state <- sprintf(
    165 - 75x + 75x +
                "selected: %s; keep_na: %s; keep_inf: %s",
    166 - 75x + 75x +
                toString(private$get_selected()),
    167 - 75x + 75x +
                private$get_keep_na(),
    168 - 75x + 75x +
                private$get_keep_inf()
    @@ -2320,7 +2378,8 @@

    teal.slice coverage - 66.06%

    173 - 76x + 76x +
          invisible(self)
    @@ -2390,7 +2449,8 @@

    teal.slice coverage - 66.06%

    183 - 765x + 765x +
          private$teal_slice
    @@ -2460,7 +2520,8 @@

    teal.slice coverage - 66.06%

    193 - 1x + 1x +
          stop("this is a virtual method")
    @@ -2551,42 +2612,48 @@

    teal.slice coverage - 66.06%

    206 - 12x + 12x +
          moduleServer(
    207 - 12x + 12x +
            id = id,
    208 - 12x + 12x +
            function(input, output, session) {
    209 - 12x + 12x +
              logger::log_trace("FilterState$server initializing module for slice: { private$get_id() } ")
    210 - 12x + 12x +
              private$server_summary("summary")
    211 - 12x + 12x +
              if (private$is_fixed()) {
    @@ -2607,7 +2674,8 @@

    teal.slice coverage - 66.06%

    214 - 12x + 12x +
                private$server_inputs("inputs")
    @@ -2628,49 +2696,56 @@

    teal.slice coverage - 66.06%

    217 - 12x + 12x +
              private$observers$state <- observeEvent(
    218 - 12x + 12x +
                eventExpr = list(private$get_selected(), private$get_keep_na(), private$get_keep_inf()),
    219 - 12x + 12x +
                handlerExpr = {
    220 - 4x + 4x +
                  current_state <- as.list(self$get_state())
    221 - 4x + 4x +
                  history <- private$state_history()
    222 - 4x + 4x +
                  history_update <- c(history, list(current_state))
    223 - 4x + 4x +
                  private$state_history(history_update)
    @@ -2698,21 +2773,24 @@

    teal.slice coverage - 66.06%

    227 - 12x + 12x +
              private$observers$back <- observeEvent(
    228 - 12x + 12x +
                eventExpr = input$back,
    229 - 12x + 12x +
                handlerExpr = {
    @@ -2775,21 +2853,24 @@

    teal.slice coverage - 66.06%

    238 - 12x + 12x +
              private$observers$reset <- observeEvent(
    239 - 12x + 12x +
                eventExpr = input$reset,
    240 - 12x + 12x +
                handlerExpr = {
    @@ -2831,42 +2912,48 @@

    teal.slice coverage - 66.06%

    246 - 12x + 12x +
              private$observers$state_history <- observeEvent(
    247 - 12x + 12x +
                eventExpr = private$state_history(),
    248 - 12x + 12x +
                handlerExpr = {
    249 - 4x + 4x +
                  shinyjs::delay(
    250 - 4x + 4x +
                    ms = 100,
    251 - 4x + 4x +
                    expr = shinyjs::toggleElement(id = "back", condition = length(private$state_history()) > 1L)
    @@ -2880,21 +2967,24 @@

    teal.slice coverage - 66.06%

    253 - 4x + 4x +
                  shinyjs::delay(
    254 - 4x + 4x +
                    ms = 100,
    255 - 4x + 4x +
                    expr = shinyjs::toggleElement(id = "reset", condition = length(private$state_history()) > 1L)
    @@ -2929,14 +3019,16 @@

    teal.slice coverage - 66.06%

    260 - 12x + 12x +
              private$destroy_shiny <- function() {
    261 - 8x + 8x +
                logger::log_trace("Destroying FilterState inputs and observers; id: { private$get_id() }")
    @@ -2950,7 +3042,8 @@

    teal.slice coverage - 66.06%

    263 - 8x + 8x +
                lapply(session$ns(names(input)), .subset2(input, "impl")$.values$remove)
    @@ -2971,7 +3064,8 @@

    teal.slice coverage - 66.06%

    266 - 8x + 8x +
                lapply(private$observers, function(x) x$destroy())
    @@ -2992,7 +3086,8 @@

    teal.slice coverage - 66.06%

    269 - 12x + 12x +
              reactive(input$remove)
    @@ -3083,7 +3178,8 @@

    teal.slice coverage - 66.06%

    282 - 12x + 12x +
          ns <- NS(id)
    @@ -3097,49 +3193,56 @@

    teal.slice coverage - 66.06%

    284 - 12x + 12x +
          tags$div(
    285 - 12x + 12x +
            id = id,
    286 - 12x + 12x +
            class = "panel filter-card",
    287 - 12x + 12x +
            include_js_files("count-bar-labels.js"),
    288 - 12x + 12x +
            tags$div(
    289 - 12x + 12x +
              class = "filter-card-header",
    290 - 12x + 12x +
              tags$div(
    @@ -3153,28 +3256,32 @@

    teal.slice coverage - 66.06%

    292 - 12x + 12x +
                class = "filter-card-title",
    293 - 12x + 12x +
                `data-toggle` = "collapse",
    294 - 12x + 12x +
                `data-bs-toggle` = "collapse",
    295 - 12x + 12x +
                href = paste0("#", ns("body")),
    @@ -3188,7 +3295,8 @@

    teal.slice coverage - 66.06%

    297 - 12x + 12x +
                if (private$is_anchored() && private$is_fixed()) {
    @@ -3202,7 +3310,8 @@

    teal.slice coverage - 66.06%

    299 - 12x + 12x +
                } else if (private$is_anchored() && !private$is_fixed()) {
    @@ -3216,7 +3325,8 @@

    teal.slice coverage - 66.06%

    301 - 12x + 12x +
                } else if (!private$is_anchored() && private$is_fixed()) {
    @@ -3237,14 +3347,16 @@

    teal.slice coverage - 66.06%

    304 - 12x + 12x +
                tags$span(tags$strong(private$get_varname())),
    305 - 12x + 12x +
                tags$span(private$get_varlabel(), class = "filter-card-varlabel")
    @@ -3258,70 +3370,80 @@

    teal.slice coverage - 66.06%

    307 - 12x + 12x +
              div(
    308 - 12x + 12x +
                class = "filter-card-controls",
    309 - 12x + 12x +
                if (isFALSE(private$is_fixed())) {
    310 - 12x + 12x +
                  actionLink(
    311 - 12x + 12x +
                    inputId = ns("back"),
    312 - 12x + 12x +
                    label = NULL,
    313 - 12x + 12x +
                    icon = icon("circle-arrow-left", lib = "font-awesome"),
    314 - 12x + 12x +
                    title = "Rewind state",
    315 - 12x + 12x +
                    class = "filter-card-back",
    316 - 12x + 12x +
                    style = "display: none"
    @@ -3342,56 +3464,64 @@

    teal.slice coverage - 66.06%

    319 - 12x + 12x +
                if (isFALSE(private$is_fixed())) {
    320 - 12x + 12x +
                  actionLink(
    321 - 12x + 12x +
                    inputId = ns("reset"),
    322 - 12x + 12x +
                    label = NULL,
    323 - 12x + 12x +
                    icon = icon("circle-arrow-up", lib = "font-awesome"),
    324 - 12x + 12x +
                    title = "Restore original state",
    325 - 12x + 12x +
                    class = "filter-card-back",
    326 - 12x + 12x +
                    style = "display: none"
    @@ -3412,42 +3542,48 @@

    teal.slice coverage - 66.06%

    329 - 12x + 12x +
                if (isFALSE(private$is_anchored())) {
    330 - 12x + 12x +
                  actionLink(
    331 - 12x + 12x +
                    inputId = ns("remove"),
    332 - 12x + 12x +
                    label = icon("circle-xmark", lib = "font-awesome"),
    333 - 12x + 12x +
                    title = "Remove filter",
    334 - 12x + 12x +
                    class = "filter-card-remove"
    @@ -3475,42 +3611,48 @@

    teal.slice coverage - 66.06%

    338 - 12x + 12x +
              tags$div(
    339 - 12x + 12x +
                class = "filter-card-summary",
    340 - 12x + 12x +
                `data-toggle` = "collapse",
    341 - 12x + 12x +
                `data-bs-toggle` = "collapse",
    342 - 12x + 12x +
                href = paste0("#", ns("body")),
    343 - 12x + 12x +
                private$ui_summary(ns("summary"))
    @@ -3531,56 +3673,64 @@

    teal.slice coverage - 66.06%

    346 - 12x + 12x +
            tags$div(
    347 - 12x + 12x +
              id = ns("body"),
    348 - 12x + 12x +
              class = "collapse out",
    349 - 12x + 12x +
              `data-parent` = paste0("#", parent_id),
    350 - 12x + 12x +
              `data-bs-parent` = paste0("#", parent_id),
    351 - 12x + 12x +
              tags$div(
    352 - 12x + 12x +
                class = "filter-card-body",
    353 - 12x + 12x +
                if (private$is_fixed()) {
    @@ -3601,7 +3751,8 @@

    teal.slice coverage - 66.06%

    356 - 12x + 12x +
                  private$ui_inputs(ns("inputs"))
    @@ -3692,14 +3843,16 @@

    teal.slice coverage - 66.06%

    369 - 47x + 47x +
          if (!is.null(private$destroy_shiny)) {
    370 - 8x + 8x +
            private$destroy_shiny()
    @@ -3993,35 +4146,40 @@

    teal.slice coverage - 66.06%

    412 - 431x + 431x +
          logger::log_trace(
    413 - 431x + 431x +
            sprintf(
    414 - 431x + 431x +
              "%s$set_selected setting selection of id: %s",
    415 - 431x + 431x +
              class(self)[1],
    416 - 431x + 431x +
              private$get_id()
    @@ -4042,35 +4200,40 @@

    teal.slice coverage - 66.06%

    419 - 431x + 431x +
          shiny::isolate({
    420 - 431x + 431x +
            value <- private$cast_and_validate(value)
    421 - 420x + 420x +
            value <- private$check_length(value)
    422 - 414x + 414x +
            value <- private$remove_out_of_bounds_values(value)
    423 - 414x + 414x +
            private$teal_slice$selected <- value
    @@ -4084,35 +4247,40 @@

    teal.slice coverage - 66.06%

    425 - 414x + 414x +
          logger::log_trace(
    426 - 414x + 414x +
            sprintf(
    427 - 414x + 414x +
              "%s$set_selected selection of id: %s",
    428 - 414x + 414x +
              class(self)[1],
    429 - 414x + 414x +
              private$get_id()
    @@ -4140,7 +4308,8 @@

    teal.slice coverage - 66.06%

    433 - 414x + 414x +
          invisible(NULL)
    @@ -4238,56 +4407,64 @@

    teal.slice coverage - 66.06%

    447 - 16x + 16x +
          checkmate::assert_flag(value)
    448 - 16x + 16x +
          private$teal_slice$keep_na <- value
    449 - 16x + 16x +
          logger::log_trace(
    450 - 16x + 16x +
            sprintf(
    451 - 16x + 16x +
              "%s$set_keep_na set for filter %s to %s.",
    452 - 16x + 16x +
              class(self)[1],
    453 - 16x + 16x +
              private$get_id(),
    454 - 16x + 16x +
              value
    @@ -4308,7 +4485,8 @@

    teal.slice coverage - 66.06%

    457 - 16x + 16x +
          invisible(NULL)
    @@ -4392,56 +4570,64 @@

    teal.slice coverage - 66.06%

    469 - 9x + 9x +
          checkmate::assert_flag(value)
    470 - 9x + 9x +
          private$teal_slice$keep_inf <- value
    471 - 9x + 9x +
          logger::log_trace(
    472 - 9x + 9x +
            sprintf(
    473 - 9x + 9x +
              "%s$set_keep_inf of filter %s set to %s",
    474 - 9x + 9x +
              class(self)[1],
    475 - 9x + 9x +
              private$get_id(),
    476 - 9x + 9x +
              value
    @@ -4469,7 +4655,8 @@

    teal.slice coverage - 66.06%

    480 - 9x + 9x +
          invisible(NULL)
    @@ -4532,7 +4719,8 @@

    teal.slice coverage - 66.06%

    489 - 87x + 87x +
          shiny::isolate(private$teal_slice$dataname)
    @@ -4581,7 +4769,8 @@

    teal.slice coverage - 66.06%

    496 - 164x + 164x +
          shiny::isolate(private$teal_slice$varname)
    @@ -4630,7 +4819,8 @@

    teal.slice coverage - 66.06%

    503 - 4x + 4x +
          shiny::isolate(private$teal_slice$id)
    @@ -4679,7 +4869,8 @@

    teal.slice coverage - 66.06%

    510 - 903x + 903x +
          shiny::isolate(private$teal_slice$choices)
    @@ -4728,7 +4919,8 @@

    teal.slice coverage - 66.06%

    517 - 360x + 360x +
          private$teal_slice$selected
    @@ -4777,7 +4969,8 @@

    teal.slice coverage - 66.06%

    524 - 153x + 153x +
          private$teal_slice$keep_na
    @@ -4826,7 +5019,8 @@

    teal.slice coverage - 66.06%

    531 - 126x + 126x +
          private$teal_slice$keep_inf
    @@ -4868,7 +5062,8 @@

    teal.slice coverage - 66.06%

    537 - 148x + 148x +
          shiny::isolate(isTRUE(private$teal_slice$fixed))
    @@ -4910,7 +5105,8 @@

    teal.slice coverage - 66.06%

    543 - 48x + 48x +
          shiny::isolate(isTRUE(private$teal_slice$anchored))
    @@ -4952,7 +5148,8 @@

    teal.slice coverage - 66.06%

    549 - 223x + 223x +
          shiny::isolate(isTRUE(private$teal_slice$multiple))
    @@ -5015,7 +5212,8 @@

    teal.slice coverage - 66.06%

    558 - 12x + 12x +
          private$varlabel
    @@ -5078,49 +5276,56 @@

    teal.slice coverage - 66.06%

    567 - 107x + 107x +
          varname <- private$get_varname()
    568 - 107x + 107x +
          varname_backticked <- sprintf("`%s`", varname)
    569 - 107x + 107x +
          ans <-
    570 - 107x + 107x +
            if (isTRUE(private$extract_type == "list")) {
    571 - 16x + 16x +
              sprintf("%s$%s", dataname, varname_backticked)
    572 - 107x + 107x +
            } else if (isTRUE(private$extract_type == "matrix")) {
    573 - 7x + 7x +
              sprintf("%s[, \"%s\"]", dataname, varname)
    @@ -5134,7 +5339,8 @@

    teal.slice coverage - 66.06%

    575 - 84x + 84x +
              varname_backticked
    @@ -5148,7 +5354,8 @@

    teal.slice coverage - 66.06%

    577 - 107x + 107x +
          str2lang(ans)
    @@ -5232,14 +5439,16 @@

    teal.slice coverage - 66.06%

    589 - 106x + 106x +
          if (private$na_count == 0L) {
    590 - 85x + 85x +
            return(filter_call)
    @@ -5260,42 +5469,48 @@

    teal.slice coverage - 66.06%

    593 - 21x + 21x +
          if (is.null(filter_call) && isFALSE(private$get_keep_na())) {
    594 - 2x + 2x +
            call("!", call("is.na", varname))
    595 - 19x + 19x +
          } else if (!is.null(filter_call) && isTRUE(private$get_keep_na())) {
    596 - 12x + 12x +
            call("|", call("is.na", varname), filter_call)
    597 - 7x + 7x +
          } else if (!is.null(filter_call) && isFALSE(private$get_keep_na())) {
    598 - 7x + 7x +
            call("&", call("!", call("is.na", varname)), filter_call)
    @@ -5372,7 +5587,8 @@

    teal.slice coverage - 66.06%

    609 - 11x + 11x +
          values
    @@ -5407,7 +5623,8 @@

    teal.slice coverage - 66.06%

    614 - 11x + 11x +
          values
    @@ -5470,7 +5687,8 @@

    teal.slice coverage - 66.06%

    623 - 31x + 31x +
          values
    @@ -5568,42 +5786,48 @@

    teal.slice coverage - 66.06%

    637 - 74x + 74x +
          if (private$is_choice_limited) {
    638 - 3x + 3x +
            TRUE
    639 - 71x + 71x +
          } else if (!setequal(private$get_selected(), private$get_choices())) {
    640 - 58x + 58x +
            TRUE
    641 - 13x + 13x +
          } else if (!isTRUE(private$get_keep_na()) && private$na_count > 0) {
    642 - 4x + 4x +
            TRUE
    @@ -5617,7 +5841,8 @@

    teal.slice coverage - 66.06%

    644 - 9x + 9x +
            FALSE
    @@ -5687,14 +5912,16 @@

    teal.slice coverage - 66.06%

    654 - 12x + 12x +
          ns <- NS(id)
    655 - 12x + 12x +
          uiOutput(ns("summary"), class = "filter-card-summary")
    @@ -5750,28 +5977,32 @@

    teal.slice coverage - 66.06%

    663 - 12x + 12x +
          moduleServer(
    664 - 12x + 12x +
            id = id,
    665 - 12x + 12x +
            function(input, output, session) {
    666 - 12x + 12x +
              output$summary <- renderUI(private$content_summary())
    @@ -6058,14 +6289,16 @@

    teal.slice coverage - 66.06%

    707 - 12x + 12x +
          ns <- NS(id)
    708 - 12x + 12x +
          if (private$na_count > 0) {
    @@ -6219,7 +6452,8 @@

    teal.slice coverage - 66.06%

    730 - 12x + 12x +
            NULL
    @@ -6296,7 +6530,8 @@

    teal.slice coverage - 66.06%

    741 - 12x + 12x +
          moduleServer(id, function(input, output, session) {
    @@ -6324,42 +6559,48 @@

    teal.slice coverage - 66.06%

    745 - 12x + 12x +
            output$trigger_visible <- renderUI({
    746 - 12x + 12x +
              updateCountText(
    747 - 12x + 12x +
                inputId = "count_label",
    748 - 12x + 12x +
                label = "Keep NA",
    749 - 12x + 12x +
                countmax = private$na_count,
    750 - 12x + 12x +
                countnow = private$filtered_na_count()
    @@ -6373,7 +6614,8 @@

    teal.slice coverage - 66.06%

    752 - 12x + 12x +
              NULL
    @@ -6415,35 +6657,40 @@

    teal.slice coverage - 66.06%

    758 - 12x + 12x +
            private$observers$keep_na_api <- observeEvent(
    759 - 12x + 12x +
              eventExpr = private$get_keep_na(),
    760 - 12x + 12x +
              ignoreNULL = FALSE, # nothing selected is possible for NA
    761 - 12x + 12x +
              ignoreInit = TRUE, # ignoreInit: should not matter because we set the UI with the desired initial state
    762 - 12x + 12x +
              handlerExpr = {
    @@ -6520,35 +6767,40 @@

    teal.slice coverage - 66.06%

    773 - 12x + 12x +
            private$observers$keep_na <- observeEvent(
    774 - 12x + 12x +
              ignoreNULL = FALSE, # ignoreNULL: we don't want to ignore NULL when nothing is selected in the `selectInput`
    775 - 12x + 12x +
              ignoreInit = TRUE, # ignoreInit: should not matter because we set the UI with the desired initial state
    776 - 12x + 12x +
              eventExpr = input$value,
    777 - 12x + 12x +
              handlerExpr = {
    @@ -6618,7 +6870,8 @@

    teal.slice coverage - 66.06%

    787 - 12x + 12x +
            invisible(NULL)
    @@ -7009,28 +7262,32 @@

    teal.slice coverage - 66.06%

    51 - 298x + 298x +
          checkmate::assert_string(dataname)
    52 - 296x + 296x +
          logger::log_trace("Instantiating { class(self)[1] }, dataname: { dataname }")
    53 - 296x + 296x +
          checkmate::assert_function(data_reactive, args = "sid")
    54 - 296x + 296x +
          checkmate::assert_string(datalabel, null.ok = TRUE)
    @@ -7044,42 +7301,48 @@

    teal.slice coverage - 66.06%

    56 - 296x + 296x +
          private$dataname <- dataname
    57 - 296x + 296x +
          private$datalabel <- datalabel
    58 - 296x + 296x +
          private$dataname_prefixed <- dataname
    59 - 296x + 296x +
          private$data <- data
    60 - 296x + 296x +
          private$data_reactive <- data_reactive
    61 - 296x + 296x +
          private$state_list <- reactiveVal()
    @@ -7093,14 +7356,16 @@

    teal.slice coverage - 66.06%

    63 - 296x + 296x +
          logger::log_trace("Instantiated { class(self)[1] }, dataname: { private$dataname }")
    64 - 296x + 296x +
          invisible(self)
    @@ -7527,7 +7792,8 @@

    teal.slice coverage - 66.06%

    125 - 82x + 82x +
          logger::log_trace("FilterStates$get_call initializing")
    @@ -7562,21 +7828,24 @@

    teal.slice coverage - 66.06%

    130 - 82x + 82x +
          states_list <- private$state_list_get()
    131 - 82x + 82x +
          if (length(states_list) == 0) {
    132 - 47x + 47x +
            return(NULL)
    @@ -7590,35 +7859,40 @@

    teal.slice coverage - 66.06%

    134 - 35x + 35x +
          args <- vapply(
    135 - 35x + 35x +
            states_list,
    136 - 35x + 35x +
            function(x) {
    137 - 56x + 56x +
              arg <- x$get_state()$arg
    138 - 7x + 7x +
              `if`(is.null(arg), "", arg) # converting NULL -> "" to enable tapply.
    @@ -7632,7 +7906,8 @@

    teal.slice coverage - 66.06%

    140 - 35x + 35x +
            character(1)
    @@ -7653,35 +7928,40 @@

    teal.slice coverage - 66.06%

    143 - 35x + 35x +
          filter_items <- tapply(
    144 - 35x + 35x +
            X = states_list,
    145 - 35x + 35x +
            INDEX = args,
    146 - 35x + 35x +
            simplify = FALSE,
    147 - 35x + 35x +
            function(items) {
    @@ -7695,14 +7975,16 @@

    teal.slice coverage - 66.06%

    149 - 37x + 37x +
              other_filter_idx <- !names(items) %in% sid
    150 - 37x + 37x +
              filtered_items <- items[other_filter_idx]
    @@ -7716,42 +7998,48 @@

    teal.slice coverage - 66.06%

    152 - 37x + 37x +
              calls <- Filter(
    153 - 37x + 37x +
                Negate(is.null),
    154 - 37x + 37x +
                lapply(
    155 - 37x + 37x +
                  filtered_items,
    156 - 37x + 37x +
                  function(state) {
    157 - 50x + 50x +
                    state$get_call(dataname = private$dataname_prefixed)
    @@ -7779,7 +8067,8 @@

    teal.slice coverage - 66.06%

    161 - 37x + 37x +
              calls_combine_by(calls, operator = "&")
    @@ -7800,21 +8089,24 @@

    teal.slice coverage - 66.06%

    164 - 35x + 35x +
          filter_items <- Filter(
    165 - 35x + 35x +
            x = filter_items,
    166 - 35x + 35x +
            f = Negate(is.null)
    @@ -7828,49 +8120,56 @@

    teal.slice coverage - 66.06%

    168 - 35x + 35x +
          if (length(filter_items) > 0L) {
    169 - 34x + 34x +
            filter_function <- private$fun
    170 - 34x + 34x +
            data_name <- str2lang(private$dataname_prefixed)
    171 - 34x + 34x +
            substitute(
    172 - 34x + 34x +
              env = list(
    173 - 34x + 34x +
                lhs = data_name,
    174 - 34x + 34x +
                rhs = as.call(c(filter_function, c(list(data_name), filter_items)))
    @@ -7884,7 +8183,8 @@

    teal.slice coverage - 66.06%

    176 - 34x + 34x +
              expr = lhs <- rhs
    @@ -7912,7 +8212,8 @@

    teal.slice coverage - 66.06%

    180 - 1x + 1x +
            NULL
    @@ -8066,35 +8367,40 @@

    teal.slice coverage - 66.06%

    202 - 17x + 17x +
          checkmate::assert_class(state, "teal_slices")
    203 - 17x + 17x +
          shiny::isolate({
    204 - 17x + 17x +
            state_ids <- vapply(state, `[[`, character(1), "id")
    205 - 17x + 17x +
            logger::log_trace("{ class(self)[1] }$remove_filter_state removing filters, state_id: { toString(state_ids) }")
    206 - 17x + 17x +
            private$state_list_remove(state_ids)
    @@ -8108,7 +8414,8 @@

    teal.slice coverage - 66.06%

    208 - 17x + 17x +
          invisible(NULL)
    @@ -8192,14 +8499,16 @@

    teal.slice coverage - 66.06%

    220 - 380x + 380x +
          slices <- unname(lapply(private$state_list(), function(x) x$get_state()))
    221 - 380x + 380x +
          fs <- do.call(teal_slices, c(slices, list(count_type = private$count_type)))
    @@ -8213,35 +8522,40 @@

    teal.slice coverage - 66.06%

    223 - 380x + 380x +
          include_varnames <- private$include_varnames
    224 - 380x + 380x +
          if (length(include_varnames)) {
    225 - 219x + 219x +
            attr(fs, "include_varnames") <- structure(
    226 - 219x + 219x +
              list(include_varnames),
    227 - 219x + 219x +
              names = private$dataname
    @@ -8269,35 +8583,40 @@

    teal.slice coverage - 66.06%

    231 - 380x + 380x +
          exclude_varnames <- private$exclude_varnames
    232 - 380x + 380x +
          if (length(exclude_varnames)) {
    233 - 10x + 10x +
            attr(fs, "exclude_varnames") <- structure(
    234 - 10x + 10x +
              list(exclude_varnames),
    235 - 10x + 10x +
              names = private$dataname
    @@ -8325,7 +8644,8 @@

    teal.slice coverage - 66.06%

    239 - 380x + 380x +
          return(fs)
    @@ -8423,49 +8743,56 @@

    teal.slice coverage - 66.06%

    253 - 133x + 133x +
          shiny::isolate({
    254 - 133x + 133x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initializing, dataname: { private$dataname }")
    255 - 133x + 133x +
            checkmate::assert_class(state, "teal_slices")
    256 - 133x + 133x +
            lapply(state, function(x) {
    257 - 186x + 186x +
              checkmate::assert_true(
    258 - 186x + 186x +
                x$dataname == private$dataname,
    259 - 186x + 186x +
                .var.name = "dataname matches private$dataname"
    @@ -8493,21 +8820,24 @@

    teal.slice coverage - 66.06%

    263 - 133x + 133x +
            private$set_filterable_varnames(
    264 - 133x + 133x +
              include_varnames = attr(state, "include_varnames")[[private$dataname]],
    265 - 133x + 133x +
              exclude_varnames = attr(state, "exclude_varnames")[[private$dataname]]
    @@ -8521,21 +8851,24 @@

    teal.slice coverage - 66.06%

    267 - 133x + 133x +
            count_type <- attr(state, "count_type")
    268 - 133x + 133x +
            if (length(count_type)) {
    269 - 19x + 19x +
              private$count_type <- count_type
    @@ -8563,35 +8896,40 @@

    teal.slice coverage - 66.06%

    273 - 133x + 133x +
            varnames <- unique(unlist(lapply(state, "[[", "varname")))
    274 - 133x + 133x +
            excluded_varnames <- setdiff(varnames, private$get_filterable_varnames())
    275 - 133x + 133x +
            if (length(excluded_varnames)) {
    276 - 3x + 3x +
              state <- Filter(function(x) !isTRUE(x$varname %in% excluded_varnames), state)
    277 - 3x + 3x +
              logger::log_warn("filters for columns: { toString(excluded_varnames) } excluded from { private$dataname }")
    @@ -8612,35 +8950,40 @@

    teal.slice coverage - 66.06%

    280 - 133x + 133x +
            if (length(state) > 0) {
    281 - 94x + 94x +
              private$set_filter_state_impl(
    282 - 94x + 94x +
                state = state,
    283 - 94x + 94x +
                data = private$data,
    284 - 94x + 94x +
                data_reactive = private$data_reactive
    @@ -8661,7 +9004,8 @@

    teal.slice coverage - 66.06%

    287 - 133x + 133x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initialized, dataname: { private$dataname }")
    @@ -8682,7 +9026,8 @@

    teal.slice coverage - 66.06%

    290 - 133x + 133x +
          invisible(NULL)
    @@ -8766,14 +9111,16 @@

    teal.slice coverage - 66.06%

    302 - 25x + 25x +
          private$state_list_empty(force)
    303 - 25x + 25x +
          invisible(NULL)
    @@ -9039,49 +9386,56 @@

    teal.slice coverage - 66.06%

    341 - 12x + 12x +
          moduleServer(
    342 - 12x + 12x +
            id = id,
    343 - 12x + 12x +
            function(input, output, session) {
    344 - 12x + 12x +
              logger::log_trace("FilterState$srv_active initializing, dataname: { private$dataname }")
    345 - 12x + 12x +
              current_state <- reactive(private$state_list_get())
    346 - 12x + 12x +
              previous_state <- reactiveVal(NULL) # FilterState list
    347 - 12x + 12x +
              added_states <- reactiveVal(NULL) # FilterState list
    @@ -9102,21 +9456,24 @@

    teal.slice coverage - 66.06%

    350 - 12x + 12x +
              fs_to_shiny_ns <- function(x) {
    351 - 24x + 24x +
                checkmate::assert_multi_class(x, c("FilterState", "FilterStateExpr"))
    352 - 24x + 24x +
                gsub("[^[:alnum:]]+", "_", get_default_slice_id(x$get_state()))
    @@ -9137,28 +9494,32 @@

    teal.slice coverage - 66.06%

    355 - 12x + 12x +
              output$trigger_visible_state_change <- renderUI({
    356 - 14x + 14x +
                current_state()
    357 - 14x + 14x +
                isolate({
    358 - 14x + 14x +
                  logger::log_trace("FilterStates$srv_active@1 determining added and removed filter states")
    @@ -9172,21 +9533,24 @@

    teal.slice coverage - 66.06%

    360 - 14x + 14x +
                  added_states(setdiff_teal_slices(current_state(), previous_state()))
    361 - 14x + 14x +
                  previous_state(current_state())
    362 - 14x + 14x +
                  NULL
    @@ -9214,42 +9578,48 @@

    teal.slice coverage - 66.06%

    366 - 12x + 12x +
              output[["cards"]] <- shiny::renderUI({
    367 - 14x + 14x +
                lapply(
    368 - 14x + 14x +
                  current_state(), # observes only if added/removed
    369 - 14x + 14x +
                  function(state) {
    370 - 12x + 12x +
                    shiny::isolate( # isolates when existing state changes
    371 - 12x + 12x +
                      state$ui(id = session$ns(fs_to_shiny_ns(state)), parent_id = session$ns("cards"))
    @@ -9291,21 +9661,24 @@

    teal.slice coverage - 66.06%

    377 - 12x + 12x +
              observeEvent(
    378 - 12x + 12x +
                added_states(), # we want to call FilterState module only once when it's added
    379 - 12x + 12x +
                ignoreNULL = TRUE,
    @@ -9319,56 +9692,64 @@

    teal.slice coverage - 66.06%

    381 - 10x + 10x +
                  added_state_names <- vapply(added_states(), function(x) x$get_state()$id, character(1L))
    382 - 10x + 10x +
                  logger::log_trace("FilterStates$srv_active@2 triggered by added states: { toString(added_state_names) }")
    383 - 10x + 10x +
                  lapply(added_states(), function(state) {
    384 - 12x + 12x +
                    fs_callback <- state$server(id = fs_to_shiny_ns(state))
    385 - 12x + 12x +
                    observeEvent(
    386 - 12x + 12x +
                      eventExpr = fs_callback(), # when remove button is clicked in the FilterState ui
    387 - 12x + 12x +
                      once = TRUE, # remove button can be called once, should be destroyed afterwards
    388 - 12x + 12x +
                      handlerExpr = private$state_list_remove(state$get_state()$id)
    @@ -9389,7 +9770,8 @@

    teal.slice coverage - 66.06%

    391 - 10x + 10x +
                  added_states(NULL)
    @@ -9417,7 +9799,8 @@

    teal.slice coverage - 66.06%

    395 - 12x + 12x +
              NULL
    @@ -9515,14 +9898,16 @@

    teal.slice coverage - 66.06%

    409 - 1x + 1x +
          checkmate::assert_string(id)
    410 - 1x + 1x +
          data <- private$data
    @@ -9536,7 +9921,8 @@

    teal.slice coverage - 66.06%

    412 - 1x + 1x +
          ns <- NS(id)
    @@ -9550,14 +9936,16 @@

    teal.slice coverage - 66.06%

    414 - 1x + 1x +
          if (ncol(data) == 0) {
    415 - 1x + 1x +
            div("no sample variables available")
    @@ -9697,28 +10085,32 @@

    teal.slice coverage - 66.06%

    435 - 8x + 8x +
          moduleServer(
    436 - 8x + 8x +
            id = id,
    437 - 8x + 8x +
            function(input, output, session) {
    438 - 8x + 8x +
              logger::log_trace("FilterStates$srv_add initializing, dataname: { private$dataname }")
    @@ -9739,42 +10131,48 @@

    teal.slice coverage - 66.06%

    441 - 8x + 8x +
              avail_column_choices <- reactive({
    442 - 9x + 9x +
                data <- private$data
    443 - 9x + 9x +
                vars_include <- private$get_filterable_varnames()
    444 - 9x + 9x +
                active_filter_vars <- unique(unlist(lapply(self$get_filter_state(), "[[", "varname")))
    445 - 9x + 9x +
                choices <- setdiff(vars_include, active_filter_vars)
    446 - 9x + 9x +
                varlabels <- get_varlabels(data)
    @@ -9788,35 +10186,40 @@

    teal.slice coverage - 66.06%

    448 - 9x + 9x +
                data_choices_labeled(
    449 - 9x + 9x +
                  data = data,
    450 - 9x + 9x +
                  choices = choices,
    451 - 9x + 9x +
                  varlabels = varlabels,
    452 - 9x + 9x +
                  keys = private$keys
    @@ -9851,21 +10254,24 @@

    teal.slice coverage - 66.06%

    457 - 8x + 8x +
              output$add_filter <- renderUI({
    458 - 6x + 6x +
                logger::log_trace(
    459 - 6x + 6x +
                  "FilterStates$srv_add@1 updating available column choices, dataname: { private$dataname }"
    @@ -9879,7 +10285,8 @@

    teal.slice coverage - 66.06%

    461 - 6x + 6x +
                if (length(avail_column_choices()) == 0) {
    @@ -9900,56 +10307,64 @@

    teal.slice coverage - 66.06%

    464 - 6x + 6x +
                  div(
    465 - 6x + 6x +
                    teal.widgets::optionalSelectInput(
    466 - 6x + 6x +
                      session$ns("var_to_add"),
    467 - 6x + 6x +
                      choices = avail_column_choices(),
    468 - 6x + 6x +
                      selected = NULL,
    469 - 6x + 6x +
                      options = shinyWidgets::pickerOptions(
    470 - 6x + 6x +
                        liveSearch = TRUE,
    471 - 6x + 6x +
                        noneSelectedText = "Select variable to filter"
    @@ -9998,56 +10413,64 @@

    teal.slice coverage - 66.06%

    478 - 8x + 8x +
              observeEvent(
    479 - 8x + 8x +
                eventExpr = input$var_to_add,
    480 - 8x + 8x +
                handlerExpr = {
    481 - 3x + 3x +
                  logger::log_trace(
    482 - 3x + 3x +
                    sprintf(
    483 - 3x + 3x +
                      "FilterStates$srv_add@2 adding FilterState of variable %s, dataname: %s",
    484 - 3x + 3x +
                      input$var_to_add,
    485 - 3x + 3x +
                      private$dataname
    @@ -10068,21 +10491,24 @@

    teal.slice coverage - 66.06%

    488 - 3x + 3x +
                  self$set_filter_state(
    489 - 3x + 3x +
                    teal_slices(
    490 - 3x + 3x +
                      teal_slice(dataname = private$dataname, varname = input$var_to_add)
    @@ -10103,35 +10529,40 @@

    teal.slice coverage - 66.06%

    493 - 3x + 3x +
                  logger::log_trace(
    494 - 3x + 3x +
                    sprintf(
    495 - 3x + 3x +
                      "FilterStates$srv_add@2 added FilterState of variable %s, dataname: %s",
    496 - 3x + 3x +
                      input$var_to_add,
    497 - 3x + 3x +
                      private$dataname
    @@ -10173,14 +10604,16 @@

    teal.slice coverage - 66.06%

    503 - 8x + 8x +
              logger::log_trace("FilterStates$srv_add initialized, dataname: { private$dataname }")
    504 - 8x + 8x +
              NULL
    @@ -10439,14 +10872,16 @@

    teal.slice coverage - 66.06%

    541 - 302x + 302x +
          if ((length(include_varnames) + length(exclude_varnames)) == 0L) {
    542 - 110x + 110x +
            return(invisible(NULL))
    @@ -10460,21 +10895,24 @@

    teal.slice coverage - 66.06%

    544 - 192x + 192x +
          checkmate::assert_character(include_varnames, any.missing = FALSE, min.len = 0L, null.ok = TRUE)
    545 - 192x + 192x +
          checkmate::assert_character(exclude_varnames, any.missing = FALSE, min.len = 0L, null.ok = TRUE)
    546 - 192x + 192x +
          if (length(include_varnames) && length(exclude_varnames)) {
    @@ -10523,28 +10961,32 @@

    teal.slice coverage - 66.06%

    553 - 192x + 192x +
          supported_vars <- get_supported_filter_varnames(private$data)
    554 - 192x + 192x +
          if (length(include_varnames)) {
    555 - 182x + 182x +
            private$include_varnames <- intersect(include_varnames, supported_vars)
    556 - 182x + 182x +
            private$exclude_varnames <- character(0)
    @@ -10558,14 +11000,16 @@

    teal.slice coverage - 66.06%

    558 - 10x + 10x +
            private$exclude_varnames <- exclude_varnames
    559 - 10x + 10x +
            private$include_varnames <- character(0)
    @@ -10579,7 +11023,8 @@

    teal.slice coverage - 66.06%

    561 - 192x + 192x +
          invisible(NULL)
    @@ -10656,14 +11101,16 @@

    teal.slice coverage - 66.06%

    572 - 142x + 142x +
          if (length(private$include_varnames)) {
    573 - 99x + 99x +
            private$include_varnames
    @@ -10677,14 +11124,16 @@

    teal.slice coverage - 66.06%

    575 - 43x + 43x +
            supported_varnames <- get_supported_filter_varnames(private$data)
    576 - 43x + 43x +
            setdiff(supported_varnames, private$exclude_varnames)
    @@ -10789,7 +11238,8 @@

    teal.slice coverage - 66.06%

    591 - 209x + 209x +
          checkmate::assert_string(state_id, null.ok = TRUE)
    @@ -10803,14 +11253,16 @@

    teal.slice coverage - 66.06%

    593 - 209x + 209x +
          if (is.null(state_id)) {
    594 - 209x + 209x +
            private$state_list()
    @@ -10936,49 +11388,56 @@

    teal.slice coverage - 66.06%

    612 - 194x + 194x +
          logger::log_trace("{ class(self)[1] } pushing into state_list, dataname: { private$dataname }")
    613 - 194x + 194x +
          checkmate::assert_string(state_id)
    614 - 194x + 194x +
          checkmate::assert_multi_class(x, c("FilterState", "FilterStateExpr"))
    615 - 194x + 194x +
          state <- stats::setNames(list(x), state_id)
    616 - 194x + 194x +
          new_state_list <- c(
    617 - 194x + 194x +
            shiny::isolate(private$state_list()),
    618 - 194x + 194x +
            state
    @@ -10992,7 +11451,8 @@

    teal.slice coverage - 66.06%

    620 - 194x + 194x +
          shiny::isolate(private$state_list(new_state_list))
    @@ -11006,14 +11466,16 @@

    teal.slice coverage - 66.06%

    622 - 194x + 194x +
          logger::log_trace("{ class(self)[1] } pushed into queue, dataname: { private$dataname }")
    623 - 194x + 194x +
          invisible(NULL)
    @@ -11132,14 +11594,16 @@

    teal.slice coverage - 66.06%

    640 - 32x + 32x +
          checkmate::assert_character(state_id)
    641 - 32x + 32x +
          logger::log_trace("{ class(self)[1] } removing a filter, state_id: { toString(state_id) }")
    @@ -11153,63 +11617,72 @@

    teal.slice coverage - 66.06%

    643 - 32x + 32x +
          shiny::isolate({
    644 - 32x + 32x +
            current_state_ids <- vapply(private$state_list(), function(x) x$get_state()$id, character(1))
    645 - 32x + 32x +
            to_remove <- state_id %in% current_state_ids
    646 - 32x + 32x +
            if (any(to_remove)) {
    647 - 31x + 31x +
              new_state_list <- Filter(
    648 - 31x + 31x +
                function(state) {
    649 - 68x + 68x +
                  if (state$get_state()$id %in% state_id) {
    650 - 54x + 54x +
                    if (state$get_state()$anchored && !force) {
    651 - 7x + 7x +
                      return(TRUE)
    @@ -11223,14 +11696,16 @@

    teal.slice coverage - 66.06%

    653 - 47x + 47x +
                      state$destroy_observers()
    654 - 47x + 47x +
                      FALSE
    @@ -11251,7 +11726,8 @@

    teal.slice coverage - 66.06%

    657 - 14x + 14x +
                    TRUE
    @@ -11272,7 +11748,8 @@

    teal.slice coverage - 66.06%

    660 - 31x + 31x +
                private$state_list()
    @@ -11286,7 +11763,8 @@

    teal.slice coverage - 66.06%

    662 - 31x + 31x +
              private$state_list(new_state_list)
    @@ -11300,7 +11778,8 @@

    teal.slice coverage - 66.06%

    664 - 1x + 1x +
              warning(sprintf("\"%s\" not found in state list", state_id))
    @@ -11328,7 +11807,8 @@

    teal.slice coverage - 66.06%

    668 - 32x + 32x +
          invisible(NULL)
    @@ -11398,21 +11878,24 @@

    teal.slice coverage - 66.06%

    678 - 25x + 25x +
          shiny::isolate({
    679 - 25x + 25x +
            logger::log_trace(
    680 - 25x + 25x +
              "{ class(self)[1] }$state_list_empty removing all non-anchored filters for dataname: { private$dataname }"
    @@ -11433,28 +11916,32 @@

    teal.slice coverage - 66.06%

    683 - 25x + 25x +
            state_list <- private$state_list()
    684 - 25x + 25x +
            if (length(state_list)) {
    685 - 15x + 15x +
              state_ids <- vapply(state_list, function(x) x$get_state()$id, character(1))
    686 - 15x + 15x +
              private$state_list_remove(state_ids, force)
    @@ -11482,7 +11969,8 @@

    teal.slice coverage - 66.06%

    690 - 25x + 25x +
          invisible(NULL)
    @@ -11608,35 +12096,40 @@

    teal.slice coverage - 66.06%

    708 - 228x + 228x +
          checkmate::assert_class(state, "teal_slices")
    709 - 228x + 228x +
          checkmate::assert_multi_class(data, c("data.frame", "matrix", "DataFrame", "HermesData"))
    710 - 228x + 228x +
          checkmate::assert_function(data_reactive, args = "sid")
    711 - 228x + 228x +
          if (length(state) == 0L) {
    712 - 115x + 115x +
            return(invisible(NULL))
    @@ -11657,14 +12150,16 @@

    teal.slice coverage - 66.06%

    715 - 113x + 113x +
          slices_hashed <- vapply(state, `[[`, character(1L), "id")
    716 - 113x + 113x +
          if (any(duplicated(slices_hashed))) {
    @@ -11713,28 +12208,32 @@

    teal.slice coverage - 66.06%

    723 - 113x + 113x +
          state_list <- shiny::isolate(private$state_list_get())
    724 - 113x + 113x +
          lapply(state, function(slice) {
    725 - 202x + 202x +
            state_id <- slice$id
    726 - 202x + 202x +
            if (state_id %in% names(state_list)) {
    @@ -11748,7 +12247,8 @@

    teal.slice coverage - 66.06%

    728 - 8x + 8x +
              state_list[[state_id]]$set_state(slice)
    @@ -11762,7 +12262,8 @@

    teal.slice coverage - 66.06%

    730 - 194x + 194x +
              if (inherits(slice, "teal_slice_expr")) {
    @@ -11776,7 +12277,8 @@

    teal.slice coverage - 66.06%

    732 - 6x + 6x +
                fstate <- init_filter_state_expr(slice)
    @@ -11797,14 +12299,16 @@

    teal.slice coverage - 66.06%

    735 - 188x + 188x +
                fstate <- init_filter_state(
    736 - 188x + 188x +
                  x = data[, slice$varname, drop = TRUE],
    @@ -11853,14 +12357,16 @@

    teal.slice coverage - 66.06%

    743 - 188x + 188x +
                  x_reactive = if (private$count_type == "none") {
    744 - 182x + 182x +
                    reactive(NULL)
    @@ -11874,7 +12380,8 @@

    teal.slice coverage - 66.06%

    746 - 6x + 6x +
                    reactive(data_reactive(state_id)[, slice$varname, drop = TRUE])
    @@ -11888,14 +12395,16 @@

    teal.slice coverage - 66.06%

    748 - 188x + 188x +
                  slice = slice,
    749 - 188x + 188x +
                  extract_type = private$extract_type
    @@ -11916,7 +12425,8 @@

    teal.slice coverage - 66.06%

    752 - 194x + 194x +
              private$state_list_push(x = fstate, state_id = state_id)
    @@ -11944,7 +12454,8 @@

    teal.slice coverage - 66.06%

    756 - 113x + 113x +
          invisible(NULL)
    @@ -12853,21 +13364,24 @@

    teal.slice coverage - 66.06%

    126 - 588x + 588x +
      checkmate::assert_string(dataname)
    127 - 581x + 581x +
      checkmate::assert_flag(fixed)
    128 - 579x + 579x +
      checkmate::assert_flag(anchored)
    @@ -12881,7 +13395,8 @@

    teal.slice coverage - 66.06%

    130 - 577x + 577x +
      formal_args <- as.list(environment())
    @@ -12895,7 +13410,8 @@

    teal.slice coverage - 66.06%

    132 - 577x + 577x +
      if (!missing(expr) && !missing(varname)) {
    @@ -12909,28 +13425,32 @@

    teal.slice coverage - 66.06%

    134 - 577x + 577x +
      } else if (!missing(expr)) {
    135 - 30x + 30x +
        checkmate::assert_string(id)
    136 - 27x + 27x +
        checkmate::assert_string(title)
    137 - 24x + 24x +
        checkmate::assert_string(expr)
    @@ -12944,84 +13464,96 @@

    teal.slice coverage - 66.06%

    139 - 23x + 23x +
        formal_args$fixed <- TRUE
    140 - 23x + 23x +
        ts_expr_args <- c("dataname", "id", "expr", "fixed", "anchored", "title")
    141 - 23x + 23x +
        formal_args <- formal_args[ts_expr_args]
    142 - 23x + 23x +
        ans <- do.call(shiny::reactiveValues, c(formal_args, list(...)))
    143 - 23x + 23x +
        class(ans) <- c("teal_slice_expr", "teal_slice", class(ans))
    144 - 547x + 547x +
      } else if (!missing(varname)) {
    145 - 546x + 546x +
        checkmate::assert_string(varname)
    146 - 543x + 543x +
        checkmate::assert_multi_class(choices, .filterable_class, null.ok = TRUE)
    147 - 542x + 542x +
        checkmate::assert_multi_class(selected, .filterable_class, null.ok = TRUE)
    148 - 540x + 540x +
        checkmate::assert_flag(keep_na, null.ok = TRUE)
    149 - 539x + 539x +
        checkmate::assert_flag(keep_inf, null.ok = TRUE)
    150 - 538x + 538x +
        checkmate::assert_flag(multiple)
    @@ -13035,21 +13567,24 @@

    teal.slice coverage - 66.06%

    152 - 538x + 538x +
        ts_var_args <- c(
    153 - 538x + 538x +
          "dataname", "varname", "id", "choices", "selected", "keep_na", "keep_inf",
    154 - 538x + 538x +
          "fixed", "anchored", "multiple"
    @@ -13063,28 +13598,32 @@

    teal.slice coverage - 66.06%

    156 - 538x + 538x +
        formal_args <- formal_args[ts_var_args]
    157 - 538x + 538x +
        args <- c(formal_args, list(...))
    158 - 538x + 538x +
        if (missing(id)) {
    159 - 529x + 529x +
          args$id <- get_default_slice_id(args)
    @@ -13098,7 +13637,8 @@

    teal.slice coverage - 66.06%

    161 - 9x + 9x +
          checkmate::assert_string(id)
    @@ -13112,14 +13652,16 @@

    teal.slice coverage - 66.06%

    163 - 535x + 535x +
        ans <- do.call(shiny::reactiveValues, args)
    164 - 535x + 535x +
        class(ans) <- c("teal_slice_var", "teal_slice", class(ans))
    @@ -13133,7 +13675,8 @@

    teal.slice coverage - 66.06%

    166 - 1x + 1x +
        stop("Must provide either `expr` or `varname`.")
    @@ -13154,7 +13697,8 @@

    teal.slice coverage - 66.06%

    169 - 558x + 558x +
      ans
    @@ -13210,7 +13754,8 @@

    teal.slice coverage - 66.06%

    177 - 4x + 4x +
      inherits(x, "teal_slice")
    @@ -13266,14 +13811,16 @@

    teal.slice coverage - 66.06%

    185 - 7x + 7x +
      checkmate::assert_list(x, names = "named")
    186 - 7x + 7x +
      do.call(teal_slice, x)
    @@ -13329,7 +13876,8 @@

    teal.slice coverage - 66.06%

    194 - 297x + 297x +
      formal_args <- setdiff(names(formals(teal_slice)), "...")
    @@ -13343,7 +13891,8 @@

    teal.slice coverage - 66.06%

    196 - 297x + 297x +
      x <- if (shiny::isRunning()) {
    @@ -13364,7 +13913,8 @@

    teal.slice coverage - 66.06%

    199 - 297x + 297x +
        shiny::isolate(shiny::reactiveValuesToList(x))
    @@ -13385,14 +13935,16 @@

    teal.slice coverage - 66.06%

    202 - 297x + 297x +
      formal_args <- intersect(formal_args, names(x))
    203 - 297x + 297x +
      extra_args <- rev(setdiff(names(x), formal_args))
    @@ -13406,7 +13958,8 @@

    teal.slice coverage - 66.06%

    205 - 297x + 297x +
      x[c(formal_args, extra_args)]
    @@ -13469,14 +14022,16 @@

    teal.slice coverage - 66.06%

    214 - 116x + 116x +
      checkmate::assert_flag(show_all)
    215 - 92x + 92x +
      checkmate::assert_flag(trim_lines)
    @@ -13490,14 +14045,16 @@

    teal.slice coverage - 66.06%

    217 - 86x + 86x +
      x_list <- as.list(x)
    218 - 47x + 47x +
      if (!show_all) x_list <- Filter(Negate(is.null), x_list)
    @@ -13511,7 +14068,8 @@

    teal.slice coverage - 66.06%

    220 - 86x + 86x +
      jsonify(x_list, trim_lines)
    @@ -13567,7 +14125,8 @@

    teal.slice coverage - 66.06%

    228 - 15x + 15x +
      cat(format(x, ...))
    @@ -13693,7 +14252,8 @@

    teal.slice coverage - 66.06%

    246 - 135x + 135x +
      checkmate::assert_list(x)
    @@ -13707,28 +14267,32 @@

    teal.slice coverage - 66.06%

    248 - 135x + 135x +
      x_json <- to_json(x)
    249 - 135x + 135x +
      x_json_justified <- justify_json(x_json)
    250 - 123x + 123x +
      if (trim_lines) x_json_justified <- trim_lines_json(x_json_justified)
    251 - 135x + 135x +
      paste(x_json_justified, collapse = "\n")
    @@ -13840,35 +14404,40 @@

    teal.slice coverage - 66.06%

    267 - 135x + 135x +
      no_unbox <- function(x) {
    268 - 2578x + 2578x +
        vars <- c("selected", "choices")
    269 - 2578x + 2578x +
        if (is.list(x)) {
    270 - 419x + 419x +
          for (var in vars) {
    271 - 335x + 335x +
            if (!is.null(x[[var]])) x[[var]] <- I(x[[var]])
    @@ -13882,7 +14451,8 @@

    teal.slice coverage - 66.06%

    273 - 419x + 419x +
          lapply(x, no_unbox)
    @@ -13896,7 +14466,8 @@

    teal.slice coverage - 66.06%

    275 - 2159x + 2159x +
          x
    @@ -13924,7 +14495,8 @@

    teal.slice coverage - 66.06%

    279 - 135x + 135x +
      jsonlite::toJSON(no_unbox(x), pretty = TRUE, auto_unbox = TRUE, digits = 16, null = "null")
    @@ -14022,35 +14594,40 @@

    teal.slice coverage - 66.06%

    293 - 135x + 135x +
      format_name <- function(name, name_width) {
    294 - 2997x + 2997x +
        if (nchar(name) == 1 || nchar(gsub("\\s", "", name)) <= 2) {
    295 - 682x + 682x +
          return(name)
    296 - 2315x + 2315x +
        } else if (grepl("slices|attributes", name)) {
    297 - 98x + 98x +
          paste0(name, ":")
    @@ -14064,7 +14641,8 @@

    teal.slice coverage - 66.06%

    299 - 2217x + 2217x +
          paste(format(name, width = name_width), ":")
    @@ -14085,28 +14663,32 @@

    teal.slice coverage - 66.06%

    302 - 135x + 135x +
      json_lines <- strsplit(json, "\n")[[1]]
    303 - 135x + 135x +
      json_lines_split <- regmatches(json_lines, regexpr(":", json_lines), invert = TRUE)
    304 - 135x + 135x +
      name_width <- max(unlist(regexpr(":", json_lines))) - 1
    305 - 135x + 135x +
      vapply(json_lines_split, function(x) paste0(format_name(x[1], name_width), stats::na.omit(x[2])), character(1))
    @@ -14211,35 +14793,40 @@

    teal.slice coverage - 66.06%

    320 - 123x + 123x +
      name_width <- max(unlist(gregexpr(":", x))) - 1
    321 - 123x + 123x +
      trim_position <- name_width + 37L
    322 - 123x + 123x +
      x_trim <- substr(x, 1, trim_position)
    323 - 123x + 123x +
      substr(x_trim, trim_position - 2, trim_position) <- "..."
    324 - 123x + 123x +
      x_trim
    @@ -14386,28 +14973,32 @@

    teal.slice coverage - 66.06%

    345 - 618x + 618x +
      checkmate::assert_multi_class(x, c("teal_slice", "list"))
    346 - 618x + 618x +
      shiny::isolate({
    347 - 618x + 618x +
        if (inherits(x, "teal_slice_expr") || is.null(x$varname)) {
    348 - 10x + 10x +
          x$id
    @@ -14421,28 +15012,32 @@

    teal.slice coverage - 66.06%

    350 - 608x + 608x +
          paste(
    351 - 608x + 608x +
            Filter(
    352 - 608x + 608x +
              length,
    353 - 608x + 608x +
              as.list(x)[c("dataname", "varname", "experiment", "arg")]
    @@ -14456,7 +15051,8 @@

    teal.slice coverage - 66.06%

    355 - 608x + 608x +
            collapse = " "
    @@ -14903,42 +15499,48 @@

    teal.slice coverage - 66.06%

    59 - 25x + 25x +
      checkmate::assert_string(inputId)
    60 - 21x + 21x +
      checkmate::assert_vector(choices)
    61 - 20x + 20x +
      checkmate::assert_numeric(countsmax, len = length(choices))
    62 - 17x + 17x +
      checkmate::assert_numeric(countsnow, len = length(choices), null.ok = TRUE)
    63 - 15x + 15x +
      if (!is.null(countsnow)) {
    64 - 7x + 7x +
        checkmate::assert_true(all(countsnow <= countsmax))
    @@ -14959,14 +15561,16 @@

    teal.slice coverage - 66.06%

    67 - 14x + 14x +
      ns <- NS(inputId)
    68 - 14x + 14x +
      counttotal <- sum(countsmax)
    @@ -14980,56 +15584,64 @@

    teal.slice coverage - 66.06%

    70 - 14x + 14x +
      mapply(
    71 - 14x + 14x +
        countBar,
    72 - 14x + 14x +
        inputId = ns(seq_along(choices)),
    73 - 14x + 14x +
        label = as.character(choices),
    74 - 14x + 14x +
        countmax = countsmax,
    75 - 14x + 14x +
        countnow = if (is.null(countsnow)) rep(list(NULL), length(choices)) else countsnow,
    76 - 14x + 14x +
        MoreArgs = list(
    77 - 14x + 14x +
          counttotal = sum(countsmax)
    @@ -15043,7 +15655,8 @@

    teal.slice coverage - 66.06%

    79 - 14x + 14x +
        SIMPLIFY = FALSE, USE.NAMES = FALSE
    @@ -15169,35 +15782,40 @@

    teal.slice coverage - 66.06%

    97 - 62x + 62x +
      checkmate::assert_string(inputId)
    98 - 58x + 58x +
      checkmate::assert_string(label)
    99 - 55x + 55x +
      checkmate::assert_number(countmax)
    100 - 53x + 53x +
      checkmate::assert_number(countnow, null.ok = TRUE, upper = countmax)
    101 - 51x + 51x +
      checkmate::assert_number(counttotal, lower = countmax)
    @@ -15211,35 +15829,40 @@

    teal.slice coverage - 66.06%

    103 - 49x + 49x +
      label <- make_count_text(label, countmax = countmax, countnow = countnow)
    104 - 49x + 49x +
      ns <- NS(inputId)
    105 - 26x + 26x +
      if (is.null(countnow)) countnow <- 0
    106 - 49x + 49x +
      tags$div(
    107 - 49x + 49x +
        class = "progress state-count-container",
    @@ -15253,42 +15876,48 @@

    teal.slice coverage - 66.06%

    109 - 49x + 49x +
        tags$div(
    110 - 49x + 49x +
          id = ns("count_bar_filtered"),
    111 - 49x + 49x +
          class = "progress-bar state-count-bar-filtered",
    112 - 49x + 49x +
          style = sprintf("width: %s%%", countnow / counttotal * 100),
    113 - 49x + 49x +
          role = "progressbar",
    114 - 49x + 49x +
          label
    @@ -15302,35 +15931,40 @@

    teal.slice coverage - 66.06%

    116 - 49x + 49x +
        tags$div(
    117 - 49x + 49x +
          id = ns("count_bar_unfiltered"),
    118 - 49x + 49x +
          class = "progress-bar state-count-bar-unfiltered",
    119 - 49x + 49x +
          style = sprintf("width: %s%%", (countmax - countnow) / counttotal * 100),
    120 - 49x + 49x +
          role = "progressbar"
    @@ -15386,28 +16020,32 @@

    teal.slice coverage - 66.06%

    128 - 7x + 7x +
      checkmate::assert_string(inputId)
    129 - 7x + 7x +
      checkmate::assert_vector(choices)
    130 - 7x + 7x +
      checkmate::assert_numeric(countsmax, len = length(choices))
    131 - 7x + 7x +
      checkmate::assert_numeric(countsnow, len = length(choices), null.ok = TRUE)
    @@ -15421,63 +16059,72 @@

    teal.slice coverage - 66.06%

    133 - 7x + 7x +
      ns <- NS(inputId)
    134 - 7x + 7x +
      mapply(
    135 - 7x + 7x +
        updateCountBar,
    136 - 7x + 7x +
        inputId = ns(seq_along(choices)),
    137 - 7x + 7x +
        label = choices,
    138 - 7x + 7x +
        countmax = countsmax,
    139 - 7x + 7x +
        countnow = if (is.null(countsnow)) rep(list(NULL), length(choices)) else countsnow,
    140 - 7x + 7x +
        MoreArgs = list(
    141 - 7x + 7x +
          counttotal = sum(countsmax)
    @@ -15498,7 +16145,8 @@

    teal.slice coverage - 66.06%

    144 - 7x + 7x +
      invisible(NULL)
    @@ -15540,35 +16188,40 @@

    teal.slice coverage - 66.06%

    150 - 18x + 18x +
      checkmate::assert_string(inputId)
    151 - 18x + 18x +
      checkmate::assert_string(label)
    152 - 18x + 18x +
      checkmate::assert_number(countmax)
    153 - 18x + 18x +
      checkmate::assert_number(countnow, null.ok = TRUE)
    154 - 18x + 18x +
      checkmate::assert_number(counttotal)
    @@ -15582,70 +16235,80 @@

    teal.slice coverage - 66.06%

    156 - 18x + 18x +
      label <- make_count_text(label, countmax = countmax, countnow = countnow)
    157 - 18x + 18x +
      if (is.null(countnow)) countnow <- countmax
    158 - 18x + 18x +
      session$sendCustomMessage(
    159 - 18x + 18x +
        type = "updateCountBar",
    160 - 18x + 18x +
        message = list(
    161 - 18x + 18x +
          id = session$ns(inputId),
    162 - 18x + 18x +
          label = label,
    163 - 18x + 18x +
          countmax = countmax,
    164 - 18x + 18x +
          countnow = countnow,
    165 - 18x + 18x +
          counttotal = counttotal
    @@ -15673,7 +16336,8 @@

    teal.slice coverage - 66.06%

    169 - 18x + 18x +
      invisible(NULL)
    @@ -15708,70 +16372,80 @@

    teal.slice coverage - 66.06%

    174 - 17x + 17x +
      checkmate::assert_string(inputId)
    175 - 17x + 17x +
      checkmate::assert_string(label)
    176 - 17x + 17x +
      checkmate::assert_number(countmax)
    177 - 17x + 17x +
      checkmate::assert_number(countnow, null.ok = TRUE)
    178 - 17x + 17x +
      label <- make_count_text(label, countmax = countmax, countnow = countnow)
    179 - 17x + 17x +
      session$sendCustomMessage(
    180 - 17x + 17x +
        type = "updateCountText",
    181 - 17x + 17x +
        message = list(
    182 - 17x + 17x +
          id = session$ns(inputId),
    183 - 17x + 17x +
          label = label
    @@ -15883,56 +16557,64 @@

    teal.slice coverage - 66.06%

    199 - 96x + 96x +
      checkmate::assert_string(label)
    200 - 94x + 94x +
      checkmate::assert_number(countmax)
    201 - 92x + 92x +
      checkmate::assert_number(countnow, null.ok = TRUE)
    202 - 90x + 90x +
      sprintf(
    203 - 90x + 90x +
        "%s (%s%s)",
    204 - 90x + 90x +
        label,
    205 - 90x + 90x +
        if (is.null(countnow)) "" else sprintf("%s/", countnow),
    206 - 90x + 90x +
        countmax
    @@ -16330,42 +17012,48 @@

    teal.slice coverage - 66.06%

    54 - 6x + 6x +
          shiny::isolate({
    55 - 6x + 6x +
            super$initialize(
    56 - 6x + 6x +
              x = x,
    57 - 6x + 6x +
              x_reactive = x_reactive,
    58 - 6x + 6x +
              slice = slice,
    59 - 6x + 6x +
              extract_type = extract_type
    @@ -16379,14 +17067,16 @@

    teal.slice coverage - 66.06%

    61 - 6x + 6x +
            private$set_choices(slice$choices)
    62 - 6x + 6x +
            private$set_selected(slice$selected)
    @@ -16407,7 +17097,8 @@

    teal.slice coverage - 66.06%

    65 - 6x + 6x +
          invisible(self)
    @@ -16491,14 +17182,16 @@

    teal.slice coverage - 66.06%

    77 - 2x + 2x +
          if (isFALSE(private$is_any_filtered())) {
    78 - 1x + 1x +
            return(NULL)
    @@ -16512,14 +17205,16 @@

    teal.slice coverage - 66.06%

    80 - 1x + 1x +
          if (missing(dataname)) dataname <- private$get_dataname()
    81 - 1x + 1x +
          filter_call <- if (isTRUE(private$get_keep_na())) {
    @@ -16540,7 +17235,8 @@

    teal.slice coverage - 66.06%

    84 - 1x + 1x +
            substitute(!is.na(varname), list(varname = private$get_varname_prefixed(dataname)))
    @@ -16652,14 +17348,16 @@

    teal.slice coverage - 66.06%

    100 - 6x + 6x +
          private$teal_slice$choices <- choices
    101 - 6x + 6x +
          invisible(NULL)
    @@ -16722,7 +17420,8 @@

    teal.slice coverage - 66.06%

    110 - 2x + 2x +
          if (private$is_choice_limited) {
    @@ -16743,7 +17442,8 @@

    teal.slice coverage - 66.06%

    113 - 2x + 2x +
            !isTRUE(private$get_keep_na())
    @@ -17736,7 +18436,8 @@

    teal.slice coverage - 66.06%

    75 - 69x + 69x +
          checkmate::assert_list(data_objects, any.missing = FALSE, min.len = 0, names = "unique")
    @@ -17750,21 +18451,24 @@

    teal.slice coverage - 66.06%

    77 - 69x + 69x +
          checkmate::assert_class(join_keys, "JoinKeys")
    78 - 65x + 65x +
          checkmate::assert_class(code, "CodeClass", null.ok = TRUE)
    79 - 65x + 65x +
          checkmate::assert_flag(check)
    @@ -17778,21 +18482,24 @@

    teal.slice coverage - 66.06%

    81 - 65x + 65x +
          self$set_check(check)
    82 - 65x + 65x +
          if (!is.null(code)) {
    83 - 6x + 6x +
            self$set_code(code)
    @@ -17813,7 +18520,8 @@

    teal.slice coverage - 66.06%

    86 - 65x + 65x +
          self$set_join_keys(join_keys)
    @@ -17827,35 +18535,40 @@

    teal.slice coverage - 66.06%

    88 - 65x + 65x +
          child_parent <- sapply(
    89 - 65x + 65x +
            names(data_objects),
    90 - 65x + 65x +
            function(i) join_keys$get_parent(i),
    91 - 65x + 65x +
            USE.NAMES = TRUE,
    92 - 65x + 65x +
            simplify = FALSE
    @@ -17869,7 +18582,8 @@

    teal.slice coverage - 66.06%

    94 - 65x + 65x +
          ordered_datanames <- topological_sort(child_parent)
    @@ -17883,28 +18597,32 @@

    teal.slice coverage - 66.06%

    96 - 64x + 64x +
          for (dataname in ordered_datanames) {
    97 - 98x + 98x +
            ds_object <- data_objects[[dataname]]
    98 - 98x + 98x +
            validate_dataset_args(ds_object, dataname)
    99 - 97x + 97x +
            if (inherits(ds_object, c("data.frame", "MultiAssayExperiment"))) {
    @@ -17960,35 +18678,40 @@

    teal.slice coverage - 66.06%

    107 - 97x + 97x +
              self$set_dataset(
    108 - 97x + 97x +
                data = ds_object$dataset,
    109 - 97x + 97x +
                dataname = dataname,
    110 - 97x + 97x +
                metadata = ds_object$metadata,
    111 - 97x + 97x +
                label = ds_object$label
    @@ -18023,7 +18746,8 @@

    teal.slice coverage - 66.06%

    116 - 63x + 63x +
          self$set_available_teal_slices(x = reactive(NULL))
    @@ -18037,7 +18761,8 @@

    teal.slice coverage - 66.06%

    118 - 63x + 63x +
          invisible(self)
    @@ -18107,7 +18832,8 @@

    teal.slice coverage - 66.06%

    128 - 111x + 111x +
          names(private$filtered_datasets)
    @@ -18177,7 +18903,8 @@

    teal.slice coverage - 66.06%

    138 - 2x + 2x +
          private$get_filtered_dataset(dataname)$get_dataset_label()
    @@ -18275,14 +19002,16 @@

    teal.slice coverage - 66.06%

    152 - 64x + 64x +
          checkmate::assert_class(x, "reactive")
    153 - 64x + 64x +
          private$available_teal_slices <- reactive({
    @@ -18296,49 +19025,56 @@

    teal.slice coverage - 66.06%

    155 - 4x + 4x +
            current_state <- isolate(self$get_filter_state())
    156 - 4x + 4x +
            allowed <- attr(current_state, "include_varnames")
    157 - 4x + 4x +
            forbidden <- attr(current_state, "exclude_varnames")
    158 - 4x + 4x +
            foo <- function(slice) {
    159 - 13x + 13x +
              if (slice$dataname %in% self$datanames()) {
    160 - 13x + 13x +
                if (slice$fixed) {
    161 - 4x + 4x +
                  TRUE
    @@ -18352,14 +19088,16 @@

    teal.slice coverage - 66.06%

    163 - 9x + 9x +
                  isTRUE(slice$varname %in% allowed[[slice$dataname]]) ||
    164 - 9x + 9x +
                    isFALSE(slice$varname %in% forbidden[[slice$dataname]])
    @@ -18401,7 +19139,8 @@

    teal.slice coverage - 66.06%

    170 - 4x + 4x +
            Filter(foo, x())
    @@ -18415,7 +19154,8 @@

    teal.slice coverage - 66.06%

    172 - 64x + 64x +
          invisible(NULL)
    @@ -18485,7 +19225,8 @@

    teal.slice coverage - 66.06%

    182 - 4x + 4x +
          private$available_teal_slices
    @@ -18681,14 +19422,16 @@

    teal.slice coverage - 66.06%

    210 - 10x + 10x +
          checkmate::assert_subset(dataname, self$datanames())
    211 - 9x + 9x +
          private$get_filtered_dataset(dataname)$get_call()
    @@ -18765,14 +19508,16 @@

    teal.slice coverage - 66.06%

    222 - 2x + 2x +
          if (!is.null(private$code)) {
    223 - 1x + 1x +
            paste0(private$code$get_code(dataname), collapse = "\n")
    @@ -18786,7 +19531,8 @@

    teal.slice coverage - 66.06%

    225 - 1x + 1x +
            paste0("# No pre-processing code provided")
    @@ -18884,28 +19630,32 @@

    teal.slice coverage - 66.06%

    239 - 18x + 18x +
          checkmate::assert_subset(dataname, self$datanames())
    240 - 17x + 17x +
          checkmate::assert_flag(filtered)
    241 - 16x + 16x +
          data <- private$get_filtered_dataset(dataname)$get_dataset(filtered)
    242 - 3x + 3x +
          if (filtered) data() else data
    @@ -18968,7 +19718,8 @@

    teal.slice coverage - 66.06%

    251 - 2x + 2x +
          private$.check
    @@ -19045,14 +19796,16 @@

    teal.slice coverage - 66.06%

    262 - 3x + 3x +
          checkmate::assert_subset(dataname, self$datanames())
    263 - 2x + 2x +
          private$get_filtered_dataset(dataname)$get_metadata()
    @@ -19115,7 +19868,8 @@

    teal.slice coverage - 66.06%

    272 - 206x + 206x +
          return(private$join_keys)
    @@ -19213,28 +19967,32 @@

    teal.slice coverage - 66.06%

    286 - 9x + 9x +
          rows <- lapply(
    287 - 9x + 9x +
            datanames,
    288 - 9x + 9x +
            function(dataname) {
    289 - 11x + 11x +
              private$get_filtered_dataset(dataname)$get_filter_overview()
    @@ -19255,7 +20013,8 @@

    teal.slice coverage - 66.06%

    292 - 5x + 5x +
          dplyr::bind_rows(rows)
    @@ -19332,7 +20091,8 @@

    teal.slice coverage - 66.06%

    303 - 1x + 1x +
          private$get_filtered_dataset(dataname)$get_keys()
    @@ -19528,7 +20288,8 @@

    teal.slice coverage - 66.06%

    331 - 102x + 102x +
          logger::log_trace("FilteredData$set_dataset setting dataset, name: { dataname }")
    @@ -19549,7 +20310,8 @@

    teal.slice coverage - 66.06%

    334 - 102x + 102x +
          check_simple_name(dataname)
    @@ -19563,63 +20325,72 @@

    teal.slice coverage - 66.06%

    336 - 102x + 102x +
          join_keys <- self$get_join_keys()
    337 - 102x + 102x +
          parent_dataname <- join_keys$get_parent(dataname)
    338 - 102x + 102x +
          if (length(parent_dataname) == 0) {
    339 - 95x + 95x +
            private$filtered_datasets[[dataname]] <- init_filtered_dataset(
    340 - 95x + 95x +
              dataset = data,
    341 - 95x + 95x +
              dataname = dataname,
    342 - 95x + 95x +
              metadata = metadata,
    343 - 95x + 95x +
              label = label,
    344 - 95x + 95x +
              keys = self$get_join_keys()$get(dataname, dataname)
    @@ -19640,63 +20411,72 @@

    teal.slice coverage - 66.06%

    347 - 7x + 7x +
            private$filtered_datasets[[dataname]] <- init_filtered_dataset(
    348 - 7x + 7x +
              dataset = data,
    349 - 7x + 7x +
              dataname = dataname,
    350 - 7x + 7x +
              keys = join_keys$get(dataname, dataname),
    351 - 7x + 7x +
              parent_name = parent_dataname,
    352 - 7x + 7x +
              parent = reactive(self$get_data(parent_dataname, filtered = TRUE)),
    353 - 7x + 7x +
              join_keys = self$get_join_keys()$get(dataname, parent_dataname),
    354 - 7x + 7x +
              label = label,
    355 - 7x + 7x +
              metadata = metadata
    @@ -19724,7 +20504,8 @@

    teal.slice coverage - 66.06%

    359 - 102x + 102x +
          invisible(self)
    @@ -19801,21 +20582,24 @@

    teal.slice coverage - 66.06%

    370 - 65x + 65x +
          checkmate::assert_class(join_keys, "JoinKeys")
    371 - 65x + 65x +
          private$join_keys <- join_keys
    372 - 65x + 65x +
          invisible(self)
    @@ -19892,21 +20676,24 @@

    teal.slice coverage - 66.06%

    383 - 65x + 65x +
          checkmate::assert_flag(check)
    384 - 65x + 65x +
          private$.check <- check
    385 - 65x + 65x +
          invisible(self)
    @@ -19990,28 +20777,32 @@

    teal.slice coverage - 66.06%

    397 - 6x + 6x +
          checkmate::assert_class(code, "CodeClass")
    398 - 6x + 6x +
          logger::log_trace("FilteredData$set_code setting code")
    399 - 6x + 6x +
          private$code <- code
    400 - 6x + 6x +
          invisible(self)
    @@ -20088,35 +20879,40 @@

    teal.slice coverage - 66.06%

    411 - 61x + 61x +
          states <- unname(lapply(private$filtered_datasets, function(x) x$get_filter_state()))
    412 - 61x + 61x +
          slices <- Filter(Negate(is.null), states)
    413 - 61x + 61x +
          slices <- do.call(c, slices)
    414 - 61x + 61x +
          if (!is.null(slices)) {
    415 - 61x + 61x +
            attr(slices, "allow_add") <- private$allow_add
    @@ -20130,7 +20926,8 @@

    teal.slice coverage - 66.06%

    417 - 61x + 61x +
          slices
    @@ -20214,28 +21011,32 @@

    teal.slice coverage - 66.06%

    429 - 7x + 7x +
          sprintf(
    430 - 7x + 7x +
            "%s:\n%s",
    431 - 7x + 7x +
            class(self)[1],
    432 - 7x + 7x +
            format(self$get_filter_state(), show_all = show_all, trim_lines = trim_lines)
    @@ -20305,7 +21106,8 @@

    teal.slice coverage - 66.06%

    442 - 3x + 3x +
          cat(shiny::isolate(self$format(...)), "\n")
    @@ -20564,56 +21366,64 @@

    teal.slice coverage - 66.06%

    479 - 31x + 31x +
          shiny::isolate({
    480 - 31x + 31x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initializing")
    481 - 31x + 31x +
            if (!is.teal_slices(state)) {
    482 - 1x + 1x +
              warning(
    483 - 1x + 1x +
                paste(
    484 - 1x + 1x +
                  "From FilteredData$set_filter_state:",
    485 - 1x + 1x +
                  "Specifying filters as lists is obsolete and will be deprecated in the next release.",
    486 - 1x + 1x +
                  "Please see ?set_filter_state and ?teal_slices for details."
    @@ -20627,7 +21437,8 @@

    teal.slice coverage - 66.06%

    488 - 1x + 1x +
                call. = FALSE
    @@ -20641,7 +21452,8 @@

    teal.slice coverage - 66.06%

    490 - 1x + 1x +
              state <- list_to_teal_slices(state)
    @@ -20662,28 +21474,32 @@

    teal.slice coverage - 66.06%

    493 - 31x + 31x +
            checkmate::assert_class(state, "teal_slices")
    494 - 31x + 31x +
            allow_add <- attr(state, "allow_add")
    495 - 31x + 31x +
            if (!is.null(allow_add)) {
    496 - 31x + 31x +
              private$allow_add <- allow_add
    @@ -20704,21 +21520,24 @@

    teal.slice coverage - 66.06%

    499 - 31x + 31x +
            lapply(self$datanames(), function(dataname) {
    500 - 61x + 61x +
              states <- Filter(function(x) identical(x$dataname, dataname), state)
    501 - 61x + 61x +
              private$get_filtered_dataset(dataname)$set_filter_state(states)
    @@ -20739,7 +21558,8 @@

    teal.slice coverage - 66.06%

    504 - 31x + 31x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initialized")
    @@ -20760,7 +21580,8 @@

    teal.slice coverage - 66.06%

    507 - 31x + 31x +
          invisible(NULL)
    @@ -20851,14 +21672,16 @@

    teal.slice coverage - 66.06%

    520 - 8x + 8x +
          shiny::isolate({
    521 - 8x + 8x +
            if (!is.teal_slices(state)) {
    @@ -20942,21 +21765,24 @@

    teal.slice coverage - 66.06%

    533 - 8x + 8x +
            checkmate::assert_class(state, "teal_slices")
    534 - 8x + 8x +
            datanames <- unique(vapply(state, "[[", character(1L), "dataname"))
    535 - 8x + 8x +
            checkmate::assert_subset(datanames, self$datanames())
    @@ -20970,14 +21796,16 @@

    teal.slice coverage - 66.06%

    537 - 8x + 8x +
            logger::log_trace(
    538 - 8x + 8x +
              "{ class(self)[1] }$remove_filter_state removing filter(s), dataname: { private$dataname }"
    @@ -20998,21 +21826,24 @@

    teal.slice coverage - 66.06%

    541 - 8x + 8x +
            lapply(datanames, function(dataname) {
    542 - 9x + 9x +
              slices <- Filter(function(x) identical(x$dataname, dataname), state)
    543 - 9x + 9x +
              private$get_filtered_dataset(dataname)$remove_filter_state(slices)
    @@ -21033,14 +21864,16 @@

    teal.slice coverage - 66.06%

    546 - 8x + 8x +
            logger::log_trace(
    547 - 8x + 8x +
              "{ class(self)[1] }$remove_filter_state removed filter(s), dataname: { private$dataname }"
    @@ -21068,7 +21901,8 @@

    teal.slice coverage - 66.06%

    551 - 8x + 8x +
          invisible(NULL)
    @@ -21180,14 +22014,16 @@

    teal.slice coverage - 66.06%

    567 - 7x + 7x +
          logger::log_trace(
    568 - 7x + 7x +
            "FilteredData$clear_filter_states called, datanames: { toString(datanames) }"
    @@ -21208,21 +22044,24 @@

    teal.slice coverage - 66.06%

    571 - 7x + 7x +
          for (dataname in datanames) {
    572 - 12x + 12x +
            fdataset <- private$get_filtered_dataset(dataname = dataname)
    573 - 12x + 12x +
            fdataset$clear_filter_states(force)
    @@ -21243,28 +22082,32 @@

    teal.slice coverage - 66.06%

    576 - 7x + 7x +
          logger::log_trace(
    577 - 7x + 7x +
            paste(
    578 - 7x + 7x +
              "FilteredData$clear_filter_states removed all non-anchored FilterStates,",
    579 - 7x + 7x +
              "datanames: { toString(datanames) }"
    @@ -21292,7 +22135,8 @@

    teal.slice coverage - 66.06%

    583 - 7x + 7x +
          invisible(NULL)
    @@ -21565,35 +22409,40 @@

    teal.slice coverage - 66.06%

    622 - 1x + 1x +
          checkmate::assert_function(active_datanames)
    623 - 1x + 1x +
          moduleServer(
    624 - 1x + 1x +
            id = id,
    625 - 1x + 1x +
            function(input, output, session) {
    626 - 1x + 1x +
              logger::log_trace("FilteredData$srv_filter_panel initializing")
    @@ -21607,14 +22456,16 @@

    teal.slice coverage - 66.06%

    628 - 1x + 1x +
              active_datanames_resolved <- reactive({
    629 - 1x + 1x +
                checkmate::assert_subset(active_datanames(), self$datanames())
    @@ -21642,28 +22493,32 @@

    teal.slice coverage - 66.06%

    633 - 1x + 1x +
              self$srv_overview("overview", active_datanames_resolved)
    634 - 1x + 1x +
              self$srv_active("active", active_datanames_resolved)
    635 - 1x + 1x +
              if (private$allow_add) {
    636 - 1x + 1x +
                self$srv_add("add", active_datanames_resolved)
    @@ -21684,14 +22539,16 @@

    teal.slice coverage - 66.06%

    639 - 1x + 1x +
              logger::log_trace("FilteredData$srv_filter_panel initialized")
    640 - 1x + 1x +
              NULL
    @@ -22132,21 +22989,24 @@

    teal.slice coverage - 66.06%

    703 - 3x + 3x +
          checkmate::assert_function(active_datanames)
    704 - 3x + 3x +
          shiny::moduleServer(id, function(input, output, session) {
    705 - 3x + 3x +
            logger::log_trace("FilteredData$srv_active initializing")
    @@ -22160,7 +23020,8 @@

    teal.slice coverage - 66.06%

    707 - 3x + 3x +
            private$srv_available_filters("available_filters")
    @@ -22174,7 +23035,8 @@

    teal.slice coverage - 66.06%

    709 - 3x + 3x +
            observeEvent(input$minimise_filter_active, {
    @@ -22223,42 +23085,48 @@

    teal.slice coverage - 66.06%

    716 - 3x + 3x +
            observeEvent(private$get_filter_count(), {
    717 - 3x + 3x +
              shinyjs::toggle("remove_all_filters", condition = private$get_filter_count() != 0)
    718 - 3x + 3x +
              shinyjs::show("filter_active_vars_contents")
    719 - 3x + 3x +
              shinyjs::hide("filters_active_count")
    720 - 3x + 3x +
              toggle_icon(session$ns("minimise_filter_active"), c("fa-angle-right", "fa-angle-down"), TRUE)
    721 - 3x + 3x +
              toggle_title(session$ns("minimise_filter_active"), c("Restore panel", "Minimise Panel"), TRUE)
    @@ -22279,28 +23147,32 @@

    teal.slice coverage - 66.06%

    724 - 3x + 3x +
            observeEvent(active_datanames(), {
    725 - 2x + 2x +
              lapply(self$datanames(), function(dataname) {
    726 - 4x + 4x +
                if (dataname %in% active_datanames()) {
    727 - 4x + 4x +
                  shinyjs::show(dataname)
    @@ -22363,35 +23235,40 @@

    teal.slice coverage - 66.06%

    736 - 3x + 3x +
            lapply(
    737 - 3x + 3x +
              self$datanames(),
    738 - 3x + 3x +
              function(dataname) {
    739 - 6x + 6x +
                fdataset <- private$get_filtered_dataset(dataname)
    740 - 6x + 6x +
                fdataset$srv_active(id = dataname)
    @@ -22419,49 +23296,56 @@

    teal.slice coverage - 66.06%

    744 - 3x + 3x +
            output$teal_filters_count <- shiny::renderText({
    745 - 3x + 3x +
              n_filters_active <- private$get_filter_count()
    746 - 3x + 3x +
              shiny::req(n_filters_active > 0L)
    747 - 2x + 2x +
              sprintf(
    748 - 2x + 2x +
                "%s filter%s applied across datasets",
    749 - 2x + 2x +
                n_filters_active,
    750 - 2x + 2x +
                ifelse(n_filters_active == 1, "", "s")
    @@ -22489,28 +23373,32 @@

    teal.slice coverage - 66.06%

    754 - 3x + 3x +
            observeEvent(input$remove_all_filters, {
    755 - 1x + 1x +
              logger::log_trace("FilteredData$srv_filter_panel@1 removing all non-anchored filters")
    756 - 1x + 1x +
              self$clear_filter_states()
    757 - 1x + 1x +
              logger::log_trace("FilteredData$srv_filter_panel@1 removed all non-anchored filters")
    @@ -22524,14 +23412,16 @@

    teal.slice coverage - 66.06%

    759 - 3x + 3x +
            logger::log_trace("FilteredData$srv_active initialized")
    760 - 3x + 3x +
            NULL
    @@ -22909,28 +23799,32 @@

    teal.slice coverage - 66.06%

    814 - 1x + 1x +
          checkmate::assert_class(active_datanames, "reactive")
    815 - 1x + 1x +
          moduleServer(id, function(input, output, session) {
    816 - 1x + 1x +
            logger::log_trace("FilteredData$srv_add initializing")
    817 - 1x + 1x +
            shiny::observeEvent(input$minimise_filter_add_vars, {
    @@ -22972,7 +23866,8 @@

    teal.slice coverage - 66.06%

    823 - 1x + 1x +
            observeEvent(active_datanames(), {
    @@ -23056,35 +23951,40 @@

    teal.slice coverage - 66.06%

    835 - 1x + 1x +
            lapply(
    836 - 1x + 1x +
              self$datanames(),
    837 - 1x + 1x +
              function(dataname) {
    838 - 2x + 2x +
                fdataset <- private$get_filtered_dataset(dataname)
    839 - 2x + 2x +
                fdataset$srv_add(id = dataname)
    @@ -23105,14 +24005,16 @@

    teal.slice coverage - 66.06%

    842 - 1x + 1x +
            logger::log_trace("FilteredData$srv_filter_panel initialized")
    843 - 1x + 1x +
            NULL
    @@ -23504,35 +24406,40 @@

    teal.slice coverage - 66.06%

    899 - 1x + 1x +
          checkmate::assert_class(active_datanames, "reactive")
    900 - 1x + 1x +
          moduleServer(
    901 - 1x + 1x +
            id = id,
    902 - 1x + 1x +
            function(input, output, session) {
    903 - 1x + 1x +
              logger::log_trace("FilteredData$srv_filter_overview initializing")
    @@ -23546,7 +24453,8 @@

    teal.slice coverage - 66.06%

    905 - 1x + 1x +
              shiny::observeEvent(input$minimise_filter_overview, {
    @@ -23588,7 +24496,8 @@

    teal.slice coverage - 66.06%

    911 - 1x + 1x +
              output$table <- renderUI({
    @@ -24008,14 +24917,16 @@

    teal.slice coverage - 66.06%

    971 - 1x + 1x +
              logger::log_trace("FilteredData$srv_filter_overview initialized")
    972 - 1x + 1x +
              NULL
    @@ -24897,7 +25808,8 @@

    teal.slice coverage - 66.06%

    1098 - 131x + 131x +
          if (length(dataname) == 0) {
    @@ -24918,7 +25830,8 @@

    teal.slice coverage - 66.06%

    1101 - 131x + 131x +
            private$filtered_datasets[[dataname]]
    @@ -25002,7 +25915,8 @@

    teal.slice coverage - 66.06%

    1113 - 11x + 11x +
          length(self$get_filter_state())
    @@ -25268,28 +26182,32 @@

    teal.slice coverage - 66.06%

    1151 - 4x + 4x +
          moduleServer(id, function(input, output, session) {
    1152 - 4x + 4x +
            slices_available <- self$get_available_teal_slices()
    1153 - 4x + 4x +
            slices_interactive <- reactive(
    1154 - 4x + 4x +
              Filter(function(slice) isFALSE(slice$fixed), slices_available())
    @@ -25303,14 +26221,16 @@

    teal.slice coverage - 66.06%

    1156 - 4x + 4x +
            slices_fixed <- reactive(
    1157 - 4x + 4x +
              Filter(function(slice) isTRUE(slice$fixed), slices_available())
    @@ -25324,21 +26244,24 @@

    teal.slice coverage - 66.06%

    1159 - 4x + 4x +
            available_slices_id <- reactive(vapply(slices_available(), `[[`, character(1), "id"))
    1160 - 4x + 4x +
            active_slices_id <- reactive(vapply(self$get_filter_state(), `[[`, character(1), "id"))
    1161 - 4x + 4x +
            duplicated_slice_references <- reactive({
    @@ -25352,35 +26275,40 @@

    teal.slice coverage - 66.06%

    1163 - 8x + 8x +
              slice_reference <- vapply(slices_available(), get_default_slice_id, character(1))
    1164 - 8x + 8x +
              is_duplicated_reference <- duplicated(slice_reference) | duplicated(slice_reference, fromLast = TRUE)
    1165 - 8x + 8x +
              is_active <- available_slices_id() %in% active_slices_id()
    1166 - 8x + 8x +
              is_not_expr <- !vapply(slices_available(), inherits, logical(1), "teal_slice_expr")
    1167 - 8x + 8x +
              slice_reference[is_duplicated_reference & is_active & is_not_expr]
    @@ -25401,70 +26329,80 @@

    teal.slice coverage - 66.06%

    1170 - 4x + 4x +
            checkbox_group_element <- function(name, value, label, checked, disabled = FALSE) {
    1171 - 35x + 35x +
              tags$div(
    1172 - 35x + 35x +
                class = "checkbox available-filters",
    1173 - 35x + 35x +
                tags$label(
    1174 - 35x + 35x +
                  tags$input(
    1175 - 35x + 35x +
                    type = "checkbox",
    1176 - 35x + 35x +
                    name = name,
    1177 - 35x + 35x +
                    value = value,
    1178 - 35x + 35x +
                    checked = checked,
    1179 - 35x + 35x +
                    disabled = if (disabled) "disabled"
    @@ -25478,7 +26416,8 @@

    teal.slice coverage - 66.06%

    1181 - 35x + 35x +
                  tags$span(label, disabled = if (disabled) disabled)
    @@ -25513,42 +26452,48 @@

    teal.slice coverage - 66.06%

    1186 - 4x + 4x +
            output$checkbox <- renderUI({
    1187 - 8x + 8x +
              checkbox <- checkboxGroupInput(
    1188 - 8x + 8x +
                session$ns("available_slices_id"),
    1189 - 8x + 8x +
                label = NULL,
    1190 - 8x + 8x +
                choices = NULL,
    1191 - 8x + 8x +
                selected = NULL
    @@ -25562,14 +26507,16 @@

    teal.slice coverage - 66.06%

    1193 - 8x + 8x +
              active_slices_ids <- active_slices_id()
    1194 - 8x + 8x +
              duplicated_slice_refs <- duplicated_slice_references()
    @@ -25583,7 +26530,8 @@

    teal.slice coverage - 66.06%

    1196 - 8x + 8x +
              checkbox_group_slice <- function(slice) {
    @@ -25597,63 +26545,72 @@

    teal.slice coverage - 66.06%

    1198 - 35x + 35x +
                shiny::isolate({
    1199 - 35x + 35x +
                  checkbox_group_element(
    1200 - 35x + 35x +
                    name = session$ns("available_slices_id"),
    1201 - 35x + 35x +
                    value = slice$id,
    1202 - 35x + 35x +
                    label = slice$id,
    1203 - 35x + 35x +
                    checked = if (slice$id %in% active_slices_ids) "checked",
    1204 - 35x + 35x +
                    disabled = slice$anchored ||
    1205 - 35x + 35x +
                      get_default_slice_id(slice) %in% duplicated_slice_refs &&
    1206 - 35x + 35x +
                        !slice$id %in% active_slices_ids
    @@ -25688,14 +26645,16 @@

    teal.slice coverage - 66.06%

    1211 - 8x + 8x +
              interactive_choice_mock <- lapply(slices_interactive(), checkbox_group_slice)
    1212 - 8x + 8x +
              non_interactive_choice_mock <- lapply(slices_fixed(), checkbox_group_slice)
    @@ -25709,63 +26668,72 @@

    teal.slice coverage - 66.06%

    1214 - 8x + 8x +
              htmltools::tagInsertChildren(
    1215 - 8x + 8x +
                checkbox,
    1216 - 8x + 8x +
                br(),
    1217 - 8x + 8x +
                if (length(non_interactive_choice_mock)) tags$strong("Fixed filters"),
    1218 - 8x + 8x +
                non_interactive_choice_mock,
    1219 - 8x + 8x +
                if (length(interactive_choice_mock)) tags$strong("Interactive filters"),
    1220 - 8x + 8x +
                interactive_choice_mock,
    1221 - 8x + 8x +
                .cssSelector = "div.shiny-options-group",
    1222 - 8x + 8x +
                after = 0
    @@ -25793,49 +26761,56 @@

    teal.slice coverage - 66.06%

    1226 - 4x + 4x +
            observeEvent(input$available_slices_id, ignoreNULL = FALSE, ignoreInit = TRUE, {
    1227 - 5x + 5x +
              new_slices_id <- setdiff(input$available_slices_id, active_slices_id())
    1228 - 5x + 5x +
              removed_slices_id <- setdiff(active_slices_id(), input$available_slices_id)
    1229 - 5x + 5x +
              if (length(new_slices_id)) {
    1230 - 3x + 3x +
                new_teal_slices <- Filter(
    1231 - 3x + 3x +
                  function(slice) slice$id %in% new_slices_id,
    1232 - 3x + 3x +
                  private$available_teal_slices()
    @@ -25849,7 +26824,8 @@

    teal.slice coverage - 66.06%

    1234 - 3x + 3x +
                self$set_filter_state(new_teal_slices)
    @@ -25870,28 +26846,32 @@

    teal.slice coverage - 66.06%

    1237 - 5x + 5x +
              if (length(removed_slices_id)) {
    1238 - 4x + 4x +
                removed_teal_slices <- Filter(
    1239 - 4x + 4x +
                  function(slice) slice$id %in% removed_slices_id,
    1240 - 4x + 4x +
                  self$get_filter_state()
    @@ -25905,7 +26885,8 @@

    teal.slice coverage - 66.06%

    1242 - 4x + 4x +
                self$remove_filter_state(removed_teal_slices)
    @@ -25933,21 +26914,24 @@

    teal.slice coverage - 66.06%

    1246 - 4x + 4x +
            observeEvent(private$available_teal_slices(), ignoreNULL = FALSE, {
    1247 - 3x + 3x +
              if (length(private$available_teal_slices())) {
    1248 - 1x + 1x +
                shinyjs::show("available_menu")
    @@ -25961,7 +26945,8 @@

    teal.slice coverage - 66.06%

    1250 - 2x + 2x +
                shinyjs::hide("available_menu")
    @@ -26191,7 +27176,8 @@

    teal.slice coverage - 66.06%

    26 - 25x + 25x +
          if (!requireNamespace("MultiAssayExperiment", quietly = TRUE)) {
    @@ -26212,21 +27198,24 @@

    teal.slice coverage - 66.06%

    29 - 25x + 25x +
          checkmate::assert_class(dataset, "MultiAssayExperiment")
    30 - 23x + 23x +
          super$initialize(dataset, dataname, keys, label, metadata)
    31 - 23x + 23x +
          experiment_names <- names(dataset)
    @@ -26247,49 +27236,56 @@

    teal.slice coverage - 66.06%

    34 - 23x + 23x +
          private$add_filter_states(
    35 - 23x + 23x +
            filter_states = init_filter_states(
    36 - 23x + 23x +
              data = dataset,
    37 - 23x + 23x +
              data_reactive = private$data_filtered_fun,
    38 - 23x + 23x +
              dataname = dataname,
    39 - 23x + 23x +
              datalabel = "subjects",
    40 - 23x + 23x +
              keys = self$get_keys()
    @@ -26303,7 +27299,8 @@

    teal.slice coverage - 66.06%

    42 - 23x + 23x +
            id = "subjects"
    @@ -26338,70 +27335,80 @@

    teal.slice coverage - 66.06%

    47 - 23x + 23x +
          lapply(
    48 - 23x + 23x +
            experiment_names,
    49 - 23x + 23x +
            function(experiment_name) {
    50 - 115x + 115x +
              data_reactive <- function(sid = "") private$data_filtered_fun(sid)[[experiment_name]]
    51 - 115x + 115x +
              private$add_filter_states(
    52 - 115x + 115x +
                filter_states = init_filter_states(
    53 - 115x + 115x +
                  data = dataset[[experiment_name]],
    54 - 115x + 115x +
                  data_reactive = data_reactive,
    55 - 115x + 115x +
                  dataname = dataname,
    56 - 115x + 115x +
                  datalabel = experiment_name
    @@ -26415,7 +27422,8 @@

    teal.slice coverage - 66.06%

    58 - 115x + 115x +
                id = experiment_name
    @@ -26681,35 +27689,40 @@

    teal.slice coverage - 66.06%

    96 - 17x + 17x +
          shiny::isolate({
    97 - 17x + 17x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initializing, dataname: { private$dataname }")
    98 - 17x + 17x +
            checkmate::assert_class(state, "teal_slices")
    99 - 16x + 16x +
            lapply(state, function(x) {
    100 - 60x + 60x +
              checkmate::assert_true(x$dataname == private$dataname, .var.name = "dataname matches private$dataname")
    @@ -26737,14 +27750,16 @@

    teal.slice coverage - 66.06%

    104 - 16x + 16x +
            subject_state <- Filter(function(x) is.null(x$experiment), state)
    105 - 16x + 16x +
            private$get_filter_states()[["subjects"]]$set_filter_state(subject_state)
    @@ -26772,28 +27787,32 @@

    teal.slice coverage - 66.06%

    109 - 16x + 16x +
            experiments <- unique(unlist(lapply(state, "[[", "experiment")))
    110 - 16x + 16x +
            available_experiments <- setdiff(names(private$get_filter_states()), "subjects")
    111 - 16x + 16x +
            excluded_filters <- setdiff(experiments, available_experiments)
    112 - 16x + 16x +
            if (length(excluded_filters)) {
    @@ -26863,21 +27882,24 @@

    teal.slice coverage - 66.06%

    122 - 16x + 16x +
            lapply(available_experiments, function(experiment) {
    123 - 80x + 80x +
              slices <- Filter(function(x) identical(x$experiment, experiment), state)
    124 - 80x + 80x +
              private$get_filter_states()[[experiment]]$set_filter_state(slices)
    @@ -26898,7 +27920,8 @@

    teal.slice coverage - 66.06%

    127 - 16x + 16x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initialized, dataname: { private$dataname }")
    @@ -26912,7 +27935,8 @@

    teal.slice coverage - 66.06%

    129 - 16x + 16x +
            invisible(NULL)
    @@ -27010,7 +28034,8 @@

    teal.slice coverage - 66.06%

    143 - 1x + 1x +
          checkmate::assert_class(state, "teal_slices")
    @@ -27024,14 +28049,16 @@

    teal.slice coverage - 66.06%

    145 - 1x + 1x +
          shiny::isolate({
    146 - 1x + 1x +
            logger::log_trace("{ class(self)[1] }$remove_filter_state removing filter(s), dataname: { private$dataname }")
    @@ -27045,14 +28072,16 @@

    teal.slice coverage - 66.06%

    148 - 1x + 1x +
            subject_state <- Filter(function(x) is.null(x$experiment), state)
    149 - 1x + 1x +
            private$get_filter_states()[["subjects"]]$remove_filter_state(subject_state)
    @@ -27080,28 +28109,32 @@

    teal.slice coverage - 66.06%

    153 - 1x + 1x +
            experiments <- unique(unlist(lapply(state, "[[", "experiment")))
    154 - 1x + 1x +
            available_experiments <- setdiff(names(private$get_filter_states()), "subjects")
    155 - 1x + 1x +
            excluded_filters <- setdiff(experiments, available_experiments)
    156 - 1x + 1x +
            if (length(excluded_filters)) {
    @@ -27164,7 +28197,8 @@

    teal.slice coverage - 66.06%

    165 - 1x + 1x +
            lapply(experiments, function(experiment) {
    @@ -27206,7 +28240,8 @@

    teal.slice coverage - 66.06%

    171 - 1x + 1x +
            logger::log_trace("{ class(self)[1] }$remove_filter_state removed filter(s), dataname: { private$dataname }")
    @@ -27227,7 +28262,8 @@

    teal.slice coverage - 66.06%

    174 - 1x + 1x +
          invisible(NULL)
    @@ -27521,21 +28557,24 @@

    teal.slice coverage - 66.06%

    216 - 2x + 2x +
          data <- self$get_dataset()
    217 - 2x + 2x +
          data_filtered <- self$get_dataset(TRUE)
    218 - 2x + 2x +
          experiment_names <- names(data)
    @@ -27549,28 +28588,32 @@

    teal.slice coverage - 66.06%

    220 - 2x + 2x +
          mae_info <- data.frame(
    221 - 2x + 2x +
            dataname = private$dataname,
    222 - 2x + 2x +
            subjects = nrow(SummarizedExperiment::colData(data)),
    223 - 2x + 2x +
            subjects_filtered = nrow(SummarizedExperiment::colData(data_filtered()))
    @@ -27591,49 +28634,56 @@

    teal.slice coverage - 66.06%

    226 - 2x + 2x +
          experiment_obs_info <- do.call("rbind", lapply(
    227 - 2x + 2x +
            experiment_names,
    228 - 2x + 2x +
            function(experiment_name) {
    229 - 10x + 10x +
              data.frame(
    230 - 10x + 10x +
                dataname = sprintf("- %s", experiment_name),
    231 - 10x + 10x +
                obs = nrow(data[[experiment_name]]),
    232 - 10x + 10x +
                obs_filtered = nrow(data_filtered()[[experiment_name]])
    @@ -27668,21 +28718,24 @@

    teal.slice coverage - 66.06%

    237 - 2x + 2x +
          get_experiment_keys <- function(mae, experiment) {
    238 - 20x + 20x +
            sample_subset <- subset(MultiAssayExperiment::sampleMap(mae), colname %in% colnames(experiment))
    239 - 20x + 20x +
            length(unique(sample_subset$primary))
    @@ -27703,42 +28756,48 @@

    teal.slice coverage - 66.06%

    242 - 2x + 2x +
          experiment_subjects_info <- do.call("rbind", lapply(
    243 - 2x + 2x +
            experiment_names,
    244 - 2x + 2x +
            function(experiment_name) {
    245 - 10x + 10x +
              data.frame(
    246 - 10x + 10x +
                subjects = get_experiment_keys(data, data[[experiment_name]]),
    247 - 10x + 10x +
                subjects_filtered = get_experiment_keys(data_filtered(), data_filtered()[[experiment_name]])
    @@ -27773,14 +28832,16 @@

    teal.slice coverage - 66.06%

    252 - 2x + 2x +
          experiment_info <- cbind(experiment_obs_info, experiment_subjects_info)
    253 - 2x + 2x +
          dplyr::bind_rows(mae_info, experiment_info)
    @@ -28759,21 +29820,24 @@

    teal.slice coverage - 66.06%

    136 - 24x + 24x +
          shiny::isolate({
    137 - 24x + 24x +
            checkmate::assert_date(x)
    138 - 23x + 23x +
            checkmate::assert_class(x_reactive, "reactive")
    @@ -28787,35 +29851,40 @@

    teal.slice coverage - 66.06%

    140 - 23x + 23x +
            super$initialize(
    141 - 23x + 23x +
              x = x,
    142 - 23x + 23x +
              x_reactive = x_reactive,
    143 - 23x + 23x +
              slice = slice,
    144 - 23x + 23x +
              extract_type = extract_type
    @@ -28829,28 +29898,32 @@

    teal.slice coverage - 66.06%

    146 - 23x + 23x +
            checkmate::assert_date(slice$choices, null.ok = TRUE)
    147 - 22x + 22x +
            private$set_choices(slice$choices)
    148 - 14x + 14x +
            if (is.null(slice$selected)) slice$selected <- slice$choices
    149 - 22x + 22x +
            private$set_selected(slice$selected)
    @@ -28871,7 +29944,8 @@

    teal.slice coverage - 66.06%

    152 - 21x + 21x +
          invisible(self)
    @@ -28955,14 +30029,16 @@

    teal.slice coverage - 66.06%

    164 - 7x + 7x +
          if (isFALSE(private$is_any_filtered())) {
    165 - 1x + 1x +
            return(NULL)
    @@ -28976,28 +30052,32 @@

    teal.slice coverage - 66.06%

    167 - 6x + 6x +
          choices <- as.character(private$get_selected())
    168 - 6x + 6x +
          varname <- private$get_varname_prefixed(dataname)
    169 - 6x + 6x +
          filter_call <-
    170 - 6x + 6x +
            call(
    @@ -29011,14 +30091,16 @@

    teal.slice coverage - 66.06%

    172 - 6x + 6x +
              call(">=", varname, call("as.Date", choices[1L])),
    173 - 6x + 6x +
              call("<=", varname, call("as.Date", choices[2L]))
    @@ -29032,7 +30114,8 @@

    teal.slice coverage - 66.06%

    175 - 6x + 6x +
          private$add_keep_na_call(filter_call, varname)
    @@ -29088,14 +30171,16 @@

    teal.slice coverage - 66.06%

    183 - 22x + 22x +
          if (is.null(choices)) {
    184 - 19x + 19x +
            choices <- range(private$x, na.rm = TRUE)
    @@ -29109,35 +30194,40 @@

    teal.slice coverage - 66.06%

    186 - 3x + 3x +
            choices_adjusted <- c(max(choices[1L], min(private$x)), min(choices[2L], max(private$x)))
    187 - 3x + 3x +
            if (any(choices != choices_adjusted)) {
    188 - 1x + 1x +
              warning(sprintf(
    189 - 1x + 1x +
                "Choices adjusted (some values outside of variable range). Varname: %s, dataname: %s.",
    190 - 1x + 1x +
                private$get_varname(), private$get_dataname()
    @@ -29151,7 +30241,8 @@

    teal.slice coverage - 66.06%

    192 - 1x + 1x +
              choices <- choices_adjusted
    @@ -29165,35 +30256,40 @@

    teal.slice coverage - 66.06%

    194 - 3x + 3x +
            if (choices[1L] >= choices[2L]) {
    195 - 1x + 1x +
              warning(sprintf(
    196 - 1x + 1x +
                "Invalid choices: lower is higher / equal to upper, or not in range of variable values.
    197 - 1x + 1x +
                Setting defaults. Varname: %s, dataname: %s.",
    198 - 1x + 1x +
                private$get_varname(), private$get_dataname()
    @@ -29207,7 +30303,8 @@

    teal.slice coverage - 66.06%

    200 - 1x + 1x +
              choices <- range(private$x, na.rm = TRUE)
    @@ -29228,28 +30325,32 @@

    teal.slice coverage - 66.06%

    203 - 22x + 22x +
          private$set_is_choice_limited(private$x, choices)
    204 - 22x + 22x +
          private$x <- private$x[(private$x >= choices[1L] & private$x <= choices[2L]) | is.na(private$x)]
    205 - 22x + 22x +
          private$teal_slice$choices <- choices
    206 - 22x + 22x +
          invisible(NULL)
    @@ -29291,14 +30392,16 @@

    teal.slice coverage - 66.06%

    212 - 22x + 22x +
          private$is_choice_limited <- (any(xl < choices[1L], na.rm = TRUE) | any(xl > choices[2L], na.rm = TRUE))
    213 - 22x + 22x +
          invisible(NULL)
    @@ -29319,21 +30422,24 @@

    teal.slice coverage - 66.06%

    216 - 33x + 33x +
          tryCatch(
    217 - 33x + 33x +
            expr = {
    218 - 33x + 33x +
              values <- as.Date(values, origin = "1970-01-01")
    @@ -29347,7 +30453,8 @@

    teal.slice coverage - 66.06%

    220 - 30x + 30x +
              values
    @@ -29361,7 +30468,8 @@

    teal.slice coverage - 66.06%

    222 - 33x + 33x +
            error = function(e) stop("Vector of set values must contain values coercible to Date.")
    @@ -29389,42 +30497,48 @@

    teal.slice coverage - 66.06%

    226 - 1x + 1x +
          if (length(values) != 2) stop("Vector of set values must have length two.")
    227 - 29x + 29x +
          if (values[1] > values[2]) {
    228 - 1x + 1x +
            warning(
    229 - 1x + 1x +
              sprintf(
    230 - 1x + 1x +
                "Start date %s is set after the end date %s, the values will be replaced with a default date range.",
    231 - 1x + 1x +
                values[1], values[2]
    @@ -29445,7 +30559,8 @@

    teal.slice coverage - 66.06%

    234 - 1x + 1x +
            values <- isolate(private$get_choices())
    @@ -29459,7 +30574,8 @@

    teal.slice coverage - 66.06%

    236 - 29x + 29x +
          values
    @@ -29480,42 +30596,48 @@

    teal.slice coverage - 66.06%

    239 - 29x + 29x +
          choices <- private$get_choices()
    240 - 29x + 29x +
          if (values[1] < choices[1L] | values[1] > choices[2L]) {
    241 - 5x + 5x +
            warning(
    242 - 5x + 5x +
              sprintf(
    243 - 5x + 5x +
                "Value: %s is outside of the possible range for column %s of dataset %s, setting minimum possible value.",
    244 - 5x + 5x +
                values[1], private$get_varname(), private$get_dataname()
    @@ -29536,7 +30658,8 @@

    teal.slice coverage - 66.06%

    247 - 5x + 5x +
            values[1] <- choices[1L]
    @@ -29557,35 +30680,40 @@

    teal.slice coverage - 66.06%

    250 - 29x + 29x +
          if (values[2] > choices[2L] | values[2] < choices[1L]) {
    251 - 5x + 5x +
            warning(
    252 - 5x + 5x +
              sprintf(
    253 - 5x + 5x +
                "Value: %s is outside of the possible range for column %s of dataset %s, setting maximum possible value.",
    254 - 5x + 5x +
                values[2], private$get_varname(), private$get_dataname()
    @@ -29606,7 +30734,8 @@

    teal.slice coverage - 66.06%

    257 - 5x + 5x +
            values[2] <- choices[2L]
    @@ -29627,7 +30756,8 @@

    teal.slice coverage - 66.06%

    260 - 29x + 29x +
          values
    @@ -31159,7 +32289,8 @@

    teal.slice coverage - 66.06%

    33 - 100x + 100x +
          if (!requireNamespace("SummarizedExperiment", quietly = TRUE)) {
    @@ -31180,35 +32311,40 @@

    teal.slice coverage - 66.06%

    36 - 100x + 100x +
          checkmate::assert_function(data_reactive, args = "sid")
    37 - 100x + 100x +
          checkmate::assert_class(data, "SummarizedExperiment")
    38 - 99x + 99x +
          super$initialize(data, data_reactive, dataname, datalabel)
    39 - 99x + 99x +
          if (!is.null(datalabel)) {
    40 - 92x + 92x +
            private$dataname_prefixed <- sprintf("%s[['%s']]", dataname, datalabel)
    @@ -31299,35 +32435,40 @@

    teal.slice coverage - 66.06%

    53 - 69x + 69x +
          shiny::isolate({
    54 - 69x + 69x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initializing, dataname: { private$dataname }")
    55 - 69x + 69x +
            checkmate::assert_class(state, "teal_slices")
    56 - 67x + 67x +
            lapply(state, function(x) {
    57 - 19x + 19x +
              checkmate::assert_choice(x$arg, choices = c("subset", "select"), null.ok = TRUE, .var.name = "teal_slice$arg")
    @@ -31341,21 +32482,24 @@

    teal.slice coverage - 66.06%

    59 - 67x + 67x +
            count_type <- attr(state, "count_type")
    60 - 67x + 67x +
            if (length(count_type)) {
    61 - 8x + 8x +
              private$count_type <- count_type
    @@ -31376,35 +32520,40 @@

    teal.slice coverage - 66.06%

    64 - 67x + 67x +
            subset_states <- Filter(function(x) x$arg == "subset", state)
    65 - 67x + 67x +
            private$set_filter_state_impl(
    66 - 67x + 67x +
              state = subset_states,
    67 - 67x + 67x +
              data = SummarizedExperiment::rowData(private$data),
    68 - 67x + 67x +
              data_reactive = function(sid = "") {
    @@ -31460,35 +32609,40 @@

    teal.slice coverage - 66.06%

    76 - 67x + 67x +
            select_states <- Filter(function(x) x$arg == "select", state)
    77 - 67x + 67x +
            private$set_filter_state_impl(
    78 - 67x + 67x +
              state = select_states,
    79 - 67x + 67x +
              data = SummarizedExperiment::colData(private$data),
    80 - 67x + 67x +
              data_reactive = function(sid = "") {
    @@ -31544,14 +32698,16 @@

    teal.slice coverage - 66.06%

    88 - 67x + 67x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initialized, dataname: { private$dataname }")
    89 - 67x + 67x +
            invisible(NULL)
    @@ -31621,49 +32777,56 @@

    teal.slice coverage - 66.06%

    99 - 2x + 2x +
          data <- private$data
    100 - 2x + 2x +
          checkmate::assert_string(id)
    101 - 2x + 2x +
          ns <- NS(id)
    102 - 2x + 2x +
          row_input <- if (ncol(SummarizedExperiment::rowData(data)) == 0) {
    103 - 1x + 1x +
            div("no sample variables available")
    104 - 2x + 2x +
          } else if (nrow(SummarizedExperiment::rowData(data)) == 0) {
    105 - 1x + 1x +
            div("no samples available")
    @@ -31747,28 +32910,32 @@

    teal.slice coverage - 66.06%

    117 - 2x + 2x +
          col_input <- if (ncol(SummarizedExperiment::colData(data)) == 0) {
    118 - 1x + 1x +
            div("no sample variables available")
    119 - 2x + 2x +
          } else if (nrow(SummarizedExperiment::colData(data)) == 0) {
    120 - 1x + 1x +
            div("no samples available")
    @@ -31852,21 +33019,24 @@

    teal.slice coverage - 66.06%

    132 - 2x + 2x +
          div(
    133 - 2x + 2x +
            row_input,
    134 - 2x + 2x +
            col_input
    @@ -33454,35 +34624,40 @@

    teal.slice coverage - 66.06%

    57 - 206x + 206x +
      checkmate::assert_class(x_reactive, "reactive")
    58 - 205x + 205x +
      checkmate::assert_character(extract_type, max.len = 1, any.missing = FALSE)
    59 - 205x + 205x +
      checkmate::assert_class(slice, "teal_slice")
    60 - 204x + 204x +
      if (length(extract_type) == 1) {
    61 - 49x + 49x +
        checkmate::assert_choice(extract_type, choices = c("list", "matrix"))
    @@ -33503,42 +34678,48 @@

    teal.slice coverage - 66.06%

    64 - 203x + 203x +
      if (all(is.na(x))) {
    65 - 1x + 1x +
        EmptyFilterState$new(
    66 - 1x + 1x +
          x = x,
    67 - 1x + 1x +
          x_reactive = x_reactive,
    68 - 1x + 1x +
          slice = slice,
    69 - 1x + 1x +
          extract_type = extract_type
    @@ -33559,7 +34740,8 @@

    teal.slice coverage - 66.06%

    72 - 202x + 202x +
        UseMethod("init_filter_state")
    @@ -33629,35 +34811,40 @@

    teal.slice coverage - 66.06%

    82 - 1x + 1x +
      args <- list(
    83 - 1x + 1x +
        x = x,
    84 - 1x + 1x +
        x_reactive = x_reactive,
    85 - 1x + 1x +
        extract_type = extract_type,
    86 - 1x + 1x +
        slice
    @@ -33678,7 +34865,8 @@

    teal.slice coverage - 66.06%

    89 - 1x + 1x +
      do.call(FilterState$new, args)
    @@ -33741,35 +34929,40 @@

    teal.slice coverage - 66.06%

    98 - 1x + 1x +
      LogicalFilterState$new(
    99 - 1x + 1x +
        x = x,
    100 - 1x + 1x +
        x_reactive = x_reactive,
    101 - 1x + 1x +
        slice = slice,
    102 - 1x + 1x +
        extract_type = extract_type
    @@ -33839,35 +35032,40 @@

    teal.slice coverage - 66.06%

    112 - 126x + 126x +
      args <- list(
    113 - 126x + 126x +
        x = x,
    114 - 126x + 126x +
        x_reactive = x_reactive,
    115 - 126x + 126x +
        slice = slice,
    116 - 126x + 126x +
        extract_type = extract_type
    @@ -33888,14 +35086,16 @@

    teal.slice coverage - 66.06%

    119 - 126x + 126x +
      if (length(unique(x[!is.na(x)])) < getOption("teal.threshold_slider_vs_checkboxgroup")) {
    120 - 29x + 29x +
        do.call(ChoicesFilterState$new, args)
    @@ -33909,7 +35109,8 @@

    teal.slice coverage - 66.06%

    122 - 97x + 97x +
        do.call(RangeFilterState$new, args)
    @@ -33979,35 +35180,40 @@

    teal.slice coverage - 66.06%

    132 - 32x + 32x +
      ChoicesFilterState$new(
    133 - 32x + 32x +
        x = x,
    134 - 32x + 32x +
        x_reactive = x_reactive,
    135 - 32x + 32x +
        slice = slice,
    136 - 32x + 32x +
        extract_type = extract_type
    @@ -34077,35 +35283,40 @@

    teal.slice coverage - 66.06%

    146 - 36x + 36x +
      ChoicesFilterState$new(
    147 - 36x + 36x +
        x = x,
    148 - 36x + 36x +
        x_reactive = x_reactive,
    149 - 36x + 36x +
        slice = slice,
    150 - 36x + 36x +
        extract_type = extract_type
    @@ -34175,35 +35386,40 @@

    teal.slice coverage - 66.06%

    160 - 2x + 2x +
      args <- list(
    161 - 2x + 2x +
        x = x,
    162 - 2x + 2x +
        x_reactive = x_reactive,
    163 - 2x + 2x +
        slice = slice,
    164 - 2x + 2x +
        extract_type = extract_type
    @@ -34224,14 +35440,16 @@

    teal.slice coverage - 66.06%

    167 - 2x + 2x +
      if (length(unique(x[!is.na(x)])) < getOption("teal.threshold_slider_vs_checkboxgroup")) {
    168 - 1x + 1x +
        do.call(ChoicesFilterState$new, args)
    @@ -34245,7 +35463,8 @@

    teal.slice coverage - 66.06%

    170 - 1x + 1x +
        do.call(DateFilterState$new, args)
    @@ -34315,35 +35534,40 @@

    teal.slice coverage - 66.06%

    180 - 2x + 2x +
      args <- list(
    181 - 2x + 2x +
        x = x,
    182 - 2x + 2x +
        x_reactive = x_reactive,
    183 - 2x + 2x +
        slice = slice,
    184 - 2x + 2x +
        extract_type = extract_type
    @@ -34364,14 +35588,16 @@

    teal.slice coverage - 66.06%

    187 - 2x + 2x +
      if (length(unique(x[!is.na(x)])) < getOption("teal.threshold_slider_vs_checkboxgroup")) {
    188 - 1x + 1x +
        do.call(ChoicesFilterState$new, args)
    @@ -34385,7 +35611,8 @@

    teal.slice coverage - 66.06%

    190 - 1x + 1x +
        do.call(DatetimeFilterState$new, args)
    @@ -34455,35 +35682,40 @@

    teal.slice coverage - 66.06%

    200 - 2x + 2x +
      args <- list(
    201 - 2x + 2x +
        x = x,
    202 - 2x + 2x +
        x_reactive = x_reactive,
    203 - 2x + 2x +
        slice = slice,
    204 - 2x + 2x +
        extract_type = extract_type
    @@ -34504,14 +35736,16 @@

    teal.slice coverage - 66.06%

    207 - 2x + 2x +
      if (length(unique(x[!is.na(x)])) < getOption("teal.threshold_slider_vs_checkboxgroup")) {
    208 - 1x + 1x +
        do.call(ChoicesFilterState$new, args)
    @@ -34525,7 +35759,8 @@

    teal.slice coverage - 66.06%

    210 - 1x + 1x +
        do.call(DatetimeFilterState$new, args)
    @@ -34651,7 +35886,8 @@

    teal.slice coverage - 66.06%

    228 - 6x + 6x +
      FilterStateExpr$new(slice)
    @@ -34812,28 +36048,32 @@

    teal.slice coverage - 66.06%

    251 - 124x + 124x +
      checkmate::assert_string(color)
    252 - 124x + 124x +
      checkmate::assert(
    253 - 124x + 124x +
        checkmate::check_number(alpha, lower = 0, upper = 1, null.ok = TRUE),
    254 - 124x + 124x +
        checkmate::check_string(alpha, pattern = "[0-9a-f]{2}", null.ok = TRUE)
    @@ -34868,14 +36108,16 @@

    teal.slice coverage - 66.06%

    259 - 124x + 124x +
      sass_file <- bslib::bs_theme()[["layers"]][[2]][["defaults"]][[1]]
    260 - 124x + 124x +
      sass_file <- attr(sass_file, "sass_file_path")
    @@ -34896,7 +36138,8 @@

    teal.slice coverage - 66.06%

    263 - 124x + 124x +
      variables_file <- readLines(sass_file)
    @@ -34910,14 +36153,16 @@

    teal.slice coverage - 66.06%

    265 - 124x + 124x +
      ind <- grep("// scss-docs-(start|end) theme-color-variables", variables_file)
    266 - 124x + 124x +
      color_definitions <- variables_file[(ind[1] + 1L):(ind[2] - 1L)]
    @@ -34938,7 +36183,8 @@

    teal.slice coverage - 66.06%

    269 - 124x + 124x +
      color_names <- sub("(\\$)(\\w.+)(:.+)", "\\2", color_definitions)
    @@ -34959,7 +36205,8 @@

    teal.slice coverage - 66.06%

    272 - 124x + 124x +
      checkmate::assert_choice(color, color_names)
    @@ -34980,7 +36227,8 @@

    teal.slice coverage - 66.06%

    275 - 124x + 124x +
      color_references <- sub("(\\$)(\\w.+)(:\\s.+\\$)(\\w.+)(\\s.+)", "\\4", color_definitions)
    @@ -35001,42 +36249,48 @@

    teal.slice coverage - 66.06%

    278 - 124x + 124x +
      color_specification <- structure(color_references, names = color_names)
    279 - 124x + 124x +
      color_specification <- vapply(color_specification, function(x) {
    280 - 992x + 992x +
        line <- grep(sprintf("^\\$%s:\\s+#\\w{6}\\s+!default", x), variables_file, value = TRUE)
    281 - 992x + 992x +
        code <- sub("(.+)(#\\w{6})(\\s+.+)", "\\2", line)
    282 - 992x + 992x +
        code
    283 - 124x + 124x +
      }, character(1L))
    @@ -35050,7 +36304,8 @@

    teal.slice coverage - 66.06%

    285 - 124x + 124x +
      if (!is.null(alpha)) {
    @@ -35078,7 +36333,8 @@

    teal.slice coverage - 66.06%

    289 - 124x + 124x +
      paste0(color_specification[color], alpha)
    @@ -35693,28 +36949,32 @@

    teal.slice coverage - 66.06%

    86 - 3x + 3x +
      checkmate::assert_multi_class(datasets, c("FilteredData", "FilterPanelAPI"))
    87 - 3x + 3x +
      checkmate::assert(
    88 - 3x + 3x +
        checkmate::check_class(filter, "teal_slices"),
    89 - 3x + 3x +
        checkmate::check_list(filter, min.len = 0, null.ok = TRUE)
    @@ -35728,7 +36988,8 @@

    teal.slice coverage - 66.06%

    91 - 3x + 3x +
      if (!is.teal_slices(filter)) {
    @@ -35756,14 +37017,16 @@

    teal.slice coverage - 66.06%

    95 - 3x + 3x +
      datasets$set_filter_state(filter)
    96 - 3x + 3x +
      invisible(NULL)
    @@ -35805,14 +37068,16 @@

    teal.slice coverage - 66.06%

    102 - 4x + 4x +
      checkmate::assert_multi_class(datasets, c("FilteredData", "FilterPanelAPI"))
    103 - 4x + 4x +
      if (shiny::isRunning()) {
    @@ -35833,7 +37098,8 @@

    teal.slice coverage - 66.06%

    106 - 4x + 4x +
        shiny::isolate(datasets$get_filter_state())
    @@ -35882,28 +37148,32 @@

    teal.slice coverage - 66.06%

    113 - 1x + 1x +
      checkmate::assert_multi_class(datasets, c("FilteredData", "FilterPanelAPI"))
    114 - 1x + 1x +
      checkmate::assert(
    115 - 1x + 1x +
        checkmate::check_class(filter, "teal_slices"),
    116 - 1x + 1x +
        checkmate::check_list(filter, min.len = 0, null.ok = TRUE)
    @@ -35924,14 +37194,16 @@

    teal.slice coverage - 66.06%

    119 - 1x + 1x +
      datasets$remove_filter_state(filter)
    120 - 1x + 1x +
      invisible(NULL)
    @@ -35973,21 +37245,24 @@

    teal.slice coverage - 66.06%

    126 - 1x + 1x +
      checkmate::assert_multi_class(datasets, c("FilteredData", "FilterPanelAPI"))
    127 - 1x + 1x +
      datasets$clear_filter_states(force = force)
    128 - 1x + 1x +
      invisible(NULL)
    @@ -36092,28 +37367,32 @@

    teal.slice coverage - 66.06%

    143 - 2x + 2x +
      checkmate::assert_character(datanames, min.len = 1, any.missing = FALSE)
    144 - 2x + 2x +
      stopifnot(
    145 - 2x + 2x +
        is(datasets, "FilteredData"),
    146 - 2x + 2x +
        all(datanames %in% datasets$datanames())
    @@ -36134,35 +37413,40 @@

    teal.slice coverage - 66.06%

    149 - 2x + 2x +
      paste(
    150 - 2x + 2x +
        unlist(lapply(
    151 - 2x + 2x +
          datanames,
    152 - 2x + 2x +
          function(dataname) {
    153 - 4x + 4x +
            datasets$get_call(dataname)
    @@ -36183,7 +37467,8 @@

    teal.slice coverage - 66.06%

    156 - 2x + 2x +
        collapse = "\n"
    @@ -36574,14 +37859,16 @@

    teal.slice coverage - 66.06%

    53 - 115x + 115x +
          checkmate::assert_data_frame(dataset)
    54 - 113x + 113x +
          super$initialize(dataset, dataname, keys, label, metadata)
    @@ -36602,21 +37889,24 @@

    teal.slice coverage - 66.06%

    57 - 111x + 111x +
          if (!is.null(parent)) {
    58 - 7x + 7x +
            checkmate::assert_character(parent_name, len = 1)
    59 - 7x + 7x +
            checkmate::assert_character(join_keys, min.len = 1)
    @@ -36630,14 +37920,16 @@

    teal.slice coverage - 66.06%

    61 - 7x + 7x +
            private$parent_name <- parent_name
    62 - 7x + 7x +
            private$join_keys <- join_keys
    @@ -36651,28 +37943,32 @@

    teal.slice coverage - 66.06%

    64 - 7x + 7x +
            private$data_filtered_fun <- function(sid = "") {
    65 - 5x + 5x +
              checkmate::assert_character(sid)
    66 - 5x + 5x +
              if (length(sid)) {
    67 - 5x + 5x +
                logger::log_trace("filtering data dataname: { dataname }, sid: { sid }")
    @@ -36700,42 +37996,48 @@

    teal.slice coverage - 66.06%

    71 - 5x + 5x +
              env <- new.env(parent = parent.env(globalenv()))
    72 - 5x + 5x +
              env[[dataname]] <- private$dataset
    73 - 5x + 5x +
              env[[parent_name]] <- parent()
    74 - 5x + 5x +
              filter_call <- self$get_call(sid)
    75 - 5x + 5x +
              eval_expr_with_msg(filter_call, env)
    76 - 5x + 5x +
              get(x = dataname, envir = env)
    @@ -36763,42 +38065,48 @@

    teal.slice coverage - 66.06%

    80 - 111x + 111x +
          private$add_filter_states(
    81 - 111x + 111x +
            filter_states = init_filter_states(
    82 - 111x + 111x +
              data = dataset,
    83 - 111x + 111x +
              data_reactive = private$data_filtered_fun,
    84 - 111x + 111x +
              dataname = dataname,
    85 - 111x + 111x +
              keys = self$get_keys()
    @@ -36812,7 +38120,8 @@

    teal.slice coverage - 66.06%

    87 - 111x + 111x +
            id = "filter"
    @@ -36840,35 +38149,40 @@

    teal.slice coverage - 66.06%

    91 - 111x + 111x +
          if (!is.null(parent)) {
    92 - 7x + 7x +
            fs <- teal_slices(
    93 - 7x + 7x +
              exclude_varnames = structure(
    94 - 7x + 7x +
                list(intersect(colnames(dataset), colnames(isolate(parent())))),
    95 - 7x + 7x +
                names = private$dataname
    @@ -36889,7 +38203,8 @@

    teal.slice coverage - 66.06%

    98 - 7x + 7x +
            self$set_filter_state(fs)
    @@ -36910,7 +38225,8 @@

    teal.slice coverage - 66.06%

    101 - 111x + 111x +
          invisible(self)
    @@ -37043,28 +38359,32 @@

    teal.slice coverage - 66.06%

    120 - 36x + 36x +
          logger::log_trace("FilteredDatasetDefault$get_call initializing for dataname: { private$dataname }")
    121 - 36x + 36x +
          filter_call <- super$get_call(sid)
    122 - 36x + 36x +
          dataname <- private$dataname
    123 - 36x + 36x +
          parent_dataname <- private$parent_name
    @@ -37078,28 +38398,32 @@

    teal.slice coverage - 66.06%

    125 - 36x + 36x +
          if (!identical(parent_dataname, character(0))) {
    126 - 6x + 6x +
            join_keys <- private$join_keys
    127 - 6x + 6x +
            parent_keys <- names(join_keys)
    128 - 6x + 6x +
            dataset_keys <- unname(join_keys)
    @@ -37113,7 +38437,8 @@

    teal.slice coverage - 66.06%

    130 - 6x + 6x +
            y_arg <- if (length(parent_keys) == 0L) {
    @@ -37134,28 +38459,32 @@

    teal.slice coverage - 66.06%

    133 - 6x + 6x +
              sprintf(
    134 - 6x + 6x +
                "%s[, c(%s), drop = FALSE]",
    135 - 6x + 6x +
                parent_dataname,
    136 - 6x + 6x +
                toString(dQuote(parent_keys, q = FALSE))
    @@ -37183,7 +38512,8 @@

    teal.slice coverage - 66.06%

    140 - 6x + 6x +
            more_args <- if (length(parent_keys) == 0 || length(dataset_keys) == 0) {
    @@ -37197,14 +38527,16 @@

    teal.slice coverage - 66.06%

    142 - 6x + 6x +
            } else if (identical(parent_keys, dataset_keys)) {
    143 - 6x + 6x +
              list(by = parent_keys)
    @@ -37239,7 +38571,8 @@

    teal.slice coverage - 66.06%

    148 - 6x + 6x +
            merge_call <- call(
    @@ -37253,49 +38586,56 @@

    teal.slice coverage - 66.06%

    150 - 6x + 6x +
              as.name(dataname),
    151 - 6x + 6x +
              as.call(
    152 - 6x + 6x +
                c(
    153 - 6x + 6x +
                  str2lang("dplyr::inner_join"),
    154 - 6x + 6x +
                  x = as.name(dataname),
    155 - 6x + 6x +
                  y = str2lang(y_arg),
    156 - 6x + 6x +
                  more_args
    @@ -37330,7 +38670,8 @@

    teal.slice coverage - 66.06%

    161 - 6x + 6x +
            filter_call <- c(filter_call, merge_call)
    @@ -37344,14 +38685,16 @@

    teal.slice coverage - 66.06%

    163 - 36x + 36x +
          logger::log_trace("FilteredDatasetDefault$get_call initializing for dataname: { private$dataname }")
    164 - 36x + 36x +
          filter_call
    @@ -37491,35 +38834,40 @@

    teal.slice coverage - 66.06%

    184 - 75x + 75x +
          shiny::isolate({
    185 - 75x + 75x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initializing, dataname: { private$dataname }")
    186 - 75x + 75x +
            checkmate::assert_class(state, "teal_slices")
    187 - 74x + 74x +
            lapply(state, function(slice) {
    188 - 100x + 100x +
              checkmate::assert_true(slice$dataname == private$dataname)
    @@ -37533,14 +38881,16 @@

    teal.slice coverage - 66.06%

    190 - 74x + 74x +
            private$get_filter_states()[[1L]]$set_filter_state(state = state)
    191 - 74x + 74x +
            invisible(NULL)
    @@ -37638,7 +38988,8 @@

    teal.slice coverage - 66.06%

    205 - 11x + 11x +
          checkmate::assert_class(state, "teal_slices")
    @@ -37652,14 +39003,16 @@

    teal.slice coverage - 66.06%

    207 - 11x + 11x +
          shiny::isolate({
    208 - 11x + 11x +
            logger::log_trace("{ class(self)[1] }$remove_filter_state removing filter(s), dataname: { private$dataname }")
    @@ -37673,14 +39026,16 @@

    teal.slice coverage - 66.06%

    210 - 11x + 11x +
            varnames <- unique(unlist(lapply(state, "[[", "varname")))
    211 - 11x + 11x +
            private$get_filter_states()[[1]]$remove_filter_state(state)
    @@ -37694,7 +39049,8 @@

    teal.slice coverage - 66.06%

    213 - 11x + 11x +
            logger::log_trace("{ class(self)[1] }$remove_filter_state removed filter(s), dataname: { private$dataname }")
    @@ -37715,7 +39071,8 @@

    teal.slice coverage - 66.06%

    216 - 11x + 11x +
          invisible(NULL)
    @@ -37890,7 +39247,8 @@

    teal.slice coverage - 66.06%

    241 - 12x + 12x +
          logger::log_trace("FilteredDataset$srv_filter_overview initialized")
    @@ -37911,14 +39269,16 @@

    teal.slice coverage - 66.06%

    244 - 12x + 12x +
          subject_keys <- if (length(private$parent_name) > 0) {
    245 - 1x + 1x +
            private$join_keys
    @@ -37932,7 +39292,8 @@

    teal.slice coverage - 66.06%

    247 - 11x + 11x +
            self$get_keys()
    @@ -37953,49 +39314,56 @@

    teal.slice coverage - 66.06%

    250 - 12x + 12x +
          dataset <- self$get_dataset()
    251 - 12x + 12x +
          data_filtered <- self$get_dataset(TRUE)
    252 - 12x + 12x +
          if (length(subject_keys) == 0) {
    253 - 10x + 10x +
            data.frame(
    254 - 10x + 10x +
              dataname = private$dataname,
    255 - 10x + 10x +
              obs = nrow(dataset),
    256 - 10x + 10x +
              obs_filtered = nrow(data_filtered())
    @@ -38016,42 +39384,48 @@

    teal.slice coverage - 66.06%

    259 - 2x + 2x +
            data.frame(
    260 - 2x + 2x +
              dataname = private$dataname,
    261 - 2x + 2x +
              obs = nrow(dataset),
    262 - 2x + 2x +
              obs_filtered = nrow(data_filtered()),
    263 - 2x + 2x +
              subjects = nrow(unique(dataset[subject_keys])),
    264 - 2x + 2x +
              subjects_filtered = nrow(unique(data_filtered()[subject_keys]))
    @@ -38323,7 +39697,8 @@

    teal.slice coverage - 66.06%

    29 - 145x + 145x +
          logger::log_trace("Instantiating { class(self)[1] }, dataname: { dataname }")
    @@ -38344,28 +39719,32 @@

    teal.slice coverage - 66.06%

    32 - 145x + 145x +
          check_simple_name(dataname)
    33 - 143x + 143x +
          checkmate::assert_character(keys, any.missing = FALSE)
    34 - 143x + 143x +
          checkmate::assert_character(label, null.ok = TRUE)
    35 - 143x + 143x +
          teal.data::validate_metadata(metadata)
    @@ -38379,42 +39758,48 @@

    teal.slice coverage - 66.06%

    37 - 143x + 143x +
          logger::log_trace("Instantiating { class(self)[1] }, dataname: { dataname }")
    38 - 143x + 143x +
          private$dataset <- dataset
    39 - 143x + 143x +
          private$dataname <- dataname
    40 - 143x + 143x +
          private$keys <- keys
    41 - 143x + 143x +
          private$label <- if (is.null(label)) character(0) else label
    42 - 143x + 143x +
          private$metadata <- metadata
    @@ -38435,28 +39820,32 @@

    teal.slice coverage - 66.06%

    45 - 143x + 143x +
          private$data_filtered_fun <- function(sid = "") {
    46 - 21x + 21x +
            checkmate::assert_character(sid)
    47 - 21x + 21x +
            if (length(sid)) {
    48 - 21x + 21x +
              logger::log_trace("filtering data dataname: { dataname }, sid: { sid }")
    @@ -38484,35 +39873,40 @@

    teal.slice coverage - 66.06%

    52 - 21x + 21x +
            env <- new.env(parent = parent.env(globalenv()))
    53 - 21x + 21x +
            env[[dataname]] <- private$dataset
    54 - 21x + 21x +
            filter_call <- self$get_call(sid)
    55 - 21x + 21x +
            eval_expr_with_msg(filter_call, env)
    56 - 21x + 21x +
            get(x = dataname, envir = env)
    @@ -38533,21 +39927,24 @@

    teal.slice coverage - 66.06%

    59 - 143x + 143x +
          private$data_filtered <- reactive(private$data_filtered_fun())
    60 - 143x + 143x +
          logger::log_trace("Instantiated { class(self)[1] }, dataname: { private$dataname }")
    61 - 143x + 143x +
          invisible(self)
    @@ -38631,28 +40028,32 @@

    teal.slice coverage - 66.06%

    73 - 24x + 24x +
          sprintf(
    74 - 24x + 24x +
            "%s:\n%s",
    75 - 24x + 24x +
            class(self)[1],
    76 - 24x + 24x +
            format(self$get_filter_state(), show_all = show_all, trim_lines = trim_lines)
    @@ -38722,7 +40123,8 @@

    teal.slice coverage - 66.06%

    86 - 10x + 10x +
          cat(shiny::isolate(self$format(...)), "\n")
    @@ -38792,28 +40194,32 @@

    teal.slice coverage - 66.06%

    96 - 14x + 14x +
          logger::log_trace("Removing filters from FilteredDataset: { deparse1(self$get_dataname()) }")
    97 - 14x + 14x +
          lapply(
    98 - 14x + 14x +
            private$get_filter_states(),
    99 - 14x + 14x +
            function(filter_states) filter_states$clear_filter_states(force)
    @@ -38827,14 +40233,16 @@

    teal.slice coverage - 66.06%

    101 - 14x + 14x +
          logger::log_trace("Removed filters from FilteredDataset: { deparse1(self$get_dataname()) }")
    102 - 14x + 14x +
          NULL
    @@ -38967,21 +40375,24 @@

    teal.slice coverage - 66.06%

    121 - 41x + 41x +
          filter_call <- Filter(
    122 - 41x + 41x +
            f = Negate(is.null),
    123 - 41x + 41x +
            x = lapply(private$get_filter_states(), function(x) x$get_call(sid))
    @@ -38995,14 +40406,16 @@

    teal.slice coverage - 66.06%

    125 - 41x + 41x +
          if (length(filter_call) == 0) {
    126 - 24x + 24x +
            return(NULL)
    @@ -39016,7 +40429,8 @@

    teal.slice coverage - 66.06%

    128 - 17x + 17x +
          filter_call
    @@ -39079,14 +40493,16 @@

    teal.slice coverage - 66.06%

    137 - 190x + 190x +
          states <- unname(lapply(private$get_filter_states(), function(x) x$get_filter_state()))
    138 - 190x + 190x +
          do.call(c, states)
    @@ -39212,7 +40628,8 @@

    teal.slice coverage - 66.06%

    156 - 16x + 16x +
          length(self$get_filter_state())
    @@ -39268,7 +40685,8 @@

    teal.slice coverage - 66.06%

    164 - 8x + 8x +
          private$dataname
    @@ -39345,14 +40763,16 @@

    teal.slice coverage - 66.06%

    175 - 45x + 45x +
          if (filtered) {
    176 - 27x + 27x +
            private$data_filtered
    @@ -39366,7 +40786,8 @@

    teal.slice coverage - 66.06%

    178 - 18x + 18x +
            private$dataset
    @@ -39422,7 +40843,8 @@

    teal.slice coverage - 66.06%

    186 - 4x + 4x +
          private$metadata
    @@ -39597,7 +41019,8 @@

    teal.slice coverage - 66.06%

    211 - 147x + 147x +
          private$keys
    @@ -39646,7 +41069,8 @@

    teal.slice coverage - 66.06%

    218 - 3x + 3x +
          private$label
    @@ -40220,77 +41644,88 @@

    teal.slice coverage - 66.06%

    300 - 7x + 7x +
          moduleServer(
    301 - 7x + 7x +
            id = id,
    302 - 7x + 7x +
            function(input, output, session) {
    303 - 7x + 7x +
              dataname <- self$get_dataname()
    304 - 7x + 7x +
              logger::log_trace("FilteredDataset$srv_active initializing, dataname: { dataname }")
    305 - 7x + 7x +
              checkmate::assert_string(dataname)
    306 - 7x + 7x +
              output$filter_count <- renderText(
    307 - 7x + 7x +
                sprintf(
    308 - 7x + 7x +
                  "%d filter%s applied",
    309 - 7x + 7x +
                  self$get_filter_count(),
    310 - 7x + 7x +
                  if (self$get_filter_count() != 1) "s" else ""
    @@ -40318,28 +41753,32 @@

    teal.slice coverage - 66.06%

    314 - 7x + 7x +
              lapply(
    315 - 7x + 7x +
                names(private$get_filter_states()),
    316 - 7x + 7x +
                function(x) {
    317 - 12x + 12x +
                  private$get_filter_states()[[x]]$srv_active(id = x)
    @@ -40367,35 +41806,40 @@

    teal.slice coverage - 66.06%

    321 - 7x + 7x +
              shiny::observeEvent(self$get_filter_state(), {
    322 - 8x + 8x +
                shinyjs::hide("filter_count_ui")
    323 - 8x + 8x +
                shinyjs::show("filters")
    324 - 8x + 8x +
                shinyjs::toggle("remove_filters", condition = length(self$get_filter_state()) != 0)
    325 - 8x + 8x +
                shinyjs::toggle("collapse", condition = length(self$get_filter_state()) != 0)
    @@ -40416,7 +41860,8 @@

    teal.slice coverage - 66.06%

    328 - 7x + 7x +
              shiny::observeEvent(input$collapse, {
    @@ -40458,28 +41903,32 @@

    teal.slice coverage - 66.06%

    334 - 7x + 7x +
              observeEvent(input$remove_filters, {
    335 - 1x + 1x +
                logger::log_trace("FilteredDataset$srv_active@1 removing all non-anchored filters, dataname: { dataname }")
    336 - 1x + 1x +
                self$clear_filter_states()
    337 - 1x + 1x +
                logger::log_trace("FilteredDataset$srv_active@1 removed all non-anchored filters, dataname: { dataname }")
    @@ -40500,7 +41949,8 @@

    teal.slice coverage - 66.06%

    340 - 7x + 7x +
              logger::log_trace("FilteredDataset$initialized, dataname: { dataname }")
    @@ -40514,7 +41964,8 @@

    teal.slice coverage - 66.06%

    342 - 7x + 7x +
              NULL
    @@ -40612,7 +42063,8 @@

    teal.slice coverage - 66.06%

    356 - 1x + 1x +
          stop("Pure virtual method")
    @@ -40738,63 +42190,72 @@

    teal.slice coverage - 66.06%

    374 - 2x + 2x +
          moduleServer(
    375 - 2x + 2x +
            id = id,
    376 - 2x + 2x +
            function(input, output, session) {
    377 - 2x + 2x +
              logger::log_trace("MAEFilteredDataset$srv_add initializing, dataname: { deparse1(self$get_dataname()) }")
    378 - 2x + 2x +
              elems <- private$get_filter_states()
    379 - 2x + 2x +
              elem_names <- names(private$get_filter_states())
    380 - 2x + 2x +
              lapply(
    381 - 2x + 2x +
                elem_names,
    382 - 2x + 2x +
                function(elem_name) elems[[elem_name]]$srv_add(elem_name)
    @@ -40808,14 +42269,16 @@

    teal.slice coverage - 66.06%

    384 - 2x + 2x +
              logger::log_trace("MAEFilteredDataset$srv_add initialized, dataname: { deparse1(self$get_dataname()) }")
    385 - 2x + 2x +
              NULL
    @@ -40962,28 +42425,32 @@

    teal.slice coverage - 66.06%

    406 - 249x + 249x +
          checkmate::assert_class(filter_states, "FilterStates")
    407 - 249x + 249x +
          checkmate::assert_string(id)
    408 - 249x + 249x +
          x <- stats::setNames(list(filter_states), id)
    409 - 249x + 249x +
          private$filter_states <- c(private$get_filter_states(), x)
    @@ -41046,7 +42513,8 @@

    teal.slice coverage - 66.06%

    418 - 716x + 716x +
          private$filter_states
    @@ -42116,56 +43584,64 @@

    teal.slice coverage - 66.06%

    149 - 126x + 126x +
          shiny::isolate({
    150 - 126x + 126x +
            checkmate::assert_numeric(x, all.missing = FALSE)
    151 - 2x + 2x +
            if (!any(is.finite(x))) stop("\"x\" contains no finite values")
    152 - 123x + 123x +
            super$initialize(x = x, x_reactive = x_reactive, slice = slice, extract_type = extract_type)
    153 - 123x + 123x +
            private$is_integer <- checkmate::test_integerish(x)
    154 - 123x + 123x +
            private$inf_count <- sum(is.infinite(x))
    155 - 123x + 123x +
            private$inf_filtered_count <- reactive(
    156 - 123x + 123x +
              if (!is.null(private$x_reactive())) sum(is.infinite(private$x_reactive()))
    @@ -42186,14 +43662,16 @@

    teal.slice coverage - 66.06%

    159 - 123x + 123x +
            checkmate::assert_numeric(slice$choices, null.ok = TRUE)
    160 - 3x + 3x +
            if (is.null(slice$keep_inf) && any(is.infinite(x))) slice$keep_inf <- TRUE
    @@ -42207,21 +43685,24 @@

    teal.slice coverage - 66.06%

    162 - 122x + 122x +
            private$set_choices(slice$choices)
    163 - 44x + 44x +
            if (is.null(slice$selected)) slice$selected <- slice$choices
    164 - 122x + 122x +
            private$set_selected(slice$selected)
    @@ -42235,21 +43716,24 @@

    teal.slice coverage - 66.06%

    166 - 119x + 119x +
            private$is_integer <- checkmate::test_integerish(x)
    167 - 119x + 119x +
            private$inf_filtered_count <- reactive(
    168 - 119x + 119x +
              if (!is.null(private$x_reactive())) sum(is.infinite(private$x_reactive()))
    @@ -42263,7 +43747,8 @@

    teal.slice coverage - 66.06%

    170 - 119x + 119x +
            private$inf_count <- sum(is.infinite(x))
    @@ -42277,63 +43762,72 @@

    teal.slice coverage - 66.06%

    172 - 119x + 119x +
            private$plot_data <- list(
    173 - 119x + 119x +
              type = "histogram",
    174 - 119x + 119x +
              nbinsx = 50,
    175 - 119x + 119x +
              x = Filter(Negate(is.na), Filter(is.finite, private$x)),
    176 - 119x + 119x +
              color = I(fetch_bs_color("secondary")),
    177 - 119x + 119x +
              alpha = 0.2,
    178 - 119x + 119x +
              bingroup = 1,
    179 - 119x + 119x +
              showlegend = FALSE,
    180 - 119x + 119x +
              hoverinfo = "none"
    @@ -42347,21 +43841,24 @@

    teal.slice coverage - 66.06%

    182 - 119x + 119x +
            private$plot_mask <- list(list(
    183 - 119x + 119x +
              type = "rect", fillcolor = rgb(1, 1, 1, .65), line = list(width = 0),
    184 - 119x + 119x +
              x0 = -0.5, x1 = 1.5, y0 = -0.5, y1 = 1.5, xref = "paper", yref = "paper"
    @@ -42375,84 +43872,96 @@

    teal.slice coverage - 66.06%

    186 - 119x + 119x +
            private$plot_layout <- reactive({
    187 - 5x + 5x +
              shapes <- private$get_shape_properties(private$get_selected())
    188 - 5x + 5x +
              list(
    189 - 5x + 5x +
                barmode = "overlay",
    190 - 5x + 5x +
                xaxis = list(
    191 - 5x + 5x +
                  range = private$get_choices() * c(0.995, 1.005),
    192 - 5x + 5x +
                  rangeslider = list(thickness = 0),
    193 - 5x + 5x +
                  showticklabels = TRUE,
    194 - 5x + 5x +
                  ticks = "outside",
    195 - 5x + 5x +
                  ticklen = 2,
    196 - 5x + 5x +
                  tickmode = "auto",
    197 - 5x + 5x +
                  nticks = 10
    @@ -42466,35 +43975,40 @@

    teal.slice coverage - 66.06%

    199 - 5x + 5x +
                yaxis = list(showgrid = FALSE, showticklabels = FALSE),
    200 - 5x + 5x +
                margin = list(b = 17, l = 0, r = 0, t = 0, autoexpand = FALSE),
    201 - 5x + 5x +
                plot_bgcolor = "#FFFFFF00",
    202 - 5x + 5x +
                paper_bgcolor = "#FFFFFF00",
    203 - 5x + 5x +
                shapes = shapes
    @@ -42515,35 +44029,40 @@

    teal.slice coverage - 66.06%

    206 - 119x + 119x +
            private$plot_config <- reactive({
    207 - 5x + 5x +
              list(
    208 - 5x + 5x +
                doubleClick = "reset",
    209 - 5x + 5x +
                displayModeBar = FALSE,
    210 - 5x + 5x +
                edits = list(shapePosition = TRUE)
    @@ -42564,42 +44083,48 @@

    teal.slice coverage - 66.06%

    213 - 119x + 119x +
            private$plot_filtered <- reactive({
    214 - 5x + 5x +
              finite_values <- Filter(is.finite, private$x_reactive())
    215 - 5x + 5x +
              list(
    216 - 5x + 5x +
                x = finite_values,
    217 - 5x + 5x +
                bingroup = 1,
    218 - 5x + 5x +
                color = I(fetch_bs_color("primary"))
    @@ -42620,7 +44145,8 @@

    teal.slice coverage - 66.06%

    221 - 119x + 119x +
            invisible(self)
    @@ -42711,14 +44237,16 @@

    teal.slice coverage - 66.06%

    234 - 34x + 34x +
          if (isFALSE(private$is_any_filtered())) {
    235 - 1x + 1x +
            return(NULL)
    @@ -42732,28 +44260,32 @@

    teal.slice coverage - 66.06%

    237 - 4x + 4x +
          if (missing(dataname)) dataname <- private$get_dataname()
    238 - 33x + 33x +
          varname <- private$get_varname_prefixed(dataname)
    239 - 33x + 33x +
          filter_call <-
    240 - 33x + 33x +
            call(
    @@ -42767,14 +44299,16 @@

    teal.slice coverage - 66.06%

    242 - 33x + 33x +
              call(">=", varname, private$get_selected()[1L]),
    243 - 33x + 33x +
              call("<=", varname, private$get_selected()[2L])
    @@ -42788,7 +44322,8 @@

    teal.slice coverage - 66.06%

    245 - 33x + 33x +
          private$add_keep_na_call(private$add_keep_inf_call(filter_call, varname), varname)
    @@ -42970,21 +44505,24 @@

    teal.slice coverage - 66.06%

    271 - 122x + 122x +
          x <- private$x[is.finite(private$x)]
    272 - 122x + 122x +
          if (is.null(choices)) {
    273 - 110x + 110x +
            choices <- range(x)
    @@ -42998,35 +44536,40 @@

    teal.slice coverage - 66.06%

    275 - 12x + 12x +
            choices_adjusted <- c(max(choices[1L], min(x)), min(choices[2L], max(x)))
    276 - 12x + 12x +
            if (any(choices != choices_adjusted)) {
    277 - 1x + 1x +
              warning(sprintf(
    278 - 1x + 1x +
                "Choices adjusted (some values outside of variable range). Varname: %s, dataname: %s.",
    279 - 1x + 1x +
                private$get_varname(), private$get_dataname()
    @@ -43040,7 +44583,8 @@

    teal.slice coverage - 66.06%

    281 - 1x + 1x +
              choices <- choices_adjusted
    @@ -43054,35 +44598,40 @@

    teal.slice coverage - 66.06%

    283 - 12x + 12x +
            if (choices[1L] > choices[2L]) {
    284 - 1x + 1x +
              warning(sprintf(
    285 - 1x + 1x +
                "Invalid choices: lower is higher / equal to upper, or not in range of variable values.
    286 - 1x + 1x +
                Setting defaults. Varname: %s, dataname: %s.",
    287 - 1x + 1x +
                private$get_varname(), private$get_dataname()
    @@ -43096,7 +44645,8 @@

    teal.slice coverage - 66.06%

    289 - 1x + 1x +
              choices <- range(x)
    @@ -43124,21 +44674,24 @@

    teal.slice coverage - 66.06%

    293 - 122x + 122x +
          private$set_is_choice_limited(private$x, choices)
    294 - 122x + 122x +
          private$x <- private$x[
    295 - 122x + 122x +
            (private$x >= choices[1L] & private$x <= choices[2L]) | is.na(private$x) | !is.finite(private$x)
    @@ -43159,7 +44712,8 @@

    teal.slice coverage - 66.06%

    298 - 122x + 122x +
          x_range <- range(private$x, finite = TRUE)
    @@ -43180,14 +44734,16 @@

    teal.slice coverage - 66.06%

    301 - 122x + 122x +
          if (identical(diff(x_range), 0)) {
    302 - 2x + 2x +
            choices <- x_range
    @@ -43201,21 +44757,24 @@

    teal.slice coverage - 66.06%

    304 - 120x + 120x +
            x_pretty <- pretty(x_range, 100L)
    305 - 120x + 120x +
            choices <- range(x_pretty)
    306 - 120x + 120x +
            private$numeric_step <- signif(private$get_pretty_range_step(x_pretty), digits = 10)
    @@ -43229,14 +44788,16 @@

    teal.slice coverage - 66.06%

    308 - 122x + 122x +
          private$teal_slice$choices <- choices
    309 - 122x + 122x +
          invisible(NULL)
    @@ -43278,28 +44839,32 @@

    teal.slice coverage - 66.06%

    315 - 122x + 122x +
          xl <- xl[!is.na(xl)]
    316 - 122x + 122x +
          xl <- xl[is.finite(xl)]
    317 - 122x + 122x +
          private$is_choice_limited <- (any(xl < choices[1L]) | any(xl > choices[2L]))
    318 - 122x + 122x +
          invisible(NULL)
    @@ -43341,14 +44906,16 @@

    teal.slice coverage - 66.06%

    324 - 33x + 33x +
          if (isTRUE(private$get_keep_inf())) {
    325 - 2x + 2x +
            call("|", call("is.infinite", varname), filter_call)
    @@ -43362,7 +44929,8 @@

    teal.slice coverage - 66.06%

    327 - 31x + 31x +
            filter_call
    @@ -43425,14 +44993,16 @@

    teal.slice coverage - 66.06%

    336 - 122x + 122x +
          if (private$is_integer && diff(range(pretty_range) > 2)) {
    337 - 45x + 45x +
            return(1L)
    @@ -43446,21 +45016,24 @@

    teal.slice coverage - 66.06%

    339 - 77x + 77x +
            n_steps <- length(pretty_range) - 1
    340 - 77x + 77x +
            return(
    341 - 77x + 77x +
              signif(digits = 10, (max(pretty_range) - min(pretty_range)) / n_steps)
    @@ -43495,35 +45068,40 @@

    teal.slice coverage - 66.06%

    346 - 138x + 138x +
          tryCatch(
    347 - 138x + 138x +
            expr = {
    348 - 138x + 138x +
              values <- as.numeric(values)
    349 - 4x + 4x +
              if (anyNA(values)) stop()
    350 - 134x + 134x +
              values
    @@ -43537,7 +45115,8 @@

    teal.slice coverage - 66.06%

    352 - 138x + 138x +
            error = function(e) stop("Vector of set values must contain values coercible to numeric")
    @@ -43572,21 +45151,24 @@

    teal.slice coverage - 66.06%

    357 - 2x + 2x +
          if (length(values) != 2L) stop("Vector of set values must have length two.")
    358 - 2x + 2x +
          if (values[1L] > values[2L]) stop("Vector of set values must be sorted.")
    359 - 130x + 130x +
          values
    @@ -43614,21 +45196,24 @@

    teal.slice coverage - 66.06%

    363 - 2x + 2x +
          if (values[1L] < private$get_choices()[1L]) values[1L] <- private$get_choices()[1L]
    364 - 2x + 2x +
          if (values[2L] > private$get_choices()[2L]) values[2L] <- private$get_choices()[2L]
    365 - 130x + 130x +
          values
    @@ -43670,35 +45255,40 @@

    teal.slice coverage - 66.06%

    371 - 34x + 34x +
          if (private$is_choice_limited) {
    372 - 1x + 1x +
            TRUE
    373 - 33x + 33x +
          } else if (!isTRUE(all.equal(private$get_selected(), private$get_choices()))) {
    374 - 31x + 31x +
            TRUE
    375 - 2x + 2x +
          } else if (!isTRUE(private$get_keep_inf()) && private$inf_count > 0) {
    @@ -43712,14 +45302,16 @@

    teal.slice coverage - 66.06%

    377 - 2x + 2x +
          } else if (!isTRUE(private$get_keep_na()) && private$na_count > 0) {
    378 - 1x + 1x +
            TRUE
    @@ -43733,7 +45325,8 @@

    teal.slice coverage - 66.06%

    380 - 1x + 1x +
            FALSE
    @@ -43782,21 +45375,24 @@

    teal.slice coverage - 66.06%

    387 - 5x + 5x +
          list(
    388 - 5x + 5x +
            list(type = "line", x0 = values[1], x1 = values[1], y0 = -100, y1 = 100, yref = "paper"),
    389 - 5x + 5x +
            list(type = "line", x0 = values[2], x1 = values[2], y0 = -100, y1 = 100, yref = "paper")
    @@ -43880,70 +45476,80 @@

    teal.slice coverage - 66.06%

    401 - 5x + 5x +
          ns <- NS(id)
    402 - 5x + 5x +
          shiny::isolate({
    403 - 5x + 5x +
            ui_input <- shinyWidgets::numericRangeInput(
    404 - 5x + 5x +
              inputId = ns("selection_manual"),
    405 - 5x + 5x +
              label = NULL,
    406 - 5x + 5x +
              min = private$get_choices()[1L],
    407 - 5x + 5x +
              max = private$get_choices()[2L],
    408 - 5x + 5x +
              value = private$get_selected(),
    409 - 5x + 5x +
              step = private$numeric_step,
    410 - 5x + 5x +
              width = "100%"
    @@ -43957,28 +45563,32 @@

    teal.slice coverage - 66.06%

    412 - 5x + 5x +
            tagList(
    413 - 5x + 5x +
              div(
    414 - 5x + 5x +
                class = "choices_state",
    415 - 5x + 5x +
                tags$head(tags$script(
    @@ -44006,21 +45616,24 @@

    teal.slice coverage - 66.06%

    419 - 5x + 5x +
                  HTML(
    420 - 5x + 5x +
                    '$(document).ready(function() {
    421 - 5x + 5x +
                      $("[data-toggle=\'popover\']").popover();
    @@ -44034,35 +45647,40 @@

    teal.slice coverage - 66.06%

    423 - 5x + 5x +
                      $(document).on("click", function (e) {
    424 - 5x + 5x +
                        if (!$("[data-toggle=\'popover\']").is(e.target) &&
    425 - 5x + 5x +
                            $("[data-toggle=\'popover\']").has(e.target).length === 0 &&
    426 - 5x + 5x +
                            $(".popover").has(e.target).length === 0) {
    427 - 5x + 5x +
                          $("[data-toggle=\'popover\']").popover("hide");
    @@ -44104,105 +45722,120 @@

    teal.slice coverage - 66.06%

    433 - 5x + 5x +
                div(
    434 - 5x + 5x +
                  actionLink(
    435 - 5x + 5x +
                    ns("plotly_info"),
    436 - 5x + 5x +
                    label = NULL,
    437 - 5x + 5x +
                    icon = icon("question-circle"),
    438 - 5x + 5x +
                    "data-toggle" = "popover",
    439 - 5x + 5x +
                    "data-html" = "true",
    440 - 5x + 5x +
                    "data-placement" = "left",
    441 - 5x + 5x +
                    "data-trigger" = "click",
    442 - 5x + 5x +
                    "data-title" = "Plot actions",
    443 - 5x + 5x +
                    "data-content" = "<p>
    444 - 5x + 5x +
                                      Drag vertical lines to set selection.<br>
    445 - 5x + 5x +
                                      Drag across plot to zoom in.<br>
    446 - 5x + 5x +
                                      Drag axis to pan.<br>
    447 - 5x + 5x +
                                      Double click to zoom out."
    @@ -44216,7 +45849,8 @@

    teal.slice coverage - 66.06%

    449 - 5x + 5x +
                  style = "text-align: right; font-size: 0.7em; margin-bottom: -1em; position: relative; z-index: 9;"
    @@ -44230,35 +45864,40 @@

    teal.slice coverage - 66.06%

    451 - 5x + 5x +
                shinycssloaders::withSpinner(
    452 - 5x + 5x +
                  plotly::plotlyOutput(ns("plot"), height = "50px"),
    453 - 5x + 5x +
                  type = 4,
    454 - 5x + 5x +
                  size = 0.25,
    455 - 5x + 5x +
                  hide.ui = FALSE
    @@ -44272,7 +45911,8 @@

    teal.slice coverage - 66.06%

    457 - 5x + 5x +
                ui_input
    @@ -44286,28 +45926,32 @@

    teal.slice coverage - 66.06%

    459 - 5x + 5x +
              div(
    460 - 5x + 5x +
                class = "filter-card-body-keep-na-inf",
    461 - 5x + 5x +
                private$keep_inf_ui(ns("keep_inf")),
    462 - 5x + 5x +
                private$keep_na_ui(ns("keep_na"))
    @@ -44391,28 +46035,32 @@

    teal.slice coverage - 66.06%

    474 - 5x + 5x +
          moduleServer(
    475 - 5x + 5x +
            id = id,
    476 - 5x + 5x +
            function(input, output, session) {
    477 - 5x + 5x +
              logger::log_trace("RangeFilterState$server initializing, id: { private$get_id() }")
    @@ -44433,7 +46081,8 @@

    teal.slice coverage - 66.06%

    480 - 5x + 5x +
              selection_manual <- debounce(reactive(input$selection_manual), 200)
    @@ -44454,7 +46103,8 @@

    teal.slice coverage - 66.06%

    483 - 5x + 5x +
              plot_data <- c(private$plot_data, source = session$ns("histogram_plot"))
    @@ -44475,42 +46125,48 @@

    teal.slice coverage - 66.06%

    486 - 5x + 5x +
              output$plot <- plotly::renderPlotly({
    487 - 5x + 5x +
                histogram <- do.call(plotly::plot_ly, plot_data)
    488 - 5x + 5x +
                histogram <- do.call(plotly::layout, c(list(p = histogram), private$plot_layout()))
    489 - 5x + 5x +
                histogram <- do.call(plotly::config, c(list(p = histogram), private$plot_config()))
    490 - 5x + 5x +
                histogram <- do.call(plotly::add_histogram, c(list(p = histogram), private$plot_filtered()))
    491 - 5x + 5x +
                histogram
    @@ -44538,63 +46194,72 @@

    teal.slice coverage - 66.06%

    495 - 5x + 5x +
              private$observers$relayout <-
    496 - 5x + 5x +
                observeEvent(
    497 - 5x + 5x +
                  ignoreNULL = FALSE,
    498 - 5x + 5x +
                  ignoreInit = TRUE,
    499 - 5x + 5x +
                  eventExpr = plotly::event_data("plotly_relayout", source = session$ns("histogram_plot")),
    500 - 5x + 5x +
                  handlerExpr = {
    501 - 1x + 1x +
                    logger::log_trace("RangeFilterState$server@1 selection changed, id: { private$get_id() }")
    502 - 1x + 1x +
                    event <- plotly::event_data("plotly_relayout", source = session$ns("histogram_plot"))
    503 - 1x + 1x +
                    if (any(grepl("shapes", names(event)))) {
    @@ -44783,42 +46448,48 @@

    teal.slice coverage - 66.06%

    530 - 5x + 5x +
              private$observers$selection_api <-
    531 - 5x + 5x +
                observeEvent(
    532 - 5x + 5x +
                  ignoreNULL = FALSE,
    533 - 5x + 5x +
                  ignoreInit = TRUE,
    534 - 5x + 5x +
                  eventExpr = private$get_selected(),
    535 - 5x + 5x +
                  handlerExpr = {
    @@ -44909,35 +46580,40 @@

    teal.slice coverage - 66.06%

    548 - 5x + 5x +
              private$observers$selection_manual <- observeEvent(
    549 - 5x + 5x +
                ignoreNULL = FALSE,
    550 - 5x + 5x +
                ignoreInit = TRUE,
    551 - 5x + 5x +
                eventExpr = selection_manual(),
    552 - 5x + 5x +
                handlerExpr = {
    @@ -45203,14 +46879,16 @@

    teal.slice coverage - 66.06%

    590 - 5x + 5x +
              private$keep_inf_srv("keep_inf")
    591 - 5x + 5x +
              private$keep_na_srv("keep_na")
    @@ -45224,14 +46902,16 @@

    teal.slice coverage - 66.06%

    593 - 5x + 5x +
              logger::log_trace("RangeFilterState$server initialized, id: { private$get_id() }")
    594 - 5x + 5x +
              NULL
    @@ -45518,42 +47198,48 @@

    teal.slice coverage - 66.06%

    635 - 5x + 5x +
          selection <- private$get_selected()
    636 - 5x + 5x +
          tagList(
    637 - 5x + 5x +
            tags$span(shiny::HTML(selection[1], "&ndash;", selection[2]), class = "filter-card-summary-value"),
    638 - 5x + 5x +
            tags$span(
    639 - 5x + 5x +
              class = "filter-card-summary-controls",
    640 - 5x + 5x +
              if (isTRUE(private$get_keep_na()) && private$na_count > 0) {
    @@ -45595,7 +47281,8 @@

    teal.slice coverage - 66.06%

    646 - 5x + 5x +
              } else if (isFALSE(private$get_keep_na()) && private$na_count > 0) {
    @@ -45644,7 +47331,8 @@

    teal.slice coverage - 66.06%

    653 - 5x + 5x +
                NULL
    @@ -45658,7 +47346,8 @@

    teal.slice coverage - 66.06%

    655 - 5x + 5x +
              if (isTRUE(private$get_keep_inf()) && private$inf_count > 0) {
    @@ -45700,7 +47389,8 @@

    teal.slice coverage - 66.06%

    661 - 5x + 5x +
              } else if (isFALSE(private$get_keep_inf()) && private$inf_count > 0) {
    @@ -45749,7 +47439,8 @@

    teal.slice coverage - 66.06%

    668 - 5x + 5x +
                NULL
    @@ -45833,7 +47524,8 @@

    teal.slice coverage - 66.06%

    680 - 5x + 5x +
          ns <- NS(id)
    @@ -45847,7 +47539,8 @@

    teal.slice coverage - 66.06%

    682 - 5x + 5x +
          if (private$inf_count > 0) {
    @@ -45987,7 +47680,8 @@

    teal.slice coverage - 66.06%

    702 - 5x + 5x +
            NULL
    @@ -46064,7 +47758,8 @@

    teal.slice coverage - 66.06%

    713 - 5x + 5x +
          moduleServer(id, function(input, output, session) {
    @@ -46092,42 +47787,48 @@

    teal.slice coverage - 66.06%

    717 - 5x + 5x +
            output$trigger_visible <- renderUI({
    718 - 5x + 5x +
              updateCountText(
    719 - 5x + 5x +
                inputId = "count_label",
    720 - 5x + 5x +
                label = "Keep Inf",
    721 - 5x + 5x +
                countmax = private$inf_count,
    722 - 5x + 5x +
                countnow = private$inf_filtered_count()
    @@ -46141,7 +47842,8 @@

    teal.slice coverage - 66.06%

    724 - 5x + 5x +
              NULL
    @@ -46183,35 +47885,40 @@

    teal.slice coverage - 66.06%

    730 - 5x + 5x +
            private$observers$keep_inf_api <- observeEvent(
    731 - 5x + 5x +
              ignoreNULL = TRUE, # its not possible for range that NULL is selected
    732 - 5x + 5x +
              ignoreInit = TRUE, # ignoreInit: should not matter because we set the UI with the desired initial state
    733 - 5x + 5x +
              eventExpr = private$get_keep_inf(),
    734 - 5x + 5x +
              handlerExpr = {
    @@ -46288,35 +47995,40 @@

    teal.slice coverage - 66.06%

    745 - 5x + 5x +
            private$observers$keep_inf <- observeEvent(
    746 - 5x + 5x +
              ignoreNULL = TRUE, # it's not possible for range that NULL is selected
    747 - 5x + 5x +
              ignoreInit = TRUE, # ignoreInit: should not matter because we set the UI with the desired initial state
    748 - 5x + 5x +
              eventExpr = input$value,
    749 - 5x + 5x +
              handlerExpr = {
    @@ -46365,7 +48077,8 @@

    teal.slice coverage - 66.06%

    756 - 5x + 5x +
            invisible(NULL)
    @@ -46546,7 +48259,8 @@

    teal.slice coverage - 66.06%

    21 - 9x + 9x +
      if (is.factor(choices)) {
    @@ -46574,35 +48288,40 @@

    teal.slice coverage - 66.06%

    25 - 9x + 9x +
      stopifnot(
    26 - 9x + 9x +
        is.character(choices) ||
    27 - 9x + 9x +
          is.numeric(choices) ||
    28 - 9x + 9x +
          is.logical(choices) ||
    29 - 9x + 9x +
          (length(choices) == 1 && is.na(choices))
    @@ -46623,7 +48342,8 @@

    teal.slice coverage - 66.06%

    32 - 9x + 9x +
      if (is.factor(labels)) {
    @@ -46651,14 +48371,16 @@

    teal.slice coverage - 66.06%

    36 - 9x + 9x +
      checkmate::assert_character(labels[!is.na(labels)], any.missing = FALSE)
    37 - 9x + 9x +
      if (length(choices) != length(labels)) {
    @@ -46679,14 +48401,16 @@

    teal.slice coverage - 66.06%

    40 - 9x + 9x +
      stopifnot(is.null(subset) || is.vector(subset))
    41 - 9x + 9x +
      stopifnot(is.null(types) || is.vector(types))
    @@ -46700,14 +48424,16 @@

    teal.slice coverage - 66.06%

    43 - 9x + 9x +
      if (is.vector(types)) {
    44 - 9x + 9x +
        stopifnot(length(choices) == length(types))
    @@ -46728,7 +48454,8 @@

    teal.slice coverage - 66.06%

    47 - 9x + 9x +
      if (!is.null(subset)) {
    @@ -46791,56 +48518,64 @@

    teal.slice coverage - 66.06%

    56 - 9x + 9x +
      is_dupl <- duplicated(choices)
    57 - 9x + 9x +
      choices <- choices[!is_dupl]
    58 - 9x + 9x +
      labels <- labels[!is_dupl]
    59 - 9x + 9x +
      types <- types[!is_dupl]
    60 - 9x + 9x +
      labels[is.na(labels)] <- "Label Missing"
    61 - 9x + 9x +
      raw_labels <- labels
    62 - 9x + 9x +
      combined_labels <- if (length(choices) > 0) {
    63 - 9x + 9x +
        paste0(choices, ": ", labels)
    @@ -46875,7 +48610,8 @@

    teal.slice coverage - 66.06%

    68 - 9x + 9x +
      if (!is.null(subset)) {
    @@ -46924,49 +48660,56 @@

    teal.slice coverage - 66.06%

    75 - 9x + 9x +
      choices <- structure(
    76 - 9x + 9x +
        choices,
    77 - 9x + 9x +
        names = combined_labels,
    78 - 9x + 9x +
        raw_labels = raw_labels,
    79 - 9x + 9x +
        combined_labels = combined_labels,
    80 - 9x + 9x +
        class = c("choices_labeled", "character"),
    81 - 9x + 9x +
        types = types
    @@ -46987,7 +48730,8 @@

    teal.slice coverage - 66.06%

    84 - 9x + 9x +
      return(choices)
    @@ -47847,28 +49591,32 @@

    teal.slice coverage - 66.06%

    121 - 16x + 16x +
          shiny::isolate({
    122 - 16x + 16x +
            checkmate::assert_logical(x)
    123 - 15x + 15x +
            checkmate::assert_logical(slice$selected, null.ok = TRUE)
    124 - 14x + 14x +
            super$initialize(x = x, x_reactive = x_reactive, slice = slice, extract_type = extract_type)
    @@ -47882,7 +49630,8 @@

    teal.slice coverage - 66.06%

    126 - 14x + 14x +
            private$set_choices(slice$choices)
    @@ -47896,28 +49645,32 @@

    teal.slice coverage - 66.06%

    128 - 14x + 14x +
            if (is.null(slice$selected) && slice$multiple) {
    129 - 7x + 7x +
              slice$selected <- private$get_choices()
    130 - 7x + 7x +
            } else if (length(slice$selected) != 1 && !slice$multiple) {
    131 - 3x + 3x +
              slice$selected <- TRUE
    @@ -47931,28 +49684,32 @@

    teal.slice coverage - 66.06%

    133 - 14x + 14x +
            private$set_selected(slice$selected)
    134 - 14x + 14x +
            df <- factor(x, levels = c(TRUE, FALSE))
    135 - 14x + 14x +
            tbl <- table(df)
    136 - 14x + 14x +
            private$set_choices_counts(tbl)
    @@ -47966,7 +49723,8 @@

    teal.slice coverage - 66.06%

    138 - 14x + 14x +
          invisible(self)
    @@ -48043,7 +49801,8 @@

    teal.slice coverage - 66.06%

    149 - 6x + 6x +
          if (isFALSE(private$is_any_filtered())) {
    @@ -48064,28 +49823,32 @@

    teal.slice coverage - 66.06%

    152 - 4x + 4x +
          if (missing(dataname)) dataname <- private$get_dataname()
    153 - 6x + 6x +
          varname <- private$get_varname_prefixed(dataname)
    154 - 6x + 6x +
          choices <- private$get_selected()
    155 - 6x + 6x +
          n_choices <- length(choices)
    @@ -48099,35 +49862,40 @@

    teal.slice coverage - 66.06%

    157 - 6x + 6x +
          filter_call <-
    158 - 6x + 6x +
            if (n_choices == 1 && choices) {
    159 - 1x + 1x +
              varname
    160 - 6x + 6x +
            } else if (n_choices == 1 && !choices) {
    161 - 4x + 4x +
              call("!", varname)
    @@ -48141,7 +49909,8 @@

    teal.slice coverage - 66.06%

    163 - 1x + 1x +
              call("%in%", varname, make_c_call(choices))
    @@ -48155,7 +49924,8 @@

    teal.slice coverage - 66.06%

    165 - 6x + 6x +
          private$add_keep_na_call(filter_call, varname)
    @@ -48225,14 +49995,16 @@

    teal.slice coverage - 66.06%

    175 - 14x + 14x +
          private$teal_slice$choices <- c(TRUE, FALSE)
    176 - 14x + 14x +
          invisible(NULL)
    @@ -48267,14 +50039,16 @@

    teal.slice coverage - 66.06%

    181 - 14x + 14x +
          private$choices_counts <- choices_counts
    182 - 14x + 14x +
          invisible(NULL)
    @@ -48295,35 +50069,40 @@

    teal.slice coverage - 66.06%

    185 - 21x + 21x +
          tryCatch(
    186 - 21x + 21x +
            expr = {
    187 - 21x + 21x +
              values <- as.logical(values)
    188 - 1x + 1x +
              if (anyNA(values)) stop()
    189 - 20x + 20x +
              values
    @@ -48337,7 +50116,8 @@

    teal.slice coverage - 66.06%

    191 - 21x + 21x +
            error = function(e) stop("Vector of set values must contain values coercible to logical.")
    @@ -48372,28 +50152,32 @@

    teal.slice coverage - 66.06%

    196 - 20x + 20x +
          if (!private$is_multiple() && length(values) > 1) {
    197 - 1x + 1x +
            warning(
    198 - 1x + 1x +
              sprintf("Selection: %s is not a vector of length one. ", toString(values, width = 360)),
    199 - 1x + 1x +
              "Maintaining previous selection."
    @@ -48407,7 +50191,8 @@

    teal.slice coverage - 66.06%

    201 - 1x + 1x +
            values <- shiny::isolate(private$get_selected())
    @@ -48421,7 +50206,8 @@

    teal.slice coverage - 66.06%

    203 - 20x + 20x +
          values
    @@ -48463,7 +50249,8 @@

    teal.slice coverage - 66.06%

    209 - 6x + 6x +
          if (private$is_choice_limited) {
    @@ -48477,14 +50264,16 @@

    teal.slice coverage - 66.06%

    211 - 6x + 6x +
          } else if (all(private$choices_counts > 0)) {
    212 - 6x + 6x +
            TRUE
    @@ -50926,21 +52715,24 @@

    teal.slice coverage - 66.06%

    146 - 25x + 25x +
          shiny::isolate({
    147 - 25x + 25x +
            checkmate::assert_multi_class(x, c("POSIXct", "POSIXlt"))
    148 - 24x + 24x +
            checkmate::assert_class(x_reactive, "reactive")
    @@ -50954,35 +52746,40 @@

    teal.slice coverage - 66.06%

    150 - 24x + 24x +
            super$initialize(
    151 - 24x + 24x +
              x = x,
    152 - 24x + 24x +
              x_reactive = x_reactive,
    153 - 24x + 24x +
              slice = slice,
    154 - 24x + 24x +
              extract_type = extract_type
    @@ -50996,28 +52793,32 @@

    teal.slice coverage - 66.06%

    156 - 24x + 24x +
            checkmate::assert_multi_class(slice$choices, c("POSIXct", "POSIXlt"), null.ok = TRUE)
    157 - 23x + 23x +
            private$set_choices(slice$choices)
    158 - 15x + 15x +
            if (is.null(slice$selected)) slice$selected <- slice$choices
    159 - 23x + 23x +
            private$set_selected(slice$selected)
    @@ -51038,7 +52839,8 @@

    teal.slice coverage - 66.06%

    162 - 22x + 22x +
          invisible(self)
    @@ -51122,14 +52924,16 @@

    teal.slice coverage - 66.06%

    174 - 7x + 7x +
          if (isFALSE(private$is_any_filtered())) {
    175 - 1x + 1x +
            return(NULL)
    @@ -51143,63 +52947,72 @@

    teal.slice coverage - 66.06%

    177 - 4x + 4x +
          if (missing(dataname)) dataname <- private$get_dataname()
    178 - 6x + 6x +
          varname <- private$get_varname_prefixed(dataname)
    179 - 6x + 6x +
          choices <- private$get_selected()
    180 - 6x + 6x +
          tzone <- Find(function(x) x != "", attr(as.POSIXlt(choices), "tzone"))
    181 - 6x + 6x +
          class <- class(choices)[1L]
    182 - 6x + 6x +
          date_fun <- as.name(
    183 - 6x + 6x +
            switch(class,
    184 - 6x + 6x +
              "POSIXct" = "as.POSIXct",
    185 - 6x + 6x +
              "POSIXlt" = "as.POSIXlt"
    @@ -51220,21 +53033,24 @@

    teal.slice coverage - 66.06%

    188 - 6x + 6x +
          choices <- as.character(choices + c(0, 1))
    189 - 6x + 6x +
          filter_call <-
    190 - 6x + 6x +
            call(
    @@ -51248,7 +53064,8 @@

    teal.slice coverage - 66.06%

    192 - 6x + 6x +
              call(
    @@ -51262,14 +53079,16 @@

    teal.slice coverage - 66.06%

    194 - 6x + 6x +
                varname,
    195 - 6x + 6x +
                as.call(list(date_fun, choices[1L], tz = tzone))
    @@ -51283,7 +53102,8 @@

    teal.slice coverage - 66.06%

    197 - 6x + 6x +
              call(
    @@ -51297,14 +53117,16 @@

    teal.slice coverage - 66.06%

    199 - 6x + 6x +
                varname,
    200 - 6x + 6x +
                as.call(list(date_fun, choices[2L], tz = tzone))
    @@ -51325,7 +53147,8 @@

    teal.slice coverage - 66.06%

    203 - 6x + 6x +
          private$add_keep_na_call(filter_call, varname)
    @@ -51388,14 +53211,16 @@

    teal.slice coverage - 66.06%

    212 - 23x + 23x +
          if (is.null(choices)) {
    213 - 20x + 20x +
            choices <- as.POSIXct(trunc(range(private$x, na.rm = TRUE), units = "secs"))
    @@ -51409,28 +53234,32 @@

    teal.slice coverage - 66.06%

    215 - 3x + 3x +
            choices <- as.POSIXct(choices, units = "secs")
    216 - 3x + 3x +
            choices_adjusted <- c(
    217 - 3x + 3x +
              max(choices[1L], min(as.POSIXct(private$x), na.rm = TRUE)),
    218 - 3x + 3x +
              min(choices[2L], max(as.POSIXct(private$x), na.rm = TRUE))
    @@ -51444,28 +53273,32 @@

    teal.slice coverage - 66.06%

    220 - 3x + 3x +
            if (any(choices != choices_adjusted)) {
    221 - 1x + 1x +
              warning(sprintf(
    222 - 1x + 1x +
                "Choices adjusted (some values outside of variable range). Varname: %s, dataname: %s.",
    223 - 1x + 1x +
                private$get_varname(), private$get_dataname()
    @@ -51479,7 +53312,8 @@

    teal.slice coverage - 66.06%

    225 - 1x + 1x +
              choices <- choices_adjusted
    @@ -51493,35 +53327,40 @@

    teal.slice coverage - 66.06%

    227 - 3x + 3x +
            if (choices[1L] >= choices[2L]) {
    228 - 1x + 1x +
              warning(sprintf(
    229 - 1x + 1x +
                "Invalid choices: lower is higher / equal to upper, or not in range of variable values.
    230 - 1x + 1x +
                Setting defaults. Varname: %s, dataname: %s.",
    231 - 1x + 1x +
                private$get_varname(), private$get_dataname()
    @@ -51535,7 +53374,8 @@

    teal.slice coverage - 66.06%

    233 - 1x + 1x +
              choices <- range(private$x, na.rm = TRUE)
    @@ -51563,28 +53403,32 @@

    teal.slice coverage - 66.06%

    237 - 23x + 23x +
          private$set_is_choice_limited(private$x, choices)
    238 - 23x + 23x +
          private$x <- private$x[
    239 - 23x + 23x +
            (as.POSIXct(trunc(private$x, units = "secs")) >= choices[1L] &
    240 - 23x + 23x +
              as.POSIXct(trunc(private$x, units = "secs")) <= choices[2L]) | is.na(private$x)
    @@ -51598,14 +53442,16 @@

    teal.slice coverage - 66.06%

    242 - 23x + 23x +
          private$teal_slice$choices <- choices
    243 - 23x + 23x +
          invisible(NULL)
    @@ -51647,14 +53493,16 @@

    teal.slice coverage - 66.06%

    249 - 23x + 23x +
          private$is_choice_limited <- (any(xl < choices[1L], na.rm = TRUE) | any(xl > choices[2L], na.rm = TRUE))
    250 - 23x + 23x +
          invisible(NULL)
    @@ -51675,21 +53523,24 @@

    teal.slice coverage - 66.06%

    253 - 34x + 34x +
          tryCatch(
    254 - 34x + 34x +
            expr = {
    255 - 34x + 34x +
              values <- as.POSIXct(values, origin = "1970-01-01 00:00:00")
    @@ -51703,7 +53554,8 @@

    teal.slice coverage - 66.06%

    257 - 31x + 31x +
              values
    @@ -51717,7 +53569,8 @@

    teal.slice coverage - 66.06%

    259 - 34x + 34x +
            error = function(e) stop("Vector of set values must contain values coercible to POSIX.")
    @@ -51745,42 +53598,48 @@

    teal.slice coverage - 66.06%

    263 - 1x + 1x +
          if (length(values) != 2) stop("Vector of set values must have length two.")
    264 - 30x + 30x +
          if (values[1] > values[2]) {
    265 - 1x + 1x +
            warning(
    266 - 1x + 1x +
              sprintf(
    267 - 1x + 1x +
                "Start date '%s' is set after the end date '%s', the values will be replaced by a default datetime range.",
    268 - 1x + 1x +
                values[1], values[2]
    @@ -51801,7 +53660,8 @@

    teal.slice coverage - 66.06%

    271 - 1x + 1x +
            values <- isolate(private$get_choices())
    @@ -51815,7 +53675,8 @@

    teal.slice coverage - 66.06%

    273 - 30x + 30x +
          values
    @@ -51836,42 +53697,48 @@

    teal.slice coverage - 66.06%

    276 - 30x + 30x +
          choices <- private$get_choices()
    277 - 30x + 30x +
          if (values[1] < choices[1L] || values[1] > choices[2L]) {
    278 - 5x + 5x +
            warning(
    279 - 5x + 5x +
              sprintf(
    280 - 5x + 5x +
                "Value: %s is outside of the range for the column '%s' in dataset '%s', setting minimum possible value.",
    281 - 5x + 5x +
                values[1], private$get_varname(), toString(private$get_dataname())
    @@ -51892,7 +53759,8 @@

    teal.slice coverage - 66.06%

    284 - 5x + 5x +
            values[1] <- choices[1L]
    @@ -51913,35 +53781,40 @@

    teal.slice coverage - 66.06%

    287 - 30x + 30x +
          if (values[2] > choices[2L] | values[2] < choices[1L]) {
    288 - 5x + 5x +
            warning(
    289 - 5x + 5x +
              sprintf(
    290 - 5x + 5x +
                "Value: '%s' is outside of the range for the column '%s' in dataset '%s', setting maximum possible value.",
    291 - 5x + 5x +
                values[2], private$get_varname(), toString(private$get_dataname())
    @@ -51962,7 +53835,8 @@

    teal.slice coverage - 66.06%

    294 - 5x + 5x +
            values[2] <- choices[2L]
    @@ -51983,7 +53857,8 @@

    teal.slice coverage - 66.06%

    297 - 30x + 30x +
          values
    @@ -54796,42 +56671,48 @@

    teal.slice coverage - 66.06%

    142 - 165x + 165x +
          shiny::isolate({
    143 - 165x + 165x +
            checkmate::assert(
    144 - 165x + 165x +
              is.character(x),
    145 - 165x + 165x +
              is.factor(x),
    146 - 165x + 165x +
              length(unique(x[!is.na(x)])) < getOption("teal.threshold_slider_vs_checkboxgroup"),
    147 - 165x + 165x +
              combine = "or"
    @@ -54852,28 +56733,32 @@

    teal.slice coverage - 66.06%

    150 - 165x + 165x +
            x_factor <- if (!is.factor(x)) {
    151 - 129x + 129x +
              structure(
    152 - 129x + 129x +
                factor(as.character(x), levels = as.character(sort(unique(x)))),
    153 - 129x + 129x +
                label = attr(x, "label")
    @@ -54894,7 +56779,8 @@

    teal.slice coverage - 66.06%

    156 - 36x + 36x +
              x
    @@ -54915,35 +56801,40 @@

    teal.slice coverage - 66.06%

    159 - 165x + 165x +
            super$initialize(
    160 - 165x + 165x +
              x = x_factor,
    161 - 165x + 165x +
              x_reactive = x_reactive,
    162 - 165x + 165x +
              slice = slice,
    163 - 165x + 165x +
              extract_type = extract_type
    @@ -54957,63 +56848,72 @@

    teal.slice coverage - 66.06%

    165 - 165x + 165x +
            private$set_choices(slice$choices)
    166 - 165x + 165x +
            if (is.null(slice$selected) && slice$multiple) {
    167 - 42x + 42x +
              slice$selected <- private$get_choices()
    168 - 123x + 123x +
            } else if (is.null(slice$selected)) {
    169 - 1x + 1x +
              slice$selected <- private$get_choices()[1]
    170 - 122x + 122x +
            } else if (length(slice$selected) > 1 && !slice$multiple) {
    171 - 1x + 1x +
              warning(
    172 - 1x + 1x +
                "ChoicesFilterState allows \"selected\" to be of length 1 when \"multiple\" is FALSE. ",
    173 - 1x + 1x +
                "Only the first value will be used."
    @@ -55027,7 +56927,8 @@

    teal.slice coverage - 66.06%

    175 - 1x + 1x +
              slice$selected <- slice$selected[1]
    @@ -55041,28 +56942,32 @@

    teal.slice coverage - 66.06%

    177 - 165x + 165x +
            private$set_selected(slice$selected)
    178 - 165x + 165x +
            private$data_class <- class(x)[1L]
    179 - 165x + 165x +
            if (inherits(x, "POSIXt")) {
    180 - 9x + 9x +
              private$tzone <- Find(function(x) x != "", attr(as.POSIXlt(x), "tzone"))
    @@ -55083,7 +56988,8 @@

    teal.slice coverage - 66.06%

    183 - 165x + 165x +
            private$set_choices_counts(unname(table(x_factor)))
    @@ -55097,7 +57003,8 @@

    teal.slice coverage - 66.06%

    185 - 165x + 165x +
          invisible(self)
    @@ -55181,14 +57088,16 @@

    teal.slice coverage - 66.06%

    197 - 60x + 60x +
          if (isFALSE(private$is_any_filtered())) {
    198 - 7x + 7x +
            return(NULL)
    @@ -55202,49 +57111,56 @@

    teal.slice coverage - 66.06%

    200 - 29x + 29x +
          if (missing(dataname)) dataname <- private$get_dataname()
    201 - 53x + 53x +
          varname <- private$get_varname_prefixed(dataname)
    202 - 53x + 53x +
          selected <- private$get_selected()
    203 - 53x + 53x +
          if (length(selected) == 0) {
    204 - 6x + 6x +
            choices <- private$get_choices()
    205 - 6x + 6x +
            fun_compare <- if (length(choices) == 1L) "==" else "%in%"
    206 - 6x + 6x +
            filter_call <- call("!", call(fun_compare, varname, make_c_call(as.character(choices))))
    @@ -55258,14 +57174,16 @@

    teal.slice coverage - 66.06%

    208 - 47x + 47x +
            if (setequal(na.omit(private$x), selected)) {
    209 - 3x + 3x +
              filter_call <- NULL
    @@ -55279,7 +57197,8 @@

    teal.slice coverage - 66.06%

    211 - 44x + 44x +
              fun_compare <- if (length(selected) == 1L) "==" else "%in%"
    @@ -55293,14 +57212,16 @@

    teal.slice coverage - 66.06%

    213 - 44x + 44x +
              if (private$data_class != "factor") {
    214 - 37x + 37x +
                selected <- do.call(sprintf("as.%s", private$data_class), list(x = selected))
    @@ -55321,63 +57242,72 @@

    teal.slice coverage - 66.06%

    217 - 44x + 44x +
              filter_call <-
    218 - 44x + 44x +
                if (inherits(selected, "Date")) {
    219 - 1x + 1x +
                  call(fun_compare, varname, call("as.Date", make_c_call(as.character(selected))))
    220 - 44x + 44x +
                } else if (inherits(selected, c("POSIXct", "POSIXlt"))) {
    221 - 2x + 2x +
                  class <- class(selected)[1L]
    222 - 2x + 2x +
                  date_fun <- as.name(
    223 - 2x + 2x +
                    switch(class,
    224 - 2x + 2x +
                      "POSIXct" = "as.POSIXct",
    225 - 2x + 2x +
                      "POSIXlt" = "as.POSIXlt"
    @@ -55398,28 +57328,32 @@

    teal.slice coverage - 66.06%

    228 - 2x + 2x +
                  call(
    229 - 2x + 2x +
                    fun_compare,
    230 - 2x + 2x +
                    varname,
    231 - 2x + 2x +
                    as.call(list(date_fun, make_c_call(as.character(selected)), tz = private$tzone))
    @@ -55447,7 +57381,8 @@

    teal.slice coverage - 66.06%

    235 - 41x + 41x +
                  call(fun_compare, varname, make_c_call(selected))
    @@ -55475,7 +57410,8 @@

    teal.slice coverage - 66.06%

    239 - 53x + 53x +
          private$add_keep_na_call(filter_call, varname)
    @@ -55594,14 +57530,16 @@

    teal.slice coverage - 66.06%

    256 - 165x + 165x +
          if (is.null(choices)) {
    257 - 152x + 152x +
            choices <- levels(private$x)
    @@ -55615,49 +57553,56 @@

    teal.slice coverage - 66.06%

    259 - 13x + 13x +
            choices <- as.character(choices)
    260 - 13x + 13x +
            choices_adjusted <- choices[choices %in% levels(private$x)]
    261 - 13x + 13x +
            if (length(setdiff(choices, choices_adjusted)) > 0L) {
    262 - 2x + 2x +
              warning(
    263 - 2x + 2x +
                sprintf(
    264 - 2x + 2x +
                  "Some choices not found in data. Adjusting. Filter id: %s.",
    265 - 2x + 2x +
                  private$get_id()
    @@ -55678,7 +57623,8 @@

    teal.slice coverage - 66.06%

    268 - 2x + 2x +
              choices <- choices_adjusted
    @@ -55692,35 +57638,40 @@

    teal.slice coverage - 66.06%

    270 - 13x + 13x +
            if (length(choices) == 0) {
    271 - 1x + 1x +
              warning(
    272 - 1x + 1x +
                sprintf(
    273 - 1x + 1x +
                  "None of the choices were found in data. Setting defaults. Filter id: %s.",
    274 - 1x + 1x +
                  private$get_id()
    @@ -55741,7 +57692,8 @@

    teal.slice coverage - 66.06%

    277 - 1x + 1x +
              choices <- levels(private$x)
    @@ -55762,35 +57714,40 @@

    teal.slice coverage - 66.06%

    280 - 165x + 165x +
          private$set_is_choice_limited(private$x, choices)
    281 - 165x + 165x +
          private$teal_slice$choices <- choices
    282 - 165x + 165x +
          private$x <- private$x[(private$x %in% private$get_choices()) | is.na(private$x)]
    283 - 165x + 165x +
          private$x <- droplevels(private$x)
    284 - 165x + 165x +
          invisible(NULL)
    @@ -55825,21 +57782,24 @@

    teal.slice coverage - 66.06%

    289 - 165x + 165x +
          xl <- x[!is.na(x)]
    290 - 165x + 165x +
          private$is_choice_limited <- length(setdiff(xl, choices)) > 0L
    291 - 165x + 165x +
          invisible(NULL)
    @@ -55874,14 +57834,16 @@

    teal.slice coverage - 66.06%

    296 - 165x + 165x +
          private$choices_counts <- choices_counts
    297 - 165x + 165x +
          invisible(NULL)
    @@ -55979,7 +57941,8 @@

    teal.slice coverage - 66.06%

    311 - 23x + 23x +
          length(private$get_choices()) <= getOption("teal.threshold_slider_vs_checkboxgroup")
    @@ -56000,21 +57963,24 @@

    teal.slice coverage - 66.06%

    314 - 194x + 194x +
          tryCatch(
    315 - 194x + 194x +
            expr = {
    316 - 194x + 194x +
              values <- as.character(values)
    @@ -56035,7 +58001,8 @@

    teal.slice coverage - 66.06%

    319 - 194x + 194x +
            error = function(e) stop("The vactor of set values must contain values coercible to character.")
    @@ -56049,7 +58016,8 @@

    teal.slice coverage - 66.06%

    321 - 194x + 194x +
          values
    @@ -56077,28 +58045,32 @@

    teal.slice coverage - 66.06%

    325 - 194x + 194x +
          if (!private$is_multiple() && length(values) > 1) {
    326 - 1x + 1x +
            warning(
    327 - 1x + 1x +
              sprintf("Selection: %s is not a vector of length one. ", toString(values, width = 360)),
    328 - 1x + 1x +
              "Maintaining previous selection."
    @@ -56112,7 +58084,8 @@

    teal.slice coverage - 66.06%

    330 - 1x + 1x +
            values <- shiny::isolate(private$get_selected())
    @@ -56126,7 +58099,8 @@

    teal.slice coverage - 66.06%

    332 - 194x + 194x +
          values
    @@ -56147,35 +58121,40 @@

    teal.slice coverage - 66.06%

    335 - 194x + 194x +
          in_choices_mask <- values %in% private$get_choices()
    336 - 194x + 194x +
          if (length(values[!in_choices_mask]) > 0) {
    337 - 17x + 17x +
            warning(paste(
    338 - 17x + 17x +
              "Values:", toString(values[!in_choices_mask], width = 360),
    339 - 17x + 17x +
              "are not in choices of column", private$get_varname(), "in dataset", private$get_dataname(), "."
    @@ -56196,7 +58175,8 @@

    teal.slice coverage - 66.06%

    342 - 194x + 194x +
          values[in_choices_mask]
    @@ -56280,7 +58260,8 @@

    teal.slice coverage - 66.06%

    354 - 7x + 7x +
          ns <- NS(id)
    @@ -56301,21 +58282,24 @@

    teal.slice coverage - 66.06%

    357 - 7x + 7x +
          shiny::isolate({
    358 - 7x + 7x +
            countsmax <- private$choices_counts
    359 - 7x + 7x +
            countsnow <- if (!is.null(private$x_reactive())) {
    @@ -56336,7 +58320,8 @@

    teal.slice coverage - 66.06%

    362 - 7x + 7x +
              NULL
    @@ -56357,42 +58342,48 @@

    teal.slice coverage - 66.06%

    365 - 7x + 7x +
            ui_input <- if (private$is_checkboxgroup()) {
    366 - 7x + 7x +
              labels <- countBars(
    367 - 7x + 7x +
                inputId = ns("labels"),
    368 - 7x + 7x +
                choices = private$get_choices(),
    369 - 7x + 7x +
                countsnow = countsnow,
    370 - 7x + 7x +
                countsmax = countsmax
    @@ -56406,70 +58397,80 @@

    teal.slice coverage - 66.06%

    372 - 7x + 7x +
              div(
    373 - 7x + 7x +
                class = "choices_state",
    374 - 7x + 7x +
                if (private$is_multiple()) {
    375 - 7x + 7x +
                  checkboxGroupInput(
    376 - 7x + 7x +
                    inputId = ns("selection"),
    377 - 7x + 7x +
                    label = NULL,
    378 - 7x + 7x +
                    selected = private$get_selected(),
    379 - 7x + 7x +
                    choiceNames = labels,
    380 - 7x + 7x +
                    choiceValues = private$get_choices(),
    381 - 7x + 7x +
                    width = "100%"
    @@ -56700,28 +58701,32 @@

    teal.slice coverage - 66.06%

    414 - 7x + 7x +
            div(
    415 - 7x + 7x +
              uiOutput(ns("trigger_visible")),
    416 - 7x + 7x +
              ui_input,
    417 - 7x + 7x +
              private$keep_na_ui(ns("keep_na"))
    @@ -56798,28 +58803,32 @@

    teal.slice coverage - 66.06%

    428 - 7x + 7x +
          moduleServer(
    429 - 7x + 7x +
            id = id,
    430 - 7x + 7x +
            function(input, output, session) {
    431 - 7x + 7x +
              logger::log_trace("ChoicesFilterState$server_inputs initializing, id: { private$get_id() }")
    @@ -56854,21 +58863,24 @@

    teal.slice coverage - 66.06%

    436 - 7x + 7x +
              non_missing_values <- reactive(Filter(Negate(is.na), private$x_reactive()))
    437 - 7x + 7x +
              output$trigger_visible <- renderUI({
    438 - 7x + 7x +
                logger::log_trace("ChoicesFilterState$server_inputs@1 updating count labels, id: { private$get_id() }")
    @@ -56882,7 +58894,8 @@

    teal.slice coverage - 66.06%

    440 - 7x + 7x +
                countsnow <- if (!is.null(private$x_reactive())) {
    @@ -56903,7 +58916,8 @@

    teal.slice coverage - 66.06%

    443 - 7x + 7x +
                  NULL
    @@ -56931,49 +58945,56 @@

    teal.slice coverage - 66.06%

    447 - 7x + 7x +
                shiny::isolate({
    448 - 7x + 7x +
                  if (private$is_checkboxgroup()) {
    449 - 7x + 7x +
                    updateCountBars(
    450 - 7x + 7x +
                      inputId = "labels",
    451 - 7x + 7x +
                      choices = private$get_choices(),
    452 - 7x + 7x +
                      countsmax = private$choices_counts,
    453 - 7x + 7x +
                      countsnow = countsnow
    @@ -57085,7 +59106,8 @@

    teal.slice coverage - 66.06%

    469 - 7x + 7x +
                  NULL
    @@ -57113,42 +59135,48 @@

    teal.slice coverage - 66.06%

    473 - 7x + 7x +
              if (private$is_checkboxgroup()) {
    474 - 7x + 7x +
                private$observers$selection <- observeEvent(
    475 - 7x + 7x +
                  ignoreNULL = FALSE,
    476 - 7x + 7x +
                  ignoreInit = TRUE, # ignoreInit: should not matter because we set the UI with the desired initial state
    477 - 7x + 7x +
                  eventExpr = input$selection,
    478 - 7x + 7x +
                  handlerExpr = {
    @@ -57470,7 +59498,8 @@

    teal.slice coverage - 66.06%

    524 - 7x + 7x +
              private$keep_na_srv("keep_na")
    @@ -57505,7 +59534,8 @@

    teal.slice coverage - 66.06%

    529 - 7x + 7x +
              private$observers$selection_api <- observeEvent(private$get_selected(), {
    @@ -57526,49 +59556,56 @@

    teal.slice coverage - 66.06%

    532 - 2x + 2x +
                if (!setequal(input$selection, private$get_selected())) {
    533 - 2x + 2x +
                  logger::log_trace("ChoicesFilterState$server@1 state changed, id: { private$get_id() }")
    534 - 2x + 2x +
                  if (private$is_checkboxgroup()) {
    535 - 2x + 2x +
                    if (private$is_multiple()) {
    536 - 2x + 2x +
                      updateCheckboxGroupInput(
    537 - 2x + 2x +
                        inputId = "selection",
    538 - 2x + 2x +
                        selected = private$get_selected()
    @@ -57687,14 +59724,16 @@

    teal.slice coverage - 66.06%

    555 - 7x + 7x +
              logger::log_trace("ChoicesFilterState$server_inputs initialized, id: { private$get_id() }")
    556 - 7x + 7x +
              NULL
    @@ -57932,28 +59971,32 @@

    teal.slice coverage - 66.06%

    590 - 7x + 7x +
          selected <- private$get_selected()
    591 - 7x + 7x +
          selected_length <- nchar(paste0(selected, collapse = ""))
    592 - 7x + 7x +
          if (selected_length <= 40) {
    593 - 7x + 7x +
            selected_text <- paste0(selected, collapse = ", ")
    @@ -57988,28 +60031,32 @@

    teal.slice coverage - 66.06%

    598 - 7x + 7x +
          tagList(
    599 - 7x + 7x +
            tags$span(
    600 - 7x + 7x +
              class = "filter-card-summary-value",
    601 - 7x + 7x +
              selected_text
    @@ -58023,21 +60070,24 @@

    teal.slice coverage - 66.06%

    603 - 7x + 7x +
            tags$span(
    604 - 7x + 7x +
              class = "filter-card-summary-controls",
    605 - 7x + 7x +
              if (isTRUE(private$get_keep_na()) && private$na_count > 0) {
    @@ -58079,7 +60129,8 @@

    teal.slice coverage - 66.06%

    611 - 7x + 7x +
              } else if (isFALSE(private$get_keep_na()) && private$na_count > 0) {
    @@ -58128,7 +60179,8 @@

    teal.slice coverage - 66.06%

    618 - 7x + 7x +
                NULL
    @@ -58519,14 +60571,16 @@

    teal.slice coverage - 66.06%

    49 - 8x + 8x +
          checkmate::assert_class(datasets, "FilteredData")
    50 - 6x + 6x +
          private$filtered_data <- datasets
    @@ -58610,7 +60664,8 @@

    teal.slice coverage - 66.06%

    62 - 8x + 8x +
          private$filtered_data$get_filter_state()
    @@ -58680,14 +60735,16 @@

    teal.slice coverage - 66.06%

    72 - 5x + 5x +
          private$filtered_data$set_filter_state(filter)
    73 - 5x + 5x +
          invisible(NULL)
    @@ -58778,14 +60835,16 @@

    teal.slice coverage - 66.06%

    86 - 1x + 1x +
          private$filtered_data$remove_filter_state(filter)
    87 - 1x + 1x +
          invisible(NULL)
    @@ -58869,21 +60928,24 @@

    teal.slice coverage - 66.06%

    99 - 2x + 2x +
          datanames_to_remove <- if (missing(datanames)) private$filtered_data$datanames() else datanames
    100 - 2x + 2x +
          private$filtered_data$clear_filter_states(datanames = datanames_to_remove)
    101 - 2x + 2x +
          invisible(NULL)
    @@ -59582,49 +61644,56 @@

    teal.slice coverage - 66.06%

    92 - 775x + 775x +
      slices <- list(...)
    93 - 775x + 775x +
      checkmate::assert_list(slices, types = "teal_slice", any.missing = FALSE)
    94 - 774x + 774x +
      slices_id <- shiny::isolate(vapply(slices, `[[`, character(1L), "id"))
    95 - 774x + 774x +
      if (any(duplicated(slices_id))) {
    96 - 1x + 1x +
        stop(
    97 - 1x + 1x +
          "Some teal_slice objects have the same id:\n",
    98 - 1x + 1x +
          toString(unique(slices_id[duplicated(slices_id)]))
    @@ -59645,35 +61714,40 @@

    teal.slice coverage - 66.06%

    101 - 773x + 773x +
      checkmate::assert_list(exclude_varnames, names = "named", types = "character", null.ok = TRUE, min.len = 1)
    102 - 772x + 772x +
      checkmate::assert_list(include_varnames, names = "named", types = "character", null.ok = TRUE, min.len = 1)
    103 - 771x + 771x +
      checkmate::assert_character(count_type, len = 1, null.ok = TRUE)
    104 - 769x + 769x +
      checkmate::assert_subset(count_type, choices = c("all", "none"), empty.ok = TRUE)
    105 - 768x + 768x +
      checkmate::assert_logical(allow_add)
    @@ -59687,35 +61761,40 @@

    teal.slice coverage - 66.06%

    107 - 767x + 767x +
      duplicated_datasets <- intersect(names(include_varnames), names(exclude_varnames))
    108 - 767x + 767x +
      if (length(duplicated_datasets)) {
    109 - 1x + 1x +
        stop(
    110 - 1x + 1x +
          "Some datasets are specified in both, include_varnames and exclude_varnames:\n",
    111 - 1x + 1x +
          toString(duplicated_datasets)
    @@ -59743,49 +61822,56 @@

    teal.slice coverage - 66.06%

    115 - 766x + 766x +
      structure(
    116 - 766x + 766x +
        slices,
    117 - 766x + 766x +
        exclude_varnames = exclude_varnames,
    118 - 766x + 766x +
        include_varnames = include_varnames,
    119 - 766x + 766x +
        count_type = count_type,
    120 - 766x + 766x +
        allow_add = allow_add,
    121 - 766x + 766x +
        class = c("teal_slices", class(slices))
    @@ -59855,7 +61941,8 @@

    teal.slice coverage - 66.06%

    131 - 523x + 523x +
      inherits(x, "teal_slices")
    @@ -60016,21 +62103,24 @@

    teal.slice coverage - 66.06%

    154 - 1115x + 1115x +
      ans <- unclass(x)
    155 - 49x + 49x +
      if (recursive) ans[] <- lapply(ans, as.list)
    156 - 1115x + 1115x +
      ans
    @@ -60093,21 +62183,24 @@

    teal.slice coverage - 66.06%

    165 - 3x + 3x +
      if (missing(i)) i <- seq_along(x)
    166 - 551x + 551x +
      if (length(i) == 0L) {
    167 - 197x + 197x +
        return(x[0])
    @@ -60121,35 +62214,40 @@

    teal.slice coverage - 66.06%

    169 - 1x + 1x +
      if (is.logical(i) && length(i) > length(x)) stop("subscript out of bounds")
    170 - 1x + 1x +
      if (is.numeric(i) && max(i) > length(x)) stop("subscript out of bounds")
    171 - 352x + 352x +
      if (is.character(i)) {
    172 - 1x + 1x +
        if (!all(is.element(i, names(x)))) stop("subscript out of bounds")
    173 - 2x + 2x +
        i <- which(is.element(i, names(x)))
    @@ -60170,35 +62268,40 @@

    teal.slice coverage - 66.06%

    176 - 351x + 351x +
      y <- NextMethod("[")
    177 - 351x + 351x +
      attrs <- attributes(x)
    178 - 351x + 351x +
      attrs$names <- attrs$names[i]
    179 - 351x + 351x +
      attributes(y) <- attrs
    180 - 351x + 351x +
      y
    @@ -60261,14 +62364,16 @@

    teal.slice coverage - 66.06%

    189 - 258x + 258x +
      x <- list(...)
    190 - 258x + 258x +
      checkmate::assert_true(all(vapply(x, is.teal_slices, logical(1L))), .var.name = "all arguments are teal_slices")
    @@ -60282,28 +62387,32 @@

    teal.slice coverage - 66.06%

    192 - 257x + 257x +
      excludes <- lapply(x, attr, "exclude_varnames")
    193 - 257x + 257x +
      names(excludes) <- NULL
    194 - 257x + 257x +
      excludes <- unlist(excludes, recursive = FALSE)
    195 - 257x + 257x +
      excludes <- excludes[!duplicated(names(excludes))]
    @@ -60317,28 +62426,32 @@

    teal.slice coverage - 66.06%

    197 - 257x + 257x +
      includes <- lapply(x, attr, "include_varnames")
    198 - 257x + 257x +
      names(includes) <- NULL
    199 - 257x + 257x +
      includes <- unlist(includes, recursive = FALSE)
    200 - 257x + 257x +
      includes <- includes[!duplicated(names(includes))]
    @@ -60352,14 +62465,16 @@

    teal.slice coverage - 66.06%

    202 - 257x + 257x +
      count_types <- lapply(x, attr, "count_type")
    203 - 257x + 257x +
      count_types <- unique(unlist(count_types))
    @@ -60373,56 +62488,64 @@

    teal.slice coverage - 66.06%

    205 - 257x + 257x +
      do.call(
    206 - 257x + 257x +
        teal_slices,
    207 - 257x + 257x +
        c(
    208 - 257x + 257x +
          unique(unlist(x, recursive = FALSE)),
    209 - 257x + 257x +
          list(
    210 - 257x + 257x +
            include_varnames = if (length(includes)) includes,
    211 - 257x + 257x +
            exclude_varnames = if (length(excludes)) excludes,
    212 - 257x + 257x +
            count_type = count_types
    @@ -60520,14 +62643,16 @@

    teal.slice coverage - 66.06%

    226 - 49x + 49x +
      checkmate::assert_flag(show_all)
    227 - 49x + 49x +
      checkmate::assert_flag(trim_lines)
    @@ -60541,35 +62666,40 @@

    teal.slice coverage - 66.06%

    229 - 49x + 49x +
      x <- as.list(x, recursive = TRUE)
    230 - 49x + 49x +
      attrs <- attributes(x)
    231 - 49x + 49x +
      attributes(x) <- NULL
    232 - 49x + 49x +
      slices_list <- list(slices = x, attributes = attrs)
    233 - 49x + 49x +
      slices_list <- Filter(Negate(is.null), slices_list) # drop attributes if empty
    @@ -60583,7 +62713,8 @@

    teal.slice coverage - 66.06%

    235 - 22x + 22x +
      if (!show_all) slices_list$slices <- lapply(slices_list$slices, function(slice) Filter(Negate(is.null), slice))
    @@ -60597,7 +62728,8 @@

    teal.slice coverage - 66.06%

    237 - 49x + 49x +
      jsonify(slices_list, trim_lines)
    @@ -60660,7 +62792,8 @@

    teal.slice coverage - 66.06%

    246 - 5x + 5x +
      cat(format(x, ...), "\n")
    @@ -60744,21 +62877,24 @@

    teal.slice coverage - 66.06%

    258 - 14x + 14x +
      Filter(
    259 - 14x + 14x +
        function(xx) {
    260 - 12x + 12x +
          !any(vapply(y, function(yy) identical(yy, xx), logical(1)))
    @@ -60772,7 +62908,8 @@

    teal.slice coverage - 66.06%

    262 - 14x + 14x +
        x
    @@ -60842,35 +62979,40 @@

    teal.slice coverage - 66.06%

    272 - 1x + 1x +
      checkmate::assert_list(x, names = "named")
    273 - 1x + 1x +
      is_bottom <- function(x) {
    274 - 10x + 10x +
        isTRUE(is.list(x) && any(names(x) %in% c("selected", "keep_na", "keep_inf"))) ||
    275 - 10x + 10x +
          identical(x, list()) ||
    276 - 10x + 10x +
          is.atomic(x)
    @@ -60884,28 +63026,32 @@

    teal.slice coverage - 66.06%

    278 - 1x + 1x +
      make_args <- function(object, dataname, varname, experiment = NULL, arg = NULL) {
    279 - 7x + 7x +
        args <- list(
    280 - 7x + 7x +
          dataname = dataname,
    281 - 7x + 7x +
          varname = varname
    @@ -60919,42 +63065,48 @@

    teal.slice coverage - 66.06%

    283 - 1x + 1x +
        if (!is.null(experiment)) args$experiment <- experiment
    284 - 1x + 1x +
        if (!is.null(arg)) args$arg <- arg
    285 - 7x + 7x +
        if (is.list(object)) {
    286 - 6x + 6x +
          args <- c(args, object)
    287 - 1x + 1x +
        } else if (is.atomic(object)) {
    288 - 1x + 1x +
          args$selected <- object
    @@ -60968,7 +63120,8 @@

    teal.slice coverage - 66.06%

    290 - 7x + 7x +
        args
    @@ -60982,7 +63135,8 @@

    teal.slice coverage - 66.06%

    292 - 1x + 1x +
      slices <- vector("list")
    @@ -60996,63 +63150,72 @@

    teal.slice coverage - 66.06%

    294 - 1x + 1x +
      for (dataname in names(x)) {
    295 - 2x + 2x +
        item <- x[[dataname]]
    296 - 2x + 2x +
        for (name_i in names(item)) {
    297 - 5x + 5x +
          subitem <- item[[name_i]]
    298 - 5x + 5x +
          if (is_bottom(subitem)) {
    299 - 3x + 3x +
            args <- make_args(
    300 - 3x + 3x +
              subitem,
    301 - 3x + 3x +
              dataname = dataname,
    302 - 3x + 3x +
              varname = name_i
    @@ -61066,7 +63229,8 @@

    teal.slice coverage - 66.06%

    304 - 3x + 3x +
            slices <- c(slices, list(as.teal_slice(args)))
    @@ -61087,56 +63251,64 @@

    teal.slice coverage - 66.06%

    307 - 2x + 2x +
            for (name_ii in names(subitem)) {
    308 - 4x + 4x +
              subsubitem <- subitem[[name_ii]]
    309 - 4x + 4x +
              if (is_bottom(subsubitem)) {
    310 - 3x + 3x +
                args <- make_args(
    311 - 3x + 3x +
                  subsubitem,
    312 - 3x + 3x +
                  dataname = dataname,
    313 - 3x + 3x +
                  experiment = if (name_i != "subjects") name_i,
    314 - 3x + 3x +
                  varname = name_ii
    @@ -61150,7 +63322,8 @@

    teal.slice coverage - 66.06%

    316 - 3x + 3x +
                slices <- c(slices, list(as.teal_slice(args)))
    @@ -61164,63 +63337,72 @@

    teal.slice coverage - 66.06%

    318 - 1x + 1x +
                for (name_iii in names(subsubitem)) {
    319 - 1x + 1x +
                  subsubsubitem <- subsubitem[[name_iii]]
    320 - 1x + 1x +
                  if (is_bottom(subsubsubitem)) {
    321 - 1x + 1x +
                    args <- make_args(
    322 - 1x + 1x +
                      subsubsubitem,
    323 - 1x + 1x +
                      dataname = dataname,
    324 - 1x + 1x +
                      experiment = name_i,
    325 - 1x + 1x +
                      arg = name_ii,
    326 - 1x + 1x +
                      varname = name_iii
    @@ -61234,7 +63416,8 @@

    teal.slice coverage - 66.06%

    328 - 1x + 1x +
                    slices <- c(slices, list(as.teal_slice(args)))
    @@ -61297,7 +63480,8 @@

    teal.slice coverage - 66.06%

    337 - 1x + 1x +
      if (length(slices) == 0L && length(x) != 0L) {
    @@ -61325,7 +63509,8 @@

    teal.slice coverage - 66.06%

    341 - 1x + 1x +
      do.call(teal_slices, c(slices, list(include_varnames = attr(x, "filterable"))))
    @@ -61569,7 +63754,8 @@

    teal.slice coverage - 66.06%

    33 - 9x + 9x +
      UseMethod("variable_types")
    @@ -61604,7 +63790,8 @@

    teal.slice coverage - 66.06%

    38 - 9x + 9x +
      checkmate::assert_character(columns, null.ok = TRUE, any.missing = FALSE)
    @@ -61618,7 +63805,8 @@

    teal.slice coverage - 66.06%

    40 - 9x + 9x +
      res <- if (is.null(columns)) {
    @@ -61667,49 +63855,56 @@

    teal.slice coverage - 66.06%

    47 - 9x + 9x +
      } else if (checkmate::test_character(columns, any.missing = FALSE)) {
    48 - 9x + 9x +
        stopifnot(all(columns %in% names(data) | vapply(columns, identical, logical(1L), "")))
    49 - 9x + 9x +
        vapply(
    50 - 9x + 9x +
          columns,
    51 - 9x + 9x +
          function(x) ifelse(x == "", "", class(data[[x]])[[1]]),
    52 - 9x + 9x +
          character(1),
    53 - 9x + 9x +
          USE.NAMES = FALSE
    @@ -61751,7 +63946,8 @@

    teal.slice coverage - 66.06%

    59 - 9x + 9x +
      return(res)
    @@ -61786,7 +63982,8 @@

    teal.slice coverage - 66.06%

    64 - 9x + 9x +
      variable_types.default(data, columns)
    @@ -62247,7 +64444,8 @@

    teal.slice coverage - 66.06%

    24 - 16x + 16x +
      UseMethod("init_filtered_data")
    @@ -62310,56 +64508,64 @@

    teal.slice coverage - 66.06%

    33 - 2x + 2x +
      data_objects <- lapply(
    34 - 2x + 2x +
        x$get_datanames(),
    35 - 2x + 2x +
        function(dataname) {
    36 - 3x + 3x +
          dataset <- x$get_dataset(dataname)
    37 - 3x + 3x +
          list(
    38 - 3x + 3x +
            dataset = dataset$get_raw_data(),
    39 - 3x + 3x +
            metadata = dataset$get_metadata(),
    40 - 3x + 3x +
            label = dataset$get_dataset_label()
    @@ -62387,7 +64593,8 @@

    teal.slice coverage - 66.06%

    44 - 2x + 2x +
      names(data_objects) <- x$get_datanames()
    @@ -62401,35 +64608,40 @@

    teal.slice coverage - 66.06%

    46 - 2x + 2x +
      init_filtered_data(
    47 - 2x + 2x +
        x = data_objects,
    48 - 2x + 2x +
        join_keys = join_keys,
    49 - 2x + 2x +
        code = code,
    50 - 2x + 2x +
        check = check
    @@ -62478,42 +64690,48 @@

    teal.slice coverage - 66.06%

    57 - 14x + 14x +
      checkmate::assert_list(x, any.missing = FALSE, names = "unique")
    58 - 13x + 13x +
      mapply(validate_dataset_args, x, names(x))
    59 - 13x + 13x +
      checkmate::assert_class(code, "CodeClass", null.ok = TRUE)
    60 - 12x + 12x +
      checkmate::assert_class(join_keys, "JoinKeys")
    61 - 11x + 11x +
      checkmate::assert_flag(check)
    62 - 10x + 10x +
      FilteredData$new(x, join_keys = join_keys, code = code, check = check)
    @@ -62611,14 +64829,16 @@

    teal.slice coverage - 66.06%

    76 - 118x + 118x +
      check_simple_name(dataname)
    77 - 118x + 118x +
      checkmate::assert_list(dataset_args, names = "unique")
    @@ -62632,7 +64852,8 @@

    teal.slice coverage - 66.06%

    79 - 118x + 118x +
      allowed_names <- c("dataset", "label", "metadata")
    @@ -62646,28 +64867,32 @@

    teal.slice coverage - 66.06%

    81 - 118x + 118x +
      checkmate::assert_subset(names(dataset_args), choices = allowed_names)
    82 - 118x + 118x +
      checkmate::assert_multi_class(dataset_args[["dataset"]], classes = c("data.frame", "MultiAssayExperiment"))
    83 - 117x + 117x +
      teal.data::validate_metadata(dataset_args[["metadata"]])
    84 - 117x + 117x +
      checkmate::assert_character(dataset_args[["label"]], null.ok = TRUE, min.len = 0, max.len = 1)
    @@ -62758,42 +64983,48 @@

    teal.slice coverage - 66.06%

    97 - 26x + 26x +
      lapply(
    98 - 26x + 26x +
        expr,
    99 - 26x + 26x +
        function(x) {
    100 - 15x + 15x +
          tryCatch(
    101 - 15x + 15x +
            eval(x, envir = env),
    102 - 15x + 15x +
            error = function(e) {
    @@ -62856,7 +65087,8 @@

    teal.slice coverage - 66.06%

    111 - 15x + 15x +
          return(invisible(NULL))
    @@ -63409,21 +65641,24 @@

    teal.slice coverage - 66.06%

    190 - 3x + 3x +
      checkmate::assert_string(input_id)
    191 - 3x + 3x +
      checkmate::assert_character(icons, len = 2L)
    192 - 3x + 3x +
      checkmate::assert_flag(one_way)
    @@ -63437,35 +65672,40 @@

    teal.slice coverage - 66.06%

    194 - 3x + 3x +
      expr <-
    195 - 3x + 3x +
        if (one_way) {
    196 - 3x + 3x +
          sprintf(
    197 - 3x + 3x +
            "$('#%s i').removeClass('%s').addClass('%s');",
    198 - 3x + 3x +
            input_id, icons[1], icons[2]
    @@ -63507,7 +65747,8 @@

    teal.slice coverage - 66.06%

    204 - 3x + 3x +
      shinyjs::runjs(expr)
    @@ -63521,7 +65762,8 @@

    teal.slice coverage - 66.06%

    206 - 3x + 3x +
      invisible(NULL)
    @@ -63563,21 +65805,24 @@

    teal.slice coverage - 66.06%

    212 - 3x + 3x +
      checkmate::assert_string(input_id)
    213 - 3x + 3x +
      checkmate::assert_character(titles, len = 2L)
    214 - 3x + 3x +
      checkmate::assert_flag(one_way)
    @@ -63591,35 +65836,40 @@

    teal.slice coverage - 66.06%

    216 - 3x + 3x +
      expr <-
    217 - 3x + 3x +
        if (one_way) {
    218 - 3x + 3x +
          sprintf(
    219 - 3x + 3x +
            "$('a#%s').attr('title', '%s');",
    220 - 3x + 3x +
            input_id, titles[2]
    @@ -63724,7 +65974,8 @@

    teal.slice coverage - 66.06%

    235 - 3x + 3x +
      shinyjs::runjs(expr)
    @@ -63738,7 +65989,8 @@

    teal.slice coverage - 66.06%

    237 - 3x + 3x +
      invisible(NULL)
    @@ -63871,35 +66123,40 @@

    teal.slice coverage - 66.06%

    256 - 65x + 65x +
      in_degrees <- list()
    257 - 65x + 65x +
      for (node in names(graph)) {
    258 - 101x + 101x +
        in_degrees[[node]] <- 0
    259 - 101x + 101x +
        for (to_edge in graph[[node]]) {
    260 - 9x + 9x +
          in_degrees[[to_edge]] <- 0
    @@ -63927,21 +66184,24 @@

    teal.slice coverage - 66.06%

    264 - 65x + 65x +
      for (node in graph) {
    265 - 101x + 101x +
        for (to_edge in node) {
    266 - 9x + 9x +
          in_degrees[[to_edge]] <- in_degrees[[to_edge]] + 1
    @@ -63976,35 +66236,40 @@

    teal.slice coverage - 66.06%

    271 - 65x + 65x +
      visited <- 0
    272 - 65x + 65x +
      sorted <- list()
    273 - 65x + 65x +
      zero_in <- list()
    274 - 65x + 65x +
      for (node in names(in_degrees)) {
    275 - 92x + 92x +
        if (in_degrees[[node]] == 0) zero_in <- append(zero_in, node)
    @@ -64018,7 +66283,8 @@

    teal.slice coverage - 66.06%

    277 - 65x + 65x +
      zero_in <- rev(zero_in)
    @@ -64032,49 +66298,56 @@

    teal.slice coverage - 66.06%

    279 - 65x + 65x +
      while (length(zero_in) != 0) {
    280 - 98x + 98x +
        visited <- visited + 1
    281 - 98x + 98x +
        sorted <- c(zero_in[[1]], sorted)
    282 - 98x + 98x +
        for (edge_to in graph[[zero_in[[1]]]]) {
    283 - 6x + 6x +
          in_degrees[[edge_to]] <- in_degrees[[edge_to]] - 1
    284 - 6x + 6x +
          if (in_degrees[[edge_to]] == 0) {
    285 - 6x + 6x +
            zero_in <- append(zero_in, edge_to, 1)
    @@ -64095,7 +66368,8 @@

    teal.slice coverage - 66.06%

    288 - 98x + 98x +
        zero_in[[1]] <- NULL
    @@ -64116,28 +66390,32 @@

    teal.slice coverage - 66.06%

    291 - 65x + 65x +
      if (visited != length(in_degrees)) {
    292 - 1x + 1x +
        stop(
    293 - 1x + 1x +
          "Graph is not a directed acyclic graph. Cycles involving nodes: ",
    294 - 1x + 1x +
          paste0(setdiff(names(in_degrees), sorted), collapse = " ")
    @@ -64158,7 +66436,8 @@

    teal.slice coverage - 66.06%

    297 - 64x + 64x +
        return(sorted)
    @@ -64346,21 +66625,24 @@

    teal.slice coverage - 66.06%

    24 - 46x + 46x +
      checkmate::assert_list(calls)
    25 - 44x + 44x +
      if (length(calls) > 0L) checkmate::assert_list(calls, types = c("call", "name"))
    26 - 45x + 45x +
      checkmate::assert_string(operator)
    @@ -64374,7 +66656,8 @@

    teal.slice coverage - 66.06%

    28 - 43x + 43x +
      calls <- Filter(x = calls, f = Negate(is.null))
    @@ -64388,21 +66671,24 @@

    teal.slice coverage - 66.06%

    30 - 43x + 43x +
      Reduce(
    31 - 43x + 43x +
        x = calls,
    32 - 43x + 43x +
        f = function(x, y) call(operator, x, y)
    @@ -64653,21 +66939,24 @@

    teal.slice coverage - 66.06%

    33 - 28x + 28x +
          checkmate::assert_matrix(data)
    34 - 27x + 27x +
          super$initialize(data, data_reactive, dataname, datalabel)
    35 - 27x + 27x +
          private$set_filterable_varnames(include_varnames = colnames(private$data))
    @@ -64883,49 +67172,56 @@

    teal.slice coverage - 66.06%

    24 - 18x + 18x +
      if (!missing(...)) {
    25 - 16x + 16x +
        checkmate::assert_flag(stop)
    26 - 16x + 16x +
        checkmate::assert_character(allowed_args, min.len = 0, null.ok = TRUE, any.missing = FALSE)
    27 - 16x + 16x +
        args <- list(...)
    28 - 16x + 16x +
        arg_names <- names(args)
    29 - 16x + 16x +
        if (is.null(arg_names)) {
    30 - 4x + 4x +
          arg_names <- rep("", length(args))
    @@ -64939,21 +67235,24 @@

    teal.slice coverage - 66.06%

    32 - 16x + 16x +
        extra_args <- arg_names[!is.element(arg_names, allowed_args)]
    33 - 16x + 16x +
        if (length(extra_args) == 0) {
    34 - 4x + 4x +
          return(invisible(NULL))
    @@ -64967,7 +67266,8 @@

    teal.slice coverage - 66.06%

    36 - 12x + 12x +
        message <- paste(length(extra_args), "total unused argument(s).")
    @@ -64981,28 +67281,32 @@

    teal.slice coverage - 66.06%

    38 - 12x + 12x +
        named_extra_args <- extra_args[!vapply(extra_args, identical, logical(1), "")]
    39 - 12x + 12x +
        if (length(named_extra_args) > 0) {
    40 - 9x + 9x +
          message <- paste0(
    41 - 9x + 9x +
            message,
    @@ -65016,21 +67320,24 @@

    teal.slice coverage - 66.06%

    43 - 9x + 9x +
            length(named_extra_args),
    44 - 9x + 9x +
            " with name(s): ",
    45 - 9x + 9x +
            paste(named_extra_args, collapse = ", "),
    @@ -65058,14 +67365,16 @@

    teal.slice coverage - 66.06%

    49 - 12x + 12x +
        if (stop) {
    50 - 8x + 8x +
          stop(message)
    @@ -65079,7 +67388,8 @@

    teal.slice coverage - 66.06%

    52 - 4x + 4x +
          warning(message)
    @@ -65296,49 +67606,56 @@

    teal.slice coverage - 66.06%

    83 - 380x + 380x +
      checkmate::assert_character(name, min.len = 1, any.missing = FALSE)
    84 - 378x + 378x +
      if (!grepl("^[[:alpha:]][a-zA-Z0-9_]*$", name, perl = TRUE)) {
    85 - 5x + 5x +
        stop(
    86 - 5x + 5x +
          "name '",
    87 - 5x + 5x +
          name,
    88 - 5x + 5x +
          "' must only contain alphanumeric characters (with underscores)",
    89 - 5x + 5x +
          " and the first character must be an alphabetic character"
    @@ -65394,28 +67711,32 @@

    teal.slice coverage - 66.06%

    97 - 2x + 2x +
      bs_theme <- getOption("teal.bs_theme")
    98 - 2x + 2x +
      if (is.null(bs_theme)) {
    99 - 1x + 1x +
        NULL
    100 - 1x + 1x +
      } else if (!inherits(bs_theme, "bs_theme")) {
    @@ -65443,7 +67764,8 @@

    teal.slice coverage - 66.06%

    104 - 1x + 1x +
        bs_theme
    @@ -65555,35 +67877,40 @@

    teal.slice coverage - 66.06%

    120 - 12x + 12x +
      checkmate::assert_character(pattern, min.len = 1, null.ok = TRUE)
    121 - 12x + 12x +
      js_files <- list.files(
    122 - 12x + 12x +
        system.file("js", package = "teal.slice", mustWork = TRUE),
    123 - 12x + 12x +
        pattern = pattern,
    124 - 12x + 12x +
        full.names = TRUE
    @@ -65597,7 +67924,8 @@

    teal.slice coverage - 66.06%

    126 - 12x + 12x +
      return(singleton(lapply(js_files, includeScript)))
    @@ -65723,14 +68051,16 @@

    teal.slice coverage - 66.06%

    144 - 53x + 53x +
      if (length(choices) > 1) {
    145 - 26x + 26x +
        do.call("call", append(list("c"), choices))
    @@ -65744,7 +68074,8 @@

    teal.slice coverage - 66.06%

    147 - 27x + 27x +
        choices
    @@ -66596,21 +68927,24 @@

    teal.slice coverage - 66.06%

    68 - 15x + 15x +
          checkmate::assert_class(slice, "teal_slice_expr")
    69 - 14x + 14x +
          private$teal_slice <- slice
    70 - 14x + 14x +
          invisible(self)
    @@ -66694,28 +69028,32 @@

    teal.slice coverage - 66.06%

    82 - 12x + 12x +
          sprintf(
    83 - 12x + 12x +
            "%s:\n%s",
    84 - 12x + 12x +
            class(self)[1],
    85 - 12x + 12x +
            format(self$get_state(), show_all = show_all, trim_lines = trim_lines)
    @@ -66778,7 +69116,8 @@

    teal.slice coverage - 66.06%

    94 - 1x + 1x +
          cat(shiny::isolate(self$format(...)))
    @@ -66841,7 +69180,8 @@

    teal.slice coverage - 66.06%

    103 - 26x + 26x +
          private$teal_slice
    @@ -66918,14 +69258,16 @@

    teal.slice coverage - 66.06%

    114 - 1x + 1x +
          checkmate::assert_class(state, "teal_slice_expr")
    115 - 1x + 1x +
          invisible(NULL)
    @@ -67023,7 +69365,8 @@

    teal.slice coverage - 66.06%

    129 - 2x + 2x +
          shiny::isolate(str2lang(private$teal_slice$expr))
    @@ -68919,35 +71262,40 @@

    teal.slice coverage - 66.06%

    156 - 115x + 115x +
          checkmate::assert_function(data_reactive, args = "sid")
    157 - 115x + 115x +
          checkmate::assert_data_frame(data)
    158 - 115x + 115x +
          super$initialize(data, data_reactive, dataname, datalabel)
    159 - 115x + 115x +
          private$keys <- keys
    160 - 115x + 115x +
          private$set_filterable_varnames(include_varnames = colnames(private$data))
    @@ -69415,7 +71763,8 @@

    teal.slice coverage - 66.06%

    58 - 253x + 253x +
      UseMethod("init_filter_states")
    @@ -69492,42 +71841,48 @@

    teal.slice coverage - 66.06%

    69 - 112x + 112x +
      DFFilterStates$new(
    70 - 112x + 112x +
        data = data,
    71 - 112x + 112x +
        data_reactive = data_reactive,
    72 - 112x + 112x +
        dataname = dataname,
    73 - 112x + 112x +
        datalabel = datalabel,
    74 - 112x + 112x +
        keys = keys
    @@ -69604,35 +71959,40 @@

    teal.slice coverage - 66.06%

    85 - 24x + 24x +
      MatrixFilterStates$new(
    86 - 24x + 24x +
        data = data,
    87 - 24x + 24x +
        data_reactive = data_reactive,
    88 - 24x + 24x +
        dataname = dataname,
    89 - 24x + 24x +
        datalabel = datalabel
    @@ -69716,7 +72076,8 @@

    teal.slice coverage - 66.06%

    101 - 24x + 24x +
      if (!requireNamespace("MultiAssayExperiment", quietly = TRUE)) {
    @@ -69737,42 +72098,48 @@

    teal.slice coverage - 66.06%

    104 - 24x + 24x +
      MAEFilterStates$new(
    105 - 24x + 24x +
        data = data,
    106 - 24x + 24x +
        data_reactive = data_reactive,
    107 - 24x + 24x +
        dataname = dataname,
    108 - 24x + 24x +
        datalabel = datalabel,
    109 - 24x + 24x +
        keys = keys
    @@ -69849,7 +72216,8 @@

    teal.slice coverage - 66.06%

    120 - 93x + 93x +
      if (!requireNamespace("SummarizedExperiment", quietly = TRUE)) {
    @@ -69870,35 +72238,40 @@

    teal.slice coverage - 66.06%

    123 - 93x + 93x +
      SEFilterStates$new(
    124 - 93x + 93x +
        data = data,
    125 - 93x + 93x +
        data_reactive = data_reactive,
    126 - 93x + 93x +
        dataname = dataname,
    127 - 93x + 93x +
        datalabel = datalabel
    @@ -70059,7 +72432,8 @@

    teal.slice coverage - 66.06%

    150 - 240x + 240x +
      UseMethod("get_supported_filter_varnames")
    @@ -70101,28 +72475,32 @@

    teal.slice coverage - 66.06%

    156 - 205x + 205x +
      is_expected_class <- vapply(
    157 - 205x + 205x +
        X = data,
    158 - 205x + 205x +
        FUN = function(x) any(class(x) %in% .filterable_class),
    159 - 205x + 205x +
        FUN.VALUE = logical(1)
    @@ -70136,7 +72514,8 @@

    teal.slice coverage - 66.06%

    161 - 205x + 205x +
      names(is_expected_class[is_expected_class])
    @@ -70185,21 +72564,24 @@

    teal.slice coverage - 66.06%

    168 - 35x + 35x +
      is_expected_class <- class(data[, 1]) %in% .filterable_class
    169 - 35x + 35x +
      if (is_expected_class && !is.null(colnames(data))) {
    170 - 32x + 32x +
        colnames(data)
    @@ -70213,7 +72595,8 @@

    teal.slice coverage - 66.06%

    172 - 3x + 3x +
        character(0)
    @@ -70451,7 +72834,8 @@

    teal.slice coverage - 66.06%

    206 - 9x + 9x +
      if (length(choices) == 0) {
    @@ -70472,14 +72856,16 @@

    teal.slice coverage - 66.06%

    209 - 9x + 9x +
      choice_types <- stats::setNames(variable_types(data = data, columns = choices), choices)
    210 - 9x + 9x +
      choice_types[keys] <- "primary_key"
    @@ -70493,28 +72879,32 @@

    teal.slice coverage - 66.06%

    212 - 9x + 9x +
      choices_labeled(
    213 - 9x + 9x +
        choices = choices,
    214 - 9x + 9x +
        labels = unname(varlabels[choices]),
    215 - 9x + 9x +
        types = choice_types[choices]
    @@ -70549,49 +72939,56 @@

    teal.slice coverage - 66.06%

    220 - 9x + 9x +
      if (!is.array(data)) {
    221 - 9x + 9x +
        vapply(
    222 - 9x + 9x +
          colnames(data),
    223 - 9x + 9x +
          FUN = function(x) {
    224 - 42x + 42x +
            label <- attr(data[[x]], "label")
    225 - 42x + 42x +
            if (is.null(label)) {
    226 - 40x + 40x +
              x
    @@ -70605,7 +73002,8 @@

    teal.slice coverage - 66.06%

    228 - 2x + 2x +
              label
    @@ -70626,7 +73024,8 @@

    teal.slice coverage - 66.06%

    231 - 9x + 9x +
          FUN.VALUE = character(1)
    @@ -70933,7 +73332,8 @@

    teal.slice coverage - 66.06%

    38 - 28x + 28x +
          if (!requireNamespace("MultiAssayExperiment", quietly = TRUE)) {
    @@ -70954,56 +73354,64 @@

    teal.slice coverage - 66.06%

    41 - 28x + 28x +
          checkmate::assert_function(data_reactive, args = "sid")
    42 - 28x + 28x +
          checkmate::assert_class(data, "MultiAssayExperiment")
    43 - 27x + 27x +
          data <- SummarizedExperiment::colData(data)
    44 - 27x + 27x +
          data_reactive <- function(sid = "") SummarizedExperiment::colData(data_reactive(sid = sid))
    45 - 27x + 27x +
          super$initialize(data, data_reactive, dataname, datalabel)
    46 - 27x + 27x +
          private$keys <- keys
    47 - 27x + 27x +
          private$set_filterable_varnames(include_varnames = colnames(data))
    48 - 27x + 27x +
          return(invisible(self))
    @@ -71114,14 +73522,16 @@

    teal.slice coverage - 66.06%

    5 - 9x + 9x +
      shiny::isolate(
    6 - 9x + 9x +
        all(vapply(fields, function(x) identical(ts1[[x]], ts2[[x]]), logical(1L)))
    @@ -71170,35 +73580,40 @@

    teal.slice coverage - 66.06%

    13 - 38x + 38x +
      shiny::isolate({
    14 - 38x + 38x +
        testthat::expect_true(
    15 - 38x + 38x +
          setequal(
    16 - 38x + 38x +
            reactiveValuesToList(x),
    17 - 38x + 38x +
            reactiveValuesToList(y)
    @@ -71254,28 +73669,32 @@

    teal.slice coverage - 66.06%

    25 - 12x + 12x +
      shiny::isolate({
    26 - 12x + 12x +
        mapply(
    27 - 12x + 12x +
          function(x, y) {
    28 - 31x + 31x +
            expect_identical_slice(x, y)
    @@ -71289,14 +73708,16 @@

    teal.slice coverage - 66.06%

    30 - 12x + 12x +
          x = x,
    31 - 12x + 12x +
          y = y
    @@ -71310,7 +73731,8 @@

    teal.slice coverage - 66.06%

    33 - 12x + 12x +
        testthat::expect_identical(attributes(x), attributes(y))
    diff --git a/v0.4.0/index.html b/v0.4.0/index.html index 4d6388111..f3bb3ca40 100644 --- a/v0.4.0/index.html +++ b/v0.4.0/index.html @@ -1,5 +1,4 @@ - - + @@ -52,22 +51,7 @@ - - + - + + diff --git a/v0.4.0/news/index.html b/v0.4.0/news/index.html index 4309e38f4..c74035520 100644 --- a/v0.4.0/news/index.html +++ b/v0.4.0/news/index.html @@ -1,8 +1,22 @@ - -Changelog • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -78,10 +98,13 @@
    -

    teal.slice 0.4.0

    +

    teal.slice 0.4.0 +

    -

    New features

    -
    + +
    -

    Breaking changes

    -
    • Setting filters using a list is now deprecated. Use teal_slices and teal_slice instead.
    • +

      Breaking changes +

      +
        +
      • Setting filters using a list is now deprecated. Use teal_slices and teal_slice instead.
      • Removed CDISCFilteredData and CDISCFilteredDataset and implementing JoinKeys handling in their parent classes (FilteredData and DefaultFilteredDataset).
      • Specifying set of filterable columns is done through include_varnames and exclude_varnames in teal_slices. Specifying attr(, "filterable") is hard deprecated.
      • -
    + +
    -

    teal.slice 0.3.0

    -
    • Examples now use scda.2022 instead of scda.2021.
    • +

      teal.slice 0.3.0 +

      +
        +
      • Examples now use scda.2022 instead of scda.2021.
      • Transferred data hashing step in FilteredDataset to teal.
      • Removed constructor of Queue class.
      • -
      -

      New features

      -
      • Added a global turn on/off button for the Filter Panel.
      • +
      +
      +

      New features +

      +
        +
      • Added a global turn on/off button for the Filter Panel.
      • Added ability to collapse Active Filter Display panel.
      • Added ability to collapse all filters of an individual dataset.
      • Added fixed filter states.
      • -
      +
    +
    -

    Enhancements

    -
    • Improved filter state presentation in FilterState$format.
    • -
    +

    Enhancements +

    +
      +
    • Improved filter state presentation in FilterState$format.
    • +
    +
    -

    Bug fixes

    -
    • Fixed an error where the RangeFilterState produced an error when using bootstrap 4.
    • +

      Bug fixes +

      +
        +
      • Fixed an error where the RangeFilterState produced an error when using bootstrap 4.
      • Fixed a bug that caused the range slider to omit values selected programmatically through the filter API.
      • Fixed a bug where setting incorrect values for Date and Date time ranges caused the app to crash.
      • -
    + +
    -

    Miscellaneous

    -
    • Calculation of step in slider for RangeFilterState now uses checkmate::test_integerish instead of is.integer.
    • +

      Miscellaneous +

      +
        +
      • Calculation of step in slider for RangeFilterState now uses checkmate::test_integerish instead of is.integer.
      • Updated init_filtered_data to take into account the removal of CDISCTealData from teal.data package.
      • Added shinyvalidate validation for Date and Date time ranges.
      • Added examples apps for FilterState child classes and DFFilterStates.
      • -
    + +
    -

    teal.slice 0.2.0

    +

    teal.slice 0.2.0 +

    -

    New features

    -
    + +
    -

    Enhancements

    -
    • Redesigned the count bars for filter panel check box inputs.
    • +

      Enhancements +

      +
        +
      • Redesigned the count bars for filter panel check box inputs.
      • Redesigned the filter panel input for dates to use CSS flexbox.
      • Update icons to be compatible with Font Awesome 6.
      • Updates the FilteredData method get_formatted_filter_state so it no longer appends empty filters.
      • Added clearer installation instructions to README.
      • -
    + +
    -

    Breaking changes

    -
    • Renamed internal S3 method get_filterable_varnames to get_supported_filter_varnames.
    • -
    +

    Breaking changes +

    +
      +
    • Renamed internal S3 method get_filterable_varnames to get_supported_filter_varnames.
    • +
    +
    -

    Bug fixes

    -
    • Fixed a bug when the filter panel overview would not refresh if the panel was hidden during a transition between active modules.
    • +

      Bug fixes +

      +
        +
      • Fixed a bug when the filter panel overview would not refresh if the panel was hidden during a transition between active modules.
      • Fixed a bug in FilterState where sliderInput step values were too precise.
      • -
    + +
    -

    teal.slice 0.1.1

    +

    teal.slice 0.1.1 +

    -

    New features

    -
    • Added a formatting function for filter panel classes.
    • -
    +

    New features +

    +
      +
    • Added a formatting function for filter panel classes.
    • +
    +
    -

    Miscellaneous

    -
    • Added a template to the pkgdown site.
    • +

      Miscellaneous +

      +
        +
      • Added a template to the pkgdown site.
      • Updated package authors.
      • Added package vignettes.
      • -
    + +
    -

    Fix

    -
    • Fixed a bug in FilteredDataset, where launching a shiny application without FilteredData would not attach the appropriate CSS files.
    • -
    +

    Fix +

    +
      +
    • Fixed a bug in FilteredDataset, where launching a shiny application without FilteredData would not attach the appropriate CSS files.
    • +
    +
    -

    teal.slice 0.1.0

    -
    • Initial release of teal.slice - a package providing a filter module for teal applications.
    • -
    -

    Changes (from behavior when functionality was part of teal)

    +

    teal.slice 0.1.0 +

    +
      +
    • Initial release of teal.slice - a package providing a filter module for teal applications.
    • +
    +
    +

    Changes (from behavior when functionality was part of teal) +

    -

    Breaking changes

    -
    • +

      Breaking changes +

      +
        +
      • default_filter has been deprecated - use list() instead for a default filter.
      • -
    + +
    -

    Bug fixes

    -
    • Add counts to filtering categorical variables bar charts in the filtering panel in cases where they were missing.
    • +

      Bug fixes +

      +
        +
      • Add counts to filtering categorical variables bar charts in the filtering panel in cases where they were missing.
      • Fixed a bug causing an error when both sliders of RangeFilterState where put to either end of the allowed range in the UI.
      • -
    + +
    -

    Miscellaneous

    -
    • Added is_any_filtered method to all FilterState classes to detect if selected values actually filters out any data. This is used to decide if an explicit filter statement is added to the call.
    • +

      Miscellaneous +

      +
        +
      • Added is_any_filtered method to all FilterState classes to detect if selected values actually filters out any data. This is used to decide if an explicit filter statement is added to the call.
      • The filter panel now displays a helpful message when data has no rows or columns in place of an empty drop down widget.
      • FilteredData now stores whether its datasets had a reproducibility check or not via two new methods to its class: set_check and get_check.
      • -
    + +
    + + + + - - + + diff --git a/v0.4.0/pull_request_template.html b/v0.4.0/pull_request_template.html index c9218d5d4..9a3d5e0e2 100644 --- a/v0.4.0/pull_request_template.html +++ b/v0.4.0/pull_request_template.html @@ -1,8 +1,22 @@ - -Pull Request • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -83,17 +103,19 @@

    Fixes #nnn

    - + + + + - - + + diff --git a/v0.4.0/reference/ChoicesFilterState.html b/v0.4.0/reference/ChoicesFilterState.html index 2ec66666a..d14d38465 100644 --- a/v0.4.0/reference/ChoicesFilterState.html +++ b/v0.4.0/reference/ChoicesFilterState.html @@ -1,8 +1,24 @@ - -FilterState object for factor or character variable — ChoicesFilterState • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,40 +107,60 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterState -> ChoicesFilterState

    +

    Inherited methods


    -

    Method new()

    -

    Initialize a InteractiveFilterState object

    -

    Usage

    -

    ChoicesFilterState$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize a InteractiveFilterState object

    +
    +

    Usage +

    +

    +
    +
    ChoicesFilterState$new(
       x,
       x_reactive = reactive(NULL),
       slice,
       extract_type = character(0)
    -)

    +)
    +

    +
    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection. For this class returned call looks like <varname> %in% c(<values selected>) with -optional is.na(<varname>).

    -

    Usage

    -

    ChoicesFilterState$get_call(dataname)

    +optional is.na(<varname>).

    +
    +

    Usage +

    +

    +
    +
    ChoicesFilterState$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    name of data set; defaults to private$get_dataname()

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (call) or NULL

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    ChoicesFilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    ChoicesFilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -198,7 +280,8 @@

    Arguments -

    Examples

    +

    Examples +

    filter_state <- teal.slice:::ChoicesFilterState$new(
       x = c(LETTERS, NA),
       slice = teal_slice(varname = "x", dataname = "data")
    @@ -308,17 +391,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.4.0/reference/DFFilterStates.html b/v0.4.0/reference/DFFilterStates.html index d3f1de00e..66d4febe7 100644 --- a/v0.4.0/reference/DFFilterStates.html +++ b/v0.4.0/reference/DFFilterStates.html @@ -1,8 +1,24 @@ - -FilterStates subclass for data frames — DFFilterStates • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,18 +107,25 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterStates -> DFFilterStates

    -

    Methods

    +

    Methods +

    -

    Public methods

    +

    Public methods +

    -

    Inherited methods +
    +

    Inherited methods


    -

    Method new()

    +

    +
    +
    +

    Method new() +

    Initializes DFFilterStates object.

    Initializes DFFilterStates object by setting dataname and initializing state_list (shiny::reactiveVal). This class contains a single state_list with no specified name, which means that when calling the subset function associated with this class -(dplyr::filter), a list of conditions is passed to unnamed arguments (...).

    -

    Usage

    -

    DFFilterStates$new(
    +(dplyr::filter), a list of conditions is passed to unnamed arguments (...).

    +
    +

    Usage +

    +

    +
    +
    DFFilterStates$new(
       data,
       data_reactive = function(sid = "") NULL,
       dataname,
       datalabel = NULL,
       keys = character(0)
    -)

    +)
    +

    +
    -

    Arguments

    -

    data
    +

    Arguments +

    +

    +
    +
    +
    data

    (data.frame)
    the R object which dplyr::filter function is applied on.

    @@ -155,23 +198,41 @@

    Arguments
    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    DFFilterStates$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    DFFilterStates$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -179,7 +240,8 @@

    Arguments -

    Examples

    +

    Examples +

    # working filters in an app
     
     library(shiny)
    @@ -298,17 +360,19 @@ 

    Examples

    + +

    + +
    - - + + diff --git a/v0.4.0/reference/DateFilterState.html b/v0.4.0/reference/DateFilterState.html index b60387263..64cb58bb1 100644 --- a/v0.4.0/reference/DateFilterState.html +++ b/v0.4.0/reference/DateFilterState.html @@ -1,8 +1,24 @@ - -FilterState object for Date variable — DateFilterState • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,40 +107,60 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterState -> DateFilterState

    +

    Inherited methods


    -

    Method new()

    -

    Initialize a FilterState object

    -

    Usage

    -

    DateFilterState$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterState object

    +
    +

    Usage +

    +

    +
    +
    DateFilterState$new(
       x,
       x_reactive = reactive(NULL),
       slice,
       extract_type = character(0)
    -)

    +)
    +

    +
    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection. For this class returned call looks like <varname> >= <min value> & <varname> <= <max value> with -optional is.na(<varname>).

    -

    Usage

    -

    DateFilterState$get_call(dataname)

    +optional is.na(<varname>).

    +
    +

    Usage +

    +

    +
    +
    DateFilterState$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    character(1) containing possibly prefixed name of data set

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (call)

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    DateFilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    DateFilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -198,7 +280,8 @@

    Arguments -

    Examples

    +

    Examples +

    filter_state <- teal.slice:::DateFilterState$new(
       x = c(Sys.Date() + seq(1:10), NA),
       slice = teal_slice(varname = "x", dataname = "data"),
    @@ -294,17 +377,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.4.0/reference/DatetimeFilterState.html b/v0.4.0/reference/DatetimeFilterState.html index 48e8975d0..c51db6df1 100644 --- a/v0.4.0/reference/DatetimeFilterState.html +++ b/v0.4.0/reference/DatetimeFilterState.html @@ -1,8 +1,24 @@ - -FilterState object for POSIXct variable — DatetimeFilterState • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,44 +107,64 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterState -> DatetimeFilterState

    +

    Inherited methods


    -

    Method new()

    +

    +
    +
    +

    Method new() +

    Initialize a FilterState object. This class has an extra field, private$timezone, which is set to Sys.timezone() by default. However, in case when using this module in teal app, one needs timezone of the app user. App user timezone is taken from session$userData$timezone -and is set only if object is initialized in shiny.

    -

    Usage

    -

    DatetimeFilterState$new(
    +and is set only if object is initialized in shiny.

    +
    +

    Usage +

    +

    +
    +
    DatetimeFilterState$new(
       x,
       x_reactive = reactive(NULL),
       extract_type = character(0),
       slice
    -)

    +)
    +

    +
    -

    Arguments

    -

    x
    +

    Arguments +

    +

    +
    +
    +
    x

    (POSIXct or POSIXlt)
    values of the variable used in filter

    @@ -135,11 +178,15 @@

    Arguments varname in the condition call will be returned as <dataname>$<varname>

  • "matrix" varname in the condition call will be returned as <dataname>[, <varname>]

  • - + +
    slice
    @@ -155,46 +202,81 @@

    Arguments
    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection. For this class returned call looks like <varname> >= as.POSIXct(<min>) & <varname> <= <max>) -with optional is.na(<varname>).

    -

    Usage

    -

    DatetimeFilterState$get_call(dataname)

    +with optional is.na(<varname>).

    +
    +

    Usage +

    +

    +
    +
    DatetimeFilterState$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    name of data set; defaults to private$get_dataname()

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (call)

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    DatetimeFilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    DatetimeFilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -202,7 +284,8 @@

    Arguments -

    Examples

    +

    Examples +

    filter_state <- teal.slice:::DatetimeFilterState$new(
       x = c(Sys.time() + seq(0, by = 3600, length.out = 10), NA),
       slice = teal_slice(varname = "x", dataname = "data"),
    @@ -306,17 +389,19 @@ 

    Examples

    + +
    + +

    - - + + diff --git a/v0.4.0/reference/DefaultFilteredDataset.html b/v0.4.0/reference/DefaultFilteredDataset.html index f859356f0..523d025a9 100644 --- a/v0.4.0/reference/DefaultFilteredDataset.html +++ b/v0.4.0/reference/DefaultFilteredDataset.html @@ -1,10 +1,26 @@ - -The DefaultFilteredDataset R6 class — DefaultFilteredDataset • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + +
    @@ -87,23 +109,30 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilteredDataset -> DefaultFilteredDataset

    +

    Inherited methods


    -

    Method new()

    -

    Initializes this DefaultFilteredDataset object

    -

    Usage

    -

    DefaultFilteredDataset$new(
    +

    +
    +
    +

    Method new() +

    +

    Initializes this DefaultFilteredDataset object

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$new(
       dataset,
       dataname,
       keys = character(0),
    @@ -129,12 +165,18 @@ 

    Usage

    join_keys = character(0), label = character(0), metadata = NULL -)

    +)
    +

    +
    -

    Arguments

    -

    dataset
    +

    Arguments +

    +

    +
    +
    +
    dataset

    (data.frame)
    single data.frame for which filters are rendered

    @@ -179,141 +221,243 @@

    Arguments
    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Gets the filter expression

    This functions returns filter calls equivalent to selected items within each of filter_states. Configuration of the calls is constant and depends on filter_states type and order which are set during initialization. This class contains single FilterStates which contains single state_list and all FilterState objects -applies to one argument (...) in dplyr::filter call.

    -

    Usage

    -

    DefaultFilteredDataset$get_call(sid = "")

    +applies to one argument (...) in dplyr::filter call.

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$get_call(sid = "")
    +

    +
    -

    Arguments

    -

    sid
    +

    Arguments +

    +

    +
    +
    +
    sid

    (character)
    when specified then method returns code containing filter conditions of FilterState objects which "sid" attribute is different than this sid argument.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    filter call or list of filter calls

    -


    -

    Method set_filter_state()

    -

    Set filter state

    -

    Usage

    -

    DefaultFilteredDataset$set_filter_state(state)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Set filter state

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$set_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slice) object

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL invisibly

    -

    Examples

    -

    dataset <- teal.slice:::DefaultFilteredDataset$new(iris, "iris")
    +

    Examples +

    +

    +
    +
    dataset <- teal.slice:::DefaultFilteredDataset$new(iris, "iris")
     fs <- teal_slices(
       teal_slice(dataname = "iris", varname = "Species", selected = "virginica"),
       teal_slice(dataname = "iris", varname = "Petal.Length", selected = c(2.0, 5))
     )
     dataset$set_filter_state(state = fs)
     shiny::isolate(dataset$get_filter_state())
    -

    +
    +

    +
    -


    -

    Method remove_filter_state()

    -

    Remove one or more FilterState form a FilteredDataset

    -

    Usage

    -

    DefaultFilteredDataset$remove_filter_state(state)

    +
    +

    +
    +
    +

    Method remove_filter_state() +

    +

    Remove one or more FilterState form a FilteredDataset

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$remove_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices)
    specifying FilterState objects to remove; teal_slices may contain only dataname and varname, other elements are ignored

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL invisibly

    -


    -

    Method ui_add()

    +
    +

    +
    +
    +

    Method ui_add() +

    +

    UI module to add filter variable for this dataset

    UI module to add filter variable for this dataset

    -

    UI module to add filter variable for this dataset

    -

    Usage

    -

    DefaultFilteredDataset$ui_add(id)

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$ui_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    identifier of the element - preferably containing dataset name

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    function - shiny UI module

    -


    -

    Method get_filter_overview()

    +
    +

    +
    +
    +

    Method get_filter_overview() +

    Get number of observations based on given keys The output shows the comparison between filtered_dataset -function parameter and the dataset inside self

    -

    Usage

    -

    DefaultFilteredDataset$get_filter_overview()

    +function parameter and the dataset inside self

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$get_filter_overview()
    +

    +
    -

    Returns

    +

    Returns +

    list containing character #filtered/#not_filtered

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    DefaultFilteredDataset$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -321,7 +465,8 @@

    Arguments -

    Examples

    +

    Examples +

    library(shiny)
     ds <- teal.slice:::DefaultFilteredDataset$new(iris, "iris")
     ds$set_filter_state(
    @@ -414,17 +559,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.4.0/reference/EmptyFilterState.html b/v0.4.0/reference/EmptyFilterState.html index b9eb62ba5..11548a6f5 100644 --- a/v0.4.0/reference/EmptyFilterState.html +++ b/v0.4.0/reference/EmptyFilterState.html @@ -1,8 +1,24 @@ - -FilterState object for empty variable — EmptyFilterState • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,40 +107,60 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterState -> EmptyFilterState

    +

    Inherited methods


    -

    Method new()

    -

    Initialize EmptyFilterState object.

    -

    Usage

    -

    EmptyFilterState$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize EmptyFilterState object.

    +
    +

    Usage +

    +

    +
    +
    EmptyFilterState$new(
       x,
       x_reactive = reactive(NULL),
       extract_type = character(0),
       slice
    -)

    +)
    +

    +
    -

    Arguments

    -

    x
    +

    Arguments +

    +

    +
    +
    +
    x

    (vector)
    values of the variable used in filter

    @@ -131,11 +174,15 @@

    Arguments varname in the condition call will be returned as <dataname>$<varname>

  • "matrix" varname in the condition call will be returned as <dataname>[, <varname>]

  • - + +
    slice
    @@ -151,46 +198,81 @@

    Arguments
    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection relevant for selected variable type. Uses internal reactive values, hence must be called -in reactive or isolated context.

    -

    Usage

    -

    EmptyFilterState$get_call(dataname)

    +in reactive or isolated context.

    +
    +

    Usage +

    +

    +
    +
    EmptyFilterState$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    name of data set; defaults to private$get_dataname()

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    logical(1)

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    EmptyFilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    EmptyFilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -198,7 +280,8 @@

    Arguments -

    Examples

    +

    Examples +

    filter_state <- teal.slice:::EmptyFilterState$new(
       x = NA,
       slice = teal_slice(varname = "x", dataname = "data"),
    @@ -213,17 +296,19 @@ 

    Examples

    + +
    + +

    - - + + diff --git a/v0.4.0/reference/FilterPanelAPI.html b/v0.4.0/reference/FilterPanelAPI.html index 745a80ba2..cf2ced7ee 100644 --- a/v0.4.0/reference/FilterPanelAPI.html +++ b/v0.4.0/reference/FilterPanelAPI.html @@ -1,10 +1,26 @@ - -Class to encapsulate the API of the filter panel of a teal app — FilterPanelAPI • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + +
    @@ -87,131 +109,230 @@
    -

    Details

    +

    Details +

    The purpose of this class is to encapsulate the API of the filter panel in a new class FilterPanelAPI so that it can be passed and used in the server call of any module instead of passing the whole FilteredData object.

    This class is supported by methods to set, get, remove filter states in the filter panel API.

    -

    Methods

    +

    Methods +


    -

    Method new()

    -

    Initialize a FilterPanelAPI object

    -

    Usage

    -

    FilterPanelAPI$new(datasets)

    + +
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterPanelAPI object

    +
    +

    Usage +

    +

    +
    +
    FilterPanelAPI$new(datasets)
    +

    +
    -

    Arguments

    -

    datasets
    +

    Arguments +

    +

    +
    +
    +
    datasets

    (FilteredData) object.

    -

    +
    +

    +
    -


    +

    +
    +
    +

    Method get_filter_state() +

    Gets the reactive values from the active FilterState objects of the FilteredData object.

    Gets all active filters in the form of a nested list. -The output list is a compatible input to set_filter_state.

    -

    Usage

    -

    FilterPanelAPI$get_filter_state()

    +The output list is a compatible input to set_filter_state.

    +
    +

    Usage +

    +

    +
    +
    FilterPanelAPI$get_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    list with named elements corresponding to FilteredDataset objects with active filters.

    -


    -

    Method set_filter_state()

    -

    Sets active filter states.

    -

    Usage

    -

    FilterPanelAPI$set_filter_state(filter)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Sets active filter states.

    +
    +

    Usage +

    +

    +
    +
    FilterPanelAPI$set_filter_state(filter)
    +

    +
    -

    Arguments

    -

    filter
    +

    Arguments +

    +

    +
    +
    +
    filter

    (teal_slices)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL invisibly

    -


    -

    Method remove_filter_state()

    -

    Remove one or more FilterState of a FilteredDataset in the FilteredData object.

    -

    Usage

    -

    FilterPanelAPI$remove_filter_state(filter)

    +
    +

    +
    +
    +

    Method remove_filter_state() +

    +

    Remove one or more FilterState of a FilteredDataset in the FilteredData object.

    +
    +

    Usage +

    +

    +
    +
    FilterPanelAPI$remove_filter_state(filter)
    +

    +
    -

    Arguments

    -

    filter
    +

    Arguments +

    +

    +
    +
    +
    filter

    (teal_slices)
    specifying FilterState objects to remove; teal_slices may contain only dataname and varname, other elements are ignored

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL invisibly

    -


    -

    Method clear_filter_states()

    -

    Remove all FilterStates of the FilteredData object.

    -

    Usage

    -

    FilterPanelAPI$clear_filter_states(datanames)

    +
    +

    +
    +
    +

    Method clear_filter_states() +

    +

    Remove all FilterStates of the FilteredData object.

    +
    +

    Usage +

    +

    +
    +
    FilterPanelAPI$clear_filter_states(datanames)
    +

    +
    -

    Arguments

    -

    datanames
    +

    Arguments +

    +

    +
    +
    +
    datanames

    (character)
    datanames to remove their FilterStates; omit to remove all FilterStates in the FilteredData object

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL invisibly

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    FilterPanelAPI$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    FilterPanelAPI$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -219,7 +340,8 @@

    Arguments -

    Examples

    +

    Examples +

    library(teal.slice)
     fd <- teal.slice::init_filtered_data(list(iris = list(dataset = iris)))
     fpa <- FilterPanelAPI$new(fd)
    @@ -289,17 +411,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.4.0/reference/FilterState.html b/v0.4.0/reference/FilterState.html index 2e06e0dc6..b8e05540a 100644 --- a/v0.4.0/reference/FilterState.html +++ b/v0.4.0/reference/FilterState.html @@ -1,8 +1,24 @@ - -FilterState Abstract Class — FilterState • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,13 +107,16 @@
    -

    Details

    +

    Details +

    This class is responsible for managing single filter item within FilteredData class. Filter states depend on the variable type: (logical, integer, numeric, factor, character, Date, POSIXct, POSIXlt) and returns FilterState object with class corresponding to input variable. Class controls single filter entry in module_single_filter_item and returns -code relevant to selected values.

    + +
    -

    Modifying state

    +

    Modifying state +

    -

    Modifying a FilterState object is possible in three scenarios:

    • In the interactive session by passing an appropriate teal_slice +

      Modifying a FilterState object is possible in three scenarios:

      +
        +
      • In the interactive session by passing an appropriate teal_slice to the set_state method, or using set_selected, set_keep_na or set_keep_inf methods.

      • In a running application by changing appropriate inputs.

      • In a running application by using filter_state_api which directly uses set_state method of the InteractiveFilterState object.

      • -
    + +
    -

    Methods

    +

    Methods +


    -

    Method new()

    -

    Initialize a FilterState object

    -

    Usage

    -

    FilterState$new(
    +
    +
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterState object

    +
    +

    Usage +

    +

    +
    +
    FilterState$new(
       x,
       x_reactive = reactive(NULL),
       slice,
       extract_type = character(0)
    -)

    +)
    +

    +
    -

    Returns

    +

    Returns +

    self invisibly

    -


    -

    Method format()

    -

    Returns a formatted string representing this FilterState object.

    -

    Usage

    -

    FilterState$format(show_all = FALSE, trim_lines = TRUE)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns a formatted string representing this FilterState object.

    +
    +

    Usage +

    +

    +
    +
    FilterState$format(show_all = FALSE, trim_lines = TRUE)
    +

    +
    -

    Arguments

    -

    show_all
    +

    Arguments +

    +

    +
    +
    +
    show_all

    logical(1) passed to format.teal_slice

    @@ -201,106 +271,196 @@

    Arguments -

    Returns

    +

    Returns +

    character(1) the formatted string

    -


    -

    Method print()

    -

    Prints this FilterState object.

    -

    Usage

    -

    FilterState$print(...)

    +
    +

    +
    +
    +

    Method print() +

    +

    Prints this FilterState object.

    +
    +

    Usage +

    +

    +
    +
    FilterState$print(...)
    +

    +
    -

    Arguments

    -

    ...
    +

    Arguments +

    +

    +
    +
    +
    ...

    additional arguments

    -

    +
    +

    +
    -


    -

    Method set_state()

    -

    Sets filtering state.

    • fixed state is prevented from changing state

    • +
    +

    +
    +
    +

    Method set_state() +

    +

    Sets filtering state.

    +
      +
    • fixed state is prevented from changing state

    • anchored state is prevented from removing state

    • -
    -

    Usage

    -

    FilterState$set_state(state)

    + +
    +

    Usage +

    +

    +
    +
    FilterState$set_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    a teal_slice object

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    self invisibly

    -


    -

    Method get_state()

    -

    Returns filtering state.

    -

    Usage

    -

    FilterState$get_state()

    +
    +

    +
    +
    +

    Method get_state() +

    +

    Returns filtering state.

    +
    +

    Usage +

    +

    +
    +
    FilterState$get_state()
    +

    +
    -

    Returns

    +

    Returns +

    A teal_slice object.

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection relevant for selected variable type. Method is using internal reactive values which makes it reactive -and must be executed in reactive or isolated context.

    -

    Usage

    -

    FilterState$get_call()

    +and must be executed in reactive or isolated context.

    +
    +

    Usage +

    +

    +
    +
    FilterState$get_call()
    +

    +
    -


    -

    Method server()

    -

    Shiny module server.

    -

    Usage

    -

    FilterState$server(id)

    +
    +

    +
    +
    +

    Method server() +

    +

    Shiny module server.

    +
    +

    Usage +

    +

    +
    +
    FilterState$server(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    shiny module instance id

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    moduleServer function which returns reactive value signaling that remove button has been clicked

    -


    -

    Method ui()

    -

    Shiny module UI.

    -

    Usage

    -

    FilterState$ui(id, parent_id = "cards")

    +
    +

    +
    +
    +

    Method ui() +

    +

    Shiny module UI.

    +
    +

    Usage +

    +

    +
    +
    FilterState$ui(id, parent_id = "cards")
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    shiny element (module instance) id; the UI for this class contains simple message stating that it is not supported

    @@ -310,35 +470,64 @@

    Arguments
    -

    Method destroy_observers()

    -

    Destroy observers stored in private$observers.

    -

    Usage

    -

    FilterState$destroy_observers()

    +
    +

    +
    +
    +

    Method destroy_observers() +

    +

    Destroy observers stored in private$observers.

    +
    +

    Usage +

    +

    +
    +
    FilterState$destroy_observers()
    +

    +
    -

    Returns

    +

    Returns +

    NULL invisibly

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    FilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    FilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -346,17 +535,19 @@

    Arguments

    + +

    + +
    - - + + diff --git a/v0.4.0/reference/FilterStateExpr.html b/v0.4.0/reference/FilterStateExpr.html index 9e9489e2e..a96d413f2 100644 --- a/v0.4.0/reference/FilterStateExpr.html +++ b/v0.4.0/reference/FilterStateExpr.html @@ -1,8 +1,24 @@ - -FilterStateExpr Class — FilterStateExpr • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,16 +107,20 @@
    -

    Details

    +

    Details +

    This class is responsible for displaying filter card and returning filter expression

    -

    Methods

    +

    Methods +


    -

    Method new()

    -

    Initialize a FilterStateExpr object

    -

    Usage

    -

    FilterStateExpr$new(slice)

    + +
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterStateExpr object

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$new(slice)
    +

    +
    -

    Arguments

    -

    slice
    +

    Arguments +

    +

    +
    +
    +
    slice

    (teal_slice_expr)
    object created by teal_slice()

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    FilterStateExpr

    -


    -

    Method format()

    -

    Returns a formatted string representing this FilterStateExpr object.

    -

    Usage

    -

    FilterStateExpr$format(show_all = FALSE, trim_lines = TRUE)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns a formatted string representing this FilterStateExpr object.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$format(show_all = FALSE, trim_lines = TRUE)
    +

    +
    -

    Arguments

    -

    show_all
    +

    Arguments +

    +

    +
    +
    +
    show_all

    logical(1) passed to format.teal_slice

    @@ -141,129 +200,237 @@

    Arguments -

    Returns

    +

    Returns +

    character(1) the formatted string

    -


    -

    Method print()

    -

    Prints this FilterStateExpr object.

    -

    Usage

    -

    FilterStateExpr$print(...)

    +
    +

    +
    +
    +

    Method print() +

    +

    Prints this FilterStateExpr object.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$print(...)
    +

    +
    -

    Arguments

    -

    ...
    +

    Arguments +

    +

    +
    +
    +
    ...

    additional arguments

    -

    +
    +

    +
    -


    -

    Method get_state()

    -

    Returns filtering state.

    -

    Usage

    -

    FilterStateExpr$get_state()

    +
    +

    +
    +
    +

    Method get_state() +

    +

    Returns filtering state.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$get_state()
    +

    +
    -

    Returns

    +

    Returns +

    A teal_slice object.

    -


    -

    Method set_state()

    -

    Sets filtering state.

    -

    Usage

    -

    FilterStateExpr$set_state(state)

    +
    +

    +
    +
    +

    Method set_state() +

    +

    Sets filtering state.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$set_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    a teal_slice object

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    self invisibly

    -


    -

    Method get_call()

    -

    Get reproducible call

    -

    Usage

    -

    FilterStateExpr$get_call(dataname)

    +
    +

    +
    +
    +

    Method get_call() +

    +

    Get reproducible call

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    -

    (ignored) for a consistency with FilterState

    +

    Arguments +

    +

    +
    +
    +
    dataname
    +
    +

    (ignored) for a consistency with FilterState

    Returns reproducible condition call for current selection relevant for selected variable type. Method is using internal reactive values which makes it reactive -and must be executed in reactive or isolated context.

    +and must be executed in reactive or isolated context.

    +
    -

    +

    +

    +
    -

    Returns

    +

    Returns +

    language

    -


    -

    Method destroy_observers()

    -

    Destroy observers stored in private$observers.

    -

    Usage

    -

    FilterStateExpr$destroy_observers()

    +
    +

    +
    +
    +

    Method destroy_observers() +

    +

    Destroy observers stored in private$observers.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$destroy_observers()
    +

    +
    -

    Returns

    +

    Returns +

    NULL invisibly

    -


    -

    Method server()

    -

    Shiny module server.

    -

    Usage

    -

    FilterStateExpr$server(id)

    +
    +

    +
    +
    +

    Method server() +

    +

    Shiny module server.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$server(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    shiny module instance id

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    moduleServer function which returns reactive value signaling that remove button has been clicked

    -


    -

    Method ui()

    -

    Shiny module UI.

    -

    Usage

    -

    FilterStateExpr$ui(id, parent_id = "cards")

    +
    +

    +
    +
    +

    Method ui() +

    +

    Shiny module UI.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$ui(id, parent_id = "cards")
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    shiny element (module instance) id; the UI for this class contains simple message stating that it is not supported

    @@ -273,23 +440,41 @@

    Arguments
    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    FilterStateExpr$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -297,7 +482,8 @@

    Arguments -

    Examples

    +

    Examples +

    filter_state <- teal.slice:::FilterStateExpr$new(
       slice = teal_slice(
         dataname = "x",
    @@ -344,17 +530,19 @@ 

    Examples

    + +

    + +
    - - + + diff --git a/v0.4.0/reference/FilterStates.html b/v0.4.0/reference/FilterStates.html index 3d92b9518..e7f67581c 100644 --- a/v0.4.0/reference/FilterStates.html +++ b/v0.4.0/reference/FilterStates.html @@ -1,5 +1,10 @@ - - + + + + + +FilterStates R6 class — FilterStates • teal.slice +FilterStates R6 class — FilterStates • teal.slice + + + + + + + + + + Skip to contents @@ -38,7 +54,8 @@ + +
    @@ -114,12 +137,15 @@
    -

    Methods

    +

    Methods +


    -

    Method new()

    + +
    +

    +
    +
    +

    Method new() +

    Initializes FilterStates object.

    Initializes FilterStates object by setting -dataname, and datalabel.

    -

    Usage

    -

    FilterStates$new(
    +dataname, and datalabel.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$new(
       data,
       data_reactive = function(sid = "") NULL,
       dataname,
       datalabel = NULL
    -)

    +)
    +

    +
    -

    Arguments

    -

    data
    +

    Arguments +

    +

    +
    +
    +
    data

    (data.frame, MultiAssayExperiment, SummarizedExperiment, matrix)
    the R object which subset function is applied on.

    @@ -172,23 +213,40 @@

    Arguments -

    Returns

    +

    Returns +

    self invisibly

    -


    -

    Method format()

    -

    Returns a formatted string representing this FilterStates object.

    -

    Usage

    -

    FilterStates$format(show_all = FALSE, trim_lines = TRUE)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns a formatted string representing this FilterStates object.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$format(show_all = FALSE, trim_lines = TRUE)
    +

    +
    -

    Arguments

    -

    show_all
    +

    Arguments +

    +

    +
    +
    +
    show_all

    logical(1) passed to format.teal_slices

    @@ -196,28 +254,40 @@

    Arguments -

    Returns

    +

    Returns +

    character(1) the formatted string

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Filter call

    Builds subset expression from condition calls generated by FilterState. The lhs of the expression is a dataname_prefixed, where word prefixed refers to situation when call is evaluated on elements of the original data, for example dataname[[x]]. By default dataname_prefixed = dataname and it's not alterable through class methods. Customization of private$dataname_prefixed is done through inheriting classes.

    -

    The rhs is a call to private$fun with following arguments:

    • dataname_prefixed

    • +

      The rhs is a call to private$fun with following arguments:

      +
        +
      • dataname_prefixed

      • list of logical expressions generated by FilterState objects stored in private$state_list. Each logical predicate is combined with & operator. Variables in these logical expressions by default are not prefixed but this can be changed by setting private$extract_type (change in the similar way as dataname_prefixed) Possible call outputs depending on a custom fields/options:

      • -

      # default
      +
    +

    +
    +
    # default
     dataname <- subset(dataname, col == "x")
     
     # fun = dplyr::filter
    @@ -230,89 +300,162 @@ 

    Method get_call()dataname <- subset(dataname, subset = row_col == "x", select = col_col == "x") # dataname = dataname[[element]] -dataname[[element]] <- subset(dataname[[element]], subset = col == "x")

    -

    If no filters are applied, NULL is returned to avoid no-op calls such as dataname <- dataname.

    -

    Usage

    -

    FilterStates$get_call(sid = "")

    +dataname[[element]] <- subset(dataname[[element]], subset = col == "x")
    +

    +
    +

    If no filters are applied, NULL is returned to avoid no-op calls such as dataname <- dataname.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$get_call(sid = "")
    +

    +
    -

    Arguments

    -

    sid
    +

    Arguments +

    +

    +
    +
    +
    sid

    (character)
    when specified then method returns code containing filter conditions of FilterState objects which "sid" attribute is different than this sid argument.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    call or NULL

    -


    -

    Method print()

    -

    Prints this FilterStates object.

    -

    Usage

    -

    FilterStates$print(...)

    +
    +

    +
    +
    +

    Method print() +

    +

    Prints this FilterStates object.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$print(...)
    +

    +
    -

    Arguments

    -

    ...
    +

    Arguments +

    +

    +
    +
    +
    ...

    additional arguments

    -

    +
    +

    +
    -


    -

    Method remove_filter_state()

    -

    Remove one or more FilterStates from the state_list along with their UI elements.

    -

    Usage

    -

    FilterStates$remove_filter_state(state)

    +
    +

    +
    +
    +

    Method remove_filter_state() +

    +

    Remove one or more FilterStates from the state_list along with their UI elements.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$remove_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices)
    specifying FilterState objects to remove; teal_slices may contain only dataname and varname, other elements are ignored

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL invisibly

    -


    +

    +
    +
    +

    Method get_filter_state() +

    Gets reactive values from active FilterState objects.

    Get active filter state from FilterState objects stored in state_list(s). -The output is a list compatible with input to self$set_filter_state.

    -

    Usage

    -

    FilterStates$get_filter_state()

    +The output is a list compatible with input to self$set_filter_state.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$get_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    list containing list per FilterState in the state_list

    -


    -

    Method set_filter_state()

    -

    Sets active FilterState objects.

    -

    Usage

    -

    FilterStates$set_filter_state(state)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Sets active FilterState objects.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$set_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (named list)
    should contain values which are initial selection in the FilterState. Names of the list element should correspond to the name of the @@ -324,137 +467,241 @@

    Arguments -

    Returns

    +

    Returns +

    function which throws an error

    -


    -

    Method clear_filter_states()

    -

    Remove all FilterState objects from this FilterStates object.

    -

    Usage

    -

    FilterStates$clear_filter_states(force = FALSE)

    +
    +

    +
    +
    +

    Method clear_filter_states() +

    +

    Remove all FilterState objects from this FilterStates object.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$clear_filter_states(force = FALSE)
    +

    +
    -

    Arguments

    -

    force
    +

    Arguments +

    +

    +
    +
    +
    force

    (logical(1))
    include locked filter states

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly

    -


    -

    Method ui_active()

    +
    +

    +
    +
    +

    Method ui_active() +

    Shiny module UI

    Shiny UI element that stores FilterState UI elements. -Populated with elements created with renderUI in the module server.

    -

    Usage

    -

    FilterStates$ui_active(id)

    +Populated with elements created with renderUI in the module server.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$ui_active(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    shiny element (module instance) id

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_active()

    -

    Shiny server module.

    -

    Usage

    -

    FilterStates$srv_active(id)

    +
    +

    +
    +
    +

    Method srv_active() +

    +

    Shiny server module.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$srv_active(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    shiny module instance id

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    moduleServer function which returns NULL

    -


    -

    Method ui_add()

    -

    Shiny UI module to add filter variable.

    -

    Usage

    -

    FilterStates$ui_add(id)

    +
    +

    +
    +
    +

    Method ui_add() +

    +

    Shiny UI module to add filter variable.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$ui_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    shiny element (module instance) id

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_add()

    +
    +

    +
    +
    +

    Method srv_add() +

    Shiny server module to add filter variable.

    This module controls available choices to select as a filter variable. Once selected, a variable is removed from available choices. -Removing a filter variable adds it back to available choices.

    -

    Usage

    -

    FilterStates$srv_add(id)

    +Removing a filter variable adds it back to available choices.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$srv_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    an ID string that corresponds with the ID used to call the module's UI function.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    moduleServer function which returns NULL

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    FilterStates$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -462,17 +709,19 @@

    Arguments

    + +
    + +
    - - + + diff --git a/v0.4.0/reference/FilteredData.html b/v0.4.0/reference/FilteredData.html index 8686c6323..efa3466b4 100644 --- a/v0.4.0/reference/FilteredData.html +++ b/v0.4.0/reference/FilteredData.html @@ -1,10 +1,26 @@ - -Class to encapsulate filtered datasets — FilteredData • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + +
    @@ -87,7 +109,8 @@ + +
    -

    Methods

    +

    Methods +


    -

    Method new()

    -

    Initialize a FilteredData object

    -

    Usage

    -

    FilteredData$new(
    +
    +
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilteredData object

    +
    +

    Usage +

    +

    +
    +
    FilteredData$new(
       data_objects,
       join_keys = teal.data::join_keys(),
       code = NULL,
       check = FALSE
    -)

    +)
    +

    +
    -

    Arguments

    -

    data_objects
    +

    Arguments +

    +

    +
    +
    +
    data_objects

    (list) should named elements containing data.frame or MultiAssayExperiment. Names of the list will serve as dataname.

    @@ -186,43 +233,72 @@

    Arguments
    -

    Method datanames()

    +
    +

    +
    +
    +

    Method datanames() +

    Gets datanames

    The datanames are returned in the order in which they must be -evaluated (in case of dependencies).

    -

    Usage

    -

    FilteredData$datanames()

    +evaluated (in case of dependencies).

    +
    +

    Usage +

    +

    +
    +
    FilteredData$datanames()
    +

    +
    -

    Returns

    +

    Returns +

    (character vector) of datanames Gets data label for the dataset

    Useful to display in Show R Code.

    -


    -

    Method get_datalabel()

    +
    +

    +
    +
    +

    Method get_datalabel() +

    -

    Usage

    -

    FilteredData$get_datalabel(dataname)

    +

    Usage +

    +

    +
    +
    FilteredData$get_datalabel(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (character) keys of dataset Set list of external filter states available for activation.

    Unlike adding new filter from the column, these filters can come with some prespecified settings. @@ -232,25 +308,41 @@

    Returns
    -

    Method set_available_teal_slices()

    +
    +

    +
    +
    +

    Method set_available_teal_slices() +

    -

    Usage

    -

    FilteredData$set_available_teal_slices(x)

    +

    Usage +

    +

    +
    +
    FilteredData$set_available_teal_slices(x)
    +

    +
    -

    Arguments

    -

    x
    +

    Arguments +

    +

    +
    +
    +
    x

    (reactive)
    should return teal_slices

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    invisible NULL Get list of filter states available for this object.

    All teal_slice objects that have been created since the beginning of the app session @@ -258,21 +350,35 @@

    Returns
    -

    Method get_available_teal_slices()

    +
    +

    +
    +
    +

    Method get_available_teal_slices() +

    -

    Usage

    -

    FilteredData$get_available_teal_slices()

    +

    Usage +

    +

    +
    +
    FilteredData$get_available_teal_slices()
    +

    +
    -

    Returns

    +

    Returns +

    reactive that returns teal_slices

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Gets a call to filter the dataset according to the filter state.

    It returns a call to filter the dataset only, assuming the other (filtered) datasets it depends on are available.

    @@ -283,56 +389,100 @@

    Method get_call()

    The filtered dataset has the name given by self$filtered_dataname(dataname)

    -

    This can be used for the Show R Code generation.

    -

    Usage

    -

    FilteredData$get_call(dataname)

    +

    This can be used for the Show R Code generation.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (call or list of calls) to filter dataset calls

    -


    -

    Method get_code()

    -

    Gets the R preprocessing code string that generates the unfiltered datasets.

    -

    Usage

    -

    FilteredData$get_code(dataname = self$datanames())

    +
    +

    +
    +
    +

    Method get_code() +

    +

    Gets the R preprocessing code string that generates the unfiltered datasets.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_code(dataname = self$datanames())
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name(s) of dataset(s)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (character(1)) deparsed code

    -


    -

    Method get_data()

    +
    +

    +
    +
    +

    Method get_data() +

    Gets filtered or unfiltered dataset.

    For filtered = FALSE, the original data set with -set_data is returned including all attributes.

    -

    Usage

    -

    FilteredData$get_data(dataname, filtered = TRUE)

    +set_data is returned including all attributes.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_data(dataname, filtered = TRUE)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset

    @@ -340,105 +490,194 @@

    Arguments
    -

    Method get_check()

    -

    Returns whether the datasets in the object has undergone a reproducibility check.

    -

    Usage

    -

    FilteredData$get_check()

    +
    +

    +
    +
    +

    Method get_check() +

    +

    Returns whether the datasets in the object has undergone a reproducibility check.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_check()
    +

    +
    -

    Returns

    +

    Returns +

    logical

    -


    -

    Method get_metadata()

    -

    Gets metadata for a given dataset.

    -

    Usage

    -

    FilteredData$get_metadata(dataname)

    +
    +

    +
    +
    +

    Method get_metadata() +

    +

    Gets metadata for a given dataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_metadata(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    value of metadata for given data (or NULL if it does not exist)

    -


    -

    Method get_join_keys()

    -

    Get join keys between two datasets.

    -

    Usage

    -

    FilteredData$get_join_keys()

    +
    +

    +
    +
    +

    Method get_join_keys() +

    +

    Get join keys between two datasets.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_join_keys()
    +

    +
    -

    Returns

    +

    Returns +

    (JoinKeys)

    -


    -

    Method get_filter_overview()

    +
    +

    +
    +
    +

    Method get_filter_overview() +

    Get filter overview table in form of X (filtered) / Y (non-filtered).

    This is intended to be presented in the application. -The content for each of the data names is defined in get_filter_overview_info method.

    -

    Usage

    -

    FilteredData$get_filter_overview(datanames)

    +The content for each of the data names is defined in get_filter_overview_info method.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_filter_overview(datanames)
    +

    +
    -

    Arguments

    -

    datanames
    +

    Arguments +

    +

    +
    +
    +
    datanames

    (character vector) names of the dataset

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (matrix) matrix of observations and subjects of all datasets

    -


    -

    Method get_keys()

    -

    Get keys for the dataset.

    -

    Usage

    -

    FilteredData$get_keys(dataname)

    +
    +

    +
    +
    +

    Method get_keys() +

    +

    Get keys for the dataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_keys(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (character) keys of dataset

    -


    -

    Method set_dataset()

    -

    Adds a dataset to this FilteredData.

    -

    Usage

    -

    FilteredData$set_dataset(data, dataname, metadata, label)

    +
    +

    +
    +
    +

    Method set_dataset() +

    +

    Adds a dataset to this FilteredData.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$set_dataset(data, dataname, metadata, label)
    +

    +
    -

    Arguments

    -

    data
    +

    Arguments +

    +

    +
    +
    +
    data

    (data.frame, MultiAssayExperiment)
    data to be filtered.

    @@ -459,10 +698,13 @@

    Arguments -

    Details

    +

    Details +

    set_dataset creates a FilteredDataset object which keeps dataset for the filtering purpose. If this data has a parent specified in the JoinKeys object stored in private$join_keys then created FilteredDataset (child) gets linked with other FilteredDataset (parent). @@ -471,93 +713,170 @@

    Details -

    Returns

    +

    Returns +

    (self) invisibly this FilteredData

    -


    -

    Method set_join_keys()

    -

    Set the join_keys.

    -

    Usage

    -

    FilteredData$set_join_keys(join_keys)

    +
    +

    +
    +
    +

    Method set_join_keys() +

    +

    Set the join_keys.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$set_join_keys(join_keys)
    +

    +
    -

    Arguments

    -

    join_keys
    +

    Arguments +

    +

    +
    +
    +
    join_keys

    (JoinKeys) join_key (converted to a nested list)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (self) invisibly this FilteredData

    -


    -

    Method set_check()

    -

    Sets whether the datasets in the object have undergone a reproducibility check.

    -

    Usage

    -

    FilteredData$set_check(check)

    +
    +

    +
    +
    +

    Method set_check() +

    +

    Sets whether the datasets in the object have undergone a reproducibility check.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$set_check(check)
    +

    +
    -

    Arguments

    -

    check
    +

    Arguments +

    +

    +
    +
    +
    check

    (logical) whether datasets have undergone reproducibility check

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (self)

    -


    -

    Method set_code()

    -

    Sets the R preprocessing code for single dataset.

    -

    Usage

    -

    FilteredData$set_code(code)

    +
    +

    +
    +
    +

    Method set_code() +

    +

    Sets the R preprocessing code for single dataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$set_code(code)
    +

    +
    -

    Arguments

    -

    code
    +

    Arguments +

    +

    +
    +
    +
    code

    (CodeClass)
    preprocessing code that can be parsed to generate the unfiltered datasets

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (self)

    -


    -

    Method get_filter_state()

    -

    Gets states of all active FilterState objects.

    -

    Usage

    -

    FilteredData$get_filter_state()

    +
    +

    +
    +
    +

    Method get_filter_state() +

    +

    Gets states of all active FilterState objects.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    A teal_slices object.

    -


    -

    Method format()

    -

    Returns a formatted string representing this FilteredData object.

    -

    Usage

    -

    FilteredData$format(show_all = FALSE, trim_lines = TRUE)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns a formatted string representing this FilteredData object.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$format(show_all = FALSE, trim_lines = TRUE)
    +

    +
    -

    Arguments

    -

    show_all
    +

    Arguments +

    +

    +
    +
    +
    show_all

    logical(1) passed to format.teal_slice

    @@ -565,53 +884,92 @@

    Arguments -

    Returns

    +

    Returns +

    character(1) the formatted string

    -


    -

    Method print()

    -

    Prints this FilteredData object.

    -

    Usage

    -

    FilteredData$print(...)

    +
    +

    +
    +
    +

    Method print() +

    +

    Prints this FilteredData object.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$print(...)
    +

    +
    -

    Arguments

    -

    ...
    +

    Arguments +

    +

    +
    +
    +
    ...

    additional arguments

    -

    +
    +

    +
    -


    -

    Method set_filter_state()

    -

    Sets active filter states.

    -

    Usage

    -

    FilteredData$set_filter_state(state)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Sets active filter states.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$set_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    either a named list list of filter selections or a teal_slices object
    specification by list will be deprecated soon

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL invisibly

    -

    Examples

    -

    utils::data(miniACC, package = "MultiAssayExperiment")
    +

    Examples +

    +

    +
    +
    utils::data(miniACC, package = "MultiAssayExperiment")
     
     datasets <- teal.slice:::FilteredData$new(
       list(iris = list(dataset = iris),
    @@ -633,43 +991,76 @@ 

    Examples ) datasets$set_filter_state(state = fs) shiny::isolate(datasets$get_filter_state()) -

    +
    +

    +
    -


    -

    Method remove_filter_state()

    -

    Removes one or more FilterState from a FilteredData object.

    -

    Usage

    -

    FilteredData$remove_filter_state(state)

    +
    +

    +
    +
    +

    Method remove_filter_state() +

    +

    Removes one or more FilterState from a FilteredData object.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$remove_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices)
    specifying FilterState objects to remove; teal_slices may contain only dataname and varname, other elements are ignored

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL invisibly

    -


    +

    +
    +
    +

    Method clear_filter_states() +

    Remove all FilterStates of a FilteredDataset or all FilterStates -of a FilteredData object.

    -

    Usage

    -

    FilteredData$clear_filter_states(datanames = self$datanames(), force = FALSE)

    +of a FilteredData object.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$clear_filter_states(datanames = self$datanames(), force = FALSE)
    +

    +
    -

    Arguments

    -

    datanames
    +

    Arguments +

    +

    +
    +
    +
    datanames

    (character)
    datanames to remove their FilterStates or empty which removes all FilterStates in the FilteredData object

    @@ -679,10 +1070,13 @@

    Arguments -

    Returns

    +

    Returns +

    NULL invisibly

    Module for the right filter panel in the teal app with a filter overview panel and a filter variable panel.

    @@ -690,40 +1084,69 @@

    Returns
    -

    Method ui_filter_panel()

    +
    +

    +
    +
    +

    Method ui_filter_panel() +

    -

    Usage

    -

    FilteredData$ui_filter_panel(id)

    +

    Usage +

    +

    +
    +
    FilteredData$ui_filter_panel(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    module id

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag Server function for filter panel

    -


    -

    Method srv_filter_panel()

    +
    +

    +
    +
    +

    Method srv_filter_panel() +

    -

    Usage

    -

    FilteredData$srv_filter_panel(id, active_datanames = self$datanames)

    +

    Usage +

    +

    +
    +
    FilteredData$srv_filter_panel(id, active_datanames = self$datanames)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    an ID string that corresponds with the ID used to call the module's UI function.

    @@ -736,44 +1159,78 @@

    Arguments -

    Returns

    +

    Returns +

    moduleServer function which returns NULL

    -


    -

    Method ui_active()

    -

    Server module responsible for displaying active filters.

    -

    Usage

    -

    FilteredData$ui_active(id)

    +
    +

    +
    +
    +

    Method ui_active() +

    +

    Server module responsible for displaying active filters.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$ui_active(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    an ID string that corresponds with the ID used to call the module's UI function.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_active()

    -

    Server module responsible for displaying active filters.

    -

    Usage

    -

    FilteredData$srv_active(id, active_datanames = self$datanames)

    +
    +

    +
    +
    +

    Method srv_active() +

    +

    Server module responsible for displaying active filters.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$srv_active(id, active_datanames = self$datanames)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    an ID string that corresponds with the ID used to call the module's UI function.

    @@ -783,44 +1240,78 @@

    Arguments -

    Returns

    +

    Returns +

    moduleServer returning NULL

    -


    -

    Method ui_add()

    -

    Server module responsible for displaying drop-downs with variables to add a filter.

    -

    Usage

    -

    FilteredData$ui_add(id)

    +
    +

    +
    +
    +

    Method ui_add() +

    +

    Server module responsible for displaying drop-downs with variables to add a filter.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$ui_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    an ID string that corresponds with the ID used to call the module's UI function.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_add()

    -

    Server module responsible for displaying drop-downs with variables to add a filter.

    -

    Usage

    -

    FilteredData$srv_add(id, active_datanames = reactive(self$datanames()))

    +
    +

    +
    +
    +

    Method srv_add() +

    +

    Server module responsible for displaying drop-downs with variables to add a filter.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$srv_add(id, active_datanames = reactive(self$datanames()))
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    an ID string that corresponds with the ID used to call the module's UI function.

    @@ -830,10 +1321,13 @@

    Arguments -

    Returns

    +

    Returns +

    moduleServer returning NULL Creates the UI for the module showing counts for each dataset contrasting the filtered to the full unfiltered dataset

    @@ -842,36 +1336,64 @@

    Returns
    -

    Method ui_overview()

    +
    +

    +
    +
    +

    Method ui_overview() +

    -

    Usage

    -

    FilteredData$ui_overview(id)

    +

    Usage +

    +

    +
    +
    FilteredData$ui_overview(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    module id Server function to display the number of records in the filtered and unfiltered data

    -

    +
    +

    +
    -


    -

    Method srv_overview()

    +
    +

    +
    +
    +

    Method srv_overview() +

    -

    Usage

    -

    FilteredData$srv_overview(id, active_datanames = self$datanames)

    +

    Usage +

    +

    +
    +
    FilteredData$srv_overview(id, active_datanames = self$datanames)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    an ID string that corresponds with the ID used to call the module's UI function.

    @@ -884,43 +1406,77 @@

    Arguments -

    Returns

    +

    Returns +

    moduleServer function which returns NULL

    -


    -

    Method handle_active_datanames()

    -

    Method is deprecated. Provide resolved active_datanames to srv_filter_panel

    -

    Usage

    -

    FilteredData$handle_active_datanames(datanames)

    +
    +

    +
    +
    +

    Method handle_active_datanames() +

    +

    Method is deprecated. Provide resolved active_datanames to srv_filter_panel

    +
    +

    Usage +

    +

    +
    +
    FilteredData$handle_active_datanames(datanames)
    +

    +
    -

    Arguments

    -

    datanames
    +

    Arguments +

    +

    +
    +
    +
    datanames

    character vector datanames to pick

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    the intersection of self$datanames() and datanames

    -


    -

    Method get_varlabels()

    -

    Method is deprecated. Please extract column labels directly from the data.

    -

    Usage

    -

    FilteredData$get_varlabels(dataname, variables = NULL)

    +
    +

    +
    +
    +

    Method get_varlabels() +

    +

    Method is deprecated. Please extract column labels directly from the data.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_varlabels(dataname, variables = NULL)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset

    @@ -929,67 +1485,131 @@

    Arguments
    -

    Method get_varnames()

    -

    Method is deprecated, Please extract variable names directly from the data instead

    -

    Usage

    -

    FilteredData$get_varnames(dataname)

    +
    +

    +
    +
    +

    Method get_varnames() +

    +

    Method is deprecated, Please extract variable names directly from the data instead

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_varnames(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character) the name of the dataset

    -

    +
    +

    +
    -


    -

    Method get_filterable_datanames()

    -

    Method is deprecated, please use self$datanames() instead

    -

    Usage

    -

    FilteredData$get_filterable_datanames()

    +
    +

    +
    +
    +

    Method get_filterable_datanames() +

    +

    Method is deprecated, please use self$datanames() instead

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_filterable_datanames()
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character vector) names of the dataset

    -

    +
    +

    +
    -


    -

    Method get_filterable_varnames()

    -

    Method is deprecated, please use self$get_filter_state() and retain attr(, "filterable_varnames") instead.

    -

    Usage

    -

    FilteredData$get_filterable_varnames(dataname)

    +
    +

    +
    +
    +

    Method get_filterable_varnames() +

    +

    Method is deprecated, please use self$get_filter_state() and retain attr(, "filterable_varnames") instead.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_filterable_varnames(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset

    -

    +
    +

    +
    -


    -

    Method set_filterable_varnames()

    -

    Method is deprecated, please use self$set_filter_state and teal_slices() with include_varnames instead.

    -

    Usage

    -

    FilteredData$set_filterable_varnames(dataname, varnames)

    +
    +

    +
    +
    +

    Method set_filterable_varnames() +

    +

    Method is deprecated, please use self$set_filter_state and teal_slices() with include_varnames instead.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$set_filterable_varnames(dataname, varnames)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset

    @@ -999,51 +1619,96 @@

    Arguments
    -

    Method get_formatted_filter_state()

    -

    Method is deprecated, please use format.teal_slices on object returned from self$get_filter_state()

    -

    Usage

    -

    FilteredData$get_formatted_filter_state()

    +
    +

    +
    +
    +

    Method get_formatted_filter_state() +

    +

    Method is deprecated, please use format.teal_slices on object returned from self$get_filter_state()

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_formatted_filter_state()
    +

    +
    -


    -

    Method remove_all_filter_states()

    -

    Deprecated - please use clear_filter_states method.

    -

    Usage

    -

    FilteredData$remove_all_filter_states(datanames)

    +
    +

    +
    +
    +

    Method remove_all_filter_states() +

    +

    Deprecated - please use clear_filter_states method.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$remove_all_filter_states(datanames)
    +

    +
    -

    Arguments

    -

    datanames
    +

    Arguments +

    +

    +
    +
    +
    datanames

    (character)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL invisibly

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    FilteredData$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -1051,7 +1716,8 @@

    Arguments -

    Examples

    +

    Examples +

    library(shiny)
     datasets <- teal.slice:::FilteredData$new(
       list(
    @@ -1283,17 +1949,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.4.0/reference/FilteredDataset.html b/v0.4.0/reference/FilteredDataset.html index 8b0dab75a..411a875f5 100644 --- a/v0.4.0/reference/FilteredDataset.html +++ b/v0.4.0/reference/FilteredDataset.html @@ -1,16 +1,32 @@ - - + + + + + +FilterStates R6 class — FilteredDataset • teal.slice +FilterStates R6 class — FilteredDataset • teal.slice + + + + + + + + + + Skip to contents @@ -26,7 +42,8 @@ + +

    @@ -96,12 +119,15 @@
    -

    Methods

    +

    Methods +


    -

    Method new()

    -

    Initializes this FilteredDataset object

    -

    Usage

    -

    +

    +
    +
    +

    Method new() +

    +

    Initializes this FilteredDataset object

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$new(
       dataset,
       dataname,
       keys = character(0),
       label = attr(dataset, "label"),
       metadata = NULL
    -)

    +)
    +

    +
    -

    Arguments

    -

    dataset
    +

    Arguments +

    +

    +
    +
    +
    dataset

    (data.frame or MultiAssayExperiment)
    single dataset for which filters are rendered

    @@ -161,19 +202,35 @@

    Arguments
    -

    Method format()

    -

    Returns a formatted string representing this FilteredDataset object.

    -

    Usage

    -

    FilteredDataset$format(show_all = FALSE, trim_lines = TRUE)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns a formatted string representing this FilteredDataset object.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$format(show_all = FALSE, trim_lines = TRUE)
    +

    +
    -

    Arguments

    -

    show_all
    +

    Arguments +

    +

    +
    +
    +
    show_all

    logical(1) passed to format.teal_slice

    @@ -181,319 +238,573 @@

    Arguments -

    Returns

    +

    Returns +

    character(1) the formatted string

    -


    -

    Method print()

    -

    Prints this FilteredDataset object.

    -

    Usage

    -

    FilteredDataset$print(...)

    +
    +

    +
    +
    +

    Method print() +

    +

    Prints this FilteredDataset object.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$print(...)
    +

    +
    -

    Arguments

    -

    ...
    +

    Arguments +

    +

    +
    +
    +
    ...

    additional arguments

    -

    +
    +

    +
    -


    -

    Method clear_filter_states()

    -

    Removes all active filter items applied to this dataset

    -

    Usage

    -

    FilteredDataset$clear_filter_states(force = FALSE)

    +
    +

    +
    +
    +

    Method clear_filter_states() +

    +

    Removes all active filter items applied to this dataset

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$clear_filter_states(force = FALSE)
    +

    +
    -

    Arguments

    -

    force
    +

    Arguments +

    +

    +
    +
    +
    force

    (logical(1))
    include locked filter states

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Gets a filter expression

    This functions returns filter calls equivalent to selected items within each of filter_states. Configuration of the calls is constant and -depends on filter_states type and order which are set during initialization.

    -

    Usage

    -

    FilteredDataset$get_call(sid = "")

    +depends on filter_states type and order which are set during initialization.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_call(sid = "")
    +

    +
    -

    Arguments

    -

    sid
    +

    Arguments +

    +

    +
    +
    +
    sid

    (character)
    when specified then method returns code containing filter conditions of FilterState objects which "sid" attribute is different than this sid argument.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    filter call or list of filter calls

    -


    -

    Method get_filter_state()

    -

    Gets states of all active FilterState objects

    -

    Usage

    -

    FilteredDataset$get_filter_state()

    +
    +

    +
    +
    +

    Method get_filter_state() +

    +

    Gets states of all active FilterState objects

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    A teal_slices object.

    -


    -

    Method set_filter_state()

    -

    Set filter state

    -

    Usage

    -

    FilteredDataset$set_filter_state(state)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Set filter state

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$set_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slice) object

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL invisibly

    -


    -

    Method get_filter_count()

    -

    Gets the number of active FilterState objects in all FilterStates in this FilteredDataset.

    -

    Usage

    -

    FilteredDataset$get_filter_count()

    +
    +

    +
    +
    +

    Method get_filter_count() +

    +

    Gets the number of active FilterState objects in all FilterStates in this FilteredDataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_filter_count()
    +

    +
    -

    Returns

    +

    Returns +

    integer(1)

    -


    -

    Method get_dataname()

    -

    Gets the name of the dataset

    -

    Usage

    -

    FilteredDataset$get_dataname()

    +
    +

    +
    +
    +

    Method get_dataname() +

    +

    Gets the name of the dataset

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_dataname()
    +

    +
    -

    Returns

    +

    Returns +

    character(1) as a name of this dataset

    -


    -

    Method get_dataset()

    -

    Gets the dataset object in this FilteredDataset

    -

    Usage

    -

    FilteredDataset$get_dataset(filtered = FALSE)

    +
    +

    +
    +
    +

    Method get_dataset() +

    +

    Gets the dataset object in this FilteredDataset

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_dataset(filtered = FALSE)
    +

    +
    -

    Arguments

    -

    filtered
    +

    Arguments +

    +

    +
    +
    +
    filtered

    (logical(1))

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    data.frame or MultiAssayExperiment, either raw or as a reactive with current filters applied

    -


    -

    Method get_metadata()

    -

    Gets the metadata for the dataset in this FilteredDataset

    -

    Usage

    -

    FilteredDataset$get_metadata()

    +
    +

    +
    +
    +

    Method get_metadata() +

    +

    Gets the metadata for the dataset in this FilteredDataset

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_metadata()
    +

    +
    -

    Returns

    +

    Returns +

    named list or NULL

    -


    -

    Method get_filter_overview()

    +
    +

    +
    +
    +

    Method get_filter_overview() +

    Get filter overview rows of a dataset The output shows the comparison between filtered_dataset -function parameter and the dataset inside self

    -

    Usage

    -

    FilteredDataset$get_filter_overview()

    +function parameter and the dataset inside self

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_filter_overview()
    +

    +
    -

    Arguments

    -

    filtered_dataset
    +

    Arguments +

    +

    +
    +
    +
    filtered_dataset

    comparison object, of the same class as self$get_dataset(), if NULL then self$get_dataset() is used.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (data.frame) matrix of observations and subjects

    -


    -

    Method get_keys()

    -

    Gets the keys for the dataset of this FilteredDataset

    -

    Usage

    -

    FilteredDataset$get_keys()

    +
    +

    +
    +
    +

    Method get_keys() +

    +

    Gets the keys for the dataset of this FilteredDataset

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_keys()
    +

    +
    -

    Returns

    +

    Returns +

    (character) the keys of dataset

    -


    -

    Method get_dataset_label()

    -

    Gets the dataset label

    -

    Usage

    -

    FilteredDataset$get_dataset_label()

    +
    +

    +
    +
    +

    Method get_dataset_label() +

    +

    Gets the dataset label

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_dataset_label()
    +

    +
    -

    Returns

    +

    Returns +

    (character) the dataset label

    -


    -

    Method ui_active()

    +
    +

    +
    +
    +

    Method ui_active() +

    UI module for dataset active filters

    UI module containing dataset active filters along with -title and remove button.

    -

    Usage

    -

    FilteredDataset$ui_active(id)

    +title and remove button.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$ui_active(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    identifier of the element - preferably containing dataset name

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    function - shiny UI module

    -


    -

    Method srv_active()

    +
    +

    +
    +
    +

    Method srv_active() +

    Server module for a dataset active filters

    -

    Server module managing a active filters.

    -

    Usage

    -

    FilteredDataset$srv_active(id)

    +

    Server module managing a active filters.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$srv_active(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    an ID string that corresponds with the ID used to call the module's UI function.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    moduleServer function which returns NULL

    -


    -

    Method ui_add()

    +
    +

    +
    +
    +

    Method ui_add() +

    +

    UI module to add filter variable for this dataset

    UI module to add filter variable for this dataset

    -

    UI module to add filter variable for this dataset

    -

    Usage

    -

    FilteredDataset$ui_add(id)

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$ui_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    identifier of the element - preferably containing dataset name

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    function - shiny UI module

    -


    -

    Method srv_add()

    +
    +

    +
    +
    +

    Method srv_add() +

    Server module to add filter variable for this dataset

    Server module to add filter variable for this dataset. For this class srv_add calls multiple modules of the same name from FilterStates as MAEFilteredDataset contains one FilterStates object for colData and one for each -experiment.

    -

    Usage

    -

    FilteredDataset$srv_add(id)

    +experiment.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$srv_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    an ID string that corresponds with the ID used to call the module's UI function.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    moduleServer function which returns NULL

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    FilteredDataset$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -501,17 +812,19 @@

    Arguments

    + +
    + +
    - - + + diff --git a/v0.4.0/reference/LogicalFilterState.html b/v0.4.0/reference/LogicalFilterState.html index b0e671f79..b1b33536b 100644 --- a/v0.4.0/reference/LogicalFilterState.html +++ b/v0.4.0/reference/LogicalFilterState.html @@ -1,8 +1,24 @@ - -FilterState object for logical variable — LogicalFilterState • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,40 +107,60 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterState -> LogicalFilterState

    +

    Inherited methods


    -

    Method new()

    -

    Initialize a FilterState object

    -

    Usage

    -

    LogicalFilterState$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterState object

    +
    +

    Usage +

    +

    +
    +
    LogicalFilterState$new(
       x,
       x_reactive = reactive(NULL),
       extract_type = character(0),
       slice
    -)

    +)
    +

    +
    -

    Arguments

    -

    x
    +

    Arguments +

    +

    +
    +
    +
    x

    (logical)
    values of the variable used in filter

    @@ -131,11 +174,15 @@

    Arguments varname in the condition call will be returned as <dataname>$<varname>

  • "matrix" varname in the condition call will be returned as <dataname>[, <varname>]

  • - + +
    slice
    @@ -151,45 +198,80 @@

    Arguments
    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection. For LogicalFilterState it's a !<varname> or <varname> and optionally -is.na(<varname>)

    -

    Usage

    -

    LogicalFilterState$get_call(dataname)

    +is.na(<varname>)

    +
    +

    Usage +

    +

    +
    +
    LogicalFilterState$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    name of data set; defaults to private$get_dataname()

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (call)

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    LogicalFilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    LogicalFilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -197,7 +279,8 @@

    Arguments -

    Examples

    +

    Examples +

    filter_state <- teal.slice:::LogicalFilterState$new(
       x = sample(c(TRUE, FALSE, NA), 10, replace = TRUE),
       slice = teal_slice(varname = "x", dataname = "data")
    @@ -279,17 +362,19 @@ 

    Examples

    + +
    + +

    - - + + diff --git a/v0.4.0/reference/MAEFilterStates.html b/v0.4.0/reference/MAEFilterStates.html index dea70ae11..58a986e67 100644 --- a/v0.4.0/reference/MAEFilterStates.html +++ b/v0.4.0/reference/MAEFilterStates.html @@ -1,8 +1,24 @@ - -FilterStates subclass for MultiAssayExperiments — MAEFilterStates • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,18 +108,25 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterStates -> MAEFilterStates

    -

    Methods

    +

    Methods +

    Inherited methods +
    +

    Inherited methods


    -

    Method new()

    +

    +
    +
    +

    Method new() +

    Initializes MAEFilterStates object

    -

    Initialize MAEFilterStates object

    -

    Usage

    -

    MAEFilterStates$new(
    +

    Initialize MAEFilterStates object

    +
    +

    Usage +

    +

    +
    +
    MAEFilterStates$new(
       data,
       data_reactive = function(sid = "") NULL,
       dataname,
       datalabel = "subjects",
       keys = character(0)
    -)

    +)
    +

    +
    -

    Arguments

    -

    data
    +

    Arguments +

    +

    +
    +
    +
    data

    (MultiAssayExperiment)
    the R object which MultiAssayExperiment::subsetByColData function is applied on.

    @@ -156,23 +200,41 @@

    Arguments
    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    MAEFilterStates$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    MAEFilterStates$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -180,17 +242,19 @@

    Arguments

    + +

    + +
    - - + + diff --git a/v0.4.0/reference/MAEFilteredDataset.html b/v0.4.0/reference/MAEFilteredDataset.html index a02acd1e4..c2eccc3fe 100644 --- a/v0.4.0/reference/MAEFilteredDataset.html +++ b/v0.4.0/reference/MAEFilteredDataset.html @@ -1,10 +1,26 @@ - -MAEFilteredDataset R6 class — MAEFilteredDataset • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + +
    @@ -87,22 +110,29 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilteredDataset -> MAEFilteredDataset

    +

    Inherited methods


    -

    Method new()

    -

    Initialize MAEFilteredDataset object

    -

    Usage

    -

    MAEFilteredDataset$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize MAEFilteredDataset object

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$new(
       dataset,
       dataname,
       keys = character(0),
       label = character(0),
       metadata = NULL
    -)

    +)
    +

    +
    -

    Arguments

    -

    dataset
    +

    Arguments +

    +

    +
    +
    +
    dataset

    (MulitiAssayExperiment)
    a single MultiAssayExperiment for which to define a subset

    @@ -157,19 +200,35 @@

    Arguments
    -

    Method set_filter_state()

    -

    Set filter state

    -

    Usage

    -

    MAEFilteredDataset$set_filter_state(state)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Set filter state

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$set_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (named list)
    names of the list should correspond to the names of the initialized FilterStates kept in private$filter_states. For this object they are "subjects" and @@ -177,15 +236,21 @@

    Arguments -

    Returns

    +

    Returns +

    NULL invisibly

    -

    Examples

    -

    utils::data(miniACC, package = "MultiAssayExperiment")
    +

    Examples +

    +

    +
    +
    utils::data(miniACC, package = "MultiAssayExperiment")
     dataset <- teal.slice:::MAEFilteredDataset$new(miniACC, "MAE")
     fs <- teal_slices(
       teal_slice(
    @@ -203,80 +268,143 @@ 

    Examples) dataset$set_filter_state(state = fs) shiny::isolate(dataset$get_filter_state()) -

    +
    +

    +
    -


    -

    Method remove_filter_state()

    -

    Remove one or more FilterState of a MAEFilteredDataset

    -

    Usage

    -

    MAEFilteredDataset$remove_filter_state(state)

    +
    +

    +
    +
    +

    Method remove_filter_state() +

    +

    Remove one or more FilterState of a MAEFilteredDataset

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$remove_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices)
    specifying FilterState objects to remove; teal_slices may contain only dataname and varname, other elements are ignored

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL invisibly

    -


    -

    Method ui_add()

    +
    +

    +
    +
    +

    Method ui_add() +

    +

    UI module to add filter variable for this dataset

    UI module to add filter variable for this dataset

    -

    UI module to add filter variable for this dataset

    -

    Usage

    -

    MAEFilteredDataset$ui_add(id)

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$ui_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    identifier of the element - preferably containing dataset name

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    function - shiny UI module

    -


    -

    Method get_filter_overview()

    -

    Get filter overview rows of a dataset

    -

    Usage

    -

    MAEFilteredDataset$get_filter_overview()

    +
    +

    +
    +
    +

    Method get_filter_overview() +

    +

    Get filter overview rows of a dataset

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$get_filter_overview()
    +

    +
    -

    Returns

    +

    Returns +

    (matrix) matrix of observations and subjects

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    MAEFilteredDataset$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -284,7 +412,8 @@

    Arguments -

    Examples

    +

    Examples +

    
     ## ------------------------------------------------
     ## Method `MAEFilteredDataset$set_filter_state`
    @@ -357,17 +486,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.4.0/reference/MatrixFilterStates.html b/v0.4.0/reference/MatrixFilterStates.html index e2fe22662..3e8fbb068 100644 --- a/v0.4.0/reference/MatrixFilterStates.html +++ b/v0.4.0/reference/MatrixFilterStates.html @@ -1,8 +1,24 @@ - -FilterStates subclass for matrices — MatrixFilterStates • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,18 +107,25 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterStates -> MatrixFilterStates

    -

    Methods

    +

    Methods +

    Inherited methods +
    +

    Inherited methods


    -

    Method new()

    +

    +
    +
    +

    Method new() +

    +

    Initialize MatrixFilterStates object

    Initialize MatrixFilterStates object

    -

    Initialize MatrixFilterStates object

    -

    Usage

    -

    MatrixFilterStates$new(
    +
    +

    Usage +

    +

    +
    +
    MatrixFilterStates$new(
       data,
       data_reactive = function(sid = "") NULL,
       dataname,
       datalabel = NULL
    -)

    +)
    +

    +
    -

    Arguments

    -

    data
    +

    Arguments +

    +

    +
    +
    +
    data

    (matrix)
    the R object which subset function is applied on.

    @@ -145,23 +188,41 @@

    Arguments
    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    MatrixFilterStates$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    MatrixFilterStates$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -169,17 +230,19 @@

    Arguments

    + +

    + +
    - - + + diff --git a/v0.4.0/reference/RangeFilterState.html b/v0.4.0/reference/RangeFilterState.html index ba7fe9b7c..2090eddf5 100644 --- a/v0.4.0/reference/RangeFilterState.html +++ b/v0.4.0/reference/RangeFilterState.html @@ -1,8 +1,24 @@ - -FilterState object for numeric variable — RangeFilterState • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,41 +107,61 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterState -> RangeFilterState

    +

    Inherited methods


    -

    Method new()

    -

    Initialize a FilterState object for range selection

    -

    Usage

    -

    RangeFilterState$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterState object for range selection

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$new(
       x,
       x_reactive = reactive(NULL),
       extract_type = character(0),
       slice
    -)

    +)
    +

    +
    -

    Arguments

    -

    x
    +

    Arguments +

    +

    +
    +
    +
    x

    (numeric)
    values of the variable used in filter

    @@ -132,11 +175,15 @@

    Arguments varname in the condition call will be returned as <dataname>$<varname>

  • "matrix" varname in the condition call will be returned as <dataname>[, <varname>]

  • - + +
    slice
    @@ -152,58 +199,104 @@

    Arguments
    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection. For this class returned call looks like <varname> >= <min value> & <varname> <= <max value> with -optional is.na(<varname>) and is.finite(<varname>).

    -

    Usage

    -

    RangeFilterState$get_call(dataname)

    +optional is.na(<varname>) and is.finite(<varname>).

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    name of data set; defaults to private$get_dataname()

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    (call)

    -


    -

    Method get_keep_inf()

    -

    Returns current keep_inf selection

    -

    Usage

    -

    RangeFilterState$get_keep_inf()

    +
    +

    +
    +
    +

    Method get_keep_inf() +

    +

    Returns current keep_inf selection

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$get_keep_inf()
    +

    +
    -

    Returns

    +

    Returns +

    (logical(1))

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    RangeFilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -211,7 +304,8 @@

    Arguments -

    Examples

    +

    Examples +

    filter_state <- teal.slice:::RangeFilterState$new(
       x = c(NA, Inf, seq(1:10)),
       slice = teal_slice(varname = "x", dataname = "data")
    @@ -322,17 +416,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.4.0/reference/SEFilterStates.html b/v0.4.0/reference/SEFilterStates.html index 02079a61a..232774085 100644 --- a/v0.4.0/reference/SEFilterStates.html +++ b/v0.4.0/reference/SEFilterStates.html @@ -1,8 +1,24 @@ - -FilterStates subclass for SummarizedExperiments — SEFilterStates • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +

    @@ -84,21 +108,28 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterStates -> SEFilterStates

    +

    Inherited methods


    -

    Method new()

    +

    +
    +
    +

    Method new() +

    Initialize SEFilterStates object

    -

    Initialize SEFilterStates object

    -

    Usage

    -

    SEFilterStates$new(
    +

    Initialize SEFilterStates object

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$new(
       data,
       data_reactive = function(sid = "") NULL,
       dataname,
       datalabel = NULL
    -)

    +)
    +

    +
    -

    Arguments

    -

    data
    +

    Arguments +

    +

    +
    +
    +
    data

    (SummarizedExperiment)
    the R object which subset function is applied on.

    @@ -145,91 +189,160 @@

    Arguments
    -

    Method set_filter_state()

    -

    Set filter state

    -

    Usage

    -

    SEFilterStates$set_filter_state(state)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Set filter state

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$set_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices)
    teal_slice objects should contain the field arg %in% c("subset", "select")

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL invisibly

    -


    -

    Method ui_add()

    -

    Shiny UI module to add filter variable

    -

    Usage

    -

    SEFilterStates$ui_add(id)

    +
    +

    +
    +
    +

    Method ui_add() +

    +

    Shiny UI module to add filter variable

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$ui_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    id of shiny module

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_add()

    +
    +

    +
    +
    +

    Method srv_add() +

    Shiny server module to add filter variable

    Module controls available choices to select as a filter variable. Selected filter variable is being removed from available choices. Removed filter variable gets back to available choices. This module unlike other FilterStates classes manages two sets of filter variables - one for colData and another for -rowData.

    -

    Usage

    -

    SEFilterStates$srv_add(id)

    +rowData.

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$srv_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1))
    an ID string that corresponds with the ID used to call the module's UI function.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    moduleServer function which returns NULL

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    SEFilterStates$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -237,17 +350,19 @@

    Arguments

    + +
    + +
    - - + + diff --git a/v0.4.0/reference/calls_combine_by.html b/v0.4.0/reference/calls_combine_by.html index 5e37cbcbf..90b70d4dc 100644 --- a/v0.4.0/reference/calls_combine_by.html +++ b/v0.4.0/reference/calls_combine_by.html @@ -1,8 +1,24 @@ - -Combine calls by operator — calls_combine_by • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +

    @@ -83,13 +105,16 @@
    -

    Usage

    +

    Usage +

    calls_combine_by(calls, operator)
    -

    Arguments

    -
    calls
    +

    Arguments +

    +
    +
    calls

    (list of calls)
    list containing calls to be combined by operator; if empty, NULL is returned

    @@ -99,9 +124,11 @@

    Arguments -

    Value

    +

    Value +

    call or NULL, if calls is an empty list

    @@ -113,7 +140,8 @@

    Value

    -

    Examples

    +

    Examples +

    calls <- list(
       quote(SEX == "F"), # subsetting on factor
       quote(AGE >= 20 & AGE <= 50), # subsetting on range
    @@ -125,17 +153,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.4.0/reference/check_ellipsis.html b/v0.4.0/reference/check_ellipsis.html index 6a7cee884..73ef9bc0c 100644 --- a/v0.4.0/reference/check_ellipsis.html +++ b/v0.4.0/reference/check_ellipsis.html @@ -1,12 +1,28 @@ - - + + + + + +Ensure the ellipsis, ..., in method arguments are empty — check_ellipsis • teal.slice +Ensure the ellipsis, ..., in method arguments are empty — check_ellipsis • teal.slice + + + + + + + + + + Skip to contents @@ -22,7 +38,8 @@ + +
    @@ -89,13 +111,16 @@
    -

    Usage

    +

    Usage +

    check_ellipsis(..., stop = FALSE, allowed_args = character(0))
    -

    Arguments

    -
    ...
    +

    Arguments +

    +
    +
    ...

    it should literally just be ...

    @@ -107,16 +132,19 @@

    Arguments -

    +

    +
    -

    Value

    +

    Value +

    NULL if ... is empty

    -

    Examples

    +

    Examples +

    method.class <- function(a, b, c, ...) {
       check_ellipsis(...)
     }
    @@ -126,17 +154,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.4.0/reference/check_simple_name.html b/v0.4.0/reference/check_simple_name.html index 529349c53..3457551e6 100644 --- a/v0.4.0/reference/check_simple_name.html +++ b/v0.4.0/reference/check_simple_name.html @@ -1,14 +1,30 @@ - - + + + + + +Whether the variable name is good to use within Show R Code — check_simple_name • teal.slice +Whether the variable name is good to use within Show R Code — check_simple_name • teal.slice + + + + + + + + + + Skip to contents @@ -24,7 +40,8 @@ + +
    @@ -92,19 +114,24 @@
    -

    Usage

    +

    Usage +

    check_simple_name(name)
    -

    Arguments

    -
    name
    +

    Arguments +

    +
    +
    name

    character, single or vector name to check

    -
    +

    +
    -

    Examples

    +

    Examples +

    teal.slice:::check_simple_name("aas2df")
     teal.slice:::check_simple_name("ADSL")
     teal.slice:::check_simple_name("ADSLmodified")
    @@ -120,17 +147,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.4.0/reference/choices_labeled.html b/v0.4.0/reference/choices_labeled.html index 37fd40332..645ce845f 100644 --- a/v0.4.0/reference/choices_labeled.html +++ b/v0.4.0/reference/choices_labeled.html @@ -1,10 +1,26 @@ - -Set "<choice>:<label>" type of Names — choices_labeled • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + +
    @@ -86,13 +108,16 @@
    -

    Usage

    +

    Usage +

    choices_labeled(choices, labels, subset = NULL, types = NULL)
    -

    Arguments

    -
    choices
    +

    Arguments +

    +
    +
    choices

    a character / numeric / logical vector

    @@ -110,31 +135,36 @@

    Arguments -

    Value

    +

    Value +

    a named character vector

    -

    Details

    +

    Details +

    If either choices or labels are factors, they are coerced to character. Duplicated elements from choices get removed.

    + +
    + +
    - - + + diff --git a/v0.4.0/reference/countBar.html b/v0.4.0/reference/countBar.html index ce8baead2..90eacd188 100644 --- a/v0.4.0/reference/countBar.html +++ b/v0.4.0/reference/countBar.html @@ -1,8 +1,24 @@ - -Progress bar with label — countBar • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,7 +105,8 @@
    -

    Usage

    +

    Usage +

    countBar(inputId, label, countmax, countnow = NULL, counttotal = countmax)
     
     updateCountBar(
    @@ -105,8 +128,10 @@ 

    Usage

    -

    Arguments

    -
    inputId
    +

    Arguments +

    +
    +
    inputId

    (character(1)) shiny id

    @@ -131,26 +156,30 @@

    Arguments -

    Value

    +

    Value +

    shiny.tag object with a progress bar and a label.

    + +
    + +
    - - + + diff --git a/v0.4.0/reference/countBars.html b/v0.4.0/reference/countBars.html index 3ab3c25ca..7065c825b 100644 --- a/v0.4.0/reference/countBars.html +++ b/v0.4.0/reference/countBars.html @@ -1,14 +1,30 @@ - - + + + + + +Progress bars with labels — countBars • teal.slice +Progress bars with labels — countBars • teal.slice + + + + + + + + + + Skip to contents @@ -24,7 +40,8 @@ + +
    @@ -92,7 +114,8 @@
    -

    Usage

    +

    Usage +

    countBars(inputId, choices, countsmax, countsnow = NULL)
     
     updateCountBars(
    @@ -105,8 +128,10 @@ 

    Usage

    -

    Arguments

    -
    inputId
    +

    Arguments +

    +
    +
    inputId

    (character(1)) shiny id

    @@ -127,9 +152,11 @@

    Arguments -

    Value

    +

    Value +

    list of shiny.tag

    @@ -138,7 +165,8 @@

    Value

    -

    Examples

    +

    Examples +

    
     choices <- sample(as.factor(c("a", "b", "c")), size = 20, replace = TRUE)
     counts <- table(choices)
    @@ -183,17 +211,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.4.0/reference/data_choices_labeled.html b/v0.4.0/reference/data_choices_labeled.html index bb133ff98..d7247c196 100644 --- a/v0.4.0/reference/data_choices_labeled.html +++ b/v0.4.0/reference/data_choices_labeled.html @@ -1,8 +1,24 @@ - -Returns a choices_labeled object — data_choices_labeled • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,7 +105,8 @@
    -

    Usage

    +

    Usage +

    data_choices_labeled(
       data,
       choices,
    @@ -93,8 +116,10 @@ 

    Usage

    -

    Arguments

    -
    data
    +

    Arguments +

    +
    +
    data

    (data.frame, DFrame, list)
    where labels can be taken from in case when varlabels is not specified. data must be specified if varlabels is not specified.

    @@ -114,26 +139,30 @@

    Arguments -

    Value

    +

    Value +

    character(0) if choices are empty; a choices_labeled object otherwise

    + +
    + + - - + + diff --git a/v0.4.0/reference/eval_expr_with_msg.html b/v0.4.0/reference/eval_expr_with_msg.html index bac31dd01..859d0b851 100644 --- a/v0.4.0/reference/eval_expr_with_msg.html +++ b/v0.4.0/reference/eval_expr_with_msg.html @@ -1,12 +1,28 @@ - - + + + + + +Evaluate expression with meaningful message — eval_expr_with_msg • teal.slice +Evaluate expression with meaningful message — eval_expr_with_msg • teal.slice + + + + + + + + + + Skip to contents @@ -22,7 +38,8 @@ + + @@ -89,39 +111,46 @@
    -

    Usage

    +

    Usage +

    eval_expr_with_msg(expr, env)
    -

    Arguments

    -
    expr
    +

    Arguments +

    +
    +
    expr

    (language)

    env

    (environment) where expression is evaluated.

    -
    + +
    -

    Value

    +

    Value +

    invisible NULL.

    + + + + - - + + diff --git a/v0.4.0/reference/fetch_bs_color.html b/v0.4.0/reference/fetch_bs_color.html index 93dffa182..44ff14b5c 100644 --- a/v0.4.0/reference/fetch_bs_color.html +++ b/v0.4.0/reference/fetch_bs_color.html @@ -1,8 +1,24 @@ - -Get hex code of the current Bootstrap theme color. — fetch_bs_color • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -83,13 +105,16 @@
    -

    Usage

    +

    Usage +

    fetch_bs_color(color, alpha = NULL)
    -

    Arguments

    -
    color
    +

    Arguments +

    +
    +
    color

    character(1) naming one of the available theme colors

    @@ -98,16 +123,19 @@

    Arguments -

    Value

    +

    Value +

    Named character(1) containing a hexadecimal color representation.

    -

    Examples

    +

    Examples +

    teal.slice:::fetch_bs_color("primary")
     #> [1] "#0d6efd"
     teal.slice:::fetch_bs_color("danger", 0.35)
    @@ -118,17 +146,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/v0.4.0/reference/filter_state_api.html b/v0.4.0/reference/filter_state_api.html index 2e70c2d37..01d629f4e 100644 --- a/v0.4.0/reference/filter_state_api.html +++ b/v0.4.0/reference/filter_state_api.html @@ -1,10 +1,26 @@ - -Managing FilteredData states — filter_state_api • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + @@ -86,7 +108,8 @@
    -

    Usage

    +

    Usage +

    set_filter_state(datasets, filter)
     
     get_filter_state(datasets)
    @@ -97,8 +120,10 @@ 

    Usage

    -

    Arguments

    -
    datasets
    +

    Arguments +

    +
    +
    datasets

    (FilteredData)
    object to store filter state and filtered datasets, shared across modules
    see FilteredData for details

    @@ -113,22 +138,28 @@

    Arguments -

    Value

    +

    Value +

    -
    • set_*, remove_* and clear_filter_state return NULL invisibly

    • +
        +
      • set_*, remove_* and clear_filter_state return NULL invisibly

      • get_filter_state returns a named teal_slices object containing a teal_slice for every existing FilterState

      • -
    + +
    -

    See also

    +

    See also +

    -

    Examples

    +

    Examples +

    utils::data(miniACC, package = "MultiAssayExperiment")
     
     datasets <- init_filtered_data(
    @@ -266,17 +297,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/v0.4.0/reference/get_default_slice_id.html b/v0.4.0/reference/get_default_slice_id.html index 4cd77c156..d4116df08 100644 --- a/v0.4.0/reference/get_default_slice_id.html +++ b/v0.4.0/reference/get_default_slice_id.html @@ -1,5 +1,10 @@ - - + + + + + +Default teal_slice id — get_default_slice_id • teal.slice +Default teal_slice id — get_default_slice_id • teal.slice + + + + + + + + + + Skip to contents @@ -40,7 +56,8 @@ + + @@ -104,48 +126,59 @@

    Function returns a default id for a teal_slice object which needs to be distinct from other teal_slice objects created for any FilterStates object. Returned id can be treated as a location of -a vector on which FilterState is built:

    • for a data.frame id concatenates dataname and varname.

    • +a vector on which FilterState is built:

      +
        +
      • for a data.frame id concatenates dataname and varname.

      • for a MultiAssayExperiment id concatenates dataname, varname, experiment and arg, so that one can add teal_slice for a varname which exists in multiple SummarizedExperiments or exists in both colData and rowData of given experiment. For such a vector teal.slice doesn't allow to activate more than one filters.

      • -
      +
    +
    -

    Usage

    +

    Usage +

    get_default_slice_id(x)
    -

    Arguments

    -
    x
    +

    Arguments +

    +
    +
    x

    (teal_slice or list)

    -
    + +
    -

    Value

    +

    Value +

    (character(1)) id for a teal_slice object.

    -

    Details

    +

    Details +

    In case of teal_slice_expr id is mandatory and must be unique.

    + + + + - - + + diff --git a/v0.4.0/reference/get_filter_expr.html b/v0.4.0/reference/get_filter_expr.html index 3f32e3109..ad2037e36 100644 --- a/v0.4.0/reference/get_filter_expr.html +++ b/v0.4.0/reference/get_filter_expr.html @@ -1,10 +1,26 @@ - -Gets filter expression for multiple datanames taking into account its order. — get_filter_expr • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + @@ -86,39 +108,46 @@
    -

    Usage

    +

    Usage +

    get_filter_expr(datasets, datanames = datasets$datanames())
    -

    Arguments

    -
    datasets
    +

    Arguments +

    +
    +
    datasets

    (FilteredData)

    datanames

    (character) vector of dataset names

    -
    + +
    -

    Value

    +

    Value +

    (expression)

    + + + + - - + + diff --git a/v0.4.0/reference/get_supported_filter_varnames.html b/v0.4.0/reference/get_supported_filter_varnames.html index 582652747..7641d408d 100644 --- a/v0.4.0/reference/get_supported_filter_varnames.html +++ b/v0.4.0/reference/get_supported_filter_varnames.html @@ -1,10 +1,26 @@ - -Gets supported filterable variable names — get_supported_filter_varnames • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + @@ -86,26 +108,32 @@
    -

    Usage

    +

    Usage +

    get_supported_filter_varnames(data)
    -

    Arguments

    -
    data
    +

    Arguments +

    +
    +
    data

    (object)
    the R object containing elements which class can be checked through vapply or apply.

    -
    + +
    -

    Value

    +

    Value +

    character vector of matched element names

    -

    Examples

    +

    Examples +

    df <- data.frame(
       a = letters[1:3],
       b = 1:3,
    @@ -118,17 +146,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/v0.4.0/reference/get_teal_bs_theme.html b/v0.4.0/reference/get_teal_bs_theme.html index 7d6a8f2e0..5899548d6 100644 --- a/v0.4.0/reference/get_teal_bs_theme.html +++ b/v0.4.0/reference/get_teal_bs_theme.html @@ -1,8 +1,24 @@ - -Resolve the expected bootstrap theme — get_teal_bs_theme • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -83,22 +105,25 @@
    -

    Usage

    +

    Usage +

    get_teal_bs_theme()
    - + + + + - - + + diff --git a/v0.4.0/reference/include_css_files.html b/v0.4.0/reference/include_css_files.html index 477962fba..7dc11eb63 100644 --- a/v0.4.0/reference/include_css_files.html +++ b/v0.4.0/reference/include_css_files.html @@ -1,12 +1,28 @@ - - + + + + + +Include CSS files from /inst/css/ package directory to application header — include_css_files • teal.slice +Include CSS files from /inst/css/ package directory to application header — include_css_files • teal.slice + + + + + + + + + + Skip to contents @@ -22,7 +38,8 @@ + + @@ -89,35 +111,42 @@
    -

    Usage

    +

    Usage +

    include_css_files(pattern = "*")
    -

    Arguments

    -
    pattern
    +

    Arguments +

    +
    +
    pattern

    (character) pattern of files to be included

    -
    + +
    -

    Value

    +

    Value +

    HTML code that includes CSS files

    + + + + - - + + diff --git a/v0.4.0/reference/include_js_files.html b/v0.4.0/reference/include_js_files.html index 239319797..0b6827bc3 100644 --- a/v0.4.0/reference/include_js_files.html +++ b/v0.4.0/reference/include_js_files.html @@ -1,12 +1,28 @@ - - + + + + + +Include JS files from /inst/js/ package directory to application header — include_js_files • teal.slice +Include JS files from /inst/js/ package directory to application header — include_js_files • teal.slice + + + + + + + + + + Skip to contents @@ -22,7 +38,8 @@ + + @@ -89,39 +111,46 @@
    -

    Usage

    +

    Usage +

    include_js_files(pattern)
    -

    Arguments

    -
    pattern
    +

    Arguments +

    +
    +
    pattern

    (character) pattern of files to be included, passed to system.file

    except

    (character) vector of basename filenames to be excluded

    -
    + +
    -

    Value

    +

    Value +

    HTML code that includes JS files

    + + + + - - + + diff --git a/v0.4.0/reference/index.html b/v0.4.0/reference/index.html index fec01eca9..eef50f450 100644 --- a/v0.4.0/reference/index.html +++ b/v0.4.0/reference/index.html @@ -1,8 +1,22 @@ - -Function reference • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -77,106 +97,145 @@
    -

    Teal filter-panel API

    +

    Teal filter-panel API +

    -

    Functions used initialize filter-panel and to modify its states.

    +

    +

    Functions used initialize filter-panel and to modify its states.

    -
    +
    +
    -
    +
    +
    init_filtered_data()
    -
    Initialize FilteredData
    -
    +
    Initialize FilteredData +
    +
    +
    +
    set_filter_state() get_filter_state() remove_filter_state() clear_filter_states()
    Managing FilteredData states
    -
    +
    +
    +
    get_filter_expr()
    Gets filter expression for multiple datanames taking into account its order.
    -
    +
    +
    +
    teal_slice() is.teal_slice() as.teal_slice() as.list(<teal_slice>) format(<teal_slice>) print(<teal_slice>)
    Specify single filter.
    -
    +
    +
    +
    teal_slices() is.teal_slices() as.teal_slices() as.list(<teal_slices>) `[`(<teal_slices>) c(<teal_slices>) format(<teal_slices>) print(<teal_slices>) list_to_teal_slices()
    Complete filter specification.
    -
    +
    +
    +
    slices_store()
    Store teal_slices object to a file
    -
    +
    +
    +
    slices_restore()
    Restore teal_slices object from a file
    -
    -

    For Developers

    + +
    +
    +

    For Developers +

    -

    Abstract and concrete classes used to build teal functionality.

    +

    +

    Abstract and concrete classes used to build teal functionality.

    -
    +
    +
    -

    R6 Classes

    -

    Abstract and concrete classes used to build teal functionality.

    +

    R6 Classes +

    +

    +

    Abstract and concrete classes used to build teal functionality.

    -
    +
    +
    -
    +
    +
    DefaultFilteredDataset
    The DefaultFilteredDataset R6 class
    -
    +
    +
    +
    FilteredData
    Class to encapsulate filtered datasets
    -
    +
    +
    +
    FilteredDataset
    -
    FilterStates R6 class
    -
    +
    +FilterStates R6 class
    +
    +
    +
    FilterPanelAPI
    Class to encapsulate the API of the filter panel of a teal app
    -
    +
    +
    +
    MAEFilteredDataset
    -
    MAEFilteredDataset R6 class
    -
    +
    +MAEFilteredDataset R6 class
    + + + + + + - - + + diff --git a/v0.4.0/reference/init_filter_state.html b/v0.4.0/reference/init_filter_state.html index 9881b3935..e1c19bfcb 100644 --- a/v0.4.0/reference/init_filter_state.html +++ b/v0.4.0/reference/init_filter_state.html @@ -1,8 +1,24 @@ - -Initializes FilterState — init_filter_state • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,7 +106,8 @@
    -

    Usage

    +

    Usage +

    init_filter_state(
       x,
       x_reactive = reactive(NULL),
    @@ -93,8 +117,10 @@ 

    Usage

    + +
    -

    Value

    +

    Value +

    FilterState object

    -

    Examples

    +

    Examples +

    filter_state <- teal.slice:::init_filter_state(
       x = c(1:10, NA, Inf),
       x_reactive = reactive(c(1:10, NA, Inf)),
    @@ -164,17 +197,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/v0.4.0/reference/init_filter_state_expr.html b/v0.4.0/reference/init_filter_state_expr.html index df7ed79d6..ea4765205 100644 --- a/v0.4.0/reference/init_filter_state_expr.html +++ b/v0.4.0/reference/init_filter_state_expr.html @@ -1,8 +1,24 @@ - -Initialize a FilterStateExpr object — init_filter_state_expr • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -83,13 +105,16 @@
    -

    Usage

    +

    Usage +

    init_filter_state_expr(slice)
    -

    Arguments

    -
    slice
    +

    Arguments +

    +
    +
    slice

    (teal_slice_expr)
    object created using teal_slice(). teal_slice is stored in the class and set_state directly manipulates values within teal_slice. get_state @@ -97,26 +122,30 @@

    Arguments -

    Value

    +

    Value +

    FilterStateExpr object

    + + + + - - + + diff --git a/v0.4.0/reference/init_filter_states.html b/v0.4.0/reference/init_filter_states.html index 4c0e876c2..fff544320 100644 --- a/v0.4.0/reference/init_filter_states.html +++ b/v0.4.0/reference/init_filter_states.html @@ -1,8 +1,24 @@ - -Initialize FilterStates object — init_filter_states • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -83,7 +105,8 @@
    -

    Usage

    +

    Usage +

    init_filter_states(
       data,
       data_reactive = reactive(NULL),
    @@ -94,8 +117,10 @@ 

    Usage

    -

    Arguments

    -
    data
    +

    Arguments +

    +
    +
    data

    (data.frame, MultiAssayExperiment, SummarizedExperiment, matrix)
    the R object which subset function is applied on.

    @@ -125,10 +150,12 @@

    Arguments -

    Examples

    +

    Examples +

    library(shiny)
     df <- data.frame(
       character = letters,
    @@ -162,17 +189,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/v0.4.0/reference/init_filtered_data.html b/v0.4.0/reference/init_filtered_data.html index 4010a76de..816fd1c69 100644 --- a/v0.4.0/reference/init_filtered_data.html +++ b/v0.4.0/reference/init_filtered_data.html @@ -1,8 +1,24 @@ - -Initialize FilteredData — init_filtered_data • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,20 +106,27 @@
    -

    Usage

    +

    Usage +

    init_filtered_data(x, join_keys, code, check)
    -

    Arguments

    -
    x
    -

    (named list or TealData) In case of TealData see teal.data::teal_data(). -If the list is provided, it should contain list(s) containing following fields:

    • dataset data object object supported by FilteredDataset.

    • +

      Arguments +

      +
      +
      x
      +
      +

      (named list or TealData) In case of TealData see teal.data::teal_data(). +If the list is provided, it should contain list(s) containing following fields:

      +
        +
      • dataset data object object supported by FilteredDataset.

      • metatada (optional) additional metadata attached to the dataset.

      • keys (optional) primary keys.

      • datalabel (optional) label describing the dataset.

      • parent (optional) which dataset is a parent of this one.

      • -
      +
    +
    join_keys
    @@ -110,10 +140,12 @@

    Arguments -

    Examples

    +

    Examples +

    library(shiny)
     datasets <- teal.slice::init_filtered_data(
       x = list(
    @@ -124,17 +156,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/v0.4.0/reference/init_filtered_dataset.html b/v0.4.0/reference/init_filtered_dataset.html index a6684825f..9180b8b44 100644 --- a/v0.4.0/reference/init_filtered_dataset.html +++ b/v0.4.0/reference/init_filtered_dataset.html @@ -1,8 +1,24 @@ - -Initializes FilteredDataset — init_filtered_dataset • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,7 +106,8 @@
    -

    Usage

    +

    Usage +

    init_filtered_dataset(
       dataset,
       dataname,
    @@ -97,8 +121,10 @@ 

    Usage

    -

    Arguments

    -
    dataset
    +

    Arguments +

    +
    +
    dataset

    (data.frame or MultiAssayExperiment)

    @@ -141,15 +167,18 @@

    Arguments -

    Note

    +

    Note +

    Although this function is exported for use in other packages, it may be changed or removed in a future release at which point any code which relies on this exported function will need to be changed.

    -

    Examples

    +

    Examples +

    # DefaultFilteredDataset example
     iris_fd <- teal.slice:::init_filtered_dataset(
       iris,
    @@ -214,17 +243,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.4.0/reference/jsonify.html b/v0.4.0/reference/jsonify.html index c1be431ce..97f338445 100644 --- a/v0.4.0/reference/jsonify.html +++ b/v0.4.0/reference/jsonify.html @@ -1,12 +1,28 @@ - - + + + + + +Convert a list to a justified JSON string — jsonify • teal.slice +Convert a list to a justified JSON string — jsonify • teal.slice + + + + + + + + + + Skip to contents @@ -22,7 +38,8 @@ + + @@ -89,39 +111,46 @@
    -

    Usage

    +

    Usage +

    jsonify(x, trim_lines)
    -

    Arguments

    -
    x
    +

    Arguments +

    +
    +
    x

    (list), possibly recursive, obtained from teal_slice or teal_slices.

    trim_lines

    (logical(1)) flag specifying whether to trim lines of the JSON string.

    -
    + +
    -

    Value

    +

    Value +

    A JSON string representation of the input list.

    + + + + - - + + diff --git a/v0.4.0/reference/justify_json.html b/v0.4.0/reference/justify_json.html index aca3bfa97..f2aa817ad 100644 --- a/v0.4.0/reference/justify_json.html +++ b/v0.4.0/reference/justify_json.html @@ -1,10 +1,26 @@ - -Justify Colons in JSON String — justify_json • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + @@ -86,35 +108,42 @@
    -

    Usage

    +

    Usage +

    justify_json(json)
    -

    Arguments

    -
    json
    +

    Arguments +

    +
    +
    json

    (character(1)) a JSON string.

    -
    + +
    -

    Value

    +

    Value +

    A list of character strings, which can be collapsed into a JSON string.

    + + + + - - + + diff --git a/v0.4.0/reference/make_c_call.html b/v0.4.0/reference/make_c_call.html index 12c4b1dfb..75a62427c 100644 --- a/v0.4.0/reference/make_c_call.html +++ b/v0.4.0/reference/make_c_call.html @@ -1,12 +1,28 @@ - -This function takes a vector of values and returns a c call. If the vector -has only one element, the element is returned directly. — make_c_call • teal.slice + + + + + + + + Skip to contents @@ -22,7 +38,8 @@ + + @@ -89,25 +111,31 @@
    -

    Usage

    +

    Usage +

    make_c_call(choices)
    -

    Arguments

    -
    choices
    +

    Arguments +

    +
    +
    choices

    A vector of values.

    -
    + +
    -

    Value

    +

    Value +

    A c call.

    -

    Examples

    +

    Examples +

    teal.slice:::make_c_call(1:3)
     #> c(1L, 2L, 3L)
     # [1] 1 2 3
    @@ -118,17 +146,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/v0.4.0/reference/make_count_text.html b/v0.4.0/reference/make_count_text.html index 513f5aff6..3f106ec7d 100644 --- a/v0.4.0/reference/make_count_text.html +++ b/v0.4.0/reference/make_count_text.html @@ -1,16 +1,32 @@ - - + + + + + +Make a count text — make_count_text • teal.slice +Make a count text — make_count_text • teal.slice + + + + + + + + + + Skip to contents @@ -26,7 +42,8 @@ + + @@ -87,18 +109,24 @@
    -

    Returns a text describing filtered counts. The text is composed in the following way:

    • when countnow is not NULL: <label> (<countnow>/<countmax>)

    • +

      Returns a text describing filtered counts. The text is composed in the following way:

      +
        +
      • when countnow is not NULL: <label> (<countnow>/<countmax>)

      • when countnow is NULL: <label> (<countmax>)

      • -
    + +
    -

    Usage

    +

    Usage +

    make_count_text(label, countmax, countnow = NULL)
    -

    Arguments

    -
    label
    +

    Arguments +

    +
    +
    label

    (character(1)) Text displayed before counts

    @@ -109,9 +137,11 @@

    Arguments -

    Value

    +

    Value +

    character(1)

    @@ -120,17 +150,19 @@

    Value

    + + + + - - + + diff --git a/v0.4.0/reference/setdiff_teal_slices.html b/v0.4.0/reference/setdiff_teal_slices.html index 3adef411a..7299e8684 100644 --- a/v0.4.0/reference/setdiff_teal_slices.html +++ b/v0.4.0/reference/setdiff_teal_slices.html @@ -1,8 +1,24 @@ - -setdiff method for teal_slices — setdiff_teal_slices • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,18 +107,23 @@
    -

    Usage

    +

    Usage +

    setdiff_teal_slices(x, y)
    -

    Arguments

    -
    x, y
    +

    Arguments +

    +
    +
    x, y

    teal_slices objects

    -
    + +
    -

    Value

    +

    Value +

    teal_slices

    @@ -103,17 +132,19 @@

    Value

    + + + + - - + + diff --git a/v0.4.0/reference/slices_restore.html b/v0.4.0/reference/slices_restore.html index 3a108e8da..18abcb360 100644 --- a/v0.4.0/reference/slices_restore.html +++ b/v0.4.0/reference/slices_restore.html @@ -1,12 +1,28 @@ - - + + + + + +Restore teal_slices object from a file — slices_restore • teal.slice +Restore teal_slices object from a file — slices_restore • teal.slice + + + + + + + + + + Skip to contents @@ -22,7 +38,8 @@ + + @@ -89,25 +111,31 @@
    -

    Usage

    +

    Usage +

    slices_restore(file)
    -

    Arguments

    -
    file
    +

    Arguments +

    +
    +
    file

    Path to file where teal_slices is stored. Must have a .json extension and read access.

    -
    + +
    -

    Value

    +

    Value +

    A teal_slices object restored from the file.

    -

    Examples

    +

    Examples +

    if (interactive()) {
       # Restore a teal_slices object from a file
       tss_restored <- slices_restore("path/to/file.json")
    @@ -115,17 +143,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/v0.4.0/reference/slices_store.html b/v0.4.0/reference/slices_store.html index a00cbdd5d..f43590e4c 100644 --- a/v0.4.0/reference/slices_store.html +++ b/v0.4.0/reference/slices_store.html @@ -1,14 +1,30 @@ - - + + + + + +Store teal_slices object to a file — slices_store • teal.slice +Store teal_slices object to a file — slices_store • teal.slice + + + + + + + + + + Skip to contents @@ -24,7 +40,8 @@ + + @@ -92,13 +114,16 @@
    -

    Usage

    +

    Usage +

    slices_store(tss, file)
    -

    Arguments

    -
    tss
    +

    Arguments +

    +
    +
    tss

    (teal_slices) object to be stored.

    @@ -106,16 +131,19 @@

    Arguments.

    -

    + +
    -

    Value

    +

    Value +

    NULL, invisibly.

    -

    Examples

    +

    Examples +

    # Create a teal_slices object
     tss <- teal_slices(
       teal_slice(dataname = "data", varname = "var"),
    @@ -130,17 +158,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/v0.4.0/reference/teal.slice-package.html b/v0.4.0/reference/teal.slice-package.html index 2d400ab41..5acbe0c79 100644 --- a/v0.4.0/reference/teal.slice-package.html +++ b/v0.4.0/reference/teal.slice-package.html @@ -1,8 +1,24 @@ - -teal.slice: Interactive Exploration of Clinical Trials Data — teal.slice-package • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -84,9 +106,12 @@
    -

    Author

    +

    Author +

    Maintainer: Dawid Kaledkowski dawid.kaledkowski@roche.com

    -

    Authors:

    + + - + + + + - - + + diff --git a/v0.4.0/reference/teal_slice.html b/v0.4.0/reference/teal_slice.html index fef9f9ccf..a0146be8e 100644 --- a/v0.4.0/reference/teal_slice.html +++ b/v0.4.0/reference/teal_slice.html @@ -1,8 +1,24 @@ - -Specify single filter. — teal_slice • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -83,7 +105,8 @@
    -

    Usage

    +

    Usage +

    teal_slice(
       dataname,
       varname,
    @@ -115,8 +138,10 @@ 

    Usage

    -

    Arguments

    -
    dataname
    +

    Arguments +

    +
    +
    dataname

    (character(1)) name of data set

    @@ -189,16 +214,19 @@

    Arguments -

    Value

    +

    Value +

    A teal.slice object. Depending on whether varname or expr was specified, the resulting teal_slice also receives class teal_slice_var or teal_slice_expr, respectively.

    -

    Details

    +

    Details +

    teal_slice object fully describes filter state and can be used to create, modify, and delete a filter state. A teal_slice contains a number of common fields (all named arguments of teal_slice), some of which are mandatory, but only @@ -207,7 +235,9 @@

    DetailsSetting any of the other values to NULL means that those properties will not be modified (when setting an existing state) or that they will be determined by data (when creating new a new one). Entire object is FilterState class member and can be accessed with FilterState$get_state().

    -

    A teal_slice can come in two flavors:

    1. teal_slice_var - +

      A teal_slice can come in two flavors:

      +
        +
      1. teal_slice_var - this describes a typical interactive filter that refers to a single variable, managed by the FilterState class. This class is created when varname is specified. The object retains all fields specified in the call. id` can be created by default and need not be specified.

      2. teal_slice_expr - @@ -216,7 +246,8 @@

        Detailsexpr is specified. dataname and anchored are retained, fixed is set to TRUE, id becomes mandatory, title remains optional, while other arguments are disregarded.

      3. -

      A teal_slice can be passed FilterState/FilterStateExpr constructors to instantiate an object. +

    +

    A teal_slice can be passed FilterState/FilterStateExpr constructors to instantiate an object. It can also be passed to FilterState$set_state to modify the state. However, once a FilterState is created, only the mutable features can be set with a teal_slice: selected, keep_na and keep_inf.

    @@ -228,7 +259,8 @@

    DetailsFilterState instantiated with anchored = TRUE cannot be removed.

    -

    Filters in SumarizedExperiment and MultiAssayExperiment objects

    +

    Filters in SumarizedExperiment and MultiAssayExperiment objects +

    @@ -242,12 +274,14 @@

    Filters in order to determine whether the filter refers to the SE's rowData or colData.

    -

    See also

    +

    See also +

    -

    Examples

    +

    Examples +

    x1 <- teal_slice(
       dataname = "data",
       id = "Female adults",
    @@ -324,17 +358,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/v0.4.0/reference/teal_slices.html b/v0.4.0/reference/teal_slices.html index 312e73606..2a45a63fc 100644 --- a/v0.4.0/reference/teal_slices.html +++ b/v0.4.0/reference/teal_slices.html @@ -1,8 +1,24 @@ - -Complete filter specification. — teal_slices • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -83,7 +105,8 @@
    -

    Usage

    +

    Usage +

    teal_slices(
       ...,
       exclude_varnames = NULL,
    @@ -115,8 +138,10 @@ 

    Usage

    -

    Arguments

    -
    ...
    +

    Arguments +

    +
    +
    ...

    any number of teal_slice objects. For print and format, additional arguments passed to other functions.

    @@ -128,13 +153,17 @@

    Arguments[Experimental] This is a new feature. Do kindly share your opinions.
    +
    +

    [Experimental] This is a new feature. Do kindly share your opinions.
    (character(1)) string specifying how observations are tallied by these filter states. -Possible options:

    • "none" (default) to have counts of single FilterState to show unfiltered number only.

    • +Possible options:

      +
        +
      • "none" (default) to have counts of single FilterState to show unfiltered number only.

      • "all" to have counts of single FilterState to show number of observation in filtered and unfiltered dataset. Note, that issues were reported when using this option with MultiAssayExperiment. Please make sure that adding new filters doesn't fail on target platform before deploying for production.

      • -
    + +
    allow_add
    @@ -160,15 +189,18 @@

    Arguments -

    Value

    +

    Value +

    teal_slices, which is an unnamed list of teal_slice objects.

    -

    Details

    +

    Details +

    teal_slices() collates multiple teal_slice objects into a teal_slices object, a complete filter specification. This is used by all classes above FilterState as well as filter_panel_api wrapper functions. @@ -179,12 +211,14 @@

    Detailsteal_slices.

    -

    See also

    +

    See also +

    -

    Examples

    +

    Examples +

    filter_1 <- teal_slice(
       dataname = "dataname1",
       varname = "varname1",
    @@ -397,17 +431,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/v0.4.0/reference/to_json.html b/v0.4.0/reference/to_json.html index ea9f082a7..3460a77f8 100644 --- a/v0.4.0/reference/to_json.html +++ b/v0.4.0/reference/to_json.html @@ -1,12 +1,28 @@ - - + + + + + +Converts a list to a JSON string — to_json • teal.slice +Converts a list to a JSON string — to_json • teal.slice + + + + + + + + + + Skip to contents @@ -22,7 +38,8 @@ + + @@ -89,35 +111,42 @@
    -

    Usage

    +

    Usage +

    to_json(x)
    -

    Arguments

    -
    x
    +

    Arguments +

    +
    +
    x

    (list) representation of teal_slices object.

    -
    + +
    -

    Value

    +

    Value +

    A JSON string.

    + + + + - - + + diff --git a/v0.4.0/reference/toggle_button.html b/v0.4.0/reference/toggle_button.html index 91c926c06..b7360911b 100644 --- a/v0.4.0/reference/toggle_button.html +++ b/v0.4.0/reference/toggle_button.html @@ -1,8 +1,24 @@ - -Toggle button properties. — toggle_button • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -83,15 +105,18 @@
    -

    Usage

    +

    Usage +

    toggle_icon(input_id, icons, one_way = FALSE)
     
     toggle_title(input_id, titles, one_way = FALSE)
    -

    Arguments

    -
    input_id
    +

    Arguments +

    +
    +
    input_id

    character(1) (name-spaced) id of the button

    @@ -104,15 +129,18 @@

    Arguments -

    Value

    +

    Value +

    Invisible NULL.

    -

    Details

    +

    Details +

    Wrapper functions that use shinyjs::runjs to change button properties in response to events, typically clicking those very buttons. shiny's actionButton and actionLink create <a> tags, @@ -123,7 +151,8 @@

    Details
    -

    Examples

    +

    Examples +

    library(shiny)
     
     ui <- fluidPage(
    @@ -174,17 +203,19 @@ 

    Examples

    + +

    + + - - + + diff --git a/v0.4.0/reference/topological_sort.html b/v0.4.0/reference/topological_sort.html index 6728aa426..7b16f123f 100644 --- a/v0.4.0/reference/topological_sort.html +++ b/v0.4.0/reference/topological_sort.html @@ -1,10 +1,26 @@ - -Topological graph sort — topological_sort • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + @@ -86,23 +108,29 @@
    -

    Usage

    +

    Usage +

    topological_sort(graph)
    -

    Arguments

    -
    graph
    +

    Arguments +

    +
    +
    graph

    (named list) list with node vector elements

    -
    + +
    -

    Details

    +

    Details +

    Implementation of Kahn algorithm with a modification to maintain the order of input elements.

    -

    Examples

    +

    Examples +

    teal.slice:::topological_sort(list(A = c(), B = c("A"), C = c("B"), D = c("A")))
     #> [[1]]
     #> [1] "A"
    @@ -145,17 +173,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/v0.4.0/reference/trim_lines_json.html b/v0.4.0/reference/trim_lines_json.html index f2a9ed27a..0f6aa3ff2 100644 --- a/v0.4.0/reference/trim_lines_json.html +++ b/v0.4.0/reference/trim_lines_json.html @@ -1,10 +1,26 @@ - -Trim Lines in JSON String — trim_lines_json • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + @@ -86,35 +108,42 @@
    -

    Usage

    +

    Usage +

    trim_lines_json(x)
    -

    Arguments

    -
    x
    +

    Arguments +

    +
    +
    x

    A character string.

    -
    + +
    -

    Value

    +

    Value +

    A character string trimmed after a certain hard-coded number of characters in the value portion.

    + + + + - - + + diff --git a/v0.4.0/reference/validate_dataset_args.html b/v0.4.0/reference/validate_dataset_args.html index 772a7461e..268ed4f3e 100644 --- a/v0.4.0/reference/validate_dataset_args.html +++ b/v0.4.0/reference/validate_dataset_args.html @@ -1,8 +1,24 @@ - -Validate dataset arguments — validate_dataset_args • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -83,13 +105,16 @@
    -

    Usage

    +

    Usage +

    validate_dataset_args(dataset_args, dataname)
    -

    Arguments

    -
    dataset_args
    +

    Arguments +

    +
    +
    dataset_args

    (list)
    containing the arguments except (dataname) needed by init_filtered_dataset

    @@ -99,26 +124,30 @@

    Arguments -

    Value

    +

    Value +

    (NULL or raises an error)

    + + + + - - + + diff --git a/v0.4.0/reference/variable_types.html b/v0.4.0/reference/variable_types.html index 28b410f85..67b1aa951 100644 --- a/v0.4.0/reference/variable_types.html +++ b/v0.4.0/reference/variable_types.html @@ -1,8 +1,24 @@ - -Get classes of selected columns from dataset — variable_types • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -83,13 +105,16 @@
    -

    Usage

    +

    Usage +

    variable_types(data, columns = NULL)
    -

    Arguments

    -
    data
    +

    Arguments +

    +
    +
    data

    (data.frame) data to determine variable types from

    @@ -97,9 +122,11 @@

    Arguments -

    Value

    +

    Value +

    (atomic vector of character) classes of columns from provided data

    @@ -108,7 +135,8 @@

    Value

    -

    Examples

    +

    Examples +

    teal.slice:::variable_types(
       data.frame(
         x = 1:3, y = factor(c("a", "b", "a")), z = c("h1", "h2", "h3"),
    @@ -137,17 +165,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/v0.5.0-rc1/404.html b/v0.5.0-rc1/404.html index dc08a432f..fcdbaecd5 100644 --- a/v0.5.0-rc1/404.html +++ b/v0.5.0-rc1/404.html @@ -1,5 +1,4 @@ - - + @@ -50,22 +49,7 @@ - - + - + + diff --git a/v0.5.0-rc1/CODE_OF_CONDUCT.html b/v0.5.0-rc1/CODE_OF_CONDUCT.html index 48b600d38..708fe1e78 100644 --- a/v0.5.0-rc1/CODE_OF_CONDUCT.html +++ b/v0.5.0-rc1/CODE_OF_CONDUCT.html @@ -1,8 +1,22 @@ - -Contributor Covenant Code of Conduct • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -80,65 +100,80 @@
    -

    Our Pledge

    +

    Our Pledge +

    We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.

    We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.

    -

    Our Standards

    +

    Our Standards +

    Examples of behavior that contributes to a positive environment for our community include:

    -
    • Demonstrating empathy and kindness toward other people
    • +
        +
      • Demonstrating empathy and kindness toward other people
      • Being respectful of differing opinions, viewpoints, and experiences
      • Giving and gracefully accepting constructive feedback
      • Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
      • Focusing on what is best not just for us as individuals, but for the overall community
      • -

      Examples of unacceptable behavior include:

      -
      • The use of sexualized language or imagery, and sexual attention or advances of any kind
      • +
      +

      Examples of unacceptable behavior include:

      +
        +
      • The use of sexualized language or imagery, and sexual attention or advances of any kind
      • Trolling, insulting or derogatory comments, and personal or political attacks
      • Public or private harassment
      • Publishing others’ private information, such as a physical or email address, without their explicit permission
      • Other conduct which could reasonably be considered inappropriate in a professional setting
      • -
    + +
    -

    Enforcement Responsibilities

    +

    Enforcement Responsibilities +

    Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.

    Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.

    -

    Scope

    +

    Scope +

    This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.

    -

    Enforcement

    +

    Enforcement +

    Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [INSERT CONTACT METHOD]. All complaints will be reviewed and investigated promptly and fairly.

    All community leaders are obligated to respect the privacy and security of the reporter of any incident.

    -

    Enforcement Guidelines

    +

    Enforcement Guidelines +

    Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:

    -

    1. Correction

    +

    1. Correction +

    Community Impact: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.

    Consequence: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.

    -

    2. Warning

    +

    2. Warning +

    Community Impact: A violation through a single incident or series of actions.

    Consequence: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.

    -

    3. Temporary Ban

    +

    3. Temporary Ban +

    Community Impact: A serious violation of community standards, including sustained inappropriate behavior.

    Consequence: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.

    -

    4. Permanent Ban

    +

    4. Permanent Ban +

    Community Impact: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.

    Consequence: A permanent ban from any sort of public interaction within the community.

    -

    Attribution

    +

    Attribution +

    This Code of Conduct is adapted from the Contributor Covenant, version 2.1, available at https://www.contributor-covenant.org/version/2/1/code_of_conduct.html.

    Community Impact Guidelines were inspired by Mozilla’s code of conduct enforcement ladder.

    For answers to common questions about this code of conduct, see the FAQ at https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.

    @@ -146,17 +181,19 @@

    Attribution

    + + + + - - + + diff --git a/v0.5.0-rc1/CONTRIBUTING.html b/v0.5.0-rc1/CONTRIBUTING.html index d45c1dd7e..88ea8a9c8 100644 --- a/v0.5.0-rc1/CONTRIBUTING.html +++ b/v0.5.0-rc1/CONTRIBUTING.html @@ -1,8 +1,22 @@ - -Contribution Guidelines • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -82,7 +102,8 @@

    🙏 Thank you for taking the time to contribute!

    Your input is deeply valued, whether an issue, a pull request, or even feedback, regardless of size, content or scope.

    -

    Table of contents

    +

    Table of contents +

    👶 Getting started

    📔 Code of Conduct

    🗃 License

    @@ -93,38 +114,47 @@

    Table of contents❓ Questions

    -

    Getting started

    +

    Getting started +

    Please refer the project documentation for a brief introduction. Please also see other articles within the project documentation for additional information.

    -

    Code of Conduct

    +

    Code of Conduct +

    A Code of Conduct governs this project. Participants and contributors are expected to follow the rules outlined therein.

    -

    License

    +

    License +

    All your contributions will be covered by this project’s license.

    -

    Issues

    +

    Issues +

    We use GitHub to track issues, feature requests, and bugs. Before submitting a new issue, please check if the issue has already been reported. If the issue already exists, please upvote the existing issue 👍.

    For new feature requests, please elaborate on the context and the benefit the feature will have for users, developers, or other relevant personas.

    -

    Pull requests

    +

    Pull requests +

    -

    GitHub Flow

    +

    GitHub Flow +

    This repository uses the GitHub Flow model for collaboration. To submit a pull request:

    -
    1. +
        +
      1. Create a branch

        Please see the branch naming convention below. If you don’t have write access to this repository, please fork it.

      2. Make changes

        Make sure your code

        -
        • passes all checks imposed by GitHub Actions
        • +
            +
          • passes all checks imposed by GitHub Actions
          • is well documented
          • is well tested with unit tests sufficiently covering the changes introduced
          • -
          +
        +
      3. Create a pull request (PR)

        In the pull request description, please link the relevant issue (if any), provide a detailed description of the change, and include any assumptions.

        @@ -138,76 +168,93 @@

        GitHub Flow -

        Branch naming convention

        +

        Branch naming convention +

        Suppose your changes are related to a current issue in the current project; please name your branch as follows: <issue_id>_<short_description>. Please use underscore (_) as a delimiter for word separation. For example, 420_fix_ui_bug would be a suitable branch name if your change is resolving and UI-related bug reported in issue number 420 in the current project.

        If your change affects multiple repositories, please name your branches as follows: <issue_id>_<issue_repo>_<short description>. For example, 69_awesomeproject_fix_spelling_error would reference issue 69 reported in project awesomeproject and aims to resolve one or more spelling errors in multiple (likely related) repositories.

    monorepo and staged.dependencies -

    + +

    Sometimes you might need to change upstream dependent package(s) to be able to submit a meaningful change. We are using staged.dependencies functionality to simulate a monorepo behavior. The dependency configuration is already specified in this project’s staged_dependencies.yaml file. You need to name the feature branches appropriately. This is the only exception from the branch naming convention described above.

    Please refer to the staged.dependencies package documentation for more details.

    -

    Coding guidelines

    +

    Coding guidelines +

    This repository follows some unified processes and standards adopted by its maintainers to ensure software development is carried out consistently within teams and cohesively across other repositories.

    -

    Style guide

    +

    Style guide +

    This repository follows the standard tidyverse style guide and uses lintr for lint checks. Customized lint configurations are available in this repository’s .lintr file.

    -

    Dependency management

    +

    Dependency management +

    Lightweight is the right weight. This repository follows tinyverse recommendations of limiting dependencies to minimum.

    -

    Dependency version management

    +

    Dependency version management +

    If the code is not compatible with all (!) historical versions of a given dependency package, it is required to specify minimal version in the DESCRIPTION file. In particular: if the development version requires (imports) the development version of another package - it is required to put abc (>= 1.2.3.9000).

    - +
    -

    R & package versions

    +

    R & package versions +

    We continuously test our packages against the newest R version along with the most recent dependencies from CRAN and BioConductor. We recommend that your working environment is also set up in the same way. You can find the details about the R version and packages used in the R CMD check GitHub Action execution log - there is a step that prints out the R sessionInfo().

    If you discover bugs on older R versions or with an older set of dependencies, please create the relevant bug reports.

    -

    pre-commit

    +

    +pre-commit +

    We highly recommend that you use the pre-commit tool combined with R hooks for pre-commit to execute some of the checks before committing and pushing your changes.

    Pre-commit hooks are already available in this repository’s .pre-commit-config.yaml file.

    -

    Recognition model

    +

    Recognition model +

    As mentioned previously, all contributions are deeply valued and appreciated. While all contribution data is available as part of the repository insights, to recognize a significant contribution and hence add the contributor to the package authors list, the following rules are enforced:

    -
    • Minimum 5% of lines of code authored* (determined by git blame query) OR
    • +
        +
      • Minimum 5% of lines of code authored* (determined by git blame query) OR
      • Being at the top 5 contributors in terms of number of commits OR lines added OR lines removed*
      • -

      *Excluding auto-generated code, including but not limited to roxygen comments or renv.lock files.

      +
    +

    *Excluding auto-generated code, including but not limited to roxygen comments or renv.lock files.

    The package maintainer also reserves the right to adjust the criteria to recognize contributions.

    -

    Questions

    +

    Questions +

    If you have further questions regarding the contribution guidelines, please contact the package/repository maintainer.

    + + + + - - + + diff --git a/v0.5.0-rc1/LICENSE-text.html b/v0.5.0-rc1/LICENSE-text.html index 7e1cddc69..fddd23a9d 100644 --- a/v0.5.0-rc1/LICENSE-text.html +++ b/v0.5.0-rc1/LICENSE-text.html @@ -1,8 +1,22 @@ - -License • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -92,17 +112,19 @@ limitations under the License. - + + + + - - + + diff --git a/v0.5.0-rc1/SECURITY.html b/v0.5.0-rc1/SECURITY.html index 9bffcc734..17df7f543 100644 --- a/v0.5.0-rc1/SECURITY.html +++ b/v0.5.0-rc1/SECURITY.html @@ -1,8 +1,22 @@ - -Security Policy • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -80,38 +100,44 @@
    -

    Reporting Security Issues

    +

    Reporting Security Issues +

    If you believe you have found a security vulnerability in any of the repositories in this organization, please report it to us through coordinated disclosure.

    Please do not report security vulnerabilities through public GitHub issues, discussions, or pull requests.

    Instead, please send an email to vulnerability.management[@]roche.com.

    Please include as much of the information listed below as you can to help us better understand and resolve the issue:

    -
    • The type of issue (e.g., buffer overflow, SQL injection, or cross-site scripting)
    • +
        +
      • The type of issue (e.g., buffer overflow, SQL injection, or cross-site scripting)
      • Full paths of source file(s) related to the manifestation of the issue
      • The location of the affected source code (tag/branch/commit or direct URL)
      • Any special configuration required to reproduce the issue
      • Step-by-step instructions to reproduce the issue
      • Proof-of-concept or exploit code (if possible)
      • Impact of the issue, including how an attacker might exploit the issue
      • -

      This information will help us triage your report more quickly.

      +
    +

    This information will help us triage your report more quickly.

    -

    Data Security Standards (DSS)

    +

    Data Security Standards (DSS) +

    Please make sure that while reporting issues in the form a bug, feature, or pull request, all sensitive information such as PII, PHI, and PCI is completely removed from any text and attachments, including pictures and videos.

    + + + + - - + + diff --git a/v0.5.0-rc1/articles/filter-panel-for-developers.html b/v0.5.0-rc1/articles/filter-panel-for-developers.html index 907959782..08a4b12c4 100644 --- a/v0.5.0-rc1/articles/filter-panel-for-developers.html +++ b/v0.5.0-rc1/articles/filter-panel-for-developers.html @@ -1,5 +1,4 @@ - - + @@ -52,22 +51,7 @@ - - + - + + diff --git a/v0.5.0-rc1/articles/index.html b/v0.5.0-rc1/articles/index.html index a9eed9c9e..71743b070 100644 --- a/v0.5.0-rc1/articles/index.html +++ b/v0.5.0-rc1/articles/index.html @@ -1,8 +1,22 @@ - -Articles • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -80,24 +100,31 @@

    All vignettes

    -
    Filter Panel for Developers
    +
    +
    Filter Panel for Developers
    -
    teal.slice Classes
    + +
    teal.slice Classes
    -
    Introduction to teal.slice
    + +
    Introduction to teal.slice
    -
    - + +
    + + + + + - - + + diff --git a/v0.5.0-rc1/articles/teal-slice-classes.html b/v0.5.0-rc1/articles/teal-slice-classes.html index 333c6dcd8..f299bc1ec 100644 --- a/v0.5.0-rc1/articles/teal-slice-classes.html +++ b/v0.5.0-rc1/articles/teal-slice-classes.html @@ -1,5 +1,4 @@ - - + @@ -52,22 +51,7 @@ - - + - + + diff --git a/v0.5.0-rc1/articles/teal-slice.html b/v0.5.0-rc1/articles/teal-slice.html index c82db111b..56cfda82b 100644 --- a/v0.5.0-rc1/articles/teal-slice.html +++ b/v0.5.0-rc1/articles/teal-slice.html @@ -1,5 +1,4 @@ - - + @@ -52,22 +51,7 @@ - - + - + + diff --git a/v0.5.0-rc1/authors.html b/v0.5.0-rc1/authors.html index b43b323ff..d6c18f6fb 100644 --- a/v0.5.0-rc1/authors.html +++ b/v0.5.0-rc1/authors.html @@ -1,8 +1,22 @@ - -Authors and Citation • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -79,7 +99,8 @@

    Authors

    -
    • +
        +
      • Dawid Kaledkowski. Author, maintainer.

      • @@ -135,7 +156,8 @@

        Authors

        F. Hoffmann-La Roche AG. Copyright holder, funder.

        -
    + +

    Citation

    @@ -156,17 +178,19 @@

    Citation

    }
    + + + + - - + + diff --git a/v0.5.0-rc1/coverage-report/index.html b/v0.5.0-rc1/coverage-report/index.html index 5e7866ba9..cfb350289 100644 --- a/v0.5.0-rc1/coverage-report/index.html +++ b/v0.5.0-rc1/coverage-report/index.html @@ -1,22 +1,21 @@ - - + - + - - + + - + - + - - - + + + @@ -851,7 +850,8 @@

    teal.slice coverage - 66.10%

    106 - 67x + 67x +
          checkmate::assert_list(data_objects, any.missing = FALSE, min.len = 0, names = "unique")
    @@ -865,14 +865,16 @@

    teal.slice coverage - 66.10%

    108 - 67x + 67x +
          data_objects <- lapply(data_objects, function(dataset) {
    109 - 101x + 101x +
            if (is.list(dataset) && "dataset" %in% names(dataset)) {
    @@ -893,7 +895,8 @@

    teal.slice coverage - 66.10%

    112 - 101x + 101x +
              dataset
    @@ -928,49 +931,56 @@

    teal.slice coverage - 66.10%

    117 - 67x + 67x +
          checkmate::assert_class(join_keys, "join_keys")
    118 - 66x + 66x +
          self$set_join_keys(join_keys)
    119 - 66x + 66x +
          child_parent <- sapply(
    120 - 66x + 66x +
            names(data_objects),
    121 - 66x + 66x +
            function(i) teal.data::parent(join_keys, i),
    122 - 66x + 66x +
            USE.NAMES = TRUE,
    123 - 66x + 66x +
            simplify = FALSE
    @@ -984,14 +994,16 @@

    teal.slice coverage - 66.10%

    125 - 66x + 66x +
          ordered_datanames <- topological_sort(child_parent)
    126 - 66x + 66x +
          ordered_datanames <- intersect(ordered_datanames, names(data_objects))
    @@ -1005,21 +1017,24 @@

    teal.slice coverage - 66.10%

    128 - 66x + 66x +
          for (dataname in ordered_datanames) {
    129 - 100x + 100x +
            ds_object <- data_objects[[dataname]]
    130 - 100x + 100x +
            self$set_dataset(data = ds_object, dataname = dataname)
    @@ -1040,7 +1055,8 @@

    teal.slice coverage - 66.10%

    133 - 66x + 66x +
          self$set_available_teal_slices(x = reactive(NULL))
    @@ -1054,7 +1070,8 @@

    teal.slice coverage - 66.10%

    135 - 66x + 66x +
          invisible(self)
    @@ -1117,7 +1134,8 @@

    teal.slice coverage - 66.10%

    144 - 118x + 118x +
          names(private$filtered_datasets)
    @@ -1187,7 +1205,8 @@

    teal.slice coverage - 66.10%

    154 - 1x + 1x +
          private$get_filtered_dataset(dataname)$get_dataset_label()
    @@ -1292,14 +1311,16 @@

    teal.slice coverage - 66.10%

    169 - 67x + 67x +
          checkmate::assert_class(x, "reactive")
    170 - 67x + 67x +
          private$available_teal_slices <- reactive({
    @@ -1313,49 +1334,56 @@

    teal.slice coverage - 66.10%

    172 - 4x + 4x +
            current_state <- isolate(self$get_filter_state())
    173 - 4x + 4x +
            allowed <- attr(current_state, "include_varnames")
    174 - 4x + 4x +
            forbidden <- attr(current_state, "exclude_varnames")
    175 - 4x + 4x +
            foo <- function(slice) {
    176 - 13x + 13x +
              if (slice$dataname %in% self$datanames()) {
    177 - 13x + 13x +
                if (slice$fixed) {
    178 - 4x + 4x +
                  TRUE
    @@ -1369,14 +1397,16 @@

    teal.slice coverage - 66.10%

    180 - 9x + 9x +
                  isTRUE(slice$varname %in% allowed[[slice$dataname]]) ||
    181 - 9x + 9x +
                    isFALSE(slice$varname %in% forbidden[[slice$dataname]])
    @@ -1418,7 +1448,8 @@

    teal.slice coverage - 66.10%

    187 - 4x + 4x +
            Filter(foo, x())
    @@ -1432,7 +1463,8 @@

    teal.slice coverage - 66.10%

    189 - 67x + 67x +
          invisible(NULL)
    @@ -1509,7 +1541,8 @@

    teal.slice coverage - 66.10%

    200 - 4x + 4x +
          private$available_teal_slices
    @@ -1705,14 +1738,16 @@

    teal.slice coverage - 66.10%

    228 - 10x + 10x +
          checkmate::assert_subset(dataname, self$datanames())
    229 - 9x + 9x +
          private$get_filtered_dataset(dataname)$get_call()
    @@ -1810,28 +1845,32 @@

    teal.slice coverage - 66.10%

    243 - 24x + 24x +
          checkmate::assert_subset(dataname, self$datanames())
    244 - 23x + 23x +
          checkmate::assert_flag(filtered)
    245 - 22x + 22x +
          data <- private$get_filtered_dataset(dataname)$get_dataset(filtered)
    246 - 3x + 3x +
          if (filtered) data() else data
    @@ -1894,7 +1933,8 @@

    teal.slice coverage - 66.10%

    255 - 2x + 2x +
          private$join_keys
    @@ -1985,28 +2025,32 @@

    teal.slice coverage - 66.10%

    268 - 9x + 9x +
          rows <- lapply(
    269 - 9x + 9x +
            datanames,
    270 - 9x + 9x +
            function(dataname) {
    271 - 11x + 11x +
              private$get_filtered_dataset(dataname)$get_filter_overview()
    @@ -2027,14 +2071,16 @@

    teal.slice coverage - 66.10%

    274 - 5x + 5x +
          unssuported_idx <- vapply(rows, function(x) all(is.na(x[-1])), logical(1))
    275 - 5x + 5x +
          dplyr::bind_rows(c(rows[!unssuported_idx], rows[unssuported_idx]))
    @@ -2111,7 +2157,8 @@

    teal.slice coverage - 66.10%

    286 - 1x + 1x +
          private$get_filtered_dataset(dataname)$get_keys()
    @@ -2265,14 +2312,16 @@

    teal.slice coverage - 66.10%

    308 - 105x + 105x +
          checkmate::assert_string(dataname)
    309 - 105x + 105x +
          logger::log_trace("FilteredData$set_dataset setting dataset, name: { dataname }")
    @@ -2293,7 +2342,8 @@

    teal.slice coverage - 66.10%

    312 - 105x + 105x +
          check_simple_name(dataname)
    @@ -2307,21 +2357,24 @@

    teal.slice coverage - 66.10%

    314 - 105x + 105x +
          parent_dataname <- teal.data::parent(private$join_keys, dataname)
    315 - 105x + 105x +
          keys <- private$join_keys[dataname, dataname]
    316 - 104x + 104x +
          if (is.null(keys)) keys <- character(0)
    @@ -2335,35 +2388,40 @@

    teal.slice coverage - 66.10%

    318 - 105x + 105x +
          if (length(parent_dataname) == 0) {
    319 - 95x + 95x +
            private$filtered_datasets[[dataname]] <- init_filtered_dataset(
    320 - 95x + 95x +
              dataset = data,
    321 - 95x + 95x +
              dataname = dataname,
    322 - 95x + 95x +
              keys = keys
    @@ -2384,7 +2442,8 @@

    teal.slice coverage - 66.10%

    325 - 10x + 10x +
            join_keys <- private$join_keys[dataname, parent_dataname]
    @@ -2398,49 +2457,56 @@

    teal.slice coverage - 66.10%

    327 - 10x + 10x +
            private$filtered_datasets[[dataname]] <- init_filtered_dataset(
    328 - 10x + 10x +
              dataset = data,
    329 - 10x + 10x +
              dataname = dataname,
    330 - 10x + 10x +
              keys = keys,
    331 - 10x + 10x +
              parent_name = parent_dataname,
    332 - 10x + 10x +
              parent = reactive(self$get_data(parent_dataname, filtered = TRUE)),
    333 - 10x + 10x +
              join_keys = join_keys
    @@ -2468,7 +2534,8 @@

    teal.slice coverage - 66.10%

    337 - 105x + 105x +
          invisible(self)
    @@ -2545,21 +2612,24 @@

    teal.slice coverage - 66.10%

    348 - 66x + 66x +
          checkmate::assert_class(join_keys, "join_keys")
    349 - 66x + 66x +
          private$join_keys <- join_keys
    350 - 66x + 66x +
          invisible(self)
    @@ -2636,35 +2706,40 @@

    teal.slice coverage - 66.10%

    361 - 53x + 53x +
          states <- unname(lapply(private$filtered_datasets, function(x) x$get_filter_state()))
    362 - 53x + 53x +
          slices <- Filter(Negate(is.null), states)
    363 - 53x + 53x +
          slices <- do.call(c, slices)
    364 - 53x + 53x +
          if (!is.null(slices)) {
    365 - 53x + 53x +
            attr(slices, "allow_add") <- private$allow_add
    @@ -2678,7 +2753,8 @@

    teal.slice coverage - 66.10%

    367 - 53x + 53x +
          slices
    @@ -2762,35 +2838,40 @@

    teal.slice coverage - 66.10%

    379 - 5x + 5x +
          datasets <- lapply(self$datanames(), private$get_filtered_dataset)
    380 - 5x + 5x +
          ind <- vapply(datasets, inherits, logical(1L), what = "DefaultFilteredDataset")
    381 - 5x + 5x +
          states <- do.call(c, lapply(datasets[!ind], function(ds) ds$get_filter_state()))
    382 - 5x + 5x +
          states_fmt <- format(states, show_all = show_all, trim_lines = trim_lines)
    383 - 5x + 5x +
          holders_fmt <- vapply(datasets[ind], format, character(1L), show_all = show_all, trim_lines = trim_lines)
    @@ -2804,28 +2885,32 @@

    teal.slice coverage - 66.10%

    385 - 5x + 5x +
          sprintf(
    386 - 5x + 5x +
            "%s:\n%s",
    387 - 5x + 5x +
            class(self)[1],
    388 - 5x + 5x +
            paste(c(states_fmt, holders_fmt), collapse = "\n")
    @@ -2965,42 +3050,48 @@

    teal.slice coverage - 66.10%

    408 - 31x + 31x +
          isolate({
    409 - 31x + 31x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initializing")
    410 - 31x + 31x +
            checkmate::assert_class(state, "teal_slices")
    411 - 31x + 31x +
            allow_add <- attr(state, "allow_add")
    412 - 31x + 31x +
            if (!is.null(allow_add)) {
    413 - 31x + 31x +
              private$allow_add <- allow_add
    @@ -3021,21 +3112,24 @@

    teal.slice coverage - 66.10%

    416 - 31x + 31x +
            lapply(self$datanames(), function(dataname) {
    417 - 63x + 63x +
              states <- Filter(function(x) identical(x$dataname, dataname), state)
    418 - 63x + 63x +
              private$get_filtered_dataset(dataname)$set_filter_state(states)
    @@ -3056,7 +3150,8 @@

    teal.slice coverage - 66.10%

    421 - 31x + 31x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initialized")
    @@ -3077,7 +3172,8 @@

    teal.slice coverage - 66.10%

    424 - 31x + 31x +
          invisible(NULL)
    @@ -3168,28 +3264,32 @@

    teal.slice coverage - 66.10%

    437 - 8x + 8x +
          isolate({
    438 - 8x + 8x +
            checkmate::assert_class(state, "teal_slices")
    439 - 8x + 8x +
            datanames <- unique(vapply(state, "[[", character(1L), "dataname"))
    440 - 8x + 8x +
            checkmate::assert_subset(datanames, self$datanames())
    @@ -3203,14 +3303,16 @@

    teal.slice coverage - 66.10%

    442 - 8x + 8x +
            logger::log_trace(
    443 - 8x + 8x +
              "{ class(self)[1] }$remove_filter_state removing filter(s), dataname: { private$dataname }"
    @@ -3231,21 +3333,24 @@

    teal.slice coverage - 66.10%

    446 - 8x + 8x +
            lapply(datanames, function(dataname) {
    447 - 9x + 9x +
              slices <- Filter(function(x) identical(x$dataname, dataname), state)
    448 - 9x + 9x +
              private$get_filtered_dataset(dataname)$remove_filter_state(slices)
    @@ -3266,14 +3371,16 @@

    teal.slice coverage - 66.10%

    451 - 8x + 8x +
            logger::log_trace(
    452 - 8x + 8x +
              "{ class(self)[1] }$remove_filter_state removed filter(s), dataname: { private$dataname }"
    @@ -3301,7 +3408,8 @@

    teal.slice coverage - 66.10%

    456 - 8x + 8x +
          invisible(NULL)
    @@ -3406,14 +3514,16 @@

    teal.slice coverage - 66.10%

    471 - 7x + 7x +
          logger::log_trace(
    472 - 7x + 7x +
            "FilteredData$clear_filter_states called, datanames: { toString(datanames) }"
    @@ -3434,21 +3544,24 @@

    teal.slice coverage - 66.10%

    475 - 7x + 7x +
          for (dataname in datanames) {
    476 - 12x + 12x +
            fdataset <- private$get_filtered_dataset(dataname = dataname)
    477 - 12x + 12x +
            fdataset$clear_filter_states(force)
    @@ -3469,28 +3582,32 @@

    teal.slice coverage - 66.10%

    480 - 7x + 7x +
          logger::log_trace(
    481 - 7x + 7x +
            paste(
    482 - 7x + 7x +
              "FilteredData$clear_filter_states removed all non-anchored FilterStates,",
    483 - 7x + 7x +
              "datanames: { toString(datanames) }"
    @@ -3518,7 +3635,8 @@

    teal.slice coverage - 66.10%

    487 - 7x + 7x +
          invisible(NULL)
    @@ -3784,35 +3902,40 @@

    teal.slice coverage - 66.10%

    525 - 1x + 1x +
          checkmate::assert_function(active_datanames)
    526 - 1x + 1x +
          moduleServer(
    527 - 1x + 1x +
            id = id,
    528 - 1x + 1x +
            function(input, output, session) {
    529 - 1x + 1x +
              logger::log_trace("FilteredData$srv_filter_panel initializing")
    @@ -3826,14 +3949,16 @@

    teal.slice coverage - 66.10%

    531 - 1x + 1x +
              active_datanames_resolved <- reactive({
    532 - 1x + 1x +
                checkmate::assert_subset(active_datanames(), self$datanames())
    @@ -3861,28 +3986,32 @@

    teal.slice coverage - 66.10%

    536 - 1x + 1x +
              self$srv_overview("overview", active_datanames_resolved)
    537 - 1x + 1x +
              self$srv_active("active", active_datanames_resolved)
    538 - 1x + 1x +
              if (private$allow_add) {
    539 - 1x + 1x +
                self$srv_add("add", active_datanames_resolved)
    @@ -3903,14 +4032,16 @@

    teal.slice coverage - 66.10%

    542 - 1x + 1x +
              logger::log_trace("FilteredData$srv_filter_panel initialized")
    543 - 1x + 1x +
              NULL
    @@ -4351,21 +4482,24 @@

    teal.slice coverage - 66.10%

    606 - 3x + 3x +
          checkmate::assert_function(active_datanames)
    607 - 3x + 3x +
          moduleServer(id, function(input, output, session) {
    608 - 3x + 3x +
            logger::log_trace("FilteredData$srv_active initializing")
    @@ -4379,7 +4513,8 @@

    teal.slice coverage - 66.10%

    610 - 3x + 3x +
            private$srv_available_filters("available_filters")
    @@ -4393,7 +4528,8 @@

    teal.slice coverage - 66.10%

    612 - 3x + 3x +
            observeEvent(input$minimise_filter_active, {
    @@ -4442,42 +4578,48 @@

    teal.slice coverage - 66.10%

    619 - 3x + 3x +
            observeEvent(private$get_filter_count(), {
    620 - 3x + 3x +
              shinyjs::toggle("remove_all_filters", condition = private$get_filter_count() != 0)
    621 - 3x + 3x +
              shinyjs::show("filter_active_vars_contents")
    622 - 3x + 3x +
              shinyjs::hide("filters_active_count")
    623 - 3x + 3x +
              toggle_icon(session$ns("minimise_filter_active"), c("fa-angle-right", "fa-angle-down"), TRUE)
    624 - 3x + 3x +
              toggle_title(session$ns("minimise_filter_active"), c("Restore panel", "Minimise Panel"), TRUE)
    @@ -4498,28 +4640,32 @@

    teal.slice coverage - 66.10%

    627 - 3x + 3x +
            observeEvent(active_datanames(), {
    628 - 2x + 2x +
              lapply(self$datanames(), function(dataname) {
    629 - 4x + 4x +
                if (dataname %in% active_datanames()) {
    630 - 4x + 4x +
                  shinyjs::show(dataname)
    @@ -4582,35 +4728,40 @@

    teal.slice coverage - 66.10%

    639 - 3x + 3x +
            lapply(
    640 - 3x + 3x +
              self$datanames(),
    641 - 3x + 3x +
              function(dataname) {
    642 - 6x + 6x +
                fdataset <- private$get_filtered_dataset(dataname)
    643 - 6x + 6x +
                fdataset$srv_active(id = dataname)
    @@ -4638,49 +4789,56 @@

    teal.slice coverage - 66.10%

    647 - 3x + 3x +
            output$teal_filters_count <- renderText({
    648 - 3x + 3x +
              n_filters_active <- private$get_filter_count()
    649 - 3x + 3x +
              req(n_filters_active > 0L)
    650 - 2x + 2x +
              sprintf(
    651 - 2x + 2x +
                "%s filter%s applied across datasets",
    652 - 2x + 2x +
                n_filters_active,
    653 - 2x + 2x +
                ifelse(n_filters_active == 1, "", "s")
    @@ -4708,28 +4866,32 @@

    teal.slice coverage - 66.10%

    657 - 3x + 3x +
            observeEvent(input$remove_all_filters, {
    658 - 1x + 1x +
              logger::log_trace("FilteredData$srv_filter_panel@1 removing all non-anchored filters")
    659 - 1x + 1x +
              self$clear_filter_states()
    660 - 1x + 1x +
              logger::log_trace("FilteredData$srv_filter_panel@1 removed all non-anchored filters")
    @@ -4743,14 +4905,16 @@

    teal.slice coverage - 66.10%

    662 - 3x + 3x +
            logger::log_trace("FilteredData$srv_active initialized")
    663 - 3x + 3x +
            NULL
    @@ -5128,28 +5292,32 @@

    teal.slice coverage - 66.10%

    717 - 1x + 1x +
          checkmate::assert_class(active_datanames, "reactive")
    718 - 1x + 1x +
          moduleServer(id, function(input, output, session) {
    719 - 1x + 1x +
            logger::log_trace("FilteredData$srv_add initializing")
    720 - 1x + 1x +
            observeEvent(input$minimise_filter_add_vars, {
    @@ -5191,7 +5359,8 @@

    teal.slice coverage - 66.10%

    726 - 1x + 1x +
            observeEvent(active_datanames(), {
    @@ -5275,35 +5444,40 @@

    teal.slice coverage - 66.10%

    738 - 1x + 1x +
            lapply(
    739 - 1x + 1x +
              self$datanames(),
    740 - 1x + 1x +
              function(dataname) {
    741 - 2x + 2x +
                fdataset <- private$get_filtered_dataset(dataname)
    742 - 2x + 2x +
                fdataset$srv_add(id = dataname)
    @@ -5324,14 +5498,16 @@

    teal.slice coverage - 66.10%

    745 - 1x + 1x +
            logger::log_trace("FilteredData$srv_filter_panel initialized")
    746 - 1x + 1x +
            NULL
    @@ -5751,35 +5927,40 @@

    teal.slice coverage - 66.10%

    806 - 1x + 1x +
          checkmate::assert_class(active_datanames, "reactive")
    807 - 1x + 1x +
          moduleServer(
    808 - 1x + 1x +
            id = id,
    809 - 1x + 1x +
            function(input, output, session) {
    810 - 1x + 1x +
              logger::log_trace("FilteredData$srv_filter_overview initializing")
    @@ -5793,7 +5974,8 @@

    teal.slice coverage - 66.10%

    812 - 1x + 1x +
              observeEvent(input$minimise_filter_overview, {
    @@ -5835,7 +6017,8 @@

    teal.slice coverage - 66.10%

    818 - 1x + 1x +
              output$table <- renderUI({
    @@ -6339,14 +6522,16 @@

    teal.slice coverage - 66.10%

    890 - 1x + 1x +
              logger::log_trace("FilteredData$srv_filter_overview initialized")
    891 - 1x + 1x +
              NULL
    @@ -6605,7 +6790,8 @@

    teal.slice coverage - 66.10%

    928 - 147x + 147x +
          if (length(dataname) == 0) {
    @@ -6626,7 +6812,8 @@

    teal.slice coverage - 66.10%

    931 - 147x + 147x +
            private$filtered_datasets[[dataname]]
    @@ -6710,7 +6897,8 @@

    teal.slice coverage - 66.10%

    943 - 11x + 11x +
          length(self$get_filter_state())
    @@ -6976,28 +7164,32 @@

    teal.slice coverage - 66.10%

    981 - 4x + 4x +
          moduleServer(id, function(input, output, session) {
    982 - 4x + 4x +
            slices_available <- self$get_available_teal_slices()
    983 - 4x + 4x +
            slices_interactive <- reactive(
    984 - 4x + 4x +
              Filter(function(slice) isFALSE(slice$fixed), slices_available())
    @@ -7011,14 +7203,16 @@

    teal.slice coverage - 66.10%

    986 - 4x + 4x +
            slices_fixed <- reactive(
    987 - 4x + 4x +
              Filter(function(slice) isTRUE(slice$fixed), slices_available())
    @@ -7032,21 +7226,24 @@

    teal.slice coverage - 66.10%

    989 - 4x + 4x +
            available_slices_id <- reactive(vapply(slices_available(), `[[`, character(1), "id"))
    990 - 4x + 4x +
            active_slices_id <- reactive(vapply(self$get_filter_state(), `[[`, character(1), "id"))
    991 - 4x + 4x +
            duplicated_slice_references <- reactive({
    @@ -7060,35 +7257,40 @@

    teal.slice coverage - 66.10%

    993 - 8x + 8x +
              slice_reference <- vapply(slices_available(), get_default_slice_id, character(1))
    994 - 8x + 8x +
              is_duplicated_reference <- duplicated(slice_reference) | duplicated(slice_reference, fromLast = TRUE)
    995 - 8x + 8x +
              is_active <- available_slices_id() %in% active_slices_id()
    996 - 8x + 8x +
              is_not_expr <- !vapply(slices_available(), inherits, logical(1), "teal_slice_expr")
    997 - 8x + 8x +
              slice_reference[is_duplicated_reference & is_active & is_not_expr]
    @@ -7109,70 +7311,80 @@

    teal.slice coverage - 66.10%

    1000 - 4x + 4x +
            checkbox_group_element <- function(name, value, label, checked, disabled = FALSE) {
    1001 - 35x + 35x +
              tags$div(
    1002 - 35x + 35x +
                class = "checkbox available-filters",
    1003 - 35x + 35x +
                tags$label(
    1004 - 35x + 35x +
                  tags$input(
    1005 - 35x + 35x +
                    type = "checkbox",
    1006 - 35x + 35x +
                    name = name,
    1007 - 35x + 35x +
                    value = value,
    1008 - 35x + 35x +
                    checked = checked,
    1009 - 35x + 35x +
                    disabled = if (disabled) "disabled"
    @@ -7186,7 +7398,8 @@

    teal.slice coverage - 66.10%

    1011 - 35x + 35x +
                  tags$span(label, disabled = if (disabled) disabled)
    @@ -7221,42 +7434,48 @@

    teal.slice coverage - 66.10%

    1016 - 4x + 4x +
            output$checkbox <- renderUI({
    1017 - 8x + 8x +
              checkbox <- checkboxGroupInput(
    1018 - 8x + 8x +
                session$ns("available_slices_id"),
    1019 - 8x + 8x +
                label = NULL,
    1020 - 8x + 8x +
                choices = NULL,
    1021 - 8x + 8x +
                selected = NULL
    @@ -7270,14 +7489,16 @@

    teal.slice coverage - 66.10%

    1023 - 8x + 8x +
              active_slices_ids <- active_slices_id()
    1024 - 8x + 8x +
              duplicated_slice_refs <- duplicated_slice_references()
    @@ -7291,7 +7512,8 @@

    teal.slice coverage - 66.10%

    1026 - 8x + 8x +
              checkbox_group_slice <- function(slice) {
    @@ -7305,63 +7527,72 @@

    teal.slice coverage - 66.10%

    1028 - 35x + 35x +
                isolate({
    1029 - 35x + 35x +
                  checkbox_group_element(
    1030 - 35x + 35x +
                    name = session$ns("available_slices_id"),
    1031 - 35x + 35x +
                    value = slice$id,
    1032 - 35x + 35x +
                    label = slice$id,
    1033 - 35x + 35x +
                    checked = if (slice$id %in% active_slices_ids) "checked",
    1034 - 35x + 35x +
                    disabled = slice$anchored ||
    1035 - 35x + 35x +
                      get_default_slice_id(slice) %in% duplicated_slice_refs &&
    1036 - 35x + 35x +
                        !slice$id %in% active_slices_ids
    @@ -7396,14 +7627,16 @@

    teal.slice coverage - 66.10%

    1041 - 8x + 8x +
              interactive_choice_mock <- lapply(slices_interactive(), checkbox_group_slice)
    1042 - 8x + 8x +
              non_interactive_choice_mock <- lapply(slices_fixed(), checkbox_group_slice)
    @@ -7417,63 +7650,72 @@

    teal.slice coverage - 66.10%

    1044 - 8x + 8x +
              htmltools::tagInsertChildren(
    1045 - 8x + 8x +
                checkbox,
    1046 - 8x + 8x +
                br(),
    1047 - 8x + 8x +
                if (length(non_interactive_choice_mock)) tags$strong("Fixed filters"),
    1048 - 8x + 8x +
                non_interactive_choice_mock,
    1049 - 8x + 8x +
                if (length(interactive_choice_mock)) tags$strong("Interactive filters"),
    1050 - 8x + 8x +
                interactive_choice_mock,
    1051 - 8x + 8x +
                .cssSelector = "div.shiny-options-group",
    1052 - 8x + 8x +
                after = 0
    @@ -7501,49 +7743,56 @@

    teal.slice coverage - 66.10%

    1056 - 4x + 4x +
            observeEvent(input$available_slices_id, ignoreNULL = FALSE, ignoreInit = TRUE, {
    1057 - 5x + 5x +
              new_slices_id <- setdiff(input$available_slices_id, active_slices_id())
    1058 - 5x + 5x +
              removed_slices_id <- setdiff(active_slices_id(), input$available_slices_id)
    1059 - 5x + 5x +
              if (length(new_slices_id)) {
    1060 - 3x + 3x +
                new_teal_slices <- Filter(
    1061 - 3x + 3x +
                  function(slice) slice$id %in% new_slices_id,
    1062 - 3x + 3x +
                  private$available_teal_slices()
    @@ -7557,7 +7806,8 @@

    teal.slice coverage - 66.10%

    1064 - 3x + 3x +
                self$set_filter_state(new_teal_slices)
    @@ -7578,28 +7828,32 @@

    teal.slice coverage - 66.10%

    1067 - 5x + 5x +
              if (length(removed_slices_id)) {
    1068 - 4x + 4x +
                removed_teal_slices <- Filter(
    1069 - 4x + 4x +
                  function(slice) slice$id %in% removed_slices_id,
    1070 - 4x + 4x +
                  self$get_filter_state()
    @@ -7613,7 +7867,8 @@

    teal.slice coverage - 66.10%

    1072 - 4x + 4x +
                self$remove_filter_state(removed_teal_slices)
    @@ -7641,21 +7896,24 @@

    teal.slice coverage - 66.10%

    1076 - 4x + 4x +
            observeEvent(private$available_teal_slices(), ignoreNULL = FALSE, {
    1077 - 3x + 3x +
              if (length(private$available_teal_slices())) {
    1078 - 1x + 1x +
                shinyjs::show("available_menu")
    @@ -7669,7 +7927,8 @@

    teal.slice coverage - 66.10%

    1080 - 2x + 2x +
                shinyjs::hide("available_menu")
    @@ -8816,56 +9075,64 @@

    teal.slice coverage - 66.10%

    157 - 121x + 121x +
          isolate({
    158 - 121x + 121x +
            checkmate::assert_numeric(x, all.missing = FALSE)
    159 - 2x + 2x +
            if (!any(is.finite(x))) stop("\"x\" contains no finite values")
    160 - 118x + 118x +
            super$initialize(x = x, x_reactive = x_reactive, slice = slice, extract_type = extract_type)
    161 - 118x + 118x +
            private$is_integer <- checkmate::test_integerish(x)
    162 - 118x + 118x +
            private$inf_count <- sum(is.infinite(x))
    163 - 118x + 118x +
            private$inf_filtered_count <- reactive(
    164 - 118x + 118x +
              if (!is.null(private$x_reactive())) sum(is.infinite(private$x_reactive()))
    @@ -8886,14 +9153,16 @@

    teal.slice coverage - 66.10%

    167 - 118x + 118x +
            checkmate::assert_numeric(slice$choices, null.ok = TRUE)
    168 - 3x + 3x +
            if (is.null(slice$keep_inf) && any(is.infinite(x))) slice$keep_inf <- TRUE
    @@ -8907,21 +9176,24 @@

    teal.slice coverage - 66.10%

    170 - 117x + 117x +
            private$set_choices(slice$choices)
    171 - 42x + 42x +
            if (is.null(slice$selected)) slice$selected <- slice$choices
    172 - 117x + 117x +
            private$set_selected(slice$selected)
    @@ -8935,21 +9207,24 @@

    teal.slice coverage - 66.10%

    174 - 114x + 114x +
            private$is_integer <- checkmate::test_integerish(x)
    175 - 114x + 114x +
            private$inf_filtered_count <- reactive(
    176 - 114x + 114x +
              if (!is.null(private$x_reactive())) sum(is.infinite(private$x_reactive()))
    @@ -8963,7 +9238,8 @@

    teal.slice coverage - 66.10%

    178 - 114x + 114x +
            private$inf_count <- sum(is.infinite(x))
    @@ -8977,63 +9253,72 @@

    teal.slice coverage - 66.10%

    180 - 114x + 114x +
            private$plot_data <- list(
    181 - 114x + 114x +
              type = "histogram",
    182 - 114x + 114x +
              nbinsx = 50,
    183 - 114x + 114x +
              x = Filter(Negate(is.na), Filter(is.finite, private$x)),
    184 - 114x + 114x +
              color = I(fetch_bs_color("secondary")),
    185 - 114x + 114x +
              alpha = 0.2,
    186 - 114x + 114x +
              bingroup = 1,
    187 - 114x + 114x +
              showlegend = FALSE,
    188 - 114x + 114x +
              hoverinfo = "none"
    @@ -9047,21 +9332,24 @@

    teal.slice coverage - 66.10%

    190 - 114x + 114x +
            private$plot_mask <- list(list(
    191 - 114x + 114x +
              type = "rect", fillcolor = rgb(1, 1, 1, .65), line = list(width = 0),
    192 - 114x + 114x +
              x0 = -0.5, x1 = 1.5, y0 = -0.5, y1 = 1.5, xref = "paper", yref = "paper"
    @@ -9075,84 +9363,96 @@

    teal.slice coverage - 66.10%

    194 - 114x + 114x +
            private$plot_layout <- reactive({
    195 - 5x + 5x +
              shapes <- private$get_shape_properties(private$get_selected())
    196 - 5x + 5x +
              list(
    197 - 5x + 5x +
                barmode = "overlay",
    198 - 5x + 5x +
                xaxis = list(
    199 - 5x + 5x +
                  range = private$get_choices() * c(0.995, 1.005),
    200 - 5x + 5x +
                  rangeslider = list(thickness = 0),
    201 - 5x + 5x +
                  showticklabels = TRUE,
    202 - 5x + 5x +
                  ticks = "outside",
    203 - 5x + 5x +
                  ticklen = 1.5,
    204 - 5x + 5x +
                  tickmode = "auto",
    205 - 5x + 5x +
                  nticks = 10
    @@ -9166,35 +9466,40 @@

    teal.slice coverage - 66.10%

    207 - 5x + 5x +
                yaxis = list(showgrid = FALSE, showticklabels = FALSE),
    208 - 5x + 5x +
                margin = list(b = 17, l = 0, r = 0, t = 0, autoexpand = FALSE),
    209 - 5x + 5x +
                plot_bgcolor = "#FFFFFF00",
    210 - 5x + 5x +
                paper_bgcolor = "#FFFFFF00",
    211 - 5x + 5x +
                shapes = shapes
    @@ -9215,35 +9520,40 @@

    teal.slice coverage - 66.10%

    214 - 114x + 114x +
            private$plot_config <- reactive({
    215 - 5x + 5x +
              list(
    216 - 5x + 5x +
                doubleClick = "reset",
    217 - 5x + 5x +
                displayModeBar = FALSE,
    218 - 5x + 5x +
                edits = list(shapePosition = TRUE)
    @@ -9264,49 +9574,56 @@

    teal.slice coverage - 66.10%

    221 - 114x + 114x +
            private$plot_filtered <- reactive({
    222 - 5x + 5x +
              finite_values <- Filter(is.finite, private$x_reactive())
    223 - 5x + 5x +
              if (!identical(finite_values, numeric(0))) {
    224 - 5x + 5x +
                list(
    225 - 5x + 5x +
                  x = finite_values,
    226 - 5x + 5x +
                  bingroup = 1,
    227 - 5x + 5x +
                  color = I(fetch_bs_color("primary"))
    @@ -9334,7 +9651,8 @@

    teal.slice coverage - 66.10%

    231 - 114x + 114x +
            invisible(self)
    @@ -9425,14 +9743,16 @@

    teal.slice coverage - 66.10%

    244 - 35x + 35x +
          if (isFALSE(private$is_any_filtered())) {
    245 - 1x + 1x +
            return(NULL)
    @@ -9446,28 +9766,32 @@

    teal.slice coverage - 66.10%

    247 - 4x + 4x +
          if (missing(dataname)) dataname <- private$get_dataname()
    248 - 34x + 34x +
          varname <- private$get_varname_prefixed(dataname)
    249 - 34x + 34x +
          filter_call <-
    250 - 34x + 34x +
            call(
    @@ -9481,14 +9805,16 @@

    teal.slice coverage - 66.10%

    252 - 34x + 34x +
              call(">=", varname, private$get_selected()[1L]),
    253 - 34x + 34x +
              call("<=", varname, private$get_selected()[2L])
    @@ -9502,7 +9828,8 @@

    teal.slice coverage - 66.10%

    255 - 34x + 34x +
          private$add_keep_na_call(private$add_keep_inf_call(filter_call, varname), varname)
    @@ -9684,21 +10011,24 @@

    teal.slice coverage - 66.10%

    281 - 117x + 117x +
          x <- private$x[is.finite(private$x)]
    282 - 117x + 117x +
          if (is.null(choices)) {
    283 - 105x + 105x +
            choices <- range(x)
    @@ -9712,35 +10042,40 @@

    teal.slice coverage - 66.10%

    285 - 12x + 12x +
            choices_adjusted <- c(max(choices[1L], min(x)), min(choices[2L], max(x)))
    286 - 12x + 12x +
            if (any(choices != choices_adjusted)) {
    287 - 1x + 1x +
              warning(sprintf(
    288 - 1x + 1x +
                "Choices adjusted (some values outside of variable range). Varname: %s, dataname: %s.",
    289 - 1x + 1x +
                private$get_varname(), private$get_dataname()
    @@ -9754,7 +10089,8 @@

    teal.slice coverage - 66.10%

    291 - 1x + 1x +
              choices <- choices_adjusted
    @@ -9768,35 +10104,40 @@

    teal.slice coverage - 66.10%

    293 - 12x + 12x +
            if (choices[1L] > choices[2L]) {
    294 - 1x + 1x +
              warning(sprintf(
    295 - 1x + 1x +
                "Invalid choices: lower is higher / equal to upper, or not in range of variable values.
    296 - 1x + 1x +
                Setting defaults. Varname: %s, dataname: %s.",
    297 - 1x + 1x +
                private$get_varname(), private$get_dataname()
    @@ -9810,7 +10151,8 @@

    teal.slice coverage - 66.10%

    299 - 1x + 1x +
              choices <- range(x)
    @@ -9838,21 +10180,24 @@

    teal.slice coverage - 66.10%

    303 - 117x + 117x +
          private$set_is_choice_limited(private$x, choices)
    304 - 117x + 117x +
          private$x <- private$x[
    305 - 117x + 117x +
            (private$x >= choices[1L] & private$x <= choices[2L]) | is.na(private$x) | !is.finite(private$x)
    @@ -9873,7 +10218,8 @@

    teal.slice coverage - 66.10%

    308 - 117x + 117x +
          x_range <- range(private$x, finite = TRUE)
    @@ -9894,14 +10240,16 @@

    teal.slice coverage - 66.10%

    311 - 117x + 117x +
          if (identical(diff(x_range), 0)) {
    312 - 2x + 2x +
            choices <- x_range
    @@ -9915,21 +10263,24 @@

    teal.slice coverage - 66.10%

    314 - 115x + 115x +
            x_pretty <- pretty(x_range, 100L)
    315 - 115x + 115x +
            choices <- range(x_pretty)
    316 - 115x + 115x +
            private$numeric_step <- signif(private$get_pretty_range_step(x_pretty), digits = 10)
    @@ -9943,14 +10294,16 @@

    teal.slice coverage - 66.10%

    318 - 117x + 117x +
          private$teal_slice$choices <- choices
    319 - 117x + 117x +
          invisible(NULL)
    @@ -9992,28 +10345,32 @@

    teal.slice coverage - 66.10%

    325 - 117x + 117x +
          xl <- xl[!is.na(xl)]
    326 - 117x + 117x +
          xl <- xl[is.finite(xl)]
    327 - 117x + 117x +
          private$is_choice_limited <- (any(xl < choices[1L]) | any(xl > choices[2L]))
    328 - 117x + 117x +
          invisible(NULL)
    @@ -10055,14 +10412,16 @@

    teal.slice coverage - 66.10%

    334 - 34x + 34x +
          if (isTRUE(private$get_keep_inf())) {
    335 - 2x + 2x +
            call("|", call("is.infinite", varname), filter_call)
    @@ -10076,7 +10435,8 @@

    teal.slice coverage - 66.10%

    337 - 32x + 32x +
            filter_call
    @@ -10139,14 +10499,16 @@

    teal.slice coverage - 66.10%

    346 - 117x + 117x +
          if (private$is_integer && diff(range(pretty_range) > 2)) {
    347 - 46x + 46x +
            return(1L)
    @@ -10160,14 +10522,16 @@

    teal.slice coverage - 66.10%

    349 - 71x + 71x +
            n_steps <- length(pretty_range) - 1
    350 - 71x + 71x +
            return(signif(digits = 10, (max(pretty_range) - min(pretty_range)) / n_steps))
    @@ -10195,35 +10559,40 @@

    teal.slice coverage - 66.10%

    354 - 133x + 133x +
          tryCatch(
    355 - 133x + 133x +
            expr = {
    356 - 133x + 133x +
              values <- as.numeric(values)
    357 - 4x + 4x +
              if (anyNA(values)) stop()
    358 - 129x + 129x +
              values
    @@ -10237,7 +10606,8 @@

    teal.slice coverage - 66.10%

    360 - 133x + 133x +
            error = function(e) stop("Vector of set values must contain values coercible to numeric")
    @@ -10272,21 +10642,24 @@

    teal.slice coverage - 66.10%

    365 - 2x + 2x +
          if (length(values) != 2L) stop("Vector of set values must have length two.")
    366 - 2x + 2x +
          if (values[1L] > values[2L]) stop("Vector of set values must be sorted.")
    367 - 125x + 125x +
          values
    @@ -10314,21 +10687,24 @@

    teal.slice coverage - 66.10%

    371 - 2x + 2x +
          if (values[1L] < private$get_choices()[1L]) values[1L] <- private$get_choices()[1L]
    372 - 2x + 2x +
          if (values[2L] > private$get_choices()[2L]) values[2L] <- private$get_choices()[2L]
    373 - 125x + 125x +
          values
    @@ -10370,35 +10746,40 @@

    teal.slice coverage - 66.10%

    379 - 35x + 35x +
          if (private$is_choice_limited) {
    380 - 1x + 1x +
            TRUE
    381 - 34x + 34x +
          } else if (!isTRUE(all.equal(private$get_selected(), private$get_choices()))) {
    382 - 32x + 32x +
            TRUE
    383 - 2x + 2x +
          } else if (!isTRUE(private$get_keep_inf()) && private$inf_count > 0) {
    @@ -10412,14 +10793,16 @@

    teal.slice coverage - 66.10%

    385 - 2x + 2x +
          } else if (!isTRUE(private$get_keep_na()) && private$na_count > 0) {
    386 - 1x + 1x +
            TRUE
    @@ -10433,7 +10816,8 @@

    teal.slice coverage - 66.10%

    388 - 1x + 1x +
            FALSE
    @@ -10482,21 +10866,24 @@

    teal.slice coverage - 66.10%

    395 - 5x + 5x +
          list(
    396 - 5x + 5x +
            list(type = "line", x0 = values[1], x1 = values[1], y0 = -100, y1 = 100, yref = "paper"),
    397 - 5x + 5x +
            list(type = "line", x0 = values[2], x1 = values[2], y0 = -100, y1 = 100, yref = "paper")
    @@ -10573,70 +10960,80 @@

    teal.slice coverage - 66.10%

    408 - 5x + 5x +
          ns <- NS(id)
    409 - 5x + 5x +
          isolate({
    410 - 5x + 5x +
            ui_input <- shinyWidgets::numericRangeInput(
    411 - 5x + 5x +
              inputId = ns("selection_manual"),
    412 - 5x + 5x +
              label = NULL,
    413 - 5x + 5x +
              min = private$get_choices()[1L],
    414 - 5x + 5x +
              max = private$get_choices()[2L],
    415 - 5x + 5x +
              value = private$get_selected(),
    416 - 5x + 5x +
              step = private$numeric_step,
    417 - 5x + 5x +
              width = "100%"
    @@ -10650,28 +11047,32 @@

    teal.slice coverage - 66.10%

    419 - 5x + 5x +
            tagList(
    420 - 5x + 5x +
              div(
    421 - 5x + 5x +
                class = "choices_state",
    422 - 5x + 5x +
                tags$head(tags$script(
    @@ -10699,21 +11100,24 @@

    teal.slice coverage - 66.10%

    426 - 5x + 5x +
                  HTML(
    427 - 5x + 5x +
                    '$(document).ready(function() {
    428 - 5x + 5x +
                      $("[data-toggle=\'popover\']").popover();
    @@ -10727,35 +11131,40 @@

    teal.slice coverage - 66.10%

    430 - 5x + 5x +
                      $(document).on("click", function (e) {
    431 - 5x + 5x +
                        if (!$("[data-toggle=\'popover\']").is(e.target) &&
    432 - 5x + 5x +
                            $("[data-toggle=\'popover\']").has(e.target).length === 0 &&
    433 - 5x + 5x +
                            $(".popover").has(e.target).length === 0) {
    434 - 5x + 5x +
                          $("[data-toggle=\'popover\']").popover("hide");
    @@ -10797,105 +11206,120 @@

    teal.slice coverage - 66.10%

    440 - 5x + 5x +
                div(
    441 - 5x + 5x +
                  actionLink(
    442 - 5x + 5x +
                    ns("plotly_info"),
    443 - 5x + 5x +
                    label = NULL,
    444 - 5x + 5x +
                    icon = icon("question-circle"),
    445 - 5x + 5x +
                    "data-toggle" = "popover",
    446 - 5x + 5x +
                    "data-html" = "true",
    447 - 5x + 5x +
                    "data-placement" = "left",
    448 - 5x + 5x +
                    "data-trigger" = "click",
    449 - 5x + 5x +
                    "data-title" = "Plot actions",
    450 - 5x + 5x +
                    "data-content" = "<p>
    451 - 5x + 5x +
                                      Drag vertical lines to set selection.<br>
    452 - 5x + 5x +
                                      Drag across plot to zoom in.<br>
    453 - 5x + 5x +
                                      Drag axis to pan.<br>
    454 - 5x + 5x +
                                      Double click to zoom out."
    @@ -10909,7 +11333,8 @@

    teal.slice coverage - 66.10%

    456 - 5x + 5x +
                  style = "text-align: right; font-size: 0.7em; margin-bottom: -1em; position: relative; z-index: 9;"
    @@ -10923,35 +11348,40 @@

    teal.slice coverage - 66.10%

    458 - 5x + 5x +
                shinycssloaders::withSpinner(
    459 - 5x + 5x +
                  plotly::plotlyOutput(ns("plot"), height = "50px"),
    460 - 5x + 5x +
                  type = 4,
    461 - 5x + 5x +
                  size = 0.25,
    462 - 5x + 5x +
                  hide.ui = FALSE
    @@ -10965,7 +11395,8 @@

    teal.slice coverage - 66.10%

    464 - 5x + 5x +
                ui_input
    @@ -10979,28 +11410,32 @@

    teal.slice coverage - 66.10%

    466 - 5x + 5x +
              div(
    467 - 5x + 5x +
                class = "filter-card-body-keep-na-inf",
    468 - 5x + 5x +
                private$keep_inf_ui(ns("keep_inf")),
    469 - 5x + 5x +
                private$keep_na_ui(ns("keep_na"))
    @@ -11077,28 +11512,32 @@

    teal.slice coverage - 66.10%

    480 - 5x + 5x +
          moduleServer(
    481 - 5x + 5x +
            id = id,
    482 - 5x + 5x +
            function(input, output, session) {
    483 - 5x + 5x +
              logger::log_trace("RangeFilterState$server initializing, id: { private$get_id() }")
    @@ -11119,7 +11558,8 @@

    teal.slice coverage - 66.10%

    486 - 5x + 5x +
              selection_manual <- debounce(reactive(input$selection_manual), 200)
    @@ -11140,7 +11580,8 @@

    teal.slice coverage - 66.10%

    489 - 5x + 5x +
              plot_data <- c(private$plot_data, source = session$ns("histogram_plot"))
    @@ -11161,42 +11602,48 @@

    teal.slice coverage - 66.10%

    492 - 5x + 5x +
              output$plot <- plotly::renderPlotly({
    493 - 5x + 5x +
                histogram <- do.call(plotly::plot_ly, plot_data)
    494 - 5x + 5x +
                histogram <- do.call(plotly::layout, c(list(p = histogram), private$plot_layout()))
    495 - 5x + 5x +
                histogram <- do.call(plotly::config, c(list(p = histogram), private$plot_config()))
    496 - 5x + 5x +
                histogram <- do.call(plotly::add_histogram, c(list(p = histogram), private$plot_filtered()))
    497 - 5x + 5x +
                histogram
    @@ -11224,63 +11671,72 @@

    teal.slice coverage - 66.10%

    501 - 5x + 5x +
              private$observers$relayout <-
    502 - 5x + 5x +
                observeEvent(
    503 - 5x + 5x +
                  ignoreNULL = FALSE,
    504 - 5x + 5x +
                  ignoreInit = TRUE,
    505 - 5x + 5x +
                  eventExpr = plotly::event_data("plotly_relayout", source = session$ns("histogram_plot")),
    506 - 5x + 5x +
                  handlerExpr = {
    507 - 1x + 1x +
                    logger::log_trace("RangeFilterState$server@1 selection changed, id: { private$get_id() }")
    508 - 1x + 1x +
                    event <- plotly::event_data("plotly_relayout", source = session$ns("histogram_plot"))
    509 - 1x + 1x +
                    if (any(grepl("shapes", names(event)))) {
    @@ -11469,42 +11925,48 @@

    teal.slice coverage - 66.10%

    536 - 5x + 5x +
              private$observers$selection_api <-
    537 - 5x + 5x +
                observeEvent(
    538 - 5x + 5x +
                  ignoreNULL = FALSE,
    539 - 5x + 5x +
                  ignoreInit = TRUE,
    540 - 5x + 5x +
                  eventExpr = private$get_selected(),
    541 - 5x + 5x +
                  handlerExpr = {
    @@ -11595,35 +12057,40 @@

    teal.slice coverage - 66.10%

    554 - 5x + 5x +
              private$observers$selection_manual <- observeEvent(
    555 - 5x + 5x +
                ignoreNULL = FALSE,
    556 - 5x + 5x +
                ignoreInit = TRUE,
    557 - 5x + 5x +
                eventExpr = selection_manual(),
    558 - 5x + 5x +
                handlerExpr = {
    @@ -11889,14 +12356,16 @@

    teal.slice coverage - 66.10%

    596 - 5x + 5x +
              private$keep_inf_srv("keep_inf")
    597 - 5x + 5x +
              private$keep_na_srv("keep_na")
    @@ -11910,14 +12379,16 @@

    teal.slice coverage - 66.10%

    599 - 5x + 5x +
              logger::log_trace("RangeFilterState$server initialized, id: { private$get_id() }")
    600 - 5x + 5x +
              NULL
    @@ -12204,42 +12675,48 @@

    teal.slice coverage - 66.10%

    641 - 5x + 5x +
          selection <- private$get_selected()
    642 - 5x + 5x +
          tagList(
    643 - 5x + 5x +
            tags$span(HTML(selection[1], "&ndash;", selection[2]), class = "filter-card-summary-value"),
    644 - 5x + 5x +
            tags$span(
    645 - 5x + 5x +
              class = "filter-card-summary-controls",
    646 - 5x + 5x +
              if (private$na_count > 0) {
    @@ -12260,7 +12737,8 @@

    teal.slice coverage - 66.10%

    649 - 5x + 5x +
              if (private$inf_count > 0) {
    @@ -12344,7 +12822,8 @@

    teal.slice coverage - 66.10%

    661 - 5x + 5x +
          ns <- NS(id)
    @@ -12358,7 +12837,8 @@

    teal.slice coverage - 66.10%

    663 - 5x + 5x +
          if (private$inf_count > 0) {
    @@ -12498,7 +12978,8 @@

    teal.slice coverage - 66.10%

    683 - 5x + 5x +
            NULL
    @@ -12575,7 +13056,8 @@

    teal.slice coverage - 66.10%

    694 - 5x + 5x +
          moduleServer(id, function(input, output, session) {
    @@ -12603,42 +13085,48 @@

    teal.slice coverage - 66.10%

    698 - 5x + 5x +
            output$trigger_visible <- renderUI({
    699 - 5x + 5x +
              updateCountText(
    700 - 5x + 5x +
                inputId = "count_label",
    701 - 5x + 5x +
                label = "Keep Inf",
    702 - 5x + 5x +
                countmax = private$inf_count,
    703 - 5x + 5x +
                countnow = private$inf_filtered_count()
    @@ -12652,7 +13140,8 @@

    teal.slice coverage - 66.10%

    705 - 5x + 5x +
              NULL
    @@ -12694,35 +13183,40 @@

    teal.slice coverage - 66.10%

    711 - 5x + 5x +
            private$observers$keep_inf_api <- observeEvent(
    712 - 5x + 5x +
              ignoreNULL = TRUE, # its not possible for range that NULL is selected
    713 - 5x + 5x +
              ignoreInit = TRUE, # ignoreInit: should not matter because we set the UI with the desired initial state
    714 - 5x + 5x +
              eventExpr = private$get_keep_inf(),
    715 - 5x + 5x +
              handlerExpr = {
    @@ -12799,35 +13293,40 @@

    teal.slice coverage - 66.10%

    726 - 5x + 5x +
            private$observers$keep_inf <- observeEvent(
    727 - 5x + 5x +
              ignoreNULL = TRUE, # it's not possible for range that NULL is selected
    728 - 5x + 5x +
              ignoreInit = TRUE, # ignoreInit: should not matter because we set the UI with the desired initial state
    729 - 5x + 5x +
              eventExpr = input$value,
    730 - 5x + 5x +
              handlerExpr = {
    @@ -12876,7 +13375,8 @@

    teal.slice coverage - 66.10%

    737 - 5x + 5x +
            invisible(NULL)
    @@ -13281,28 +13781,32 @@

    teal.slice coverage - 66.10%

    53 - 274x + 274x +
          checkmate::assert_string(dataname)
    54 - 272x + 272x +
          logger::log_trace("Instantiating { class(self)[1] }, dataname: { dataname }")
    55 - 272x + 272x +
          checkmate::assert_function(data_reactive, args = "sid")
    56 - 272x + 272x +
          checkmate::assert_string(datalabel, null.ok = TRUE)
    @@ -13316,42 +13820,48 @@

    teal.slice coverage - 66.10%

    58 - 272x + 272x +
          private$dataname <- dataname
    59 - 272x + 272x +
          private$datalabel <- datalabel
    60 - 272x + 272x +
          private$dataname_prefixed <- dataname
    61 - 272x + 272x +
          private$data <- data
    62 - 272x + 272x +
          private$data_reactive <- data_reactive
    63 - 272x + 272x +
          private$state_list <- reactiveVal()
    @@ -13365,14 +13875,16 @@

    teal.slice coverage - 66.10%

    65 - 272x + 272x +
          logger::log_trace("Instantiated { class(self)[1] }, dataname: { private$dataname }")
    66 - 272x + 272x +
          invisible(self)
    @@ -13799,7 +14311,8 @@

    teal.slice coverage - 66.10%

    127 - 88x + 88x +
          logger::log_trace("FilterStates$get_call initializing")
    @@ -13834,21 +14347,24 @@

    teal.slice coverage - 66.10%

    132 - 88x + 88x +
          states_list <- private$state_list_get()
    133 - 88x + 88x +
          if (length(states_list) == 0) {
    134 - 52x + 52x +
            return(NULL)
    @@ -13862,35 +14378,40 @@

    teal.slice coverage - 66.10%

    136 - 36x + 36x +
          args <- vapply(
    137 - 36x + 36x +
            states_list,
    138 - 36x + 36x +
            function(x) {
    139 - 57x + 57x +
              arg <- x$get_state()$arg
    140 - 7x + 7x +
              `if`(is.null(arg), "", arg) # converting NULL -> "" to enable tapply.
    @@ -13904,7 +14425,8 @@

    teal.slice coverage - 66.10%

    142 - 36x + 36x +
            character(1)
    @@ -13925,35 +14447,40 @@

    teal.slice coverage - 66.10%

    145 - 36x + 36x +
          filter_items <- tapply(
    146 - 36x + 36x +
            X = states_list,
    147 - 36x + 36x +
            INDEX = args,
    148 - 36x + 36x +
            simplify = FALSE,
    149 - 36x + 36x +
            function(items) {
    @@ -13967,14 +14494,16 @@

    teal.slice coverage - 66.10%

    151 - 38x + 38x +
              other_filter_idx <- !names(items) %in% sid
    152 - 38x + 38x +
              filtered_items <- items[other_filter_idx]
    @@ -13988,42 +14517,48 @@

    teal.slice coverage - 66.10%

    154 - 38x + 38x +
              calls <- Filter(
    155 - 38x + 38x +
                Negate(is.null),
    156 - 38x + 38x +
                lapply(
    157 - 38x + 38x +
                  filtered_items,
    158 - 38x + 38x +
                  function(state) {
    159 - 51x + 51x +
                    state$get_call(dataname = private$dataname_prefixed)
    @@ -14051,7 +14586,8 @@

    teal.slice coverage - 66.10%

    163 - 38x + 38x +
              calls_combine_by(calls, operator = "&")
    @@ -14072,21 +14608,24 @@

    teal.slice coverage - 66.10%

    166 - 36x + 36x +
          filter_items <- Filter(
    167 - 36x + 36x +
            x = filter_items,
    168 - 36x + 36x +
            f = Negate(is.null)
    @@ -14100,49 +14639,56 @@

    teal.slice coverage - 66.10%

    170 - 36x + 36x +
          if (length(filter_items) > 0L) {
    171 - 35x + 35x +
            filter_function <- private$fun
    172 - 35x + 35x +
            data_name <- str2lang(private$dataname_prefixed)
    173 - 35x + 35x +
            substitute(
    174 - 35x + 35x +
              env = list(
    175 - 35x + 35x +
                lhs = data_name,
    176 - 35x + 35x +
                rhs = as.call(c(filter_function, c(list(data_name), filter_items)))
    @@ -14156,7 +14702,8 @@

    teal.slice coverage - 66.10%

    178 - 35x + 35x +
              expr = lhs <- rhs
    @@ -14184,7 +14731,8 @@

    teal.slice coverage - 66.10%

    182 - 1x + 1x +
            NULL
    @@ -14338,35 +14886,40 @@

    teal.slice coverage - 66.10%

    204 - 17x + 17x +
          checkmate::assert_class(state, "teal_slices")
    205 - 17x + 17x +
          isolate({
    206 - 17x + 17x +
            state_ids <- vapply(state, `[[`, character(1), "id")
    207 - 17x + 17x +
            logger::log_trace("{ class(self)[1] }$remove_filter_state removing filters, state_id: { toString(state_ids) }")
    208 - 17x + 17x +
            private$state_list_remove(state_ids)
    @@ -14380,7 +14933,8 @@

    teal.slice coverage - 66.10%

    210 - 17x + 17x +
          invisible(NULL)
    @@ -14464,14 +15018,16 @@

    teal.slice coverage - 66.10%

    222 - 364x + 364x +
          slices <- unname(lapply(private$state_list(), function(x) x$get_state()))
    223 - 364x + 364x +
          fs <- do.call(teal_slices, c(slices, list(count_type = private$count_type)))
    @@ -14485,35 +15041,40 @@

    teal.slice coverage - 66.10%

    225 - 364x + 364x +
          include_varnames <- private$include_varnames
    226 - 364x + 364x +
          if (length(include_varnames)) {
    227 - 214x + 214x +
            attr(fs, "include_varnames") <- structure(
    228 - 214x + 214x +
              list(include_varnames),
    229 - 214x + 214x +
              names = private$dataname
    @@ -14541,35 +15102,40 @@

    teal.slice coverage - 66.10%

    233 - 364x + 364x +
          exclude_varnames <- private$exclude_varnames
    234 - 364x + 364x +
          if (length(exclude_varnames)) {
    235 - 9x + 9x +
            attr(fs, "exclude_varnames") <- structure(
    236 - 9x + 9x +
              list(exclude_varnames),
    237 - 9x + 9x +
              names = private$dataname
    @@ -14597,7 +15163,8 @@

    teal.slice coverage - 66.10%

    241 - 364x + 364x +
          fs
    @@ -14653,49 +15220,56 @@

    teal.slice coverage - 66.10%

    249 - 135x + 135x +
          isolate({
    250 - 135x + 135x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initializing, dataname: { private$dataname }")
    251 - 135x + 135x +
            checkmate::assert_class(state, "teal_slices")
    252 - 135x + 135x +
            lapply(state, function(x) {
    253 - 177x + 177x +
              checkmate::assert_true(
    254 - 177x + 177x +
                x$dataname == private$dataname,
    255 - 177x + 177x +
                .var.name = "dataname matches private$dataname"
    @@ -14723,21 +15297,24 @@

    teal.slice coverage - 66.10%

    259 - 135x + 135x +
            private$set_filterable_varnames(
    260 - 135x + 135x +
              include_varnames = attr(state, "include_varnames")[[private$dataname]],
    261 - 135x + 135x +
              exclude_varnames = attr(state, "exclude_varnames")[[private$dataname]]
    @@ -14751,21 +15328,24 @@

    teal.slice coverage - 66.10%

    263 - 135x + 135x +
            count_type <- attr(state, "count_type")
    264 - 135x + 135x +
            if (length(count_type)) {
    265 - 21x + 21x +
              private$count_type <- count_type
    @@ -14793,35 +15373,40 @@

    teal.slice coverage - 66.10%

    269 - 135x + 135x +
            varnames <- unique(unlist(lapply(state, "[[", "varname")))
    270 - 135x + 135x +
            excluded_varnames <- setdiff(varnames, private$get_filterable_varnames())
    271 - 135x + 135x +
            if (length(excluded_varnames)) {
    272 - 3x + 3x +
              state <- Filter(function(x) !isTRUE(x$varname %in% excluded_varnames), state)
    273 - 3x + 3x +
              logger::log_warn("filters for columns: { toString(excluded_varnames) } excluded from { private$dataname }")
    @@ -14842,35 +15427,40 @@

    teal.slice coverage - 66.10%

    276 - 135x + 135x +
            if (length(state) > 0) {
    277 - 93x + 93x +
              private$set_filter_state_impl(
    278 - 93x + 93x +
                state = state,
    279 - 93x + 93x +
                data = private$data,
    280 - 93x + 93x +
                data_reactive = private$data_reactive
    @@ -14891,7 +15481,8 @@

    teal.slice coverage - 66.10%

    283 - 135x + 135x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initialized, dataname: { private$dataname }")
    @@ -14912,7 +15503,8 @@

    teal.slice coverage - 66.10%

    286 - 135x + 135x +
          invisible(NULL)
    @@ -14996,14 +15588,16 @@

    teal.slice coverage - 66.10%

    298 - 25x + 25x +
          private$state_list_empty(force)
    299 - 25x + 25x +
          invisible(NULL)
    @@ -15255,49 +15849,56 @@

    teal.slice coverage - 66.10%

    335 - 12x + 12x +
          moduleServer(
    336 - 12x + 12x +
            id = id,
    337 - 12x + 12x +
            function(input, output, session) {
    338 - 12x + 12x +
              logger::log_trace("FilterState$srv_active initializing, dataname: { private$dataname }")
    339 - 12x + 12x +
              current_state <- reactive(private$state_list_get())
    340 - 12x + 12x +
              previous_state <- reactiveVal(NULL) # FilterState list
    341 - 12x + 12x +
              added_states <- reactiveVal(NULL) # FilterState list
    @@ -15318,21 +15919,24 @@

    teal.slice coverage - 66.10%

    344 - 12x + 12x +
              fs_to_shiny_ns <- function(x) {
    345 - 24x + 24x +
                checkmate::assert_multi_class(x, c("FilterState", "FilterStateExpr"))
    346 - 24x + 24x +
                gsub("[^[:alnum:]]+", "_", get_default_slice_id(x$get_state()))
    @@ -15353,28 +15957,32 @@

    teal.slice coverage - 66.10%

    349 - 12x + 12x +
              output$trigger_visible_state_change <- renderUI({
    350 - 14x + 14x +
                current_state()
    351 - 14x + 14x +
                isolate({
    352 - 14x + 14x +
                  logger::log_trace("FilterStates$srv_active@1 determining added and removed filter states")
    @@ -15388,21 +15996,24 @@

    teal.slice coverage - 66.10%

    354 - 14x + 14x +
                  added_states(setdiff_teal_slices(current_state(), previous_state()))
    355 - 14x + 14x +
                  previous_state(current_state())
    356 - 14x + 14x +
                  NULL
    @@ -15430,42 +16041,48 @@

    teal.slice coverage - 66.10%

    360 - 12x + 12x +
              output[["cards"]] <- renderUI({
    361 - 14x + 14x +
                lapply(
    362 - 14x + 14x +
                  current_state(), # observes only if added/removed
    363 - 14x + 14x +
                  function(state) {
    364 - 12x + 12x +
                    isolate( # isolates when existing state changes
    365 - 12x + 12x +
                      state$ui(id = session$ns(fs_to_shiny_ns(state)), parent_id = session$ns("cards"))
    @@ -15507,21 +16124,24 @@

    teal.slice coverage - 66.10%

    371 - 12x + 12x +
              observeEvent(
    372 - 12x + 12x +
                added_states(), # we want to call FilterState module only once when it's added
    373 - 12x + 12x +
                ignoreNULL = TRUE,
    @@ -15535,63 +16155,72 @@

    teal.slice coverage - 66.10%

    375 - 10x + 10x +
                  added_state_names <- vapply(added_states(), function(x) x$get_state()$id, character(1L))
    376 - 10x + 10x +
                  logger::log_trace("FilterStates$srv_active@2 triggered by added states: { toString(added_state_names) }")
    377 - 10x + 10x +
                  lapply(added_states(), function(state) {
    378 - 12x + 12x +
                    fs_callback <- state$server(id = fs_to_shiny_ns(state))
    379 - 12x + 12x +
                    observeEvent(
    380 - 12x + 12x +
                      once = TRUE, # remove button can be called once, should be destroyed afterwards
    381 - 12x + 12x +
                      ignoreInit = TRUE, # ignoreInit: should not matter because we destroy the previous input set of the UI
    382 - 12x + 12x +
                      eventExpr = fs_callback(), # when remove button is clicked in the FilterState ui
    383 - 12x + 12x +
                      handlerExpr = private$state_list_remove(state$get_state()$id)
    @@ -15612,7 +16241,8 @@

    teal.slice coverage - 66.10%

    386 - 10x + 10x +
                  added_states(NULL)
    @@ -15640,7 +16270,8 @@

    teal.slice coverage - 66.10%

    390 - 12x + 12x +
              NULL
    @@ -15738,14 +16369,16 @@

    teal.slice coverage - 66.10%

    404 - 1x + 1x +
          checkmate::assert_string(id)
    405 - 1x + 1x +
          data <- private$data
    @@ -15759,7 +16392,8 @@

    teal.slice coverage - 66.10%

    407 - 1x + 1x +
          ns <- NS(id)
    @@ -15773,14 +16407,16 @@

    teal.slice coverage - 66.10%

    409 - 1x + 1x +
          if (ncol(data) == 0) {
    410 - 1x + 1x +
            div("no sample variables available")
    @@ -15920,28 +16556,32 @@

    teal.slice coverage - 66.10%

    430 - 8x + 8x +
          moduleServer(
    431 - 8x + 8x +
            id = id,
    432 - 8x + 8x +
            function(input, output, session) {
    433 - 8x + 8x +
              logger::log_trace("FilterStates$srv_add initializing, dataname: { private$dataname }")
    @@ -15962,42 +16602,48 @@

    teal.slice coverage - 66.10%

    436 - 8x + 8x +
              avail_column_choices <- reactive({
    437 - 9x + 9x +
                data <- private$data
    438 - 9x + 9x +
                vars_include <- private$get_filterable_varnames()
    439 - 9x + 9x +
                active_filter_vars <- unique(unlist(lapply(self$get_filter_state(), "[[", "varname")))
    440 - 9x + 9x +
                choices <- setdiff(vars_include, active_filter_vars)
    441 - 9x + 9x +
                varlabels <- get_varlabels(data)
    @@ -16011,35 +16657,40 @@

    teal.slice coverage - 66.10%

    443 - 9x + 9x +
                data_choices_labeled(
    444 - 9x + 9x +
                  data = data,
    445 - 9x + 9x +
                  choices = choices,
    446 - 9x + 9x +
                  varlabels = varlabels,
    447 - 9x + 9x +
                  keys = private$keys
    @@ -16074,21 +16725,24 @@

    teal.slice coverage - 66.10%

    452 - 8x + 8x +
              output$add_filter <- renderUI({
    453 - 6x + 6x +
                logger::log_trace(
    454 - 6x + 6x +
                  "FilterStates$srv_add@1 updating available column choices, dataname: { private$dataname }"
    @@ -16102,7 +16756,8 @@

    teal.slice coverage - 66.10%

    456 - 6x + 6x +
                if (length(avail_column_choices()) == 0) {
    @@ -16123,56 +16778,64 @@

    teal.slice coverage - 66.10%

    459 - 6x + 6x +
                  div(
    460 - 6x + 6x +
                    teal.widgets::optionalSelectInput(
    461 - 6x + 6x +
                      session$ns("var_to_add"),
    462 - 6x + 6x +
                      choices = avail_column_choices(),
    463 - 6x + 6x +
                      selected = NULL,
    464 - 6x + 6x +
                      options = shinyWidgets::pickerOptions(
    465 - 6x + 6x +
                        liveSearch = TRUE,
    466 - 6x + 6x +
                        noneSelectedText = "Select variable to filter"
    @@ -16221,56 +16884,64 @@

    teal.slice coverage - 66.10%

    473 - 8x + 8x +
              observeEvent(
    474 - 8x + 8x +
                eventExpr = input$var_to_add,
    475 - 8x + 8x +
                handlerExpr = {
    476 - 3x + 3x +
                  logger::log_trace(
    477 - 3x + 3x +
                    sprintf(
    478 - 3x + 3x +
                      "FilterStates$srv_add@2 adding FilterState of variable %s, dataname: %s",
    479 - 3x + 3x +
                      input$var_to_add,
    480 - 3x + 3x +
                      private$dataname
    @@ -16291,21 +16962,24 @@

    teal.slice coverage - 66.10%

    483 - 3x + 3x +
                  self$set_filter_state(
    484 - 3x + 3x +
                    teal_slices(
    485 - 3x + 3x +
                      teal_slice(dataname = private$dataname, varname = input$var_to_add)
    @@ -16326,35 +17000,40 @@

    teal.slice coverage - 66.10%

    488 - 3x + 3x +
                  logger::log_trace(
    489 - 3x + 3x +
                    sprintf(
    490 - 3x + 3x +
                      "FilterStates$srv_add@2 added FilterState of variable %s, dataname: %s",
    491 - 3x + 3x +
                      input$var_to_add,
    492 - 3x + 3x +
                      private$dataname
    @@ -16396,14 +17075,16 @@

    teal.slice coverage - 66.10%

    498 - 8x + 8x +
              logger::log_trace("FilterStates$srv_add initialized, dataname: { private$dataname }")
    499 - 8x + 8x +
              NULL
    @@ -16662,14 +17343,16 @@

    teal.slice coverage - 66.10%

    536 - 288x + 288x +
          if ((length(include_varnames) + length(exclude_varnames)) == 0L) {
    537 - 113x + 113x +
            return(invisible(NULL))
    @@ -16683,21 +17366,24 @@

    teal.slice coverage - 66.10%

    539 - 175x + 175x +
          checkmate::assert_character(include_varnames, any.missing = FALSE, min.len = 0L, null.ok = TRUE)
    540 - 175x + 175x +
          checkmate::assert_character(exclude_varnames, any.missing = FALSE, min.len = 0L, null.ok = TRUE)
    541 - 175x + 175x +
          if (length(include_varnames) && length(exclude_varnames)) {
    @@ -16746,28 +17432,32 @@

    teal.slice coverage - 66.10%

    548 - 175x + 175x +
          supported_vars <- get_supported_filter_varnames(private$data)
    549 - 175x + 175x +
          if (length(include_varnames)) {
    550 - 161x + 161x +
            private$include_varnames <- intersect(include_varnames, supported_vars)
    551 - 161x + 161x +
            private$exclude_varnames <- character(0)
    @@ -16781,14 +17471,16 @@

    teal.slice coverage - 66.10%

    553 - 14x + 14x +
            private$exclude_varnames <- exclude_varnames
    554 - 14x + 14x +
            private$include_varnames <- character(0)
    @@ -16802,7 +17494,8 @@

    teal.slice coverage - 66.10%

    556 - 175x + 175x +
          invisible(NULL)
    @@ -16879,14 +17572,16 @@

    teal.slice coverage - 66.10%

    567 - 144x + 144x +
          if (length(private$include_varnames)) {
    568 - 97x + 97x +
            private$include_varnames
    @@ -16900,14 +17595,16 @@

    teal.slice coverage - 66.10%

    570 - 47x + 47x +
            supported_varnames <- get_supported_filter_varnames(private$data)
    571 - 47x + 47x +
            setdiff(supported_varnames, private$exclude_varnames)
    @@ -17012,7 +17709,8 @@

    teal.slice coverage - 66.10%

    586 - 212x + 212x +
          checkmate::assert_string(state_id, null.ok = TRUE)
    @@ -17026,14 +17724,16 @@

    teal.slice coverage - 66.10%

    588 - 212x + 212x +
          if (is.null(state_id)) {
    589 - 212x + 212x +
            private$state_list()
    @@ -17159,49 +17859,56 @@

    teal.slice coverage - 66.10%

    607 - 183x + 183x +
          logger::log_trace("{ class(self)[1] } pushing into state_list, dataname: { private$dataname }")
    608 - 183x + 183x +
          checkmate::assert_string(state_id)
    609 - 183x + 183x +
          checkmate::assert_multi_class(x, c("FilterState", "FilterStateExpr"))
    610 - 183x + 183x +
          state <- stats::setNames(list(x), state_id)
    611 - 183x + 183x +
          new_state_list <- c(
    612 - 183x + 183x +
            isolate(private$state_list()),
    613 - 183x + 183x +
            state
    @@ -17215,7 +17922,8 @@

    teal.slice coverage - 66.10%

    615 - 183x + 183x +
          isolate(private$state_list(new_state_list))
    @@ -17229,14 +17937,16 @@

    teal.slice coverage - 66.10%

    617 - 183x + 183x +
          logger::log_trace("{ class(self)[1] } pushed into queue, dataname: { private$dataname }")
    618 - 183x + 183x +
          invisible(NULL)
    @@ -17355,14 +18065,16 @@

    teal.slice coverage - 66.10%

    635 - 32x + 32x +
          checkmate::assert_character(state_id)
    636 - 32x + 32x +
          logger::log_trace("{ class(self)[1] } removing a filter, state_id: { toString(state_id) }")
    @@ -17376,63 +18088,72 @@

    teal.slice coverage - 66.10%

    638 - 32x + 32x +
          isolate({
    639 - 32x + 32x +
            current_state_ids <- vapply(private$state_list(), function(x) x$get_state()$id, character(1))
    640 - 32x + 32x +
            to_remove <- state_id %in% current_state_ids
    641 - 32x + 32x +
            if (any(to_remove)) {
    642 - 31x + 31x +
              new_state_list <- Filter(
    643 - 31x + 31x +
                function(state) {
    644 - 68x + 68x +
                  if (state$get_state()$id %in% state_id) {
    645 - 54x + 54x +
                    if (state$get_state()$anchored && !force) {
    646 - 7x + 7x +
                      return(TRUE)
    @@ -17446,14 +18167,16 @@

    teal.slice coverage - 66.10%

    648 - 47x + 47x +
                      state$destroy_observers()
    649 - 47x + 47x +
                      FALSE
    @@ -17474,7 +18197,8 @@

    teal.slice coverage - 66.10%

    652 - 14x + 14x +
                    TRUE
    @@ -17495,7 +18219,8 @@

    teal.slice coverage - 66.10%

    655 - 31x + 31x +
                private$state_list()
    @@ -17509,7 +18234,8 @@

    teal.slice coverage - 66.10%

    657 - 31x + 31x +
              private$state_list(new_state_list)
    @@ -17523,7 +18249,8 @@

    teal.slice coverage - 66.10%

    659 - 1x + 1x +
              warning(sprintf("\"%s\" not found in state list", state_id))
    @@ -17551,7 +18278,8 @@

    teal.slice coverage - 66.10%

    663 - 32x + 32x +
          invisible(NULL)
    @@ -17621,21 +18349,24 @@

    teal.slice coverage - 66.10%

    673 - 25x + 25x +
          isolate({
    674 - 25x + 25x +
            logger::log_trace(
    675 - 25x + 25x +
              "{ class(self)[1] }$state_list_empty removing all non-anchored filters for dataname: { private$dataname }"
    @@ -17656,28 +18387,32 @@

    teal.slice coverage - 66.10%

    678 - 25x + 25x +
            state_list <- private$state_list()
    679 - 25x + 25x +
            if (length(state_list)) {
    680 - 15x + 15x +
              state_ids <- vapply(state_list, function(x) x$get_state()$id, character(1))
    681 - 15x + 15x +
              private$state_list_remove(state_ids, force)
    @@ -17705,7 +18440,8 @@

    teal.slice coverage - 66.10%

    685 - 25x + 25x +
          invisible(NULL)
    @@ -17831,35 +18567,40 @@

    teal.slice coverage - 66.10%

    703 - 211x + 211x +
          checkmate::assert_class(state, "teal_slices")
    704 - 211x + 211x +
          checkmate::assert_multi_class(data, c("data.frame", "matrix", "DataFrame", "HermesData"))
    705 - 211x + 211x +
          checkmate::assert_function(data_reactive, args = "sid")
    706 - 211x + 211x +
          if (length(state) == 0L) {
    707 - 101x + 101x +
            return(invisible(NULL))
    @@ -17880,14 +18621,16 @@

    teal.slice coverage - 66.10%

    710 - 110x + 110x +
          slices_hashed <- vapply(state, `[[`, character(1L), "id")
    711 - 110x + 110x +
          if (any(duplicated(slices_hashed))) {
    @@ -17936,28 +18679,32 @@

    teal.slice coverage - 66.10%

    718 - 110x + 110x +
          state_list <- isolate(private$state_list_get())
    719 - 110x + 110x +
          lapply(state, function(slice) {
    720 - 191x + 191x +
            state_id <- slice$id
    721 - 191x + 191x +
            if (state_id %in% names(state_list)) {
    @@ -17971,7 +18718,8 @@

    teal.slice coverage - 66.10%

    723 - 8x + 8x +
              state_list[[state_id]]$set_state(slice)
    @@ -17985,7 +18733,8 @@

    teal.slice coverage - 66.10%

    725 - 183x + 183x +
              if (inherits(slice, "teal_slice_expr")) {
    @@ -17999,7 +18748,8 @@

    teal.slice coverage - 66.10%

    727 - 6x + 6x +
                fstate <- init_filter_state_expr(slice)
    @@ -18020,14 +18770,16 @@

    teal.slice coverage - 66.10%

    730 - 177x + 177x +
                fstate <- init_filter_state(
    731 - 177x + 177x +
                  x = data[, slice$varname, drop = TRUE],
    @@ -18076,14 +18828,16 @@

    teal.slice coverage - 66.10%

    738 - 177x + 177x +
                  x_reactive = if (private$count_type == "none") {
    739 - 171x + 171x +
                    reactive(NULL)
    @@ -18097,7 +18851,8 @@

    teal.slice coverage - 66.10%

    741 - 6x + 6x +
                    reactive(data_reactive(state_id)[, slice$varname, drop = TRUE])
    @@ -18111,14 +18866,16 @@

    teal.slice coverage - 66.10%

    743 - 177x + 177x +
                  slice = slice,
    744 - 177x + 177x +
                  extract_type = private$extract_type
    @@ -18139,7 +18896,8 @@

    teal.slice coverage - 66.10%

    747 - 183x + 183x +
              private$state_list_push(x = fstate, state_id = state_id)
    @@ -18167,7 +18925,8 @@

    teal.slice coverage - 66.10%

    751 - 110x + 110x +
          invisible(NULL)
    @@ -18579,7 +19338,8 @@

    teal.slice coverage - 66.10%

    55 - 23x + 23x +
          if (!requireNamespace("MultiAssayExperiment", quietly = TRUE)) {
    @@ -18600,21 +19360,24 @@

    teal.slice coverage - 66.10%

    58 - 23x + 23x +
          checkmate::assert_class(dataset, "MultiAssayExperiment")
    59 - 21x + 21x +
          super$initialize(dataset, dataname, keys, label)
    60 - 21x + 21x +
          experiment_names <- names(dataset)
    @@ -18635,49 +19398,56 @@

    teal.slice coverage - 66.10%

    63 - 21x + 21x +
          private$add_filter_states(
    64 - 21x + 21x +
            filter_states = init_filter_states(
    65 - 21x + 21x +
              data = dataset,
    66 - 21x + 21x +
              data_reactive = private$data_filtered_fun,
    67 - 21x + 21x +
              dataname = dataname,
    68 - 21x + 21x +
              datalabel = "subjects",
    69 - 21x + 21x +
              keys = self$get_keys()
    @@ -18691,7 +19461,8 @@

    teal.slice coverage - 66.10%

    71 - 21x + 21x +
            id = "subjects"
    @@ -18726,70 +19497,80 @@

    teal.slice coverage - 66.10%

    76 - 21x + 21x +
          lapply(
    77 - 21x + 21x +
            experiment_names,
    78 - 21x + 21x +
            function(experiment_name) {
    79 - 105x + 105x +
              data_reactive <- function(sid = "") private$data_filtered_fun(sid)[[experiment_name]]
    80 - 105x + 105x +
              private$add_filter_states(
    81 - 105x + 105x +
                filter_states = init_filter_states(
    82 - 105x + 105x +
                  data = dataset[[experiment_name]],
    83 - 105x + 105x +
                  data_reactive = data_reactive,
    84 - 105x + 105x +
                  dataname = dataname,
    85 - 105x + 105x +
                  datalabel = experiment_name
    @@ -18803,7 +19584,8 @@

    teal.slice coverage - 66.10%

    87 - 105x + 105x +
                id = experiment_name
    @@ -18894,35 +19676,40 @@

    teal.slice coverage - 66.10%

    100 - 15x + 15x +
          isolate({
    101 - 15x + 15x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initializing, dataname: { private$dataname }")
    102 - 15x + 15x +
            checkmate::assert_class(state, "teal_slices")
    103 - 14x + 14x +
            lapply(state, function(x) {
    104 - 52x + 52x +
              checkmate::assert_true(x$dataname == private$dataname, .var.name = "dataname matches private$dataname")
    @@ -18950,14 +19737,16 @@

    teal.slice coverage - 66.10%

    108 - 14x + 14x +
            subject_state <- Filter(function(x) is.null(x$experiment), state)
    109 - 14x + 14x +
            private$get_filter_states()[["subjects"]]$set_filter_state(subject_state)
    @@ -18985,28 +19774,32 @@

    teal.slice coverage - 66.10%

    113 - 14x + 14x +
            experiments <- unique(unlist(lapply(state, "[[", "experiment")))
    114 - 14x + 14x +
            available_experiments <- setdiff(names(private$get_filter_states()), "subjects")
    115 - 14x + 14x +
            excluded_filters <- setdiff(experiments, available_experiments)
    116 - 14x + 14x +
            if (length(excluded_filters)) {
    @@ -19076,21 +19869,24 @@

    teal.slice coverage - 66.10%

    126 - 14x + 14x +
            lapply(available_experiments, function(experiment) {
    127 - 70x + 70x +
              slices <- Filter(function(x) identical(x$experiment, experiment), state)
    128 - 70x + 70x +
              private$get_filter_states()[[experiment]]$set_filter_state(slices)
    @@ -19111,7 +19907,8 @@

    teal.slice coverage - 66.10%

    131 - 14x + 14x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initialized, dataname: { private$dataname }")
    @@ -19125,7 +19922,8 @@

    teal.slice coverage - 66.10%

    133 - 14x + 14x +
            invisible(NULL)
    @@ -19223,7 +20021,8 @@

    teal.slice coverage - 66.10%

    147 - 1x + 1x +
          checkmate::assert_class(state, "teal_slices")
    @@ -19237,14 +20036,16 @@

    teal.slice coverage - 66.10%

    149 - 1x + 1x +
          isolate({
    150 - 1x + 1x +
            logger::log_trace("{ class(self)[1] }$remove_filter_state removing filter(s), dataname: { private$dataname }")
    @@ -19258,14 +20059,16 @@

    teal.slice coverage - 66.10%

    152 - 1x + 1x +
            subject_state <- Filter(function(x) is.null(x$experiment), state)
    153 - 1x + 1x +
            private$get_filter_states()[["subjects"]]$remove_filter_state(subject_state)
    @@ -19293,28 +20096,32 @@

    teal.slice coverage - 66.10%

    157 - 1x + 1x +
            experiments <- unique(unlist(lapply(state, "[[", "experiment")))
    158 - 1x + 1x +
            available_experiments <- setdiff(names(private$get_filter_states()), "subjects")
    159 - 1x + 1x +
            excluded_filters <- setdiff(experiments, available_experiments)
    160 - 1x + 1x +
            if (length(excluded_filters)) {
    @@ -19377,7 +20184,8 @@

    teal.slice coverage - 66.10%

    169 - 1x + 1x +
            lapply(experiments, function(experiment) {
    @@ -19419,7 +20227,8 @@

    teal.slice coverage - 66.10%

    175 - 1x + 1x +
            logger::log_trace("{ class(self)[1] }$remove_filter_state removed filter(s), dataname: { private$dataname }")
    @@ -19440,7 +20249,8 @@

    teal.slice coverage - 66.10%

    178 - 1x + 1x +
          invisible(NULL)
    @@ -19727,21 +20537,24 @@

    teal.slice coverage - 66.10%

    219 - 2x + 2x +
          data <- self$get_dataset()
    220 - 2x + 2x +
          data_filtered <- self$get_dataset(TRUE)
    221 - 2x + 2x +
          experiment_names <- names(data)
    @@ -19755,28 +20568,32 @@

    teal.slice coverage - 66.10%

    223 - 2x + 2x +
          mae_info <- data.frame(
    224 - 2x + 2x +
            dataname = private$dataname,
    225 - 2x + 2x +
            subjects = nrow(SummarizedExperiment::colData(data)),
    226 - 2x + 2x +
            subjects_filtered = nrow(SummarizedExperiment::colData(data_filtered()))
    @@ -19797,49 +20614,56 @@

    teal.slice coverage - 66.10%

    229 - 2x + 2x +
          experiment_obs_info <- do.call("rbind", lapply(
    230 - 2x + 2x +
            experiment_names,
    231 - 2x + 2x +
            function(experiment_name) {
    232 - 10x + 10x +
              data.frame(
    233 - 10x + 10x +
                dataname = sprintf("- %s", experiment_name),
    234 - 10x + 10x +
                obs = nrow(data[[experiment_name]]),
    235 - 10x + 10x +
                obs_filtered = nrow(data_filtered()[[experiment_name]])
    @@ -19874,21 +20698,24 @@

    teal.slice coverage - 66.10%

    240 - 2x + 2x +
          get_experiment_keys <- function(mae, experiment) {
    241 - 20x + 20x +
            sample_subset <- subset(MultiAssayExperiment::sampleMap(mae), colname %in% colnames(experiment))
    242 - 20x + 20x +
            length(unique(sample_subset$primary))
    @@ -19909,42 +20736,48 @@

    teal.slice coverage - 66.10%

    245 - 2x + 2x +
          experiment_subjects_info <- do.call("rbind", lapply(
    246 - 2x + 2x +
            experiment_names,
    247 - 2x + 2x +
            function(experiment_name) {
    248 - 10x + 10x +
              data.frame(
    249 - 10x + 10x +
                subjects = get_experiment_keys(data, data[[experiment_name]]),
    250 - 10x + 10x +
                subjects_filtered = get_experiment_keys(data_filtered(), data_filtered()[[experiment_name]])
    @@ -19979,14 +20812,16 @@

    teal.slice coverage - 66.10%

    255 - 2x + 2x +
          experiment_info <- cbind(experiment_obs_info, experiment_subjects_info)
    256 - 2x + 2x +
          dplyr::bind_rows(mae_info, experiment_info)
    @@ -20258,7 +21093,8 @@

    teal.slice coverage - 66.10%

    35 - 92x + 92x +
          if (!requireNamespace("SummarizedExperiment", quietly = TRUE)) {
    @@ -20279,35 +21115,40 @@

    teal.slice coverage - 66.10%

    38 - 92x + 92x +
          checkmate::assert_function(data_reactive, args = "sid")
    39 - 92x + 92x +
          checkmate::assert_class(data, "SummarizedExperiment")
    40 - 91x + 91x +
          super$initialize(data, data_reactive, dataname, datalabel)
    41 - 91x + 91x +
          if (!is.null(datalabel)) {
    42 - 84x + 84x +
            private$dataname_prefixed <- sprintf("%s[['%s']]", dataname, datalabel)
    @@ -20398,35 +21239,40 @@

    teal.slice coverage - 66.10%

    55 - 61x + 61x +
          isolate({
    56 - 61x + 61x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initializing, dataname: { private$dataname }")
    57 - 61x + 61x +
            checkmate::assert_class(state, "teal_slices")
    58 - 59x + 59x +
            lapply(state, function(x) {
    59 - 17x + 17x +
              checkmate::assert_choice(x$arg, choices = c("subset", "select"), null.ok = TRUE, .var.name = "teal_slice$arg")
    @@ -20440,21 +21286,24 @@

    teal.slice coverage - 66.10%

    61 - 59x + 59x +
            count_type <- attr(state, "count_type")
    62 - 59x + 59x +
            if (length(count_type)) {
    63 - 8x + 8x +
              private$count_type <- count_type
    @@ -20475,35 +21324,40 @@

    teal.slice coverage - 66.10%

    66 - 59x + 59x +
            subset_states <- Filter(function(x) x$arg == "subset", state)
    67 - 59x + 59x +
            private$set_filter_state_impl(
    68 - 59x + 59x +
              state = subset_states,
    69 - 59x + 59x +
              data = SummarizedExperiment::rowData(private$data),
    70 - 59x + 59x +
              data_reactive = function(sid = "") {
    @@ -20559,35 +21413,40 @@

    teal.slice coverage - 66.10%

    78 - 59x + 59x +
            select_states <- Filter(function(x) x$arg == "select", state)
    79 - 59x + 59x +
            private$set_filter_state_impl(
    80 - 59x + 59x +
              state = select_states,
    81 - 59x + 59x +
              data = SummarizedExperiment::colData(private$data),
    82 - 59x + 59x +
              data_reactive = function(sid = "") {
    @@ -20643,14 +21502,16 @@

    teal.slice coverage - 66.10%

    90 - 59x + 59x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initialized, dataname: { private$dataname }")
    91 - 59x + 59x +
            invisible(NULL)
    @@ -20720,49 +21581,56 @@

    teal.slice coverage - 66.10%

    101 - 2x + 2x +
          data <- private$data
    102 - 2x + 2x +
          checkmate::assert_string(id)
    103 - 2x + 2x +
          ns <- NS(id)
    104 - 2x + 2x +
          row_input <- if (ncol(SummarizedExperiment::rowData(data)) == 0) {
    105 - 1x + 1x +
            div("no sample variables available")
    106 - 2x + 2x +
          } else if (nrow(SummarizedExperiment::rowData(data)) == 0) {
    107 - 1x + 1x +
            div("no samples available")
    @@ -20846,28 +21714,32 @@

    teal.slice coverage - 66.10%

    119 - 2x + 2x +
          col_input <- if (ncol(SummarizedExperiment::colData(data)) == 0) {
    120 - 1x + 1x +
            div("no sample variables available")
    121 - 2x + 2x +
          } else if (nrow(SummarizedExperiment::colData(data)) == 0) {
    122 - 1x + 1x +
            div("no samples available")
    @@ -20951,21 +21823,24 @@

    teal.slice coverage - 66.10%

    134 - 2x + 2x +
          div(
    135 - 2x + 2x +
            row_input,
    136 - 2x + 2x +
            col_input
    @@ -22616,35 +23491,40 @@

    teal.slice coverage - 66.10%

    66 - 195x + 195x +
      checkmate::assert_class(x_reactive, "reactive")
    67 - 194x + 194x +
      checkmate::assert_character(extract_type, max.len = 1, any.missing = FALSE)
    68 - 194x + 194x +
      checkmate::assert_class(slice, "teal_slice")
    69 - 193x + 193x +
      if (length(extract_type) == 1) {
    70 - 43x + 43x +
        checkmate::assert_choice(extract_type, choices = c("list", "matrix"))
    @@ -22665,42 +23545,48 @@

    teal.slice coverage - 66.10%

    73 - 192x + 192x +
      if (all(is.na(x))) {
    74 - 1x + 1x +
        EmptyFilterState$new(
    75 - 1x + 1x +
          x = x,
    76 - 1x + 1x +
          x_reactive = x_reactive,
    77 - 1x + 1x +
          slice = slice,
    78 - 1x + 1x +
          extract_type = extract_type
    @@ -22721,7 +23607,8 @@

    teal.slice coverage - 66.10%

    81 - 191x + 191x +
        UseMethod("init_filter_state")
    @@ -22791,35 +23678,40 @@

    teal.slice coverage - 66.10%

    91 - 1x + 1x +
      args <- list(
    92 - 1x + 1x +
        x = x,
    93 - 1x + 1x +
        x_reactive = x_reactive,
    94 - 1x + 1x +
        extract_type = extract_type,
    95 - 1x + 1x +
        slice
    @@ -22840,7 +23732,8 @@

    teal.slice coverage - 66.10%

    98 - 1x + 1x +
      do.call(FilterState$new, args)
    @@ -22903,35 +23796,40 @@

    teal.slice coverage - 66.10%

    107 - 1x + 1x +
      LogicalFilterState$new(
    108 - 1x + 1x +
        x = x,
    109 - 1x + 1x +
        x_reactive = x_reactive,
    110 - 1x + 1x +
        slice = slice,
    111 - 1x + 1x +
        extract_type = extract_type
    @@ -23001,35 +23899,40 @@

    teal.slice coverage - 66.10%

    121 - 120x + 120x +
      args <- list(
    122 - 120x + 120x +
        x = x,
    123 - 120x + 120x +
        x_reactive = x_reactive,
    124 - 120x + 120x +
        slice = slice,
    125 - 120x + 120x +
        extract_type = extract_type
    @@ -23050,14 +23953,16 @@

    teal.slice coverage - 66.10%

    128 - 120x + 120x +
      if (length(unique(x[!is.na(x)])) < getOption("teal.threshold_slider_vs_checkboxgroup")) {
    129 - 28x + 28x +
        do.call(ChoicesFilterState$new, args)
    @@ -23071,7 +23976,8 @@

    teal.slice coverage - 66.10%

    131 - 92x + 92x +
        do.call(RangeFilterState$new, args)
    @@ -23141,35 +24047,40 @@

    teal.slice coverage - 66.10%

    141 - 31x + 31x +
      ChoicesFilterState$new(
    142 - 31x + 31x +
        x = x,
    143 - 31x + 31x +
        x_reactive = x_reactive,
    144 - 31x + 31x +
        slice = slice,
    145 - 31x + 31x +
        extract_type = extract_type
    @@ -23239,35 +24150,40 @@

    teal.slice coverage - 66.10%

    155 - 32x + 32x +
      ChoicesFilterState$new(
    156 - 32x + 32x +
        x = x,
    157 - 32x + 32x +
        x_reactive = x_reactive,
    158 - 32x + 32x +
        slice = slice,
    159 - 32x + 32x +
        extract_type = extract_type
    @@ -23337,35 +24253,40 @@

    teal.slice coverage - 66.10%

    169 - 2x + 2x +
      args <- list(
    170 - 2x + 2x +
        x = x,
    171 - 2x + 2x +
        x_reactive = x_reactive,
    172 - 2x + 2x +
        slice = slice,
    173 - 2x + 2x +
        extract_type = extract_type
    @@ -23386,14 +24307,16 @@

    teal.slice coverage - 66.10%

    176 - 2x + 2x +
      if (length(unique(x[!is.na(x)])) < getOption("teal.threshold_slider_vs_checkboxgroup")) {
    177 - 1x + 1x +
        do.call(ChoicesFilterState$new, args)
    @@ -23407,7 +24330,8 @@

    teal.slice coverage - 66.10%

    179 - 1x + 1x +
        do.call(DateFilterState$new, args)
    @@ -23477,35 +24401,40 @@

    teal.slice coverage - 66.10%

    189 - 2x + 2x +
      args <- list(
    190 - 2x + 2x +
        x = x,
    191 - 2x + 2x +
        x_reactive = x_reactive,
    192 - 2x + 2x +
        slice = slice,
    193 - 2x + 2x +
        extract_type = extract_type
    @@ -23526,14 +24455,16 @@

    teal.slice coverage - 66.10%

    196 - 2x + 2x +
      if (length(unique(x[!is.na(x)])) < getOption("teal.threshold_slider_vs_checkboxgroup")) {
    197 - 1x + 1x +
        do.call(ChoicesFilterState$new, args)
    @@ -23547,7 +24478,8 @@

    teal.slice coverage - 66.10%

    199 - 1x + 1x +
        do.call(DatetimeFilterState$new, args)
    @@ -23617,35 +24549,40 @@

    teal.slice coverage - 66.10%

    209 - 2x + 2x +
      args <- list(
    210 - 2x + 2x +
        x = x,
    211 - 2x + 2x +
        x_reactive = x_reactive,
    212 - 2x + 2x +
        slice = slice,
    213 - 2x + 2x +
        extract_type = extract_type
    @@ -23666,14 +24603,16 @@

    teal.slice coverage - 66.10%

    216 - 2x + 2x +
      if (length(unique(x[!is.na(x)])) < getOption("teal.threshold_slider_vs_checkboxgroup")) {
    217 - 1x + 1x +
        do.call(ChoicesFilterState$new, args)
    @@ -23687,7 +24626,8 @@

    teal.slice coverage - 66.10%

    219 - 1x + 1x +
        do.call(DatetimeFilterState$new, args)
    @@ -23778,7 +24718,8 @@

    teal.slice coverage - 66.10%

    232 - 6x + 6x +
      FilterStateExpr$new(slice)
    @@ -23946,28 +24887,32 @@

    teal.slice coverage - 66.10%

    256 - 119x + 119x +
      checkmate::assert_string(color)
    257 - 119x + 119x +
      checkmate::assert(
    258 - 119x + 119x +
        checkmate::check_number(alpha, lower = 0, upper = 1, null.ok = TRUE),
    259 - 119x + 119x +
        checkmate::check_string(alpha, pattern = "[0-9a-f]{2}", null.ok = TRUE)
    @@ -23995,7 +24940,8 @@

    teal.slice coverage - 66.10%

    263 - 119x + 119x +
      sass_file <- if (utils::packageVersion("bslib") < as.package_version("0.5.1.9000")) {
    @@ -24016,7 +24962,8 @@

    teal.slice coverage - 66.10%

    266 - 119x + 119x +
        bslib::bs_theme()[["layers"]][[2]][["defaults"]][[1]][[1]]
    @@ -24030,7 +24977,8 @@

    teal.slice coverage - 66.10%

    268 - 119x + 119x +
      sass_file <- attr(sass_file, "sass_file_path")
    @@ -24051,7 +24999,8 @@

    teal.slice coverage - 66.10%

    271 - 119x + 119x +
      variables_file <- readLines(sass_file)
    @@ -24065,14 +25014,16 @@

    teal.slice coverage - 66.10%

    273 - 119x + 119x +
      ind <- grep("// scss-docs-(start|end) theme-color-variables", variables_file)
    274 - 119x + 119x +
      color_definitions <- variables_file[(ind[1] + 1L):(ind[2] - 1L)]
    @@ -24093,7 +25044,8 @@

    teal.slice coverage - 66.10%

    277 - 119x + 119x +
      color_names <- sub("(\\$)(\\w.+)(:.+)", "\\2", color_definitions)
    @@ -24114,7 +25066,8 @@

    teal.slice coverage - 66.10%

    280 - 119x + 119x +
      checkmate::assert_choice(color, color_names)
    @@ -24135,7 +25088,8 @@

    teal.slice coverage - 66.10%

    283 - 119x + 119x +
      color_references <- sub("(\\$)(\\w.+)(:\\s.+\\$)(\\w.+)(\\s.+)", "\\4", color_definitions)
    @@ -24156,42 +25110,48 @@

    teal.slice coverage - 66.10%

    286 - 119x + 119x +
      color_specification <- structure(color_references, names = color_names)
    287 - 119x + 119x +
      color_specification <- vapply(color_specification, function(x) {
    288 - 952x + 952x +
        line <- grep(sprintf("^\\$%s:\\s+#\\w{6}\\s+!default", x), variables_file, value = TRUE)
    289 - 952x + 952x +
        code <- sub("(.+)(#\\w{6})(\\s+.+)", "\\2", line)
    290 - 952x + 952x +
        code
    291 - 119x + 119x +
      }, character(1L))
    @@ -24205,7 +25165,8 @@

    teal.slice coverage - 66.10%

    293 - 119x + 119x +
      if (!is.null(alpha)) {
    @@ -24233,7 +25194,8 @@

    teal.slice coverage - 66.10%

    297 - 119x + 119x +
      paste0(color_specification[color], alpha)
    @@ -25156,28 +26118,32 @@

    teal.slice coverage - 66.10%

    130 - 16x + 16x +
          isolate({
    131 - 16x + 16x +
            checkmate::assert_logical(x)
    132 - 15x + 15x +
            checkmate::assert_logical(slice$selected, null.ok = TRUE)
    133 - 14x + 14x +
            super$initialize(x = x, x_reactive = x_reactive, slice = slice, extract_type = extract_type)
    @@ -25191,7 +26157,8 @@

    teal.slice coverage - 66.10%

    135 - 14x + 14x +
            private$set_choices(slice$choices)
    @@ -25205,28 +26172,32 @@

    teal.slice coverage - 66.10%

    137 - 14x + 14x +
            if (is.null(slice$selected) && slice$multiple) {
    138 - 7x + 7x +
              slice$selected <- private$get_choices()
    139 - 7x + 7x +
            } else if (length(slice$selected) != 1 && !slice$multiple) {
    140 - 3x + 3x +
              slice$selected <- TRUE
    @@ -25240,28 +26211,32 @@

    teal.slice coverage - 66.10%

    142 - 14x + 14x +
            private$set_selected(slice$selected)
    143 - 14x + 14x +
            df <- factor(x, levels = c(TRUE, FALSE))
    144 - 14x + 14x +
            tbl <- table(df)
    145 - 14x + 14x +
            private$set_choices_counts(tbl)
    @@ -25275,7 +26250,8 @@

    teal.slice coverage - 66.10%

    147 - 14x + 14x +
          invisible(self)
    @@ -25345,7 +26321,8 @@

    teal.slice coverage - 66.10%

    157 - 6x + 6x +
          if (isFALSE(private$is_any_filtered())) {
    @@ -25366,28 +26343,32 @@

    teal.slice coverage - 66.10%

    160 - 4x + 4x +
          if (missing(dataname)) dataname <- private$get_dataname()
    161 - 6x + 6x +
          varname <- private$get_varname_prefixed(dataname)
    162 - 6x + 6x +
          choices <- private$get_selected()
    163 - 6x + 6x +
          n_choices <- length(choices)
    @@ -25401,35 +26382,40 @@

    teal.slice coverage - 66.10%

    165 - 6x + 6x +
          filter_call <-
    166 - 6x + 6x +
            if (n_choices == 1 && choices) {
    167 - 1x + 1x +
              varname
    168 - 6x + 6x +
            } else if (n_choices == 1 && !choices) {
    169 - 4x + 4x +
              call("!", varname)
    @@ -25443,7 +26429,8 @@

    teal.slice coverage - 66.10%

    171 - 1x + 1x +
              call("%in%", varname, make_c_call(choices))
    @@ -25457,7 +26444,8 @@

    teal.slice coverage - 66.10%

    173 - 6x + 6x +
          private$add_keep_na_call(filter_call, varname)
    @@ -25527,14 +26515,16 @@

    teal.slice coverage - 66.10%

    183 - 14x + 14x +
          private$teal_slice$choices <- c(TRUE, FALSE)
    184 - 14x + 14x +
          invisible(NULL)
    @@ -25569,14 +26559,16 @@

    teal.slice coverage - 66.10%

    189 - 14x + 14x +
          private$choices_counts <- choices_counts
    190 - 14x + 14x +
          invisible(NULL)
    @@ -25597,35 +26589,40 @@

    teal.slice coverage - 66.10%

    193 - 21x + 21x +
          tryCatch(
    194 - 21x + 21x +
            expr = {
    195 - 21x + 21x +
              values <- as.logical(values)
    196 - 1x + 1x +
              if (anyNA(values)) stop()
    197 - 20x + 20x +
              values
    @@ -25639,7 +26636,8 @@

    teal.slice coverage - 66.10%

    199 - 21x + 21x +
            error = function(e) stop("Vector of set values must contain values coercible to logical.")
    @@ -25674,28 +26672,32 @@

    teal.slice coverage - 66.10%

    204 - 20x + 20x +
          if (!private$is_multiple() && length(values) > 1) {
    205 - 1x + 1x +
            warning(
    206 - 1x + 1x +
              sprintf("Selection: %s is not a vector of length one. ", toString(values, width = 360)),
    207 - 1x + 1x +
              "Maintaining previous selection."
    @@ -25709,7 +26711,8 @@

    teal.slice coverage - 66.10%

    209 - 1x + 1x +
            values <- isolate(private$get_selected())
    @@ -25723,7 +26726,8 @@

    teal.slice coverage - 66.10%

    211 - 20x + 20x +
          values
    @@ -25765,7 +26769,8 @@

    teal.slice coverage - 66.10%

    217 - 6x + 6x +
          if (private$is_choice_limited) {
    @@ -25779,14 +26784,16 @@

    teal.slice coverage - 66.10%

    219 - 6x + 6x +
          } else if (all(private$choices_counts > 0)) {
    220 - 6x + 6x +
            TRUE
    @@ -27612,14 +28619,16 @@

    teal.slice coverage - 66.10%

    71 - 103x + 103x +
          checkmate::assert_data_frame(dataset)
    72 - 101x + 101x +
          super$initialize(dataset, dataname, keys, label)
    @@ -27640,21 +28649,24 @@

    teal.slice coverage - 66.10%

    75 - 99x + 99x +
          if (!is.null(parent)) {
    76 - 10x + 10x +
            checkmate::assert_character(parent_name, len = 1)
    77 - 10x + 10x +
            checkmate::assert_character(join_keys, min.len = 1)
    @@ -27668,14 +28680,16 @@

    teal.slice coverage - 66.10%

    79 - 10x + 10x +
            private$parent_name <- parent_name
    80 - 10x + 10x +
            private$join_keys <- join_keys
    @@ -27689,28 +28703,32 @@

    teal.slice coverage - 66.10%

    82 - 10x + 10x +
            private$data_filtered_fun <- function(sid = "") {
    83 - 8x + 8x +
              checkmate::assert_character(sid)
    84 - 8x + 8x +
              if (length(sid)) {
    85 - 8x + 8x +
                logger::log_trace("filtering data dataname: { dataname }, sid: { sid }")
    @@ -27738,42 +28756,48 @@

    teal.slice coverage - 66.10%

    89 - 8x + 8x +
              env <- new.env(parent = parent.env(globalenv()))
    90 - 8x + 8x +
              env[[dataname]] <- private$dataset
    91 - 8x + 8x +
              env[[parent_name]] <- parent()
    92 - 8x + 8x +
              filter_call <- self$get_call(sid)
    93 - 8x + 8x +
              eval_expr_with_msg(filter_call, env)
    94 - 8x + 8x +
              get(x = dataname, envir = env)
    @@ -27801,42 +28825,48 @@

    teal.slice coverage - 66.10%

    98 - 99x + 99x +
          private$add_filter_states(
    99 - 99x + 99x +
            filter_states = init_filter_states(
    100 - 99x + 99x +
              data = dataset,
    101 - 99x + 99x +
              data_reactive = private$data_filtered_fun,
    102 - 99x + 99x +
              dataname = dataname,
    103 - 99x + 99x +
              keys = self$get_keys()
    @@ -27850,7 +28880,8 @@

    teal.slice coverage - 66.10%

    105 - 99x + 99x +
            id = "filter"
    @@ -27878,35 +28909,40 @@

    teal.slice coverage - 66.10%

    109 - 99x + 99x +
          if (!is.null(parent)) {
    110 - 10x + 10x +
            fs <- teal_slices(
    111 - 10x + 10x +
              exclude_varnames = structure(
    112 - 10x + 10x +
                list(intersect(colnames(dataset), colnames(isolate(parent())))),
    113 - 10x + 10x +
                names = private$dataname
    @@ -27927,7 +28963,8 @@

    teal.slice coverage - 66.10%

    116 - 10x + 10x +
            self$set_filter_state(fs)
    @@ -27948,7 +28985,8 @@

    teal.slice coverage - 66.10%

    119 - 99x + 99x +
          invisible(self)
    @@ -28074,28 +29112,32 @@

    teal.slice coverage - 66.10%

    137 - 42x + 42x +
          logger::log_trace("DataframeFilteredDataset$get_call initializing for dataname: { private$dataname }")
    138 - 42x + 42x +
          filter_call <- super$get_call(sid)
    139 - 42x + 42x +
          dataname <- private$dataname
    140 - 42x + 42x +
          parent_dataname <- private$parent_name
    @@ -28109,28 +29151,32 @@

    teal.slice coverage - 66.10%

    142 - 42x + 42x +
          if (!identical(parent_dataname, character(0))) {
    143 - 9x + 9x +
            join_keys <- private$join_keys
    144 - 9x + 9x +
            parent_keys <- unname(join_keys)
    145 - 9x + 9x +
            dataset_keys <- names(join_keys)
    @@ -28144,7 +29190,8 @@

    teal.slice coverage - 66.10%

    147 - 9x + 9x +
            y_arg <- if (length(parent_keys) == 0L) {
    @@ -28165,28 +29212,32 @@

    teal.slice coverage - 66.10%

    150 - 9x + 9x +
              sprintf(
    151 - 9x + 9x +
                "%s[, c(%s), drop = FALSE]",
    152 - 9x + 9x +
                parent_dataname,
    153 - 9x + 9x +
                toString(dQuote(parent_keys, q = FALSE))
    @@ -28214,7 +29265,8 @@

    teal.slice coverage - 66.10%

    157 - 9x + 9x +
            more_args <- if (length(parent_keys) == 0 || length(dataset_keys) == 0) {
    @@ -28228,14 +29280,16 @@

    teal.slice coverage - 66.10%

    159 - 9x + 9x +
            } else if (identical(parent_keys, dataset_keys)) {
    160 - 7x + 7x +
              list(by = parent_keys)
    @@ -28249,7 +29303,8 @@

    teal.slice coverage - 66.10%

    162 - 2x + 2x +
              list(by = stats::setNames(parent_keys, dataset_keys))
    @@ -28270,7 +29325,8 @@

    teal.slice coverage - 66.10%

    165 - 9x + 9x +
            merge_call <- call(
    @@ -28284,49 +29340,56 @@

    teal.slice coverage - 66.10%

    167 - 9x + 9x +
              as.name(dataname),
    168 - 9x + 9x +
              as.call(
    169 - 9x + 9x +
                c(
    170 - 9x + 9x +
                  str2lang("dplyr::inner_join"),
    171 - 9x + 9x +
                  x = as.name(dataname),
    172 - 9x + 9x +
                  y = str2lang(y_arg),
    173 - 9x + 9x +
                  more_args
    @@ -28361,7 +29424,8 @@

    teal.slice coverage - 66.10%

    178 - 9x + 9x +
            filter_call <- c(filter_call, merge_call)
    @@ -28375,14 +29439,16 @@

    teal.slice coverage - 66.10%

    180 - 42x + 42x +
          logger::log_trace("DataframeFilteredDataset$get_call initializing for dataname: { private$dataname }")
    181 - 42x + 42x +
          filter_call
    @@ -28452,35 +29518,40 @@

    teal.slice coverage - 66.10%

    191 - 81x + 81x +
          isolate({
    192 - 81x + 81x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initializing, dataname: { private$dataname }")
    193 - 81x + 81x +
            checkmate::assert_class(state, "teal_slices")
    194 - 80x + 80x +
            lapply(state, function(slice) {
    195 - 97x + 97x +
              checkmate::assert_true(slice$dataname == private$dataname)
    @@ -28494,14 +29565,16 @@

    teal.slice coverage - 66.10%

    197 - 80x + 80x +
            private$get_filter_states()[[1L]]$set_filter_state(state = state)
    198 - 80x + 80x +
            invisible(NULL)
    @@ -28599,7 +29672,8 @@

    teal.slice coverage - 66.10%

    212 - 11x + 11x +
          checkmate::assert_class(state, "teal_slices")
    @@ -28613,14 +29687,16 @@

    teal.slice coverage - 66.10%

    214 - 11x + 11x +
          isolate({
    215 - 11x + 11x +
            logger::log_trace("{ class(self)[1] }$remove_filter_state removing filter(s), dataname: { private$dataname }")
    @@ -28634,14 +29710,16 @@

    teal.slice coverage - 66.10%

    217 - 11x + 11x +
            varnames <- unique(unlist(lapply(state, "[[", "varname")))
    218 - 11x + 11x +
            private$get_filter_states()[[1]]$remove_filter_state(state)
    @@ -28655,7 +29733,8 @@

    teal.slice coverage - 66.10%

    220 - 11x + 11x +
            logger::log_trace("{ class(self)[1] }$remove_filter_state removed filter(s), dataname: { private$dataname }")
    @@ -28676,7 +29755,8 @@

    teal.slice coverage - 66.10%

    223 - 11x + 11x +
          invisible(NULL)
    @@ -28837,7 +29917,8 @@

    teal.slice coverage - 66.10%

    246 - 12x + 12x +
          logger::log_trace("FilteredDataset$srv_filter_overview initialized")
    @@ -28858,14 +29939,16 @@

    teal.slice coverage - 66.10%

    249 - 12x + 12x +
          subject_keys <- if (length(private$parent_name) > 0) {
    250 - 1x + 1x +
            names(private$join_keys)
    @@ -28879,7 +29962,8 @@

    teal.slice coverage - 66.10%

    252 - 11x + 11x +
            self$get_keys()
    @@ -28893,49 +29977,56 @@

    teal.slice coverage - 66.10%

    254 - 12x + 12x +
          dataset <- self$get_dataset()
    255 - 12x + 12x +
          data_filtered <- self$get_dataset(TRUE)
    256 - 12x + 12x +
          if (length(subject_keys) == 0) {
    257 - 10x + 10x +
            data.frame(
    258 - 10x + 10x +
              dataname = private$dataname,
    259 - 10x + 10x +
              obs = nrow(dataset),
    260 - 10x + 10x +
              obs_filtered = nrow(data_filtered())
    @@ -28956,42 +30047,48 @@

    teal.slice coverage - 66.10%

    263 - 2x + 2x +
            data.frame(
    264 - 2x + 2x +
              dataname = private$dataname,
    265 - 2x + 2x +
              obs = nrow(dataset),
    266 - 2x + 2x +
              obs_filtered = nrow(data_filtered()),
    267 - 2x + 2x +
              subjects = nrow(unique(dataset[subject_keys])),
    268 - 2x + 2x +
              subjects_filtered = nrow(unique(data_filtered()[subject_keys]))
    @@ -29900,28 +30997,32 @@

    teal.slice coverage - 66.10%

    118 - 3x + 3x +
      checkmate::assert_multi_class(datasets, c("FilteredData", "FilterPanelAPI"))
    119 - 3x + 3x +
      checkmate::assert_class(filter, "teal_slices")
    120 - 3x + 3x +
      datasets$set_filter_state(filter)
    121 - 3x + 3x +
      invisible(NULL)
    @@ -29963,14 +31064,16 @@

    teal.slice coverage - 66.10%

    127 - 4x + 4x +
      checkmate::assert_multi_class(datasets, c("FilteredData", "FilterPanelAPI"))
    128 - 4x + 4x +
      if (isRunning()) {
    @@ -29991,7 +31094,8 @@

    teal.slice coverage - 66.10%

    131 - 4x + 4x +
        isolate(datasets$get_filter_state())
    @@ -30040,14 +31144,16 @@

    teal.slice coverage - 66.10%

    138 - 1x + 1x +
      checkmate::assert_multi_class(datasets, c("FilteredData", "FilterPanelAPI"))
    139 - 1x + 1x +
      checkmate::assert_class(filter, "teal_slices")
    @@ -30061,14 +31167,16 @@

    teal.slice coverage - 66.10%

    141 - 1x + 1x +
      datasets$remove_filter_state(filter)
    142 - 1x + 1x +
      invisible(NULL)
    @@ -30110,21 +31218,24 @@

    teal.slice coverage - 66.10%

    148 - 1x + 1x +
      checkmate::assert_multi_class(datasets, c("FilteredData", "FilterPanelAPI"))
    149 - 1x + 1x +
      datasets$clear_filter_states(force = force)
    150 - 1x + 1x +
      invisible(NULL)
    @@ -30243,28 +31354,32 @@

    teal.slice coverage - 66.10%

    167 - 2x + 2x +
      checkmate::assert_character(datanames, min.len = 1, any.missing = FALSE)
    168 - 2x + 2x +
      stopifnot(
    169 - 2x + 2x +
        is(datasets, "FilteredData"),
    170 - 2x + 2x +
        all(datanames %in% datasets$datanames())
    @@ -30285,35 +31400,40 @@

    teal.slice coverage - 66.10%

    173 - 2x + 2x +
      paste(
    174 - 2x + 2x +
        unlist(lapply(
    175 - 2x + 2x +
          datanames,
    176 - 2x + 2x +
          function(dataname) {
    177 - 4x + 4x +
            datasets$get_call(dataname)
    @@ -30334,7 +31454,8 @@

    teal.slice coverage - 66.10%

    180 - 2x + 2x +
        collapse = "\n"
    @@ -30879,35 +32000,40 @@

    teal.slice coverage - 66.10%

    75 - 368x + 368x +
          checkmate::assert_class(x_reactive, "reactive")
    76 - 367x + 367x +
          checkmate::assert_class(slice, "teal_slice")
    77 - 365x + 365x +
          checkmate::assert_character(extract_type, max.len = 1, any.missing = FALSE)
    78 - 365x + 365x +
          if (length(extract_type) == 1) {
    79 - 53x + 53x +
            checkmate::assert_choice(extract_type, choices = c("list", "matrix"))
    @@ -30935,14 +32061,16 @@

    teal.slice coverage - 66.10%

    83 - 364x + 364x +
          private$x <- x
    84 - 364x + 364x +
          private$x_reactive <- x_reactive
    @@ -30956,21 +32084,24 @@

    teal.slice coverage - 66.10%

    86 - 364x + 364x +
          private$na_count <- sum(is.na(x))
    87 - 364x + 364x +
          private$filtered_na_count <- reactive(
    88 - 364x + 364x +
            if (!is.null(private$x_reactive())) {
    @@ -31005,7 +32136,8 @@

    teal.slice coverage - 66.10%

    93 - 364x + 364x +
          private$extract_type <- extract_type
    @@ -31026,14 +32158,16 @@

    teal.slice coverage - 66.10%

    96 - 18x + 18x +
          if (is.null(isolate(slice$keep_na)) && anyNA(x)) slice$keep_na <- TRUE
    97 - 364x + 364x +
          private$teal_slice <- slice
    @@ -31047,7 +32181,8 @@

    teal.slice coverage - 66.10%

    99 - 364x + 364x +
          varlabel <- attr(x, "label")
    @@ -31061,21 +32196,24 @@

    teal.slice coverage - 66.10%

    101 - 364x + 364x +
          private$varlabel <-
    102 - 364x + 364x +
            if (is.null(varlabel) || identical(varlabel, private$get_varname())) {
    103 - 363x + 363x +
              character(0)
    @@ -31089,7 +32227,8 @@

    teal.slice coverage - 66.10%

    105 - 1x + 1x +
              varlabel
    @@ -31110,7 +32249,8 @@

    teal.slice coverage - 66.10%

    108 - 364x + 364x +
          private$state_history <- reactiveVal(list())
    @@ -31124,7 +32264,8 @@

    teal.slice coverage - 66.10%

    110 - 364x + 364x +
          logger::log_trace("Instantiated FilterState object id: { private$get_id() }")
    @@ -31138,7 +32279,8 @@

    teal.slice coverage - 66.10%

    112 - 364x + 364x +
          invisible(self)
    @@ -31222,28 +32364,32 @@

    teal.slice coverage - 66.10%

    124 - 68x + 68x +
          sprintf(
    125 - 68x + 68x +
            "%s:\n%s",
    126 - 68x + 68x +
            class(self)[1],
    127 - 68x + 68x +
            format(self$get_state(), show_all = show_all, trim_lines = trim_lines)
    @@ -31313,7 +32459,8 @@

    teal.slice coverage - 66.10%

    137 - 14x + 14x +
          cat(isolate(self$format(...)))
    @@ -31404,21 +32551,24 @@

    teal.slice coverage - 66.10%

    150 - 89x + 89x +
          checkmate::assert_class(state, "teal_slice")
    151 - 88x + 88x +
          if (private$is_fixed()) {
    152 - 1x + 1x +
            logger::log_warn("attempt to set state on fixed filter aborted id: { private$get_id() }")
    @@ -31432,28 +32582,32 @@

    teal.slice coverage - 66.10%

    154 - 87x + 87x +
            logger::log_trace("{ class(self)[1] }$set_state setting state of filter id: { private$get_id() }")
    155 - 87x + 87x +
            isolate({
    156 - 87x + 87x +
              if (!is.null(state$selected)) {
    157 - 78x + 78x +
                private$set_selected(state$selected)
    @@ -31467,14 +32621,16 @@

    teal.slice coverage - 66.10%

    159 - 75x + 75x +
              if (!is.null(state$keep_na)) {
    160 - 16x + 16x +
                private$set_keep_na(state$keep_na)
    @@ -31488,14 +32644,16 @@

    teal.slice coverage - 66.10%

    162 - 75x + 75x +
              if (!is.null(state$keep_inf)) {
    163 - 9x + 9x +
                private$set_keep_inf(state$keep_inf)
    @@ -31509,35 +32667,40 @@

    teal.slice coverage - 66.10%

    165 - 75x + 75x +
              current_state <- sprintf(
    166 - 75x + 75x +
                "selected: %s; keep_na: %s; keep_inf: %s",
    167 - 75x + 75x +
                toString(private$get_selected()),
    168 - 75x + 75x +
                private$get_keep_na(),
    169 - 75x + 75x +
                private$get_keep_inf()
    @@ -31572,7 +32735,8 @@

    teal.slice coverage - 66.10%

    174 - 76x + 76x +
          invisible(self)
    @@ -31642,7 +32806,8 @@

    teal.slice coverage - 66.10%

    184 - 747x + 747x +
          private$teal_slice
    @@ -31712,7 +32877,8 @@

    teal.slice coverage - 66.10%

    194 - 1x + 1x +
          stop("this is a virtual method")
    @@ -31796,42 +32962,48 @@

    teal.slice coverage - 66.10%

    206 - 12x + 12x +
          moduleServer(
    207 - 12x + 12x +
            id = id,
    208 - 12x + 12x +
            function(input, output, session) {
    209 - 12x + 12x +
              logger::log_trace("FilterState$server initializing module for slice: { private$get_id() } ")
    210 - 12x + 12x +
              private$server_summary("summary")
    211 - 12x + 12x +
              if (private$is_fixed()) {
    @@ -31852,7 +33024,8 @@

    teal.slice coverage - 66.10%

    214 - 12x + 12x +
                private$server_inputs("inputs")
    @@ -31873,49 +33046,56 @@

    teal.slice coverage - 66.10%

    217 - 12x + 12x +
              private$observers$state <- observeEvent(
    218 - 12x + 12x +
                eventExpr = list(private$get_selected(), private$get_keep_na(), private$get_keep_inf()),
    219 - 12x + 12x +
                handlerExpr = {
    220 - 4x + 4x +
                  current_state <- as.list(self$get_state())
    221 - 4x + 4x +
                  history <- private$state_history()
    222 - 4x + 4x +
                  history_update <- c(history, list(current_state))
    223 - 4x + 4x +
                  private$state_history(history_update)
    @@ -31943,21 +33123,24 @@

    teal.slice coverage - 66.10%

    227 - 12x + 12x +
              private$observers$back <- observeEvent(
    228 - 12x + 12x +
                eventExpr = input$back,
    229 - 12x + 12x +
                handlerExpr = {
    @@ -32020,21 +33203,24 @@

    teal.slice coverage - 66.10%

    238 - 12x + 12x +
              private$observers$reset <- observeEvent(
    239 - 12x + 12x +
                eventExpr = input$reset,
    240 - 12x + 12x +
                handlerExpr = {
    @@ -32090,56 +33276,64 @@

    teal.slice coverage - 66.10%

    248 - 12x + 12x +
              private$observers$state_history <- observeEvent(
    249 - 12x + 12x +
                eventExpr = private$state_history(),
    250 - 12x + 12x +
                handlerExpr = {
    251 - 4x + 4x +
                  shinyjs::disable(id = "back")
    252 - 4x + 4x +
                  shinyjs::disable(id = "reset")
    253 - 4x + 4x +
                  shinyjs::delay(
    254 - 4x + 4x +
                    ms = 100,
    255 - 4x + 4x +
                    expr = {
    @@ -32174,21 +33368,24 @@

    teal.slice coverage - 66.10%

    260 - 4x + 4x +
                  shinyjs::delay(
    261 - 4x + 4x +
                    ms = 100,
    262 - 4x + 4x +
                    expr = {
    @@ -32244,14 +33441,16 @@

    teal.slice coverage - 66.10%

    270 - 12x + 12x +
              private$destroy_shiny <- function() {
    271 - 8x + 8x +
                logger::log_trace("Destroying FilterState inputs and observers; id: { private$get_id() }")
    @@ -32265,7 +33464,8 @@

    teal.slice coverage - 66.10%

    273 - 8x + 8x +
                lapply(session$ns(names(input)), .subset2(input, "impl")$.values$remove)
    @@ -32286,7 +33486,8 @@

    teal.slice coverage - 66.10%

    276 - 8x + 8x +
                lapply(private$observers, function(x) x$destroy())
    @@ -32307,7 +33508,8 @@

    teal.slice coverage - 66.10%

    279 - 12x + 12x +
              reactive(input$remove)
    @@ -32391,7 +33593,8 @@

    teal.slice coverage - 66.10%

    291 - 12x + 12x +
          ns <- NS(id)
    @@ -32447,84 +33650,96 @@

    teal.slice coverage - 66.10%

    299 - 12x + 12x +
          div(
    300 - 12x + 12x +
            id = id,
    301 - 12x + 12x +
            class = "panel filter-card",
    302 - 12x + 12x +
            include_js_files("count-bar-labels.js"),
    303 - 12x + 12x +
            div(
    304 - 12x + 12x +
              class = "filter-card-header",
    305 - 12x + 12x +
              `data-toggle` = "collapse",
    306 - 12x + 12x +
              `data-bs-toggle` = "collapse",
    307 - 12x + 12x +
              href = paste0("#", ns("body")),
    308 - 12x + 12x +
              div(
    309 - 12x + 12x +
                class = "filter-card-title",
    310 - 12x + 12x +
                if (private$is_anchored() && private$is_fixed()) {
    @@ -32538,7 +33753,8 @@

    teal.slice coverage - 66.10%

    312 - 12x + 12x +
                } else if (private$is_anchored() && !private$is_fixed()) {
    @@ -32552,7 +33768,8 @@

    teal.slice coverage - 66.10%

    314 - 12x + 12x +
                } else if (!private$is_anchored() && private$is_fixed()) {
    @@ -32573,28 +33790,32 @@

    teal.slice coverage - 66.10%

    317 - 12x + 12x +
                div(class = "filter-card-varname", strong(private$get_varname())),
    318 - 12x + 12x +
                div(class = "filter-card-varlabel", private$get_varlabel()),
    319 - 12x + 12x +
                div(
    320 - 12x + 12x +
                  class = "filter-card-controls",
    @@ -32615,7 +33836,8 @@

    teal.slice coverage - 66.10%

    323 - 12x + 12x +
                  onclick = "event.stopPropagation();event.preventDefault();",
    @@ -32629,70 +33851,80 @@

    teal.slice coverage - 66.10%

    325 - 12x + 12x +
                  `data-bs-toggle` = "collapse",
    326 - 12x + 12x +
                  `data-bs-target` = NULL,
    327 - 12x + 12x +
                  if (isFALSE(private$is_fixed())) {
    328 - 12x + 12x +
                    actionLink(
    329 - 12x + 12x +
                      inputId = ns("back"),
    330 - 12x + 12x +
                      label = NULL,
    331 - 12x + 12x +
                      icon = icon("circle-arrow-left", lib = "font-awesome"),
    332 - 12x + 12x +
                      title = "Rewind state",
    333 - 12x + 12x +
                      class = "filter-card-back",
    334 - 12x + 12x +
                      style = "display: none"
    @@ -32713,56 +33945,64 @@

    teal.slice coverage - 66.10%

    337 - 12x + 12x +
                  if (isFALSE(private$is_fixed())) {
    338 - 12x + 12x +
                    actionLink(
    339 - 12x + 12x +
                      inputId = ns("reset"),
    340 - 12x + 12x +
                      label = NULL,
    341 - 12x + 12x +
                      icon = icon("circle-arrow-up", lib = "font-awesome"),
    342 - 12x + 12x +
                      title = "Restore original state",
    343 - 12x + 12x +
                      class = "filter-card-back",
    344 - 12x + 12x +
                      style = "display: none"
    @@ -32783,42 +34023,48 @@

    teal.slice coverage - 66.10%

    347 - 12x + 12x +
                  if (isFALSE(private$is_anchored())) {
    348 - 12x + 12x +
                    actionLink(
    349 - 12x + 12x +
                      inputId = ns("remove"),
    350 - 12x + 12x +
                      label = icon("circle-xmark", lib = "font-awesome"),
    351 - 12x + 12x +
                      title = "Remove filter",
    352 - 12x + 12x +
                      class = "filter-card-remove"
    @@ -32853,7 +34099,8 @@

    teal.slice coverage - 66.10%

    357 - 12x + 12x +
              div(class = "filter-card-summary", private$ui_summary(ns("summary")))
    @@ -32867,56 +34114,64 @@

    teal.slice coverage - 66.10%

    359 - 12x + 12x +
            div(
    360 - 12x + 12x +
              id = ns("body"),
    361 - 12x + 12x +
              class = "collapse out",
    362 - 12x + 12x +
              `data-parent` = paste0("#", parent_id),
    363 - 12x + 12x +
              `data-bs-parent` = paste0("#", parent_id),
    364 - 12x + 12x +
              div(
    365 - 12x + 12x +
                class = "filter-card-body",
    366 - 12x + 12x +
                if (private$is_fixed()) {
    @@ -32937,7 +34192,8 @@

    teal.slice coverage - 66.10%

    369 - 12x + 12x +
                  private$ui_inputs(ns("inputs"))
    @@ -33028,14 +34284,16 @@

    teal.slice coverage - 66.10%

    382 - 47x + 47x +
          if (!is.null(private$destroy_shiny)) {
    383 - 8x + 8x +
            private$destroy_shiny()
    @@ -33329,35 +34587,40 @@

    teal.slice coverage - 66.10%

    425 - 420x + 420x +
          logger::log_trace(
    426 - 420x + 420x +
            sprintf(
    427 - 420x + 420x +
              "%s$set_selected setting selection of id: %s",
    428 - 420x + 420x +
              class(self)[1],
    429 - 420x + 420x +
              private$get_id()
    @@ -33378,35 +34641,40 @@

    teal.slice coverage - 66.10%

    432 - 420x + 420x +
          isolate({
    433 - 420x + 420x +
            value <- private$cast_and_validate(value)
    434 - 409x + 409x +
            value <- private$check_length(value)
    435 - 403x + 403x +
            value <- private$remove_out_of_bounds_values(value)
    436 - 403x + 403x +
            private$teal_slice$selected <- value
    @@ -33420,35 +34688,40 @@

    teal.slice coverage - 66.10%

    438 - 403x + 403x +
          logger::log_trace(
    439 - 403x + 403x +
            sprintf(
    440 - 403x + 403x +
              "%s$set_selected selection of id: %s",
    441 - 403x + 403x +
              class(self)[1],
    442 - 403x + 403x +
              private$get_id()
    @@ -33476,7 +34749,8 @@

    teal.slice coverage - 66.10%

    446 - 403x + 403x +
          invisible(NULL)
    @@ -33560,56 +34834,64 @@

    teal.slice coverage - 66.10%

    458 - 16x + 16x +
          checkmate::assert_flag(value)
    459 - 16x + 16x +
          private$teal_slice$keep_na <- value
    460 - 16x + 16x +
          logger::log_trace(
    461 - 16x + 16x +
            sprintf(
    462 - 16x + 16x +
              "%s$set_keep_na set for filter %s to %s.",
    463 - 16x + 16x +
              class(self)[1],
    464 - 16x + 16x +
              private$get_id(),
    465 - 16x + 16x +
              value
    @@ -33630,7 +34912,8 @@

    teal.slice coverage - 66.10%

    468 - 16x + 16x +
          invisible(NULL)
    @@ -33714,56 +34997,64 @@

    teal.slice coverage - 66.10%

    480 - 9x + 9x +
          checkmate::assert_flag(value)
    481 - 9x + 9x +
          private$teal_slice$keep_inf <- value
    482 - 9x + 9x +
          logger::log_trace(
    483 - 9x + 9x +
            sprintf(
    484 - 9x + 9x +
              "%s$set_keep_inf of filter %s set to %s",
    485 - 9x + 9x +
              class(self)[1],
    486 - 9x + 9x +
              private$get_id(),
    487 - 9x + 9x +
              value
    @@ -33791,7 +35082,8 @@

    teal.slice coverage - 66.10%

    491 - 9x + 9x +
          invisible(NULL)
    @@ -33854,7 +35146,8 @@

    teal.slice coverage - 66.10%

    500 - 87x + 87x +
          isolate(private$teal_slice$dataname)
    @@ -33903,7 +35196,8 @@

    teal.slice coverage - 66.10%

    507 - 165x + 165x +
          isolate(private$teal_slice$varname)
    @@ -33952,7 +35246,8 @@

    teal.slice coverage - 66.10%

    514 - 4x + 4x +
          isolate(private$teal_slice$id)
    @@ -34008,7 +35303,8 @@

    teal.slice coverage - 66.10%

    522 - 882x + 882x +
          isolate(private$teal_slice$choices)
    @@ -34064,7 +35360,8 @@

    teal.slice coverage - 66.10%

    530 - 363x + 363x +
          private$teal_slice$selected
    @@ -34113,7 +35410,8 @@

    teal.slice coverage - 66.10%

    537 - 129x + 129x +
          private$teal_slice$keep_na
    @@ -34162,7 +35460,8 @@

    teal.slice coverage - 66.10%

    544 - 117x + 117x +
          private$teal_slice$keep_inf
    @@ -34204,7 +35503,8 @@

    teal.slice coverage - 66.10%

    550 - 148x + 148x +
          isolate(isTRUE(private$teal_slice$fixed))
    @@ -34246,7 +35546,8 @@

    teal.slice coverage - 66.10%

    556 - 48x + 48x +
          isolate(isTRUE(private$teal_slice$anchored))
    @@ -34288,7 +35589,8 @@

    teal.slice coverage - 66.10%

    562 - 217x + 217x +
          isolate(isTRUE(private$teal_slice$multiple))
    @@ -34351,7 +35653,8 @@

    teal.slice coverage - 66.10%

    571 - 12x + 12x +
          private$varlabel
    @@ -34400,49 +35703,56 @@

    teal.slice coverage - 66.10%

    578 - 108x + 108x +
          varname <- private$get_varname()
    579 - 108x + 108x +
          varname_backticked <- sprintf("`%s`", varname)
    580 - 108x + 108x +
          ans <-
    581 - 108x + 108x +
            if (isTRUE(private$extract_type == "list")) {
    582 - 16x + 16x +
              sprintf("%s$%s", dataname, varname_backticked)
    583 - 108x + 108x +
            } else if (isTRUE(private$extract_type == "matrix")) {
    584 - 7x + 7x +
              sprintf("%s[, \"%s\"]", dataname, varname)
    @@ -34456,7 +35766,8 @@

    teal.slice coverage - 66.10%

    586 - 85x + 85x +
              varname_backticked
    @@ -34470,7 +35781,8 @@

    teal.slice coverage - 66.10%

    588 - 108x + 108x +
          str2lang(ans)
    @@ -34540,14 +35852,16 @@

    teal.slice coverage - 66.10%

    598 - 107x + 107x +
          if (private$na_count == 0L) {
    599 - 86x + 86x +
            return(filter_call)
    @@ -34568,42 +35882,48 @@

    teal.slice coverage - 66.10%

    602 - 21x + 21x +
          if (is.null(filter_call) && isFALSE(private$get_keep_na())) {
    603 - 2x + 2x +
            call("!", call("is.na", varname))
    604 - 19x + 19x +
          } else if (!is.null(filter_call) && isTRUE(private$get_keep_na())) {
    605 - 12x + 12x +
            call("|", call("is.na", varname), filter_call)
    606 - 7x + 7x +
          } else if (!is.null(filter_call) && isFALSE(private$get_keep_na())) {
    607 - 7x + 7x +
            call("&", call("!", call("is.na", varname)), filter_call)
    @@ -34680,7 +36000,8 @@

    teal.slice coverage - 66.10%

    618 - 11x + 11x +
          values
    @@ -34715,7 +36036,8 @@

    teal.slice coverage - 66.10%

    623 - 11x + 11x +
          values
    @@ -34778,7 +36100,8 @@

    teal.slice coverage - 66.10%

    632 - 31x + 31x +
          values
    @@ -34876,42 +36199,48 @@

    teal.slice coverage - 66.10%

    646 - 74x + 74x +
          if (private$is_choice_limited) {
    647 - 3x + 3x +
            TRUE
    648 - 71x + 71x +
          } else if (!setequal(private$get_selected(), private$get_choices())) {
    649 - 58x + 58x +
            TRUE
    650 - 13x + 13x +
          } else if (!isTRUE(private$get_keep_na()) && private$na_count > 0) {
    651 - 4x + 4x +
            TRUE
    @@ -34925,7 +36254,8 @@

    teal.slice coverage - 66.10%

    653 - 9x + 9x +
            FALSE
    @@ -34995,14 +36325,16 @@

    teal.slice coverage - 66.10%

    663 - 12x + 12x +
          ns <- NS(id)
    664 - 12x + 12x +
          uiOutput(ns("summary"), class = "filter-card-summary")
    @@ -35058,28 +36390,32 @@

    teal.slice coverage - 66.10%

    672 - 12x + 12x +
          moduleServer(
    673 - 12x + 12x +
            id = id,
    674 - 12x + 12x +
            function(input, output, session) {
    675 - 12x + 12x +
              output$summary <- renderUI(private$content_summary())
    @@ -35345,14 +36681,16 @@

    teal.slice coverage - 66.10%

    713 - 12x + 12x +
          ns <- NS(id)
    714 - 12x + 12x +
          if (private$na_count > 0) {
    @@ -35506,7 +36844,8 @@

    teal.slice coverage - 66.10%

    736 - 12x + 12x +
            NULL
    @@ -35583,7 +36922,8 @@

    teal.slice coverage - 66.10%

    747 - 12x + 12x +
          moduleServer(id, function(input, output, session) {
    @@ -35611,42 +36951,48 @@

    teal.slice coverage - 66.10%

    751 - 12x + 12x +
            output$trigger_visible <- renderUI({
    752 - 12x + 12x +
              updateCountText(
    753 - 12x + 12x +
                inputId = "count_label",
    754 - 12x + 12x +
                label = "Keep NA",
    755 - 12x + 12x +
                countmax = private$na_count,
    756 - 12x + 12x +
                countnow = private$filtered_na_count()
    @@ -35660,7 +37006,8 @@

    teal.slice coverage - 66.10%

    758 - 12x + 12x +
              NULL
    @@ -35702,35 +37049,40 @@

    teal.slice coverage - 66.10%

    764 - 12x + 12x +
            private$observers$keep_na_api <- observeEvent(
    765 - 12x + 12x +
              ignoreNULL = FALSE, # nothing selected is possible for NA
    766 - 12x + 12x +
              ignoreInit = TRUE, # ignoreInit: should not matter because we set the UI with the desired initial state
    767 - 12x + 12x +
              eventExpr = private$get_keep_na(),
    768 - 12x + 12x +
              handlerExpr = {
    @@ -35807,35 +37159,40 @@

    teal.slice coverage - 66.10%

    779 - 12x + 12x +
            private$observers$keep_na <- observeEvent(
    780 - 12x + 12x +
              ignoreNULL = FALSE, # ignoreNULL: we don't want to ignore NULL when nothing is selected in the `selectInput`
    781 - 12x + 12x +
              ignoreInit = TRUE, # ignoreInit: should not matter because we set the UI with the desired initial state
    782 - 12x + 12x +
              eventExpr = input$value,
    783 - 12x + 12x +
              handlerExpr = {
    @@ -35905,7 +37262,8 @@

    teal.slice coverage - 66.10%

    793 - 12x + 12x +
            invisible(NULL)
    @@ -36107,7 +37465,8 @@

    teal.slice coverage - 66.10%

    24 - 9x + 9x +
      if (is.factor(choices)) {
    @@ -36135,35 +37494,40 @@

    teal.slice coverage - 66.10%

    28 - 9x + 9x +
      stopifnot(
    29 - 9x + 9x +
        is.character(choices) ||
    30 - 9x + 9x +
          is.numeric(choices) ||
    31 - 9x + 9x +
          is.logical(choices) ||
    32 - 9x + 9x +
          (length(choices) == 1 && is.na(choices))
    @@ -36184,7 +37548,8 @@

    teal.slice coverage - 66.10%

    35 - 9x + 9x +
      if (is.factor(labels)) {
    @@ -36212,14 +37577,16 @@

    teal.slice coverage - 66.10%

    39 - 9x + 9x +
      checkmate::assert_character(labels[!is.na(labels)], any.missing = FALSE)
    40 - 9x + 9x +
      if (length(choices) != length(labels)) {
    @@ -36240,14 +37607,16 @@

    teal.slice coverage - 66.10%

    43 - 9x + 9x +
      stopifnot(is.null(subset) || is.vector(subset))
    44 - 9x + 9x +
      stopifnot(is.null(types) || is.vector(types))
    @@ -36261,14 +37630,16 @@

    teal.slice coverage - 66.10%

    46 - 9x + 9x +
      if (is.vector(types)) {
    47 - 9x + 9x +
        stopifnot(length(choices) == length(types))
    @@ -36289,7 +37660,8 @@

    teal.slice coverage - 66.10%

    50 - 9x + 9x +
      if (!is.null(subset)) {
    @@ -36352,56 +37724,64 @@

    teal.slice coverage - 66.10%

    59 - 9x + 9x +
      is_dupl <- duplicated(choices)
    60 - 9x + 9x +
      choices <- choices[!is_dupl]
    61 - 9x + 9x +
      labels <- labels[!is_dupl]
    62 - 9x + 9x +
      types <- types[!is_dupl]
    63 - 9x + 9x +
      labels[is.na(labels)] <- "Label Missing"
    64 - 9x + 9x +
      raw_labels <- labels
    65 - 9x + 9x +
      combined_labels <- if (length(choices) > 0) {
    66 - 9x + 9x +
        paste0(choices, ": ", labels)
    @@ -36436,7 +37816,8 @@

    teal.slice coverage - 66.10%

    71 - 9x + 9x +
      if (!is.null(subset)) {
    @@ -36485,49 +37866,56 @@

    teal.slice coverage - 66.10%

    78 - 9x + 9x +
      choices <- structure(
    79 - 9x + 9x +
        choices,
    80 - 9x + 9x +
        names = combined_labels,
    81 - 9x + 9x +
        raw_labels = raw_labels,
    82 - 9x + 9x +
        combined_labels = combined_labels,
    83 - 9x + 9x +
        class = c("choices_labeled", "character"),
    84 - 9x + 9x +
        types = types
    @@ -36548,7 +37936,8 @@

    teal.slice coverage - 66.10%

    87 - 9x + 9x +
      choices
    @@ -37576,21 +38965,24 @@

    teal.slice coverage - 66.10%

    145 - 24x + 24x +
          isolate({
    146 - 24x + 24x +
            checkmate::assert_date(x)
    147 - 23x + 23x +
            checkmate::assert_class(x_reactive, "reactive")
    @@ -37604,35 +38996,40 @@

    teal.slice coverage - 66.10%

    149 - 23x + 23x +
            super$initialize(
    150 - 23x + 23x +
              x = x,
    151 - 23x + 23x +
              x_reactive = x_reactive,
    152 - 23x + 23x +
              slice = slice,
    153 - 23x + 23x +
              extract_type = extract_type
    @@ -37646,28 +39043,32 @@

    teal.slice coverage - 66.10%

    155 - 23x + 23x +
            checkmate::assert_date(slice$choices, null.ok = TRUE)
    156 - 22x + 22x +
            private$set_choices(slice$choices)
    157 - 14x + 14x +
            if (is.null(slice$selected)) slice$selected <- slice$choices
    158 - 22x + 22x +
            private$set_selected(slice$selected)
    @@ -37688,7 +39089,8 @@

    teal.slice coverage - 66.10%

    161 - 21x + 21x +
          invisible(self)
    @@ -37765,14 +39167,16 @@

    teal.slice coverage - 66.10%

    172 - 7x + 7x +
          if (isFALSE(private$is_any_filtered())) {
    173 - 1x + 1x +
            return(NULL)
    @@ -37786,28 +39190,32 @@

    teal.slice coverage - 66.10%

    175 - 6x + 6x +
          choices <- as.character(private$get_selected())
    176 - 6x + 6x +
          varname <- private$get_varname_prefixed(dataname)
    177 - 6x + 6x +
          filter_call <-
    178 - 6x + 6x +
            call(
    @@ -37821,14 +39229,16 @@

    teal.slice coverage - 66.10%

    180 - 6x + 6x +
              call(">=", varname, call("as.Date", choices[1L])),
    181 - 6x + 6x +
              call("<=", varname, call("as.Date", choices[2L]))
    @@ -37842,7 +39252,8 @@

    teal.slice coverage - 66.10%

    183 - 6x + 6x +
          private$add_keep_na_call(filter_call, varname)
    @@ -37898,14 +39309,16 @@

    teal.slice coverage - 66.10%

    191 - 22x + 22x +
          if (is.null(choices)) {
    192 - 19x + 19x +
            choices <- range(private$x, na.rm = TRUE)
    @@ -37919,35 +39332,40 @@

    teal.slice coverage - 66.10%

    194 - 3x + 3x +
            choices_adjusted <- c(max(choices[1L], min(private$x)), min(choices[2L], max(private$x)))
    195 - 3x + 3x +
            if (any(choices != choices_adjusted)) {
    196 - 1x + 1x +
              warning(sprintf(
    197 - 1x + 1x +
                "Choices adjusted (some values outside of variable range). Varname: %s, dataname: %s.",
    198 - 1x + 1x +
                private$get_varname(), private$get_dataname()
    @@ -37961,7 +39379,8 @@

    teal.slice coverage - 66.10%

    200 - 1x + 1x +
              choices <- choices_adjusted
    @@ -37975,35 +39394,40 @@

    teal.slice coverage - 66.10%

    202 - 3x + 3x +
            if (choices[1L] >= choices[2L]) {
    203 - 1x + 1x +
              warning(sprintf(
    204 - 1x + 1x +
                "Invalid choices: lower is higher / equal to upper, or not in range of variable values.
    205 - 1x + 1x +
                Setting defaults. Varname: %s, dataname: %s.",
    206 - 1x + 1x +
                private$get_varname(), private$get_dataname()
    @@ -38017,7 +39441,8 @@

    teal.slice coverage - 66.10%

    208 - 1x + 1x +
              choices <- range(private$x, na.rm = TRUE)
    @@ -38038,28 +39463,32 @@

    teal.slice coverage - 66.10%

    211 - 22x + 22x +
          private$set_is_choice_limited(private$x, choices)
    212 - 22x + 22x +
          private$x <- private$x[(private$x >= choices[1L] & private$x <= choices[2L]) | is.na(private$x)]
    213 - 22x + 22x +
          private$teal_slice$choices <- choices
    214 - 22x + 22x +
          invisible(NULL)
    @@ -38101,14 +39530,16 @@

    teal.slice coverage - 66.10%

    220 - 22x + 22x +
          private$is_choice_limited <- (any(xl < choices[1L], na.rm = TRUE) | any(xl > choices[2L], na.rm = TRUE))
    221 - 22x + 22x +
          invisible(NULL)
    @@ -38129,21 +39560,24 @@

    teal.slice coverage - 66.10%

    224 - 33x + 33x +
          tryCatch(
    225 - 33x + 33x +
            expr = {
    226 - 33x + 33x +
              values <- as.Date(values, origin = "1970-01-01")
    @@ -38157,7 +39591,8 @@

    teal.slice coverage - 66.10%

    228 - 30x + 30x +
              values
    @@ -38171,7 +39606,8 @@

    teal.slice coverage - 66.10%

    230 - 33x + 33x +
            error = function(e) stop("Vector of set values must contain values coercible to Date.")
    @@ -38199,42 +39635,48 @@

    teal.slice coverage - 66.10%

    234 - 1x + 1x +
          if (length(values) != 2) stop("Vector of set values must have length two.")
    235 - 29x + 29x +
          if (values[1] > values[2]) {
    236 - 1x + 1x +
            warning(
    237 - 1x + 1x +
              sprintf(
    238 - 1x + 1x +
                "Start date %s is set after the end date %s, the values will be replaced with a default date range.",
    239 - 1x + 1x +
                values[1], values[2]
    @@ -38255,7 +39697,8 @@

    teal.slice coverage - 66.10%

    242 - 1x + 1x +
            values <- isolate(private$get_choices())
    @@ -38269,7 +39712,8 @@

    teal.slice coverage - 66.10%

    244 - 29x + 29x +
          values
    @@ -38290,42 +39734,48 @@

    teal.slice coverage - 66.10%

    247 - 29x + 29x +
          choices <- private$get_choices()
    248 - 29x + 29x +
          if (values[1] < choices[1L] | values[1] > choices[2L]) {
    249 - 5x + 5x +
            warning(
    250 - 5x + 5x +
              sprintf(
    251 - 5x + 5x +
                "Value: %s is outside of the possible range for column %s of dataset %s, setting minimum possible value.",
    252 - 5x + 5x +
                values[1], private$get_varname(), private$get_dataname()
    @@ -38346,7 +39796,8 @@

    teal.slice coverage - 66.10%

    255 - 5x + 5x +
            values[1] <- choices[1L]
    @@ -38367,35 +39818,40 @@

    teal.slice coverage - 66.10%

    258 - 29x + 29x +
          if (values[2] > choices[2L] | values[2] < choices[1L]) {
    259 - 5x + 5x +
            warning(
    260 - 5x + 5x +
              sprintf(
    261 - 5x + 5x +
                "Value: %s is outside of the possible range for column %s of dataset %s, setting maximum possible value.",
    262 - 5x + 5x +
                values[2], private$get_varname(), private$get_dataname()
    @@ -38416,7 +39872,8 @@

    teal.slice coverage - 66.10%

    265 - 5x + 5x +
            values[2] <- choices[2L]
    @@ -38437,7 +39894,8 @@

    teal.slice coverage - 66.10%

    268 - 29x + 29x +
          values
    @@ -40725,21 +42183,24 @@

    teal.slice coverage - 66.10%

    155 - 25x + 25x +
          isolate({
    156 - 25x + 25x +
            checkmate::assert_multi_class(x, c("POSIXct", "POSIXlt"))
    157 - 24x + 24x +
            checkmate::assert_class(x_reactive, "reactive")
    @@ -40753,35 +42214,40 @@

    teal.slice coverage - 66.10%

    159 - 24x + 24x +
            super$initialize(
    160 - 24x + 24x +
              x = x,
    161 - 24x + 24x +
              x_reactive = x_reactive,
    162 - 24x + 24x +
              slice = slice,
    163 - 24x + 24x +
              extract_type = extract_type
    @@ -40795,28 +42261,32 @@

    teal.slice coverage - 66.10%

    165 - 24x + 24x +
            checkmate::assert_multi_class(slice$choices, c("POSIXct", "POSIXlt"), null.ok = TRUE)
    166 - 23x + 23x +
            private$set_choices(slice$choices)
    167 - 15x + 15x +
            if (is.null(slice$selected)) slice$selected <- slice$choices
    168 - 23x + 23x +
            private$set_selected(slice$selected)
    @@ -40837,7 +42307,8 @@

    teal.slice coverage - 66.10%

    171 - 22x + 22x +
          invisible(self)
    @@ -40914,14 +42385,16 @@

    teal.slice coverage - 66.10%

    182 - 7x + 7x +
          if (isFALSE(private$is_any_filtered())) {
    183 - 1x + 1x +
            return(NULL)
    @@ -40935,63 +42408,72 @@

    teal.slice coverage - 66.10%

    185 - 4x + 4x +
          if (missing(dataname)) dataname <- private$get_dataname()
    186 - 6x + 6x +
          varname <- private$get_varname_prefixed(dataname)
    187 - 6x + 6x +
          choices <- private$get_selected()
    188 - 6x + 6x +
          tzone <- Find(function(x) x != "", attr(as.POSIXlt(choices), "tzone"))
    189 - 6x + 6x +
          class <- class(choices)[1L]
    190 - 6x + 6x +
          date_fun <- as.name(
    191 - 6x + 6x +
            switch(class,
    192 - 6x + 6x +
              "POSIXct" = "as.POSIXct",
    193 - 6x + 6x +
              "POSIXlt" = "as.POSIXlt"
    @@ -41012,21 +42494,24 @@

    teal.slice coverage - 66.10%

    196 - 6x + 6x +
          choices <- as.character(choices + c(0, 1))
    197 - 6x + 6x +
          filter_call <-
    198 - 6x + 6x +
            call(
    @@ -41040,7 +42525,8 @@

    teal.slice coverage - 66.10%

    200 - 6x + 6x +
              call(
    @@ -41054,14 +42540,16 @@

    teal.slice coverage - 66.10%

    202 - 6x + 6x +
                varname,
    203 - 6x + 6x +
                as.call(list(date_fun, choices[1L], tz = tzone))
    @@ -41075,7 +42563,8 @@

    teal.slice coverage - 66.10%

    205 - 6x + 6x +
              call(
    @@ -41089,14 +42578,16 @@

    teal.slice coverage - 66.10%

    207 - 6x + 6x +
                varname,
    208 - 6x + 6x +
                as.call(list(date_fun, choices[2L], tz = tzone))
    @@ -41117,7 +42608,8 @@

    teal.slice coverage - 66.10%

    211 - 6x + 6x +
          private$add_keep_na_call(filter_call, varname)
    @@ -41180,14 +42672,16 @@

    teal.slice coverage - 66.10%

    220 - 23x + 23x +
          if (is.null(choices)) {
    221 - 20x + 20x +
            choices <- as.POSIXct(trunc(range(private$x, na.rm = TRUE), units = "secs"))
    @@ -41201,28 +42695,32 @@

    teal.slice coverage - 66.10%

    223 - 3x + 3x +
            choices <- as.POSIXct(choices, units = "secs")
    224 - 3x + 3x +
            choices_adjusted <- c(
    225 - 3x + 3x +
              max(choices[1L], min(as.POSIXct(private$x), na.rm = TRUE)),
    226 - 3x + 3x +
              min(choices[2L], max(as.POSIXct(private$x), na.rm = TRUE))
    @@ -41236,28 +42734,32 @@

    teal.slice coverage - 66.10%

    228 - 3x + 3x +
            if (any(choices != choices_adjusted)) {
    229 - 1x + 1x +
              warning(sprintf(
    230 - 1x + 1x +
                "Choices adjusted (some values outside of variable range). Varname: %s, dataname: %s.",
    231 - 1x + 1x +
                private$get_varname(), private$get_dataname()
    @@ -41271,7 +42773,8 @@

    teal.slice coverage - 66.10%

    233 - 1x + 1x +
              choices <- choices_adjusted
    @@ -41285,35 +42788,40 @@

    teal.slice coverage - 66.10%

    235 - 3x + 3x +
            if (choices[1L] >= choices[2L]) {
    236 - 1x + 1x +
              warning(sprintf(
    237 - 1x + 1x +
                "Invalid choices: lower is higher / equal to upper, or not in range of variable values.
    238 - 1x + 1x +
                Setting defaults. Varname: %s, dataname: %s.",
    239 - 1x + 1x +
                private$get_varname(), private$get_dataname()
    @@ -41327,7 +42835,8 @@

    teal.slice coverage - 66.10%

    241 - 1x + 1x +
              choices <- range(private$x, na.rm = TRUE)
    @@ -41355,14 +42864,16 @@

    teal.slice coverage - 66.10%

    245 - 23x + 23x +
          private$set_is_choice_limited(private$x, choices)
    246 - 23x + 23x +
          private$x <- private$x[
    @@ -41376,21 +42887,24 @@

    teal.slice coverage - 66.10%

    248 - 23x + 23x +
              as.POSIXct(trunc(private$x, units = "secs")) >= choices[1L] &
    249 - 23x + 23x +
                as.POSIXct(trunc(private$x, units = "secs")) <= choices[2L]
    250 - 23x + 23x +
            ) | is.na(private$x)
    @@ -41404,14 +42918,16 @@

    teal.slice coverage - 66.10%

    252 - 23x + 23x +
          private$teal_slice$choices <- choices
    253 - 23x + 23x +
          invisible(NULL)
    @@ -41453,14 +42969,16 @@

    teal.slice coverage - 66.10%

    259 - 23x + 23x +
          private$is_choice_limited <- (any(xl < choices[1L], na.rm = TRUE) | any(xl > choices[2L], na.rm = TRUE))
    260 - 23x + 23x +
          invisible(NULL)
    @@ -41481,21 +42999,24 @@

    teal.slice coverage - 66.10%

    263 - 34x + 34x +
          tryCatch(
    264 - 34x + 34x +
            expr = {
    265 - 34x + 34x +
              values <- as.POSIXct(values, origin = "1970-01-01 00:00:00")
    @@ -41509,7 +43030,8 @@

    teal.slice coverage - 66.10%

    267 - 31x + 31x +
              values
    @@ -41523,7 +43045,8 @@

    teal.slice coverage - 66.10%

    269 - 34x + 34x +
            error = function(e) stop("Vector of set values must contain values coercible to POSIX.")
    @@ -41551,42 +43074,48 @@

    teal.slice coverage - 66.10%

    273 - 1x + 1x +
          if (length(values) != 2) stop("Vector of set values must have length two.")
    274 - 30x + 30x +
          if (values[1] > values[2]) {
    275 - 1x + 1x +
            warning(
    276 - 1x + 1x +
              sprintf(
    277 - 1x + 1x +
                "Start date '%s' is set after the end date '%s', the values will be replaced by a default datetime range.",
    278 - 1x + 1x +
                values[1], values[2]
    @@ -41607,7 +43136,8 @@

    teal.slice coverage - 66.10%

    281 - 1x + 1x +
            values <- isolate(private$get_choices())
    @@ -41621,7 +43151,8 @@

    teal.slice coverage - 66.10%

    283 - 30x + 30x +
          values
    @@ -41642,42 +43173,48 @@

    teal.slice coverage - 66.10%

    286 - 30x + 30x +
          choices <- private$get_choices()
    287 - 30x + 30x +
          if (values[1] < choices[1L] || values[1] > choices[2L]) {
    288 - 5x + 5x +
            warning(
    289 - 5x + 5x +
              sprintf(
    290 - 5x + 5x +
                "Value: %s is outside of the range for the column '%s' in dataset '%s', setting minimum possible value.",
    291 - 5x + 5x +
                values[1], private$get_varname(), toString(private$get_dataname())
    @@ -41698,7 +43235,8 @@

    teal.slice coverage - 66.10%

    294 - 5x + 5x +
            values[1] <- choices[1L]
    @@ -41719,35 +43257,40 @@

    teal.slice coverage - 66.10%

    297 - 30x + 30x +
          if (values[2] > choices[2L] | values[2] < choices[1L]) {
    298 - 5x + 5x +
            warning(
    299 - 5x + 5x +
              sprintf(
    300 - 5x + 5x +
                "Value: '%s' is outside of the range for the column '%s' in dataset '%s', setting maximum possible value.",
    301 - 5x + 5x +
                values[2], private$get_varname(), toString(private$get_dataname())
    @@ -41768,7 +43311,8 @@

    teal.slice coverage - 66.10%

    304 - 5x + 5x +
            values[2] <- choices[2L]
    @@ -41789,7 +43333,8 @@

    teal.slice coverage - 66.10%

    307 - 30x + 30x +
          values
    @@ -43615,49 +45160,56 @@

    teal.slice coverage - 66.10%

    15 - 273x + 273x +
      checkmate::assert_character(name, min.len = 1, any.missing = FALSE)
    16 - 271x + 271x +
      if (!grepl("^[[:alpha:]][a-zA-Z0-9_]*$", name, perl = TRUE)) {
    17 - 5x + 5x +
        stop(
    18 - 5x + 5x +
          "name '",
    19 - 5x + 5x +
          name,
    20 - 5x + 5x +
          "' must only contain alphanumeric characters (with underscores)",
    21 - 5x + 5x +
          " and the first character must be an alphabetic character"
    @@ -43776,35 +45328,40 @@

    teal.slice coverage - 66.10%

    38 - 12x + 12x +
      checkmate::assert_character(pattern, min.len = 1, null.ok = TRUE)
    39 - 12x + 12x +
      js_files <- list.files(
    40 - 12x + 12x +
        system.file("js", package = "teal.slice", mustWork = TRUE),
    41 - 12x + 12x +
        pattern = pattern,
    42 - 12x + 12x +
        full.names = TRUE
    @@ -43818,7 +45375,8 @@

    teal.slice coverage - 66.10%

    44 - 12x + 12x +
      return(singleton(lapply(js_files, includeScript)))
    @@ -43958,14 +45516,16 @@

    teal.slice coverage - 66.10%

    64 - 53x + 53x +
      if (length(choices) > 1) {
    65 - 26x + 26x +
        do.call("call", append(list("c"), choices))
    @@ -43979,7 +45539,8 @@

    teal.slice coverage - 66.10%

    67 - 27x + 27x +
        choices
    @@ -44244,21 +45805,24 @@

    teal.slice coverage - 66.10%

    35 - 26x + 26x +
          checkmate::assert_matrix(data)
    36 - 25x + 25x +
          super$initialize(data, data_reactive, dataname, datalabel)
    37 - 25x + 25x +
          private$set_filterable_varnames(include_varnames = colnames(private$data))
    @@ -45363,42 +46927,48 @@

    teal.slice coverage - 66.10%

    151 - 159x + 159x +
          isolate({
    152 - 159x + 159x +
            checkmate::assert(
    153 - 159x + 159x +
              is.character(x),
    154 - 159x + 159x +
              is.factor(x),
    155 - 159x + 159x +
              length(unique(x[!is.na(x)])) < getOption("teal.threshold_slider_vs_checkboxgroup"),
    156 - 159x + 159x +
              combine = "or"
    @@ -45419,28 +46989,32 @@

    teal.slice coverage - 66.10%

    159 - 159x + 159x +
            x_factor <- if (!is.factor(x)) {
    160 - 124x + 124x +
              structure(
    161 - 124x + 124x +
                factor(as.character(x), levels = as.character(sort(unique(x)))),
    162 - 124x + 124x +
                label = attr(x, "label")
    @@ -45461,7 +47035,8 @@

    teal.slice coverage - 66.10%

    165 - 35x + 35x +
              x
    @@ -45482,35 +47057,40 @@

    teal.slice coverage - 66.10%

    168 - 159x + 159x +
            super$initialize(
    169 - 159x + 159x +
              x = x_factor,
    170 - 159x + 159x +
              x_reactive = x_reactive,
    171 - 159x + 159x +
              slice = slice,
    172 - 159x + 159x +
              extract_type = extract_type
    @@ -45524,63 +47104,72 @@

    teal.slice coverage - 66.10%

    174 - 159x + 159x +
            private$set_choices(slice$choices)
    175 - 159x + 159x +
            if (is.null(slice$selected) && slice$multiple) {
    176 - 42x + 42x +
              slice$selected <- private$get_choices()
    177 - 117x + 117x +
            } else if (is.null(slice$selected)) {
    178 - 1x + 1x +
              slice$selected <- private$get_choices()[1]
    179 - 116x + 116x +
            } else if (length(slice$selected) > 1 && !slice$multiple) {
    180 - 1x + 1x +
              warning(
    181 - 1x + 1x +
                "ChoicesFilterState allows \"selected\" to be of length 1 when \"multiple\" is FALSE. ",
    182 - 1x + 1x +
                "Only the first value will be used."
    @@ -45594,7 +47183,8 @@

    teal.slice coverage - 66.10%

    184 - 1x + 1x +
              slice$selected <- slice$selected[1]
    @@ -45608,28 +47198,32 @@

    teal.slice coverage - 66.10%

    186 - 159x + 159x +
            private$set_selected(slice$selected)
    187 - 159x + 159x +
            private$data_class <- class(x)[1L]
    188 - 159x + 159x +
            if (inherits(x, "POSIXt")) {
    189 - 9x + 9x +
              private$tzone <- Find(function(x) x != "", attr(as.POSIXlt(x), "tzone"))
    @@ -45650,7 +47244,8 @@

    teal.slice coverage - 66.10%

    192 - 159x + 159x +
            private$set_choices_counts(unname(table(x_factor)))
    @@ -45664,7 +47259,8 @@

    teal.slice coverage - 66.10%

    194 - 159x + 159x +
          invisible(self)
    @@ -45741,14 +47337,16 @@

    teal.slice coverage - 66.10%

    205 - 60x + 60x +
          if (isFALSE(private$is_any_filtered())) {
    206 - 7x + 7x +
            return(NULL)
    @@ -45762,49 +47360,56 @@

    teal.slice coverage - 66.10%

    208 - 29x + 29x +
          if (missing(dataname)) dataname <- private$get_dataname()
    209 - 53x + 53x +
          varname <- private$get_varname_prefixed(dataname)
    210 - 53x + 53x +
          selected <- private$get_selected()
    211 - 53x + 53x +
          if (length(selected) == 0) {
    212 - 6x + 6x +
            choices <- private$get_choices()
    213 - 6x + 6x +
            fun_compare <- if (length(choices) == 1L) "==" else "%in%"
    214 - 6x + 6x +
            filter_call <- call("!", call(fun_compare, varname, make_c_call(as.character(choices))))
    @@ -45818,14 +47423,16 @@

    teal.slice coverage - 66.10%

    216 - 47x + 47x +
            if (setequal(na.omit(private$x), selected)) {
    217 - 3x + 3x +
              filter_call <- NULL
    @@ -45839,7 +47446,8 @@

    teal.slice coverage - 66.10%

    219 - 44x + 44x +
              fun_compare <- if (length(selected) == 1L) "==" else "%in%"
    @@ -45853,14 +47461,16 @@

    teal.slice coverage - 66.10%

    221 - 44x + 44x +
              if (private$data_class != "factor") {
    222 - 37x + 37x +
                selected <- do.call(sprintf("as.%s", private$data_class), list(x = selected))
    @@ -45881,63 +47491,72 @@

    teal.slice coverage - 66.10%

    225 - 44x + 44x +
              filter_call <-
    226 - 44x + 44x +
                if (inherits(selected, "Date")) {
    227 - 1x + 1x +
                  call(fun_compare, varname, call("as.Date", make_c_call(as.character(selected))))
    228 - 44x + 44x +
                } else if (inherits(selected, c("POSIXct", "POSIXlt"))) {
    229 - 2x + 2x +
                  class <- class(selected)[1L]
    230 - 2x + 2x +
                  date_fun <- as.name(
    231 - 2x + 2x +
                    switch(class,
    232 - 2x + 2x +
                      "POSIXct" = "as.POSIXct",
    233 - 2x + 2x +
                      "POSIXlt" = "as.POSIXlt"
    @@ -45958,28 +47577,32 @@

    teal.slice coverage - 66.10%

    236 - 2x + 2x +
                  call(
    237 - 2x + 2x +
                    fun_compare,
    238 - 2x + 2x +
                    varname,
    239 - 2x + 2x +
                    as.call(list(date_fun, make_c_call(as.character(selected)), tz = private$tzone))
    @@ -46007,7 +47630,8 @@

    teal.slice coverage - 66.10%

    243 - 41x + 41x +
                  call(fun_compare, varname, make_c_call(selected))
    @@ -46035,7 +47659,8 @@

    teal.slice coverage - 66.10%

    247 - 53x + 53x +
          private$add_keep_na_call(filter_call, varname)
    @@ -46154,14 +47779,16 @@

    teal.slice coverage - 66.10%

    264 - 159x + 159x +
          if (is.null(choices)) {
    265 - 144x + 144x +
            choices <- levels(private$x)
    @@ -46175,49 +47802,56 @@

    teal.slice coverage - 66.10%

    267 - 15x + 15x +
            choices <- as.character(choices)
    268 - 15x + 15x +
            choices_adjusted <- choices[choices %in% levels(private$x)]
    269 - 15x + 15x +
            if (length(setdiff(choices, choices_adjusted)) > 0L) {
    270 - 2x + 2x +
              warning(
    271 - 2x + 2x +
                sprintf(
    272 - 2x + 2x +
                  "Some choices not found in data. Adjusting. Filter id: %s.",
    273 - 2x + 2x +
                  private$get_id()
    @@ -46238,7 +47872,8 @@

    teal.slice coverage - 66.10%

    276 - 2x + 2x +
              choices <- choices_adjusted
    @@ -46252,35 +47887,40 @@

    teal.slice coverage - 66.10%

    278 - 15x + 15x +
            if (length(choices) == 0) {
    279 - 1x + 1x +
              warning(
    280 - 1x + 1x +
                sprintf(
    281 - 1x + 1x +
                  "None of the choices were found in data. Setting defaults. Filter id: %s.",
    282 - 1x + 1x +
                  private$get_id()
    @@ -46301,7 +47941,8 @@

    teal.slice coverage - 66.10%

    285 - 1x + 1x +
              choices <- levels(private$x)
    @@ -46322,35 +47963,40 @@

    teal.slice coverage - 66.10%

    288 - 159x + 159x +
          private$set_is_choice_limited(private$x, choices)
    289 - 159x + 159x +
          private$teal_slice$choices <- choices
    290 - 159x + 159x +
          private$x <- private$x[(private$x %in% private$get_choices()) | is.na(private$x)]
    291 - 159x + 159x +
          private$x <- droplevels(private$x)
    292 - 159x + 159x +
          invisible(NULL)
    @@ -46385,21 +48031,24 @@

    teal.slice coverage - 66.10%

    297 - 159x + 159x +
          xl <- x[!is.na(x)]
    298 - 159x + 159x +
          private$is_choice_limited <- length(setdiff(xl, choices)) > 0L
    299 - 159x + 159x +
          invisible(NULL)
    @@ -46434,14 +48083,16 @@

    teal.slice coverage - 66.10%

    304 - 159x + 159x +
          private$choices_counts <- choices_counts
    305 - 159x + 159x +
          invisible(NULL)
    @@ -46539,7 +48190,8 @@

    teal.slice coverage - 66.10%

    319 - 23x + 23x +
          length(private$get_choices()) <= getOption("teal.threshold_slider_vs_checkboxgroup")
    @@ -46560,21 +48212,24 @@

    teal.slice coverage - 66.10%

    322 - 188x + 188x +
          tryCatch(
    323 - 188x + 188x +
            expr = {
    324 - 188x + 188x +
              values <- as.character(values)
    @@ -46595,7 +48250,8 @@

    teal.slice coverage - 66.10%

    327 - 188x + 188x +
            error = function(e) stop("The vector of set values must contain values coercible to character.")
    @@ -46609,7 +48265,8 @@

    teal.slice coverage - 66.10%

    329 - 188x + 188x +
          values
    @@ -46637,28 +48294,32 @@

    teal.slice coverage - 66.10%

    333 - 188x + 188x +
          if (!private$is_multiple() && length(values) > 1) {
    334 - 1x + 1x +
            warning(
    335 - 1x + 1x +
              sprintf("Selection: %s is not a vector of length one. ", toString(values, width = 360)),
    336 - 1x + 1x +
              "Maintaining previous selection."
    @@ -46672,7 +48333,8 @@

    teal.slice coverage - 66.10%

    338 - 1x + 1x +
            values <- isolate(private$get_selected())
    @@ -46686,7 +48348,8 @@

    teal.slice coverage - 66.10%

    340 - 188x + 188x +
          values
    @@ -46707,35 +48370,40 @@

    teal.slice coverage - 66.10%

    343 - 188x + 188x +
          in_choices_mask <- values %in% private$get_choices()
    344 - 188x + 188x +
          if (length(values[!in_choices_mask]) > 0) {
    345 - 17x + 17x +
            warning(paste(
    346 - 17x + 17x +
              "Values:", toString(values[!in_choices_mask], width = 360),
    347 - 17x + 17x +
              "are not in choices of column", private$get_varname(), "in dataset", private$get_dataname(), "."
    @@ -46756,7 +48424,8 @@

    teal.slice coverage - 66.10%

    350 - 188x + 188x +
          values[in_choices_mask]
    @@ -46833,7 +48502,8 @@

    teal.slice coverage - 66.10%

    361 - 7x + 7x +
          ns <- NS(id)
    @@ -46854,21 +48524,24 @@

    teal.slice coverage - 66.10%

    364 - 7x + 7x +
          isolate({
    365 - 7x + 7x +
            countsmax <- private$choices_counts
    366 - 7x + 7x +
            countsnow <- if (!is.null(private$x_reactive())) {
    @@ -46896,42 +48569,48 @@

    teal.slice coverage - 66.10%

    370 - 7x + 7x +
            ui_input <- if (private$is_checkboxgroup()) {
    371 - 7x + 7x +
              labels <- countBars(
    372 - 7x + 7x +
                inputId = ns("labels"),
    373 - 7x + 7x +
                choices = private$get_choices(),
    374 - 7x + 7x +
                countsnow = countsnow,
    375 - 7x + 7x +
                countsmax = countsmax
    @@ -46945,70 +48624,80 @@

    teal.slice coverage - 66.10%

    377 - 7x + 7x +
              div(
    378 - 7x + 7x +
                class = "choices_state",
    379 - 7x + 7x +
                if (private$is_multiple()) {
    380 - 7x + 7x +
                  checkboxGroupInput(
    381 - 7x + 7x +
                    inputId = ns("selection"),
    382 - 7x + 7x +
                    label = NULL,
    383 - 7x + 7x +
                    selected = private$get_selected(),
    384 - 7x + 7x +
                    choiceNames = labels,
    385 - 7x + 7x +
                    choiceValues = private$get_choices(),
    386 - 7x + 7x +
                    width = "100%"
    @@ -47239,28 +48928,32 @@

    teal.slice coverage - 66.10%

    419 - 7x + 7x +
            div(
    420 - 7x + 7x +
              uiOutput(ns("trigger_visible")),
    421 - 7x + 7x +
              ui_input,
    422 - 7x + 7x +
              private$keep_na_ui(ns("keep_na"))
    @@ -47330,28 +49023,32 @@

    teal.slice coverage - 66.10%

    432 - 7x + 7x +
          moduleServer(
    433 - 7x + 7x +
            id = id,
    434 - 7x + 7x +
            function(input, output, session) {
    435 - 7x + 7x +
              logger::log_trace("ChoicesFilterState$server_inputs initializing, id: { private$get_id() }")
    @@ -47386,21 +49083,24 @@

    teal.slice coverage - 66.10%

    440 - 7x + 7x +
              non_missing_values <- reactive(Filter(Negate(is.na), private$x_reactive()))
    441 - 7x + 7x +
              output$trigger_visible <- renderUI({
    442 - 7x + 7x +
                logger::log_trace("ChoicesFilterState$server_inputs@1 updating count labels, id: { private$get_id() }")
    @@ -47414,7 +49114,8 @@

    teal.slice coverage - 66.10%

    444 - 7x + 7x +
                countsnow <- if (!is.null(private$x_reactive())) {
    @@ -47449,49 +49150,56 @@

    teal.slice coverage - 66.10%

    449 - 7x + 7x +
                isolate({
    450 - 7x + 7x +
                  if (private$is_checkboxgroup()) {
    451 - 7x + 7x +
                    updateCountBars(
    452 - 7x + 7x +
                      inputId = "labels",
    453 - 7x + 7x +
                      choices = private$get_choices(),
    454 - 7x + 7x +
                      countsmax = private$choices_counts,
    455 - 7x + 7x +
                      countsnow = countsnow
    @@ -47603,7 +49311,8 @@

    teal.slice coverage - 66.10%

    471 - 7x + 7x +
                  NULL
    @@ -47631,42 +49340,48 @@

    teal.slice coverage - 66.10%

    475 - 7x + 7x +
              if (private$is_checkboxgroup()) {
    476 - 7x + 7x +
                private$observers$selection <- observeEvent(
    477 - 7x + 7x +
                  ignoreNULL = FALSE,
    478 - 7x + 7x +
                  ignoreInit = TRUE, # ignoreInit: should not matter because we set the UI with the desired initial state
    479 - 7x + 7x +
                  eventExpr = input$selection,
    480 - 7x + 7x +
                  handlerExpr = {
    @@ -47988,7 +49703,8 @@

    teal.slice coverage - 66.10%

    526 - 7x + 7x +
              private$keep_na_srv("keep_na")
    @@ -48023,7 +49739,8 @@

    teal.slice coverage - 66.10%

    531 - 7x + 7x +
              private$observers$selection_api <- observeEvent(private$get_selected(), {
    @@ -48044,49 +49761,56 @@

    teal.slice coverage - 66.10%

    534 - 2x + 2x +
                if (!setequal(input$selection, private$get_selected())) {
    535 - 2x + 2x +
                  logger::log_trace("ChoicesFilterState$server@1 state changed, id: { private$get_id() }")
    536 - 2x + 2x +
                  if (private$is_checkboxgroup()) {
    537 - 2x + 2x +
                    if (private$is_multiple()) {
    538 - 2x + 2x +
                      updateCheckboxGroupInput(
    539 - 2x + 2x +
                        inputId = "selection",
    540 - 2x + 2x +
                        selected = private$get_selected()
    @@ -48205,14 +49929,16 @@

    teal.slice coverage - 66.10%

    557 - 7x + 7x +
              logger::log_trace("ChoicesFilterState$server_inputs initialized, id: { private$get_id() }")
    558 - 7x + 7x +
              NULL
    @@ -48464,21 +50190,24 @@

    teal.slice coverage - 66.10%

    594 - 7x + 7x +
          selected <- private$get_selected()
    595 - 7x + 7x +
          selected_text <-
    596 - 7x + 7x +
            if (length(selected) == 0L) {
    @@ -48499,14 +50228,16 @@

    teal.slice coverage - 66.10%

    599 - 7x + 7x +
              if (sum(nchar(selected)) <= 40L) {
    600 - 7x + 7x +
                paste(selected, collapse = ", ")
    @@ -48541,28 +50272,32 @@

    teal.slice coverage - 66.10%

    605 - 7x + 7x +
          tagList(
    606 - 7x + 7x +
            tags$span(
    607 - 7x + 7x +
              class = "filter-card-summary-value",
    608 - 7x + 7x +
              selected_text
    @@ -48576,21 +50311,24 @@

    teal.slice coverage - 66.10%

    610 - 7x + 7x +
            tags$span(
    611 - 7x + 7x +
              class = "filter-card-summary-controls",
    612 - 7x + 7x +
              if (private$na_count > 0) {
    @@ -48876,7 +50614,8 @@

    teal.slice coverage - 66.10%

    33 - 153x + 153x +
          logger::log_trace("Instantiating { class(self)[1] }, dataname: { dataname }")
    @@ -48897,21 +50636,24 @@

    teal.slice coverage - 66.10%

    36 - 153x + 153x +
          check_simple_name(dataname)
    37 - 151x + 151x +
          checkmate::assert_character(keys, any.missing = FALSE)
    38 - 151x + 151x +
          checkmate::assert_character(label, null.ok = TRUE)
    @@ -48925,35 +50667,40 @@

    teal.slice coverage - 66.10%

    40 - 151x + 151x +
          logger::log_trace("Instantiating { class(self)[1] }, dataname: { dataname }")
    41 - 151x + 151x +
          private$dataset <- dataset
    42 - 151x + 151x +
          private$dataname <- dataname
    43 - 151x + 151x +
          private$keys <- keys
    44 - 151x + 151x +
          private$label <- if (is.null(label)) character(0) else label
    @@ -48974,28 +50721,32 @@

    teal.slice coverage - 66.10%

    47 - 151x + 151x +
          private$data_filtered_fun <- function(sid = "") {
    48 - 24x + 24x +
            checkmate::assert_character(sid)
    49 - 24x + 24x +
            if (length(sid)) {
    50 - 24x + 24x +
              logger::log_trace("filtering data dataname: { dataname }, sid: { sid }")
    @@ -49023,35 +50774,40 @@

    teal.slice coverage - 66.10%

    54 - 24x + 24x +
            env <- new.env(parent = parent.env(globalenv()))
    55 - 24x + 24x +
            env[[dataname]] <- private$dataset
    56 - 24x + 24x +
            filter_call <- self$get_call(sid)
    57 - 24x + 24x +
            eval_expr_with_msg(filter_call, env)
    58 - 24x + 24x +
            get(x = dataname, envir = env)
    @@ -49072,21 +50828,24 @@

    teal.slice coverage - 66.10%

    61 - 151x + 151x +
          private$data_filtered <- reactive(private$data_filtered_fun())
    62 - 151x + 151x +
          logger::log_trace("Instantiated { class(self)[1] }, dataname: { private$dataname }")
    63 - 151x + 151x +
          invisible(self)
    @@ -49170,28 +50929,32 @@

    teal.slice coverage - 66.10%

    75 - 24x + 24x +
          sprintf(
    76 - 24x + 24x +
            "%s:\n%s",
    77 - 24x + 24x +
            class(self)[1],
    78 - 24x + 24x +
            format(self$get_filter_state(), show_all = show_all, trim_lines = trim_lines)
    @@ -49261,7 +51024,8 @@

    teal.slice coverage - 66.10%

    88 - 10x + 10x +
          cat(isolate(self$format(...)), "\n")
    @@ -49338,28 +51102,32 @@

    teal.slice coverage - 66.10%

    99 - 14x + 14x +
          logger::log_trace("Removing filters from FilteredDataset: { deparse1(self$get_dataname()) }")
    100 - 14x + 14x +
          lapply(
    101 - 14x + 14x +
            private$get_filter_states(),
    102 - 14x + 14x +
            function(filter_states) filter_states$clear_filter_states(force)
    @@ -49373,14 +51141,16 @@

    teal.slice coverage - 66.10%

    104 - 14x + 14x +
          logger::log_trace("Removed filters from FilteredDataset: { deparse1(self$get_dataname()) }")
    105 - 14x + 14x +
          NULL
    @@ -49513,21 +51283,24 @@

    teal.slice coverage - 66.10%

    124 - 47x + 47x +
          filter_call <- Filter(
    125 - 47x + 47x +
            f = Negate(is.null),
    126 - 47x + 47x +
            x = lapply(private$get_filter_states(), function(x) x$get_call(sid))
    @@ -49541,14 +51314,16 @@

    teal.slice coverage - 66.10%

    128 - 47x + 47x +
          if (length(filter_call) == 0) {
    129 - 29x + 29x +
            return(NULL)
    @@ -49562,7 +51337,8 @@

    teal.slice coverage - 66.10%

    131 - 18x + 18x +
          filter_call
    @@ -49625,14 +51401,16 @@

    teal.slice coverage - 66.10%

    140 - 184x + 184x +
          states <- unname(lapply(private$get_filter_states(), function(x) x$get_filter_state()))
    141 - 184x + 184x +
          do.call(c, states)
    @@ -49758,7 +51536,8 @@

    teal.slice coverage - 66.10%

    159 - 16x + 16x +
          length(self$get_filter_state())
    @@ -49814,7 +51593,8 @@

    teal.slice coverage - 66.10%

    167 - 8x + 8x +
          private$dataname
    @@ -49905,14 +51685,16 @@

    teal.slice coverage - 66.10%

    180 - 51x + 51x +
          if (filtered) {
    181 - 33x + 33x +
            private$data_filtered
    @@ -49926,7 +51708,8 @@

    teal.slice coverage - 66.10%

    183 - 18x + 18x +
            private$dataset
    @@ -50031,7 +51814,8 @@

    teal.slice coverage - 66.10%

    198 - 133x + 133x +
          private$keys
    @@ -50080,7 +51864,8 @@

    teal.slice coverage - 66.10%

    205 - 2x + 2x +
          private$label
    @@ -50626,77 +52411,88 @@

    teal.slice coverage - 66.10%

    283 - 7x + 7x +
          moduleServer(
    284 - 7x + 7x +
            id = id,
    285 - 7x + 7x +
            function(input, output, session) {
    286 - 7x + 7x +
              dataname <- self$get_dataname()
    287 - 7x + 7x +
              logger::log_trace("FilteredDataset$srv_active initializing, dataname: { dataname }")
    288 - 7x + 7x +
              checkmate::assert_string(dataname)
    289 - 7x + 7x +
              output$filter_count <- renderText(
    290 - 7x + 7x +
                sprintf(
    291 - 7x + 7x +
                  "%d filter%s applied",
    292 - 7x + 7x +
                  self$get_filter_count(),
    293 - 7x + 7x +
                  if (self$get_filter_count() != 1) "s" else ""
    @@ -50724,28 +52520,32 @@

    teal.slice coverage - 66.10%

    297 - 7x + 7x +
              lapply(
    298 - 7x + 7x +
                names(private$get_filter_states()),
    299 - 7x + 7x +
                function(x) {
    300 - 12x + 12x +
                  private$get_filter_states()[[x]]$srv_active(id = x)
    @@ -50773,35 +52573,40 @@

    teal.slice coverage - 66.10%

    304 - 7x + 7x +
              observeEvent(self$get_filter_state(), {
    305 - 8x + 8x +
                shinyjs::hide("filter_count_ui")
    306 - 8x + 8x +
                shinyjs::show("filters")
    307 - 8x + 8x +
                shinyjs::toggle("remove_filters", condition = length(self$get_filter_state()) != 0)
    308 - 8x + 8x +
                shinyjs::toggle("collapse", condition = length(self$get_filter_state()) != 0)
    @@ -50822,7 +52627,8 @@

    teal.slice coverage - 66.10%

    311 - 7x + 7x +
              observeEvent(input$collapse, {
    @@ -50864,28 +52670,32 @@

    teal.slice coverage - 66.10%

    317 - 7x + 7x +
              observeEvent(input$remove_filters, {
    318 - 1x + 1x +
                logger::log_trace("FilteredDataset$srv_active@1 removing all non-anchored filters, dataname: { dataname }")
    319 - 1x + 1x +
                self$clear_filter_states()
    320 - 1x + 1x +
                logger::log_trace("FilteredDataset$srv_active@1 removed all non-anchored filters, dataname: { dataname }")
    @@ -50906,7 +52716,8 @@

    teal.slice coverage - 66.10%

    323 - 7x + 7x +
              logger::log_trace("FilteredDataset$initialized, dataname: { dataname }")
    @@ -50920,7 +52731,8 @@

    teal.slice coverage - 66.10%

    325 - 7x + 7x +
              NULL
    @@ -51011,7 +52823,8 @@

    teal.slice coverage - 66.10%

    338 - 1x + 1x +
          stop("Pure virtual method")
    @@ -51109,63 +52922,72 @@

    teal.slice coverage - 66.10%

    352 - 2x + 2x +
          moduleServer(
    353 - 2x + 2x +
            id = id,
    354 - 2x + 2x +
            function(input, output, session) {
    355 - 2x + 2x +
              logger::log_trace("MAEFilteredDataset$srv_add initializing, dataname: { deparse1(self$get_dataname()) }")
    356 - 2x + 2x +
              elems <- private$get_filter_states()
    357 - 2x + 2x +
              elem_names <- names(private$get_filter_states())
    358 - 2x + 2x +
              lapply(
    359 - 2x + 2x +
                elem_names,
    360 - 2x + 2x +
                function(elem_name) elems[[elem_name]]$srv_add(elem_name)
    @@ -51179,14 +53001,16 @@

    teal.slice coverage - 66.10%

    362 - 2x + 2x +
              logger::log_trace("MAEFilteredDataset$srv_add initialized, dataname: { deparse1(self$get_dataname()) }")
    363 - 2x + 2x +
              NULL
    @@ -51326,28 +53150,32 @@

    teal.slice coverage - 66.10%

    383 - 225x + 225x +
          checkmate::assert_class(filter_states, "FilterStates")
    384 - 225x + 225x +
          checkmate::assert_string(id)
    385 - 225x + 225x +
          x <- stats::setNames(list(filter_states), id)
    386 - 225x + 225x +
          private$filter_states <- c(private$get_filter_states(), x)
    @@ -51396,7 +53224,8 @@

    teal.slice coverage - 66.10%

    393 - 684x + 684x +
          private$filter_states
    @@ -51948,42 +53777,48 @@

    teal.slice coverage - 66.10%

    75 - 25x + 25x +
      checkmate::assert_string(inputId)
    76 - 21x + 21x +
      checkmate::assert_vector(choices)
    77 - 20x + 20x +
      checkmate::assert_numeric(countsmax, len = length(choices))
    78 - 17x + 17x +
      checkmate::assert_numeric(countsnow, len = length(choices), null.ok = TRUE)
    79 - 15x + 15x +
      if (!is.null(countsnow)) {
    80 - 7x + 7x +
        checkmate::assert_true(all(countsnow <= countsmax))
    @@ -52004,7 +53839,8 @@

    teal.slice coverage - 66.10%

    83 - 14x + 14x +
      ns <- NS(inputId)
    @@ -52018,56 +53854,64 @@

    teal.slice coverage - 66.10%

    85 - 14x + 14x +
      mapply(
    86 - 14x + 14x +
        countBar,
    87 - 14x + 14x +
        inputId = ns(seq_along(choices)),
    88 - 14x + 14x +
        label = as.character(choices),
    89 - 14x + 14x +
        countmax = countsmax,
    90 - 14x + 14x +
        countnow = if (is.null(countsnow)) rep(list(NULL), length(choices)) else countsnow,
    91 - 14x + 14x +
        MoreArgs = list(
    92 - 14x + 14x +
          counttotal = sum(countsmax)
    @@ -52081,7 +53925,8 @@

    teal.slice coverage - 66.10%

    94 - 14x + 14x +
        SIMPLIFY = FALSE, USE.NAMES = FALSE
    @@ -52256,35 +54101,40 @@

    teal.slice coverage - 66.10%

    119 - 62x + 62x +
      checkmate::assert_string(inputId)
    120 - 58x + 58x +
      checkmate::assert_string(label)
    121 - 55x + 55x +
      checkmate::assert_number(countmax)
    122 - 53x + 53x +
      checkmate::assert_number(countnow, null.ok = TRUE, upper = countmax)
    123 - 51x + 51x +
      checkmate::assert_number(counttotal, lower = countmax)
    @@ -52298,35 +54148,40 @@

    teal.slice coverage - 66.10%

    125 - 49x + 49x +
      label <- make_count_text(label, countmax = countmax, countnow = countnow)
    126 - 49x + 49x +
      ns <- NS(inputId)
    127 - 26x + 26x +
      if (is.null(countnow)) countnow <- 0
    128 - 49x + 49x +
      tags$div(
    129 - 49x + 49x +
        class = "progress state-count-container",
    @@ -52340,42 +54195,48 @@

    teal.slice coverage - 66.10%

    131 - 49x + 49x +
        tags$div(
    132 - 49x + 49x +
          id = ns("count_bar_filtered"),
    133 - 49x + 49x +
          class = "progress-bar state-count-bar-filtered",
    134 - 49x + 49x +
          style = sprintf("width: %s%%", countnow / counttotal * 100),
    135 - 49x + 49x +
          role = "progressbar",
    136 - 49x + 49x +
          label
    @@ -52389,35 +54250,40 @@

    teal.slice coverage - 66.10%

    138 - 49x + 49x +
        tags$div(
    139 - 49x + 49x +
          id = ns("count_bar_unfiltered"),
    140 - 49x + 49x +
          class = "progress-bar state-count-bar-unfiltered",
    141 - 49x + 49x +
          style = sprintf("width: %s%%", (countmax - countnow) / counttotal * 100),
    142 - 49x + 49x +
          role = "progressbar"
    @@ -52466,28 +54332,32 @@

    teal.slice coverage - 66.10%

    149 - 7x + 7x +
      checkmate::assert_string(inputId)
    150 - 7x + 7x +
      checkmate::assert_vector(choices)
    151 - 7x + 7x +
      checkmate::assert_numeric(countsmax, len = length(choices))
    152 - 7x + 7x +
      checkmate::assert_numeric(countsnow, len = length(choices), null.ok = TRUE)
    @@ -52501,63 +54371,72 @@

    teal.slice coverage - 66.10%

    154 - 7x + 7x +
      ns <- NS(inputId)
    155 - 7x + 7x +
      mapply(
    156 - 7x + 7x +
        updateCountBar,
    157 - 7x + 7x +
        inputId = ns(seq_along(choices)),
    158 - 7x + 7x +
        label = choices,
    159 - 7x + 7x +
        countmax = countsmax,
    160 - 7x + 7x +
        countnow = if (is.null(countsnow)) rep(list(NULL), length(choices)) else countsnow,
    161 - 7x + 7x +
        MoreArgs = list(
    162 - 7x + 7x +
          counttotal = sum(countsmax)
    @@ -52578,7 +54457,8 @@

    teal.slice coverage - 66.10%

    165 - 7x + 7x +
      invisible(NULL)
    @@ -52613,35 +54493,40 @@

    teal.slice coverage - 66.10%

    170 - 18x + 18x +
      checkmate::assert_string(inputId)
    171 - 18x + 18x +
      checkmate::assert_string(label)
    172 - 18x + 18x +
      checkmate::assert_number(countmax)
    173 - 18x + 18x +
      checkmate::assert_number(countnow, null.ok = TRUE)
    174 - 18x + 18x +
      checkmate::assert_number(counttotal)
    @@ -52655,70 +54540,80 @@

    teal.slice coverage - 66.10%

    176 - 18x + 18x +
      label <- make_count_text(label, countmax = countmax, countnow = countnow)
    177 - 18x + 18x +
      if (is.null(countnow)) countnow <- countmax
    178 - 18x + 18x +
      session$sendCustomMessage(
    179 - 18x + 18x +
        type = "updateCountBar",
    180 - 18x + 18x +
        message = list(
    181 - 18x + 18x +
          id = session$ns(inputId),
    182 - 18x + 18x +
          label = label,
    183 - 18x + 18x +
          countmax = countmax,
    184 - 18x + 18x +
          countnow = countnow,
    185 - 18x + 18x +
          counttotal = counttotal
    @@ -52746,7 +54641,8 @@

    teal.slice coverage - 66.10%

    189 - 18x + 18x +
      invisible(NULL)
    @@ -52781,70 +54677,80 @@

    teal.slice coverage - 66.10%

    194 - 17x + 17x +
      checkmate::assert_string(inputId)
    195 - 17x + 17x +
      checkmate::assert_string(label)
    196 - 17x + 17x +
      checkmate::assert_number(countmax)
    197 - 17x + 17x +
      checkmate::assert_number(countnow, null.ok = TRUE)
    198 - 17x + 17x +
      label <- make_count_text(label, countmax = countmax, countnow = countnow)
    199 - 17x + 17x +
      session$sendCustomMessage(
    200 - 17x + 17x +
        type = "updateCountText",
    201 - 17x + 17x +
        message = list(
    202 - 17x + 17x +
          id = session$ns(inputId),
    203 - 17x + 17x +
          label = label
    @@ -52984,56 +54890,64 @@

    teal.slice coverage - 66.10%

    223 - 96x + 96x +
      checkmate::assert_string(label)
    224 - 94x + 94x +
      checkmate::assert_number(countmax)
    225 - 92x + 92x +
      checkmate::assert_number(countnow, null.ok = TRUE)
    226 - 90x + 90x +
      sprintf(
    227 - 90x + 90x +
        "%s (%s%s)",
    228 - 90x + 90x +
        label,
    229 - 90x + 90x +
        if (is.null(countnow)) "" else sprintf("%s/", countnow),
    230 - 90x + 90x +
        countmax
    @@ -53942,21 +55856,24 @@

    teal.slice coverage - 66.10%

    127 - 579x + 579x +
      checkmate::assert_string(dataname)
    128 - 572x + 572x +
      checkmate::assert_flag(fixed)
    129 - 570x + 570x +
      checkmate::assert_flag(anchored)
    @@ -53970,7 +55887,8 @@

    teal.slice coverage - 66.10%

    131 - 568x + 568x +
      formal_args <- as.list(environment())
    @@ -53984,7 +55902,8 @@

    teal.slice coverage - 66.10%

    133 - 568x + 568x +
      if (!missing(expr) && !missing(varname)) {
    @@ -53998,28 +55917,32 @@

    teal.slice coverage - 66.10%

    135 - 568x + 568x +
      } else if (!missing(expr)) {
    136 - 30x + 30x +
        checkmate::assert_string(id)
    137 - 27x + 27x +
        checkmate::assert_string(title)
    138 - 24x + 24x +
        checkmate::assert_string(expr)
    @@ -54033,84 +55956,96 @@

    teal.slice coverage - 66.10%

    140 - 23x + 23x +
        formal_args$fixed <- TRUE
    141 - 23x + 23x +
        ts_expr_args <- c("dataname", "id", "expr", "fixed", "anchored", "title")
    142 - 23x + 23x +
        formal_args <- formal_args[ts_expr_args]
    143 - 23x + 23x +
        ans <- do.call(reactiveValues, c(formal_args, list(...)))
    144 - 23x + 23x +
        class(ans) <- c("teal_slice_expr", "teal_slice", class(ans))
    145 - 538x + 538x +
      } else if (!missing(varname)) {
    146 - 537x + 537x +
        checkmate::assert_string(varname)
    147 - 534x + 534x +
        checkmate::assert_multi_class(choices, .filterable_class, null.ok = TRUE)
    148 - 533x + 533x +
        checkmate::assert_multi_class(selected, .filterable_class, null.ok = TRUE)
    149 - 531x + 531x +
        checkmate::assert_flag(keep_na, null.ok = TRUE)
    150 - 530x + 530x +
        checkmate::assert_flag(keep_inf, null.ok = TRUE)
    151 - 529x + 529x +
        checkmate::assert_flag(multiple)
    @@ -54124,21 +56059,24 @@

    teal.slice coverage - 66.10%

    153 - 529x + 529x +
        ts_var_args <- c(
    154 - 529x + 529x +
          "dataname", "varname", "id", "choices", "selected", "keep_na", "keep_inf",
    155 - 529x + 529x +
          "fixed", "anchored", "multiple"
    @@ -54152,42 +56090,48 @@

    teal.slice coverage - 66.10%

    157 - 529x + 529x +
        formal_args <- formal_args[ts_var_args]
    158 - 529x + 529x +
        args <- c(formal_args, list(...))
    159 - 529x + 529x +
        args[c("choices", "selected")] <-
    160 - 529x + 529x +
          lapply(args[c("choices", "selected")], function(x) if (is.factor(x)) as.character(x) else x)
    161 - 529x + 529x +
        if (missing(id)) {
    162 - 520x + 520x +
          args$id <- get_default_slice_id(args)
    @@ -54201,7 +56145,8 @@

    teal.slice coverage - 66.10%

    164 - 9x + 9x +
          checkmate::assert_string(id)
    @@ -54215,14 +56160,16 @@

    teal.slice coverage - 66.10%

    166 - 526x + 526x +
        ans <- do.call(reactiveValues, args)
    167 - 526x + 526x +
        class(ans) <- c("teal_slice_var", "teal_slice", class(ans))
    @@ -54236,7 +56183,8 @@

    teal.slice coverage - 66.10%

    169 - 1x + 1x +
        stop("Must provide either `expr` or `varname`.")
    @@ -54257,7 +56205,8 @@

    teal.slice coverage - 66.10%

    172 - 549x + 549x +
      ans
    @@ -54313,7 +56262,8 @@

    teal.slice coverage - 66.10%

    180 - 4x + 4x +
      inherits(x, "teal_slice")
    @@ -54432,7 +56382,8 @@

    teal.slice coverage - 66.10%

    197 - 283x + 283x +
      formal_args <- setdiff(names(formals(teal_slice)), "...")
    @@ -54446,7 +56397,8 @@

    teal.slice coverage - 66.10%

    199 - 283x + 283x +
      x <- if (isRunning()) {
    @@ -54467,7 +56419,8 @@

    teal.slice coverage - 66.10%

    202 - 283x + 283x +
        isolate(reactiveValuesToList(x))
    @@ -54488,14 +56441,16 @@

    teal.slice coverage - 66.10%

    205 - 283x + 283x +
      formal_args <- intersect(formal_args, names(x))
    206 - 283x + 283x +
      extra_args <- rev(setdiff(names(x), formal_args))
    @@ -54509,7 +56464,8 @@

    teal.slice coverage - 66.10%

    208 - 283x + 283x +
      x[c(formal_args, extra_args)]
    @@ -54572,14 +56528,16 @@

    teal.slice coverage - 66.10%

    217 - 116x + 116x +
      checkmate::assert_flag(show_all)
    218 - 92x + 92x +
      checkmate::assert_flag(trim_lines)
    @@ -54593,14 +56551,16 @@

    teal.slice coverage - 66.10%

    220 - 86x + 86x +
      x_list <- as.list(x)
    221 - 47x + 47x +
      if (!show_all) x_list <- Filter(Negate(is.null), x_list)
    @@ -54614,7 +56574,8 @@

    teal.slice coverage - 66.10%

    223 - 86x + 86x +
      jsonify(x_list, trim_lines)
    @@ -54670,7 +56631,8 @@

    teal.slice coverage - 66.10%

    231 - 15x + 15x +
      cat(format(x, ...))
    @@ -54796,7 +56758,8 @@

    teal.slice coverage - 66.10%

    249 - 131x + 131x +
      checkmate::assert_list(x)
    @@ -54810,28 +56773,32 @@

    teal.slice coverage - 66.10%

    251 - 131x + 131x +
      x_json <- to_json(x)
    252 - 131x + 131x +
      x_json_justified <- justify_json(x_json)
    253 - 121x + 121x +
      if (trim_lines) x_json_justified <- trim_lines_json(x_json_justified)
    254 - 131x + 131x +
      paste(x_json_justified, collapse = "\n")
    @@ -54936,35 +56903,40 @@

    teal.slice coverage - 66.10%

    269 - 131x + 131x +
      no_unbox <- function(x) {
    270 - 2390x + 2390x +
        vars <- c("selected", "choices")
    271 - 2390x + 2390x +
        if (is.list(x)) {
    272 - 385x + 385x +
          for (var in vars) {
    273 - 307x + 307x +
            if (!is.null(x[[var]])) x[[var]] <- I(format_time(x[[var]]))
    @@ -54978,7 +56950,8 @@

    teal.slice coverage - 66.10%

    275 - 385x + 385x +
          lapply(x, no_unbox)
    @@ -54992,7 +56965,8 @@

    teal.slice coverage - 66.10%

    277 - 2005x + 2005x +
          x
    @@ -55020,7 +56994,8 @@

    teal.slice coverage - 66.10%

    281 - 131x + 131x +
      jsonlite::toJSON(no_unbox(x), pretty = TRUE, auto_unbox = TRUE, digits = 16, null = "null")
    @@ -55132,14 +57107,16 @@

    teal.slice coverage - 66.10%

    297 - 307x + 307x +
      if ("POSIXt" %in% class(x)) {
    298 - 20x + 20x +
        format(x, format = "%Y-%m-%d %H:%M:%S", usetz = TRUE, tz = "UTC")
    @@ -55153,7 +57130,8 @@

    teal.slice coverage - 66.10%

    300 - 287x + 287x +
        x
    @@ -55258,35 +57236,40 @@

    teal.slice coverage - 66.10%

    315 - 131x + 131x +
      format_name <- function(name, name_width) {
    316 - 2775x + 2775x +
        if (nchar(name) == 1 || nchar(gsub("\\s", "", name)) <= 2) {
    317 - 630x + 630x +
          return(name)
    318 - 2145x + 2145x +
        } else if (grepl("slices|attributes", name)) {
    319 - 90x + 90x +
          paste0(name, ":")
    @@ -55300,7 +57283,8 @@

    teal.slice coverage - 66.10%

    321 - 2055x + 2055x +
          paste(format(name, width = name_width), ":")
    @@ -55321,28 +57305,32 @@

    teal.slice coverage - 66.10%

    324 - 131x + 131x +
      json_lines <- strsplit(json, "\n")[[1]]
    325 - 131x + 131x +
      json_lines_split <- regmatches(json_lines, regexpr(":", json_lines), invert = TRUE)
    326 - 131x + 131x +
      name_width <- max(unlist(regexpr(":", json_lines))) - 1
    327 - 131x + 131x +
      vapply(json_lines_split, function(x) paste0(format_name(x[1], name_width), stats::na.omit(x[2])), character(1))
    @@ -55447,35 +57435,40 @@

    teal.slice coverage - 66.10%

    342 - 121x + 121x +
      name_width <- max(unlist(gregexpr(":", x))) - 1
    343 - 121x + 121x +
      trim_position <- name_width + 37L
    344 - 121x + 121x +
      x_trim <- substr(x, 1, trim_position)
    345 - 121x + 121x +
      substr(x_trim, trim_position - 2, trim_position) <- "..."
    346 - 121x + 121x +
      x_trim
    @@ -55643,28 +57636,32 @@

    teal.slice coverage - 66.10%

    370 - 609x + 609x +
      checkmate::assert_multi_class(x, c("teal_slice", "list"))
    371 - 609x + 609x +
      isolate({
    372 - 609x + 609x +
        if (inherits(x, "teal_slice_expr") || is.null(x$varname)) {
    373 - 10x + 10x +
          x$id
    @@ -55678,28 +57675,32 @@

    teal.slice coverage - 66.10%

    375 - 599x + 599x +
          paste(
    376 - 599x + 599x +
            Filter(
    377 - 599x + 599x +
              length,
    378 - 599x + 599x +
              as.list(x)[c("dataname", "varname", "experiment", "arg")]
    @@ -55713,7 +57714,8 @@

    teal.slice coverage - 66.10%

    380 - 599x + 599x +
            collapse = " "
    @@ -56020,7 +58022,8 @@

    teal.slice coverage - 66.10%

    39 - 26x + 26x +
          if (!requireNamespace("MultiAssayExperiment", quietly = TRUE)) {
    @@ -56041,14 +58044,16 @@

    teal.slice coverage - 66.10%

    42 - 26x + 26x +
          checkmate::assert_function(data_reactive, args = "sid")
    43 - 26x + 26x +
          checkmate::assert_class(data, "MultiAssayExperiment")
    @@ -56062,35 +58067,40 @@

    teal.slice coverage - 66.10%

    45 - 25x + 25x +
          data <- SummarizedExperiment::colData(data)
    46 - 25x + 25x +
          data_reactive <- function(sid = "") SummarizedExperiment::colData(data_reactive(sid = sid))
    47 - 25x + 25x +
          super$initialize(data, data_reactive, dataname, datalabel)
    48 - 25x + 25x +
          private$keys <- keys
    49 - 25x + 25x +
          private$set_filterable_varnames(include_varnames = colnames(data))
    @@ -56104,7 +58114,8 @@

    teal.slice coverage - 66.10%

    51 - 25x + 25x +
          invisible(self)
    @@ -56852,49 +58863,56 @@

    teal.slice coverage - 66.10%

    96 - 764x + 764x +
      slices <- list(...)
    97 - 764x + 764x +
      checkmate::assert_list(slices, types = "teal_slice", any.missing = FALSE)
    98 - 763x + 763x +
      slices_id <- isolate(vapply(slices, `[[`, character(1L), "id"))
    99 - 763x + 763x +
      if (any(duplicated(slices_id))) {
    100 - 1x + 1x +
        stop(
    101 - 1x + 1x +
          "Some teal_slice objects have the same id:\n",
    102 - 1x + 1x +
          toString(unique(slices_id[duplicated(slices_id)]))
    @@ -56915,35 +58933,40 @@

    teal.slice coverage - 66.10%

    105 - 762x + 762x +
      checkmate::assert_list(exclude_varnames, names = "named", types = "character", null.ok = TRUE, min.len = 1)
    106 - 761x + 761x +
      checkmate::assert_list(include_varnames, names = "named", types = "character", null.ok = TRUE, min.len = 1)
    107 - 760x + 760x +
      checkmate::assert_character(count_type, len = 1, null.ok = TRUE)
    108 - 758x + 758x +
      checkmate::assert_subset(count_type, choices = c("all", "none"), empty.ok = TRUE)
    109 - 757x + 757x +
      checkmate::assert_logical(allow_add)
    @@ -56957,35 +58980,40 @@

    teal.slice coverage - 66.10%

    111 - 756x + 756x +
      duplicated_datasets <- intersect(names(include_varnames), names(exclude_varnames))
    112 - 756x + 756x +
      if (length(duplicated_datasets)) {
    113 - 1x + 1x +
        stop(
    114 - 1x + 1x +
          "Some datasets are specified in both, include_varnames and exclude_varnames:\n",
    115 - 1x + 1x +
          toString(duplicated_datasets)
    @@ -57013,49 +59041,56 @@

    teal.slice coverage - 66.10%

    119 - 755x + 755x +
      structure(
    120 - 755x + 755x +
        slices,
    121 - 755x + 755x +
        exclude_varnames = exclude_varnames,
    122 - 755x + 755x +
        include_varnames = include_varnames,
    123 - 755x + 755x +
        count_type = count_type,
    124 - 755x + 755x +
        allow_add = allow_add,
    125 - 755x + 755x +
        class = c("teal_slices", class(slices))
    @@ -57125,7 +59160,8 @@

    teal.slice coverage - 66.10%

    135 - 465x + 465x +
      inherits(x, "teal_slices")
    @@ -57286,21 +59322,24 @@

    teal.slice coverage - 66.10%

    158 - 1077x + 1077x +
      ans <- unclass(x)
    159 - 45x + 45x +
      if (recursive) ans[] <- lapply(ans, as.list)
    160 - 1077x + 1077x +
      ans
    @@ -57363,21 +59402,24 @@

    teal.slice coverage - 66.10%

    169 - 3x + 3x +
      if (missing(i)) i <- seq_along(x)
    170 - 506x + 506x +
      if (length(i) == 0L) {
    171 - 178x + 178x +
        return(x[0])
    @@ -57391,35 +59433,40 @@

    teal.slice coverage - 66.10%

    173 - 1x + 1x +
      if (is.logical(i) && length(i) > length(x)) stop("subscript out of bounds")
    174 - 1x + 1x +
      if (is.numeric(i) && max(i) > length(x)) stop("subscript out of bounds")
    175 - 326x + 326x +
      if (is.character(i)) {
    176 - 1x + 1x +
        if (!all(is.element(i, names(x)))) stop("subscript out of bounds")
    177 - 2x + 2x +
        i <- which(is.element(i, names(x)))
    @@ -57440,35 +59487,40 @@

    teal.slice coverage - 66.10%

    180 - 325x + 325x +
      y <- NextMethod("[")
    181 - 325x + 325x +
      attrs <- attributes(x)
    182 - 325x + 325x +
      attrs$names <- attrs$names[i]
    183 - 325x + 325x +
      attributes(y) <- attrs
    184 - 325x + 325x +
      y
    @@ -57531,14 +59583,16 @@

    teal.slice coverage - 66.10%

    193 - 252x + 252x +
      x <- list(...)
    194 - 252x + 252x +
      checkmate::assert_true(all(vapply(x, is.teal_slices, logical(1L))), .var.name = "all arguments are teal_slices")
    @@ -57552,21 +59606,24 @@

    teal.slice coverage - 66.10%

    196 - 251x + 251x +
      all_attributes <- lapply(x, attributes)
    197 - 251x + 251x +
      all_attributes <- coalesce_r(all_attributes)
    198 - 251x + 251x +
      all_attributes <- all_attributes[names(all_attributes) != "class"]
    @@ -57580,35 +59637,40 @@

    teal.slice coverage - 66.10%

    200 - 251x + 251x +
      do.call(
    201 - 251x + 251x +
        teal_slices,
    202 - 251x + 251x +
        c(
    203 - 251x + 251x +
          unique(unlist(x, recursive = FALSE)),
    204 - 251x + 251x +
          all_attributes
    @@ -57699,14 +59761,16 @@

    teal.slice coverage - 66.10%

    217 - 45x + 45x +
      checkmate::assert_flag(show_all)
    218 - 45x + 45x +
      checkmate::assert_flag(trim_lines)
    @@ -57720,35 +59784,40 @@

    teal.slice coverage - 66.10%

    220 - 45x + 45x +
      x <- as.list(x, recursive = TRUE)
    221 - 45x + 45x +
      attrs <- attributes(x)
    222 - 45x + 45x +
      attributes(x) <- NULL
    223 - 45x + 45x +
      slices_list <- list(slices = x, attributes = attrs)
    224 - 45x + 45x +
      slices_list <- Filter(Negate(is.null), slices_list) # drop attributes if empty
    @@ -57762,7 +59831,8 @@

    teal.slice coverage - 66.10%

    226 - 20x + 20x +
      if (!show_all) slices_list$slices <- lapply(slices_list$slices, function(slice) Filter(Negate(is.null), slice))
    @@ -57776,7 +59846,8 @@

    teal.slice coverage - 66.10%

    228 - 45x + 45x +
      jsonify(slices_list, trim_lines)
    @@ -57832,7 +59903,8 @@

    teal.slice coverage - 66.10%

    236 - 2x + 2x +
      cat(format(x, ...), "\n")
    @@ -57916,21 +59988,24 @@

    teal.slice coverage - 66.10%

    248 - 14x + 14x +
      Filter(
    249 - 14x + 14x +
        function(xx) {
    250 - 12x + 12x +
          !any(vapply(y, function(yy) identical(yy, xx), logical(1)))
    @@ -57944,7 +60019,8 @@

    teal.slice coverage - 66.10%

    252 - 14x + 14x +
        x
    @@ -58091,28 +60167,32 @@

    teal.slice coverage - 66.10%

    273 - 1569x + 1569x +
      checkmate::assert_list(x)
    274 - 1568x + 1568x +
      xnn <- Filter(Negate(is.null), x)
    275 - 1568x + 1568x +
      if (all(vapply(xnn, is.atomic, logical(1L)))) {
    276 - 1059x + 1059x +
        return(xnn[[1L]])
    @@ -58126,21 +60206,24 @@

    teal.slice coverage - 66.10%

    278 - 509x + 509x +
      lapply(x, checkmate::assert_list, names = "named", null.ok = TRUE, .var.name = "list element")
    279 - 508x + 508x +
      all_names <- unique(unlist(lapply(x, names)))
    280 - 508x + 508x +
      sapply(all_names, function(nm) coalesce_r(lapply(x, `[[`, nm)), simplify = FALSE)
    @@ -58440,7 +60523,8 @@

    teal.slice coverage - 66.10%

    41 - 24x + 24x +
          super$initialize(dataset = dataset, dataname = dataname, label = label)
    @@ -58524,35 +60608,40 @@

    teal.slice coverage - 66.10%

    53 - 4x + 4x +
          class_string <- toString(class(private$dataset))
    54 - 4x + 4x +
          if (trim_lines) {
    55 - 2x + 2x +
            trim_position <- 37L
    56 - 2x + 2x +
            class_string <- strtrim(class_string, trim_position)
    57 - 2x + 2x +
            substr(class_string, 35L, 37L) <- "..."
    @@ -58566,7 +60655,8 @@

    teal.slice coverage - 66.10%

    59 - 4x + 4x +
          sprintf(" - unfiltered dataset:\t\"%s\":   %s", private$dataname, class_string)
    @@ -58608,7 +60698,8 @@

    teal.slice coverage - 66.10%

    65 - 1x + 1x +
          invisible(NULL)
    @@ -58636,7 +60727,8 @@

    teal.slice coverage - 66.10%

    69 - 2x + 2x +
          invisible(NULL)
    @@ -58671,14 +60763,16 @@

    teal.slice coverage - 66.10%

    74 - 3x + 3x +
          if (length(state) != 0L) {
    75 - 1x + 1x +
            warning("DefaultFilterState cannot set state")
    @@ -58692,7 +60786,8 @@

    teal.slice coverage - 66.10%

    77 - 3x + 3x +
          invisible(NULL)
    @@ -58727,7 +60822,8 @@

    teal.slice coverage - 66.10%

    82 - 1x + 1x +
          invisible(NULL)
    @@ -58783,7 +60879,8 @@

    teal.slice coverage - 66.10%

    90 - 1x + 1x +
          data.frame(dataname = private$dataname, obs = NA, obs_filtered = NA)
    @@ -59461,42 +61558,48 @@

    teal.slice coverage - 66.10%

    63 - 6x + 6x +
          isolate({
    64 - 6x + 6x +
            super$initialize(
    65 - 6x + 6x +
              x = x,
    66 - 6x + 6x +
              x_reactive = x_reactive,
    67 - 6x + 6x +
              slice = slice,
    68 - 6x + 6x +
              extract_type = extract_type
    @@ -59510,14 +61613,16 @@

    teal.slice coverage - 66.10%

    70 - 6x + 6x +
            private$set_choices(slice$choices)
    71 - 6x + 6x +
            private$set_selected(slice$selected)
    @@ -59538,7 +61643,8 @@

    teal.slice coverage - 66.10%

    74 - 6x + 6x +
          invisible(self)
    @@ -59608,14 +61714,16 @@

    teal.slice coverage - 66.10%

    84 - 2x + 2x +
          if (isFALSE(private$is_any_filtered())) {
    85 - 1x + 1x +
            return(NULL)
    @@ -59629,14 +61737,16 @@

    teal.slice coverage - 66.10%

    87 - 1x + 1x +
          if (missing(dataname)) dataname <- private$get_dataname()
    88 - 1x + 1x +
          filter_call <- if (isTRUE(private$get_keep_na())) {
    @@ -59657,7 +61767,8 @@

    teal.slice coverage - 66.10%

    91 - 1x + 1x +
            substitute(!is.na(varname), list(varname = private$get_varname_prefixed(dataname)))
    @@ -59769,14 +61880,16 @@

    teal.slice coverage - 66.10%

    107 - 6x + 6x +
          private$teal_slice$choices <- choices
    108 - 6x + 6x +
          invisible(NULL)
    @@ -59832,7 +61945,8 @@

    teal.slice coverage - 66.10%

    116 - 2x + 2x +
          if (private$is_choice_limited) {
    @@ -59853,7 +61967,8 @@

    teal.slice coverage - 66.10%

    119 - 2x + 2x +
            !isTRUE(private$get_keep_na())
    @@ -60356,21 +62471,24 @@

    teal.slice coverage - 66.10%

    18 - 7x + 7x +
      checkmate::assert_list(x, any.missing = FALSE, names = "unique")
    19 - 6x + 6x +
      checkmate::assert_class(join_keys, "join_keys")
    20 - 5x + 5x +
      if (!missing(code)) {
    @@ -60412,7 +62530,8 @@

    teal.slice coverage - 66.10%

    26 - 5x + 5x +
      if (!missing(check)) {
    @@ -60454,7 +62573,8 @@

    teal.slice coverage - 66.10%

    32 - 5x + 5x +
      FilteredData$new(x, join_keys = join_keys)
    @@ -60552,42 +62672,48 @@

    teal.slice coverage - 66.10%

    46 - 32x + 32x +
      lapply(
    47 - 32x + 32x +
        expr,
    48 - 32x + 32x +
        function(x) {
    49 - 19x + 19x +
          tryCatch(
    50 - 19x + 19x +
            eval(x, envir = env),
    51 - 19x + 19x +
            error = function(e) {
    @@ -60664,7 +62790,8 @@

    teal.slice coverage - 66.10%

    62 - 32x + 32x +
      invisible(NULL)
    @@ -61224,21 +63351,24 @@

    teal.slice coverage - 66.10%

    142 - 3x + 3x +
      checkmate::assert_string(input_id)
    143 - 3x + 3x +
      checkmate::assert_character(icons, len = 2L)
    144 - 3x + 3x +
      checkmate::assert_flag(one_way)
    @@ -61252,35 +63382,40 @@

    teal.slice coverage - 66.10%

    146 - 3x + 3x +
      expr <-
    147 - 3x + 3x +
        if (one_way) {
    148 - 3x + 3x +
          sprintf(
    149 - 3x + 3x +
            "$('#%s i').removeClass('%s').addClass('%s');",
    150 - 3x + 3x +
            input_id, icons[1], icons[2]
    @@ -61322,7 +63457,8 @@

    teal.slice coverage - 66.10%

    156 - 3x + 3x +
      shinyjs::runjs(expr)
    @@ -61336,7 +63472,8 @@

    teal.slice coverage - 66.10%

    158 - 3x + 3x +
      invisible(NULL)
    @@ -61378,21 +63515,24 @@

    teal.slice coverage - 66.10%

    164 - 3x + 3x +
      checkmate::assert_string(input_id)
    165 - 3x + 3x +
      checkmate::assert_character(titles, len = 2L)
    166 - 3x + 3x +
      checkmate::assert_flag(one_way)
    @@ -61406,35 +63546,40 @@

    teal.slice coverage - 66.10%

    168 - 3x + 3x +
      expr <-
    169 - 3x + 3x +
        if (one_way) {
    170 - 3x + 3x +
          sprintf(
    171 - 3x + 3x +
            "$('a#%s').attr('title', '%s');",
    172 - 3x + 3x +
            input_id, titles[2]
    @@ -61539,7 +63684,8 @@

    teal.slice coverage - 66.10%

    187 - 3x + 3x +
      shinyjs::runjs(expr)
    @@ -61553,7 +63699,8 @@

    teal.slice coverage - 66.10%

    189 - 3x + 3x +
      invisible(NULL)
    @@ -61644,7 +63791,8 @@

    teal.slice coverage - 66.10%

    202 - 66x + 66x +
      utils::getFromNamespace("topological_sort", ns = "teal.data")(graph)
    @@ -62049,14 +64197,16 @@

    teal.slice coverage - 66.10%

    56 - 8x + 8x +
          checkmate::assert_class(datasets, "FilteredData")
    57 - 6x + 6x +
          private$filtered_data <- datasets
    @@ -62140,7 +64290,8 @@

    teal.slice coverage - 66.10%

    69 - 8x + 8x +
          private$filtered_data$get_filter_state()
    @@ -62210,14 +64361,16 @@

    teal.slice coverage - 66.10%

    79 - 5x + 5x +
          private$filtered_data$set_filter_state(filter)
    80 - 5x + 5x +
          invisible(NULL)
    @@ -62308,14 +64461,16 @@

    teal.slice coverage - 66.10%

    93 - 1x + 1x +
          private$filtered_data$remove_filter_state(filter)
    94 - 1x + 1x +
          invisible(NULL)
    @@ -62406,21 +64561,24 @@

    teal.slice coverage - 66.10%

    107 - 2x + 2x +
          datanames_to_remove <- if (missing(datanames)) private$filtered_data$datanames() else datanames
    108 - 2x + 2x +
          private$filtered_data$clear_filter_states(datanames = datanames_to_remove)
    109 - 2x + 2x +
          invisible(NULL)
    @@ -62923,7 +65081,8 @@

    teal.slice coverage - 66.10%

    64 - 229x + 229x +
      UseMethod("init_filter_states")
    @@ -63000,42 +65159,48 @@

    teal.slice coverage - 66.10%

    75 - 100x + 100x +
      DFFilterStates$new(
    76 - 100x + 100x +
        data = data,
    77 - 100x + 100x +
        data_reactive = data_reactive,
    78 - 100x + 100x +
        dataname = dataname,
    79 - 100x + 100x +
        datalabel = datalabel,
    80 - 100x + 100x +
        keys = keys
    @@ -63112,35 +65277,40 @@

    teal.slice coverage - 66.10%

    91 - 22x + 22x +
      MatrixFilterStates$new(
    92 - 22x + 22x +
        data = data,
    93 - 22x + 22x +
        data_reactive = data_reactive,
    94 - 22x + 22x +
        dataname = dataname,
    95 - 22x + 22x +
        datalabel = datalabel
    @@ -63224,7 +65394,8 @@

    teal.slice coverage - 66.10%

    107 - 22x + 22x +
      if (!requireNamespace("MultiAssayExperiment", quietly = TRUE)) {
    @@ -63245,42 +65416,48 @@

    teal.slice coverage - 66.10%

    110 - 22x + 22x +
      MAEFilterStates$new(
    111 - 22x + 22x +
        data = data,
    112 - 22x + 22x +
        data_reactive = data_reactive,
    113 - 22x + 22x +
        dataname = dataname,
    114 - 22x + 22x +
        datalabel = datalabel,
    115 - 22x + 22x +
        keys = keys
    @@ -63357,7 +65534,8 @@

    teal.slice coverage - 66.10%

    126 - 85x + 85x +
      if (!requireNamespace("SummarizedExperiment", quietly = TRUE)) {
    @@ -63378,35 +65556,40 @@

    teal.slice coverage - 66.10%

    129 - 85x + 85x +
      SEFilterStates$new(
    130 - 85x + 85x +
        data = data,
    131 - 85x + 85x +
        data_reactive = data_reactive,
    132 - 85x + 85x +
        dataname = dataname,
    133 - 85x + 85x +
        datalabel = datalabel
    @@ -63588,7 +65771,8 @@

    teal.slice coverage - 66.10%

    159 - 227x + 227x +
      UseMethod("get_supported_filter_varnames")
    @@ -63630,28 +65814,32 @@

    teal.slice coverage - 66.10%

    165 - 198x + 198x +
      is_expected_class <- vapply(
    166 - 198x + 198x +
        X = data,
    167 - 198x + 198x +
        FUN = function(x) any(class(x) %in% .filterable_class),
    168 - 198x + 198x +
        FUN.VALUE = logical(1)
    @@ -63665,7 +65853,8 @@

    teal.slice coverage - 66.10%

    170 - 198x + 198x +
      names(is_expected_class[is_expected_class])
    @@ -63714,21 +65903,24 @@

    teal.slice coverage - 66.10%

    177 - 29x + 29x +
      is_expected_class <- class(data[, 1]) %in% .filterable_class
    178 - 29x + 29x +
      if (is_expected_class && !is.null(colnames(data))) {
    179 - 26x + 26x +
        colnames(data)
    @@ -63742,7 +65934,8 @@

    teal.slice coverage - 66.10%

    181 - 3x + 3x +
        character(0)
    @@ -63980,7 +66173,8 @@

    teal.slice coverage - 66.10%

    215 - 9x + 9x +
      if (length(choices) == 0) {
    @@ -64001,14 +66195,16 @@

    teal.slice coverage - 66.10%

    218 - 9x + 9x +
      choice_types <- variable_types(data = data, columns = choices)
    219 - 9x + 9x +
      choice_types[keys] <- "primary_key"
    @@ -64022,28 +66218,32 @@

    teal.slice coverage - 66.10%

    221 - 9x + 9x +
      choices_labeled(
    222 - 9x + 9x +
        choices = choices,
    223 - 9x + 9x +
        labels = unname(varlabels[choices]),
    224 - 9x + 9x +
        types = choice_types[choices]
    @@ -64092,49 +66292,56 @@

    teal.slice coverage - 66.10%

    231 - 9x + 9x +
      if (!is.array(data)) {
    232 - 9x + 9x +
        vapply(
    233 - 9x + 9x +
          colnames(data),
    234 - 9x + 9x +
          FUN = function(x) {
    235 - 42x + 42x +
            label <- attr(data[[x]], "label")
    236 - 42x + 42x +
            if (is.null(label)) {
    237 - 40x + 40x +
              x
    @@ -64148,7 +66355,8 @@

    teal.slice coverage - 66.10%

    239 - 2x + 2x +
              label
    @@ -64169,7 +66377,8 @@

    teal.slice coverage - 66.10%

    242 - 9x + 9x +
          FUN.VALUE = character(1)
    @@ -64742,21 +66951,24 @@

    teal.slice coverage - 66.10%

    76 - 15x + 15x +
          checkmate::assert_class(slice, "teal_slice_expr")
    77 - 14x + 14x +
          private$teal_slice <- slice
    78 - 14x + 14x +
          invisible(self)
    @@ -64840,28 +67052,32 @@

    teal.slice coverage - 66.10%

    90 - 12x + 12x +
          sprintf(
    91 - 12x + 12x +
            "%s:\n%s",
    92 - 12x + 12x +
            class(self)[1],
    93 - 12x + 12x +
            format(self$get_state(), show_all = show_all, trim_lines = trim_lines)
    @@ -64931,7 +67147,8 @@

    teal.slice coverage - 66.10%

    103 - 1x + 1x +
          cat(isolate(self$format(...)))
    @@ -64994,7 +67211,8 @@

    teal.slice coverage - 66.10%

    112 - 26x + 26x +
          private$teal_slice
    @@ -65071,14 +67289,16 @@

    teal.slice coverage - 66.10%

    123 - 1x + 1x +
          checkmate::assert_class(state, "teal_slice_expr")
    124 - 1x + 1x +
          invisible(self)
    @@ -65190,7 +67410,8 @@

    teal.slice coverage - 66.10%

    140 - 2x + 2x +
          isolate(str2lang(private$teal_slice$expr))
    @@ -67806,35 +70027,40 @@

    teal.slice coverage - 66.10%

    187 - 103x + 103x +
          checkmate::assert_function(data_reactive, args = "sid")
    188 - 103x + 103x +
          checkmate::assert_data_frame(data)
    189 - 103x + 103x +
          super$initialize(data, data_reactive, dataname, datalabel)
    190 - 103x + 103x +
          private$keys <- keys
    191 - 103x + 103x +
          private$set_filterable_varnames(include_varnames = colnames(private$data))
    @@ -68169,21 +70395,24 @@

    teal.slice coverage - 66.10%

    39 - 9x + 9x +
      checkmate::assert_multi_class(data, c("data.frame", "DataFrame", "matrix"))
    40 - 9x + 9x +
      checkmate::assert_character(columns, any.missing = FALSE, null.ok = TRUE)
    41 - 9x + 9x +
      checkmate::assert_subset(columns, colnames(data))
    @@ -68197,7 +70426,8 @@

    teal.slice coverage - 66.10%

    43 - 9x + 9x +
      if (is.matrix(data)) {
    @@ -68267,14 +70497,16 @@

    teal.slice coverage - 66.10%

    53 - 9x + 9x +
        types <- vapply(data, function(x) class(x)[1L], character(1L))
    54 - 9x + 9x +
        if (!is.null(columns)) types <- types[columns]
    @@ -68295,7 +70527,8 @@

    teal.slice coverage - 66.10%

    57 - 9x + 9x +
      types
    @@ -68931,7 +71164,8 @@

    teal.slice coverage - 66.10%

    89 - 107x + 107x +
      UseMethod("init_filtered_dataset")
    @@ -69015,56 +71249,64 @@

    teal.slice coverage - 66.10%

    101 - 83x + 83x +
      DataframeFilteredDataset$new(
    102 - 83x + 83x +
        dataset = dataset,
    103 - 83x + 83x +
        dataname = dataname,
    104 - 83x + 83x +
        keys = keys,
    105 - 83x + 83x +
        parent_name = parent_name,
    106 - 83x + 83x +
        parent = parent,
    107 - 83x + 83x +
        join_keys = join_keys,
    108 - 83x + 83x +
        label = label
    @@ -69155,7 +71397,8 @@

    teal.slice coverage - 66.10%

    121 - 7x + 7x +
      if (!requireNamespace("MultiAssayExperiment", quietly = TRUE)) {
    @@ -69176,35 +71419,40 @@

    teal.slice coverage - 66.10%

    124 - 7x + 7x +
      MAEFilteredDataset$new(
    125 - 7x + 7x +
        dataset = dataset,
    126 - 7x + 7x +
        dataname = dataname,
    127 - 7x + 7x +
        keys = keys,
    128 - 7x + 7x +
        label = label
    @@ -69295,28 +71543,32 @@

    teal.slice coverage - 66.10%

    141 - 17x + 17x +
      DefaultFilteredDataset$new(
    142 - 17x + 17x +
        dataset = dataset,
    143 - 17x + 17x +
        dataname = dataname,
    144 - 17x + 17x +
        label = label
    @@ -69546,21 +71798,24 @@

    teal.slice coverage - 66.10%

    30 - 47x + 47x +
      checkmate::assert_list(calls)
    31 - 45x + 45x +
      if (length(calls) > 0L) checkmate::assert_list(calls, types = c("call", "name"))
    32 - 46x + 46x +
      checkmate::assert_string(operator)
    @@ -69574,21 +71829,24 @@

    teal.slice coverage - 66.10%

    34 - 44x + 44x +
      Reduce(
    35 - 44x + 44x +
        x = calls,
    36 - 44x + 44x +
        f = function(x, y) call(operator, x, y)
    @@ -69782,14 +72040,16 @@

    teal.slice coverage - 66.10%

    7 - 9x + 9x +
      isolate(
    8 - 9x + 9x +
        all(vapply(fields, function(x) identical(ts1[[x]], ts2[[x]]), logical(1L)))
    @@ -69852,35 +72112,40 @@

    teal.slice coverage - 66.10%

    17 - 34x + 34x +
      isolate({
    18 - 34x + 34x +
        testthat::expect_true(
    19 - 34x + 34x +
          setequal(
    20 - 34x + 34x +
            reactiveValuesToList(x),
    21 - 34x + 34x +
            reactiveValuesToList(y)
    @@ -69950,28 +72215,32 @@

    teal.slice coverage - 66.10%

    31 - 12x + 12x +
      isolate({
    32 - 12x + 12x +
        mapply(
    33 - 12x + 12x +
          function(x, y) {
    34 - 27x + 27x +
            expect_identical_slice(x, y)
    @@ -69985,14 +72254,16 @@

    teal.slice coverage - 66.10%

    36 - 12x + 12x +
          x = x,
    37 - 12x + 12x +
          y = y
    @@ -70006,7 +72277,8 @@

    teal.slice coverage - 66.10%

    39 - 12x + 12x +
        testthat::expect_identical(attributes(x), attributes(y))
    diff --git a/v0.5.0-rc1/index.html b/v0.5.0-rc1/index.html index b036e53d1..44b2d66b9 100644 --- a/v0.5.0-rc1/index.html +++ b/v0.5.0-rc1/index.html @@ -1,5 +1,4 @@ - - + @@ -58,22 +57,7 @@ - - + - + + diff --git a/v0.5.0-rc1/news/index.html b/v0.5.0-rc1/news/index.html index cedafcbd0..6a037523f 100644 --- a/v0.5.0-rc1/news/index.html +++ b/v0.5.0-rc1/news/index.html @@ -1,8 +1,22 @@ - -Changelog • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -78,31 +98,44 @@
    -

    teal.slice 0.5.0

    +

    teal.slice 0.5.0 +

    -

    Enhancements

    -
    • Simplified init_filtered_data to accept a named list of datasets. init_filtered_data does not currently handle a list containing dataset, metadata, datalabel and code.
    • -
    +

    Enhancements +

    +
      +
    • Simplified init_filtered_data to accept a named list of datasets. init_filtered_data does not currently handle a list containing dataset, metadata, datalabel and code.
    • +
    +
    -

    Breaking changes

    -
    • +

      Breaking changes +

      +
        +
      • TealData object is no longer supported by teal.slice.
      • set_filter_state no longer accepts a nested list. Use teal_slices() and teal_slice() instead.
      • Renamed FilteredDataset subclass that handles data.frames from DefaultFilteredDataset to DataframeFilteredDataset. Added new class DefaultFilteredDataset that will store any type of object. Filtering will is not supported.
      • -
    + +
    -

    Miscellaneous

    -
    • Specified minimal version of package dependencies.
    • +

      Miscellaneous +

      +
        +
      • Specified minimal version of package dependencies.
      • Removed storing and restoring of teal_slices objects.
      • Update documentation and code to reflect the changes due to the refactor of teal.data::JoinKeys into teal.data::join_keys.
      • -
    + +
    -

    teal.slice 0.4.0

    +

    teal.slice 0.4.0 +

    -

    New features

    -
    + +
    -

    Breaking changes

    -
    • Setting filters using a list is now deprecated. Use teal_slices and teal_slice instead.
    • +

      Breaking changes +

      +
        +
      • Setting filters using a list is now deprecated. Use teal_slices and teal_slice instead.
      • Removed CDISCFilteredData and CDISCFilteredDataset and implementing JoinKeys handling in their parent classes (FilteredData and DefaultFilteredDataset).
      • Specifying set of filterable columns is done through include_varnames and exclude_varnames in teal_slices. Specifying attr(, "filterable") is hard deprecated.
      • Removed private fields $code and $check from FilteredData class and made appropriate changes to constructor and init_filtered_data.
      • -
    + +
    -

    teal.slice 0.3.0

    -
    • Examples now use scda.2022 instead of scda.2021.
    • +

      teal.slice 0.3.0 +

      +
        +
      • Examples now use scda.2022 instead of scda.2021.
      • Transferred data hashing step in FilteredDataset to teal.
      • Removed constructor of Queue class.
      • -
      -

      New features

      -
      • Added a global turn on/off button for the Filter Panel.
      • +
      +
      +

      New features +

      +
        +
      • Added a global turn on/off button for the Filter Panel.
      • Added ability to collapse Active Filter Display panel.
      • Added ability to collapse all filters of an individual dataset.
      • Added fixed filter states.
      • -
      +
    +
    -

    Enhancements

    -
    • Improved filter state presentation in FilterState$format.
    • -
    +

    Enhancements +

    +
      +
    • Improved filter state presentation in FilterState$format.
    • +
    +
    -

    Bug fixes

    -
    • Fixed an error where the RangeFilterState produced an error when using bootstrap 4.
    • +

      Bug fixes +

      +
        +
      • Fixed an error where the RangeFilterState produced an error when using bootstrap 4.
      • Fixed a bug that caused the range slider to omit values selected by the filter API.
      • Fixed a bug where setting incorrect values for Date and Date time ranges caused the app to crash.
      • -
    + +
    -

    Miscellaneous

    -
    • Calculation of step in slider for RangeFilterState now uses checkmate::test_integerish instead of is.integer.
    • +

      Miscellaneous +

      +
        +
      • Calculation of step in slider for RangeFilterState now uses checkmate::test_integerish instead of is.integer.
      • Updated init_filtered_data to take into account the removal of CDISCTealData from teal.data package.
      • Added shinyvalidate validation for Date and Date time ranges.
      • Added examples apps for FilterState child classes and DFFilterStates.
      • -
    + +
    -

    teal.slice 0.2.0

    +

    teal.slice 0.2.0 +

    -

    New features

    -
    + +
    -

    Enhancements

    -
    • Redesigned the count bars for filter panel check box inputs.
    • +

      Enhancements +

      +
        +
      • Redesigned the count bars for filter panel check box inputs.
      • Redesigned the filter panel input for dates to use CSS flexbox.
      • Update icons to be compatible with Font Awesome 6.
      • Updates the FilteredData method get_formatted_filter_state so it no longer appends empty filters.
      • Added clearer installation instructions to README.
      • -
    + +
    -

    Breaking changes

    -
    • Renamed internal S3 method get_filterable_varnames to get_supported_filter_varnames.
    • -
    +

    Breaking changes +

    +
      +
    • Renamed internal S3 method get_filterable_varnames to get_supported_filter_varnames.
    • +
    +
    -

    Bug fixes

    -
    • Fixed a bug when the filter panel overview would not refresh if the panel was hidden during a transition between active modules.
    • +

      Bug fixes +

      +
        +
      • Fixed a bug when the filter panel overview would not refresh if the panel was hidden during a transition between active modules.
      • Fixed a bug in FilterState where sliderInput step values were too precise.
      • -
    + +
    -

    teal.slice 0.1.1

    +

    teal.slice 0.1.1 +

    -

    New features

    -
    • Added a formatting function for filter panel classes.
    • -
    +

    New features +

    +
      +
    • Added a formatting function for filter panel classes.
    • +
    +
    -

    Miscellaneous

    -
    • Added a template to the pkgdown site.
    • +

      Miscellaneous +

      +
        +
      • Added a template to the pkgdown site.
      • Updated package authors.
      • Added package vignettes.
      • -
    + +
    -

    Fix

    -
    • Fixed a bug in FilteredDataset, where launching a shiny application without FilteredData would not attach the appropriate CSS files.
    • -
    +

    Fix +

    +
      +
    • Fixed a bug in FilteredDataset, where launching a shiny application without FilteredData would not attach the appropriate CSS files.
    • +
    +
    -

    teal.slice 0.1.0

    -
    • Initial release of teal.slice - a package providing a filter module for teal applications.
    • -
    -

    Changes (from behavior when functionality was part of teal)

    +

    teal.slice 0.1.0 +

    +
      +
    • Initial release of teal.slice - a package providing a filter module for teal applications.
    • +
    +
    +

    Changes (from behavior when functionality was part of teal) +

    -

    Breaking changes

    -
    • +

      Breaking changes +

      +
        +
      • default_filter has been deprecated - use list() instead for a default filter.
      • -
    + +
    -

    Bug fixes

    -
    • Add counts to filtering categorical variables bar charts in the filtering panel in cases where they were missing.
    • +

      Bug fixes +

      +
        +
      • Add counts to filtering categorical variables bar charts in the filtering panel in cases where they were missing.
      • Fixed a bug causing an error when both sliders of RangeFilterState where put to either end of the allowed range in the UI.
      • -
    + +
    -

    Miscellaneous

    -
    • Added is_any_filtered method to all FilterState classes to detect if selected values actually filters out any data. This is used to decide if an explicit filter statement is added to the call.
    • +

      Miscellaneous +

      +
        +
      • Added is_any_filtered method to all FilterState classes to detect if selected values actually filters out any data. This is used to decide if an explicit filter statement is added to the call.
      • The filter panel now displays a helpful message when data has no rows or columns in place of an empty drop down widget.
      • FilteredData now stores whether its datasets had a reproducibility check or not via two new methods to its class: set_check and get_check.
      • -
    + +
    + + + + - - + + diff --git a/v0.5.0-rc1/pull_request_template.html b/v0.5.0-rc1/pull_request_template.html index 612f628db..cce22b640 100644 --- a/v0.5.0-rc1/pull_request_template.html +++ b/v0.5.0-rc1/pull_request_template.html @@ -1,8 +1,22 @@ - -Pull Request • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -83,17 +103,19 @@

    Fixes #nnn

    - + + + + - - + + diff --git a/v0.5.0-rc1/reference/ChoicesFilterState.html b/v0.5.0-rc1/reference/ChoicesFilterState.html index 26e179491..fa3f0e6dd 100644 --- a/v0.5.0-rc1/reference/ChoicesFilterState.html +++ b/v0.5.0-rc1/reference/ChoicesFilterState.html @@ -1,8 +1,24 @@ - -FilterState object for categorical data — ChoicesFilterState • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,40 +107,60 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterState -> ChoicesFilterState

    +

    Inherited methods


    -

    Method new()

    -

    Initialize a FilterState object.

    -

    Usage

    -

    ChoicesFilterState$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterState object.

    +
    +

    Usage +

    +

    +
    +
    ChoicesFilterState$new(
       x,
       x_reactive = reactive(NULL),
       slice,
       extract_type = character(0)
    -)

    +)
    +

    +
    -

    Returns

    +

    Returns +

    Object of class ChoicesFilterState, invisibly.

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection. For this class returned call looks like -<varname> %in% c(<values selected>) with optional is.na(<varname>).

    -

    Usage

    -

    ChoicesFilterState$get_call(dataname)

    +<varname> %in% c(<values selected>) with optional is.na(<varname>).

    +
    +

    Usage +

    +

    +
    +
    ChoicesFilterState$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of data set; defaults to private$get_dataname()

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    call or NULL

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    ChoicesFilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    ChoicesFilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -197,7 +280,8 @@

    Arguments -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     include_css_files <- getFromNamespace("include_css_files", "teal.slice")
     include_js_files <- getFromNamespace("include_js_files", "teal.slice")
    @@ -313,17 +397,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.5.0-rc1/reference/DFFilterStates.html b/v0.5.0-rc1/reference/DFFilterStates.html index 2c5395320..14f3fee0a 100644 --- a/v0.5.0-rc1/reference/DFFilterStates.html +++ b/v0.5.0-rc1/reference/DFFilterStates.html @@ -1,8 +1,24 @@ - -FilterStates subclass for data frames — DFFilterStates • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,18 +107,25 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterStates -> DFFilterStates

    -

    Methods

    +

    Methods +

    -

    Public methods

    +

    Public methods +

    -

    Inherited methods +
    +

    Inherited methods


    -

    Method new()

    +

    +
    +
    +

    Method new() +

    Initializes DFFilterStates object by setting dataname and initializing state_list (shiny::reactiveVal). This class contains a single state_list with no specified name, which means that when calling the subset function associated with this class -(dplyr::filter), a list of conditions is passed to unnamed arguments (...).

    -

    Usage

    -

    DFFilterStates$new(
    +(dplyr::filter), a list of conditions is passed to unnamed arguments (...).

    +
    +

    Usage +

    +

    +
    +
    DFFilterStates$new(
       data,
       data_reactive = function(sid = "") NULL,
       dataname,
       datalabel = NULL,
       keys = character(0)
    -)

    +)
    +

    +
    -

    Arguments

    -

    data
    +

    Arguments +

    +

    +
    +
    +
    data

    (data.frame) the R object which dplyr::filter function will be applied on.

    @@ -154,23 +197,41 @@

    Arguments
    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    DFFilterStates$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    DFFilterStates$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -178,7 +239,8 @@

    Arguments -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     include_css_files <- getFromNamespace("include_css_files", "teal.slice")
     include_js_files <- getFromNamespace("include_js_files", "teal.slice")
    @@ -323,17 +385,19 @@ 

    Examples

    + +

    + +
    - - + + diff --git a/v0.5.0-rc1/reference/DataframeFilteredDataset.html b/v0.5.0-rc1/reference/DataframeFilteredDataset.html index 575d73497..0ad57d696 100644 --- a/v0.5.0-rc1/reference/DataframeFilteredDataset.html +++ b/v0.5.0-rc1/reference/DataframeFilteredDataset.html @@ -1,10 +1,26 @@ - -The DataframeFilteredDataset R6 class — DataframeFilteredDataset • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + +
    @@ -87,23 +109,30 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilteredDataset -> DataframeFilteredDataset

    +

    Inherited methods


    -

    Method new()

    -

    Initializes this DataframeFilteredDataset object.

    -

    Usage

    -

    DataframeFilteredDataset$new(
    +

    +
    +
    +

    Method new() +

    +

    Initializes this DataframeFilteredDataset object.

    +
    +

    Usage +

    +

    +
    +
    DataframeFilteredDataset$new(
       dataset,
       dataname,
       keys = character(0),
    @@ -127,12 +163,18 @@ 

    Usage

    parent = NULL, join_keys = character(0), label = character(0) -)

    +)
    +

    +
    -

    Arguments

    -

    dataset
    +

    Arguments +

    +

    +
    +
    +
    dataset

    (data.frame) single data.frame for which filters are rendered.

    @@ -170,129 +212,227 @@

    Arguments -

    Returns

    +

    Returns +

    Object of class DataframeFilteredDataset, invisibly.

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Gets the subset expression.

    This function returns subset expressions equivalent to selected items within each of filter_states. Configuration of the expressions is constant and depends on filter_states type and order which are set during initialization. This class contains single FilterStates which contains single state_list -and all FilterState objects apply to one argument (...) in a dplyr::filter call.

    -

    Usage

    -

    DataframeFilteredDataset$get_call(sid = "")

    +and all FilterState objects apply to one argument (...) in a dplyr::filter call.

    +
    +

    Usage +

    +

    +
    +
    DataframeFilteredDataset$get_call(sid = "")
    +

    +
    -

    Arguments

    -

    sid
    +

    Arguments +

    +

    +
    +
    +
    sid

    (character) when specified, the method returns code containing conditions calls of FilterState objects with sid different to that of this sid argument.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Either a list of length 1 containing a filter call, or NULL.

    -


    -

    Method set_filter_state()

    -

    Set filter state.

    -

    Usage

    -

    DataframeFilteredDataset$set_filter_state(state)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Set filter state.

    +
    +

    Usage +

    +

    +
    +
    DataframeFilteredDataset$set_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method remove_filter_state()

    -

    Remove one or more FilterState form a FilteredDataset.

    -

    Usage

    -

    DataframeFilteredDataset$remove_filter_state(state)

    +
    +

    +
    +
    +

    Method remove_filter_state() +

    +

    Remove one or more FilterState form a FilteredDataset.

    +
    +

    Usage +

    +

    +
    +
    DataframeFilteredDataset$remove_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices) specifying FilterState objects to remove; teal_slices may contain only dataname and varname, other elements are ignored

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method ui_add()

    -

    UI module to add filter variable for this dataset.

    -

    Usage

    -

    DataframeFilteredDataset$ui_add(id)

    +
    +

    +
    +
    +

    Method ui_add() +

    +

    UI module to add filter variable for this dataset.

    +
    +

    Usage +

    +

    +
    +
    DataframeFilteredDataset$ui_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method get_filter_overview()

    -

    Creates row for filter overview in the form of
    dataname -- observations (remaining/total) - data.frame

    -

    Usage

    -

    DataframeFilteredDataset$get_filter_overview()

    +
    +

    +
    +
    +

    Method get_filter_overview() +

    +

    Creates row for filter overview in the form of
    dataname -- observations (remaining/total) - data.frame

    +
    +

    Usage +

    +

    +
    +
    DataframeFilteredDataset$get_filter_overview()
    +

    +
    -

    Returns

    +

    Returns +

    A data.frame.

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    DataframeFilteredDataset$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    DataframeFilteredDataset$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -300,7 +440,8 @@

    Arguments -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     DataframeFilteredDataset <- getFromNamespace("DataframeFilteredDataset", "teal.slice")
     
    @@ -394,17 +535,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.5.0-rc1/reference/DateFilterState.html b/v0.5.0-rc1/reference/DateFilterState.html index c26d9290f..9ffb52d52 100644 --- a/v0.5.0-rc1/reference/DateFilterState.html +++ b/v0.5.0-rc1/reference/DateFilterState.html @@ -1,8 +1,24 @@ - -FilterState object for Date data — DateFilterState • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,40 +107,60 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterState -> DateFilterState

    +

    Inherited methods


    -

    Method new()

    -

    Initialize a FilterState object.

    -

    Usage

    -

    DateFilterState$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterState object.

    +
    +

    Usage +

    +

    +
    +
    DateFilterState$new(
       x,
       x_reactive = reactive(NULL),
       slice,
       extract_type = character(0)
    -)

    +)
    +

    +
    -

    Returns

    +

    Returns +

    Object of class DateFilterState, invisibly.

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection. For this class returned call looks like -<varname> >= <min value> & <varname> <= <max value> with optional is.na(<varname>).

    -

    Usage

    -

    DateFilterState$get_call(dataname)

    +<varname> >= <min value> & <varname> <= <max value> with optional is.na(<varname>).

    +
    +

    Usage +

    +

    +
    +
    DateFilterState$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) containing possibly prefixed name of data set

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    call or NULL

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    DateFilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    DateFilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -197,7 +280,8 @@

    Arguments -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     include_css_files <- getFromNamespace("include_css_files", "teal.slice")
     include_js_files <- getFromNamespace("include_js_files", "teal.slice")
    @@ -299,17 +383,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.5.0-rc1/reference/DatetimeFilterState.html b/v0.5.0-rc1/reference/DatetimeFilterState.html index 7b5c48717..16aab0f27 100644 --- a/v0.5.0-rc1/reference/DatetimeFilterState.html +++ b/v0.5.0-rc1/reference/DatetimeFilterState.html @@ -1,8 +1,24 @@ - -FilterState object for date time data — DatetimeFilterState • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,44 +107,64 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterState -> DatetimeFilterState

    +

    Inherited methods


    -

    Method new()

    +

    +
    +
    +

    Method new() +

    Initialize a FilterState object. This class has an extra field, private$timezone, which is set to Sys.timezone() by default. However, in case when using this module in teal app, one needs timezone of the app user. App user timezone is taken from session$userData$timezone -and is set only if object is initialized in shiny.

    -

    Usage

    -

    DatetimeFilterState$new(
    +and is set only if object is initialized in shiny.

    +
    +

    Usage +

    +

    +
    +
    DatetimeFilterState$new(
       x,
       x_reactive = reactive(NULL),
       extract_type = character(0),
       slice
    -)

    +)
    +

    +
    -

    Arguments

    -

    x
    +

    Arguments +

    +

    +
    +
    +
    x

    (POSIXct or POSIXlt) variable to be filtered.

    @@ -135,11 +178,15 @@

    Arguments varname in the condition call will be returned as <dataname>$<varname>

  • "matrix" varname in the condition call will be returned as <dataname>[, <varname>]

  • - + +
    slice
    @@ -151,49 +198,85 @@

    Arguments -

    Returns

    +

    Returns +

    Object of class DatetimeFilterState, invisibly.

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection. For this class returned call looks like -<varname> >= as.POSIXct(<min>) & <varname> <= <max>) with optional is.na(<varname>).

    -

    Usage

    -

    DatetimeFilterState$get_call(dataname)

    +<varname> >= as.POSIXct(<min>) & <varname> <= <max>) with optional is.na(<varname>).

    +
    +

    Usage +

    +

    +
    +
    DatetimeFilterState$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    name of data set; defaults to private$get_dataname()

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    call

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    DatetimeFilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    DatetimeFilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -201,7 +284,8 @@

    Arguments -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     include_css_files <- getFromNamespace("include_css_files", "teal.slice")
     include_js_files <- getFromNamespace("include_js_files", "teal.slice")
    @@ -311,17 +395,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.5.0-rc1/reference/DefaultFilteredDataset.html b/v0.5.0-rc1/reference/DefaultFilteredDataset.html index e4f5fd0b9..a15094651 100644 --- a/v0.5.0-rc1/reference/DefaultFilteredDataset.html +++ b/v0.5.0-rc1/reference/DefaultFilteredDataset.html @@ -1,8 +1,24 @@ - -DefaultFilteredDataset R6 class — DefaultFilteredDataset • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,16 +107,20 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilteredDataset -> DefaultFilteredDataset

    +

    Inherited methods


    -

    Method new()

    -

    Initializes this DefaultFilteredDataset object.

    -

    Usage

    -

    DefaultFilteredDataset$new(dataset, dataname, label = character(0))

    +

    +
    +
    +

    Method new() +

    +

    Initializes this DefaultFilteredDataset object.

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$new(dataset, dataname, label = character(0))
    +

    +
    -

    Arguments

    -

    dataset
    +

    Arguments +

    +

    +
    +
    +
    dataset

    any type of object; will not be filtered.

    @@ -134,23 +177,40 @@

    Arguments -

    Returns

    +

    Returns +

    Object of class DefaultFilteredDataset, invisibly.

    -


    -

    Method format()

    -

    Returns a formatted string representing this DefaultFilteredDataset object.

    -

    Usage

    -

    DefaultFilteredDataset$format(show_all, trim_lines = FALSE)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns a formatted string representing this DefaultFilteredDataset object.

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$format(show_all, trim_lines = FALSE)
    +

    +
    -

    Arguments

    -

    show_all
    +

    Arguments +

    +

    +
    +
    +
    show_all

    (logical(1)) for method consistency, ignored.

    @@ -158,167 +218,291 @@

    Arguments -

    Returns

    +

    Returns +

    The formatted string.

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    -

    Usage

    -

    DefaultFilteredDataset$get_call(sid)

    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$get_call(sid)
    +

    +
    -

    Arguments

    -

    sid
    +

    Arguments +

    +

    +
    +
    +
    sid

    (character(1)) for method consistency, ignored.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    +

    +
    +
    +

    Method get_filter_state() +

    -

    Usage

    -

    DefaultFilteredDataset$get_filter_state()

    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$get_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    +

    +
    +
    +

    Method set_filter_state() +

    -

    Usage

    -

    DefaultFilteredDataset$set_filter_state(state)

    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$set_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices) for method consistency, ignored.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    +

    +
    +
    +

    Method clear_filter_states() +

    -

    Usage

    -

    DefaultFilteredDataset$clear_filter_states(force)

    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$clear_filter_states(force)
    +

    +
    -

    Arguments

    -

    force
    +

    Arguments +

    +

    +
    +
    +
    force

    (logical(1)) for method consistency, ignored.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method get_filter_overview()

    -

    Creates row for filter overview in the form of
    dataname - unsupported data class

    -

    Usage

    -

    DefaultFilteredDataset$get_filter_overview()

    +
    +

    +
    +
    +

    Method get_filter_overview() +

    +

    Creates row for filter overview in the form of
    dataname - unsupported data class

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$get_filter_overview()
    +

    +
    -

    Returns

    +

    Returns +

    A data.frame.

    -


    -

    Method ui_active()

    -

    Overwrites parent method.

    -

    Usage

    -

    DefaultFilteredDataset$ui_active(id)

    +
    +

    +
    +
    +

    Method ui_active() +

    +

    Overwrites parent method.

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$ui_active(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Details

    +

    Details +

    Blank UI module that would list active filter states for this dataset.

    -

    Returns

    +

    Returns +

    An empty div.

    -


    -

    Method ui_add()

    -

    Overwrites parent method.

    -

    Usage

    -

    DefaultFilteredDataset$ui_add(id)

    +
    +

    +
    +
    +

    Method ui_add() +

    +

    Overwrites parent method.

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$ui_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Details

    +

    Details +

    Blank UI module that would list active filter states for this dataset.

    -

    Returns

    +

    Returns +

    An empty div.

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    DefaultFilteredDataset$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -326,7 +510,8 @@

    Arguments -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     DefaultFilteredDataset <- getFromNamespace("DefaultFilteredDataset", "teal.slice")
     
    @@ -339,17 +524,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.5.0-rc1/reference/EmptyFilterState.html b/v0.5.0-rc1/reference/EmptyFilterState.html index dd99dc9ca..b4eb26636 100644 --- a/v0.5.0-rc1/reference/EmptyFilterState.html +++ b/v0.5.0-rc1/reference/EmptyFilterState.html @@ -1,8 +1,24 @@ - -FilterState object for empty variables — EmptyFilterState • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,40 +107,60 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterState -> EmptyFilterState

    +

    Inherited methods


    -

    Method new()

    -

    Initialize EmptyFilterState object.

    -

    Usage

    -

    EmptyFilterState$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize EmptyFilterState object.

    +
    +

    Usage +

    +

    +
    +
    EmptyFilterState$new(
       x,
       x_reactive = reactive(NULL),
       extract_type = character(0),
       slice
    -)

    +)
    +

    +
    -

    Arguments

    -

    x
    +

    Arguments +

    +

    + -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection relevant for selected variable type. -Uses internal reactive values, hence must be called in reactive or isolated context.

    -

    Usage

    -

    EmptyFilterState$get_call(dataname)

    +Uses internal reactive values, hence must be called in reactive or isolated context.

    +
    +

    Usage +

    +

    +
    +
    EmptyFilterState$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    name of data set; defaults to private$get_dataname()

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    logical(1)

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    EmptyFilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    EmptyFilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -196,7 +279,8 @@

    Arguments -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     include_js_files <- getFromNamespace("include_js_files", "teal.slice")
     EmptyFilterState <- getFromNamespace("EmptyFilterState", "teal.slice")
    @@ -217,17 +301,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.5.0-rc1/reference/FilterPanelAPI.html b/v0.5.0-rc1/reference/FilterPanelAPI.html index ab263605e..070bced9e 100644 --- a/v0.5.0-rc1/reference/FilterPanelAPI.html +++ b/v0.5.0-rc1/reference/FilterPanelAPI.html @@ -1,8 +1,24 @@ - -Class to encapsulate the API of the filter panel of a teal app — FilterPanelAPI • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,7 +106,8 @@
    -

    Details

    +

    Details +

    The purpose of this class is to encapsulate the API of the filter panel in a new class FilterPanelAPI so that it can be passed and used in the server call of any module instead of passing the whole FilteredData object.

    @@ -92,125 +115,223 @@

    Details

    -

    Methods

    +

    Methods +


    -

    Method new()

    -

    Initialize a FilterPanelAPI object.

    -

    Usage

    -

    FilterPanelAPI$new(datasets)

    + +
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterPanelAPI object.

    +
    +

    Usage +

    +

    +
    +
    FilterPanelAPI$new(datasets)
    +

    +
    -

    Arguments

    -

    datasets
    +

    Arguments +

    +

    +
    +
    +
    datasets

    (FilteredData)

    -

    +
    +

    +
    -


    +

    +
    +
    +

    Method get_filter_state() +

    Gets the reactive values from the active FilterState objects of the FilteredData object.

    Gets all active filters in the form of a nested list. -The output list is a compatible input to set_filter_state.

    -

    Usage

    -

    FilterPanelAPI$get_filter_state()

    +The output list is a compatible input to set_filter_state.

    +
    +

    Usage +

    +

    +
    +
    FilterPanelAPI$get_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    list with named elements corresponding to FilteredDataset objects with active filters.

    -


    -

    Method set_filter_state()

    -

    Sets active filter states.

    -

    Usage

    -

    FilterPanelAPI$set_filter_state(filter)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Sets active filter states.

    +
    +

    Usage +

    +

    +
    +
    FilterPanelAPI$set_filter_state(filter)
    +

    +
    -

    Arguments

    -

    filter
    +

    Arguments +

    +

    +
    +
    +
    filter

    (teal_slices)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method remove_filter_state()

    -

    Remove one or more FilterState of a FilteredDataset in the FilteredData object.

    -

    Usage

    -

    FilterPanelAPI$remove_filter_state(filter)

    +
    +

    +
    +
    +

    Method remove_filter_state() +

    +

    Remove one or more FilterState of a FilteredDataset in the FilteredData object.

    +
    +

    Usage +

    +

    +
    +
    FilterPanelAPI$remove_filter_state(filter)
    +

    +
    -

    Arguments

    -

    filter
    +

    Arguments +

    +

    +
    +
    +
    filter

    (teal_slices) specifying FilterState objects to remove; teal_slices may contain only dataname and varname, other elements are ignored

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method clear_filter_states()

    -

    Remove all FilterStates of the FilteredData object.

    -

    Usage

    -

    FilterPanelAPI$clear_filter_states(datanames)

    +
    +

    +
    +
    +

    Method clear_filter_states() +

    +

    Remove all FilterStates of the FilteredData object.

    +
    +

    Usage +

    +

    +
    +
    FilterPanelAPI$clear_filter_states(datanames)
    +

    +
    -

    Arguments

    -

    datanames
    +

    Arguments +

    +

    +
    +
    +
    datanames

    (character) datanames to remove their FilterStates; omit to remove all FilterStates in the FilteredData object

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    FilterPanelAPI$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    FilterPanelAPI$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -218,7 +339,8 @@

    Arguments -

    Examples

    +

    Examples +

    library(shiny)
     
     fd <- init_filtered_data(list(iris = iris))
    @@ -289,17 +411,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.5.0-rc1/reference/FilterState.html b/v0.5.0-rc1/reference/FilterState.html index b2b6e184b..6db915e98 100644 --- a/v0.5.0-rc1/reference/FilterState.html +++ b/v0.5.0-rc1/reference/FilterState.html @@ -1,8 +1,24 @@ - -FilterState abstract class — FilterState • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,12 +107,15 @@
    -

    Details

    +

    Details +

    This class is responsible for managing a single filter item within a FilteredData object and outputs a condition call (logical predicate) for subsetting one variable. Filter states depend on the variable type: (logical, integer, numeric, character, factor, Date, POSIXct, POSIXlt) -and FilterState subclasses exist that correspond to those types.

    +

    Each variable's filter state is an R6 object keeps the variable that is filtered, a teal_slice object that describes the filter state, as well as a shiny module (UI and server) that allows the user to alter the filter state. Changes to the filter state that cause some observations to be omitted trigger the get_call method and every R function call up in the reactive chain.

    -

    Modifying state

    +

    Modifying state +

    -

    Modifying a FilterState object is possible in three scenarios:

    • In an interactive session, by passing an appropriate teal_slice to the set_state method.

    • +

      Modifying a FilterState object is possible in three scenarios:

      +
        +
      • In an interactive session, by passing an appropriate teal_slice to the set_state method.

      • In a running application, by changing appropriate inputs.

      • In a running application, by using filter_state_api which directly uses set_state method of the FilterState object.

      • -
    + +
    -

    Methods

    +

    Methods +


    -

    Method new()

    -

    Initialize a FilterState object.

    -

    Usage

    -

    FilterState$new(
    +
    +
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterState object.

    +
    +

    Usage +

    +

    +
    +
    FilterState$new(
       x,
       x_reactive = reactive(NULL),
       slice,
       extract_type = character(0)
    -)

    +)
    +

    +
    -

    Returns

    +

    Returns +

    Object of class FilterState, invisibly.

    -


    -

    Method format()

    -

    Returns a formatted string representing this FilterState object.

    -

    Usage

    -

    FilterState$format(show_all = FALSE, trim_lines = TRUE)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns a formatted string representing this FilterState object.

    +
    +

    Usage +

    +

    +
    +
    FilterState$format(show_all = FALSE, trim_lines = TRUE)
    +

    +
    -

    Arguments

    -

    show_all
    +

    Arguments +

    +

    +
    +
    +
    show_all

    (logical(1)) passed to format.teal_slice

    @@ -197,106 +267,196 @@

    Arguments -

    Returns

    +

    Returns +

    character(1) the formatted string

    -


    -

    Method print()

    -

    Prints this FilterState object.

    -

    Usage

    -

    FilterState$print(...)

    +
    +

    +
    +
    +

    Method print() +

    +

    Prints this FilterState object.

    +
    +

    Usage +

    +

    +
    +
    FilterState$print(...)
    +

    +
    -

    Arguments

    -

    ...
    +

    Arguments +

    +

    +
    +
    +
    ...

    additional arguments

    -

    +
    +

    +
    -


    -

    Method set_state()

    -

    Sets mutable parameters of the filter state.

    • fixed state is prevented from changing state

    • +
    +

    +
    +
    +

    Method set_state() +

    +

    Sets mutable parameters of the filter state.

    +
      +
    • fixed state is prevented from changing state

    • anchored state is prevented from removing state

    • -
    -

    Usage

    -

    FilterState$set_state(state)

    + +
    +

    Usage +

    +

    +
    +
    FilterState$set_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slice)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    self invisibly

    -


    -

    Method get_state()

    -

    Returns a complete description of the filter state.

    -

    Usage

    -

    FilterState$get_state()

    +
    +

    +
    +
    +

    Method get_state() +

    +

    Returns a complete description of the filter state.

    +
    +

    Usage +

    +

    +
    +
    FilterState$get_state()
    +

    +
    -

    Returns

    +

    Returns +

    A teal_slice object.

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection relevant for selected variable type. Method is using internal reactive values which makes it reactive -and must be executed in reactive or isolated context.

    -

    Usage

    -

    FilterState$get_call()

    +and must be executed in reactive or isolated context.

    +
    +

    Usage +

    +

    +
    +
    FilterState$get_call()
    +

    +
    -


    -

    Method server()

    -

    shiny module server.

    -

    Usage

    -

    FilterState$server(id)

    +
    +

    +
    +
    +

    Method server() +

    +

    shiny module server.

    +
    +

    Usage +

    +

    +
    +
    FilterState$server(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Reactive expression signaling that remove button has been clicked.

    -


    -

    Method ui()

    +
    +

    +
    +
    +

    Method ui() +

    shiny UI module. -The UI for this class contains simple message stating that it is not supported.

    -

    Usage

    -

    FilterState$ui(id, parent_id = "cards")

    +The UI for this class contains simple message stating that it is not supported.

    +
    +

    Usage +

    +

    +
    +
    FilterState$ui(id, parent_id = "cards")
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    @@ -305,35 +465,64 @@

    Arguments
    -

    Method destroy_observers()

    -

    Destroy observers stored in private$observers.

    -

    Usage

    -

    FilterState$destroy_observers()

    +
    +

    +
    +
    +

    Method destroy_observers() +

    +

    Destroy observers stored in private$observers.

    +
    +

    Usage +

    +

    +
    +
    FilterState$destroy_observers()
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    FilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    FilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -341,17 +530,19 @@

    Arguments

    + +

    + +
    - - + + diff --git a/v0.5.0-rc1/reference/FilterStateExpr.html b/v0.5.0-rc1/reference/FilterStateExpr.html index dcde9ab3d..c68042af0 100644 --- a/v0.5.0-rc1/reference/FilterStateExpr.html +++ b/v0.5.0-rc1/reference/FilterStateExpr.html @@ -1,8 +1,24 @@ - -FilterStateExpr R6 class — FilterStateExpr • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,18 +107,22 @@
    -

    Details

    +

    Details +

    Creates a filter state around a predefined condition call (logical predicate). The condition call is independent of the data and the filter card allows no interaction (the filter is always fixed).

    -

    Methods

    +

    Methods +


    -

    Method new()

    -

    Initialize a FilterStateExpr object.

    -

    Usage

    -

    FilterStateExpr$new(slice)

    + +
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterStateExpr object.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$new(slice)
    +

    +
    -

    Arguments

    -

    slice
    +

    Arguments +

    +

    +
    +
    +
    slice

    (teal_slice_expr)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Object of class FilterStateExpr, invisibly.

    -


    -

    Method format()

    -

    Returns a formatted string representing this FilterStateExpr object.

    -

    Usage

    -

    FilterStateExpr$format(show_all = FALSE, trim_lines = TRUE)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns a formatted string representing this FilterStateExpr object.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$format(show_all = FALSE, trim_lines = TRUE)
    +

    +
    -

    Arguments

    -

    show_all
    +

    Arguments +

    +

    +
    +
    +
    show_all

    (logical(1)) passed to format.teal_slice

    @@ -142,133 +201,242 @@

    Arguments -

    Returns

    +

    Returns +

    character(1) the formatted string

    -


    -

    Method print()

    -

    Prints this FilterStateExpr object.

    -

    Usage

    -

    FilterStateExpr$print(...)

    +
    +

    +
    +
    +

    Method print() +

    +

    Prints this FilterStateExpr object.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$print(...)
    +

    +
    -

    Arguments

    -

    ...
    +

    Arguments +

    +

    +
    +
    +
    ...

    arguments passed to the format method

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method get_state()

    -

    Returns a complete description of this filter state.

    -

    Usage

    -

    FilterStateExpr$get_state()

    +
    +

    +
    +
    +

    Method get_state() +

    +

    Returns a complete description of this filter state.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$get_state()
    +

    +
    -

    Returns

    +

    Returns +

    A teal_slice object.

    -


    -

    Method set_state()

    -

    Does nothing. Exists for compatibility.

    -

    Usage

    -

    FilterStateExpr$set_state(state)

    +
    +

    +
    +
    +

    Method set_state() +

    +

    Does nothing. Exists for compatibility.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$set_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slice)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    self, invisibly.

    -


    -

    Method get_call()

    -

    Get reproducible call.

    -

    Usage

    -

    FilterStateExpr$get_call(dataname)

    +
    +

    +
    +
    +

    Method get_call() +

    +

    Get reproducible call.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    -

    (ignored) for a consistency with FilterState

    +

    Arguments +

    +

    +
    +
    +
    dataname
    +
    +

    (ignored) for a consistency with FilterState

    Returns reproducible condition call for current selection relevant for selected variable type. Method is using internal reactive values which makes it reactive -and must be executed in reactive or isolated context.

    +and must be executed in reactive or isolated context.

    +
    -

    + +

    +
    -

    Returns

    +

    Returns +

    call or NULL

    -


    -

    Method destroy_observers()

    -

    Destroy observers stored in private$observers.

    -

    Usage

    -

    FilterStateExpr$destroy_observers()

    +
    +

    +
    +
    +

    Method destroy_observers() +

    +

    Destroy observers stored in private$observers.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$destroy_observers()
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method server()

    -

    shiny module server.

    -

    Usage

    -

    FilterStateExpr$server(id)

    +
    +

    +
    +
    +

    Method server() +

    +

    shiny module server.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$server(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Reactive expression signaling that the remove button has been clicked.

    -


    -

    Method ui()

    +
    +

    +
    +
    +

    Method ui() +

    shiny module UI. -The UI for this class contains simple message stating that it is not supported.

    -

    Usage

    -

    FilterStateExpr$ui(id, parent_id = "cards")

    +The UI for this class contains simple message stating that it is not supported.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$ui(id, parent_id = "cards")
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    @@ -278,23 +446,41 @@

    Arguments
    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    FilterStateExpr$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -302,7 +488,8 @@

    Arguments -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     include_js_files <- getFromNamespace("include_js_files", "teal.slice")
     include_css_files <- getFromNamespace("include_css_files", "teal.slice")
    @@ -355,17 +542,19 @@ 

    Examples

    + +

    + +
    - - + + diff --git a/v0.5.0-rc1/reference/FilterStates.html b/v0.5.0-rc1/reference/FilterStates.html index 064cfc385..7f4dd2f73 100644 --- a/v0.5.0-rc1/reference/FilterStates.html +++ b/v0.5.0-rc1/reference/FilterStates.html @@ -1,5 +1,10 @@ - - + + + + + +FilterStates R6 class — FilterStates • teal.slice +FilterStates R6 class — FilterStates • teal.slice + + + + + + + + + + Skip to contents @@ -38,7 +54,8 @@ + +
    @@ -114,12 +137,15 @@
    -

    Methods

    +

    Methods +


    -

    Method new()

    + +
    +

    +
    +
    +

    Method new() +

    Initializes FilterStates object by setting -dataname, and datalabel.

    -

    Usage

    -

    FilterStates$new(
    +dataname, and datalabel.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$new(
       data,
       data_reactive = function(sid = "") NULL,
       dataname,
       datalabel = NULL
    -)

    +)
    +

    +
    -

    Arguments

    -

    data
    +

    Arguments +

    +

    +
    +
    +
    data

    (data.frame or MultiAssayExperiment or SummarizedExperiment or matrix) the R object which subset function is applied on.

    @@ -171,23 +212,40 @@

    Arguments -

    Returns

    +

    Returns +

    Object of class FilterStates, invisibly.

    -


    -

    Method format()

    -

    Returns a formatted string representing this FilterStates object.

    -

    Usage

    -

    FilterStates$format(show_all = FALSE, trim_lines = TRUE)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns a formatted string representing this FilterStates object.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$format(show_all = FALSE, trim_lines = TRUE)
    +

    +
    -

    Arguments

    -

    show_all
    +

    Arguments +

    +

    +
    +
    +
    show_all

    (logical(1)) passed to format.teal_slices

    @@ -195,28 +253,40 @@

    Arguments -

    Returns

    +

    Returns +

    character(1) the formatted string

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Filter call

    Builds subset expression from condition calls generated by FilterState. The lhs of the expression is a dataname_prefixed, where word prefixed refers to situation when call is evaluated on elements of the original data, for example dataname[[x]]. By default dataname_prefixed = dataname and it's not alterable through class methods. Customization of private$dataname_prefixed is done through inheriting classes.

    -

    The rhs is a call to private$fun with following arguments:

    • dataname_prefixed

    • +

      The rhs is a call to private$fun with following arguments:

      +
        +
      • dataname_prefixed

      • list of logical expressions generated by FilterState objects stored in private$state_list. Each logical predicate is combined with & operator. Variables in these logical expressions by default are not prefixed but this can be changed by setting private$extract_type (change in the similar way as dataname_prefixed) Possible call outputs depending on a custom fields/options:

      • -

      # default
      +
    +

    +
    +
    # default
     dataname <- subset(dataname, col == "x")
     
     # fun = dplyr::filter
    @@ -229,222 +299,399 @@ 

    Method get_call()dataname <- subset(dataname, subset = row_col == "x", select = col_col == "x") # dataname = dataname[[element]] -dataname[[element]] <- subset(dataname[[element]], subset = col == "x")

    -

    If no filters are applied, NULL is returned to avoid no-op calls such as dataname <- dataname.

    -

    Usage

    -

    FilterStates$get_call(sid = "")

    +dataname[[element]] <- subset(dataname[[element]], subset = col == "x")
    +

    +
    +

    If no filters are applied, NULL is returned to avoid no-op calls such as dataname <- dataname.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$get_call(sid = "")
    +

    +
    -

    Arguments

    -

    sid
    +

    Arguments +

    +

    +
    +
    +
    sid

    (character) when specified then method returns code containing condition calls (logical predicates) of FilterState objects which "sid" attribute is different than this sid argument.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    call or NULL

    -


    -

    Method print()

    -

    Prints this FilterStates object.

    -

    Usage

    -

    FilterStates$print(...)

    +
    +

    +
    +
    +

    Method print() +

    +

    Prints this FilterStates object.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$print(...)
    +

    +
    -

    Arguments

    -

    ...
    +

    Arguments +

    +

    +
    +
    +
    ...

    additional arguments passed to format.

    -

    +
    +

    +
    -


    -

    Method remove_filter_state()

    -

    Remove one or more FilterStates from the state_list along with their UI elements.

    -

    Usage

    -

    FilterStates$remove_filter_state(state)

    +
    +

    +
    +
    +

    Method remove_filter_state() +

    +

    Remove one or more FilterStates from the state_list along with their UI elements.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$remove_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices) specifying FilterState objects to remove; teal_slices may contain only dataname and varname, other elements are ignored

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    +

    +
    +
    +

    Method get_filter_state() +

    Gets reactive values from active FilterState objects.

    Get active filter state from FilterState objects stored in state_list(s). -The output is a list compatible with input to self$set_filter_state.

    -

    Usage

    -

    FilterStates$get_filter_state()

    +The output is a list compatible with input to self$set_filter_state.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$get_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    Object of class teal_slices.

    -


    -

    Method set_filter_state()

    -

    Sets active FilterState objects.

    -

    Usage

    -

    FilterStates$set_filter_state(state)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Sets active FilterState objects.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$set_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Function that raises an error.

    -


    -

    Method clear_filter_states()

    -

    Remove all FilterState objects from this FilterStates object.

    -

    Usage

    -

    FilterStates$clear_filter_states(force = FALSE)

    +
    +

    +
    +
    +

    Method clear_filter_states() +

    +

    Remove all FilterState objects from this FilterStates object.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$clear_filter_states(force = FALSE)
    +

    +
    -

    Arguments

    -

    force
    +

    Arguments +

    +

    +
    +
    +
    force

    (logical(1)) flag specifying whether to include anchored filter states.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method ui_active()

    +
    +

    +
    +
    +

    Method ui_active() +

    shiny UI definition that stores FilterState UI elements. -Populated with elements created with renderUI in the module server.

    -

    Usage

    -

    FilterStates$ui_active(id)

    +Populated with elements created with renderUI in the module server.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$ui_active(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_active()

    -

    shiny server module.

    -

    Usage

    -

    FilterStates$srv_active(id)

    +
    +

    +
    +
    +

    Method srv_active() +

    +

    shiny server module.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$srv_active(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL.

    -


    -

    Method ui_add()

    -

    shiny UI module to add filter variable.

    -

    Usage

    -

    FilterStates$ui_add(id)

    +
    +

    +
    +
    +

    Method ui_add() +

    +

    shiny UI module to add filter variable.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$ui_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_add()

    +
    +

    +
    +
    +

    Method srv_add() +

    shiny server module to add filter variable.

    This module controls available choices to select as a filter variable. Once selected, a variable is removed from available choices. -Removing a filter variable adds it back to available choices.

    -

    Usage

    -

    FilterStates$srv_add(id)

    +Removing a filter variable adds it back to available choices.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$srv_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL.

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    FilterStates$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -452,17 +699,19 @@

    Arguments

    + +
    + +
    - - + + diff --git a/v0.5.0-rc1/reference/FilteredData.html b/v0.5.0-rc1/reference/FilteredData.html index a3d68903a..91934012e 100644 --- a/v0.5.0-rc1/reference/FilteredData.html +++ b/v0.5.0-rc1/reference/FilteredData.html @@ -1,8 +1,24 @@ - -Class to encapsulate filtered datasets — FilteredData • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,7 +106,8 @@ + +
    -

    Methods

    +

    Methods +


    -

    Method new()

    -

    Initialize a FilteredData object.

    -

    Usage

    -

    FilteredData$new(data_objects, join_keys = teal.data::join_keys())

    + +
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilteredData object.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$new(data_objects, join_keys = teal.data::join_keys())
    +

    +
    -

    Arguments

    -

    data_objects
    +

    Arguments +

    +

    +
    +
    +
    data_objects

    (named list) List of data objects. Names of the list will be used as dataname for respective datasets.

    @@ -157,65 +204,113 @@

    Argumentsteal.data::join_keys().

    -

    +
    +

    +
    -


    -

    Method datanames()

    -

    Gets datanames.

    -

    Usage

    -

    FilteredData$datanames()

    +
    +

    +
    +
    +

    Method datanames() +

    +

    Gets datanames.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$datanames()
    +

    +
    -

    Details

    +

    Details +

    The datanames are returned in the order in which they must be evaluated (in case of dependencies).

    -

    Returns

    +

    Returns +

    Character vector.

    -


    -

    Method get_datalabel()

    +
    +

    +
    +
    +

    Method get_datalabel() +

    Gets data label for the dataset. -Useful to display in Show R Code.

    -

    Usage

    -

    FilteredData$get_datalabel(dataname)

    +Useful to display in Show R Code.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_datalabel(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Character string.

    -


    -

    Method set_available_teal_slices()

    -

    Set list of external filter states available for activation.

    -

    Usage

    -

    FilteredData$set_available_teal_slices(x)

    +
    +

    +
    +
    +

    Method set_available_teal_slices() +

    +

    Set list of external filter states available for activation.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$set_available_teal_slices(x)
    +

    +
    -

    Arguments

    -

    x
    +

    Arguments +

    +

    +
    +
    +
    x

    (reactive) should return teal_slices

    -

    +
    +

    +
    -

    Details

    +

    Details +

    Unlike adding new filter from the column, these filters can come with some prespecified settings. teal_slices are wrapped in a reactive so they can be updated from elsewhere in the app. Filters passed in x are limited to those that can be set for this FilteredData object, @@ -224,46 +319,76 @@

    Details -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method get_available_teal_slices()

    -

    Get list of filter states available for this object.

    -

    Usage

    -

    FilteredData$get_available_teal_slices()

    +
    +

    +
    +
    +

    Method get_available_teal_slices() +

    +

    Get list of filter states available for this object.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_available_teal_slices()
    +

    +
    -

    Details

    +

    Details +

    All teal_slice objects that have been created since the beginning of the app session are stored in one teal_slices object. This returns a subset of that teal_slices, describing filter states that can be set for this object.

    -

    Returns

    +

    Returns +

    reactive that returns teal_slices.

    -


    -

    Method get_call()

    -

    Gets a call to filter the dataset according to the filter state.

    -

    Usage

    -

    FilteredData$get_call(dataname)

    +
    +

    +
    +
    +

    Method get_call() +

    +

    Gets a call to filter the dataset according to the filter state.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset

    -

    +
    +

    +
    -

    Details

    +

    Details +

    It returns a call to filter the dataset only, assuming the other (filtered) datasets it depends on are available.

    Together with self$datanames() which returns the datasets in the correct @@ -277,21 +402,36 @@

    Details -

    Returns

    +

    Returns +

    A list of calls.

    -


    -

    Method get_data()

    +
    +

    +
    +
    +

    Method get_data() +

    Gets filtered or unfiltered dataset.

    -

    For filtered = FALSE, the original data set with set_data is returned including all attributes.

    -

    Usage

    -

    FilteredData$get_data(dataname, filtered = TRUE)

    +

    For filtered = FALSE, the original data set with set_data is returned including all attributes.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_data(dataname, filtered = TRUE)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset.

    @@ -299,77 +439,139 @@

    Arguments -

    Returns

    +

    Returns +

    A data object, a data.frame or a MultiAssayExperiment.

    -


    -

    Method get_join_keys()

    -

    Get join keys between two datasets.

    -

    Usage

    -

    FilteredData$get_join_keys()

    +
    +

    +
    +
    +

    Method get_join_keys() +

    +

    Get join keys between two datasets.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_join_keys()
    +

    +
    -

    Returns

    +

    Returns +

    join_keys

    -


    -

    Method get_filter_overview()

    +
    +

    +
    +
    +

    Method get_filter_overview() +

    Creates filter overview table to be displayed in the application. One row is created per dataset, according to the get_filter_overview methods -of the contained FilteredDataset objects.

    -

    Usage

    -

    FilteredData$get_filter_overview(datanames)

    +of the contained FilteredDataset objects.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_filter_overview(datanames)
    +

    +
    -

    Arguments

    -

    datanames
    +

    Arguments +

    +

    +
    +
    +
    datanames

    (character) vector of dataset names.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    A data.frame listing the numbers of observations in all datasets.

    -


    -

    Method get_keys()

    -

    Get keys for the dataset.

    -

    Usage

    -

    FilteredData$get_keys(dataname)

    +
    +

    +
    +
    +

    Method get_keys() +

    +

    Get keys for the dataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_keys(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Character vector of key column names.

    -


    -

    Method set_dataset()

    -

    Adds a dataset to this FilteredData.

    -

    Usage

    -

    FilteredData$set_dataset(data, dataname)

    +
    +

    +
    +
    +

    Method set_dataset() +

    +

    Adds a dataset to this FilteredData.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$set_dataset(data, dataname)
    +

    +
    -

    Arguments

    -

    data
    +

    Arguments +

    +

    +
    +
    +
    data

    (data.frame or MultiAssayExperiment) data to be filtered.

    @@ -379,10 +581,13 @@

    Arguments -

    Details

    +

    Details +

    set_dataset creates a FilteredDataset object which keeps dataset for the filtering purpose. If this data has a parent specified in the join_keys object stored in private$join_keys then created FilteredDataset (child) gets linked with other FilteredDataset (parent). @@ -391,52 +596,95 @@

    Details -

    Returns

    +

    Returns +

    self, invisibly.

    -


    -

    Method set_join_keys()

    -

    Set the join_keys.

    -

    Usage

    -

    FilteredData$set_join_keys(join_keys)

    +
    +

    +
    +
    +

    Method set_join_keys() +

    +

    Set the join_keys.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$set_join_keys(join_keys)
    +

    +
    -

    Arguments

    -

    join_keys
    +

    Arguments +

    +

    +
    +
    +
    join_keys

    (join_keys), see teal.data::join_keys().

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    self, invisibly.

    -


    -

    Method get_filter_state()

    -

    Gets states of all contained FilterState objects.

    -

    Usage

    -

    FilteredData$get_filter_state()

    +
    +

    +
    +
    +

    Method get_filter_state() +

    +

    Gets states of all contained FilterState objects.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    A teal_slices object.

    -


    -

    Method format()

    -

    Returns a formatted string representing this FilteredData object.

    -

    Usage

    -

    FilteredData$format(show_all = FALSE, trim_lines = TRUE)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns a formatted string representing this FilteredData object.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$format(show_all = FALSE, trim_lines = TRUE)
    +

    +
    -

    Arguments

    -

    show_all
    +

    Arguments +

    +

    +
    +
    +
    show_all

    (logical(1)) passed to format.teal_slice.

    @@ -444,81 +692,148 @@

    Arguments -

    Returns

    +

    Returns +

    character(1) the formatted string.

    -


    -

    Method print()

    -

    Prints this FilteredData object.

    -

    Usage

    -

    FilteredData$print(...)

    +
    +

    +
    +
    +

    Method print() +

    +

    Prints this FilteredData object.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$print(...)
    +

    +
    -

    Arguments

    -

    ...
    +

    Arguments +

    +

    +
    +
    +
    ...

    additional arguments passed to format.

    -

    +
    +

    +
    -


    -

    Method set_filter_state()

    -

    Sets active filter states.

    -

    Usage

    -

    FilteredData$set_filter_state(state)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Sets active filter states.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$set_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method remove_filter_state()

    -

    Removes one or more FilterState from a FilteredData object.

    -

    Usage

    -

    FilteredData$remove_filter_state(state)

    +
    +

    +
    +
    +

    Method remove_filter_state() +

    +

    Removes one or more FilterState from a FilteredData object.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$remove_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices) specifying FilterState objects to remove; teal_slices may contain only dataname and varname, other elements are ignored.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method clear_filter_states()

    -

    Remove all FilterStates of a FilteredDataset or all FilterStates of a FilteredData object.

    -

    Usage

    -

    FilteredData$clear_filter_states(datanames = self$datanames(), force = FALSE)

    +
    +

    +
    +
    +

    Method clear_filter_states() +

    +

    Remove all FilterStates of a FilteredDataset or all FilterStates of a FilteredData object.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$clear_filter_states(datanames = self$datanames(), force = FALSE)
    +

    +
    -

    Arguments

    -

    datanames
    +

    Arguments +

    +

    +
    +
    +
    datanames

    (character) names of datasets for which to remove all filter states. Defaults to all datasets in this FilteredData object.

    @@ -529,45 +844,79 @@

    Arguments -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method ui_filter_panel()

    +
    +

    +
    +
    +

    Method ui_filter_panel() +

    top-level shiny module for the filter panel in the teal app. -Contains 1) filter overview panel, 2) filter active panel, and 3) add filters panel.

    -

    Usage

    -

    FilteredData$ui_filter_panel(id)

    +Contains 1) filter overview panel, 2) filter active panel, and 3) add filters panel.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$ui_filter_panel(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_filter_panel()

    -

    Server function for filter panel.

    -

    Usage

    -

    FilteredData$srv_filter_panel(id, active_datanames = self$datanames)

    +
    +

    +
    +
    +

    Method srv_filter_panel() +

    +

    Server function for filter panel.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$srv_filter_panel(id, active_datanames = self$datanames)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    @@ -580,44 +929,78 @@

    Arguments -

    Returns

    +

    Returns +

    NULL.

    -


    -

    Method ui_active()

    -

    Server module responsible for displaying active filters.

    -

    Usage

    -

    FilteredData$ui_active(id)

    +
    +

    +
    +
    +

    Method ui_active() +

    +

    Server module responsible for displaying active filters.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$ui_active(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_active()

    -

    Server module responsible for displaying active filters.

    -

    Usage

    -

    FilteredData$srv_active(id, active_datanames = self$datanames)

    +
    +

    +
    +
    +

    Method srv_active() +

    +

    Server module responsible for displaying active filters.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$srv_active(id, active_datanames = self$datanames)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    @@ -627,44 +1010,78 @@

    Arguments -

    Returns

    +

    Returns +

    NULL.

    -


    -

    Method ui_add()

    -

    Server module responsible for displaying drop-downs with variables to add a filter.

    -

    Usage

    -

    FilteredData$ui_add(id)

    +
    +

    +
    +
    +

    Method ui_add() +

    +

    Server module responsible for displaying drop-downs with variables to add a filter.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$ui_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_add()

    -

    Server module responsible for displaying drop-downs with variables to add a filter.

    -

    Usage

    -

    FilteredData$srv_add(id, active_datanames = reactive(self$datanames()))

    +
    +

    +
    +
    +

    Method srv_add() +

    +

    Server module responsible for displaying drop-downs with variables to add a filter.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$srv_add(id, active_datanames = reactive(self$datanames()))
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    @@ -674,45 +1091,78 @@

    Arguments -

    Returns

    +

    Returns +

    NULL.

    -


    -

    Method ui_overview()

    +
    +

    +
    +
    +

    Method ui_overview() +

    Creates the UI definition for the module showing counts for each dataset contrasting the filtered to the full unfiltered dataset.

    Per dataset, it displays the number of rows/observations in each dataset, -the number of unique subjects.

    -

    Usage

    -

    FilteredData$ui_overview(id)

    +the number of unique subjects.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$ui_overview(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -


    -

    Method srv_overview()

    +
    +

    +
    +
    +

    Method srv_overview() +

    Server function to display the number of records in the filtered and unfiltered -data.

    -

    Usage

    -

    FilteredData$srv_overview(id, active_datanames = self$datanames)

    +data.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$srv_overview(id, active_datanames = self$datanames)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    @@ -725,27 +1175,46 @@

    Arguments -

    Returns

    +

    Returns +

    NULL.

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    FilteredData$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -753,7 +1222,8 @@

    Arguments -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     FilteredData <- getFromNamespace("FilteredData", "teal.slice")
     
    @@ -931,17 +1401,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.5.0-rc1/reference/FilteredDataset.html b/v0.5.0-rc1/reference/FilteredDataset.html index cba428afe..01da9f1f3 100644 --- a/v0.5.0-rc1/reference/FilteredDataset.html +++ b/v0.5.0-rc1/reference/FilteredDataset.html @@ -1,16 +1,32 @@ - - + + + + + +FilteredDataset R6 class — FilteredDataset • teal.slice +FilteredDataset R6 class — FilteredDataset • teal.slice + + + + + + + + + + Skip to contents @@ -26,7 +42,8 @@ + +
    @@ -96,12 +119,15 @@
    -

    Methods

    +

    Methods +


    -

    Method new()

    -

    Initializes this FilteredDataset object.

    -

    Usage

    -

    +

    +
    +
    +

    Method new() +

    +

    Initializes this FilteredDataset object.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$new(
       dataset,
       dataname,
       keys = character(0),
       label = attr(dataset, "label")
    -)

    +)
    +

    +
    -

    Arguments

    -

    dataset
    +

    Arguments +

    +

    +
    +
    +
    dataset

    any object

    @@ -152,23 +193,40 @@

    Arguments -

    Returns

    +

    Returns +

    Object of class FilteredDataset, invisibly.

    -


    -

    Method format()

    -

    Returns a formatted string representing this FilteredDataset object.

    -

    Usage

    -

    FilteredDataset$format(show_all = FALSE, trim_lines = TRUE)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns a formatted string representing this FilteredDataset object.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$format(show_all = FALSE, trim_lines = TRUE)
    +

    +
    -

    Arguments

    -

    show_all
    +

    Arguments +

    +

    +
    +
    +
    show_all

    (logical(1)) passed to format.teal_slice.

    @@ -176,289 +234,526 @@

    Arguments -

    Returns

    +

    Returns +

    The formatted character string.

    -


    -

    Method print()

    -

    Prints this FilteredDataset object.

    -

    Usage

    -

    FilteredDataset$print(...)

    +
    +

    +
    +
    +

    Method print() +

    +

    Prints this FilteredDataset object.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$print(...)
    +

    +
    -

    Arguments

    -

    ...
    +

    Arguments +

    +

    +
    +
    +
    ...

    additional arguments passed to format.

    -

    +
    +

    +
    -


    -

    Method clear_filter_states()

    -

    Removes all filter items applied to this dataset.

    -

    Usage

    -

    FilteredDataset$clear_filter_states(force = FALSE)

    +
    +

    +
    +
    +

    Method clear_filter_states() +

    +

    Removes all filter items applied to this dataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$clear_filter_states(force = FALSE)
    +

    +
    -

    Arguments

    -

    force
    +

    Arguments +

    +

    +
    +
    +
    force

    (logical(1)) flag specifying whether to include anchored filter states.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL.

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Gets a filter expression.

    This function returns filter calls equivalent to selected items within each of filter_states. Configuration of the calls is constant and -depends on filter_states type and order which are set during initialization.

    -

    Usage

    -

    FilteredDataset$get_call(sid = "")

    +depends on filter_states type and order which are set during initialization.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_call(sid = "")
    +

    +
    -

    Arguments

    -

    sid
    +

    Arguments +

    +

    +
    +
    +
    sid

    (character) when specified, the method returns code containing conditions calls of FilterState objects with sid different to this sid argument.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Either a list of filter calls, or NULL.

    -


    -

    Method get_filter_state()

    -

    Gets states of all contained FilterState objects.

    -

    Usage

    -

    FilteredDataset$get_filter_state()

    +
    +

    +
    +
    +

    Method get_filter_state() +

    +

    Gets states of all contained FilterState objects.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    A teal_slices object.

    -


    -

    Method set_filter_state()

    -

    Set filter state.

    -

    Usage

    -

    FilteredDataset$set_filter_state(state)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Set filter state.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$set_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Virtual method, returns nothing and raises error.

    -


    -

    Method get_filter_count()

    -

    Gets the number of FilterState objects in all FilterStates in this FilteredDataset.

    -

    Usage

    -

    FilteredDataset$get_filter_count()

    +
    +

    +
    +
    +

    Method get_filter_count() +

    +

    Gets the number of FilterState objects in all FilterStates in this FilteredDataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_filter_count()
    +

    +
    -

    Returns

    +

    Returns +

    integer(1)

    -


    -

    Method get_dataname()

    -

    Gets the name of the dataset.

    -

    Usage

    -

    FilteredDataset$get_dataname()

    +
    +

    +
    +
    +

    Method get_dataname() +

    +

    Gets the name of the dataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_dataname()
    +

    +
    -

    Returns

    +

    Returns +

    A character string.

    -


    -

    Method get_dataset()

    -

    Gets the dataset object in this FilteredDataset.

    -

    Usage

    -

    FilteredDataset$get_dataset(filtered = FALSE)

    +
    +

    +
    +
    +

    Method get_dataset() +

    +

    Gets the dataset object in this FilteredDataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_dataset(filtered = FALSE)
    +

    +
    -

    Arguments

    -

    filtered
    +

    Arguments +

    +

    +
    +
    +
    filtered

    (logical(1))

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    The stored dataset. If data.frame or MultiAssayExperiment, either raw or as a reactive with current filters applied (depending on filtered).

    -


    -

    Method get_filter_overview()

    -

    Get filter overview of a dataset.

    -

    Usage

    -

    FilteredDataset$get_filter_overview()

    +
    +

    +
    +
    +

    Method get_filter_overview() +

    +

    Get filter overview of a dataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_filter_overview()
    +

    +
    -

    Returns

    +

    Returns +

    Virtual method, returns nothing and raises an error.

    -


    -

    Method get_keys()

    -

    Gets the key columns for this dataset.

    -

    Usage

    -

    FilteredDataset$get_keys()

    +
    +

    +
    +
    +

    Method get_keys() +

    +

    Gets the key columns for this dataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_keys()
    +

    +
    -

    Returns

    +

    Returns +

    Character vector of variable names

    -


    -

    Method get_dataset_label()

    -

    Gets the dataset label.

    -

    Usage

    -

    FilteredDataset$get_dataset_label()

    +
    +

    +
    +
    +

    Method get_dataset_label() +

    +

    Gets the dataset label.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_dataset_label()
    +

    +
    -

    Returns

    +

    Returns +

    Character string.

    -


    -

    Method ui_active()

    -

    shiny module containing active filters for a dataset, along with a title and a remove button.

    -

    Usage

    -

    FilteredDataset$ui_active(id)

    +
    +

    +
    +
    +

    Method ui_active() +

    +

    shiny module containing active filters for a dataset, along with a title and a remove button.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$ui_active(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_active()

    -

    Server module for a dataset active filters.

    -

    Usage

    -

    FilteredDataset$srv_active(id)

    +
    +

    +
    +
    +

    Method srv_active() +

    +

    Server module for a dataset active filters.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$srv_active(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL.

    -


    -

    Method ui_add()

    -

    UI module to add filter variable for this dataset.

    -

    Usage

    -

    FilteredDataset$ui_add(id)

    +
    +

    +
    +
    +

    Method ui_add() +

    +

    UI module to add filter variable for this dataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$ui_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Virtual method, returns nothing and raises error.

    -


    -

    Method srv_add()

    +
    +

    +
    +
    +

    Method srv_add() +

    Server module to add filter variable for this dataset. For this class srv_add calls multiple modules of the same name from FilterStates as MAEFilteredDataset -contains one FilterStates object for colData and one for each experiment.

    -

    Usage

    -

    FilteredDataset$srv_add(id)

    +contains one FilterStates object for colData and one for each experiment.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$srv_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL.

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    FilteredDataset$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -466,17 +761,19 @@

    Arguments

    + +
    + +
    - - + + diff --git a/v0.5.0-rc1/reference/LogicalFilterState.html b/v0.5.0-rc1/reference/LogicalFilterState.html index a090cae3c..e87e29009 100644 --- a/v0.5.0-rc1/reference/LogicalFilterState.html +++ b/v0.5.0-rc1/reference/LogicalFilterState.html @@ -1,8 +1,24 @@ - -FilterState object for logical data — LogicalFilterState • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,40 +107,60 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterState -> LogicalFilterState

    +

    Inherited methods


    -

    Method new()

    -

    Initialize a FilterState object.

    -

    Usage

    -

    LogicalFilterState$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterState object.

    +
    +

    Usage +

    +

    +
    +
    LogicalFilterState$new(
       x,
       x_reactive = reactive(NULL),
       extract_type = character(0),
       slice
    -)

    +)
    +

    +
    -

    Arguments

    -

    x
    +

    Arguments +

    +

    + -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection. -For LogicalFilterState it's a !<varname> or <varname> and optionally is.na(<varname>)

    -

    Usage

    -

    LogicalFilterState$get_call(dataname)

    +For LogicalFilterState it's a !<varname> or <varname> and optionally is.na(<varname>)

    +
    +

    Usage +

    +

    +
    +
    LogicalFilterState$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    name of data set; defaults to private$get_dataname()

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    call

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    LogicalFilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    LogicalFilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -196,7 +279,8 @@

    Arguments -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     include_css_files <- getFromNamespace("include_css_files", "teal.slice")
     include_js_files <- getFromNamespace("include_js_files", "teal.slice")
    @@ -284,17 +368,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.5.0-rc1/reference/MAEFilterStates.html b/v0.5.0-rc1/reference/MAEFilterStates.html index 64678d478..23832a8c6 100644 --- a/v0.5.0-rc1/reference/MAEFilterStates.html +++ b/v0.5.0-rc1/reference/MAEFilterStates.html @@ -1,8 +1,24 @@ - -FilterStates subclass for MultiAssayExperiments — MAEFilterStates • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,18 +107,25 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterStates -> MAEFilterStates

    -

    Methods

    +

    Methods +

    Inherited methods +
    +

    Inherited methods


    -

    Method new()

    -

    Initialize MAEFilterStates object.

    -

    Usage

    -

    MAEFilterStates$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize MAEFilterStates object.

    +
    +

    Usage +

    +

    +
    +
    MAEFilterStates$new(
       data,
       data_reactive = function(sid = "") NULL,
       dataname,
       datalabel = "subjects",
       keys = character(0)
    -)

    +)
    +

    +
    -

    Arguments

    -

    data
    +

    Arguments +

    +

    +
    +
    +
    data

    (MultiAssayExperiment) the R object which MultiAssayExperiment::subsetByColData function is applied on.

    @@ -155,23 +198,41 @@

    Arguments
    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    MAEFilterStates$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    MAEFilterStates$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -179,17 +240,19 @@

    Arguments

    + +

    + +
    - - + + diff --git a/v0.5.0-rc1/reference/MAEFilteredDataset.html b/v0.5.0-rc1/reference/MAEFilteredDataset.html index 746f82ba6..696e164eb 100644 --- a/v0.5.0-rc1/reference/MAEFilteredDataset.html +++ b/v0.5.0-rc1/reference/MAEFilteredDataset.html @@ -1,10 +1,26 @@ - -MAEFilteredDataset R6 class — MAEFilteredDataset • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + +
    @@ -87,22 +110,29 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilteredDataset -> MAEFilteredDataset

    +

    Inherited methods


    -

    Method new()

    -

    Initialize MAEFilteredDataset object.

    -

    Usage

    -

    MAEFilteredDataset$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize MAEFilteredDataset object.

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$new(
       dataset,
       dataname,
       keys = character(0),
       label = character(0)
    -)

    +)
    +

    +
    -

    Arguments

    -

    dataset
    +

    Arguments +

    +

    +
    +
    +
    dataset

    (MulitiAssayExperiment) single MulitiAssayExperiment for which filters are rendered.

    @@ -149,102 +192,183 @@

    Arguments -

    Returns

    +

    Returns +

    Object of class MAEFilteredDataset, invisibly.

    -


    -

    Method set_filter_state()

    -

    Set filter state.

    -

    Usage

    -

    MAEFilteredDataset$set_filter_state(state)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Set filter state.

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$set_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method remove_filter_state()

    -

    Remove one or more FilterState of a MAEFilteredDataset.

    -

    Usage

    -

    MAEFilteredDataset$remove_filter_state(state)

    +
    +

    +
    +
    +

    Method remove_filter_state() +

    +

    Remove one or more FilterState of a MAEFilteredDataset.

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$remove_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices) specifying FilterState objects to remove; teal_slices may contain only dataname and varname, other elements are ignored.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method ui_add()

    -

    UI module to add filter variable for this dataset.

    -

    Usage

    -

    MAEFilteredDataset$ui_add(id)

    +
    +

    +
    +
    +

    Method ui_add() +

    +

    UI module to add filter variable for this dataset.

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$ui_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method get_filter_overview()

    -

    Creates row for filter overview in the form of
    dataname -- observations (remaining/total) -- subjects (remaining/total) - MAE

    -

    Usage

    -

    MAEFilteredDataset$get_filter_overview()

    +
    +

    +
    +
    +

    Method get_filter_overview() +

    +

    Creates row for filter overview in the form of
    dataname -- observations (remaining/total) -- subjects (remaining/total) - MAE

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$get_filter_overview()
    +

    +
    -

    Returns

    +

    Returns +

    A data.frame.

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    MAEFilteredDataset$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -252,7 +376,8 @@

    Arguments -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     MAEFilteredDataset <- getFromNamespace("MAEFilteredDataset", "teal.slice")
     
    @@ -324,17 +449,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.5.0-rc1/reference/MatrixFilterStates.html b/v0.5.0-rc1/reference/MatrixFilterStates.html index 654cc0f0d..7a403e0e4 100644 --- a/v0.5.0-rc1/reference/MatrixFilterStates.html +++ b/v0.5.0-rc1/reference/MatrixFilterStates.html @@ -1,8 +1,24 @@ - -FilterStates subclass for matrices — MatrixFilterStates • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,18 +107,25 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterStates -> MatrixFilterStates

    -

    Methods

    +

    Methods +

    Inherited methods +
    +

    Inherited methods


    -

    Method new()

    -

    Initialize MatrixFilterStates object.

    -

    Usage

    -

    MatrixFilterStates$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize MatrixFilterStates object.

    +
    +

    Usage +

    +

    +
    +
    MatrixFilterStates$new(
       data,
       data_reactive = function(sid = "") NULL,
       dataname,
       datalabel = NULL
    -)

    +)
    +

    +
    -

    Arguments

    -

    data
    +

    Arguments +

    +

    +
    +
    +
    data

    (matrix) the R object which subset function is applied on.

    @@ -144,23 +187,41 @@

    Arguments
    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    MatrixFilterStates$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    MatrixFilterStates$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -168,17 +229,19 @@

    Arguments

    + +

    + +
    - - + + diff --git a/v0.5.0-rc1/reference/RangeFilterState.html b/v0.5.0-rc1/reference/RangeFilterState.html index adb681533..0152c239a 100644 --- a/v0.5.0-rc1/reference/RangeFilterState.html +++ b/v0.5.0-rc1/reference/RangeFilterState.html @@ -1,8 +1,24 @@ - -FilterState object for numeric data — RangeFilterState • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,41 +107,61 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterState -> RangeFilterState

    +

    Inherited methods


    -

    Method new()

    -

    Initialize a FilterState object for range selection.

    -

    Usage

    -

    RangeFilterState$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterState object for range selection.

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$new(
       x,
       x_reactive = reactive(NULL),
       extract_type = character(0),
       slice
    -)

    +)
    +

    +
    -

    Arguments

    -

    x
    +

    Arguments +

    +

    + -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection. For this class returned call looks like <varname> >= <min value> & <varname> <= <max value> with -optional is.na(<varname>) and is.finite(<varname>).

    -

    Usage

    -

    RangeFilterState$get_call(dataname)

    +optional is.na(<varname>) and is.finite(<varname>).

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    name of data set; defaults to private$get_dataname()

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    call

    -


    -

    Method get_keep_inf()

    -

    Returns current keep_inf selection.

    -

    Usage

    -

    RangeFilterState$get_keep_inf()

    +
    +

    +
    +
    +

    Method get_keep_inf() +

    +

    Returns current keep_inf selection.

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$get_keep_inf()
    +

    +
    -

    Returns

    +

    Returns +

    logical(1)

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    RangeFilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -211,7 +305,8 @@

    Arguments -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     include_css_files <- getFromNamespace("include_css_files", "teal.slice")
     include_js_files <- getFromNamespace("include_js_files", "teal.slice")
    @@ -327,17 +422,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.5.0-rc1/reference/SEFilterStates.html b/v0.5.0-rc1/reference/SEFilterStates.html index a2b11853a..e61653439 100644 --- a/v0.5.0-rc1/reference/SEFilterStates.html +++ b/v0.5.0-rc1/reference/SEFilterStates.html @@ -1,8 +1,24 @@ - -FilterStates subclass for SummarizedExperiments — SEFilterStates • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,21 +107,28 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterStates -> SEFilterStates

    +

    Inherited methods


    -

    Method new()

    -

    Initialize SEFilterStates object.

    -

    Usage

    -

    SEFilterStates$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize SEFilterStates object.

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$new(
       data,
       data_reactive = function(sid = "") NULL,
       dataname,
       datalabel = NULL
    -)

    +)
    +

    +
    -

    Arguments

    -

    data
    +

    Arguments +

    +

    +
    +
    +
    data

    (SummarizedExperiment) the R object which subset function is applied on.

    @@ -144,92 +187,161 @@

    Arguments
    -

    Method set_filter_state()

    -

    Set filter state.

    -

    Usage

    -

    SEFilterStates$set_filter_state(state)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Set filter state.

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$set_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices) teal_slice objects should contain the field arg %in% c("subset", "select")

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method ui_add()

    -

    shiny UI module to add filter variable.

    -

    Usage

    -

    SEFilterStates$ui_add(id)

    +
    +

    +
    +
    +

    Method ui_add() +

    +

    shiny UI module to add filter variable.

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$ui_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_add()

    +
    +

    +
    +
    +

    Method srv_add() +

    shiny server module to add filter variable.

    Module controls available choices to select as a filter variable. Selected filter variable is being removed from available choices. Removed filter variable gets back to available choices. This module unlike other FilterStates classes manages two sets of filter variables - one for colData and another for -rowData.

    -

    Usage

    -

    SEFilterStates$srv_add(id)

    +rowData.

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$srv_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    SEFilterStates$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -237,17 +349,19 @@

    Arguments

    + +
    + +
    - - + + diff --git a/v0.5.0-rc1/reference/calls_combine_by.html b/v0.5.0-rc1/reference/calls_combine_by.html index 0fd92d326..ba8565f94 100644 --- a/v0.5.0-rc1/reference/calls_combine_by.html +++ b/v0.5.0-rc1/reference/calls_combine_by.html @@ -1,8 +1,24 @@ - -Compose predicates — calls_combine_by • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +

    @@ -83,13 +105,16 @@
    -

    Usage

    +

    Usage +

    calls_combine_by(calls, operator)
    -

    Arguments

    -
    calls
    +

    Arguments +

    +
    +
    calls

    (list) containing calls (or symbols) to be combined by operator

    @@ -98,21 +123,25 @@

    Arguments

    -

    + +
    -

    Value

    +

    Value +

    A call where elements of calls are composed with operator or NULL if calls is an empty list.

    -

    Details

    +

    Details +

    This function is used to combine logical predicates produced by FilterState objects to build a complete subset expression.

    -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     calls_combine_by <- getFromNamespace("calls_combine_by", "teal.slice")
     
    @@ -127,17 +156,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.5.0-rc1/reference/check_simple_name.html b/v0.5.0-rc1/reference/check_simple_name.html index 543bb4323..52545144a 100644 --- a/v0.5.0-rc1/reference/check_simple_name.html +++ b/v0.5.0-rc1/reference/check_simple_name.html @@ -1,14 +1,30 @@ - - + + + + + +Test whether variable name can be used within Show R Code — check_simple_name • teal.slice +Test whether variable name can be used within Show R Code — check_simple_name • teal.slice + + + + + + + + + + Skip to contents @@ -24,7 +40,8 @@ + +
    @@ -92,35 +115,42 @@
    -

    Usage

    +

    Usage +

    check_simple_name(name)
    -

    Arguments

    -
    name
    +

    Arguments +

    +
    +
    name

    (character) vector of names to check

    -
    + +
    -

    Value

    +

    Value +

    Returns NULL or raises error.

    + +
    + +
    - - + + diff --git a/v0.5.0-rc1/reference/choices_labeled.html b/v0.5.0-rc1/reference/choices_labeled.html index 3220ee271..e08ed1496 100644 --- a/v0.5.0-rc1/reference/choices_labeled.html +++ b/v0.5.0-rc1/reference/choices_labeled.html @@ -1,10 +1,26 @@ - -Set "<choice>:<label>" type of names — choices_labeled • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + +
    @@ -86,13 +108,16 @@
    -

    Usage

    +

    Usage +

    choices_labeled(choices, labels, subset = NULL, types = NULL)
    -

    Arguments

    -
    choices
    +

    Arguments +

    +
    +
    choices

    (character or numeric or logical) vector

    @@ -110,31 +135,36 @@

    Arguments -

    Value

    +

    Value +

    A named character vector.

    -

    Details

    +

    Details +

    If either choices or labels are factors, they are coerced to character. Duplicated elements from choices get removed.

    + +
    + +
    - - + + diff --git a/v0.5.0-rc1/reference/coalesce_r.html b/v0.5.0-rc1/reference/coalesce_r.html index 49d48c6f1..cb4b53318 100644 --- a/v0.5.0-rc1/reference/coalesce_r.html +++ b/v0.5.0-rc1/reference/coalesce_r.html @@ -1,8 +1,24 @@ - -Recursively coalesce list elements. — coalesce_r • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,24 +105,30 @@
    -

    Usage

    +

    Usage +

    coalesce_r(x)
    -

    Arguments

    -
    x
    +

    Arguments +

    +
    +
    x

    (list), either of atomic vectors or of named lists

    -
    + +
    -

    Value

    +

    Value +

    Either an atomic vector of length 1 or a (potentially nested) list.

    -

    Details

    +

    Details +

    Given a list of atomic vectors, the first non-null element is returned. Given a list of lists, for all names found in all elements of the list the first non-null element of a given name is returned.

    @@ -108,17 +136,19 @@

    Details

    + +
    + +
    - - + + diff --git a/v0.5.0-rc1/reference/countBar.html b/v0.5.0-rc1/reference/countBar.html index 7dc7dad95..e04189e00 100644 --- a/v0.5.0-rc1/reference/countBar.html +++ b/v0.5.0-rc1/reference/countBar.html @@ -1,8 +1,24 @@ - -Progress bar with label — countBar • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,7 +105,8 @@
    -

    Usage

    +

    Usage +

    countBar(inputId, label, countmax, countnow = NULL, counttotal = countmax)
     
     updateCountBar(
    @@ -105,8 +128,10 @@ 

    Usage

    -

    Arguments

    -
    inputId
    +

    Arguments +

    +
    +
    inputId

    (character(1)) shiny id of the parent element (e.g. a check-box group input).

    @@ -129,32 +154,40 @@

    Arguments -

    Value

    +

    Value +

    shiny.tag object with a progress bar and a label.

    -

    Details

    -

    A progress bar is created to visualize the number of counts in a variable, with filling and a text label.

    • progress bar width is derived as a fraction of the container width: style = "width: <countmax> / <counttotal>%",

    • +

      Details +

      +

      A progress bar is created to visualize the number of counts in a variable, with filling and a text label.

      +
        +
      • progress bar width is derived as a fraction of the container width: style = "width: <countmax> / <counttotal>%",

      • progress bar is filled up to the fraction <countnow> / <countmax>,

      • text label is obtained by <label> (<countnow> / <countmax>).

      • -
    + +
    + +
    + +
    - - + + diff --git a/v0.5.0-rc1/reference/countBars.html b/v0.5.0-rc1/reference/countBars.html index 974a8127f..3da6e5f64 100644 --- a/v0.5.0-rc1/reference/countBars.html +++ b/v0.5.0-rc1/reference/countBars.html @@ -1,8 +1,24 @@ - -Progress bars with labels — countBars • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,7 +105,8 @@
    -

    Usage

    +

    Usage +

    countBars(inputId, choices, countsmax, countsnow = NULL)
     
     updateCountBars(
    @@ -96,8 +119,10 @@ 

    Usage

    -

    Arguments

    -
    inputId
    +

    Arguments +

    +
    +
    inputId

    (character(1)) shiny id of the parent element (e.g. a check-box group input).

    @@ -116,9 +141,11 @@

    Arguments -

    Value

    +

    Value +

    List of shiny.tags.

    @@ -138,7 +165,8 @@

    Value

    -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     include_js_files <- getFromNamespace("include_js_files", "teal.slice")
     include_css_files <- getFromNamespace("include_css_files", "teal.slice")
    @@ -190,17 +218,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.5.0-rc1/reference/data_choices_labeled.html b/v0.5.0-rc1/reference/data_choices_labeled.html index 9511ff1ef..a20ee5569 100644 --- a/v0.5.0-rc1/reference/data_choices_labeled.html +++ b/v0.5.0-rc1/reference/data_choices_labeled.html @@ -1,8 +1,24 @@ - -Returns a choices_labeled object — data_choices_labeled • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,7 +105,8 @@
    -

    Usage

    +

    Usage +

    data_choices_labeled(
       data,
       choices,
    @@ -93,8 +116,10 @@ 

    Usage

    -

    Arguments

    -
    data
    +

    Arguments +

    +
    +
    data

    (data.frame or DFrame or list) where labels can be taken from in case when varlabels is not specified. data must be specified if varlabels is not specified.

    @@ -114,26 +139,30 @@

    Arguments -

    Value

    +

    Value +

    character(0) if choices are empty; a choices_labeled object otherwise

    + +
    + +
    - - + + diff --git a/v0.5.0-rc1/reference/eval_expr_with_msg.html b/v0.5.0-rc1/reference/eval_expr_with_msg.html index 9eb8a7747..8c4d64327 100644 --- a/v0.5.0-rc1/reference/eval_expr_with_msg.html +++ b/v0.5.0-rc1/reference/eval_expr_with_msg.html @@ -1,12 +1,28 @@ - - + + + + + +Evaluate expression with meaningful message — eval_expr_with_msg • teal.slice +Evaluate expression with meaningful message — eval_expr_with_msg • teal.slice + + + + + + + + + + Skip to contents @@ -22,7 +38,8 @@ + +
    @@ -89,39 +111,46 @@
    -

    Usage

    +

    Usage +

    eval_expr_with_msg(expr, env)
    -

    Arguments

    -
    expr
    +

    Arguments +

    +
    +
    expr

    (language)

    env

    (environment) where expression is evaluated.

    -
    + +
    -

    Value

    +

    Value +

    NULL, invisibly.

    + + + + - - + + diff --git a/v0.5.0-rc1/reference/fetch_bs_color.html b/v0.5.0-rc1/reference/fetch_bs_color.html index 2b020ed9a..ae2a4ce61 100644 --- a/v0.5.0-rc1/reference/fetch_bs_color.html +++ b/v0.5.0-rc1/reference/fetch_bs_color.html @@ -1,8 +1,24 @@ - -Get hex code of the current Bootstrap theme color. — fetch_bs_color • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -83,13 +105,16 @@
    -

    Usage

    +

    Usage +

    fetch_bs_color(color, alpha = NULL)
    -

    Arguments

    -
    color
    +

    Arguments +

    +
    +
    color

    (character(1)) naming one of the available theme colors

    @@ -98,16 +123,19 @@

    Arguments -

    Value

    +

    Value +

    Named character(1) containing a hexadecimal color representation.

    -

    Examples

    +

    Examples +

    fetch_bs_color <- getFromNamespace("fetch_bs_color", "teal.slice")
     fetch_bs_color("primary")
     #> [1] "#0d6efd"
    @@ -119,17 +147,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/v0.5.0-rc1/reference/filter_state_api.html b/v0.5.0-rc1/reference/filter_state_api.html index 5132a1b22..c7daf9902 100644 --- a/v0.5.0-rc1/reference/filter_state_api.html +++ b/v0.5.0-rc1/reference/filter_state_api.html @@ -1,10 +1,26 @@ - -Managing FilteredData states — filter_state_api • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + @@ -86,7 +108,8 @@
    -

    Usage

    +

    Usage +

    set_filter_state(datasets, filter)
     
     get_filter_state(datasets)
    @@ -97,11 +120,15 @@ 

    Usage

    -

    Arguments

    -
    datasets
    -

    (FilteredData) +

    Arguments +

    +
    +
    datasets
    +
    +

    (FilteredData) object to store filter state and filtered datasets, shared across modules

    -

    see FilteredData for details

    +

    see FilteredData for details

    +
    filter
    @@ -113,22 +140,28 @@

    Arguments -

    Value

    +

    Value +

    -
    • set_*, remove_* and clear_filter_state return NULL invisibly

    • +
        +
      • set_*, remove_* and clear_filter_state return NULL invisibly

      • get_filter_state returns a named teal_slices object containing a teal_slice for every existing FilterState

      • -
    + +
    -

    See also

    +

    See also +

    -

    Examples

    +

    Examples +

    datasets <- init_filtered_data(list(iris = iris, mtcars = mtcars))
     fs <- teal_slices(
       teal_slice(dataname = "iris", varname = "Species", selected = c("setosa", "versicolor")),
    @@ -326,17 +359,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/v0.5.0-rc1/reference/format_time.html b/v0.5.0-rc1/reference/format_time.html index b96940d21..fd5dd846e 100644 --- a/v0.5.0-rc1/reference/format_time.html +++ b/v0.5.0-rc1/reference/format_time.html @@ -1,8 +1,24 @@ - -Format POSIXt for storage — format_time • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -83,40 +105,48 @@
    -

    Usage

    +

    Usage +

    format_time(x)
    -

    Arguments

    -
    x
    +

    Arguments +

    +
    +
    x

    (POSIXt) vector of date time values or anything else

    -
    + +
    -

    Value

    +

    Value +

    If x is of class POSIXt, a character vector, otherwise x itself.

    -

    Details

    +

    Details +

    Date times are stored as string representations expressed in the UTC time zone. The storage format is YYYY-MM-DD HH:MM:SS.

    + + + + - - + + diff --git a/v0.5.0-rc1/reference/get_default_slice_id.html b/v0.5.0-rc1/reference/get_default_slice_id.html index 0840dab33..c664a5c60 100644 --- a/v0.5.0-rc1/reference/get_default_slice_id.html +++ b/v0.5.0-rc1/reference/get_default_slice_id.html @@ -1,8 +1,24 @@ - -Default teal_slice id — get_default_slice_id • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -83,48 +105,59 @@
    -

    Usage

    +

    Usage +

    get_default_slice_id(x)
    -

    Arguments

    -
    x
    +

    Arguments +

    +
    +
    x

    (teal_slice or list)

    -
    + +
    -

    Value

    +

    Value +

    (character(1)) id for a teal_slice object.

    -

    Details

    +

    Details +

    Function returns a default id for a teal_slice object which needs to be distinct from other teal_slice objects created for any FilterStates object. Returned id can be treated as a location of -a vector on which FilterState is built:

    • for a data.frame id concatenates dataname and varname.

    • +a vector on which FilterState is built:

      +
        +
      • for a data.frame id concatenates dataname and varname.

      • for a MultiAssayExperiment id concatenates dataname, varname, experiment and arg, so that one can add teal_slice for a varname which exists in multiple SummarizedExperiments or exists in both colData and rowData of given experiment. For such a vector teal.slice doesn't allow to activate more than one filters. In case of teal_slice_expr id is mandatory and must be unique.

      • -
    + + + + + + - - + + diff --git a/v0.5.0-rc1/reference/get_filter_expr.html b/v0.5.0-rc1/reference/get_filter_expr.html index f7e6c9e7f..cdc96cf95 100644 --- a/v0.5.0-rc1/reference/get_filter_expr.html +++ b/v0.5.0-rc1/reference/get_filter_expr.html @@ -1,10 +1,26 @@ - -Gets filter expression for multiple datanames taking into account its order. — get_filter_expr • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + @@ -86,39 +108,46 @@
    -

    Usage

    +

    Usage +

    get_filter_expr(datasets, datanames = datasets$datanames())
    -

    Arguments

    -
    datasets
    +

    Arguments +

    +
    +
    datasets

    (FilteredData)

    datanames

    (character) vector of dataset names

    -
    + +
    -

    Value

    +

    Value +

    A character string containing all subset expressions.

    + + + + - - + + diff --git a/v0.5.0-rc1/reference/get_supported_filter_varnames.html b/v0.5.0-rc1/reference/get_supported_filter_varnames.html index 04bd828c1..92cf72947 100644 --- a/v0.5.0-rc1/reference/get_supported_filter_varnames.html +++ b/v0.5.0-rc1/reference/get_supported_filter_varnames.html @@ -1,10 +1,26 @@ - -Gets supported filterable variable names — get_supported_filter_varnames • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + @@ -86,25 +108,31 @@
    -

    Usage

    +

    Usage +

    get_supported_filter_varnames(data)
    -

    Arguments

    -
    data
    +

    Arguments +

    +
    +
    data

    the R object containing elements which class can be checked through vapply or apply.

    -
    + +
    -

    Value

    +

    Value +

    character vector of variable names.

    -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     get_supported_filter_varnames <- getFromNamespace("get_supported_filter_varnames", "teal.slice")
     
    @@ -120,17 +148,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/v0.5.0-rc1/reference/include_css_files.html b/v0.5.0-rc1/reference/include_css_files.html index 1d48a7d3e..34cfcca3a 100644 --- a/v0.5.0-rc1/reference/include_css_files.html +++ b/v0.5.0-rc1/reference/include_css_files.html @@ -1,12 +1,28 @@ - - + + + + + +Include CSS files from /inst/css/ package directory to application header — include_css_files • teal.slice +Include CSS files from /inst/css/ package directory to application header — include_css_files • teal.slice + + + + + + + + + + Skip to contents @@ -22,7 +38,8 @@ + + @@ -89,35 +111,42 @@
    -

    Usage

    +

    Usage +

    include_css_files(pattern = "*")
    -

    Arguments

    -
    pattern
    +

    Arguments +

    +
    +
    pattern

    (character) pattern of files to be included

    -
    + +
    -

    Value

    +

    Value +

    HTML code that includes CSS files

    + + + + - - + + diff --git a/v0.5.0-rc1/reference/include_js_files.html b/v0.5.0-rc1/reference/include_js_files.html index fd269a370..d0d1e32cf 100644 --- a/v0.5.0-rc1/reference/include_js_files.html +++ b/v0.5.0-rc1/reference/include_js_files.html @@ -1,12 +1,28 @@ - - + + + + + +Include JS files from /inst/js/ package directory to application header — include_js_files • teal.slice +Include JS files from /inst/js/ package directory to application header — include_js_files • teal.slice + + + + + + + + + + Skip to contents @@ -22,7 +38,8 @@ + + @@ -89,39 +111,46 @@
    -

    Usage

    +

    Usage +

    include_js_files(pattern)
    -

    Arguments

    -
    pattern
    +

    Arguments +

    +
    +
    pattern

    (character) pattern of files to be included, passed to system.file

    except

    (character) vector of basename filenames to be excluded

    -
    + +
    -

    Value

    +

    Value +

    HTML code that includes JS files

    + + + + - - + + diff --git a/v0.5.0-rc1/reference/index.html b/v0.5.0-rc1/reference/index.html index fbd686bb5..cbc44491b 100644 --- a/v0.5.0-rc1/reference/index.html +++ b/v0.5.0-rc1/reference/index.html @@ -1,8 +1,22 @@ - -Function reference • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -77,96 +97,132 @@
    -

    teal filter-panel API

    +

    +teal filter-panel API +

    -

    Functions used initialize filter-panel and to modify its states.

    +

    +

    Functions used initialize filter-panel and to modify its states.

    -
    +
    +
    -
    +
    +
    init_filtered_data()
    -
    Initialize FilteredData
    -
    +
    Initialize FilteredData +
    +
    +
    +
    set_filter_state() get_filter_state() remove_filter_state() clear_filter_states()
    Managing FilteredData states
    -
    +
    +
    +
    get_filter_expr()
    Gets filter expression for multiple datanames taking into account its order.
    -
    +
    +
    +
    teal_slice() is.teal_slice() as.teal_slice() as.list(<teal_slice>) format(<teal_slice>) print(<teal_slice>)
    Specify single filter
    -
    +
    +
    +
    teal_slices() is.teal_slices() as.teal_slices() as.list(<teal_slices>) `[`(<teal_slices>) c(<teal_slices>) format(<teal_slices>) print(<teal_slices>)
    Complete filter specification
    -
    -

    For developers

    + +
    +
    +

    For developers +

    -

    Abstract and concrete classes used to build teal functionality.

    +

    +

    Abstract and concrete classes used to build teal functionality.

    -
    +
    +
    -

    R6 Classes

    -

    Abstract and concrete classes used to build teal functionality.

    +

    R6 Classes +

    +

    +

    Abstract and concrete classes used to build teal functionality.

    -
    +
    +
    -
    +
    +
    FilteredData
    Class to encapsulate filtered datasets
    -
    +
    +
    +
    FilteredDataset
    -
    FilteredDataset R6 class
    -
    +
    +FilteredDataset R6 class
    +
    +
    +
    FilterPanelAPI
    Class to encapsulate the API of the filter panel of a teal app
    -
    +
    +
    +
    DataframeFilteredDataset
    The DataframeFilteredDataset R6 class
    -
    +
    +
    +
    MAEFilteredDataset
    -
    MAEFilteredDataset R6 class
    -
    +
    +MAEFilteredDataset R6 class
    + + + + + + - - + + diff --git a/v0.5.0-rc1/reference/init_filter_state.html b/v0.5.0-rc1/reference/init_filter_state.html index dcaf889a9..f46a8ab61 100644 --- a/v0.5.0-rc1/reference/init_filter_state.html +++ b/v0.5.0-rc1/reference/init_filter_state.html @@ -1,8 +1,24 @@ - -Initialize FilterState — init_filter_state • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,7 +106,8 @@
    -

    Usage

    +

    Usage +

    init_filter_state(
       x,
       x_reactive = reactive(NULL),
    @@ -93,8 +117,10 @@ 

    Usage

    + +
    -

    Value

    +

    Value +

    FilterState object

    -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     init_filter_state <- getFromNamespace("init_filter_state", "teal.slice")
     
    @@ -172,17 +205,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/v0.5.0-rc1/reference/init_filter_state_expr.html b/v0.5.0-rc1/reference/init_filter_state_expr.html index 9d95c8d3c..225f77fe5 100644 --- a/v0.5.0-rc1/reference/init_filter_state_expr.html +++ b/v0.5.0-rc1/reference/init_filter_state_expr.html @@ -1,8 +1,24 @@ - -Initialize a FilterStateExpr object — init_filter_state_expr • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -83,36 +105,43 @@
    -

    Usage

    +

    Usage +

    init_filter_state_expr(slice)
    -

    Arguments

    -
    slice
    +

    Arguments +

    +
    +
    slice

    (teal_slice_expr) specifying this filter state.

    -
    + +
    -

    Value

    +

    Value +

    FilterStateExpr object

    + + + + - - + + diff --git a/v0.5.0-rc1/reference/init_filter_states.html b/v0.5.0-rc1/reference/init_filter_states.html index 8af0dbd3f..7b2c183dd 100644 --- a/v0.5.0-rc1/reference/init_filter_states.html +++ b/v0.5.0-rc1/reference/init_filter_states.html @@ -1,8 +1,24 @@ - -Initialize FilterStates object — init_filter_states • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -83,7 +105,8 @@
    -

    Usage

    +

    Usage +

    init_filter_states(
       data,
       data_reactive = reactive(NULL),
    @@ -94,8 +117,10 @@ 

    Usage

    -

    Arguments

    -
    data
    +

    Arguments +

    +
    +
    data

    (data.frame or MultiAssayExperiment or SummarizedExperiment or matrix) object to subset.

    @@ -123,16 +148,19 @@

    Arguments -

    Value

    +

    Value +

    Object of class FilterStates.

    -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     init_filter_states <- getFromNamespace("init_filter_states", "teal.slice")
     
    @@ -171,17 +199,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/v0.5.0-rc1/reference/init_filtered_data.html b/v0.5.0-rc1/reference/init_filtered_data.html index c32b9e4f7..0b38144ca 100644 --- a/v0.5.0-rc1/reference/init_filtered_data.html +++ b/v0.5.0-rc1/reference/init_filtered_data.html @@ -1,8 +1,24 @@ - -Initialize FilteredData — init_filtered_data • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,13 +106,16 @@
    -

    Usage

    +

    Usage +

    init_filtered_data(x, join_keys = teal.data::join_keys(), code, check)
    -

    Arguments

    -
    x
    +

    Arguments +

    +
    +
    x

    (named list) of datasets.

    @@ -104,16 +130,19 @@

    Arguments[Deprecated]

    -

    + +
    -

    Value

    +

    Value +

    Object of class FilteredData.

    -

    Examples

    +

    Examples +

    datasets <- init_filtered_data(list(iris = iris, mtcars = mtcars))
     datasets
     #> FilteredData:
    @@ -132,17 +161,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/v0.5.0-rc1/reference/init_filtered_dataset.html b/v0.5.0-rc1/reference/init_filtered_dataset.html index 86c66701f..737007359 100644 --- a/v0.5.0-rc1/reference/init_filtered_dataset.html +++ b/v0.5.0-rc1/reference/init_filtered_dataset.html @@ -1,8 +1,24 @@ - -Initialize FilteredDataset — init_filtered_dataset • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,7 +106,8 @@
    -

    Usage

    +

    Usage +

    init_filtered_dataset(
       dataset,
       dataname,
    @@ -96,8 +120,10 @@ 

    Usage

    -

    Arguments

    -
    dataset
    +

    Arguments +

    +
    +
    dataset

    any object

    @@ -133,15 +159,18 @@

    Arguments -

    Value

    +

    Value +

    Object of class FilteredDataset.

    -

    Warning

    +

    Warning +

    This function is exported to allow other packages to extend teal.slice but it is treated as internal. @@ -150,7 +179,8 @@

    Warning
    -

    Examples

    +

    Examples +

    # DataframeFilteredDataset example
     library(shiny)
     
    @@ -202,17 +232,19 @@ 

    Examples

    + +

    + +
    - - + + diff --git a/v0.5.0-rc1/reference/jsonify.html b/v0.5.0-rc1/reference/jsonify.html index aca0d6688..bd058b5b0 100644 --- a/v0.5.0-rc1/reference/jsonify.html +++ b/v0.5.0-rc1/reference/jsonify.html @@ -1,12 +1,28 @@ - - + + + + + +Convert a list to a justified JSON string — jsonify • teal.slice +Convert a list to a justified JSON string — jsonify • teal.slice + + + + + + + + + + Skip to contents @@ -22,7 +38,8 @@ + +
    @@ -89,39 +111,46 @@
    -

    Usage

    +

    Usage +

    jsonify(x, trim_lines)
    -

    Arguments

    -
    x
    +

    Arguments +

    +
    +
    x

    (list), possibly recursive, obtained from teal_slice or teal_slices.

    trim_lines

    (logical(1)) flag specifying whether to trim lines of the JSON string.

    -
    + +
    -

    Value

    +

    Value +

    A JSON string representation of the input list.

    + + + + - - + + diff --git a/v0.5.0-rc1/reference/justify_json.html b/v0.5.0-rc1/reference/justify_json.html index 838273ae8..741f68f0f 100644 --- a/v0.5.0-rc1/reference/justify_json.html +++ b/v0.5.0-rc1/reference/justify_json.html @@ -1,10 +1,26 @@ - -Justify colons in JSON string — justify_json • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + @@ -86,35 +108,42 @@
    -

    Usage

    +

    Usage +

    justify_json(json)
    -

    Arguments

    -
    json
    +

    Arguments +

    +
    +
    json

    (character(1)) a JSON string.

    -
    + +
    -

    Value

    +

    Value +

    A list of character strings, which can be collapsed into a JSON string.

    + + + + - - + + diff --git a/v0.5.0-rc1/reference/make_c_call.html b/v0.5.0-rc1/reference/make_c_call.html index be426b701..a965317b9 100644 --- a/v0.5.0-rc1/reference/make_c_call.html +++ b/v0.5.0-rc1/reference/make_c_call.html @@ -1,10 +1,26 @@ - -Build concatenating call — make_c_call • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + @@ -86,25 +108,31 @@
    -

    Usage

    +

    Usage +

    make_c_call(choices)
    -

    Arguments

    -
    choices
    +

    Arguments +

    +
    +
    choices

    A vector of values.

    -
    + +
    -

    Value

    +

    Value +

    A c call.

    -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     make_c_call <- getFromNamespace("make_c_call", "teal.slice")
     make_c_call(1:3)
    @@ -115,17 +143,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/v0.5.0-rc1/reference/make_count_text.html b/v0.5.0-rc1/reference/make_count_text.html index e51908757..4c519caf8 100644 --- a/v0.5.0-rc1/reference/make_count_text.html +++ b/v0.5.0-rc1/reference/make_count_text.html @@ -1,16 +1,32 @@ - - + + + + + +Build count text — make_count_text • teal.slice +Build count text — make_count_text • teal.slice + + + + + + + + + + Skip to contents @@ -26,7 +42,8 @@ + + @@ -87,18 +109,24 @@
    -

    Returns a text label describing filtered counts. The text is composed in the following way:

    • when countnow is not NULL: <label> (<countnow>/<countmax>)

    • +

      Returns a text label describing filtered counts. The text is composed in the following way:

      +
        +
      • when countnow is not NULL: <label> (<countnow>/<countmax>)

      • when countnow is NULL: <label> (<countmax>)

      • -
    + +
    -

    Usage

    +

    Usage +

    make_count_text(label, countmax, countnow = NULL)
    -

    Arguments

    -
    label
    +

    Arguments +

    +
    +
    label

    (character(1)) Text displayed before counts.

    @@ -109,26 +137,30 @@

    Arguments -

    Value

    +

    Value +

    A character string.

    + + + + - - + + diff --git a/v0.5.0-rc1/reference/setdiff_teal_slices.html b/v0.5.0-rc1/reference/setdiff_teal_slices.html index 340f2351e..2827e98ea 100644 --- a/v0.5.0-rc1/reference/setdiff_teal_slices.html +++ b/v0.5.0-rc1/reference/setdiff_teal_slices.html @@ -1,8 +1,24 @@ - -setdiff method for teal_slices — setdiff_teal_slices • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,18 +107,23 @@
    -

    Usage

    +

    Usage +

    setdiff_teal_slices(x, y)
    -

    Arguments

    -
    x, y
    +

    Arguments +

    +
    +
    x, y

    (teal_slices)

    -
    + +
    -

    Value

    +

    Value +

    teal_slices

    @@ -103,17 +132,19 @@

    Value

    + + + + - - + + diff --git a/v0.5.0-rc1/reference/teal.slice-package.html b/v0.5.0-rc1/reference/teal.slice-package.html index 392c7051c..9e15949db 100644 --- a/v0.5.0-rc1/reference/teal.slice-package.html +++ b/v0.5.0-rc1/reference/teal.slice-package.html @@ -1,8 +1,24 @@ - -teal.slice: Interactive Exploration of Clinical Trials Data — teal.slice-package • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,16 +107,24 @@
    -

    Author

    +

    Author +

    Maintainer: Dawid Kaledkowski dawid.kaledkowski@roche.com

    -

    Authors:

    + +
    + + + + - - + + diff --git a/v0.5.0-rc1/reference/teal_slice.html b/v0.5.0-rc1/reference/teal_slice.html index 79b47c258..a5b0bc665 100644 --- a/v0.5.0-rc1/reference/teal_slice.html +++ b/v0.5.0-rc1/reference/teal_slice.html @@ -1,8 +1,24 @@ - -Specify single filter — teal_slice • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -83,7 +105,8 @@
    -

    Usage

    +

    Usage +

    teal_slice(
       dataname,
       varname,
    @@ -115,8 +138,10 @@ 

    Usage

    -

    Arguments

    -
    dataname
    +

    Arguments +

    +
    +
    dataname

    (character(1)) name of data set

    @@ -189,16 +214,19 @@

    Arguments -

    Value

    +

    Value +

    A teal.slice object. Depending on whether varname or expr was specified, the resulting teal_slice also receives class teal_slice_var or teal_slice_expr, respectively.

    -

    Details

    +

    Details +

    teal_slice object fully describes filter state and can be used to create, modify, and delete a filter state. A teal_slice contains a number of common fields (all named arguments of teal_slice), some of which are mandatory, but only @@ -207,7 +235,9 @@

    DetailsSetting any of the other values to NULL means that those properties will not be modified (when setting an existing state) or that they will be determined by data (when creating new a new one). Entire object is FilterState class member and can be accessed with FilterState$get_state().

    -

    A teal_slice can come in two flavors:

    1. teal_slice_var - +

      A teal_slice can come in two flavors:

      +
        +
      1. teal_slice_var - this describes a typical interactive filter that refers to a single variable, managed by the FilterState class. This class is created when varname is specified. The object retains all fields specified in the call. id can be created by default and need not be specified.

      2. @@ -217,7 +247,8 @@

        Detailsexpr is specified. dataname and anchored are retained, fixed is set to TRUE, id becomes mandatory, title remains optional, while other arguments are disregarded.

        -

      A teal_slice can be passed FilterState/FilterStateExpr constructors to instantiate an object. +

    +

    A teal_slice can be passed FilterState/FilterStateExpr constructors to instantiate an object. It can also be passed to FilterState$set_state to modify the state. However, once a FilterState is created, only the mutable features can be set with a teal_slice: selected, keep_na and keep_inf.

    @@ -229,11 +260,13 @@

    DetailsFilterState instantiated with anchored = TRUE cannot be removed.

    -

    Note

    +

    Note +

    Date time objects of POSIX*t classes are printed as strings after converting to UTC timezone.

    -

    Filters in SumarizedExperiment and MultiAssayExperiment objects

    +

    Filters in SumarizedExperiment and MultiAssayExperiment objects +

    @@ -247,12 +280,14 @@

    Filters in order to determine whether the filter refers to the SE's rowData or colData.

    -

    See also

    +

    See also +

    -

    Examples

    +

    Examples +

    x1 <- teal_slice(
       dataname = "data",
       id = "Female adults",
    @@ -329,17 +364,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/v0.5.0-rc1/reference/teal_slices.html b/v0.5.0-rc1/reference/teal_slices.html index 64b019bd1..da2868008 100644 --- a/v0.5.0-rc1/reference/teal_slices.html +++ b/v0.5.0-rc1/reference/teal_slices.html @@ -1,8 +1,24 @@ - -Complete filter specification — teal_slices • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -83,7 +105,8 @@
    -

    Usage

    +

    Usage +

    teal_slices(
       ...,
       exclude_varnames = NULL,
    @@ -113,8 +136,10 @@ 

    Usage

    -

    Arguments

    -
    ...
    +

    Arguments +

    +
    +
    ...

    any number of teal_slice objects. For print and format, additional arguments passed to other functions.

    @@ -126,15 +151,19 @@

    Arguments[Experimental] +
    +

    [Experimental] This is a new feature. Do kindly share your opinions on teal.slice's GitHub repository.

    (character(1)) string specifying how observations are tallied by these filter states. -Possible options:

    • "none" (default) to have counts of single FilterState to show unfiltered number only.

    • +Possible options:

      +
        +
      • "none" (default) to have counts of single FilterState to show unfiltered number only.

      • "all" to have counts of single FilterState to show number of observation in filtered and unfiltered dataset. Note, that issues were reported when using this option with MultiAssayExperiment. Please make sure that adding new filters doesn't fail on target platform before deploying for production.

      • -
    + +
    allow_add
    @@ -160,15 +189,18 @@

    Arguments -

    Value

    +

    Value +

    teal_slices, which is an unnamed list of teal_slice objects.

    -

    Details

    +

    Details +

    teal_slices() collates multiple teal_slice objects into a teal_slices object, a complete filter specification. This is used by all classes above FilterState as well as filter_panel_api wrapper functions. @@ -179,15 +211,19 @@

    Detailsteal_slices.

    -

    See also

    +

    See also +

    -
    • teal_slice for creating constituent elements of teal_slices

    • +
        +
      • teal_slice for creating constituent elements of teal_slices

      • teal::slices_store for robust utilities for saving and loading teal_slices in JSON format

      • -
    + +
    -

    Examples

    +

    Examples +

    filter_1 <- teal_slice(
       dataname = "dataname1",
       varname = "varname1",
    @@ -400,17 +436,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/v0.5.0-rc1/reference/to_json.html b/v0.5.0-rc1/reference/to_json.html index 11bb53bc6..39ea30858 100644 --- a/v0.5.0-rc1/reference/to_json.html +++ b/v0.5.0-rc1/reference/to_json.html @@ -1,12 +1,28 @@ - - + + + + + +Converts a list to a JSON string — to_json • teal.slice +Converts a list to a JSON string — to_json • teal.slice + + + + + + + + + + Skip to contents @@ -22,7 +38,8 @@ + + @@ -89,35 +111,42 @@
    -

    Usage

    +

    Usage +

    to_json(x)
    -

    Arguments

    -
    x
    +

    Arguments +

    +
    +
    x

    (list) representation of teal_slices object.

    -
    + +
    -

    Value

    +

    Value +

    A JSON string.

    + + + + - - + + diff --git a/v0.5.0-rc1/reference/toggle_button.html b/v0.5.0-rc1/reference/toggle_button.html index eb6848693..401104794 100644 --- a/v0.5.0-rc1/reference/toggle_button.html +++ b/v0.5.0-rc1/reference/toggle_button.html @@ -1,8 +1,24 @@ - -Toggle button properties. — toggle_button • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -83,15 +105,18 @@
    -

    Usage

    +

    Usage +

    toggle_icon(input_id, icons, one_way = FALSE)
     
     toggle_title(input_id, titles, one_way = FALSE)
    -

    Arguments

    -
    input_id
    +

    Arguments +

    +
    +
    input_id

    (character(1)) (name-spaced) id of the button

    @@ -104,15 +129,18 @@

    Arguments -

    Value

    +

    Value +

    NULL, invisibly.

    -

    Details

    +

    Details +

    Wrapper functions that use shinyjs::runjs to change button properties in response to events, typically clicking those very buttons. shiny's actionButton and actionLink create <a> tags, @@ -123,7 +151,8 @@

    Details
    -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     toggle_icon <- getFromNamespace("toggle_icon", "teal.slice")
     
    @@ -178,17 +207,19 @@ 

    Examples

    + +

    + + - - + + diff --git a/v0.5.0-rc1/reference/topological_sort.html b/v0.5.0-rc1/reference/topological_sort.html index d9806e391..728c1363d 100644 --- a/v0.5.0-rc1/reference/topological_sort.html +++ b/v0.5.0-rc1/reference/topological_sort.html @@ -1,10 +1,26 @@ - -Topological graph sort — topological_sort • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + @@ -86,23 +108,29 @@
    -

    Usage

    +

    Usage +

    topological_sort(graph)
    -

    Arguments

    -
    graph
    +

    Arguments +

    +
    +
    graph

    (named list) with node vector elements

    -
    + +
    -

    Details

    +

    Details +

    Implementation of Kahn algorithm with a modification to maintain the order of input elements.

    -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     topological_sort <- getFromNamespace("topological_sort", "teal.slice")
     
    @@ -148,17 +176,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/v0.5.0-rc1/reference/trim_lines_json.html b/v0.5.0-rc1/reference/trim_lines_json.html index 9acaec54a..8ae3d6627 100644 --- a/v0.5.0-rc1/reference/trim_lines_json.html +++ b/v0.5.0-rc1/reference/trim_lines_json.html @@ -1,10 +1,26 @@ - -Trim lines in JSON string — trim_lines_json • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + @@ -86,35 +108,42 @@
    -

    Usage

    +

    Usage +

    trim_lines_json(x)
    -

    Arguments

    -
    x
    +

    Arguments +

    +
    +
    x

    (character)

    -
    + +
    -

    Value

    +

    Value +

    A character string trimmed after a certain hard-coded number of characters in the value portion.

    + + + + - - + + diff --git a/v0.5.0-rc1/reference/variable_types.html b/v0.5.0-rc1/reference/variable_types.html index 946b00ba9..8bdc6d408 100644 --- a/v0.5.0-rc1/reference/variable_types.html +++ b/v0.5.0-rc1/reference/variable_types.html @@ -1,8 +1,24 @@ - -Get classes of selected columns from dataset — variable_types • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -83,13 +105,16 @@
    -

    Usage

    +

    Usage +

    variable_types(data, columns = NULL)
    -

    Arguments

    -
    data
    +

    Arguments +

    +
    +
    data

    (data.frame or DataFrame or matrix) Object in which to determine variable types.

    @@ -97,16 +122,19 @@

    Arguments -

    Value

    +

    Value +

    Character vector of classes of columns from provided data.

    -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     variable_types <- getFromNamespace("variable_types", "teal.slice")
     
    @@ -142,17 +170,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/v0.5.0-rc2/404.html b/v0.5.0-rc2/404.html index dc08a432f..fcdbaecd5 100644 --- a/v0.5.0-rc2/404.html +++ b/v0.5.0-rc2/404.html @@ -1,5 +1,4 @@ - - + @@ -50,22 +49,7 @@ - - + - + + diff --git a/v0.5.0-rc2/CODE_OF_CONDUCT.html b/v0.5.0-rc2/CODE_OF_CONDUCT.html index 48b600d38..708fe1e78 100644 --- a/v0.5.0-rc2/CODE_OF_CONDUCT.html +++ b/v0.5.0-rc2/CODE_OF_CONDUCT.html @@ -1,8 +1,22 @@ - -Contributor Covenant Code of Conduct • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -80,65 +100,80 @@
    -

    Our Pledge

    +

    Our Pledge +

    We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.

    We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.

    -

    Our Standards

    +

    Our Standards +

    Examples of behavior that contributes to a positive environment for our community include:

    -
    • Demonstrating empathy and kindness toward other people
    • +
        +
      • Demonstrating empathy and kindness toward other people
      • Being respectful of differing opinions, viewpoints, and experiences
      • Giving and gracefully accepting constructive feedback
      • Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
      • Focusing on what is best not just for us as individuals, but for the overall community
      • -

      Examples of unacceptable behavior include:

      -
      • The use of sexualized language or imagery, and sexual attention or advances of any kind
      • +
      +

      Examples of unacceptable behavior include:

      +
        +
      • The use of sexualized language or imagery, and sexual attention or advances of any kind
      • Trolling, insulting or derogatory comments, and personal or political attacks
      • Public or private harassment
      • Publishing others’ private information, such as a physical or email address, without their explicit permission
      • Other conduct which could reasonably be considered inappropriate in a professional setting
      • -
    + +
    -

    Enforcement Responsibilities

    +

    Enforcement Responsibilities +

    Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.

    Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.

    -

    Scope

    +

    Scope +

    This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.

    -

    Enforcement

    +

    Enforcement +

    Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [INSERT CONTACT METHOD]. All complaints will be reviewed and investigated promptly and fairly.

    All community leaders are obligated to respect the privacy and security of the reporter of any incident.

    -

    Enforcement Guidelines

    +

    Enforcement Guidelines +

    Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:

    -

    1. Correction

    +

    1. Correction +

    Community Impact: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.

    Consequence: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.

    -

    2. Warning

    +

    2. Warning +

    Community Impact: A violation through a single incident or series of actions.

    Consequence: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.

    -

    3. Temporary Ban

    +

    3. Temporary Ban +

    Community Impact: A serious violation of community standards, including sustained inappropriate behavior.

    Consequence: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.

    -

    4. Permanent Ban

    +

    4. Permanent Ban +

    Community Impact: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.

    Consequence: A permanent ban from any sort of public interaction within the community.

    -

    Attribution

    +

    Attribution +

    This Code of Conduct is adapted from the Contributor Covenant, version 2.1, available at https://www.contributor-covenant.org/version/2/1/code_of_conduct.html.

    Community Impact Guidelines were inspired by Mozilla’s code of conduct enforcement ladder.

    For answers to common questions about this code of conduct, see the FAQ at https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.

    @@ -146,17 +181,19 @@

    Attribution

    + + + + - - + + diff --git a/v0.5.0-rc2/CONTRIBUTING.html b/v0.5.0-rc2/CONTRIBUTING.html index d45c1dd7e..88ea8a9c8 100644 --- a/v0.5.0-rc2/CONTRIBUTING.html +++ b/v0.5.0-rc2/CONTRIBUTING.html @@ -1,8 +1,22 @@ - -Contribution Guidelines • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -82,7 +102,8 @@

    🙏 Thank you for taking the time to contribute!

    Your input is deeply valued, whether an issue, a pull request, or even feedback, regardless of size, content or scope.

    -

    Table of contents

    +

    Table of contents +

    👶 Getting started

    📔 Code of Conduct

    🗃 License

    @@ -93,38 +114,47 @@

    Table of contents❓ Questions

    -

    Getting started

    +

    Getting started +

    Please refer the project documentation for a brief introduction. Please also see other articles within the project documentation for additional information.

    -

    Code of Conduct

    +

    Code of Conduct +

    A Code of Conduct governs this project. Participants and contributors are expected to follow the rules outlined therein.

    -

    License

    +

    License +

    All your contributions will be covered by this project’s license.

    -

    Issues

    +

    Issues +

    We use GitHub to track issues, feature requests, and bugs. Before submitting a new issue, please check if the issue has already been reported. If the issue already exists, please upvote the existing issue 👍.

    For new feature requests, please elaborate on the context and the benefit the feature will have for users, developers, or other relevant personas.

    -

    Pull requests

    +

    Pull requests +

    -

    GitHub Flow

    +

    GitHub Flow +

    This repository uses the GitHub Flow model for collaboration. To submit a pull request:

    -
    1. +
        +
      1. Create a branch

        Please see the branch naming convention below. If you don’t have write access to this repository, please fork it.

      2. Make changes

        Make sure your code

        -
        • passes all checks imposed by GitHub Actions
        • +
            +
          • passes all checks imposed by GitHub Actions
          • is well documented
          • is well tested with unit tests sufficiently covering the changes introduced
          • -
          +
        +
      3. Create a pull request (PR)

        In the pull request description, please link the relevant issue (if any), provide a detailed description of the change, and include any assumptions.

        @@ -138,76 +168,93 @@

        GitHub Flow -

        Branch naming convention

        +

        Branch naming convention +

        Suppose your changes are related to a current issue in the current project; please name your branch as follows: <issue_id>_<short_description>. Please use underscore (_) as a delimiter for word separation. For example, 420_fix_ui_bug would be a suitable branch name if your change is resolving and UI-related bug reported in issue number 420 in the current project.

        If your change affects multiple repositories, please name your branches as follows: <issue_id>_<issue_repo>_<short description>. For example, 69_awesomeproject_fix_spelling_error would reference issue 69 reported in project awesomeproject and aims to resolve one or more spelling errors in multiple (likely related) repositories.

    monorepo and staged.dependencies -

    + +

    Sometimes you might need to change upstream dependent package(s) to be able to submit a meaningful change. We are using staged.dependencies functionality to simulate a monorepo behavior. The dependency configuration is already specified in this project’s staged_dependencies.yaml file. You need to name the feature branches appropriately. This is the only exception from the branch naming convention described above.

    Please refer to the staged.dependencies package documentation for more details.

    -

    Coding guidelines

    +

    Coding guidelines +

    This repository follows some unified processes and standards adopted by its maintainers to ensure software development is carried out consistently within teams and cohesively across other repositories.

    -

    Style guide

    +

    Style guide +

    This repository follows the standard tidyverse style guide and uses lintr for lint checks. Customized lint configurations are available in this repository’s .lintr file.

    -

    Dependency management

    +

    Dependency management +

    Lightweight is the right weight. This repository follows tinyverse recommendations of limiting dependencies to minimum.

    -

    Dependency version management

    +

    Dependency version management +

    If the code is not compatible with all (!) historical versions of a given dependency package, it is required to specify minimal version in the DESCRIPTION file. In particular: if the development version requires (imports) the development version of another package - it is required to put abc (>= 1.2.3.9000).

    - +
    -

    R & package versions

    +

    R & package versions +

    We continuously test our packages against the newest R version along with the most recent dependencies from CRAN and BioConductor. We recommend that your working environment is also set up in the same way. You can find the details about the R version and packages used in the R CMD check GitHub Action execution log - there is a step that prints out the R sessionInfo().

    If you discover bugs on older R versions or with an older set of dependencies, please create the relevant bug reports.

    -

    pre-commit

    +

    +pre-commit +

    We highly recommend that you use the pre-commit tool combined with R hooks for pre-commit to execute some of the checks before committing and pushing your changes.

    Pre-commit hooks are already available in this repository’s .pre-commit-config.yaml file.

    -

    Recognition model

    +

    Recognition model +

    As mentioned previously, all contributions are deeply valued and appreciated. While all contribution data is available as part of the repository insights, to recognize a significant contribution and hence add the contributor to the package authors list, the following rules are enforced:

    -
    • Minimum 5% of lines of code authored* (determined by git blame query) OR
    • +
        +
      • Minimum 5% of lines of code authored* (determined by git blame query) OR
      • Being at the top 5 contributors in terms of number of commits OR lines added OR lines removed*
      • -

      *Excluding auto-generated code, including but not limited to roxygen comments or renv.lock files.

      +
    +

    *Excluding auto-generated code, including but not limited to roxygen comments or renv.lock files.

    The package maintainer also reserves the right to adjust the criteria to recognize contributions.

    -

    Questions

    +

    Questions +

    If you have further questions regarding the contribution guidelines, please contact the package/repository maintainer.

    + + + + - - + + diff --git a/v0.5.0-rc2/LICENSE-text.html b/v0.5.0-rc2/LICENSE-text.html index 7e1cddc69..fddd23a9d 100644 --- a/v0.5.0-rc2/LICENSE-text.html +++ b/v0.5.0-rc2/LICENSE-text.html @@ -1,8 +1,22 @@ - -License • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -92,17 +112,19 @@ limitations under the License. - + + + + - - + + diff --git a/v0.5.0-rc2/SECURITY.html b/v0.5.0-rc2/SECURITY.html index 9bffcc734..17df7f543 100644 --- a/v0.5.0-rc2/SECURITY.html +++ b/v0.5.0-rc2/SECURITY.html @@ -1,8 +1,22 @@ - -Security Policy • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -80,38 +100,44 @@
    -

    Reporting Security Issues

    +

    Reporting Security Issues +

    If you believe you have found a security vulnerability in any of the repositories in this organization, please report it to us through coordinated disclosure.

    Please do not report security vulnerabilities through public GitHub issues, discussions, or pull requests.

    Instead, please send an email to vulnerability.management[@]roche.com.

    Please include as much of the information listed below as you can to help us better understand and resolve the issue:

    -
    • The type of issue (e.g., buffer overflow, SQL injection, or cross-site scripting)
    • +
        +
      • The type of issue (e.g., buffer overflow, SQL injection, or cross-site scripting)
      • Full paths of source file(s) related to the manifestation of the issue
      • The location of the affected source code (tag/branch/commit or direct URL)
      • Any special configuration required to reproduce the issue
      • Step-by-step instructions to reproduce the issue
      • Proof-of-concept or exploit code (if possible)
      • Impact of the issue, including how an attacker might exploit the issue
      • -

      This information will help us triage your report more quickly.

      +
    +

    This information will help us triage your report more quickly.

    -

    Data Security Standards (DSS)

    +

    Data Security Standards (DSS) +

    Please make sure that while reporting issues in the form a bug, feature, or pull request, all sensitive information such as PII, PHI, and PCI is completely removed from any text and attachments, including pictures and videos.

    + + + + - - + + diff --git a/v0.5.0-rc2/articles/filter-panel-for-developers.html b/v0.5.0-rc2/articles/filter-panel-for-developers.html index 907959782..08a4b12c4 100644 --- a/v0.5.0-rc2/articles/filter-panel-for-developers.html +++ b/v0.5.0-rc2/articles/filter-panel-for-developers.html @@ -1,5 +1,4 @@ - - + @@ -52,22 +51,7 @@ - - + - + + diff --git a/v0.5.0-rc2/articles/index.html b/v0.5.0-rc2/articles/index.html index a9eed9c9e..71743b070 100644 --- a/v0.5.0-rc2/articles/index.html +++ b/v0.5.0-rc2/articles/index.html @@ -1,8 +1,22 @@ - -Articles • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -80,24 +100,31 @@

    All vignettes

    -
    Filter Panel for Developers
    +
    +
    Filter Panel for Developers
    -
    teal.slice Classes
    + +
    teal.slice Classes
    -
    Introduction to teal.slice
    + +
    Introduction to teal.slice
    -
    - + +
    + + + + + - - + + diff --git a/v0.5.0-rc2/articles/teal-slice-classes.html b/v0.5.0-rc2/articles/teal-slice-classes.html index 333c6dcd8..f299bc1ec 100644 --- a/v0.5.0-rc2/articles/teal-slice-classes.html +++ b/v0.5.0-rc2/articles/teal-slice-classes.html @@ -1,5 +1,4 @@ - - + @@ -52,22 +51,7 @@ - - + - + + diff --git a/v0.5.0-rc2/articles/teal-slice.html b/v0.5.0-rc2/articles/teal-slice.html index c82db111b..56cfda82b 100644 --- a/v0.5.0-rc2/articles/teal-slice.html +++ b/v0.5.0-rc2/articles/teal-slice.html @@ -1,5 +1,4 @@ - - + @@ -52,22 +51,7 @@ - - + - + + diff --git a/v0.5.0-rc2/authors.html b/v0.5.0-rc2/authors.html index b43b323ff..d6c18f6fb 100644 --- a/v0.5.0-rc2/authors.html +++ b/v0.5.0-rc2/authors.html @@ -1,8 +1,22 @@ - -Authors and Citation • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -79,7 +99,8 @@

    Authors

    -
    • +
        +
      • Dawid Kaledkowski. Author, maintainer.

      • @@ -135,7 +156,8 @@

        Authors

        F. Hoffmann-La Roche AG. Copyright holder, funder.

        -
    + +

    Citation

    @@ -156,17 +178,19 @@

    Citation

    }
    + + + + - - + + diff --git a/v0.5.0-rc2/coverage-report/index.html b/v0.5.0-rc2/coverage-report/index.html index 0735cd350..629b6370d 100644 --- a/v0.5.0-rc2/coverage-report/index.html +++ b/v0.5.0-rc2/coverage-report/index.html @@ -1,22 +1,21 @@ - - + - + - - + + - + - + - - - + + + @@ -480,28 +479,32 @@

    teal.slice coverage - 66.10%

    53 - 274x + 274x +
          checkmate::assert_string(dataname)
    54 - 272x + 272x +
          logger::log_trace("Instantiating { class(self)[1] }, dataname: { dataname }")
    55 - 272x + 272x +
          checkmate::assert_function(data_reactive, args = "sid")
    56 - 272x + 272x +
          checkmate::assert_string(datalabel, null.ok = TRUE)
    @@ -515,42 +518,48 @@

    teal.slice coverage - 66.10%

    58 - 272x + 272x +
          private$dataname <- dataname
    59 - 272x + 272x +
          private$datalabel <- datalabel
    60 - 272x + 272x +
          private$dataname_prefixed <- dataname
    61 - 272x + 272x +
          private$data <- data
    62 - 272x + 272x +
          private$data_reactive <- data_reactive
    63 - 272x + 272x +
          private$state_list <- reactiveVal()
    @@ -564,14 +573,16 @@

    teal.slice coverage - 66.10%

    65 - 272x + 272x +
          logger::log_trace("Instantiated { class(self)[1] }, dataname: { private$dataname }")
    66 - 272x + 272x +
          invisible(self)
    @@ -998,7 +1009,8 @@

    teal.slice coverage - 66.10%

    127 - 88x + 88x +
          logger::log_trace("FilterStates$get_call initializing")
    @@ -1033,21 +1045,24 @@

    teal.slice coverage - 66.10%

    132 - 88x + 88x +
          states_list <- private$state_list_get()
    133 - 88x + 88x +
          if (length(states_list) == 0) {
    134 - 52x + 52x +
            return(NULL)
    @@ -1061,35 +1076,40 @@

    teal.slice coverage - 66.10%

    136 - 36x + 36x +
          args <- vapply(
    137 - 36x + 36x +
            states_list,
    138 - 36x + 36x +
            function(x) {
    139 - 57x + 57x +
              arg <- x$get_state()$arg
    140 - 7x + 7x +
              `if`(is.null(arg), "", arg) # converting NULL -> "" to enable tapply.
    @@ -1103,7 +1123,8 @@

    teal.slice coverage - 66.10%

    142 - 36x + 36x +
            character(1)
    @@ -1124,35 +1145,40 @@

    teal.slice coverage - 66.10%

    145 - 36x + 36x +
          filter_items <- tapply(
    146 - 36x + 36x +
            X = states_list,
    147 - 36x + 36x +
            INDEX = args,
    148 - 36x + 36x +
            simplify = FALSE,
    149 - 36x + 36x +
            function(items) {
    @@ -1166,14 +1192,16 @@

    teal.slice coverage - 66.10%

    151 - 38x + 38x +
              other_filter_idx <- !names(items) %in% sid
    152 - 38x + 38x +
              filtered_items <- items[other_filter_idx]
    @@ -1187,42 +1215,48 @@

    teal.slice coverage - 66.10%

    154 - 38x + 38x +
              calls <- Filter(
    155 - 38x + 38x +
                Negate(is.null),
    156 - 38x + 38x +
                lapply(
    157 - 38x + 38x +
                  filtered_items,
    158 - 38x + 38x +
                  function(state) {
    159 - 51x + 51x +
                    state$get_call(dataname = private$dataname_prefixed)
    @@ -1250,7 +1284,8 @@

    teal.slice coverage - 66.10%

    163 - 38x + 38x +
              calls_combine_by(calls, operator = "&")
    @@ -1271,21 +1306,24 @@

    teal.slice coverage - 66.10%

    166 - 36x + 36x +
          filter_items <- Filter(
    167 - 36x + 36x +
            x = filter_items,
    168 - 36x + 36x +
            f = Negate(is.null)
    @@ -1299,49 +1337,56 @@

    teal.slice coverage - 66.10%

    170 - 36x + 36x +
          if (length(filter_items) > 0L) {
    171 - 35x + 35x +
            filter_function <- private$fun
    172 - 35x + 35x +
            data_name <- str2lang(private$dataname_prefixed)
    173 - 35x + 35x +
            substitute(
    174 - 35x + 35x +
              env = list(
    175 - 35x + 35x +
                lhs = data_name,
    176 - 35x + 35x +
                rhs = as.call(c(filter_function, c(list(data_name), filter_items)))
    @@ -1355,7 +1400,8 @@

    teal.slice coverage - 66.10%

    178 - 35x + 35x +
              expr = lhs <- rhs
    @@ -1383,7 +1429,8 @@

    teal.slice coverage - 66.10%

    182 - 1x + 1x +
            NULL
    @@ -1537,35 +1584,40 @@

    teal.slice coverage - 66.10%

    204 - 17x + 17x +
          checkmate::assert_class(state, "teal_slices")
    205 - 17x + 17x +
          isolate({
    206 - 17x + 17x +
            state_ids <- vapply(state, `[[`, character(1), "id")
    207 - 17x + 17x +
            logger::log_trace("{ class(self)[1] }$remove_filter_state removing filters, state_id: { toString(state_ids) }")
    208 - 17x + 17x +
            private$state_list_remove(state_ids)
    @@ -1579,7 +1631,8 @@

    teal.slice coverage - 66.10%

    210 - 17x + 17x +
          invisible(NULL)
    @@ -1663,14 +1716,16 @@

    teal.slice coverage - 66.10%

    222 - 364x + 364x +
          slices <- unname(lapply(private$state_list(), function(x) x$get_state()))
    223 - 364x + 364x +
          fs <- do.call(teal_slices, c(slices, list(count_type = private$count_type)))
    @@ -1684,35 +1739,40 @@

    teal.slice coverage - 66.10%

    225 - 364x + 364x +
          include_varnames <- private$include_varnames
    226 - 364x + 364x +
          if (length(include_varnames)) {
    227 - 214x + 214x +
            attr(fs, "include_varnames") <- structure(
    228 - 214x + 214x +
              list(include_varnames),
    229 - 214x + 214x +
              names = private$dataname
    @@ -1740,35 +1800,40 @@

    teal.slice coverage - 66.10%

    233 - 364x + 364x +
          exclude_varnames <- private$exclude_varnames
    234 - 364x + 364x +
          if (length(exclude_varnames)) {
    235 - 9x + 9x +
            attr(fs, "exclude_varnames") <- structure(
    236 - 9x + 9x +
              list(exclude_varnames),
    237 - 9x + 9x +
              names = private$dataname
    @@ -1796,7 +1861,8 @@

    teal.slice coverage - 66.10%

    241 - 364x + 364x +
          fs
    @@ -1852,49 +1918,56 @@

    teal.slice coverage - 66.10%

    249 - 135x + 135x +
          isolate({
    250 - 135x + 135x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initializing, dataname: { private$dataname }")
    251 - 135x + 135x +
            checkmate::assert_class(state, "teal_slices")
    252 - 135x + 135x +
            lapply(state, function(x) {
    253 - 177x + 177x +
              checkmate::assert_true(
    254 - 177x + 177x +
                x$dataname == private$dataname,
    255 - 177x + 177x +
                .var.name = "dataname matches private$dataname"
    @@ -1922,21 +1995,24 @@

    teal.slice coverage - 66.10%

    259 - 135x + 135x +
            private$set_filterable_varnames(
    260 - 135x + 135x +
              include_varnames = attr(state, "include_varnames")[[private$dataname]],
    261 - 135x + 135x +
              exclude_varnames = attr(state, "exclude_varnames")[[private$dataname]]
    @@ -1950,21 +2026,24 @@

    teal.slice coverage - 66.10%

    263 - 135x + 135x +
            count_type <- attr(state, "count_type")
    264 - 135x + 135x +
            if (length(count_type)) {
    265 - 21x + 21x +
              private$count_type <- count_type
    @@ -1992,35 +2071,40 @@

    teal.slice coverage - 66.10%

    269 - 135x + 135x +
            varnames <- unique(unlist(lapply(state, "[[", "varname")))
    270 - 135x + 135x +
            excluded_varnames <- setdiff(varnames, private$get_filterable_varnames())
    271 - 135x + 135x +
            if (length(excluded_varnames)) {
    272 - 3x + 3x +
              state <- Filter(function(x) !isTRUE(x$varname %in% excluded_varnames), state)
    273 - 3x + 3x +
              logger::log_warn("filters for columns: { toString(excluded_varnames) } excluded from { private$dataname }")
    @@ -2041,35 +2125,40 @@

    teal.slice coverage - 66.10%

    276 - 135x + 135x +
            if (length(state) > 0) {
    277 - 93x + 93x +
              private$set_filter_state_impl(
    278 - 93x + 93x +
                state = state,
    279 - 93x + 93x +
                data = private$data,
    280 - 93x + 93x +
                data_reactive = private$data_reactive
    @@ -2090,7 +2179,8 @@

    teal.slice coverage - 66.10%

    283 - 135x + 135x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initialized, dataname: { private$dataname }")
    @@ -2111,7 +2201,8 @@

    teal.slice coverage - 66.10%

    286 - 135x + 135x +
          invisible(NULL)
    @@ -2195,14 +2286,16 @@

    teal.slice coverage - 66.10%

    298 - 25x + 25x +
          private$state_list_empty(force)
    299 - 25x + 25x +
          invisible(NULL)
    @@ -2454,49 +2547,56 @@

    teal.slice coverage - 66.10%

    335 - 12x + 12x +
          moduleServer(
    336 - 12x + 12x +
            id = id,
    337 - 12x + 12x +
            function(input, output, session) {
    338 - 12x + 12x +
              logger::log_trace("FilterState$srv_active initializing, dataname: { private$dataname }")
    339 - 12x + 12x +
              current_state <- reactive(private$state_list_get())
    340 - 12x + 12x +
              previous_state <- reactiveVal(NULL) # FilterState list
    341 - 12x + 12x +
              added_states <- reactiveVal(NULL) # FilterState list
    @@ -2517,21 +2617,24 @@

    teal.slice coverage - 66.10%

    344 - 12x + 12x +
              fs_to_shiny_ns <- function(x) {
    345 - 24x + 24x +
                checkmate::assert_multi_class(x, c("FilterState", "FilterStateExpr"))
    346 - 24x + 24x +
                gsub("[^[:alnum:]]+", "_", get_default_slice_id(x$get_state()))
    @@ -2552,28 +2655,32 @@

    teal.slice coverage - 66.10%

    349 - 12x + 12x +
              output$trigger_visible_state_change <- renderUI({
    350 - 14x + 14x +
                current_state()
    351 - 14x + 14x +
                isolate({
    352 - 14x + 14x +
                  logger::log_trace("FilterStates$srv_active@1 determining added and removed filter states")
    @@ -2587,21 +2694,24 @@

    teal.slice coverage - 66.10%

    354 - 14x + 14x +
                  added_states(setdiff_teal_slices(current_state(), previous_state()))
    355 - 14x + 14x +
                  previous_state(current_state())
    356 - 14x + 14x +
                  NULL
    @@ -2629,42 +2739,48 @@

    teal.slice coverage - 66.10%

    360 - 12x + 12x +
              output[["cards"]] <- renderUI({
    361 - 14x + 14x +
                lapply(
    362 - 14x + 14x +
                  current_state(), # observes only if added/removed
    363 - 14x + 14x +
                  function(state) {
    364 - 12x + 12x +
                    isolate( # isolates when existing state changes
    365 - 12x + 12x +
                      state$ui(id = session$ns(fs_to_shiny_ns(state)), parent_id = session$ns("cards"))
    @@ -2706,21 +2822,24 @@

    teal.slice coverage - 66.10%

    371 - 12x + 12x +
              observeEvent(
    372 - 12x + 12x +
                added_states(), # we want to call FilterState module only once when it's added
    373 - 12x + 12x +
                ignoreNULL = TRUE,
    @@ -2734,63 +2853,72 @@

    teal.slice coverage - 66.10%

    375 - 10x + 10x +
                  added_state_names <- vapply(added_states(), function(x) x$get_state()$id, character(1L))
    376 - 10x + 10x +
                  logger::log_trace("FilterStates$srv_active@2 triggered by added states: { toString(added_state_names) }")
    377 - 10x + 10x +
                  lapply(added_states(), function(state) {
    378 - 12x + 12x +
                    fs_callback <- state$server(id = fs_to_shiny_ns(state))
    379 - 12x + 12x +
                    observeEvent(
    380 - 12x + 12x +
                      once = TRUE, # remove button can be called once, should be destroyed afterwards
    381 - 12x + 12x +
                      ignoreInit = TRUE, # ignoreInit: should not matter because we destroy the previous input set of the UI
    382 - 12x + 12x +
                      eventExpr = fs_callback(), # when remove button is clicked in the FilterState ui
    383 - 12x + 12x +
                      handlerExpr = private$state_list_remove(state$get_state()$id)
    @@ -2811,7 +2939,8 @@

    teal.slice coverage - 66.10%

    386 - 10x + 10x +
                  added_states(NULL)
    @@ -2839,7 +2968,8 @@

    teal.slice coverage - 66.10%

    390 - 12x + 12x +
              NULL
    @@ -2937,14 +3067,16 @@

    teal.slice coverage - 66.10%

    404 - 1x + 1x +
          checkmate::assert_string(id)
    405 - 1x + 1x +
          data <- private$data
    @@ -2958,7 +3090,8 @@

    teal.slice coverage - 66.10%

    407 - 1x + 1x +
          ns <- NS(id)
    @@ -2972,14 +3105,16 @@

    teal.slice coverage - 66.10%

    409 - 1x + 1x +
          if (ncol(data) == 0) {
    410 - 1x + 1x +
            div("no sample variables available")
    @@ -3119,28 +3254,32 @@

    teal.slice coverage - 66.10%

    430 - 8x + 8x +
          moduleServer(
    431 - 8x + 8x +
            id = id,
    432 - 8x + 8x +
            function(input, output, session) {
    433 - 8x + 8x +
              logger::log_trace("FilterStates$srv_add initializing, dataname: { private$dataname }")
    @@ -3161,42 +3300,48 @@

    teal.slice coverage - 66.10%

    436 - 8x + 8x +
              avail_column_choices <- reactive({
    437 - 9x + 9x +
                data <- private$data
    438 - 9x + 9x +
                vars_include <- private$get_filterable_varnames()
    439 - 9x + 9x +
                active_filter_vars <- unique(unlist(lapply(self$get_filter_state(), "[[", "varname")))
    440 - 9x + 9x +
                choices <- setdiff(vars_include, active_filter_vars)
    441 - 9x + 9x +
                varlabels <- get_varlabels(data)
    @@ -3210,35 +3355,40 @@

    teal.slice coverage - 66.10%

    443 - 9x + 9x +
                data_choices_labeled(
    444 - 9x + 9x +
                  data = data,
    445 - 9x + 9x +
                  choices = choices,
    446 - 9x + 9x +
                  varlabels = varlabels,
    447 - 9x + 9x +
                  keys = private$keys
    @@ -3273,21 +3423,24 @@

    teal.slice coverage - 66.10%

    452 - 8x + 8x +
              output$add_filter <- renderUI({
    453 - 6x + 6x +
                logger::log_trace(
    454 - 6x + 6x +
                  "FilterStates$srv_add@1 updating available column choices, dataname: { private$dataname }"
    @@ -3301,7 +3454,8 @@

    teal.slice coverage - 66.10%

    456 - 6x + 6x +
                if (length(avail_column_choices()) == 0) {
    @@ -3322,56 +3476,64 @@

    teal.slice coverage - 66.10%

    459 - 6x + 6x +
                  div(
    460 - 6x + 6x +
                    teal.widgets::optionalSelectInput(
    461 - 6x + 6x +
                      session$ns("var_to_add"),
    462 - 6x + 6x +
                      choices = avail_column_choices(),
    463 - 6x + 6x +
                      selected = NULL,
    464 - 6x + 6x +
                      options = shinyWidgets::pickerOptions(
    465 - 6x + 6x +
                        liveSearch = TRUE,
    466 - 6x + 6x +
                        noneSelectedText = "Select variable to filter"
    @@ -3420,56 +3582,64 @@

    teal.slice coverage - 66.10%

    473 - 8x + 8x +
              observeEvent(
    474 - 8x + 8x +
                eventExpr = input$var_to_add,
    475 - 8x + 8x +
                handlerExpr = {
    476 - 3x + 3x +
                  logger::log_trace(
    477 - 3x + 3x +
                    sprintf(
    478 - 3x + 3x +
                      "FilterStates$srv_add@2 adding FilterState of variable %s, dataname: %s",
    479 - 3x + 3x +
                      input$var_to_add,
    480 - 3x + 3x +
                      private$dataname
    @@ -3490,21 +3660,24 @@

    teal.slice coverage - 66.10%

    483 - 3x + 3x +
                  self$set_filter_state(
    484 - 3x + 3x +
                    teal_slices(
    485 - 3x + 3x +
                      teal_slice(dataname = private$dataname, varname = input$var_to_add)
    @@ -3525,35 +3698,40 @@

    teal.slice coverage - 66.10%

    488 - 3x + 3x +
                  logger::log_trace(
    489 - 3x + 3x +
                    sprintf(
    490 - 3x + 3x +
                      "FilterStates$srv_add@2 added FilterState of variable %s, dataname: %s",
    491 - 3x + 3x +
                      input$var_to_add,
    492 - 3x + 3x +
                      private$dataname
    @@ -3595,14 +3773,16 @@

    teal.slice coverage - 66.10%

    498 - 8x + 8x +
              logger::log_trace("FilterStates$srv_add initialized, dataname: { private$dataname }")
    499 - 8x + 8x +
              NULL
    @@ -3861,14 +4041,16 @@

    teal.slice coverage - 66.10%

    536 - 288x + 288x +
          if ((length(include_varnames) + length(exclude_varnames)) == 0L) {
    537 - 113x + 113x +
            return(invisible(NULL))
    @@ -3882,21 +4064,24 @@

    teal.slice coverage - 66.10%

    539 - 175x + 175x +
          checkmate::assert_character(include_varnames, any.missing = FALSE, min.len = 0L, null.ok = TRUE)
    540 - 175x + 175x +
          checkmate::assert_character(exclude_varnames, any.missing = FALSE, min.len = 0L, null.ok = TRUE)
    541 - 175x + 175x +
          if (length(include_varnames) && length(exclude_varnames)) {
    @@ -3945,28 +4130,32 @@

    teal.slice coverage - 66.10%

    548 - 175x + 175x +
          supported_vars <- get_supported_filter_varnames(private$data)
    549 - 175x + 175x +
          if (length(include_varnames)) {
    550 - 161x + 161x +
            private$include_varnames <- intersect(include_varnames, supported_vars)
    551 - 161x + 161x +
            private$exclude_varnames <- character(0)
    @@ -3980,14 +4169,16 @@

    teal.slice coverage - 66.10%

    553 - 14x + 14x +
            private$exclude_varnames <- exclude_varnames
    554 - 14x + 14x +
            private$include_varnames <- character(0)
    @@ -4001,7 +4192,8 @@

    teal.slice coverage - 66.10%

    556 - 175x + 175x +
          invisible(NULL)
    @@ -4078,14 +4270,16 @@

    teal.slice coverage - 66.10%

    567 - 144x + 144x +
          if (length(private$include_varnames)) {
    568 - 97x + 97x +
            private$include_varnames
    @@ -4099,14 +4293,16 @@

    teal.slice coverage - 66.10%

    570 - 47x + 47x +
            supported_varnames <- get_supported_filter_varnames(private$data)
    571 - 47x + 47x +
            setdiff(supported_varnames, private$exclude_varnames)
    @@ -4211,7 +4407,8 @@

    teal.slice coverage - 66.10%

    586 - 212x + 212x +
          checkmate::assert_string(state_id, null.ok = TRUE)
    @@ -4225,14 +4422,16 @@

    teal.slice coverage - 66.10%

    588 - 212x + 212x +
          if (is.null(state_id)) {
    589 - 212x + 212x +
            private$state_list()
    @@ -4358,49 +4557,56 @@

    teal.slice coverage - 66.10%

    607 - 183x + 183x +
          logger::log_trace("{ class(self)[1] } pushing into state_list, dataname: { private$dataname }")
    608 - 183x + 183x +
          checkmate::assert_string(state_id)
    609 - 183x + 183x +
          checkmate::assert_multi_class(x, c("FilterState", "FilterStateExpr"))
    610 - 183x + 183x +
          state <- stats::setNames(list(x), state_id)
    611 - 183x + 183x +
          new_state_list <- c(
    612 - 183x + 183x +
            isolate(private$state_list()),
    613 - 183x + 183x +
            state
    @@ -4414,7 +4620,8 @@

    teal.slice coverage - 66.10%

    615 - 183x + 183x +
          isolate(private$state_list(new_state_list))
    @@ -4428,14 +4635,16 @@

    teal.slice coverage - 66.10%

    617 - 183x + 183x +
          logger::log_trace("{ class(self)[1] } pushed into queue, dataname: { private$dataname }")
    618 - 183x + 183x +
          invisible(NULL)
    @@ -4554,14 +4763,16 @@

    teal.slice coverage - 66.10%

    635 - 32x + 32x +
          checkmate::assert_character(state_id)
    636 - 32x + 32x +
          logger::log_trace("{ class(self)[1] } removing a filter, state_id: { toString(state_id) }")
    @@ -4575,63 +4786,72 @@

    teal.slice coverage - 66.10%

    638 - 32x + 32x +
          isolate({
    639 - 32x + 32x +
            current_state_ids <- vapply(private$state_list(), function(x) x$get_state()$id, character(1))
    640 - 32x + 32x +
            to_remove <- state_id %in% current_state_ids
    641 - 32x + 32x +
            if (any(to_remove)) {
    642 - 31x + 31x +
              new_state_list <- Filter(
    643 - 31x + 31x +
                function(state) {
    644 - 68x + 68x +
                  if (state$get_state()$id %in% state_id) {
    645 - 54x + 54x +
                    if (state$get_state()$anchored && !force) {
    646 - 7x + 7x +
                      return(TRUE)
    @@ -4645,14 +4865,16 @@

    teal.slice coverage - 66.10%

    648 - 47x + 47x +
                      state$destroy_observers()
    649 - 47x + 47x +
                      FALSE
    @@ -4673,7 +4895,8 @@

    teal.slice coverage - 66.10%

    652 - 14x + 14x +
                    TRUE
    @@ -4694,7 +4917,8 @@

    teal.slice coverage - 66.10%

    655 - 31x + 31x +
                private$state_list()
    @@ -4708,7 +4932,8 @@

    teal.slice coverage - 66.10%

    657 - 31x + 31x +
              private$state_list(new_state_list)
    @@ -4722,7 +4947,8 @@

    teal.slice coverage - 66.10%

    659 - 1x + 1x +
              warning(sprintf("\"%s\" not found in state list", state_id))
    @@ -4750,7 +4976,8 @@

    teal.slice coverage - 66.10%

    663 - 32x + 32x +
          invisible(NULL)
    @@ -4820,21 +5047,24 @@

    teal.slice coverage - 66.10%

    673 - 25x + 25x +
          isolate({
    674 - 25x + 25x +
            logger::log_trace(
    675 - 25x + 25x +
              "{ class(self)[1] }$state_list_empty removing all non-anchored filters for dataname: { private$dataname }"
    @@ -4855,28 +5085,32 @@

    teal.slice coverage - 66.10%

    678 - 25x + 25x +
            state_list <- private$state_list()
    679 - 25x + 25x +
            if (length(state_list)) {
    680 - 15x + 15x +
              state_ids <- vapply(state_list, function(x) x$get_state()$id, character(1))
    681 - 15x + 15x +
              private$state_list_remove(state_ids, force)
    @@ -4904,7 +5138,8 @@

    teal.slice coverage - 66.10%

    685 - 25x + 25x +
          invisible(NULL)
    @@ -5030,35 +5265,40 @@

    teal.slice coverage - 66.10%

    703 - 211x + 211x +
          checkmate::assert_class(state, "teal_slices")
    704 - 211x + 211x +
          checkmate::assert_multi_class(data, c("data.frame", "matrix", "DataFrame", "HermesData"))
    705 - 211x + 211x +
          checkmate::assert_function(data_reactive, args = "sid")
    706 - 211x + 211x +
          if (length(state) == 0L) {
    707 - 101x + 101x +
            return(invisible(NULL))
    @@ -5079,14 +5319,16 @@

    teal.slice coverage - 66.10%

    710 - 110x + 110x +
          slices_hashed <- vapply(state, `[[`, character(1L), "id")
    711 - 110x + 110x +
          if (any(duplicated(slices_hashed))) {
    @@ -5135,28 +5377,32 @@

    teal.slice coverage - 66.10%

    718 - 110x + 110x +
          state_list <- isolate(private$state_list_get())
    719 - 110x + 110x +
          lapply(state, function(slice) {
    720 - 191x + 191x +
            state_id <- slice$id
    721 - 191x + 191x +
            if (state_id %in% names(state_list)) {
    @@ -5170,7 +5416,8 @@

    teal.slice coverage - 66.10%

    723 - 8x + 8x +
              state_list[[state_id]]$set_state(slice)
    @@ -5184,7 +5431,8 @@

    teal.slice coverage - 66.10%

    725 - 183x + 183x +
              if (inherits(slice, "teal_slice_expr")) {
    @@ -5198,7 +5446,8 @@

    teal.slice coverage - 66.10%

    727 - 6x + 6x +
                fstate <- init_filter_state_expr(slice)
    @@ -5219,14 +5468,16 @@

    teal.slice coverage - 66.10%

    730 - 177x + 177x +
                fstate <- init_filter_state(
    731 - 177x + 177x +
                  x = data[, slice$varname, drop = TRUE],
    @@ -5275,14 +5526,16 @@

    teal.slice coverage - 66.10%

    738 - 177x + 177x +
                  x_reactive = if (private$count_type == "none") {
    739 - 171x + 171x +
                    reactive(NULL)
    @@ -5296,7 +5549,8 @@

    teal.slice coverage - 66.10%

    741 - 6x + 6x +
                    reactive(data_reactive(state_id)[, slice$varname, drop = TRUE])
    @@ -5310,14 +5564,16 @@

    teal.slice coverage - 66.10%

    743 - 177x + 177x +
                  slice = slice,
    744 - 177x + 177x +
                  extract_type = private$extract_type
    @@ -5338,7 +5594,8 @@

    teal.slice coverage - 66.10%

    747 - 183x + 183x +
              private$state_list_push(x = fstate, state_id = state_id)
    @@ -5366,7 +5623,8 @@

    teal.slice coverage - 66.10%

    751 - 110x + 110x +
          invisible(NULL)
    @@ -5764,7 +6022,8 @@

    teal.slice coverage - 66.10%

    53 - 67x + 67x +
          checkmate::assert_list(data_objects, any.missing = FALSE, min.len = 0, names = "unique")
    @@ -5778,14 +6037,16 @@

    teal.slice coverage - 66.10%

    55 - 67x + 67x +
          data_objects <- lapply(data_objects, function(dataset) {
    56 - 101x + 101x +
            if (is.list(dataset) && "dataset" %in% names(dataset)) {
    @@ -5806,7 +6067,8 @@

    teal.slice coverage - 66.10%

    59 - 101x + 101x +
              dataset
    @@ -5841,49 +6103,56 @@

    teal.slice coverage - 66.10%

    64 - 67x + 67x +
          checkmate::assert_class(join_keys, "join_keys")
    65 - 66x + 66x +
          self$set_join_keys(join_keys)
    66 - 66x + 66x +
          child_parent <- sapply(
    67 - 66x + 66x +
            names(data_objects),
    68 - 66x + 66x +
            function(i) teal.data::parent(join_keys, i),
    69 - 66x + 66x +
            USE.NAMES = TRUE,
    70 - 66x + 66x +
            simplify = FALSE
    @@ -5897,14 +6166,16 @@

    teal.slice coverage - 66.10%

    72 - 66x + 66x +
          ordered_datanames <- topological_sort(child_parent)
    73 - 66x + 66x +
          ordered_datanames <- intersect(ordered_datanames, names(data_objects))
    @@ -5918,21 +6189,24 @@

    teal.slice coverage - 66.10%

    75 - 66x + 66x +
          for (dataname in ordered_datanames) {
    76 - 100x + 100x +
            ds_object <- data_objects[[dataname]]
    77 - 100x + 100x +
            self$set_dataset(data = ds_object, dataname = dataname)
    @@ -5953,7 +6227,8 @@

    teal.slice coverage - 66.10%

    80 - 66x + 66x +
          self$set_available_teal_slices(x = reactive(NULL))
    @@ -5967,7 +6242,8 @@

    teal.slice coverage - 66.10%

    82 - 66x + 66x +
          invisible(self)
    @@ -6030,7 +6306,8 @@

    teal.slice coverage - 66.10%

    91 - 118x + 118x +
          names(private$filtered_datasets)
    @@ -6100,7 +6377,8 @@

    teal.slice coverage - 66.10%

    101 - 1x + 1x +
          private$get_filtered_dataset(dataname)$get_dataset_label()
    @@ -6205,14 +6483,16 @@

    teal.slice coverage - 66.10%

    116 - 67x + 67x +
          checkmate::assert_class(x, "reactive")
    117 - 67x + 67x +
          private$available_teal_slices <- reactive({
    @@ -6226,49 +6506,56 @@

    teal.slice coverage - 66.10%

    119 - 4x + 4x +
            current_state <- isolate(self$get_filter_state())
    120 - 4x + 4x +
            allowed <- attr(current_state, "include_varnames")
    121 - 4x + 4x +
            forbidden <- attr(current_state, "exclude_varnames")
    122 - 4x + 4x +
            foo <- function(slice) {
    123 - 13x + 13x +
              if (slice$dataname %in% self$datanames()) {
    124 - 13x + 13x +
                if (slice$fixed) {
    125 - 4x + 4x +
                  TRUE
    @@ -6282,14 +6569,16 @@

    teal.slice coverage - 66.10%

    127 - 9x + 9x +
                  isTRUE(slice$varname %in% allowed[[slice$dataname]]) ||
    128 - 9x + 9x +
                    isFALSE(slice$varname %in% forbidden[[slice$dataname]])
    @@ -6331,7 +6620,8 @@

    teal.slice coverage - 66.10%

    134 - 4x + 4x +
            Filter(foo, x())
    @@ -6345,7 +6635,8 @@

    teal.slice coverage - 66.10%

    136 - 67x + 67x +
          invisible(NULL)
    @@ -6422,7 +6713,8 @@

    teal.slice coverage - 66.10%

    147 - 4x + 4x +
          private$available_teal_slices
    @@ -6618,14 +6910,16 @@

    teal.slice coverage - 66.10%

    175 - 10x + 10x +
          checkmate::assert_subset(dataname, self$datanames())
    176 - 9x + 9x +
          private$get_filtered_dataset(dataname)$get_call()
    @@ -6723,28 +7017,32 @@

    teal.slice coverage - 66.10%

    190 - 24x + 24x +
          checkmate::assert_subset(dataname, self$datanames())
    191 - 23x + 23x +
          checkmate::assert_flag(filtered)
    192 - 22x + 22x +
          data <- private$get_filtered_dataset(dataname)$get_dataset(filtered)
    193 - 3x + 3x +
          if (filtered) data() else data
    @@ -6807,7 +7105,8 @@

    teal.slice coverage - 66.10%

    202 - 2x + 2x +
          private$join_keys
    @@ -6898,28 +7197,32 @@

    teal.slice coverage - 66.10%

    215 - 9x + 9x +
          rows <- lapply(
    216 - 9x + 9x +
            datanames,
    217 - 9x + 9x +
            function(dataname) {
    218 - 11x + 11x +
              private$get_filtered_dataset(dataname)$get_filter_overview()
    @@ -6940,14 +7243,16 @@

    teal.slice coverage - 66.10%

    221 - 5x + 5x +
          unssuported_idx <- vapply(rows, function(x) all(is.na(x[-1])), logical(1))
    222 - 5x + 5x +
          dplyr::bind_rows(c(rows[!unssuported_idx], rows[unssuported_idx]))
    @@ -7024,7 +7329,8 @@

    teal.slice coverage - 66.10%

    233 - 1x + 1x +
          private$get_filtered_dataset(dataname)$get_keys()
    @@ -7178,14 +7484,16 @@

    teal.slice coverage - 66.10%

    255 - 105x + 105x +
          checkmate::assert_string(dataname)
    256 - 105x + 105x +
          logger::log_trace("FilteredData$set_dataset setting dataset, name: { dataname }")
    @@ -7206,7 +7514,8 @@

    teal.slice coverage - 66.10%

    259 - 105x + 105x +
          check_simple_name(dataname)
    @@ -7220,21 +7529,24 @@

    teal.slice coverage - 66.10%

    261 - 105x + 105x +
          parent_dataname <- teal.data::parent(private$join_keys, dataname)
    262 - 105x + 105x +
          keys <- private$join_keys[dataname, dataname]
    263 - 104x + 104x +
          if (is.null(keys)) keys <- character(0)
    @@ -7248,35 +7560,40 @@

    teal.slice coverage - 66.10%

    265 - 105x + 105x +
          if (length(parent_dataname) == 0) {
    266 - 95x + 95x +
            private$filtered_datasets[[dataname]] <- init_filtered_dataset(
    267 - 95x + 95x +
              dataset = data,
    268 - 95x + 95x +
              dataname = dataname,
    269 - 95x + 95x +
              keys = keys
    @@ -7297,7 +7614,8 @@

    teal.slice coverage - 66.10%

    272 - 10x + 10x +
            join_keys <- private$join_keys[dataname, parent_dataname]
    @@ -7311,49 +7629,56 @@

    teal.slice coverage - 66.10%

    274 - 10x + 10x +
            private$filtered_datasets[[dataname]] <- init_filtered_dataset(
    275 - 10x + 10x +
              dataset = data,
    276 - 10x + 10x +
              dataname = dataname,
    277 - 10x + 10x +
              keys = keys,
    278 - 10x + 10x +
              parent_name = parent_dataname,
    279 - 10x + 10x +
              parent = reactive(self$get_data(parent_dataname, filtered = TRUE)),
    280 - 10x + 10x +
              join_keys = join_keys
    @@ -7381,7 +7706,8 @@

    teal.slice coverage - 66.10%

    284 - 105x + 105x +
          invisible(self)
    @@ -7458,21 +7784,24 @@

    teal.slice coverage - 66.10%

    295 - 66x + 66x +
          checkmate::assert_class(join_keys, "join_keys")
    296 - 66x + 66x +
          private$join_keys <- join_keys
    297 - 66x + 66x +
          invisible(self)
    @@ -7549,35 +7878,40 @@

    teal.slice coverage - 66.10%

    308 - 53x + 53x +
          states <- unname(lapply(private$filtered_datasets, function(x) x$get_filter_state()))
    309 - 53x + 53x +
          slices <- Filter(Negate(is.null), states)
    310 - 53x + 53x +
          slices <- do.call(c, slices)
    311 - 53x + 53x +
          if (!is.null(slices)) {
    312 - 53x + 53x +
            attr(slices, "allow_add") <- private$allow_add
    @@ -7591,7 +7925,8 @@

    teal.slice coverage - 66.10%

    314 - 53x + 53x +
          slices
    @@ -7675,35 +8010,40 @@

    teal.slice coverage - 66.10%

    326 - 5x + 5x +
          datasets <- lapply(self$datanames(), private$get_filtered_dataset)
    327 - 5x + 5x +
          ind <- vapply(datasets, inherits, logical(1L), what = "DefaultFilteredDataset")
    328 - 5x + 5x +
          states <- do.call(c, lapply(datasets[!ind], function(ds) ds$get_filter_state()))
    329 - 5x + 5x +
          states_fmt <- format(states, show_all = show_all, trim_lines = trim_lines)
    330 - 5x + 5x +
          holders_fmt <- vapply(datasets[ind], format, character(1L), show_all = show_all, trim_lines = trim_lines)
    @@ -7717,28 +8057,32 @@

    teal.slice coverage - 66.10%

    332 - 5x + 5x +
          sprintf(
    333 - 5x + 5x +
            "%s:\n%s",
    334 - 5x + 5x +
            class(self)[1],
    335 - 5x + 5x +
            paste(c(states_fmt, holders_fmt), collapse = "\n")
    @@ -7878,42 +8222,48 @@

    teal.slice coverage - 66.10%

    355 - 31x + 31x +
          isolate({
    356 - 31x + 31x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initializing")
    357 - 31x + 31x +
            checkmate::assert_class(state, "teal_slices")
    358 - 31x + 31x +
            allow_add <- attr(state, "allow_add")
    359 - 31x + 31x +
            if (!is.null(allow_add)) {
    360 - 31x + 31x +
              private$allow_add <- allow_add
    @@ -7934,21 +8284,24 @@

    teal.slice coverage - 66.10%

    363 - 31x + 31x +
            lapply(self$datanames(), function(dataname) {
    364 - 63x + 63x +
              states <- Filter(function(x) identical(x$dataname, dataname), state)
    365 - 63x + 63x +
              private$get_filtered_dataset(dataname)$set_filter_state(states)
    @@ -7969,7 +8322,8 @@

    teal.slice coverage - 66.10%

    368 - 31x + 31x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initialized")
    @@ -7990,7 +8344,8 @@

    teal.slice coverage - 66.10%

    371 - 31x + 31x +
          invisible(NULL)
    @@ -8081,28 +8436,32 @@

    teal.slice coverage - 66.10%

    384 - 8x + 8x +
          isolate({
    385 - 8x + 8x +
            checkmate::assert_class(state, "teal_slices")
    386 - 8x + 8x +
            datanames <- unique(vapply(state, "[[", character(1L), "dataname"))
    387 - 8x + 8x +
            checkmate::assert_subset(datanames, self$datanames())
    @@ -8116,14 +8475,16 @@

    teal.slice coverage - 66.10%

    389 - 8x + 8x +
            logger::log_trace(
    390 - 8x + 8x +
              "{ class(self)[1] }$remove_filter_state removing filter(s), dataname: { private$dataname }"
    @@ -8144,21 +8505,24 @@

    teal.slice coverage - 66.10%

    393 - 8x + 8x +
            lapply(datanames, function(dataname) {
    394 - 9x + 9x +
              slices <- Filter(function(x) identical(x$dataname, dataname), state)
    395 - 9x + 9x +
              private$get_filtered_dataset(dataname)$remove_filter_state(slices)
    @@ -8179,14 +8543,16 @@

    teal.slice coverage - 66.10%

    398 - 8x + 8x +
            logger::log_trace(
    399 - 8x + 8x +
              "{ class(self)[1] }$remove_filter_state removed filter(s), dataname: { private$dataname }"
    @@ -8214,7 +8580,8 @@

    teal.slice coverage - 66.10%

    403 - 8x + 8x +
          invisible(NULL)
    @@ -8319,14 +8686,16 @@

    teal.slice coverage - 66.10%

    418 - 7x + 7x +
          logger::log_trace(
    419 - 7x + 7x +
            "FilteredData$clear_filter_states called, datanames: { toString(datanames) }"
    @@ -8347,21 +8716,24 @@

    teal.slice coverage - 66.10%

    422 - 7x + 7x +
          for (dataname in datanames) {
    423 - 12x + 12x +
            fdataset <- private$get_filtered_dataset(dataname = dataname)
    424 - 12x + 12x +
            fdataset$clear_filter_states(force)
    @@ -8382,28 +8754,32 @@

    teal.slice coverage - 66.10%

    427 - 7x + 7x +
          logger::log_trace(
    428 - 7x + 7x +
            paste(
    429 - 7x + 7x +
              "FilteredData$clear_filter_states removed all non-anchored FilterStates,",
    430 - 7x + 7x +
              "datanames: { toString(datanames) }"
    @@ -8431,7 +8807,8 @@

    teal.slice coverage - 66.10%

    434 - 7x + 7x +
          invisible(NULL)
    @@ -8697,35 +9074,40 @@

    teal.slice coverage - 66.10%

    472 - 1x + 1x +
          checkmate::assert_function(active_datanames)
    473 - 1x + 1x +
          moduleServer(
    474 - 1x + 1x +
            id = id,
    475 - 1x + 1x +
            function(input, output, session) {
    476 - 1x + 1x +
              logger::log_trace("FilteredData$srv_filter_panel initializing")
    @@ -8739,14 +9121,16 @@

    teal.slice coverage - 66.10%

    478 - 1x + 1x +
              active_datanames_resolved <- reactive({
    479 - 1x + 1x +
                checkmate::assert_subset(active_datanames(), self$datanames())
    @@ -8774,28 +9158,32 @@

    teal.slice coverage - 66.10%

    483 - 1x + 1x +
              self$srv_overview("overview", active_datanames_resolved)
    484 - 1x + 1x +
              self$srv_active("active", active_datanames_resolved)
    485 - 1x + 1x +
              if (private$allow_add) {
    486 - 1x + 1x +
                self$srv_add("add", active_datanames_resolved)
    @@ -8816,14 +9204,16 @@

    teal.slice coverage - 66.10%

    489 - 1x + 1x +
              logger::log_trace("FilteredData$srv_filter_panel initialized")
    490 - 1x + 1x +
              NULL
    @@ -9264,21 +9654,24 @@

    teal.slice coverage - 66.10%

    553 - 3x + 3x +
          checkmate::assert_function(active_datanames)
    554 - 3x + 3x +
          moduleServer(id, function(input, output, session) {
    555 - 3x + 3x +
            logger::log_trace("FilteredData$srv_active initializing")
    @@ -9292,7 +9685,8 @@

    teal.slice coverage - 66.10%

    557 - 3x + 3x +
            private$srv_available_filters("available_filters")
    @@ -9306,7 +9700,8 @@

    teal.slice coverage - 66.10%

    559 - 3x + 3x +
            observeEvent(input$minimise_filter_active, {
    @@ -9355,42 +9750,48 @@

    teal.slice coverage - 66.10%

    566 - 3x + 3x +
            observeEvent(private$get_filter_count(), {
    567 - 3x + 3x +
              shinyjs::toggle("remove_all_filters", condition = private$get_filter_count() != 0)
    568 - 3x + 3x +
              shinyjs::show("filter_active_vars_contents")
    569 - 3x + 3x +
              shinyjs::hide("filters_active_count")
    570 - 3x + 3x +
              toggle_icon(session$ns("minimise_filter_active"), c("fa-angle-right", "fa-angle-down"), TRUE)
    571 - 3x + 3x +
              toggle_title(session$ns("minimise_filter_active"), c("Restore panel", "Minimise Panel"), TRUE)
    @@ -9411,28 +9812,32 @@

    teal.slice coverage - 66.10%

    574 - 3x + 3x +
            observeEvent(active_datanames(), {
    575 - 2x + 2x +
              lapply(self$datanames(), function(dataname) {
    576 - 4x + 4x +
                if (dataname %in% active_datanames()) {
    577 - 4x + 4x +
                  shinyjs::show(dataname)
    @@ -9495,35 +9900,40 @@

    teal.slice coverage - 66.10%

    586 - 3x + 3x +
            lapply(
    587 - 3x + 3x +
              self$datanames(),
    588 - 3x + 3x +
              function(dataname) {
    589 - 6x + 6x +
                fdataset <- private$get_filtered_dataset(dataname)
    590 - 6x + 6x +
                fdataset$srv_active(id = dataname)
    @@ -9551,49 +9961,56 @@

    teal.slice coverage - 66.10%

    594 - 3x + 3x +
            output$teal_filters_count <- renderText({
    595 - 3x + 3x +
              n_filters_active <- private$get_filter_count()
    596 - 3x + 3x +
              req(n_filters_active > 0L)
    597 - 2x + 2x +
              sprintf(
    598 - 2x + 2x +
                "%s filter%s applied across datasets",
    599 - 2x + 2x +
                n_filters_active,
    600 - 2x + 2x +
                ifelse(n_filters_active == 1, "", "s")
    @@ -9621,28 +10038,32 @@

    teal.slice coverage - 66.10%

    604 - 3x + 3x +
            observeEvent(input$remove_all_filters, {
    605 - 1x + 1x +
              logger::log_trace("FilteredData$srv_filter_panel@1 removing all non-anchored filters")
    606 - 1x + 1x +
              self$clear_filter_states()
    607 - 1x + 1x +
              logger::log_trace("FilteredData$srv_filter_panel@1 removed all non-anchored filters")
    @@ -9656,14 +10077,16 @@

    teal.slice coverage - 66.10%

    609 - 3x + 3x +
            logger::log_trace("FilteredData$srv_active initialized")
    610 - 3x + 3x +
            NULL
    @@ -10041,28 +10464,32 @@

    teal.slice coverage - 66.10%

    664 - 1x + 1x +
          checkmate::assert_class(active_datanames, "reactive")
    665 - 1x + 1x +
          moduleServer(id, function(input, output, session) {
    666 - 1x + 1x +
            logger::log_trace("FilteredData$srv_add initializing")
    667 - 1x + 1x +
            observeEvent(input$minimise_filter_add_vars, {
    @@ -10104,7 +10531,8 @@

    teal.slice coverage - 66.10%

    673 - 1x + 1x +
            observeEvent(active_datanames(), {
    @@ -10188,35 +10616,40 @@

    teal.slice coverage - 66.10%

    685 - 1x + 1x +
            lapply(
    686 - 1x + 1x +
              self$datanames(),
    687 - 1x + 1x +
              function(dataname) {
    688 - 2x + 2x +
                fdataset <- private$get_filtered_dataset(dataname)
    689 - 2x + 2x +
                fdataset$srv_add(id = dataname)
    @@ -10237,14 +10670,16 @@

    teal.slice coverage - 66.10%

    692 - 1x + 1x +
            logger::log_trace("FilteredData$srv_filter_panel initialized")
    693 - 1x + 1x +
            NULL
    @@ -10664,35 +11099,40 @@

    teal.slice coverage - 66.10%

    753 - 1x + 1x +
          checkmate::assert_class(active_datanames, "reactive")
    754 - 1x + 1x +
          moduleServer(
    755 - 1x + 1x +
            id = id,
    756 - 1x + 1x +
            function(input, output, session) {
    757 - 1x + 1x +
              logger::log_trace("FilteredData$srv_filter_overview initializing")
    @@ -10706,7 +11146,8 @@

    teal.slice coverage - 66.10%

    759 - 1x + 1x +
              observeEvent(input$minimise_filter_overview, {
    @@ -10748,7 +11189,8 @@

    teal.slice coverage - 66.10%

    765 - 1x + 1x +
              output$table <- renderUI({
    @@ -11252,14 +11694,16 @@

    teal.slice coverage - 66.10%

    837 - 1x + 1x +
              logger::log_trace("FilteredData$srv_filter_overview initialized")
    838 - 1x + 1x +
              NULL
    @@ -11518,7 +11962,8 @@

    teal.slice coverage - 66.10%

    875 - 147x + 147x +
          if (length(dataname) == 0) {
    @@ -11539,7 +11984,8 @@

    teal.slice coverage - 66.10%

    878 - 147x + 147x +
            private$filtered_datasets[[dataname]]
    @@ -11623,7 +12069,8 @@

    teal.slice coverage - 66.10%

    890 - 11x + 11x +
          length(self$get_filter_state())
    @@ -11889,28 +12336,32 @@

    teal.slice coverage - 66.10%

    928 - 4x + 4x +
          moduleServer(id, function(input, output, session) {
    929 - 4x + 4x +
            slices_available <- self$get_available_teal_slices()
    930 - 4x + 4x +
            slices_interactive <- reactive(
    931 - 4x + 4x +
              Filter(function(slice) isFALSE(slice$fixed), slices_available())
    @@ -11924,14 +12375,16 @@

    teal.slice coverage - 66.10%

    933 - 4x + 4x +
            slices_fixed <- reactive(
    934 - 4x + 4x +
              Filter(function(slice) isTRUE(slice$fixed), slices_available())
    @@ -11945,21 +12398,24 @@

    teal.slice coverage - 66.10%

    936 - 4x + 4x +
            available_slices_id <- reactive(vapply(slices_available(), `[[`, character(1), "id"))
    937 - 4x + 4x +
            active_slices_id <- reactive(vapply(self$get_filter_state(), `[[`, character(1), "id"))
    938 - 4x + 4x +
            duplicated_slice_references <- reactive({
    @@ -11973,35 +12429,40 @@

    teal.slice coverage - 66.10%

    940 - 8x + 8x +
              slice_reference <- vapply(slices_available(), get_default_slice_id, character(1))
    941 - 8x + 8x +
              is_duplicated_reference <- duplicated(slice_reference) | duplicated(slice_reference, fromLast = TRUE)
    942 - 8x + 8x +
              is_active <- available_slices_id() %in% active_slices_id()
    943 - 8x + 8x +
              is_not_expr <- !vapply(slices_available(), inherits, logical(1), "teal_slice_expr")
    944 - 8x + 8x +
              slice_reference[is_duplicated_reference & is_active & is_not_expr]
    @@ -12022,70 +12483,80 @@

    teal.slice coverage - 66.10%

    947 - 4x + 4x +
            checkbox_group_element <- function(name, value, label, checked, disabled = FALSE) {
    948 - 35x + 35x +
              tags$div(
    949 - 35x + 35x +
                class = "checkbox available-filters",
    950 - 35x + 35x +
                tags$label(
    951 - 35x + 35x +
                  tags$input(
    952 - 35x + 35x +
                    type = "checkbox",
    953 - 35x + 35x +
                    name = name,
    954 - 35x + 35x +
                    value = value,
    955 - 35x + 35x +
                    checked = checked,
    956 - 35x + 35x +
                    disabled = if (disabled) "disabled"
    @@ -12099,7 +12570,8 @@

    teal.slice coverage - 66.10%

    958 - 35x + 35x +
                  tags$span(label, disabled = if (disabled) disabled)
    @@ -12134,42 +12606,48 @@

    teal.slice coverage - 66.10%

    963 - 4x + 4x +
            output$checkbox <- renderUI({
    964 - 8x + 8x +
              checkbox <- checkboxGroupInput(
    965 - 8x + 8x +
                session$ns("available_slices_id"),
    966 - 8x + 8x +
                label = NULL,
    967 - 8x + 8x +
                choices = NULL,
    968 - 8x + 8x +
                selected = NULL
    @@ -12183,14 +12661,16 @@

    teal.slice coverage - 66.10%

    970 - 8x + 8x +
              active_slices_ids <- active_slices_id()
    971 - 8x + 8x +
              duplicated_slice_refs <- duplicated_slice_references()
    @@ -12204,7 +12684,8 @@

    teal.slice coverage - 66.10%

    973 - 8x + 8x +
              checkbox_group_slice <- function(slice) {
    @@ -12218,63 +12699,72 @@

    teal.slice coverage - 66.10%

    975 - 35x + 35x +
                isolate({
    976 - 35x + 35x +
                  checkbox_group_element(
    977 - 35x + 35x +
                    name = session$ns("available_slices_id"),
    978 - 35x + 35x +
                    value = slice$id,
    979 - 35x + 35x +
                    label = slice$id,
    980 - 35x + 35x +
                    checked = if (slice$id %in% active_slices_ids) "checked",
    981 - 35x + 35x +
                    disabled = slice$anchored ||
    982 - 35x + 35x +
                      get_default_slice_id(slice) %in% duplicated_slice_refs &&
    983 - 35x + 35x +
                        !slice$id %in% active_slices_ids
    @@ -12309,14 +12799,16 @@

    teal.slice coverage - 66.10%

    988 - 8x + 8x +
              interactive_choice_mock <- lapply(slices_interactive(), checkbox_group_slice)
    989 - 8x + 8x +
              non_interactive_choice_mock <- lapply(slices_fixed(), checkbox_group_slice)
    @@ -12330,63 +12822,72 @@

    teal.slice coverage - 66.10%

    991 - 8x + 8x +
              htmltools::tagInsertChildren(
    992 - 8x + 8x +
                checkbox,
    993 - 8x + 8x +
                br(),
    994 - 8x + 8x +
                if (length(non_interactive_choice_mock)) tags$strong("Fixed filters"),
    995 - 8x + 8x +
                non_interactive_choice_mock,
    996 - 8x + 8x +
                if (length(interactive_choice_mock)) tags$strong("Interactive filters"),
    997 - 8x + 8x +
                interactive_choice_mock,
    998 - 8x + 8x +
                .cssSelector = "div.shiny-options-group",
    999 - 8x + 8x +
                after = 0
    @@ -12414,49 +12915,56 @@

    teal.slice coverage - 66.10%

    1003 - 4x + 4x +
            observeEvent(input$available_slices_id, ignoreNULL = FALSE, ignoreInit = TRUE, {
    1004 - 5x + 5x +
              new_slices_id <- setdiff(input$available_slices_id, active_slices_id())
    1005 - 5x + 5x +
              removed_slices_id <- setdiff(active_slices_id(), input$available_slices_id)
    1006 - 5x + 5x +
              if (length(new_slices_id)) {
    1007 - 3x + 3x +
                new_teal_slices <- Filter(
    1008 - 3x + 3x +
                  function(slice) slice$id %in% new_slices_id,
    1009 - 3x + 3x +
                  private$available_teal_slices()
    @@ -12470,7 +12978,8 @@

    teal.slice coverage - 66.10%

    1011 - 3x + 3x +
                self$set_filter_state(new_teal_slices)
    @@ -12491,28 +13000,32 @@

    teal.slice coverage - 66.10%

    1014 - 5x + 5x +
              if (length(removed_slices_id)) {
    1015 - 4x + 4x +
                removed_teal_slices <- Filter(
    1016 - 4x + 4x +
                  function(slice) slice$id %in% removed_slices_id,
    1017 - 4x + 4x +
                  self$get_filter_state()
    @@ -12526,7 +13039,8 @@

    teal.slice coverage - 66.10%

    1019 - 4x + 4x +
                self$remove_filter_state(removed_teal_slices)
    @@ -12554,21 +13068,24 @@

    teal.slice coverage - 66.10%

    1023 - 4x + 4x +
            observeEvent(private$available_teal_slices(), ignoreNULL = FALSE, {
    1024 - 3x + 3x +
              if (length(private$available_teal_slices())) {
    1025 - 1x + 1x +
                shinyjs::show("available_menu")
    @@ -12582,7 +13099,8 @@

    teal.slice coverage - 66.10%

    1027 - 2x + 2x +
                shinyjs::hide("available_menu")
    @@ -12959,28 +13477,32 @@

    teal.slice coverage - 66.10%

    47 - 16x + 16x +
          isolate({
    48 - 16x + 16x +
            checkmate::assert_logical(x)
    49 - 15x + 15x +
            checkmate::assert_logical(slice$selected, null.ok = TRUE)
    50 - 14x + 14x +
            super$initialize(x = x, x_reactive = x_reactive, slice = slice, extract_type = extract_type)
    @@ -12994,7 +13516,8 @@

    teal.slice coverage - 66.10%

    52 - 14x + 14x +
            private$set_choices(slice$choices)
    @@ -13008,28 +13531,32 @@

    teal.slice coverage - 66.10%

    54 - 14x + 14x +
            if (is.null(slice$selected) && slice$multiple) {
    55 - 7x + 7x +
              slice$selected <- private$get_choices()
    56 - 7x + 7x +
            } else if (length(slice$selected) != 1 && !slice$multiple) {
    57 - 3x + 3x +
              slice$selected <- TRUE
    @@ -13043,28 +13570,32 @@

    teal.slice coverage - 66.10%

    59 - 14x + 14x +
            private$set_selected(slice$selected)
    60 - 14x + 14x +
            df <- factor(x, levels = c(TRUE, FALSE))
    61 - 14x + 14x +
            tbl <- table(df)
    62 - 14x + 14x +
            private$set_choices_counts(tbl)
    @@ -13078,7 +13609,8 @@

    teal.slice coverage - 66.10%

    64 - 14x + 14x +
          invisible(self)
    @@ -13148,7 +13680,8 @@

    teal.slice coverage - 66.10%

    74 - 6x + 6x +
          if (isFALSE(private$is_any_filtered())) {
    @@ -13169,28 +13702,32 @@

    teal.slice coverage - 66.10%

    77 - 4x + 4x +
          if (missing(dataname)) dataname <- private$get_dataname()
    78 - 6x + 6x +
          varname <- private$get_varname_prefixed(dataname)
    79 - 6x + 6x +
          choices <- private$get_selected()
    80 - 6x + 6x +
          n_choices <- length(choices)
    @@ -13204,35 +13741,40 @@

    teal.slice coverage - 66.10%

    82 - 6x + 6x +
          filter_call <-
    83 - 6x + 6x +
            if (n_choices == 1 && choices) {
    84 - 1x + 1x +
              varname
    85 - 6x + 6x +
            } else if (n_choices == 1 && !choices) {
    86 - 4x + 4x +
              call("!", varname)
    @@ -13246,7 +13788,8 @@

    teal.slice coverage - 66.10%

    88 - 1x + 1x +
              call("%in%", varname, make_c_call(choices))
    @@ -13260,7 +13803,8 @@

    teal.slice coverage - 66.10%

    90 - 6x + 6x +
          private$add_keep_na_call(filter_call, varname)
    @@ -13330,14 +13874,16 @@

    teal.slice coverage - 66.10%

    100 - 14x + 14x +
          private$teal_slice$choices <- c(TRUE, FALSE)
    101 - 14x + 14x +
          invisible(NULL)
    @@ -13372,14 +13918,16 @@

    teal.slice coverage - 66.10%

    106 - 14x + 14x +
          private$choices_counts <- choices_counts
    107 - 14x + 14x +
          invisible(NULL)
    @@ -13400,35 +13948,40 @@

    teal.slice coverage - 66.10%

    110 - 21x + 21x +
          tryCatch(
    111 - 21x + 21x +
            expr = {
    112 - 21x + 21x +
              values <- as.logical(values)
    113 - 1x + 1x +
              if (anyNA(values)) stop()
    114 - 20x + 20x +
              values
    @@ -13442,7 +13995,8 @@

    teal.slice coverage - 66.10%

    116 - 21x + 21x +
            error = function(e) stop("Vector of set values must contain values coercible to logical.")
    @@ -13477,28 +14031,32 @@

    teal.slice coverage - 66.10%

    121 - 20x + 20x +
          if (!private$is_multiple() && length(values) > 1) {
    122 - 1x + 1x +
            warning(
    123 - 1x + 1x +
              sprintf("Selection: %s is not a vector of length one. ", toString(values, width = 360)),
    124 - 1x + 1x +
              "Maintaining previous selection."
    @@ -13512,7 +14070,8 @@

    teal.slice coverage - 66.10%

    126 - 1x + 1x +
            values <- isolate(private$get_selected())
    @@ -13526,7 +14085,8 @@

    teal.slice coverage - 66.10%

    128 - 20x + 20x +
          values
    @@ -13568,7 +14128,8 @@

    teal.slice coverage - 66.10%

    134 - 6x + 6x +
          if (private$is_choice_limited) {
    @@ -13582,14 +14143,16 @@

    teal.slice coverage - 66.10%

    136 - 6x + 6x +
          } else if (all(private$choices_counts > 0)) {
    137 - 6x + 6x +
            TRUE
    @@ -15254,21 +15817,24 @@

    teal.slice coverage - 66.10%

    48 - 24x + 24x +
          isolate({
    49 - 24x + 24x +
            checkmate::assert_date(x)
    50 - 23x + 23x +
            checkmate::assert_class(x_reactive, "reactive")
    @@ -15282,35 +15848,40 @@

    teal.slice coverage - 66.10%

    52 - 23x + 23x +
            super$initialize(
    53 - 23x + 23x +
              x = x,
    54 - 23x + 23x +
              x_reactive = x_reactive,
    55 - 23x + 23x +
              slice = slice,
    56 - 23x + 23x +
              extract_type = extract_type
    @@ -15324,28 +15895,32 @@

    teal.slice coverage - 66.10%

    58 - 23x + 23x +
            checkmate::assert_date(slice$choices, null.ok = TRUE)
    59 - 22x + 22x +
            private$set_choices(slice$choices)
    60 - 14x + 14x +
            if (is.null(slice$selected)) slice$selected <- slice$choices
    61 - 22x + 22x +
            private$set_selected(slice$selected)
    @@ -15366,7 +15941,8 @@

    teal.slice coverage - 66.10%

    64 - 21x + 21x +
          invisible(self)
    @@ -15443,14 +16019,16 @@

    teal.slice coverage - 66.10%

    75 - 7x + 7x +
          if (isFALSE(private$is_any_filtered())) {
    76 - 1x + 1x +
            return(NULL)
    @@ -15464,28 +16042,32 @@

    teal.slice coverage - 66.10%

    78 - 6x + 6x +
          choices <- as.character(private$get_selected())
    79 - 6x + 6x +
          varname <- private$get_varname_prefixed(dataname)
    80 - 6x + 6x +
          filter_call <-
    81 - 6x + 6x +
            call(
    @@ -15499,14 +16081,16 @@

    teal.slice coverage - 66.10%

    83 - 6x + 6x +
              call(">=", varname, call("as.Date", choices[1L])),
    84 - 6x + 6x +
              call("<=", varname, call("as.Date", choices[2L]))
    @@ -15520,7 +16104,8 @@

    teal.slice coverage - 66.10%

    86 - 6x + 6x +
          private$add_keep_na_call(filter_call, varname)
    @@ -15576,14 +16161,16 @@

    teal.slice coverage - 66.10%

    94 - 22x + 22x +
          if (is.null(choices)) {
    95 - 19x + 19x +
            choices <- range(private$x, na.rm = TRUE)
    @@ -15597,35 +16184,40 @@

    teal.slice coverage - 66.10%

    97 - 3x + 3x +
            choices_adjusted <- c(max(choices[1L], min(private$x)), min(choices[2L], max(private$x)))
    98 - 3x + 3x +
            if (any(choices != choices_adjusted)) {
    99 - 1x + 1x +
              warning(sprintf(
    100 - 1x + 1x +
                "Choices adjusted (some values outside of variable range). Varname: %s, dataname: %s.",
    101 - 1x + 1x +
                private$get_varname(), private$get_dataname()
    @@ -15639,7 +16231,8 @@

    teal.slice coverage - 66.10%

    103 - 1x + 1x +
              choices <- choices_adjusted
    @@ -15653,35 +16246,40 @@

    teal.slice coverage - 66.10%

    105 - 3x + 3x +
            if (choices[1L] >= choices[2L]) {
    106 - 1x + 1x +
              warning(sprintf(
    107 - 1x + 1x +
                "Invalid choices: lower is higher / equal to upper, or not in range of variable values.
    108 - 1x + 1x +
                Setting defaults. Varname: %s, dataname: %s.",
    109 - 1x + 1x +
                private$get_varname(), private$get_dataname()
    @@ -15695,7 +16293,8 @@

    teal.slice coverage - 66.10%

    111 - 1x + 1x +
              choices <- range(private$x, na.rm = TRUE)
    @@ -15716,28 +16315,32 @@

    teal.slice coverage - 66.10%

    114 - 22x + 22x +
          private$set_is_choice_limited(private$x, choices)
    115 - 22x + 22x +
          private$x <- private$x[(private$x >= choices[1L] & private$x <= choices[2L]) | is.na(private$x)]
    116 - 22x + 22x +
          private$teal_slice$choices <- choices
    117 - 22x + 22x +
          invisible(NULL)
    @@ -15779,14 +16382,16 @@

    teal.slice coverage - 66.10%

    123 - 22x + 22x +
          private$is_choice_limited <- (any(xl < choices[1L], na.rm = TRUE) | any(xl > choices[2L], na.rm = TRUE))
    124 - 22x + 22x +
          invisible(NULL)
    @@ -15807,21 +16412,24 @@

    teal.slice coverage - 66.10%

    127 - 33x + 33x +
          tryCatch(
    128 - 33x + 33x +
            expr = {
    129 - 33x + 33x +
              values <- as.Date(values, origin = "1970-01-01")
    @@ -15835,7 +16443,8 @@

    teal.slice coverage - 66.10%

    131 - 30x + 30x +
              values
    @@ -15849,7 +16458,8 @@

    teal.slice coverage - 66.10%

    133 - 33x + 33x +
            error = function(e) stop("Vector of set values must contain values coercible to Date.")
    @@ -15877,42 +16487,48 @@

    teal.slice coverage - 66.10%

    137 - 1x + 1x +
          if (length(values) != 2) stop("Vector of set values must have length two.")
    138 - 29x + 29x +
          if (values[1] > values[2]) {
    139 - 1x + 1x +
            warning(
    140 - 1x + 1x +
              sprintf(
    141 - 1x + 1x +
                "Start date %s is set after the end date %s, the values will be replaced with a default date range.",
    142 - 1x + 1x +
                values[1], values[2]
    @@ -15933,7 +16549,8 @@

    teal.slice coverage - 66.10%

    145 - 1x + 1x +
            values <- isolate(private$get_choices())
    @@ -15947,7 +16564,8 @@

    teal.slice coverage - 66.10%

    147 - 29x + 29x +
          values
    @@ -15968,42 +16586,48 @@

    teal.slice coverage - 66.10%

    150 - 29x + 29x +
          choices <- private$get_choices()
    151 - 29x + 29x +
          if (values[1] < choices[1L] | values[1] > choices[2L]) {
    152 - 5x + 5x +
            warning(
    153 - 5x + 5x +
              sprintf(
    154 - 5x + 5x +
                "Value: %s is outside of the possible range for column %s of dataset %s, setting minimum possible value.",
    155 - 5x + 5x +
                values[1], private$get_varname(), private$get_dataname()
    @@ -16024,7 +16648,8 @@

    teal.slice coverage - 66.10%

    158 - 5x + 5x +
            values[1] <- choices[1L]
    @@ -16045,35 +16670,40 @@

    teal.slice coverage - 66.10%

    161 - 29x + 29x +
          if (values[2] > choices[2L] | values[2] < choices[1L]) {
    162 - 5x + 5x +
            warning(
    163 - 5x + 5x +
              sprintf(
    164 - 5x + 5x +
                "Value: %s is outside of the possible range for column %s of dataset %s, setting maximum possible value.",
    165 - 5x + 5x +
                values[2], private$get_varname(), private$get_dataname()
    @@ -16094,7 +16724,8 @@

    teal.slice coverage - 66.10%

    168 - 5x + 5x +
            values[2] <- choices[2L]
    @@ -16115,7 +16746,8 @@

    teal.slice coverage - 66.10%

    171 - 29x + 29x +
          values
    @@ -17640,14 +18272,16 @@

    teal.slice coverage - 66.10%

    46 - 103x + 103x +
          checkmate::assert_data_frame(dataset)
    47 - 101x + 101x +
          super$initialize(dataset, dataname, keys, label)
    @@ -17668,21 +18302,24 @@

    teal.slice coverage - 66.10%

    50 - 99x + 99x +
          if (!is.null(parent)) {
    51 - 10x + 10x +
            checkmate::assert_character(parent_name, len = 1)
    52 - 10x + 10x +
            checkmate::assert_character(join_keys, min.len = 1)
    @@ -17696,14 +18333,16 @@

    teal.slice coverage - 66.10%

    54 - 10x + 10x +
            private$parent_name <- parent_name
    55 - 10x + 10x +
            private$join_keys <- join_keys
    @@ -17717,28 +18356,32 @@

    teal.slice coverage - 66.10%

    57 - 10x + 10x +
            private$data_filtered_fun <- function(sid = "") {
    58 - 8x + 8x +
              checkmate::assert_character(sid)
    59 - 8x + 8x +
              if (length(sid)) {
    60 - 8x + 8x +
                logger::log_trace("filtering data dataname: { dataname }, sid: { sid }")
    @@ -17766,42 +18409,48 @@

    teal.slice coverage - 66.10%

    64 - 8x + 8x +
              env <- new.env(parent = parent.env(globalenv()))
    65 - 8x + 8x +
              env[[dataname]] <- private$dataset
    66 - 8x + 8x +
              env[[parent_name]] <- parent()
    67 - 8x + 8x +
              filter_call <- self$get_call(sid)
    68 - 8x + 8x +
              eval_expr_with_msg(filter_call, env)
    69 - 8x + 8x +
              get(x = dataname, envir = env)
    @@ -17829,42 +18478,48 @@

    teal.slice coverage - 66.10%

    73 - 99x + 99x +
          private$add_filter_states(
    74 - 99x + 99x +
            filter_states = init_filter_states(
    75 - 99x + 99x +
              data = dataset,
    76 - 99x + 99x +
              data_reactive = private$data_filtered_fun,
    77 - 99x + 99x +
              dataname = dataname,
    78 - 99x + 99x +
              keys = self$get_keys()
    @@ -17878,7 +18533,8 @@

    teal.slice coverage - 66.10%

    80 - 99x + 99x +
            id = "filter"
    @@ -17906,35 +18562,40 @@

    teal.slice coverage - 66.10%

    84 - 99x + 99x +
          if (!is.null(parent)) {
    85 - 10x + 10x +
            fs <- teal_slices(
    86 - 10x + 10x +
              exclude_varnames = structure(
    87 - 10x + 10x +
                list(intersect(colnames(dataset), colnames(isolate(parent())))),
    88 - 10x + 10x +
                names = private$dataname
    @@ -17955,7 +18616,8 @@

    teal.slice coverage - 66.10%

    91 - 10x + 10x +
            self$set_filter_state(fs)
    @@ -17976,7 +18638,8 @@

    teal.slice coverage - 66.10%

    94 - 99x + 99x +
          invisible(self)
    @@ -18102,28 +18765,32 @@

    teal.slice coverage - 66.10%

    112 - 42x + 42x +
          logger::log_trace("DataframeFilteredDataset$get_call initializing for dataname: { private$dataname }")
    113 - 42x + 42x +
          filter_call <- super$get_call(sid)
    114 - 42x + 42x +
          dataname <- private$dataname
    115 - 42x + 42x +
          parent_dataname <- private$parent_name
    @@ -18137,28 +18804,32 @@

    teal.slice coverage - 66.10%

    117 - 42x + 42x +
          if (!identical(parent_dataname, character(0))) {
    118 - 9x + 9x +
            join_keys <- private$join_keys
    119 - 9x + 9x +
            parent_keys <- unname(join_keys)
    120 - 9x + 9x +
            dataset_keys <- names(join_keys)
    @@ -18172,7 +18843,8 @@

    teal.slice coverage - 66.10%

    122 - 9x + 9x +
            y_arg <- if (length(parent_keys) == 0L) {
    @@ -18193,28 +18865,32 @@

    teal.slice coverage - 66.10%

    125 - 9x + 9x +
              sprintf(
    126 - 9x + 9x +
                "%s[, c(%s), drop = FALSE]",
    127 - 9x + 9x +
                parent_dataname,
    128 - 9x + 9x +
                toString(dQuote(parent_keys, q = FALSE))
    @@ -18242,7 +18918,8 @@

    teal.slice coverage - 66.10%

    132 - 9x + 9x +
            more_args <- if (length(parent_keys) == 0 || length(dataset_keys) == 0) {
    @@ -18256,14 +18933,16 @@

    teal.slice coverage - 66.10%

    134 - 9x + 9x +
            } else if (identical(parent_keys, dataset_keys)) {
    135 - 7x + 7x +
              list(by = parent_keys)
    @@ -18277,7 +18956,8 @@

    teal.slice coverage - 66.10%

    137 - 2x + 2x +
              list(by = stats::setNames(parent_keys, dataset_keys))
    @@ -18298,7 +18978,8 @@

    teal.slice coverage - 66.10%

    140 - 9x + 9x +
            merge_call <- call(
    @@ -18312,49 +18993,56 @@

    teal.slice coverage - 66.10%

    142 - 9x + 9x +
              as.name(dataname),
    143 - 9x + 9x +
              as.call(
    144 - 9x + 9x +
                c(
    145 - 9x + 9x +
                  str2lang("dplyr::inner_join"),
    146 - 9x + 9x +
                  x = as.name(dataname),
    147 - 9x + 9x +
                  y = str2lang(y_arg),
    148 - 9x + 9x +
                  more_args
    @@ -18389,7 +19077,8 @@

    teal.slice coverage - 66.10%

    153 - 9x + 9x +
            filter_call <- c(filter_call, merge_call)
    @@ -18403,14 +19092,16 @@

    teal.slice coverage - 66.10%

    155 - 42x + 42x +
          logger::log_trace("DataframeFilteredDataset$get_call initializing for dataname: { private$dataname }")
    156 - 42x + 42x +
          filter_call
    @@ -18480,35 +19171,40 @@

    teal.slice coverage - 66.10%

    166 - 81x + 81x +
          isolate({
    167 - 81x + 81x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initializing, dataname: { private$dataname }")
    168 - 81x + 81x +
            checkmate::assert_class(state, "teal_slices")
    169 - 80x + 80x +
            lapply(state, function(slice) {
    170 - 97x + 97x +
              checkmate::assert_true(slice$dataname == private$dataname)
    @@ -18522,14 +19218,16 @@

    teal.slice coverage - 66.10%

    172 - 80x + 80x +
            private$get_filter_states()[[1L]]$set_filter_state(state = state)
    173 - 80x + 80x +
            invisible(NULL)
    @@ -18627,7 +19325,8 @@

    teal.slice coverage - 66.10%

    187 - 11x + 11x +
          checkmate::assert_class(state, "teal_slices")
    @@ -18641,14 +19340,16 @@

    teal.slice coverage - 66.10%

    189 - 11x + 11x +
          isolate({
    190 - 11x + 11x +
            logger::log_trace("{ class(self)[1] }$remove_filter_state removing filter(s), dataname: { private$dataname }")
    @@ -18662,14 +19363,16 @@

    teal.slice coverage - 66.10%

    192 - 11x + 11x +
            varnames <- unique(unlist(lapply(state, "[[", "varname")))
    193 - 11x + 11x +
            private$get_filter_states()[[1]]$remove_filter_state(state)
    @@ -18683,7 +19386,8 @@

    teal.slice coverage - 66.10%

    195 - 11x + 11x +
            logger::log_trace("{ class(self)[1] }$remove_filter_state removed filter(s), dataname: { private$dataname }")
    @@ -18704,7 +19408,8 @@

    teal.slice coverage - 66.10%

    198 - 11x + 11x +
          invisible(NULL)
    @@ -18865,7 +19570,8 @@

    teal.slice coverage - 66.10%

    221 - 12x + 12x +
          logger::log_trace("FilteredDataset$srv_filter_overview initialized")
    @@ -18886,14 +19592,16 @@

    teal.slice coverage - 66.10%

    224 - 12x + 12x +
          subject_keys <- if (length(private$parent_name) > 0) {
    225 - 1x + 1x +
            names(private$join_keys)
    @@ -18907,7 +19615,8 @@

    teal.slice coverage - 66.10%

    227 - 11x + 11x +
            self$get_keys()
    @@ -18921,49 +19630,56 @@

    teal.slice coverage - 66.10%

    229 - 12x + 12x +
          dataset <- self$get_dataset()
    230 - 12x + 12x +
          data_filtered <- self$get_dataset(TRUE)
    231 - 12x + 12x +
          if (length(subject_keys) == 0) {
    232 - 10x + 10x +
            data.frame(
    233 - 10x + 10x +
              dataname = private$dataname,
    234 - 10x + 10x +
              obs = nrow(dataset),
    235 - 10x + 10x +
              obs_filtered = nrow(data_filtered())
    @@ -18984,42 +19700,48 @@

    teal.slice coverage - 66.10%

    238 - 2x + 2x +
            data.frame(
    239 - 2x + 2x +
              dataname = private$dataname,
    240 - 2x + 2x +
              obs = nrow(dataset),
    241 - 2x + 2x +
              obs_filtered = nrow(data_filtered()),
    242 - 2x + 2x +
              subjects = nrow(unique(dataset[subject_keys])),
    243 - 2x + 2x +
              subjects_filtered = nrow(unique(data_filtered()[subject_keys]))
    @@ -19983,35 +20705,40 @@

    teal.slice coverage - 66.10%

    75 - 368x + 368x +
          checkmate::assert_class(x_reactive, "reactive")
    76 - 367x + 367x +
          checkmate::assert_class(slice, "teal_slice")
    77 - 365x + 365x +
          checkmate::assert_character(extract_type, max.len = 1, any.missing = FALSE)
    78 - 365x + 365x +
          if (length(extract_type) == 1) {
    79 - 53x + 53x +
            checkmate::assert_choice(extract_type, choices = c("list", "matrix"))
    @@ -20039,14 +20766,16 @@

    teal.slice coverage - 66.10%

    83 - 364x + 364x +
          private$x <- x
    84 - 364x + 364x +
          private$x_reactive <- x_reactive
    @@ -20060,21 +20789,24 @@

    teal.slice coverage - 66.10%

    86 - 364x + 364x +
          private$na_count <- sum(is.na(x))
    87 - 364x + 364x +
          private$filtered_na_count <- reactive(
    88 - 364x + 364x +
            if (!is.null(private$x_reactive())) {
    @@ -20109,7 +20841,8 @@

    teal.slice coverage - 66.10%

    93 - 364x + 364x +
          private$extract_type <- extract_type
    @@ -20130,14 +20863,16 @@

    teal.slice coverage - 66.10%

    96 - 18x + 18x +
          if (is.null(isolate(slice$keep_na)) && anyNA(x)) slice$keep_na <- TRUE
    97 - 364x + 364x +
          private$teal_slice <- slice
    @@ -20151,7 +20886,8 @@

    teal.slice coverage - 66.10%

    99 - 364x + 364x +
          varlabel <- attr(x, "label")
    @@ -20165,21 +20901,24 @@

    teal.slice coverage - 66.10%

    101 - 364x + 364x +
          private$varlabel <-
    102 - 364x + 364x +
            if (is.null(varlabel) || identical(varlabel, private$get_varname())) {
    103 - 363x + 363x +
              character(0)
    @@ -20193,7 +20932,8 @@

    teal.slice coverage - 66.10%

    105 - 1x + 1x +
              varlabel
    @@ -20214,7 +20954,8 @@

    teal.slice coverage - 66.10%

    108 - 364x + 364x +
          private$state_history <- reactiveVal(list())
    @@ -20228,7 +20969,8 @@

    teal.slice coverage - 66.10%

    110 - 364x + 364x +
          logger::log_trace("Instantiated FilterState object id: { private$get_id() }")
    @@ -20242,7 +20984,8 @@

    teal.slice coverage - 66.10%

    112 - 364x + 364x +
          invisible(self)
    @@ -20326,28 +21069,32 @@

    teal.slice coverage - 66.10%

    124 - 68x + 68x +
          sprintf(
    125 - 68x + 68x +
            "%s:\n%s",
    126 - 68x + 68x +
            class(self)[1],
    127 - 68x + 68x +
            format(self$get_state(), show_all = show_all, trim_lines = trim_lines)
    @@ -20417,7 +21164,8 @@

    teal.slice coverage - 66.10%

    137 - 14x + 14x +
          cat(isolate(self$format(...)))
    @@ -20508,21 +21256,24 @@

    teal.slice coverage - 66.10%

    150 - 89x + 89x +
          checkmate::assert_class(state, "teal_slice")
    151 - 88x + 88x +
          if (private$is_fixed()) {
    152 - 1x + 1x +
            logger::log_warn("attempt to set state on fixed filter aborted id: { private$get_id() }")
    @@ -20536,28 +21287,32 @@

    teal.slice coverage - 66.10%

    154 - 87x + 87x +
            logger::log_trace("{ class(self)[1] }$set_state setting state of filter id: { private$get_id() }")
    155 - 87x + 87x +
            isolate({
    156 - 87x + 87x +
              if (!is.null(state$selected)) {
    157 - 78x + 78x +
                private$set_selected(state$selected)
    @@ -20571,14 +21326,16 @@

    teal.slice coverage - 66.10%

    159 - 75x + 75x +
              if (!is.null(state$keep_na)) {
    160 - 16x + 16x +
                private$set_keep_na(state$keep_na)
    @@ -20592,14 +21349,16 @@

    teal.slice coverage - 66.10%

    162 - 75x + 75x +
              if (!is.null(state$keep_inf)) {
    163 - 9x + 9x +
                private$set_keep_inf(state$keep_inf)
    @@ -20613,35 +21372,40 @@

    teal.slice coverage - 66.10%

    165 - 75x + 75x +
              current_state <- sprintf(
    166 - 75x + 75x +
                "selected: %s; keep_na: %s; keep_inf: %s",
    167 - 75x + 75x +
                toString(private$get_selected()),
    168 - 75x + 75x +
                private$get_keep_na(),
    169 - 75x + 75x +
                private$get_keep_inf()
    @@ -20676,7 +21440,8 @@

    teal.slice coverage - 66.10%

    174 - 76x + 76x +
          invisible(self)
    @@ -20746,7 +21511,8 @@

    teal.slice coverage - 66.10%

    184 - 747x + 747x +
          private$teal_slice
    @@ -20816,7 +21582,8 @@

    teal.slice coverage - 66.10%

    194 - 1x + 1x +
          stop("this is a virtual method")
    @@ -20900,42 +21667,48 @@

    teal.slice coverage - 66.10%

    206 - 12x + 12x +
          moduleServer(
    207 - 12x + 12x +
            id = id,
    208 - 12x + 12x +
            function(input, output, session) {
    209 - 12x + 12x +
              logger::log_trace("FilterState$server initializing module for slice: { private$get_id() } ")
    210 - 12x + 12x +
              private$server_summary("summary")
    211 - 12x + 12x +
              if (private$is_fixed()) {
    @@ -20956,7 +21729,8 @@

    teal.slice coverage - 66.10%

    214 - 12x + 12x +
                private$server_inputs("inputs")
    @@ -20977,49 +21751,56 @@

    teal.slice coverage - 66.10%

    217 - 12x + 12x +
              private$observers$state <- observeEvent(
    218 - 12x + 12x +
                eventExpr = list(private$get_selected(), private$get_keep_na(), private$get_keep_inf()),
    219 - 12x + 12x +
                handlerExpr = {
    220 - 4x + 4x +
                  current_state <- as.list(self$get_state())
    221 - 4x + 4x +
                  history <- private$state_history()
    222 - 4x + 4x +
                  history_update <- c(history, list(current_state))
    223 - 4x + 4x +
                  private$state_history(history_update)
    @@ -21047,21 +21828,24 @@

    teal.slice coverage - 66.10%

    227 - 12x + 12x +
              private$observers$back <- observeEvent(
    228 - 12x + 12x +
                eventExpr = input$back,
    229 - 12x + 12x +
                handlerExpr = {
    @@ -21124,21 +21908,24 @@

    teal.slice coverage - 66.10%

    238 - 12x + 12x +
              private$observers$reset <- observeEvent(
    239 - 12x + 12x +
                eventExpr = input$reset,
    240 - 12x + 12x +
                handlerExpr = {
    @@ -21194,56 +21981,64 @@

    teal.slice coverage - 66.10%

    248 - 12x + 12x +
              private$observers$state_history <- observeEvent(
    249 - 12x + 12x +
                eventExpr = private$state_history(),
    250 - 12x + 12x +
                handlerExpr = {
    251 - 4x + 4x +
                  shinyjs::disable(id = "back")
    252 - 4x + 4x +
                  shinyjs::disable(id = "reset")
    253 - 4x + 4x +
                  shinyjs::delay(
    254 - 4x + 4x +
                    ms = 100,
    255 - 4x + 4x +
                    expr = {
    @@ -21278,21 +22073,24 @@

    teal.slice coverage - 66.10%

    260 - 4x + 4x +
                  shinyjs::delay(
    261 - 4x + 4x +
                    ms = 100,
    262 - 4x + 4x +
                    expr = {
    @@ -21348,14 +22146,16 @@

    teal.slice coverage - 66.10%

    270 - 12x + 12x +
              private$destroy_shiny <- function() {
    271 - 8x + 8x +
                logger::log_trace("Destroying FilterState inputs and observers; id: { private$get_id() }")
    @@ -21369,7 +22169,8 @@

    teal.slice coverage - 66.10%

    273 - 8x + 8x +
                lapply(session$ns(names(input)), .subset2(input, "impl")$.values$remove)
    @@ -21390,7 +22191,8 @@

    teal.slice coverage - 66.10%

    276 - 8x + 8x +
                lapply(private$observers, function(x) x$destroy())
    @@ -21411,7 +22213,8 @@

    teal.slice coverage - 66.10%

    279 - 12x + 12x +
              reactive(input$remove)
    @@ -21495,7 +22298,8 @@

    teal.slice coverage - 66.10%

    291 - 12x + 12x +
          ns <- NS(id)
    @@ -21551,84 +22355,96 @@

    teal.slice coverage - 66.10%

    299 - 12x + 12x +
          div(
    300 - 12x + 12x +
            id = id,
    301 - 12x + 12x +
            class = "panel filter-card",
    302 - 12x + 12x +
            include_js_files("count-bar-labels.js"),
    303 - 12x + 12x +
            div(
    304 - 12x + 12x +
              class = "filter-card-header",
    305 - 12x + 12x +
              `data-toggle` = "collapse",
    306 - 12x + 12x +
              `data-bs-toggle` = "collapse",
    307 - 12x + 12x +
              href = paste0("#", ns("body")),
    308 - 12x + 12x +
              div(
    309 - 12x + 12x +
                class = "filter-card-title",
    310 - 12x + 12x +
                if (private$is_anchored() && private$is_fixed()) {
    @@ -21642,7 +22458,8 @@

    teal.slice coverage - 66.10%

    312 - 12x + 12x +
                } else if (private$is_anchored() && !private$is_fixed()) {
    @@ -21656,7 +22473,8 @@

    teal.slice coverage - 66.10%

    314 - 12x + 12x +
                } else if (!private$is_anchored() && private$is_fixed()) {
    @@ -21677,28 +22495,32 @@

    teal.slice coverage - 66.10%

    317 - 12x + 12x +
                div(class = "filter-card-varname", strong(private$get_varname())),
    318 - 12x + 12x +
                div(class = "filter-card-varlabel", private$get_varlabel()),
    319 - 12x + 12x +
                div(
    320 - 12x + 12x +
                  class = "filter-card-controls",
    @@ -21719,7 +22541,8 @@

    teal.slice coverage - 66.10%

    323 - 12x + 12x +
                  onclick = "event.stopPropagation();event.preventDefault();",
    @@ -21733,70 +22556,80 @@

    teal.slice coverage - 66.10%

    325 - 12x + 12x +
                  `data-bs-toggle` = "collapse",
    326 - 12x + 12x +
                  `data-bs-target` = NULL,
    327 - 12x + 12x +
                  if (isFALSE(private$is_fixed())) {
    328 - 12x + 12x +
                    actionLink(
    329 - 12x + 12x +
                      inputId = ns("back"),
    330 - 12x + 12x +
                      label = NULL,
    331 - 12x + 12x +
                      icon = icon("circle-arrow-left", lib = "font-awesome"),
    332 - 12x + 12x +
                      title = "Rewind state",
    333 - 12x + 12x +
                      class = "filter-card-back",
    334 - 12x + 12x +
                      style = "display: none"
    @@ -21817,56 +22650,64 @@

    teal.slice coverage - 66.10%

    337 - 12x + 12x +
                  if (isFALSE(private$is_fixed())) {
    338 - 12x + 12x +
                    actionLink(
    339 - 12x + 12x +
                      inputId = ns("reset"),
    340 - 12x + 12x +
                      label = NULL,
    341 - 12x + 12x +
                      icon = icon("circle-arrow-up", lib = "font-awesome"),
    342 - 12x + 12x +
                      title = "Restore original state",
    343 - 12x + 12x +
                      class = "filter-card-back",
    344 - 12x + 12x +
                      style = "display: none"
    @@ -21887,42 +22728,48 @@

    teal.slice coverage - 66.10%

    347 - 12x + 12x +
                  if (isFALSE(private$is_anchored())) {
    348 - 12x + 12x +
                    actionLink(
    349 - 12x + 12x +
                      inputId = ns("remove"),
    350 - 12x + 12x +
                      label = icon("circle-xmark", lib = "font-awesome"),
    351 - 12x + 12x +
                      title = "Remove filter",
    352 - 12x + 12x +
                      class = "filter-card-remove"
    @@ -21957,7 +22804,8 @@

    teal.slice coverage - 66.10%

    357 - 12x + 12x +
              div(class = "filter-card-summary", private$ui_summary(ns("summary")))
    @@ -21971,56 +22819,64 @@

    teal.slice coverage - 66.10%

    359 - 12x + 12x +
            div(
    360 - 12x + 12x +
              id = ns("body"),
    361 - 12x + 12x +
              class = "collapse out",
    362 - 12x + 12x +
              `data-parent` = paste0("#", parent_id),
    363 - 12x + 12x +
              `data-bs-parent` = paste0("#", parent_id),
    364 - 12x + 12x +
              div(
    365 - 12x + 12x +
                class = "filter-card-body",
    366 - 12x + 12x +
                if (private$is_fixed()) {
    @@ -22041,7 +22897,8 @@

    teal.slice coverage - 66.10%

    369 - 12x + 12x +
                  private$ui_inputs(ns("inputs"))
    @@ -22132,14 +22989,16 @@

    teal.slice coverage - 66.10%

    382 - 47x + 47x +
          if (!is.null(private$destroy_shiny)) {
    383 - 8x + 8x +
            private$destroy_shiny()
    @@ -22433,35 +23292,40 @@

    teal.slice coverage - 66.10%

    425 - 420x + 420x +
          logger::log_trace(
    426 - 420x + 420x +
            sprintf(
    427 - 420x + 420x +
              "%s$set_selected setting selection of id: %s",
    428 - 420x + 420x +
              class(self)[1],
    429 - 420x + 420x +
              private$get_id()
    @@ -22482,35 +23346,40 @@

    teal.slice coverage - 66.10%

    432 - 420x + 420x +
          isolate({
    433 - 420x + 420x +
            value <- private$cast_and_validate(value)
    434 - 409x + 409x +
            value <- private$check_length(value)
    435 - 403x + 403x +
            value <- private$remove_out_of_bounds_values(value)
    436 - 403x + 403x +
            private$teal_slice$selected <- value
    @@ -22524,35 +23393,40 @@

    teal.slice coverage - 66.10%

    438 - 403x + 403x +
          logger::log_trace(
    439 - 403x + 403x +
            sprintf(
    440 - 403x + 403x +
              "%s$set_selected selection of id: %s",
    441 - 403x + 403x +
              class(self)[1],
    442 - 403x + 403x +
              private$get_id()
    @@ -22580,7 +23454,8 @@

    teal.slice coverage - 66.10%

    446 - 403x + 403x +
          invisible(NULL)
    @@ -22664,56 +23539,64 @@

    teal.slice coverage - 66.10%

    458 - 16x + 16x +
          checkmate::assert_flag(value)
    459 - 16x + 16x +
          private$teal_slice$keep_na <- value
    460 - 16x + 16x +
          logger::log_trace(
    461 - 16x + 16x +
            sprintf(
    462 - 16x + 16x +
              "%s$set_keep_na set for filter %s to %s.",
    463 - 16x + 16x +
              class(self)[1],
    464 - 16x + 16x +
              private$get_id(),
    465 - 16x + 16x +
              value
    @@ -22734,7 +23617,8 @@

    teal.slice coverage - 66.10%

    468 - 16x + 16x +
          invisible(NULL)
    @@ -22818,56 +23702,64 @@

    teal.slice coverage - 66.10%

    480 - 9x + 9x +
          checkmate::assert_flag(value)
    481 - 9x + 9x +
          private$teal_slice$keep_inf <- value
    482 - 9x + 9x +
          logger::log_trace(
    483 - 9x + 9x +
            sprintf(
    484 - 9x + 9x +
              "%s$set_keep_inf of filter %s set to %s",
    485 - 9x + 9x +
              class(self)[1],
    486 - 9x + 9x +
              private$get_id(),
    487 - 9x + 9x +
              value
    @@ -22895,7 +23787,8 @@

    teal.slice coverage - 66.10%

    491 - 9x + 9x +
          invisible(NULL)
    @@ -22958,7 +23851,8 @@

    teal.slice coverage - 66.10%

    500 - 87x + 87x +
          isolate(private$teal_slice$dataname)
    @@ -23007,7 +23901,8 @@

    teal.slice coverage - 66.10%

    507 - 165x + 165x +
          isolate(private$teal_slice$varname)
    @@ -23056,7 +23951,8 @@

    teal.slice coverage - 66.10%

    514 - 4x + 4x +
          isolate(private$teal_slice$id)
    @@ -23112,7 +24008,8 @@

    teal.slice coverage - 66.10%

    522 - 882x + 882x +
          isolate(private$teal_slice$choices)
    @@ -23168,7 +24065,8 @@

    teal.slice coverage - 66.10%

    530 - 363x + 363x +
          private$teal_slice$selected
    @@ -23217,7 +24115,8 @@

    teal.slice coverage - 66.10%

    537 - 129x + 129x +
          private$teal_slice$keep_na
    @@ -23266,7 +24165,8 @@

    teal.slice coverage - 66.10%

    544 - 117x + 117x +
          private$teal_slice$keep_inf
    @@ -23308,7 +24208,8 @@

    teal.slice coverage - 66.10%

    550 - 148x + 148x +
          isolate(isTRUE(private$teal_slice$fixed))
    @@ -23350,7 +24251,8 @@

    teal.slice coverage - 66.10%

    556 - 48x + 48x +
          isolate(isTRUE(private$teal_slice$anchored))
    @@ -23392,7 +24294,8 @@

    teal.slice coverage - 66.10%

    562 - 217x + 217x +
          isolate(isTRUE(private$teal_slice$multiple))
    @@ -23455,7 +24358,8 @@

    teal.slice coverage - 66.10%

    571 - 12x + 12x +
          private$varlabel
    @@ -23504,49 +24408,56 @@

    teal.slice coverage - 66.10%

    578 - 108x + 108x +
          varname <- private$get_varname()
    579 - 108x + 108x +
          varname_backticked <- sprintf("`%s`", varname)
    580 - 108x + 108x +
          ans <-
    581 - 108x + 108x +
            if (isTRUE(private$extract_type == "list")) {
    582 - 16x + 16x +
              sprintf("%s$%s", dataname, varname_backticked)
    583 - 108x + 108x +
            } else if (isTRUE(private$extract_type == "matrix")) {
    584 - 7x + 7x +
              sprintf("%s[, \"%s\"]", dataname, varname)
    @@ -23560,7 +24471,8 @@

    teal.slice coverage - 66.10%

    586 - 85x + 85x +
              varname_backticked
    @@ -23574,7 +24486,8 @@

    teal.slice coverage - 66.10%

    588 - 108x + 108x +
          str2lang(ans)
    @@ -23644,14 +24557,16 @@

    teal.slice coverage - 66.10%

    598 - 107x + 107x +
          if (private$na_count == 0L) {
    599 - 86x + 86x +
            return(filter_call)
    @@ -23672,42 +24587,48 @@

    teal.slice coverage - 66.10%

    602 - 21x + 21x +
          if (is.null(filter_call) && isFALSE(private$get_keep_na())) {
    603 - 2x + 2x +
            call("!", call("is.na", varname))
    604 - 19x + 19x +
          } else if (!is.null(filter_call) && isTRUE(private$get_keep_na())) {
    605 - 12x + 12x +
            call("|", call("is.na", varname), filter_call)
    606 - 7x + 7x +
          } else if (!is.null(filter_call) && isFALSE(private$get_keep_na())) {
    607 - 7x + 7x +
            call("&", call("!", call("is.na", varname)), filter_call)
    @@ -23784,7 +24705,8 @@

    teal.slice coverage - 66.10%

    618 - 11x + 11x +
          values
    @@ -23819,7 +24741,8 @@

    teal.slice coverage - 66.10%

    623 - 11x + 11x +
          values
    @@ -23882,7 +24805,8 @@

    teal.slice coverage - 66.10%

    632 - 31x + 31x +
          values
    @@ -23980,42 +24904,48 @@

    teal.slice coverage - 66.10%

    646 - 74x + 74x +
          if (private$is_choice_limited) {
    647 - 3x + 3x +
            TRUE
    648 - 71x + 71x +
          } else if (!setequal(private$get_selected(), private$get_choices())) {
    649 - 58x + 58x +
            TRUE
    650 - 13x + 13x +
          } else if (!isTRUE(private$get_keep_na()) && private$na_count > 0) {
    651 - 4x + 4x +
            TRUE
    @@ -24029,7 +24959,8 @@

    teal.slice coverage - 66.10%

    653 - 9x + 9x +
            FALSE
    @@ -24099,14 +25030,16 @@

    teal.slice coverage - 66.10%

    663 - 12x + 12x +
          ns <- NS(id)
    664 - 12x + 12x +
          uiOutput(ns("summary"), class = "filter-card-summary")
    @@ -24162,28 +25095,32 @@

    teal.slice coverage - 66.10%

    672 - 12x + 12x +
          moduleServer(
    673 - 12x + 12x +
            id = id,
    674 - 12x + 12x +
            function(input, output, session) {
    675 - 12x + 12x +
              output$summary <- renderUI(private$content_summary())
    @@ -24449,14 +25386,16 @@

    teal.slice coverage - 66.10%

    713 - 12x + 12x +
          ns <- NS(id)
    714 - 12x + 12x +
          if (private$na_count > 0) {
    @@ -24610,7 +25549,8 @@

    teal.slice coverage - 66.10%

    736 - 12x + 12x +
            NULL
    @@ -24687,7 +25627,8 @@

    teal.slice coverage - 66.10%

    747 - 12x + 12x +
          moduleServer(id, function(input, output, session) {
    @@ -24715,42 +25656,48 @@

    teal.slice coverage - 66.10%

    751 - 12x + 12x +
            output$trigger_visible <- renderUI({
    752 - 12x + 12x +
              updateCountText(
    753 - 12x + 12x +
                inputId = "count_label",
    754 - 12x + 12x +
                label = "Keep NA",
    755 - 12x + 12x +
                countmax = private$na_count,
    756 - 12x + 12x +
                countnow = private$filtered_na_count()
    @@ -24764,7 +25711,8 @@

    teal.slice coverage - 66.10%

    758 - 12x + 12x +
              NULL
    @@ -24806,35 +25754,40 @@

    teal.slice coverage - 66.10%

    764 - 12x + 12x +
            private$observers$keep_na_api <- observeEvent(
    765 - 12x + 12x +
              ignoreNULL = FALSE, # nothing selected is possible for NA
    766 - 12x + 12x +
              ignoreInit = TRUE, # ignoreInit: should not matter because we set the UI with the desired initial state
    767 - 12x + 12x +
              eventExpr = private$get_keep_na(),
    768 - 12x + 12x +
              handlerExpr = {
    @@ -24911,35 +25864,40 @@

    teal.slice coverage - 66.10%

    779 - 12x + 12x +
            private$observers$keep_na <- observeEvent(
    780 - 12x + 12x +
              ignoreNULL = FALSE, # ignoreNULL: we don't want to ignore NULL when nothing is selected in the `selectInput`
    781 - 12x + 12x +
              ignoreInit = TRUE, # ignoreInit: should not matter because we set the UI with the desired initial state
    782 - 12x + 12x +
              eventExpr = input$value,
    783 - 12x + 12x +
              handlerExpr = {
    @@ -25009,7 +25967,8 @@

    teal.slice coverage - 66.10%

    793 - 12x + 12x +
            invisible(NULL)
    @@ -25288,7 +26247,8 @@

    teal.slice coverage - 66.10%

    35 - 92x + 92x +
          if (!requireNamespace("SummarizedExperiment", quietly = TRUE)) {
    @@ -25309,35 +26269,40 @@

    teal.slice coverage - 66.10%

    38 - 92x + 92x +
          checkmate::assert_function(data_reactive, args = "sid")
    39 - 92x + 92x +
          checkmate::assert_class(data, "SummarizedExperiment")
    40 - 91x + 91x +
          super$initialize(data, data_reactive, dataname, datalabel)
    41 - 91x + 91x +
          if (!is.null(datalabel)) {
    42 - 84x + 84x +
            private$dataname_prefixed <- sprintf("%s[['%s']]", dataname, datalabel)
    @@ -25428,35 +26393,40 @@

    teal.slice coverage - 66.10%

    55 - 61x + 61x +
          isolate({
    56 - 61x + 61x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initializing, dataname: { private$dataname }")
    57 - 61x + 61x +
            checkmate::assert_class(state, "teal_slices")
    58 - 59x + 59x +
            lapply(state, function(x) {
    59 - 17x + 17x +
              checkmate::assert_choice(x$arg, choices = c("subset", "select"), null.ok = TRUE, .var.name = "teal_slice$arg")
    @@ -25470,21 +26440,24 @@

    teal.slice coverage - 66.10%

    61 - 59x + 59x +
            count_type <- attr(state, "count_type")
    62 - 59x + 59x +
            if (length(count_type)) {
    63 - 8x + 8x +
              private$count_type <- count_type
    @@ -25505,35 +26478,40 @@

    teal.slice coverage - 66.10%

    66 - 59x + 59x +
            subset_states <- Filter(function(x) x$arg == "subset", state)
    67 - 59x + 59x +
            private$set_filter_state_impl(
    68 - 59x + 59x +
              state = subset_states,
    69 - 59x + 59x +
              data = SummarizedExperiment::rowData(private$data),
    70 - 59x + 59x +
              data_reactive = function(sid = "") {
    @@ -25589,35 +26567,40 @@

    teal.slice coverage - 66.10%

    78 - 59x + 59x +
            select_states <- Filter(function(x) x$arg == "select", state)
    79 - 59x + 59x +
            private$set_filter_state_impl(
    80 - 59x + 59x +
              state = select_states,
    81 - 59x + 59x +
              data = SummarizedExperiment::colData(private$data),
    82 - 59x + 59x +
              data_reactive = function(sid = "") {
    @@ -25673,14 +26656,16 @@

    teal.slice coverage - 66.10%

    90 - 59x + 59x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initialized, dataname: { private$dataname }")
    91 - 59x + 59x +
            invisible(NULL)
    @@ -25750,49 +26735,56 @@

    teal.slice coverage - 66.10%

    101 - 2x + 2x +
          data <- private$data
    102 - 2x + 2x +
          checkmate::assert_string(id)
    103 - 2x + 2x +
          ns <- NS(id)
    104 - 2x + 2x +
          row_input <- if (ncol(SummarizedExperiment::rowData(data)) == 0) {
    105 - 1x + 1x +
            div("no sample variables available")
    106 - 2x + 2x +
          } else if (nrow(SummarizedExperiment::rowData(data)) == 0) {
    107 - 1x + 1x +
            div("no samples available")
    @@ -25876,28 +26868,32 @@

    teal.slice coverage - 66.10%

    119 - 2x + 2x +
          col_input <- if (ncol(SummarizedExperiment::colData(data)) == 0) {
    120 - 1x + 1x +
            div("no sample variables available")
    121 - 2x + 2x +
          } else if (nrow(SummarizedExperiment::colData(data)) == 0) {
    122 - 1x + 1x +
            div("no samples available")
    @@ -25981,21 +26977,24 @@

    teal.slice coverage - 66.10%

    134 - 2x + 2x +
          div(
    135 - 2x + 2x +
            row_input,
    136 - 2x + 2x +
            col_input
    @@ -27401,7 +28400,8 @@

    teal.slice coverage - 66.10%

    31 - 24x + 24x +
          super$initialize(dataset = dataset, dataname = dataname, label = label)
    @@ -27485,35 +28485,40 @@

    teal.slice coverage - 66.10%

    43 - 4x + 4x +
          class_string <- toString(class(private$dataset))
    44 - 4x + 4x +
          if (trim_lines) {
    45 - 2x + 2x +
            trim_position <- 37L
    46 - 2x + 2x +
            class_string <- strtrim(class_string, trim_position)
    47 - 2x + 2x +
            substr(class_string, 35L, 37L) <- "..."
    @@ -27527,7 +28532,8 @@

    teal.slice coverage - 66.10%

    49 - 4x + 4x +
          sprintf(" - unfiltered dataset:\t\"%s\":   %s", private$dataname, class_string)
    @@ -27569,7 +28575,8 @@

    teal.slice coverage - 66.10%

    55 - 1x + 1x +
          invisible(NULL)
    @@ -27597,7 +28604,8 @@

    teal.slice coverage - 66.10%

    59 - 2x + 2x +
          invisible(NULL)
    @@ -27632,14 +28640,16 @@

    teal.slice coverage - 66.10%

    64 - 3x + 3x +
          if (length(state) != 0L) {
    65 - 1x + 1x +
            warning("DefaultFilterState cannot set state")
    @@ -27653,7 +28663,8 @@

    teal.slice coverage - 66.10%

    67 - 3x + 3x +
          invisible(NULL)
    @@ -27688,7 +28699,8 @@

    teal.slice coverage - 66.10%

    72 - 1x + 1x +
          invisible(NULL)
    @@ -27744,7 +28756,8 @@

    teal.slice coverage - 66.10%

    80 - 1x + 1x +
          data.frame(dataname = private$dataname, obs = NA, obs_filtered = NA)
    @@ -28149,7 +29162,8 @@

    teal.slice coverage - 66.10%

    24 - 9x + 9x +
      if (is.factor(choices)) {
    @@ -28177,35 +29191,40 @@

    teal.slice coverage - 66.10%

    28 - 9x + 9x +
      stopifnot(
    29 - 9x + 9x +
        is.character(choices) ||
    30 - 9x + 9x +
          is.numeric(choices) ||
    31 - 9x + 9x +
          is.logical(choices) ||
    32 - 9x + 9x +
          (length(choices) == 1 && is.na(choices))
    @@ -28226,7 +29245,8 @@

    teal.slice coverage - 66.10%

    35 - 9x + 9x +
      if (is.factor(labels)) {
    @@ -28254,14 +29274,16 @@

    teal.slice coverage - 66.10%

    39 - 9x + 9x +
      checkmate::assert_character(labels[!is.na(labels)], any.missing = FALSE)
    40 - 9x + 9x +
      if (length(choices) != length(labels)) {
    @@ -28282,14 +29304,16 @@

    teal.slice coverage - 66.10%

    43 - 9x + 9x +
      stopifnot(is.null(subset) || is.vector(subset))
    44 - 9x + 9x +
      stopifnot(is.null(types) || is.vector(types))
    @@ -28303,14 +29327,16 @@

    teal.slice coverage - 66.10%

    46 - 9x + 9x +
      if (is.vector(types)) {
    47 - 9x + 9x +
        stopifnot(length(choices) == length(types))
    @@ -28331,7 +29357,8 @@

    teal.slice coverage - 66.10%

    50 - 9x + 9x +
      if (!is.null(subset)) {
    @@ -28394,56 +29421,64 @@

    teal.slice coverage - 66.10%

    59 - 9x + 9x +
      is_dupl <- duplicated(choices)
    60 - 9x + 9x +
      choices <- choices[!is_dupl]
    61 - 9x + 9x +
      labels <- labels[!is_dupl]
    62 - 9x + 9x +
      types <- types[!is_dupl]
    63 - 9x + 9x +
      labels[is.na(labels)] <- "Label Missing"
    64 - 9x + 9x +
      raw_labels <- labels
    65 - 9x + 9x +
      combined_labels <- if (length(choices) > 0) {
    66 - 9x + 9x +
        paste0(choices, ": ", labels)
    @@ -28478,7 +29513,8 @@

    teal.slice coverage - 66.10%

    71 - 9x + 9x +
      if (!is.null(subset)) {
    @@ -28527,49 +29563,56 @@

    teal.slice coverage - 66.10%

    78 - 9x + 9x +
      choices <- structure(
    79 - 9x + 9x +
        choices,
    80 - 9x + 9x +
        names = combined_labels,
    81 - 9x + 9x +
        raw_labels = raw_labels,
    82 - 9x + 9x +
        combined_labels = combined_labels,
    83 - 9x + 9x +
        class = c("choices_labeled", "character"),
    84 - 9x + 9x +
        types = types
    @@ -28590,7 +29633,8 @@

    teal.slice coverage - 66.10%

    87 - 9x + 9x +
      choices
    @@ -28967,21 +30011,24 @@

    teal.slice coverage - 66.10%

    52 - 25x + 25x +
          isolate({
    53 - 25x + 25x +
            checkmate::assert_multi_class(x, c("POSIXct", "POSIXlt"))
    54 - 24x + 24x +
            checkmate::assert_class(x_reactive, "reactive")
    @@ -28995,35 +30042,40 @@

    teal.slice coverage - 66.10%

    56 - 24x + 24x +
            super$initialize(
    57 - 24x + 24x +
              x = x,
    58 - 24x + 24x +
              x_reactive = x_reactive,
    59 - 24x + 24x +
              slice = slice,
    60 - 24x + 24x +
              extract_type = extract_type
    @@ -29037,28 +30089,32 @@

    teal.slice coverage - 66.10%

    62 - 24x + 24x +
            checkmate::assert_multi_class(slice$choices, c("POSIXct", "POSIXlt"), null.ok = TRUE)
    63 - 23x + 23x +
            private$set_choices(slice$choices)
    64 - 15x + 15x +
            if (is.null(slice$selected)) slice$selected <- slice$choices
    65 - 23x + 23x +
            private$set_selected(slice$selected)
    @@ -29079,7 +30135,8 @@

    teal.slice coverage - 66.10%

    68 - 22x + 22x +
          invisible(self)
    @@ -29156,14 +30213,16 @@

    teal.slice coverage - 66.10%

    79 - 7x + 7x +
          if (isFALSE(private$is_any_filtered())) {
    80 - 1x + 1x +
            return(NULL)
    @@ -29177,63 +30236,72 @@

    teal.slice coverage - 66.10%

    82 - 4x + 4x +
          if (missing(dataname)) dataname <- private$get_dataname()
    83 - 6x + 6x +
          varname <- private$get_varname_prefixed(dataname)
    84 - 6x + 6x +
          choices <- private$get_selected()
    85 - 6x + 6x +
          tzone <- Find(function(x) x != "", attr(as.POSIXlt(choices), "tzone"))
    86 - 6x + 6x +
          class <- class(choices)[1L]
    87 - 6x + 6x +
          date_fun <- as.name(
    88 - 6x + 6x +
            switch(class,
    89 - 6x + 6x +
              "POSIXct" = "as.POSIXct",
    90 - 6x + 6x +
              "POSIXlt" = "as.POSIXlt"
    @@ -29254,21 +30322,24 @@

    teal.slice coverage - 66.10%

    93 - 6x + 6x +
          choices <- as.character(choices + c(0, 1))
    94 - 6x + 6x +
          filter_call <-
    95 - 6x + 6x +
            call(
    @@ -29282,7 +30353,8 @@

    teal.slice coverage - 66.10%

    97 - 6x + 6x +
              call(
    @@ -29296,14 +30368,16 @@

    teal.slice coverage - 66.10%

    99 - 6x + 6x +
                varname,
    100 - 6x + 6x +
                as.call(list(date_fun, choices[1L], tz = tzone))
    @@ -29317,7 +30391,8 @@

    teal.slice coverage - 66.10%

    102 - 6x + 6x +
              call(
    @@ -29331,14 +30406,16 @@

    teal.slice coverage - 66.10%

    104 - 6x + 6x +
                varname,
    105 - 6x + 6x +
                as.call(list(date_fun, choices[2L], tz = tzone))
    @@ -29359,7 +30436,8 @@

    teal.slice coverage - 66.10%

    108 - 6x + 6x +
          private$add_keep_na_call(filter_call, varname)
    @@ -29422,14 +30500,16 @@

    teal.slice coverage - 66.10%

    117 - 23x + 23x +
          if (is.null(choices)) {
    118 - 20x + 20x +
            choices <- as.POSIXct(trunc(range(private$x, na.rm = TRUE), units = "secs"))
    @@ -29443,28 +30523,32 @@

    teal.slice coverage - 66.10%

    120 - 3x + 3x +
            choices <- as.POSIXct(choices, units = "secs")
    121 - 3x + 3x +
            choices_adjusted <- c(
    122 - 3x + 3x +
              max(choices[1L], min(as.POSIXct(private$x), na.rm = TRUE)),
    123 - 3x + 3x +
              min(choices[2L], max(as.POSIXct(private$x), na.rm = TRUE))
    @@ -29478,28 +30562,32 @@

    teal.slice coverage - 66.10%

    125 - 3x + 3x +
            if (any(choices != choices_adjusted)) {
    126 - 1x + 1x +
              warning(sprintf(
    127 - 1x + 1x +
                "Choices adjusted (some values outside of variable range). Varname: %s, dataname: %s.",
    128 - 1x + 1x +
                private$get_varname(), private$get_dataname()
    @@ -29513,7 +30601,8 @@

    teal.slice coverage - 66.10%

    130 - 1x + 1x +
              choices <- choices_adjusted
    @@ -29527,35 +30616,40 @@

    teal.slice coverage - 66.10%

    132 - 3x + 3x +
            if (choices[1L] >= choices[2L]) {
    133 - 1x + 1x +
              warning(sprintf(
    134 - 1x + 1x +
                "Invalid choices: lower is higher / equal to upper, or not in range of variable values.
    135 - 1x + 1x +
                Setting defaults. Varname: %s, dataname: %s.",
    136 - 1x + 1x +
                private$get_varname(), private$get_dataname()
    @@ -29569,7 +30663,8 @@

    teal.slice coverage - 66.10%

    138 - 1x + 1x +
              choices <- range(private$x, na.rm = TRUE)
    @@ -29597,14 +30692,16 @@

    teal.slice coverage - 66.10%

    142 - 23x + 23x +
          private$set_is_choice_limited(private$x, choices)
    143 - 23x + 23x +
          private$x <- private$x[
    @@ -29618,21 +30715,24 @@

    teal.slice coverage - 66.10%

    145 - 23x + 23x +
              as.POSIXct(trunc(private$x, units = "secs")) >= choices[1L] &
    146 - 23x + 23x +
                as.POSIXct(trunc(private$x, units = "secs")) <= choices[2L]
    147 - 23x + 23x +
            ) | is.na(private$x)
    @@ -29646,14 +30746,16 @@

    teal.slice coverage - 66.10%

    149 - 23x + 23x +
          private$teal_slice$choices <- choices
    150 - 23x + 23x +
          invisible(NULL)
    @@ -29695,14 +30797,16 @@

    teal.slice coverage - 66.10%

    156 - 23x + 23x +
          private$is_choice_limited <- (any(xl < choices[1L], na.rm = TRUE) | any(xl > choices[2L], na.rm = TRUE))
    157 - 23x + 23x +
          invisible(NULL)
    @@ -29723,21 +30827,24 @@

    teal.slice coverage - 66.10%

    160 - 34x + 34x +
          tryCatch(
    161 - 34x + 34x +
            expr = {
    162 - 34x + 34x +
              values <- as.POSIXct(values, origin = "1970-01-01 00:00:00")
    @@ -29751,7 +30858,8 @@

    teal.slice coverage - 66.10%

    164 - 31x + 31x +
              values
    @@ -29765,7 +30873,8 @@

    teal.slice coverage - 66.10%

    166 - 34x + 34x +
            error = function(e) stop("Vector of set values must contain values coercible to POSIX.")
    @@ -29793,42 +30902,48 @@

    teal.slice coverage - 66.10%

    170 - 1x + 1x +
          if (length(values) != 2) stop("Vector of set values must have length two.")
    171 - 30x + 30x +
          if (values[1] > values[2]) {
    172 - 1x + 1x +
            warning(
    173 - 1x + 1x +
              sprintf(
    174 - 1x + 1x +
                "Start date '%s' is set after the end date '%s', the values will be replaced by a default datetime range.",
    175 - 1x + 1x +
                values[1], values[2]
    @@ -29849,7 +30964,8 @@

    teal.slice coverage - 66.10%

    178 - 1x + 1x +
            values <- isolate(private$get_choices())
    @@ -29863,7 +30979,8 @@

    teal.slice coverage - 66.10%

    180 - 30x + 30x +
          values
    @@ -29884,42 +31001,48 @@

    teal.slice coverage - 66.10%

    183 - 30x + 30x +
          choices <- private$get_choices()
    184 - 30x + 30x +
          if (values[1] < choices[1L] || values[1] > choices[2L]) {
    185 - 5x + 5x +
            warning(
    186 - 5x + 5x +
              sprintf(
    187 - 5x + 5x +
                "Value: %s is outside of the range for the column '%s' in dataset '%s', setting minimum possible value.",
    188 - 5x + 5x +
                values[1], private$get_varname(), toString(private$get_dataname())
    @@ -29940,7 +31063,8 @@

    teal.slice coverage - 66.10%

    191 - 5x + 5x +
            values[1] <- choices[1L]
    @@ -29961,35 +31085,40 @@

    teal.slice coverage - 66.10%

    194 - 30x + 30x +
          if (values[2] > choices[2L] | values[2] < choices[1L]) {
    195 - 5x + 5x +
            warning(
    196 - 5x + 5x +
              sprintf(
    197 - 5x + 5x +
                "Value: '%s' is outside of the range for the column '%s' in dataset '%s', setting maximum possible value.",
    198 - 5x + 5x +
                values[2], private$get_varname(), toString(private$get_dataname())
    @@ -30010,7 +31139,8 @@

    teal.slice coverage - 66.10%

    201 - 5x + 5x +
            values[2] <- choices[2L]
    @@ -30031,7 +31161,8 @@

    teal.slice coverage - 66.10%

    204 - 30x + 30x +
          values
    @@ -32074,56 +33205,64 @@

    teal.slice coverage - 66.10%

    46 - 121x + 121x +
          isolate({
    47 - 121x + 121x +
            checkmate::assert_numeric(x, all.missing = FALSE)
    48 - 2x + 2x +
            if (!any(is.finite(x))) stop("\"x\" contains no finite values")
    49 - 118x + 118x +
            super$initialize(x = x, x_reactive = x_reactive, slice = slice, extract_type = extract_type)
    50 - 118x + 118x +
            private$is_integer <- checkmate::test_integerish(x)
    51 - 118x + 118x +
            private$inf_count <- sum(is.infinite(x))
    52 - 118x + 118x +
            private$inf_filtered_count <- reactive(
    53 - 118x + 118x +
              if (!is.null(private$x_reactive())) sum(is.infinite(private$x_reactive()))
    @@ -32144,14 +33283,16 @@

    teal.slice coverage - 66.10%

    56 - 118x + 118x +
            checkmate::assert_numeric(slice$choices, null.ok = TRUE)
    57 - 3x + 3x +
            if (is.null(slice$keep_inf) && any(is.infinite(x))) slice$keep_inf <- TRUE
    @@ -32165,21 +33306,24 @@

    teal.slice coverage - 66.10%

    59 - 117x + 117x +
            private$set_choices(slice$choices)
    60 - 42x + 42x +
            if (is.null(slice$selected)) slice$selected <- slice$choices
    61 - 117x + 117x +
            private$set_selected(slice$selected)
    @@ -32193,21 +33337,24 @@

    teal.slice coverage - 66.10%

    63 - 114x + 114x +
            private$is_integer <- checkmate::test_integerish(x)
    64 - 114x + 114x +
            private$inf_filtered_count <- reactive(
    65 - 114x + 114x +
              if (!is.null(private$x_reactive())) sum(is.infinite(private$x_reactive()))
    @@ -32221,7 +33368,8 @@

    teal.slice coverage - 66.10%

    67 - 114x + 114x +
            private$inf_count <- sum(is.infinite(x))
    @@ -32235,63 +33383,72 @@

    teal.slice coverage - 66.10%

    69 - 114x + 114x +
            private$plot_data <- list(
    70 - 114x + 114x +
              type = "histogram",
    71 - 114x + 114x +
              nbinsx = 50,
    72 - 114x + 114x +
              x = Filter(Negate(is.na), Filter(is.finite, private$x)),
    73 - 114x + 114x +
              color = I(fetch_bs_color("secondary")),
    74 - 114x + 114x +
              alpha = 0.2,
    75 - 114x + 114x +
              bingroup = 1,
    76 - 114x + 114x +
              showlegend = FALSE,
    77 - 114x + 114x +
              hoverinfo = "none"
    @@ -32305,21 +33462,24 @@

    teal.slice coverage - 66.10%

    79 - 114x + 114x +
            private$plot_mask <- list(list(
    80 - 114x + 114x +
              type = "rect", fillcolor = rgb(1, 1, 1, .65), line = list(width = 0),
    81 - 114x + 114x +
              x0 = -0.5, x1 = 1.5, y0 = -0.5, y1 = 1.5, xref = "paper", yref = "paper"
    @@ -32333,84 +33493,96 @@

    teal.slice coverage - 66.10%

    83 - 114x + 114x +
            private$plot_layout <- reactive({
    84 - 5x + 5x +
              shapes <- private$get_shape_properties(private$get_selected())
    85 - 5x + 5x +
              list(
    86 - 5x + 5x +
                barmode = "overlay",
    87 - 5x + 5x +
                xaxis = list(
    88 - 5x + 5x +
                  range = private$get_choices() * c(0.995, 1.005),
    89 - 5x + 5x +
                  rangeslider = list(thickness = 0),
    90 - 5x + 5x +
                  showticklabels = TRUE,
    91 - 5x + 5x +
                  ticks = "outside",
    92 - 5x + 5x +
                  ticklen = 1.5,
    93 - 5x + 5x +
                  tickmode = "auto",
    94 - 5x + 5x +
                  nticks = 10
    @@ -32424,35 +33596,40 @@

    teal.slice coverage - 66.10%

    96 - 5x + 5x +
                yaxis = list(showgrid = FALSE, showticklabels = FALSE),
    97 - 5x + 5x +
                margin = list(b = 17, l = 0, r = 0, t = 0, autoexpand = FALSE),
    98 - 5x + 5x +
                plot_bgcolor = "#FFFFFF00",
    99 - 5x + 5x +
                paper_bgcolor = "#FFFFFF00",
    100 - 5x + 5x +
                shapes = shapes
    @@ -32473,35 +33650,40 @@

    teal.slice coverage - 66.10%

    103 - 114x + 114x +
            private$plot_config <- reactive({
    104 - 5x + 5x +
              list(
    105 - 5x + 5x +
                doubleClick = "reset",
    106 - 5x + 5x +
                displayModeBar = FALSE,
    107 - 5x + 5x +
                edits = list(shapePosition = TRUE)
    @@ -32522,49 +33704,56 @@

    teal.slice coverage - 66.10%

    110 - 114x + 114x +
            private$plot_filtered <- reactive({
    111 - 5x + 5x +
              finite_values <- Filter(is.finite, private$x_reactive())
    112 - 5x + 5x +
              if (!identical(finite_values, numeric(0))) {
    113 - 5x + 5x +
                list(
    114 - 5x + 5x +
                  x = finite_values,
    115 - 5x + 5x +
                  bingroup = 1,
    116 - 5x + 5x +
                  color = I(fetch_bs_color("primary"))
    @@ -32592,7 +33781,8 @@

    teal.slice coverage - 66.10%

    120 - 114x + 114x +
            invisible(self)
    @@ -32683,14 +33873,16 @@

    teal.slice coverage - 66.10%

    133 - 35x + 35x +
          if (isFALSE(private$is_any_filtered())) {
    134 - 1x + 1x +
            return(NULL)
    @@ -32704,28 +33896,32 @@

    teal.slice coverage - 66.10%

    136 - 4x + 4x +
          if (missing(dataname)) dataname <- private$get_dataname()
    137 - 34x + 34x +
          varname <- private$get_varname_prefixed(dataname)
    138 - 34x + 34x +
          filter_call <-
    139 - 34x + 34x +
            call(
    @@ -32739,14 +33935,16 @@

    teal.slice coverage - 66.10%

    141 - 34x + 34x +
              call(">=", varname, private$get_selected()[1L]),
    142 - 34x + 34x +
              call("<=", varname, private$get_selected()[2L])
    @@ -32760,7 +33958,8 @@

    teal.slice coverage - 66.10%

    144 - 34x + 34x +
          private$add_keep_na_call(private$add_keep_inf_call(filter_call, varname), varname)
    @@ -32942,21 +34141,24 @@

    teal.slice coverage - 66.10%

    170 - 117x + 117x +
          x <- private$x[is.finite(private$x)]
    171 - 117x + 117x +
          if (is.null(choices)) {
    172 - 105x + 105x +
            choices <- range(x)
    @@ -32970,35 +34172,40 @@

    teal.slice coverage - 66.10%

    174 - 12x + 12x +
            choices_adjusted <- c(max(choices[1L], min(x)), min(choices[2L], max(x)))
    175 - 12x + 12x +
            if (any(choices != choices_adjusted)) {
    176 - 1x + 1x +
              warning(sprintf(
    177 - 1x + 1x +
                "Choices adjusted (some values outside of variable range). Varname: %s, dataname: %s.",
    178 - 1x + 1x +
                private$get_varname(), private$get_dataname()
    @@ -33012,7 +34219,8 @@

    teal.slice coverage - 66.10%

    180 - 1x + 1x +
              choices <- choices_adjusted
    @@ -33026,35 +34234,40 @@

    teal.slice coverage - 66.10%

    182 - 12x + 12x +
            if (choices[1L] > choices[2L]) {
    183 - 1x + 1x +
              warning(sprintf(
    184 - 1x + 1x +
                "Invalid choices: lower is higher / equal to upper, or not in range of variable values.
    185 - 1x + 1x +
                Setting defaults. Varname: %s, dataname: %s.",
    186 - 1x + 1x +
                private$get_varname(), private$get_dataname()
    @@ -33068,7 +34281,8 @@

    teal.slice coverage - 66.10%

    188 - 1x + 1x +
              choices <- range(x)
    @@ -33096,21 +34310,24 @@

    teal.slice coverage - 66.10%

    192 - 117x + 117x +
          private$set_is_choice_limited(private$x, choices)
    193 - 117x + 117x +
          private$x <- private$x[
    194 - 117x + 117x +
            (private$x >= choices[1L] & private$x <= choices[2L]) | is.na(private$x) | !is.finite(private$x)
    @@ -33131,7 +34348,8 @@

    teal.slice coverage - 66.10%

    197 - 117x + 117x +
          x_range <- range(private$x, finite = TRUE)
    @@ -33152,14 +34370,16 @@

    teal.slice coverage - 66.10%

    200 - 117x + 117x +
          if (identical(diff(x_range), 0)) {
    201 - 2x + 2x +
            choices <- x_range
    @@ -33173,21 +34393,24 @@

    teal.slice coverage - 66.10%

    203 - 115x + 115x +
            x_pretty <- pretty(x_range, 100L)
    204 - 115x + 115x +
            choices <- range(x_pretty)
    205 - 115x + 115x +
            private$numeric_step <- signif(private$get_pretty_range_step(x_pretty), digits = 10)
    @@ -33201,14 +34424,16 @@

    teal.slice coverage - 66.10%

    207 - 117x + 117x +
          private$teal_slice$choices <- choices
    208 - 117x + 117x +
          invisible(NULL)
    @@ -33250,28 +34475,32 @@

    teal.slice coverage - 66.10%

    214 - 117x + 117x +
          xl <- xl[!is.na(xl)]
    215 - 117x + 117x +
          xl <- xl[is.finite(xl)]
    216 - 117x + 117x +
          private$is_choice_limited <- (any(xl < choices[1L]) | any(xl > choices[2L]))
    217 - 117x + 117x +
          invisible(NULL)
    @@ -33313,14 +34542,16 @@

    teal.slice coverage - 66.10%

    223 - 34x + 34x +
          if (isTRUE(private$get_keep_inf())) {
    224 - 2x + 2x +
            call("|", call("is.infinite", varname), filter_call)
    @@ -33334,7 +34565,8 @@

    teal.slice coverage - 66.10%

    226 - 32x + 32x +
            filter_call
    @@ -33397,14 +34629,16 @@

    teal.slice coverage - 66.10%

    235 - 117x + 117x +
          if (private$is_integer && diff(range(pretty_range) > 2)) {
    236 - 46x + 46x +
            return(1L)
    @@ -33418,14 +34652,16 @@

    teal.slice coverage - 66.10%

    238 - 71x + 71x +
            n_steps <- length(pretty_range) - 1
    239 - 71x + 71x +
            return(signif(digits = 10, (max(pretty_range) - min(pretty_range)) / n_steps))
    @@ -33453,35 +34689,40 @@

    teal.slice coverage - 66.10%

    243 - 133x + 133x +
          tryCatch(
    244 - 133x + 133x +
            expr = {
    245 - 133x + 133x +
              values <- as.numeric(values)
    246 - 4x + 4x +
              if (anyNA(values)) stop()
    247 - 129x + 129x +
              values
    @@ -33495,7 +34736,8 @@

    teal.slice coverage - 66.10%

    249 - 133x + 133x +
            error = function(e) stop("Vector of set values must contain values coercible to numeric")
    @@ -33530,21 +34772,24 @@

    teal.slice coverage - 66.10%

    254 - 2x + 2x +
          if (length(values) != 2L) stop("Vector of set values must have length two.")
    255 - 2x + 2x +
          if (values[1L] > values[2L]) stop("Vector of set values must be sorted.")
    256 - 125x + 125x +
          values
    @@ -33572,21 +34817,24 @@

    teal.slice coverage - 66.10%

    260 - 2x + 2x +
          if (values[1L] < private$get_choices()[1L]) values[1L] <- private$get_choices()[1L]
    261 - 2x + 2x +
          if (values[2L] > private$get_choices()[2L]) values[2L] <- private$get_choices()[2L]
    262 - 125x + 125x +
          values
    @@ -33628,35 +34876,40 @@

    teal.slice coverage - 66.10%

    268 - 35x + 35x +
          if (private$is_choice_limited) {
    269 - 1x + 1x +
            TRUE
    270 - 34x + 34x +
          } else if (!isTRUE(all.equal(private$get_selected(), private$get_choices()))) {
    271 - 32x + 32x +
            TRUE
    272 - 2x + 2x +
          } else if (!isTRUE(private$get_keep_inf()) && private$inf_count > 0) {
    @@ -33670,14 +34923,16 @@

    teal.slice coverage - 66.10%

    274 - 2x + 2x +
          } else if (!isTRUE(private$get_keep_na()) && private$na_count > 0) {
    275 - 1x + 1x +
            TRUE
    @@ -33691,7 +34946,8 @@

    teal.slice coverage - 66.10%

    277 - 1x + 1x +
            FALSE
    @@ -33740,21 +34996,24 @@

    teal.slice coverage - 66.10%

    284 - 5x + 5x +
          list(
    285 - 5x + 5x +
            list(type = "line", x0 = values[1], x1 = values[1], y0 = -100, y1 = 100, yref = "paper"),
    286 - 5x + 5x +
            list(type = "line", x0 = values[2], x1 = values[2], y0 = -100, y1 = 100, yref = "paper")
    @@ -33831,70 +35090,80 @@

    teal.slice coverage - 66.10%

    297 - 5x + 5x +
          ns <- NS(id)
    298 - 5x + 5x +
          isolate({
    299 - 5x + 5x +
            ui_input <- shinyWidgets::numericRangeInput(
    300 - 5x + 5x +
              inputId = ns("selection_manual"),
    301 - 5x + 5x +
              label = NULL,
    302 - 5x + 5x +
              min = private$get_choices()[1L],
    303 - 5x + 5x +
              max = private$get_choices()[2L],
    304 - 5x + 5x +
              value = private$get_selected(),
    305 - 5x + 5x +
              step = private$numeric_step,
    306 - 5x + 5x +
              width = "100%"
    @@ -33908,28 +35177,32 @@

    teal.slice coverage - 66.10%

    308 - 5x + 5x +
            tagList(
    309 - 5x + 5x +
              div(
    310 - 5x + 5x +
                class = "choices_state",
    311 - 5x + 5x +
                tags$head(tags$script(
    @@ -33957,21 +35230,24 @@

    teal.slice coverage - 66.10%

    315 - 5x + 5x +
                  HTML(
    316 - 5x + 5x +
                    '$(document).ready(function() {
    317 - 5x + 5x +
                      $("[data-toggle=\'popover\']").popover();
    @@ -33985,35 +35261,40 @@

    teal.slice coverage - 66.10%

    319 - 5x + 5x +
                      $(document).on("click", function (e) {
    320 - 5x + 5x +
                        if (!$("[data-toggle=\'popover\']").is(e.target) &&
    321 - 5x + 5x +
                            $("[data-toggle=\'popover\']").has(e.target).length === 0 &&
    322 - 5x + 5x +
                            $(".popover").has(e.target).length === 0) {
    323 - 5x + 5x +
                          $("[data-toggle=\'popover\']").popover("hide");
    @@ -34055,105 +35336,120 @@

    teal.slice coverage - 66.10%

    329 - 5x + 5x +
                div(
    330 - 5x + 5x +
                  actionLink(
    331 - 5x + 5x +
                    ns("plotly_info"),
    332 - 5x + 5x +
                    label = NULL,
    333 - 5x + 5x +
                    icon = icon("question-circle"),
    334 - 5x + 5x +
                    "data-toggle" = "popover",
    335 - 5x + 5x +
                    "data-html" = "true",
    336 - 5x + 5x +
                    "data-placement" = "left",
    337 - 5x + 5x +
                    "data-trigger" = "click",
    338 - 5x + 5x +
                    "data-title" = "Plot actions",
    339 - 5x + 5x +
                    "data-content" = "<p>
    340 - 5x + 5x +
                                      Drag vertical lines to set selection.<br>
    341 - 5x + 5x +
                                      Drag across plot to zoom in.<br>
    342 - 5x + 5x +
                                      Drag axis to pan.<br>
    343 - 5x + 5x +
                                      Double click to zoom out."
    @@ -34167,7 +35463,8 @@

    teal.slice coverage - 66.10%

    345 - 5x + 5x +
                  style = "text-align: right; font-size: 0.7em; margin-bottom: -1em; position: relative; z-index: 9;"
    @@ -34181,35 +35478,40 @@

    teal.slice coverage - 66.10%

    347 - 5x + 5x +
                shinycssloaders::withSpinner(
    348 - 5x + 5x +
                  plotly::plotlyOutput(ns("plot"), height = "50px"),
    349 - 5x + 5x +
                  type = 4,
    350 - 5x + 5x +
                  size = 0.25,
    351 - 5x + 5x +
                  hide.ui = FALSE
    @@ -34223,7 +35525,8 @@

    teal.slice coverage - 66.10%

    353 - 5x + 5x +
                ui_input
    @@ -34237,28 +35540,32 @@

    teal.slice coverage - 66.10%

    355 - 5x + 5x +
              div(
    356 - 5x + 5x +
                class = "filter-card-body-keep-na-inf",
    357 - 5x + 5x +
                private$keep_inf_ui(ns("keep_inf")),
    358 - 5x + 5x +
                private$keep_na_ui(ns("keep_na"))
    @@ -34335,28 +35642,32 @@

    teal.slice coverage - 66.10%

    369 - 5x + 5x +
          moduleServer(
    370 - 5x + 5x +
            id = id,
    371 - 5x + 5x +
            function(input, output, session) {
    372 - 5x + 5x +
              logger::log_trace("RangeFilterState$server initializing, id: { private$get_id() }")
    @@ -34377,7 +35688,8 @@

    teal.slice coverage - 66.10%

    375 - 5x + 5x +
              selection_manual <- debounce(reactive(input$selection_manual), 200)
    @@ -34398,7 +35710,8 @@

    teal.slice coverage - 66.10%

    378 - 5x + 5x +
              plot_data <- c(private$plot_data, source = session$ns("histogram_plot"))
    @@ -34419,42 +35732,48 @@

    teal.slice coverage - 66.10%

    381 - 5x + 5x +
              output$plot <- plotly::renderPlotly({
    382 - 5x + 5x +
                histogram <- do.call(plotly::plot_ly, plot_data)
    383 - 5x + 5x +
                histogram <- do.call(plotly::layout, c(list(p = histogram), private$plot_layout()))
    384 - 5x + 5x +
                histogram <- do.call(plotly::config, c(list(p = histogram), private$plot_config()))
    385 - 5x + 5x +
                histogram <- do.call(plotly::add_histogram, c(list(p = histogram), private$plot_filtered()))
    386 - 5x + 5x +
                histogram
    @@ -34482,63 +35801,72 @@

    teal.slice coverage - 66.10%

    390 - 5x + 5x +
              private$observers$relayout <-
    391 - 5x + 5x +
                observeEvent(
    392 - 5x + 5x +
                  ignoreNULL = FALSE,
    393 - 5x + 5x +
                  ignoreInit = TRUE,
    394 - 5x + 5x +
                  eventExpr = plotly::event_data("plotly_relayout", source = session$ns("histogram_plot")),
    395 - 5x + 5x +
                  handlerExpr = {
    396 - 1x + 1x +
                    logger::log_trace("RangeFilterState$server@1 selection changed, id: { private$get_id() }")
    397 - 1x + 1x +
                    event <- plotly::event_data("plotly_relayout", source = session$ns("histogram_plot"))
    398 - 1x + 1x +
                    if (any(grepl("shapes", names(event)))) {
    @@ -34727,42 +36055,48 @@

    teal.slice coverage - 66.10%

    425 - 5x + 5x +
              private$observers$selection_api <-
    426 - 5x + 5x +
                observeEvent(
    427 - 5x + 5x +
                  ignoreNULL = FALSE,
    428 - 5x + 5x +
                  ignoreInit = TRUE,
    429 - 5x + 5x +
                  eventExpr = private$get_selected(),
    430 - 5x + 5x +
                  handlerExpr = {
    @@ -34853,35 +36187,40 @@

    teal.slice coverage - 66.10%

    443 - 5x + 5x +
              private$observers$selection_manual <- observeEvent(
    444 - 5x + 5x +
                ignoreNULL = FALSE,
    445 - 5x + 5x +
                ignoreInit = TRUE,
    446 - 5x + 5x +
                eventExpr = selection_manual(),
    447 - 5x + 5x +
                handlerExpr = {
    @@ -35147,14 +36486,16 @@

    teal.slice coverage - 66.10%

    485 - 5x + 5x +
              private$keep_inf_srv("keep_inf")
    486 - 5x + 5x +
              private$keep_na_srv("keep_na")
    @@ -35168,14 +36509,16 @@

    teal.slice coverage - 66.10%

    488 - 5x + 5x +
              logger::log_trace("RangeFilterState$server initialized, id: { private$get_id() }")
    489 - 5x + 5x +
              NULL
    @@ -35462,42 +36805,48 @@

    teal.slice coverage - 66.10%

    530 - 5x + 5x +
          selection <- private$get_selected()
    531 - 5x + 5x +
          tagList(
    532 - 5x + 5x +
            tags$span(HTML(selection[1], "&ndash;", selection[2]), class = "filter-card-summary-value"),
    533 - 5x + 5x +
            tags$span(
    534 - 5x + 5x +
              class = "filter-card-summary-controls",
    535 - 5x + 5x +
              if (private$na_count > 0) {
    @@ -35518,7 +36867,8 @@

    teal.slice coverage - 66.10%

    538 - 5x + 5x +
              if (private$inf_count > 0) {
    @@ -35602,7 +36952,8 @@

    teal.slice coverage - 66.10%

    550 - 5x + 5x +
          ns <- NS(id)
    @@ -35616,7 +36967,8 @@

    teal.slice coverage - 66.10%

    552 - 5x + 5x +
          if (private$inf_count > 0) {
    @@ -35756,7 +37108,8 @@

    teal.slice coverage - 66.10%

    572 - 5x + 5x +
            NULL
    @@ -35833,7 +37186,8 @@

    teal.slice coverage - 66.10%

    583 - 5x + 5x +
          moduleServer(id, function(input, output, session) {
    @@ -35861,42 +37215,48 @@

    teal.slice coverage - 66.10%

    587 - 5x + 5x +
            output$trigger_visible <- renderUI({
    588 - 5x + 5x +
              updateCountText(
    589 - 5x + 5x +
                inputId = "count_label",
    590 - 5x + 5x +
                label = "Keep Inf",
    591 - 5x + 5x +
                countmax = private$inf_count,
    592 - 5x + 5x +
                countnow = private$inf_filtered_count()
    @@ -35910,7 +37270,8 @@

    teal.slice coverage - 66.10%

    594 - 5x + 5x +
              NULL
    @@ -35952,35 +37313,40 @@

    teal.slice coverage - 66.10%

    600 - 5x + 5x +
            private$observers$keep_inf_api <- observeEvent(
    601 - 5x + 5x +
              ignoreNULL = TRUE, # its not possible for range that NULL is selected
    602 - 5x + 5x +
              ignoreInit = TRUE, # ignoreInit: should not matter because we set the UI with the desired initial state
    603 - 5x + 5x +
              eventExpr = private$get_keep_inf(),
    604 - 5x + 5x +
              handlerExpr = {
    @@ -36057,35 +37423,40 @@

    teal.slice coverage - 66.10%

    615 - 5x + 5x +
            private$observers$keep_inf <- observeEvent(
    616 - 5x + 5x +
              ignoreNULL = TRUE, # it's not possible for range that NULL is selected
    617 - 5x + 5x +
              ignoreInit = TRUE, # ignoreInit: should not matter because we set the UI with the desired initial state
    618 - 5x + 5x +
              eventExpr = input$value,
    619 - 5x + 5x +
              handlerExpr = {
    @@ -36134,7 +37505,8 @@

    teal.slice coverage - 66.10%

    626 - 5x + 5x +
            invisible(NULL)
    @@ -36357,21 +37729,24 @@

    teal.slice coverage - 66.10%

    27 - 15x + 15x +
          checkmate::assert_class(slice, "teal_slice_expr")
    28 - 14x + 14x +
          private$teal_slice <- slice
    29 - 14x + 14x +
          invisible(self)
    @@ -36455,28 +37830,32 @@

    teal.slice coverage - 66.10%

    41 - 12x + 12x +
          sprintf(
    42 - 12x + 12x +
            "%s:\n%s",
    43 - 12x + 12x +
            class(self)[1],
    44 - 12x + 12x +
            format(self$get_state(), show_all = show_all, trim_lines = trim_lines)
    @@ -36546,7 +37925,8 @@

    teal.slice coverage - 66.10%

    54 - 1x + 1x +
          cat(isolate(self$format(...)))
    @@ -36609,7 +37989,8 @@

    teal.slice coverage - 66.10%

    63 - 26x + 26x +
          private$teal_slice
    @@ -36686,14 +38067,16 @@

    teal.slice coverage - 66.10%

    74 - 1x + 1x +
          checkmate::assert_class(state, "teal_slice_expr")
    75 - 1x + 1x +
          invisible(self)
    @@ -36805,7 +38188,8 @@

    teal.slice coverage - 66.10%

    91 - 2x + 2x +
          isolate(str2lang(private$teal_slice$expr))
    @@ -37987,7 +39371,8 @@

    teal.slice coverage - 66.10%

    33 - 153x + 153x +
          logger::log_trace("Instantiating { class(self)[1] }, dataname: { dataname }")
    @@ -38008,21 +39393,24 @@

    teal.slice coverage - 66.10%

    36 - 153x + 153x +
          check_simple_name(dataname)
    37 - 151x + 151x +
          checkmate::assert_character(keys, any.missing = FALSE)
    38 - 151x + 151x +
          checkmate::assert_character(label, null.ok = TRUE)
    @@ -38036,35 +39424,40 @@

    teal.slice coverage - 66.10%

    40 - 151x + 151x +
          logger::log_trace("Instantiating { class(self)[1] }, dataname: { dataname }")
    41 - 151x + 151x +
          private$dataset <- dataset
    42 - 151x + 151x +
          private$dataname <- dataname
    43 - 151x + 151x +
          private$keys <- keys
    44 - 151x + 151x +
          private$label <- if (is.null(label)) character(0) else label
    @@ -38085,28 +39478,32 @@

    teal.slice coverage - 66.10%

    47 - 151x + 151x +
          private$data_filtered_fun <- function(sid = "") {
    48 - 24x + 24x +
            checkmate::assert_character(sid)
    49 - 24x + 24x +
            if (length(sid)) {
    50 - 24x + 24x +
              logger::log_trace("filtering data dataname: { dataname }, sid: { sid }")
    @@ -38134,35 +39531,40 @@

    teal.slice coverage - 66.10%

    54 - 24x + 24x +
            env <- new.env(parent = parent.env(globalenv()))
    55 - 24x + 24x +
            env[[dataname]] <- private$dataset
    56 - 24x + 24x +
            filter_call <- self$get_call(sid)
    57 - 24x + 24x +
            eval_expr_with_msg(filter_call, env)
    58 - 24x + 24x +
            get(x = dataname, envir = env)
    @@ -38183,21 +39585,24 @@

    teal.slice coverage - 66.10%

    61 - 151x + 151x +
          private$data_filtered <- reactive(private$data_filtered_fun())
    62 - 151x + 151x +
          logger::log_trace("Instantiated { class(self)[1] }, dataname: { private$dataname }")
    63 - 151x + 151x +
          invisible(self)
    @@ -38281,28 +39686,32 @@

    teal.slice coverage - 66.10%

    75 - 24x + 24x +
          sprintf(
    76 - 24x + 24x +
            "%s:\n%s",
    77 - 24x + 24x +
            class(self)[1],
    78 - 24x + 24x +
            format(self$get_filter_state(), show_all = show_all, trim_lines = trim_lines)
    @@ -38372,7 +39781,8 @@

    teal.slice coverage - 66.10%

    88 - 10x + 10x +
          cat(isolate(self$format(...)), "\n")
    @@ -38449,28 +39859,32 @@

    teal.slice coverage - 66.10%

    99 - 14x + 14x +
          logger::log_trace("Removing filters from FilteredDataset: { deparse1(self$get_dataname()) }")
    100 - 14x + 14x +
          lapply(
    101 - 14x + 14x +
            private$get_filter_states(),
    102 - 14x + 14x +
            function(filter_states) filter_states$clear_filter_states(force)
    @@ -38484,14 +39898,16 @@

    teal.slice coverage - 66.10%

    104 - 14x + 14x +
          logger::log_trace("Removed filters from FilteredDataset: { deparse1(self$get_dataname()) }")
    105 - 14x + 14x +
          NULL
    @@ -38624,21 +40040,24 @@

    teal.slice coverage - 66.10%

    124 - 47x + 47x +
          filter_call <- Filter(
    125 - 47x + 47x +
            f = Negate(is.null),
    126 - 47x + 47x +
            x = lapply(private$get_filter_states(), function(x) x$get_call(sid))
    @@ -38652,14 +40071,16 @@

    teal.slice coverage - 66.10%

    128 - 47x + 47x +
          if (length(filter_call) == 0) {
    129 - 29x + 29x +
            return(NULL)
    @@ -38673,7 +40094,8 @@

    teal.slice coverage - 66.10%

    131 - 18x + 18x +
          filter_call
    @@ -38736,14 +40158,16 @@

    teal.slice coverage - 66.10%

    140 - 184x + 184x +
          states <- unname(lapply(private$get_filter_states(), function(x) x$get_filter_state()))
    141 - 184x + 184x +
          do.call(c, states)
    @@ -38869,7 +40293,8 @@

    teal.slice coverage - 66.10%

    159 - 16x + 16x +
          length(self$get_filter_state())
    @@ -38925,7 +40350,8 @@

    teal.slice coverage - 66.10%

    167 - 8x + 8x +
          private$dataname
    @@ -39016,14 +40442,16 @@

    teal.slice coverage - 66.10%

    180 - 51x + 51x +
          if (filtered) {
    181 - 33x + 33x +
            private$data_filtered
    @@ -39037,7 +40465,8 @@

    teal.slice coverage - 66.10%

    183 - 18x + 18x +
            private$dataset
    @@ -39142,7 +40571,8 @@

    teal.slice coverage - 66.10%

    198 - 133x + 133x +
          private$keys
    @@ -39191,7 +40621,8 @@

    teal.slice coverage - 66.10%

    205 - 2x + 2x +
          private$label
    @@ -39737,77 +41168,88 @@

    teal.slice coverage - 66.10%

    283 - 7x + 7x +
          moduleServer(
    284 - 7x + 7x +
            id = id,
    285 - 7x + 7x +
            function(input, output, session) {
    286 - 7x + 7x +
              dataname <- self$get_dataname()
    287 - 7x + 7x +
              logger::log_trace("FilteredDataset$srv_active initializing, dataname: { dataname }")
    288 - 7x + 7x +
              checkmate::assert_string(dataname)
    289 - 7x + 7x +
              output$filter_count <- renderText(
    290 - 7x + 7x +
                sprintf(
    291 - 7x + 7x +
                  "%d filter%s applied",
    292 - 7x + 7x +
                  self$get_filter_count(),
    293 - 7x + 7x +
                  if (self$get_filter_count() != 1) "s" else ""
    @@ -39835,28 +41277,32 @@

    teal.slice coverage - 66.10%

    297 - 7x + 7x +
              lapply(
    298 - 7x + 7x +
                names(private$get_filter_states()),
    299 - 7x + 7x +
                function(x) {
    300 - 12x + 12x +
                  private$get_filter_states()[[x]]$srv_active(id = x)
    @@ -39884,35 +41330,40 @@

    teal.slice coverage - 66.10%

    304 - 7x + 7x +
              observeEvent(self$get_filter_state(), {
    305 - 8x + 8x +
                shinyjs::hide("filter_count_ui")
    306 - 8x + 8x +
                shinyjs::show("filters")
    307 - 8x + 8x +
                shinyjs::toggle("remove_filters", condition = length(self$get_filter_state()) != 0)
    308 - 8x + 8x +
                shinyjs::toggle("collapse", condition = length(self$get_filter_state()) != 0)
    @@ -39933,7 +41384,8 @@

    teal.slice coverage - 66.10%

    311 - 7x + 7x +
              observeEvent(input$collapse, {
    @@ -39975,28 +41427,32 @@

    teal.slice coverage - 66.10%

    317 - 7x + 7x +
              observeEvent(input$remove_filters, {
    318 - 1x + 1x +
                logger::log_trace("FilteredDataset$srv_active@1 removing all non-anchored filters, dataname: { dataname }")
    319 - 1x + 1x +
                self$clear_filter_states()
    320 - 1x + 1x +
                logger::log_trace("FilteredDataset$srv_active@1 removed all non-anchored filters, dataname: { dataname }")
    @@ -40017,7 +41473,8 @@

    teal.slice coverage - 66.10%

    323 - 7x + 7x +
              logger::log_trace("FilteredDataset$initialized, dataname: { dataname }")
    @@ -40031,7 +41488,8 @@

    teal.slice coverage - 66.10%

    325 - 7x + 7x +
              NULL
    @@ -40122,7 +41580,8 @@

    teal.slice coverage - 66.10%

    338 - 1x + 1x +
          stop("Pure virtual method")
    @@ -40220,63 +41679,72 @@

    teal.slice coverage - 66.10%

    352 - 2x + 2x +
          moduleServer(
    353 - 2x + 2x +
            id = id,
    354 - 2x + 2x +
            function(input, output, session) {
    355 - 2x + 2x +
              logger::log_trace("MAEFilteredDataset$srv_add initializing, dataname: { deparse1(self$get_dataname()) }")
    356 - 2x + 2x +
              elems <- private$get_filter_states()
    357 - 2x + 2x +
              elem_names <- names(private$get_filter_states())
    358 - 2x + 2x +
              lapply(
    359 - 2x + 2x +
                elem_names,
    360 - 2x + 2x +
                function(elem_name) elems[[elem_name]]$srv_add(elem_name)
    @@ -40290,14 +41758,16 @@

    teal.slice coverage - 66.10%

    362 - 2x + 2x +
              logger::log_trace("MAEFilteredDataset$srv_add initialized, dataname: { deparse1(self$get_dataname()) }")
    363 - 2x + 2x +
              NULL
    @@ -40437,28 +41907,32 @@

    teal.slice coverage - 66.10%

    383 - 225x + 225x +
          checkmate::assert_class(filter_states, "FilterStates")
    384 - 225x + 225x +
          checkmate::assert_string(id)
    385 - 225x + 225x +
          x <- stats::setNames(list(filter_states), id)
    386 - 225x + 225x +
          private$filter_states <- c(private$get_filter_states(), x)
    @@ -40507,7 +41981,8 @@

    teal.slice coverage - 66.10%

    393 - 684x + 684x +
          private$filter_states
    @@ -40863,42 +42338,48 @@

    teal.slice coverage - 66.10%

    47 - 6x + 6x +
          isolate({
    48 - 6x + 6x +
            super$initialize(
    49 - 6x + 6x +
              x = x,
    50 - 6x + 6x +
              x_reactive = x_reactive,
    51 - 6x + 6x +
              slice = slice,
    52 - 6x + 6x +
              extract_type = extract_type
    @@ -40912,14 +42393,16 @@

    teal.slice coverage - 66.10%

    54 - 6x + 6x +
            private$set_choices(slice$choices)
    55 - 6x + 6x +
            private$set_selected(slice$selected)
    @@ -40940,7 +42423,8 @@

    teal.slice coverage - 66.10%

    58 - 6x + 6x +
          invisible(self)
    @@ -41010,14 +42494,16 @@

    teal.slice coverage - 66.10%

    68 - 2x + 2x +
          if (isFALSE(private$is_any_filtered())) {
    69 - 1x + 1x +
            return(NULL)
    @@ -41031,14 +42517,16 @@

    teal.slice coverage - 66.10%

    71 - 1x + 1x +
          if (missing(dataname)) dataname <- private$get_dataname()
    72 - 1x + 1x +
          filter_call <- if (isTRUE(private$get_keep_na())) {
    @@ -41059,7 +42547,8 @@

    teal.slice coverage - 66.10%

    75 - 1x + 1x +
            substitute(!is.na(varname), list(varname = private$get_varname_prefixed(dataname)))
    @@ -41171,14 +42660,16 @@

    teal.slice coverage - 66.10%

    91 - 6x + 6x +
          private$teal_slice$choices <- choices
    92 - 6x + 6x +
          invisible(NULL)
    @@ -41234,7 +42725,8 @@

    teal.slice coverage - 66.10%

    100 - 2x + 2x +
          if (private$is_choice_limited) {
    @@ -41255,7 +42747,8 @@

    teal.slice coverage - 66.10%

    103 - 2x + 2x +
            !isTRUE(private$get_keep_na())
    @@ -41968,42 +43461,48 @@

    teal.slice coverage - 66.10%

    48 - 159x + 159x +
          isolate({
    49 - 159x + 159x +
            checkmate::assert(
    50 - 159x + 159x +
              is.character(x),
    51 - 159x + 159x +
              is.factor(x),
    52 - 159x + 159x +
              length(unique(x[!is.na(x)])) < getOption("teal.threshold_slider_vs_checkboxgroup"),
    53 - 159x + 159x +
              combine = "or"
    @@ -42024,28 +43523,32 @@

    teal.slice coverage - 66.10%

    56 - 159x + 159x +
            x_factor <- if (!is.factor(x)) {
    57 - 124x + 124x +
              structure(
    58 - 124x + 124x +
                factor(as.character(x), levels = as.character(sort(unique(x)))),
    59 - 124x + 124x +
                label = attr(x, "label")
    @@ -42066,7 +43569,8 @@

    teal.slice coverage - 66.10%

    62 - 35x + 35x +
              x
    @@ -42087,35 +43591,40 @@

    teal.slice coverage - 66.10%

    65 - 159x + 159x +
            super$initialize(
    66 - 159x + 159x +
              x = x_factor,
    67 - 159x + 159x +
              x_reactive = x_reactive,
    68 - 159x + 159x +
              slice = slice,
    69 - 159x + 159x +
              extract_type = extract_type
    @@ -42129,63 +43638,72 @@

    teal.slice coverage - 66.10%

    71 - 159x + 159x +
            private$set_choices(slice$choices)
    72 - 159x + 159x +
            if (is.null(slice$selected) && slice$multiple) {
    73 - 42x + 42x +
              slice$selected <- private$get_choices()
    74 - 117x + 117x +
            } else if (is.null(slice$selected)) {
    75 - 1x + 1x +
              slice$selected <- private$get_choices()[1]
    76 - 116x + 116x +
            } else if (length(slice$selected) > 1 && !slice$multiple) {
    77 - 1x + 1x +
              warning(
    78 - 1x + 1x +
                "ChoicesFilterState allows \"selected\" to be of length 1 when \"multiple\" is FALSE. ",
    79 - 1x + 1x +
                "Only the first value will be used."
    @@ -42199,7 +43717,8 @@

    teal.slice coverage - 66.10%

    81 - 1x + 1x +
              slice$selected <- slice$selected[1]
    @@ -42213,28 +43732,32 @@

    teal.slice coverage - 66.10%

    83 - 159x + 159x +
            private$set_selected(slice$selected)
    84 - 159x + 159x +
            private$data_class <- class(x)[1L]
    85 - 159x + 159x +
            if (inherits(x, "POSIXt")) {
    86 - 9x + 9x +
              private$tzone <- Find(function(x) x != "", attr(as.POSIXlt(x), "tzone"))
    @@ -42255,7 +43778,8 @@

    teal.slice coverage - 66.10%

    89 - 159x + 159x +
            private$set_choices_counts(unname(table(x_factor)))
    @@ -42269,7 +43793,8 @@

    teal.slice coverage - 66.10%

    91 - 159x + 159x +
          invisible(self)
    @@ -42346,14 +43871,16 @@

    teal.slice coverage - 66.10%

    102 - 60x + 60x +
          if (isFALSE(private$is_any_filtered())) {
    103 - 7x + 7x +
            return(NULL)
    @@ -42367,49 +43894,56 @@

    teal.slice coverage - 66.10%

    105 - 29x + 29x +
          if (missing(dataname)) dataname <- private$get_dataname()
    106 - 53x + 53x +
          varname <- private$get_varname_prefixed(dataname)
    107 - 53x + 53x +
          selected <- private$get_selected()
    108 - 53x + 53x +
          if (length(selected) == 0) {
    109 - 6x + 6x +
            choices <- private$get_choices()
    110 - 6x + 6x +
            fun_compare <- if (length(choices) == 1L) "==" else "%in%"
    111 - 6x + 6x +
            filter_call <- call("!", call(fun_compare, varname, make_c_call(as.character(choices))))
    @@ -42423,14 +43957,16 @@

    teal.slice coverage - 66.10%

    113 - 47x + 47x +
            if (setequal(na.omit(private$x), selected)) {
    114 - 3x + 3x +
              filter_call <- NULL
    @@ -42444,7 +43980,8 @@

    teal.slice coverage - 66.10%

    116 - 44x + 44x +
              fun_compare <- if (length(selected) == 1L) "==" else "%in%"
    @@ -42458,14 +43995,16 @@

    teal.slice coverage - 66.10%

    118 - 44x + 44x +
              if (private$data_class != "factor") {
    119 - 37x + 37x +
                selected <- do.call(sprintf("as.%s", private$data_class), list(x = selected))
    @@ -42486,63 +44025,72 @@

    teal.slice coverage - 66.10%

    122 - 44x + 44x +
              filter_call <-
    123 - 44x + 44x +
                if (inherits(selected, "Date")) {
    124 - 1x + 1x +
                  call(fun_compare, varname, call("as.Date", make_c_call(as.character(selected))))
    125 - 44x + 44x +
                } else if (inherits(selected, c("POSIXct", "POSIXlt"))) {
    126 - 2x + 2x +
                  class <- class(selected)[1L]
    127 - 2x + 2x +
                  date_fun <- as.name(
    128 - 2x + 2x +
                    switch(class,
    129 - 2x + 2x +
                      "POSIXct" = "as.POSIXct",
    130 - 2x + 2x +
                      "POSIXlt" = "as.POSIXlt"
    @@ -42563,28 +44111,32 @@

    teal.slice coverage - 66.10%

    133 - 2x + 2x +
                  call(
    134 - 2x + 2x +
                    fun_compare,
    135 - 2x + 2x +
                    varname,
    136 - 2x + 2x +
                    as.call(list(date_fun, make_c_call(as.character(selected)), tz = private$tzone))
    @@ -42612,7 +44164,8 @@

    teal.slice coverage - 66.10%

    140 - 41x + 41x +
                  call(fun_compare, varname, make_c_call(selected))
    @@ -42640,7 +44193,8 @@

    teal.slice coverage - 66.10%

    144 - 53x + 53x +
          private$add_keep_na_call(filter_call, varname)
    @@ -42759,14 +44313,16 @@

    teal.slice coverage - 66.10%

    161 - 159x + 159x +
          if (is.null(choices)) {
    162 - 144x + 144x +
            choices <- levels(private$x)
    @@ -42780,49 +44336,56 @@

    teal.slice coverage - 66.10%

    164 - 15x + 15x +
            choices <- as.character(choices)
    165 - 15x + 15x +
            choices_adjusted <- choices[choices %in% levels(private$x)]
    166 - 15x + 15x +
            if (length(setdiff(choices, choices_adjusted)) > 0L) {
    167 - 2x + 2x +
              warning(
    168 - 2x + 2x +
                sprintf(
    169 - 2x + 2x +
                  "Some choices not found in data. Adjusting. Filter id: %s.",
    170 - 2x + 2x +
                  private$get_id()
    @@ -42843,7 +44406,8 @@

    teal.slice coverage - 66.10%

    173 - 2x + 2x +
              choices <- choices_adjusted
    @@ -42857,35 +44421,40 @@

    teal.slice coverage - 66.10%

    175 - 15x + 15x +
            if (length(choices) == 0) {
    176 - 1x + 1x +
              warning(
    177 - 1x + 1x +
                sprintf(
    178 - 1x + 1x +
                  "None of the choices were found in data. Setting defaults. Filter id: %s.",
    179 - 1x + 1x +
                  private$get_id()
    @@ -42906,7 +44475,8 @@

    teal.slice coverage - 66.10%

    182 - 1x + 1x +
              choices <- levels(private$x)
    @@ -42927,35 +44497,40 @@

    teal.slice coverage - 66.10%

    185 - 159x + 159x +
          private$set_is_choice_limited(private$x, choices)
    186 - 159x + 159x +
          private$teal_slice$choices <- choices
    187 - 159x + 159x +
          private$x <- private$x[(private$x %in% private$get_choices()) | is.na(private$x)]
    188 - 159x + 159x +
          private$x <- droplevels(private$x)
    189 - 159x + 159x +
          invisible(NULL)
    @@ -42990,21 +44565,24 @@

    teal.slice coverage - 66.10%

    194 - 159x + 159x +
          xl <- x[!is.na(x)]
    195 - 159x + 159x +
          private$is_choice_limited <- length(setdiff(xl, choices)) > 0L
    196 - 159x + 159x +
          invisible(NULL)
    @@ -43039,14 +44617,16 @@

    teal.slice coverage - 66.10%

    201 - 159x + 159x +
          private$choices_counts <- choices_counts
    202 - 159x + 159x +
          invisible(NULL)
    @@ -43144,7 +44724,8 @@

    teal.slice coverage - 66.10%

    216 - 23x + 23x +
          length(private$get_choices()) <= getOption("teal.threshold_slider_vs_checkboxgroup")
    @@ -43165,21 +44746,24 @@

    teal.slice coverage - 66.10%

    219 - 188x + 188x +
          tryCatch(
    220 - 188x + 188x +
            expr = {
    221 - 188x + 188x +
              values <- as.character(values)
    @@ -43200,7 +44784,8 @@

    teal.slice coverage - 66.10%

    224 - 188x + 188x +
            error = function(e) stop("The vector of set values must contain values coercible to character.")
    @@ -43214,7 +44799,8 @@

    teal.slice coverage - 66.10%

    226 - 188x + 188x +
          values
    @@ -43242,28 +44828,32 @@

    teal.slice coverage - 66.10%

    230 - 188x + 188x +
          if (!private$is_multiple() && length(values) > 1) {
    231 - 1x + 1x +
            warning(
    232 - 1x + 1x +
              sprintf("Selection: %s is not a vector of length one. ", toString(values, width = 360)),
    233 - 1x + 1x +
              "Maintaining previous selection."
    @@ -43277,7 +44867,8 @@

    teal.slice coverage - 66.10%

    235 - 1x + 1x +
            values <- isolate(private$get_selected())
    @@ -43291,7 +44882,8 @@

    teal.slice coverage - 66.10%

    237 - 188x + 188x +
          values
    @@ -43312,35 +44904,40 @@

    teal.slice coverage - 66.10%

    240 - 188x + 188x +
          in_choices_mask <- values %in% private$get_choices()
    241 - 188x + 188x +
          if (length(values[!in_choices_mask]) > 0) {
    242 - 17x + 17x +
            warning(paste(
    243 - 17x + 17x +
              "Values:", toString(values[!in_choices_mask], width = 360),
    244 - 17x + 17x +
              "are not in choices of column", private$get_varname(), "in dataset", private$get_dataname(), "."
    @@ -43361,7 +44958,8 @@

    teal.slice coverage - 66.10%

    247 - 188x + 188x +
          values[in_choices_mask]
    @@ -43438,7 +45036,8 @@

    teal.slice coverage - 66.10%

    258 - 7x + 7x +
          ns <- NS(id)
    @@ -43459,21 +45058,24 @@

    teal.slice coverage - 66.10%

    261 - 7x + 7x +
          isolate({
    262 - 7x + 7x +
            countsmax <- private$choices_counts
    263 - 7x + 7x +
            countsnow <- if (!is.null(private$x_reactive())) {
    @@ -43501,42 +45103,48 @@

    teal.slice coverage - 66.10%

    267 - 7x + 7x +
            ui_input <- if (private$is_checkboxgroup()) {
    268 - 7x + 7x +
              labels <- countBars(
    269 - 7x + 7x +
                inputId = ns("labels"),
    270 - 7x + 7x +
                choices = private$get_choices(),
    271 - 7x + 7x +
                countsnow = countsnow,
    272 - 7x + 7x +
                countsmax = countsmax
    @@ -43550,70 +45158,80 @@

    teal.slice coverage - 66.10%

    274 - 7x + 7x +
              div(
    275 - 7x + 7x +
                class = "choices_state",
    276 - 7x + 7x +
                if (private$is_multiple()) {
    277 - 7x + 7x +
                  checkboxGroupInput(
    278 - 7x + 7x +
                    inputId = ns("selection"),
    279 - 7x + 7x +
                    label = NULL,
    280 - 7x + 7x +
                    selected = private$get_selected(),
    281 - 7x + 7x +
                    choiceNames = labels,
    282 - 7x + 7x +
                    choiceValues = private$get_choices(),
    283 - 7x + 7x +
                    width = "100%"
    @@ -43844,28 +45462,32 @@

    teal.slice coverage - 66.10%

    316 - 7x + 7x +
            div(
    317 - 7x + 7x +
              uiOutput(ns("trigger_visible")),
    318 - 7x + 7x +
              ui_input,
    319 - 7x + 7x +
              private$keep_na_ui(ns("keep_na"))
    @@ -43935,28 +45557,32 @@

    teal.slice coverage - 66.10%

    329 - 7x + 7x +
          moduleServer(
    330 - 7x + 7x +
            id = id,
    331 - 7x + 7x +
            function(input, output, session) {
    332 - 7x + 7x +
              logger::log_trace("ChoicesFilterState$server_inputs initializing, id: { private$get_id() }")
    @@ -43991,21 +45617,24 @@

    teal.slice coverage - 66.10%

    337 - 7x + 7x +
              non_missing_values <- reactive(Filter(Negate(is.na), private$x_reactive()))
    338 - 7x + 7x +
              output$trigger_visible <- renderUI({
    339 - 7x + 7x +
                logger::log_trace("ChoicesFilterState$server_inputs@1 updating count labels, id: { private$get_id() }")
    @@ -44019,7 +45648,8 @@

    teal.slice coverage - 66.10%

    341 - 7x + 7x +
                countsnow <- if (!is.null(private$x_reactive())) {
    @@ -44054,49 +45684,56 @@

    teal.slice coverage - 66.10%

    346 - 7x + 7x +
                isolate({
    347 - 7x + 7x +
                  if (private$is_checkboxgroup()) {
    348 - 7x + 7x +
                    updateCountBars(
    349 - 7x + 7x +
                      inputId = "labels",
    350 - 7x + 7x +
                      choices = private$get_choices(),
    351 - 7x + 7x +
                      countsmax = private$choices_counts,
    352 - 7x + 7x +
                      countsnow = countsnow
    @@ -44208,7 +45845,8 @@

    teal.slice coverage - 66.10%

    368 - 7x + 7x +
                  NULL
    @@ -44236,42 +45874,48 @@

    teal.slice coverage - 66.10%

    372 - 7x + 7x +
              if (private$is_checkboxgroup()) {
    373 - 7x + 7x +
                private$observers$selection <- observeEvent(
    374 - 7x + 7x +
                  ignoreNULL = FALSE,
    375 - 7x + 7x +
                  ignoreInit = TRUE, # ignoreInit: should not matter because we set the UI with the desired initial state
    376 - 7x + 7x +
                  eventExpr = input$selection,
    377 - 7x + 7x +
                  handlerExpr = {
    @@ -44593,7 +46237,8 @@

    teal.slice coverage - 66.10%

    423 - 7x + 7x +
              private$keep_na_srv("keep_na")
    @@ -44628,7 +46273,8 @@

    teal.slice coverage - 66.10%

    428 - 7x + 7x +
              private$observers$selection_api <- observeEvent(private$get_selected(), {
    @@ -44649,49 +46295,56 @@

    teal.slice coverage - 66.10%

    431 - 2x + 2x +
                if (!setequal(input$selection, private$get_selected())) {
    432 - 2x + 2x +
                  logger::log_trace("ChoicesFilterState$server@1 state changed, id: { private$get_id() }")
    433 - 2x + 2x +
                  if (private$is_checkboxgroup()) {
    434 - 2x + 2x +
                    if (private$is_multiple()) {
    435 - 2x + 2x +
                      updateCheckboxGroupInput(
    436 - 2x + 2x +
                        inputId = "selection",
    437 - 2x + 2x +
                        selected = private$get_selected()
    @@ -44810,14 +46463,16 @@

    teal.slice coverage - 66.10%

    454 - 7x + 7x +
              logger::log_trace("ChoicesFilterState$server_inputs initialized, id: { private$get_id() }")
    455 - 7x + 7x +
              NULL
    @@ -45069,21 +46724,24 @@

    teal.slice coverage - 66.10%

    491 - 7x + 7x +
          selected <- private$get_selected()
    492 - 7x + 7x +
          selected_text <-
    493 - 7x + 7x +
            if (length(selected) == 0L) {
    @@ -45104,14 +46762,16 @@

    teal.slice coverage - 66.10%

    496 - 7x + 7x +
              if (sum(nchar(selected)) <= 40L) {
    497 - 7x + 7x +
                paste(selected, collapse = ", ")
    @@ -45146,28 +46806,32 @@

    teal.slice coverage - 66.10%

    502 - 7x + 7x +
          tagList(
    503 - 7x + 7x +
            tags$span(
    504 - 7x + 7x +
              class = "filter-card-summary-value",
    505 - 7x + 7x +
              selected_text
    @@ -45181,21 +46845,24 @@

    teal.slice coverage - 66.10%

    507 - 7x + 7x +
            tags$span(
    508 - 7x + 7x +
              class = "filter-card-summary-controls",
    509 - 7x + 7x +
              if (private$na_count > 0) {
    @@ -45446,7 +47113,8 @@

    teal.slice coverage - 66.10%

    28 - 229x + 229x +
      UseMethod("init_filter_states")
    @@ -45523,42 +47191,48 @@

    teal.slice coverage - 66.10%

    39 - 100x + 100x +
      DFFilterStates$new(
    40 - 100x + 100x +
        data = data,
    41 - 100x + 100x +
        data_reactive = data_reactive,
    42 - 100x + 100x +
        dataname = dataname,
    43 - 100x + 100x +
        datalabel = datalabel,
    44 - 100x + 100x +
        keys = keys
    @@ -45635,35 +47309,40 @@

    teal.slice coverage - 66.10%

    55 - 22x + 22x +
      MatrixFilterStates$new(
    56 - 22x + 22x +
        data = data,
    57 - 22x + 22x +
        data_reactive = data_reactive,
    58 - 22x + 22x +
        dataname = dataname,
    59 - 22x + 22x +
        datalabel = datalabel
    @@ -45747,7 +47426,8 @@

    teal.slice coverage - 66.10%

    71 - 22x + 22x +
      if (!requireNamespace("MultiAssayExperiment", quietly = TRUE)) {
    @@ -45768,42 +47448,48 @@

    teal.slice coverage - 66.10%

    74 - 22x + 22x +
      MAEFilterStates$new(
    75 - 22x + 22x +
        data = data,
    76 - 22x + 22x +
        data_reactive = data_reactive,
    77 - 22x + 22x +
        dataname = dataname,
    78 - 22x + 22x +
        datalabel = datalabel,
    79 - 22x + 22x +
        keys = keys
    @@ -45880,7 +47566,8 @@

    teal.slice coverage - 66.10%

    90 - 85x + 85x +
      if (!requireNamespace("SummarizedExperiment", quietly = TRUE)) {
    @@ -45901,35 +47588,40 @@

    teal.slice coverage - 66.10%

    93 - 85x + 85x +
      SEFilterStates$new(
    94 - 85x + 85x +
        data = data,
    95 - 85x + 85x +
        data_reactive = data_reactive,
    96 - 85x + 85x +
        dataname = dataname,
    97 - 85x + 85x +
        datalabel = datalabel
    @@ -46034,7 +47726,8 @@

    teal.slice coverage - 66.10%

    112 - 227x + 227x +
      UseMethod("get_supported_filter_varnames")
    @@ -46076,28 +47769,32 @@

    teal.slice coverage - 66.10%

    118 - 198x + 198x +
      is_expected_class <- vapply(
    119 - 198x + 198x +
        X = data,
    120 - 198x + 198x +
        FUN = function(x) any(class(x) %in% .filterable_class),
    121 - 198x + 198x +
        FUN.VALUE = logical(1)
    @@ -46111,7 +47808,8 @@

    teal.slice coverage - 66.10%

    123 - 198x + 198x +
      names(is_expected_class[is_expected_class])
    @@ -46160,21 +47858,24 @@

    teal.slice coverage - 66.10%

    130 - 29x + 29x +
      is_expected_class <- class(data[, 1]) %in% .filterable_class
    131 - 29x + 29x +
      if (is_expected_class && !is.null(colnames(data))) {
    132 - 26x + 26x +
        colnames(data)
    @@ -46188,7 +47889,8 @@

    teal.slice coverage - 66.10%

    134 - 3x + 3x +
        character(0)
    @@ -46426,7 +48128,8 @@

    teal.slice coverage - 66.10%

    168 - 9x + 9x +
      if (length(choices) == 0) {
    @@ -46447,14 +48150,16 @@

    teal.slice coverage - 66.10%

    171 - 9x + 9x +
      choice_types <- variable_types(data = data, columns = choices)
    172 - 9x + 9x +
      choice_types[keys] <- "primary_key"
    @@ -46468,28 +48173,32 @@

    teal.slice coverage - 66.10%

    174 - 9x + 9x +
      choices_labeled(
    175 - 9x + 9x +
        choices = choices,
    176 - 9x + 9x +
        labels = unname(varlabels[choices]),
    177 - 9x + 9x +
        types = choice_types[choices]
    @@ -46538,49 +48247,56 @@

    teal.slice coverage - 66.10%

    184 - 9x + 9x +
      if (!is.array(data)) {
    185 - 9x + 9x +
        vapply(
    186 - 9x + 9x +
          colnames(data),
    187 - 9x + 9x +
          FUN = function(x) {
    188 - 42x + 42x +
            label <- attr(data[[x]], "label")
    189 - 42x + 42x +
            if (is.null(label)) {
    190 - 40x + 40x +
              x
    @@ -46594,7 +48310,8 @@

    teal.slice coverage - 66.10%

    192 - 2x + 2x +
              label
    @@ -46615,7 +48332,8 @@

    teal.slice coverage - 66.10%

    195 - 9x + 9x +
          FUN.VALUE = character(1)
    @@ -46866,7 +48584,8 @@

    teal.slice coverage - 66.10%

    30 - 23x + 23x +
          if (!requireNamespace("MultiAssayExperiment", quietly = TRUE)) {
    @@ -46887,21 +48606,24 @@

    teal.slice coverage - 66.10%

    33 - 23x + 23x +
          checkmate::assert_class(dataset, "MultiAssayExperiment")
    34 - 21x + 21x +
          super$initialize(dataset, dataname, keys, label)
    35 - 21x + 21x +
          experiment_names <- names(dataset)
    @@ -46922,49 +48644,56 @@

    teal.slice coverage - 66.10%

    38 - 21x + 21x +
          private$add_filter_states(
    39 - 21x + 21x +
            filter_states = init_filter_states(
    40 - 21x + 21x +
              data = dataset,
    41 - 21x + 21x +
              data_reactive = private$data_filtered_fun,
    42 - 21x + 21x +
              dataname = dataname,
    43 - 21x + 21x +
              datalabel = "subjects",
    44 - 21x + 21x +
              keys = self$get_keys()
    @@ -46978,7 +48707,8 @@

    teal.slice coverage - 66.10%

    46 - 21x + 21x +
            id = "subjects"
    @@ -47013,70 +48743,80 @@

    teal.slice coverage - 66.10%

    51 - 21x + 21x +
          lapply(
    52 - 21x + 21x +
            experiment_names,
    53 - 21x + 21x +
            function(experiment_name) {
    54 - 105x + 105x +
              data_reactive <- function(sid = "") private$data_filtered_fun(sid)[[experiment_name]]
    55 - 105x + 105x +
              private$add_filter_states(
    56 - 105x + 105x +
                filter_states = init_filter_states(
    57 - 105x + 105x +
                  data = dataset[[experiment_name]],
    58 - 105x + 105x +
                  data_reactive = data_reactive,
    59 - 105x + 105x +
                  dataname = dataname,
    60 - 105x + 105x +
                  datalabel = experiment_name
    @@ -47090,7 +48830,8 @@

    teal.slice coverage - 66.10%

    62 - 105x + 105x +
                id = experiment_name
    @@ -47181,35 +48922,40 @@

    teal.slice coverage - 66.10%

    75 - 15x + 15x +
          isolate({
    76 - 15x + 15x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initializing, dataname: { private$dataname }")
    77 - 15x + 15x +
            checkmate::assert_class(state, "teal_slices")
    78 - 14x + 14x +
            lapply(state, function(x) {
    79 - 52x + 52x +
              checkmate::assert_true(x$dataname == private$dataname, .var.name = "dataname matches private$dataname")
    @@ -47237,14 +48983,16 @@

    teal.slice coverage - 66.10%

    83 - 14x + 14x +
            subject_state <- Filter(function(x) is.null(x$experiment), state)
    84 - 14x + 14x +
            private$get_filter_states()[["subjects"]]$set_filter_state(subject_state)
    @@ -47272,28 +49020,32 @@

    teal.slice coverage - 66.10%

    88 - 14x + 14x +
            experiments <- unique(unlist(lapply(state, "[[", "experiment")))
    89 - 14x + 14x +
            available_experiments <- setdiff(names(private$get_filter_states()), "subjects")
    90 - 14x + 14x +
            excluded_filters <- setdiff(experiments, available_experiments)
    91 - 14x + 14x +
            if (length(excluded_filters)) {
    @@ -47363,21 +49115,24 @@

    teal.slice coverage - 66.10%

    101 - 14x + 14x +
            lapply(available_experiments, function(experiment) {
    102 - 70x + 70x +
              slices <- Filter(function(x) identical(x$experiment, experiment), state)
    103 - 70x + 70x +
              private$get_filter_states()[[experiment]]$set_filter_state(slices)
    @@ -47398,7 +49153,8 @@

    teal.slice coverage - 66.10%

    106 - 14x + 14x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initialized, dataname: { private$dataname }")
    @@ -47412,7 +49168,8 @@

    teal.slice coverage - 66.10%

    108 - 14x + 14x +
            invisible(NULL)
    @@ -47510,7 +49267,8 @@

    teal.slice coverage - 66.10%

    122 - 1x + 1x +
          checkmate::assert_class(state, "teal_slices")
    @@ -47524,14 +49282,16 @@

    teal.slice coverage - 66.10%

    124 - 1x + 1x +
          isolate({
    125 - 1x + 1x +
            logger::log_trace("{ class(self)[1] }$remove_filter_state removing filter(s), dataname: { private$dataname }")
    @@ -47545,14 +49305,16 @@

    teal.slice coverage - 66.10%

    127 - 1x + 1x +
            subject_state <- Filter(function(x) is.null(x$experiment), state)
    128 - 1x + 1x +
            private$get_filter_states()[["subjects"]]$remove_filter_state(subject_state)
    @@ -47580,28 +49342,32 @@

    teal.slice coverage - 66.10%

    132 - 1x + 1x +
            experiments <- unique(unlist(lapply(state, "[[", "experiment")))
    133 - 1x + 1x +
            available_experiments <- setdiff(names(private$get_filter_states()), "subjects")
    134 - 1x + 1x +
            excluded_filters <- setdiff(experiments, available_experiments)
    135 - 1x + 1x +
            if (length(excluded_filters)) {
    @@ -47664,7 +49430,8 @@

    teal.slice coverage - 66.10%

    144 - 1x + 1x +
            lapply(experiments, function(experiment) {
    @@ -47706,7 +49473,8 @@

    teal.slice coverage - 66.10%

    150 - 1x + 1x +
            logger::log_trace("{ class(self)[1] }$remove_filter_state removed filter(s), dataname: { private$dataname }")
    @@ -47727,7 +49495,8 @@

    teal.slice coverage - 66.10%

    153 - 1x + 1x +
          invisible(NULL)
    @@ -48014,21 +49783,24 @@

    teal.slice coverage - 66.10%

    194 - 2x + 2x +
          data <- self$get_dataset()
    195 - 2x + 2x +
          data_filtered <- self$get_dataset(TRUE)
    196 - 2x + 2x +
          experiment_names <- names(data)
    @@ -48042,28 +49814,32 @@

    teal.slice coverage - 66.10%

    198 - 2x + 2x +
          mae_info <- data.frame(
    199 - 2x + 2x +
            dataname = private$dataname,
    200 - 2x + 2x +
            subjects = nrow(SummarizedExperiment::colData(data)),
    201 - 2x + 2x +
            subjects_filtered = nrow(SummarizedExperiment::colData(data_filtered()))
    @@ -48084,49 +49860,56 @@

    teal.slice coverage - 66.10%

    204 - 2x + 2x +
          experiment_obs_info <- do.call("rbind", lapply(
    205 - 2x + 2x +
            experiment_names,
    206 - 2x + 2x +
            function(experiment_name) {
    207 - 10x + 10x +
              data.frame(
    208 - 10x + 10x +
                dataname = sprintf("- %s", experiment_name),
    209 - 10x + 10x +
                obs = nrow(data[[experiment_name]]),
    210 - 10x + 10x +
                obs_filtered = nrow(data_filtered()[[experiment_name]])
    @@ -48161,21 +49944,24 @@

    teal.slice coverage - 66.10%

    215 - 2x + 2x +
          get_experiment_keys <- function(mae, experiment) {
    216 - 20x + 20x +
            sample_subset <- subset(MultiAssayExperiment::sampleMap(mae), colname %in% colnames(experiment))
    217 - 20x + 20x +
            length(unique(sample_subset$primary))
    @@ -48196,42 +49982,48 @@

    teal.slice coverage - 66.10%

    220 - 2x + 2x +
          experiment_subjects_info <- do.call("rbind", lapply(
    221 - 2x + 2x +
            experiment_names,
    222 - 2x + 2x +
            function(experiment_name) {
    223 - 10x + 10x +
              data.frame(
    224 - 10x + 10x +
                subjects = get_experiment_keys(data, data[[experiment_name]]),
    225 - 10x + 10x +
                subjects_filtered = get_experiment_keys(data_filtered(), data_filtered()[[experiment_name]])
    @@ -48266,14 +50058,16 @@

    teal.slice coverage - 66.10%

    230 - 2x + 2x +
          experiment_info <- cbind(experiment_obs_info, experiment_subjects_info)
    231 - 2x + 2x +
          dplyr::bind_rows(mae_info, experiment_info)
    @@ -48510,35 +50304,40 @@

    teal.slice coverage - 66.10%

    30 - 195x + 195x +
      checkmate::assert_class(x_reactive, "reactive")
    31 - 194x + 194x +
      checkmate::assert_character(extract_type, max.len = 1, any.missing = FALSE)
    32 - 194x + 194x +
      checkmate::assert_class(slice, "teal_slice")
    33 - 193x + 193x +
      if (length(extract_type) == 1) {
    34 - 43x + 43x +
        checkmate::assert_choice(extract_type, choices = c("list", "matrix"))
    @@ -48559,42 +50358,48 @@

    teal.slice coverage - 66.10%

    37 - 192x + 192x +
      if (all(is.na(x))) {
    38 - 1x + 1x +
        EmptyFilterState$new(
    39 - 1x + 1x +
          x = x,
    40 - 1x + 1x +
          x_reactive = x_reactive,
    41 - 1x + 1x +
          slice = slice,
    42 - 1x + 1x +
          extract_type = extract_type
    @@ -48615,7 +50420,8 @@

    teal.slice coverage - 66.10%

    45 - 191x + 191x +
        UseMethod("init_filter_state")
    @@ -48685,35 +50491,40 @@

    teal.slice coverage - 66.10%

    55 - 1x + 1x +
      args <- list(
    56 - 1x + 1x +
        x = x,
    57 - 1x + 1x +
        x_reactive = x_reactive,
    58 - 1x + 1x +
        extract_type = extract_type,
    59 - 1x + 1x +
        slice
    @@ -48734,7 +50545,8 @@

    teal.slice coverage - 66.10%

    62 - 1x + 1x +
      do.call(FilterState$new, args)
    @@ -48797,35 +50609,40 @@

    teal.slice coverage - 66.10%

    71 - 1x + 1x +
      LogicalFilterState$new(
    72 - 1x + 1x +
        x = x,
    73 - 1x + 1x +
        x_reactive = x_reactive,
    74 - 1x + 1x +
        slice = slice,
    75 - 1x + 1x +
        extract_type = extract_type
    @@ -48895,35 +50712,40 @@

    teal.slice coverage - 66.10%

    85 - 120x + 120x +
      args <- list(
    86 - 120x + 120x +
        x = x,
    87 - 120x + 120x +
        x_reactive = x_reactive,
    88 - 120x + 120x +
        slice = slice,
    89 - 120x + 120x +
        extract_type = extract_type
    @@ -48944,14 +50766,16 @@

    teal.slice coverage - 66.10%

    92 - 120x + 120x +
      if (length(unique(x[!is.na(x)])) < getOption("teal.threshold_slider_vs_checkboxgroup")) {
    93 - 28x + 28x +
        do.call(ChoicesFilterState$new, args)
    @@ -48965,7 +50789,8 @@

    teal.slice coverage - 66.10%

    95 - 92x + 92x +
        do.call(RangeFilterState$new, args)
    @@ -49035,35 +50860,40 @@

    teal.slice coverage - 66.10%

    105 - 31x + 31x +
      ChoicesFilterState$new(
    106 - 31x + 31x +
        x = x,
    107 - 31x + 31x +
        x_reactive = x_reactive,
    108 - 31x + 31x +
        slice = slice,
    109 - 31x + 31x +
        extract_type = extract_type
    @@ -49133,35 +50963,40 @@

    teal.slice coverage - 66.10%

    119 - 32x + 32x +
      ChoicesFilterState$new(
    120 - 32x + 32x +
        x = x,
    121 - 32x + 32x +
        x_reactive = x_reactive,
    122 - 32x + 32x +
        slice = slice,
    123 - 32x + 32x +
        extract_type = extract_type
    @@ -49231,35 +51066,40 @@

    teal.slice coverage - 66.10%

    133 - 2x + 2x +
      args <- list(
    134 - 2x + 2x +
        x = x,
    135 - 2x + 2x +
        x_reactive = x_reactive,
    136 - 2x + 2x +
        slice = slice,
    137 - 2x + 2x +
        extract_type = extract_type
    @@ -49280,14 +51120,16 @@

    teal.slice coverage - 66.10%

    140 - 2x + 2x +
      if (length(unique(x[!is.na(x)])) < getOption("teal.threshold_slider_vs_checkboxgroup")) {
    141 - 1x + 1x +
        do.call(ChoicesFilterState$new, args)
    @@ -49301,7 +51143,8 @@

    teal.slice coverage - 66.10%

    143 - 1x + 1x +
        do.call(DateFilterState$new, args)
    @@ -49371,35 +51214,40 @@

    teal.slice coverage - 66.10%

    153 - 2x + 2x +
      args <- list(
    154 - 2x + 2x +
        x = x,
    155 - 2x + 2x +
        x_reactive = x_reactive,
    156 - 2x + 2x +
        slice = slice,
    157 - 2x + 2x +
        extract_type = extract_type
    @@ -49420,14 +51268,16 @@

    teal.slice coverage - 66.10%

    160 - 2x + 2x +
      if (length(unique(x[!is.na(x)])) < getOption("teal.threshold_slider_vs_checkboxgroup")) {
    161 - 1x + 1x +
        do.call(ChoicesFilterState$new, args)
    @@ -49441,7 +51291,8 @@

    teal.slice coverage - 66.10%

    163 - 1x + 1x +
        do.call(DatetimeFilterState$new, args)
    @@ -49511,35 +51362,40 @@

    teal.slice coverage - 66.10%

    173 - 2x + 2x +
      args <- list(
    174 - 2x + 2x +
        x = x,
    175 - 2x + 2x +
        x_reactive = x_reactive,
    176 - 2x + 2x +
        slice = slice,
    177 - 2x + 2x +
        extract_type = extract_type
    @@ -49560,14 +51416,16 @@

    teal.slice coverage - 66.10%

    180 - 2x + 2x +
      if (length(unique(x[!is.na(x)])) < getOption("teal.threshold_slider_vs_checkboxgroup")) {
    181 - 1x + 1x +
        do.call(ChoicesFilterState$new, args)
    @@ -49581,7 +51439,8 @@

    teal.slice coverage - 66.10%

    183 - 1x + 1x +
        do.call(DatetimeFilterState$new, args)
    @@ -49672,7 +51531,8 @@

    teal.slice coverage - 66.10%

    196 - 6x + 6x +
      FilterStateExpr$new(slice)
    @@ -49798,28 +51658,32 @@

    teal.slice coverage - 66.10%

    214 - 119x + 119x +
      checkmate::assert_string(color)
    215 - 119x + 119x +
      checkmate::assert(
    216 - 119x + 119x +
        checkmate::check_number(alpha, lower = 0, upper = 1, null.ok = TRUE),
    217 - 119x + 119x +
        checkmate::check_string(alpha, pattern = "[0-9a-f]{2}", null.ok = TRUE)
    @@ -49847,7 +51711,8 @@

    teal.slice coverage - 66.10%

    221 - 119x + 119x +
      sass_file <- if (utils::packageVersion("bslib") < as.package_version("0.5.1.9000")) {
    @@ -49868,7 +51733,8 @@

    teal.slice coverage - 66.10%

    224 - 119x + 119x +
        bslib::bs_theme()[["layers"]][[2]][["defaults"]][[1]][[1]]
    @@ -49882,7 +51748,8 @@

    teal.slice coverage - 66.10%

    226 - 119x + 119x +
      sass_file <- attr(sass_file, "sass_file_path")
    @@ -49903,7 +51770,8 @@

    teal.slice coverage - 66.10%

    229 - 119x + 119x +
      variables_file <- readLines(sass_file)
    @@ -49917,14 +51785,16 @@

    teal.slice coverage - 66.10%

    231 - 119x + 119x +
      ind <- grep("// scss-docs-(start|end) theme-color-variables", variables_file)
    232 - 119x + 119x +
      color_definitions <- variables_file[(ind[1] + 1L):(ind[2] - 1L)]
    @@ -49945,7 +51815,8 @@

    teal.slice coverage - 66.10%

    235 - 119x + 119x +
      color_names <- sub("(\\$)(\\w.+)(:.+)", "\\2", color_definitions)
    @@ -49966,7 +51837,8 @@

    teal.slice coverage - 66.10%

    238 - 119x + 119x +
      checkmate::assert_choice(color, color_names)
    @@ -49987,7 +51859,8 @@

    teal.slice coverage - 66.10%

    241 - 119x + 119x +
      color_references <- sub("(\\$)(\\w.+)(:\\s.+\\$)(\\w.+)(\\s.+)", "\\4", color_definitions)
    @@ -50008,42 +51881,48 @@

    teal.slice coverage - 66.10%

    244 - 119x + 119x +
      color_specification <- structure(color_references, names = color_names)
    245 - 119x + 119x +
      color_specification <- vapply(color_specification, function(x) {
    246 - 952x + 952x +
        line <- grep(sprintf("^\\$%s:\\s+#\\w{6}\\s+!default", x), variables_file, value = TRUE)
    247 - 952x + 952x +
        code <- sub("(.+)(#\\w{6})(\\s+.+)", "\\2", line)
    248 - 952x + 952x +
        code
    249 - 119x + 119x +
      }, character(1L))
    @@ -50057,7 +51936,8 @@

    teal.slice coverage - 66.10%

    251 - 119x + 119x +
      if (!is.null(alpha)) {
    @@ -50085,7 +51965,8 @@

    teal.slice coverage - 66.10%

    255 - 119x + 119x +
      paste0(color_specification[color], alpha)
    @@ -50987,21 +52868,24 @@

    teal.slice coverage - 66.10%

    127 - 579x + 579x +
      checkmate::assert_string(dataname)
    128 - 572x + 572x +
      checkmate::assert_flag(fixed)
    129 - 570x + 570x +
      checkmate::assert_flag(anchored)
    @@ -51015,7 +52899,8 @@

    teal.slice coverage - 66.10%

    131 - 568x + 568x +
      formal_args <- as.list(environment())
    @@ -51029,7 +52914,8 @@

    teal.slice coverage - 66.10%

    133 - 568x + 568x +
      if (!missing(expr) && !missing(varname)) {
    @@ -51043,28 +52929,32 @@

    teal.slice coverage - 66.10%

    135 - 568x + 568x +
      } else if (!missing(expr)) {
    136 - 30x + 30x +
        checkmate::assert_string(id)
    137 - 27x + 27x +
        checkmate::assert_string(title)
    138 - 24x + 24x +
        checkmate::assert_string(expr)
    @@ -51078,84 +52968,96 @@

    teal.slice coverage - 66.10%

    140 - 23x + 23x +
        formal_args$fixed <- TRUE
    141 - 23x + 23x +
        ts_expr_args <- c("dataname", "id", "expr", "fixed", "anchored", "title")
    142 - 23x + 23x +
        formal_args <- formal_args[ts_expr_args]
    143 - 23x + 23x +
        ans <- do.call(reactiveValues, c(formal_args, list(...)))
    144 - 23x + 23x +
        class(ans) <- c("teal_slice_expr", "teal_slice", class(ans))
    145 - 538x + 538x +
      } else if (!missing(varname)) {
    146 - 537x + 537x +
        checkmate::assert_string(varname)
    147 - 534x + 534x +
        checkmate::assert_multi_class(choices, .filterable_class, null.ok = TRUE)
    148 - 533x + 533x +
        checkmate::assert_multi_class(selected, .filterable_class, null.ok = TRUE)
    149 - 531x + 531x +
        checkmate::assert_flag(keep_na, null.ok = TRUE)
    150 - 530x + 530x +
        checkmate::assert_flag(keep_inf, null.ok = TRUE)
    151 - 529x + 529x +
        checkmate::assert_flag(multiple)
    @@ -51169,21 +53071,24 @@

    teal.slice coverage - 66.10%

    153 - 529x + 529x +
        ts_var_args <- c(
    154 - 529x + 529x +
          "dataname", "varname", "id", "choices", "selected", "keep_na", "keep_inf",
    155 - 529x + 529x +
          "fixed", "anchored", "multiple"
    @@ -51197,42 +53102,48 @@

    teal.slice coverage - 66.10%

    157 - 529x + 529x +
        formal_args <- formal_args[ts_var_args]
    158 - 529x + 529x +
        args <- c(formal_args, list(...))
    159 - 529x + 529x +
        args[c("choices", "selected")] <-
    160 - 529x + 529x +
          lapply(args[c("choices", "selected")], function(x) if (is.factor(x)) as.character(x) else x)
    161 - 529x + 529x +
        if (missing(id)) {
    162 - 520x + 520x +
          args$id <- get_default_slice_id(args)
    @@ -51246,7 +53157,8 @@

    teal.slice coverage - 66.10%

    164 - 9x + 9x +
          checkmate::assert_string(id)
    @@ -51260,14 +53172,16 @@

    teal.slice coverage - 66.10%

    166 - 526x + 526x +
        ans <- do.call(reactiveValues, args)
    167 - 526x + 526x +
        class(ans) <- c("teal_slice_var", "teal_slice", class(ans))
    @@ -51281,7 +53195,8 @@

    teal.slice coverage - 66.10%

    169 - 1x + 1x +
        stop("Must provide either `expr` or `varname`.")
    @@ -51302,7 +53217,8 @@

    teal.slice coverage - 66.10%

    172 - 549x + 549x +
      ans
    @@ -51358,7 +53274,8 @@

    teal.slice coverage - 66.10%

    180 - 4x + 4x +
      inherits(x, "teal_slice")
    @@ -51477,7 +53394,8 @@

    teal.slice coverage - 66.10%

    197 - 283x + 283x +
      formal_args <- setdiff(names(formals(teal_slice)), "...")
    @@ -51491,7 +53409,8 @@

    teal.slice coverage - 66.10%

    199 - 283x + 283x +
      x <- if (isRunning()) {
    @@ -51512,7 +53431,8 @@

    teal.slice coverage - 66.10%

    202 - 283x + 283x +
        isolate(reactiveValuesToList(x))
    @@ -51533,14 +53453,16 @@

    teal.slice coverage - 66.10%

    205 - 283x + 283x +
      formal_args <- intersect(formal_args, names(x))
    206 - 283x + 283x +
      extra_args <- rev(setdiff(names(x), formal_args))
    @@ -51554,7 +53476,8 @@

    teal.slice coverage - 66.10%

    208 - 283x + 283x +
      x[c(formal_args, extra_args)]
    @@ -51617,14 +53540,16 @@

    teal.slice coverage - 66.10%

    217 - 116x + 116x +
      checkmate::assert_flag(show_all)
    218 - 92x + 92x +
      checkmate::assert_flag(trim_lines)
    @@ -51638,14 +53563,16 @@

    teal.slice coverage - 66.10%

    220 - 86x + 86x +
      x_list <- as.list(x)
    221 - 47x + 47x +
      if (!show_all) x_list <- Filter(Negate(is.null), x_list)
    @@ -51659,7 +53586,8 @@

    teal.slice coverage - 66.10%

    223 - 86x + 86x +
      jsonify(x_list, trim_lines)
    @@ -51715,7 +53643,8 @@

    teal.slice coverage - 66.10%

    231 - 15x + 15x +
      cat(format(x, ...))
    @@ -51841,7 +53770,8 @@

    teal.slice coverage - 66.10%

    249 - 131x + 131x +
      checkmate::assert_list(x)
    @@ -51855,28 +53785,32 @@

    teal.slice coverage - 66.10%

    251 - 131x + 131x +
      x_json <- to_json(x)
    252 - 131x + 131x +
      x_json_justified <- justify_json(x_json)
    253 - 121x + 121x +
      if (trim_lines) x_json_justified <- trim_lines_json(x_json_justified)
    254 - 131x + 131x +
      paste(x_json_justified, collapse = "\n")
    @@ -51981,35 +53915,40 @@

    teal.slice coverage - 66.10%

    269 - 131x + 131x +
      no_unbox <- function(x) {
    270 - 2390x + 2390x +
        vars <- c("selected", "choices")
    271 - 2390x + 2390x +
        if (is.list(x)) {
    272 - 385x + 385x +
          for (var in vars) {
    273 - 307x + 307x +
            if (!is.null(x[[var]])) x[[var]] <- I(format_time(x[[var]]))
    @@ -52023,7 +53962,8 @@

    teal.slice coverage - 66.10%

    275 - 385x + 385x +
          lapply(x, no_unbox)
    @@ -52037,7 +53977,8 @@

    teal.slice coverage - 66.10%

    277 - 2005x + 2005x +
          x
    @@ -52065,7 +54006,8 @@

    teal.slice coverage - 66.10%

    281 - 131x + 131x +
      jsonlite::toJSON(no_unbox(x), pretty = TRUE, auto_unbox = TRUE, digits = 16, null = "null")
    @@ -52177,14 +54119,16 @@

    teal.slice coverage - 66.10%

    297 - 307x + 307x +
      if ("POSIXt" %in% class(x)) {
    298 - 20x + 20x +
        format(x, format = "%Y-%m-%d %H:%M:%S", usetz = TRUE, tz = "UTC")
    @@ -52198,7 +54142,8 @@

    teal.slice coverage - 66.10%

    300 - 287x + 287x +
        x
    @@ -52303,35 +54248,40 @@

    teal.slice coverage - 66.10%

    315 - 131x + 131x +
      format_name <- function(name, name_width) {
    316 - 2775x + 2775x +
        if (nchar(name) == 1 || nchar(gsub("\\s", "", name)) <= 2) {
    317 - 630x + 630x +
          return(name)
    318 - 2145x + 2145x +
        } else if (grepl("slices|attributes", name)) {
    319 - 90x + 90x +
          paste0(name, ":")
    @@ -52345,7 +54295,8 @@

    teal.slice coverage - 66.10%

    321 - 2055x + 2055x +
          paste(format(name, width = name_width), ":")
    @@ -52366,28 +54317,32 @@

    teal.slice coverage - 66.10%

    324 - 131x + 131x +
      json_lines <- strsplit(json, "\n")[[1]]
    325 - 131x + 131x +
      json_lines_split <- regmatches(json_lines, regexpr(":", json_lines), invert = TRUE)
    326 - 131x + 131x +
      name_width <- max(unlist(regexpr(":", json_lines))) - 1
    327 - 131x + 131x +
      vapply(json_lines_split, function(x) paste0(format_name(x[1], name_width), stats::na.omit(x[2])), character(1))
    @@ -52492,35 +54447,40 @@

    teal.slice coverage - 66.10%

    342 - 121x + 121x +
      name_width <- max(unlist(gregexpr(":", x))) - 1
    343 - 121x + 121x +
      trim_position <- name_width + 37L
    344 - 121x + 121x +
      x_trim <- substr(x, 1, trim_position)
    345 - 121x + 121x +
      substr(x_trim, trim_position - 2, trim_position) <- "..."
    346 - 121x + 121x +
      x_trim
    @@ -52688,28 +54648,32 @@

    teal.slice coverage - 66.10%

    370 - 609x + 609x +
      checkmate::assert_multi_class(x, c("teal_slice", "list"))
    371 - 609x + 609x +
      isolate({
    372 - 609x + 609x +
        if (inherits(x, "teal_slice_expr") || is.null(x$varname)) {
    373 - 10x + 10x +
          x$id
    @@ -52723,28 +54687,32 @@

    teal.slice coverage - 66.10%

    375 - 599x + 599x +
          paste(
    376 - 599x + 599x +
            Filter(
    377 - 599x + 599x +
              length,
    378 - 599x + 599x +
              as.list(x)[c("dataname", "varname", "experiment", "arg")]
    @@ -52758,7 +54726,8 @@

    teal.slice coverage - 66.10%

    380 - 599x + 599x +
            collapse = " "
    @@ -52918,21 +54887,24 @@

    teal.slice coverage - 66.10%

    18 - 7x + 7x +
      checkmate::assert_list(x, any.missing = FALSE, names = "unique")
    19 - 6x + 6x +
      checkmate::assert_class(join_keys, "join_keys")
    20 - 5x + 5x +
      if (!missing(code)) {
    @@ -52974,7 +54946,8 @@

    teal.slice coverage - 66.10%

    26 - 5x + 5x +
      if (!missing(check)) {
    @@ -53016,7 +54989,8 @@

    teal.slice coverage - 66.10%

    32 - 5x + 5x +
      FilteredData$new(x, join_keys = join_keys)
    @@ -53114,42 +55088,48 @@

    teal.slice coverage - 66.10%

    46 - 32x + 32x +
      lapply(
    47 - 32x + 32x +
        expr,
    48 - 32x + 32x +
        function(x) {
    49 - 19x + 19x +
          tryCatch(
    50 - 19x + 19x +
            eval(x, envir = env),
    51 - 19x + 19x +
            error = function(e) {
    @@ -53226,7 +55206,8 @@

    teal.slice coverage - 66.10%

    62 - 32x + 32x +
      invisible(NULL)
    @@ -53422,21 +55403,24 @@

    teal.slice coverage - 66.10%

    90 - 3x + 3x +
      checkmate::assert_string(input_id)
    91 - 3x + 3x +
      checkmate::assert_character(icons, len = 2L)
    92 - 3x + 3x +
      checkmate::assert_flag(one_way)
    @@ -53450,35 +55434,40 @@

    teal.slice coverage - 66.10%

    94 - 3x + 3x +
      expr <-
    95 - 3x + 3x +
        if (one_way) {
    96 - 3x + 3x +
          sprintf(
    97 - 3x + 3x +
            "$('#%s i').removeClass('%s').addClass('%s');",
    98 - 3x + 3x +
            input_id, icons[1], icons[2]
    @@ -53520,7 +55509,8 @@

    teal.slice coverage - 66.10%

    104 - 3x + 3x +
      shinyjs::runjs(expr)
    @@ -53534,7 +55524,8 @@

    teal.slice coverage - 66.10%

    106 - 3x + 3x +
      invisible(NULL)
    @@ -53576,21 +55567,24 @@

    teal.slice coverage - 66.10%

    112 - 3x + 3x +
      checkmate::assert_string(input_id)
    113 - 3x + 3x +
      checkmate::assert_character(titles, len = 2L)
    114 - 3x + 3x +
      checkmate::assert_flag(one_way)
    @@ -53604,35 +55598,40 @@

    teal.slice coverage - 66.10%

    116 - 3x + 3x +
      expr <-
    117 - 3x + 3x +
        if (one_way) {
    118 - 3x + 3x +
          sprintf(
    119 - 3x + 3x +
            "$('a#%s').attr('title', '%s');",
    120 - 3x + 3x +
            input_id, titles[2]
    @@ -53737,7 +55736,8 @@

    teal.slice coverage - 66.10%

    135 - 3x + 3x +
      shinyjs::runjs(expr)
    @@ -53751,7 +55751,8 @@

    teal.slice coverage - 66.10%

    137 - 3x + 3x +
      invisible(NULL)
    @@ -53800,7 +55801,8 @@

    teal.slice coverage - 66.10%

    144 - 66x + 66x +
      utils::getFromNamespace("topological_sort", ns = "teal.data")(graph)
    @@ -54205,14 +56207,16 @@

    teal.slice coverage - 66.10%

    56 - 8x + 8x +
          checkmate::assert_class(datasets, "FilteredData")
    57 - 6x + 6x +
          private$filtered_data <- datasets
    @@ -54296,7 +56300,8 @@

    teal.slice coverage - 66.10%

    69 - 8x + 8x +
          private$filtered_data$get_filter_state()
    @@ -54366,14 +56371,16 @@

    teal.slice coverage - 66.10%

    79 - 5x + 5x +
          private$filtered_data$set_filter_state(filter)
    80 - 5x + 5x +
          invisible(NULL)
    @@ -54464,14 +56471,16 @@

    teal.slice coverage - 66.10%

    93 - 1x + 1x +
          private$filtered_data$remove_filter_state(filter)
    94 - 1x + 1x +
          invisible(NULL)
    @@ -54562,21 +56571,24 @@

    teal.slice coverage - 66.10%

    107 - 2x + 2x +
          datanames_to_remove <- if (missing(datanames)) private$filtered_data$datanames() else datanames
    108 - 2x + 2x +
          private$filtered_data$clear_filter_states(datanames = datanames_to_remove)
    109 - 2x + 2x +
          invisible(NULL)
    @@ -55275,7 +57287,8 @@

    teal.slice coverage - 66.10%

    92 - 107x + 107x +
      UseMethod("init_filtered_dataset")
    @@ -55359,56 +57372,64 @@

    teal.slice coverage - 66.10%

    104 - 83x + 83x +
      DataframeFilteredDataset$new(
    105 - 83x + 83x +
        dataset = dataset,
    106 - 83x + 83x +
        dataname = dataname,
    107 - 83x + 83x +
        keys = keys,
    108 - 83x + 83x +
        parent_name = parent_name,
    109 - 83x + 83x +
        parent = parent,
    110 - 83x + 83x +
        join_keys = join_keys,
    111 - 83x + 83x +
        label = label
    @@ -55499,7 +57520,8 @@

    teal.slice coverage - 66.10%

    124 - 7x + 7x +
      if (!requireNamespace("MultiAssayExperiment", quietly = TRUE)) {
    @@ -55520,35 +57542,40 @@

    teal.slice coverage - 66.10%

    127 - 7x + 7x +
      MAEFilteredDataset$new(
    128 - 7x + 7x +
        dataset = dataset,
    129 - 7x + 7x +
        dataname = dataname,
    130 - 7x + 7x +
        keys = keys,
    131 - 7x + 7x +
        label = label
    @@ -55639,28 +57666,32 @@

    teal.slice coverage - 66.10%

    144 - 17x + 17x +
      DefaultFilteredDataset$new(
    145 - 17x + 17x +
        dataset = dataset,
    146 - 17x + 17x +
        dataname = dataname,
    147 - 17x + 17x +
        label = label
    @@ -55995,35 +58026,40 @@

    teal.slice coverage - 66.10%

    45 - 103x + 103x +
          checkmate::assert_function(data_reactive, args = "sid")
    46 - 103x + 103x +
          checkmate::assert_data_frame(data)
    47 - 103x + 103x +
          super$initialize(data, data_reactive, dataname, datalabel)
    48 - 103x + 103x +
          private$keys <- keys
    49 - 103x + 103x +
          private$set_filterable_varnames(include_varnames = colnames(private$data))
    @@ -56169,21 +58205,24 @@

    teal.slice coverage - 66.10%

    12 - 9x + 9x +
      checkmate::assert_multi_class(data, c("data.frame", "DataFrame", "matrix"))
    13 - 9x + 9x +
      checkmate::assert_character(columns, any.missing = FALSE, null.ok = TRUE)
    14 - 9x + 9x +
      checkmate::assert_subset(columns, colnames(data))
    @@ -56197,7 +58236,8 @@

    teal.slice coverage - 66.10%

    16 - 9x + 9x +
      if (is.matrix(data)) {
    @@ -56267,14 +58307,16 @@

    teal.slice coverage - 66.10%

    26 - 9x + 9x +
        types <- vapply(data, function(x) class(x)[1L], character(1L))
    27 - 9x + 9x +
        if (!is.null(columns)) types <- types[columns]
    @@ -56295,7 +58337,8 @@

    teal.slice coverage - 66.10%

    30 - 9x + 9x +
      types
    @@ -56413,49 +58456,56 @@

    teal.slice coverage - 66.10%

    15 - 273x + 273x +
      checkmate::assert_character(name, min.len = 1, any.missing = FALSE)
    16 - 271x + 271x +
      if (!grepl("^[[:alpha:]][a-zA-Z0-9_]*$", name, perl = TRUE)) {
    17 - 5x + 5x +
        stop(
    18 - 5x + 5x +
          "name '",
    19 - 5x + 5x +
          name,
    20 - 5x + 5x +
          "' must only contain alphanumeric characters (with underscores)",
    21 - 5x + 5x +
          " and the first character must be an alphabetic character"
    @@ -56567,35 +58617,40 @@

    teal.slice coverage - 66.10%

    37 - 12x + 12x +
      checkmate::assert_character(pattern, min.len = 1, null.ok = TRUE)
    38 - 12x + 12x +
      js_files <- list.files(
    39 - 12x + 12x +
        system.file("js", package = "teal.slice", mustWork = TRUE),
    40 - 12x + 12x +
        pattern = pattern,
    41 - 12x + 12x +
        full.names = TRUE
    @@ -56609,7 +58664,8 @@

    teal.slice coverage - 66.10%

    43 - 12x + 12x +
      singleton(lapply(js_files, includeScript))
    @@ -56707,14 +58763,16 @@

    teal.slice coverage - 66.10%

    57 - 53x + 53x +
      if (length(choices) > 1) {
    58 - 26x + 26x +
        do.call("call", append(list("c"), choices))
    @@ -56728,7 +58786,8 @@

    teal.slice coverage - 66.10%

    60 - 27x + 27x +
        choices
    @@ -57021,7 +59080,8 @@

    teal.slice coverage - 66.10%

    39 - 26x + 26x +
          if (!requireNamespace("MultiAssayExperiment", quietly = TRUE)) {
    @@ -57042,14 +59102,16 @@

    teal.slice coverage - 66.10%

    42 - 26x + 26x +
          checkmate::assert_function(data_reactive, args = "sid")
    43 - 26x + 26x +
          checkmate::assert_class(data, "MultiAssayExperiment")
    @@ -57063,35 +59125,40 @@

    teal.slice coverage - 66.10%

    45 - 25x + 25x +
          data <- SummarizedExperiment::colData(data)
    46 - 25x + 25x +
          data_reactive <- function(sid = "") SummarizedExperiment::colData(data_reactive(sid = sid))
    47 - 25x + 25x +
          super$initialize(data, data_reactive, dataname, datalabel)
    48 - 25x + 25x +
          private$keys <- keys
    49 - 25x + 25x +
          private$set_filterable_varnames(include_varnames = colnames(data))
    @@ -57105,7 +59172,8 @@

    teal.slice coverage - 66.10%

    51 - 25x + 25x +
          invisible(self)
    @@ -57853,49 +59921,56 @@

    teal.slice coverage - 66.10%

    96 - 764x + 764x +
      slices <- list(...)
    97 - 764x + 764x +
      checkmate::assert_list(slices, types = "teal_slice", any.missing = FALSE)
    98 - 763x + 763x +
      slices_id <- isolate(vapply(slices, `[[`, character(1L), "id"))
    99 - 763x + 763x +
      if (any(duplicated(slices_id))) {
    100 - 1x + 1x +
        stop(
    101 - 1x + 1x +
          "Some teal_slice objects have the same id:\n",
    102 - 1x + 1x +
          toString(unique(slices_id[duplicated(slices_id)]))
    @@ -57916,35 +59991,40 @@

    teal.slice coverage - 66.10%

    105 - 762x + 762x +
      checkmate::assert_list(exclude_varnames, names = "named", types = "character", null.ok = TRUE, min.len = 1)
    106 - 761x + 761x +
      checkmate::assert_list(include_varnames, names = "named", types = "character", null.ok = TRUE, min.len = 1)
    107 - 760x + 760x +
      checkmate::assert_character(count_type, len = 1, null.ok = TRUE)
    108 - 758x + 758x +
      checkmate::assert_subset(count_type, choices = c("all", "none"), empty.ok = TRUE)
    109 - 757x + 757x +
      checkmate::assert_logical(allow_add)
    @@ -57958,35 +60038,40 @@

    teal.slice coverage - 66.10%

    111 - 756x + 756x +
      duplicated_datasets <- intersect(names(include_varnames), names(exclude_varnames))
    112 - 756x + 756x +
      if (length(duplicated_datasets)) {
    113 - 1x + 1x +
        stop(
    114 - 1x + 1x +
          "Some datasets are specified in both, include_varnames and exclude_varnames:\n",
    115 - 1x + 1x +
          toString(duplicated_datasets)
    @@ -58014,49 +60099,56 @@

    teal.slice coverage - 66.10%

    119 - 755x + 755x +
      structure(
    120 - 755x + 755x +
        slices,
    121 - 755x + 755x +
        exclude_varnames = exclude_varnames,
    122 - 755x + 755x +
        include_varnames = include_varnames,
    123 - 755x + 755x +
        count_type = count_type,
    124 - 755x + 755x +
        allow_add = allow_add,
    125 - 755x + 755x +
        class = c("teal_slices", class(slices))
    @@ -58126,7 +60218,8 @@

    teal.slice coverage - 66.10%

    135 - 465x + 465x +
      inherits(x, "teal_slices")
    @@ -58287,21 +60380,24 @@

    teal.slice coverage - 66.10%

    158 - 1077x + 1077x +
      ans <- unclass(x)
    159 - 45x + 45x +
      if (recursive) ans[] <- lapply(ans, as.list)
    160 - 1077x + 1077x +
      ans
    @@ -58364,21 +60460,24 @@

    teal.slice coverage - 66.10%

    169 - 3x + 3x +
      if (missing(i)) i <- seq_along(x)
    170 - 506x + 506x +
      if (length(i) == 0L) {
    171 - 178x + 178x +
        return(x[0])
    @@ -58392,35 +60491,40 @@

    teal.slice coverage - 66.10%

    173 - 1x + 1x +
      if (is.logical(i) && length(i) > length(x)) stop("subscript out of bounds")
    174 - 1x + 1x +
      if (is.numeric(i) && max(i) > length(x)) stop("subscript out of bounds")
    175 - 326x + 326x +
      if (is.character(i)) {
    176 - 1x + 1x +
        if (!all(is.element(i, names(x)))) stop("subscript out of bounds")
    177 - 2x + 2x +
        i <- which(is.element(i, names(x)))
    @@ -58441,35 +60545,40 @@

    teal.slice coverage - 66.10%

    180 - 325x + 325x +
      y <- NextMethod("[")
    181 - 325x + 325x +
      attrs <- attributes(x)
    182 - 325x + 325x +
      attrs$names <- attrs$names[i]
    183 - 325x + 325x +
      attributes(y) <- attrs
    184 - 325x + 325x +
      y
    @@ -58532,14 +60641,16 @@

    teal.slice coverage - 66.10%

    193 - 252x + 252x +
      x <- list(...)
    194 - 252x + 252x +
      checkmate::assert_true(all(vapply(x, is.teal_slices, logical(1L))), .var.name = "all arguments are teal_slices")
    @@ -58553,21 +60664,24 @@

    teal.slice coverage - 66.10%

    196 - 251x + 251x +
      all_attributes <- lapply(x, attributes)
    197 - 251x + 251x +
      all_attributes <- coalesce_r(all_attributes)
    198 - 251x + 251x +
      all_attributes <- all_attributes[names(all_attributes) != "class"]
    @@ -58581,35 +60695,40 @@

    teal.slice coverage - 66.10%

    200 - 251x + 251x +
      do.call(
    201 - 251x + 251x +
        teal_slices,
    202 - 251x + 251x +
        c(
    203 - 251x + 251x +
          unique(unlist(x, recursive = FALSE)),
    204 - 251x + 251x +
          all_attributes
    @@ -58700,14 +60819,16 @@

    teal.slice coverage - 66.10%

    217 - 45x + 45x +
      checkmate::assert_flag(show_all)
    218 - 45x + 45x +
      checkmate::assert_flag(trim_lines)
    @@ -58721,35 +60842,40 @@

    teal.slice coverage - 66.10%

    220 - 45x + 45x +
      x <- as.list(x, recursive = TRUE)
    221 - 45x + 45x +
      attrs <- attributes(x)
    222 - 45x + 45x +
      attributes(x) <- NULL
    223 - 45x + 45x +
      slices_list <- list(slices = x, attributes = attrs)
    224 - 45x + 45x +
      slices_list <- Filter(Negate(is.null), slices_list) # drop attributes if empty
    @@ -58763,7 +60889,8 @@

    teal.slice coverage - 66.10%

    226 - 20x + 20x +
      if (!show_all) slices_list$slices <- lapply(slices_list$slices, function(slice) Filter(Negate(is.null), slice))
    @@ -58777,7 +60904,8 @@

    teal.slice coverage - 66.10%

    228 - 45x + 45x +
      jsonify(slices_list, trim_lines)
    @@ -58833,7 +60961,8 @@

    teal.slice coverage - 66.10%

    236 - 2x + 2x +
      cat(format(x, ...), "\n")
    @@ -58917,21 +61046,24 @@

    teal.slice coverage - 66.10%

    248 - 14x + 14x +
      Filter(
    249 - 14x + 14x +
        function(xx) {
    250 - 12x + 12x +
          !any(vapply(y, function(yy) identical(yy, xx), logical(1)))
    @@ -58945,7 +61077,8 @@

    teal.slice coverage - 66.10%

    252 - 14x + 14x +
        x
    @@ -59092,28 +61225,32 @@

    teal.slice coverage - 66.10%

    273 - 1569x + 1569x +
      checkmate::assert_list(x)
    274 - 1568x + 1568x +
      xnn <- Filter(Negate(is.null), x)
    275 - 1568x + 1568x +
      if (all(vapply(xnn, is.atomic, logical(1L)))) {
    276 - 1059x + 1059x +
        return(xnn[[1L]])
    @@ -59127,21 +61264,24 @@

    teal.slice coverage - 66.10%

    278 - 509x + 509x +
      lapply(x, checkmate::assert_list, names = "named", null.ok = TRUE, .var.name = "list element")
    279 - 508x + 508x +
      all_names <- unique(unlist(lapply(x, names)))
    280 - 508x + 508x +
      sapply(all_names, function(nm) coalesce_r(lapply(x, `[[`, nm)), simplify = FALSE)
    @@ -59336,42 +61476,48 @@

    teal.slice coverage - 66.10%

    26 - 25x + 25x +
      checkmate::assert_string(inputId)
    27 - 21x + 21x +
      checkmate::assert_vector(choices)
    28 - 20x + 20x +
      checkmate::assert_numeric(countsmax, len = length(choices))
    29 - 17x + 17x +
      checkmate::assert_numeric(countsnow, len = length(choices), null.ok = TRUE)
    30 - 15x + 15x +
      if (!is.null(countsnow)) {
    31 - 7x + 7x +
        checkmate::assert_true(all(countsnow <= countsmax))
    @@ -59392,7 +61538,8 @@

    teal.slice coverage - 66.10%

    34 - 14x + 14x +
      ns <- NS(inputId)
    @@ -59406,56 +61553,64 @@

    teal.slice coverage - 66.10%

    36 - 14x + 14x +
      mapply(
    37 - 14x + 14x +
        countBar,
    38 - 14x + 14x +
        inputId = ns(seq_along(choices)),
    39 - 14x + 14x +
        label = as.character(choices),
    40 - 14x + 14x +
        countmax = countsmax,
    41 - 14x + 14x +
        countnow = if (is.null(countsnow)) rep(list(NULL), length(choices)) else countsnow,
    42 - 14x + 14x +
        MoreArgs = list(
    43 - 14x + 14x +
          counttotal = sum(countsmax)
    @@ -59469,7 +61624,8 @@

    teal.slice coverage - 66.10%

    45 - 14x + 14x +
        SIMPLIFY = FALSE, USE.NAMES = FALSE
    @@ -59644,35 +61800,40 @@

    teal.slice coverage - 66.10%

    70 - 62x + 62x +
      checkmate::assert_string(inputId)
    71 - 58x + 58x +
      checkmate::assert_string(label)
    72 - 55x + 55x +
      checkmate::assert_number(countmax)
    73 - 53x + 53x +
      checkmate::assert_number(countnow, null.ok = TRUE, upper = countmax)
    74 - 51x + 51x +
      checkmate::assert_number(counttotal, lower = countmax)
    @@ -59686,35 +61847,40 @@

    teal.slice coverage - 66.10%

    76 - 49x + 49x +
      label <- make_count_text(label, countmax = countmax, countnow = countnow)
    77 - 49x + 49x +
      ns <- NS(inputId)
    78 - 26x + 26x +
      if (is.null(countnow)) countnow <- 0
    79 - 49x + 49x +
      tags$div(
    80 - 49x + 49x +
        class = "progress state-count-container",
    @@ -59728,42 +61894,48 @@

    teal.slice coverage - 66.10%

    82 - 49x + 49x +
        tags$div(
    83 - 49x + 49x +
          id = ns("count_bar_filtered"),
    84 - 49x + 49x +
          class = "progress-bar state-count-bar-filtered",
    85 - 49x + 49x +
          style = sprintf("width: %s%%", countnow / counttotal * 100),
    86 - 49x + 49x +
          role = "progressbar",
    87 - 49x + 49x +
          label
    @@ -59777,35 +61949,40 @@

    teal.slice coverage - 66.10%

    89 - 49x + 49x +
        tags$div(
    90 - 49x + 49x +
          id = ns("count_bar_unfiltered"),
    91 - 49x + 49x +
          class = "progress-bar state-count-bar-unfiltered",
    92 - 49x + 49x +
          style = sprintf("width: %s%%", (countmax - countnow) / counttotal * 100),
    93 - 49x + 49x +
          role = "progressbar"
    @@ -59854,28 +62031,32 @@

    teal.slice coverage - 66.10%

    100 - 7x + 7x +
      checkmate::assert_string(inputId)
    101 - 7x + 7x +
      checkmate::assert_vector(choices)
    102 - 7x + 7x +
      checkmate::assert_numeric(countsmax, len = length(choices))
    103 - 7x + 7x +
      checkmate::assert_numeric(countsnow, len = length(choices), null.ok = TRUE)
    @@ -59889,63 +62070,72 @@

    teal.slice coverage - 66.10%

    105 - 7x + 7x +
      ns <- NS(inputId)
    106 - 7x + 7x +
      mapply(
    107 - 7x + 7x +
        updateCountBar,
    108 - 7x + 7x +
        inputId = ns(seq_along(choices)),
    109 - 7x + 7x +
        label = choices,
    110 - 7x + 7x +
        countmax = countsmax,
    111 - 7x + 7x +
        countnow = if (is.null(countsnow)) rep(list(NULL), length(choices)) else countsnow,
    112 - 7x + 7x +
        MoreArgs = list(
    113 - 7x + 7x +
          counttotal = sum(countsmax)
    @@ -59966,7 +62156,8 @@

    teal.slice coverage - 66.10%

    116 - 7x + 7x +
      invisible(NULL)
    @@ -60001,35 +62192,40 @@

    teal.slice coverage - 66.10%

    121 - 18x + 18x +
      checkmate::assert_string(inputId)
    122 - 18x + 18x +
      checkmate::assert_string(label)
    123 - 18x + 18x +
      checkmate::assert_number(countmax)
    124 - 18x + 18x +
      checkmate::assert_number(countnow, null.ok = TRUE)
    125 - 18x + 18x +
      checkmate::assert_number(counttotal)
    @@ -60043,70 +62239,80 @@

    teal.slice coverage - 66.10%

    127 - 18x + 18x +
      label <- make_count_text(label, countmax = countmax, countnow = countnow)
    128 - 18x + 18x +
      if (is.null(countnow)) countnow <- countmax
    129 - 18x + 18x +
      session$sendCustomMessage(
    130 - 18x + 18x +
        type = "updateCountBar",
    131 - 18x + 18x +
        message = list(
    132 - 18x + 18x +
          id = session$ns(inputId),
    133 - 18x + 18x +
          label = label,
    134 - 18x + 18x +
          countmax = countmax,
    135 - 18x + 18x +
          countnow = countnow,
    136 - 18x + 18x +
          counttotal = counttotal
    @@ -60134,7 +62340,8 @@

    teal.slice coverage - 66.10%

    140 - 18x + 18x +
      invisible(NULL)
    @@ -60169,70 +62376,80 @@

    teal.slice coverage - 66.10%

    145 - 17x + 17x +
      checkmate::assert_string(inputId)
    146 - 17x + 17x +
      checkmate::assert_string(label)
    147 - 17x + 17x +
      checkmate::assert_number(countmax)
    148 - 17x + 17x +
      checkmate::assert_number(countnow, null.ok = TRUE)
    149 - 17x + 17x +
      label <- make_count_text(label, countmax = countmax, countnow = countnow)
    150 - 17x + 17x +
      session$sendCustomMessage(
    151 - 17x + 17x +
        type = "updateCountText",
    152 - 17x + 17x +
        message = list(
    153 - 17x + 17x +
          id = session$ns(inputId),
    154 - 17x + 17x +
          label = label
    @@ -60372,56 +62589,64 @@

    teal.slice coverage - 66.10%

    174 - 96x + 96x +
      checkmate::assert_string(label)
    175 - 94x + 94x +
      checkmate::assert_number(countmax)
    176 - 92x + 92x +
      checkmate::assert_number(countnow, null.ok = TRUE)
    177 - 90x + 90x +
      sprintf(
    178 - 90x + 90x +
        "%s (%s%s)",
    179 - 90x + 90x +
        label,
    180 - 90x + 90x +
        if (is.null(countnow)) "" else sprintf("%s/", countnow),
    181 - 90x + 90x +
        countmax
    @@ -61288,28 +63513,32 @@

    teal.slice coverage - 66.10%

    121 - 3x + 3x +
      checkmate::assert_multi_class(datasets, c("FilteredData", "FilterPanelAPI"))
    122 - 3x + 3x +
      checkmate::assert_class(filter, "teal_slices")
    123 - 3x + 3x +
      datasets$set_filter_state(filter)
    124 - 3x + 3x +
      invisible(NULL)
    @@ -61351,14 +63580,16 @@

    teal.slice coverage - 66.10%

    130 - 4x + 4x +
      checkmate::assert_multi_class(datasets, c("FilteredData", "FilterPanelAPI"))
    131 - 4x + 4x +
      if (isRunning()) {
    @@ -61379,7 +63610,8 @@

    teal.slice coverage - 66.10%

    134 - 4x + 4x +
        isolate(datasets$get_filter_state())
    @@ -61428,14 +63660,16 @@

    teal.slice coverage - 66.10%

    141 - 1x + 1x +
      checkmate::assert_multi_class(datasets, c("FilteredData", "FilterPanelAPI"))
    142 - 1x + 1x +
      checkmate::assert_class(filter, "teal_slices")
    @@ -61449,14 +63683,16 @@

    teal.slice coverage - 66.10%

    144 - 1x + 1x +
      datasets$remove_filter_state(filter)
    145 - 1x + 1x +
      invisible(NULL)
    @@ -61498,21 +63734,24 @@

    teal.slice coverage - 66.10%

    151 - 1x + 1x +
      checkmate::assert_multi_class(datasets, c("FilteredData", "FilterPanelAPI"))
    152 - 1x + 1x +
      datasets$clear_filter_states(force = force)
    153 - 1x + 1x +
      invisible(NULL)
    @@ -61631,28 +63870,32 @@

    teal.slice coverage - 66.10%

    170 - 2x + 2x +
      checkmate::assert_character(datanames, min.len = 1, any.missing = FALSE)
    171 - 2x + 2x +
      stopifnot(
    172 - 2x + 2x +
        is(datasets, "FilteredData"),
    173 - 2x + 2x +
        all(datanames %in% datasets$datanames())
    @@ -61673,35 +63916,40 @@

    teal.slice coverage - 66.10%

    176 - 2x + 2x +
      paste(
    177 - 2x + 2x +
        unlist(lapply(
    178 - 2x + 2x +
          datanames,
    179 - 2x + 2x +
          function(dataname) {
    180 - 4x + 4x +
            datasets$get_call(dataname)
    @@ -61722,7 +63970,8 @@

    teal.slice coverage - 66.10%

    183 - 2x + 2x +
        collapse = "\n"
    @@ -61791,14 +64040,16 @@

    teal.slice coverage - 66.10%

    7 - 9x + 9x +
      isolate(
    8 - 9x + 9x +
        all(vapply(fields, function(x) identical(ts1[[x]], ts2[[x]]), logical(1L)))
    @@ -61861,35 +64112,40 @@

    teal.slice coverage - 66.10%

    17 - 34x + 34x +
      isolate({
    18 - 34x + 34x +
        testthat::expect_true(
    19 - 34x + 34x +
          setequal(
    20 - 34x + 34x +
            reactiveValuesToList(x),
    21 - 34x + 34x +
            reactiveValuesToList(y)
    @@ -61959,28 +64215,32 @@

    teal.slice coverage - 66.10%

    31 - 12x + 12x +
      isolate({
    32 - 12x + 12x +
        mapply(
    33 - 12x + 12x +
          function(x, y) {
    34 - 27x + 27x +
            expect_identical_slice(x, y)
    @@ -61994,14 +64254,16 @@

    teal.slice coverage - 66.10%

    36 - 12x + 12x +
          x = x,
    37 - 12x + 12x +
          y = y
    @@ -62015,7 +64277,8 @@

    teal.slice coverage - 66.10%

    39 - 12x + 12x +
        testthat::expect_identical(attributes(x), attributes(y))
    @@ -62293,21 +64556,24 @@

    teal.slice coverage - 66.10%

    19 - 47x + 47x +
      checkmate::assert_list(calls)
    20 - 45x + 45x +
      if (length(calls) > 0L) checkmate::assert_list(calls, types = c("call", "name"))
    21 - 46x + 46x +
      checkmate::assert_string(operator)
    @@ -62321,21 +64587,24 @@

    teal.slice coverage - 66.10%

    23 - 44x + 44x +
      Reduce(
    24 - 44x + 44x +
        x = calls,
    25 - 44x + 44x +
        f = function(x, y) call(operator, x, y)
    @@ -62600,21 +64869,24 @@

    teal.slice coverage - 66.10%

    35 - 26x + 26x +
          checkmate::assert_matrix(data)
    36 - 25x + 25x +
          super$initialize(data, data_reactive, dataname, datalabel)
    37 - 25x + 25x +
          private$set_filterable_varnames(include_varnames = colnames(private$data))
    diff --git a/v0.5.0-rc2/index.html b/v0.5.0-rc2/index.html index b036e53d1..44b2d66b9 100644 --- a/v0.5.0-rc2/index.html +++ b/v0.5.0-rc2/index.html @@ -1,5 +1,4 @@ - - + @@ -58,22 +57,7 @@ - - + - + + diff --git a/v0.5.0-rc2/news/index.html b/v0.5.0-rc2/news/index.html index cedafcbd0..6a037523f 100644 --- a/v0.5.0-rc2/news/index.html +++ b/v0.5.0-rc2/news/index.html @@ -1,8 +1,22 @@ - -Changelog • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -78,31 +98,44 @@
    -

    teal.slice 0.5.0

    +

    teal.slice 0.5.0 +

    -

    Enhancements

    -
    • Simplified init_filtered_data to accept a named list of datasets. init_filtered_data does not currently handle a list containing dataset, metadata, datalabel and code.
    • -
    +

    Enhancements +

    +
      +
    • Simplified init_filtered_data to accept a named list of datasets. init_filtered_data does not currently handle a list containing dataset, metadata, datalabel and code.
    • +
    +
    -

    Breaking changes

    -
    • +

      Breaking changes +

      +
        +
      • TealData object is no longer supported by teal.slice.
      • set_filter_state no longer accepts a nested list. Use teal_slices() and teal_slice() instead.
      • Renamed FilteredDataset subclass that handles data.frames from DefaultFilteredDataset to DataframeFilteredDataset. Added new class DefaultFilteredDataset that will store any type of object. Filtering will is not supported.
      • -
    + +
    -

    Miscellaneous

    -
    • Specified minimal version of package dependencies.
    • +

      Miscellaneous +

      +
        +
      • Specified minimal version of package dependencies.
      • Removed storing and restoring of teal_slices objects.
      • Update documentation and code to reflect the changes due to the refactor of teal.data::JoinKeys into teal.data::join_keys.
      • -
    + +
    -

    teal.slice 0.4.0

    +

    teal.slice 0.4.0 +

    -

    New features

    -
    + +
    -

    Breaking changes

    -
    • Setting filters using a list is now deprecated. Use teal_slices and teal_slice instead.
    • +

      Breaking changes +

      +
        +
      • Setting filters using a list is now deprecated. Use teal_slices and teal_slice instead.
      • Removed CDISCFilteredData and CDISCFilteredDataset and implementing JoinKeys handling in their parent classes (FilteredData and DefaultFilteredDataset).
      • Specifying set of filterable columns is done through include_varnames and exclude_varnames in teal_slices. Specifying attr(, "filterable") is hard deprecated.
      • Removed private fields $code and $check from FilteredData class and made appropriate changes to constructor and init_filtered_data.
      • -
    + +
    -

    teal.slice 0.3.0

    -
    • Examples now use scda.2022 instead of scda.2021.
    • +

      teal.slice 0.3.0 +

      +
        +
      • Examples now use scda.2022 instead of scda.2021.
      • Transferred data hashing step in FilteredDataset to teal.
      • Removed constructor of Queue class.
      • -
      -

      New features

      -
      • Added a global turn on/off button for the Filter Panel.
      • +
      +
      +

      New features +

      +
        +
      • Added a global turn on/off button for the Filter Panel.
      • Added ability to collapse Active Filter Display panel.
      • Added ability to collapse all filters of an individual dataset.
      • Added fixed filter states.
      • -
      +
    +
    -

    Enhancements

    -
    • Improved filter state presentation in FilterState$format.
    • -
    +

    Enhancements +

    +
      +
    • Improved filter state presentation in FilterState$format.
    • +
    +
    -

    Bug fixes

    -
    • Fixed an error where the RangeFilterState produced an error when using bootstrap 4.
    • +

      Bug fixes +

      +
        +
      • Fixed an error where the RangeFilterState produced an error when using bootstrap 4.
      • Fixed a bug that caused the range slider to omit values selected by the filter API.
      • Fixed a bug where setting incorrect values for Date and Date time ranges caused the app to crash.
      • -
    + +
    -

    Miscellaneous

    -
    • Calculation of step in slider for RangeFilterState now uses checkmate::test_integerish instead of is.integer.
    • +

      Miscellaneous +

      +
        +
      • Calculation of step in slider for RangeFilterState now uses checkmate::test_integerish instead of is.integer.
      • Updated init_filtered_data to take into account the removal of CDISCTealData from teal.data package.
      • Added shinyvalidate validation for Date and Date time ranges.
      • Added examples apps for FilterState child classes and DFFilterStates.
      • -
    + +
    -

    teal.slice 0.2.0

    +

    teal.slice 0.2.0 +

    -

    New features

    -
    + +
    -

    Enhancements

    -
    • Redesigned the count bars for filter panel check box inputs.
    • +

      Enhancements +

      +
        +
      • Redesigned the count bars for filter panel check box inputs.
      • Redesigned the filter panel input for dates to use CSS flexbox.
      • Update icons to be compatible with Font Awesome 6.
      • Updates the FilteredData method get_formatted_filter_state so it no longer appends empty filters.
      • Added clearer installation instructions to README.
      • -
    + +
    -

    Breaking changes

    -
    • Renamed internal S3 method get_filterable_varnames to get_supported_filter_varnames.
    • -
    +

    Breaking changes +

    +
      +
    • Renamed internal S3 method get_filterable_varnames to get_supported_filter_varnames.
    • +
    +
    -

    Bug fixes

    -
    • Fixed a bug when the filter panel overview would not refresh if the panel was hidden during a transition between active modules.
    • +

      Bug fixes +

      +
        +
      • Fixed a bug when the filter panel overview would not refresh if the panel was hidden during a transition between active modules.
      • Fixed a bug in FilterState where sliderInput step values were too precise.
      • -
    + +
    -

    teal.slice 0.1.1

    +

    teal.slice 0.1.1 +

    -

    New features

    -
    • Added a formatting function for filter panel classes.
    • -
    +

    New features +

    +
      +
    • Added a formatting function for filter panel classes.
    • +
    +
    -

    Miscellaneous

    -
    • Added a template to the pkgdown site.
    • +

      Miscellaneous +

      +
        +
      • Added a template to the pkgdown site.
      • Updated package authors.
      • Added package vignettes.
      • -
    + +
    -

    Fix

    -
    • Fixed a bug in FilteredDataset, where launching a shiny application without FilteredData would not attach the appropriate CSS files.
    • -
    +

    Fix +

    +
      +
    • Fixed a bug in FilteredDataset, where launching a shiny application without FilteredData would not attach the appropriate CSS files.
    • +
    +
    -

    teal.slice 0.1.0

    -
    • Initial release of teal.slice - a package providing a filter module for teal applications.
    • -
    -

    Changes (from behavior when functionality was part of teal)

    +

    teal.slice 0.1.0 +

    +
      +
    • Initial release of teal.slice - a package providing a filter module for teal applications.
    • +
    +
    +

    Changes (from behavior when functionality was part of teal) +

    -

    Breaking changes

    -
    • +

      Breaking changes +

      +
        +
      • default_filter has been deprecated - use list() instead for a default filter.
      • -
    + +
    -

    Bug fixes

    -
    • Add counts to filtering categorical variables bar charts in the filtering panel in cases where they were missing.
    • +

      Bug fixes +

      +
        +
      • Add counts to filtering categorical variables bar charts in the filtering panel in cases where they were missing.
      • Fixed a bug causing an error when both sliders of RangeFilterState where put to either end of the allowed range in the UI.
      • -
    + +
    -

    Miscellaneous

    -
    • Added is_any_filtered method to all FilterState classes to detect if selected values actually filters out any data. This is used to decide if an explicit filter statement is added to the call.
    • +

      Miscellaneous +

      +
        +
      • Added is_any_filtered method to all FilterState classes to detect if selected values actually filters out any data. This is used to decide if an explicit filter statement is added to the call.
      • The filter panel now displays a helpful message when data has no rows or columns in place of an empty drop down widget.
      • FilteredData now stores whether its datasets had a reproducibility check or not via two new methods to its class: set_check and get_check.
      • -
    + +
    + + + + - - + + diff --git a/v0.5.0-rc2/pull_request_template.html b/v0.5.0-rc2/pull_request_template.html index 612f628db..cce22b640 100644 --- a/v0.5.0-rc2/pull_request_template.html +++ b/v0.5.0-rc2/pull_request_template.html @@ -1,8 +1,22 @@ - -Pull Request • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -83,17 +103,19 @@

    Fixes #nnn

    - + + + + - - + + diff --git a/v0.5.0-rc2/reference/ChoicesFilterState.html b/v0.5.0-rc2/reference/ChoicesFilterState.html index 1419c5760..fd3b973ee 100644 --- a/v0.5.0-rc2/reference/ChoicesFilterState.html +++ b/v0.5.0-rc2/reference/ChoicesFilterState.html @@ -1,8 +1,24 @@ - -FilterState object for categorical data — ChoicesFilterState • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,40 +107,60 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterState -> ChoicesFilterState

    +

    Inherited methods


    -

    Method new()

    -

    Initialize a FilterState object.

    -

    Usage

    -

    ChoicesFilterState$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterState object.

    +
    +

    Usage +

    +

    +
    +
    ChoicesFilterState$new(
       x,
       x_reactive = reactive(NULL),
       slice,
       extract_type = character(0)
    -)

    +)
    +

    +
    -

    Returns

    +

    Returns +

    Object of class ChoicesFilterState, invisibly.

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection. For this class returned call looks like -<varname> %in% c(<values selected>) with optional is.na(<varname>).

    -

    Usage

    -

    ChoicesFilterState$get_call(dataname)

    +<varname> %in% c(<values selected>) with optional is.na(<varname>).

    +
    +

    Usage +

    +

    +
    +
    ChoicesFilterState$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of data set; defaults to private$get_dataname()

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    call or NULL

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    ChoicesFilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    ChoicesFilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -197,17 +280,19 @@

    Arguments

    + +
    + +
    - - + + diff --git a/v0.5.0-rc2/reference/DFFilterStates.html b/v0.5.0-rc2/reference/DFFilterStates.html index 9a4e3d793..8f9ae6d74 100644 --- a/v0.5.0-rc2/reference/DFFilterStates.html +++ b/v0.5.0-rc2/reference/DFFilterStates.html @@ -1,8 +1,24 @@ - -FilterStates subclass for data frames — DFFilterStates • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,18 +107,25 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterStates -> DFFilterStates

    -

    Methods

    +

    Methods +

    -

    Public methods

    +

    Public methods +

    -

    Inherited methods +
    +

    Inherited methods


    -

    Method new()

    +

    +
    +
    +

    Method new() +

    Initializes DFFilterStates object by setting dataname and initializing state_list (shiny::reactiveVal). This class contains a single state_list with no specified name, which means that when calling the subset function associated with this class -(dplyr::filter), a list of conditions is passed to unnamed arguments (...).

    -

    Usage

    -

    DFFilterStates$new(
    +(dplyr::filter), a list of conditions is passed to unnamed arguments (...).

    +
    +

    Usage +

    +

    +
    +
    DFFilterStates$new(
       data,
       data_reactive = function(sid = "") NULL,
       dataname,
       datalabel = NULL,
       keys = character(0)
    -)

    +)
    +

    +
    -

    Arguments

    -

    data
    +

    Arguments +

    +

    +
    +
    +
    data

    (data.frame) the R object which dplyr::filter function will be applied on.

    @@ -154,23 +197,41 @@

    Arguments
    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    DFFilterStates$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    DFFilterStates$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -178,17 +239,19 @@

    Arguments

    + +

    + +
    - - + + diff --git a/v0.5.0-rc2/reference/DataframeFilteredDataset.html b/v0.5.0-rc2/reference/DataframeFilteredDataset.html index e5392bc12..84e52e169 100644 --- a/v0.5.0-rc2/reference/DataframeFilteredDataset.html +++ b/v0.5.0-rc2/reference/DataframeFilteredDataset.html @@ -1,10 +1,26 @@ - -The DataframeFilteredDataset R6 class — DataframeFilteredDataset • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + +
    @@ -87,23 +109,30 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilteredDataset -> DataframeFilteredDataset

    +

    Inherited methods


    -

    Method new()

    -

    Initializes this DataframeFilteredDataset object.

    -

    Usage

    -

    DataframeFilteredDataset$new(
    +

    +
    +
    +

    Method new() +

    +

    Initializes this DataframeFilteredDataset object.

    +
    +

    Usage +

    +

    +
    +
    DataframeFilteredDataset$new(
       dataset,
       dataname,
       keys = character(0),
    @@ -127,12 +163,18 @@ 

    Usage

    parent = NULL, join_keys = character(0), label = character(0) -)

    +)
    +

    +
    -

    Arguments

    -

    dataset
    +

    Arguments +

    +

    +
    +
    +
    dataset

    (data.frame) single data.frame for which filters are rendered.

    @@ -170,129 +212,227 @@

    Arguments -

    Returns

    +

    Returns +

    Object of class DataframeFilteredDataset, invisibly.

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Gets the subset expression.

    This function returns subset expressions equivalent to selected items within each of filter_states. Configuration of the expressions is constant and depends on filter_states type and order which are set during initialization. This class contains single FilterStates which contains single state_list -and all FilterState objects apply to one argument (...) in a dplyr::filter call.

    -

    Usage

    -

    DataframeFilteredDataset$get_call(sid = "")

    +and all FilterState objects apply to one argument (...) in a dplyr::filter call.

    +
    +

    Usage +

    +

    +
    +
    DataframeFilteredDataset$get_call(sid = "")
    +

    +
    -

    Arguments

    -

    sid
    +

    Arguments +

    +

    +
    +
    +
    sid

    (character) when specified, the method returns code containing conditions calls of FilterState objects with sid different to that of this sid argument.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Either a list of length 1 containing a filter call, or NULL.

    -


    -

    Method set_filter_state()

    -

    Set filter state.

    -

    Usage

    -

    DataframeFilteredDataset$set_filter_state(state)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Set filter state.

    +
    +

    Usage +

    +

    +
    +
    DataframeFilteredDataset$set_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method remove_filter_state()

    -

    Remove one or more FilterState form a FilteredDataset.

    -

    Usage

    -

    DataframeFilteredDataset$remove_filter_state(state)

    +
    +

    +
    +
    +

    Method remove_filter_state() +

    +

    Remove one or more FilterState form a FilteredDataset.

    +
    +

    Usage +

    +

    +
    +
    DataframeFilteredDataset$remove_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices) specifying FilterState objects to remove; teal_slices may contain only dataname and varname, other elements are ignored

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method ui_add()

    -

    UI module to add filter variable for this dataset.

    -

    Usage

    -

    DataframeFilteredDataset$ui_add(id)

    +
    +

    +
    +
    +

    Method ui_add() +

    +

    UI module to add filter variable for this dataset.

    +
    +

    Usage +

    +

    +
    +
    DataframeFilteredDataset$ui_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method get_filter_overview()

    -

    Creates row for filter overview in the form of
    dataname -- observations (remaining/total) - data.frame

    -

    Usage

    -

    DataframeFilteredDataset$get_filter_overview()

    +
    +

    +
    +
    +

    Method get_filter_overview() +

    +

    Creates row for filter overview in the form of
    dataname -- observations (remaining/total) - data.frame

    +
    +

    Usage +

    +

    +
    +
    DataframeFilteredDataset$get_filter_overview()
    +

    +
    -

    Returns

    +

    Returns +

    A data.frame.

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    DataframeFilteredDataset$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    DataframeFilteredDataset$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -300,17 +440,19 @@

    Arguments

    + +
    + +
    - - + + diff --git a/v0.5.0-rc2/reference/DateFilterState.html b/v0.5.0-rc2/reference/DateFilterState.html index 261620ca7..afcd34622 100644 --- a/v0.5.0-rc2/reference/DateFilterState.html +++ b/v0.5.0-rc2/reference/DateFilterState.html @@ -1,8 +1,24 @@ - -FilterState object for Date data — DateFilterState • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,40 +107,60 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterState -> DateFilterState

    +

    Inherited methods


    -

    Method new()

    -

    Initialize a FilterState object.

    -

    Usage

    -

    DateFilterState$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterState object.

    +
    +

    Usage +

    +

    +
    +
    DateFilterState$new(
       x,
       x_reactive = reactive(NULL),
       slice,
       extract_type = character(0)
    -)

    +)
    +

    +
    -

    Returns

    +

    Returns +

    Object of class DateFilterState, invisibly.

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection. For this class returned call looks like -<varname> >= <min value> & <varname> <= <max value> with optional is.na(<varname>).

    -

    Usage

    -

    DateFilterState$get_call(dataname)

    +<varname> >= <min value> & <varname> <= <max value> with optional is.na(<varname>).

    +
    +

    Usage +

    +

    +
    +
    DateFilterState$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) containing possibly prefixed name of data set

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    call or NULL

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    DateFilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    DateFilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -197,17 +280,19 @@

    Arguments

    + +
    + +
    - - + + diff --git a/v0.5.0-rc2/reference/DatetimeFilterState.html b/v0.5.0-rc2/reference/DatetimeFilterState.html index 5c828c26d..0779facb5 100644 --- a/v0.5.0-rc2/reference/DatetimeFilterState.html +++ b/v0.5.0-rc2/reference/DatetimeFilterState.html @@ -1,8 +1,24 @@ - -FilterState object for date time data — DatetimeFilterState • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,44 +107,64 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterState -> DatetimeFilterState

    +

    Inherited methods


    -

    Method new()

    +

    +
    +
    +

    Method new() +

    Initialize a FilterState object. This class has an extra field, private$timezone, which is set to Sys.timezone() by default. However, in case when using this module in teal app, one needs timezone of the app user. App user timezone is taken from session$userData$timezone -and is set only if object is initialized in shiny.

    -

    Usage

    -

    DatetimeFilterState$new(
    +and is set only if object is initialized in shiny.

    +
    +

    Usage +

    +

    +
    +
    DatetimeFilterState$new(
       x,
       x_reactive = reactive(NULL),
       extract_type = character(0),
       slice
    -)

    +)
    +

    +
    -

    Arguments

    -

    x
    +

    Arguments +

    +

    +
    +
    +
    x

    (POSIXct or POSIXlt) variable to be filtered.

    @@ -135,11 +178,15 @@

    Arguments varname in the condition call will be returned as <dataname>$<varname>

  • "matrix" varname in the condition call will be returned as <dataname>[, <varname>]

  • - + +
    slice
    @@ -151,49 +198,85 @@

    Arguments -

    Returns

    +

    Returns +

    Object of class DatetimeFilterState, invisibly.

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection. For this class returned call looks like -<varname> >= as.POSIXct(<min>) & <varname> <= <max>) with optional is.na(<varname>).

    -

    Usage

    -

    DatetimeFilterState$get_call(dataname)

    +<varname> >= as.POSIXct(<min>) & <varname> <= <max>) with optional is.na(<varname>).

    +
    +

    Usage +

    +

    +
    +
    DatetimeFilterState$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    name of data set; defaults to private$get_dataname()

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    call

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    DatetimeFilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    DatetimeFilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -201,17 +284,19 @@

    Arguments

    + +
    + +
    - - + + diff --git a/v0.5.0-rc2/reference/DefaultFilteredDataset.html b/v0.5.0-rc2/reference/DefaultFilteredDataset.html index 461f243c7..2819d4bb2 100644 --- a/v0.5.0-rc2/reference/DefaultFilteredDataset.html +++ b/v0.5.0-rc2/reference/DefaultFilteredDataset.html @@ -1,8 +1,24 @@ - -DefaultFilteredDataset R6 class — DefaultFilteredDataset • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,16 +107,20 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilteredDataset -> DefaultFilteredDataset

    +

    Inherited methods


    -

    Method new()

    -

    Initializes this DefaultFilteredDataset object.

    -

    Usage

    -

    DefaultFilteredDataset$new(dataset, dataname, label = character(0))

    +

    +
    +
    +

    Method new() +

    +

    Initializes this DefaultFilteredDataset object.

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$new(dataset, dataname, label = character(0))
    +

    +
    -

    Arguments

    -

    dataset
    +

    Arguments +

    +

    +
    +
    +
    dataset

    any type of object; will not be filtered.

    @@ -134,23 +177,40 @@

    Arguments -

    Returns

    +

    Returns +

    Object of class DefaultFilteredDataset, invisibly.

    -


    -

    Method format()

    -

    Returns a formatted string representing this DefaultFilteredDataset object.

    -

    Usage

    -

    DefaultFilteredDataset$format(show_all, trim_lines = FALSE)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns a formatted string representing this DefaultFilteredDataset object.

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$format(show_all, trim_lines = FALSE)
    +

    +
    -

    Arguments

    -

    show_all
    +

    Arguments +

    +

    +
    +
    +
    show_all

    (logical(1)) for method consistency, ignored.

    @@ -158,167 +218,291 @@

    Arguments -

    Returns

    +

    Returns +

    The formatted string.

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    -

    Usage

    -

    DefaultFilteredDataset$get_call(sid)

    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$get_call(sid)
    +

    +
    -

    Arguments

    -

    sid
    +

    Arguments +

    +

    +
    +
    +
    sid

    (character(1)) for method consistency, ignored.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    +

    +
    +
    +

    Method get_filter_state() +

    -

    Usage

    -

    DefaultFilteredDataset$get_filter_state()

    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$get_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    +

    +
    +
    +

    Method set_filter_state() +

    -

    Usage

    -

    DefaultFilteredDataset$set_filter_state(state)

    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$set_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices) for method consistency, ignored.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    +

    +
    +
    +

    Method clear_filter_states() +

    -

    Usage

    -

    DefaultFilteredDataset$clear_filter_states(force)

    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$clear_filter_states(force)
    +

    +
    -

    Arguments

    -

    force
    +

    Arguments +

    +

    +
    +
    +
    force

    (logical(1)) for method consistency, ignored.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method get_filter_overview()

    -

    Creates row for filter overview in the form of
    dataname - unsupported data class

    -

    Usage

    -

    DefaultFilteredDataset$get_filter_overview()

    +
    +

    +
    +
    +

    Method get_filter_overview() +

    +

    Creates row for filter overview in the form of
    dataname - unsupported data class

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$get_filter_overview()
    +

    +
    -

    Returns

    +

    Returns +

    A data.frame.

    -


    -

    Method ui_active()

    -

    Overwrites parent method.

    -

    Usage

    -

    DefaultFilteredDataset$ui_active(id)

    +
    +

    +
    +
    +

    Method ui_active() +

    +

    Overwrites parent method.

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$ui_active(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Details

    +

    Details +

    Blank UI module that would list active filter states for this dataset.

    -

    Returns

    +

    Returns +

    An empty div.

    -


    -

    Method ui_add()

    -

    Overwrites parent method.

    -

    Usage

    -

    DefaultFilteredDataset$ui_add(id)

    +
    +

    +
    +
    +

    Method ui_add() +

    +

    Overwrites parent method.

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$ui_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Details

    +

    Details +

    Blank UI module that would list active filter states for this dataset.

    -

    Returns

    +

    Returns +

    An empty div.

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    DefaultFilteredDataset$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -326,17 +510,19 @@

    Arguments

    + +
    + +
    - - + + diff --git a/v0.5.0-rc2/reference/EmptyFilterState.html b/v0.5.0-rc2/reference/EmptyFilterState.html index 3b42c2a58..4ae5b4a23 100644 --- a/v0.5.0-rc2/reference/EmptyFilterState.html +++ b/v0.5.0-rc2/reference/EmptyFilterState.html @@ -1,8 +1,24 @@ - -FilterState object for empty variables — EmptyFilterState • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,40 +107,60 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterState -> EmptyFilterState

    +

    Inherited methods


    -

    Method new()

    -

    Initialize EmptyFilterState object.

    -

    Usage

    -

    EmptyFilterState$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize EmptyFilterState object.

    +
    +

    Usage +

    +

    +
    +
    EmptyFilterState$new(
       x,
       x_reactive = reactive(NULL),
       extract_type = character(0),
       slice
    -)

    +)
    +

    +
    -

    Arguments

    -

    x
    +

    Arguments +

    +

    + -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection relevant for selected variable type. -Uses internal reactive values, hence must be called in reactive or isolated context.

    -

    Usage

    -

    EmptyFilterState$get_call(dataname)

    +Uses internal reactive values, hence must be called in reactive or isolated context.

    +
    +

    Usage +

    +

    +
    +
    EmptyFilterState$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    name of data set; defaults to private$get_dataname()

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    logical(1)

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    EmptyFilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    EmptyFilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -196,17 +279,19 @@

    Arguments

    + +
    + +
    - - + + diff --git a/v0.5.0-rc2/reference/FilterPanelAPI.html b/v0.5.0-rc2/reference/FilterPanelAPI.html index ab263605e..070bced9e 100644 --- a/v0.5.0-rc2/reference/FilterPanelAPI.html +++ b/v0.5.0-rc2/reference/FilterPanelAPI.html @@ -1,8 +1,24 @@ - -Class to encapsulate the API of the filter panel of a teal app — FilterPanelAPI • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,7 +106,8 @@
    -

    Details

    +

    Details +

    The purpose of this class is to encapsulate the API of the filter panel in a new class FilterPanelAPI so that it can be passed and used in the server call of any module instead of passing the whole FilteredData object.

    @@ -92,125 +115,223 @@

    Details

    -

    Methods

    +

    Methods +


    -

    Method new()

    -

    Initialize a FilterPanelAPI object.

    -

    Usage

    -

    FilterPanelAPI$new(datasets)

    + +
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterPanelAPI object.

    +
    +

    Usage +

    +

    +
    +
    FilterPanelAPI$new(datasets)
    +

    +
    -

    Arguments

    -

    datasets
    +

    Arguments +

    +

    +
    +
    +
    datasets

    (FilteredData)

    -

    +
    +

    +
    -


    +

    +
    +
    +

    Method get_filter_state() +

    Gets the reactive values from the active FilterState objects of the FilteredData object.

    Gets all active filters in the form of a nested list. -The output list is a compatible input to set_filter_state.

    -

    Usage

    -

    FilterPanelAPI$get_filter_state()

    +The output list is a compatible input to set_filter_state.

    +
    +

    Usage +

    +

    +
    +
    FilterPanelAPI$get_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    list with named elements corresponding to FilteredDataset objects with active filters.

    -


    -

    Method set_filter_state()

    -

    Sets active filter states.

    -

    Usage

    -

    FilterPanelAPI$set_filter_state(filter)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Sets active filter states.

    +
    +

    Usage +

    +

    +
    +
    FilterPanelAPI$set_filter_state(filter)
    +

    +
    -

    Arguments

    -

    filter
    +

    Arguments +

    +

    +
    +
    +
    filter

    (teal_slices)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method remove_filter_state()

    -

    Remove one or more FilterState of a FilteredDataset in the FilteredData object.

    -

    Usage

    -

    FilterPanelAPI$remove_filter_state(filter)

    +
    +

    +
    +
    +

    Method remove_filter_state() +

    +

    Remove one or more FilterState of a FilteredDataset in the FilteredData object.

    +
    +

    Usage +

    +

    +
    +
    FilterPanelAPI$remove_filter_state(filter)
    +

    +
    -

    Arguments

    -

    filter
    +

    Arguments +

    +

    +
    +
    +
    filter

    (teal_slices) specifying FilterState objects to remove; teal_slices may contain only dataname and varname, other elements are ignored

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method clear_filter_states()

    -

    Remove all FilterStates of the FilteredData object.

    -

    Usage

    -

    FilterPanelAPI$clear_filter_states(datanames)

    +
    +

    +
    +
    +

    Method clear_filter_states() +

    +

    Remove all FilterStates of the FilteredData object.

    +
    +

    Usage +

    +

    +
    +
    FilterPanelAPI$clear_filter_states(datanames)
    +

    +
    -

    Arguments

    -

    datanames
    +

    Arguments +

    +

    +
    +
    +
    datanames

    (character) datanames to remove their FilterStates; omit to remove all FilterStates in the FilteredData object

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    FilterPanelAPI$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    FilterPanelAPI$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -218,7 +339,8 @@

    Arguments -

    Examples

    +

    Examples +

    library(shiny)
     
     fd <- init_filtered_data(list(iris = iris))
    @@ -289,17 +411,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.5.0-rc2/reference/FilterState.html b/v0.5.0-rc2/reference/FilterState.html index b2b6e184b..6db915e98 100644 --- a/v0.5.0-rc2/reference/FilterState.html +++ b/v0.5.0-rc2/reference/FilterState.html @@ -1,8 +1,24 @@ - -FilterState abstract class — FilterState • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,12 +107,15 @@
    -

    Details

    +

    Details +

    This class is responsible for managing a single filter item within a FilteredData object and outputs a condition call (logical predicate) for subsetting one variable. Filter states depend on the variable type: (logical, integer, numeric, character, factor, Date, POSIXct, POSIXlt) -and FilterState subclasses exist that correspond to those types.

    +

    Each variable's filter state is an R6 object keeps the variable that is filtered, a teal_slice object that describes the filter state, as well as a shiny module (UI and server) that allows the user to alter the filter state. Changes to the filter state that cause some observations to be omitted trigger the get_call method and every R function call up in the reactive chain.

    -

    Modifying state

    +

    Modifying state +

    -

    Modifying a FilterState object is possible in three scenarios:

    • In an interactive session, by passing an appropriate teal_slice to the set_state method.

    • +

      Modifying a FilterState object is possible in three scenarios:

      +
        +
      • In an interactive session, by passing an appropriate teal_slice to the set_state method.

      • In a running application, by changing appropriate inputs.

      • In a running application, by using filter_state_api which directly uses set_state method of the FilterState object.

      • -
    + +
    -

    Methods

    +

    Methods +


    -

    Method new()

    -

    Initialize a FilterState object.

    -

    Usage

    -

    FilterState$new(
    +
    +
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterState object.

    +
    +

    Usage +

    +

    +
    +
    FilterState$new(
       x,
       x_reactive = reactive(NULL),
       slice,
       extract_type = character(0)
    -)

    +)
    +

    +
    -

    Returns

    +

    Returns +

    Object of class FilterState, invisibly.

    -


    -

    Method format()

    -

    Returns a formatted string representing this FilterState object.

    -

    Usage

    -

    FilterState$format(show_all = FALSE, trim_lines = TRUE)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns a formatted string representing this FilterState object.

    +
    +

    Usage +

    +

    +
    +
    FilterState$format(show_all = FALSE, trim_lines = TRUE)
    +

    +
    -

    Arguments

    -

    show_all
    +

    Arguments +

    +

    +
    +
    +
    show_all

    (logical(1)) passed to format.teal_slice

    @@ -197,106 +267,196 @@

    Arguments -

    Returns

    +

    Returns +

    character(1) the formatted string

    -


    -

    Method print()

    -

    Prints this FilterState object.

    -

    Usage

    -

    FilterState$print(...)

    +
    +

    +
    +
    +

    Method print() +

    +

    Prints this FilterState object.

    +
    +

    Usage +

    +

    +
    +
    FilterState$print(...)
    +

    +
    -

    Arguments

    -

    ...
    +

    Arguments +

    +

    +
    +
    +
    ...

    additional arguments

    -

    +
    +

    +
    -


    -

    Method set_state()

    -

    Sets mutable parameters of the filter state.

    • fixed state is prevented from changing state

    • +
    +

    +
    +
    +

    Method set_state() +

    +

    Sets mutable parameters of the filter state.

    +
      +
    • fixed state is prevented from changing state

    • anchored state is prevented from removing state

    • -
    -

    Usage

    -

    FilterState$set_state(state)

    + +
    +

    Usage +

    +

    +
    +
    FilterState$set_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slice)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    self invisibly

    -


    -

    Method get_state()

    -

    Returns a complete description of the filter state.

    -

    Usage

    -

    FilterState$get_state()

    +
    +

    +
    +
    +

    Method get_state() +

    +

    Returns a complete description of the filter state.

    +
    +

    Usage +

    +

    +
    +
    FilterState$get_state()
    +

    +
    -

    Returns

    +

    Returns +

    A teal_slice object.

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection relevant for selected variable type. Method is using internal reactive values which makes it reactive -and must be executed in reactive or isolated context.

    -

    Usage

    -

    FilterState$get_call()

    +and must be executed in reactive or isolated context.

    +
    +

    Usage +

    +

    +
    +
    FilterState$get_call()
    +

    +
    -


    -

    Method server()

    -

    shiny module server.

    -

    Usage

    -

    FilterState$server(id)

    +
    +

    +
    +
    +

    Method server() +

    +

    shiny module server.

    +
    +

    Usage +

    +

    +
    +
    FilterState$server(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Reactive expression signaling that remove button has been clicked.

    -


    -

    Method ui()

    +
    +

    +
    +
    +

    Method ui() +

    shiny UI module. -The UI for this class contains simple message stating that it is not supported.

    -

    Usage

    -

    FilterState$ui(id, parent_id = "cards")

    +The UI for this class contains simple message stating that it is not supported.

    +
    +

    Usage +

    +

    +
    +
    FilterState$ui(id, parent_id = "cards")
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    @@ -305,35 +465,64 @@

    Arguments
    -

    Method destroy_observers()

    -

    Destroy observers stored in private$observers.

    -

    Usage

    -

    FilterState$destroy_observers()

    +
    +

    +
    +
    +

    Method destroy_observers() +

    +

    Destroy observers stored in private$observers.

    +
    +

    Usage +

    +

    +
    +
    FilterState$destroy_observers()
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    FilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    FilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -341,17 +530,19 @@

    Arguments

    + +

    + +
    - - + + diff --git a/v0.5.0-rc2/reference/FilterStateExpr.html b/v0.5.0-rc2/reference/FilterStateExpr.html index 6d426a4cb..53a731253 100644 --- a/v0.5.0-rc2/reference/FilterStateExpr.html +++ b/v0.5.0-rc2/reference/FilterStateExpr.html @@ -1,8 +1,24 @@ - -FilterStateExpr R6 class — FilterStateExpr • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,18 +107,22 @@
    -

    Details

    +

    Details +

    Creates a filter state around a predefined condition call (logical predicate). The condition call is independent of the data and the filter card allows no interaction (the filter is always fixed).

    -

    Methods

    +

    Methods +


    -

    Method new()

    -

    Initialize a FilterStateExpr object.

    -

    Usage

    -

    FilterStateExpr$new(slice)

    + +
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterStateExpr object.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$new(slice)
    +

    +
    -

    Arguments

    -

    slice
    +

    Arguments +

    +

    +
    +
    +
    slice

    (teal_slice_expr)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Object of class FilterStateExpr, invisibly.

    -


    -

    Method format()

    -

    Returns a formatted string representing this FilterStateExpr object.

    -

    Usage

    -

    FilterStateExpr$format(show_all = FALSE, trim_lines = TRUE)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns a formatted string representing this FilterStateExpr object.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$format(show_all = FALSE, trim_lines = TRUE)
    +

    +
    -

    Arguments

    -

    show_all
    +

    Arguments +

    +

    +
    +
    +
    show_all

    (logical(1)) passed to format.teal_slice

    @@ -142,133 +201,242 @@

    Arguments -

    Returns

    +

    Returns +

    character(1) the formatted string

    -


    -

    Method print()

    -

    Prints this FilterStateExpr object.

    -

    Usage

    -

    FilterStateExpr$print(...)

    +
    +

    +
    +
    +

    Method print() +

    +

    Prints this FilterStateExpr object.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$print(...)
    +

    +
    -

    Arguments

    -

    ...
    +

    Arguments +

    +

    +
    +
    +
    ...

    arguments passed to the format method

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method get_state()

    -

    Returns a complete description of this filter state.

    -

    Usage

    -

    FilterStateExpr$get_state()

    +
    +

    +
    +
    +

    Method get_state() +

    +

    Returns a complete description of this filter state.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$get_state()
    +

    +
    -

    Returns

    +

    Returns +

    A teal_slice object.

    -


    -

    Method set_state()

    -

    Does nothing. Exists for compatibility.

    -

    Usage

    -

    FilterStateExpr$set_state(state)

    +
    +

    +
    +
    +

    Method set_state() +

    +

    Does nothing. Exists for compatibility.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$set_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slice)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    self, invisibly.

    -


    -

    Method get_call()

    -

    Get reproducible call.

    -

    Usage

    -

    FilterStateExpr$get_call(dataname)

    +
    +

    +
    +
    +

    Method get_call() +

    +

    Get reproducible call.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    -

    (ignored) for a consistency with FilterState

    +

    Arguments +

    +

    +
    +
    +
    dataname
    +
    +

    (ignored) for a consistency with FilterState

    Returns reproducible condition call for current selection relevant for selected variable type. Method is using internal reactive values which makes it reactive -and must be executed in reactive or isolated context.

    +and must be executed in reactive or isolated context.

    +
    -

    + +

    +
    -

    Returns

    +

    Returns +

    call or NULL

    -


    -

    Method destroy_observers()

    -

    Destroy observers stored in private$observers.

    -

    Usage

    -

    FilterStateExpr$destroy_observers()

    +
    +

    +
    +
    +

    Method destroy_observers() +

    +

    Destroy observers stored in private$observers.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$destroy_observers()
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method server()

    -

    shiny module server.

    -

    Usage

    -

    FilterStateExpr$server(id)

    +
    +

    +
    +
    +

    Method server() +

    +

    shiny module server.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$server(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Reactive expression signaling that the remove button has been clicked.

    -


    -

    Method ui()

    +
    +

    +
    +
    +

    Method ui() +

    shiny module UI. -The UI for this class contains simple message stating that it is not supported.

    -

    Usage

    -

    FilterStateExpr$ui(id, parent_id = "cards")

    +The UI for this class contains simple message stating that it is not supported.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$ui(id, parent_id = "cards")
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    @@ -278,23 +446,41 @@

    Arguments
    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    FilterStateExpr$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -302,17 +488,19 @@

    Arguments

    + +

    + +
    - - + + diff --git a/v0.5.0-rc2/reference/FilterStates.html b/v0.5.0-rc2/reference/FilterStates.html index 064cfc385..7f4dd2f73 100644 --- a/v0.5.0-rc2/reference/FilterStates.html +++ b/v0.5.0-rc2/reference/FilterStates.html @@ -1,5 +1,10 @@ - - + + + + + +FilterStates R6 class — FilterStates • teal.slice +FilterStates R6 class — FilterStates • teal.slice + + + + + + + + + + Skip to contents @@ -38,7 +54,8 @@ + +
    @@ -114,12 +137,15 @@
    -

    Methods

    +

    Methods +


    -

    Method new()

    + +
    +

    +
    +
    +

    Method new() +

    Initializes FilterStates object by setting -dataname, and datalabel.

    -

    Usage

    -

    FilterStates$new(
    +dataname, and datalabel.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$new(
       data,
       data_reactive = function(sid = "") NULL,
       dataname,
       datalabel = NULL
    -)

    +)
    +

    +
    -

    Arguments

    -

    data
    +

    Arguments +

    +

    +
    +
    +
    data

    (data.frame or MultiAssayExperiment or SummarizedExperiment or matrix) the R object which subset function is applied on.

    @@ -171,23 +212,40 @@

    Arguments -

    Returns

    +

    Returns +

    Object of class FilterStates, invisibly.

    -


    -

    Method format()

    -

    Returns a formatted string representing this FilterStates object.

    -

    Usage

    -

    FilterStates$format(show_all = FALSE, trim_lines = TRUE)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns a formatted string representing this FilterStates object.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$format(show_all = FALSE, trim_lines = TRUE)
    +

    +
    -

    Arguments

    -

    show_all
    +

    Arguments +

    +

    +
    +
    +
    show_all

    (logical(1)) passed to format.teal_slices

    @@ -195,28 +253,40 @@

    Arguments -

    Returns

    +

    Returns +

    character(1) the formatted string

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Filter call

    Builds subset expression from condition calls generated by FilterState. The lhs of the expression is a dataname_prefixed, where word prefixed refers to situation when call is evaluated on elements of the original data, for example dataname[[x]]. By default dataname_prefixed = dataname and it's not alterable through class methods. Customization of private$dataname_prefixed is done through inheriting classes.

    -

    The rhs is a call to private$fun with following arguments:

    • dataname_prefixed

    • +

      The rhs is a call to private$fun with following arguments:

      +
        +
      • dataname_prefixed

      • list of logical expressions generated by FilterState objects stored in private$state_list. Each logical predicate is combined with & operator. Variables in these logical expressions by default are not prefixed but this can be changed by setting private$extract_type (change in the similar way as dataname_prefixed) Possible call outputs depending on a custom fields/options:

      • -

      # default
      +
    +

    +
    +
    # default
     dataname <- subset(dataname, col == "x")
     
     # fun = dplyr::filter
    @@ -229,222 +299,399 @@ 

    Method get_call()dataname <- subset(dataname, subset = row_col == "x", select = col_col == "x") # dataname = dataname[[element]] -dataname[[element]] <- subset(dataname[[element]], subset = col == "x")

    -

    If no filters are applied, NULL is returned to avoid no-op calls such as dataname <- dataname.

    -

    Usage

    -

    FilterStates$get_call(sid = "")

    +dataname[[element]] <- subset(dataname[[element]], subset = col == "x")
    +

    +
    +

    If no filters are applied, NULL is returned to avoid no-op calls such as dataname <- dataname.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$get_call(sid = "")
    +

    +
    -

    Arguments

    -

    sid
    +

    Arguments +

    +

    +
    +
    +
    sid

    (character) when specified then method returns code containing condition calls (logical predicates) of FilterState objects which "sid" attribute is different than this sid argument.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    call or NULL

    -


    -

    Method print()

    -

    Prints this FilterStates object.

    -

    Usage

    -

    FilterStates$print(...)

    +
    +

    +
    +
    +

    Method print() +

    +

    Prints this FilterStates object.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$print(...)
    +

    +
    -

    Arguments

    -

    ...
    +

    Arguments +

    +

    +
    +
    +
    ...

    additional arguments passed to format.

    -

    +
    +

    +
    -


    -

    Method remove_filter_state()

    -

    Remove one or more FilterStates from the state_list along with their UI elements.

    -

    Usage

    -

    FilterStates$remove_filter_state(state)

    +
    +

    +
    +
    +

    Method remove_filter_state() +

    +

    Remove one or more FilterStates from the state_list along with their UI elements.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$remove_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices) specifying FilterState objects to remove; teal_slices may contain only dataname and varname, other elements are ignored

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    +

    +
    +
    +

    Method get_filter_state() +

    Gets reactive values from active FilterState objects.

    Get active filter state from FilterState objects stored in state_list(s). -The output is a list compatible with input to self$set_filter_state.

    -

    Usage

    -

    FilterStates$get_filter_state()

    +The output is a list compatible with input to self$set_filter_state.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$get_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    Object of class teal_slices.

    -


    -

    Method set_filter_state()

    -

    Sets active FilterState objects.

    -

    Usage

    -

    FilterStates$set_filter_state(state)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Sets active FilterState objects.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$set_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Function that raises an error.

    -


    -

    Method clear_filter_states()

    -

    Remove all FilterState objects from this FilterStates object.

    -

    Usage

    -

    FilterStates$clear_filter_states(force = FALSE)

    +
    +

    +
    +
    +

    Method clear_filter_states() +

    +

    Remove all FilterState objects from this FilterStates object.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$clear_filter_states(force = FALSE)
    +

    +
    -

    Arguments

    -

    force
    +

    Arguments +

    +

    +
    +
    +
    force

    (logical(1)) flag specifying whether to include anchored filter states.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method ui_active()

    +
    +

    +
    +
    +

    Method ui_active() +

    shiny UI definition that stores FilterState UI elements. -Populated with elements created with renderUI in the module server.

    -

    Usage

    -

    FilterStates$ui_active(id)

    +Populated with elements created with renderUI in the module server.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$ui_active(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_active()

    -

    shiny server module.

    -

    Usage

    -

    FilterStates$srv_active(id)

    +
    +

    +
    +
    +

    Method srv_active() +

    +

    shiny server module.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$srv_active(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL.

    -


    -

    Method ui_add()

    -

    shiny UI module to add filter variable.

    -

    Usage

    -

    FilterStates$ui_add(id)

    +
    +

    +
    +
    +

    Method ui_add() +

    +

    shiny UI module to add filter variable.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$ui_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_add()

    +
    +

    +
    +
    +

    Method srv_add() +

    shiny server module to add filter variable.

    This module controls available choices to select as a filter variable. Once selected, a variable is removed from available choices. -Removing a filter variable adds it back to available choices.

    -

    Usage

    -

    FilterStates$srv_add(id)

    +Removing a filter variable adds it back to available choices.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$srv_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL.

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    FilterStates$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -452,17 +699,19 @@

    Arguments

    + +
    + +
    - - + + diff --git a/v0.5.0-rc2/reference/FilteredData.html b/v0.5.0-rc2/reference/FilteredData.html index b26e17365..f98306b65 100644 --- a/v0.5.0-rc2/reference/FilteredData.html +++ b/v0.5.0-rc2/reference/FilteredData.html @@ -1,8 +1,24 @@ - -Class to encapsulate filtered datasets — FilteredData • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,7 +106,8 @@ + +
    -

    Methods

    +

    Methods +


    -

    Method new()

    -

    Initialize a FilteredData object.

    -

    Usage

    -

    FilteredData$new(data_objects, join_keys = teal.data::join_keys())

    + +
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilteredData object.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$new(data_objects, join_keys = teal.data::join_keys())
    +

    +
    -

    Arguments

    -

    data_objects
    +

    Arguments +

    +

    +
    +
    +
    data_objects

    (named list) List of data objects. Names of the list will be used as dataname for respective datasets.

    @@ -157,65 +204,113 @@

    Argumentsteal.data::join_keys().

    -

    +
    +

    +
    -


    -

    Method datanames()

    -

    Gets datanames.

    -

    Usage

    -

    FilteredData$datanames()

    +
    +

    +
    +
    +

    Method datanames() +

    +

    Gets datanames.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$datanames()
    +

    +
    -

    Details

    +

    Details +

    The datanames are returned in the order in which they must be evaluated (in case of dependencies).

    -

    Returns

    +

    Returns +

    Character vector.

    -


    -

    Method get_datalabel()

    +
    +

    +
    +
    +

    Method get_datalabel() +

    Gets data label for the dataset. -Useful to display in Show R Code.

    -

    Usage

    -

    FilteredData$get_datalabel(dataname)

    +Useful to display in Show R Code.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_datalabel(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Character string.

    -


    -

    Method set_available_teal_slices()

    -

    Set list of external filter states available for activation.

    -

    Usage

    -

    FilteredData$set_available_teal_slices(x)

    +
    +

    +
    +
    +

    Method set_available_teal_slices() +

    +

    Set list of external filter states available for activation.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$set_available_teal_slices(x)
    +

    +
    -

    Arguments

    -

    x
    +

    Arguments +

    +

    +
    +
    +
    x

    (reactive) should return teal_slices

    -

    +
    +

    +
    -

    Details

    +

    Details +

    Unlike adding new filter from the column, these filters can come with some prespecified settings. teal_slices are wrapped in a reactive so they can be updated from elsewhere in the app. Filters passed in x are limited to those that can be set for this FilteredData object, @@ -224,46 +319,76 @@

    Details -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method get_available_teal_slices()

    -

    Get list of filter states available for this object.

    -

    Usage

    -

    FilteredData$get_available_teal_slices()

    +
    +

    +
    +
    +

    Method get_available_teal_slices() +

    +

    Get list of filter states available for this object.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_available_teal_slices()
    +

    +
    -

    Details

    +

    Details +

    All teal_slice objects that have been created since the beginning of the app session are stored in one teal_slices object. This returns a subset of that teal_slices, describing filter states that can be set for this object.

    -

    Returns

    +

    Returns +

    reactive that returns teal_slices.

    -


    -

    Method get_call()

    -

    Gets a call to filter the dataset according to the filter state.

    -

    Usage

    -

    FilteredData$get_call(dataname)

    +
    +

    +
    +
    +

    Method get_call() +

    +

    Gets a call to filter the dataset according to the filter state.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset

    -

    +
    +

    +
    -

    Details

    +

    Details +

    It returns a call to filter the dataset only, assuming the other (filtered) datasets it depends on are available.

    Together with self$datanames() which returns the datasets in the correct @@ -277,21 +402,36 @@

    Details -

    Returns

    +

    Returns +

    A list of calls.

    -


    -

    Method get_data()

    +
    +

    +
    +
    +

    Method get_data() +

    Gets filtered or unfiltered dataset.

    -

    For filtered = FALSE, the original data set with set_data is returned including all attributes.

    -

    Usage

    -

    FilteredData$get_data(dataname, filtered = TRUE)

    +

    For filtered = FALSE, the original data set with set_data is returned including all attributes.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_data(dataname, filtered = TRUE)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset.

    @@ -299,77 +439,139 @@

    Arguments -

    Returns

    +

    Returns +

    A data object, a data.frame or a MultiAssayExperiment.

    -


    -

    Method get_join_keys()

    -

    Get join keys between two datasets.

    -

    Usage

    -

    FilteredData$get_join_keys()

    +
    +

    +
    +
    +

    Method get_join_keys() +

    +

    Get join keys between two datasets.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_join_keys()
    +

    +
    -

    Returns

    +

    Returns +

    join_keys

    -


    -

    Method get_filter_overview()

    +
    +

    +
    +
    +

    Method get_filter_overview() +

    Creates filter overview table to be displayed in the application. One row is created per dataset, according to the get_filter_overview methods -of the contained FilteredDataset objects.

    -

    Usage

    -

    FilteredData$get_filter_overview(datanames)

    +of the contained FilteredDataset objects.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_filter_overview(datanames)
    +

    +
    -

    Arguments

    -

    datanames
    +

    Arguments +

    +

    +
    +
    +
    datanames

    (character) vector of dataset names.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    A data.frame listing the numbers of observations in all datasets.

    -


    -

    Method get_keys()

    -

    Get keys for the dataset.

    -

    Usage

    -

    FilteredData$get_keys(dataname)

    +
    +

    +
    +
    +

    Method get_keys() +

    +

    Get keys for the dataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_keys(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Character vector of key column names.

    -


    -

    Method set_dataset()

    -

    Adds a dataset to this FilteredData.

    -

    Usage

    -

    FilteredData$set_dataset(data, dataname)

    +
    +

    +
    +
    +

    Method set_dataset() +

    +

    Adds a dataset to this FilteredData.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$set_dataset(data, dataname)
    +

    +
    -

    Arguments

    -

    data
    +

    Arguments +

    +

    +
    +
    +
    data

    (data.frame or MultiAssayExperiment) data to be filtered.

    @@ -379,10 +581,13 @@

    Arguments -

    Details

    +

    Details +

    set_dataset creates a FilteredDataset object which keeps dataset for the filtering purpose. If this data has a parent specified in the join_keys object stored in private$join_keys then created FilteredDataset (child) gets linked with other FilteredDataset (parent). @@ -391,52 +596,95 @@

    Details -

    Returns

    +

    Returns +

    self, invisibly.

    -


    -

    Method set_join_keys()

    -

    Set the join_keys.

    -

    Usage

    -

    FilteredData$set_join_keys(join_keys)

    +
    +

    +
    +
    +

    Method set_join_keys() +

    +

    Set the join_keys.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$set_join_keys(join_keys)
    +

    +
    -

    Arguments

    -

    join_keys
    +

    Arguments +

    +

    +
    +
    +
    join_keys

    (join_keys), see teal.data::join_keys().

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    self, invisibly.

    -


    -

    Method get_filter_state()

    -

    Gets states of all contained FilterState objects.

    -

    Usage

    -

    FilteredData$get_filter_state()

    +
    +

    +
    +
    +

    Method get_filter_state() +

    +

    Gets states of all contained FilterState objects.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    A teal_slices object.

    -


    -

    Method format()

    -

    Returns a formatted string representing this FilteredData object.

    -

    Usage

    -

    FilteredData$format(show_all = FALSE, trim_lines = TRUE)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns a formatted string representing this FilteredData object.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$format(show_all = FALSE, trim_lines = TRUE)
    +

    +
    -

    Arguments

    -

    show_all
    +

    Arguments +

    +

    +
    +
    +
    show_all

    (logical(1)) passed to format.teal_slice.

    @@ -444,81 +692,148 @@

    Arguments -

    Returns

    +

    Returns +

    character(1) the formatted string.

    -


    -

    Method print()

    -

    Prints this FilteredData object.

    -

    Usage

    -

    FilteredData$print(...)

    +
    +

    +
    +
    +

    Method print() +

    +

    Prints this FilteredData object.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$print(...)
    +

    +
    -

    Arguments

    -

    ...
    +

    Arguments +

    +

    +
    +
    +
    ...

    additional arguments passed to format.

    -

    +
    +

    +
    -


    -

    Method set_filter_state()

    -

    Sets active filter states.

    -

    Usage

    -

    FilteredData$set_filter_state(state)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Sets active filter states.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$set_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method remove_filter_state()

    -

    Removes one or more FilterState from a FilteredData object.

    -

    Usage

    -

    FilteredData$remove_filter_state(state)

    +
    +

    +
    +
    +

    Method remove_filter_state() +

    +

    Removes one or more FilterState from a FilteredData object.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$remove_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices) specifying FilterState objects to remove; teal_slices may contain only dataname and varname, other elements are ignored.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method clear_filter_states()

    -

    Remove all FilterStates of a FilteredDataset or all FilterStates of a FilteredData object.

    -

    Usage

    -

    FilteredData$clear_filter_states(datanames = self$datanames(), force = FALSE)

    +
    +

    +
    +
    +

    Method clear_filter_states() +

    +

    Remove all FilterStates of a FilteredDataset or all FilterStates of a FilteredData object.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$clear_filter_states(datanames = self$datanames(), force = FALSE)
    +

    +
    -

    Arguments

    -

    datanames
    +

    Arguments +

    +

    +
    +
    +
    datanames

    (character) names of datasets for which to remove all filter states. Defaults to all datasets in this FilteredData object.

    @@ -529,45 +844,79 @@

    Arguments -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method ui_filter_panel()

    +
    +

    +
    +
    +

    Method ui_filter_panel() +

    top-level shiny module for the filter panel in the teal app. -Contains 1) filter overview panel, 2) filter active panel, and 3) add filters panel.

    -

    Usage

    -

    FilteredData$ui_filter_panel(id)

    +Contains 1) filter overview panel, 2) filter active panel, and 3) add filters panel.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$ui_filter_panel(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_filter_panel()

    -

    Server function for filter panel.

    -

    Usage

    -

    FilteredData$srv_filter_panel(id, active_datanames = self$datanames)

    +
    +

    +
    +
    +

    Method srv_filter_panel() +

    +

    Server function for filter panel.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$srv_filter_panel(id, active_datanames = self$datanames)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    @@ -580,44 +929,78 @@

    Arguments -

    Returns

    +

    Returns +

    NULL.

    -


    -

    Method ui_active()

    -

    Server module responsible for displaying active filters.

    -

    Usage

    -

    FilteredData$ui_active(id)

    +
    +

    +
    +
    +

    Method ui_active() +

    +

    Server module responsible for displaying active filters.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$ui_active(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_active()

    -

    Server module responsible for displaying active filters.

    -

    Usage

    -

    FilteredData$srv_active(id, active_datanames = self$datanames)

    +
    +

    +
    +
    +

    Method srv_active() +

    +

    Server module responsible for displaying active filters.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$srv_active(id, active_datanames = self$datanames)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    @@ -627,44 +1010,78 @@

    Arguments -

    Returns

    +

    Returns +

    NULL.

    -


    -

    Method ui_add()

    -

    Server module responsible for displaying drop-downs with variables to add a filter.

    -

    Usage

    -

    FilteredData$ui_add(id)

    +
    +

    +
    +
    +

    Method ui_add() +

    +

    Server module responsible for displaying drop-downs with variables to add a filter.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$ui_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_add()

    -

    Server module responsible for displaying drop-downs with variables to add a filter.

    -

    Usage

    -

    FilteredData$srv_add(id, active_datanames = reactive(self$datanames()))

    +
    +

    +
    +
    +

    Method srv_add() +

    +

    Server module responsible for displaying drop-downs with variables to add a filter.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$srv_add(id, active_datanames = reactive(self$datanames()))
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    @@ -674,45 +1091,78 @@

    Arguments -

    Returns

    +

    Returns +

    NULL.

    -


    -

    Method ui_overview()

    +
    +

    +
    +
    +

    Method ui_overview() +

    Creates the UI definition for the module showing counts for each dataset contrasting the filtered to the full unfiltered dataset.

    Per dataset, it displays the number of rows/observations in each dataset, -the number of unique subjects.

    -

    Usage

    -

    FilteredData$ui_overview(id)

    +the number of unique subjects.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$ui_overview(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -


    -

    Method srv_overview()

    +
    +

    +
    +
    +

    Method srv_overview() +

    Server function to display the number of records in the filtered and unfiltered -data.

    -

    Usage

    -

    FilteredData$srv_overview(id, active_datanames = self$datanames)

    +data.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$srv_overview(id, active_datanames = self$datanames)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    @@ -725,27 +1175,46 @@

    Arguments -

    Returns

    +

    Returns +

    NULL.

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    FilteredData$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -753,17 +1222,19 @@

    Arguments

    + +
    + +
    - - + + diff --git a/v0.5.0-rc2/reference/FilteredDataset.html b/v0.5.0-rc2/reference/FilteredDataset.html index cba428afe..01da9f1f3 100644 --- a/v0.5.0-rc2/reference/FilteredDataset.html +++ b/v0.5.0-rc2/reference/FilteredDataset.html @@ -1,16 +1,32 @@ - - + + + + + +FilteredDataset R6 class — FilteredDataset • teal.slice +FilteredDataset R6 class — FilteredDataset • teal.slice + + + + + + + + + + Skip to contents @@ -26,7 +42,8 @@ + +
    @@ -96,12 +119,15 @@
    -

    Methods

    +

    Methods +


    -

    Method new()

    -

    Initializes this FilteredDataset object.

    -

    Usage

    -

    +

    +
    +
    +

    Method new() +

    +

    Initializes this FilteredDataset object.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$new(
       dataset,
       dataname,
       keys = character(0),
       label = attr(dataset, "label")
    -)

    +)
    +

    +
    -

    Arguments

    -

    dataset
    +

    Arguments +

    +

    +
    +
    +
    dataset

    any object

    @@ -152,23 +193,40 @@

    Arguments -

    Returns

    +

    Returns +

    Object of class FilteredDataset, invisibly.

    -


    -

    Method format()

    -

    Returns a formatted string representing this FilteredDataset object.

    -

    Usage

    -

    FilteredDataset$format(show_all = FALSE, trim_lines = TRUE)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns a formatted string representing this FilteredDataset object.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$format(show_all = FALSE, trim_lines = TRUE)
    +

    +
    -

    Arguments

    -

    show_all
    +

    Arguments +

    +

    +
    +
    +
    show_all

    (logical(1)) passed to format.teal_slice.

    @@ -176,289 +234,526 @@

    Arguments -

    Returns

    +

    Returns +

    The formatted character string.

    -


    -

    Method print()

    -

    Prints this FilteredDataset object.

    -

    Usage

    -

    FilteredDataset$print(...)

    +
    +

    +
    +
    +

    Method print() +

    +

    Prints this FilteredDataset object.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$print(...)
    +

    +
    -

    Arguments

    -

    ...
    +

    Arguments +

    +

    +
    +
    +
    ...

    additional arguments passed to format.

    -

    +
    +

    +
    -


    -

    Method clear_filter_states()

    -

    Removes all filter items applied to this dataset.

    -

    Usage

    -

    FilteredDataset$clear_filter_states(force = FALSE)

    +
    +

    +
    +
    +

    Method clear_filter_states() +

    +

    Removes all filter items applied to this dataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$clear_filter_states(force = FALSE)
    +

    +
    -

    Arguments

    -

    force
    +

    Arguments +

    +

    +
    +
    +
    force

    (logical(1)) flag specifying whether to include anchored filter states.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL.

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Gets a filter expression.

    This function returns filter calls equivalent to selected items within each of filter_states. Configuration of the calls is constant and -depends on filter_states type and order which are set during initialization.

    -

    Usage

    -

    FilteredDataset$get_call(sid = "")

    +depends on filter_states type and order which are set during initialization.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_call(sid = "")
    +

    +
    -

    Arguments

    -

    sid
    +

    Arguments +

    +

    +
    +
    +
    sid

    (character) when specified, the method returns code containing conditions calls of FilterState objects with sid different to this sid argument.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Either a list of filter calls, or NULL.

    -


    -

    Method get_filter_state()

    -

    Gets states of all contained FilterState objects.

    -

    Usage

    -

    FilteredDataset$get_filter_state()

    +
    +

    +
    +
    +

    Method get_filter_state() +

    +

    Gets states of all contained FilterState objects.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    A teal_slices object.

    -


    -

    Method set_filter_state()

    -

    Set filter state.

    -

    Usage

    -

    FilteredDataset$set_filter_state(state)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Set filter state.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$set_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Virtual method, returns nothing and raises error.

    -


    -

    Method get_filter_count()

    -

    Gets the number of FilterState objects in all FilterStates in this FilteredDataset.

    -

    Usage

    -

    FilteredDataset$get_filter_count()

    +
    +

    +
    +
    +

    Method get_filter_count() +

    +

    Gets the number of FilterState objects in all FilterStates in this FilteredDataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_filter_count()
    +

    +
    -

    Returns

    +

    Returns +

    integer(1)

    -


    -

    Method get_dataname()

    -

    Gets the name of the dataset.

    -

    Usage

    -

    FilteredDataset$get_dataname()

    +
    +

    +
    +
    +

    Method get_dataname() +

    +

    Gets the name of the dataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_dataname()
    +

    +
    -

    Returns

    +

    Returns +

    A character string.

    -


    -

    Method get_dataset()

    -

    Gets the dataset object in this FilteredDataset.

    -

    Usage

    -

    FilteredDataset$get_dataset(filtered = FALSE)

    +
    +

    +
    +
    +

    Method get_dataset() +

    +

    Gets the dataset object in this FilteredDataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_dataset(filtered = FALSE)
    +

    +
    -

    Arguments

    -

    filtered
    +

    Arguments +

    +

    +
    +
    +
    filtered

    (logical(1))

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    The stored dataset. If data.frame or MultiAssayExperiment, either raw or as a reactive with current filters applied (depending on filtered).

    -


    -

    Method get_filter_overview()

    -

    Get filter overview of a dataset.

    -

    Usage

    -

    FilteredDataset$get_filter_overview()

    +
    +

    +
    +
    +

    Method get_filter_overview() +

    +

    Get filter overview of a dataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_filter_overview()
    +

    +
    -

    Returns

    +

    Returns +

    Virtual method, returns nothing and raises an error.

    -


    -

    Method get_keys()

    -

    Gets the key columns for this dataset.

    -

    Usage

    -

    FilteredDataset$get_keys()

    +
    +

    +
    +
    +

    Method get_keys() +

    +

    Gets the key columns for this dataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_keys()
    +

    +
    -

    Returns

    +

    Returns +

    Character vector of variable names

    -


    -

    Method get_dataset_label()

    -

    Gets the dataset label.

    -

    Usage

    -

    FilteredDataset$get_dataset_label()

    +
    +

    +
    +
    +

    Method get_dataset_label() +

    +

    Gets the dataset label.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_dataset_label()
    +

    +
    -

    Returns

    +

    Returns +

    Character string.

    -


    -

    Method ui_active()

    -

    shiny module containing active filters for a dataset, along with a title and a remove button.

    -

    Usage

    -

    FilteredDataset$ui_active(id)

    +
    +

    +
    +
    +

    Method ui_active() +

    +

    shiny module containing active filters for a dataset, along with a title and a remove button.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$ui_active(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_active()

    -

    Server module for a dataset active filters.

    -

    Usage

    -

    FilteredDataset$srv_active(id)

    +
    +

    +
    +
    +

    Method srv_active() +

    +

    Server module for a dataset active filters.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$srv_active(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL.

    -


    -

    Method ui_add()

    -

    UI module to add filter variable for this dataset.

    -

    Usage

    -

    FilteredDataset$ui_add(id)

    +
    +

    +
    +
    +

    Method ui_add() +

    +

    UI module to add filter variable for this dataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$ui_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Virtual method, returns nothing and raises error.

    -


    -

    Method srv_add()

    +
    +

    +
    +
    +

    Method srv_add() +

    Server module to add filter variable for this dataset. For this class srv_add calls multiple modules of the same name from FilterStates as MAEFilteredDataset -contains one FilterStates object for colData and one for each experiment.

    -

    Usage

    -

    FilteredDataset$srv_add(id)

    +contains one FilterStates object for colData and one for each experiment.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$srv_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL.

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    FilteredDataset$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -466,17 +761,19 @@

    Arguments

    + +
    + +
    - - + + diff --git a/v0.5.0-rc2/reference/LogicalFilterState.html b/v0.5.0-rc2/reference/LogicalFilterState.html index ecc229d8e..3a5e2fd51 100644 --- a/v0.5.0-rc2/reference/LogicalFilterState.html +++ b/v0.5.0-rc2/reference/LogicalFilterState.html @@ -1,8 +1,24 @@ - -FilterState object for logical data — LogicalFilterState • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,40 +107,60 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterState -> LogicalFilterState

    +

    Inherited methods


    -

    Method new()

    -

    Initialize a FilterState object.

    -

    Usage

    -

    LogicalFilterState$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterState object.

    +
    +

    Usage +

    +

    +
    +
    LogicalFilterState$new(
       x,
       x_reactive = reactive(NULL),
       extract_type = character(0),
       slice
    -)

    +)
    +

    +
    -

    Arguments

    -

    x
    +

    Arguments +

    +

    + -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection. -For LogicalFilterState it's a !<varname> or <varname> and optionally is.na(<varname>)

    -

    Usage

    -

    LogicalFilterState$get_call(dataname)

    +For LogicalFilterState it's a !<varname> or <varname> and optionally is.na(<varname>)

    +
    +

    Usage +

    +

    +
    +
    LogicalFilterState$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    name of data set; defaults to private$get_dataname()

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    call

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    LogicalFilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    LogicalFilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -196,17 +279,19 @@

    Arguments

    + +
    + +
    - - + + diff --git a/v0.5.0-rc2/reference/MAEFilterStates.html b/v0.5.0-rc2/reference/MAEFilterStates.html index 64678d478..23832a8c6 100644 --- a/v0.5.0-rc2/reference/MAEFilterStates.html +++ b/v0.5.0-rc2/reference/MAEFilterStates.html @@ -1,8 +1,24 @@ - -FilterStates subclass for MultiAssayExperiments — MAEFilterStates • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,18 +107,25 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterStates -> MAEFilterStates

    -

    Methods

    +

    Methods +

    Inherited methods +
    +

    Inherited methods


    -

    Method new()

    -

    Initialize MAEFilterStates object.

    -

    Usage

    -

    MAEFilterStates$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize MAEFilterStates object.

    +
    +

    Usage +

    +

    +
    +
    MAEFilterStates$new(
       data,
       data_reactive = function(sid = "") NULL,
       dataname,
       datalabel = "subjects",
       keys = character(0)
    -)

    +)
    +

    +
    -

    Arguments

    -

    data
    +

    Arguments +

    +

    +
    +
    +
    data

    (MultiAssayExperiment) the R object which MultiAssayExperiment::subsetByColData function is applied on.

    @@ -155,23 +198,41 @@

    Arguments
    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    MAEFilterStates$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    MAEFilterStates$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -179,17 +240,19 @@

    Arguments

    + +

    + +
    - - + + diff --git a/v0.5.0-rc2/reference/MAEFilteredDataset.html b/v0.5.0-rc2/reference/MAEFilteredDataset.html index ba2897f7b..b36e7da31 100644 --- a/v0.5.0-rc2/reference/MAEFilteredDataset.html +++ b/v0.5.0-rc2/reference/MAEFilteredDataset.html @@ -1,10 +1,26 @@ - -MAEFilteredDataset R6 class — MAEFilteredDataset • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + +
    @@ -87,22 +110,29 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilteredDataset -> MAEFilteredDataset

    +

    Inherited methods


    -

    Method new()

    -

    Initialize MAEFilteredDataset object.

    -

    Usage

    -

    MAEFilteredDataset$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize MAEFilteredDataset object.

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$new(
       dataset,
       dataname,
       keys = character(0),
       label = character(0)
    -)

    +)
    +

    +
    -

    Arguments

    -

    dataset
    +

    Arguments +

    +

    +
    +
    +
    dataset

    (MulitiAssayExperiment) single MulitiAssayExperiment for which filters are rendered.

    @@ -149,102 +192,183 @@

    Arguments -

    Returns

    +

    Returns +

    Object of class MAEFilteredDataset, invisibly.

    -


    -

    Method set_filter_state()

    -

    Set filter state.

    -

    Usage

    -

    MAEFilteredDataset$set_filter_state(state)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Set filter state.

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$set_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method remove_filter_state()

    -

    Remove one or more FilterState of a MAEFilteredDataset.

    -

    Usage

    -

    MAEFilteredDataset$remove_filter_state(state)

    +
    +

    +
    +
    +

    Method remove_filter_state() +

    +

    Remove one or more FilterState of a MAEFilteredDataset.

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$remove_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices) specifying FilterState objects to remove; teal_slices may contain only dataname and varname, other elements are ignored.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method ui_add()

    -

    UI module to add filter variable for this dataset.

    -

    Usage

    -

    MAEFilteredDataset$ui_add(id)

    +
    +

    +
    +
    +

    Method ui_add() +

    +

    UI module to add filter variable for this dataset.

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$ui_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method get_filter_overview()

    -

    Creates row for filter overview in the form of
    dataname -- observations (remaining/total) -- subjects (remaining/total) - MAE

    -

    Usage

    -

    MAEFilteredDataset$get_filter_overview()

    +
    +

    +
    +
    +

    Method get_filter_overview() +

    +

    Creates row for filter overview in the form of
    dataname -- observations (remaining/total) -- subjects (remaining/total) - MAE

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$get_filter_overview()
    +

    +
    -

    Returns

    +

    Returns +

    A data.frame.

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    MAEFilteredDataset$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -252,17 +376,19 @@

    Arguments

    + +
    + +
    - - + + diff --git a/v0.5.0-rc2/reference/MatrixFilterStates.html b/v0.5.0-rc2/reference/MatrixFilterStates.html index 654cc0f0d..7a403e0e4 100644 --- a/v0.5.0-rc2/reference/MatrixFilterStates.html +++ b/v0.5.0-rc2/reference/MatrixFilterStates.html @@ -1,8 +1,24 @@ - -FilterStates subclass for matrices — MatrixFilterStates • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,18 +107,25 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterStates -> MatrixFilterStates

    -

    Methods

    +

    Methods +

    Inherited methods +
    +

    Inherited methods


    -

    Method new()

    -

    Initialize MatrixFilterStates object.

    -

    Usage

    -

    MatrixFilterStates$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize MatrixFilterStates object.

    +
    +

    Usage +

    +

    +
    +
    MatrixFilterStates$new(
       data,
       data_reactive = function(sid = "") NULL,
       dataname,
       datalabel = NULL
    -)

    +)
    +

    +
    -

    Arguments

    -

    data
    +

    Arguments +

    +

    +
    +
    +
    data

    (matrix) the R object which subset function is applied on.

    @@ -144,23 +187,41 @@

    Arguments
    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    MatrixFilterStates$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    MatrixFilterStates$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -168,17 +229,19 @@

    Arguments

    + +

    + +
    - - + + diff --git a/v0.5.0-rc2/reference/RangeFilterState.html b/v0.5.0-rc2/reference/RangeFilterState.html index 84417b101..e92d8f157 100644 --- a/v0.5.0-rc2/reference/RangeFilterState.html +++ b/v0.5.0-rc2/reference/RangeFilterState.html @@ -1,8 +1,24 @@ - -FilterState object for numeric data — RangeFilterState • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,41 +107,61 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterState -> RangeFilterState

    +

    Inherited methods


    -

    Method new()

    -

    Initialize a FilterState object for range selection.

    -

    Usage

    -

    RangeFilterState$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterState object for range selection.

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$new(
       x,
       x_reactive = reactive(NULL),
       extract_type = character(0),
       slice
    -)

    +)
    +

    +
    -

    Arguments

    -

    x
    +

    Arguments +

    +

    + -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection. For this class returned call looks like <varname> >= <min value> & <varname> <= <max value> with -optional is.na(<varname>) and is.finite(<varname>).

    -

    Usage

    -

    RangeFilterState$get_call(dataname)

    +optional is.na(<varname>) and is.finite(<varname>).

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    name of data set; defaults to private$get_dataname()

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    call

    -


    -

    Method get_keep_inf()

    -

    Returns current keep_inf selection.

    -

    Usage

    -

    RangeFilterState$get_keep_inf()

    +
    +

    +
    +
    +

    Method get_keep_inf() +

    +

    Returns current keep_inf selection.

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$get_keep_inf()
    +

    +
    -

    Returns

    +

    Returns +

    logical(1)

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    RangeFilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -211,17 +305,19 @@

    Arguments

    + +
    + +
    - - + + diff --git a/v0.5.0-rc2/reference/SEFilterStates.html b/v0.5.0-rc2/reference/SEFilterStates.html index a2b11853a..e61653439 100644 --- a/v0.5.0-rc2/reference/SEFilterStates.html +++ b/v0.5.0-rc2/reference/SEFilterStates.html @@ -1,8 +1,24 @@ - -FilterStates subclass for SummarizedExperiments — SEFilterStates • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,21 +107,28 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterStates -> SEFilterStates

    +

    Inherited methods


    -

    Method new()

    -

    Initialize SEFilterStates object.

    -

    Usage

    -

    SEFilterStates$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize SEFilterStates object.

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$new(
       data,
       data_reactive = function(sid = "") NULL,
       dataname,
       datalabel = NULL
    -)

    +)
    +

    +
    -

    Arguments

    -

    data
    +

    Arguments +

    +

    +
    +
    +
    data

    (SummarizedExperiment) the R object which subset function is applied on.

    @@ -144,92 +187,161 @@

    Arguments
    -

    Method set_filter_state()

    -

    Set filter state.

    -

    Usage

    -

    SEFilterStates$set_filter_state(state)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Set filter state.

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$set_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices) teal_slice objects should contain the field arg %in% c("subset", "select")

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method ui_add()

    -

    shiny UI module to add filter variable.

    -

    Usage

    -

    SEFilterStates$ui_add(id)

    +
    +

    +
    +
    +

    Method ui_add() +

    +

    shiny UI module to add filter variable.

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$ui_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_add()

    +
    +

    +
    +
    +

    Method srv_add() +

    shiny server module to add filter variable.

    Module controls available choices to select as a filter variable. Selected filter variable is being removed from available choices. Removed filter variable gets back to available choices. This module unlike other FilterStates classes manages two sets of filter variables - one for colData and another for -rowData.

    -

    Usage

    -

    SEFilterStates$srv_add(id)

    +rowData.

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$srv_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    SEFilterStates$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -237,17 +349,19 @@

    Arguments

    + +
    + +
    - - + + diff --git a/v0.5.0-rc2/reference/calls_combine_by.html b/v0.5.0-rc2/reference/calls_combine_by.html index 04f78264a..2b38f5c36 100644 --- a/v0.5.0-rc2/reference/calls_combine_by.html +++ b/v0.5.0-rc2/reference/calls_combine_by.html @@ -1,8 +1,24 @@ - -Compose predicates — calls_combine_by • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +

    @@ -83,13 +105,16 @@
    -

    Usage

    +

    Usage +

    calls_combine_by(calls, operator)
    -

    Arguments

    -
    calls
    +

    Arguments +

    +
    +
    calls

    (list) containing calls (or symbols) to be combined by operator

    @@ -98,31 +123,36 @@

    Arguments

    -

    + +
    -

    Value

    +

    Value +

    A call where elements of calls are composed with operator or NULL if calls is an empty list.

    -

    Details

    +

    Details +

    This function is used to combine logical predicates produced by FilterState objects to build a complete subset expression.

    + +
    + +
    - - + + diff --git a/v0.5.0-rc2/reference/check_simple_name.html b/v0.5.0-rc2/reference/check_simple_name.html index 543bb4323..52545144a 100644 --- a/v0.5.0-rc2/reference/check_simple_name.html +++ b/v0.5.0-rc2/reference/check_simple_name.html @@ -1,14 +1,30 @@ - - + + + + + +Test whether variable name can be used within Show R Code — check_simple_name • teal.slice +Test whether variable name can be used within Show R Code — check_simple_name • teal.slice + + + + + + + + + + Skip to contents @@ -24,7 +40,8 @@ + +
    @@ -92,35 +115,42 @@
    -

    Usage

    +

    Usage +

    check_simple_name(name)
    -

    Arguments

    -
    name
    +

    Arguments +

    +
    +
    name

    (character) vector of names to check

    -
    + +
    -

    Value

    +

    Value +

    Returns NULL or raises error.

    + +
    + +
    - - + + diff --git a/v0.5.0-rc2/reference/choices_labeled.html b/v0.5.0-rc2/reference/choices_labeled.html index 3220ee271..e08ed1496 100644 --- a/v0.5.0-rc2/reference/choices_labeled.html +++ b/v0.5.0-rc2/reference/choices_labeled.html @@ -1,10 +1,26 @@ - -Set "<choice>:<label>" type of names — choices_labeled • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + +
    @@ -86,13 +108,16 @@
    -

    Usage

    +

    Usage +

    choices_labeled(choices, labels, subset = NULL, types = NULL)
    -

    Arguments

    -
    choices
    +

    Arguments +

    +
    +
    choices

    (character or numeric or logical) vector

    @@ -110,31 +135,36 @@

    Arguments -

    Value

    +

    Value +

    A named character vector.

    -

    Details

    +

    Details +

    If either choices or labels are factors, they are coerced to character. Duplicated elements from choices get removed.

    + +
    + +
    - - + + diff --git a/v0.5.0-rc2/reference/coalesce_r.html b/v0.5.0-rc2/reference/coalesce_r.html index 49d48c6f1..cb4b53318 100644 --- a/v0.5.0-rc2/reference/coalesce_r.html +++ b/v0.5.0-rc2/reference/coalesce_r.html @@ -1,8 +1,24 @@ - -Recursively coalesce list elements. — coalesce_r • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,24 +105,30 @@
    -

    Usage

    +

    Usage +

    coalesce_r(x)
    -

    Arguments

    -
    x
    +

    Arguments +

    +
    +
    x

    (list), either of atomic vectors or of named lists

    -
    + +
    -

    Value

    +

    Value +

    Either an atomic vector of length 1 or a (potentially nested) list.

    -

    Details

    +

    Details +

    Given a list of atomic vectors, the first non-null element is returned. Given a list of lists, for all names found in all elements of the list the first non-null element of a given name is returned.

    @@ -108,17 +136,19 @@

    Details

    + +
    + +
    - - + + diff --git a/v0.5.0-rc2/reference/countBar.html b/v0.5.0-rc2/reference/countBar.html index 7dc7dad95..e04189e00 100644 --- a/v0.5.0-rc2/reference/countBar.html +++ b/v0.5.0-rc2/reference/countBar.html @@ -1,8 +1,24 @@ - -Progress bar with label — countBar • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,7 +105,8 @@
    -

    Usage

    +

    Usage +

    countBar(inputId, label, countmax, countnow = NULL, counttotal = countmax)
     
     updateCountBar(
    @@ -105,8 +128,10 @@ 

    Usage

    -

    Arguments

    -
    inputId
    +

    Arguments +

    +
    +
    inputId

    (character(1)) shiny id of the parent element (e.g. a check-box group input).

    @@ -129,32 +154,40 @@

    Arguments -

    Value

    +

    Value +

    shiny.tag object with a progress bar and a label.

    -

    Details

    -

    A progress bar is created to visualize the number of counts in a variable, with filling and a text label.

    • progress bar width is derived as a fraction of the container width: style = "width: <countmax> / <counttotal>%",

    • +

      Details +

      +

      A progress bar is created to visualize the number of counts in a variable, with filling and a text label.

      +
        +
      • progress bar width is derived as a fraction of the container width: style = "width: <countmax> / <counttotal>%",

      • progress bar is filled up to the fraction <countnow> / <countmax>,

      • text label is obtained by <label> (<countnow> / <countmax>).

      • -
    + +
    + +
    + +
    - - + + diff --git a/v0.5.0-rc2/reference/countBars.html b/v0.5.0-rc2/reference/countBars.html index faefd13f2..8a104a897 100644 --- a/v0.5.0-rc2/reference/countBars.html +++ b/v0.5.0-rc2/reference/countBars.html @@ -1,8 +1,24 @@ - -Progress bars with labels — countBars • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,7 +105,8 @@
    -

    Usage

    +

    Usage +

    countBars(inputId, choices, countsmax, countsnow = NULL)
     
     updateCountBars(
    @@ -96,8 +119,10 @@ 

    Usage

    -

    Arguments

    -
    inputId
    +

    Arguments +

    +
    +
    inputId

    (character(1)) shiny id of the parent element (e.g. a check-box group input).

    @@ -116,9 +141,11 @@

    Arguments -

    Value

    +

    Value +

    List of shiny.tags.

    @@ -138,17 +165,19 @@

    Value

    + +
    + + - - + + diff --git a/v0.5.0-rc2/reference/data_choices_labeled.html b/v0.5.0-rc2/reference/data_choices_labeled.html index 9511ff1ef..a20ee5569 100644 --- a/v0.5.0-rc2/reference/data_choices_labeled.html +++ b/v0.5.0-rc2/reference/data_choices_labeled.html @@ -1,8 +1,24 @@ - -Returns a choices_labeled object — data_choices_labeled • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -83,7 +105,8 @@
    -

    Usage

    +

    Usage +

    data_choices_labeled(
       data,
       choices,
    @@ -93,8 +116,10 @@ 

    Usage

    -

    Arguments

    -
    data
    +

    Arguments +

    +
    +
    data

    (data.frame or DFrame or list) where labels can be taken from in case when varlabels is not specified. data must be specified if varlabels is not specified.

    @@ -114,26 +139,30 @@

    Arguments -

    Value

    +

    Value +

    character(0) if choices are empty; a choices_labeled object otherwise

    + + + + - - + + diff --git a/v0.5.0-rc2/reference/eval_expr_with_msg.html b/v0.5.0-rc2/reference/eval_expr_with_msg.html index 9eb8a7747..8c4d64327 100644 --- a/v0.5.0-rc2/reference/eval_expr_with_msg.html +++ b/v0.5.0-rc2/reference/eval_expr_with_msg.html @@ -1,12 +1,28 @@ - - + + + + + +Evaluate expression with meaningful message — eval_expr_with_msg • teal.slice +Evaluate expression with meaningful message — eval_expr_with_msg • teal.slice + + + + + + + + + + Skip to contents @@ -22,7 +38,8 @@ + + @@ -89,39 +111,46 @@
    -

    Usage

    +

    Usage +

    eval_expr_with_msg(expr, env)
    -

    Arguments

    -
    expr
    +

    Arguments +

    +
    +
    expr

    (language)

    env

    (environment) where expression is evaluated.

    -
    + +
    -

    Value

    +

    Value +

    NULL, invisibly.

    + + + + - - + + diff --git a/v0.5.0-rc2/reference/fetch_bs_color.html b/v0.5.0-rc2/reference/fetch_bs_color.html index cbc70cd6c..a99a1f532 100644 --- a/v0.5.0-rc2/reference/fetch_bs_color.html +++ b/v0.5.0-rc2/reference/fetch_bs_color.html @@ -1,8 +1,24 @@ - -Get hex code of the current Bootstrap theme color. — fetch_bs_color • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -83,13 +105,16 @@
    -

    Usage

    +

    Usage +

    fetch_bs_color(color, alpha = NULL)
    -

    Arguments

    -
    color
    +

    Arguments +

    +
    +
    color

    (character(1)) naming one of the available theme colors

    @@ -98,26 +123,30 @@

    Arguments -

    Value

    +

    Value +

    Named character(1) containing a hexadecimal color representation.

    + + + + - - + + diff --git a/v0.5.0-rc2/reference/filter_state_api.html b/v0.5.0-rc2/reference/filter_state_api.html index e73435770..bc2220239 100644 --- a/v0.5.0-rc2/reference/filter_state_api.html +++ b/v0.5.0-rc2/reference/filter_state_api.html @@ -1,10 +1,26 @@ - -Managing FilteredData states — filter_state_api • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + @@ -86,7 +108,8 @@
    -

    Usage

    +

    Usage +

    set_filter_state(datasets, filter)
     
     get_filter_state(datasets)
    @@ -97,11 +120,15 @@ 

    Usage

    -

    Arguments

    -
    datasets
    -

    (FilteredData) +

    Arguments +

    +
    +
    datasets
    +
    +

    (FilteredData) object to store filter state and filtered datasets, shared across modules

    -

    see FilteredData for details

    +

    see FilteredData for details

    +
    filter
    @@ -113,22 +140,28 @@

    Arguments -

    Value

    +

    Value +

    -
    • set_*, remove_* and clear_filter_state return NULL invisibly

    • +
        +
      • set_*, remove_* and clear_filter_state return NULL invisibly

      • get_filter_state returns a named teal_slices object containing a teal_slice for every existing FilterState

      • -
    + +
    -

    See also

    +

    See also +

    -

    Examples

    +

    Examples +

    datasets <- init_filtered_data(list(iris = iris, mtcars = mtcars))
     fs <- teal_slices(
       teal_slice(dataname = "iris", varname = "Species", selected = c("setosa", "versicolor")),
    @@ -271,17 +304,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/v0.5.0-rc2/reference/format_time.html b/v0.5.0-rc2/reference/format_time.html index b96940d21..fd5dd846e 100644 --- a/v0.5.0-rc2/reference/format_time.html +++ b/v0.5.0-rc2/reference/format_time.html @@ -1,8 +1,24 @@ - -Format POSIXt for storage — format_time • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -83,40 +105,48 @@
    -

    Usage

    +

    Usage +

    format_time(x)
    -

    Arguments

    -
    x
    +

    Arguments +

    +
    +
    x

    (POSIXt) vector of date time values or anything else

    -
    + +
    -

    Value

    +

    Value +

    If x is of class POSIXt, a character vector, otherwise x itself.

    -

    Details

    +

    Details +

    Date times are stored as string representations expressed in the UTC time zone. The storage format is YYYY-MM-DD HH:MM:SS.

    + + + + - - + + diff --git a/v0.5.0-rc2/reference/get_default_slice_id.html b/v0.5.0-rc2/reference/get_default_slice_id.html index 0840dab33..c664a5c60 100644 --- a/v0.5.0-rc2/reference/get_default_slice_id.html +++ b/v0.5.0-rc2/reference/get_default_slice_id.html @@ -1,8 +1,24 @@ - -Default teal_slice id — get_default_slice_id • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -83,48 +105,59 @@
    -

    Usage

    +

    Usage +

    get_default_slice_id(x)
    -

    Arguments

    -
    x
    +

    Arguments +

    +
    +
    x

    (teal_slice or list)

    -
    + +
    -

    Value

    +

    Value +

    (character(1)) id for a teal_slice object.

    -

    Details

    +

    Details +

    Function returns a default id for a teal_slice object which needs to be distinct from other teal_slice objects created for any FilterStates object. Returned id can be treated as a location of -a vector on which FilterState is built:

    • for a data.frame id concatenates dataname and varname.

    • +a vector on which FilterState is built:

      +
        +
      • for a data.frame id concatenates dataname and varname.

      • for a MultiAssayExperiment id concatenates dataname, varname, experiment and arg, so that one can add teal_slice for a varname which exists in multiple SummarizedExperiments or exists in both colData and rowData of given experiment. For such a vector teal.slice doesn't allow to activate more than one filters. In case of teal_slice_expr id is mandatory and must be unique.

      • -
    + + + + + + - - + + diff --git a/v0.5.0-rc2/reference/get_filter_expr.html b/v0.5.0-rc2/reference/get_filter_expr.html index f7e6c9e7f..cdc96cf95 100644 --- a/v0.5.0-rc2/reference/get_filter_expr.html +++ b/v0.5.0-rc2/reference/get_filter_expr.html @@ -1,10 +1,26 @@ - -Gets filter expression for multiple datanames taking into account its order. — get_filter_expr • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + @@ -86,39 +108,46 @@
    -

    Usage

    +

    Usage +

    get_filter_expr(datasets, datanames = datasets$datanames())
    -

    Arguments

    -
    datasets
    +

    Arguments +

    +
    +
    datasets

    (FilteredData)

    datanames

    (character) vector of dataset names

    -
    + +
    -

    Value

    +

    Value +

    A character string containing all subset expressions.

    + + + + - - + + diff --git a/v0.5.0-rc2/reference/get_supported_filter_varnames.html b/v0.5.0-rc2/reference/get_supported_filter_varnames.html index b37785289..21878e0b9 100644 --- a/v0.5.0-rc2/reference/get_supported_filter_varnames.html +++ b/v0.5.0-rc2/reference/get_supported_filter_varnames.html @@ -1,10 +1,26 @@ - -Gets supported filterable variable names — get_supported_filter_varnames • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + @@ -86,35 +108,42 @@
    -

    Usage

    +

    Usage +

    get_supported_filter_varnames(data)
    -

    Arguments

    -
    data
    +

    Arguments +

    +
    +
    data

    the R object containing elements which class can be checked through vapply or apply.

    -
    + +
    -

    Value

    +

    Value +

    character vector of variable names.

    + + + + - - + + diff --git a/v0.5.0-rc2/reference/include_css_files.html b/v0.5.0-rc2/reference/include_css_files.html index 1d48a7d3e..34cfcca3a 100644 --- a/v0.5.0-rc2/reference/include_css_files.html +++ b/v0.5.0-rc2/reference/include_css_files.html @@ -1,12 +1,28 @@ - - + + + + + +Include CSS files from /inst/css/ package directory to application header — include_css_files • teal.slice +Include CSS files from /inst/css/ package directory to application header — include_css_files • teal.slice + + + + + + + + + + Skip to contents @@ -22,7 +38,8 @@ + + @@ -89,35 +111,42 @@
    -

    Usage

    +

    Usage +

    include_css_files(pattern = "*")
    -

    Arguments

    -
    pattern
    +

    Arguments +

    +
    +
    pattern

    (character) pattern of files to be included

    -
    + +
    -

    Value

    +

    Value +

    HTML code that includes CSS files

    + + + + - - + + diff --git a/v0.5.0-rc2/reference/include_js_files.html b/v0.5.0-rc2/reference/include_js_files.html index f5fbe5af6..bfeecf723 100644 --- a/v0.5.0-rc2/reference/include_js_files.html +++ b/v0.5.0-rc2/reference/include_js_files.html @@ -1,12 +1,28 @@ - - + + + + + +Include JS files from /inst/js/ package directory to application header — include_js_files • teal.slice +Include JS files from /inst/js/ package directory to application header — include_js_files • teal.slice + + + + + + + + + + Skip to contents @@ -22,7 +38,8 @@ + + @@ -89,35 +111,42 @@
    -

    Usage

    +

    Usage +

    include_js_files(pattern)
    -

    Arguments

    -
    pattern
    +

    Arguments +

    +
    +
    pattern

    (character) pattern of files to be included, passed to system.file

    -
    + +
    -

    Value

    +

    Value +

    HTML code that includes JS files

    + + + + - - + + diff --git a/v0.5.0-rc2/reference/index.html b/v0.5.0-rc2/reference/index.html index fbd686bb5..cbc44491b 100644 --- a/v0.5.0-rc2/reference/index.html +++ b/v0.5.0-rc2/reference/index.html @@ -1,8 +1,22 @@ - -Function reference • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -77,96 +97,132 @@
    -

    teal filter-panel API

    +

    +teal filter-panel API +

    -

    Functions used initialize filter-panel and to modify its states.

    +

    +

    Functions used initialize filter-panel and to modify its states.

    -
    +
    +
    -
    +
    +
    init_filtered_data()
    -
    Initialize FilteredData
    -
    +
    Initialize FilteredData +
    +
    +
    +
    set_filter_state() get_filter_state() remove_filter_state() clear_filter_states()
    Managing FilteredData states
    -
    +
    +
    +
    get_filter_expr()
    Gets filter expression for multiple datanames taking into account its order.
    -
    +
    +
    +
    teal_slice() is.teal_slice() as.teal_slice() as.list(<teal_slice>) format(<teal_slice>) print(<teal_slice>)
    Specify single filter
    -
    +
    +
    +
    teal_slices() is.teal_slices() as.teal_slices() as.list(<teal_slices>) `[`(<teal_slices>) c(<teal_slices>) format(<teal_slices>) print(<teal_slices>)
    Complete filter specification
    -
    -

    For developers

    + +
    +
    +

    For developers +

    -

    Abstract and concrete classes used to build teal functionality.

    +

    +

    Abstract and concrete classes used to build teal functionality.

    -
    +
    +
    -

    R6 Classes

    -

    Abstract and concrete classes used to build teal functionality.

    +

    R6 Classes +

    +

    +

    Abstract and concrete classes used to build teal functionality.

    -
    +
    +
    -
    +
    +
    FilteredData
    Class to encapsulate filtered datasets
    -
    +
    +
    +
    FilteredDataset
    -
    FilteredDataset R6 class
    -
    +
    +FilteredDataset R6 class
    +
    +
    +
    FilterPanelAPI
    Class to encapsulate the API of the filter panel of a teal app
    -
    +
    +
    +
    DataframeFilteredDataset
    The DataframeFilteredDataset R6 class
    -
    +
    +
    +
    MAEFilteredDataset
    -
    MAEFilteredDataset R6 class
    -
    +
    +MAEFilteredDataset R6 class
    + + + + + + - - + + diff --git a/v0.5.0-rc2/reference/init_filter_state.html b/v0.5.0-rc2/reference/init_filter_state.html index deacfafab..dc4591a09 100644 --- a/v0.5.0-rc2/reference/init_filter_state.html +++ b/v0.5.0-rc2/reference/init_filter_state.html @@ -1,8 +1,24 @@ - -Initialize FilterState — init_filter_state • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,7 +106,8 @@
    -

    Usage

    +

    Usage +

    init_filter_state(
       x,
       x_reactive = reactive(NULL),
    @@ -93,8 +117,10 @@ 

    Usage

    + +
    -

    Value

    +

    Value +

    FilterState object

    + + + + - - + + diff --git a/v0.5.0-rc2/reference/init_filter_state_expr.html b/v0.5.0-rc2/reference/init_filter_state_expr.html index 9d95c8d3c..225f77fe5 100644 --- a/v0.5.0-rc2/reference/init_filter_state_expr.html +++ b/v0.5.0-rc2/reference/init_filter_state_expr.html @@ -1,8 +1,24 @@ - -Initialize a FilterStateExpr object — init_filter_state_expr • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -83,36 +105,43 @@
    -

    Usage

    +

    Usage +

    init_filter_state_expr(slice)
    -

    Arguments

    -
    slice
    +

    Arguments +

    +
    +
    slice

    (teal_slice_expr) specifying this filter state.

    -
    + +
    -

    Value

    +

    Value +

    FilterStateExpr object

    + + + + - - + + diff --git a/v0.5.0-rc2/reference/init_filter_states.html b/v0.5.0-rc2/reference/init_filter_states.html index 4ff677fb7..4249e9afe 100644 --- a/v0.5.0-rc2/reference/init_filter_states.html +++ b/v0.5.0-rc2/reference/init_filter_states.html @@ -1,8 +1,24 @@ - -Initialize FilterStates object — init_filter_states • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -83,7 +105,8 @@
    -

    Usage

    +

    Usage +

    init_filter_states(
       data,
       data_reactive = reactive(NULL),
    @@ -94,8 +117,10 @@ 

    Usage

    -

    Arguments

    -
    data
    +

    Arguments +

    +
    +
    data

    (data.frame or MultiAssayExperiment or SummarizedExperiment or matrix) object to subset.

    @@ -123,26 +148,30 @@

    Arguments -

    Value

    +

    Value +

    Object of class FilterStates.

    + + + + - - + + diff --git a/v0.5.0-rc2/reference/init_filtered_data.html b/v0.5.0-rc2/reference/init_filtered_data.html index c32b9e4f7..0b38144ca 100644 --- a/v0.5.0-rc2/reference/init_filtered_data.html +++ b/v0.5.0-rc2/reference/init_filtered_data.html @@ -1,8 +1,24 @@ - -Initialize FilteredData — init_filtered_data • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,13 +106,16 @@
    -

    Usage

    +

    Usage +

    init_filtered_data(x, join_keys = teal.data::join_keys(), code, check)
    -

    Arguments

    -
    x
    +

    Arguments +

    +
    +
    x

    (named list) of datasets.

    @@ -104,16 +130,19 @@

    Arguments[Deprecated]

    -

    + +
    -

    Value

    +

    Value +

    Object of class FilteredData.

    -

    Examples

    +

    Examples +

    datasets <- init_filtered_data(list(iris = iris, mtcars = mtcars))
     datasets
     #> FilteredData:
    @@ -132,17 +161,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/v0.5.0-rc2/reference/init_filtered_dataset.html b/v0.5.0-rc2/reference/init_filtered_dataset.html index bde6280d3..d945f4a98 100644 --- a/v0.5.0-rc2/reference/init_filtered_dataset.html +++ b/v0.5.0-rc2/reference/init_filtered_dataset.html @@ -1,8 +1,24 @@ - -Initialize FilteredDataset — init_filtered_dataset • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,7 +106,8 @@
    -

    Usage

    +

    Usage +

    init_filtered_dataset(
       dataset,
       dataname,
    @@ -96,8 +120,10 @@ 

    Usage

    -

    Arguments

    -
    dataset
    +

    Arguments +

    +
    +
    dataset

    any object

    @@ -133,15 +159,18 @@

    Arguments -

    Value

    +

    Value +

    Object of class FilteredDataset.

    -

    Warning

    +

    Warning +

    This function is exported to allow other packages to extend teal.slice but it is treated as internal. @@ -150,7 +179,8 @@

    Warning
    -

    Examples

    +

    Examples +

    # DataframeFilteredDataset example
     library(shiny)
     
    @@ -206,17 +236,19 @@ 

    Examples

    + +

    + +
    - - + + diff --git a/v0.5.0-rc2/reference/jsonify.html b/v0.5.0-rc2/reference/jsonify.html index aca0d6688..bd058b5b0 100644 --- a/v0.5.0-rc2/reference/jsonify.html +++ b/v0.5.0-rc2/reference/jsonify.html @@ -1,12 +1,28 @@ - - + + + + + +Convert a list to a justified JSON string — jsonify • teal.slice +Convert a list to a justified JSON string — jsonify • teal.slice + + + + + + + + + + Skip to contents @@ -22,7 +38,8 @@ + +
    @@ -89,39 +111,46 @@
    -

    Usage

    +

    Usage +

    jsonify(x, trim_lines)
    -

    Arguments

    -
    x
    +

    Arguments +

    +
    +
    x

    (list), possibly recursive, obtained from teal_slice or teal_slices.

    trim_lines

    (logical(1)) flag specifying whether to trim lines of the JSON string.

    -
    + +
    -

    Value

    +

    Value +

    A JSON string representation of the input list.

    + + + + - - + + diff --git a/v0.5.0-rc2/reference/justify_json.html b/v0.5.0-rc2/reference/justify_json.html index 838273ae8..741f68f0f 100644 --- a/v0.5.0-rc2/reference/justify_json.html +++ b/v0.5.0-rc2/reference/justify_json.html @@ -1,10 +1,26 @@ - -Justify colons in JSON string — justify_json • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + @@ -86,35 +108,42 @@
    -

    Usage

    +

    Usage +

    justify_json(json)
    -

    Arguments

    -
    json
    +

    Arguments +

    +
    +
    json

    (character(1)) a JSON string.

    -
    + +
    -

    Value

    +

    Value +

    A list of character strings, which can be collapsed into a JSON string.

    + + + + - - + + diff --git a/v0.5.0-rc2/reference/make_c_call.html b/v0.5.0-rc2/reference/make_c_call.html index 6dfb405f5..633820b4d 100644 --- a/v0.5.0-rc2/reference/make_c_call.html +++ b/v0.5.0-rc2/reference/make_c_call.html @@ -1,10 +1,26 @@ - -Build concatenating call — make_c_call • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + @@ -86,35 +108,42 @@
    -

    Usage

    +

    Usage +

    make_c_call(choices)
    -

    Arguments

    -
    choices
    +

    Arguments +

    +
    +
    choices

    A vector of values.

    -
    + +
    -

    Value

    +

    Value +

    A c call.

    + + + + - - + + diff --git a/v0.5.0-rc2/reference/make_count_text.html b/v0.5.0-rc2/reference/make_count_text.html index e51908757..4c519caf8 100644 --- a/v0.5.0-rc2/reference/make_count_text.html +++ b/v0.5.0-rc2/reference/make_count_text.html @@ -1,16 +1,32 @@ - - + + + + + +Build count text — make_count_text • teal.slice +Build count text — make_count_text • teal.slice + + + + + + + + + + Skip to contents @@ -26,7 +42,8 @@ + + @@ -87,18 +109,24 @@
    -

    Returns a text label describing filtered counts. The text is composed in the following way:

    • when countnow is not NULL: <label> (<countnow>/<countmax>)

    • +

      Returns a text label describing filtered counts. The text is composed in the following way:

      +
        +
      • when countnow is not NULL: <label> (<countnow>/<countmax>)

      • when countnow is NULL: <label> (<countmax>)

      • -
    + +
    -

    Usage

    +

    Usage +

    make_count_text(label, countmax, countnow = NULL)
    -

    Arguments

    -
    label
    +

    Arguments +

    +
    +
    label

    (character(1)) Text displayed before counts.

    @@ -109,26 +137,30 @@

    Arguments -

    Value

    +

    Value +

    A character string.

    + + + + - - + + diff --git a/v0.5.0-rc2/reference/setdiff_teal_slices.html b/v0.5.0-rc2/reference/setdiff_teal_slices.html index 340f2351e..2827e98ea 100644 --- a/v0.5.0-rc2/reference/setdiff_teal_slices.html +++ b/v0.5.0-rc2/reference/setdiff_teal_slices.html @@ -1,8 +1,24 @@ - -setdiff method for teal_slices — setdiff_teal_slices • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,18 +107,23 @@
    -

    Usage

    +

    Usage +

    setdiff_teal_slices(x, y)
    -

    Arguments

    -
    x, y
    +

    Arguments +

    +
    +
    x, y

    (teal_slices)

    -
    + +
    -

    Value

    +

    Value +

    teal_slices

    @@ -103,17 +132,19 @@

    Value

    + + + + - - + + diff --git a/v0.5.0-rc2/reference/teal.slice-package.html b/v0.5.0-rc2/reference/teal.slice-package.html index 392c7051c..9e15949db 100644 --- a/v0.5.0-rc2/reference/teal.slice-package.html +++ b/v0.5.0-rc2/reference/teal.slice-package.html @@ -1,8 +1,24 @@ - -teal.slice: Interactive Exploration of Clinical Trials Data — teal.slice-package • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,16 +107,24 @@
    -

    Author

    +

    Author +

    Maintainer: Dawid Kaledkowski dawid.kaledkowski@roche.com

    -

    Authors:

    + +
    + + + + - - + + diff --git a/v0.5.0-rc2/reference/teal_slice.html b/v0.5.0-rc2/reference/teal_slice.html index 79b47c258..a5b0bc665 100644 --- a/v0.5.0-rc2/reference/teal_slice.html +++ b/v0.5.0-rc2/reference/teal_slice.html @@ -1,8 +1,24 @@ - -Specify single filter — teal_slice • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -83,7 +105,8 @@
    -

    Usage

    +

    Usage +

    teal_slice(
       dataname,
       varname,
    @@ -115,8 +138,10 @@ 

    Usage

    -

    Arguments

    -
    dataname
    +

    Arguments +

    +
    +
    dataname

    (character(1)) name of data set

    @@ -189,16 +214,19 @@

    Arguments -

    Value

    +

    Value +

    A teal.slice object. Depending on whether varname or expr was specified, the resulting teal_slice also receives class teal_slice_var or teal_slice_expr, respectively.

    -

    Details

    +

    Details +

    teal_slice object fully describes filter state and can be used to create, modify, and delete a filter state. A teal_slice contains a number of common fields (all named arguments of teal_slice), some of which are mandatory, but only @@ -207,7 +235,9 @@

    DetailsSetting any of the other values to NULL means that those properties will not be modified (when setting an existing state) or that they will be determined by data (when creating new a new one). Entire object is FilterState class member and can be accessed with FilterState$get_state().

    -

    A teal_slice can come in two flavors:

    1. teal_slice_var - +

      A teal_slice can come in two flavors:

      +
        +
      1. teal_slice_var - this describes a typical interactive filter that refers to a single variable, managed by the FilterState class. This class is created when varname is specified. The object retains all fields specified in the call. id can be created by default and need not be specified.

      2. @@ -217,7 +247,8 @@

        Detailsexpr is specified. dataname and anchored are retained, fixed is set to TRUE, id becomes mandatory, title remains optional, while other arguments are disregarded.

        -

      A teal_slice can be passed FilterState/FilterStateExpr constructors to instantiate an object. +

    +

    A teal_slice can be passed FilterState/FilterStateExpr constructors to instantiate an object. It can also be passed to FilterState$set_state to modify the state. However, once a FilterState is created, only the mutable features can be set with a teal_slice: selected, keep_na and keep_inf.

    @@ -229,11 +260,13 @@

    DetailsFilterState instantiated with anchored = TRUE cannot be removed.

    -

    Note

    +

    Note +

    Date time objects of POSIX*t classes are printed as strings after converting to UTC timezone.

    -

    Filters in SumarizedExperiment and MultiAssayExperiment objects

    +

    Filters in SumarizedExperiment and MultiAssayExperiment objects +

    @@ -247,12 +280,14 @@

    Filters in order to determine whether the filter refers to the SE's rowData or colData.

    -

    See also

    +

    See also +

    -

    Examples

    +

    Examples +

    x1 <- teal_slice(
       dataname = "data",
       id = "Female adults",
    @@ -329,17 +364,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/v0.5.0-rc2/reference/teal_slices.html b/v0.5.0-rc2/reference/teal_slices.html index 64b019bd1..da2868008 100644 --- a/v0.5.0-rc2/reference/teal_slices.html +++ b/v0.5.0-rc2/reference/teal_slices.html @@ -1,8 +1,24 @@ - -Complete filter specification — teal_slices • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -83,7 +105,8 @@
    -

    Usage

    +

    Usage +

    teal_slices(
       ...,
       exclude_varnames = NULL,
    @@ -113,8 +136,10 @@ 

    Usage

    -

    Arguments

    -
    ...
    +

    Arguments +

    +
    +
    ...

    any number of teal_slice objects. For print and format, additional arguments passed to other functions.

    @@ -126,15 +151,19 @@

    Arguments[Experimental] +
    +

    [Experimental] This is a new feature. Do kindly share your opinions on teal.slice's GitHub repository.

    (character(1)) string specifying how observations are tallied by these filter states. -Possible options:

    • "none" (default) to have counts of single FilterState to show unfiltered number only.

    • +Possible options:

      +
        +
      • "none" (default) to have counts of single FilterState to show unfiltered number only.

      • "all" to have counts of single FilterState to show number of observation in filtered and unfiltered dataset. Note, that issues were reported when using this option with MultiAssayExperiment. Please make sure that adding new filters doesn't fail on target platform before deploying for production.

      • -
    + +
    allow_add
    @@ -160,15 +189,18 @@

    Arguments -

    Value

    +

    Value +

    teal_slices, which is an unnamed list of teal_slice objects.

    -

    Details

    +

    Details +

    teal_slices() collates multiple teal_slice objects into a teal_slices object, a complete filter specification. This is used by all classes above FilterState as well as filter_panel_api wrapper functions. @@ -179,15 +211,19 @@

    Detailsteal_slices.

    -

    See also

    +

    See also +

    -
    • teal_slice for creating constituent elements of teal_slices

    • +
        +
      • teal_slice for creating constituent elements of teal_slices

      • teal::slices_store for robust utilities for saving and loading teal_slices in JSON format

      • -
    + +
    -

    Examples

    +

    Examples +

    filter_1 <- teal_slice(
       dataname = "dataname1",
       varname = "varname1",
    @@ -400,17 +436,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/v0.5.0-rc2/reference/to_json.html b/v0.5.0-rc2/reference/to_json.html index 11bb53bc6..39ea30858 100644 --- a/v0.5.0-rc2/reference/to_json.html +++ b/v0.5.0-rc2/reference/to_json.html @@ -1,12 +1,28 @@ - - + + + + + +Converts a list to a JSON string — to_json • teal.slice +Converts a list to a JSON string — to_json • teal.slice + + + + + + + + + + Skip to contents @@ -22,7 +38,8 @@ + + @@ -89,35 +111,42 @@
    -

    Usage

    +

    Usage +

    to_json(x)
    -

    Arguments

    -
    x
    +

    Arguments +

    +
    +
    x

    (list) representation of teal_slices object.

    -
    + +
    -

    Value

    +

    Value +

    A JSON string.

    + + + + - - + + diff --git a/v0.5.0-rc2/reference/toggle_button.html b/v0.5.0-rc2/reference/toggle_button.html index 88c09926f..0ee8e20e8 100644 --- a/v0.5.0-rc2/reference/toggle_button.html +++ b/v0.5.0-rc2/reference/toggle_button.html @@ -1,8 +1,24 @@ - -Toggle button properties. — toggle_button • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -83,15 +105,18 @@
    -

    Usage

    +

    Usage +

    toggle_icon(input_id, icons, one_way = FALSE)
     
     toggle_title(input_id, titles, one_way = FALSE)
    -

    Arguments

    -
    input_id
    +

    Arguments +

    +
    +
    input_id

    (character(1)) (name-spaced) id of the button

    @@ -104,15 +129,18 @@

    Arguments -

    Value

    +

    Value +

    NULL, invisibly.

    -

    Details

    +

    Details +

    Wrapper functions that use shinyjs::runjs to change button properties in response to events, typically clicking those very buttons. shiny's actionButton and actionLink create <a> tags, @@ -123,17 +151,19 @@

    Details

    + + + + - - + + diff --git a/v0.5.0-rc2/reference/topological_sort.html b/v0.5.0-rc2/reference/topological_sort.html index e61fb14fb..ce100fc2a 100644 --- a/v0.5.0-rc2/reference/topological_sort.html +++ b/v0.5.0-rc2/reference/topological_sort.html @@ -1,10 +1,26 @@ - -Topological graph sort — topological_sort • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + @@ -86,33 +108,40 @@
    -

    Usage

    +

    Usage +

    topological_sort(graph)
    -

    Arguments

    -
    graph
    +

    Arguments +

    +
    +
    graph

    (named list) with node vector elements

    -
    + +
    -

    Details

    +

    Details +

    Implementation of Kahn algorithm with a modification to maintain the order of input elements.

    + + + + - - + + diff --git a/v0.5.0-rc2/reference/trim_lines_json.html b/v0.5.0-rc2/reference/trim_lines_json.html index 9acaec54a..8ae3d6627 100644 --- a/v0.5.0-rc2/reference/trim_lines_json.html +++ b/v0.5.0-rc2/reference/trim_lines_json.html @@ -1,10 +1,26 @@ - -Trim lines in JSON string — trim_lines_json • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + @@ -86,35 +108,42 @@
    -

    Usage

    +

    Usage +

    trim_lines_json(x)
    -

    Arguments

    -
    x
    +

    Arguments +

    +
    +
    x

    (character)

    -
    + +
    -

    Value

    +

    Value +

    A character string trimmed after a certain hard-coded number of characters in the value portion.

    + + + + - - + + diff --git a/v0.5.0-rc2/reference/variable_types.html b/v0.5.0-rc2/reference/variable_types.html index 8f57f03b2..34138b184 100644 --- a/v0.5.0-rc2/reference/variable_types.html +++ b/v0.5.0-rc2/reference/variable_types.html @@ -1,8 +1,24 @@ - -Get classes of selected columns from dataset — variable_types • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -83,13 +105,16 @@
    -

    Usage

    +

    Usage +

    variable_types(data, columns = NULL)
    -

    Arguments

    -
    data
    +

    Arguments +

    +
    +
    data

    (data.frame or DataFrame or matrix) Object in which to determine variable types.

    @@ -97,26 +122,30 @@

    Arguments -

    Value

    +

    Value +

    Character vector of classes of columns from provided data.

    + + + + - - + + diff --git a/v0.5.0/404.html b/v0.5.0/404.html index dc08a432f..fcdbaecd5 100644 --- a/v0.5.0/404.html +++ b/v0.5.0/404.html @@ -1,5 +1,4 @@ - - + @@ -50,22 +49,7 @@ - - + - + + diff --git a/v0.5.0/CODE_OF_CONDUCT.html b/v0.5.0/CODE_OF_CONDUCT.html index 48b600d38..708fe1e78 100644 --- a/v0.5.0/CODE_OF_CONDUCT.html +++ b/v0.5.0/CODE_OF_CONDUCT.html @@ -1,8 +1,22 @@ - -Contributor Covenant Code of Conduct • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -80,65 +100,80 @@
    -

    Our Pledge

    +

    Our Pledge +

    We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.

    We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.

    -

    Our Standards

    +

    Our Standards +

    Examples of behavior that contributes to a positive environment for our community include:

    -
    • Demonstrating empathy and kindness toward other people
    • +
        +
      • Demonstrating empathy and kindness toward other people
      • Being respectful of differing opinions, viewpoints, and experiences
      • Giving and gracefully accepting constructive feedback
      • Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
      • Focusing on what is best not just for us as individuals, but for the overall community
      • -

      Examples of unacceptable behavior include:

      -
      • The use of sexualized language or imagery, and sexual attention or advances of any kind
      • +
      +

      Examples of unacceptable behavior include:

      +
        +
      • The use of sexualized language or imagery, and sexual attention or advances of any kind
      • Trolling, insulting or derogatory comments, and personal or political attacks
      • Public or private harassment
      • Publishing others’ private information, such as a physical or email address, without their explicit permission
      • Other conduct which could reasonably be considered inappropriate in a professional setting
      • -
    + +
    -

    Enforcement Responsibilities

    +

    Enforcement Responsibilities +

    Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.

    Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.

    -

    Scope

    +

    Scope +

    This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.

    -

    Enforcement

    +

    Enforcement +

    Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [INSERT CONTACT METHOD]. All complaints will be reviewed and investigated promptly and fairly.

    All community leaders are obligated to respect the privacy and security of the reporter of any incident.

    -

    Enforcement Guidelines

    +

    Enforcement Guidelines +

    Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:

    -

    1. Correction

    +

    1. Correction +

    Community Impact: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.

    Consequence: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.

    -

    2. Warning

    +

    2. Warning +

    Community Impact: A violation through a single incident or series of actions.

    Consequence: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.

    -

    3. Temporary Ban

    +

    3. Temporary Ban +

    Community Impact: A serious violation of community standards, including sustained inappropriate behavior.

    Consequence: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.

    -

    4. Permanent Ban

    +

    4. Permanent Ban +

    Community Impact: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.

    Consequence: A permanent ban from any sort of public interaction within the community.

    -

    Attribution

    +

    Attribution +

    This Code of Conduct is adapted from the Contributor Covenant, version 2.1, available at https://www.contributor-covenant.org/version/2/1/code_of_conduct.html.

    Community Impact Guidelines were inspired by Mozilla’s code of conduct enforcement ladder.

    For answers to common questions about this code of conduct, see the FAQ at https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.

    @@ -146,17 +181,19 @@

    Attribution

    + + + + - - + + diff --git a/v0.5.0/CONTRIBUTING.html b/v0.5.0/CONTRIBUTING.html index d45c1dd7e..88ea8a9c8 100644 --- a/v0.5.0/CONTRIBUTING.html +++ b/v0.5.0/CONTRIBUTING.html @@ -1,8 +1,22 @@ - -Contribution Guidelines • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -82,7 +102,8 @@

    🙏 Thank you for taking the time to contribute!

    Your input is deeply valued, whether an issue, a pull request, or even feedback, regardless of size, content or scope.

    -

    Table of contents

    +

    Table of contents +

    👶 Getting started

    📔 Code of Conduct

    🗃 License

    @@ -93,38 +114,47 @@

    Table of contents❓ Questions

    -

    Getting started

    +

    Getting started +

    Please refer the project documentation for a brief introduction. Please also see other articles within the project documentation for additional information.

    -

    Code of Conduct

    +

    Code of Conduct +

    A Code of Conduct governs this project. Participants and contributors are expected to follow the rules outlined therein.

    -

    License

    +

    License +

    All your contributions will be covered by this project’s license.

    -

    Issues

    +

    Issues +

    We use GitHub to track issues, feature requests, and bugs. Before submitting a new issue, please check if the issue has already been reported. If the issue already exists, please upvote the existing issue 👍.

    For new feature requests, please elaborate on the context and the benefit the feature will have for users, developers, or other relevant personas.

    -

    Pull requests

    +

    Pull requests +

    -

    GitHub Flow

    +

    GitHub Flow +

    This repository uses the GitHub Flow model for collaboration. To submit a pull request:

    -
    1. +
        +
      1. Create a branch

        Please see the branch naming convention below. If you don’t have write access to this repository, please fork it.

      2. Make changes

        Make sure your code

        -
        • passes all checks imposed by GitHub Actions
        • +
            +
          • passes all checks imposed by GitHub Actions
          • is well documented
          • is well tested with unit tests sufficiently covering the changes introduced
          • -
          +
        +
      3. Create a pull request (PR)

        In the pull request description, please link the relevant issue (if any), provide a detailed description of the change, and include any assumptions.

        @@ -138,76 +168,93 @@

        GitHub Flow -

        Branch naming convention

        +

        Branch naming convention +

        Suppose your changes are related to a current issue in the current project; please name your branch as follows: <issue_id>_<short_description>. Please use underscore (_) as a delimiter for word separation. For example, 420_fix_ui_bug would be a suitable branch name if your change is resolving and UI-related bug reported in issue number 420 in the current project.

        If your change affects multiple repositories, please name your branches as follows: <issue_id>_<issue_repo>_<short description>. For example, 69_awesomeproject_fix_spelling_error would reference issue 69 reported in project awesomeproject and aims to resolve one or more spelling errors in multiple (likely related) repositories.

    monorepo and staged.dependencies -

    + +

    Sometimes you might need to change upstream dependent package(s) to be able to submit a meaningful change. We are using staged.dependencies functionality to simulate a monorepo behavior. The dependency configuration is already specified in this project’s staged_dependencies.yaml file. You need to name the feature branches appropriately. This is the only exception from the branch naming convention described above.

    Please refer to the staged.dependencies package documentation for more details.

    -

    Coding guidelines

    +

    Coding guidelines +

    This repository follows some unified processes and standards adopted by its maintainers to ensure software development is carried out consistently within teams and cohesively across other repositories.

    -

    Style guide

    +

    Style guide +

    This repository follows the standard tidyverse style guide and uses lintr for lint checks. Customized lint configurations are available in this repository’s .lintr file.

    -

    Dependency management

    +

    Dependency management +

    Lightweight is the right weight. This repository follows tinyverse recommendations of limiting dependencies to minimum.

    -

    Dependency version management

    +

    Dependency version management +

    If the code is not compatible with all (!) historical versions of a given dependency package, it is required to specify minimal version in the DESCRIPTION file. In particular: if the development version requires (imports) the development version of another package - it is required to put abc (>= 1.2.3.9000).

    - +
    -

    R & package versions

    +

    R & package versions +

    We continuously test our packages against the newest R version along with the most recent dependencies from CRAN and BioConductor. We recommend that your working environment is also set up in the same way. You can find the details about the R version and packages used in the R CMD check GitHub Action execution log - there is a step that prints out the R sessionInfo().

    If you discover bugs on older R versions or with an older set of dependencies, please create the relevant bug reports.

    -

    pre-commit

    +

    +pre-commit +

    We highly recommend that you use the pre-commit tool combined with R hooks for pre-commit to execute some of the checks before committing and pushing your changes.

    Pre-commit hooks are already available in this repository’s .pre-commit-config.yaml file.

    -

    Recognition model

    +

    Recognition model +

    As mentioned previously, all contributions are deeply valued and appreciated. While all contribution data is available as part of the repository insights, to recognize a significant contribution and hence add the contributor to the package authors list, the following rules are enforced:

    -
    • Minimum 5% of lines of code authored* (determined by git blame query) OR
    • +
        +
      • Minimum 5% of lines of code authored* (determined by git blame query) OR
      • Being at the top 5 contributors in terms of number of commits OR lines added OR lines removed*
      • -

      *Excluding auto-generated code, including but not limited to roxygen comments or renv.lock files.

      +
    +

    *Excluding auto-generated code, including but not limited to roxygen comments or renv.lock files.

    The package maintainer also reserves the right to adjust the criteria to recognize contributions.

    -

    Questions

    +

    Questions +

    If you have further questions regarding the contribution guidelines, please contact the package/repository maintainer.

    + + + + - - + + diff --git a/v0.5.0/LICENSE-text.html b/v0.5.0/LICENSE-text.html index 7e1cddc69..fddd23a9d 100644 --- a/v0.5.0/LICENSE-text.html +++ b/v0.5.0/LICENSE-text.html @@ -1,8 +1,22 @@ - -License • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -92,17 +112,19 @@ limitations under the License. - + + + + - - + + diff --git a/v0.5.0/SECURITY.html b/v0.5.0/SECURITY.html index 9bffcc734..17df7f543 100644 --- a/v0.5.0/SECURITY.html +++ b/v0.5.0/SECURITY.html @@ -1,8 +1,22 @@ - -Security Policy • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -80,38 +100,44 @@
    -

    Reporting Security Issues

    +

    Reporting Security Issues +

    If you believe you have found a security vulnerability in any of the repositories in this organization, please report it to us through coordinated disclosure.

    Please do not report security vulnerabilities through public GitHub issues, discussions, or pull requests.

    Instead, please send an email to vulnerability.management[@]roche.com.

    Please include as much of the information listed below as you can to help us better understand and resolve the issue:

    -
    • The type of issue (e.g., buffer overflow, SQL injection, or cross-site scripting)
    • +
        +
      • The type of issue (e.g., buffer overflow, SQL injection, or cross-site scripting)
      • Full paths of source file(s) related to the manifestation of the issue
      • The location of the affected source code (tag/branch/commit or direct URL)
      • Any special configuration required to reproduce the issue
      • Step-by-step instructions to reproduce the issue
      • Proof-of-concept or exploit code (if possible)
      • Impact of the issue, including how an attacker might exploit the issue
      • -

      This information will help us triage your report more quickly.

      +
    +

    This information will help us triage your report more quickly.

    -

    Data Security Standards (DSS)

    +

    Data Security Standards (DSS) +

    Please make sure that while reporting issues in the form a bug, feature, or pull request, all sensitive information such as PII, PHI, and PCI is completely removed from any text and attachments, including pictures and videos.

    + + + + - - + + diff --git a/v0.5.0/articles/filter-panel-for-developers.html b/v0.5.0/articles/filter-panel-for-developers.html index 907959782..08a4b12c4 100644 --- a/v0.5.0/articles/filter-panel-for-developers.html +++ b/v0.5.0/articles/filter-panel-for-developers.html @@ -1,5 +1,4 @@ - - + @@ -52,22 +51,7 @@ - - + - + + diff --git a/v0.5.0/articles/index.html b/v0.5.0/articles/index.html index a9eed9c9e..71743b070 100644 --- a/v0.5.0/articles/index.html +++ b/v0.5.0/articles/index.html @@ -1,8 +1,22 @@ - -Articles • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -80,24 +100,31 @@

    All vignettes

    -
    Filter Panel for Developers
    +
    +
    Filter Panel for Developers
    -
    teal.slice Classes
    + +
    teal.slice Classes
    -
    Introduction to teal.slice
    + +
    Introduction to teal.slice
    -
    - + +
    + + + + + - - + + diff --git a/v0.5.0/articles/teal-slice-classes.html b/v0.5.0/articles/teal-slice-classes.html index 333c6dcd8..f299bc1ec 100644 --- a/v0.5.0/articles/teal-slice-classes.html +++ b/v0.5.0/articles/teal-slice-classes.html @@ -1,5 +1,4 @@ - - + @@ -52,22 +51,7 @@ - - + - + + diff --git a/v0.5.0/articles/teal-slice.html b/v0.5.0/articles/teal-slice.html index c82db111b..56cfda82b 100644 --- a/v0.5.0/articles/teal-slice.html +++ b/v0.5.0/articles/teal-slice.html @@ -1,5 +1,4 @@ - - + @@ -52,22 +51,7 @@ - - + - + + diff --git a/v0.5.0/authors.html b/v0.5.0/authors.html index 2deaf00e8..68d80a5e6 100644 --- a/v0.5.0/authors.html +++ b/v0.5.0/authors.html @@ -1,8 +1,22 @@ - -Authors and Citation • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -79,7 +99,8 @@

    Authors

    -
    • +
        +
      • Dawid Kaledkowski. Author, maintainer.

      • @@ -139,7 +160,8 @@

        Authors

        F. Hoffmann-La Roche AG. Copyright holder, funder.

        -
    + +

    Citation

    @@ -160,17 +182,19 @@

    Citation

    }
    + + + + - - + + diff --git a/v0.5.0/index.html b/v0.5.0/index.html index f833076a6..2815d4311 100644 --- a/v0.5.0/index.html +++ b/v0.5.0/index.html @@ -1,5 +1,4 @@ - - + @@ -58,22 +57,7 @@ - - + - + + diff --git a/v0.5.0/news/index.html b/v0.5.0/news/index.html index 60f9ed0c3..a7411cf31 100644 --- a/v0.5.0/news/index.html +++ b/v0.5.0/news/index.html @@ -1,8 +1,22 @@ - -Changelog • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -78,31 +98,45 @@
    -

    teal.slice 0.5.0

    CRAN release: 2024-02-06

    +

    teal.slice 0.5.0 +

    +

    CRAN release: 2024-02-06

    -

    Enhancements

    -
    • Simplified init_filtered_data to accept a named list of datasets. init_filtered_data does not currently handle a list containing dataset, metadata, datalabel and code.
    • -
    +

    Enhancements +

    +
      +
    • Simplified init_filtered_data to accept a named list of datasets. init_filtered_data does not currently handle a list containing dataset, metadata, datalabel and code.
    • +
    +
    -

    Breaking changes

    -
    • +

      Breaking changes +

      +
        +
      • TealData object is no longer supported by teal.slice.
      • set_filter_state no longer accepts a nested list. Use teal_slices() and teal_slice() instead.
      • Renamed FilteredDataset subclass that handles data.frames from DefaultFilteredDataset to DataframeFilteredDataset. Added new class DefaultFilteredDataset that will store any type of object. Filtering will is not supported.
      • -
    + +
    -

    Miscellaneous

    -
    • Specified minimal version of package dependencies.
    • +

      Miscellaneous +

      +
        +
      • Specified minimal version of package dependencies.
      • Removed storing and restoring of teal_slices objects.
      • Update documentation and code to reflect the changes due to the refactor of teal.data::JoinKeys into teal.data::join_keys.
      • -
    + +
    -

    teal.slice 0.4.0

    +

    teal.slice 0.4.0 +

    -

    New features

    -
    + +
    -

    Breaking changes

    -
    • Setting filters using a list is now deprecated. Use teal_slices and teal_slice instead.
    • +

      Breaking changes +

      +
        +
      • Setting filters using a list is now deprecated. Use teal_slices and teal_slice instead.
      • Removed CDISCFilteredData and CDISCFilteredDataset and implementing JoinKeys handling in their parent classes (FilteredData and DefaultFilteredDataset).
      • Specifying set of filterable columns is done through include_varnames and exclude_varnames in teal_slices. Specifying attr(, "filterable") is hard deprecated.
      • Removed private fields $code and $check from FilteredData class and made appropriate changes to constructor and init_filtered_data.
      • -
    + +
    -

    teal.slice 0.3.0

    -
    • Examples now use scda.2022 instead of scda.2021.
    • +

      teal.slice 0.3.0 +

      +
        +
      • Examples now use scda.2022 instead of scda.2021.
      • Transferred data hashing step in FilteredDataset to teal.
      • Removed constructor of Queue class.
      • -
      -

      New features

      -
      • Added a global turn on/off button for the Filter Panel.
      • +
      +
      +

      New features +

      +
        +
      • Added a global turn on/off button for the Filter Panel.
      • Added ability to collapse Active Filter Display panel.
      • Added ability to collapse all filters of an individual dataset.
      • Added fixed filter states.
      • -
      +
    +
    -

    Enhancements

    -
    • Improved filter state presentation in FilterState$format.
    • -
    +

    Enhancements +

    +
      +
    • Improved filter state presentation in FilterState$format.
    • +
    +
    -

    Bug fixes

    -
    • Fixed an error where the RangeFilterState produced an error when using bootstrap 4.
    • +

      Bug fixes +

      +
        +
      • Fixed an error where the RangeFilterState produced an error when using bootstrap 4.
      • Fixed a bug that caused the range slider to omit values selected by the filter API.
      • Fixed a bug where setting incorrect values for Date and Date time ranges caused the app to crash.
      • -
    + +
    -

    Miscellaneous

    -
    • Calculation of step in slider for RangeFilterState now uses checkmate::test_integerish instead of is.integer.
    • +

      Miscellaneous +

      +
        +
      • Calculation of step in slider for RangeFilterState now uses checkmate::test_integerish instead of is.integer.
      • Updated init_filtered_data to take into account the removal of CDISCTealData from teal.data package.
      • Added shinyvalidate validation for Date and Date time ranges.
      • Added examples apps for FilterState child classes and DFFilterStates.
      • -
    + +
    -

    teal.slice 0.2.0

    +

    teal.slice 0.2.0 +

    -

    New features

    -
    + +
    -

    Enhancements

    -
    • Redesigned the count bars for filter panel check box inputs.
    • +

      Enhancements +

      +
        +
      • Redesigned the count bars for filter panel check box inputs.
      • Redesigned the filter panel input for dates to use CSS flexbox.
      • Update icons to be compatible with Font Awesome 6.
      • Updates the FilteredData method get_formatted_filter_state so it no longer appends empty filters.
      • Added clearer installation instructions to README.
      • -
    + +
    -

    Breaking changes

    -
    • Renamed internal S3 method get_filterable_varnames to get_supported_filter_varnames.
    • -
    +

    Breaking changes +

    +
      +
    • Renamed internal S3 method get_filterable_varnames to get_supported_filter_varnames.
    • +
    +
    -

    Bug fixes

    -
    • Fixed a bug when the filter panel overview would not refresh if the panel was hidden during a transition between active modules.
    • +

      Bug fixes +

      +
        +
      • Fixed a bug when the filter panel overview would not refresh if the panel was hidden during a transition between active modules.
      • Fixed a bug in FilterState where sliderInput step values were too precise.
      • -
    + +
    -

    teal.slice 0.1.1

    +

    teal.slice 0.1.1 +

    -

    New features

    -
    • Added a formatting function for filter panel classes.
    • -
    +

    New features +

    +
      +
    • Added a formatting function for filter panel classes.
    • +
    +
    -

    Miscellaneous

    -
    • Added a template to the pkgdown site.
    • +

      Miscellaneous +

      +
        +
      • Added a template to the pkgdown site.
      • Updated package authors.
      • Added package vignettes.
      • -
    + +
    -

    Fix

    -
    • Fixed a bug in FilteredDataset, where launching a shiny application without FilteredData would not attach the appropriate CSS files.
    • -
    +

    Fix +

    +
      +
    • Fixed a bug in FilteredDataset, where launching a shiny application without FilteredData would not attach the appropriate CSS files.
    • +
    +
    -

    teal.slice 0.1.0

    -
    • Initial release of teal.slice - a package providing a filter module for teal applications.
    • -
    -

    Changes (from behavior when functionality was part of teal)

    +

    teal.slice 0.1.0 +

    +
      +
    • Initial release of teal.slice - a package providing a filter module for teal applications.
    • +
    +
    +

    Changes (from behavior when functionality was part of teal) +

    -

    Breaking changes

    -
    • +

      Breaking changes +

      +
        +
      • default_filter has been deprecated - use list() instead for a default filter.
      • -
    + +
    -

    Bug fixes

    -
    • Add counts to filtering categorical variables bar charts in the filtering panel in cases where they were missing.
    • +

      Bug fixes +

      +
        +
      • Add counts to filtering categorical variables bar charts in the filtering panel in cases where they were missing.
      • Fixed a bug causing an error when both sliders of RangeFilterState where put to either end of the allowed range in the UI.
      • -
    + +
    -

    Miscellaneous

    -
    • Added is_any_filtered method to all FilterState classes to detect if selected values actually filters out any data. This is used to decide if an explicit filter statement is added to the call.
    • +

      Miscellaneous +

      +
        +
      • Added is_any_filtered method to all FilterState classes to detect if selected values actually filters out any data. This is used to decide if an explicit filter statement is added to the call.
      • The filter panel now displays a helpful message when data has no rows or columns in place of an empty drop down widget.
      • FilteredData now stores whether its datasets had a reproducibility check or not via two new methods to its class: set_check and get_check.
      • -
    + +
    + + + + - - + + diff --git a/v0.5.0/pull_request_template.html b/v0.5.0/pull_request_template.html index 612f628db..cce22b640 100644 --- a/v0.5.0/pull_request_template.html +++ b/v0.5.0/pull_request_template.html @@ -1,8 +1,22 @@ - -Pull Request • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -83,17 +103,19 @@

    Fixes #nnn

    - + + + + - - + + diff --git a/v0.5.0/reference/ChoicesFilterState.html b/v0.5.0/reference/ChoicesFilterState.html index 1419c5760..fd3b973ee 100644 --- a/v0.5.0/reference/ChoicesFilterState.html +++ b/v0.5.0/reference/ChoicesFilterState.html @@ -1,8 +1,24 @@ - -FilterState object for categorical data — ChoicesFilterState • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,40 +107,60 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterState -> ChoicesFilterState

    +

    Inherited methods


    -

    Method new()

    -

    Initialize a FilterState object.

    -

    Usage

    -

    ChoicesFilterState$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterState object.

    +
    +

    Usage +

    +

    +
    +
    ChoicesFilterState$new(
       x,
       x_reactive = reactive(NULL),
       slice,
       extract_type = character(0)
    -)

    +)
    +

    +
    -

    Returns

    +

    Returns +

    Object of class ChoicesFilterState, invisibly.

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection. For this class returned call looks like -<varname> %in% c(<values selected>) with optional is.na(<varname>).

    -

    Usage

    -

    ChoicesFilterState$get_call(dataname)

    +<varname> %in% c(<values selected>) with optional is.na(<varname>).

    +
    +

    Usage +

    +

    +
    +
    ChoicesFilterState$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of data set; defaults to private$get_dataname()

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    call or NULL

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    ChoicesFilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    ChoicesFilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -197,17 +280,19 @@

    Arguments

    + +
    + +
    - - + + diff --git a/v0.5.0/reference/DFFilterStates.html b/v0.5.0/reference/DFFilterStates.html index 9a4e3d793..8f9ae6d74 100644 --- a/v0.5.0/reference/DFFilterStates.html +++ b/v0.5.0/reference/DFFilterStates.html @@ -1,8 +1,24 @@ - -FilterStates subclass for data frames — DFFilterStates • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,18 +107,25 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterStates -> DFFilterStates

    -

    Methods

    +

    Methods +

    -

    Public methods

    +

    Public methods +

    -

    Inherited methods +
    +

    Inherited methods


    -

    Method new()

    +

    +
    +
    +

    Method new() +

    Initializes DFFilterStates object by setting dataname and initializing state_list (shiny::reactiveVal). This class contains a single state_list with no specified name, which means that when calling the subset function associated with this class -(dplyr::filter), a list of conditions is passed to unnamed arguments (...).

    -

    Usage

    -

    DFFilterStates$new(
    +(dplyr::filter), a list of conditions is passed to unnamed arguments (...).

    +
    +

    Usage +

    +

    +
    +
    DFFilterStates$new(
       data,
       data_reactive = function(sid = "") NULL,
       dataname,
       datalabel = NULL,
       keys = character(0)
    -)

    +)
    +

    +
    -

    Arguments

    -

    data
    +

    Arguments +

    +

    +
    +
    +
    data

    (data.frame) the R object which dplyr::filter function will be applied on.

    @@ -154,23 +197,41 @@

    Arguments
    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    DFFilterStates$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    DFFilterStates$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -178,17 +239,19 @@

    Arguments

    + +

    + +
    - - + + diff --git a/v0.5.0/reference/DataframeFilteredDataset.html b/v0.5.0/reference/DataframeFilteredDataset.html index e5392bc12..84e52e169 100644 --- a/v0.5.0/reference/DataframeFilteredDataset.html +++ b/v0.5.0/reference/DataframeFilteredDataset.html @@ -1,10 +1,26 @@ - -The DataframeFilteredDataset R6 class — DataframeFilteredDataset • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + +
    @@ -87,23 +109,30 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilteredDataset -> DataframeFilteredDataset

    +

    Inherited methods


    -

    Method new()

    -

    Initializes this DataframeFilteredDataset object.

    -

    Usage

    -

    DataframeFilteredDataset$new(
    +

    +
    +
    +

    Method new() +

    +

    Initializes this DataframeFilteredDataset object.

    +
    +

    Usage +

    +

    +
    +
    DataframeFilteredDataset$new(
       dataset,
       dataname,
       keys = character(0),
    @@ -127,12 +163,18 @@ 

    Usage

    parent = NULL, join_keys = character(0), label = character(0) -)

    +)
    +

    +
    -

    Arguments

    -

    dataset
    +

    Arguments +

    +

    +
    +
    +
    dataset

    (data.frame) single data.frame for which filters are rendered.

    @@ -170,129 +212,227 @@

    Arguments -

    Returns

    +

    Returns +

    Object of class DataframeFilteredDataset, invisibly.

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Gets the subset expression.

    This function returns subset expressions equivalent to selected items within each of filter_states. Configuration of the expressions is constant and depends on filter_states type and order which are set during initialization. This class contains single FilterStates which contains single state_list -and all FilterState objects apply to one argument (...) in a dplyr::filter call.

    -

    Usage

    -

    DataframeFilteredDataset$get_call(sid = "")

    +and all FilterState objects apply to one argument (...) in a dplyr::filter call.

    +
    +

    Usage +

    +

    +
    +
    DataframeFilteredDataset$get_call(sid = "")
    +

    +
    -

    Arguments

    -

    sid
    +

    Arguments +

    +

    +
    +
    +
    sid

    (character) when specified, the method returns code containing conditions calls of FilterState objects with sid different to that of this sid argument.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Either a list of length 1 containing a filter call, or NULL.

    -


    -

    Method set_filter_state()

    -

    Set filter state.

    -

    Usage

    -

    DataframeFilteredDataset$set_filter_state(state)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Set filter state.

    +
    +

    Usage +

    +

    +
    +
    DataframeFilteredDataset$set_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method remove_filter_state()

    -

    Remove one or more FilterState form a FilteredDataset.

    -

    Usage

    -

    DataframeFilteredDataset$remove_filter_state(state)

    +
    +

    +
    +
    +

    Method remove_filter_state() +

    +

    Remove one or more FilterState form a FilteredDataset.

    +
    +

    Usage +

    +

    +
    +
    DataframeFilteredDataset$remove_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices) specifying FilterState objects to remove; teal_slices may contain only dataname and varname, other elements are ignored

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method ui_add()

    -

    UI module to add filter variable for this dataset.

    -

    Usage

    -

    DataframeFilteredDataset$ui_add(id)

    +
    +

    +
    +
    +

    Method ui_add() +

    +

    UI module to add filter variable for this dataset.

    +
    +

    Usage +

    +

    +
    +
    DataframeFilteredDataset$ui_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method get_filter_overview()

    -

    Creates row for filter overview in the form of
    dataname -- observations (remaining/total) - data.frame

    -

    Usage

    -

    DataframeFilteredDataset$get_filter_overview()

    +
    +

    +
    +
    +

    Method get_filter_overview() +

    +

    Creates row for filter overview in the form of
    dataname -- observations (remaining/total) - data.frame

    +
    +

    Usage +

    +

    +
    +
    DataframeFilteredDataset$get_filter_overview()
    +

    +
    -

    Returns

    +

    Returns +

    A data.frame.

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    DataframeFilteredDataset$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    DataframeFilteredDataset$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -300,17 +440,19 @@

    Arguments

    + +
    + +
    - - + + diff --git a/v0.5.0/reference/DateFilterState.html b/v0.5.0/reference/DateFilterState.html index 261620ca7..afcd34622 100644 --- a/v0.5.0/reference/DateFilterState.html +++ b/v0.5.0/reference/DateFilterState.html @@ -1,8 +1,24 @@ - -FilterState object for Date data — DateFilterState • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,40 +107,60 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterState -> DateFilterState

    +

    Inherited methods


    -

    Method new()

    -

    Initialize a FilterState object.

    -

    Usage

    -

    DateFilterState$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterState object.

    +
    +

    Usage +

    +

    +
    +
    DateFilterState$new(
       x,
       x_reactive = reactive(NULL),
       slice,
       extract_type = character(0)
    -)

    +)
    +

    +
    -

    Returns

    +

    Returns +

    Object of class DateFilterState, invisibly.

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection. For this class returned call looks like -<varname> >= <min value> & <varname> <= <max value> with optional is.na(<varname>).

    -

    Usage

    -

    DateFilterState$get_call(dataname)

    +<varname> >= <min value> & <varname> <= <max value> with optional is.na(<varname>).

    +
    +

    Usage +

    +

    +
    +
    DateFilterState$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) containing possibly prefixed name of data set

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    call or NULL

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    DateFilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    DateFilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -197,17 +280,19 @@

    Arguments

    + +
    + +
    - - + + diff --git a/v0.5.0/reference/DatetimeFilterState.html b/v0.5.0/reference/DatetimeFilterState.html index 5c828c26d..0779facb5 100644 --- a/v0.5.0/reference/DatetimeFilterState.html +++ b/v0.5.0/reference/DatetimeFilterState.html @@ -1,8 +1,24 @@ - -FilterState object for date time data — DatetimeFilterState • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,44 +107,64 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterState -> DatetimeFilterState

    +

    Inherited methods


    -

    Method new()

    +

    +
    +
    +

    Method new() +

    Initialize a FilterState object. This class has an extra field, private$timezone, which is set to Sys.timezone() by default. However, in case when using this module in teal app, one needs timezone of the app user. App user timezone is taken from session$userData$timezone -and is set only if object is initialized in shiny.

    -

    Usage

    -

    DatetimeFilterState$new(
    +and is set only if object is initialized in shiny.

    +
    +

    Usage +

    +

    +
    +
    DatetimeFilterState$new(
       x,
       x_reactive = reactive(NULL),
       extract_type = character(0),
       slice
    -)

    +)
    +

    +
    -

    Arguments

    -

    x
    +

    Arguments +

    +

    +
    +
    +
    x

    (POSIXct or POSIXlt) variable to be filtered.

    @@ -135,11 +178,15 @@

    Arguments varname in the condition call will be returned as <dataname>$<varname>

  • "matrix" varname in the condition call will be returned as <dataname>[, <varname>]

  • - + +
    slice
    @@ -151,49 +198,85 @@

    Arguments -

    Returns

    +

    Returns +

    Object of class DatetimeFilterState, invisibly.

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection. For this class returned call looks like -<varname> >= as.POSIXct(<min>) & <varname> <= <max>) with optional is.na(<varname>).

    -

    Usage

    -

    DatetimeFilterState$get_call(dataname)

    +<varname> >= as.POSIXct(<min>) & <varname> <= <max>) with optional is.na(<varname>).

    +
    +

    Usage +

    +

    +
    +
    DatetimeFilterState$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    name of data set; defaults to private$get_dataname()

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    call

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    DatetimeFilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    DatetimeFilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -201,17 +284,19 @@

    Arguments

    + +
    + +
    - - + + diff --git a/v0.5.0/reference/DefaultFilteredDataset.html b/v0.5.0/reference/DefaultFilteredDataset.html index 461f243c7..2819d4bb2 100644 --- a/v0.5.0/reference/DefaultFilteredDataset.html +++ b/v0.5.0/reference/DefaultFilteredDataset.html @@ -1,8 +1,24 @@ - -DefaultFilteredDataset R6 class — DefaultFilteredDataset • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,16 +107,20 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilteredDataset -> DefaultFilteredDataset

    +

    Inherited methods


    -

    Method new()

    -

    Initializes this DefaultFilteredDataset object.

    -

    Usage

    -

    DefaultFilteredDataset$new(dataset, dataname, label = character(0))

    +

    +
    +
    +

    Method new() +

    +

    Initializes this DefaultFilteredDataset object.

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$new(dataset, dataname, label = character(0))
    +

    +
    -

    Arguments

    -

    dataset
    +

    Arguments +

    +

    +
    +
    +
    dataset

    any type of object; will not be filtered.

    @@ -134,23 +177,40 @@

    Arguments -

    Returns

    +

    Returns +

    Object of class DefaultFilteredDataset, invisibly.

    -


    -

    Method format()

    -

    Returns a formatted string representing this DefaultFilteredDataset object.

    -

    Usage

    -

    DefaultFilteredDataset$format(show_all, trim_lines = FALSE)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns a formatted string representing this DefaultFilteredDataset object.

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$format(show_all, trim_lines = FALSE)
    +

    +
    -

    Arguments

    -

    show_all
    +

    Arguments +

    +

    +
    +
    +
    show_all

    (logical(1)) for method consistency, ignored.

    @@ -158,167 +218,291 @@

    Arguments -

    Returns

    +

    Returns +

    The formatted string.

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    -

    Usage

    -

    DefaultFilteredDataset$get_call(sid)

    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$get_call(sid)
    +

    +
    -

    Arguments

    -

    sid
    +

    Arguments +

    +

    +
    +
    +
    sid

    (character(1)) for method consistency, ignored.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    +

    +
    +
    +

    Method get_filter_state() +

    -

    Usage

    -

    DefaultFilteredDataset$get_filter_state()

    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$get_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    +

    +
    +
    +

    Method set_filter_state() +

    -

    Usage

    -

    DefaultFilteredDataset$set_filter_state(state)

    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$set_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices) for method consistency, ignored.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    +

    +
    +
    +

    Method clear_filter_states() +

    -

    Usage

    -

    DefaultFilteredDataset$clear_filter_states(force)

    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$clear_filter_states(force)
    +

    +
    -

    Arguments

    -

    force
    +

    Arguments +

    +

    +
    +
    +
    force

    (logical(1)) for method consistency, ignored.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method get_filter_overview()

    -

    Creates row for filter overview in the form of
    dataname - unsupported data class

    -

    Usage

    -

    DefaultFilteredDataset$get_filter_overview()

    +
    +

    +
    +
    +

    Method get_filter_overview() +

    +

    Creates row for filter overview in the form of
    dataname - unsupported data class

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$get_filter_overview()
    +

    +
    -

    Returns

    +

    Returns +

    A data.frame.

    -


    -

    Method ui_active()

    -

    Overwrites parent method.

    -

    Usage

    -

    DefaultFilteredDataset$ui_active(id)

    +
    +

    +
    +
    +

    Method ui_active() +

    +

    Overwrites parent method.

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$ui_active(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Details

    +

    Details +

    Blank UI module that would list active filter states for this dataset.

    -

    Returns

    +

    Returns +

    An empty div.

    -


    -

    Method ui_add()

    -

    Overwrites parent method.

    -

    Usage

    -

    DefaultFilteredDataset$ui_add(id)

    +
    +

    +
    +
    +

    Method ui_add() +

    +

    Overwrites parent method.

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$ui_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Details

    +

    Details +

    Blank UI module that would list active filter states for this dataset.

    -

    Returns

    +

    Returns +

    An empty div.

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    DefaultFilteredDataset$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -326,17 +510,19 @@

    Arguments

    + +
    + +
    - - + + diff --git a/v0.5.0/reference/EmptyFilterState.html b/v0.5.0/reference/EmptyFilterState.html index 3b42c2a58..4ae5b4a23 100644 --- a/v0.5.0/reference/EmptyFilterState.html +++ b/v0.5.0/reference/EmptyFilterState.html @@ -1,8 +1,24 @@ - -FilterState object for empty variables — EmptyFilterState • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,40 +107,60 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterState -> EmptyFilterState

    +

    Inherited methods


    -

    Method new()

    -

    Initialize EmptyFilterState object.

    -

    Usage

    -

    EmptyFilterState$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize EmptyFilterState object.

    +
    +

    Usage +

    +

    +
    +
    EmptyFilterState$new(
       x,
       x_reactive = reactive(NULL),
       extract_type = character(0),
       slice
    -)

    +)
    +

    +
    -

    Arguments

    -

    x
    +

    Arguments +

    +

    + -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection relevant for selected variable type. -Uses internal reactive values, hence must be called in reactive or isolated context.

    -

    Usage

    -

    EmptyFilterState$get_call(dataname)

    +Uses internal reactive values, hence must be called in reactive or isolated context.

    +
    +

    Usage +

    +

    +
    +
    EmptyFilterState$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    name of data set; defaults to private$get_dataname()

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    logical(1)

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    EmptyFilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    EmptyFilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -196,17 +279,19 @@

    Arguments

    + +
    + +
    - - + + diff --git a/v0.5.0/reference/FilterPanelAPI.html b/v0.5.0/reference/FilterPanelAPI.html index ab263605e..070bced9e 100644 --- a/v0.5.0/reference/FilterPanelAPI.html +++ b/v0.5.0/reference/FilterPanelAPI.html @@ -1,8 +1,24 @@ - -Class to encapsulate the API of the filter panel of a teal app — FilterPanelAPI • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,7 +106,8 @@
    -

    Details

    +

    Details +

    The purpose of this class is to encapsulate the API of the filter panel in a new class FilterPanelAPI so that it can be passed and used in the server call of any module instead of passing the whole FilteredData object.

    @@ -92,125 +115,223 @@

    Details

    -

    Methods

    +

    Methods +


    -

    Method new()

    -

    Initialize a FilterPanelAPI object.

    -

    Usage

    -

    FilterPanelAPI$new(datasets)

    + +
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterPanelAPI object.

    +
    +

    Usage +

    +

    +
    +
    FilterPanelAPI$new(datasets)
    +

    +
    -

    Arguments

    -

    datasets
    +

    Arguments +

    +

    +
    +
    +
    datasets

    (FilteredData)

    -

    +
    +

    +
    -


    +

    +
    +
    +

    Method get_filter_state() +

    Gets the reactive values from the active FilterState objects of the FilteredData object.

    Gets all active filters in the form of a nested list. -The output list is a compatible input to set_filter_state.

    -

    Usage

    -

    FilterPanelAPI$get_filter_state()

    +The output list is a compatible input to set_filter_state.

    +
    +

    Usage +

    +

    +
    +
    FilterPanelAPI$get_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    list with named elements corresponding to FilteredDataset objects with active filters.

    -


    -

    Method set_filter_state()

    -

    Sets active filter states.

    -

    Usage

    -

    FilterPanelAPI$set_filter_state(filter)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Sets active filter states.

    +
    +

    Usage +

    +

    +
    +
    FilterPanelAPI$set_filter_state(filter)
    +

    +
    -

    Arguments

    -

    filter
    +

    Arguments +

    +

    +
    +
    +
    filter

    (teal_slices)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method remove_filter_state()

    -

    Remove one or more FilterState of a FilteredDataset in the FilteredData object.

    -

    Usage

    -

    FilterPanelAPI$remove_filter_state(filter)

    +
    +

    +
    +
    +

    Method remove_filter_state() +

    +

    Remove one or more FilterState of a FilteredDataset in the FilteredData object.

    +
    +

    Usage +

    +

    +
    +
    FilterPanelAPI$remove_filter_state(filter)
    +

    +
    -

    Arguments

    -

    filter
    +

    Arguments +

    +

    +
    +
    +
    filter

    (teal_slices) specifying FilterState objects to remove; teal_slices may contain only dataname and varname, other elements are ignored

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method clear_filter_states()

    -

    Remove all FilterStates of the FilteredData object.

    -

    Usage

    -

    FilterPanelAPI$clear_filter_states(datanames)

    +
    +

    +
    +
    +

    Method clear_filter_states() +

    +

    Remove all FilterStates of the FilteredData object.

    +
    +

    Usage +

    +

    +
    +
    FilterPanelAPI$clear_filter_states(datanames)
    +

    +
    -

    Arguments

    -

    datanames
    +

    Arguments +

    +

    +
    +
    +
    datanames

    (character) datanames to remove their FilterStates; omit to remove all FilterStates in the FilteredData object

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    FilterPanelAPI$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    FilterPanelAPI$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -218,7 +339,8 @@

    Arguments -

    Examples

    +

    Examples +

    library(shiny)
     
     fd <- init_filtered_data(list(iris = iris))
    @@ -289,17 +411,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.5.0/reference/FilterState.html b/v0.5.0/reference/FilterState.html index b2b6e184b..6db915e98 100644 --- a/v0.5.0/reference/FilterState.html +++ b/v0.5.0/reference/FilterState.html @@ -1,8 +1,24 @@ - -FilterState abstract class — FilterState • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,12 +107,15 @@
    -

    Details

    +

    Details +

    This class is responsible for managing a single filter item within a FilteredData object and outputs a condition call (logical predicate) for subsetting one variable. Filter states depend on the variable type: (logical, integer, numeric, character, factor, Date, POSIXct, POSIXlt) -and FilterState subclasses exist that correspond to those types.

    +

    Each variable's filter state is an R6 object keeps the variable that is filtered, a teal_slice object that describes the filter state, as well as a shiny module (UI and server) that allows the user to alter the filter state. Changes to the filter state that cause some observations to be omitted trigger the get_call method and every R function call up in the reactive chain.

    -

    Modifying state

    +

    Modifying state +

    -

    Modifying a FilterState object is possible in three scenarios:

    • In an interactive session, by passing an appropriate teal_slice to the set_state method.

    • +

      Modifying a FilterState object is possible in three scenarios:

      +
        +
      • In an interactive session, by passing an appropriate teal_slice to the set_state method.

      • In a running application, by changing appropriate inputs.

      • In a running application, by using filter_state_api which directly uses set_state method of the FilterState object.

      • -
    + +
    -

    Methods

    +

    Methods +


    -

    Method new()

    -

    Initialize a FilterState object.

    -

    Usage

    -

    FilterState$new(
    +
    +
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterState object.

    +
    +

    Usage +

    +

    +
    +
    FilterState$new(
       x,
       x_reactive = reactive(NULL),
       slice,
       extract_type = character(0)
    -)

    +)
    +

    +
    -

    Returns

    +

    Returns +

    Object of class FilterState, invisibly.

    -


    -

    Method format()

    -

    Returns a formatted string representing this FilterState object.

    -

    Usage

    -

    FilterState$format(show_all = FALSE, trim_lines = TRUE)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns a formatted string representing this FilterState object.

    +
    +

    Usage +

    +

    +
    +
    FilterState$format(show_all = FALSE, trim_lines = TRUE)
    +

    +
    -

    Arguments

    -

    show_all
    +

    Arguments +

    +

    +
    +
    +
    show_all

    (logical(1)) passed to format.teal_slice

    @@ -197,106 +267,196 @@

    Arguments -

    Returns

    +

    Returns +

    character(1) the formatted string

    -


    -

    Method print()

    -

    Prints this FilterState object.

    -

    Usage

    -

    FilterState$print(...)

    +
    +

    +
    +
    +

    Method print() +

    +

    Prints this FilterState object.

    +
    +

    Usage +

    +

    +
    +
    FilterState$print(...)
    +

    +
    -

    Arguments

    -

    ...
    +

    Arguments +

    +

    +
    +
    +
    ...

    additional arguments

    -

    +
    +

    +
    -


    -

    Method set_state()

    -

    Sets mutable parameters of the filter state.

    • fixed state is prevented from changing state

    • +
    +

    +
    +
    +

    Method set_state() +

    +

    Sets mutable parameters of the filter state.

    +
      +
    • fixed state is prevented from changing state

    • anchored state is prevented from removing state

    • -
    -

    Usage

    -

    FilterState$set_state(state)

    + +
    +

    Usage +

    +

    +
    +
    FilterState$set_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slice)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    self invisibly

    -


    -

    Method get_state()

    -

    Returns a complete description of the filter state.

    -

    Usage

    -

    FilterState$get_state()

    +
    +

    +
    +
    +

    Method get_state() +

    +

    Returns a complete description of the filter state.

    +
    +

    Usage +

    +

    +
    +
    FilterState$get_state()
    +

    +
    -

    Returns

    +

    Returns +

    A teal_slice object.

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection relevant for selected variable type. Method is using internal reactive values which makes it reactive -and must be executed in reactive or isolated context.

    -

    Usage

    -

    FilterState$get_call()

    +and must be executed in reactive or isolated context.

    +
    +

    Usage +

    +

    +
    +
    FilterState$get_call()
    +

    +
    -


    -

    Method server()

    -

    shiny module server.

    -

    Usage

    -

    FilterState$server(id)

    +
    +

    +
    +
    +

    Method server() +

    +

    shiny module server.

    +
    +

    Usage +

    +

    +
    +
    FilterState$server(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Reactive expression signaling that remove button has been clicked.

    -


    -

    Method ui()

    +
    +

    +
    +
    +

    Method ui() +

    shiny UI module. -The UI for this class contains simple message stating that it is not supported.

    -

    Usage

    -

    FilterState$ui(id, parent_id = "cards")

    +The UI for this class contains simple message stating that it is not supported.

    +
    +

    Usage +

    +

    +
    +
    FilterState$ui(id, parent_id = "cards")
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    @@ -305,35 +465,64 @@

    Arguments
    -

    Method destroy_observers()

    -

    Destroy observers stored in private$observers.

    -

    Usage

    -

    FilterState$destroy_observers()

    +
    +

    +
    +
    +

    Method destroy_observers() +

    +

    Destroy observers stored in private$observers.

    +
    +

    Usage +

    +

    +
    +
    FilterState$destroy_observers()
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    FilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    FilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -341,17 +530,19 @@

    Arguments

    + +

    + +
    - - + + diff --git a/v0.5.0/reference/FilterStateExpr.html b/v0.5.0/reference/FilterStateExpr.html index 6d426a4cb..53a731253 100644 --- a/v0.5.0/reference/FilterStateExpr.html +++ b/v0.5.0/reference/FilterStateExpr.html @@ -1,8 +1,24 @@ - -FilterStateExpr R6 class — FilterStateExpr • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,18 +107,22 @@
    -

    Details

    +

    Details +

    Creates a filter state around a predefined condition call (logical predicate). The condition call is independent of the data and the filter card allows no interaction (the filter is always fixed).

    -

    Methods

    +

    Methods +


    -

    Method new()

    -

    Initialize a FilterStateExpr object.

    -

    Usage

    -

    FilterStateExpr$new(slice)

    + +
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterStateExpr object.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$new(slice)
    +

    +
    -

    Arguments

    -

    slice
    +

    Arguments +

    +

    +
    +
    +
    slice

    (teal_slice_expr)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Object of class FilterStateExpr, invisibly.

    -


    -

    Method format()

    -

    Returns a formatted string representing this FilterStateExpr object.

    -

    Usage

    -

    FilterStateExpr$format(show_all = FALSE, trim_lines = TRUE)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns a formatted string representing this FilterStateExpr object.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$format(show_all = FALSE, trim_lines = TRUE)
    +

    +
    -

    Arguments

    -

    show_all
    +

    Arguments +

    +

    +
    +
    +
    show_all

    (logical(1)) passed to format.teal_slice

    @@ -142,133 +201,242 @@

    Arguments -

    Returns

    +

    Returns +

    character(1) the formatted string

    -


    -

    Method print()

    -

    Prints this FilterStateExpr object.

    -

    Usage

    -

    FilterStateExpr$print(...)

    +
    +

    +
    +
    +

    Method print() +

    +

    Prints this FilterStateExpr object.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$print(...)
    +

    +
    -

    Arguments

    -

    ...
    +

    Arguments +

    +

    +
    +
    +
    ...

    arguments passed to the format method

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method get_state()

    -

    Returns a complete description of this filter state.

    -

    Usage

    -

    FilterStateExpr$get_state()

    +
    +

    +
    +
    +

    Method get_state() +

    +

    Returns a complete description of this filter state.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$get_state()
    +

    +
    -

    Returns

    +

    Returns +

    A teal_slice object.

    -


    -

    Method set_state()

    -

    Does nothing. Exists for compatibility.

    -

    Usage

    -

    FilterStateExpr$set_state(state)

    +
    +

    +
    +
    +

    Method set_state() +

    +

    Does nothing. Exists for compatibility.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$set_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slice)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    self, invisibly.

    -


    -

    Method get_call()

    -

    Get reproducible call.

    -

    Usage

    -

    FilterStateExpr$get_call(dataname)

    +
    +

    +
    +
    +

    Method get_call() +

    +

    Get reproducible call.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    -

    (ignored) for a consistency with FilterState

    +

    Arguments +

    +

    +
    +
    +
    dataname
    +
    +

    (ignored) for a consistency with FilterState

    Returns reproducible condition call for current selection relevant for selected variable type. Method is using internal reactive values which makes it reactive -and must be executed in reactive or isolated context.

    +and must be executed in reactive or isolated context.

    +
    -

    + +

    +
    -

    Returns

    +

    Returns +

    call or NULL

    -


    -

    Method destroy_observers()

    -

    Destroy observers stored in private$observers.

    -

    Usage

    -

    FilterStateExpr$destroy_observers()

    +
    +

    +
    +
    +

    Method destroy_observers() +

    +

    Destroy observers stored in private$observers.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$destroy_observers()
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method server()

    -

    shiny module server.

    -

    Usage

    -

    FilterStateExpr$server(id)

    +
    +

    +
    +
    +

    Method server() +

    +

    shiny module server.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$server(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Reactive expression signaling that the remove button has been clicked.

    -


    -

    Method ui()

    +
    +

    +
    +
    +

    Method ui() +

    shiny module UI. -The UI for this class contains simple message stating that it is not supported.

    -

    Usage

    -

    FilterStateExpr$ui(id, parent_id = "cards")

    +The UI for this class contains simple message stating that it is not supported.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$ui(id, parent_id = "cards")
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    @@ -278,23 +446,41 @@

    Arguments
    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    FilterStateExpr$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -302,17 +488,19 @@

    Arguments

    + +

    + +
    - - + + diff --git a/v0.5.0/reference/FilterStates.html b/v0.5.0/reference/FilterStates.html index 064cfc385..7f4dd2f73 100644 --- a/v0.5.0/reference/FilterStates.html +++ b/v0.5.0/reference/FilterStates.html @@ -1,5 +1,10 @@ - - + + + + + +FilterStates R6 class — FilterStates • teal.slice +FilterStates R6 class — FilterStates • teal.slice + + + + + + + + + + Skip to contents @@ -38,7 +54,8 @@ + +
    @@ -114,12 +137,15 @@
    -

    Methods

    +

    Methods +


    -

    Method new()

    + +
    +

    +
    +
    +

    Method new() +

    Initializes FilterStates object by setting -dataname, and datalabel.

    -

    Usage

    -

    FilterStates$new(
    +dataname, and datalabel.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$new(
       data,
       data_reactive = function(sid = "") NULL,
       dataname,
       datalabel = NULL
    -)

    +)
    +

    +
    -

    Arguments

    -

    data
    +

    Arguments +

    +

    +
    +
    +
    data

    (data.frame or MultiAssayExperiment or SummarizedExperiment or matrix) the R object which subset function is applied on.

    @@ -171,23 +212,40 @@

    Arguments -

    Returns

    +

    Returns +

    Object of class FilterStates, invisibly.

    -


    -

    Method format()

    -

    Returns a formatted string representing this FilterStates object.

    -

    Usage

    -

    FilterStates$format(show_all = FALSE, trim_lines = TRUE)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns a formatted string representing this FilterStates object.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$format(show_all = FALSE, trim_lines = TRUE)
    +

    +
    -

    Arguments

    -

    show_all
    +

    Arguments +

    +

    +
    +
    +
    show_all

    (logical(1)) passed to format.teal_slices

    @@ -195,28 +253,40 @@

    Arguments -

    Returns

    +

    Returns +

    character(1) the formatted string

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Filter call

    Builds subset expression from condition calls generated by FilterState. The lhs of the expression is a dataname_prefixed, where word prefixed refers to situation when call is evaluated on elements of the original data, for example dataname[[x]]. By default dataname_prefixed = dataname and it's not alterable through class methods. Customization of private$dataname_prefixed is done through inheriting classes.

    -

    The rhs is a call to private$fun with following arguments:

    • dataname_prefixed

    • +

      The rhs is a call to private$fun with following arguments:

      +
        +
      • dataname_prefixed

      • list of logical expressions generated by FilterState objects stored in private$state_list. Each logical predicate is combined with & operator. Variables in these logical expressions by default are not prefixed but this can be changed by setting private$extract_type (change in the similar way as dataname_prefixed) Possible call outputs depending on a custom fields/options:

      • -

      # default
      +
    +

    +
    +
    # default
     dataname <- subset(dataname, col == "x")
     
     # fun = dplyr::filter
    @@ -229,222 +299,399 @@ 

    Method get_call()dataname <- subset(dataname, subset = row_col == "x", select = col_col == "x") # dataname = dataname[[element]] -dataname[[element]] <- subset(dataname[[element]], subset = col == "x")

    -

    If no filters are applied, NULL is returned to avoid no-op calls such as dataname <- dataname.

    -

    Usage

    -

    FilterStates$get_call(sid = "")

    +dataname[[element]] <- subset(dataname[[element]], subset = col == "x")
    +

    +
    +

    If no filters are applied, NULL is returned to avoid no-op calls such as dataname <- dataname.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$get_call(sid = "")
    +

    +
    -

    Arguments

    -

    sid
    +

    Arguments +

    +

    +
    +
    +
    sid

    (character) when specified then method returns code containing condition calls (logical predicates) of FilterState objects which "sid" attribute is different than this sid argument.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    call or NULL

    -


    -

    Method print()

    -

    Prints this FilterStates object.

    -

    Usage

    -

    FilterStates$print(...)

    +
    +

    +
    +
    +

    Method print() +

    +

    Prints this FilterStates object.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$print(...)
    +

    +
    -

    Arguments

    -

    ...
    +

    Arguments +

    +

    +
    +
    +
    ...

    additional arguments passed to format.

    -

    +
    +

    +
    -


    -

    Method remove_filter_state()

    -

    Remove one or more FilterStates from the state_list along with their UI elements.

    -

    Usage

    -

    FilterStates$remove_filter_state(state)

    +
    +

    +
    +
    +

    Method remove_filter_state() +

    +

    Remove one or more FilterStates from the state_list along with their UI elements.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$remove_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices) specifying FilterState objects to remove; teal_slices may contain only dataname and varname, other elements are ignored

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    +

    +
    +
    +

    Method get_filter_state() +

    Gets reactive values from active FilterState objects.

    Get active filter state from FilterState objects stored in state_list(s). -The output is a list compatible with input to self$set_filter_state.

    -

    Usage

    -

    FilterStates$get_filter_state()

    +The output is a list compatible with input to self$set_filter_state.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$get_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    Object of class teal_slices.

    -


    -

    Method set_filter_state()

    -

    Sets active FilterState objects.

    -

    Usage

    -

    FilterStates$set_filter_state(state)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Sets active FilterState objects.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$set_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Function that raises an error.

    -


    -

    Method clear_filter_states()

    -

    Remove all FilterState objects from this FilterStates object.

    -

    Usage

    -

    FilterStates$clear_filter_states(force = FALSE)

    +
    +

    +
    +
    +

    Method clear_filter_states() +

    +

    Remove all FilterState objects from this FilterStates object.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$clear_filter_states(force = FALSE)
    +

    +
    -

    Arguments

    -

    force
    +

    Arguments +

    +

    +
    +
    +
    force

    (logical(1)) flag specifying whether to include anchored filter states.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method ui_active()

    +
    +

    +
    +
    +

    Method ui_active() +

    shiny UI definition that stores FilterState UI elements. -Populated with elements created with renderUI in the module server.

    -

    Usage

    -

    FilterStates$ui_active(id)

    +Populated with elements created with renderUI in the module server.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$ui_active(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_active()

    -

    shiny server module.

    -

    Usage

    -

    FilterStates$srv_active(id)

    +
    +

    +
    +
    +

    Method srv_active() +

    +

    shiny server module.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$srv_active(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL.

    -


    -

    Method ui_add()

    -

    shiny UI module to add filter variable.

    -

    Usage

    -

    FilterStates$ui_add(id)

    +
    +

    +
    +
    +

    Method ui_add() +

    +

    shiny UI module to add filter variable.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$ui_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_add()

    +
    +

    +
    +
    +

    Method srv_add() +

    shiny server module to add filter variable.

    This module controls available choices to select as a filter variable. Once selected, a variable is removed from available choices. -Removing a filter variable adds it back to available choices.

    -

    Usage

    -

    FilterStates$srv_add(id)

    +Removing a filter variable adds it back to available choices.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$srv_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL.

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    FilterStates$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -452,17 +699,19 @@

    Arguments

    + +
    + +
    - - + + diff --git a/v0.5.0/reference/FilteredData.html b/v0.5.0/reference/FilteredData.html index b26e17365..f98306b65 100644 --- a/v0.5.0/reference/FilteredData.html +++ b/v0.5.0/reference/FilteredData.html @@ -1,8 +1,24 @@ - -Class to encapsulate filtered datasets — FilteredData • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,7 +106,8 @@ + +
    -

    Methods

    +

    Methods +


    -

    Method new()

    -

    Initialize a FilteredData object.

    -

    Usage

    -

    FilteredData$new(data_objects, join_keys = teal.data::join_keys())

    + +
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilteredData object.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$new(data_objects, join_keys = teal.data::join_keys())
    +

    +
    -

    Arguments

    -

    data_objects
    +

    Arguments +

    +

    +
    +
    +
    data_objects

    (named list) List of data objects. Names of the list will be used as dataname for respective datasets.

    @@ -157,65 +204,113 @@

    Argumentsteal.data::join_keys().

    -

    +
    +

    +
    -


    -

    Method datanames()

    -

    Gets datanames.

    -

    Usage

    -

    FilteredData$datanames()

    +
    +

    +
    +
    +

    Method datanames() +

    +

    Gets datanames.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$datanames()
    +

    +
    -

    Details

    +

    Details +

    The datanames are returned in the order in which they must be evaluated (in case of dependencies).

    -

    Returns

    +

    Returns +

    Character vector.

    -


    -

    Method get_datalabel()

    +
    +

    +
    +
    +

    Method get_datalabel() +

    Gets data label for the dataset. -Useful to display in Show R Code.

    -

    Usage

    -

    FilteredData$get_datalabel(dataname)

    +Useful to display in Show R Code.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_datalabel(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Character string.

    -


    -

    Method set_available_teal_slices()

    -

    Set list of external filter states available for activation.

    -

    Usage

    -

    FilteredData$set_available_teal_slices(x)

    +
    +

    +
    +
    +

    Method set_available_teal_slices() +

    +

    Set list of external filter states available for activation.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$set_available_teal_slices(x)
    +

    +
    -

    Arguments

    -

    x
    +

    Arguments +

    +

    +
    +
    +
    x

    (reactive) should return teal_slices

    -

    +
    +

    +
    -

    Details

    +

    Details +

    Unlike adding new filter from the column, these filters can come with some prespecified settings. teal_slices are wrapped in a reactive so they can be updated from elsewhere in the app. Filters passed in x are limited to those that can be set for this FilteredData object, @@ -224,46 +319,76 @@

    Details -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method get_available_teal_slices()

    -

    Get list of filter states available for this object.

    -

    Usage

    -

    FilteredData$get_available_teal_slices()

    +
    +

    +
    +
    +

    Method get_available_teal_slices() +

    +

    Get list of filter states available for this object.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_available_teal_slices()
    +

    +
    -

    Details

    +

    Details +

    All teal_slice objects that have been created since the beginning of the app session are stored in one teal_slices object. This returns a subset of that teal_slices, describing filter states that can be set for this object.

    -

    Returns

    +

    Returns +

    reactive that returns teal_slices.

    -


    -

    Method get_call()

    -

    Gets a call to filter the dataset according to the filter state.

    -

    Usage

    -

    FilteredData$get_call(dataname)

    +
    +

    +
    +
    +

    Method get_call() +

    +

    Gets a call to filter the dataset according to the filter state.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset

    -

    +
    +

    +
    -

    Details

    +

    Details +

    It returns a call to filter the dataset only, assuming the other (filtered) datasets it depends on are available.

    Together with self$datanames() which returns the datasets in the correct @@ -277,21 +402,36 @@

    Details -

    Returns

    +

    Returns +

    A list of calls.

    -


    -

    Method get_data()

    +
    +

    +
    +
    +

    Method get_data() +

    Gets filtered or unfiltered dataset.

    -

    For filtered = FALSE, the original data set with set_data is returned including all attributes.

    -

    Usage

    -

    FilteredData$get_data(dataname, filtered = TRUE)

    +

    For filtered = FALSE, the original data set with set_data is returned including all attributes.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_data(dataname, filtered = TRUE)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset.

    @@ -299,77 +439,139 @@

    Arguments -

    Returns

    +

    Returns +

    A data object, a data.frame or a MultiAssayExperiment.

    -


    -

    Method get_join_keys()

    -

    Get join keys between two datasets.

    -

    Usage

    -

    FilteredData$get_join_keys()

    +
    +

    +
    +
    +

    Method get_join_keys() +

    +

    Get join keys between two datasets.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_join_keys()
    +

    +
    -

    Returns

    +

    Returns +

    join_keys

    -


    -

    Method get_filter_overview()

    +
    +

    +
    +
    +

    Method get_filter_overview() +

    Creates filter overview table to be displayed in the application. One row is created per dataset, according to the get_filter_overview methods -of the contained FilteredDataset objects.

    -

    Usage

    -

    FilteredData$get_filter_overview(datanames)

    +of the contained FilteredDataset objects.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_filter_overview(datanames)
    +

    +
    -

    Arguments

    -

    datanames
    +

    Arguments +

    +

    +
    +
    +
    datanames

    (character) vector of dataset names.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    A data.frame listing the numbers of observations in all datasets.

    -


    -

    Method get_keys()

    -

    Get keys for the dataset.

    -

    Usage

    -

    FilteredData$get_keys(dataname)

    +
    +

    +
    +
    +

    Method get_keys() +

    +

    Get keys for the dataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_keys(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Character vector of key column names.

    -


    -

    Method set_dataset()

    -

    Adds a dataset to this FilteredData.

    -

    Usage

    -

    FilteredData$set_dataset(data, dataname)

    +
    +

    +
    +
    +

    Method set_dataset() +

    +

    Adds a dataset to this FilteredData.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$set_dataset(data, dataname)
    +

    +
    -

    Arguments

    -

    data
    +

    Arguments +

    +

    +
    +
    +
    data

    (data.frame or MultiAssayExperiment) data to be filtered.

    @@ -379,10 +581,13 @@

    Arguments -

    Details

    +

    Details +

    set_dataset creates a FilteredDataset object which keeps dataset for the filtering purpose. If this data has a parent specified in the join_keys object stored in private$join_keys then created FilteredDataset (child) gets linked with other FilteredDataset (parent). @@ -391,52 +596,95 @@

    Details -

    Returns

    +

    Returns +

    self, invisibly.

    -


    -

    Method set_join_keys()

    -

    Set the join_keys.

    -

    Usage

    -

    FilteredData$set_join_keys(join_keys)

    +
    +

    +
    +
    +

    Method set_join_keys() +

    +

    Set the join_keys.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$set_join_keys(join_keys)
    +

    +
    -

    Arguments

    -

    join_keys
    +

    Arguments +

    +

    +
    +
    +
    join_keys

    (join_keys), see teal.data::join_keys().

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    self, invisibly.

    -


    -

    Method get_filter_state()

    -

    Gets states of all contained FilterState objects.

    -

    Usage

    -

    FilteredData$get_filter_state()

    +
    +

    +
    +
    +

    Method get_filter_state() +

    +

    Gets states of all contained FilterState objects.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    A teal_slices object.

    -


    -

    Method format()

    -

    Returns a formatted string representing this FilteredData object.

    -

    Usage

    -

    FilteredData$format(show_all = FALSE, trim_lines = TRUE)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns a formatted string representing this FilteredData object.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$format(show_all = FALSE, trim_lines = TRUE)
    +

    +
    -

    Arguments

    -

    show_all
    +

    Arguments +

    +

    +
    +
    +
    show_all

    (logical(1)) passed to format.teal_slice.

    @@ -444,81 +692,148 @@

    Arguments -

    Returns

    +

    Returns +

    character(1) the formatted string.

    -


    -

    Method print()

    -

    Prints this FilteredData object.

    -

    Usage

    -

    FilteredData$print(...)

    +
    +

    +
    +
    +

    Method print() +

    +

    Prints this FilteredData object.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$print(...)
    +

    +
    -

    Arguments

    -

    ...
    +

    Arguments +

    +

    +
    +
    +
    ...

    additional arguments passed to format.

    -

    +
    +

    +
    -


    -

    Method set_filter_state()

    -

    Sets active filter states.

    -

    Usage

    -

    FilteredData$set_filter_state(state)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Sets active filter states.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$set_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method remove_filter_state()

    -

    Removes one or more FilterState from a FilteredData object.

    -

    Usage

    -

    FilteredData$remove_filter_state(state)

    +
    +

    +
    +
    +

    Method remove_filter_state() +

    +

    Removes one or more FilterState from a FilteredData object.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$remove_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices) specifying FilterState objects to remove; teal_slices may contain only dataname and varname, other elements are ignored.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method clear_filter_states()

    -

    Remove all FilterStates of a FilteredDataset or all FilterStates of a FilteredData object.

    -

    Usage

    -

    FilteredData$clear_filter_states(datanames = self$datanames(), force = FALSE)

    +
    +

    +
    +
    +

    Method clear_filter_states() +

    +

    Remove all FilterStates of a FilteredDataset or all FilterStates of a FilteredData object.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$clear_filter_states(datanames = self$datanames(), force = FALSE)
    +

    +
    -

    Arguments

    -

    datanames
    +

    Arguments +

    +

    +
    +
    +
    datanames

    (character) names of datasets for which to remove all filter states. Defaults to all datasets in this FilteredData object.

    @@ -529,45 +844,79 @@

    Arguments -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method ui_filter_panel()

    +
    +

    +
    +
    +

    Method ui_filter_panel() +

    top-level shiny module for the filter panel in the teal app. -Contains 1) filter overview panel, 2) filter active panel, and 3) add filters panel.

    -

    Usage

    -

    FilteredData$ui_filter_panel(id)

    +Contains 1) filter overview panel, 2) filter active panel, and 3) add filters panel.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$ui_filter_panel(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_filter_panel()

    -

    Server function for filter panel.

    -

    Usage

    -

    FilteredData$srv_filter_panel(id, active_datanames = self$datanames)

    +
    +

    +
    +
    +

    Method srv_filter_panel() +

    +

    Server function for filter panel.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$srv_filter_panel(id, active_datanames = self$datanames)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    @@ -580,44 +929,78 @@

    Arguments -

    Returns

    +

    Returns +

    NULL.

    -


    -

    Method ui_active()

    -

    Server module responsible for displaying active filters.

    -

    Usage

    -

    FilteredData$ui_active(id)

    +
    +

    +
    +
    +

    Method ui_active() +

    +

    Server module responsible for displaying active filters.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$ui_active(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_active()

    -

    Server module responsible for displaying active filters.

    -

    Usage

    -

    FilteredData$srv_active(id, active_datanames = self$datanames)

    +
    +

    +
    +
    +

    Method srv_active() +

    +

    Server module responsible for displaying active filters.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$srv_active(id, active_datanames = self$datanames)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    @@ -627,44 +1010,78 @@

    Arguments -

    Returns

    +

    Returns +

    NULL.

    -


    -

    Method ui_add()

    -

    Server module responsible for displaying drop-downs with variables to add a filter.

    -

    Usage

    -

    FilteredData$ui_add(id)

    +
    +

    +
    +
    +

    Method ui_add() +

    +

    Server module responsible for displaying drop-downs with variables to add a filter.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$ui_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_add()

    -

    Server module responsible for displaying drop-downs with variables to add a filter.

    -

    Usage

    -

    FilteredData$srv_add(id, active_datanames = reactive(self$datanames()))

    +
    +

    +
    +
    +

    Method srv_add() +

    +

    Server module responsible for displaying drop-downs with variables to add a filter.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$srv_add(id, active_datanames = reactive(self$datanames()))
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    @@ -674,45 +1091,78 @@

    Arguments -

    Returns

    +

    Returns +

    NULL.

    -


    -

    Method ui_overview()

    +
    +

    +
    +
    +

    Method ui_overview() +

    Creates the UI definition for the module showing counts for each dataset contrasting the filtered to the full unfiltered dataset.

    Per dataset, it displays the number of rows/observations in each dataset, -the number of unique subjects.

    -

    Usage

    -

    FilteredData$ui_overview(id)

    +the number of unique subjects.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$ui_overview(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -


    -

    Method srv_overview()

    +
    +

    +
    +
    +

    Method srv_overview() +

    Server function to display the number of records in the filtered and unfiltered -data.

    -

    Usage

    -

    FilteredData$srv_overview(id, active_datanames = self$datanames)

    +data.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$srv_overview(id, active_datanames = self$datanames)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    @@ -725,27 +1175,46 @@

    Arguments -

    Returns

    +

    Returns +

    NULL.

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    FilteredData$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -753,17 +1222,19 @@

    Arguments

    + +
    + +
    - - + + diff --git a/v0.5.0/reference/FilteredDataset.html b/v0.5.0/reference/FilteredDataset.html index cba428afe..01da9f1f3 100644 --- a/v0.5.0/reference/FilteredDataset.html +++ b/v0.5.0/reference/FilteredDataset.html @@ -1,16 +1,32 @@ - - + + + + + +FilteredDataset R6 class — FilteredDataset • teal.slice +FilteredDataset R6 class — FilteredDataset • teal.slice + + + + + + + + + + Skip to contents @@ -26,7 +42,8 @@ + +
    @@ -96,12 +119,15 @@
    -

    Methods

    +

    Methods +


    -

    Method new()

    -

    Initializes this FilteredDataset object.

    -

    Usage

    -

    +

    +
    +
    +

    Method new() +

    +

    Initializes this FilteredDataset object.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$new(
       dataset,
       dataname,
       keys = character(0),
       label = attr(dataset, "label")
    -)

    +)
    +

    +
    -

    Arguments

    -

    dataset
    +

    Arguments +

    +

    +
    +
    +
    dataset

    any object

    @@ -152,23 +193,40 @@

    Arguments -

    Returns

    +

    Returns +

    Object of class FilteredDataset, invisibly.

    -


    -

    Method format()

    -

    Returns a formatted string representing this FilteredDataset object.

    -

    Usage

    -

    FilteredDataset$format(show_all = FALSE, trim_lines = TRUE)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns a formatted string representing this FilteredDataset object.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$format(show_all = FALSE, trim_lines = TRUE)
    +

    +
    -

    Arguments

    -

    show_all
    +

    Arguments +

    +

    +
    +
    +
    show_all

    (logical(1)) passed to format.teal_slice.

    @@ -176,289 +234,526 @@

    Arguments -

    Returns

    +

    Returns +

    The formatted character string.

    -


    -

    Method print()

    -

    Prints this FilteredDataset object.

    -

    Usage

    -

    FilteredDataset$print(...)

    +
    +

    +
    +
    +

    Method print() +

    +

    Prints this FilteredDataset object.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$print(...)
    +

    +
    -

    Arguments

    -

    ...
    +

    Arguments +

    +

    +
    +
    +
    ...

    additional arguments passed to format.

    -

    +
    +

    +
    -


    -

    Method clear_filter_states()

    -

    Removes all filter items applied to this dataset.

    -

    Usage

    -

    FilteredDataset$clear_filter_states(force = FALSE)

    +
    +

    +
    +
    +

    Method clear_filter_states() +

    +

    Removes all filter items applied to this dataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$clear_filter_states(force = FALSE)
    +

    +
    -

    Arguments

    -

    force
    +

    Arguments +

    +

    +
    +
    +
    force

    (logical(1)) flag specifying whether to include anchored filter states.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL.

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Gets a filter expression.

    This function returns filter calls equivalent to selected items within each of filter_states. Configuration of the calls is constant and -depends on filter_states type and order which are set during initialization.

    -

    Usage

    -

    FilteredDataset$get_call(sid = "")

    +depends on filter_states type and order which are set during initialization.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_call(sid = "")
    +

    +
    -

    Arguments

    -

    sid
    +

    Arguments +

    +

    +
    +
    +
    sid

    (character) when specified, the method returns code containing conditions calls of FilterState objects with sid different to this sid argument.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Either a list of filter calls, or NULL.

    -


    -

    Method get_filter_state()

    -

    Gets states of all contained FilterState objects.

    -

    Usage

    -

    FilteredDataset$get_filter_state()

    +
    +

    +
    +
    +

    Method get_filter_state() +

    +

    Gets states of all contained FilterState objects.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    A teal_slices object.

    -


    -

    Method set_filter_state()

    -

    Set filter state.

    -

    Usage

    -

    FilteredDataset$set_filter_state(state)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Set filter state.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$set_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Virtual method, returns nothing and raises error.

    -


    -

    Method get_filter_count()

    -

    Gets the number of FilterState objects in all FilterStates in this FilteredDataset.

    -

    Usage

    -

    FilteredDataset$get_filter_count()

    +
    +

    +
    +
    +

    Method get_filter_count() +

    +

    Gets the number of FilterState objects in all FilterStates in this FilteredDataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_filter_count()
    +

    +
    -

    Returns

    +

    Returns +

    integer(1)

    -


    -

    Method get_dataname()

    -

    Gets the name of the dataset.

    -

    Usage

    -

    FilteredDataset$get_dataname()

    +
    +

    +
    +
    +

    Method get_dataname() +

    +

    Gets the name of the dataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_dataname()
    +

    +
    -

    Returns

    +

    Returns +

    A character string.

    -


    -

    Method get_dataset()

    -

    Gets the dataset object in this FilteredDataset.

    -

    Usage

    -

    FilteredDataset$get_dataset(filtered = FALSE)

    +
    +

    +
    +
    +

    Method get_dataset() +

    +

    Gets the dataset object in this FilteredDataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_dataset(filtered = FALSE)
    +

    +
    -

    Arguments

    -

    filtered
    +

    Arguments +

    +

    +
    +
    +
    filtered

    (logical(1))

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    The stored dataset. If data.frame or MultiAssayExperiment, either raw or as a reactive with current filters applied (depending on filtered).

    -


    -

    Method get_filter_overview()

    -

    Get filter overview of a dataset.

    -

    Usage

    -

    FilteredDataset$get_filter_overview()

    +
    +

    +
    +
    +

    Method get_filter_overview() +

    +

    Get filter overview of a dataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_filter_overview()
    +

    +
    -

    Returns

    +

    Returns +

    Virtual method, returns nothing and raises an error.

    -


    -

    Method get_keys()

    -

    Gets the key columns for this dataset.

    -

    Usage

    -

    FilteredDataset$get_keys()

    +
    +

    +
    +
    +

    Method get_keys() +

    +

    Gets the key columns for this dataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_keys()
    +

    +
    -

    Returns

    +

    Returns +

    Character vector of variable names

    -


    -

    Method get_dataset_label()

    -

    Gets the dataset label.

    -

    Usage

    -

    FilteredDataset$get_dataset_label()

    +
    +

    +
    +
    +

    Method get_dataset_label() +

    +

    Gets the dataset label.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_dataset_label()
    +

    +
    -

    Returns

    +

    Returns +

    Character string.

    -


    -

    Method ui_active()

    -

    shiny module containing active filters for a dataset, along with a title and a remove button.

    -

    Usage

    -

    FilteredDataset$ui_active(id)

    +
    +

    +
    +
    +

    Method ui_active() +

    +

    shiny module containing active filters for a dataset, along with a title and a remove button.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$ui_active(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_active()

    -

    Server module for a dataset active filters.

    -

    Usage

    -

    FilteredDataset$srv_active(id)

    +
    +

    +
    +
    +

    Method srv_active() +

    +

    Server module for a dataset active filters.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$srv_active(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL.

    -


    -

    Method ui_add()

    -

    UI module to add filter variable for this dataset.

    -

    Usage

    -

    FilteredDataset$ui_add(id)

    +
    +

    +
    +
    +

    Method ui_add() +

    +

    UI module to add filter variable for this dataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$ui_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Virtual method, returns nothing and raises error.

    -


    -

    Method srv_add()

    +
    +

    +
    +
    +

    Method srv_add() +

    Server module to add filter variable for this dataset. For this class srv_add calls multiple modules of the same name from FilterStates as MAEFilteredDataset -contains one FilterStates object for colData and one for each experiment.

    -

    Usage

    -

    FilteredDataset$srv_add(id)

    +contains one FilterStates object for colData and one for each experiment.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$srv_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL.

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    FilteredDataset$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -466,17 +761,19 @@

    Arguments

    + +
    + +
    - - + + diff --git a/v0.5.0/reference/LogicalFilterState.html b/v0.5.0/reference/LogicalFilterState.html index ecc229d8e..3a5e2fd51 100644 --- a/v0.5.0/reference/LogicalFilterState.html +++ b/v0.5.0/reference/LogicalFilterState.html @@ -1,8 +1,24 @@ - -FilterState object for logical data — LogicalFilterState • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,40 +107,60 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterState -> LogicalFilterState

    +

    Inherited methods


    -

    Method new()

    -

    Initialize a FilterState object.

    -

    Usage

    -

    LogicalFilterState$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterState object.

    +
    +

    Usage +

    +

    +
    +
    LogicalFilterState$new(
       x,
       x_reactive = reactive(NULL),
       extract_type = character(0),
       slice
    -)

    +)
    +

    +
    -

    Arguments

    -

    x
    +

    Arguments +

    +

    + -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection. -For LogicalFilterState it's a !<varname> or <varname> and optionally is.na(<varname>)

    -

    Usage

    -

    LogicalFilterState$get_call(dataname)

    +For LogicalFilterState it's a !<varname> or <varname> and optionally is.na(<varname>)

    +
    +

    Usage +

    +

    +
    +
    LogicalFilterState$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    name of data set; defaults to private$get_dataname()

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    call

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    LogicalFilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    LogicalFilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -196,17 +279,19 @@

    Arguments

    + +
    + +
    - - + + diff --git a/v0.5.0/reference/MAEFilterStates.html b/v0.5.0/reference/MAEFilterStates.html index 64678d478..23832a8c6 100644 --- a/v0.5.0/reference/MAEFilterStates.html +++ b/v0.5.0/reference/MAEFilterStates.html @@ -1,8 +1,24 @@ - -FilterStates subclass for MultiAssayExperiments — MAEFilterStates • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,18 +107,25 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterStates -> MAEFilterStates

    -

    Methods

    +

    Methods +

    Inherited methods +
    +

    Inherited methods


    -

    Method new()

    -

    Initialize MAEFilterStates object.

    -

    Usage

    -

    MAEFilterStates$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize MAEFilterStates object.

    +
    +

    Usage +

    +

    +
    +
    MAEFilterStates$new(
       data,
       data_reactive = function(sid = "") NULL,
       dataname,
       datalabel = "subjects",
       keys = character(0)
    -)

    +)
    +

    +
    -

    Arguments

    -

    data
    +

    Arguments +

    +

    +
    +
    +
    data

    (MultiAssayExperiment) the R object which MultiAssayExperiment::subsetByColData function is applied on.

    @@ -155,23 +198,41 @@

    Arguments
    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    MAEFilterStates$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    MAEFilterStates$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -179,17 +240,19 @@

    Arguments

    + +

    + +
    - - + + diff --git a/v0.5.0/reference/MAEFilteredDataset.html b/v0.5.0/reference/MAEFilteredDataset.html index ba2897f7b..b36e7da31 100644 --- a/v0.5.0/reference/MAEFilteredDataset.html +++ b/v0.5.0/reference/MAEFilteredDataset.html @@ -1,10 +1,26 @@ - -MAEFilteredDataset R6 class — MAEFilteredDataset • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + +
    @@ -87,22 +110,29 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilteredDataset -> MAEFilteredDataset

    +

    Inherited methods


    -

    Method new()

    -

    Initialize MAEFilteredDataset object.

    -

    Usage

    -

    MAEFilteredDataset$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize MAEFilteredDataset object.

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$new(
       dataset,
       dataname,
       keys = character(0),
       label = character(0)
    -)

    +)
    +

    +
    -

    Arguments

    -

    dataset
    +

    Arguments +

    +

    +
    +
    +
    dataset

    (MulitiAssayExperiment) single MulitiAssayExperiment for which filters are rendered.

    @@ -149,102 +192,183 @@

    Arguments -

    Returns

    +

    Returns +

    Object of class MAEFilteredDataset, invisibly.

    -


    -

    Method set_filter_state()

    -

    Set filter state.

    -

    Usage

    -

    MAEFilteredDataset$set_filter_state(state)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Set filter state.

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$set_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method remove_filter_state()

    -

    Remove one or more FilterState of a MAEFilteredDataset.

    -

    Usage

    -

    MAEFilteredDataset$remove_filter_state(state)

    +
    +

    +
    +
    +

    Method remove_filter_state() +

    +

    Remove one or more FilterState of a MAEFilteredDataset.

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$remove_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices) specifying FilterState objects to remove; teal_slices may contain only dataname and varname, other elements are ignored.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method ui_add()

    -

    UI module to add filter variable for this dataset.

    -

    Usage

    -

    MAEFilteredDataset$ui_add(id)

    +
    +

    +
    +
    +

    Method ui_add() +

    +

    UI module to add filter variable for this dataset.

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$ui_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method get_filter_overview()

    -

    Creates row for filter overview in the form of
    dataname -- observations (remaining/total) -- subjects (remaining/total) - MAE

    -

    Usage

    -

    MAEFilteredDataset$get_filter_overview()

    +
    +

    +
    +
    +

    Method get_filter_overview() +

    +

    Creates row for filter overview in the form of
    dataname -- observations (remaining/total) -- subjects (remaining/total) - MAE

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$get_filter_overview()
    +

    +
    -

    Returns

    +

    Returns +

    A data.frame.

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    MAEFilteredDataset$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -252,17 +376,19 @@

    Arguments

    + +
    + +
    - - + + diff --git a/v0.5.0/reference/MatrixFilterStates.html b/v0.5.0/reference/MatrixFilterStates.html index 654cc0f0d..7a403e0e4 100644 --- a/v0.5.0/reference/MatrixFilterStates.html +++ b/v0.5.0/reference/MatrixFilterStates.html @@ -1,8 +1,24 @@ - -FilterStates subclass for matrices — MatrixFilterStates • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,18 +107,25 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterStates -> MatrixFilterStates

    -

    Methods

    +

    Methods +

    Inherited methods +
    +

    Inherited methods


    -

    Method new()

    -

    Initialize MatrixFilterStates object.

    -

    Usage

    -

    MatrixFilterStates$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize MatrixFilterStates object.

    +
    +

    Usage +

    +

    +
    +
    MatrixFilterStates$new(
       data,
       data_reactive = function(sid = "") NULL,
       dataname,
       datalabel = NULL
    -)

    +)
    +

    +
    -

    Arguments

    -

    data
    +

    Arguments +

    +

    +
    +
    +
    data

    (matrix) the R object which subset function is applied on.

    @@ -144,23 +187,41 @@

    Arguments
    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    MatrixFilterStates$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    MatrixFilterStates$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -168,17 +229,19 @@

    Arguments

    + +

    + +
    - - + + diff --git a/v0.5.0/reference/RangeFilterState.html b/v0.5.0/reference/RangeFilterState.html index 84417b101..e92d8f157 100644 --- a/v0.5.0/reference/RangeFilterState.html +++ b/v0.5.0/reference/RangeFilterState.html @@ -1,8 +1,24 @@ - -FilterState object for numeric data — RangeFilterState • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,41 +107,61 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterState -> RangeFilterState

    +

    Inherited methods


    -

    Method new()

    -

    Initialize a FilterState object for range selection.

    -

    Usage

    -

    RangeFilterState$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterState object for range selection.

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$new(
       x,
       x_reactive = reactive(NULL),
       extract_type = character(0),
       slice
    -)

    +)
    +

    +
    -

    Arguments

    -

    x
    +

    Arguments +

    +

    + -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection. For this class returned call looks like <varname> >= <min value> & <varname> <= <max value> with -optional is.na(<varname>) and is.finite(<varname>).

    -

    Usage

    -

    RangeFilterState$get_call(dataname)

    +optional is.na(<varname>) and is.finite(<varname>).

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    name of data set; defaults to private$get_dataname()

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    call

    -


    -

    Method get_keep_inf()

    -

    Returns current keep_inf selection.

    -

    Usage

    -

    RangeFilterState$get_keep_inf()

    +
    +

    +
    +
    +

    Method get_keep_inf() +

    +

    Returns current keep_inf selection.

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$get_keep_inf()
    +

    +
    -

    Returns

    +

    Returns +

    logical(1)

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    RangeFilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -211,17 +305,19 @@

    Arguments

    + +
    + +
    - - + + diff --git a/v0.5.0/reference/SEFilterStates.html b/v0.5.0/reference/SEFilterStates.html index a2b11853a..e61653439 100644 --- a/v0.5.0/reference/SEFilterStates.html +++ b/v0.5.0/reference/SEFilterStates.html @@ -1,8 +1,24 @@ - -FilterStates subclass for SummarizedExperiments — SEFilterStates • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,21 +107,28 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterStates -> SEFilterStates

    +

    Inherited methods


    -

    Method new()

    -

    Initialize SEFilterStates object.

    -

    Usage

    -

    SEFilterStates$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize SEFilterStates object.

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$new(
       data,
       data_reactive = function(sid = "") NULL,
       dataname,
       datalabel = NULL
    -)

    +)
    +

    +
    -

    Arguments

    -

    data
    +

    Arguments +

    +

    +
    +
    +
    data

    (SummarizedExperiment) the R object which subset function is applied on.

    @@ -144,92 +187,161 @@

    Arguments
    -

    Method set_filter_state()

    -

    Set filter state.

    -

    Usage

    -

    SEFilterStates$set_filter_state(state)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Set filter state.

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$set_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices) teal_slice objects should contain the field arg %in% c("subset", "select")

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method ui_add()

    -

    shiny UI module to add filter variable.

    -

    Usage

    -

    SEFilterStates$ui_add(id)

    +
    +

    +
    +
    +

    Method ui_add() +

    +

    shiny UI module to add filter variable.

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$ui_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_add()

    +
    +

    +
    +
    +

    Method srv_add() +

    shiny server module to add filter variable.

    Module controls available choices to select as a filter variable. Selected filter variable is being removed from available choices. Removed filter variable gets back to available choices. This module unlike other FilterStates classes manages two sets of filter variables - one for colData and another for -rowData.

    -

    Usage

    -

    SEFilterStates$srv_add(id)

    +rowData.

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$srv_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    SEFilterStates$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -237,17 +349,19 @@

    Arguments

    + +
    + +
    - - + + diff --git a/v0.5.0/reference/calls_combine_by.html b/v0.5.0/reference/calls_combine_by.html index 04f78264a..2b38f5c36 100644 --- a/v0.5.0/reference/calls_combine_by.html +++ b/v0.5.0/reference/calls_combine_by.html @@ -1,8 +1,24 @@ - -Compose predicates — calls_combine_by • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +

    @@ -83,13 +105,16 @@
    -

    Usage

    +

    Usage +

    calls_combine_by(calls, operator)
    -

    Arguments

    -
    calls
    +

    Arguments +

    +
    +
    calls

    (list) containing calls (or symbols) to be combined by operator

    @@ -98,31 +123,36 @@

    Arguments

    -

    + +
    -

    Value

    +

    Value +

    A call where elements of calls are composed with operator or NULL if calls is an empty list.

    -

    Details

    +

    Details +

    This function is used to combine logical predicates produced by FilterState objects to build a complete subset expression.

    + +
    + +
    - - + + diff --git a/v0.5.0/reference/check_simple_name.html b/v0.5.0/reference/check_simple_name.html index 543bb4323..52545144a 100644 --- a/v0.5.0/reference/check_simple_name.html +++ b/v0.5.0/reference/check_simple_name.html @@ -1,14 +1,30 @@ - - + + + + + +Test whether variable name can be used within Show R Code — check_simple_name • teal.slice +Test whether variable name can be used within Show R Code — check_simple_name • teal.slice + + + + + + + + + + Skip to contents @@ -24,7 +40,8 @@ + +
    @@ -92,35 +115,42 @@
    -

    Usage

    +

    Usage +

    check_simple_name(name)
    -

    Arguments

    -
    name
    +

    Arguments +

    +
    +
    name

    (character) vector of names to check

    -
    + +
    -

    Value

    +

    Value +

    Returns NULL or raises error.

    + +
    + +
    - - + + diff --git a/v0.5.0/reference/choices_labeled.html b/v0.5.0/reference/choices_labeled.html index 3220ee271..e08ed1496 100644 --- a/v0.5.0/reference/choices_labeled.html +++ b/v0.5.0/reference/choices_labeled.html @@ -1,10 +1,26 @@ - -Set "<choice>:<label>" type of names — choices_labeled • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + +
    @@ -86,13 +108,16 @@
    -

    Usage

    +

    Usage +

    choices_labeled(choices, labels, subset = NULL, types = NULL)
    -

    Arguments

    -
    choices
    +

    Arguments +

    +
    +
    choices

    (character or numeric or logical) vector

    @@ -110,31 +135,36 @@

    Arguments -

    Value

    +

    Value +

    A named character vector.

    -

    Details

    +

    Details +

    If either choices or labels are factors, they are coerced to character. Duplicated elements from choices get removed.

    + +
    + +
    - - + + diff --git a/v0.5.0/reference/coalesce_r.html b/v0.5.0/reference/coalesce_r.html index 49d48c6f1..cb4b53318 100644 --- a/v0.5.0/reference/coalesce_r.html +++ b/v0.5.0/reference/coalesce_r.html @@ -1,8 +1,24 @@ - -Recursively coalesce list elements. — coalesce_r • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,24 +105,30 @@
    -

    Usage

    +

    Usage +

    coalesce_r(x)
    -

    Arguments

    -
    x
    +

    Arguments +

    +
    +
    x

    (list), either of atomic vectors or of named lists

    -
    + +
    -

    Value

    +

    Value +

    Either an atomic vector of length 1 or a (potentially nested) list.

    -

    Details

    +

    Details +

    Given a list of atomic vectors, the first non-null element is returned. Given a list of lists, for all names found in all elements of the list the first non-null element of a given name is returned.

    @@ -108,17 +136,19 @@

    Details

    + +
    + +
    - - + + diff --git a/v0.5.0/reference/countBar.html b/v0.5.0/reference/countBar.html index 7dc7dad95..e04189e00 100644 --- a/v0.5.0/reference/countBar.html +++ b/v0.5.0/reference/countBar.html @@ -1,8 +1,24 @@ - -Progress bar with label — countBar • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,7 +105,8 @@
    -

    Usage

    +

    Usage +

    countBar(inputId, label, countmax, countnow = NULL, counttotal = countmax)
     
     updateCountBar(
    @@ -105,8 +128,10 @@ 

    Usage

    -

    Arguments

    -
    inputId
    +

    Arguments +

    +
    +
    inputId

    (character(1)) shiny id of the parent element (e.g. a check-box group input).

    @@ -129,32 +154,40 @@

    Arguments -

    Value

    +

    Value +

    shiny.tag object with a progress bar and a label.

    -

    Details

    -

    A progress bar is created to visualize the number of counts in a variable, with filling and a text label.

    • progress bar width is derived as a fraction of the container width: style = "width: <countmax> / <counttotal>%",

    • +

      Details +

      +

      A progress bar is created to visualize the number of counts in a variable, with filling and a text label.

      +
        +
      • progress bar width is derived as a fraction of the container width: style = "width: <countmax> / <counttotal>%",

      • progress bar is filled up to the fraction <countnow> / <countmax>,

      • text label is obtained by <label> (<countnow> / <countmax>).

      • -
    + +
    + +
    + +
    - - + + diff --git a/v0.5.0/reference/countBars.html b/v0.5.0/reference/countBars.html index faefd13f2..8a104a897 100644 --- a/v0.5.0/reference/countBars.html +++ b/v0.5.0/reference/countBars.html @@ -1,8 +1,24 @@ - -Progress bars with labels — countBars • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,7 +105,8 @@
    -

    Usage

    +

    Usage +

    countBars(inputId, choices, countsmax, countsnow = NULL)
     
     updateCountBars(
    @@ -96,8 +119,10 @@ 

    Usage

    -

    Arguments

    -
    inputId
    +

    Arguments +

    +
    +
    inputId

    (character(1)) shiny id of the parent element (e.g. a check-box group input).

    @@ -116,9 +141,11 @@

    Arguments -

    Value

    +

    Value +

    List of shiny.tags.

    @@ -138,17 +165,19 @@

    Value

    + +
    + + - - + + diff --git a/v0.5.0/reference/data_choices_labeled.html b/v0.5.0/reference/data_choices_labeled.html index 9511ff1ef..a20ee5569 100644 --- a/v0.5.0/reference/data_choices_labeled.html +++ b/v0.5.0/reference/data_choices_labeled.html @@ -1,8 +1,24 @@ - -Returns a choices_labeled object — data_choices_labeled • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -83,7 +105,8 @@
    -

    Usage

    +

    Usage +

    data_choices_labeled(
       data,
       choices,
    @@ -93,8 +116,10 @@ 

    Usage

    -

    Arguments

    -
    data
    +

    Arguments +

    +
    +
    data

    (data.frame or DFrame or list) where labels can be taken from in case when varlabels is not specified. data must be specified if varlabels is not specified.

    @@ -114,26 +139,30 @@

    Arguments -

    Value

    +

    Value +

    character(0) if choices are empty; a choices_labeled object otherwise

    + + + + - - + + diff --git a/v0.5.0/reference/eval_expr_with_msg.html b/v0.5.0/reference/eval_expr_with_msg.html index 9eb8a7747..8c4d64327 100644 --- a/v0.5.0/reference/eval_expr_with_msg.html +++ b/v0.5.0/reference/eval_expr_with_msg.html @@ -1,12 +1,28 @@ - - + + + + + +Evaluate expression with meaningful message — eval_expr_with_msg • teal.slice +Evaluate expression with meaningful message — eval_expr_with_msg • teal.slice + + + + + + + + + + Skip to contents @@ -22,7 +38,8 @@ + + @@ -89,39 +111,46 @@
    -

    Usage

    +

    Usage +

    eval_expr_with_msg(expr, env)
    -

    Arguments

    -
    expr
    +

    Arguments +

    +
    +
    expr

    (language)

    env

    (environment) where expression is evaluated.

    -
    + +
    -

    Value

    +

    Value +

    NULL, invisibly.

    + + + + - - + + diff --git a/v0.5.0/reference/fetch_bs_color.html b/v0.5.0/reference/fetch_bs_color.html index cbc70cd6c..a99a1f532 100644 --- a/v0.5.0/reference/fetch_bs_color.html +++ b/v0.5.0/reference/fetch_bs_color.html @@ -1,8 +1,24 @@ - -Get hex code of the current Bootstrap theme color. — fetch_bs_color • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -83,13 +105,16 @@
    -

    Usage

    +

    Usage +

    fetch_bs_color(color, alpha = NULL)
    -

    Arguments

    -
    color
    +

    Arguments +

    +
    +
    color

    (character(1)) naming one of the available theme colors

    @@ -98,26 +123,30 @@

    Arguments -

    Value

    +

    Value +

    Named character(1) containing a hexadecimal color representation.

    + + + + - - + + diff --git a/v0.5.0/reference/filter_state_api.html b/v0.5.0/reference/filter_state_api.html index e73435770..bc2220239 100644 --- a/v0.5.0/reference/filter_state_api.html +++ b/v0.5.0/reference/filter_state_api.html @@ -1,10 +1,26 @@ - -Managing FilteredData states — filter_state_api • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + @@ -86,7 +108,8 @@
    -

    Usage

    +

    Usage +

    set_filter_state(datasets, filter)
     
     get_filter_state(datasets)
    @@ -97,11 +120,15 @@ 

    Usage

    -

    Arguments

    -
    datasets
    -

    (FilteredData) +

    Arguments +

    +
    +
    datasets
    +
    +

    (FilteredData) object to store filter state and filtered datasets, shared across modules

    -

    see FilteredData for details

    +

    see FilteredData for details

    +
    filter
    @@ -113,22 +140,28 @@

    Arguments -

    Value

    +

    Value +

    -
    • set_*, remove_* and clear_filter_state return NULL invisibly

    • +
        +
      • set_*, remove_* and clear_filter_state return NULL invisibly

      • get_filter_state returns a named teal_slices object containing a teal_slice for every existing FilterState

      • -
    + +
    -

    See also

    +

    See also +

    -

    Examples

    +

    Examples +

    datasets <- init_filtered_data(list(iris = iris, mtcars = mtcars))
     fs <- teal_slices(
       teal_slice(dataname = "iris", varname = "Species", selected = c("setosa", "versicolor")),
    @@ -271,17 +304,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/v0.5.0/reference/format_time.html b/v0.5.0/reference/format_time.html index b96940d21..fd5dd846e 100644 --- a/v0.5.0/reference/format_time.html +++ b/v0.5.0/reference/format_time.html @@ -1,8 +1,24 @@ - -Format POSIXt for storage — format_time • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -83,40 +105,48 @@
    -

    Usage

    +

    Usage +

    format_time(x)
    -

    Arguments

    -
    x
    +

    Arguments +

    +
    +
    x

    (POSIXt) vector of date time values or anything else

    -
    + +
    -

    Value

    +

    Value +

    If x is of class POSIXt, a character vector, otherwise x itself.

    -

    Details

    +

    Details +

    Date times are stored as string representations expressed in the UTC time zone. The storage format is YYYY-MM-DD HH:MM:SS.

    + + + + - - + + diff --git a/v0.5.0/reference/get_default_slice_id.html b/v0.5.0/reference/get_default_slice_id.html index 0840dab33..c664a5c60 100644 --- a/v0.5.0/reference/get_default_slice_id.html +++ b/v0.5.0/reference/get_default_slice_id.html @@ -1,8 +1,24 @@ - -Default teal_slice id — get_default_slice_id • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -83,48 +105,59 @@
    -

    Usage

    +

    Usage +

    get_default_slice_id(x)
    -

    Arguments

    -
    x
    +

    Arguments +

    +
    +
    x

    (teal_slice or list)

    -
    + +
    -

    Value

    +

    Value +

    (character(1)) id for a teal_slice object.

    -

    Details

    +

    Details +

    Function returns a default id for a teal_slice object which needs to be distinct from other teal_slice objects created for any FilterStates object. Returned id can be treated as a location of -a vector on which FilterState is built:

    • for a data.frame id concatenates dataname and varname.

    • +a vector on which FilterState is built:

      +
        +
      • for a data.frame id concatenates dataname and varname.

      • for a MultiAssayExperiment id concatenates dataname, varname, experiment and arg, so that one can add teal_slice for a varname which exists in multiple SummarizedExperiments or exists in both colData and rowData of given experiment. For such a vector teal.slice doesn't allow to activate more than one filters. In case of teal_slice_expr id is mandatory and must be unique.

      • -
    + + + + + + - - + + diff --git a/v0.5.0/reference/get_filter_expr.html b/v0.5.0/reference/get_filter_expr.html index f7e6c9e7f..cdc96cf95 100644 --- a/v0.5.0/reference/get_filter_expr.html +++ b/v0.5.0/reference/get_filter_expr.html @@ -1,10 +1,26 @@ - -Gets filter expression for multiple datanames taking into account its order. — get_filter_expr • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + @@ -86,39 +108,46 @@
    -

    Usage

    +

    Usage +

    get_filter_expr(datasets, datanames = datasets$datanames())
    -

    Arguments

    -
    datasets
    +

    Arguments +

    +
    +
    datasets

    (FilteredData)

    datanames

    (character) vector of dataset names

    -
    + +
    -

    Value

    +

    Value +

    A character string containing all subset expressions.

    + + + + - - + + diff --git a/v0.5.0/reference/get_supported_filter_varnames.html b/v0.5.0/reference/get_supported_filter_varnames.html index b37785289..21878e0b9 100644 --- a/v0.5.0/reference/get_supported_filter_varnames.html +++ b/v0.5.0/reference/get_supported_filter_varnames.html @@ -1,10 +1,26 @@ - -Gets supported filterable variable names — get_supported_filter_varnames • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + @@ -86,35 +108,42 @@
    -

    Usage

    +

    Usage +

    get_supported_filter_varnames(data)
    -

    Arguments

    -
    data
    +

    Arguments +

    +
    +
    data

    the R object containing elements which class can be checked through vapply or apply.

    -
    + +
    -

    Value

    +

    Value +

    character vector of variable names.

    + + + + - - + + diff --git a/v0.5.0/reference/include_css_files.html b/v0.5.0/reference/include_css_files.html index 1d48a7d3e..34cfcca3a 100644 --- a/v0.5.0/reference/include_css_files.html +++ b/v0.5.0/reference/include_css_files.html @@ -1,12 +1,28 @@ - - + + + + + +Include CSS files from /inst/css/ package directory to application header — include_css_files • teal.slice +Include CSS files from /inst/css/ package directory to application header — include_css_files • teal.slice + + + + + + + + + + Skip to contents @@ -22,7 +38,8 @@ + + @@ -89,35 +111,42 @@
    -

    Usage

    +

    Usage +

    include_css_files(pattern = "*")
    -

    Arguments

    -
    pattern
    +

    Arguments +

    +
    +
    pattern

    (character) pattern of files to be included

    -
    + +
    -

    Value

    +

    Value +

    HTML code that includes CSS files

    + + + + - - + + diff --git a/v0.5.0/reference/include_js_files.html b/v0.5.0/reference/include_js_files.html index f5fbe5af6..bfeecf723 100644 --- a/v0.5.0/reference/include_js_files.html +++ b/v0.5.0/reference/include_js_files.html @@ -1,12 +1,28 @@ - - + + + + + +Include JS files from /inst/js/ package directory to application header — include_js_files • teal.slice +Include JS files from /inst/js/ package directory to application header — include_js_files • teal.slice + + + + + + + + + + Skip to contents @@ -22,7 +38,8 @@ + + @@ -89,35 +111,42 @@
    -

    Usage

    +

    Usage +

    include_js_files(pattern)
    -

    Arguments

    -
    pattern
    +

    Arguments +

    +
    +
    pattern

    (character) pattern of files to be included, passed to system.file

    -
    + +
    -

    Value

    +

    Value +

    HTML code that includes JS files

    + + + + - - + + diff --git a/v0.5.0/reference/index.html b/v0.5.0/reference/index.html index fbd686bb5..cbc44491b 100644 --- a/v0.5.0/reference/index.html +++ b/v0.5.0/reference/index.html @@ -1,8 +1,22 @@ - -Function reference • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -77,96 +97,132 @@
    -

    teal filter-panel API

    +

    +teal filter-panel API +

    -

    Functions used initialize filter-panel and to modify its states.

    +

    +

    Functions used initialize filter-panel and to modify its states.

    -
    +
    +
    -
    +
    +
    init_filtered_data()
    -
    Initialize FilteredData
    -
    +
    Initialize FilteredData +
    +
    +
    +
    set_filter_state() get_filter_state() remove_filter_state() clear_filter_states()
    Managing FilteredData states
    -
    +
    +
    +
    get_filter_expr()
    Gets filter expression for multiple datanames taking into account its order.
    -
    +
    +
    +
    teal_slice() is.teal_slice() as.teal_slice() as.list(<teal_slice>) format(<teal_slice>) print(<teal_slice>)
    Specify single filter
    -
    +
    +
    +
    teal_slices() is.teal_slices() as.teal_slices() as.list(<teal_slices>) `[`(<teal_slices>) c(<teal_slices>) format(<teal_slices>) print(<teal_slices>)
    Complete filter specification
    -
    -

    For developers

    + +
    +
    +

    For developers +

    -

    Abstract and concrete classes used to build teal functionality.

    +

    +

    Abstract and concrete classes used to build teal functionality.

    -
    +
    +
    -

    R6 Classes

    -

    Abstract and concrete classes used to build teal functionality.

    +

    R6 Classes +

    +

    +

    Abstract and concrete classes used to build teal functionality.

    -
    +
    +
    -
    +
    +
    FilteredData
    Class to encapsulate filtered datasets
    -
    +
    +
    +
    FilteredDataset
    -
    FilteredDataset R6 class
    -
    +
    +FilteredDataset R6 class
    +
    +
    +
    FilterPanelAPI
    Class to encapsulate the API of the filter panel of a teal app
    -
    +
    +
    +
    DataframeFilteredDataset
    The DataframeFilteredDataset R6 class
    -
    +
    +
    +
    MAEFilteredDataset
    -
    MAEFilteredDataset R6 class
    -
    +
    +MAEFilteredDataset R6 class
    + + + + + + - - + + diff --git a/v0.5.0/reference/init_filter_state.html b/v0.5.0/reference/init_filter_state.html index deacfafab..dc4591a09 100644 --- a/v0.5.0/reference/init_filter_state.html +++ b/v0.5.0/reference/init_filter_state.html @@ -1,8 +1,24 @@ - -Initialize FilterState — init_filter_state • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,7 +106,8 @@
    -

    Usage

    +

    Usage +

    init_filter_state(
       x,
       x_reactive = reactive(NULL),
    @@ -93,8 +117,10 @@ 

    Usage

    + +
    -

    Value

    +

    Value +

    FilterState object

    + + + + - - + + diff --git a/v0.5.0/reference/init_filter_state_expr.html b/v0.5.0/reference/init_filter_state_expr.html index 9d95c8d3c..225f77fe5 100644 --- a/v0.5.0/reference/init_filter_state_expr.html +++ b/v0.5.0/reference/init_filter_state_expr.html @@ -1,8 +1,24 @@ - -Initialize a FilterStateExpr object — init_filter_state_expr • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -83,36 +105,43 @@
    -

    Usage

    +

    Usage +

    init_filter_state_expr(slice)
    -

    Arguments

    -
    slice
    +

    Arguments +

    +
    +
    slice

    (teal_slice_expr) specifying this filter state.

    -
    + +
    -

    Value

    +

    Value +

    FilterStateExpr object

    + + + + - - + + diff --git a/v0.5.0/reference/init_filter_states.html b/v0.5.0/reference/init_filter_states.html index 4ff677fb7..4249e9afe 100644 --- a/v0.5.0/reference/init_filter_states.html +++ b/v0.5.0/reference/init_filter_states.html @@ -1,8 +1,24 @@ - -Initialize FilterStates object — init_filter_states • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -83,7 +105,8 @@
    -

    Usage

    +

    Usage +

    init_filter_states(
       data,
       data_reactive = reactive(NULL),
    @@ -94,8 +117,10 @@ 

    Usage

    -

    Arguments

    -
    data
    +

    Arguments +

    +
    +
    data

    (data.frame or MultiAssayExperiment or SummarizedExperiment or matrix) object to subset.

    @@ -123,26 +148,30 @@

    Arguments -

    Value

    +

    Value +

    Object of class FilterStates.

    + + + + - - + + diff --git a/v0.5.0/reference/init_filtered_data.html b/v0.5.0/reference/init_filtered_data.html index c32b9e4f7..0b38144ca 100644 --- a/v0.5.0/reference/init_filtered_data.html +++ b/v0.5.0/reference/init_filtered_data.html @@ -1,8 +1,24 @@ - -Initialize FilteredData — init_filtered_data • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,13 +106,16 @@
    -

    Usage

    +

    Usage +

    init_filtered_data(x, join_keys = teal.data::join_keys(), code, check)
    -

    Arguments

    -
    x
    +

    Arguments +

    +
    +
    x

    (named list) of datasets.

    @@ -104,16 +130,19 @@

    Arguments[Deprecated]

    -

    + +
    -

    Value

    +

    Value +

    Object of class FilteredData.

    -

    Examples

    +

    Examples +

    datasets <- init_filtered_data(list(iris = iris, mtcars = mtcars))
     datasets
     #> FilteredData:
    @@ -132,17 +161,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/v0.5.0/reference/init_filtered_dataset.html b/v0.5.0/reference/init_filtered_dataset.html index bde6280d3..d945f4a98 100644 --- a/v0.5.0/reference/init_filtered_dataset.html +++ b/v0.5.0/reference/init_filtered_dataset.html @@ -1,8 +1,24 @@ - -Initialize FilteredDataset — init_filtered_dataset • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,7 +106,8 @@
    -

    Usage

    +

    Usage +

    init_filtered_dataset(
       dataset,
       dataname,
    @@ -96,8 +120,10 @@ 

    Usage

    -

    Arguments

    -
    dataset
    +

    Arguments +

    +
    +
    dataset

    any object

    @@ -133,15 +159,18 @@

    Arguments -

    Value

    +

    Value +

    Object of class FilteredDataset.

    -

    Warning

    +

    Warning +

    This function is exported to allow other packages to extend teal.slice but it is treated as internal. @@ -150,7 +179,8 @@

    Warning
    -

    Examples

    +

    Examples +

    # DataframeFilteredDataset example
     library(shiny)
     
    @@ -206,17 +236,19 @@ 

    Examples

    + +

    + +
    - - + + diff --git a/v0.5.0/reference/jsonify.html b/v0.5.0/reference/jsonify.html index aca0d6688..bd058b5b0 100644 --- a/v0.5.0/reference/jsonify.html +++ b/v0.5.0/reference/jsonify.html @@ -1,12 +1,28 @@ - - + + + + + +Convert a list to a justified JSON string — jsonify • teal.slice +Convert a list to a justified JSON string — jsonify • teal.slice + + + + + + + + + + Skip to contents @@ -22,7 +38,8 @@ + +
    @@ -89,39 +111,46 @@
    -

    Usage

    +

    Usage +

    jsonify(x, trim_lines)
    -

    Arguments

    -
    x
    +

    Arguments +

    +
    +
    x

    (list), possibly recursive, obtained from teal_slice or teal_slices.

    trim_lines

    (logical(1)) flag specifying whether to trim lines of the JSON string.

    -
    + +
    -

    Value

    +

    Value +

    A JSON string representation of the input list.

    + + + + - - + + diff --git a/v0.5.0/reference/justify_json.html b/v0.5.0/reference/justify_json.html index 838273ae8..741f68f0f 100644 --- a/v0.5.0/reference/justify_json.html +++ b/v0.5.0/reference/justify_json.html @@ -1,10 +1,26 @@ - -Justify colons in JSON string — justify_json • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + @@ -86,35 +108,42 @@
    -

    Usage

    +

    Usage +

    justify_json(json)
    -

    Arguments

    -
    json
    +

    Arguments +

    +
    +
    json

    (character(1)) a JSON string.

    -
    + +
    -

    Value

    +

    Value +

    A list of character strings, which can be collapsed into a JSON string.

    + + + + - - + + diff --git a/v0.5.0/reference/make_c_call.html b/v0.5.0/reference/make_c_call.html index 6dfb405f5..633820b4d 100644 --- a/v0.5.0/reference/make_c_call.html +++ b/v0.5.0/reference/make_c_call.html @@ -1,10 +1,26 @@ - -Build concatenating call — make_c_call • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + @@ -86,35 +108,42 @@
    -

    Usage

    +

    Usage +

    make_c_call(choices)
    -

    Arguments

    -
    choices
    +

    Arguments +

    +
    +
    choices

    A vector of values.

    -
    + +
    -

    Value

    +

    Value +

    A c call.

    + + + + - - + + diff --git a/v0.5.0/reference/make_count_text.html b/v0.5.0/reference/make_count_text.html index e51908757..4c519caf8 100644 --- a/v0.5.0/reference/make_count_text.html +++ b/v0.5.0/reference/make_count_text.html @@ -1,16 +1,32 @@ - - + + + + + +Build count text — make_count_text • teal.slice +Build count text — make_count_text • teal.slice + + + + + + + + + + Skip to contents @@ -26,7 +42,8 @@ + + @@ -87,18 +109,24 @@
    -

    Returns a text label describing filtered counts. The text is composed in the following way:

    • when countnow is not NULL: <label> (<countnow>/<countmax>)

    • +

      Returns a text label describing filtered counts. The text is composed in the following way:

      +
        +
      • when countnow is not NULL: <label> (<countnow>/<countmax>)

      • when countnow is NULL: <label> (<countmax>)

      • -
    + +
    -

    Usage

    +

    Usage +

    make_count_text(label, countmax, countnow = NULL)
    -

    Arguments

    -
    label
    +

    Arguments +

    +
    +
    label

    (character(1)) Text displayed before counts.

    @@ -109,26 +137,30 @@

    Arguments -

    Value

    +

    Value +

    A character string.

    + + + + - - + + diff --git a/v0.5.0/reference/setdiff_teal_slices.html b/v0.5.0/reference/setdiff_teal_slices.html index 340f2351e..2827e98ea 100644 --- a/v0.5.0/reference/setdiff_teal_slices.html +++ b/v0.5.0/reference/setdiff_teal_slices.html @@ -1,8 +1,24 @@ - -setdiff method for teal_slices — setdiff_teal_slices • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,18 +107,23 @@
    -

    Usage

    +

    Usage +

    setdiff_teal_slices(x, y)
    -

    Arguments

    -
    x, y
    +

    Arguments +

    +
    +
    x, y

    (teal_slices)

    -
    + +
    -

    Value

    +

    Value +

    teal_slices

    @@ -103,17 +132,19 @@

    Value

    + + + + - - + + diff --git a/v0.5.0/reference/teal.slice-package.html b/v0.5.0/reference/teal.slice-package.html index f3c689c57..7efd2079c 100644 --- a/v0.5.0/reference/teal.slice-package.html +++ b/v0.5.0/reference/teal.slice-package.html @@ -1,8 +1,24 @@ - -teal.slice: Interactive Exploration of Clinical Trials Data — teal.slice-package • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,16 +107,24 @@
    -

    Author

    +

    Author +

    Maintainer: Dawid Kaledkowski dawid.kaledkowski@roche.com (ORCID)

    -

    Authors:

    + +
    + + + + - - + + diff --git a/v0.5.0/reference/teal_slice.html b/v0.5.0/reference/teal_slice.html index 79b47c258..a5b0bc665 100644 --- a/v0.5.0/reference/teal_slice.html +++ b/v0.5.0/reference/teal_slice.html @@ -1,8 +1,24 @@ - -Specify single filter — teal_slice • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -83,7 +105,8 @@
    -

    Usage

    +

    Usage +

    teal_slice(
       dataname,
       varname,
    @@ -115,8 +138,10 @@ 

    Usage

    -

    Arguments

    -
    dataname
    +

    Arguments +

    +
    +
    dataname

    (character(1)) name of data set

    @@ -189,16 +214,19 @@

    Arguments -

    Value

    +

    Value +

    A teal.slice object. Depending on whether varname or expr was specified, the resulting teal_slice also receives class teal_slice_var or teal_slice_expr, respectively.

    -

    Details

    +

    Details +

    teal_slice object fully describes filter state and can be used to create, modify, and delete a filter state. A teal_slice contains a number of common fields (all named arguments of teal_slice), some of which are mandatory, but only @@ -207,7 +235,9 @@

    DetailsSetting any of the other values to NULL means that those properties will not be modified (when setting an existing state) or that they will be determined by data (when creating new a new one). Entire object is FilterState class member and can be accessed with FilterState$get_state().

    -

    A teal_slice can come in two flavors:

    1. teal_slice_var - +

      A teal_slice can come in two flavors:

      +
        +
      1. teal_slice_var - this describes a typical interactive filter that refers to a single variable, managed by the FilterState class. This class is created when varname is specified. The object retains all fields specified in the call. id can be created by default and need not be specified.

      2. @@ -217,7 +247,8 @@

        Detailsexpr is specified. dataname and anchored are retained, fixed is set to TRUE, id becomes mandatory, title remains optional, while other arguments are disregarded.

        -

      A teal_slice can be passed FilterState/FilterStateExpr constructors to instantiate an object. +

    +

    A teal_slice can be passed FilterState/FilterStateExpr constructors to instantiate an object. It can also be passed to FilterState$set_state to modify the state. However, once a FilterState is created, only the mutable features can be set with a teal_slice: selected, keep_na and keep_inf.

    @@ -229,11 +260,13 @@

    DetailsFilterState instantiated with anchored = TRUE cannot be removed.

    -

    Note

    +

    Note +

    Date time objects of POSIX*t classes are printed as strings after converting to UTC timezone.

    -

    Filters in SumarizedExperiment and MultiAssayExperiment objects

    +

    Filters in SumarizedExperiment and MultiAssayExperiment objects +

    @@ -247,12 +280,14 @@

    Filters in order to determine whether the filter refers to the SE's rowData or colData.

    -

    See also

    +

    See also +

    -

    Examples

    +

    Examples +

    x1 <- teal_slice(
       dataname = "data",
       id = "Female adults",
    @@ -329,17 +364,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/v0.5.0/reference/teal_slices.html b/v0.5.0/reference/teal_slices.html index 64b019bd1..da2868008 100644 --- a/v0.5.0/reference/teal_slices.html +++ b/v0.5.0/reference/teal_slices.html @@ -1,8 +1,24 @@ - -Complete filter specification — teal_slices • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -83,7 +105,8 @@
    -

    Usage

    +

    Usage +

    teal_slices(
       ...,
       exclude_varnames = NULL,
    @@ -113,8 +136,10 @@ 

    Usage

    -

    Arguments

    -
    ...
    +

    Arguments +

    +
    +
    ...

    any number of teal_slice objects. For print and format, additional arguments passed to other functions.

    @@ -126,15 +151,19 @@

    Arguments[Experimental] +
    +

    [Experimental] This is a new feature. Do kindly share your opinions on teal.slice's GitHub repository.

    (character(1)) string specifying how observations are tallied by these filter states. -Possible options:

    • "none" (default) to have counts of single FilterState to show unfiltered number only.

    • +Possible options:

      +
        +
      • "none" (default) to have counts of single FilterState to show unfiltered number only.

      • "all" to have counts of single FilterState to show number of observation in filtered and unfiltered dataset. Note, that issues were reported when using this option with MultiAssayExperiment. Please make sure that adding new filters doesn't fail on target platform before deploying for production.

      • -
    + +
    allow_add
    @@ -160,15 +189,18 @@

    Arguments -

    Value

    +

    Value +

    teal_slices, which is an unnamed list of teal_slice objects.

    -

    Details

    +

    Details +

    teal_slices() collates multiple teal_slice objects into a teal_slices object, a complete filter specification. This is used by all classes above FilterState as well as filter_panel_api wrapper functions. @@ -179,15 +211,19 @@

    Detailsteal_slices.

    -

    See also

    +

    See also +

    -
    • teal_slice for creating constituent elements of teal_slices

    • +
        +
      • teal_slice for creating constituent elements of teal_slices

      • teal::slices_store for robust utilities for saving and loading teal_slices in JSON format

      • -
    + +
    -

    Examples

    +

    Examples +

    filter_1 <- teal_slice(
       dataname = "dataname1",
       varname = "varname1",
    @@ -400,17 +436,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/v0.5.0/reference/to_json.html b/v0.5.0/reference/to_json.html index 11bb53bc6..39ea30858 100644 --- a/v0.5.0/reference/to_json.html +++ b/v0.5.0/reference/to_json.html @@ -1,12 +1,28 @@ - - + + + + + +Converts a list to a JSON string — to_json • teal.slice +Converts a list to a JSON string — to_json • teal.slice + + + + + + + + + + Skip to contents @@ -22,7 +38,8 @@ + + @@ -89,35 +111,42 @@
    -

    Usage

    +

    Usage +

    to_json(x)
    -

    Arguments

    -
    x
    +

    Arguments +

    +
    +
    x

    (list) representation of teal_slices object.

    -
    + +
    -

    Value

    +

    Value +

    A JSON string.

    + + + + - - + + diff --git a/v0.5.0/reference/toggle_button.html b/v0.5.0/reference/toggle_button.html index 88c09926f..0ee8e20e8 100644 --- a/v0.5.0/reference/toggle_button.html +++ b/v0.5.0/reference/toggle_button.html @@ -1,8 +1,24 @@ - -Toggle button properties. — toggle_button • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -83,15 +105,18 @@
    -

    Usage

    +

    Usage +

    toggle_icon(input_id, icons, one_way = FALSE)
     
     toggle_title(input_id, titles, one_way = FALSE)
    -

    Arguments

    -
    input_id
    +

    Arguments +

    +
    +
    input_id

    (character(1)) (name-spaced) id of the button

    @@ -104,15 +129,18 @@

    Arguments -

    Value

    +

    Value +

    NULL, invisibly.

    -

    Details

    +

    Details +

    Wrapper functions that use shinyjs::runjs to change button properties in response to events, typically clicking those very buttons. shiny's actionButton and actionLink create <a> tags, @@ -123,17 +151,19 @@

    Details

    + + + + - - + + diff --git a/v0.5.0/reference/topological_sort.html b/v0.5.0/reference/topological_sort.html index e61fb14fb..ce100fc2a 100644 --- a/v0.5.0/reference/topological_sort.html +++ b/v0.5.0/reference/topological_sort.html @@ -1,10 +1,26 @@ - -Topological graph sort — topological_sort • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + @@ -86,33 +108,40 @@
    -

    Usage

    +

    Usage +

    topological_sort(graph)
    -

    Arguments

    -
    graph
    +

    Arguments +

    +
    +
    graph

    (named list) with node vector elements

    -
    + +
    -

    Details

    +

    Details +

    Implementation of Kahn algorithm with a modification to maintain the order of input elements.

    + + + + - - + + diff --git a/v0.5.0/reference/trim_lines_json.html b/v0.5.0/reference/trim_lines_json.html index 9acaec54a..8ae3d6627 100644 --- a/v0.5.0/reference/trim_lines_json.html +++ b/v0.5.0/reference/trim_lines_json.html @@ -1,10 +1,26 @@ - -Trim lines in JSON string — trim_lines_json • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + @@ -86,35 +108,42 @@
    -

    Usage

    +

    Usage +

    trim_lines_json(x)
    -

    Arguments

    -
    x
    +

    Arguments +

    +
    +
    x

    (character)

    -
    + +
    -

    Value

    +

    Value +

    A character string trimmed after a certain hard-coded number of characters in the value portion.

    + + + + - - + + diff --git a/v0.5.0/reference/variable_types.html b/v0.5.0/reference/variable_types.html index 8f57f03b2..34138b184 100644 --- a/v0.5.0/reference/variable_types.html +++ b/v0.5.0/reference/variable_types.html @@ -1,8 +1,24 @@ - -Get classes of selected columns from dataset — variable_types • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -83,13 +105,16 @@
    -

    Usage

    +

    Usage +

    variable_types(data, columns = NULL)
    -

    Arguments

    -
    data
    +

    Arguments +

    +
    +
    data

    (data.frame or DataFrame or matrix) Object in which to determine variable types.

    @@ -97,26 +122,30 @@

    Arguments -

    Value

    +

    Value +

    Character vector of classes of columns from provided data.

    + + + + - - + + diff --git a/v0.5.1-rc1/404.html b/v0.5.1-rc1/404.html index d78b51333..465f0b5da 100644 --- a/v0.5.1-rc1/404.html +++ b/v0.5.1-rc1/404.html @@ -1,5 +1,4 @@ - - + @@ -50,22 +49,7 @@ - - + - + + diff --git a/v0.5.1-rc1/CODE_OF_CONDUCT.html b/v0.5.1-rc1/CODE_OF_CONDUCT.html index ce1ca96bd..5676a050f 100644 --- a/v0.5.1-rc1/CODE_OF_CONDUCT.html +++ b/v0.5.1-rc1/CODE_OF_CONDUCT.html @@ -1,8 +1,22 @@ - -Contributor Covenant Code of Conduct • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -80,65 +100,80 @@
    -

    Our Pledge

    +

    Our Pledge +

    We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.

    We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.

    -

    Our Standards

    +

    Our Standards +

    Examples of behavior that contributes to a positive environment for our community include:

    -
    • Demonstrating empathy and kindness toward other people
    • +
        +
      • Demonstrating empathy and kindness toward other people
      • Being respectful of differing opinions, viewpoints, and experiences
      • Giving and gracefully accepting constructive feedback
      • Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
      • Focusing on what is best not just for us as individuals, but for the overall community
      • -

      Examples of unacceptable behavior include:

      -
      • The use of sexualized language or imagery, and sexual attention or advances of any kind
      • +
      +

      Examples of unacceptable behavior include:

      +
        +
      • The use of sexualized language or imagery, and sexual attention or advances of any kind
      • Trolling, insulting or derogatory comments, and personal or political attacks
      • Public or private harassment
      • Publishing others’ private information, such as a physical or email address, without their explicit permission
      • Other conduct which could reasonably be considered inappropriate in a professional setting
      • -
    + +
    -

    Enforcement Responsibilities

    +

    Enforcement Responsibilities +

    Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.

    Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.

    -

    Scope

    +

    Scope +

    This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.

    -

    Enforcement

    +

    Enforcement +

    Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [INSERT CONTACT METHOD]. All complaints will be reviewed and investigated promptly and fairly.

    All community leaders are obligated to respect the privacy and security of the reporter of any incident.

    -

    Enforcement Guidelines

    +

    Enforcement Guidelines +

    Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:

    -

    1. Correction

    +

    1. Correction +

    Community Impact: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.

    Consequence: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.

    -

    2. Warning

    +

    2. Warning +

    Community Impact: A violation through a single incident or series of actions.

    Consequence: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.

    -

    3. Temporary Ban

    +

    3. Temporary Ban +

    Community Impact: A serious violation of community standards, including sustained inappropriate behavior.

    Consequence: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.

    -

    4. Permanent Ban

    +

    4. Permanent Ban +

    Community Impact: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.

    Consequence: A permanent ban from any sort of public interaction within the community.

    -

    Attribution

    +

    Attribution +

    This Code of Conduct is adapted from the Contributor Covenant, version 2.1, available at https://www.contributor-covenant.org/version/2/1/code_of_conduct.html.

    Community Impact Guidelines were inspired by Mozilla’s code of conduct enforcement ladder.

    For answers to common questions about this code of conduct, see the FAQ at https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.

    @@ -146,17 +181,19 @@

    Attribution

    + + + + - - + + diff --git a/v0.5.1-rc1/CONTRIBUTING.html b/v0.5.1-rc1/CONTRIBUTING.html index 3690a5c9a..c61674ed4 100644 --- a/v0.5.1-rc1/CONTRIBUTING.html +++ b/v0.5.1-rc1/CONTRIBUTING.html @@ -1,8 +1,22 @@ - -Contribution Guidelines • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -82,7 +102,8 @@

    🙏 Thank you for taking the time to contribute!

    Your input is deeply valued, whether an issue, a pull request, or even feedback, regardless of size, content or scope.

    -

    Table of contents

    +

    Table of contents +

    👶 Getting started

    📔 Code of Conduct

    🗃 License

    @@ -93,38 +114,47 @@

    Table of contents❓ Questions

    -

    Getting started

    +

    Getting started +

    Please refer the project documentation for a brief introduction. Please also see other articles within the project documentation for additional information.

    -

    Code of Conduct

    +

    Code of Conduct +

    A Code of Conduct governs this project. Participants and contributors are expected to follow the rules outlined therein.

    -

    License

    +

    License +

    All your contributions will be covered by this project’s license.

    -

    Issues

    +

    Issues +

    We use GitHub to track issues, feature requests, and bugs. Before submitting a new issue, please check if the issue has already been reported. If the issue already exists, please upvote the existing issue 👍.

    For new feature requests, please elaborate on the context and the benefit the feature will have for users, developers, or other relevant personas.

    -

    Pull requests

    +

    Pull requests +

    -

    GitHub Flow

    +

    GitHub Flow +

    This repository uses the GitHub Flow model for collaboration. To submit a pull request:

    -
    1. +
        +
      1. Create a branch

        Please see the branch naming convention below. If you don’t have write access to this repository, please fork it.

      2. Make changes

        Make sure your code

        -
        • passes all checks imposed by GitHub Actions
        • +
            +
          • passes all checks imposed by GitHub Actions
          • is well documented
          • is well tested with unit tests sufficiently covering the changes introduced
          • -
          +
        +
      3. Create a pull request (PR)

        In the pull request description, please link the relevant issue (if any), provide a detailed description of the change, and include any assumptions.

        @@ -138,76 +168,93 @@

        GitHub Flow -

        Branch naming convention

        +

        Branch naming convention +

        Suppose your changes are related to a current issue in the current project; please name your branch as follows: <issue_id>_<short_description>. Please use underscore (_) as a delimiter for word separation. For example, 420_fix_ui_bug would be a suitable branch name if your change is resolving and UI-related bug reported in issue number 420 in the current project.

        If your change affects multiple repositories, please name your branches as follows: <issue_id>_<issue_repo>_<short description>. For example, 69_awesomeproject_fix_spelling_error would reference issue 69 reported in project awesomeproject and aims to resolve one or more spelling errors in multiple (likely related) repositories.

    monorepo and staged.dependencies -

    + +

    Sometimes you might need to change upstream dependent package(s) to be able to submit a meaningful change. We are using staged.dependencies functionality to simulate a monorepo behavior. The dependency configuration is already specified in this project’s staged_dependencies.yaml file. You need to name the feature branches appropriately. This is the only exception from the branch naming convention described above.

    Please refer to the staged.dependencies package documentation for more details.

    -

    Coding guidelines

    +

    Coding guidelines +

    This repository follows some unified processes and standards adopted by its maintainers to ensure software development is carried out consistently within teams and cohesively across other repositories.

    -

    Style guide

    +

    Style guide +

    This repository follows the standard tidyverse style guide and uses lintr for lint checks. Customized lint configurations are available in this repository’s .lintr file.

    -

    Dependency management

    +

    Dependency management +

    Lightweight is the right weight. This repository follows tinyverse recommendations of limiting dependencies to minimum.

    -

    Dependency version management

    +

    Dependency version management +

    If the code is not compatible with all (!) historical versions of a given dependency package, it is required to specify minimal version in the DESCRIPTION file. In particular: if the development version requires (imports) the development version of another package - it is required to put abc (>= 1.2.3.9000).

    - +
    -

    R & package versions

    +

    R & package versions +

    We continuously test our packages against the newest R version along with the most recent dependencies from CRAN and BioConductor. We recommend that your working environment is also set up in the same way. You can find the details about the R version and packages used in the R CMD check GitHub Action execution log - there is a step that prints out the R sessionInfo().

    If you discover bugs on older R versions or with an older set of dependencies, please create the relevant bug reports.

    -

    pre-commit

    +

    +pre-commit +

    We highly recommend that you use the pre-commit tool combined with R hooks for pre-commit to execute some of the checks before committing and pushing your changes.

    Pre-commit hooks are already available in this repository’s .pre-commit-config.yaml file.

    -

    Recognition model

    +

    Recognition model +

    As mentioned previously, all contributions are deeply valued and appreciated. While all contribution data is available as part of the repository insights, to recognize a significant contribution and hence add the contributor to the package authors list, the following rules are enforced:

    -
    • Minimum 5% of lines of code authored* (determined by git blame query) OR
    • +
        +
      • Minimum 5% of lines of code authored* (determined by git blame query) OR
      • Being at the top 5 contributors in terms of number of commits OR lines added OR lines removed*
      • -

      *Excluding auto-generated code, including but not limited to roxygen comments or renv.lock files.

      +
    +

    *Excluding auto-generated code, including but not limited to roxygen comments or renv.lock files.

    The package maintainer also reserves the right to adjust the criteria to recognize contributions.

    -

    Questions

    +

    Questions +

    If you have further questions regarding the contribution guidelines, please contact the package/repository maintainer.

    + + + + - - + + diff --git a/v0.5.1-rc1/LICENSE-text.html b/v0.5.1-rc1/LICENSE-text.html index de80e9399..e10520d89 100644 --- a/v0.5.1-rc1/LICENSE-text.html +++ b/v0.5.1-rc1/LICENSE-text.html @@ -1,8 +1,22 @@ - -License • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -92,17 +112,19 @@ limitations under the License. - + + + + - - + + diff --git a/v0.5.1-rc1/SECURITY.html b/v0.5.1-rc1/SECURITY.html index f6f263475..c74550f27 100644 --- a/v0.5.1-rc1/SECURITY.html +++ b/v0.5.1-rc1/SECURITY.html @@ -1,8 +1,22 @@ - -Security Policy • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -80,38 +100,44 @@
    -

    Reporting Security Issues

    +

    Reporting Security Issues +

    If you believe you have found a security vulnerability in any of the repositories in this organization, please report it to us through coordinated disclosure.

    Please do not report security vulnerabilities through public GitHub issues, discussions, or pull requests.

    Instead, please send an email to vulnerability.management[@]roche.com.

    Please include as much of the information listed below as you can to help us better understand and resolve the issue:

    -
    • The type of issue (e.g., buffer overflow, SQL injection, or cross-site scripting)
    • +
        +
      • The type of issue (e.g., buffer overflow, SQL injection, or cross-site scripting)
      • Full paths of source file(s) related to the manifestation of the issue
      • The location of the affected source code (tag/branch/commit or direct URL)
      • Any special configuration required to reproduce the issue
      • Step-by-step instructions to reproduce the issue
      • Proof-of-concept or exploit code (if possible)
      • Impact of the issue, including how an attacker might exploit the issue
      • -

      This information will help us triage your report more quickly.

      +
    +

    This information will help us triage your report more quickly.

    -

    Data Security Standards (DSS)

    +

    Data Security Standards (DSS) +

    Please make sure that while reporting issues in the form a bug, feature, or pull request, all sensitive information such as PII, PHI, and PCI is completely removed from any text and attachments, including pictures and videos.

    + + + + - - + + diff --git a/v0.5.1-rc1/articles/filter-panel-for-developers.html b/v0.5.1-rc1/articles/filter-panel-for-developers.html index 986ec9cce..34dc283f9 100644 --- a/v0.5.1-rc1/articles/filter-panel-for-developers.html +++ b/v0.5.1-rc1/articles/filter-panel-for-developers.html @@ -1,5 +1,4 @@ - - + @@ -52,22 +51,7 @@ - - + - + + diff --git a/v0.5.1-rc1/articles/index.html b/v0.5.1-rc1/articles/index.html index 236a4f07e..5cc494abd 100644 --- a/v0.5.1-rc1/articles/index.html +++ b/v0.5.1-rc1/articles/index.html @@ -1,8 +1,22 @@ - -Articles • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -80,24 +100,31 @@

    All vignettes

    -
    Filter Panel for Developers
    +
    +
    Filter Panel for Developers
    -
    teal.slice Classes
    + +
    teal.slice Classes
    -
    Introduction to teal.slice
    + +
    Introduction to teal.slice
    -
    - + +
    + + + + + - - + + diff --git a/v0.5.1-rc1/articles/teal-slice-classes.html b/v0.5.1-rc1/articles/teal-slice-classes.html index 6c98d7032..1f7434bb9 100644 --- a/v0.5.1-rc1/articles/teal-slice-classes.html +++ b/v0.5.1-rc1/articles/teal-slice-classes.html @@ -1,5 +1,4 @@ - - + @@ -52,22 +51,7 @@ - - + - + + diff --git a/v0.5.1-rc1/articles/teal-slice.html b/v0.5.1-rc1/articles/teal-slice.html index f1b965356..c19605cfd 100644 --- a/v0.5.1-rc1/articles/teal-slice.html +++ b/v0.5.1-rc1/articles/teal-slice.html @@ -1,5 +1,4 @@ - - + @@ -52,22 +51,7 @@ - - + - + + diff --git a/v0.5.1-rc1/authors.html b/v0.5.1-rc1/authors.html index b1b4c129b..136084e67 100644 --- a/v0.5.1-rc1/authors.html +++ b/v0.5.1-rc1/authors.html @@ -1,8 +1,22 @@ - -Authors and Citation • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -79,7 +99,8 @@

    Authors

    -
    • +
        +
      • Dawid Kaledkowski. Author, maintainer.

      • @@ -139,7 +160,8 @@

        Authors

        F. Hoffmann-La Roche AG. Copyright holder, funder.

        -
    + +

    Citation

    @@ -160,17 +182,19 @@

    Citation

    }
    + + + + - - + + diff --git a/v0.5.1-rc1/coverage-report/index.html b/v0.5.1-rc1/coverage-report/index.html index 4e7845e92..e5c3b9350 100644 --- a/v0.5.1-rc1/coverage-report/index.html +++ b/v0.5.1-rc1/coverage-report/index.html @@ -1,23 +1,22 @@ - - + - + - + - - + + - + - + - - - + + + @@ -852,7 +851,8 @@

    teal.slice coverage - 65.92%

    106 - 67x + 67x +
          checkmate::assert_list(data_objects, any.missing = FALSE, min.len = 0, names = "unique")
    @@ -866,14 +866,16 @@

    teal.slice coverage - 65.92%

    108 - 67x + 67x +
          data_objects <- lapply(data_objects, function(dataset) {
    109 - 101x + 101x +
            if (is.list(dataset) && "dataset" %in% names(dataset)) {
    @@ -894,7 +896,8 @@

    teal.slice coverage - 65.92%

    112 - 101x + 101x +
              dataset
    @@ -929,49 +932,56 @@

    teal.slice coverage - 65.92%

    117 - 67x + 67x +
          checkmate::assert_class(join_keys, "join_keys")
    118 - 66x + 66x +
          self$set_join_keys(join_keys)
    119 - 66x + 66x +
          child_parent <- sapply(
    120 - 66x + 66x +
            names(data_objects),
    121 - 66x + 66x +
            function(i) teal.data::parent(join_keys, i),
    122 - 66x + 66x +
            USE.NAMES = TRUE,
    123 - 66x + 66x +
            simplify = FALSE
    @@ -985,14 +995,16 @@

    teal.slice coverage - 65.92%

    125 - 66x + 66x +
          ordered_datanames <- topological_sort(child_parent)
    126 - 66x + 66x +
          ordered_datanames <- intersect(ordered_datanames, names(data_objects))
    @@ -1006,21 +1018,24 @@

    teal.slice coverage - 65.92%

    128 - 66x + 66x +
          for (dataname in ordered_datanames) {
    129 - 100x + 100x +
            ds_object <- data_objects[[dataname]]
    130 - 100x + 100x +
            self$set_dataset(data = ds_object, dataname = dataname)
    @@ -1041,7 +1056,8 @@

    teal.slice coverage - 65.92%

    133 - 66x + 66x +
          self$set_available_teal_slices(x = reactive(NULL))
    @@ -1055,7 +1071,8 @@

    teal.slice coverage - 65.92%

    135 - 66x + 66x +
          invisible(self)
    @@ -1118,7 +1135,8 @@

    teal.slice coverage - 65.92%

    144 - 118x + 118x +
          names(private$filtered_datasets)
    @@ -1188,7 +1206,8 @@

    teal.slice coverage - 65.92%

    154 - 1x + 1x +
          private$get_filtered_dataset(dataname)$get_dataset_label()
    @@ -1293,14 +1312,16 @@

    teal.slice coverage - 65.92%

    169 - 67x + 67x +
          checkmate::assert_class(x, "reactive")
    170 - 67x + 67x +
          private$available_teal_slices <- reactive({
    @@ -1314,49 +1335,56 @@

    teal.slice coverage - 65.92%

    172 - 4x + 4x +
            current_state <- isolate(self$get_filter_state())
    173 - 4x + 4x +
            allowed <- attr(current_state, "include_varnames")
    174 - 4x + 4x +
            forbidden <- attr(current_state, "exclude_varnames")
    175 - 4x + 4x +
            foo <- function(slice) {
    176 - 13x + 13x +
              if (slice$dataname %in% self$datanames()) {
    177 - 13x + 13x +
                if (slice$fixed) {
    178 - 4x + 4x +
                  TRUE
    @@ -1370,14 +1398,16 @@

    teal.slice coverage - 65.92%

    180 - 9x + 9x +
                  isTRUE(slice$varname %in% allowed[[slice$dataname]]) ||
    181 - 9x + 9x +
                    isFALSE(slice$varname %in% forbidden[[slice$dataname]])
    @@ -1419,7 +1449,8 @@

    teal.slice coverage - 65.92%

    187 - 4x + 4x +
            Filter(foo, x())
    @@ -1433,7 +1464,8 @@

    teal.slice coverage - 65.92%

    189 - 67x + 67x +
          invisible(NULL)
    @@ -1510,7 +1542,8 @@

    teal.slice coverage - 65.92%

    200 - 4x + 4x +
          private$available_teal_slices
    @@ -1706,14 +1739,16 @@

    teal.slice coverage - 65.92%

    228 - 10x + 10x +
          checkmate::assert_subset(dataname, self$datanames())
    229 - 9x + 9x +
          private$get_filtered_dataset(dataname)$get_call()
    @@ -1811,28 +1846,32 @@

    teal.slice coverage - 65.92%

    243 - 24x + 24x +
          checkmate::assert_subset(dataname, self$datanames())
    244 - 23x + 23x +
          checkmate::assert_flag(filtered)
    245 - 22x + 22x +
          data <- private$get_filtered_dataset(dataname)$get_dataset(filtered)
    246 - 3x + 3x +
          if (filtered) data() else data
    @@ -1895,7 +1934,8 @@

    teal.slice coverage - 65.92%

    255 - 2x + 2x +
          private$join_keys
    @@ -1986,28 +2026,32 @@

    teal.slice coverage - 65.92%

    268 - 9x + 9x +
          rows <- lapply(
    269 - 9x + 9x +
            datanames,
    270 - 9x + 9x +
            function(dataname) {
    271 - 11x + 11x +
              private$get_filtered_dataset(dataname)$get_filter_overview()
    @@ -2028,14 +2072,16 @@

    teal.slice coverage - 65.92%

    274 - 5x + 5x +
          unssuported_idx <- vapply(rows, function(x) all(is.na(x[-1])), logical(1))
    275 - 5x + 5x +
          dplyr::bind_rows(c(rows[!unssuported_idx], rows[unssuported_idx]))
    @@ -2112,7 +2158,8 @@

    teal.slice coverage - 65.92%

    286 - 1x + 1x +
          private$get_filtered_dataset(dataname)$get_keys()
    @@ -2266,14 +2313,16 @@

    teal.slice coverage - 65.92%

    308 - 105x + 105x +
          checkmate::assert_string(dataname)
    309 - 105x + 105x +
          logger::log_trace("FilteredData$set_dataset setting dataset, name: { dataname }")
    @@ -2294,7 +2343,8 @@

    teal.slice coverage - 65.92%

    312 - 105x + 105x +
          check_simple_name(dataname)
    @@ -2308,21 +2358,24 @@

    teal.slice coverage - 65.92%

    314 - 105x + 105x +
          parent_dataname <- teal.data::parent(private$join_keys, dataname)
    315 - 105x + 105x +
          keys <- private$join_keys[dataname, dataname]
    316 - 104x + 104x +
          if (is.null(keys)) keys <- character(0)
    @@ -2336,35 +2389,40 @@

    teal.slice coverage - 65.92%

    318 - 105x + 105x +
          if (length(parent_dataname) == 0) {
    319 - 95x + 95x +
            private$filtered_datasets[[dataname]] <- init_filtered_dataset(
    320 - 95x + 95x +
              dataset = data,
    321 - 95x + 95x +
              dataname = dataname,
    322 - 95x + 95x +
              keys = keys
    @@ -2385,7 +2443,8 @@

    teal.slice coverage - 65.92%

    325 - 10x + 10x +
            join_keys <- private$join_keys[dataname, parent_dataname]
    @@ -2399,49 +2458,56 @@

    teal.slice coverage - 65.92%

    327 - 10x + 10x +
            private$filtered_datasets[[dataname]] <- init_filtered_dataset(
    328 - 10x + 10x +
              dataset = data,
    329 - 10x + 10x +
              dataname = dataname,
    330 - 10x + 10x +
              keys = keys,
    331 - 10x + 10x +
              parent_name = parent_dataname,
    332 - 10x + 10x +
              parent = reactive(self$get_data(parent_dataname, filtered = TRUE)),
    333 - 10x + 10x +
              join_keys = join_keys
    @@ -2469,7 +2535,8 @@

    teal.slice coverage - 65.92%

    337 - 105x + 105x +
          invisible(self)
    @@ -2546,21 +2613,24 @@

    teal.slice coverage - 65.92%

    348 - 66x + 66x +
          checkmate::assert_class(join_keys, "join_keys")
    349 - 66x + 66x +
          private$join_keys <- join_keys
    350 - 66x + 66x +
          invisible(self)
    @@ -2637,35 +2707,40 @@

    teal.slice coverage - 65.92%

    361 - 53x + 53x +
          states <- unname(lapply(private$filtered_datasets, function(x) x$get_filter_state()))
    362 - 53x + 53x +
          slices <- Filter(Negate(is.null), states)
    363 - 53x + 53x +
          slices <- do.call(c, slices)
    364 - 53x + 53x +
          if (!is.null(slices)) {
    365 - 53x + 53x +
            attr(slices, "allow_add") <- private$allow_add
    @@ -2679,7 +2754,8 @@

    teal.slice coverage - 65.92%

    367 - 53x + 53x +
          slices
    @@ -2763,35 +2839,40 @@

    teal.slice coverage - 65.92%

    379 - 5x + 5x +
          datasets <- lapply(self$datanames(), private$get_filtered_dataset)
    380 - 5x + 5x +
          ind <- vapply(datasets, inherits, logical(1L), what = "DefaultFilteredDataset")
    381 - 5x + 5x +
          states <- do.call(c, lapply(datasets[!ind], function(ds) ds$get_filter_state()))
    382 - 5x + 5x +
          states_fmt <- format(states, show_all = show_all, trim_lines = trim_lines)
    383 - 5x + 5x +
          holders_fmt <- vapply(datasets[ind], format, character(1L), show_all = show_all, trim_lines = trim_lines)
    @@ -2805,28 +2886,32 @@

    teal.slice coverage - 65.92%

    385 - 5x + 5x +
          sprintf(
    386 - 5x + 5x +
            "%s:\n%s",
    387 - 5x + 5x +
            class(self)[1],
    388 - 5x + 5x +
            paste(c(states_fmt, holders_fmt), collapse = "\n")
    @@ -2966,42 +3051,48 @@

    teal.slice coverage - 65.92%

    408 - 31x + 31x +
          isolate({
    409 - 31x + 31x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initializing")
    410 - 31x + 31x +
            checkmate::assert_class(state, "teal_slices")
    411 - 31x + 31x +
            allow_add <- attr(state, "allow_add")
    412 - 31x + 31x +
            if (!is.null(allow_add)) {
    413 - 31x + 31x +
              private$allow_add <- allow_add
    @@ -3022,21 +3113,24 @@

    teal.slice coverage - 65.92%

    416 - 31x + 31x +
            lapply(self$datanames(), function(dataname) {
    417 - 63x + 63x +
              states <- Filter(function(x) identical(x$dataname, dataname), state)
    418 - 63x + 63x +
              private$get_filtered_dataset(dataname)$set_filter_state(states)
    @@ -3057,7 +3151,8 @@

    teal.slice coverage - 65.92%

    421 - 31x + 31x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initialized")
    @@ -3078,7 +3173,8 @@

    teal.slice coverage - 65.92%

    424 - 31x + 31x +
          invisible(NULL)
    @@ -3169,28 +3265,32 @@

    teal.slice coverage - 65.92%

    437 - 8x + 8x +
          isolate({
    438 - 8x + 8x +
            checkmate::assert_class(state, "teal_slices")
    439 - 8x + 8x +
            datanames <- unique(vapply(state, "[[", character(1L), "dataname"))
    440 - 8x + 8x +
            checkmate::assert_subset(datanames, self$datanames())
    @@ -3204,14 +3304,16 @@

    teal.slice coverage - 65.92%

    442 - 8x + 8x +
            logger::log_trace(
    443 - 8x + 8x +
              "{ class(self)[1] }$remove_filter_state removing filter(s), dataname: { private$dataname }"
    @@ -3232,21 +3334,24 @@

    teal.slice coverage - 65.92%

    446 - 8x + 8x +
            lapply(datanames, function(dataname) {
    447 - 9x + 9x +
              slices <- Filter(function(x) identical(x$dataname, dataname), state)
    448 - 9x + 9x +
              private$get_filtered_dataset(dataname)$remove_filter_state(slices)
    @@ -3267,14 +3372,16 @@

    teal.slice coverage - 65.92%

    451 - 8x + 8x +
            logger::log_trace(
    452 - 8x + 8x +
              "{ class(self)[1] }$remove_filter_state removed filter(s), dataname: { private$dataname }"
    @@ -3302,7 +3409,8 @@

    teal.slice coverage - 65.92%

    456 - 8x + 8x +
          invisible(NULL)
    @@ -3407,14 +3515,16 @@

    teal.slice coverage - 65.92%

    471 - 7x + 7x +
          logger::log_trace(
    472 - 7x + 7x +
            "FilteredData$clear_filter_states called, datanames: { toString(datanames) }"
    @@ -3435,21 +3545,24 @@

    teal.slice coverage - 65.92%

    475 - 7x + 7x +
          for (dataname in datanames) {
    476 - 12x + 12x +
            fdataset <- private$get_filtered_dataset(dataname = dataname)
    477 - 12x + 12x +
            fdataset$clear_filter_states(force)
    @@ -3470,28 +3583,32 @@

    teal.slice coverage - 65.92%

    480 - 7x + 7x +
          logger::log_trace(
    481 - 7x + 7x +
            paste(
    482 - 7x + 7x +
              "FilteredData$clear_filter_states removed all non-anchored FilterStates,",
    483 - 7x + 7x +
              "datanames: { toString(datanames) }"
    @@ -3519,7 +3636,8 @@

    teal.slice coverage - 65.92%

    487 - 7x + 7x +
          invisible(NULL)
    @@ -3785,35 +3903,40 @@

    teal.slice coverage - 65.92%

    525 - 1x + 1x +
          checkmate::assert_function(active_datanames)
    526 - 1x + 1x +
          moduleServer(
    527 - 1x + 1x +
            id = id,
    528 - 1x + 1x +
            function(input, output, session) {
    529 - 1x + 1x +
              logger::log_trace("FilteredData$srv_filter_panel initializing")
    @@ -3827,14 +3950,16 @@

    teal.slice coverage - 65.92%

    531 - 1x + 1x +
              active_datanames_resolved <- reactive({
    532 - 1x + 1x +
                checkmate::assert_subset(active_datanames(), self$datanames())
    @@ -3862,28 +3987,32 @@

    teal.slice coverage - 65.92%

    536 - 1x + 1x +
              self$srv_overview("overview", active_datanames_resolved)
    537 - 1x + 1x +
              self$srv_active("active", active_datanames_resolved)
    538 - 1x + 1x +
              if (private$allow_add) {
    539 - 1x + 1x +
                self$srv_add("add", active_datanames_resolved)
    @@ -3904,14 +4033,16 @@

    teal.slice coverage - 65.92%

    542 - 1x + 1x +
              logger::log_trace("FilteredData$srv_filter_panel initialized")
    543 - 1x + 1x +
              NULL
    @@ -4352,21 +4483,24 @@

    teal.slice coverage - 65.92%

    606 - 3x + 3x +
          checkmate::assert_function(active_datanames)
    607 - 3x + 3x +
          moduleServer(id, function(input, output, session) {
    608 - 3x + 3x +
            logger::log_trace("FilteredData$srv_active initializing")
    @@ -4380,7 +4514,8 @@

    teal.slice coverage - 65.92%

    610 - 3x + 3x +
            private$srv_available_filters("available_filters")
    @@ -4394,7 +4529,8 @@

    teal.slice coverage - 65.92%

    612 - 3x + 3x +
            observeEvent(input$minimise_filter_active, {
    @@ -4443,42 +4579,48 @@

    teal.slice coverage - 65.92%

    619 - 3x + 3x +
            observeEvent(private$get_filter_count(), {
    620 - 3x + 3x +
              shinyjs::toggle("remove_all_filters", condition = private$get_filter_count() != 0)
    621 - 3x + 3x +
              shinyjs::show("filter_active_vars_contents")
    622 - 3x + 3x +
              shinyjs::hide("filters_active_count")
    623 - 3x + 3x +
              toggle_icon(session$ns("minimise_filter_active"), c("fa-angle-right", "fa-angle-down"), TRUE)
    624 - 3x + 3x +
              toggle_title(session$ns("minimise_filter_active"), c("Restore panel", "Minimise Panel"), TRUE)
    @@ -4499,28 +4641,32 @@

    teal.slice coverage - 65.92%

    627 - 3x + 3x +
            observeEvent(active_datanames(), {
    628 - 2x + 2x +
              lapply(self$datanames(), function(dataname) {
    629 - 4x + 4x +
                if (dataname %in% active_datanames()) {
    630 - 4x + 4x +
                  shinyjs::show(dataname)
    @@ -4583,35 +4729,40 @@

    teal.slice coverage - 65.92%

    639 - 3x + 3x +
            lapply(
    640 - 3x + 3x +
              self$datanames(),
    641 - 3x + 3x +
              function(dataname) {
    642 - 6x + 6x +
                fdataset <- private$get_filtered_dataset(dataname)
    643 - 6x + 6x +
                fdataset$srv_active(id = dataname)
    @@ -4639,49 +4790,56 @@

    teal.slice coverage - 65.92%

    647 - 3x + 3x +
            output$teal_filters_count <- renderText({
    648 - 3x + 3x +
              n_filters_active <- private$get_filter_count()
    649 - 3x + 3x +
              req(n_filters_active > 0L)
    650 - 2x + 2x +
              sprintf(
    651 - 2x + 2x +
                "%s filter%s applied across datasets",
    652 - 2x + 2x +
                n_filters_active,
    653 - 2x + 2x +
                ifelse(n_filters_active == 1, "", "s")
    @@ -4709,28 +4867,32 @@

    teal.slice coverage - 65.92%

    657 - 3x + 3x +
            observeEvent(input$remove_all_filters, {
    658 - 1x + 1x +
              logger::log_trace("FilteredData$srv_filter_panel@1 removing all non-anchored filters")
    659 - 1x + 1x +
              self$clear_filter_states()
    660 - 1x + 1x +
              logger::log_trace("FilteredData$srv_filter_panel@1 removed all non-anchored filters")
    @@ -4744,14 +4906,16 @@

    teal.slice coverage - 65.92%

    662 - 3x + 3x +
            logger::log_trace("FilteredData$srv_active initialized")
    663 - 3x + 3x +
            NULL
    @@ -5129,28 +5293,32 @@

    teal.slice coverage - 65.92%

    717 - 1x + 1x +
          checkmate::assert_class(active_datanames, "reactive")
    718 - 1x + 1x +
          moduleServer(id, function(input, output, session) {
    719 - 1x + 1x +
            logger::log_trace("FilteredData$srv_add initializing")
    720 - 1x + 1x +
            observeEvent(input$minimise_filter_add_vars, {
    @@ -5192,7 +5360,8 @@

    teal.slice coverage - 65.92%

    726 - 1x + 1x +
            observeEvent(active_datanames(), {
    @@ -5276,35 +5445,40 @@

    teal.slice coverage - 65.92%

    738 - 1x + 1x +
            lapply(
    739 - 1x + 1x +
              self$datanames(),
    740 - 1x + 1x +
              function(dataname) {
    741 - 2x + 2x +
                fdataset <- private$get_filtered_dataset(dataname)
    742 - 2x + 2x +
                fdataset$srv_add(id = dataname)
    @@ -5325,14 +5499,16 @@

    teal.slice coverage - 65.92%

    745 - 1x + 1x +
            logger::log_trace("FilteredData$srv_filter_panel initialized")
    746 - 1x + 1x +
            NULL
    @@ -5752,35 +5928,40 @@

    teal.slice coverage - 65.92%

    806 - 1x + 1x +
          checkmate::assert_class(active_datanames, "reactive")
    807 - 1x + 1x +
          moduleServer(
    808 - 1x + 1x +
            id = id,
    809 - 1x + 1x +
            function(input, output, session) {
    810 - 1x + 1x +
              logger::log_trace("FilteredData$srv_filter_overview initializing")
    @@ -5794,7 +5975,8 @@

    teal.slice coverage - 65.92%

    812 - 1x + 1x +
              observeEvent(input$minimise_filter_overview, {
    @@ -5836,7 +6018,8 @@

    teal.slice coverage - 65.92%

    818 - 1x + 1x +
              output$table <- renderUI({
    @@ -6410,14 +6593,16 @@

    teal.slice coverage - 65.92%

    900 - 1x + 1x +
              logger::log_trace("FilteredData$srv_filter_overview initialized")
    901 - 1x + 1x +
              NULL
    @@ -6676,7 +6861,8 @@

    teal.slice coverage - 65.92%

    938 - 147x + 147x +
          if (length(dataname) == 0) {
    @@ -6697,7 +6883,8 @@

    teal.slice coverage - 65.92%

    941 - 147x + 147x +
            private$filtered_datasets[[dataname]]
    @@ -6781,7 +6968,8 @@

    teal.slice coverage - 65.92%

    953 - 11x + 11x +
          length(self$get_filter_state())
    @@ -7047,28 +7235,32 @@

    teal.slice coverage - 65.92%

    991 - 4x + 4x +
          moduleServer(id, function(input, output, session) {
    992 - 4x + 4x +
            slices_available <- self$get_available_teal_slices()
    993 - 4x + 4x +
            slices_interactive <- reactive(
    994 - 4x + 4x +
              Filter(function(slice) isFALSE(slice$fixed), slices_available())
    @@ -7082,14 +7274,16 @@

    teal.slice coverage - 65.92%

    996 - 4x + 4x +
            slices_fixed <- reactive(
    997 - 4x + 4x +
              Filter(function(slice) isTRUE(slice$fixed), slices_available())
    @@ -7103,21 +7297,24 @@

    teal.slice coverage - 65.92%

    999 - 4x + 4x +
            available_slices_id <- reactive(vapply(slices_available(), `[[`, character(1), "id"))
    1000 - 4x + 4x +
            active_slices_id <- reactive(vapply(self$get_filter_state(), `[[`, character(1), "id"))
    1001 - 4x + 4x +
            duplicated_slice_references <- reactive({
    @@ -7131,35 +7328,40 @@

    teal.slice coverage - 65.92%

    1003 - 8x + 8x +
              slice_reference <- vapply(slices_available(), get_default_slice_id, character(1))
    1004 - 8x + 8x +
              is_duplicated_reference <- duplicated(slice_reference) | duplicated(slice_reference, fromLast = TRUE)
    1005 - 8x + 8x +
              is_active <- available_slices_id() %in% active_slices_id()
    1006 - 8x + 8x +
              is_not_expr <- !vapply(slices_available(), inherits, logical(1), "teal_slice_expr")
    1007 - 8x + 8x +
              slice_reference[is_duplicated_reference & is_active & is_not_expr]
    @@ -7180,70 +7382,80 @@

    teal.slice coverage - 65.92%

    1010 - 4x + 4x +
            checkbox_group_element <- function(name, value, label, checked, disabled = FALSE) {
    1011 - 35x + 35x +
              tags$div(
    1012 - 35x + 35x +
                class = "checkbox available-filters",
    1013 - 35x + 35x +
                tags$label(
    1014 - 35x + 35x +
                  tags$input(
    1015 - 35x + 35x +
                    type = "checkbox",
    1016 - 35x + 35x +
                    name = name,
    1017 - 35x + 35x +
                    value = value,
    1018 - 35x + 35x +
                    checked = checked,
    1019 - 35x + 35x +
                    disabled = if (disabled) "disabled"
    @@ -7257,7 +7469,8 @@

    teal.slice coverage - 65.92%

    1021 - 35x + 35x +
                  tags$span(label, disabled = if (disabled) disabled)
    @@ -7292,42 +7505,48 @@

    teal.slice coverage - 65.92%

    1026 - 4x + 4x +
            output$checkbox <- renderUI({
    1027 - 8x + 8x +
              checkbox <- checkboxGroupInput(
    1028 - 8x + 8x +
                session$ns("available_slices_id"),
    1029 - 8x + 8x +
                label = NULL,
    1030 - 8x + 8x +
                choices = NULL,
    1031 - 8x + 8x +
                selected = NULL
    @@ -7341,14 +7560,16 @@

    teal.slice coverage - 65.92%

    1033 - 8x + 8x +
              active_slices_ids <- active_slices_id()
    1034 - 8x + 8x +
              duplicated_slice_refs <- duplicated_slice_references()
    @@ -7362,7 +7583,8 @@

    teal.slice coverage - 65.92%

    1036 - 8x + 8x +
              checkbox_group_slice <- function(slice) {
    @@ -7376,63 +7598,72 @@

    teal.slice coverage - 65.92%

    1038 - 35x + 35x +
                isolate({
    1039 - 35x + 35x +
                  checkbox_group_element(
    1040 - 35x + 35x +
                    name = session$ns("available_slices_id"),
    1041 - 35x + 35x +
                    value = slice$id,
    1042 - 35x + 35x +
                    label = slice$id,
    1043 - 35x + 35x +
                    checked = if (slice$id %in% active_slices_ids) "checked",
    1044 - 35x + 35x +
                    disabled = slice$anchored ||
    1045 - 35x + 35x +
                      get_default_slice_id(slice) %in% duplicated_slice_refs &&
    1046 - 35x + 35x +
                        !slice$id %in% active_slices_ids
    @@ -7467,14 +7698,16 @@

    teal.slice coverage - 65.92%

    1051 - 8x + 8x +
              interactive_choice_mock <- lapply(slices_interactive(), checkbox_group_slice)
    1052 - 8x + 8x +
              non_interactive_choice_mock <- lapply(slices_fixed(), checkbox_group_slice)
    @@ -7488,63 +7721,72 @@

    teal.slice coverage - 65.92%

    1054 - 8x + 8x +
              htmltools::tagInsertChildren(
    1055 - 8x + 8x +
                checkbox,
    1056 - 8x + 8x +
                tags$br(),
    1057 - 8x + 8x +
                if (length(non_interactive_choice_mock)) tags$strong("Fixed filters"),
    1058 - 8x + 8x +
                non_interactive_choice_mock,
    1059 - 8x + 8x +
                if (length(interactive_choice_mock)) tags$strong("Interactive filters"),
    1060 - 8x + 8x +
                interactive_choice_mock,
    1061 - 8x + 8x +
                .cssSelector = "div.shiny-options-group",
    1062 - 8x + 8x +
                after = 0
    @@ -7572,49 +7814,56 @@

    teal.slice coverage - 65.92%

    1066 - 4x + 4x +
            observeEvent(input$available_slices_id, ignoreNULL = FALSE, ignoreInit = TRUE, {
    1067 - 5x + 5x +
              new_slices_id <- setdiff(input$available_slices_id, active_slices_id())
    1068 - 5x + 5x +
              removed_slices_id <- setdiff(active_slices_id(), input$available_slices_id)
    1069 - 5x + 5x +
              if (length(new_slices_id)) {
    1070 - 3x + 3x +
                new_teal_slices <- Filter(
    1071 - 3x + 3x +
                  function(slice) slice$id %in% new_slices_id,
    1072 - 3x + 3x +
                  private$available_teal_slices()
    @@ -7628,7 +7877,8 @@

    teal.slice coverage - 65.92%

    1074 - 3x + 3x +
                self$set_filter_state(new_teal_slices)
    @@ -7649,28 +7899,32 @@

    teal.slice coverage - 65.92%

    1077 - 5x + 5x +
              if (length(removed_slices_id)) {
    1078 - 4x + 4x +
                removed_teal_slices <- Filter(
    1079 - 4x + 4x +
                  function(slice) slice$id %in% removed_slices_id,
    1080 - 4x + 4x +
                  self$get_filter_state()
    @@ -7684,7 +7938,8 @@

    teal.slice coverage - 65.92%

    1082 - 4x + 4x +
                self$remove_filter_state(removed_teal_slices)
    @@ -7712,21 +7967,24 @@

    teal.slice coverage - 65.92%

    1086 - 4x + 4x +
            observeEvent(private$available_teal_slices(), ignoreNULL = FALSE, {
    1087 - 3x + 3x +
              if (length(private$available_teal_slices())) {
    1088 - 1x + 1x +
                shinyjs::show("available_menu")
    @@ -7740,7 +7998,8 @@

    teal.slice coverage - 65.92%

    1090 - 2x + 2x +
                shinyjs::hide("available_menu")
    @@ -8887,56 +9146,64 @@

    teal.slice coverage - 65.92%

    157 - 121x + 121x +
          isolate({
    158 - 121x + 121x +
            checkmate::assert_numeric(x, all.missing = FALSE)
    159 - 2x + 2x +
            if (!any(is.finite(x))) stop("\"x\" contains no finite values")
    160 - 118x + 118x +
            super$initialize(x = x, x_reactive = x_reactive, slice = slice, extract_type = extract_type)
    161 - 118x + 118x +
            private$is_integer <- checkmate::test_integerish(x)
    162 - 118x + 118x +
            private$inf_count <- sum(is.infinite(x))
    163 - 118x + 118x +
            private$inf_filtered_count <- reactive(
    164 - 118x + 118x +
              if (!is.null(private$x_reactive())) sum(is.infinite(private$x_reactive()))
    @@ -8957,14 +9224,16 @@

    teal.slice coverage - 65.92%

    167 - 118x + 118x +
            checkmate::assert_numeric(slice$choices, null.ok = TRUE)
    168 - 3x + 3x +
            if (is.null(slice$keep_inf) && any(is.infinite(x))) slice$keep_inf <- TRUE
    @@ -8978,21 +9247,24 @@

    teal.slice coverage - 65.92%

    170 - 117x + 117x +
            private$set_choices(slice$choices)
    171 - 42x + 42x +
            if (is.null(slice$selected)) slice$selected <- slice$choices
    172 - 117x + 117x +
            private$set_selected(slice$selected)
    @@ -9006,21 +9278,24 @@

    teal.slice coverage - 65.92%

    174 - 114x + 114x +
            private$is_integer <- checkmate::test_integerish(x)
    175 - 114x + 114x +
            private$inf_filtered_count <- reactive(
    176 - 114x + 114x +
              if (!is.null(private$x_reactive())) sum(is.infinite(private$x_reactive()))
    @@ -9034,7 +9309,8 @@

    teal.slice coverage - 65.92%

    178 - 114x + 114x +
            private$inf_count <- sum(is.infinite(x))
    @@ -9048,63 +9324,72 @@

    teal.slice coverage - 65.92%

    180 - 114x + 114x +
            private$plot_data <- list(
    181 - 114x + 114x +
              type = "histogram",
    182 - 114x + 114x +
              nbinsx = 50,
    183 - 114x + 114x +
              x = Filter(Negate(is.na), Filter(is.finite, private$x)),
    184 - 114x + 114x +
              color = I(fetch_bs_color("secondary")),
    185 - 114x + 114x +
              alpha = 0.2,
    186 - 114x + 114x +
              bingroup = 1,
    187 - 114x + 114x +
              showlegend = FALSE,
    188 - 114x + 114x +
              hoverinfo = "none"
    @@ -9118,21 +9403,24 @@

    teal.slice coverage - 65.92%

    190 - 114x + 114x +
            private$plot_mask <- list(list(
    191 - 114x + 114x +
              type = "rect", fillcolor = rgb(1, 1, 1, .65), line = list(width = 0),
    192 - 114x + 114x +
              x0 = -0.5, x1 = 1.5, y0 = -0.5, y1 = 1.5, xref = "paper", yref = "paper"
    @@ -9146,84 +9434,96 @@

    teal.slice coverage - 65.92%

    194 - 114x + 114x +
            private$plot_layout <- reactive({
    195 - 5x + 5x +
              shapes <- private$get_shape_properties(private$get_selected())
    196 - 5x + 5x +
              list(
    197 - 5x + 5x +
                barmode = "overlay",
    198 - 5x + 5x +
                xaxis = list(
    199 - 5x + 5x +
                  range = private$get_choices() * c(0.995, 1.005),
    200 - 5x + 5x +
                  rangeslider = list(thickness = 0),
    201 - 5x + 5x +
                  showticklabels = TRUE,
    202 - 5x + 5x +
                  ticks = "outside",
    203 - 5x + 5x +
                  ticklen = 1.5,
    204 - 5x + 5x +
                  tickmode = "auto",
    205 - 5x + 5x +
                  nticks = 10
    @@ -9237,35 +9537,40 @@

    teal.slice coverage - 65.92%

    207 - 5x + 5x +
                yaxis = list(showgrid = FALSE, showticklabels = FALSE),
    208 - 5x + 5x +
                margin = list(b = 17, l = 0, r = 0, t = 0, autoexpand = FALSE),
    209 - 5x + 5x +
                plot_bgcolor = "#FFFFFF00",
    210 - 5x + 5x +
                paper_bgcolor = "#FFFFFF00",
    211 - 5x + 5x +
                shapes = shapes
    @@ -9286,35 +9591,40 @@

    teal.slice coverage - 65.92%

    214 - 114x + 114x +
            private$plot_config <- reactive({
    215 - 5x + 5x +
              list(
    216 - 5x + 5x +
                doubleClick = "reset",
    217 - 5x + 5x +
                displayModeBar = FALSE,
    218 - 5x + 5x +
                edits = list(shapePosition = TRUE)
    @@ -9335,49 +9645,56 @@

    teal.slice coverage - 65.92%

    221 - 114x + 114x +
            private$plot_filtered <- reactive({
    222 - 5x + 5x +
              finite_values <- Filter(is.finite, private$x_reactive())
    223 - 5x + 5x +
              if (!identical(finite_values, numeric(0))) {
    224 - 5x + 5x +
                list(
    225 - 5x + 5x +
                  x = finite_values,
    226 - 5x + 5x +
                  bingroup = 1,
    227 - 5x + 5x +
                  color = I(fetch_bs_color("primary"))
    @@ -9405,7 +9722,8 @@

    teal.slice coverage - 65.92%

    231 - 114x + 114x +
            invisible(self)
    @@ -9496,14 +9814,16 @@

    teal.slice coverage - 65.92%

    244 - 35x + 35x +
          if (isFALSE(private$is_any_filtered())) {
    245 - 1x + 1x +
            return(NULL)
    @@ -9517,28 +9837,32 @@

    teal.slice coverage - 65.92%

    247 - 4x + 4x +
          if (missing(dataname)) dataname <- private$get_dataname()
    248 - 34x + 34x +
          varname <- private$get_varname_prefixed(dataname)
    249 - 34x + 34x +
          filter_call <-
    250 - 34x + 34x +
            call(
    @@ -9552,14 +9876,16 @@

    teal.slice coverage - 65.92%

    252 - 34x + 34x +
              call(">=", varname, private$get_selected()[1L]),
    253 - 34x + 34x +
              call("<=", varname, private$get_selected()[2L])
    @@ -9573,7 +9899,8 @@

    teal.slice coverage - 65.92%

    255 - 34x + 34x +
          private$add_keep_na_call(private$add_keep_inf_call(filter_call, varname), varname)
    @@ -9755,21 +10082,24 @@

    teal.slice coverage - 65.92%

    281 - 117x + 117x +
          x <- private$x[is.finite(private$x)]
    282 - 117x + 117x +
          if (is.null(choices)) {
    283 - 105x + 105x +
            choices <- range(x)
    @@ -9783,35 +10113,40 @@

    teal.slice coverage - 65.92%

    285 - 12x + 12x +
            choices_adjusted <- c(max(choices[1L], min(x)), min(choices[2L], max(x)))
    286 - 12x + 12x +
            if (any(choices != choices_adjusted)) {
    287 - 1x + 1x +
              warning(sprintf(
    288 - 1x + 1x +
                "Choices adjusted (some values outside of variable range). Varname: %s, dataname: %s.",
    289 - 1x + 1x +
                private$get_varname(), private$get_dataname()
    @@ -9825,7 +10160,8 @@

    teal.slice coverage - 65.92%

    291 - 1x + 1x +
              choices <- choices_adjusted
    @@ -9839,35 +10175,40 @@

    teal.slice coverage - 65.92%

    293 - 12x + 12x +
            if (choices[1L] > choices[2L]) {
    294 - 1x + 1x +
              warning(sprintf(
    295 - 1x + 1x +
                "Invalid choices: lower is higher / equal to upper, or not in range of variable values.
    296 - 1x + 1x +
                Setting defaults. Varname: %s, dataname: %s.",
    297 - 1x + 1x +
                private$get_varname(), private$get_dataname()
    @@ -9881,7 +10222,8 @@

    teal.slice coverage - 65.92%

    299 - 1x + 1x +
              choices <- range(x)
    @@ -9909,21 +10251,24 @@

    teal.slice coverage - 65.92%

    303 - 117x + 117x +
          private$set_is_choice_limited(private$x, choices)
    304 - 117x + 117x +
          private$x <- private$x[
    305 - 117x + 117x +
            (private$x >= choices[1L] & private$x <= choices[2L]) | is.na(private$x) | !is.finite(private$x)
    @@ -9944,7 +10289,8 @@

    teal.slice coverage - 65.92%

    308 - 117x + 117x +
          x_range <- range(private$x, finite = TRUE)
    @@ -9965,14 +10311,16 @@

    teal.slice coverage - 65.92%

    311 - 117x + 117x +
          if (identical(diff(x_range), 0)) {
    312 - 2x + 2x +
            choices <- x_range
    @@ -9986,21 +10334,24 @@

    teal.slice coverage - 65.92%

    314 - 115x + 115x +
            x_pretty <- pretty(x_range, 100L)
    315 - 115x + 115x +
            choices <- range(x_pretty)
    316 - 115x + 115x +
            private$numeric_step <- signif(private$get_pretty_range_step(x_pretty), digits = 10)
    @@ -10014,14 +10365,16 @@

    teal.slice coverage - 65.92%

    318 - 117x + 117x +
          private$teal_slice$choices <- choices
    319 - 117x + 117x +
          invisible(NULL)
    @@ -10063,28 +10416,32 @@

    teal.slice coverage - 65.92%

    325 - 117x + 117x +
          xl <- xl[!is.na(xl)]
    326 - 117x + 117x +
          xl <- xl[is.finite(xl)]
    327 - 117x + 117x +
          private$is_choice_limited <- (any(xl < choices[1L]) | any(xl > choices[2L]))
    328 - 117x + 117x +
          invisible(NULL)
    @@ -10126,14 +10483,16 @@

    teal.slice coverage - 65.92%

    334 - 34x + 34x +
          if (isTRUE(private$get_keep_inf())) {
    335 - 2x + 2x +
            call("|", call("is.infinite", varname), filter_call)
    @@ -10147,7 +10506,8 @@

    teal.slice coverage - 65.92%

    337 - 32x + 32x +
            filter_call
    @@ -10210,14 +10570,16 @@

    teal.slice coverage - 65.92%

    346 - 117x + 117x +
          if (private$is_integer && diff(range(pretty_range) > 2)) {
    347 - 46x + 46x +
            return(1L)
    @@ -10231,14 +10593,16 @@

    teal.slice coverage - 65.92%

    349 - 71x + 71x +
            n_steps <- length(pretty_range) - 1
    350 - 71x + 71x +
            return(signif(digits = 10, (max(pretty_range) - min(pretty_range)) / n_steps))
    @@ -10266,35 +10630,40 @@

    teal.slice coverage - 65.92%

    354 - 133x + 133x +
          tryCatch(
    355 - 133x + 133x +
            expr = {
    356 - 133x + 133x +
              values <- as.numeric(values)
    357 - 4x + 4x +
              if (anyNA(values)) stop()
    358 - 129x + 129x +
              values
    @@ -10308,7 +10677,8 @@

    teal.slice coverage - 65.92%

    360 - 133x + 133x +
            error = function(e) stop("Vector of set values must contain values coercible to numeric")
    @@ -10343,21 +10713,24 @@

    teal.slice coverage - 65.92%

    365 - 2x + 2x +
          if (length(values) != 2L) stop("Vector of set values must have length two.")
    366 - 2x + 2x +
          if (values[1L] > values[2L]) stop("Vector of set values must be sorted.")
    367 - 125x + 125x +
          values
    @@ -10385,21 +10758,24 @@

    teal.slice coverage - 65.92%

    371 - 2x + 2x +
          if (values[1L] < private$get_choices()[1L]) values[1L] <- private$get_choices()[1L]
    372 - 2x + 2x +
          if (values[2L] > private$get_choices()[2L]) values[2L] <- private$get_choices()[2L]
    373 - 125x + 125x +
          values
    @@ -10441,35 +10817,40 @@

    teal.slice coverage - 65.92%

    379 - 35x + 35x +
          if (private$is_choice_limited) {
    380 - 1x + 1x +
            TRUE
    381 - 34x + 34x +
          } else if (!isTRUE(all.equal(private$get_selected(), private$get_choices()))) {
    382 - 32x + 32x +
            TRUE
    383 - 2x + 2x +
          } else if (!isTRUE(private$get_keep_inf()) && private$inf_count > 0) {
    @@ -10483,14 +10864,16 @@

    teal.slice coverage - 65.92%

    385 - 2x + 2x +
          } else if (!isTRUE(private$get_keep_na()) && private$na_count > 0) {
    386 - 1x + 1x +
            TRUE
    @@ -10504,7 +10887,8 @@

    teal.slice coverage - 65.92%

    388 - 1x + 1x +
            FALSE
    @@ -10553,21 +10937,24 @@

    teal.slice coverage - 65.92%

    395 - 5x + 5x +
          list(
    396 - 5x + 5x +
            list(type = "line", x0 = values[1], x1 = values[1], y0 = -100, y1 = 100, yref = "paper"),
    397 - 5x + 5x +
            list(type = "line", x0 = values[2], x1 = values[2], y0 = -100, y1 = 100, yref = "paper")
    @@ -10644,70 +11031,80 @@

    teal.slice coverage - 65.92%

    408 - 5x + 5x +
          ns <- NS(id)
    409 - 5x + 5x +
          isolate({
    410 - 5x + 5x +
            ui_input <- shinyWidgets::numericRangeInput(
    411 - 5x + 5x +
              inputId = ns("selection_manual"),
    412 - 5x + 5x +
              label = NULL,
    413 - 5x + 5x +
              min = private$get_choices()[1L],
    414 - 5x + 5x +
              max = private$get_choices()[2L],
    415 - 5x + 5x +
              value = private$get_selected(),
    416 - 5x + 5x +
              step = private$numeric_step,
    417 - 5x + 5x +
              width = "100%"
    @@ -10721,28 +11118,32 @@

    teal.slice coverage - 65.92%

    419 - 5x + 5x +
            tagList(
    420 - 5x + 5x +
              tags$div(
    421 - 5x + 5x +
                class = "choices_state",
    422 - 5x + 5x +
                tags$head(tags$script(
    @@ -10770,21 +11171,24 @@

    teal.slice coverage - 65.92%

    426 - 5x + 5x +
                  HTML(
    427 - 5x + 5x +
                    '$(document).ready(function() {
    428 - 5x + 5x +
                      $("[data-toggle=\'popover\']").popover();
    @@ -10798,35 +11202,40 @@

    teal.slice coverage - 65.92%

    430 - 5x + 5x +
                      $(document).on("click", function (e) {
    431 - 5x + 5x +
                        if (!$("[data-toggle=\'popover\']").is(e.target) &&
    432 - 5x + 5x +
                            $("[data-toggle=\'popover\']").has(e.target).length === 0 &&
    433 - 5x + 5x +
                            $(".popover").has(e.target).length === 0) {
    434 - 5x + 5x +
                          $("[data-toggle=\'popover\']").popover("hide");
    @@ -10868,105 +11277,120 @@

    teal.slice coverage - 65.92%

    440 - 5x + 5x +
                tags$div(
    441 - 5x + 5x +
                  actionLink(
    442 - 5x + 5x +
                    ns("plotly_info"),
    443 - 5x + 5x +
                    label = NULL,
    444 - 5x + 5x +
                    icon = icon("question-circle"),
    445 - 5x + 5x +
                    "data-toggle" = "popover",
    446 - 5x + 5x +
                    "data-html" = "true",
    447 - 5x + 5x +
                    "data-placement" = "left",
    448 - 5x + 5x +
                    "data-trigger" = "click",
    449 - 5x + 5x +
                    "data-title" = "Plot actions",
    450 - 5x + 5x +
                    "data-content" = "<p>
    451 - 5x + 5x +
                                      Drag vertical lines to set selection.<br>
    452 - 5x + 5x +
                                      Drag across plot to zoom in.<br>
    453 - 5x + 5x +
                                      Drag axis to pan.<br>
    454 - 5x + 5x +
                                      Double click to zoom out."
    @@ -10980,7 +11404,8 @@

    teal.slice coverage - 65.92%

    456 - 5x + 5x +
                  style = "text-align: right; font-size: 0.7em; margin-bottom: -1em; position: relative; z-index: 9;"
    @@ -10994,35 +11419,40 @@

    teal.slice coverage - 65.92%

    458 - 5x + 5x +
                shinycssloaders::withSpinner(
    459 - 5x + 5x +
                  plotly::plotlyOutput(ns("plot"), height = "50px"),
    460 - 5x + 5x +
                  type = 4,
    461 - 5x + 5x +
                  size = 0.25,
    462 - 5x + 5x +
                  hide.ui = FALSE
    @@ -11036,7 +11466,8 @@

    teal.slice coverage - 65.92%

    464 - 5x + 5x +
                ui_input
    @@ -11050,28 +11481,32 @@

    teal.slice coverage - 65.92%

    466 - 5x + 5x +
              tags$div(
    467 - 5x + 5x +
                class = "filter-card-body-keep-na-inf",
    468 - 5x + 5x +
                private$keep_inf_ui(ns("keep_inf")),
    469 - 5x + 5x +
                private$keep_na_ui(ns("keep_na"))
    @@ -11148,28 +11583,32 @@

    teal.slice coverage - 65.92%

    480 - 5x + 5x +
          moduleServer(
    481 - 5x + 5x +
            id = id,
    482 - 5x + 5x +
            function(input, output, session) {
    483 - 5x + 5x +
              logger::log_trace("RangeFilterState$server initializing, id: { private$get_id() }")
    @@ -11190,7 +11629,8 @@

    teal.slice coverage - 65.92%

    486 - 5x + 5x +
              selection_manual <- debounce(reactive(input$selection_manual), 200)
    @@ -11211,7 +11651,8 @@

    teal.slice coverage - 65.92%

    489 - 5x + 5x +
              plot_data <- c(private$plot_data, source = session$ns("histogram_plot"))
    @@ -11232,42 +11673,48 @@

    teal.slice coverage - 65.92%

    492 - 5x + 5x +
              output$plot <- plotly::renderPlotly({
    493 - 5x + 5x +
                histogram <- do.call(plotly::plot_ly, plot_data)
    494 - 5x + 5x +
                histogram <- do.call(plotly::layout, c(list(p = histogram), private$plot_layout()))
    495 - 5x + 5x +
                histogram <- do.call(plotly::config, c(list(p = histogram), private$plot_config()))
    496 - 5x + 5x +
                histogram <- do.call(plotly::add_histogram, c(list(p = histogram), private$plot_filtered()))
    497 - 5x + 5x +
                histogram
    @@ -11295,63 +11742,72 @@

    teal.slice coverage - 65.92%

    501 - 5x + 5x +
              private$observers$relayout <-
    502 - 5x + 5x +
                observeEvent(
    503 - 5x + 5x +
                  ignoreNULL = FALSE,
    504 - 5x + 5x +
                  ignoreInit = TRUE,
    505 - 5x + 5x +
                  eventExpr = plotly::event_data("plotly_relayout", source = session$ns("histogram_plot")),
    506 - 5x + 5x +
                  handlerExpr = {
    507 - 1x + 1x +
                    logger::log_trace("RangeFilterState$server@1 selection changed, id: { private$get_id() }")
    508 - 1x + 1x +
                    event <- plotly::event_data("plotly_relayout", source = session$ns("histogram_plot"))
    509 - 1x + 1x +
                    if (any(grepl("shapes", names(event)))) {
    @@ -11540,42 +11996,48 @@

    teal.slice coverage - 65.92%

    536 - 5x + 5x +
              private$observers$selection_api <-
    537 - 5x + 5x +
                observeEvent(
    538 - 5x + 5x +
                  ignoreNULL = FALSE,
    539 - 5x + 5x +
                  ignoreInit = TRUE,
    540 - 5x + 5x +
                  eventExpr = private$get_selected(),
    541 - 5x + 5x +
                  handlerExpr = {
    @@ -11666,35 +12128,40 @@

    teal.slice coverage - 65.92%

    554 - 5x + 5x +
              private$observers$selection_manual <- observeEvent(
    555 - 5x + 5x +
                ignoreNULL = FALSE,
    556 - 5x + 5x +
                ignoreInit = TRUE,
    557 - 5x + 5x +
                eventExpr = selection_manual(),
    558 - 5x + 5x +
                handlerExpr = {
    @@ -11960,14 +12427,16 @@

    teal.slice coverage - 65.92%

    596 - 5x + 5x +
              private$keep_inf_srv("keep_inf")
    597 - 5x + 5x +
              private$keep_na_srv("keep_na")
    @@ -11981,14 +12450,16 @@

    teal.slice coverage - 65.92%

    599 - 5x + 5x +
              logger::log_trace("RangeFilterState$server initialized, id: { private$get_id() }")
    600 - 5x + 5x +
              NULL
    @@ -12275,42 +12746,48 @@

    teal.slice coverage - 65.92%

    641 - 5x + 5x +
          selection <- private$get_selected()
    642 - 5x + 5x +
          tagList(
    643 - 5x + 5x +
            tags$span(HTML(selection[1], "&ndash;", selection[2]), class = "filter-card-summary-value"),
    644 - 5x + 5x +
            tags$span(
    645 - 5x + 5x +
              class = "filter-card-summary-controls",
    646 - 5x + 5x +
              if (private$na_count > 0) {
    @@ -12331,7 +12808,8 @@

    teal.slice coverage - 65.92%

    649 - 5x + 5x +
              if (private$inf_count > 0) {
    @@ -12415,7 +12893,8 @@

    teal.slice coverage - 65.92%

    661 - 5x + 5x +
          ns <- NS(id)
    @@ -12429,7 +12908,8 @@

    teal.slice coverage - 65.92%

    663 - 5x + 5x +
          if (private$inf_count > 0) {
    @@ -12569,7 +13049,8 @@

    teal.slice coverage - 65.92%

    683 - 5x + 5x +
            NULL
    @@ -12646,7 +13127,8 @@

    teal.slice coverage - 65.92%

    694 - 5x + 5x +
          moduleServer(id, function(input, output, session) {
    @@ -12674,42 +13156,48 @@

    teal.slice coverage - 65.92%

    698 - 5x + 5x +
            output$trigger_visible <- renderUI({
    699 - 5x + 5x +
              updateCountText(
    700 - 5x + 5x +
                inputId = "count_label",
    701 - 5x + 5x +
                label = "Keep Inf",
    702 - 5x + 5x +
                countmax = private$inf_count,
    703 - 5x + 5x +
                countnow = private$inf_filtered_count()
    @@ -12723,7 +13211,8 @@

    teal.slice coverage - 65.92%

    705 - 5x + 5x +
              NULL
    @@ -12765,35 +13254,40 @@

    teal.slice coverage - 65.92%

    711 - 5x + 5x +
            private$observers$keep_inf_api <- observeEvent(
    712 - 5x + 5x +
              ignoreNULL = TRUE, # its not possible for range that NULL is selected
    713 - 5x + 5x +
              ignoreInit = TRUE, # ignoreInit: should not matter because we set the UI with the desired initial state
    714 - 5x + 5x +
              eventExpr = private$get_keep_inf(),
    715 - 5x + 5x +
              handlerExpr = {
    @@ -12870,35 +13364,40 @@

    teal.slice coverage - 65.92%

    726 - 5x + 5x +
            private$observers$keep_inf <- observeEvent(
    727 - 5x + 5x +
              ignoreNULL = TRUE, # it's not possible for range that NULL is selected
    728 - 5x + 5x +
              ignoreInit = TRUE, # ignoreInit: should not matter because we set the UI with the desired initial state
    729 - 5x + 5x +
              eventExpr = input$value,
    730 - 5x + 5x +
              handlerExpr = {
    @@ -12947,7 +13446,8 @@

    teal.slice coverage - 65.92%

    737 - 5x + 5x +
            invisible(NULL)
    @@ -13366,7 +13866,8 @@

    teal.slice coverage - 65.92%

    55 - 23x + 23x +
          if (!requireNamespace("MultiAssayExperiment", quietly = TRUE)) {
    @@ -13387,21 +13888,24 @@

    teal.slice coverage - 65.92%

    58 - 23x + 23x +
          checkmate::assert_class(dataset, "MultiAssayExperiment")
    59 - 21x + 21x +
          super$initialize(dataset, dataname, keys, label)
    60 - 21x + 21x +
          experiment_names <- names(dataset)
    @@ -13422,49 +13926,56 @@

    teal.slice coverage - 65.92%

    63 - 21x + 21x +
          private$add_filter_states(
    64 - 21x + 21x +
            filter_states = init_filter_states(
    65 - 21x + 21x +
              data = dataset,
    66 - 21x + 21x +
              data_reactive = private$data_filtered_fun,
    67 - 21x + 21x +
              dataname = dataname,
    68 - 21x + 21x +
              datalabel = "subjects",
    69 - 21x + 21x +
              keys = self$get_keys()
    @@ -13478,7 +13989,8 @@

    teal.slice coverage - 65.92%

    71 - 21x + 21x +
            id = "subjects"
    @@ -13513,70 +14025,80 @@

    teal.slice coverage - 65.92%

    76 - 21x + 21x +
          lapply(
    77 - 21x + 21x +
            experiment_names,
    78 - 21x + 21x +
            function(experiment_name) {
    79 - 105x + 105x +
              data_reactive <- function(sid = "") private$data_filtered_fun(sid)[[experiment_name]]
    80 - 105x + 105x +
              private$add_filter_states(
    81 - 105x + 105x +
                filter_states = init_filter_states(
    82 - 105x + 105x +
                  data = dataset[[experiment_name]],
    83 - 105x + 105x +
                  data_reactive = data_reactive,
    84 - 105x + 105x +
                  dataname = dataname,
    85 - 105x + 105x +
                  datalabel = experiment_name
    @@ -13590,7 +14112,8 @@

    teal.slice coverage - 65.92%

    87 - 105x + 105x +
                id = experiment_name
    @@ -13681,35 +14204,40 @@

    teal.slice coverage - 65.92%

    100 - 15x + 15x +
          isolate({
    101 - 15x + 15x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initializing, dataname: { private$dataname }")
    102 - 15x + 15x +
            checkmate::assert_class(state, "teal_slices")
    103 - 14x + 14x +
            lapply(state, function(x) {
    104 - 52x + 52x +
              checkmate::assert_true(x$dataname == private$dataname, .var.name = "dataname matches private$dataname")
    @@ -13737,14 +14265,16 @@

    teal.slice coverage - 65.92%

    108 - 14x + 14x +
            subject_state <- Filter(function(x) is.null(x$experiment), state)
    109 - 14x + 14x +
            private$get_filter_states()[["subjects"]]$set_filter_state(subject_state)
    @@ -13772,28 +14302,32 @@

    teal.slice coverage - 65.92%

    113 - 14x + 14x +
            experiments <- unique(unlist(lapply(state, "[[", "experiment")))
    114 - 14x + 14x +
            available_experiments <- setdiff(names(private$get_filter_states()), "subjects")
    115 - 14x + 14x +
            excluded_filters <- setdiff(experiments, available_experiments)
    116 - 14x + 14x +
            if (length(excluded_filters)) {
    @@ -13863,21 +14397,24 @@

    teal.slice coverage - 65.92%

    126 - 14x + 14x +
            lapply(available_experiments, function(experiment) {
    127 - 70x + 70x +
              slices <- Filter(function(x) identical(x$experiment, experiment), state)
    128 - 70x + 70x +
              private$get_filter_states()[[experiment]]$set_filter_state(slices)
    @@ -13898,7 +14435,8 @@

    teal.slice coverage - 65.92%

    131 - 14x + 14x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initialized, dataname: { private$dataname }")
    @@ -13912,7 +14450,8 @@

    teal.slice coverage - 65.92%

    133 - 14x + 14x +
            invisible(NULL)
    @@ -14010,7 +14549,8 @@

    teal.slice coverage - 65.92%

    147 - 1x + 1x +
          checkmate::assert_class(state, "teal_slices")
    @@ -14024,14 +14564,16 @@

    teal.slice coverage - 65.92%

    149 - 1x + 1x +
          isolate({
    150 - 1x + 1x +
            logger::log_trace("{ class(self)[1] }$remove_filter_state removing filter(s), dataname: { private$dataname }")
    @@ -14045,14 +14587,16 @@

    teal.slice coverage - 65.92%

    152 - 1x + 1x +
            subject_state <- Filter(function(x) is.null(x$experiment), state)
    153 - 1x + 1x +
            private$get_filter_states()[["subjects"]]$remove_filter_state(subject_state)
    @@ -14080,28 +14624,32 @@

    teal.slice coverage - 65.92%

    157 - 1x + 1x +
            experiments <- unique(unlist(lapply(state, "[[", "experiment")))
    158 - 1x + 1x +
            available_experiments <- setdiff(names(private$get_filter_states()), "subjects")
    159 - 1x + 1x +
            excluded_filters <- setdiff(experiments, available_experiments)
    160 - 1x + 1x +
            if (length(excluded_filters)) {
    @@ -14164,7 +14712,8 @@

    teal.slice coverage - 65.92%

    169 - 1x + 1x +
            lapply(experiments, function(experiment) {
    @@ -14206,7 +14755,8 @@

    teal.slice coverage - 65.92%

    175 - 1x + 1x +
            logger::log_trace("{ class(self)[1] }$remove_filter_state removed filter(s), dataname: { private$dataname }")
    @@ -14227,7 +14777,8 @@

    teal.slice coverage - 65.92%

    178 - 1x + 1x +
          invisible(NULL)
    @@ -14514,21 +15065,24 @@

    teal.slice coverage - 65.92%

    219 - 2x + 2x +
          data <- self$get_dataset()
    220 - 2x + 2x +
          data_filtered <- self$get_dataset(TRUE)
    221 - 2x + 2x +
          experiment_names <- names(data)
    @@ -14542,28 +15096,32 @@

    teal.slice coverage - 65.92%

    223 - 2x + 2x +
          mae_info <- data.frame(
    224 - 2x + 2x +
            dataname = private$dataname,
    225 - 2x + 2x +
            subjects = nrow(SummarizedExperiment::colData(data)),
    226 - 2x + 2x +
            subjects_filtered = nrow(SummarizedExperiment::colData(data_filtered()))
    @@ -14584,49 +15142,56 @@

    teal.slice coverage - 65.92%

    229 - 2x + 2x +
          experiment_obs_info <- do.call("rbind", lapply(
    230 - 2x + 2x +
            experiment_names,
    231 - 2x + 2x +
            function(experiment_name) {
    232 - 10x + 10x +
              data.frame(
    233 - 10x + 10x +
                dataname = sprintf("- %s", experiment_name),
    234 - 10x + 10x +
                obs = nrow(data[[experiment_name]]),
    235 - 10x + 10x +
                obs_filtered = nrow(data_filtered()[[experiment_name]])
    @@ -14661,21 +15226,24 @@

    teal.slice coverage - 65.92%

    240 - 2x + 2x +
          get_experiment_keys <- function(mae, experiment) {
    241 - 20x + 20x +
            sample_subset <- subset(MultiAssayExperiment::sampleMap(mae), colname %in% colnames(experiment))
    242 - 20x + 20x +
            length(unique(sample_subset$primary))
    @@ -14696,42 +15264,48 @@

    teal.slice coverage - 65.92%

    245 - 2x + 2x +
          experiment_subjects_info <- do.call("rbind", lapply(
    246 - 2x + 2x +
            experiment_names,
    247 - 2x + 2x +
            function(experiment_name) {
    248 - 10x + 10x +
              data.frame(
    249 - 10x + 10x +
                subjects = get_experiment_keys(data, data[[experiment_name]]),
    250 - 10x + 10x +
                subjects_filtered = get_experiment_keys(data_filtered(), data_filtered()[[experiment_name]])
    @@ -14766,14 +15340,16 @@

    teal.slice coverage - 65.92%

    255 - 2x + 2x +
          experiment_info <- cbind(experiment_obs_info, experiment_subjects_info)
    256 - 2x + 2x +
          dplyr::bind_rows(mae_info, experiment_info)
    @@ -15668,21 +16244,24 @@

    teal.slice coverage - 65.92%

    124 - 580x + 580x +
      checkmate::assert_string(dataname)
    125 - 573x + 573x +
      checkmate::assert_flag(fixed)
    126 - 571x + 571x +
      checkmate::assert_flag(anchored)
    @@ -15696,7 +16275,8 @@

    teal.slice coverage - 65.92%

    128 - 569x + 569x +
      formal_args <- as.list(environment())
    @@ -15710,7 +16290,8 @@

    teal.slice coverage - 65.92%

    130 - 569x + 569x +
      if (!missing(expr) && !missing(varname)) {
    @@ -15724,28 +16305,32 @@

    teal.slice coverage - 65.92%

    132 - 569x + 569x +
      } else if (!missing(expr)) {
    133 - 30x + 30x +
        checkmate::assert_string(id)
    134 - 27x + 27x +
        checkmate::assert_string(title)
    135 - 24x + 24x +
        checkmate::assert_string(expr)
    @@ -15759,84 +16344,96 @@

    teal.slice coverage - 65.92%

    137 - 23x + 23x +
        formal_args$fixed <- TRUE
    138 - 23x + 23x +
        ts_expr_args <- c("dataname", "id", "expr", "fixed", "anchored", "title")
    139 - 23x + 23x +
        formal_args <- formal_args[ts_expr_args]
    140 - 23x + 23x +
        ans <- do.call(reactiveValues, c(formal_args, list(...)))
    141 - 23x + 23x +
        class(ans) <- c("teal_slice_expr", "teal_slice", class(ans))
    142 - 539x + 539x +
      } else if (!missing(varname)) {
    143 - 538x + 538x +
        checkmate::assert_string(varname)
    144 - 535x + 535x +
        checkmate::assert_multi_class(choices, .filterable_class, null.ok = TRUE)
    145 - 534x + 534x +
        checkmate::assert_multi_class(selected, .filterable_class, null.ok = TRUE)
    146 - 532x + 532x +
        checkmate::assert_flag(keep_na, null.ok = TRUE)
    147 - 531x + 531x +
        checkmate::assert_flag(keep_inf, null.ok = TRUE)
    148 - 530x + 530x +
        checkmate::assert_flag(multiple)
    @@ -15850,21 +16447,24 @@

    teal.slice coverage - 65.92%

    150 - 530x + 530x +
        ts_var_args <- c(
    151 - 530x + 530x +
          "dataname", "varname", "id", "choices", "selected", "keep_na", "keep_inf",
    152 - 530x + 530x +
          "fixed", "anchored", "multiple"
    @@ -15878,42 +16478,48 @@

    teal.slice coverage - 65.92%

    154 - 530x + 530x +
        formal_args <- formal_args[ts_var_args]
    155 - 530x + 530x +
        args <- c(formal_args, list(...))
    156 - 530x + 530x +
        args[c("choices", "selected")] <-
    157 - 530x + 530x +
          lapply(args[c("choices", "selected")], function(x) if (is.factor(x)) as.character(x) else x)
    158 - 530x + 530x +
        if (missing(id)) {
    159 - 521x + 521x +
          args$id <- get_default_slice_id(args)
    @@ -15927,7 +16533,8 @@

    teal.slice coverage - 65.92%

    161 - 9x + 9x +
          checkmate::assert_string(id)
    @@ -15941,14 +16548,16 @@

    teal.slice coverage - 65.92%

    163 - 527x + 527x +
        ans <- do.call(reactiveValues, args)
    164 - 527x + 527x +
        class(ans) <- c("teal_slice_var", "teal_slice", class(ans))
    @@ -15962,7 +16571,8 @@

    teal.slice coverage - 65.92%

    166 - 1x + 1x +
        stop("Must provide either `expr` or `varname`.")
    @@ -15983,7 +16593,8 @@

    teal.slice coverage - 65.92%

    169 - 550x + 550x +
      ans
    @@ -16116,7 +16727,8 @@

    teal.slice coverage - 65.92%

    188 - 4x + 4x +
      inherits(x, "teal_slice")
    @@ -16221,7 +16833,8 @@

    teal.slice coverage - 65.92%

    203 - 283x + 283x +
      formal_args <- setdiff(names(formals(teal_slice)), "...")
    @@ -16235,7 +16848,8 @@

    teal.slice coverage - 65.92%

    205 - 283x + 283x +
      x <- if (isRunning()) {
    @@ -16256,7 +16870,8 @@

    teal.slice coverage - 65.92%

    208 - 283x + 283x +
        isolate(reactiveValuesToList(x))
    @@ -16277,14 +16892,16 @@

    teal.slice coverage - 65.92%

    211 - 283x + 283x +
      formal_args <- intersect(formal_args, names(x))
    212 - 283x + 283x +
      extra_args <- rev(setdiff(names(x), formal_args))
    @@ -16298,7 +16915,8 @@

    teal.slice coverage - 65.92%

    214 - 283x + 283x +
      x[c(formal_args, extra_args)]
    @@ -16354,14 +16972,16 @@

    teal.slice coverage - 65.92%

    222 - 116x + 116x +
      checkmate::assert_flag(show_all)
    223 - 92x + 92x +
      checkmate::assert_flag(trim_lines)
    @@ -16375,14 +16995,16 @@

    teal.slice coverage - 65.92%

    225 - 86x + 86x +
      x_list <- as.list(x)
    226 - 47x + 47x +
      if (!show_all) x_list <- Filter(Negate(is.null), x_list)
    @@ -16396,7 +17018,8 @@

    teal.slice coverage - 65.92%

    228 - 86x + 86x +
      jsonify(x_list, trim_lines)
    @@ -16445,7 +17068,8 @@

    teal.slice coverage - 65.92%

    235 - 15x + 15x +
      cat(format(x, ...))
    @@ -16571,7 +17195,8 @@

    teal.slice coverage - 65.92%

    253 - 131x + 131x +
      checkmate::assert_list(x)
    @@ -16585,28 +17210,32 @@

    teal.slice coverage - 65.92%

    255 - 131x + 131x +
      x_json <- to_json(x)
    256 - 131x + 131x +
      x_json_justified <- justify_json(x_json)
    257 - 121x + 121x +
      if (trim_lines) x_json_justified <- trim_lines_json(x_json_justified)
    258 - 131x + 131x +
      paste(x_json_justified, collapse = "\n")
    @@ -16711,35 +17340,40 @@

    teal.slice coverage - 65.92%

    273 - 131x + 131x +
      no_unbox <- function(x) {
    274 - 2390x + 2390x +
        vars <- c("selected", "choices")
    275 - 2390x + 2390x +
        if (is.list(x)) {
    276 - 385x + 385x +
          for (var in vars) {
    277 - 307x + 307x +
            if (!is.null(x[[var]])) x[[var]] <- I(format_time(x[[var]]))
    @@ -16753,7 +17387,8 @@

    teal.slice coverage - 65.92%

    279 - 385x + 385x +
          lapply(x, no_unbox)
    @@ -16767,7 +17402,8 @@

    teal.slice coverage - 65.92%

    281 - 2005x + 2005x +
          x
    @@ -16795,7 +17431,8 @@

    teal.slice coverage - 65.92%

    285 - 131x + 131x +
      jsonlite::toJSON(no_unbox(x), pretty = TRUE, auto_unbox = TRUE, digits = 16, null = "null")
    @@ -16907,14 +17544,16 @@

    teal.slice coverage - 65.92%

    301 - 307x + 307x +
      if ("POSIXt" %in% class(x)) {
    302 - 20x + 20x +
        format(x, format = "%Y-%m-%d %H:%M:%S", usetz = TRUE, tz = "UTC")
    @@ -16928,7 +17567,8 @@

    teal.slice coverage - 65.92%

    304 - 287x + 287x +
        x
    @@ -17033,35 +17673,40 @@

    teal.slice coverage - 65.92%

    319 - 131x + 131x +
      format_name <- function(name, name_width) {
    320 - 2775x + 2775x +
        if (nchar(name) == 1 || nchar(gsub("\\s", "", name)) <= 2) {
    321 - 630x + 630x +
          return(name)
    322 - 2145x + 2145x +
        } else if (grepl("slices|attributes", name)) {
    323 - 90x + 90x +
          paste0(name, ":")
    @@ -17075,7 +17720,8 @@

    teal.slice coverage - 65.92%

    325 - 2055x + 2055x +
          paste(format(name, width = name_width), ":")
    @@ -17096,28 +17742,32 @@

    teal.slice coverage - 65.92%

    328 - 131x + 131x +
      json_lines <- strsplit(json, "\n")[[1]]
    329 - 131x + 131x +
      json_lines_split <- regmatches(json_lines, regexpr(":", json_lines), invert = TRUE)
    330 - 131x + 131x +
      name_width <- max(unlist(regexpr(":", json_lines))) - 1
    331 - 131x + 131x +
      vapply(json_lines_split, function(x) paste0(format_name(x[1], name_width), stats::na.omit(x[2])), character(1))
    @@ -17222,35 +17872,40 @@

    teal.slice coverage - 65.92%

    346 - 121x + 121x +
      name_width <- max(unlist(gregexpr(":", x))) - 1
    347 - 121x + 121x +
      trim_position <- name_width + 37L
    348 - 121x + 121x +
      x_trim <- substr(x, 1, trim_position)
    349 - 121x + 121x +
      substr(x_trim, trim_position - 2, trim_position) <- "..."
    350 - 121x + 121x +
      x_trim
    @@ -17418,28 +18073,32 @@

    teal.slice coverage - 65.92%

    374 - 610x + 610x +
      checkmate::assert_multi_class(x, c("teal_slice", "list"))
    375 - 610x + 610x +
      isolate({
    376 - 610x + 610x +
        if (inherits(x, "teal_slice_expr") || is.null(x$varname)) {
    377 - 10x + 10x +
          x$id
    @@ -17453,28 +18112,32 @@

    teal.slice coverage - 65.92%

    379 - 600x + 600x +
          paste(
    380 - 600x + 600x +
            Filter(
    381 - 600x + 600x +
              length,
    382 - 600x + 600x +
              as.list(x)[c("dataname", "varname", "experiment", "arg")]
    @@ -17488,7 +18151,8 @@

    teal.slice coverage - 65.92%

    384 - 600x + 600x +
            collapse = " "
    @@ -18019,14 +18683,16 @@

    teal.slice coverage - 65.92%

    71 - 103x + 103x +
          checkmate::assert_data_frame(dataset)
    72 - 101x + 101x +
          super$initialize(dataset, dataname, keys, label)
    @@ -18047,21 +18713,24 @@

    teal.slice coverage - 65.92%

    75 - 99x + 99x +
          if (!is.null(parent)) {
    76 - 10x + 10x +
            checkmate::assert_character(parent_name, len = 1)
    77 - 10x + 10x +
            checkmate::assert_character(join_keys, min.len = 1)
    @@ -18075,14 +18744,16 @@

    teal.slice coverage - 65.92%

    79 - 10x + 10x +
            private$parent_name <- parent_name
    80 - 10x + 10x +
            private$join_keys <- join_keys
    @@ -18096,28 +18767,32 @@

    teal.slice coverage - 65.92%

    82 - 10x + 10x +
            private$data_filtered_fun <- function(sid = "") {
    83 - 8x + 8x +
              checkmate::assert_character(sid)
    84 - 8x + 8x +
              if (length(sid)) {
    85 - 8x + 8x +
                logger::log_trace("filtering data dataname: { dataname }, sid: { sid }")
    @@ -18145,42 +18820,48 @@

    teal.slice coverage - 65.92%

    89 - 8x + 8x +
              env <- new.env(parent = parent.env(globalenv()))
    90 - 8x + 8x +
              env[[dataname]] <- private$dataset
    91 - 8x + 8x +
              env[[parent_name]] <- parent()
    92 - 8x + 8x +
              filter_call <- self$get_call(sid)
    93 - 8x + 8x +
              eval_expr_with_msg(filter_call, env)
    94 - 8x + 8x +
              get(x = dataname, envir = env)
    @@ -18208,42 +18889,48 @@

    teal.slice coverage - 65.92%

    98 - 99x + 99x +
          private$add_filter_states(
    99 - 99x + 99x +
            filter_states = init_filter_states(
    100 - 99x + 99x +
              data = dataset,
    101 - 99x + 99x +
              data_reactive = private$data_filtered_fun,
    102 - 99x + 99x +
              dataname = dataname,
    103 - 99x + 99x +
              keys = self$get_keys()
    @@ -18257,7 +18944,8 @@

    teal.slice coverage - 65.92%

    105 - 99x + 99x +
            id = "filter"
    @@ -18285,35 +18973,40 @@

    teal.slice coverage - 65.92%

    109 - 99x + 99x +
          if (!is.null(parent)) {
    110 - 10x + 10x +
            fs <- teal_slices(
    111 - 10x + 10x +
              exclude_varnames = structure(
    112 - 10x + 10x +
                list(intersect(colnames(dataset), colnames(isolate(parent())))),
    113 - 10x + 10x +
                names = private$dataname
    @@ -18334,7 +19027,8 @@

    teal.slice coverage - 65.92%

    116 - 10x + 10x +
            self$set_filter_state(fs)
    @@ -18355,7 +19049,8 @@

    teal.slice coverage - 65.92%

    119 - 99x + 99x +
          invisible(self)
    @@ -18481,28 +19176,32 @@

    teal.slice coverage - 65.92%

    137 - 42x + 42x +
          logger::log_trace("DataframeFilteredDataset$get_call initializing for dataname: { private$dataname }")
    138 - 42x + 42x +
          filter_call <- super$get_call(sid)
    139 - 42x + 42x +
          dataname <- private$dataname
    140 - 42x + 42x +
          parent_dataname <- private$parent_name
    @@ -18516,28 +19215,32 @@

    teal.slice coverage - 65.92%

    142 - 42x + 42x +
          if (!identical(parent_dataname, character(0))) {
    143 - 9x + 9x +
            join_keys <- private$join_keys
    144 - 9x + 9x +
            parent_keys <- unname(join_keys)
    145 - 9x + 9x +
            dataset_keys <- names(join_keys)
    @@ -18551,7 +19254,8 @@

    teal.slice coverage - 65.92%

    147 - 9x + 9x +
            y_arg <- if (length(parent_keys) == 0L) {
    @@ -18572,28 +19276,32 @@

    teal.slice coverage - 65.92%

    150 - 9x + 9x +
              sprintf(
    151 - 9x + 9x +
                "%s[, c(%s), drop = FALSE]",
    152 - 9x + 9x +
                parent_dataname,
    153 - 9x + 9x +
                toString(dQuote(parent_keys, q = FALSE))
    @@ -18621,7 +19329,8 @@

    teal.slice coverage - 65.92%

    157 - 9x + 9x +
            more_args <- if (length(parent_keys) == 0 || length(dataset_keys) == 0) {
    @@ -18635,14 +19344,16 @@

    teal.slice coverage - 65.92%

    159 - 9x + 9x +
            } else if (identical(parent_keys, dataset_keys)) {
    160 - 7x + 7x +
              list(by = parent_keys)
    @@ -18656,7 +19367,8 @@

    teal.slice coverage - 65.92%

    162 - 2x + 2x +
              list(by = stats::setNames(parent_keys, dataset_keys))
    @@ -18677,7 +19389,8 @@

    teal.slice coverage - 65.92%

    165 - 9x + 9x +
            merge_call <- call(
    @@ -18691,49 +19404,56 @@

    teal.slice coverage - 65.92%

    167 - 9x + 9x +
              as.name(dataname),
    168 - 9x + 9x +
              as.call(
    169 - 9x + 9x +
                c(
    170 - 9x + 9x +
                  str2lang("dplyr::inner_join"),
    171 - 9x + 9x +
                  x = as.name(dataname),
    172 - 9x + 9x +
                  y = str2lang(y_arg),
    173 - 9x + 9x +
                  more_args
    @@ -18768,7 +19488,8 @@

    teal.slice coverage - 65.92%

    178 - 9x + 9x +
            filter_call <- c(filter_call, merge_call)
    @@ -18782,14 +19503,16 @@

    teal.slice coverage - 65.92%

    180 - 42x + 42x +
          logger::log_trace("DataframeFilteredDataset$get_call initializing for dataname: { private$dataname }")
    181 - 42x + 42x +
          filter_call
    @@ -18859,35 +19582,40 @@

    teal.slice coverage - 65.92%

    191 - 81x + 81x +
          isolate({
    192 - 81x + 81x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initializing, dataname: { private$dataname }")
    193 - 81x + 81x +
            checkmate::assert_class(state, "teal_slices")
    194 - 80x + 80x +
            lapply(state, function(slice) {
    195 - 97x + 97x +
              checkmate::assert_true(slice$dataname == private$dataname)
    @@ -18901,14 +19629,16 @@

    teal.slice coverage - 65.92%

    197 - 80x + 80x +
            private$get_filter_states()[[1L]]$set_filter_state(state = state)
    198 - 80x + 80x +
            invisible(NULL)
    @@ -19006,7 +19736,8 @@

    teal.slice coverage - 65.92%

    212 - 11x + 11x +
          checkmate::assert_class(state, "teal_slices")
    @@ -19020,14 +19751,16 @@

    teal.slice coverage - 65.92%

    214 - 11x + 11x +
          isolate({
    215 - 11x + 11x +
            logger::log_trace("{ class(self)[1] }$remove_filter_state removing filter(s), dataname: { private$dataname }")
    @@ -19041,14 +19774,16 @@

    teal.slice coverage - 65.92%

    217 - 11x + 11x +
            varnames <- unique(unlist(lapply(state, "[[", "varname")))
    218 - 11x + 11x +
            private$get_filter_states()[[1]]$remove_filter_state(state)
    @@ -19062,7 +19797,8 @@

    teal.slice coverage - 65.92%

    220 - 11x + 11x +
            logger::log_trace("{ class(self)[1] }$remove_filter_state removed filter(s), dataname: { private$dataname }")
    @@ -19083,7 +19819,8 @@

    teal.slice coverage - 65.92%

    223 - 11x + 11x +
          invisible(NULL)
    @@ -19244,7 +19981,8 @@

    teal.slice coverage - 65.92%

    246 - 12x + 12x +
          logger::log_trace("FilteredDataset$srv_filter_overview initialized")
    @@ -19265,14 +20003,16 @@

    teal.slice coverage - 65.92%

    249 - 12x + 12x +
          subject_keys <- if (length(private$parent_name) > 0) {
    250 - 1x + 1x +
            names(private$join_keys)
    @@ -19286,7 +20026,8 @@

    teal.slice coverage - 65.92%

    252 - 11x + 11x +
            self$get_keys()
    @@ -19300,49 +20041,56 @@

    teal.slice coverage - 65.92%

    254 - 12x + 12x +
          dataset <- self$get_dataset()
    255 - 12x + 12x +
          data_filtered <- self$get_dataset(TRUE)
    256 - 12x + 12x +
          if (length(subject_keys) == 0) {
    257 - 10x + 10x +
            data.frame(
    258 - 10x + 10x +
              dataname = private$dataname,
    259 - 10x + 10x +
              obs = nrow(dataset),
    260 - 10x + 10x +
              obs_filtered = nrow(data_filtered())
    @@ -19363,42 +20111,48 @@

    teal.slice coverage - 65.92%

    263 - 2x + 2x +
            data.frame(
    264 - 2x + 2x +
              dataname = private$dataname,
    265 - 2x + 2x +
              obs = nrow(dataset),
    266 - 2x + 2x +
              obs_filtered = nrow(data_filtered()),
    267 - 2x + 2x +
              subjects = nrow(unique(dataset[subject_keys])),
    268 - 2x + 2x +
              subjects_filtered = nrow(unique(data_filtered()[subject_keys]))
    @@ -20566,21 +21320,24 @@

    teal.slice coverage - 65.92%

    155 - 25x + 25x +
          isolate({
    156 - 25x + 25x +
            checkmate::assert_multi_class(x, c("POSIXct", "POSIXlt"))
    157 - 24x + 24x +
            checkmate::assert_class(x_reactive, "reactive")
    @@ -20594,35 +21351,40 @@

    teal.slice coverage - 65.92%

    159 - 24x + 24x +
            super$initialize(
    160 - 24x + 24x +
              x = x,
    161 - 24x + 24x +
              x_reactive = x_reactive,
    162 - 24x + 24x +
              slice = slice,
    163 - 24x + 24x +
              extract_type = extract_type
    @@ -20636,28 +21398,32 @@

    teal.slice coverage - 65.92%

    165 - 24x + 24x +
            checkmate::assert_multi_class(slice$choices, c("POSIXct", "POSIXlt"), null.ok = TRUE)
    166 - 23x + 23x +
            private$set_choices(slice$choices)
    167 - 15x + 15x +
            if (is.null(slice$selected)) slice$selected <- slice$choices
    168 - 23x + 23x +
            private$set_selected(slice$selected)
    @@ -20678,7 +21444,8 @@

    teal.slice coverage - 65.92%

    171 - 22x + 22x +
          invisible(self)
    @@ -20755,14 +21522,16 @@

    teal.slice coverage - 65.92%

    182 - 7x + 7x +
          if (isFALSE(private$is_any_filtered())) {
    183 - 1x + 1x +
            return(NULL)
    @@ -20776,63 +21545,72 @@

    teal.slice coverage - 65.92%

    185 - 4x + 4x +
          if (missing(dataname)) dataname <- private$get_dataname()
    186 - 6x + 6x +
          varname <- private$get_varname_prefixed(dataname)
    187 - 6x + 6x +
          choices <- private$get_selected()
    188 - 6x + 6x +
          tzone <- Find(function(x) x != "", attr(as.POSIXlt(choices), "tzone"))
    189 - 6x + 6x +
          class <- class(choices)[1L]
    190 - 6x + 6x +
          date_fun <- as.name(
    191 - 6x + 6x +
            switch(class,
    192 - 6x + 6x +
              "POSIXct" = "as.POSIXct",
    193 - 6x + 6x +
              "POSIXlt" = "as.POSIXlt"
    @@ -20853,21 +21631,24 @@

    teal.slice coverage - 65.92%

    196 - 6x + 6x +
          choices <- as.character(choices + c(0, 1))
    197 - 6x + 6x +
          filter_call <-
    198 - 6x + 6x +
            call(
    @@ -20881,7 +21662,8 @@

    teal.slice coverage - 65.92%

    200 - 6x + 6x +
              call(
    @@ -20895,14 +21677,16 @@

    teal.slice coverage - 65.92%

    202 - 6x + 6x +
                varname,
    203 - 6x + 6x +
                as.call(list(date_fun, choices[1L], tz = tzone))
    @@ -20916,7 +21700,8 @@

    teal.slice coverage - 65.92%

    205 - 6x + 6x +
              call(
    @@ -20930,14 +21715,16 @@

    teal.slice coverage - 65.92%

    207 - 6x + 6x +
                varname,
    208 - 6x + 6x +
                as.call(list(date_fun, choices[2L], tz = tzone))
    @@ -20958,7 +21745,8 @@

    teal.slice coverage - 65.92%

    211 - 6x + 6x +
          private$add_keep_na_call(filter_call, varname)
    @@ -21021,14 +21809,16 @@

    teal.slice coverage - 65.92%

    220 - 23x + 23x +
          if (is.null(choices)) {
    221 - 20x + 20x +
            choices <- as.POSIXct(trunc(range(private$x, na.rm = TRUE), units = "secs"))
    @@ -21042,28 +21832,32 @@

    teal.slice coverage - 65.92%

    223 - 3x + 3x +
            choices <- as.POSIXct(choices, units = "secs")
    224 - 3x + 3x +
            choices_adjusted <- c(
    225 - 3x + 3x +
              max(choices[1L], min(as.POSIXct(private$x), na.rm = TRUE)),
    226 - 3x + 3x +
              min(choices[2L], max(as.POSIXct(private$x), na.rm = TRUE))
    @@ -21077,28 +21871,32 @@

    teal.slice coverage - 65.92%

    228 - 3x + 3x +
            if (any(choices != choices_adjusted)) {
    229 - 1x + 1x +
              warning(sprintf(
    230 - 1x + 1x +
                "Choices adjusted (some values outside of variable range). Varname: %s, dataname: %s.",
    231 - 1x + 1x +
                private$get_varname(), private$get_dataname()
    @@ -21112,7 +21910,8 @@

    teal.slice coverage - 65.92%

    233 - 1x + 1x +
              choices <- choices_adjusted
    @@ -21126,35 +21925,40 @@

    teal.slice coverage - 65.92%

    235 - 3x + 3x +
            if (choices[1L] >= choices[2L]) {
    236 - 1x + 1x +
              warning(sprintf(
    237 - 1x + 1x +
                "Invalid choices: lower is higher / equal to upper, or not in range of variable values.
    238 - 1x + 1x +
                Setting defaults. Varname: %s, dataname: %s.",
    239 - 1x + 1x +
                private$get_varname(), private$get_dataname()
    @@ -21168,7 +21972,8 @@

    teal.slice coverage - 65.92%

    241 - 1x + 1x +
              choices <- range(private$x, na.rm = TRUE)
    @@ -21196,14 +22001,16 @@

    teal.slice coverage - 65.92%

    245 - 23x + 23x +
          private$set_is_choice_limited(private$x, choices)
    246 - 23x + 23x +
          private$x <- private$x[
    @@ -21217,21 +22024,24 @@

    teal.slice coverage - 65.92%

    248 - 23x + 23x +
              as.POSIXct(trunc(private$x, units = "secs")) >= choices[1L] &
    249 - 23x + 23x +
                as.POSIXct(trunc(private$x, units = "secs")) <= choices[2L]
    250 - 23x + 23x +
            ) | is.na(private$x)
    @@ -21245,14 +22055,16 @@

    teal.slice coverage - 65.92%

    252 - 23x + 23x +
          private$teal_slice$choices <- choices
    253 - 23x + 23x +
          invisible(NULL)
    @@ -21294,14 +22106,16 @@

    teal.slice coverage - 65.92%

    259 - 23x + 23x +
          private$is_choice_limited <- (any(xl < choices[1L], na.rm = TRUE) | any(xl > choices[2L], na.rm = TRUE))
    260 - 23x + 23x +
          invisible(NULL)
    @@ -21322,21 +22136,24 @@

    teal.slice coverage - 65.92%

    263 - 34x + 34x +
          tryCatch(
    264 - 34x + 34x +
            expr = {
    265 - 34x + 34x +
              values <- as.POSIXct(values, origin = "1970-01-01 00:00:00")
    @@ -21350,7 +22167,8 @@

    teal.slice coverage - 65.92%

    267 - 31x + 31x +
              values
    @@ -21364,7 +22182,8 @@

    teal.slice coverage - 65.92%

    269 - 34x + 34x +
            error = function(e) stop("Vector of set values must contain values coercible to POSIX.")
    @@ -21392,42 +22211,48 @@

    teal.slice coverage - 65.92%

    273 - 1x + 1x +
          if (length(values) != 2) stop("Vector of set values must have length two.")
    274 - 30x + 30x +
          if (values[1] > values[2]) {
    275 - 1x + 1x +
            warning(
    276 - 1x + 1x +
              sprintf(
    277 - 1x + 1x +
                "Start date '%s' is set after the end date '%s', the values will be replaced by a default datetime range.",
    278 - 1x + 1x +
                values[1], values[2]
    @@ -21448,7 +22273,8 @@

    teal.slice coverage - 65.92%

    281 - 1x + 1x +
            values <- isolate(private$get_choices())
    @@ -21462,7 +22288,8 @@

    teal.slice coverage - 65.92%

    283 - 30x + 30x +
          values
    @@ -21483,42 +22310,48 @@

    teal.slice coverage - 65.92%

    286 - 30x + 30x +
          choices <- private$get_choices()
    287 - 30x + 30x +
          if (values[1] < choices[1L] || values[1] > choices[2L]) {
    288 - 5x + 5x +
            warning(
    289 - 5x + 5x +
              sprintf(
    290 - 5x + 5x +
                "Value: %s is outside of the range for the column '%s' in dataset '%s', setting minimum possible value.",
    291 - 5x + 5x +
                values[1], private$get_varname(), toString(private$get_dataname())
    @@ -21539,7 +22372,8 @@

    teal.slice coverage - 65.92%

    294 - 5x + 5x +
            values[1] <- choices[1L]
    @@ -21560,35 +22394,40 @@

    teal.slice coverage - 65.92%

    297 - 30x + 30x +
          if (values[2] > choices[2L] | values[2] < choices[1L]) {
    298 - 5x + 5x +
            warning(
    299 - 5x + 5x +
              sprintf(
    300 - 5x + 5x +
                "Value: '%s' is outside of the range for the column '%s' in dataset '%s', setting maximum possible value.",
    301 - 5x + 5x +
                values[2], private$get_varname(), toString(private$get_dataname())
    @@ -21609,7 +22448,8 @@

    teal.slice coverage - 65.92%

    304 - 5x + 5x +
            values[2] <- choices[2L]
    @@ -21630,7 +22470,8 @@

    teal.slice coverage - 65.92%

    307 - 30x + 30x +
          values
    @@ -23813,35 +24654,40 @@

    teal.slice coverage - 65.92%

    66 - 195x + 195x +
      checkmate::assert_class(x_reactive, "reactive")
    67 - 194x + 194x +
      checkmate::assert_character(extract_type, max.len = 1, any.missing = FALSE)
    68 - 194x + 194x +
      checkmate::assert_class(slice, "teal_slice")
    69 - 193x + 193x +
      if (length(extract_type) == 1) {
    70 - 43x + 43x +
        checkmate::assert_choice(extract_type, choices = c("list", "matrix"))
    @@ -23862,42 +24708,48 @@

    teal.slice coverage - 65.92%

    73 - 192x + 192x +
      if (all(is.na(x))) {
    74 - 1x + 1x +
        EmptyFilterState$new(
    75 - 1x + 1x +
          x = x,
    76 - 1x + 1x +
          x_reactive = x_reactive,
    77 - 1x + 1x +
          slice = slice,
    78 - 1x + 1x +
          extract_type = extract_type
    @@ -23918,7 +24770,8 @@

    teal.slice coverage - 65.92%

    81 - 191x + 191x +
        UseMethod("init_filter_state")
    @@ -23988,35 +24841,40 @@

    teal.slice coverage - 65.92%

    91 - 1x + 1x +
      args <- list(
    92 - 1x + 1x +
        x = x,
    93 - 1x + 1x +
        x_reactive = x_reactive,
    94 - 1x + 1x +
        extract_type = extract_type,
    95 - 1x + 1x +
        slice
    @@ -24037,7 +24895,8 @@

    teal.slice coverage - 65.92%

    98 - 1x + 1x +
      do.call(FilterState$new, args)
    @@ -24100,35 +24959,40 @@

    teal.slice coverage - 65.92%

    107 - 1x + 1x +
      LogicalFilterState$new(
    108 - 1x + 1x +
        x = x,
    109 - 1x + 1x +
        x_reactive = x_reactive,
    110 - 1x + 1x +
        slice = slice,
    111 - 1x + 1x +
        extract_type = extract_type
    @@ -24198,35 +25062,40 @@

    teal.slice coverage - 65.92%

    121 - 120x + 120x +
      args <- list(
    122 - 120x + 120x +
        x = x,
    123 - 120x + 120x +
        x_reactive = x_reactive,
    124 - 120x + 120x +
        slice = slice,
    125 - 120x + 120x +
        extract_type = extract_type
    @@ -24247,14 +25116,16 @@

    teal.slice coverage - 65.92%

    128 - 120x + 120x +
      if (length(unique(x[!is.na(x)])) < getOption("teal.threshold_slider_vs_checkboxgroup")) {
    129 - 28x + 28x +
        do.call(ChoicesFilterState$new, args)
    @@ -24268,7 +25139,8 @@

    teal.slice coverage - 65.92%

    131 - 92x + 92x +
        do.call(RangeFilterState$new, args)
    @@ -24338,35 +25210,40 @@

    teal.slice coverage - 65.92%

    141 - 31x + 31x +
      ChoicesFilterState$new(
    142 - 31x + 31x +
        x = x,
    143 - 31x + 31x +
        x_reactive = x_reactive,
    144 - 31x + 31x +
        slice = slice,
    145 - 31x + 31x +
        extract_type = extract_type
    @@ -24436,35 +25313,40 @@

    teal.slice coverage - 65.92%

    155 - 32x + 32x +
      ChoicesFilterState$new(
    156 - 32x + 32x +
        x = x,
    157 - 32x + 32x +
        x_reactive = x_reactive,
    158 - 32x + 32x +
        slice = slice,
    159 - 32x + 32x +
        extract_type = extract_type
    @@ -24534,35 +25416,40 @@

    teal.slice coverage - 65.92%

    169 - 2x + 2x +
      args <- list(
    170 - 2x + 2x +
        x = x,
    171 - 2x + 2x +
        x_reactive = x_reactive,
    172 - 2x + 2x +
        slice = slice,
    173 - 2x + 2x +
        extract_type = extract_type
    @@ -24583,14 +25470,16 @@

    teal.slice coverage - 65.92%

    176 - 2x + 2x +
      if (length(unique(x[!is.na(x)])) < getOption("teal.threshold_slider_vs_checkboxgroup")) {
    177 - 1x + 1x +
        do.call(ChoicesFilterState$new, args)
    @@ -24604,7 +25493,8 @@

    teal.slice coverage - 65.92%

    179 - 1x + 1x +
        do.call(DateFilterState$new, args)
    @@ -24674,35 +25564,40 @@

    teal.slice coverage - 65.92%

    189 - 2x + 2x +
      args <- list(
    190 - 2x + 2x +
        x = x,
    191 - 2x + 2x +
        x_reactive = x_reactive,
    192 - 2x + 2x +
        slice = slice,
    193 - 2x + 2x +
        extract_type = extract_type
    @@ -24723,14 +25618,16 @@

    teal.slice coverage - 65.92%

    196 - 2x + 2x +
      if (length(unique(x[!is.na(x)])) < getOption("teal.threshold_slider_vs_checkboxgroup")) {
    197 - 1x + 1x +
        do.call(ChoicesFilterState$new, args)
    @@ -24744,7 +25641,8 @@

    teal.slice coverage - 65.92%

    199 - 1x + 1x +
        do.call(DatetimeFilterState$new, args)
    @@ -24814,35 +25712,40 @@

    teal.slice coverage - 65.92%

    209 - 2x + 2x +
      args <- list(
    210 - 2x + 2x +
        x = x,
    211 - 2x + 2x +
        x_reactive = x_reactive,
    212 - 2x + 2x +
        slice = slice,
    213 - 2x + 2x +
        extract_type = extract_type
    @@ -24863,14 +25766,16 @@

    teal.slice coverage - 65.92%

    216 - 2x + 2x +
      if (length(unique(x[!is.na(x)])) < getOption("teal.threshold_slider_vs_checkboxgroup")) {
    217 - 1x + 1x +
        do.call(ChoicesFilterState$new, args)
    @@ -24884,7 +25789,8 @@

    teal.slice coverage - 65.92%

    219 - 1x + 1x +
        do.call(DatetimeFilterState$new, args)
    @@ -24975,7 +25881,8 @@

    teal.slice coverage - 65.92%

    232 - 6x + 6x +
      FilterStateExpr$new(slice)
    @@ -25143,28 +26050,32 @@

    teal.slice coverage - 65.92%

    256 - 119x + 119x +
      checkmate::assert_string(color)
    257 - 119x + 119x +
      checkmate::assert(
    258 - 119x + 119x +
        checkmate::check_number(alpha, lower = 0, upper = 1, null.ok = TRUE),
    259 - 119x + 119x +
        checkmate::check_string(alpha, pattern = "[0-9a-f]{2}", null.ok = TRUE)
    @@ -25192,7 +26103,8 @@

    teal.slice coverage - 65.92%

    263 - 119x + 119x +
      sass_file <- if (utils::packageVersion("bslib") < as.package_version("0.5.1.9000")) {
    @@ -25213,7 +26125,8 @@

    teal.slice coverage - 65.92%

    266 - 119x + 119x +
        bslib::bs_theme()[["layers"]][[2]][["defaults"]][[1]][[1]]
    @@ -25227,7 +26140,8 @@

    teal.slice coverage - 65.92%

    268 - 119x + 119x +
      sass_file <- attr(sass_file, "sass_file_path")
    @@ -25248,7 +26162,8 @@

    teal.slice coverage - 65.92%

    271 - 119x + 119x +
      variables_file <- readLines(sass_file)
    @@ -25262,14 +26177,16 @@

    teal.slice coverage - 65.92%

    273 - 119x + 119x +
      ind <- grep("// scss-docs-(start|end) theme-color-variables", variables_file)
    274 - 119x + 119x +
      color_definitions <- variables_file[(ind[1] + 1L):(ind[2] - 1L)]
    @@ -25290,7 +26207,8 @@

    teal.slice coverage - 65.92%

    277 - 119x + 119x +
      color_names <- sub("(\\$)(\\w.+)(:.+)", "\\2", color_definitions)
    @@ -25311,7 +26229,8 @@

    teal.slice coverage - 65.92%

    280 - 119x + 119x +
      checkmate::assert_choice(color, color_names)
    @@ -25332,7 +26251,8 @@

    teal.slice coverage - 65.92%

    283 - 119x + 119x +
      color_references <- sub("(\\$)(\\w.+)(:\\s.+\\$)(\\w.+)(\\s.+)", "\\4", color_definitions)
    @@ -25353,42 +26273,48 @@

    teal.slice coverage - 65.92%

    286 - 119x + 119x +
      color_specification <- structure(color_references, names = color_names)
    287 - 119x + 119x +
      color_specification <- vapply(color_specification, function(x) {
    288 - 952x + 952x +
        line <- grep(sprintf("^\\$%s:\\s+#\\w{6}\\s+!default", x), variables_file, value = TRUE)
    289 - 952x + 952x +
        code <- sub("(.+)(#\\w{6})(\\s+.+)", "\\2", line)
    290 - 952x + 952x +
        code
    291 - 119x + 119x +
      }, character(1L))
    @@ -25402,7 +26328,8 @@

    teal.slice coverage - 65.92%

    293 - 119x + 119x +
      if (!is.null(alpha)) {
    @@ -25430,7 +26357,8 @@

    teal.slice coverage - 65.92%

    297 - 119x + 119x +
      paste0(color_specification[color], alpha)
    @@ -26500,42 +27428,48 @@

    teal.slice coverage - 65.92%

    151 - 160x + 160x +
          isolate({
    152 - 160x + 160x +
            checkmate::assert(
    153 - 160x + 160x +
              is.character(x),
    154 - 160x + 160x +
              is.factor(x),
    155 - 160x + 160x +
              length(unique(x[!is.na(x)])) < getOption("teal.threshold_slider_vs_checkboxgroup"),
    156 - 160x + 160x +
              combine = "or"
    @@ -26549,35 +27483,40 @@

    teal.slice coverage - 65.92%

    158 - 160x + 160x +
            super$initialize(
    159 - 160x + 160x +
              x = x,
    160 - 160x + 160x +
              x_reactive = x_reactive,
    161 - 160x + 160x +
              slice = slice,
    162 - 160x + 160x +
              extract_type = extract_type
    @@ -26591,63 +27530,72 @@

    teal.slice coverage - 65.92%

    164 - 160x + 160x +
            private$set_choices(slice$choices)
    165 - 160x + 160x +
            if (is.null(slice$selected) && slice$multiple) {
    166 - 42x + 42x +
              slice$selected <- private$get_choices()
    167 - 118x + 118x +
            } else if (is.null(slice$selected)) {
    168 - 1x + 1x +
              slice$selected <- private$get_choices()[1]
    169 - 117x + 117x +
            } else if (length(slice$selected) > 1 && !slice$multiple) {
    170 - 1x + 1x +
              warning(
    171 - 1x + 1x +
                "ChoicesFilterState allows \"selected\" to be of length 1 when \"multiple\" is FALSE. ",
    172 - 1x + 1x +
                "Only the first value will be used."
    @@ -26661,7 +27609,8 @@

    teal.slice coverage - 65.92%

    174 - 1x + 1x +
              slice$selected <- slice$selected[1]
    @@ -26675,21 +27624,24 @@

    teal.slice coverage - 65.92%

    176 - 160x + 160x +
            private$set_selected(slice$selected)
    177 - 160x + 160x +
            if (inherits(x, "POSIXt")) {
    178 - 9x + 9x +
              private$tzone <- Find(function(x) x != "", attr(as.POSIXlt(x), "tzone"))
    @@ -26710,7 +27662,8 @@

    teal.slice coverage - 65.92%

    181 - 160x + 160x +
          invisible(self)
    @@ -26787,14 +27740,16 @@

    teal.slice coverage - 65.92%

    192 - 61x + 61x +
          if (isFALSE(private$is_any_filtered())) {
    193 - 7x + 7x +
            return(NULL)
    @@ -26808,49 +27763,56 @@

    teal.slice coverage - 65.92%

    195 - 30x + 30x +
          if (missing(dataname)) dataname <- private$get_dataname()
    196 - 54x + 54x +
          varname <- private$get_varname_prefixed(dataname)
    197 - 54x + 54x +
          choices <- private$get_choices()
    198 - 54x + 54x +
          selected <- private$get_selected()
    199 - 54x + 54x +
          fun_compare <- if (length(selected) == 1L) "==" else "%in%"
    200 - 54x + 54x +
          filter_call <- if (length(selected) == 0) {
    201 - 6x + 6x +
            call("!", call(fun_compare, varname, make_c_call(as.character(choices))))
    @@ -26864,70 +27826,80 @@

    teal.slice coverage - 65.92%

    203 - 48x + 48x +
            if (setequal(selected, choices) && !private$is_choice_limited) {
    204 - 2x + 2x +
              NULL
    205 - 46x + 46x +
            } else if (inherits(private$x, "Date")) {
    206 - 1x + 1x +
              call(fun_compare, varname, call("as.Date", make_c_call(as.character(selected))))
    207 - 45x + 45x +
            } else if (inherits(private$x, c("POSIXct", "POSIXlt"))) {
    208 - 2x + 2x +
              class <- class(private$x)[1L]
    209 - 2x + 2x +
              date_fun <- as.name(
    210 - 2x + 2x +
                switch(class,
    211 - 2x + 2x +
                  "POSIXct" = "as.POSIXct",
    212 - 2x + 2x +
                  "POSIXlt" = "as.POSIXlt"
    @@ -26948,28 +27920,32 @@

    teal.slice coverage - 65.92%

    215 - 2x + 2x +
              call(
    216 - 2x + 2x +
                fun_compare,
    217 - 2x + 2x +
                varname,
    218 - 2x + 2x +
                as.call(list(date_fun, make_c_call(as.character(selected)), tz = private$tzone))
    @@ -26983,14 +27959,16 @@

    teal.slice coverage - 65.92%

    220 - 43x + 43x +
            } else if (is.numeric(private$x)) {
    221 - 7x + 7x +
              call(fun_compare, varname, make_c_call(as.numeric(selected)))
    @@ -27011,7 +27989,8 @@

    teal.slice coverage - 65.92%

    224 - 36x + 36x +
              call(fun_compare, varname, make_c_call(selected))
    @@ -27032,7 +28011,8 @@

    teal.slice coverage - 65.92%

    227 - 54x + 54x +
          private$add_keep_na_call(filter_call, varname)
    @@ -27144,28 +28124,32 @@

    teal.slice coverage - 65.92%

    243 - 160x + 160x +
          ordered_counts <- .table(private$x)
    244 - 160x + 160x +
          possible_choices <- names(ordered_counts)
    245 - 160x + 160x +
          if (is.null(choices)) {
    246 - 145x + 145x +
            choices <- possible_choices
    @@ -27179,49 +28163,56 @@

    teal.slice coverage - 65.92%

    248 - 15x + 15x +
            choices <- as.character(choices)
    249 - 15x + 15x +
            choices_adjusted <- choices[choices %in% possible_choices]
    250 - 15x + 15x +
            if (length(setdiff(choices, choices_adjusted)) > 0L) {
    251 - 2x + 2x +
              warning(
    252 - 2x + 2x +
                sprintf(
    253 - 2x + 2x +
                  "Some choices not found in data. Adjusting. Filter id: %s.",
    254 - 2x + 2x +
                  private$get_id()
    @@ -27242,7 +28233,8 @@

    teal.slice coverage - 65.92%

    257 - 2x + 2x +
              choices <- choices_adjusted
    @@ -27256,35 +28248,40 @@

    teal.slice coverage - 65.92%

    259 - 15x + 15x +
            if (length(choices) == 0) {
    260 - 1x + 1x +
              warning(
    261 - 1x + 1x +
                sprintf(
    262 - 1x + 1x +
                  "None of the choices were found in data. Setting defaults. Filter id: %s.",
    263 - 1x + 1x +
                  private$get_id()
    @@ -27305,7 +28302,8 @@

    teal.slice coverage - 65.92%

    266 - 1x + 1x +
              choices <- possible_choices
    @@ -27326,28 +28324,32 @@

    teal.slice coverage - 65.92%

    269 - 160x + 160x +
          private$set_choices_counts(unname(ordered_counts[choices]))
    270 - 160x + 160x +
          private$set_is_choice_limited(possible_choices, choices)
    271 - 160x + 160x +
          private$teal_slice$choices <- choices
    272 - 160x + 160x +
          invisible(NULL)
    @@ -27382,21 +28384,24 @@

    teal.slice coverage - 65.92%

    277 - 160x + 160x +
          xl <- x[!is.na(x)]
    278 - 160x + 160x +
          private$is_choice_limited <- length(setdiff(xl, choices)) > 0L
    279 - 160x + 160x +
          invisible(NULL)
    @@ -27431,14 +28436,16 @@

    teal.slice coverage - 65.92%

    284 - 160x + 160x +
          private$choices_counts <- choices_counts
    285 - 160x + 160x +
          invisible(NULL)
    @@ -27473,7 +28480,8 @@

    teal.slice coverage - 65.92%

    290 - 23x + 23x +
          length(private$get_choices()) <= getOption("teal.threshold_slider_vs_checkboxgroup")
    @@ -27494,21 +28502,24 @@

    teal.slice coverage - 65.92%

    293 - 189x + 189x +
          tryCatch(
    294 - 189x + 189x +
            expr = {
    295 - 189x + 189x +
              values <- as.character(values)
    @@ -27529,7 +28540,8 @@

    teal.slice coverage - 65.92%

    298 - 189x + 189x +
            error = function(e) stop("The vector of set values must contain values coercible to character.")
    @@ -27543,7 +28555,8 @@

    teal.slice coverage - 65.92%

    300 - 189x + 189x +
          values
    @@ -27571,28 +28584,32 @@

    teal.slice coverage - 65.92%

    304 - 189x + 189x +
          if (!private$is_multiple() && length(values) > 1) {
    305 - 1x + 1x +
            warning(
    306 - 1x + 1x +
              sprintf("Selection: %s is not a vector of length one. ", toString(values, width = 360)),
    307 - 1x + 1x +
              "Maintaining previous selection."
    @@ -27606,7 +28623,8 @@

    teal.slice coverage - 65.92%

    309 - 1x + 1x +
            values <- isolate(private$get_selected())
    @@ -27620,7 +28638,8 @@

    teal.slice coverage - 65.92%

    311 - 189x + 189x +
          values
    @@ -27641,35 +28660,40 @@

    teal.slice coverage - 65.92%

    314 - 189x + 189x +
          in_choices_mask <- values %in% private$get_choices()
    315 - 189x + 189x +
          if (length(values[!in_choices_mask]) > 0) {
    316 - 17x + 17x +
            warning(paste(
    317 - 17x + 17x +
              "Values:", toString(values[!in_choices_mask], width = 360),
    318 - 17x + 17x +
              "are not in choices of column", private$get_varname(), "in dataset", private$get_dataname(), "."
    @@ -27690,7 +28714,8 @@

    teal.slice coverage - 65.92%

    321 - 189x + 189x +
          values[in_choices_mask]
    @@ -27767,7 +28792,8 @@

    teal.slice coverage - 65.92%

    332 - 7x + 7x +
          ns <- NS(id)
    @@ -27788,21 +28814,24 @@

    teal.slice coverage - 65.92%

    335 - 7x + 7x +
          isolate({
    336 - 7x + 7x +
            countsmax <- private$choices_counts
    337 - 7x + 7x +
            countsnow <- if (!is.null(private$x_reactive())) {
    @@ -27844,42 +28873,48 @@

    teal.slice coverage - 65.92%

    343 - 7x + 7x +
            ui_input <- if (private$is_checkboxgroup()) {
    344 - 7x + 7x +
              labels <- countBars(
    345 - 7x + 7x +
                inputId = ns("labels"),
    346 - 7x + 7x +
                choices = private$get_choices(),
    347 - 7x + 7x +
                countsnow = countsnow,
    348 - 7x + 7x +
                countsmax = countsmax
    @@ -27893,70 +28928,80 @@

    teal.slice coverage - 65.92%

    350 - 6x + 6x +
              tags$div(
    351 - 6x + 6x +
                class = "choices_state",
    352 - 6x + 6x +
                if (private$is_multiple()) {
    353 - 6x + 6x +
                  checkboxGroupInput(
    354 - 6x + 6x +
                    inputId = ns("selection"),
    355 - 6x + 6x +
                    label = NULL,
    356 - 6x + 6x +
                    selected = private$get_selected(),
    357 - 6x + 6x +
                    choiceNames = labels,
    358 - 6x + 6x +
                    choiceValues = private$get_choices(),
    359 - 6x + 6x +
                    width = "100%"
    @@ -28187,28 +29232,32 @@

    teal.slice coverage - 65.92%

    392 - 6x + 6x +
            tags$div(
    393 - 6x + 6x +
              uiOutput(ns("trigger_visible")),
    394 - 6x + 6x +
              ui_input,
    395 - 6x + 6x +
              private$keep_na_ui(ns("keep_na"))
    @@ -28278,28 +29327,32 @@

    teal.slice coverage - 65.92%

    405 - 7x + 7x +
          moduleServer(
    406 - 7x + 7x +
            id = id,
    407 - 7x + 7x +
            function(input, output, session) {
    408 - 7x + 7x +
              logger::log_trace("ChoicesFilterState$server_inputs initializing, id: { private$get_id() }")
    @@ -28334,21 +29387,24 @@

    teal.slice coverage - 65.92%

    413 - 7x + 7x +
              non_missing_values <- reactive(Filter(Negate(is.na), private$x_reactive()))
    414 - 7x + 7x +
              output$trigger_visible <- renderUI({
    415 - 7x + 7x +
                logger::log_trace("ChoicesFilterState$server_inputs@1 updating count labels, id: { private$get_id() }")
    @@ -28362,7 +29418,8 @@

    teal.slice coverage - 65.92%

    417 - 7x + 7x +
                countsnow <- if (!is.null(private$x_reactive())) {
    @@ -28411,49 +29468,56 @@

    teal.slice coverage - 65.92%

    424 - 7x + 7x +
                isolate({
    425 - 7x + 7x +
                  if (private$is_checkboxgroup()) {
    426 - 7x + 7x +
                    updateCountBars(
    427 - 7x + 7x +
                      inputId = "labels",
    428 - 7x + 7x +
                      choices = private$get_choices(),
    429 - 7x + 7x +
                      countsmax = private$choices_counts,
    430 - 7x + 7x +
                      countsnow = countsnow
    @@ -28565,7 +29629,8 @@

    teal.slice coverage - 65.92%

    446 - 6x + 6x +
                  NULL
    @@ -28593,42 +29658,48 @@

    teal.slice coverage - 65.92%

    450 - 7x + 7x +
              if (private$is_checkboxgroup()) {
    451 - 7x + 7x +
                private$observers$selection <- observeEvent(
    452 - 7x + 7x +
                  ignoreNULL = FALSE,
    453 - 7x + 7x +
                  ignoreInit = TRUE, # ignoreInit: should not matter because we set the UI with the desired initial state
    454 - 7x + 7x +
                  eventExpr = input$selection,
    455 - 7x + 7x +
                  handlerExpr = {
    @@ -28950,7 +30021,8 @@

    teal.slice coverage - 65.92%

    501 - 7x + 7x +
              private$keep_na_srv("keep_na")
    @@ -28985,7 +30057,8 @@

    teal.slice coverage - 65.92%

    506 - 7x + 7x +
              private$observers$selection_api <- observeEvent(private$get_selected(), {
    @@ -29006,49 +30079,56 @@

    teal.slice coverage - 65.92%

    509 - 2x + 2x +
                if (!setequal(input$selection, private$get_selected())) {
    510 - 2x + 2x +
                  logger::log_trace("ChoicesFilterState$server@1 state changed, id: { private$get_id() }")
    511 - 2x + 2x +
                  if (private$is_checkboxgroup()) {
    512 - 2x + 2x +
                    if (private$is_multiple()) {
    513 - 2x + 2x +
                      updateCheckboxGroupInput(
    514 - 2x + 2x +
                        inputId = "selection",
    515 - 2x + 2x +
                        selected = private$get_selected()
    @@ -29167,14 +30247,16 @@

    teal.slice coverage - 65.92%

    532 - 7x + 7x +
              logger::log_trace("ChoicesFilterState$server_inputs initialized, id: { private$get_id() }")
    533 - 7x + 7x +
              NULL
    @@ -29440,21 +30522,24 @@

    teal.slice coverage - 65.92%

    571 - 7x + 7x +
          selected <- private$get_selected()
    572 - 7x + 7x +
          selected_text <-
    573 - 7x + 7x +
            if (length(selected) == 0L) {
    @@ -29475,14 +30560,16 @@

    teal.slice coverage - 65.92%

    576 - 7x + 7x +
              if (sum(nchar(selected)) <= 40L) {
    577 - 7x + 7x +
                paste(selected, collapse = ", ")
    @@ -29517,28 +30604,32 @@

    teal.slice coverage - 65.92%

    582 - 7x + 7x +
          tagList(
    583 - 7x + 7x +
            tags$span(
    584 - 7x + 7x +
              class = "filter-card-summary-value",
    585 - 7x + 7x +
              selected_text
    @@ -29552,21 +30643,24 @@

    teal.slice coverage - 65.92%

    587 - 7x + 7x +
            tags$span(
    588 - 7x + 7x +
              class = "filter-card-summary-controls",
    589 - 7x + 7x +
              if (private$na_count > 0) {
    @@ -29678,21 +30772,24 @@

    teal.slice coverage - 65.92%

    605 - 160x + 160x +
      table(
    606 - 160x + 160x +
        if (is.factor(x)) {
    607 - 36x + 36x +
          x
    @@ -29706,7 +30803,8 @@

    teal.slice coverage - 65.92%

    609 - 124x + 124x +
          as.character(x)
    @@ -30104,28 +31202,32 @@

    teal.slice coverage - 65.92%

    53 - 274x + 274x +
          checkmate::assert_string(dataname)
    54 - 272x + 272x +
          logger::log_trace("Instantiating { class(self)[1] }, dataname: { dataname }")
    55 - 272x + 272x +
          checkmate::assert_function(data_reactive, args = "sid")
    56 - 272x + 272x +
          checkmate::assert_string(datalabel, null.ok = TRUE)
    @@ -30139,42 +31241,48 @@

    teal.slice coverage - 65.92%

    58 - 272x + 272x +
          private$dataname <- dataname
    59 - 272x + 272x +
          private$datalabel <- datalabel
    60 - 272x + 272x +
          private$dataname_prefixed <- dataname
    61 - 272x + 272x +
          private$data <- data
    62 - 272x + 272x +
          private$data_reactive <- data_reactive
    63 - 272x + 272x +
          private$state_list <- reactiveVal()
    @@ -30188,14 +31296,16 @@

    teal.slice coverage - 65.92%

    65 - 272x + 272x +
          logger::log_trace("Instantiated { class(self)[1] }, dataname: { private$dataname }")
    66 - 272x + 272x +
          invisible(self)
    @@ -30622,7 +31732,8 @@

    teal.slice coverage - 65.92%

    127 - 88x + 88x +
          logger::log_trace("FilterStates$get_call initializing")
    @@ -30657,21 +31768,24 @@

    teal.slice coverage - 65.92%

    132 - 88x + 88x +
          states_list <- private$state_list_get()
    133 - 88x + 88x +
          if (length(states_list) == 0) {
    134 - 52x + 52x +
            return(NULL)
    @@ -30685,35 +31799,40 @@

    teal.slice coverage - 65.92%

    136 - 36x + 36x +
          args <- vapply(
    137 - 36x + 36x +
            states_list,
    138 - 36x + 36x +
            function(x) {
    139 - 57x + 57x +
              arg <- x$get_state()$arg
    140 - 7x + 7x +
              `if`(is.null(arg), "", arg) # converting NULL -> "" to enable tapply.
    @@ -30727,7 +31846,8 @@

    teal.slice coverage - 65.92%

    142 - 36x + 36x +
            character(1)
    @@ -30748,35 +31868,40 @@

    teal.slice coverage - 65.92%

    145 - 36x + 36x +
          filter_items <- tapply(
    146 - 36x + 36x +
            X = states_list,
    147 - 36x + 36x +
            INDEX = args,
    148 - 36x + 36x +
            simplify = FALSE,
    149 - 36x + 36x +
            function(items) {
    @@ -30790,14 +31915,16 @@

    teal.slice coverage - 65.92%

    151 - 38x + 38x +
              other_filter_idx <- !names(items) %in% sid
    152 - 38x + 38x +
              filtered_items <- items[other_filter_idx]
    @@ -30811,42 +31938,48 @@

    teal.slice coverage - 65.92%

    154 - 38x + 38x +
              calls <- Filter(
    155 - 38x + 38x +
                Negate(is.null),
    156 - 38x + 38x +
                lapply(
    157 - 38x + 38x +
                  filtered_items,
    158 - 38x + 38x +
                  function(state) {
    159 - 51x + 51x +
                    state$get_call(dataname = private$dataname_prefixed)
    @@ -30874,7 +32007,8 @@

    teal.slice coverage - 65.92%

    163 - 38x + 38x +
              calls_combine_by(calls, operator = "&")
    @@ -30895,21 +32029,24 @@

    teal.slice coverage - 65.92%

    166 - 36x + 36x +
          filter_items <- Filter(
    167 - 36x + 36x +
            x = filter_items,
    168 - 36x + 36x +
            f = Negate(is.null)
    @@ -30923,49 +32060,56 @@

    teal.slice coverage - 65.92%

    170 - 36x + 36x +
          if (length(filter_items) > 0L) {
    171 - 35x + 35x +
            filter_function <- private$fun
    172 - 35x + 35x +
            data_name <- str2lang(private$dataname_prefixed)
    173 - 35x + 35x +
            substitute(
    174 - 35x + 35x +
              env = list(
    175 - 35x + 35x +
                lhs = data_name,
    176 - 35x + 35x +
                rhs = as.call(c(filter_function, c(list(data_name), filter_items)))
    @@ -30979,7 +32123,8 @@

    teal.slice coverage - 65.92%

    178 - 35x + 35x +
              expr = lhs <- rhs
    @@ -31007,7 +32152,8 @@

    teal.slice coverage - 65.92%

    182 - 1x + 1x +
            NULL
    @@ -31161,35 +32307,40 @@

    teal.slice coverage - 65.92%

    204 - 17x + 17x +
          checkmate::assert_class(state, "teal_slices")
    205 - 17x + 17x +
          isolate({
    206 - 17x + 17x +
            state_ids <- vapply(state, `[[`, character(1), "id")
    207 - 17x + 17x +
            logger::log_trace("{ class(self)[1] }$remove_filter_state removing filters, state_id: { toString(state_ids) }")
    208 - 17x + 17x +
            private$state_list_remove(state_ids)
    @@ -31203,7 +32354,8 @@

    teal.slice coverage - 65.92%

    210 - 17x + 17x +
          invisible(NULL)
    @@ -31287,14 +32439,16 @@

    teal.slice coverage - 65.92%

    222 - 364x + 364x +
          slices <- unname(lapply(private$state_list(), function(x) x$get_state()))
    223 - 364x + 364x +
          fs <- do.call(teal_slices, c(slices, list(count_type = private$count_type)))
    @@ -31308,35 +32462,40 @@

    teal.slice coverage - 65.92%

    225 - 364x + 364x +
          include_varnames <- private$include_varnames
    226 - 364x + 364x +
          if (length(include_varnames)) {
    227 - 214x + 214x +
            attr(fs, "include_varnames") <- structure(
    228 - 214x + 214x +
              list(include_varnames),
    229 - 214x + 214x +
              names = private$dataname
    @@ -31364,35 +32523,40 @@

    teal.slice coverage - 65.92%

    233 - 364x + 364x +
          exclude_varnames <- private$exclude_varnames
    234 - 364x + 364x +
          if (length(exclude_varnames)) {
    235 - 9x + 9x +
            attr(fs, "exclude_varnames") <- structure(
    236 - 9x + 9x +
              list(exclude_varnames),
    237 - 9x + 9x +
              names = private$dataname
    @@ -31420,7 +32584,8 @@

    teal.slice coverage - 65.92%

    241 - 364x + 364x +
          fs
    @@ -31476,49 +32641,56 @@

    teal.slice coverage - 65.92%

    249 - 135x + 135x +
          isolate({
    250 - 135x + 135x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initializing, dataname: { private$dataname }")
    251 - 135x + 135x +
            checkmate::assert_class(state, "teal_slices")
    252 - 135x + 135x +
            lapply(state, function(x) {
    253 - 177x + 177x +
              checkmate::assert_true(
    254 - 177x + 177x +
                x$dataname == private$dataname,
    255 - 177x + 177x +
                .var.name = "dataname matches private$dataname"
    @@ -31546,21 +32718,24 @@

    teal.slice coverage - 65.92%

    259 - 135x + 135x +
            private$set_filterable_varnames(
    260 - 135x + 135x +
              include_varnames = attr(state, "include_varnames")[[private$dataname]],
    261 - 135x + 135x +
              exclude_varnames = attr(state, "exclude_varnames")[[private$dataname]]
    @@ -31574,21 +32749,24 @@

    teal.slice coverage - 65.92%

    263 - 135x + 135x +
            count_type <- attr(state, "count_type")
    264 - 135x + 135x +
            if (length(count_type)) {
    265 - 21x + 21x +
              private$count_type <- count_type
    @@ -31616,35 +32794,40 @@

    teal.slice coverage - 65.92%

    269 - 135x + 135x +
            varnames <- unique(unlist(lapply(state, "[[", "varname")))
    270 - 135x + 135x +
            excluded_varnames <- setdiff(varnames, private$get_filterable_varnames())
    271 - 135x + 135x +
            if (length(excluded_varnames)) {
    272 - 3x + 3x +
              state <- Filter(function(x) !isTRUE(x$varname %in% excluded_varnames), state)
    273 - 3x + 3x +
              warning(sprintf("filters for columns: %s excluded from %s", toString(excluded_varnames), private$dataname))
    @@ -31665,35 +32848,40 @@

    teal.slice coverage - 65.92%

    276 - 135x + 135x +
            if (length(state) > 0) {
    277 - 93x + 93x +
              private$set_filter_state_impl(
    278 - 93x + 93x +
                state = state,
    279 - 93x + 93x +
                data = private$data,
    280 - 93x + 93x +
                data_reactive = private$data_reactive
    @@ -31714,7 +32902,8 @@

    teal.slice coverage - 65.92%

    283 - 135x + 135x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initialized, dataname: { private$dataname }")
    @@ -31735,7 +32924,8 @@

    teal.slice coverage - 65.92%

    286 - 135x + 135x +
          invisible(NULL)
    @@ -31819,14 +33009,16 @@

    teal.slice coverage - 65.92%

    298 - 25x + 25x +
          private$state_list_empty(force)
    299 - 25x + 25x +
          invisible(NULL)
    @@ -32078,49 +33270,56 @@

    teal.slice coverage - 65.92%

    335 - 12x + 12x +
          moduleServer(
    336 - 12x + 12x +
            id = id,
    337 - 12x + 12x +
            function(input, output, session) {
    338 - 12x + 12x +
              logger::log_trace("FilterState$srv_active initializing, dataname: { private$dataname }")
    339 - 12x + 12x +
              current_state <- reactive(private$state_list_get())
    340 - 12x + 12x +
              previous_state <- reactiveVal(NULL) # FilterState list
    341 - 12x + 12x +
              added_states <- reactiveVal(NULL) # FilterState list
    @@ -32141,21 +33340,24 @@

    teal.slice coverage - 65.92%

    344 - 12x + 12x +
              fs_to_shiny_ns <- function(x) {
    345 - 24x + 24x +
                checkmate::assert_multi_class(x, c("FilterState", "FilterStateExpr"))
    346 - 24x + 24x +
                gsub("[^[:alnum:]]+", "_", get_default_slice_id(x$get_state()))
    @@ -32176,28 +33378,32 @@

    teal.slice coverage - 65.92%

    349 - 12x + 12x +
              output$trigger_visible_state_change <- renderUI({
    350 - 14x + 14x +
                current_state()
    351 - 14x + 14x +
                isolate({
    352 - 14x + 14x +
                  logger::log_trace("FilterStates$srv_active@1 determining added and removed filter states")
    @@ -32211,21 +33417,24 @@

    teal.slice coverage - 65.92%

    354 - 14x + 14x +
                  added_states(setdiff_teal_slices(current_state(), previous_state()))
    355 - 14x + 14x +
                  previous_state(current_state())
    356 - 14x + 14x +
                  NULL
    @@ -32253,42 +33462,48 @@

    teal.slice coverage - 65.92%

    360 - 12x + 12x +
              output[["cards"]] <- renderUI({
    361 - 14x + 14x +
                lapply(
    362 - 14x + 14x +
                  current_state(), # observes only if added/removed
    363 - 14x + 14x +
                  function(state) {
    364 - 12x + 12x +
                    isolate( # isolates when existing state changes
    365 - 12x + 12x +
                      state$ui(id = session$ns(fs_to_shiny_ns(state)), parent_id = session$ns("cards"))
    @@ -32330,21 +33545,24 @@

    teal.slice coverage - 65.92%

    371 - 12x + 12x +
              observeEvent(
    372 - 12x + 12x +
                added_states(), # we want to call FilterState module only once when it's added
    373 - 12x + 12x +
                ignoreNULL = TRUE,
    @@ -32358,63 +33576,72 @@

    teal.slice coverage - 65.92%

    375 - 10x + 10x +
                  added_state_names <- vapply(added_states(), function(x) x$get_state()$id, character(1L))
    376 - 10x + 10x +
                  logger::log_trace("FilterStates$srv_active@2 triggered by added states: { toString(added_state_names) }")
    377 - 10x + 10x +
                  lapply(added_states(), function(state) {
    378 - 12x + 12x +
                    fs_callback <- state$server(id = fs_to_shiny_ns(state))
    379 - 12x + 12x +
                    observeEvent(
    380 - 12x + 12x +
                      once = TRUE, # remove button can be called once, should be destroyed afterwards
    381 - 12x + 12x +
                      ignoreInit = TRUE, # ignoreInit: should not matter because we destroy the previous input set of the UI
    382 - 12x + 12x +
                      eventExpr = fs_callback(), # when remove button is clicked in the FilterState ui
    383 - 12x + 12x +
                      handlerExpr = private$state_list_remove(state$get_state()$id)
    @@ -32435,7 +33662,8 @@

    teal.slice coverage - 65.92%

    386 - 10x + 10x +
                  added_states(NULL)
    @@ -32463,7 +33691,8 @@

    teal.slice coverage - 65.92%

    390 - 12x + 12x +
              NULL
    @@ -32561,14 +33790,16 @@

    teal.slice coverage - 65.92%

    404 - 1x + 1x +
          checkmate::assert_string(id)
    405 - 1x + 1x +
          data <- private$data
    @@ -32582,7 +33813,8 @@

    teal.slice coverage - 65.92%

    407 - 1x + 1x +
          ns <- NS(id)
    @@ -32596,14 +33828,16 @@

    teal.slice coverage - 65.92%

    409 - 1x + 1x +
          if (ncol(data) == 0) {
    410 - 1x + 1x +
            tags$div("no sample variables available")
    @@ -32743,28 +33977,32 @@

    teal.slice coverage - 65.92%

    430 - 8x + 8x +
          moduleServer(
    431 - 8x + 8x +
            id = id,
    432 - 8x + 8x +
            function(input, output, session) {
    433 - 8x + 8x +
              logger::log_trace("FilterStates$srv_add initializing, dataname: { private$dataname }")
    @@ -32785,42 +34023,48 @@

    teal.slice coverage - 65.92%

    436 - 8x + 8x +
              avail_column_choices <- reactive({
    437 - 9x + 9x +
                data <- private$data
    438 - 9x + 9x +
                vars_include <- private$get_filterable_varnames()
    439 - 9x + 9x +
                active_filter_vars <- unique(unlist(lapply(self$get_filter_state(), "[[", "varname")))
    440 - 9x + 9x +
                choices <- setdiff(vars_include, active_filter_vars)
    441 - 9x + 9x +
                varlabels <- get_varlabels(data)
    @@ -32834,35 +34078,40 @@

    teal.slice coverage - 65.92%

    443 - 9x + 9x +
                data_choices_labeled(
    444 - 9x + 9x +
                  data = data,
    445 - 9x + 9x +
                  choices = choices,
    446 - 9x + 9x +
                  varlabels = varlabels,
    447 - 9x + 9x +
                  keys = private$keys
    @@ -32897,21 +34146,24 @@

    teal.slice coverage - 65.92%

    452 - 8x + 8x +
              output$add_filter <- renderUI({
    453 - 6x + 6x +
                logger::log_trace(
    454 - 6x + 6x +
                  "FilterStates$srv_add@1 updating available column choices, dataname: { private$dataname }"
    @@ -32925,7 +34177,8 @@

    teal.slice coverage - 65.92%

    456 - 6x + 6x +
                if (length(avail_column_choices()) == 0) {
    @@ -32946,56 +34199,64 @@

    teal.slice coverage - 65.92%

    459 - 6x + 6x +
                  tags$div(
    460 - 6x + 6x +
                    teal.widgets::optionalSelectInput(
    461 - 6x + 6x +
                      session$ns("var_to_add"),
    462 - 6x + 6x +
                      choices = avail_column_choices(),
    463 - 6x + 6x +
                      selected = NULL,
    464 - 6x + 6x +
                      options = shinyWidgets::pickerOptions(
    465 - 6x + 6x +
                        liveSearch = TRUE,
    466 - 6x + 6x +
                        noneSelectedText = "Select variable to filter"
    @@ -33044,56 +34305,64 @@

    teal.slice coverage - 65.92%

    473 - 8x + 8x +
              observeEvent(
    474 - 8x + 8x +
                eventExpr = input$var_to_add,
    475 - 8x + 8x +
                handlerExpr = {
    476 - 3x + 3x +
                  logger::log_trace(
    477 - 3x + 3x +
                    sprintf(
    478 - 3x + 3x +
                      "FilterStates$srv_add@2 adding FilterState of variable %s, dataname: %s",
    479 - 3x + 3x +
                      input$var_to_add,
    480 - 3x + 3x +
                      private$dataname
    @@ -33114,21 +34383,24 @@

    teal.slice coverage - 65.92%

    483 - 3x + 3x +
                  self$set_filter_state(
    484 - 3x + 3x +
                    teal_slices(
    485 - 3x + 3x +
                      teal_slice(dataname = private$dataname, varname = input$var_to_add)
    @@ -33149,35 +34421,40 @@

    teal.slice coverage - 65.92%

    488 - 3x + 3x +
                  logger::log_trace(
    489 - 3x + 3x +
                    sprintf(
    490 - 3x + 3x +
                      "FilterStates$srv_add@2 added FilterState of variable %s, dataname: %s",
    491 - 3x + 3x +
                      input$var_to_add,
    492 - 3x + 3x +
                      private$dataname
    @@ -33219,14 +34496,16 @@

    teal.slice coverage - 65.92%

    498 - 8x + 8x +
              logger::log_trace("FilterStates$srv_add initialized, dataname: { private$dataname }")
    499 - 8x + 8x +
              NULL
    @@ -33485,14 +34764,16 @@

    teal.slice coverage - 65.92%

    536 - 288x + 288x +
          if ((length(include_varnames) + length(exclude_varnames)) == 0L) {
    537 - 113x + 113x +
            return(invisible(NULL))
    @@ -33506,21 +34787,24 @@

    teal.slice coverage - 65.92%

    539 - 175x + 175x +
          checkmate::assert_character(include_varnames, any.missing = FALSE, min.len = 0L, null.ok = TRUE)
    540 - 175x + 175x +
          checkmate::assert_character(exclude_varnames, any.missing = FALSE, min.len = 0L, null.ok = TRUE)
    541 - 175x + 175x +
          if (length(include_varnames) && length(exclude_varnames)) {
    @@ -33569,28 +34853,32 @@

    teal.slice coverage - 65.92%

    548 - 175x + 175x +
          supported_vars <- get_supported_filter_varnames(private$data)
    549 - 175x + 175x +
          if (length(include_varnames)) {
    550 - 161x + 161x +
            private$include_varnames <- intersect(include_varnames, supported_vars)
    551 - 161x + 161x +
            private$exclude_varnames <- character(0)
    @@ -33604,14 +34892,16 @@

    teal.slice coverage - 65.92%

    553 - 14x + 14x +
            private$exclude_varnames <- exclude_varnames
    554 - 14x + 14x +
            private$include_varnames <- character(0)
    @@ -33625,7 +34915,8 @@

    teal.slice coverage - 65.92%

    556 - 175x + 175x +
          invisible(NULL)
    @@ -33702,14 +34993,16 @@

    teal.slice coverage - 65.92%

    567 - 144x + 144x +
          if (length(private$include_varnames)) {
    568 - 97x + 97x +
            private$include_varnames
    @@ -33723,14 +35016,16 @@

    teal.slice coverage - 65.92%

    570 - 47x + 47x +
            supported_varnames <- get_supported_filter_varnames(private$data)
    571 - 47x + 47x +
            setdiff(supported_varnames, private$exclude_varnames)
    @@ -33835,7 +35130,8 @@

    teal.slice coverage - 65.92%

    586 - 212x + 212x +
          checkmate::assert_string(state_id, null.ok = TRUE)
    @@ -33849,14 +35145,16 @@

    teal.slice coverage - 65.92%

    588 - 212x + 212x +
          if (is.null(state_id)) {
    589 - 212x + 212x +
            private$state_list()
    @@ -33982,49 +35280,56 @@

    teal.slice coverage - 65.92%

    607 - 183x + 183x +
          logger::log_trace("{ class(self)[1] } pushing into state_list, dataname: { private$dataname }")
    608 - 183x + 183x +
          checkmate::assert_string(state_id)
    609 - 183x + 183x +
          checkmate::assert_multi_class(x, c("FilterState", "FilterStateExpr"))
    610 - 183x + 183x +
          state <- stats::setNames(list(x), state_id)
    611 - 183x + 183x +
          new_state_list <- c(
    612 - 183x + 183x +
            isolate(private$state_list()),
    613 - 183x + 183x +
            state
    @@ -34038,7 +35343,8 @@

    teal.slice coverage - 65.92%

    615 - 183x + 183x +
          isolate(private$state_list(new_state_list))
    @@ -34052,14 +35358,16 @@

    teal.slice coverage - 65.92%

    617 - 183x + 183x +
          logger::log_trace("{ class(self)[1] } pushed into queue, dataname: { private$dataname }")
    618 - 183x + 183x +
          invisible(NULL)
    @@ -34178,14 +35486,16 @@

    teal.slice coverage - 65.92%

    635 - 32x + 32x +
          checkmate::assert_character(state_id)
    636 - 32x + 32x +
          logger::log_trace("{ class(self)[1] } removing a filter, state_id: { toString(state_id) }")
    @@ -34199,63 +35509,72 @@

    teal.slice coverage - 65.92%

    638 - 32x + 32x +
          isolate({
    639 - 32x + 32x +
            current_state_ids <- vapply(private$state_list(), function(x) x$get_state()$id, character(1))
    640 - 32x + 32x +
            to_remove <- state_id %in% current_state_ids
    641 - 32x + 32x +
            if (any(to_remove)) {
    642 - 31x + 31x +
              new_state_list <- Filter(
    643 - 31x + 31x +
                function(state) {
    644 - 68x + 68x +
                  if (state$get_state()$id %in% state_id) {
    645 - 54x + 54x +
                    if (state$get_state()$anchored && !force) {
    646 - 7x + 7x +
                      return(TRUE)
    @@ -34269,14 +35588,16 @@

    teal.slice coverage - 65.92%

    648 - 47x + 47x +
                      state$destroy_observers()
    649 - 47x + 47x +
                      FALSE
    @@ -34297,7 +35618,8 @@

    teal.slice coverage - 65.92%

    652 - 14x + 14x +
                    TRUE
    @@ -34318,7 +35640,8 @@

    teal.slice coverage - 65.92%

    655 - 31x + 31x +
                private$state_list()
    @@ -34332,7 +35655,8 @@

    teal.slice coverage - 65.92%

    657 - 31x + 31x +
              private$state_list(new_state_list)
    @@ -34346,7 +35670,8 @@

    teal.slice coverage - 65.92%

    659 - 1x + 1x +
              warning(sprintf("\"%s\" not found in state list", state_id))
    @@ -34374,7 +35699,8 @@

    teal.slice coverage - 65.92%

    663 - 32x + 32x +
          invisible(NULL)
    @@ -34444,21 +35770,24 @@

    teal.slice coverage - 65.92%

    673 - 25x + 25x +
          isolate({
    674 - 25x + 25x +
            logger::log_trace(
    675 - 25x + 25x +
              "{ class(self)[1] }$state_list_empty removing all non-anchored filters for dataname: { private$dataname }"
    @@ -34479,28 +35808,32 @@

    teal.slice coverage - 65.92%

    678 - 25x + 25x +
            state_list <- private$state_list()
    679 - 25x + 25x +
            if (length(state_list)) {
    680 - 15x + 15x +
              state_ids <- vapply(state_list, function(x) x$get_state()$id, character(1))
    681 - 15x + 15x +
              private$state_list_remove(state_ids, force)
    @@ -34528,7 +35861,8 @@

    teal.slice coverage - 65.92%

    685 - 25x + 25x +
          invisible(NULL)
    @@ -34654,35 +35988,40 @@

    teal.slice coverage - 65.92%

    703 - 211x + 211x +
          checkmate::assert_class(state, "teal_slices")
    704 - 211x + 211x +
          checkmate::assert_multi_class(data, c("data.frame", "matrix", "DataFrame", "HermesData"))
    705 - 211x + 211x +
          checkmate::assert_function(data_reactive, args = "sid")
    706 - 211x + 211x +
          if (length(state) == 0L) {
    707 - 101x + 101x +
            return(invisible(NULL))
    @@ -34703,14 +36042,16 @@

    teal.slice coverage - 65.92%

    710 - 110x + 110x +
          slices_hashed <- vapply(state, `[[`, character(1L), "id")
    711 - 110x + 110x +
          if (any(duplicated(slices_hashed))) {
    @@ -34759,28 +36100,32 @@

    teal.slice coverage - 65.92%

    718 - 110x + 110x +
          state_list <- isolate(private$state_list_get())
    719 - 110x + 110x +
          lapply(state, function(slice) {
    720 - 191x + 191x +
            state_id <- slice$id
    721 - 191x + 191x +
            if (state_id %in% names(state_list)) {
    @@ -34794,7 +36139,8 @@

    teal.slice coverage - 65.92%

    723 - 8x + 8x +
              state_list[[state_id]]$set_state(slice)
    @@ -34808,7 +36154,8 @@

    teal.slice coverage - 65.92%

    725 - 183x + 183x +
              if (inherits(slice, "teal_slice_expr")) {
    @@ -34822,7 +36169,8 @@

    teal.slice coverage - 65.92%

    727 - 6x + 6x +
                fstate <- init_filter_state_expr(slice)
    @@ -34843,14 +36191,16 @@

    teal.slice coverage - 65.92%

    730 - 177x + 177x +
                fstate <- init_filter_state(
    731 - 177x + 177x +
                  x = data[, slice$varname, drop = TRUE],
    @@ -34899,14 +36249,16 @@

    teal.slice coverage - 65.92%

    738 - 177x + 177x +
                  x_reactive = if (private$count_type == "none") {
    739 - 171x + 171x +
                    reactive(NULL)
    @@ -34920,7 +36272,8 @@

    teal.slice coverage - 65.92%

    741 - 6x + 6x +
                    reactive(data_reactive(state_id)[, slice$varname, drop = TRUE])
    @@ -34934,14 +36287,16 @@

    teal.slice coverage - 65.92%

    743 - 177x + 177x +
                  slice = slice,
    744 - 177x + 177x +
                  extract_type = private$extract_type
    @@ -34962,7 +36317,8 @@

    teal.slice coverage - 65.92%

    747 - 183x + 183x +
              private$state_list_push(x = fstate, state_id = state_id)
    @@ -34990,7 +36346,8 @@

    teal.slice coverage - 65.92%

    751 - 110x + 110x +
          invisible(NULL)
    @@ -35542,35 +36899,40 @@

    teal.slice coverage - 65.92%

    75 - 369x + 369x +
          checkmate::assert_class(x_reactive, "reactive")
    76 - 368x + 368x +
          checkmate::assert_class(slice, "teal_slice")
    77 - 366x + 366x +
          checkmate::assert_character(extract_type, max.len = 1, any.missing = FALSE)
    78 - 366x + 366x +
          if (length(extract_type) == 1) {
    79 - 53x + 53x +
            checkmate::assert_choice(extract_type, choices = c("list", "matrix"))
    @@ -35598,14 +36960,16 @@

    teal.slice coverage - 65.92%

    83 - 365x + 365x +
          private$x <- x
    84 - 365x + 365x +
          private$x_reactive <- x_reactive
    @@ -35619,21 +36983,24 @@

    teal.slice coverage - 65.92%

    86 - 365x + 365x +
          private$na_count <- sum(is.na(x))
    87 - 365x + 365x +
          private$filtered_na_count <- reactive(
    88 - 365x + 365x +
            if (!is.null(private$x_reactive())) {
    @@ -35668,7 +37035,8 @@

    teal.slice coverage - 65.92%

    93 - 365x + 365x +
          private$extract_type <- extract_type
    @@ -35689,14 +37057,16 @@

    teal.slice coverage - 65.92%

    96 - 18x + 18x +
          if (is.null(isolate(slice$keep_na)) && anyNA(x)) slice$keep_na <- TRUE
    97 - 365x + 365x +
          private$teal_slice <- slice
    @@ -35710,7 +37080,8 @@

    teal.slice coverage - 65.92%

    99 - 365x + 365x +
          varlabel <- attr(x, "label", exact = TRUE)
    @@ -35724,21 +37095,24 @@

    teal.slice coverage - 65.92%

    101 - 365x + 365x +
          private$varlabel <-
    102 - 365x + 365x +
            if (is.null(varlabel) || identical(varlabel, private$get_varname())) {
    103 - 364x + 364x +
              character(0)
    @@ -35752,7 +37126,8 @@

    teal.slice coverage - 65.92%

    105 - 1x + 1x +
              varlabel
    @@ -35773,7 +37148,8 @@

    teal.slice coverage - 65.92%

    108 - 365x + 365x +
          private$state_history <- reactiveVal(list())
    @@ -35787,7 +37163,8 @@

    teal.slice coverage - 65.92%

    110 - 365x + 365x +
          logger::log_trace("Instantiated FilterState object id: { private$get_id() }")
    @@ -35801,7 +37178,8 @@

    teal.slice coverage - 65.92%

    112 - 365x + 365x +
          invisible(self)
    @@ -35885,28 +37263,32 @@

    teal.slice coverage - 65.92%

    124 - 68x + 68x +
          sprintf(
    125 - 68x + 68x +
            "%s:\n%s",
    126 - 68x + 68x +
            class(self)[1],
    127 - 68x + 68x +
            format(self$get_state(), show_all = show_all, trim_lines = trim_lines)
    @@ -35976,7 +37358,8 @@

    teal.slice coverage - 65.92%

    137 - 14x + 14x +
          cat(isolate(self$format(...)))
    @@ -36067,21 +37450,24 @@

    teal.slice coverage - 65.92%

    150 - 89x + 89x +
          checkmate::assert_class(state, "teal_slice")
    151 - 88x + 88x +
          if (private$is_fixed()) {
    152 - 1x + 1x +
            warning("attempt to set state on fixed filter aborted id: ", private$get_id())
    @@ -36095,28 +37481,32 @@

    teal.slice coverage - 65.92%

    154 - 87x + 87x +
            logger::log_trace("{ class(self)[1] }$set_state setting state of filter id: { private$get_id() }")
    155 - 87x + 87x +
            isolate({
    156 - 87x + 87x +
              if (!is.null(state$selected)) {
    157 - 78x + 78x +
                private$set_selected(state$selected)
    @@ -36130,14 +37520,16 @@

    teal.slice coverage - 65.92%

    159 - 75x + 75x +
              if (!is.null(state$keep_na)) {
    160 - 16x + 16x +
                private$set_keep_na(state$keep_na)
    @@ -36151,14 +37543,16 @@

    teal.slice coverage - 65.92%

    162 - 75x + 75x +
              if (!is.null(state$keep_inf)) {
    163 - 9x + 9x +
                private$set_keep_inf(state$keep_inf)
    @@ -36172,35 +37566,40 @@

    teal.slice coverage - 65.92%

    165 - 75x + 75x +
              current_state <- sprintf(
    166 - 75x + 75x +
                "selected: %s; keep_na: %s; keep_inf: %s",
    167 - 75x + 75x +
                toString(private$get_selected()),
    168 - 75x + 75x +
                private$get_keep_na(),
    169 - 75x + 75x +
                private$get_keep_inf()
    @@ -36235,7 +37634,8 @@

    teal.slice coverage - 65.92%

    174 - 76x + 76x +
          invisible(self)
    @@ -36305,7 +37705,8 @@

    teal.slice coverage - 65.92%

    184 - 747x + 747x +
          private$teal_slice
    @@ -36375,7 +37776,8 @@

    teal.slice coverage - 65.92%

    194 - 1x + 1x +
          stop("this is a virtual method")
    @@ -36459,42 +37861,48 @@

    teal.slice coverage - 65.92%

    206 - 12x + 12x +
          moduleServer(
    207 - 12x + 12x +
            id = id,
    208 - 12x + 12x +
            function(input, output, session) {
    209 - 12x + 12x +
              logger::log_trace("FilterState$server initializing module for slice: { private$get_id() } ")
    210 - 12x + 12x +
              private$server_summary("summary")
    211 - 12x + 12x +
              if (private$is_fixed()) {
    @@ -36515,7 +37923,8 @@

    teal.slice coverage - 65.92%

    214 - 12x + 12x +
                private$server_inputs("inputs")
    @@ -36536,49 +37945,56 @@

    teal.slice coverage - 65.92%

    217 - 12x + 12x +
              private$observers$state <- observeEvent(
    218 - 12x + 12x +
                eventExpr = list(private$get_selected(), private$get_keep_na(), private$get_keep_inf()),
    219 - 12x + 12x +
                handlerExpr = {
    220 - 4x + 4x +
                  current_state <- as.list(self$get_state())
    221 - 4x + 4x +
                  history <- private$state_history()
    222 - 4x + 4x +
                  history_update <- c(history, list(current_state))
    223 - 4x + 4x +
                  private$state_history(history_update)
    @@ -36606,21 +38022,24 @@

    teal.slice coverage - 65.92%

    227 - 12x + 12x +
              private$observers$back <- observeEvent(
    228 - 12x + 12x +
                eventExpr = input$back,
    229 - 12x + 12x +
                handlerExpr = {
    @@ -36683,21 +38102,24 @@

    teal.slice coverage - 65.92%

    238 - 12x + 12x +
              private$observers$reset <- observeEvent(
    239 - 12x + 12x +
                eventExpr = input$reset,
    240 - 12x + 12x +
                handlerExpr = {
    @@ -36753,56 +38175,64 @@

    teal.slice coverage - 65.92%

    248 - 12x + 12x +
              private$observers$state_history <- observeEvent(
    249 - 12x + 12x +
                eventExpr = private$state_history(),
    250 - 12x + 12x +
                handlerExpr = {
    251 - 4x + 4x +
                  shinyjs::disable(id = "back")
    252 - 4x + 4x +
                  shinyjs::disable(id = "reset")
    253 - 4x + 4x +
                  shinyjs::delay(
    254 - 4x + 4x +
                    ms = 100,
    255 - 4x + 4x +
                    expr = {
    @@ -36837,21 +38267,24 @@

    teal.slice coverage - 65.92%

    260 - 4x + 4x +
                  shinyjs::delay(
    261 - 4x + 4x +
                    ms = 100,
    262 - 4x + 4x +
                    expr = {
    @@ -36907,14 +38340,16 @@

    teal.slice coverage - 65.92%

    270 - 12x + 12x +
              private$destroy_shiny <- function() {
    271 - 8x + 8x +
                logger::log_trace("Destroying FilterState inputs and observers; id: { private$get_id() }")
    @@ -36928,7 +38363,8 @@

    teal.slice coverage - 65.92%

    273 - 8x + 8x +
                lapply(session$ns(names(input)), .subset2(input, "impl")$.values$remove)
    @@ -36949,7 +38385,8 @@

    teal.slice coverage - 65.92%

    276 - 8x + 8x +
                lapply(private$observers, function(x) x$destroy())
    @@ -36970,7 +38407,8 @@

    teal.slice coverage - 65.92%

    279 - 12x + 12x +
              reactive(input$remove)
    @@ -37054,7 +38492,8 @@

    teal.slice coverage - 65.92%

    291 - 12x + 12x +
          ns <- NS(id)
    @@ -37110,84 +38549,96 @@

    teal.slice coverage - 65.92%

    299 - 12x + 12x +
          tags$div(
    300 - 12x + 12x +
            id = id,
    301 - 12x + 12x +
            class = "panel filter-card",
    302 - 12x + 12x +
            include_js_files("count-bar-labels.js"),
    303 - 12x + 12x +
            tags$div(
    304 - 12x + 12x +
              class = "filter-card-header",
    305 - 12x + 12x +
              `data-toggle` = "collapse",
    306 - 12x + 12x +
              `data-bs-toggle` = "collapse",
    307 - 12x + 12x +
              href = paste0("#", ns("body")),
    308 - 12x + 12x +
              tags$div(
    309 - 12x + 12x +
                class = "filter-card-title",
    310 - 12x + 12x +
                if (private$is_anchored() && private$is_fixed()) {
    @@ -37201,7 +38652,8 @@

    teal.slice coverage - 65.92%

    312 - 12x + 12x +
                } else if (private$is_anchored() && !private$is_fixed()) {
    @@ -37215,7 +38667,8 @@

    teal.slice coverage - 65.92%

    314 - 12x + 12x +
                } else if (!private$is_anchored() && private$is_fixed()) {
    @@ -37236,28 +38689,32 @@

    teal.slice coverage - 65.92%

    317 - 12x + 12x +
                tags$div(class = "filter-card-varname", tags$strong(private$get_varname())),
    318 - 12x + 12x +
                tags$div(class = "filter-card-varlabel", private$get_varlabel()),
    319 - 12x + 12x +
                tags$div(
    320 - 12x + 12x +
                  class = "filter-card-controls",
    @@ -37278,7 +38735,8 @@

    teal.slice coverage - 65.92%

    323 - 12x + 12x +
                  onclick = "event.stopPropagation();event.preventDefault();",
    @@ -37292,70 +38750,80 @@

    teal.slice coverage - 65.92%

    325 - 12x + 12x +
                  `data-bs-toggle` = "collapse",
    326 - 12x + 12x +
                  `data-bs-target` = NULL,
    327 - 12x + 12x +
                  if (isFALSE(private$is_fixed())) {
    328 - 12x + 12x +
                    actionLink(
    329 - 12x + 12x +
                      inputId = ns("back"),
    330 - 12x + 12x +
                      label = NULL,
    331 - 12x + 12x +
                      icon = icon("circle-arrow-left", lib = "font-awesome"),
    332 - 12x + 12x +
                      title = "Rewind state",
    333 - 12x + 12x +
                      class = "filter-card-back",
    334 - 12x + 12x +
                      style = "display: none"
    @@ -37376,56 +38844,64 @@

    teal.slice coverage - 65.92%

    337 - 12x + 12x +
                  if (isFALSE(private$is_fixed())) {
    338 - 12x + 12x +
                    actionLink(
    339 - 12x + 12x +
                      inputId = ns("reset"),
    340 - 12x + 12x +
                      label = NULL,
    341 - 12x + 12x +
                      icon = icon("circle-arrow-up", lib = "font-awesome"),
    342 - 12x + 12x +
                      title = "Restore original state",
    343 - 12x + 12x +
                      class = "filter-card-back",
    344 - 12x + 12x +
                      style = "display: none"
    @@ -37446,42 +38922,48 @@

    teal.slice coverage - 65.92%

    347 - 12x + 12x +
                  if (isFALSE(private$is_anchored())) {
    348 - 12x + 12x +
                    actionLink(
    349 - 12x + 12x +
                      inputId = ns("remove"),
    350 - 12x + 12x +
                      label = icon("circle-xmark", lib = "font-awesome"),
    351 - 12x + 12x +
                      title = "Remove filter",
    352 - 12x + 12x +
                      class = "filter-card-remove"
    @@ -37516,7 +38998,8 @@

    teal.slice coverage - 65.92%

    357 - 12x + 12x +
              tags$div(class = "filter-card-summary", private$ui_summary(ns("summary")))
    @@ -37530,56 +39013,64 @@

    teal.slice coverage - 65.92%

    359 - 12x + 12x +
            tags$div(
    360 - 12x + 12x +
              id = ns("body"),
    361 - 12x + 12x +
              class = "collapse out",
    362 - 12x + 12x +
              `data-parent` = paste0("#", parent_id),
    363 - 12x + 12x +
              `data-bs-parent` = paste0("#", parent_id),
    364 - 12x + 12x +
              tags$div(
    365 - 12x + 12x +
                class = "filter-card-body",
    366 - 12x + 12x +
                if (private$is_fixed()) {
    @@ -37600,7 +39091,8 @@

    teal.slice coverage - 65.92%

    369 - 12x + 12x +
                  private$ui_inputs(ns("inputs"))
    @@ -37691,14 +39183,16 @@

    teal.slice coverage - 65.92%

    382 - 47x + 47x +
          if (!is.null(private$destroy_shiny)) {
    383 - 8x + 8x +
            private$destroy_shiny()
    @@ -37992,35 +39486,40 @@

    teal.slice coverage - 65.92%

    425 - 421x + 421x +
          logger::log_trace(
    426 - 421x + 421x +
            sprintf(
    427 - 421x + 421x +
              "%s$set_selected setting selection of id: %s",
    428 - 421x + 421x +
              class(self)[1],
    429 - 421x + 421x +
              private$get_id()
    @@ -38041,35 +39540,40 @@

    teal.slice coverage - 65.92%

    432 - 421x + 421x +
          isolate({
    433 - 421x + 421x +
            value <- private$cast_and_validate(value)
    434 - 410x + 410x +
            value <- private$check_length(value)
    435 - 404x + 404x +
            value <- private$remove_out_of_bounds_values(value)
    436 - 404x + 404x +
            private$teal_slice$selected <- value
    @@ -38083,35 +39587,40 @@

    teal.slice coverage - 65.92%

    438 - 404x + 404x +
          logger::log_trace(
    439 - 404x + 404x +
            sprintf(
    440 - 404x + 404x +
              "%s$set_selected selection of id: %s",
    441 - 404x + 404x +
              class(self)[1],
    442 - 404x + 404x +
              private$get_id()
    @@ -38139,7 +39648,8 @@

    teal.slice coverage - 65.92%

    446 - 404x + 404x +
          invisible(NULL)
    @@ -38223,56 +39733,64 @@

    teal.slice coverage - 65.92%

    458 - 16x + 16x +
          checkmate::assert_flag(value)
    459 - 16x + 16x +
          private$teal_slice$keep_na <- value
    460 - 16x + 16x +
          logger::log_trace(
    461 - 16x + 16x +
            sprintf(
    462 - 16x + 16x +
              "%s$set_keep_na set for filter %s to %s.",
    463 - 16x + 16x +
              class(self)[1],
    464 - 16x + 16x +
              private$get_id(),
    465 - 16x + 16x +
              value
    @@ -38293,7 +39811,8 @@

    teal.slice coverage - 65.92%

    468 - 16x + 16x +
          invisible(NULL)
    @@ -38377,56 +39896,64 @@

    teal.slice coverage - 65.92%

    480 - 9x + 9x +
          checkmate::assert_flag(value)
    481 - 9x + 9x +
          private$teal_slice$keep_inf <- value
    482 - 9x + 9x +
          logger::log_trace(
    483 - 9x + 9x +
            sprintf(
    484 - 9x + 9x +
              "%s$set_keep_inf of filter %s set to %s",
    485 - 9x + 9x +
              class(self)[1],
    486 - 9x + 9x +
              private$get_id(),
    487 - 9x + 9x +
              value
    @@ -38454,7 +39981,8 @@

    teal.slice coverage - 65.92%

    491 - 9x + 9x +
          invisible(NULL)
    @@ -38517,7 +40045,8 @@

    teal.slice coverage - 65.92%

    500 - 88x + 88x +
          isolate(private$teal_slice$dataname)
    @@ -38566,7 +40095,8 @@

    teal.slice coverage - 65.92%

    507 - 166x + 166x +
          isolate(private$teal_slice$varname)
    @@ -38615,7 +40145,8 @@

    teal.slice coverage - 65.92%

    514 - 4x + 4x +
          isolate(private$teal_slice$id)
    @@ -38671,7 +40202,8 @@

    teal.slice coverage - 65.92%

    522 - 772x + 772x +
          isolate(private$teal_slice$choices)
    @@ -38727,7 +40259,8 @@

    teal.slice coverage - 65.92%

    530 - 364x + 364x +
          private$teal_slice$selected
    @@ -38776,7 +40309,8 @@

    teal.slice coverage - 65.92%

    537 - 129x + 129x +
          private$teal_slice$keep_na
    @@ -38825,7 +40359,8 @@

    teal.slice coverage - 65.92%

    544 - 117x + 117x +
          private$teal_slice$keep_inf
    @@ -38867,7 +40402,8 @@

    teal.slice coverage - 65.92%

    550 - 148x + 148x +
          isolate(isTRUE(private$teal_slice$fixed))
    @@ -38909,7 +40445,8 @@

    teal.slice coverage - 65.92%

    556 - 48x + 48x +
          isolate(isTRUE(private$teal_slice$anchored))
    @@ -38951,7 +40488,8 @@

    teal.slice coverage - 65.92%

    562 - 217x + 217x +
          isolate(isTRUE(private$teal_slice$multiple))
    @@ -39014,7 +40552,8 @@

    teal.slice coverage - 65.92%

    571 - 12x + 12x +
          private$varlabel
    @@ -39063,49 +40602,56 @@

    teal.slice coverage - 65.92%

    578 - 109x + 109x +
          varname <- private$get_varname()
    579 - 109x + 109x +
          varname_backticked <- sprintf("`%s`", varname)
    580 - 109x + 109x +
          ans <-
    581 - 109x + 109x +
            if (isTRUE(private$extract_type == "list")) {
    582 - 16x + 16x +
              sprintf("%s$%s", dataname, varname_backticked)
    583 - 109x + 109x +
            } else if (isTRUE(private$extract_type == "matrix")) {
    584 - 7x + 7x +
              sprintf("%s[, \"%s\"]", dataname, varname)
    @@ -39119,7 +40665,8 @@

    teal.slice coverage - 65.92%

    586 - 86x + 86x +
              varname_backticked
    @@ -39133,7 +40680,8 @@

    teal.slice coverage - 65.92%

    588 - 109x + 109x +
          str2lang(ans)
    @@ -39203,14 +40751,16 @@

    teal.slice coverage - 65.92%

    598 - 108x + 108x +
          if (private$na_count == 0L) {
    599 - 87x + 87x +
            return(filter_call)
    @@ -39231,42 +40781,48 @@

    teal.slice coverage - 65.92%

    602 - 21x + 21x +
          if (is.null(filter_call) && isFALSE(private$get_keep_na())) {
    603 - 2x + 2x +
            call("!", call("is.na", varname))
    604 - 19x + 19x +
          } else if (!is.null(filter_call) && isTRUE(private$get_keep_na())) {
    605 - 12x + 12x +
            call("|", call("is.na", varname), filter_call)
    606 - 7x + 7x +
          } else if (!is.null(filter_call) && isFALSE(private$get_keep_na())) {
    607 - 7x + 7x +
            call("&", call("!", call("is.na", varname)), filter_call)
    @@ -39343,7 +40899,8 @@

    teal.slice coverage - 65.92%

    618 - 11x + 11x +
          values
    @@ -39378,7 +40935,8 @@

    teal.slice coverage - 65.92%

    623 - 11x + 11x +
          values
    @@ -39441,7 +40999,8 @@

    teal.slice coverage - 65.92%

    632 - 31x + 31x +
          values
    @@ -39539,42 +41098,48 @@

    teal.slice coverage - 65.92%

    646 - 75x + 75x +
          if (private$is_choice_limited) {
    647 - 3x + 3x +
            TRUE
    648 - 72x + 72x +
          } else if (!setequal(private$get_selected(), private$get_choices())) {
    649 - 59x + 59x +
            TRUE
    650 - 13x + 13x +
          } else if (!isTRUE(private$get_keep_na()) && private$na_count > 0) {
    651 - 4x + 4x +
            TRUE
    @@ -39588,7 +41153,8 @@

    teal.slice coverage - 65.92%

    653 - 9x + 9x +
            FALSE
    @@ -39658,14 +41224,16 @@

    teal.slice coverage - 65.92%

    663 - 12x + 12x +
          ns <- NS(id)
    664 - 12x + 12x +
          uiOutput(ns("summary"), class = "filter-card-summary")
    @@ -39721,28 +41289,32 @@

    teal.slice coverage - 65.92%

    672 - 12x + 12x +
          moduleServer(
    673 - 12x + 12x +
            id = id,
    674 - 12x + 12x +
            function(input, output, session) {
    675 - 12x + 12x +
              output$summary <- renderUI(private$content_summary())
    @@ -40008,14 +41580,16 @@

    teal.slice coverage - 65.92%

    713 - 11x + 11x +
          ns <- NS(id)
    714 - 11x + 11x +
          if (private$na_count > 0) {
    @@ -40169,7 +41743,8 @@

    teal.slice coverage - 65.92%

    736 - 11x + 11x +
            NULL
    @@ -40246,7 +41821,8 @@

    teal.slice coverage - 65.92%

    747 - 12x + 12x +
          moduleServer(id, function(input, output, session) {
    @@ -40274,42 +41850,48 @@

    teal.slice coverage - 65.92%

    751 - 12x + 12x +
            output$trigger_visible <- renderUI({
    752 - 12x + 12x +
              updateCountText(
    753 - 12x + 12x +
                inputId = "count_label",
    754 - 12x + 12x +
                label = "Keep NA",
    755 - 12x + 12x +
                countmax = private$na_count,
    756 - 12x + 12x +
                countnow = private$filtered_na_count()
    @@ -40323,7 +41905,8 @@

    teal.slice coverage - 65.92%

    758 - 12x + 12x +
              NULL
    @@ -40365,35 +41948,40 @@

    teal.slice coverage - 65.92%

    764 - 12x + 12x +
            private$observers$keep_na_api <- observeEvent(
    765 - 12x + 12x +
              ignoreNULL = FALSE, # nothing selected is possible for NA
    766 - 12x + 12x +
              ignoreInit = TRUE, # ignoreInit: should not matter because we set the UI with the desired initial state
    767 - 12x + 12x +
              eventExpr = private$get_keep_na(),
    768 - 12x + 12x +
              handlerExpr = {
    @@ -40470,35 +42058,40 @@

    teal.slice coverage - 65.92%

    779 - 12x + 12x +
            private$observers$keep_na <- observeEvent(
    780 - 12x + 12x +
              ignoreNULL = FALSE, # ignoreNULL: we don't want to ignore NULL when nothing is selected in the `selectInput`
    781 - 12x + 12x +
              ignoreInit = TRUE, # ignoreInit: should not matter because we set the UI with the desired initial state
    782 - 12x + 12x +
              eventExpr = input$value,
    783 - 12x + 12x +
              handlerExpr = {
    @@ -40568,7 +42161,8 @@

    teal.slice coverage - 65.92%

    793 - 12x + 12x +
            invisible(NULL)
    @@ -40847,7 +42441,8 @@

    teal.slice coverage - 65.92%

    35 - 92x + 92x +
          if (!requireNamespace("SummarizedExperiment", quietly = TRUE)) {
    @@ -40868,35 +42463,40 @@

    teal.slice coverage - 65.92%

    38 - 92x + 92x +
          checkmate::assert_function(data_reactive, args = "sid")
    39 - 92x + 92x +
          checkmate::assert_class(data, "SummarizedExperiment")
    40 - 91x + 91x +
          super$initialize(data, data_reactive, dataname, datalabel)
    41 - 91x + 91x +
          if (!is.null(datalabel)) {
    42 - 84x + 84x +
            private$dataname_prefixed <- sprintf("%s[['%s']]", dataname, datalabel)
    @@ -40987,35 +42587,40 @@

    teal.slice coverage - 65.92%

    55 - 61x + 61x +
          isolate({
    56 - 61x + 61x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initializing, dataname: { private$dataname }")
    57 - 61x + 61x +
            checkmate::assert_class(state, "teal_slices")
    58 - 59x + 59x +
            lapply(state, function(x) {
    59 - 17x + 17x +
              checkmate::assert_choice(x$arg, choices = c("subset", "select"), null.ok = TRUE, .var.name = "teal_slice$arg")
    @@ -41029,21 +42634,24 @@

    teal.slice coverage - 65.92%

    61 - 59x + 59x +
            count_type <- attr(state, "count_type")
    62 - 59x + 59x +
            if (length(count_type)) {
    63 - 8x + 8x +
              private$count_type <- count_type
    @@ -41064,35 +42672,40 @@

    teal.slice coverage - 65.92%

    66 - 59x + 59x +
            subset_states <- Filter(function(x) x$arg == "subset", state)
    67 - 59x + 59x +
            private$set_filter_state_impl(
    68 - 59x + 59x +
              state = subset_states,
    69 - 59x + 59x +
              data = SummarizedExperiment::rowData(private$data),
    70 - 59x + 59x +
              data_reactive = function(sid = "") {
    @@ -41148,35 +42761,40 @@

    teal.slice coverage - 65.92%

    78 - 59x + 59x +
            select_states <- Filter(function(x) x$arg == "select", state)
    79 - 59x + 59x +
            private$set_filter_state_impl(
    80 - 59x + 59x +
              state = select_states,
    81 - 59x + 59x +
              data = SummarizedExperiment::colData(private$data),
    82 - 59x + 59x +
              data_reactive = function(sid = "") {
    @@ -41232,14 +42850,16 @@

    teal.slice coverage - 65.92%

    90 - 59x + 59x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initialized, dataname: { private$dataname }")
    91 - 59x + 59x +
            invisible(NULL)
    @@ -41309,49 +42929,56 @@

    teal.slice coverage - 65.92%

    101 - 2x + 2x +
          data <- private$data
    102 - 2x + 2x +
          checkmate::assert_string(id)
    103 - 2x + 2x +
          ns <- NS(id)
    104 - 2x + 2x +
          row_input <- if (ncol(SummarizedExperiment::rowData(data)) == 0) {
    105 - 1x + 1x +
            tags$div("no sample variables available")
    106 - 2x + 2x +
          } else if (nrow(SummarizedExperiment::rowData(data)) == 0) {
    107 - 1x + 1x +
            tags$div("no samples available")
    @@ -41435,28 +43062,32 @@

    teal.slice coverage - 65.92%

    119 - 2x + 2x +
          col_input <- if (ncol(SummarizedExperiment::colData(data)) == 0) {
    120 - 1x + 1x +
            tags$div("no sample variables available")
    121 - 2x + 2x +
          } else if (nrow(SummarizedExperiment::colData(data)) == 0) {
    122 - 1x + 1x +
            tags$div("no samples available")
    @@ -41540,21 +43171,24 @@

    teal.slice coverage - 65.92%

    134 - 2x + 2x +
          tags$div(
    135 - 2x + 2x +
            row_input,
    136 - 2x + 2x +
            col_input
    @@ -42974,7 +44608,8 @@

    teal.slice coverage - 65.92%

    33 - 153x + 153x +
          logger::log_trace("Instantiating { class(self)[1] }, dataname: { dataname }")
    @@ -42995,21 +44630,24 @@

    teal.slice coverage - 65.92%

    36 - 153x + 153x +
          check_simple_name(dataname)
    37 - 151x + 151x +
          checkmate::assert_character(keys, any.missing = FALSE)
    38 - 151x + 151x +
          checkmate::assert_character(label, null.ok = TRUE)
    @@ -43023,35 +44661,40 @@

    teal.slice coverage - 65.92%

    40 - 151x + 151x +
          logger::log_trace("Instantiating { class(self)[1] }, dataname: { dataname }")
    41 - 151x + 151x +
          private$dataset <- dataset
    42 - 151x + 151x +
          private$dataname <- dataname
    43 - 151x + 151x +
          private$keys <- keys
    44 - 151x + 151x +
          private$label <- if (is.null(label)) character(0) else label
    @@ -43072,28 +44715,32 @@

    teal.slice coverage - 65.92%

    47 - 151x + 151x +
          private$data_filtered_fun <- function(sid = "") {
    48 - 24x + 24x +
            checkmate::assert_character(sid)
    49 - 24x + 24x +
            if (length(sid)) {
    50 - 24x + 24x +
              logger::log_trace("filtering data dataname: { dataname }, sid: { sid }")
    @@ -43121,35 +44768,40 @@

    teal.slice coverage - 65.92%

    54 - 24x + 24x +
            env <- new.env(parent = parent.env(globalenv()))
    55 - 24x + 24x +
            env[[dataname]] <- private$dataset
    56 - 24x + 24x +
            filter_call <- self$get_call(sid)
    57 - 24x + 24x +
            eval_expr_with_msg(filter_call, env)
    58 - 24x + 24x +
            get(x = dataname, envir = env)
    @@ -43170,21 +44822,24 @@

    teal.slice coverage - 65.92%

    61 - 151x + 151x +
          private$data_filtered <- reactive(private$data_filtered_fun())
    62 - 151x + 151x +
          logger::log_trace("Instantiated { class(self)[1] }, dataname: { private$dataname }")
    63 - 151x + 151x +
          invisible(self)
    @@ -43268,28 +44923,32 @@

    teal.slice coverage - 65.92%

    75 - 24x + 24x +
          sprintf(
    76 - 24x + 24x +
            "%s:\n%s",
    77 - 24x + 24x +
            class(self)[1],
    78 - 24x + 24x +
            format(self$get_filter_state(), show_all = show_all, trim_lines = trim_lines)
    @@ -43359,7 +45018,8 @@

    teal.slice coverage - 65.92%

    88 - 10x + 10x +
          cat(isolate(self$format(...)), "\n")
    @@ -43436,28 +45096,32 @@

    teal.slice coverage - 65.92%

    99 - 14x + 14x +
          logger::log_trace("Removing filters from FilteredDataset: { deparse1(self$get_dataname()) }")
    100 - 14x + 14x +
          lapply(
    101 - 14x + 14x +
            private$get_filter_states(),
    102 - 14x + 14x +
            function(filter_states) filter_states$clear_filter_states(force)
    @@ -43471,14 +45135,16 @@

    teal.slice coverage - 65.92%

    104 - 14x + 14x +
          logger::log_trace("Removed filters from FilteredDataset: { deparse1(self$get_dataname()) }")
    105 - 14x + 14x +
          NULL
    @@ -43611,21 +45277,24 @@

    teal.slice coverage - 65.92%

    124 - 47x + 47x +
          filter_call <- Filter(
    125 - 47x + 47x +
            f = Negate(is.null),
    126 - 47x + 47x +
            x = lapply(private$get_filter_states(), function(x) x$get_call(sid))
    @@ -43639,14 +45308,16 @@

    teal.slice coverage - 65.92%

    128 - 47x + 47x +
          if (length(filter_call) == 0) {
    129 - 29x + 29x +
            return(NULL)
    @@ -43660,7 +45331,8 @@

    teal.slice coverage - 65.92%

    131 - 18x + 18x +
          filter_call
    @@ -43723,14 +45395,16 @@

    teal.slice coverage - 65.92%

    140 - 184x + 184x +
          states <- unname(lapply(private$get_filter_states(), function(x) x$get_filter_state()))
    141 - 184x + 184x +
          do.call(c, states)
    @@ -43856,7 +45530,8 @@

    teal.slice coverage - 65.92%

    159 - 16x + 16x +
          length(self$get_filter_state())
    @@ -43912,7 +45587,8 @@

    teal.slice coverage - 65.92%

    167 - 8x + 8x +
          private$dataname
    @@ -44003,14 +45679,16 @@

    teal.slice coverage - 65.92%

    180 - 51x + 51x +
          if (filtered) {
    181 - 33x + 33x +
            private$data_filtered
    @@ -44024,7 +45702,8 @@

    teal.slice coverage - 65.92%

    183 - 18x + 18x +
            private$dataset
    @@ -44129,7 +45808,8 @@

    teal.slice coverage - 65.92%

    198 - 133x + 133x +
          private$keys
    @@ -44178,7 +45858,8 @@

    teal.slice coverage - 65.92%

    205 - 2x + 2x +
          private$label
    @@ -44724,77 +46405,88 @@

    teal.slice coverage - 65.92%

    283 - 7x + 7x +
          moduleServer(
    284 - 7x + 7x +
            id = id,
    285 - 7x + 7x +
            function(input, output, session) {
    286 - 7x + 7x +
              dataname <- self$get_dataname()
    287 - 7x + 7x +
              logger::log_trace("FilteredDataset$srv_active initializing, dataname: { dataname }")
    288 - 7x + 7x +
              checkmate::assert_string(dataname)
    289 - 7x + 7x +
              output$filter_count <- renderText(
    290 - 7x + 7x +
                sprintf(
    291 - 7x + 7x +
                  "%d filter%s applied",
    292 - 7x + 7x +
                  self$get_filter_count(),
    293 - 7x + 7x +
                  if (self$get_filter_count() != 1) "s" else ""
    @@ -44822,28 +46514,32 @@

    teal.slice coverage - 65.92%

    297 - 7x + 7x +
              lapply(
    298 - 7x + 7x +
                names(private$get_filter_states()),
    299 - 7x + 7x +
                function(x) {
    300 - 12x + 12x +
                  private$get_filter_states()[[x]]$srv_active(id = x)
    @@ -44871,35 +46567,40 @@

    teal.slice coverage - 65.92%

    304 - 7x + 7x +
              observeEvent(self$get_filter_state(), {
    305 - 8x + 8x +
                shinyjs::hide("filter_count_ui")
    306 - 8x + 8x +
                shinyjs::show("filters")
    307 - 8x + 8x +
                shinyjs::toggle("remove_filters", condition = length(self$get_filter_state()) != 0)
    308 - 8x + 8x +
                shinyjs::toggle("collapse", condition = length(self$get_filter_state()) != 0)
    @@ -44920,7 +46621,8 @@

    teal.slice coverage - 65.92%

    311 - 7x + 7x +
              observeEvent(input$collapse, {
    @@ -44962,28 +46664,32 @@

    teal.slice coverage - 65.92%

    317 - 7x + 7x +
              observeEvent(input$remove_filters, {
    318 - 1x + 1x +
                logger::log_trace("FilteredDataset$srv_active@1 removing all non-anchored filters, dataname: { dataname }")
    319 - 1x + 1x +
                self$clear_filter_states()
    320 - 1x + 1x +
                logger::log_trace("FilteredDataset$srv_active@1 removed all non-anchored filters, dataname: { dataname }")
    @@ -45004,7 +46710,8 @@

    teal.slice coverage - 65.92%

    323 - 7x + 7x +
              logger::log_trace("FilteredDataset$initialized, dataname: { dataname }")
    @@ -45018,7 +46725,8 @@

    teal.slice coverage - 65.92%

    325 - 7x + 7x +
              NULL
    @@ -45109,7 +46817,8 @@

    teal.slice coverage - 65.92%

    338 - 1x + 1x +
          stop("Pure virtual method")
    @@ -45207,63 +46916,72 @@

    teal.slice coverage - 65.92%

    352 - 2x + 2x +
          moduleServer(
    353 - 2x + 2x +
            id = id,
    354 - 2x + 2x +
            function(input, output, session) {
    355 - 2x + 2x +
              logger::log_trace("MAEFilteredDataset$srv_add initializing, dataname: { deparse1(self$get_dataname()) }")
    356 - 2x + 2x +
              elems <- private$get_filter_states()
    357 - 2x + 2x +
              elem_names <- names(private$get_filter_states())
    358 - 2x + 2x +
              lapply(
    359 - 2x + 2x +
                elem_names,
    360 - 2x + 2x +
                function(elem_name) elems[[elem_name]]$srv_add(elem_name)
    @@ -45277,14 +46995,16 @@

    teal.slice coverage - 65.92%

    362 - 2x + 2x +
              logger::log_trace("MAEFilteredDataset$srv_add initialized, dataname: { deparse1(self$get_dataname()) }")
    363 - 2x + 2x +
              NULL
    @@ -45424,28 +47144,32 @@

    teal.slice coverage - 65.92%

    383 - 225x + 225x +
          checkmate::assert_class(filter_states, "FilterStates")
    384 - 225x + 225x +
          checkmate::assert_string(id)
    385 - 225x + 225x +
          x <- stats::setNames(list(filter_states), id)
    386 - 225x + 225x +
          private$filter_states <- c(private$get_filter_states(), x)
    @@ -45494,7 +47218,8 @@

    teal.slice coverage - 65.92%

    393 - 684x + 684x +
          private$filter_states
    @@ -45962,42 +47687,48 @@

    teal.slice coverage - 65.92%

    63 - 6x + 6x +
          isolate({
    64 - 6x + 6x +
            super$initialize(
    65 - 6x + 6x +
              x = x,
    66 - 6x + 6x +
              x_reactive = x_reactive,
    67 - 6x + 6x +
              slice = slice,
    68 - 6x + 6x +
              extract_type = extract_type
    @@ -46011,14 +47742,16 @@

    teal.slice coverage - 65.92%

    70 - 6x + 6x +
            private$set_choices(slice$choices)
    71 - 6x + 6x +
            private$set_selected(slice$selected)
    @@ -46039,7 +47772,8 @@

    teal.slice coverage - 65.92%

    74 - 6x + 6x +
          invisible(self)
    @@ -46109,14 +47843,16 @@

    teal.slice coverage - 65.92%

    84 - 2x + 2x +
          if (isFALSE(private$is_any_filtered())) {
    85 - 1x + 1x +
            return(NULL)
    @@ -46130,14 +47866,16 @@

    teal.slice coverage - 65.92%

    87 - 1x + 1x +
          if (missing(dataname)) dataname <- private$get_dataname()
    88 - 1x + 1x +
          filter_call <- if (isTRUE(private$get_keep_na())) {
    @@ -46158,7 +47896,8 @@

    teal.slice coverage - 65.92%

    91 - 1x + 1x +
            substitute(!is.na(varname), list(varname = private$get_varname_prefixed(dataname)))
    @@ -46270,14 +48009,16 @@

    teal.slice coverage - 65.92%

    107 - 6x + 6x +
          private$teal_slice$choices <- choices
    108 - 6x + 6x +
          invisible(NULL)
    @@ -46333,7 +48074,8 @@

    teal.slice coverage - 65.92%

    116 - 2x + 2x +
          if (private$is_choice_limited) {
    @@ -46354,7 +48096,8 @@

    teal.slice coverage - 65.92%

    119 - 2x + 2x +
            !isTRUE(private$get_keep_na())
    @@ -47256,42 +48999,48 @@

    teal.slice coverage - 65.92%

    75 - 25x + 25x +
      checkmate::assert_string(inputId)
    76 - 21x + 21x +
      checkmate::assert_vector(choices)
    77 - 20x + 20x +
      checkmate::assert_numeric(countsmax, len = length(choices))
    78 - 17x + 17x +
      checkmate::assert_numeric(countsnow, len = length(choices), null.ok = TRUE)
    79 - 15x + 15x +
      if (!is.null(countsnow)) {
    80 - 7x + 7x +
        checkmate::assert_true(all(countsnow <= countsmax))
    @@ -47312,7 +49061,8 @@

    teal.slice coverage - 65.92%

    83 - 14x + 14x +
      ns <- NS(inputId)
    @@ -47326,56 +49076,64 @@

    teal.slice coverage - 65.92%

    85 - 14x + 14x +
      mapply(
    86 - 14x + 14x +
        countBar,
    87 - 14x + 14x +
        inputId = ns(seq_along(choices)),
    88 - 14x + 14x +
        label = as.character(choices),
    89 - 14x + 14x +
        countmax = countsmax,
    90 - 14x + 14x +
        countnow = if (is.null(countsnow)) rep(list(NULL), length(choices)) else countsnow,
    91 - 14x + 14x +
        MoreArgs = list(
    92 - 14x + 14x +
          counttotal = sum(countsmax)
    @@ -47389,7 +49147,8 @@

    teal.slice coverage - 65.92%

    94 - 14x + 14x +
        SIMPLIFY = FALSE, USE.NAMES = FALSE
    @@ -47564,35 +49323,40 @@

    teal.slice coverage - 65.92%

    119 - 61x + 61x +
      checkmate::assert_string(inputId)
    120 - 57x + 57x +
      checkmate::assert_string(label)
    121 - 54x + 54x +
      checkmate::assert_number(countmax)
    122 - 51x + 51x +
      checkmate::assert_number(countnow, null.ok = TRUE, upper = countmax)
    123 - 49x + 49x +
      checkmate::assert_number(counttotal, lower = countmax)
    @@ -47606,35 +49370,40 @@

    teal.slice coverage - 65.92%

    125 - 47x + 47x +
      label <- make_count_text(label, countmax = countmax, countnow = countnow)
    126 - 47x + 47x +
      ns <- NS(inputId)
    127 - 24x + 24x +
      if (is.null(countnow)) countnow <- 0
    128 - 47x + 47x +
      tags$div(
    129 - 47x + 47x +
        class = "progress state-count-container",
    @@ -47648,42 +49417,48 @@

    teal.slice coverage - 65.92%

    131 - 47x + 47x +
        tags$div(
    132 - 47x + 47x +
          id = ns("count_bar_filtered"),
    133 - 47x + 47x +
          class = "progress-bar state-count-bar-filtered",
    134 - 47x + 47x +
          style = sprintf("width: %s%%", countnow / counttotal * 100),
    135 - 47x + 47x +
          role = "progressbar",
    136 - 47x + 47x +
          label
    @@ -47697,35 +49472,40 @@

    teal.slice coverage - 65.92%

    138 - 47x + 47x +
        tags$div(
    139 - 47x + 47x +
          id = ns("count_bar_unfiltered"),
    140 - 47x + 47x +
          class = "progress-bar state-count-bar-unfiltered",
    141 - 47x + 47x +
          style = sprintf("width: %s%%", (countmax - countnow) / counttotal * 100),
    142 - 47x + 47x +
          role = "progressbar"
    @@ -47774,28 +49554,32 @@

    teal.slice coverage - 65.92%

    149 - 7x + 7x +
      checkmate::assert_string(inputId)
    150 - 7x + 7x +
      checkmate::assert_vector(choices)
    151 - 7x + 7x +
      checkmate::assert_numeric(countsmax, len = length(choices))
    152 - 7x + 7x +
      checkmate::assert_numeric(countsnow, len = length(choices), null.ok = TRUE)
    @@ -47809,63 +49593,72 @@

    teal.slice coverage - 65.92%

    154 - 7x + 7x +
      ns <- NS(inputId)
    155 - 7x + 7x +
      mapply(
    156 - 7x + 7x +
        updateCountBar,
    157 - 7x + 7x +
        inputId = ns(seq_along(choices)),
    158 - 7x + 7x +
        label = choices,
    159 - 7x + 7x +
        countmax = countsmax,
    160 - 7x + 7x +
        countnow = if (is.null(countsnow)) rep(list(NULL), length(choices)) else countsnow,
    161 - 7x + 7x +
        MoreArgs = list(
    162 - 7x + 7x +
          counttotal = sum(countsmax)
    @@ -47886,7 +49679,8 @@

    teal.slice coverage - 65.92%

    165 - 6x + 6x +
      invisible(NULL)
    @@ -47921,35 +49715,40 @@

    teal.slice coverage - 65.92%

    170 - 17x + 17x +
      checkmate::assert_string(inputId)
    171 - 17x + 17x +
      checkmate::assert_string(label)
    172 - 17x + 17x +
      checkmate::assert_number(countmax)
    173 - 16x + 16x +
      checkmate::assert_number(countnow, null.ok = TRUE)
    174 - 16x + 16x +
      checkmate::assert_number(counttotal)
    @@ -47963,70 +49762,80 @@

    teal.slice coverage - 65.92%

    176 - 16x + 16x +
      label <- make_count_text(label, countmax = countmax, countnow = countnow)
    177 - 16x + 16x +
      if (is.null(countnow)) countnow <- countmax
    178 - 16x + 16x +
      session$sendCustomMessage(
    179 - 16x + 16x +
        type = "updateCountBar",
    180 - 16x + 16x +
        message = list(
    181 - 16x + 16x +
          id = session$ns(inputId),
    182 - 16x + 16x +
          label = label,
    183 - 16x + 16x +
          countmax = countmax,
    184 - 16x + 16x +
          countnow = countnow,
    185 - 16x + 16x +
          counttotal = counttotal
    @@ -48054,7 +49863,8 @@

    teal.slice coverage - 65.92%

    189 - 16x + 16x +
      invisible(NULL)
    @@ -48089,70 +49899,80 @@

    teal.slice coverage - 65.92%

    194 - 17x + 17x +
      checkmate::assert_string(inputId)
    195 - 17x + 17x +
      checkmate::assert_string(label)
    196 - 17x + 17x +
      checkmate::assert_number(countmax)
    197 - 17x + 17x +
      checkmate::assert_number(countnow, null.ok = TRUE)
    198 - 17x + 17x +
      label <- make_count_text(label, countmax = countmax, countnow = countnow)
    199 - 17x + 17x +
      session$sendCustomMessage(
    200 - 17x + 17x +
        type = "updateCountText",
    201 - 17x + 17x +
        message = list(
    202 - 17x + 17x +
          id = session$ns(inputId),
    203 - 17x + 17x +
          label = label
    @@ -48292,56 +50112,64 @@

    teal.slice coverage - 65.92%

    223 - 92x + 92x +
      checkmate::assert_string(label)
    224 - 90x + 90x +
      checkmate::assert_number(countmax)
    225 - 88x + 88x +
      checkmate::assert_number(countnow, null.ok = TRUE)
    226 - 86x + 86x +
      sprintf(
    227 - 86x + 86x +
        "%s (%s%s)",
    228 - 86x + 86x +
        label,
    229 - 86x + 86x +
        if (is.null(countnow)) "" else sprintf("%s/", countnow),
    230 - 86x + 86x +
        countmax
    @@ -48648,7 +50476,8 @@

    teal.slice coverage - 65.92%

    41 - 24x + 24x +
          super$initialize(dataset = dataset, dataname = dataname, label = label)
    @@ -48732,35 +50561,40 @@

    teal.slice coverage - 65.92%

    53 - 4x + 4x +
          class_string <- toString(class(private$dataset))
    54 - 4x + 4x +
          if (trim_lines) {
    55 - 2x + 2x +
            trim_position <- 37L
    56 - 2x + 2x +
            class_string <- strtrim(class_string, trim_position)
    57 - 2x + 2x +
            substr(class_string, 35L, 37L) <- "..."
    @@ -48774,7 +50608,8 @@

    teal.slice coverage - 65.92%

    59 - 4x + 4x +
          sprintf(" - unfiltered dataset:\t\"%s\":   %s", private$dataname, class_string)
    @@ -48816,7 +50651,8 @@

    teal.slice coverage - 65.92%

    65 - 1x + 1x +
          invisible(NULL)
    @@ -48844,7 +50680,8 @@

    teal.slice coverage - 65.92%

    69 - 2x + 2x +
          invisible(NULL)
    @@ -48879,14 +50716,16 @@

    teal.slice coverage - 65.92%

    74 - 3x + 3x +
          if (length(state) != 0L) {
    75 - 1x + 1x +
            warning("DefaultFilterState cannot set state")
    @@ -48900,7 +50739,8 @@

    teal.slice coverage - 65.92%

    77 - 3x + 3x +
          invisible(NULL)
    @@ -48935,7 +50775,8 @@

    teal.slice coverage - 65.92%

    82 - 1x + 1x +
          invisible(NULL)
    @@ -48991,7 +50832,8 @@

    teal.slice coverage - 65.92%

    90 - 1x + 1x +
          data.frame(dataname = private$dataname, obs = NA, obs_filtered = NA)
    @@ -49676,7 +51518,8 @@

    teal.slice coverage - 65.92%

    64 - 229x + 229x +
      UseMethod("init_filter_states")
    @@ -49753,42 +51596,48 @@

    teal.slice coverage - 65.92%

    75 - 100x + 100x +
      DFFilterStates$new(
    76 - 100x + 100x +
        data = data,
    77 - 100x + 100x +
        data_reactive = data_reactive,
    78 - 100x + 100x +
        dataname = dataname,
    79 - 100x + 100x +
        datalabel = datalabel,
    80 - 100x + 100x +
        keys = keys
    @@ -49865,35 +51714,40 @@

    teal.slice coverage - 65.92%

    91 - 22x + 22x +
      MatrixFilterStates$new(
    92 - 22x + 22x +
        data = data,
    93 - 22x + 22x +
        data_reactive = data_reactive,
    94 - 22x + 22x +
        dataname = dataname,
    95 - 22x + 22x +
        datalabel = datalabel
    @@ -49977,7 +51831,8 @@

    teal.slice coverage - 65.92%

    107 - 22x + 22x +
      if (!requireNamespace("MultiAssayExperiment", quietly = TRUE)) {
    @@ -49998,42 +51853,48 @@

    teal.slice coverage - 65.92%

    110 - 22x + 22x +
      MAEFilterStates$new(
    111 - 22x + 22x +
        data = data,
    112 - 22x + 22x +
        data_reactive = data_reactive,
    113 - 22x + 22x +
        dataname = dataname,
    114 - 22x + 22x +
        datalabel = datalabel,
    115 - 22x + 22x +
        keys = keys
    @@ -50110,7 +51971,8 @@

    teal.slice coverage - 65.92%

    126 - 85x + 85x +
      if (!requireNamespace("SummarizedExperiment", quietly = TRUE)) {
    @@ -50131,35 +51993,40 @@

    teal.slice coverage - 65.92%

    129 - 85x + 85x +
      SEFilterStates$new(
    130 - 85x + 85x +
        data = data,
    131 - 85x + 85x +
        data_reactive = data_reactive,
    132 - 85x + 85x +
        dataname = dataname,
    133 - 85x + 85x +
        datalabel = datalabel
    @@ -50341,7 +52208,8 @@

    teal.slice coverage - 65.92%

    159 - 227x + 227x +
      UseMethod("get_supported_filter_varnames")
    @@ -50383,28 +52251,32 @@

    teal.slice coverage - 65.92%

    165 - 198x + 198x +
      is_expected_class <- vapply(
    166 - 198x + 198x +
        X = data,
    167 - 198x + 198x +
        FUN = function(x) any(class(x) %in% .filterable_class),
    168 - 198x + 198x +
        FUN.VALUE = logical(1)
    @@ -50418,7 +52290,8 @@

    teal.slice coverage - 65.92%

    170 - 198x + 198x +
      names(is_expected_class[is_expected_class])
    @@ -50467,21 +52340,24 @@

    teal.slice coverage - 65.92%

    177 - 29x + 29x +
      is_expected_class <- class(data[, 1]) %in% .filterable_class
    178 - 29x + 29x +
      if (is_expected_class && !is.null(colnames(data))) {
    179 - 26x + 26x +
        colnames(data)
    @@ -50495,7 +52371,8 @@

    teal.slice coverage - 65.92%

    181 - 3x + 3x +
        character(0)
    @@ -50733,7 +52610,8 @@

    teal.slice coverage - 65.92%

    215 - 9x + 9x +
      if (length(choices) == 0) {
    @@ -50754,14 +52632,16 @@

    teal.slice coverage - 65.92%

    218 - 9x + 9x +
      choice_types <- variable_types(data = data, columns = choices)
    219 - 9x + 9x +
      choice_types[keys] <- "primary_key"
    @@ -50775,28 +52655,32 @@

    teal.slice coverage - 65.92%

    221 - 9x + 9x +
      choices_labeled(
    222 - 9x + 9x +
        choices = choices,
    223 - 9x + 9x +
        labels = unname(varlabels[choices]),
    224 - 9x + 9x +
        types = choice_types[choices]
    @@ -50845,49 +52729,56 @@

    teal.slice coverage - 65.92%

    231 - 9x + 9x +
      if (!is.array(data)) {
    232 - 9x + 9x +
        vapply(
    233 - 9x + 9x +
          colnames(data),
    234 - 9x + 9x +
          FUN = function(x) {
    235 - 42x + 42x +
            label <- attr(data[[x]], "label")
    236 - 42x + 42x +
            if (is.null(label)) {
    237 - 40x + 40x +
              x
    @@ -50901,7 +52792,8 @@

    teal.slice coverage - 65.92%

    239 - 2x + 2x +
              label
    @@ -50922,7 +52814,8 @@

    teal.slice coverage - 65.92%

    242 - 9x + 9x +
          FUN.VALUE = character(1)
    @@ -51131,7 +53024,8 @@

    teal.slice coverage - 65.92%

    24 - 9x + 9x +
      if (is.factor(choices)) {
    @@ -51159,35 +53053,40 @@

    teal.slice coverage - 65.92%

    28 - 9x + 9x +
      stopifnot(
    29 - 9x + 9x +
        is.character(choices) ||
    30 - 9x + 9x +
          is.numeric(choices) ||
    31 - 9x + 9x +
          is.logical(choices) ||
    32 - 9x + 9x +
          (length(choices) == 1 && is.na(choices))
    @@ -51208,7 +53107,8 @@

    teal.slice coverage - 65.92%

    35 - 9x + 9x +
      if (is.factor(labels)) {
    @@ -51236,14 +53136,16 @@

    teal.slice coverage - 65.92%

    39 - 9x + 9x +
      checkmate::assert_character(labels[!is.na(labels)], any.missing = FALSE)
    40 - 9x + 9x +
      if (length(choices) != length(labels)) {
    @@ -51264,14 +53166,16 @@

    teal.slice coverage - 65.92%

    43 - 9x + 9x +
      stopifnot(is.null(subset) || is.vector(subset))
    44 - 9x + 9x +
      stopifnot(is.null(types) || is.vector(types))
    @@ -51285,14 +53189,16 @@

    teal.slice coverage - 65.92%

    46 - 9x + 9x +
      if (is.vector(types)) {
    47 - 9x + 9x +
        stopifnot(length(choices) == length(types))
    @@ -51313,7 +53219,8 @@

    teal.slice coverage - 65.92%

    50 - 9x + 9x +
      if (!is.null(subset)) {
    @@ -51376,56 +53283,64 @@

    teal.slice coverage - 65.92%

    59 - 9x + 9x +
      is_dupl <- duplicated(choices)
    60 - 9x + 9x +
      choices <- choices[!is_dupl]
    61 - 9x + 9x +
      labels <- labels[!is_dupl]
    62 - 9x + 9x +
      types <- types[!is_dupl]
    63 - 9x + 9x +
      labels[is.na(labels)] <- "Label Missing"
    64 - 9x + 9x +
      raw_labels <- labels
    65 - 9x + 9x +
      combined_labels <- if (length(choices) > 0) {
    66 - 9x + 9x +
        paste0(choices, ": ", labels)
    @@ -51460,7 +53375,8 @@

    teal.slice coverage - 65.92%

    71 - 9x + 9x +
      if (!is.null(subset)) {
    @@ -51509,49 +53425,56 @@

    teal.slice coverage - 65.92%

    78 - 9x + 9x +
      choices <- structure(
    79 - 9x + 9x +
        choices,
    80 - 9x + 9x +
        names = combined_labels,
    81 - 9x + 9x +
        raw_labels = raw_labels,
    82 - 9x + 9x +
        combined_labels = combined_labels,
    83 - 9x + 9x +
        class = c("choices_labeled", "character"),
    84 - 9x + 9x +
        types = types
    @@ -51572,7 +53495,8 @@

    teal.slice coverage - 65.92%

    87 - 9x + 9x +
      choices
    @@ -52600,21 +54524,24 @@

    teal.slice coverage - 65.92%

    145 - 24x + 24x +
          isolate({
    146 - 24x + 24x +
            checkmate::assert_date(x)
    147 - 23x + 23x +
            checkmate::assert_class(x_reactive, "reactive")
    @@ -52628,35 +54555,40 @@

    teal.slice coverage - 65.92%

    149 - 23x + 23x +
            super$initialize(
    150 - 23x + 23x +
              x = x,
    151 - 23x + 23x +
              x_reactive = x_reactive,
    152 - 23x + 23x +
              slice = slice,
    153 - 23x + 23x +
              extract_type = extract_type
    @@ -52670,28 +54602,32 @@

    teal.slice coverage - 65.92%

    155 - 23x + 23x +
            checkmate::assert_date(slice$choices, null.ok = TRUE)
    156 - 22x + 22x +
            private$set_choices(slice$choices)
    157 - 14x + 14x +
            if (is.null(slice$selected)) slice$selected <- slice$choices
    158 - 22x + 22x +
            private$set_selected(slice$selected)
    @@ -52712,7 +54648,8 @@

    teal.slice coverage - 65.92%

    161 - 21x + 21x +
          invisible(self)
    @@ -52789,14 +54726,16 @@

    teal.slice coverage - 65.92%

    172 - 7x + 7x +
          if (isFALSE(private$is_any_filtered())) {
    173 - 1x + 1x +
            return(NULL)
    @@ -52810,28 +54749,32 @@

    teal.slice coverage - 65.92%

    175 - 6x + 6x +
          choices <- as.character(private$get_selected())
    176 - 6x + 6x +
          varname <- private$get_varname_prefixed(dataname)
    177 - 6x + 6x +
          filter_call <-
    178 - 6x + 6x +
            call(
    @@ -52845,14 +54788,16 @@

    teal.slice coverage - 65.92%

    180 - 6x + 6x +
              call(">=", varname, call("as.Date", choices[1L])),
    181 - 6x + 6x +
              call("<=", varname, call("as.Date", choices[2L]))
    @@ -52866,7 +54811,8 @@

    teal.slice coverage - 65.92%

    183 - 6x + 6x +
          private$add_keep_na_call(filter_call, varname)
    @@ -52922,14 +54868,16 @@

    teal.slice coverage - 65.92%

    191 - 22x + 22x +
          if (is.null(choices)) {
    192 - 19x + 19x +
            choices <- range(private$x, na.rm = TRUE)
    @@ -52943,21 +54891,24 @@

    teal.slice coverage - 65.92%

    194 - 3x + 3x +
            choices_adjusted <- c(
    195 - 3x + 3x +
              max(choices[1L], min(private$x, na.rm = TRUE)),
    196 - 3x + 3x +
              min(choices[2L], max(private$x, na.rm = TRUE))
    @@ -52971,28 +54922,32 @@

    teal.slice coverage - 65.92%

    198 - 3x + 3x +
            if (any(choices != choices_adjusted)) {
    199 - 1x + 1x +
              warning(sprintf(
    200 - 1x + 1x +
                "Choices adjusted (some values outside of variable range). Varname: %s, dataname: %s.",
    201 - 1x + 1x +
                private$get_varname(), private$get_dataname()
    @@ -53006,7 +54961,8 @@

    teal.slice coverage - 65.92%

    203 - 1x + 1x +
              choices <- choices_adjusted
    @@ -53020,35 +54976,40 @@

    teal.slice coverage - 65.92%

    205 - 3x + 3x +
            if (choices[1L] >= choices[2L]) {
    206 - 1x + 1x +
              warning(sprintf(
    207 - 1x + 1x +
                "Invalid choices: lower is higher / equal to upper, or not in range of variable values.
    208 - 1x + 1x +
                Setting defaults. Varname: %s, dataname: %s.",
    209 - 1x + 1x +
                private$get_varname(), private$get_dataname()
    @@ -53062,7 +55023,8 @@

    teal.slice coverage - 65.92%

    211 - 1x + 1x +
              choices <- range(private$x, na.rm = TRUE)
    @@ -53083,28 +55045,32 @@

    teal.slice coverage - 65.92%

    214 - 22x + 22x +
          private$set_is_choice_limited(private$x, choices)
    215 - 22x + 22x +
          private$x <- private$x[(private$x >= choices[1L] & private$x <= choices[2L]) | is.na(private$x)]
    216 - 22x + 22x +
          private$teal_slice$choices <- choices
    217 - 22x + 22x +
          invisible(NULL)
    @@ -53146,14 +55112,16 @@

    teal.slice coverage - 65.92%

    223 - 22x + 22x +
          private$is_choice_limited <- (any(xl < choices[1L], na.rm = TRUE) | any(xl > choices[2L], na.rm = TRUE))
    224 - 22x + 22x +
          invisible(NULL)
    @@ -53174,21 +55142,24 @@

    teal.slice coverage - 65.92%

    227 - 33x + 33x +
          tryCatch(
    228 - 33x + 33x +
            expr = {
    229 - 33x + 33x +
              values <- as.Date(values, origin = "1970-01-01")
    @@ -53202,7 +55173,8 @@

    teal.slice coverage - 65.92%

    231 - 30x + 30x +
              values
    @@ -53216,7 +55188,8 @@

    teal.slice coverage - 65.92%

    233 - 33x + 33x +
            error = function(e) stop("Vector of set values must contain values coercible to Date.")
    @@ -53244,42 +55217,48 @@

    teal.slice coverage - 65.92%

    237 - 1x + 1x +
          if (length(values) != 2) stop("Vector of set values must have length two.")
    238 - 29x + 29x +
          if (values[1] > values[2]) {
    239 - 1x + 1x +
            warning(
    240 - 1x + 1x +
              sprintf(
    241 - 1x + 1x +
                "Start date %s is set after the end date %s, the values will be replaced with a default date range.",
    242 - 1x + 1x +
                values[1], values[2]
    @@ -53300,7 +55279,8 @@

    teal.slice coverage - 65.92%

    245 - 1x + 1x +
            values <- isolate(private$get_choices())
    @@ -53314,7 +55294,8 @@

    teal.slice coverage - 65.92%

    247 - 29x + 29x +
          values
    @@ -53335,42 +55316,48 @@

    teal.slice coverage - 65.92%

    250 - 29x + 29x +
          choices <- private$get_choices()
    251 - 29x + 29x +
          if (values[1] < choices[1L] | values[1] > choices[2L]) {
    252 - 5x + 5x +
            warning(
    253 - 5x + 5x +
              sprintf(
    254 - 5x + 5x +
                "Value: %s is outside of the possible range for column %s of dataset %s, setting minimum possible value.",
    255 - 5x + 5x +
                values[1], private$get_varname(), private$get_dataname()
    @@ -53391,7 +55378,8 @@

    teal.slice coverage - 65.92%

    258 - 5x + 5x +
            values[1] <- choices[1L]
    @@ -53412,35 +55400,40 @@

    teal.slice coverage - 65.92%

    261 - 29x + 29x +
          if (values[2] > choices[2L] | values[2] < choices[1L]) {
    262 - 5x + 5x +
            warning(
    263 - 5x + 5x +
              sprintf(
    264 - 5x + 5x +
                "Value: %s is outside of the possible range for column %s of dataset %s, setting maximum possible value.",
    265 - 5x + 5x +
                values[2], private$get_varname(), private$get_dataname()
    @@ -53461,7 +55454,8 @@

    teal.slice coverage - 65.92%

    268 - 5x + 5x +
            values[2] <- choices[2L]
    @@ -53482,7 +55476,8 @@

    teal.slice coverage - 65.92%

    271 - 29x + 29x +
          values
    @@ -55595,28 +57590,32 @@

    teal.slice coverage - 65.92%

    130 - 16x + 16x +
          isolate({
    131 - 16x + 16x +
            checkmate::assert_logical(x)
    132 - 15x + 15x +
            checkmate::assert_logical(slice$selected, null.ok = TRUE)
    133 - 14x + 14x +
            super$initialize(x = x, x_reactive = x_reactive, slice = slice, extract_type = extract_type)
    @@ -55630,7 +57629,8 @@

    teal.slice coverage - 65.92%

    135 - 14x + 14x +
            private$set_choices(slice$choices)
    @@ -55644,28 +57644,32 @@

    teal.slice coverage - 65.92%

    137 - 14x + 14x +
            if (is.null(slice$selected) && slice$multiple) {
    138 - 7x + 7x +
              slice$selected <- private$get_choices()
    139 - 7x + 7x +
            } else if (length(slice$selected) != 1 && !slice$multiple) {
    140 - 3x + 3x +
              slice$selected <- TRUE
    @@ -55679,28 +57683,32 @@

    teal.slice coverage - 65.92%

    142 - 14x + 14x +
            private$set_selected(slice$selected)
    143 - 14x + 14x +
            df <- factor(x, levels = c(TRUE, FALSE))
    144 - 14x + 14x +
            tbl <- table(df)
    145 - 14x + 14x +
            private$set_choices_counts(tbl)
    @@ -55714,7 +57722,8 @@

    teal.slice coverage - 65.92%

    147 - 14x + 14x +
          invisible(self)
    @@ -55784,7 +57793,8 @@

    teal.slice coverage - 65.92%

    157 - 6x + 6x +
          if (isFALSE(private$is_any_filtered())) {
    @@ -55805,28 +57815,32 @@

    teal.slice coverage - 65.92%

    160 - 4x + 4x +
          if (missing(dataname)) dataname <- private$get_dataname()
    161 - 6x + 6x +
          varname <- private$get_varname_prefixed(dataname)
    162 - 6x + 6x +
          choices <- private$get_selected()
    163 - 6x + 6x +
          n_choices <- length(choices)
    @@ -55840,35 +57854,40 @@

    teal.slice coverage - 65.92%

    165 - 6x + 6x +
          filter_call <-
    166 - 6x + 6x +
            if (n_choices == 1 && choices) {
    167 - 1x + 1x +
              varname
    168 - 6x + 6x +
            } else if (n_choices == 1 && !choices) {
    169 - 4x + 4x +
              call("!", varname)
    @@ -55882,7 +57901,8 @@

    teal.slice coverage - 65.92%

    171 - 1x + 1x +
              call("%in%", varname, make_c_call(choices))
    @@ -55896,7 +57916,8 @@

    teal.slice coverage - 65.92%

    173 - 6x + 6x +
          private$add_keep_na_call(filter_call, varname)
    @@ -55966,14 +57987,16 @@

    teal.slice coverage - 65.92%

    183 - 14x + 14x +
          private$teal_slice$choices <- c(TRUE, FALSE)
    184 - 14x + 14x +
          invisible(NULL)
    @@ -56008,14 +58031,16 @@

    teal.slice coverage - 65.92%

    189 - 14x + 14x +
          private$choices_counts <- choices_counts
    190 - 14x + 14x +
          invisible(NULL)
    @@ -56036,35 +58061,40 @@

    teal.slice coverage - 65.92%

    193 - 21x + 21x +
          tryCatch(
    194 - 21x + 21x +
            expr = {
    195 - 21x + 21x +
              values <- as.logical(values)
    196 - 1x + 1x +
              if (anyNA(values)) stop()
    197 - 20x + 20x +
              values
    @@ -56078,7 +58108,8 @@

    teal.slice coverage - 65.92%

    199 - 21x + 21x +
            error = function(e) stop("Vector of set values must contain values coercible to logical.")
    @@ -56113,28 +58144,32 @@

    teal.slice coverage - 65.92%

    204 - 20x + 20x +
          if (!private$is_multiple() && length(values) > 1) {
    205 - 1x + 1x +
            warning(
    206 - 1x + 1x +
              sprintf("Selection: %s is not a vector of length one. ", toString(values, width = 360)),
    207 - 1x + 1x +
              "Maintaining previous selection."
    @@ -56148,7 +58183,8 @@

    teal.slice coverage - 65.92%

    209 - 1x + 1x +
            values <- isolate(private$get_selected())
    @@ -56162,7 +58198,8 @@

    teal.slice coverage - 65.92%

    211 - 20x + 20x +
          values
    @@ -56204,7 +58241,8 @@

    teal.slice coverage - 65.92%

    217 - 6x + 6x +
          if (private$is_choice_limited) {
    @@ -56218,14 +58256,16 @@

    teal.slice coverage - 65.92%

    219 - 6x + 6x +
          } else if (all(private$choices_counts > 0)) {
    220 - 6x + 6x +
            TRUE
    @@ -58219,49 +60259,56 @@

    teal.slice coverage - 65.92%

    95 - 764x + 764x +
      slices <- list(...)
    96 - 764x + 764x +
      checkmate::assert_list(slices, types = "teal_slice", any.missing = FALSE)
    97 - 763x + 763x +
      slices_id <- isolate(vapply(slices, `[[`, character(1L), "id"))
    98 - 763x + 763x +
      if (any(duplicated(slices_id))) {
    99 - 1x + 1x +
        stop(
    100 - 1x + 1x +
          "Some teal_slice objects have the same id:\n",
    101 - 1x + 1x +
          toString(unique(slices_id[duplicated(slices_id)]))
    @@ -58282,35 +60329,40 @@

    teal.slice coverage - 65.92%

    104 - 762x + 762x +
      checkmate::assert_list(exclude_varnames, names = "named", types = "character", null.ok = TRUE, min.len = 1)
    105 - 761x + 761x +
      checkmate::assert_list(include_varnames, names = "named", types = "character", null.ok = TRUE, min.len = 1)
    106 - 760x + 760x +
      checkmate::assert_character(count_type, len = 1, null.ok = TRUE)
    107 - 758x + 758x +
      checkmate::assert_subset(count_type, choices = c("all", "none"), empty.ok = TRUE)
    108 - 757x + 757x +
      checkmate::assert_logical(allow_add)
    @@ -58324,35 +60376,40 @@

    teal.slice coverage - 65.92%

    110 - 756x + 756x +
      duplicated_datasets <- intersect(names(include_varnames), names(exclude_varnames))
    111 - 756x + 756x +
      if (length(duplicated_datasets)) {
    112 - 1x + 1x +
        stop(
    113 - 1x + 1x +
          "Some datasets are specified in both, include_varnames and exclude_varnames:\n",
    114 - 1x + 1x +
          toString(duplicated_datasets)
    @@ -58380,49 +60437,56 @@

    teal.slice coverage - 65.92%

    118 - 755x + 755x +
      structure(
    119 - 755x + 755x +
        slices,
    120 - 755x + 755x +
        exclude_varnames = exclude_varnames,
    121 - 755x + 755x +
        include_varnames = include_varnames,
    122 - 755x + 755x +
        count_type = count_type,
    123 - 755x + 755x +
        allow_add = allow_add,
    124 - 755x + 755x +
        class = c("teal_slices", class(slices))
    @@ -58555,7 +60619,8 @@

    teal.slice coverage - 65.92%

    143 - 465x + 465x +
      inherits(x, "teal_slices")
    @@ -58695,21 +60760,24 @@

    teal.slice coverage - 65.92%

    163 - 1077x + 1077x +
      ans <- unclass(x)
    164 - 45x + 45x +
      if (recursive) ans[] <- lapply(ans, as.list)
    165 - 1077x + 1077x +
      ans
    @@ -58765,21 +60833,24 @@

    teal.slice coverage - 65.92%

    173 - 3x + 3x +
      if (missing(i)) i <- seq_along(x)
    174 - 506x + 506x +
      if (length(i) == 0L) {
    175 - 178x + 178x +
        return(x[0])
    @@ -58793,35 +60864,40 @@

    teal.slice coverage - 65.92%

    177 - 1x + 1x +
      if (is.logical(i) && length(i) > length(x)) stop("subscript out of bounds")
    178 - 1x + 1x +
      if (is.numeric(i) && max(i) > length(x)) stop("subscript out of bounds")
    179 - 326x + 326x +
      if (is.character(i)) {
    180 - 1x + 1x +
        if (!all(is.element(i, names(x)))) stop("subscript out of bounds")
    181 - 2x + 2x +
        i <- which(is.element(i, names(x)))
    @@ -58842,35 +60918,40 @@

    teal.slice coverage - 65.92%

    184 - 325x + 325x +
      y <- NextMethod("[")
    185 - 325x + 325x +
      attrs <- attributes(x)
    186 - 325x + 325x +
      attrs$names <- attrs$names[i]
    187 - 325x + 325x +
      attributes(y) <- attrs
    188 - 325x + 325x +
      y
    @@ -58926,14 +61007,16 @@

    teal.slice coverage - 65.92%

    196 - 252x + 252x +
      x <- list(...)
    197 - 252x + 252x +
      checkmate::assert_true(all(vapply(x, is.teal_slices, logical(1L))), .var.name = "all arguments are teal_slices")
    @@ -58947,21 +61030,24 @@

    teal.slice coverage - 65.92%

    199 - 251x + 251x +
      all_attributes <- lapply(x, attributes)
    200 - 251x + 251x +
      all_attributes <- coalesce_r(all_attributes)
    201 - 251x + 251x +
      all_attributes <- all_attributes[names(all_attributes) != "class"]
    @@ -58975,35 +61061,40 @@

    teal.slice coverage - 65.92%

    203 - 251x + 251x +
      do.call(
    204 - 251x + 251x +
        teal_slices,
    205 - 251x + 251x +
        c(
    206 - 251x + 251x +
          unique(unlist(x, recursive = FALSE)),
    207 - 251x + 251x +
          all_attributes
    @@ -59087,14 +61178,16 @@

    teal.slice coverage - 65.92%

    219 - 45x + 45x +
      checkmate::assert_flag(show_all)
    220 - 45x + 45x +
      checkmate::assert_flag(trim_lines)
    @@ -59108,35 +61201,40 @@

    teal.slice coverage - 65.92%

    222 - 45x + 45x +
      x <- as.list(x, recursive = TRUE)
    223 - 45x + 45x +
      attrs <- attributes(x)
    224 - 45x + 45x +
      attributes(x) <- NULL
    225 - 45x + 45x +
      slices_list <- list(slices = x, attributes = attrs)
    226 - 45x + 45x +
      slices_list <- Filter(Negate(is.null), slices_list) # drop attributes if empty
    @@ -59150,7 +61248,8 @@

    teal.slice coverage - 65.92%

    228 - 20x + 20x +
      if (!show_all) slices_list$slices <- lapply(slices_list$slices, function(slice) Filter(Negate(is.null), slice))
    @@ -59164,7 +61263,8 @@

    teal.slice coverage - 65.92%

    230 - 45x + 45x +
      jsonify(slices_list, trim_lines)
    @@ -59213,7 +61313,8 @@

    teal.slice coverage - 65.92%

    237 - 2x + 2x +
      cat(format(x, ...), "\n")
    @@ -59297,21 +61398,24 @@

    teal.slice coverage - 65.92%

    249 - 14x + 14x +
      Filter(
    250 - 14x + 14x +
        function(xx) {
    251 - 12x + 12x +
          !any(vapply(y, function(yy) identical(yy, xx), logical(1)))
    @@ -59325,7 +61429,8 @@

    teal.slice coverage - 65.92%

    253 - 14x + 14x +
        x
    @@ -59472,28 +61577,32 @@

    teal.slice coverage - 65.92%

    274 - 1569x + 1569x +
      checkmate::assert_list(x)
    275 - 1568x + 1568x +
      xnn <- Filter(Negate(is.null), x)
    276 - 1568x + 1568x +
      if (all(vapply(xnn, is.atomic, logical(1L)))) {
    277 - 1059x + 1059x +
        return(xnn[[1L]])
    @@ -59507,21 +61616,24 @@

    teal.slice coverage - 65.92%

    279 - 509x + 509x +
      lapply(x, checkmate::assert_list, names = "named", null.ok = TRUE, .var.name = "list element")
    280 - 508x + 508x +
      all_names <- unique(unlist(lapply(x, names)))
    281 - 508x + 508x +
      sapply(all_names, function(nm) coalesce_r(lapply(x, `[[`, nm)), simplify = FALSE)
    @@ -59660,21 +61772,24 @@

    teal.slice coverage - 65.92%

    18 - 7x + 7x +
      checkmate::assert_list(x, any.missing = FALSE, names = "unique")
    19 - 6x + 6x +
      checkmate::assert_class(join_keys, "join_keys")
    20 - 5x + 5x +
      if (!missing(code)) {
    @@ -59716,7 +61831,8 @@

    teal.slice coverage - 65.92%

    26 - 5x + 5x +
      if (!missing(check)) {
    @@ -59758,7 +61874,8 @@

    teal.slice coverage - 65.92%

    32 - 5x + 5x +
      FilteredData$new(x, join_keys = join_keys)
    @@ -59856,42 +61973,48 @@

    teal.slice coverage - 65.92%

    46 - 32x + 32x +
      lapply(
    47 - 32x + 32x +
        expr,
    48 - 32x + 32x +
        function(x) {
    49 - 19x + 19x +
          tryCatch(
    50 - 19x + 19x +
            eval(x, envir = env),
    51 - 19x + 19x +
            error = function(e) {
    @@ -59968,7 +62091,8 @@

    teal.slice coverage - 65.92%

    62 - 32x + 32x +
      invisible(NULL)
    @@ -60528,21 +62652,24 @@

    teal.slice coverage - 65.92%

    142 - 3x + 3x +
      checkmate::assert_string(input_id)
    143 - 3x + 3x +
      checkmate::assert_character(icons, len = 2L)
    144 - 3x + 3x +
      checkmate::assert_flag(one_way)
    @@ -60556,35 +62683,40 @@

    teal.slice coverage - 65.92%

    146 - 3x + 3x +
      expr <-
    147 - 3x + 3x +
        if (one_way) {
    148 - 3x + 3x +
          sprintf(
    149 - 3x + 3x +
            "$('#%s i').removeClass('%s').addClass('%s');",
    150 - 3x + 3x +
            input_id, icons[1], icons[2]
    @@ -60626,7 +62758,8 @@

    teal.slice coverage - 65.92%

    156 - 3x + 3x +
      shinyjs::runjs(expr)
    @@ -60640,7 +62773,8 @@

    teal.slice coverage - 65.92%

    158 - 3x + 3x +
      invisible(NULL)
    @@ -60682,21 +62816,24 @@

    teal.slice coverage - 65.92%

    164 - 3x + 3x +
      checkmate::assert_string(input_id)
    165 - 3x + 3x +
      checkmate::assert_character(titles, len = 2L)
    166 - 3x + 3x +
      checkmate::assert_flag(one_way)
    @@ -60710,35 +62847,40 @@

    teal.slice coverage - 65.92%

    168 - 3x + 3x +
      expr <-
    169 - 3x + 3x +
        if (one_way) {
    170 - 3x + 3x +
          sprintf(
    171 - 3x + 3x +
            "$('a#%s').attr('title', '%s');",
    172 - 3x + 3x +
            input_id, titles[2]
    @@ -60843,7 +62985,8 @@

    teal.slice coverage - 65.92%

    187 - 3x + 3x +
      shinyjs::runjs(expr)
    @@ -60857,7 +63000,8 @@

    teal.slice coverage - 65.92%

    189 - 3x + 3x +
      invisible(NULL)
    @@ -60948,7 +63092,8 @@

    teal.slice coverage - 65.92%

    202 - 66x + 66x +
      utils::getFromNamespace("topological_sort", ns = "teal.data")(graph)
    @@ -61493,21 +63638,24 @@

    teal.slice coverage - 65.92%

    76 - 15x + 15x +
          checkmate::assert_class(slice, "teal_slice_expr")
    77 - 14x + 14x +
          private$teal_slice <- slice
    78 - 14x + 14x +
          invisible(self)
    @@ -61591,28 +63739,32 @@

    teal.slice coverage - 65.92%

    90 - 12x + 12x +
          sprintf(
    91 - 12x + 12x +
            "%s:\n%s",
    92 - 12x + 12x +
            class(self)[1],
    93 - 12x + 12x +
            format(self$get_state(), show_all = show_all, trim_lines = trim_lines)
    @@ -61682,7 +63834,8 @@

    teal.slice coverage - 65.92%

    103 - 1x + 1x +
          cat(isolate(self$format(...)))
    @@ -61745,7 +63898,8 @@

    teal.slice coverage - 65.92%

    112 - 26x + 26x +
          private$teal_slice
    @@ -61822,14 +63976,16 @@

    teal.slice coverage - 65.92%

    123 - 1x + 1x +
          checkmate::assert_class(state, "teal_slice_expr")
    124 - 1x + 1x +
          invisible(self)
    @@ -61941,7 +64097,8 @@

    teal.slice coverage - 65.92%

    140 - 2x + 2x +
          isolate(str2lang(private$teal_slice$expr))
    @@ -63102,21 +65259,24 @@

    teal.slice coverage - 65.92%

    30 - 47x + 47x +
      checkmate::assert_list(calls)
    31 - 45x + 45x +
      if (length(calls) > 0L) checkmate::assert_list(calls, types = c("call", "name"))
    32 - 46x + 46x +
      checkmate::assert_string(operator)
    @@ -63130,21 +65290,24 @@

    teal.slice coverage - 65.92%

    34 - 44x + 44x +
      Reduce(
    35 - 44x + 44x +
        x = calls,
    36 - 44x + 44x +
        f = function(x, y) call(operator, x, y)
    @@ -63556,14 +65719,16 @@

    teal.slice coverage - 65.92%

    56 - 8x + 8x +
          checkmate::assert_class(datasets, "FilteredData")
    57 - 6x + 6x +
          private$filtered_data <- datasets
    @@ -63647,7 +65812,8 @@

    teal.slice coverage - 65.92%

    69 - 8x + 8x +
          private$filtered_data$get_filter_state()
    @@ -63717,14 +65883,16 @@

    teal.slice coverage - 65.92%

    79 - 5x + 5x +
          private$filtered_data$set_filter_state(filter)
    80 - 5x + 5x +
          invisible(NULL)
    @@ -63815,14 +65983,16 @@

    teal.slice coverage - 65.92%

    93 - 1x + 1x +
          private$filtered_data$remove_filter_state(filter)
    94 - 1x + 1x +
          invisible(NULL)
    @@ -63913,21 +66083,24 @@

    teal.slice coverage - 65.92%

    107 - 2x + 2x +
          datanames_to_remove <- if (missing(datanames)) private$filtered_data$datanames() else datanames
    108 - 2x + 2x +
          private$filtered_data$clear_filter_states(datanames = datanames_to_remove)
    109 - 2x + 2x +
          invisible(NULL)
    @@ -64626,7 +66799,8 @@

    teal.slice coverage - 65.92%

    92 - 107x + 107x +
      UseMethod("init_filtered_dataset")
    @@ -64710,56 +66884,64 @@

    teal.slice coverage - 65.92%

    104 - 83x + 83x +
      DataframeFilteredDataset$new(
    105 - 83x + 83x +
        dataset = dataset,
    106 - 83x + 83x +
        dataname = dataname,
    107 - 83x + 83x +
        keys = keys,
    108 - 83x + 83x +
        parent_name = parent_name,
    109 - 83x + 83x +
        parent = parent,
    110 - 83x + 83x +
        join_keys = join_keys,
    111 - 83x + 83x +
        label = label
    @@ -64850,7 +67032,8 @@

    teal.slice coverage - 65.92%

    124 - 7x + 7x +
      if (!requireNamespace("MultiAssayExperiment", quietly = TRUE)) {
    @@ -64871,35 +67054,40 @@

    teal.slice coverage - 65.92%

    127 - 7x + 7x +
      MAEFilteredDataset$new(
    128 - 7x + 7x +
        dataset = dataset,
    129 - 7x + 7x +
        dataname = dataname,
    130 - 7x + 7x +
        keys = keys,
    131 - 7x + 7x +
        label = label
    @@ -64990,28 +67178,32 @@

    teal.slice coverage - 65.92%

    144 - 17x + 17x +
      DefaultFilteredDataset$new(
    145 - 17x + 17x +
        dataset = dataset,
    146 - 17x + 17x +
        dataname = dataname,
    147 - 17x + 17x +
        label = label
    @@ -65878,28 +68070,32 @@

    teal.slice coverage - 65.92%

    121 - 3x + 3x +
      checkmate::assert_multi_class(datasets, c("FilteredData", "FilterPanelAPI"))
    122 - 3x + 3x +
      checkmate::assert_class(filter, "teal_slices")
    123 - 3x + 3x +
      datasets$set_filter_state(filter)
    124 - 3x + 3x +
      invisible(NULL)
    @@ -65941,14 +68137,16 @@

    teal.slice coverage - 65.92%

    130 - 4x + 4x +
      checkmate::assert_multi_class(datasets, c("FilteredData", "FilterPanelAPI"))
    131 - 4x + 4x +
      if (isRunning()) {
    @@ -65969,7 +68167,8 @@

    teal.slice coverage - 65.92%

    134 - 4x + 4x +
        isolate(datasets$get_filter_state())
    @@ -66018,14 +68217,16 @@

    teal.slice coverage - 65.92%

    141 - 1x + 1x +
      checkmate::assert_multi_class(datasets, c("FilteredData", "FilterPanelAPI"))
    142 - 1x + 1x +
      checkmate::assert_class(filter, "teal_slices")
    @@ -66039,14 +68240,16 @@

    teal.slice coverage - 65.92%

    144 - 1x + 1x +
      datasets$remove_filter_state(filter)
    145 - 1x + 1x +
      invisible(NULL)
    @@ -66088,21 +68291,24 @@

    teal.slice coverage - 65.92%

    151 - 1x + 1x +
      checkmate::assert_multi_class(datasets, c("FilteredData", "FilterPanelAPI"))
    152 - 1x + 1x +
      datasets$clear_filter_states(force = force)
    153 - 1x + 1x +
      invisible(NULL)
    @@ -66221,28 +68427,32 @@

    teal.slice coverage - 65.92%

    170 - 2x + 2x +
      checkmate::assert_character(datanames, min.len = 1, any.missing = FALSE)
    171 - 2x + 2x +
      stopifnot(
    172 - 2x + 2x +
        is(datasets, "FilteredData"),
    173 - 2x + 2x +
        all(datanames %in% datasets$datanames())
    @@ -66263,35 +68473,40 @@

    teal.slice coverage - 65.92%

    176 - 2x + 2x +
      paste(
    177 - 2x + 2x +
        unlist(lapply(
    178 - 2x + 2x +
          datanames,
    179 - 2x + 2x +
          function(dataname) {
    180 - 4x + 4x +
            datasets$get_call(dataname)
    @@ -66312,7 +68527,8 @@

    teal.slice coverage - 65.92%

    183 - 2x + 2x +
        collapse = "\n"
    @@ -66577,21 +68793,24 @@

    teal.slice coverage - 65.92%

    35 - 26x + 26x +
          checkmate::assert_matrix(data)
    36 - 25x + 25x +
          super$initialize(data, data_reactive, dataname, datalabel)
    37 - 25x + 25x +
          private$set_filterable_varnames(include_varnames = colnames(private$data))
    @@ -66744,49 +68963,56 @@

    teal.slice coverage - 65.92%

    15 - 273x + 273x +
      checkmate::assert_character(name, min.len = 1, any.missing = FALSE)
    16 - 271x + 271x +
      if (!grepl("^[[:alpha:]][a-zA-Z0-9_]*$", name, perl = TRUE)) {
    17 - 5x + 5x +
        stop(
    18 - 5x + 5x +
          "name '",
    19 - 5x + 5x +
          name,
    20 - 5x + 5x +
          "' must only contain alphanumeric characters (with underscores)",
    21 - 5x + 5x +
          " and the first character must be an alphabetic character"
    @@ -66898,35 +69124,40 @@

    teal.slice coverage - 65.92%

    37 - 12x + 12x +
      checkmate::assert_character(pattern, min.len = 1, null.ok = TRUE)
    38 - 12x + 12x +
      js_files <- list.files(
    39 - 12x + 12x +
        system.file("js", package = "teal.slice", mustWork = TRUE),
    40 - 12x + 12x +
        pattern = pattern,
    41 - 12x + 12x +
        full.names = TRUE
    @@ -66940,7 +69171,8 @@

    teal.slice coverage - 65.92%

    43 - 12x + 12x +
      singleton(lapply(js_files, includeScript))
    @@ -67080,14 +69312,16 @@

    teal.slice coverage - 65.92%

    63 - 55x + 55x +
      if (length(choices) > 1) {
    64 - 27x + 27x +
        do.call("call", append(list("c"), choices))
    @@ -67101,7 +69335,8 @@

    teal.slice coverage - 65.92%

    66 - 28x + 28x +
        choices
    @@ -67394,21 +69629,24 @@

    teal.slice coverage - 65.92%

    39 - 9x + 9x +
      checkmate::assert_multi_class(data, c("data.frame", "DataFrame", "matrix"))
    40 - 9x + 9x +
      checkmate::assert_character(columns, any.missing = FALSE, null.ok = TRUE)
    41 - 9x + 9x +
      checkmate::assert_subset(columns, colnames(data))
    @@ -67422,7 +69660,8 @@

    teal.slice coverage - 65.92%

    43 - 9x + 9x +
      if (is.matrix(data)) {
    @@ -67492,14 +69731,16 @@

    teal.slice coverage - 65.92%

    53 - 9x + 9x +
        types <- vapply(data, function(x) class(x)[1L], character(1L))
    54 - 9x + 9x +
        if (!is.null(columns)) types <- types[columns]
    @@ -67520,7 +69761,8 @@

    teal.slice coverage - 65.92%

    57 - 9x + 9x +
      types
    @@ -69205,35 +71447,40 @@

    teal.slice coverage - 65.92%

    187 - 103x + 103x +
          checkmate::assert_function(data_reactive, args = "sid")
    188 - 103x + 103x +
          checkmate::assert_data_frame(data)
    189 - 103x + 103x +
          super$initialize(data, data_reactive, dataname, datalabel)
    190 - 103x + 103x +
          private$keys <- keys
    191 - 103x + 103x +
          private$set_filterable_varnames(include_varnames = colnames(private$data))
    @@ -69568,7 +71815,8 @@

    teal.slice coverage - 65.92%

    39 - 26x + 26x +
          if (!requireNamespace("MultiAssayExperiment", quietly = TRUE)) {
    @@ -69589,14 +71837,16 @@

    teal.slice coverage - 65.92%

    42 - 26x + 26x +
          checkmate::assert_function(data_reactive, args = "sid")
    43 - 26x + 26x +
          checkmate::assert_class(data, "MultiAssayExperiment")
    @@ -69610,35 +71860,40 @@

    teal.slice coverage - 65.92%

    45 - 25x + 25x +
          data <- SummarizedExperiment::colData(data)
    46 - 25x + 25x +
          data_reactive <- function(sid = "") SummarizedExperiment::colData(data_reactive(sid = sid))
    47 - 25x + 25x +
          super$initialize(data, data_reactive, dataname, datalabel)
    48 - 25x + 25x +
          private$keys <- keys
    49 - 25x + 25x +
          private$set_filterable_varnames(include_varnames = colnames(data))
    @@ -69652,7 +71907,8 @@

    teal.slice coverage - 65.92%

    51 - 25x + 25x +
          invisible(self)
    @@ -69777,14 +72033,16 @@

    teal.slice coverage - 65.92%

    7 - 9x + 9x +
      isolate(
    8 - 9x + 9x +
        all(vapply(fields, function(x) identical(ts1[[x]], ts2[[x]]), logical(1L)))
    @@ -69847,35 +72105,40 @@

    teal.slice coverage - 65.92%

    17 - 34x + 34x +
      isolate({
    18 - 34x + 34x +
        testthat::expect_true(
    19 - 34x + 34x +
          setequal(
    20 - 34x + 34x +
            reactiveValuesToList(x),
    21 - 34x + 34x +
            reactiveValuesToList(y)
    @@ -69945,28 +72208,32 @@

    teal.slice coverage - 65.92%

    31 - 12x + 12x +
      isolate({
    32 - 12x + 12x +
        mapply(
    33 - 12x + 12x +
          function(x, y) {
    34 - 27x + 27x +
            expect_identical_slice(x, y)
    @@ -69980,14 +72247,16 @@

    teal.slice coverage - 65.92%

    36 - 12x + 12x +
          x = x,
    37 - 12x + 12x +
          y = y
    @@ -70001,7 +72270,8 @@

    teal.slice coverage - 65.92%

    39 - 12x + 12x +
        testthat::expect_identical(attributes(x), attributes(y))
    diff --git a/v0.5.1-rc1/index.html b/v0.5.1-rc1/index.html index d8c65f9ba..487ebe528 100644 --- a/v0.5.1-rc1/index.html +++ b/v0.5.1-rc1/index.html @@ -1,5 +1,4 @@ - - + @@ -52,22 +51,7 @@ - - + - + + diff --git a/v0.5.1-rc1/news/index.html b/v0.5.1-rc1/news/index.html index 92e409f43..7e75d3032 100644 --- a/v0.5.1-rc1/news/index.html +++ b/v0.5.1-rc1/news/index.html @@ -1,8 +1,22 @@ - -Changelog • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -78,49 +98,73 @@
    -

    teal.slice 0.5.1

    +

    teal.slice 0.5.1 +

    -

    Bug fixes

    -
    • Fix how the filter panel handles NA values in a Date column.
    • +

      Bug fixes +

      +
        +
      • Fix how the filter panel handles NA values in a Date column.
      • Fix filtering of ordered column to return the right call.
      • Ensure choices are sorted for factor and ordered data types.
      • -
    + +
    -

    Miscellaneous

    -
    • Added teal_slice and teal_slices to package index.
    • +

      Miscellaneous +

      +
        +
      • Added teal_slice and teal_slices to package index.
      • Implement mouse-over behavior for the filter card when it is selected.
      • -
    + +
    -

    teal.slice 0.5.0

    CRAN release: 2024-02-06

    +

    teal.slice 0.5.0 +

    +

    CRAN release: 2024-02-06

    -

    Enhancements

    -
    • Simplified init_filtered_data to accept a named list of datasets. init_filtered_data does not currently handle a list containing dataset, metadata, datalabel and code.
    • -
    +

    Enhancements +

    +
      +
    • Simplified init_filtered_data to accept a named list of datasets. init_filtered_data does not currently handle a list containing dataset, metadata, datalabel and code.
    • +
    +
    -

    Breaking changes

    -
    • +

      Breaking changes +

      +
        +
      • TealData object is no longer supported by teal.slice.
      • set_filter_state no longer accepts a nested list. Use teal_slices() and teal_slice() instead.
      • Renamed FilteredDataset subclass that handles data.frames from DefaultFilteredDataset to DataframeFilteredDataset. Added new class DefaultFilteredDataset that will store any type of object. Filtering will is not supported.
      • -
    + +
    -

    Bug fixes

    -
    • Performs an exact match when determining the default label of a dataset from attributes.
    • -
    +

    Bug fixes +

    +
      +
    • Performs an exact match when determining the default label of a dataset from attributes.
    • +
    +
    -

    Miscellaneous

    -
    • Specified minimal version of package dependencies.
    • +

      Miscellaneous +

      +
        +
      • Specified minimal version of package dependencies.
      • Removed storing and restoring of teal_slices objects.
      • Update documentation and code to reflect the changes due to the refactor of teal.data::JoinKeys into teal.data::join_keys.
      • -
    + +
    -

    teal.slice 0.4.0

    +

    teal.slice 0.4.0 +

    -

    New features

    -
    + +
    -

    Breaking changes

    -
    • Setting filters using a list is now deprecated. Use teal_slices and teal_slice instead.
    • +

      Breaking changes +

      +
        +
      • Setting filters using a list is now deprecated. Use teal_slices and teal_slice instead.
      • Removed CDISCFilteredData and CDISCFilteredDataset and implementing JoinKeys handling in their parent classes (FilteredData and DefaultFilteredDataset).
      • Specifying set of filterable columns is done through include_varnames and exclude_varnames in teal_slices. Specifying attr(, "filterable") is hard deprecated.
      • Removed private fields $code and $check from FilteredData class and made appropriate changes to constructor and init_filtered_data.
      • -
    + +
    -

    teal.slice 0.3.0

    -
    • Examples now use scda.2022 instead of scda.2021.
    • +

      teal.slice 0.3.0 +

      +
        +
      • Examples now use scda.2022 instead of scda.2021.
      • Transferred data hashing step in FilteredDataset to teal.
      • Removed constructor of Queue class.
      • -
      -

      New features

      -
      • Added a global turn on/off button for the Filter Panel.
      • +
      +
      +

      New features +

      +
        +
      • Added a global turn on/off button for the Filter Panel.
      • Added ability to collapse Active Filter Display panel.
      • Added ability to collapse all filters of an individual dataset.
      • Added fixed filter states.
      • -
      +
    +
    -

    Enhancements

    -
    • Improved filter state presentation in FilterState$format.
    • -
    +

    Enhancements +

    +
      +
    • Improved filter state presentation in FilterState$format.
    • +
    +
    -

    Bug fixes

    -
    • Fixed an error where the RangeFilterState produced an error when using bootstrap 4.
    • +

      Bug fixes +

      +
        +
      • Fixed an error where the RangeFilterState produced an error when using bootstrap 4.
      • Fixed a bug that caused the range slider to omit values selected by the filter API.
      • Fixed a bug where setting incorrect values for Date and Date time ranges caused the app to crash.
      • -
    + +
    -

    Miscellaneous

    -
    • Calculation of step in slider for RangeFilterState now uses checkmate::test_integerish instead of is.integer.
    • +

      Miscellaneous +

      +
        +
      • Calculation of step in slider for RangeFilterState now uses checkmate::test_integerish instead of is.integer.
      • Updated init_filtered_data to take into account the removal of CDISCTealData from teal.data package.
      • Added shinyvalidate validation for Date and Date time ranges.
      • Added examples apps for FilterState child classes and DFFilterStates.
      • -
    + +
    -

    teal.slice 0.2.0

    +

    teal.slice 0.2.0 +

    -

    New features

    -
    + +
    -

    Enhancements

    -
    • Redesigned the count bars for filter panel check box inputs.
    • +

      Enhancements +

      +
        +
      • Redesigned the count bars for filter panel check box inputs.
      • Redesigned the filter panel input for dates to use CSS flexbox.
      • Update icons to be compatible with Font Awesome 6.
      • Updates the FilteredData method get_formatted_filter_state so it no longer appends empty filters.
      • Added clearer installation instructions to README.
      • -
    + +
    -

    Breaking changes

    -
    • Renamed internal S3 method get_filterable_varnames to get_supported_filter_varnames.
    • -
    +

    Breaking changes +

    +
      +
    • Renamed internal S3 method get_filterable_varnames to get_supported_filter_varnames.
    • +
    +
    -

    Bug fixes

    -
    • Fixed a bug when the filter panel overview would not refresh if the panel was hidden during a transition between active modules.
    • +

      Bug fixes +

      +
        +
      • Fixed a bug when the filter panel overview would not refresh if the panel was hidden during a transition between active modules.
      • Fixed a bug in FilterState where sliderInput step values were too precise.
      • -
    + +
    -

    teal.slice 0.1.1

    +

    teal.slice 0.1.1 +

    -

    New features

    -
    • Added a formatting function for filter panel classes.
    • -
    +

    New features +

    +
      +
    • Added a formatting function for filter panel classes.
    • +
    +
    -

    Miscellaneous

    -
    • Added a template to the pkgdown site.
    • +

      Miscellaneous +

      +
        +
      • Added a template to the pkgdown site.
      • Updated package authors.
      • Added package vignettes.
      • -
    + +
    -

    Fix

    -
    • Fixed a bug in FilteredDataset, where launching a shiny application without FilteredData would not attach the appropriate CSS files.
    • -
    +

    Fix +

    +
      +
    • Fixed a bug in FilteredDataset, where launching a shiny application without FilteredData would not attach the appropriate CSS files.
    • +
    +
    -

    teal.slice 0.1.0

    -
    • Initial release of teal.slice - a package providing a filter module for teal applications.
    • -
    -

    Changes (from behavior when functionality was part of teal)

    +

    teal.slice 0.1.0 +

    +
      +
    • Initial release of teal.slice - a package providing a filter module for teal applications.
    • +
    +
    +

    Changes (from behavior when functionality was part of teal) +

    -

    Breaking changes

    -
    • +

      Breaking changes +

      +
        +
      • default_filter has been deprecated - use list() instead for a default filter.
      • -
    + +
    -

    Bug fixes

    -
    • Add counts to filtering categorical variables bar charts in the filtering panel in cases where they were missing.
    • +

      Bug fixes +

      +
        +
      • Add counts to filtering categorical variables bar charts in the filtering panel in cases where they were missing.
      • Fixed a bug causing an error when both sliders of RangeFilterState where put to either end of the allowed range in the UI.
      • -
    + +
    -

    Miscellaneous

    -
    • Added is_any_filtered method to all FilterState classes to detect if selected values actually filters out any data. This is used to decide if an explicit filter statement is added to the call.
    • +

      Miscellaneous +

      +
        +
      • Added is_any_filtered method to all FilterState classes to detect if selected values actually filters out any data. This is used to decide if an explicit filter statement is added to the call.
      • The filter panel now displays a helpful message when data has no rows or columns in place of an empty drop down widget.
      • FilteredData now stores whether its datasets had a reproducibility check or not via two new methods to its class: set_check and get_check.
      • -
    + +
    + + + + - - + + diff --git a/v0.5.1-rc1/reference/ChoicesFilterState.html b/v0.5.1-rc1/reference/ChoicesFilterState.html index 3e537436b..529e238bb 100644 --- a/v0.5.1-rc1/reference/ChoicesFilterState.html +++ b/v0.5.1-rc1/reference/ChoicesFilterState.html @@ -1,8 +1,24 @@ - -FilterState object for categorical data — ChoicesFilterState • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,40 +107,60 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterState -> ChoicesFilterState

    +

    Inherited methods


    -

    Method new()

    -

    Initialize a FilterState object.

    -

    Usage

    -

    ChoicesFilterState$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterState object.

    +
    +

    Usage +

    +

    +
    +
    ChoicesFilterState$new(
       x,
       x_reactive = reactive(NULL),
       slice,
       extract_type = character(0)
    -)

    +)
    +

    +
    -

    Returns

    +

    Returns +

    Object of class ChoicesFilterState, invisibly.

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection. For this class returned call looks like -<varname> %in% c(<values selected>) with optional is.na(<varname>).

    -

    Usage

    -

    ChoicesFilterState$get_call(dataname)

    +<varname> %in% c(<values selected>) with optional is.na(<varname>).

    +
    +

    Usage +

    +

    +
    +
    ChoicesFilterState$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of data set; defaults to private$get_dataname()

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    call or NULL

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    ChoicesFilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    ChoicesFilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -197,7 +280,8 @@

    Arguments -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     include_css_files <- getFromNamespace("include_css_files", "teal.slice")
     include_js_files <- getFromNamespace("include_js_files", "teal.slice")
    @@ -313,17 +397,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.5.1-rc1/reference/DFFilterStates.html b/v0.5.1-rc1/reference/DFFilterStates.html index 6af7a032f..f0020eac4 100644 --- a/v0.5.1-rc1/reference/DFFilterStates.html +++ b/v0.5.1-rc1/reference/DFFilterStates.html @@ -1,8 +1,24 @@ - -FilterStates subclass for data frames — DFFilterStates • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,18 +107,25 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterStates -> DFFilterStates

    -

    Methods

    +

    Methods +

    -

    Public methods

    +

    Public methods +

    -

    Inherited methods +
    +

    Inherited methods


    -

    Method new()

    +

    +
    +
    +

    Method new() +

    Initializes DFFilterStates object by setting dataname and initializing state_list (shiny::reactiveVal). This class contains a single state_list with no specified name, which means that when calling the subset function associated with this class -(dplyr::filter), a list of conditions is passed to unnamed arguments (...).

    -

    Usage

    -

    DFFilterStates$new(
    +(dplyr::filter), a list of conditions is passed to unnamed arguments (...).

    +
    +

    Usage +

    +

    +
    +
    DFFilterStates$new(
       data,
       data_reactive = function(sid = "") NULL,
       dataname,
       datalabel = NULL,
       keys = character(0)
    -)

    +)
    +

    +
    -

    Arguments

    -

    data
    +

    Arguments +

    +

    +
    +
    +
    data

    (data.frame) the R object which dplyr::filter function will be applied on.

    @@ -154,23 +197,41 @@

    Arguments
    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    DFFilterStates$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    DFFilterStates$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -178,7 +239,8 @@

    Arguments -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     include_css_files <- getFromNamespace("include_css_files", "teal.slice")
     include_js_files <- getFromNamespace("include_js_files", "teal.slice")
    @@ -323,17 +385,19 @@ 

    Examples

    + +

    + +
    - - + + diff --git a/v0.5.1-rc1/reference/DataframeFilteredDataset.html b/v0.5.1-rc1/reference/DataframeFilteredDataset.html index 164f379e6..cc4f423b6 100644 --- a/v0.5.1-rc1/reference/DataframeFilteredDataset.html +++ b/v0.5.1-rc1/reference/DataframeFilteredDataset.html @@ -1,10 +1,26 @@ - -The DataframeFilteredDataset R6 class — DataframeFilteredDataset • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + +
    @@ -87,23 +109,30 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilteredDataset -> DataframeFilteredDataset

    +

    Inherited methods


    -

    Method new()

    -

    Initializes this DataframeFilteredDataset object.

    -

    Usage

    -

    DataframeFilteredDataset$new(
    +

    +
    +
    +

    Method new() +

    +

    Initializes this DataframeFilteredDataset object.

    +
    +

    Usage +

    +

    +
    +
    DataframeFilteredDataset$new(
       dataset,
       dataname,
       keys = character(0),
    @@ -127,12 +163,18 @@ 

    Usage

    parent = NULL, join_keys = character(0), label = character(0) -)

    +)
    +

    +
    -

    Arguments

    -

    dataset
    +

    Arguments +

    +

    +
    +
    +
    dataset

    (data.frame) single data.frame for which filters are rendered.

    @@ -170,129 +212,227 @@

    Arguments -

    Returns

    +

    Returns +

    Object of class DataframeFilteredDataset, invisibly.

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Gets the subset expression.

    This function returns subset expressions equivalent to selected items within each of filter_states. Configuration of the expressions is constant and depends on filter_states type and order which are set during initialization. This class contains single FilterStates which contains single state_list -and all FilterState objects apply to one argument (...) in a dplyr::filter call.

    -

    Usage

    -

    DataframeFilteredDataset$get_call(sid = "")

    +and all FilterState objects apply to one argument (...) in a dplyr::filter call.

    +
    +

    Usage +

    +

    +
    +
    DataframeFilteredDataset$get_call(sid = "")
    +

    +
    -

    Arguments

    -

    sid
    +

    Arguments +

    +

    +
    +
    +
    sid

    (character) when specified, the method returns code containing conditions calls of FilterState objects with sid different to that of this sid argument.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Either a list of length 1 containing a filter call, or NULL.

    -


    -

    Method set_filter_state()

    -

    Set filter state.

    -

    Usage

    -

    DataframeFilteredDataset$set_filter_state(state)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Set filter state.

    +
    +

    Usage +

    +

    +
    +
    DataframeFilteredDataset$set_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method remove_filter_state()

    -

    Remove one or more FilterState form a FilteredDataset.

    -

    Usage

    -

    DataframeFilteredDataset$remove_filter_state(state)

    +
    +

    +
    +
    +

    Method remove_filter_state() +

    +

    Remove one or more FilterState form a FilteredDataset.

    +
    +

    Usage +

    +

    +
    +
    DataframeFilteredDataset$remove_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices) specifying FilterState objects to remove; teal_slices may contain only dataname and varname, other elements are ignored

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method ui_add()

    -

    UI module to add filter variable for this dataset.

    -

    Usage

    -

    DataframeFilteredDataset$ui_add(id)

    +
    +

    +
    +
    +

    Method ui_add() +

    +

    UI module to add filter variable for this dataset.

    +
    +

    Usage +

    +

    +
    +
    DataframeFilteredDataset$ui_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method get_filter_overview()

    -

    Creates row for filter overview in the form of
    dataname -- observations (remaining/total) - data.frame

    -

    Usage

    -

    DataframeFilteredDataset$get_filter_overview()

    +
    +

    +
    +
    +

    Method get_filter_overview() +

    +

    Creates row for filter overview in the form of
    dataname -- observations (remaining/total) - data.frame

    +
    +

    Usage +

    +

    +
    +
    DataframeFilteredDataset$get_filter_overview()
    +

    +
    -

    Returns

    +

    Returns +

    A data.frame.

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    DataframeFilteredDataset$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    DataframeFilteredDataset$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -300,7 +440,8 @@

    Arguments -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     DataframeFilteredDataset <- getFromNamespace("DataframeFilteredDataset", "teal.slice")
     
    @@ -394,17 +535,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.5.1-rc1/reference/DateFilterState.html b/v0.5.1-rc1/reference/DateFilterState.html index 0a13c994a..5a0f3b96c 100644 --- a/v0.5.1-rc1/reference/DateFilterState.html +++ b/v0.5.1-rc1/reference/DateFilterState.html @@ -1,8 +1,24 @@ - -FilterState object for Date data — DateFilterState • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,40 +107,60 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterState -> DateFilterState

    +

    Inherited methods


    -

    Method new()

    -

    Initialize a FilterState object.

    -

    Usage

    -

    DateFilterState$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterState object.

    +
    +

    Usage +

    +

    +
    +
    DateFilterState$new(
       x,
       x_reactive = reactive(NULL),
       slice,
       extract_type = character(0)
    -)

    +)
    +

    +
    -

    Returns

    +

    Returns +

    Object of class DateFilterState, invisibly.

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection. For this class returned call looks like -<varname> >= <min value> & <varname> <= <max value> with optional is.na(<varname>).

    -

    Usage

    -

    DateFilterState$get_call(dataname)

    +<varname> >= <min value> & <varname> <= <max value> with optional is.na(<varname>).

    +
    +

    Usage +

    +

    +
    +
    DateFilterState$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) containing possibly prefixed name of data set

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    call or NULL

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    DateFilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    DateFilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -197,7 +280,8 @@

    Arguments -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     include_css_files <- getFromNamespace("include_css_files", "teal.slice")
     include_js_files <- getFromNamespace("include_js_files", "teal.slice")
    @@ -299,17 +383,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.5.1-rc1/reference/DatetimeFilterState.html b/v0.5.1-rc1/reference/DatetimeFilterState.html index 8a26246d1..1d57c988e 100644 --- a/v0.5.1-rc1/reference/DatetimeFilterState.html +++ b/v0.5.1-rc1/reference/DatetimeFilterState.html @@ -1,8 +1,24 @@ - -FilterState object for date time data — DatetimeFilterState • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,44 +107,64 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterState -> DatetimeFilterState

    +

    Inherited methods


    -

    Method new()

    +

    +
    +
    +

    Method new() +

    Initialize a FilterState object. This class has an extra field, private$timezone, which is set to Sys.timezone() by default. However, in case when using this module in teal app, one needs timezone of the app user. App user timezone is taken from session$userData$timezone -and is set only if object is initialized in shiny.

    -

    Usage

    -

    DatetimeFilterState$new(
    +and is set only if object is initialized in shiny.

    +
    +

    Usage +

    +

    +
    +
    DatetimeFilterState$new(
       x,
       x_reactive = reactive(NULL),
       extract_type = character(0),
       slice
    -)

    +)
    +

    +
    -

    Arguments

    -

    x
    +

    Arguments +

    +

    +
    +
    +
    x

    (POSIXct or POSIXlt) variable to be filtered.

    @@ -135,11 +178,15 @@

    Arguments varname in the condition call will be returned as <dataname>$<varname>

  • "matrix" varname in the condition call will be returned as <dataname>[, <varname>]

  • - + +
    slice
    @@ -151,49 +198,85 @@

    Arguments -

    Returns

    +

    Returns +

    Object of class DatetimeFilterState, invisibly.

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection. For this class returned call looks like -<varname> >= as.POSIXct(<min>) & <varname> <= <max>) with optional is.na(<varname>).

    -

    Usage

    -

    DatetimeFilterState$get_call(dataname)

    +<varname> >= as.POSIXct(<min>) & <varname> <= <max>) with optional is.na(<varname>).

    +
    +

    Usage +

    +

    +
    +
    DatetimeFilterState$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    name of data set; defaults to private$get_dataname()

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    call

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    DatetimeFilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    DatetimeFilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -201,7 +284,8 @@

    Arguments -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     include_css_files <- getFromNamespace("include_css_files", "teal.slice")
     include_js_files <- getFromNamespace("include_js_files", "teal.slice")
    @@ -311,17 +395,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.5.1-rc1/reference/DefaultFilteredDataset.html b/v0.5.1-rc1/reference/DefaultFilteredDataset.html index 8efb5a58c..959a4abfc 100644 --- a/v0.5.1-rc1/reference/DefaultFilteredDataset.html +++ b/v0.5.1-rc1/reference/DefaultFilteredDataset.html @@ -1,8 +1,24 @@ - -DefaultFilteredDataset R6 class — DefaultFilteredDataset • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,16 +107,20 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilteredDataset -> DefaultFilteredDataset

    +

    Inherited methods


    -

    Method new()

    -

    Initializes this DefaultFilteredDataset object.

    -

    Usage

    -

    DefaultFilteredDataset$new(dataset, dataname, label = character(0))

    +

    +
    +
    +

    Method new() +

    +

    Initializes this DefaultFilteredDataset object.

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$new(dataset, dataname, label = character(0))
    +

    +
    -

    Arguments

    -

    dataset
    +

    Arguments +

    +

    +
    +
    +
    dataset

    any type of object; will not be filtered.

    @@ -134,23 +177,40 @@

    Arguments -

    Returns

    +

    Returns +

    Object of class DefaultFilteredDataset, invisibly.

    -


    -

    Method format()

    -

    Returns a formatted string representing this DefaultFilteredDataset object.

    -

    Usage

    -

    DefaultFilteredDataset$format(show_all, trim_lines = FALSE)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns a formatted string representing this DefaultFilteredDataset object.

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$format(show_all, trim_lines = FALSE)
    +

    +
    -

    Arguments

    -

    show_all
    +

    Arguments +

    +

    +
    +
    +
    show_all

    (logical(1)) for method consistency, ignored.

    @@ -158,167 +218,291 @@

    Arguments -

    Returns

    +

    Returns +

    The formatted string.

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    -

    Usage

    -

    DefaultFilteredDataset$get_call(sid)

    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$get_call(sid)
    +

    +
    -

    Arguments

    -

    sid
    +

    Arguments +

    +

    +
    +
    +
    sid

    (character(1)) for method consistency, ignored.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    +

    +
    +
    +

    Method get_filter_state() +

    -

    Usage

    -

    DefaultFilteredDataset$get_filter_state()

    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$get_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    +

    +
    +
    +

    Method set_filter_state() +

    -

    Usage

    -

    DefaultFilteredDataset$set_filter_state(state)

    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$set_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices) for method consistency, ignored.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    +

    +
    +
    +

    Method clear_filter_states() +

    -

    Usage

    -

    DefaultFilteredDataset$clear_filter_states(force)

    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$clear_filter_states(force)
    +

    +
    -

    Arguments

    -

    force
    +

    Arguments +

    +

    +
    +
    +
    force

    (logical(1)) for method consistency, ignored.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method get_filter_overview()

    -

    Creates row for filter overview in the form of
    dataname - unsupported data class

    -

    Usage

    -

    DefaultFilteredDataset$get_filter_overview()

    +
    +

    +
    +
    +

    Method get_filter_overview() +

    +

    Creates row for filter overview in the form of
    dataname - unsupported data class

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$get_filter_overview()
    +

    +
    -

    Returns

    +

    Returns +

    A data.frame.

    -


    -

    Method ui_active()

    -

    Overwrites parent method.

    -

    Usage

    -

    DefaultFilteredDataset$ui_active(id)

    +
    +

    +
    +
    +

    Method ui_active() +

    +

    Overwrites parent method.

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$ui_active(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Details

    +

    Details +

    Blank UI module that would list active filter states for this dataset.

    -

    Returns

    +

    Returns +

    An empty div.

    -


    -

    Method ui_add()

    -

    Overwrites parent method.

    -

    Usage

    -

    DefaultFilteredDataset$ui_add(id)

    +
    +

    +
    +
    +

    Method ui_add() +

    +

    Overwrites parent method.

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$ui_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Details

    +

    Details +

    Blank UI module that would list active filter states for this dataset.

    -

    Returns

    +

    Returns +

    An empty div.

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    DefaultFilteredDataset$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -326,7 +510,8 @@

    Arguments -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     DefaultFilteredDataset <- getFromNamespace("DefaultFilteredDataset", "teal.slice")
     
    @@ -339,17 +524,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.5.1-rc1/reference/EmptyFilterState.html b/v0.5.1-rc1/reference/EmptyFilterState.html index f7dcadc62..0aed053cb 100644 --- a/v0.5.1-rc1/reference/EmptyFilterState.html +++ b/v0.5.1-rc1/reference/EmptyFilterState.html @@ -1,8 +1,24 @@ - -FilterState object for empty variables — EmptyFilterState • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,40 +107,60 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterState -> EmptyFilterState

    +

    Inherited methods


    -

    Method new()

    -

    Initialize EmptyFilterState object.

    -

    Usage

    -

    EmptyFilterState$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize EmptyFilterState object.

    +
    +

    Usage +

    +

    +
    +
    EmptyFilterState$new(
       x,
       x_reactive = reactive(NULL),
       extract_type = character(0),
       slice
    -)

    +)
    +

    +
    -

    Arguments

    -

    x
    +

    Arguments +

    +

    + -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection relevant for selected variable type. -Uses internal reactive values, hence must be called in reactive or isolated context.

    -

    Usage

    -

    EmptyFilterState$get_call(dataname)

    +Uses internal reactive values, hence must be called in reactive or isolated context.

    +
    +

    Usage +

    +

    +
    +
    EmptyFilterState$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    name of data set; defaults to private$get_dataname()

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    logical(1)

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    EmptyFilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    EmptyFilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -196,7 +279,8 @@

    Arguments -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     include_js_files <- getFromNamespace("include_js_files", "teal.slice")
     EmptyFilterState <- getFromNamespace("EmptyFilterState", "teal.slice")
    @@ -217,17 +301,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.5.1-rc1/reference/FilterPanelAPI.html b/v0.5.1-rc1/reference/FilterPanelAPI.html index a2e99bf8a..4fbb75ada 100644 --- a/v0.5.1-rc1/reference/FilterPanelAPI.html +++ b/v0.5.1-rc1/reference/FilterPanelAPI.html @@ -1,8 +1,24 @@ - -Class to encapsulate the API of the filter panel of a teal app — FilterPanelAPI • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,7 +106,8 @@
    -

    Details

    +

    Details +

    The purpose of this class is to encapsulate the API of the filter panel in a new class FilterPanelAPI so that it can be passed and used in the server call of any module instead of passing the whole FilteredData object.

    @@ -92,125 +115,223 @@

    Details

    -

    Methods

    +

    Methods +


    -

    Method new()

    -

    Initialize a FilterPanelAPI object.

    -

    Usage

    -

    FilterPanelAPI$new(datasets)

    + +
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterPanelAPI object.

    +
    +

    Usage +

    +

    +
    +
    FilterPanelAPI$new(datasets)
    +

    +
    -

    Arguments

    -

    datasets
    +

    Arguments +

    +

    +
    +
    +
    datasets

    (FilteredData)

    -

    +
    +

    +
    -


    +

    +
    +
    +

    Method get_filter_state() +

    Gets the reactive values from the active FilterState objects of the FilteredData object.

    Gets all active filters in the form of a nested list. -The output list is a compatible input to set_filter_state.

    -

    Usage

    -

    FilterPanelAPI$get_filter_state()

    +The output list is a compatible input to set_filter_state.

    +
    +

    Usage +

    +

    +
    +
    FilterPanelAPI$get_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    list with named elements corresponding to FilteredDataset objects with active filters.

    -


    -

    Method set_filter_state()

    -

    Sets active filter states.

    -

    Usage

    -

    FilterPanelAPI$set_filter_state(filter)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Sets active filter states.

    +
    +

    Usage +

    +

    +
    +
    FilterPanelAPI$set_filter_state(filter)
    +

    +
    -

    Arguments

    -

    filter
    +

    Arguments +

    +

    +
    +
    +
    filter

    (teal_slices)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method remove_filter_state()

    -

    Remove one or more FilterState of a FilteredDataset in the FilteredData object.

    -

    Usage

    -

    FilterPanelAPI$remove_filter_state(filter)

    +
    +

    +
    +
    +

    Method remove_filter_state() +

    +

    Remove one or more FilterState of a FilteredDataset in the FilteredData object.

    +
    +

    Usage +

    +

    +
    +
    FilterPanelAPI$remove_filter_state(filter)
    +

    +
    -

    Arguments

    -

    filter
    +

    Arguments +

    +

    +
    +
    +
    filter

    (teal_slices) specifying FilterState objects to remove; teal_slices may contain only dataname and varname, other elements are ignored

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method clear_filter_states()

    -

    Remove all FilterStates of the FilteredData object.

    -

    Usage

    -

    FilterPanelAPI$clear_filter_states(datanames)

    +
    +

    +
    +
    +

    Method clear_filter_states() +

    +

    Remove all FilterStates of the FilteredData object.

    +
    +

    Usage +

    +

    +
    +
    FilterPanelAPI$clear_filter_states(datanames)
    +

    +
    -

    Arguments

    -

    datanames
    +

    Arguments +

    +

    +
    +
    +
    datanames

    (character) datanames to remove their FilterStates; omit to remove all FilterStates in the FilteredData object

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    FilterPanelAPI$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    FilterPanelAPI$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -218,7 +339,8 @@

    Arguments -

    Examples

    +

    Examples +

    library(shiny)
     
     fd <- init_filtered_data(list(iris = iris))
    @@ -289,17 +411,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.5.1-rc1/reference/FilterState.html b/v0.5.1-rc1/reference/FilterState.html index 2ed9dd5b9..2156cd5b6 100644 --- a/v0.5.1-rc1/reference/FilterState.html +++ b/v0.5.1-rc1/reference/FilterState.html @@ -1,8 +1,24 @@ - -FilterState abstract class — FilterState • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,12 +107,15 @@
    -

    Details

    +

    Details +

    This class is responsible for managing a single filter item within a FilteredData object and outputs a condition call (logical predicate) for subsetting one variable. Filter states depend on the variable type: (logical, integer, numeric, character, factor, Date, POSIXct, POSIXlt) -and FilterState subclasses exist that correspond to those types.

    +

    Each variable's filter state is an R6 object keeps the variable that is filtered, a teal_slice object that describes the filter state, as well as a shiny module (UI and server) that allows the user to alter the filter state. Changes to the filter state that cause some observations to be omitted trigger the get_call method and every R function call up in the reactive chain.

    -

    Modifying state

    +

    Modifying state +

    -

    Modifying a FilterState object is possible in three scenarios:

    • In an interactive session, by passing an appropriate teal_slice to the set_state method.

    • +

      Modifying a FilterState object is possible in three scenarios:

      +
        +
      • In an interactive session, by passing an appropriate teal_slice to the set_state method.

      • In a running application, by changing appropriate inputs.

      • In a running application, by using filter_state_api which directly uses set_state method of the FilterState object.

      • -
    + +
    -

    Methods

    +

    Methods +


    -

    Method new()

    -

    Initialize a FilterState object.

    -

    Usage

    -

    FilterState$new(
    +
    +
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterState object.

    +
    +

    Usage +

    +

    +
    +
    FilterState$new(
       x,
       x_reactive = reactive(NULL),
       slice,
       extract_type = character(0)
    -)

    +)
    +

    +
    -

    Returns

    +

    Returns +

    Object of class FilterState, invisibly.

    -


    -

    Method format()

    -

    Returns a formatted string representing this FilterState object.

    -

    Usage

    -

    FilterState$format(show_all = FALSE, trim_lines = TRUE)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns a formatted string representing this FilterState object.

    +
    +

    Usage +

    +

    +
    +
    FilterState$format(show_all = FALSE, trim_lines = TRUE)
    +

    +
    -

    Arguments

    -

    show_all
    +

    Arguments +

    +

    +
    +
    +
    show_all

    (logical(1)) passed to format.teal_slice

    @@ -197,106 +267,196 @@

    Arguments -

    Returns

    +

    Returns +

    character(1) the formatted string

    -


    -

    Method print()

    -

    Prints this FilterState object.

    -

    Usage

    -

    FilterState$print(...)

    +
    +

    +
    +
    +

    Method print() +

    +

    Prints this FilterState object.

    +
    +

    Usage +

    +

    +
    +
    FilterState$print(...)
    +

    +
    -

    Arguments

    -

    ...
    +

    Arguments +

    +

    +
    +
    +
    ...

    additional arguments

    -

    +
    +

    +
    -


    -

    Method set_state()

    -

    Sets mutable parameters of the filter state.

    • fixed state is prevented from changing state

    • +
    +

    +
    +
    +

    Method set_state() +

    +

    Sets mutable parameters of the filter state.

    +
      +
    • fixed state is prevented from changing state

    • anchored state is prevented from removing state

    • -
    -

    Usage

    -

    FilterState$set_state(state)

    + +
    +

    Usage +

    +

    +
    +
    FilterState$set_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slice)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    self invisibly

    -


    -

    Method get_state()

    -

    Returns a complete description of the filter state.

    -

    Usage

    -

    FilterState$get_state()

    +
    +

    +
    +
    +

    Method get_state() +

    +

    Returns a complete description of the filter state.

    +
    +

    Usage +

    +

    +
    +
    FilterState$get_state()
    +

    +
    -

    Returns

    +

    Returns +

    A teal_slice object.

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection relevant for selected variable type. Method is using internal reactive values which makes it reactive -and must be executed in reactive or isolated context.

    -

    Usage

    -

    FilterState$get_call()

    +and must be executed in reactive or isolated context.

    +
    +

    Usage +

    +

    +
    +
    FilterState$get_call()
    +

    +
    -


    -

    Method server()

    -

    shiny module server.

    -

    Usage

    -

    FilterState$server(id)

    +
    +

    +
    +
    +

    Method server() +

    +

    shiny module server.

    +
    +

    Usage +

    +

    +
    +
    FilterState$server(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Reactive expression signaling that remove button has been clicked.

    -


    -

    Method ui()

    +
    +

    +
    +
    +

    Method ui() +

    shiny UI module. -The UI for this class contains simple message stating that it is not supported.

    -

    Usage

    -

    FilterState$ui(id, parent_id = "cards")

    +The UI for this class contains simple message stating that it is not supported.

    +
    +

    Usage +

    +

    +
    +
    FilterState$ui(id, parent_id = "cards")
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    @@ -305,35 +465,64 @@

    Arguments
    -

    Method destroy_observers()

    -

    Destroy observers stored in private$observers.

    -

    Usage

    -

    FilterState$destroy_observers()

    +
    +

    +
    +
    +

    Method destroy_observers() +

    +

    Destroy observers stored in private$observers.

    +
    +

    Usage +

    +

    +
    +
    FilterState$destroy_observers()
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    FilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    FilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -341,17 +530,19 @@

    Arguments

    + +

    + +
    - - + + diff --git a/v0.5.1-rc1/reference/FilterStateExpr.html b/v0.5.1-rc1/reference/FilterStateExpr.html index 6b5e6af54..f086f1df5 100644 --- a/v0.5.1-rc1/reference/FilterStateExpr.html +++ b/v0.5.1-rc1/reference/FilterStateExpr.html @@ -1,8 +1,24 @@ - -FilterStateExpr R6 class — FilterStateExpr • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,18 +107,22 @@
    -

    Details

    +

    Details +

    Creates a filter state around a predefined condition call (logical predicate). The condition call is independent of the data and the filter card allows no interaction (the filter is always fixed).

    -

    Methods

    +

    Methods +


    -

    Method new()

    -

    Initialize a FilterStateExpr object.

    -

    Usage

    -

    FilterStateExpr$new(slice)

    + +
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterStateExpr object.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$new(slice)
    +

    +
    -

    Arguments

    -

    slice
    +

    Arguments +

    +

    +
    +
    +
    slice

    (teal_slice_expr)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Object of class FilterStateExpr, invisibly.

    -


    -

    Method format()

    -

    Returns a formatted string representing this FilterStateExpr object.

    -

    Usage

    -

    FilterStateExpr$format(show_all = FALSE, trim_lines = TRUE)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns a formatted string representing this FilterStateExpr object.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$format(show_all = FALSE, trim_lines = TRUE)
    +

    +
    -

    Arguments

    -

    show_all
    +

    Arguments +

    +

    +
    +
    +
    show_all

    (logical(1)) passed to format.teal_slice

    @@ -142,133 +201,242 @@

    Arguments -

    Returns

    +

    Returns +

    character(1) the formatted string

    -


    -

    Method print()

    -

    Prints this FilterStateExpr object.

    -

    Usage

    -

    FilterStateExpr$print(...)

    +
    +

    +
    +
    +

    Method print() +

    +

    Prints this FilterStateExpr object.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$print(...)
    +

    +
    -

    Arguments

    -

    ...
    +

    Arguments +

    +

    +
    +
    +
    ...

    arguments passed to the format method

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method get_state()

    -

    Returns a complete description of this filter state.

    -

    Usage

    -

    FilterStateExpr$get_state()

    +
    +

    +
    +
    +

    Method get_state() +

    +

    Returns a complete description of this filter state.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$get_state()
    +

    +
    -

    Returns

    +

    Returns +

    A teal_slice object.

    -


    -

    Method set_state()

    -

    Does nothing. Exists for compatibility.

    -

    Usage

    -

    FilterStateExpr$set_state(state)

    +
    +

    +
    +
    +

    Method set_state() +

    +

    Does nothing. Exists for compatibility.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$set_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slice)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    self, invisibly.

    -


    -

    Method get_call()

    -

    Get reproducible call.

    -

    Usage

    -

    FilterStateExpr$get_call(dataname)

    +
    +

    +
    +
    +

    Method get_call() +

    +

    Get reproducible call.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    -

    (ignored) for a consistency with FilterState

    +

    Arguments +

    +

    +
    +
    +
    dataname
    +
    +

    (ignored) for a consistency with FilterState

    Returns reproducible condition call for current selection relevant for selected variable type. Method is using internal reactive values which makes it reactive -and must be executed in reactive or isolated context.

    +and must be executed in reactive or isolated context.

    +
    -

    + +

    +
    -

    Returns

    +

    Returns +

    call or NULL

    -


    -

    Method destroy_observers()

    -

    Destroy observers stored in private$observers.

    -

    Usage

    -

    FilterStateExpr$destroy_observers()

    +
    +

    +
    +
    +

    Method destroy_observers() +

    +

    Destroy observers stored in private$observers.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$destroy_observers()
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method server()

    -

    shiny module server.

    -

    Usage

    -

    FilterStateExpr$server(id)

    +
    +

    +
    +
    +

    Method server() +

    +

    shiny module server.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$server(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Reactive expression signaling that the remove button has been clicked.

    -


    -

    Method ui()

    +
    +

    +
    +
    +

    Method ui() +

    shiny module UI. -The UI for this class contains simple message stating that it is not supported.

    -

    Usage

    -

    FilterStateExpr$ui(id, parent_id = "cards")

    +The UI for this class contains simple message stating that it is not supported.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$ui(id, parent_id = "cards")
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    @@ -278,23 +446,41 @@

    Arguments
    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    FilterStateExpr$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -302,7 +488,8 @@

    Arguments -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     include_js_files <- getFromNamespace("include_js_files", "teal.slice")
     include_css_files <- getFromNamespace("include_css_files", "teal.slice")
    @@ -355,17 +542,19 @@ 

    Examples

    + +

    + +
    - - + + diff --git a/v0.5.1-rc1/reference/FilterStates.html b/v0.5.1-rc1/reference/FilterStates.html index 08f5f0b55..8ed054d79 100644 --- a/v0.5.1-rc1/reference/FilterStates.html +++ b/v0.5.1-rc1/reference/FilterStates.html @@ -1,5 +1,10 @@ - - + + + + + +FilterStates R6 class — FilterStates • teal.slice +FilterStates R6 class — FilterStates • teal.slice + + + + + + + + + + Skip to contents @@ -38,7 +54,8 @@ + +
    @@ -114,12 +137,15 @@
    -

    Methods

    +

    Methods +


    -

    Method new()

    + +
    +

    +
    +
    +

    Method new() +

    Initializes FilterStates object by setting -dataname, and datalabel.

    -

    Usage

    -

    FilterStates$new(
    +dataname, and datalabel.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$new(
       data,
       data_reactive = function(sid = "") NULL,
       dataname,
       datalabel = NULL
    -)

    +)
    +

    +
    -

    Arguments

    -

    data
    +

    Arguments +

    +

    +
    +
    +
    data

    (data.frame or MultiAssayExperiment or SummarizedExperiment or matrix) the R object which subset function is applied on.

    @@ -171,23 +212,40 @@

    Arguments -

    Returns

    +

    Returns +

    Object of class FilterStates, invisibly.

    -


    -

    Method format()

    -

    Returns a formatted string representing this FilterStates object.

    -

    Usage

    -

    FilterStates$format(show_all = FALSE, trim_lines = TRUE)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns a formatted string representing this FilterStates object.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$format(show_all = FALSE, trim_lines = TRUE)
    +

    +
    -

    Arguments

    -

    show_all
    +

    Arguments +

    +

    +
    +
    +
    show_all

    (logical(1)) passed to format.teal_slices

    @@ -195,28 +253,40 @@

    Arguments -

    Returns

    +

    Returns +

    character(1) the formatted string

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Filter call

    Builds subset expression from condition calls generated by FilterState. The lhs of the expression is a dataname_prefixed, where word prefixed refers to situation when call is evaluated on elements of the original data, for example dataname[[x]]. By default dataname_prefixed = dataname and it's not alterable through class methods. Customization of private$dataname_prefixed is done through inheriting classes.

    -

    The rhs is a call to private$fun with following arguments:

    • dataname_prefixed

    • +

      The rhs is a call to private$fun with following arguments:

      +
        +
      • dataname_prefixed

      • list of logical expressions generated by FilterState objects stored in private$state_list. Each logical predicate is combined with & operator. Variables in these logical expressions by default are not prefixed but this can be changed by setting private$extract_type (change in the similar way as dataname_prefixed) Possible call outputs depending on a custom fields/options:

      • -

      # default
      +
    +

    +
    +
    # default
     dataname <- subset(dataname, col == "x")
     
     # fun = dplyr::filter
    @@ -229,222 +299,399 @@ 

    Method get_call()dataname <- subset(dataname, subset = row_col == "x", select = col_col == "x") # dataname = dataname[[element]] -dataname[[element]] <- subset(dataname[[element]], subset = col == "x")

    -

    If no filters are applied, NULL is returned to avoid no-op calls such as dataname <- dataname.

    -

    Usage

    -

    FilterStates$get_call(sid = "")

    +dataname[[element]] <- subset(dataname[[element]], subset = col == "x")
    +

    +
    +

    If no filters are applied, NULL is returned to avoid no-op calls such as dataname <- dataname.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$get_call(sid = "")
    +

    +
    -

    Arguments

    -

    sid
    +

    Arguments +

    +

    +
    +
    +
    sid

    (character) when specified then method returns code containing condition calls (logical predicates) of FilterState objects which "sid" attribute is different than this sid argument.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    call or NULL

    -


    -

    Method print()

    -

    Prints this FilterStates object.

    -

    Usage

    -

    FilterStates$print(...)

    +
    +

    +
    +
    +

    Method print() +

    +

    Prints this FilterStates object.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$print(...)
    +

    +
    -

    Arguments

    -

    ...
    +

    Arguments +

    +

    +
    +
    +
    ...

    additional arguments passed to format.

    -

    +
    +

    +
    -


    -

    Method remove_filter_state()

    -

    Remove one or more FilterStates from the state_list along with their UI elements.

    -

    Usage

    -

    FilterStates$remove_filter_state(state)

    +
    +

    +
    +
    +

    Method remove_filter_state() +

    +

    Remove one or more FilterStates from the state_list along with their UI elements.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$remove_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices) specifying FilterState objects to remove; teal_slices may contain only dataname and varname, other elements are ignored

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    +

    +
    +
    +

    Method get_filter_state() +

    Gets reactive values from active FilterState objects.

    Get active filter state from FilterState objects stored in state_list(s). -The output is a list compatible with input to self$set_filter_state.

    -

    Usage

    -

    FilterStates$get_filter_state()

    +The output is a list compatible with input to self$set_filter_state.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$get_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    Object of class teal_slices.

    -


    -

    Method set_filter_state()

    -

    Sets active FilterState objects.

    -

    Usage

    -

    FilterStates$set_filter_state(state)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Sets active FilterState objects.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$set_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Function that raises an error.

    -


    -

    Method clear_filter_states()

    -

    Remove all FilterState objects from this FilterStates object.

    -

    Usage

    -

    FilterStates$clear_filter_states(force = FALSE)

    +
    +

    +
    +
    +

    Method clear_filter_states() +

    +

    Remove all FilterState objects from this FilterStates object.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$clear_filter_states(force = FALSE)
    +

    +
    -

    Arguments

    -

    force
    +

    Arguments +

    +

    +
    +
    +
    force

    (logical(1)) flag specifying whether to include anchored filter states.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method ui_active()

    +
    +

    +
    +
    +

    Method ui_active() +

    shiny UI definition that stores FilterState UI elements. -Populated with elements created with renderUI in the module server.

    -

    Usage

    -

    FilterStates$ui_active(id)

    +Populated with elements created with renderUI in the module server.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$ui_active(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_active()

    -

    shiny server module.

    -

    Usage

    -

    FilterStates$srv_active(id)

    +
    +

    +
    +
    +

    Method srv_active() +

    +

    shiny server module.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$srv_active(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL.

    -


    -

    Method ui_add()

    -

    shiny UI module to add filter variable.

    -

    Usage

    -

    FilterStates$ui_add(id)

    +
    +

    +
    +
    +

    Method ui_add() +

    +

    shiny UI module to add filter variable.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$ui_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_add()

    +
    +

    +
    +
    +

    Method srv_add() +

    shiny server module to add filter variable.

    This module controls available choices to select as a filter variable. Once selected, a variable is removed from available choices. -Removing a filter variable adds it back to available choices.

    -

    Usage

    -

    FilterStates$srv_add(id)

    +Removing a filter variable adds it back to available choices.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$srv_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL.

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    FilterStates$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -452,17 +699,19 @@

    Arguments

    + +
    + +
    - - + + diff --git a/v0.5.1-rc1/reference/FilteredData.html b/v0.5.1-rc1/reference/FilteredData.html index 5e690874d..cef5a5636 100644 --- a/v0.5.1-rc1/reference/FilteredData.html +++ b/v0.5.1-rc1/reference/FilteredData.html @@ -1,8 +1,24 @@ - -Class to encapsulate filtered datasets — FilteredData • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,7 +106,8 @@ + +
    -

    Methods

    +

    Methods +


    -

    Method new()

    -

    Initialize a FilteredData object.

    -

    Usage

    -

    FilteredData$new(data_objects, join_keys = teal.data::join_keys())

    + +
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilteredData object.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$new(data_objects, join_keys = teal.data::join_keys())
    +

    +
    -

    Arguments

    -

    data_objects
    +

    Arguments +

    +

    +
    +
    +
    data_objects

    (named list) List of data objects. Names of the list will be used as dataname for respective datasets.

    @@ -157,65 +204,113 @@

    Argumentsteal.data::join_keys().

    -

    +
    +

    +
    -


    -

    Method datanames()

    -

    Gets datanames.

    -

    Usage

    -

    FilteredData$datanames()

    +
    +

    +
    +
    +

    Method datanames() +

    +

    Gets datanames.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$datanames()
    +

    +
    -

    Details

    +

    Details +

    The datanames are returned in the order in which they must be evaluated (in case of dependencies).

    -

    Returns

    +

    Returns +

    Character vector.

    -


    -

    Method get_datalabel()

    +
    +

    +
    +
    +

    Method get_datalabel() +

    Gets data label for the dataset. -Useful to display in Show R Code.

    -

    Usage

    -

    FilteredData$get_datalabel(dataname)

    +Useful to display in Show R Code.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_datalabel(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Character string.

    -


    -

    Method set_available_teal_slices()

    -

    Set list of external filter states available for activation.

    -

    Usage

    -

    FilteredData$set_available_teal_slices(x)

    +
    +

    +
    +
    +

    Method set_available_teal_slices() +

    +

    Set list of external filter states available for activation.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$set_available_teal_slices(x)
    +

    +
    -

    Arguments

    -

    x
    +

    Arguments +

    +

    +
    +
    +
    x

    (reactive) should return teal_slices

    -

    +
    +

    +
    -

    Details

    +

    Details +

    Unlike adding new filter from the column, these filters can come with some prespecified settings. teal_slices are wrapped in a reactive so they can be updated from elsewhere in the app. Filters passed in x are limited to those that can be set for this FilteredData object, @@ -224,46 +319,76 @@

    Details -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method get_available_teal_slices()

    -

    Get list of filter states available for this object.

    -

    Usage

    -

    FilteredData$get_available_teal_slices()

    +
    +

    +
    +
    +

    Method get_available_teal_slices() +

    +

    Get list of filter states available for this object.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_available_teal_slices()
    +

    +
    -

    Details

    +

    Details +

    All teal_slice objects that have been created since the beginning of the app session are stored in one teal_slices object. This returns a subset of that teal_slices, describing filter states that can be set for this object.

    -

    Returns

    +

    Returns +

    reactive that returns teal_slices.

    -


    -

    Method get_call()

    -

    Gets a call to filter the dataset according to the filter state.

    -

    Usage

    -

    FilteredData$get_call(dataname)

    +
    +

    +
    +
    +

    Method get_call() +

    +

    Gets a call to filter the dataset according to the filter state.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset

    -

    +
    +

    +
    -

    Details

    +

    Details +

    It returns a call to filter the dataset only, assuming the other (filtered) datasets it depends on are available.

    Together with self$datanames() which returns the datasets in the correct @@ -277,21 +402,36 @@

    Details -

    Returns

    +

    Returns +

    A list of calls.

    -


    -

    Method get_data()

    +
    +

    +
    +
    +

    Method get_data() +

    Gets filtered or unfiltered dataset.

    -

    For filtered = FALSE, the original data set with set_data is returned including all attributes.

    -

    Usage

    -

    FilteredData$get_data(dataname, filtered = TRUE)

    +

    For filtered = FALSE, the original data set with set_data is returned including all attributes.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_data(dataname, filtered = TRUE)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset.

    @@ -299,77 +439,139 @@

    Arguments -

    Returns

    +

    Returns +

    A data object, a data.frame or a MultiAssayExperiment.

    -


    -

    Method get_join_keys()

    -

    Get join keys between two datasets.

    -

    Usage

    -

    FilteredData$get_join_keys()

    +
    +

    +
    +
    +

    Method get_join_keys() +

    +

    Get join keys between two datasets.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_join_keys()
    +

    +
    -

    Returns

    +

    Returns +

    join_keys

    -


    -

    Method get_filter_overview()

    +
    +

    +
    +
    +

    Method get_filter_overview() +

    Creates filter overview table to be displayed in the application. One row is created per dataset, according to the get_filter_overview methods -of the contained FilteredDataset objects.

    -

    Usage

    -

    FilteredData$get_filter_overview(datanames)

    +of the contained FilteredDataset objects.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_filter_overview(datanames)
    +

    +
    -

    Arguments

    -

    datanames
    +

    Arguments +

    +

    +
    +
    +
    datanames

    (character) vector of dataset names.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    A data.frame listing the numbers of observations in all datasets.

    -


    -

    Method get_keys()

    -

    Get keys for the dataset.

    -

    Usage

    -

    FilteredData$get_keys(dataname)

    +
    +

    +
    +
    +

    Method get_keys() +

    +

    Get keys for the dataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_keys(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Character vector of key column names.

    -


    -

    Method set_dataset()

    -

    Adds a dataset to this FilteredData.

    -

    Usage

    -

    FilteredData$set_dataset(data, dataname)

    +
    +

    +
    +
    +

    Method set_dataset() +

    +

    Adds a dataset to this FilteredData.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$set_dataset(data, dataname)
    +

    +
    -

    Arguments

    -

    data
    +

    Arguments +

    +

    +
    +
    +
    data

    (data.frame or MultiAssayExperiment) data to be filtered.

    @@ -379,10 +581,13 @@

    Arguments -

    Details

    +

    Details +

    set_dataset creates a FilteredDataset object which keeps dataset for the filtering purpose. If this data has a parent specified in the join_keys object stored in private$join_keys then created FilteredDataset (child) gets linked with other FilteredDataset (parent). @@ -391,52 +596,95 @@

    Details -

    Returns

    +

    Returns +

    self, invisibly.

    -


    -

    Method set_join_keys()

    -

    Set the join_keys.

    -

    Usage

    -

    FilteredData$set_join_keys(join_keys)

    +
    +

    +
    +
    +

    Method set_join_keys() +

    +

    Set the join_keys.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$set_join_keys(join_keys)
    +

    +
    -

    Arguments

    -

    join_keys
    +

    Arguments +

    +

    +
    +
    +
    join_keys

    (join_keys), see teal.data::join_keys().

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    self, invisibly.

    -


    -

    Method get_filter_state()

    -

    Gets states of all contained FilterState objects.

    -

    Usage

    -

    FilteredData$get_filter_state()

    +
    +

    +
    +
    +

    Method get_filter_state() +

    +

    Gets states of all contained FilterState objects.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    A teal_slices object.

    -


    -

    Method format()

    -

    Returns a formatted string representing this FilteredData object.

    -

    Usage

    -

    FilteredData$format(show_all = FALSE, trim_lines = TRUE)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns a formatted string representing this FilteredData object.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$format(show_all = FALSE, trim_lines = TRUE)
    +

    +
    -

    Arguments

    -

    show_all
    +

    Arguments +

    +

    +
    +
    +
    show_all

    (logical(1)) passed to format.teal_slice.

    @@ -444,81 +692,148 @@

    Arguments -

    Returns

    +

    Returns +

    character(1) the formatted string.

    -


    -

    Method print()

    -

    Prints this FilteredData object.

    -

    Usage

    -

    FilteredData$print(...)

    +
    +

    +
    +
    +

    Method print() +

    +

    Prints this FilteredData object.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$print(...)
    +

    +
    -

    Arguments

    -

    ...
    +

    Arguments +

    +

    +
    +
    +
    ...

    additional arguments passed to format.

    -

    +
    +

    +
    -


    -

    Method set_filter_state()

    -

    Sets active filter states.

    -

    Usage

    -

    FilteredData$set_filter_state(state)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Sets active filter states.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$set_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method remove_filter_state()

    -

    Removes one or more FilterState from a FilteredData object.

    -

    Usage

    -

    FilteredData$remove_filter_state(state)

    +
    +

    +
    +
    +

    Method remove_filter_state() +

    +

    Removes one or more FilterState from a FilteredData object.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$remove_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices) specifying FilterState objects to remove; teal_slices may contain only dataname and varname, other elements are ignored.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method clear_filter_states()

    -

    Remove all FilterStates of a FilteredDataset or all FilterStates of a FilteredData object.

    -

    Usage

    -

    FilteredData$clear_filter_states(datanames = self$datanames(), force = FALSE)

    +
    +

    +
    +
    +

    Method clear_filter_states() +

    +

    Remove all FilterStates of a FilteredDataset or all FilterStates of a FilteredData object.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$clear_filter_states(datanames = self$datanames(), force = FALSE)
    +

    +
    -

    Arguments

    -

    datanames
    +

    Arguments +

    +

    +
    +
    +
    datanames

    (character) names of datasets for which to remove all filter states. Defaults to all datasets in this FilteredData object.

    @@ -529,45 +844,79 @@

    Arguments -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method ui_filter_panel()

    +
    +

    +
    +
    +

    Method ui_filter_panel() +

    top-level shiny module for the filter panel in the teal app. -Contains 1) filter overview panel, 2) filter active panel, and 3) add filters panel.

    -

    Usage

    -

    FilteredData$ui_filter_panel(id)

    +Contains 1) filter overview panel, 2) filter active panel, and 3) add filters panel.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$ui_filter_panel(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_filter_panel()

    -

    Server function for filter panel.

    -

    Usage

    -

    FilteredData$srv_filter_panel(id, active_datanames = self$datanames)

    +
    +

    +
    +
    +

    Method srv_filter_panel() +

    +

    Server function for filter panel.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$srv_filter_panel(id, active_datanames = self$datanames)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    @@ -580,44 +929,78 @@

    Arguments -

    Returns

    +

    Returns +

    NULL.

    -


    -

    Method ui_active()

    -

    Server module responsible for displaying active filters.

    -

    Usage

    -

    FilteredData$ui_active(id)

    +
    +

    +
    +
    +

    Method ui_active() +

    +

    Server module responsible for displaying active filters.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$ui_active(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_active()

    -

    Server module responsible for displaying active filters.

    -

    Usage

    -

    FilteredData$srv_active(id, active_datanames = self$datanames)

    +
    +

    +
    +
    +

    Method srv_active() +

    +

    Server module responsible for displaying active filters.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$srv_active(id, active_datanames = self$datanames)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    @@ -627,44 +1010,78 @@

    Arguments -

    Returns

    +

    Returns +

    NULL.

    -


    -

    Method ui_add()

    -

    Server module responsible for displaying drop-downs with variables to add a filter.

    -

    Usage

    -

    FilteredData$ui_add(id)

    +
    +

    +
    +
    +

    Method ui_add() +

    +

    Server module responsible for displaying drop-downs with variables to add a filter.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$ui_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_add()

    -

    Server module responsible for displaying drop-downs with variables to add a filter.

    -

    Usage

    -

    FilteredData$srv_add(id, active_datanames = reactive(self$datanames()))

    +
    +

    +
    +
    +

    Method srv_add() +

    +

    Server module responsible for displaying drop-downs with variables to add a filter.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$srv_add(id, active_datanames = reactive(self$datanames()))
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    @@ -674,45 +1091,78 @@

    Arguments -

    Returns

    +

    Returns +

    NULL.

    -


    -

    Method ui_overview()

    +
    +

    +
    +
    +

    Method ui_overview() +

    Creates the UI definition for the module showing counts for each dataset contrasting the filtered to the full unfiltered dataset.

    Per dataset, it displays the number of rows/observations in each dataset, -the number of unique subjects.

    -

    Usage

    -

    FilteredData$ui_overview(id)

    +the number of unique subjects.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$ui_overview(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -


    -

    Method srv_overview()

    +
    +

    +
    +
    +

    Method srv_overview() +

    Server function to display the number of records in the filtered and unfiltered -data.

    -

    Usage

    -

    FilteredData$srv_overview(id, active_datanames = self$datanames)

    +data.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$srv_overview(id, active_datanames = self$datanames)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    @@ -725,27 +1175,46 @@

    Arguments -

    Returns

    +

    Returns +

    NULL.

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    FilteredData$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -753,7 +1222,8 @@

    Arguments -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     FilteredData <- getFromNamespace("FilteredData", "teal.slice")
     
    @@ -931,17 +1401,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.5.1-rc1/reference/FilteredDataset.html b/v0.5.1-rc1/reference/FilteredDataset.html index e09e98053..ca6a3587c 100644 --- a/v0.5.1-rc1/reference/FilteredDataset.html +++ b/v0.5.1-rc1/reference/FilteredDataset.html @@ -1,16 +1,32 @@ - - + + + + + +FilteredDataset R6 class — FilteredDataset • teal.slice +FilteredDataset R6 class — FilteredDataset • teal.slice + + + + + + + + + + Skip to contents @@ -26,7 +42,8 @@ + +
    @@ -96,12 +119,15 @@
    -

    Methods

    +

    Methods +


    -

    Method new()

    -

    Initializes this FilteredDataset object.

    -

    Usage

    -

    +

    +
    +
    +

    Method new() +

    +

    Initializes this FilteredDataset object.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$new(
       dataset,
       dataname,
       keys = character(0),
       label = attr(dataset, "label", exact = TRUE)
    -)

    +)
    +

    +
    -

    Arguments

    -

    dataset
    +

    Arguments +

    +

    +
    +
    +
    dataset

    any object

    @@ -152,23 +193,40 @@

    Arguments -

    Returns

    +

    Returns +

    Object of class FilteredDataset, invisibly.

    -


    -

    Method format()

    -

    Returns a formatted string representing this FilteredDataset object.

    -

    Usage

    -

    FilteredDataset$format(show_all = FALSE, trim_lines = TRUE)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns a formatted string representing this FilteredDataset object.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$format(show_all = FALSE, trim_lines = TRUE)
    +

    +
    -

    Arguments

    -

    show_all
    +

    Arguments +

    +

    +
    +
    +
    show_all

    (logical(1)) passed to format.teal_slice.

    @@ -176,289 +234,526 @@

    Arguments -

    Returns

    +

    Returns +

    The formatted character string.

    -


    -

    Method print()

    -

    Prints this FilteredDataset object.

    -

    Usage

    -

    FilteredDataset$print(...)

    +
    +

    +
    +
    +

    Method print() +

    +

    Prints this FilteredDataset object.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$print(...)
    +

    +
    -

    Arguments

    -

    ...
    +

    Arguments +

    +

    +
    +
    +
    ...

    additional arguments passed to format.

    -

    +
    +

    +
    -


    -

    Method clear_filter_states()

    -

    Removes all filter items applied to this dataset.

    -

    Usage

    -

    FilteredDataset$clear_filter_states(force = FALSE)

    +
    +

    +
    +
    +

    Method clear_filter_states() +

    +

    Removes all filter items applied to this dataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$clear_filter_states(force = FALSE)
    +

    +
    -

    Arguments

    -

    force
    +

    Arguments +

    +

    +
    +
    +
    force

    (logical(1)) flag specifying whether to include anchored filter states.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL.

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Gets a filter expression.

    This function returns filter calls equivalent to selected items within each of filter_states. Configuration of the calls is constant and -depends on filter_states type and order which are set during initialization.

    -

    Usage

    -

    FilteredDataset$get_call(sid = "")

    +depends on filter_states type and order which are set during initialization.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_call(sid = "")
    +

    +
    -

    Arguments

    -

    sid
    +

    Arguments +

    +

    +
    +
    +
    sid

    (character) when specified, the method returns code containing conditions calls of FilterState objects with sid different to this sid argument.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Either a list of filter calls, or NULL.

    -


    -

    Method get_filter_state()

    -

    Gets states of all contained FilterState objects.

    -

    Usage

    -

    FilteredDataset$get_filter_state()

    +
    +

    +
    +
    +

    Method get_filter_state() +

    +

    Gets states of all contained FilterState objects.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    A teal_slices object.

    -


    -

    Method set_filter_state()

    -

    Set filter state.

    -

    Usage

    -

    FilteredDataset$set_filter_state(state)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Set filter state.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$set_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Virtual method, returns nothing and raises error.

    -


    -

    Method get_filter_count()

    -

    Gets the number of FilterState objects in all FilterStates in this FilteredDataset.

    -

    Usage

    -

    FilteredDataset$get_filter_count()

    +
    +

    +
    +
    +

    Method get_filter_count() +

    +

    Gets the number of FilterState objects in all FilterStates in this FilteredDataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_filter_count()
    +

    +
    -

    Returns

    +

    Returns +

    integer(1)

    -


    -

    Method get_dataname()

    -

    Gets the name of the dataset.

    -

    Usage

    -

    FilteredDataset$get_dataname()

    +
    +

    +
    +
    +

    Method get_dataname() +

    +

    Gets the name of the dataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_dataname()
    +

    +
    -

    Returns

    +

    Returns +

    A character string.

    -


    -

    Method get_dataset()

    -

    Gets the dataset object in this FilteredDataset.

    -

    Usage

    -

    FilteredDataset$get_dataset(filtered = FALSE)

    +
    +

    +
    +
    +

    Method get_dataset() +

    +

    Gets the dataset object in this FilteredDataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_dataset(filtered = FALSE)
    +

    +
    -

    Arguments

    -

    filtered
    +

    Arguments +

    +

    +
    +
    +
    filtered

    (logical(1))

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    The stored dataset. If data.frame or MultiAssayExperiment, either raw or as a reactive with current filters applied (depending on filtered).

    -


    -

    Method get_filter_overview()

    -

    Get filter overview of a dataset.

    -

    Usage

    -

    FilteredDataset$get_filter_overview()

    +
    +

    +
    +
    +

    Method get_filter_overview() +

    +

    Get filter overview of a dataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_filter_overview()
    +

    +
    -

    Returns

    +

    Returns +

    Virtual method, returns nothing and raises an error.

    -


    -

    Method get_keys()

    -

    Gets the key columns for this dataset.

    -

    Usage

    -

    FilteredDataset$get_keys()

    +
    +

    +
    +
    +

    Method get_keys() +

    +

    Gets the key columns for this dataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_keys()
    +

    +
    -

    Returns

    +

    Returns +

    Character vector of variable names

    -


    -

    Method get_dataset_label()

    -

    Gets the dataset label.

    -

    Usage

    -

    FilteredDataset$get_dataset_label()

    +
    +

    +
    +
    +

    Method get_dataset_label() +

    +

    Gets the dataset label.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_dataset_label()
    +

    +
    -

    Returns

    +

    Returns +

    Character string.

    -


    -

    Method ui_active()

    -

    shiny module containing active filters for a dataset, along with a title and a remove button.

    -

    Usage

    -

    FilteredDataset$ui_active(id)

    +
    +

    +
    +
    +

    Method ui_active() +

    +

    shiny module containing active filters for a dataset, along with a title and a remove button.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$ui_active(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_active()

    -

    Server module for a dataset active filters.

    -

    Usage

    -

    FilteredDataset$srv_active(id)

    +
    +

    +
    +
    +

    Method srv_active() +

    +

    Server module for a dataset active filters.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$srv_active(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL.

    -


    -

    Method ui_add()

    -

    UI module to add filter variable for this dataset.

    -

    Usage

    -

    FilteredDataset$ui_add(id)

    +
    +

    +
    +
    +

    Method ui_add() +

    +

    UI module to add filter variable for this dataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$ui_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Virtual method, returns nothing and raises error.

    -


    -

    Method srv_add()

    +
    +

    +
    +
    +

    Method srv_add() +

    Server module to add filter variable for this dataset. For this class srv_add calls multiple modules of the same name from FilterStates as MAEFilteredDataset -contains one FilterStates object for colData and one for each experiment.

    -

    Usage

    -

    FilteredDataset$srv_add(id)

    +contains one FilterStates object for colData and one for each experiment.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$srv_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL.

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    FilteredDataset$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -466,17 +761,19 @@

    Arguments

    + +
    + +
    - - + + diff --git a/v0.5.1-rc1/reference/LogicalFilterState.html b/v0.5.1-rc1/reference/LogicalFilterState.html index 68c34e73e..9e186e794 100644 --- a/v0.5.1-rc1/reference/LogicalFilterState.html +++ b/v0.5.1-rc1/reference/LogicalFilterState.html @@ -1,8 +1,24 @@ - -FilterState object for logical data — LogicalFilterState • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,40 +107,60 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterState -> LogicalFilterState

    +

    Inherited methods


    -

    Method new()

    -

    Initialize a FilterState object.

    -

    Usage

    -

    LogicalFilterState$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterState object.

    +
    +

    Usage +

    +

    +
    +
    LogicalFilterState$new(
       x,
       x_reactive = reactive(NULL),
       extract_type = character(0),
       slice
    -)

    +)
    +

    +
    -

    Arguments

    -

    x
    +

    Arguments +

    +

    + -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection. -For LogicalFilterState it's a !<varname> or <varname> and optionally is.na(<varname>)

    -

    Usage

    -

    LogicalFilterState$get_call(dataname)

    +For LogicalFilterState it's a !<varname> or <varname> and optionally is.na(<varname>)

    +
    +

    Usage +

    +

    +
    +
    LogicalFilterState$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    name of data set; defaults to private$get_dataname()

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    call

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    LogicalFilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    LogicalFilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -196,7 +279,8 @@

    Arguments -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     include_css_files <- getFromNamespace("include_css_files", "teal.slice")
     include_js_files <- getFromNamespace("include_js_files", "teal.slice")
    @@ -284,17 +368,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.5.1-rc1/reference/MAEFilterStates.html b/v0.5.1-rc1/reference/MAEFilterStates.html index e234b346d..2a22f92b4 100644 --- a/v0.5.1-rc1/reference/MAEFilterStates.html +++ b/v0.5.1-rc1/reference/MAEFilterStates.html @@ -1,8 +1,24 @@ - -FilterStates subclass for MultiAssayExperiments — MAEFilterStates • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,18 +107,25 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterStates -> MAEFilterStates

    -

    Methods

    +

    Methods +

    Inherited methods +
    +

    Inherited methods


    -

    Method new()

    -

    Initialize MAEFilterStates object.

    -

    Usage

    -

    MAEFilterStates$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize MAEFilterStates object.

    +
    +

    Usage +

    +

    +
    +
    MAEFilterStates$new(
       data,
       data_reactive = function(sid = "") NULL,
       dataname,
       datalabel = "subjects",
       keys = character(0)
    -)

    +)
    +

    +
    -

    Arguments

    -

    data
    +

    Arguments +

    +

    +
    +
    +
    data

    (MultiAssayExperiment) the R object which MultiAssayExperiment::subsetByColData function is applied on.

    @@ -155,23 +198,41 @@

    Arguments
    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    MAEFilterStates$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    MAEFilterStates$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -179,17 +240,19 @@

    Arguments

    + +

    + +
    - - + + diff --git a/v0.5.1-rc1/reference/MAEFilteredDataset.html b/v0.5.1-rc1/reference/MAEFilteredDataset.html index 075ae5c20..de644fd92 100644 --- a/v0.5.1-rc1/reference/MAEFilteredDataset.html +++ b/v0.5.1-rc1/reference/MAEFilteredDataset.html @@ -1,10 +1,26 @@ - -MAEFilteredDataset R6 class — MAEFilteredDataset • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + +
    @@ -87,22 +110,29 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilteredDataset -> MAEFilteredDataset

    +

    Inherited methods


    -

    Method new()

    -

    Initialize MAEFilteredDataset object.

    -

    Usage

    -

    MAEFilteredDataset$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize MAEFilteredDataset object.

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$new(
       dataset,
       dataname,
       keys = character(0),
       label = character(0)
    -)

    +)
    +

    +
    -

    Arguments

    -

    dataset
    +

    Arguments +

    +

    +
    +
    +
    dataset

    (MulitiAssayExperiment) single MulitiAssayExperiment for which filters are rendered.

    @@ -149,102 +192,183 @@

    Arguments -

    Returns

    +

    Returns +

    Object of class MAEFilteredDataset, invisibly.

    -


    -

    Method set_filter_state()

    -

    Set filter state.

    -

    Usage

    -

    MAEFilteredDataset$set_filter_state(state)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Set filter state.

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$set_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method remove_filter_state()

    -

    Remove one or more FilterState of a MAEFilteredDataset.

    -

    Usage

    -

    MAEFilteredDataset$remove_filter_state(state)

    +
    +

    +
    +
    +

    Method remove_filter_state() +

    +

    Remove one or more FilterState of a MAEFilteredDataset.

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$remove_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices) specifying FilterState objects to remove; teal_slices may contain only dataname and varname, other elements are ignored.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method ui_add()

    -

    UI module to add filter variable for this dataset.

    -

    Usage

    -

    MAEFilteredDataset$ui_add(id)

    +
    +

    +
    +
    +

    Method ui_add() +

    +

    UI module to add filter variable for this dataset.

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$ui_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method get_filter_overview()

    -

    Creates row for filter overview in the form of
    dataname -- observations (remaining/total) -- subjects (remaining/total) - MAE

    -

    Usage

    -

    MAEFilteredDataset$get_filter_overview()

    +
    +

    +
    +
    +

    Method get_filter_overview() +

    +

    Creates row for filter overview in the form of
    dataname -- observations (remaining/total) -- subjects (remaining/total) - MAE

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$get_filter_overview()
    +

    +
    -

    Returns

    +

    Returns +

    A data.frame.

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    MAEFilteredDataset$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -252,7 +376,8 @@

    Arguments -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     MAEFilteredDataset <- getFromNamespace("MAEFilteredDataset", "teal.slice")
     
    @@ -324,17 +449,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.5.1-rc1/reference/MatrixFilterStates.html b/v0.5.1-rc1/reference/MatrixFilterStates.html index 4745975bd..ae136b858 100644 --- a/v0.5.1-rc1/reference/MatrixFilterStates.html +++ b/v0.5.1-rc1/reference/MatrixFilterStates.html @@ -1,8 +1,24 @@ - -FilterStates subclass for matrices — MatrixFilterStates • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,18 +107,25 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterStates -> MatrixFilterStates

    -

    Methods

    +

    Methods +

    Inherited methods +
    +

    Inherited methods


    -

    Method new()

    -

    Initialize MatrixFilterStates object.

    -

    Usage

    -

    MatrixFilterStates$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize MatrixFilterStates object.

    +
    +

    Usage +

    +

    +
    +
    MatrixFilterStates$new(
       data,
       data_reactive = function(sid = "") NULL,
       dataname,
       datalabel = NULL
    -)

    +)
    +

    +
    -

    Arguments

    -

    data
    +

    Arguments +

    +

    +
    +
    +
    data

    (matrix) the R object which subset function is applied on.

    @@ -144,23 +187,41 @@

    Arguments
    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    MatrixFilterStates$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    MatrixFilterStates$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -168,17 +229,19 @@

    Arguments

    + +

    + +
    - - + + diff --git a/v0.5.1-rc1/reference/RangeFilterState.html b/v0.5.1-rc1/reference/RangeFilterState.html index be948086c..9220dd9be 100644 --- a/v0.5.1-rc1/reference/RangeFilterState.html +++ b/v0.5.1-rc1/reference/RangeFilterState.html @@ -1,8 +1,24 @@ - -FilterState object for numeric data — RangeFilterState • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,41 +107,61 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterState -> RangeFilterState

    +

    Inherited methods


    -

    Method new()

    -

    Initialize a FilterState object for range selection.

    -

    Usage

    -

    RangeFilterState$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterState object for range selection.

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$new(
       x,
       x_reactive = reactive(NULL),
       extract_type = character(0),
       slice
    -)

    +)
    +

    +
    -

    Arguments

    -

    x
    +

    Arguments +

    +

    + -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection. For this class returned call looks like <varname> >= <min value> & <varname> <= <max value> with -optional is.na(<varname>) and is.finite(<varname>).

    -

    Usage

    -

    RangeFilterState$get_call(dataname)

    +optional is.na(<varname>) and is.finite(<varname>).

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    name of data set; defaults to private$get_dataname()

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    call

    -


    -

    Method get_keep_inf()

    -

    Returns current keep_inf selection.

    -

    Usage

    -

    RangeFilterState$get_keep_inf()

    +
    +

    +
    +
    +

    Method get_keep_inf() +

    +

    Returns current keep_inf selection.

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$get_keep_inf()
    +

    +
    -

    Returns

    +

    Returns +

    logical(1)

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    RangeFilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -211,7 +305,8 @@

    Arguments -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     include_css_files <- getFromNamespace("include_css_files", "teal.slice")
     include_js_files <- getFromNamespace("include_js_files", "teal.slice")
    @@ -327,17 +422,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.5.1-rc1/reference/SEFilterStates.html b/v0.5.1-rc1/reference/SEFilterStates.html index e1d50e7d4..2c9d32573 100644 --- a/v0.5.1-rc1/reference/SEFilterStates.html +++ b/v0.5.1-rc1/reference/SEFilterStates.html @@ -1,8 +1,24 @@ - -FilterStates subclass for SummarizedExperiments — SEFilterStates • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,21 +107,28 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterStates -> SEFilterStates

    +

    Inherited methods


    -

    Method new()

    -

    Initialize SEFilterStates object.

    -

    Usage

    -

    SEFilterStates$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize SEFilterStates object.

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$new(
       data,
       data_reactive = function(sid = "") NULL,
       dataname,
       datalabel = NULL
    -)

    +)
    +

    +
    -

    Arguments

    -

    data
    +

    Arguments +

    +

    +
    +
    +
    data

    (SummarizedExperiment) the R object which subset function is applied on.

    @@ -144,92 +187,161 @@

    Arguments
    -

    Method set_filter_state()

    -

    Set filter state.

    -

    Usage

    -

    SEFilterStates$set_filter_state(state)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Set filter state.

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$set_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices) teal_slice objects should contain the field arg %in% c("subset", "select")

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method ui_add()

    -

    shiny UI module to add filter variable.

    -

    Usage

    -

    SEFilterStates$ui_add(id)

    +
    +

    +
    +
    +

    Method ui_add() +

    +

    shiny UI module to add filter variable.

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$ui_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_add()

    +
    +

    +
    +
    +

    Method srv_add() +

    shiny server module to add filter variable.

    Module controls available choices to select as a filter variable. Selected filter variable is being removed from available choices. Removed filter variable gets back to available choices. This module unlike other FilterStates classes manages two sets of filter variables - one for colData and another for -rowData.

    -

    Usage

    -

    SEFilterStates$srv_add(id)

    +rowData.

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$srv_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    SEFilterStates$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -237,17 +349,19 @@

    Arguments

    + +
    + +
    - - + + diff --git a/v0.5.1-rc1/reference/calls_combine_by.html b/v0.5.1-rc1/reference/calls_combine_by.html index 65b87d277..692c31fa1 100644 --- a/v0.5.1-rc1/reference/calls_combine_by.html +++ b/v0.5.1-rc1/reference/calls_combine_by.html @@ -1,8 +1,24 @@ - -Compose predicates — calls_combine_by • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +

    @@ -83,13 +105,16 @@
    -

    Usage

    +

    Usage +

    calls_combine_by(calls, operator)
    -

    Arguments

    -
    calls
    +

    Arguments +

    +
    +
    calls

    (list) containing calls (or symbols) to be combined by operator

    @@ -98,21 +123,25 @@

    Arguments

    -

    + +
    -

    Value

    +

    Value +

    A call where elements of calls are composed with operator or NULL if calls is an empty list.

    -

    Details

    +

    Details +

    This function is used to combine logical predicates produced by FilterState objects to build a complete subset expression.

    -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     calls_combine_by <- getFromNamespace("calls_combine_by", "teal.slice")
     
    @@ -127,17 +156,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.5.1-rc1/reference/check_simple_name.html b/v0.5.1-rc1/reference/check_simple_name.html index 07a32394b..68ee98b31 100644 --- a/v0.5.1-rc1/reference/check_simple_name.html +++ b/v0.5.1-rc1/reference/check_simple_name.html @@ -1,14 +1,30 @@ - - + + + + + +Test whether variable name can be used within Show R Code — check_simple_name • teal.slice +Test whether variable name can be used within Show R Code — check_simple_name • teal.slice + + + + + + + + + + Skip to contents @@ -24,7 +40,8 @@ + +
    @@ -92,35 +115,42 @@
    -

    Usage

    +

    Usage +

    check_simple_name(name)
    -

    Arguments

    -
    name
    +

    Arguments +

    +
    +
    name

    (character) vector of names to check

    -
    + +
    -

    Value

    +

    Value +

    Returns NULL or raises error.

    + +
    + +
    - - + + diff --git a/v0.5.1-rc1/reference/choices_labeled.html b/v0.5.1-rc1/reference/choices_labeled.html index 08bb980b8..0dc4ec4d3 100644 --- a/v0.5.1-rc1/reference/choices_labeled.html +++ b/v0.5.1-rc1/reference/choices_labeled.html @@ -1,10 +1,26 @@ - -Set "<choice>:<label>" type of names — choices_labeled • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + +
    @@ -86,13 +108,16 @@
    -

    Usage

    +

    Usage +

    choices_labeled(choices, labels, subset = NULL, types = NULL)
    -

    Arguments

    -
    choices
    +

    Arguments +

    +
    +
    choices

    (character or numeric or logical) vector

    @@ -110,31 +135,36 @@

    Arguments -

    Value

    +

    Value +

    A named character vector.

    -

    Details

    +

    Details +

    If either choices or labels are factors, they are coerced to character. Duplicated elements from choices get removed.

    + +
    + +
    - - + + diff --git a/v0.5.1-rc1/reference/coalesce_r.html b/v0.5.1-rc1/reference/coalesce_r.html index 100dd18d9..3af1e6887 100644 --- a/v0.5.1-rc1/reference/coalesce_r.html +++ b/v0.5.1-rc1/reference/coalesce_r.html @@ -1,8 +1,24 @@ - -Recursively coalesce list elements. — coalesce_r • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,24 +105,30 @@
    -

    Usage

    +

    Usage +

    coalesce_r(x)
    -

    Arguments

    -
    x
    +

    Arguments +

    +
    +
    x

    (list), either of atomic vectors or of named lists

    -
    + +
    -

    Value

    +

    Value +

    Either an atomic vector of length 1 or a (potentially nested) list.

    -

    Details

    +

    Details +

    Given a list of atomic vectors, the first non-null element is returned. Given a list of lists, for all names found in all elements of the list the first non-null element of a given name is returned.

    @@ -108,17 +136,19 @@

    Details

    + +
    + +
    - - + + diff --git a/v0.5.1-rc1/reference/countBar.html b/v0.5.1-rc1/reference/countBar.html index 64d821d2c..5e9c0487e 100644 --- a/v0.5.1-rc1/reference/countBar.html +++ b/v0.5.1-rc1/reference/countBar.html @@ -1,8 +1,24 @@ - -Progress bar with label — countBar • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,7 +105,8 @@
    -

    Usage

    +

    Usage +

    countBar(inputId, label, countmax, countnow = NULL, counttotal = countmax)
     
     updateCountBar(
    @@ -105,8 +128,10 @@ 

    Usage

    -

    Arguments

    -
    inputId
    +

    Arguments +

    +
    +
    inputId

    (character(1)) shiny id of the parent element (e.g. a check-box group input).

    @@ -129,32 +154,40 @@

    Arguments -

    Value

    +

    Value +

    shiny.tag object with a progress bar and a label.

    -

    Details

    -

    A progress bar is created to visualize the number of counts in a variable, with filling and a text label.

    • progress bar width is derived as a fraction of the container width: style = "width: <countmax> / <counttotal>%",

    • +

      Details +

      +

      A progress bar is created to visualize the number of counts in a variable, with filling and a text label.

      +
        +
      • progress bar width is derived as a fraction of the container width: style = "width: <countmax> / <counttotal>%",

      • progress bar is filled up to the fraction <countnow> / <countmax>,

      • text label is obtained by <label> (<countnow> / <countmax>).

      • -
    + +
    + +
    + +
    - - + + diff --git a/v0.5.1-rc1/reference/countBars.html b/v0.5.1-rc1/reference/countBars.html index 9a9ab86c1..0fc83c820 100644 --- a/v0.5.1-rc1/reference/countBars.html +++ b/v0.5.1-rc1/reference/countBars.html @@ -1,8 +1,24 @@ - -Progress bars with labels — countBars • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,7 +105,8 @@
    -

    Usage

    +

    Usage +

    countBars(inputId, choices, countsmax, countsnow = NULL)
     
     updateCountBars(
    @@ -96,8 +119,10 @@ 

    Usage

    -

    Arguments

    -
    inputId
    +

    Arguments +

    +
    +
    inputId

    (character(1)) shiny id of the parent element (e.g. a check-box group input).

    @@ -116,9 +141,11 @@

    Arguments -

    Value

    +

    Value +

    List of shiny.tags.

    @@ -138,7 +165,8 @@

    Value

    -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     include_js_files <- getFromNamespace("include_js_files", "teal.slice")
     include_css_files <- getFromNamespace("include_css_files", "teal.slice")
    @@ -190,17 +218,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.5.1-rc1/reference/data_choices_labeled.html b/v0.5.1-rc1/reference/data_choices_labeled.html index c8b28de43..5ee5c15f3 100644 --- a/v0.5.1-rc1/reference/data_choices_labeled.html +++ b/v0.5.1-rc1/reference/data_choices_labeled.html @@ -1,8 +1,24 @@ - -Returns a choices_labeled object — data_choices_labeled • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,7 +105,8 @@
    -

    Usage

    +

    Usage +

    data_choices_labeled(
       data,
       choices,
    @@ -93,8 +116,10 @@ 

    Usage

    -

    Arguments

    -
    data
    +

    Arguments +

    +
    +
    data

    (data.frame or DFrame or list) where labels can be taken from in case when varlabels is not specified. data must be specified if varlabels is not specified.

    @@ -114,26 +139,30 @@

    Arguments -

    Value

    +

    Value +

    character(0) if choices are empty; a choices_labeled object otherwise

    + +
    + +
    - - + + diff --git a/v0.5.1-rc1/reference/dot-table.html b/v0.5.1-rc1/reference/dot-table.html index 1c69f977b..a2891a07b 100644 --- a/v0.5.1-rc1/reference/dot-table.html +++ b/v0.5.1-rc1/reference/dot-table.html @@ -1,8 +1,24 @@ - -table handling POSIXlt — .table • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,35 +107,42 @@
    -

    Usage

    +

    Usage +

    .table(x)
    -

    Arguments

    -
    x
    +

    Arguments +

    +
    +
    x

    (vector) variable to get counts from.

    -
    + +
    -

    Value

    +

    Value +

    vector of counts named by unique values of x.

    + +
    + + - - + + diff --git a/v0.5.1-rc1/reference/eval_expr_with_msg.html b/v0.5.1-rc1/reference/eval_expr_with_msg.html index ef4d0af0d..2b8f47f10 100644 --- a/v0.5.1-rc1/reference/eval_expr_with_msg.html +++ b/v0.5.1-rc1/reference/eval_expr_with_msg.html @@ -1,12 +1,28 @@ - - + + + + + +Evaluate expression with meaningful message — eval_expr_with_msg • teal.slice +Evaluate expression with meaningful message — eval_expr_with_msg • teal.slice + + + + + + + + + + Skip to contents @@ -22,7 +38,8 @@ + + @@ -89,39 +111,46 @@
    -

    Usage

    +

    Usage +

    eval_expr_with_msg(expr, env)
    -

    Arguments

    -
    expr
    +

    Arguments +

    +
    +
    expr

    (language)

    env

    (environment) where expression is evaluated.

    -
    + +
    -

    Value

    +

    Value +

    NULL, invisibly.

    + + + + - - + + diff --git a/v0.5.1-rc1/reference/fetch_bs_color.html b/v0.5.1-rc1/reference/fetch_bs_color.html index 8911cbc5c..e07252870 100644 --- a/v0.5.1-rc1/reference/fetch_bs_color.html +++ b/v0.5.1-rc1/reference/fetch_bs_color.html @@ -1,8 +1,24 @@ - -Get hex code of the current Bootstrap theme color. — fetch_bs_color • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -83,13 +105,16 @@
    -

    Usage

    +

    Usage +

    fetch_bs_color(color, alpha = NULL)
    -

    Arguments

    -
    color
    +

    Arguments +

    +
    +
    color

    (character(1)) naming one of the available theme colors

    @@ -98,16 +123,19 @@

    Arguments -

    Value

    +

    Value +

    Named character(1) containing a hexadecimal color representation.

    -

    Examples

    +

    Examples +

    fetch_bs_color <- getFromNamespace("fetch_bs_color", "teal.slice")
     fetch_bs_color("primary")
     #> [1] "#0d6efd"
    @@ -119,17 +147,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/v0.5.1-rc1/reference/filter_state_api.html b/v0.5.1-rc1/reference/filter_state_api.html index 377d718a1..6ae3e54ee 100644 --- a/v0.5.1-rc1/reference/filter_state_api.html +++ b/v0.5.1-rc1/reference/filter_state_api.html @@ -1,10 +1,26 @@ - -Managing FilteredData states — filter_state_api • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + @@ -86,7 +108,8 @@
    -

    Usage

    +

    Usage +

    set_filter_state(datasets, filter)
     
     get_filter_state(datasets)
    @@ -97,11 +120,15 @@ 

    Usage

    -

    Arguments

    -
    datasets
    -

    (FilteredData) +

    Arguments +

    +
    +
    datasets
    +
    +

    (FilteredData) object to store filter state and filtered datasets, shared across modules

    -

    see FilteredData for details

    +

    see FilteredData for details

    +
    filter
    @@ -113,22 +140,28 @@

    Arguments -

    Value

    +

    Value +

    -
    • set_*, remove_* and clear_filter_state return NULL invisibly

    • +
        +
      • set_*, remove_* and clear_filter_state return NULL invisibly

      • get_filter_state returns a named teal_slices object containing a teal_slice for every existing FilterState

      • -
    + +
    -

    See also

    +

    See also +

    -

    Examples

    +

    Examples +

    datasets <- init_filtered_data(list(iris = iris, mtcars = mtcars))
     fs <- teal_slices(
       teal_slice(dataname = "iris", varname = "Species", selected = c("setosa", "versicolor")),
    @@ -271,17 +304,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/v0.5.1-rc1/reference/format_time.html b/v0.5.1-rc1/reference/format_time.html index c948a2431..86a8744c8 100644 --- a/v0.5.1-rc1/reference/format_time.html +++ b/v0.5.1-rc1/reference/format_time.html @@ -1,8 +1,24 @@ - -Format POSIXt for storage — format_time • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -83,40 +105,48 @@
    -

    Usage

    +

    Usage +

    format_time(x)
    -

    Arguments

    -
    x
    +

    Arguments +

    +
    +
    x

    (POSIXt) vector of date time values or anything else

    -
    + +
    -

    Value

    +

    Value +

    If x is of class POSIXt, a character vector, otherwise x itself.

    -

    Details

    +

    Details +

    Date times are stored as string representations expressed in the UTC time zone. The storage format is YYYY-MM-DD HH:MM:SS.

    + + + + - - + + diff --git a/v0.5.1-rc1/reference/get_default_slice_id.html b/v0.5.1-rc1/reference/get_default_slice_id.html index a06a0a524..855a27f1c 100644 --- a/v0.5.1-rc1/reference/get_default_slice_id.html +++ b/v0.5.1-rc1/reference/get_default_slice_id.html @@ -1,8 +1,24 @@ - -Default teal_slice id — get_default_slice_id • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -83,48 +105,59 @@
    -

    Usage

    +

    Usage +

    get_default_slice_id(x)
    -

    Arguments

    -
    x
    +

    Arguments +

    +
    +
    x

    (teal_slice or list)

    -
    + +
    -

    Value

    +

    Value +

    (character(1)) id for a teal_slice object.

    -

    Details

    +

    Details +

    Function returns a default id for a teal_slice object which needs to be distinct from other teal_slice objects created for any FilterStates object. Returned id can be treated as a location of -a vector on which FilterState is built:

    • for a data.frame id concatenates dataname and varname.

    • +a vector on which FilterState is built:

      +
        +
      • for a data.frame id concatenates dataname and varname.

      • for a MultiAssayExperiment id concatenates dataname, varname, experiment and arg, so that one can add teal_slice for a varname which exists in multiple SummarizedExperiments or exists in both colData and rowData of given experiment. For such a vector teal.slice doesn't allow to activate more than one filters. In case of teal_slice_expr id is mandatory and must be unique.

      • -
    + + + + + + - - + + diff --git a/v0.5.1-rc1/reference/get_filter_expr.html b/v0.5.1-rc1/reference/get_filter_expr.html index 3ecb0168d..cbc3af0fd 100644 --- a/v0.5.1-rc1/reference/get_filter_expr.html +++ b/v0.5.1-rc1/reference/get_filter_expr.html @@ -1,10 +1,26 @@ - -Gets filter expression for multiple datanames taking into account its order. — get_filter_expr • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + @@ -86,39 +108,46 @@
    -

    Usage

    +

    Usage +

    get_filter_expr(datasets, datanames = datasets$datanames())
    -

    Arguments

    -
    datasets
    +

    Arguments +

    +
    +
    datasets

    (FilteredData)

    datanames

    (character) vector of dataset names

    -
    + +
    -

    Value

    +

    Value +

    A character string containing all subset expressions.

    + + + + - - + + diff --git a/v0.5.1-rc1/reference/get_supported_filter_varnames.html b/v0.5.1-rc1/reference/get_supported_filter_varnames.html index a0d5387b3..6c1cf1f32 100644 --- a/v0.5.1-rc1/reference/get_supported_filter_varnames.html +++ b/v0.5.1-rc1/reference/get_supported_filter_varnames.html @@ -1,10 +1,26 @@ - -Gets supported filterable variable names — get_supported_filter_varnames • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + @@ -86,25 +108,31 @@
    -

    Usage

    +

    Usage +

    get_supported_filter_varnames(data)
    -

    Arguments

    -
    data
    +

    Arguments +

    +
    +
    data

    the R object containing elements which class can be checked through vapply or apply.

    -
    + +
    -

    Value

    +

    Value +

    character vector of variable names.

    -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     get_supported_filter_varnames <- getFromNamespace("get_supported_filter_varnames", "teal.slice")
     
    @@ -120,17 +148,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/v0.5.1-rc1/reference/include_css_files.html b/v0.5.1-rc1/reference/include_css_files.html index f2bcc017b..3472b06fe 100644 --- a/v0.5.1-rc1/reference/include_css_files.html +++ b/v0.5.1-rc1/reference/include_css_files.html @@ -1,12 +1,28 @@ - - + + + + + +Include CSS files from /inst/css/ package directory to application header — include_css_files • teal.slice +Include CSS files from /inst/css/ package directory to application header — include_css_files • teal.slice + + + + + + + + + + Skip to contents @@ -22,7 +38,8 @@ + + @@ -89,35 +111,42 @@
    -

    Usage

    +

    Usage +

    include_css_files(pattern = "*")
    -

    Arguments

    -
    pattern
    +

    Arguments +

    +
    +
    pattern

    (character) pattern of files to be included

    -
    + +
    -

    Value

    +

    Value +

    HTML code that includes CSS files

    + + + + - - + + diff --git a/v0.5.1-rc1/reference/include_js_files.html b/v0.5.1-rc1/reference/include_js_files.html index 3013e1169..5aa882445 100644 --- a/v0.5.1-rc1/reference/include_js_files.html +++ b/v0.5.1-rc1/reference/include_js_files.html @@ -1,12 +1,28 @@ - - + + + + + +Include JS files from /inst/js/ package directory to application header — include_js_files • teal.slice +Include JS files from /inst/js/ package directory to application header — include_js_files • teal.slice + + + + + + + + + + Skip to contents @@ -22,7 +38,8 @@ + + @@ -89,35 +111,42 @@
    -

    Usage

    +

    Usage +

    include_js_files(pattern)
    -

    Arguments

    -
    pattern
    +

    Arguments +

    +
    +
    pattern

    (character) pattern of files to be included, passed to system.file

    -
    + +
    -

    Value

    +

    Value +

    HTML code that includes JS files

    + + + + - - + + diff --git a/v0.5.1-rc1/reference/index.html b/v0.5.1-rc1/reference/index.html index e753fa1f3..daa1c4f4c 100644 --- a/v0.5.1-rc1/reference/index.html +++ b/v0.5.1-rc1/reference/index.html @@ -1,8 +1,22 @@ - -Function reference • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -77,96 +97,129 @@
    -

    teal filter-panel API

    +

    +teal filter-panel API +

    Functions used initialize filter-panel and to modify its states.

    -
    +
    +
    -
    +
    +
    init_filtered_data()
    -
    Initialize FilteredData
    -
    +
    Initialize FilteredData +
    +
    +
    +
    set_filter_state() get_filter_state() remove_filter_state() clear_filter_states()
    Managing FilteredData states
    -
    +
    +
    +
    get_filter_expr()
    Gets filter expression for multiple datanames taking into account its order.
    -
    +
    +
    +
    teal_slice()
    Specify single filter
    -
    +
    +
    +
    teal_slices()
    Complete filter specification
    -
    -

    For developers

    + +
    +
    +

    For developers +

    Abstract and concrete classes used to build teal functionality.

    -
    +
    +
    -

    R6 Classes

    +

    R6 Classes +

    Abstract and concrete classes used to build teal functionality.

    -
    +
    +
    -
    +
    +
    FilteredData
    Class to encapsulate filtered datasets
    -
    +
    +
    +
    FilteredDataset
    -
    FilteredDataset R6 class
    -
    +
    +FilteredDataset R6 class
    +
    +
    +
    FilterPanelAPI
    Class to encapsulate the API of the filter panel of a teal app
    -
    +
    +
    +
    DataframeFilteredDataset
    The DataframeFilteredDataset R6 class
    -
    +
    +
    +
    MAEFilteredDataset
    -
    MAEFilteredDataset R6 class
    -
    +
    +MAEFilteredDataset R6 class
    + + + + + + - - + + diff --git a/v0.5.1-rc1/reference/init_filter_state.html b/v0.5.1-rc1/reference/init_filter_state.html index e60ece6fc..1e536bc6b 100644 --- a/v0.5.1-rc1/reference/init_filter_state.html +++ b/v0.5.1-rc1/reference/init_filter_state.html @@ -1,8 +1,24 @@ - -Initialize FilterState — init_filter_state • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,7 +106,8 @@
    -

    Usage

    +

    Usage +

    init_filter_state(
       x,
       x_reactive = reactive(NULL),
    @@ -93,8 +117,10 @@ 

    Usage

    + +
    -

    Value

    +

    Value +

    FilterState object

    -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     init_filter_state <- getFromNamespace("init_filter_state", "teal.slice")
     
    @@ -172,17 +205,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/v0.5.1-rc1/reference/init_filter_state_expr.html b/v0.5.1-rc1/reference/init_filter_state_expr.html index e922a4357..ef4524df9 100644 --- a/v0.5.1-rc1/reference/init_filter_state_expr.html +++ b/v0.5.1-rc1/reference/init_filter_state_expr.html @@ -1,8 +1,24 @@ - -Initialize a FilterStateExpr object — init_filter_state_expr • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -83,36 +105,43 @@
    -

    Usage

    +

    Usage +

    init_filter_state_expr(slice)
    -

    Arguments

    -
    slice
    +

    Arguments +

    +
    +
    slice

    (teal_slice_expr) specifying this filter state.

    -
    + +
    -

    Value

    +

    Value +

    FilterStateExpr object

    + + + + - - + + diff --git a/v0.5.1-rc1/reference/init_filter_states.html b/v0.5.1-rc1/reference/init_filter_states.html index e039d1e65..2d0a2b1bc 100644 --- a/v0.5.1-rc1/reference/init_filter_states.html +++ b/v0.5.1-rc1/reference/init_filter_states.html @@ -1,8 +1,24 @@ - -Initialize FilterStates object — init_filter_states • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -83,7 +105,8 @@
    -

    Usage

    +

    Usage +

    init_filter_states(
       data,
       data_reactive = reactive(NULL),
    @@ -94,8 +117,10 @@ 

    Usage

    -

    Arguments

    -
    data
    +

    Arguments +

    +
    +
    data

    (data.frame or MultiAssayExperiment or SummarizedExperiment or matrix) object to subset.

    @@ -123,16 +148,19 @@

    Arguments -

    Value

    +

    Value +

    Object of class FilterStates.

    -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     init_filter_states <- getFromNamespace("init_filter_states", "teal.slice")
     
    @@ -171,17 +199,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/v0.5.1-rc1/reference/init_filtered_data.html b/v0.5.1-rc1/reference/init_filtered_data.html index 86ecbae25..376b5c200 100644 --- a/v0.5.1-rc1/reference/init_filtered_data.html +++ b/v0.5.1-rc1/reference/init_filtered_data.html @@ -1,8 +1,24 @@ - -Initialize FilteredData — init_filtered_data • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,13 +106,16 @@
    -

    Usage

    +

    Usage +

    init_filtered_data(x, join_keys = teal.data::join_keys(), code, check)
    -

    Arguments

    -
    x
    +

    Arguments +

    +
    +
    x

    (named list) of datasets.

    @@ -104,16 +130,19 @@

    Arguments[Deprecated]

    -

    + +
    -

    Value

    +

    Value +

    Object of class FilteredData.

    -

    Examples

    +

    Examples +

    datasets <- init_filtered_data(list(iris = iris, mtcars = mtcars))
     datasets
     #> FilteredData:
    @@ -132,17 +161,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/v0.5.1-rc1/reference/init_filtered_dataset.html b/v0.5.1-rc1/reference/init_filtered_dataset.html index bfa701847..47cccbbfc 100644 --- a/v0.5.1-rc1/reference/init_filtered_dataset.html +++ b/v0.5.1-rc1/reference/init_filtered_dataset.html @@ -1,8 +1,24 @@ - -Initialize FilteredDataset — init_filtered_dataset • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,7 +106,8 @@
    -

    Usage

    +

    Usage +

    init_filtered_dataset(
       dataset,
       dataname,
    @@ -96,8 +120,10 @@ 

    Usage

    -

    Arguments

    -
    dataset
    +

    Arguments +

    +
    +
    dataset

    any object

    @@ -133,15 +159,18 @@

    Arguments -

    Value

    +

    Value +

    Object of class FilteredDataset.

    -

    Warning

    +

    Warning +

    This function is exported to allow other packages to extend teal.slice but it is treated as internal. @@ -150,7 +179,8 @@

    Warning
    -

    Examples

    +

    Examples +

    # DataframeFilteredDataset example
     library(shiny)
     
    @@ -206,17 +236,19 @@ 

    Examples

    + +

    + +
    - - + + diff --git a/v0.5.1-rc1/reference/jsonify.html b/v0.5.1-rc1/reference/jsonify.html index 92a7010d1..5cb32b26b 100644 --- a/v0.5.1-rc1/reference/jsonify.html +++ b/v0.5.1-rc1/reference/jsonify.html @@ -1,12 +1,28 @@ - - + + + + + +Convert a list to a justified JSON string — jsonify • teal.slice +Convert a list to a justified JSON string — jsonify • teal.slice + + + + + + + + + + Skip to contents @@ -22,7 +38,8 @@ + +
    @@ -89,39 +111,46 @@
    -

    Usage

    +

    Usage +

    jsonify(x, trim_lines)
    -

    Arguments

    -
    x
    +

    Arguments +

    +
    +
    x

    (list), possibly recursive, obtained from teal_slice or teal_slices.

    trim_lines

    (logical(1)) flag specifying whether to trim lines of the JSON string.

    -
    + +
    -

    Value

    +

    Value +

    A JSON string representation of the input list.

    + + + + - - + + diff --git a/v0.5.1-rc1/reference/justify_json.html b/v0.5.1-rc1/reference/justify_json.html index c4f6b1f09..d3b21bb06 100644 --- a/v0.5.1-rc1/reference/justify_json.html +++ b/v0.5.1-rc1/reference/justify_json.html @@ -1,10 +1,26 @@ - -Justify colons in JSON string — justify_json • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + @@ -86,35 +108,42 @@
    -

    Usage

    +

    Usage +

    justify_json(json)
    -

    Arguments

    -
    json
    +

    Arguments +

    +
    +
    json

    (character(1)) a JSON string.

    -
    + +
    -

    Value

    +

    Value +

    A list of character strings, which can be collapsed into a JSON string.

    + + + + - - + + diff --git a/v0.5.1-rc1/reference/make_c_call.html b/v0.5.1-rc1/reference/make_c_call.html index a0fffd855..75bccd7aa 100644 --- a/v0.5.1-rc1/reference/make_c_call.html +++ b/v0.5.1-rc1/reference/make_c_call.html @@ -1,10 +1,26 @@ - -Build concatenating call — make_c_call • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + @@ -86,25 +108,31 @@
    -

    Usage

    +

    Usage +

    make_c_call(choices)
    -

    Arguments

    -
    choices
    +

    Arguments +

    +
    +
    choices

    A vector of values.

    -
    + +
    -

    Value

    +

    Value +

    A c call.

    -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     make_c_call <- getFromNamespace("make_c_call", "teal.slice")
     make_c_call(1:3)
    @@ -115,17 +143,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/v0.5.1-rc1/reference/make_count_text.html b/v0.5.1-rc1/reference/make_count_text.html index d5a3d5ed4..c1ba190af 100644 --- a/v0.5.1-rc1/reference/make_count_text.html +++ b/v0.5.1-rc1/reference/make_count_text.html @@ -1,16 +1,32 @@ - - + + + + + +Build count text — make_count_text • teal.slice +Build count text — make_count_text • teal.slice + + + + + + + + + + Skip to contents @@ -26,7 +42,8 @@ + + @@ -87,18 +109,24 @@
    -

    Returns a text label describing filtered counts. The text is composed in the following way:

    • when countnow is not NULL: <label> (<countnow>/<countmax>)

    • +

      Returns a text label describing filtered counts. The text is composed in the following way:

      +
        +
      • when countnow is not NULL: <label> (<countnow>/<countmax>)

      • when countnow is NULL: <label> (<countmax>)

      • -
    + +
    -

    Usage

    +

    Usage +

    make_count_text(label, countmax, countnow = NULL)
    -

    Arguments

    -
    label
    +

    Arguments +

    +
    +
    label

    (character(1)) Text displayed before counts.

    @@ -109,26 +137,30 @@

    Arguments -

    Value

    +

    Value +

    A character string.

    + + + + - - + + diff --git a/v0.5.1-rc1/reference/setdiff_teal_slices.html b/v0.5.1-rc1/reference/setdiff_teal_slices.html index 0b2ac76cb..75aa55a8e 100644 --- a/v0.5.1-rc1/reference/setdiff_teal_slices.html +++ b/v0.5.1-rc1/reference/setdiff_teal_slices.html @@ -1,8 +1,24 @@ - -setdiff method for teal_slices — setdiff_teal_slices • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,18 +107,23 @@
    -

    Usage

    +

    Usage +

    setdiff_teal_slices(x, y)
    -

    Arguments

    -
    x, y
    +

    Arguments +

    +
    +
    x, y

    (teal_slices)

    -
    + +
    -

    Value

    +

    Value +

    teal_slices

    @@ -103,17 +132,19 @@

    Value

    + + + + - - + + diff --git a/v0.5.1-rc1/reference/teal.slice-package.html b/v0.5.1-rc1/reference/teal.slice-package.html index 3d179bedc..7d6de92e8 100644 --- a/v0.5.1-rc1/reference/teal.slice-package.html +++ b/v0.5.1-rc1/reference/teal.slice-package.html @@ -1,8 +1,24 @@ - -teal.slice: Interactive Exploration of Clinical Trials Data — teal.slice-package • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,16 +107,24 @@
    -

    Author

    +

    Author +

    Maintainer: Dawid Kaledkowski dawid.kaledkowski@roche.com (ORCID)

    -

    Authors:

    + +
    + + + + - - + + diff --git a/v0.5.1-rc1/reference/teal_slice-utilities.html b/v0.5.1-rc1/reference/teal_slice-utilities.html index 15eea9cc1..be6471f8c 100644 --- a/v0.5.1-rc1/reference/teal_slice-utilities.html +++ b/v0.5.1-rc1/reference/teal_slice-utilities.html @@ -1,8 +1,24 @@ - -teal_slice utility functions — teal_slice-utilities • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,7 +106,8 @@
    -

    Usage

    +

    Usage +

    is.teal_slice(x)
     
     as.teal_slice(x)
    @@ -99,8 +123,10 @@ 

    Usage

    -

    Arguments

    -
    x
    +

    Arguments +

    +
    +
    x

    (teal.slice)

    @@ -116,10 +142,12 @@

    Arguments -

    Examples

    +

    Examples +

    x1 <- teal_slice(
       dataname = "data",
       id = "Female adults",
    @@ -196,17 +224,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.5.1-rc1/reference/teal_slice.html b/v0.5.1-rc1/reference/teal_slice.html index 333f9c1cb..26d9018d3 100644 --- a/v0.5.1-rc1/reference/teal_slice.html +++ b/v0.5.1-rc1/reference/teal_slice.html @@ -1,10 +1,26 @@ - -Specify single filter — teal_slice • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + @@ -86,7 +108,8 @@
    -

    Usage

    +

    Usage +

    teal_slice(
       dataname,
       varname,
    @@ -105,8 +128,10 @@ 

    Usage

    -

    Arguments

    -
    dataname
    +

    Arguments +

    +
    +
    dataname

    (character(1)) name of data set

    @@ -165,16 +190,19 @@

    Arguments -

    Value

    +

    Value +

    A teal.slice object. Depending on whether varname or expr was specified, the resulting teal_slice also receives class teal_slice_var or teal_slice_expr, respectively.

    -

    Details

    +

    Details +

    teal_slice object fully describes filter state and can be used to create, modify, and delete a filter state. A teal_slice contains a number of common fields (all named arguments of teal_slice), some of which are mandatory, but only @@ -183,7 +211,9 @@

    DetailsSetting any of the other values to NULL means that those properties will not be modified (when setting an existing state) or that they will be determined by data (when creating new a new one). Entire object is FilterState class member and can be accessed with FilterState$get_state().

    -

    A teal_slice can come in two flavors:

    1. teal_slice_var - +

      A teal_slice can come in two flavors:

      +
        +
      1. teal_slice_var - this describes a typical interactive filter that refers to a single variable, managed by the FilterState class. This class is created when varname is specified. The object retains all fields specified in the call. id can be created by default and need not be specified.

      2. @@ -193,7 +223,8 @@

        Detailsexpr is specified. dataname and anchored are retained, fixed is set to TRUE, id becomes mandatory, title remains optional, while other arguments are disregarded.

        -

      A teal_slice can be passed FilterState/FilterStateExpr constructors to instantiate an object. +

    +

    A teal_slice can be passed FilterState/FilterStateExpr constructors to instantiate an object. It can also be passed to FilterState$set_state to modify the state. However, once a FilterState is created, only the mutable features can be set with a teal_slice: selected, keep_na and keep_inf.

    @@ -205,11 +236,13 @@

    DetailsFilterState instantiated with anchored = TRUE cannot be removed.

    -

    Note

    +

    Note +

    Date time objects of POSIX*t classes are printed as strings after converting to UTC timezone.

    -

    Filters in SumarizedExperiment and MultiAssayExperiment objects

    +

    Filters in SumarizedExperiment and MultiAssayExperiment objects +

    @@ -223,13 +256,15 @@

    Filters in order to determine whether the filter refers to the SE's rowData or colData.

    -

    Examples

    +

    Examples +

    x1 <- teal_slice(
       dataname = "data",
       id = "Female adults",
    @@ -306,17 +341,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/v0.5.1-rc1/reference/teal_slices-utilities.html b/v0.5.1-rc1/reference/teal_slices-utilities.html index 0aea97630..d2478cac7 100644 --- a/v0.5.1-rc1/reference/teal_slices-utilities.html +++ b/v0.5.1-rc1/reference/teal_slices-utilities.html @@ -1,8 +1,24 @@ - -teal_slices utility functions — teal_slices-utilities • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,7 +106,8 @@
    -

    Usage

    +

    Usage +

    is.teal_slices(x)
     
     as.teal_slices(x)
    @@ -105,8 +129,10 @@ 

    Usage

    -

    Arguments

    -
    x
    +

    Arguments +

    +
    +
    x

    object to test for teal_slices, object to convert to teal_slices or a teal_slices object

    @@ -129,10 +155,12 @@

    Arguments -

    Examples

    +

    Examples +

    filter_1 <- teal_slice(
       dataname = "dataname1",
       varname = "varname1",
    @@ -345,17 +373,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.5.1-rc1/reference/teal_slices.html b/v0.5.1-rc1/reference/teal_slices.html index 74f3eb340..3e0350dce 100644 --- a/v0.5.1-rc1/reference/teal_slices.html +++ b/v0.5.1-rc1/reference/teal_slices.html @@ -1,10 +1,26 @@ - -Complete filter specification — teal_slices • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + @@ -86,7 +108,8 @@
    -

    Usage

    +

    Usage +

    teal_slices(
       ...,
       exclude_varnames = NULL,
    @@ -97,8 +120,10 @@ 

    Usage

    -

    Arguments

    -
    ...
    +

    Arguments +

    +
    +
    ...

    any number of teal_slice objects.

    @@ -109,29 +134,36 @@

    Arguments[Experimental] +
    +

    [Experimental] This is a new feature. Do kindly share your opinions on teal.slice's GitHub repository.

    (character(1)) string specifying how observations are tallied by these filter states. -Possible options:

    • "none" (default) to have counts of single FilterState to show unfiltered number only.

    • +Possible options:

      +
        +
      • "none" (default) to have counts of single FilterState to show unfiltered number only.

      • "all" to have counts of single FilterState to show number of observation in filtered and unfiltered dataset. Note, that issues were reported when using this option with MultiAssayExperiment. Please make sure that adding new filters doesn't fail on target platform before deploying for production.

      • -
    + +
    allow_add

    (logical(1)) logical flag specifying whether the user will be able to add new filters

    -

    + +
    -

    Value

    +

    Value +

    teal_slices, which is an unnamed list of teal_slice objects.

    -

    Details

    +

    Details +

    teal_slices() collates multiple teal_slice objects into a teal_slices object, a complete filter specification. This is used by all classes above FilterState as well as filter_panel_api wrapper functions. @@ -142,17 +174,21 @@

    Detailsteal_slices.

    -

    See also

    +

    See also +

    -
    + +
    -

    Examples

    +

    Examples +

    filter_1 <- teal_slice(
       dataname = "dataname1",
       varname = "varname1",
    @@ -365,17 +401,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/v0.5.1-rc1/reference/to_json.html b/v0.5.1-rc1/reference/to_json.html index 766da7489..d77cc5611 100644 --- a/v0.5.1-rc1/reference/to_json.html +++ b/v0.5.1-rc1/reference/to_json.html @@ -1,12 +1,28 @@ - - + + + + + +Converts a list to a JSON string — to_json • teal.slice +Converts a list to a JSON string — to_json • teal.slice + + + + + + + + + + Skip to contents @@ -22,7 +38,8 @@ + + @@ -89,35 +111,42 @@
    -

    Usage

    +

    Usage +

    to_json(x)
    -

    Arguments

    -
    x
    +

    Arguments +

    +
    +
    x

    (list) representation of teal_slices object.

    -
    + +
    -

    Value

    +

    Value +

    A JSON string.

    + + + + - - + + diff --git a/v0.5.1-rc1/reference/toggle_button.html b/v0.5.1-rc1/reference/toggle_button.html index f87ce85e7..4a1b70d4e 100644 --- a/v0.5.1-rc1/reference/toggle_button.html +++ b/v0.5.1-rc1/reference/toggle_button.html @@ -1,8 +1,24 @@ - -Toggle button properties. — toggle_button • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -83,15 +105,18 @@
    -

    Usage

    +

    Usage +

    toggle_icon(input_id, icons, one_way = FALSE)
     
     toggle_title(input_id, titles, one_way = FALSE)
    -

    Arguments

    -
    input_id
    +

    Arguments +

    +
    +
    input_id

    (character(1)) (name-spaced) id of the button

    @@ -104,15 +129,18 @@

    Arguments -

    Value

    +

    Value +

    NULL, invisibly.

    -

    Details

    +

    Details +

    Wrapper functions that use shinyjs::runjs to change button properties in response to events, typically clicking those very buttons. shiny's actionButton and actionLink create <a> tags, @@ -123,7 +151,8 @@

    Details
    -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     toggle_icon <- getFromNamespace("toggle_icon", "teal.slice")
     
    @@ -178,17 +207,19 @@ 

    Examples

    + +

    + + - - + + diff --git a/v0.5.1-rc1/reference/topological_sort.html b/v0.5.1-rc1/reference/topological_sort.html index 85b576f21..76a94714b 100644 --- a/v0.5.1-rc1/reference/topological_sort.html +++ b/v0.5.1-rc1/reference/topological_sort.html @@ -1,10 +1,26 @@ - -Topological graph sort — topological_sort • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + @@ -86,23 +108,29 @@
    -

    Usage

    +

    Usage +

    topological_sort(graph)
    -

    Arguments

    -
    graph
    +

    Arguments +

    +
    +
    graph

    (named list) with node vector elements

    -
    + +
    -

    Details

    +

    Details +

    Implementation of Kahn algorithm with a modification to maintain the order of input elements.

    -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     topological_sort <- getFromNamespace("topological_sort", "teal.slice")
     
    @@ -148,17 +176,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/v0.5.1-rc1/reference/trim_lines_json.html b/v0.5.1-rc1/reference/trim_lines_json.html index 962b55ad5..b5f123b9a 100644 --- a/v0.5.1-rc1/reference/trim_lines_json.html +++ b/v0.5.1-rc1/reference/trim_lines_json.html @@ -1,10 +1,26 @@ - -Trim lines in JSON string — trim_lines_json • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + @@ -86,35 +108,42 @@
    -

    Usage

    +

    Usage +

    trim_lines_json(x)
    -

    Arguments

    -
    x
    +

    Arguments +

    +
    +
    x

    (character)

    -
    + +
    -

    Value

    +

    Value +

    A character string trimmed after a certain hard-coded number of characters in the value portion.

    + + + + - - + + diff --git a/v0.5.1-rc1/reference/variable_types.html b/v0.5.1-rc1/reference/variable_types.html index d27e6b158..05e7f0d79 100644 --- a/v0.5.1-rc1/reference/variable_types.html +++ b/v0.5.1-rc1/reference/variable_types.html @@ -1,8 +1,24 @@ - -Get classes of selected columns from dataset — variable_types • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -83,13 +105,16 @@
    -

    Usage

    +

    Usage +

    variable_types(data, columns = NULL)
    -

    Arguments

    -
    data
    +

    Arguments +

    +
    +
    data

    (data.frame or DataFrame or matrix) Object in which to determine variable types.

    @@ -97,16 +122,19 @@

    Arguments -

    Value

    +

    Value +

    Character vector of classes of columns from provided data.

    -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     variable_types <- getFromNamespace("variable_types", "teal.slice")
     
    @@ -142,17 +170,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/v0.5.1/404.html b/v0.5.1/404.html index d78b51333..465f0b5da 100644 --- a/v0.5.1/404.html +++ b/v0.5.1/404.html @@ -1,5 +1,4 @@ - - + @@ -50,22 +49,7 @@ - - + - + + diff --git a/v0.5.1/CODE_OF_CONDUCT.html b/v0.5.1/CODE_OF_CONDUCT.html index ce1ca96bd..5676a050f 100644 --- a/v0.5.1/CODE_OF_CONDUCT.html +++ b/v0.5.1/CODE_OF_CONDUCT.html @@ -1,8 +1,22 @@ - -Contributor Covenant Code of Conduct • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -80,65 +100,80 @@
    -

    Our Pledge

    +

    Our Pledge +

    We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.

    We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.

    -

    Our Standards

    +

    Our Standards +

    Examples of behavior that contributes to a positive environment for our community include:

    -
    • Demonstrating empathy and kindness toward other people
    • +
        +
      • Demonstrating empathy and kindness toward other people
      • Being respectful of differing opinions, viewpoints, and experiences
      • Giving and gracefully accepting constructive feedback
      • Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
      • Focusing on what is best not just for us as individuals, but for the overall community
      • -

      Examples of unacceptable behavior include:

      -
      • The use of sexualized language or imagery, and sexual attention or advances of any kind
      • +
      +

      Examples of unacceptable behavior include:

      +
        +
      • The use of sexualized language or imagery, and sexual attention or advances of any kind
      • Trolling, insulting or derogatory comments, and personal or political attacks
      • Public or private harassment
      • Publishing others’ private information, such as a physical or email address, without their explicit permission
      • Other conduct which could reasonably be considered inappropriate in a professional setting
      • -
    + +
    -

    Enforcement Responsibilities

    +

    Enforcement Responsibilities +

    Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.

    Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.

    -

    Scope

    +

    Scope +

    This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.

    -

    Enforcement

    +

    Enforcement +

    Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [INSERT CONTACT METHOD]. All complaints will be reviewed and investigated promptly and fairly.

    All community leaders are obligated to respect the privacy and security of the reporter of any incident.

    -

    Enforcement Guidelines

    +

    Enforcement Guidelines +

    Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:

    -

    1. Correction

    +

    1. Correction +

    Community Impact: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.

    Consequence: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.

    -

    2. Warning

    +

    2. Warning +

    Community Impact: A violation through a single incident or series of actions.

    Consequence: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.

    -

    3. Temporary Ban

    +

    3. Temporary Ban +

    Community Impact: A serious violation of community standards, including sustained inappropriate behavior.

    Consequence: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.

    -

    4. Permanent Ban

    +

    4. Permanent Ban +

    Community Impact: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.

    Consequence: A permanent ban from any sort of public interaction within the community.

    -

    Attribution

    +

    Attribution +

    This Code of Conduct is adapted from the Contributor Covenant, version 2.1, available at https://www.contributor-covenant.org/version/2/1/code_of_conduct.html.

    Community Impact Guidelines were inspired by Mozilla’s code of conduct enforcement ladder.

    For answers to common questions about this code of conduct, see the FAQ at https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.

    @@ -146,17 +181,19 @@

    Attribution

    + + + + - - + + diff --git a/v0.5.1/CONTRIBUTING.html b/v0.5.1/CONTRIBUTING.html index 3690a5c9a..c61674ed4 100644 --- a/v0.5.1/CONTRIBUTING.html +++ b/v0.5.1/CONTRIBUTING.html @@ -1,8 +1,22 @@ - -Contribution Guidelines • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -82,7 +102,8 @@

    🙏 Thank you for taking the time to contribute!

    Your input is deeply valued, whether an issue, a pull request, or even feedback, regardless of size, content or scope.

    -

    Table of contents

    +

    Table of contents +

    👶 Getting started

    📔 Code of Conduct

    🗃 License

    @@ -93,38 +114,47 @@

    Table of contents❓ Questions

    -

    Getting started

    +

    Getting started +

    Please refer the project documentation for a brief introduction. Please also see other articles within the project documentation for additional information.

    -

    Code of Conduct

    +

    Code of Conduct +

    A Code of Conduct governs this project. Participants and contributors are expected to follow the rules outlined therein.

    -

    License

    +

    License +

    All your contributions will be covered by this project’s license.

    -

    Issues

    +

    Issues +

    We use GitHub to track issues, feature requests, and bugs. Before submitting a new issue, please check if the issue has already been reported. If the issue already exists, please upvote the existing issue 👍.

    For new feature requests, please elaborate on the context and the benefit the feature will have for users, developers, or other relevant personas.

    -

    Pull requests

    +

    Pull requests +

    -

    GitHub Flow

    +

    GitHub Flow +

    This repository uses the GitHub Flow model for collaboration. To submit a pull request:

    -
    1. +
        +
      1. Create a branch

        Please see the branch naming convention below. If you don’t have write access to this repository, please fork it.

      2. Make changes

        Make sure your code

        -
        • passes all checks imposed by GitHub Actions
        • +
            +
          • passes all checks imposed by GitHub Actions
          • is well documented
          • is well tested with unit tests sufficiently covering the changes introduced
          • -
          +
        +
      3. Create a pull request (PR)

        In the pull request description, please link the relevant issue (if any), provide a detailed description of the change, and include any assumptions.

        @@ -138,76 +168,93 @@

        GitHub Flow -

        Branch naming convention

        +

        Branch naming convention +

        Suppose your changes are related to a current issue in the current project; please name your branch as follows: <issue_id>_<short_description>. Please use underscore (_) as a delimiter for word separation. For example, 420_fix_ui_bug would be a suitable branch name if your change is resolving and UI-related bug reported in issue number 420 in the current project.

        If your change affects multiple repositories, please name your branches as follows: <issue_id>_<issue_repo>_<short description>. For example, 69_awesomeproject_fix_spelling_error would reference issue 69 reported in project awesomeproject and aims to resolve one or more spelling errors in multiple (likely related) repositories.

    monorepo and staged.dependencies -

    + +

    Sometimes you might need to change upstream dependent package(s) to be able to submit a meaningful change. We are using staged.dependencies functionality to simulate a monorepo behavior. The dependency configuration is already specified in this project’s staged_dependencies.yaml file. You need to name the feature branches appropriately. This is the only exception from the branch naming convention described above.

    Please refer to the staged.dependencies package documentation for more details.

    -

    Coding guidelines

    +

    Coding guidelines +

    This repository follows some unified processes and standards adopted by its maintainers to ensure software development is carried out consistently within teams and cohesively across other repositories.

    -

    Style guide

    +

    Style guide +

    This repository follows the standard tidyverse style guide and uses lintr for lint checks. Customized lint configurations are available in this repository’s .lintr file.

    -

    Dependency management

    +

    Dependency management +

    Lightweight is the right weight. This repository follows tinyverse recommendations of limiting dependencies to minimum.

    -

    Dependency version management

    +

    Dependency version management +

    If the code is not compatible with all (!) historical versions of a given dependency package, it is required to specify minimal version in the DESCRIPTION file. In particular: if the development version requires (imports) the development version of another package - it is required to put abc (>= 1.2.3.9000).

    - +
    -

    R & package versions

    +

    R & package versions +

    We continuously test our packages against the newest R version along with the most recent dependencies from CRAN and BioConductor. We recommend that your working environment is also set up in the same way. You can find the details about the R version and packages used in the R CMD check GitHub Action execution log - there is a step that prints out the R sessionInfo().

    If you discover bugs on older R versions or with an older set of dependencies, please create the relevant bug reports.

    -

    pre-commit

    +

    +pre-commit +

    We highly recommend that you use the pre-commit tool combined with R hooks for pre-commit to execute some of the checks before committing and pushing your changes.

    Pre-commit hooks are already available in this repository’s .pre-commit-config.yaml file.

    -

    Recognition model

    +

    Recognition model +

    As mentioned previously, all contributions are deeply valued and appreciated. While all contribution data is available as part of the repository insights, to recognize a significant contribution and hence add the contributor to the package authors list, the following rules are enforced:

    -
    • Minimum 5% of lines of code authored* (determined by git blame query) OR
    • +
        +
      • Minimum 5% of lines of code authored* (determined by git blame query) OR
      • Being at the top 5 contributors in terms of number of commits OR lines added OR lines removed*
      • -

      *Excluding auto-generated code, including but not limited to roxygen comments or renv.lock files.

      +
    +

    *Excluding auto-generated code, including but not limited to roxygen comments or renv.lock files.

    The package maintainer also reserves the right to adjust the criteria to recognize contributions.

    -

    Questions

    +

    Questions +

    If you have further questions regarding the contribution guidelines, please contact the package/repository maintainer.

    + + + + - - + + diff --git a/v0.5.1/LICENSE-text.html b/v0.5.1/LICENSE-text.html index de80e9399..e10520d89 100644 --- a/v0.5.1/LICENSE-text.html +++ b/v0.5.1/LICENSE-text.html @@ -1,8 +1,22 @@ - -License • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -92,17 +112,19 @@ limitations under the License. - + + + + - - + + diff --git a/v0.5.1/SECURITY.html b/v0.5.1/SECURITY.html index f6f263475..c74550f27 100644 --- a/v0.5.1/SECURITY.html +++ b/v0.5.1/SECURITY.html @@ -1,8 +1,22 @@ - -Security Policy • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -80,38 +100,44 @@
    -

    Reporting Security Issues

    +

    Reporting Security Issues +

    If you believe you have found a security vulnerability in any of the repositories in this organization, please report it to us through coordinated disclosure.

    Please do not report security vulnerabilities through public GitHub issues, discussions, or pull requests.

    Instead, please send an email to vulnerability.management[@]roche.com.

    Please include as much of the information listed below as you can to help us better understand and resolve the issue:

    -
    • The type of issue (e.g., buffer overflow, SQL injection, or cross-site scripting)
    • +
        +
      • The type of issue (e.g., buffer overflow, SQL injection, or cross-site scripting)
      • Full paths of source file(s) related to the manifestation of the issue
      • The location of the affected source code (tag/branch/commit or direct URL)
      • Any special configuration required to reproduce the issue
      • Step-by-step instructions to reproduce the issue
      • Proof-of-concept or exploit code (if possible)
      • Impact of the issue, including how an attacker might exploit the issue
      • -

      This information will help us triage your report more quickly.

      +
    +

    This information will help us triage your report more quickly.

    -

    Data Security Standards (DSS)

    +

    Data Security Standards (DSS) +

    Please make sure that while reporting issues in the form a bug, feature, or pull request, all sensitive information such as PII, PHI, and PCI is completely removed from any text and attachments, including pictures and videos.

    + + + + - - + + diff --git a/v0.5.1/articles/filter-panel-for-developers.html b/v0.5.1/articles/filter-panel-for-developers.html index 986ec9cce..34dc283f9 100644 --- a/v0.5.1/articles/filter-panel-for-developers.html +++ b/v0.5.1/articles/filter-panel-for-developers.html @@ -1,5 +1,4 @@ - - + @@ -52,22 +51,7 @@ - - + - + + diff --git a/v0.5.1/articles/index.html b/v0.5.1/articles/index.html index 236a4f07e..5cc494abd 100644 --- a/v0.5.1/articles/index.html +++ b/v0.5.1/articles/index.html @@ -1,8 +1,22 @@ - -Articles • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -80,24 +100,31 @@

    All vignettes

    -
    Filter Panel for Developers
    +
    +
    Filter Panel for Developers
    -
    teal.slice Classes
    + +
    teal.slice Classes
    -
    Introduction to teal.slice
    + +
    Introduction to teal.slice
    -
    - + +
    + + + + + - - + + diff --git a/v0.5.1/articles/teal-slice-classes.html b/v0.5.1/articles/teal-slice-classes.html index 6c98d7032..1f7434bb9 100644 --- a/v0.5.1/articles/teal-slice-classes.html +++ b/v0.5.1/articles/teal-slice-classes.html @@ -1,5 +1,4 @@ - - + @@ -52,22 +51,7 @@ - - + - + + diff --git a/v0.5.1/articles/teal-slice.html b/v0.5.1/articles/teal-slice.html index f1b965356..c19605cfd 100644 --- a/v0.5.1/articles/teal-slice.html +++ b/v0.5.1/articles/teal-slice.html @@ -1,5 +1,4 @@ - - + @@ -52,22 +51,7 @@ - - + - + + diff --git a/v0.5.1/authors.html b/v0.5.1/authors.html index b1b4c129b..136084e67 100644 --- a/v0.5.1/authors.html +++ b/v0.5.1/authors.html @@ -1,8 +1,22 @@ - -Authors and Citation • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -79,7 +99,8 @@

    Authors

    -
    • +
        +
      • Dawid Kaledkowski. Author, maintainer.

      • @@ -139,7 +160,8 @@

        Authors

        F. Hoffmann-La Roche AG. Copyright holder, funder.

        -
    + +

    Citation

    @@ -160,17 +182,19 @@

    Citation

    }
    + + + + - - + + diff --git a/v0.5.1/coverage-report/index.html b/v0.5.1/coverage-report/index.html index c10bf9398..0f7bb6c5c 100644 --- a/v0.5.1/coverage-report/index.html +++ b/v0.5.1/coverage-report/index.html @@ -1,23 +1,22 @@ - - + - + - + - - + + - + - + - - - + + + @@ -852,7 +851,8 @@

    teal.slice coverage - 65.92%

    106 - 67x + 67x +
          checkmate::assert_list(data_objects, any.missing = FALSE, min.len = 0, names = "unique")
    @@ -866,14 +866,16 @@

    teal.slice coverage - 65.92%

    108 - 67x + 67x +
          data_objects <- lapply(data_objects, function(dataset) {
    109 - 101x + 101x +
            if (is.list(dataset) && "dataset" %in% names(dataset)) {
    @@ -894,7 +896,8 @@

    teal.slice coverage - 65.92%

    112 - 101x + 101x +
              dataset
    @@ -929,49 +932,56 @@

    teal.slice coverage - 65.92%

    117 - 67x + 67x +
          checkmate::assert_class(join_keys, "join_keys")
    118 - 66x + 66x +
          self$set_join_keys(join_keys)
    119 - 66x + 66x +
          child_parent <- sapply(
    120 - 66x + 66x +
            names(data_objects),
    121 - 66x + 66x +
            function(i) teal.data::parent(join_keys, i),
    122 - 66x + 66x +
            USE.NAMES = TRUE,
    123 - 66x + 66x +
            simplify = FALSE
    @@ -985,14 +995,16 @@

    teal.slice coverage - 65.92%

    125 - 66x + 66x +
          ordered_datanames <- topological_sort(child_parent)
    126 - 66x + 66x +
          ordered_datanames <- intersect(ordered_datanames, names(data_objects))
    @@ -1006,21 +1018,24 @@

    teal.slice coverage - 65.92%

    128 - 66x + 66x +
          for (dataname in ordered_datanames) {
    129 - 100x + 100x +
            ds_object <- data_objects[[dataname]]
    130 - 100x + 100x +
            self$set_dataset(data = ds_object, dataname = dataname)
    @@ -1041,7 +1056,8 @@

    teal.slice coverage - 65.92%

    133 - 66x + 66x +
          self$set_available_teal_slices(x = reactive(NULL))
    @@ -1055,7 +1071,8 @@

    teal.slice coverage - 65.92%

    135 - 66x + 66x +
          invisible(self)
    @@ -1118,7 +1135,8 @@

    teal.slice coverage - 65.92%

    144 - 118x + 118x +
          names(private$filtered_datasets)
    @@ -1188,7 +1206,8 @@

    teal.slice coverage - 65.92%

    154 - 1x + 1x +
          private$get_filtered_dataset(dataname)$get_dataset_label()
    @@ -1293,14 +1312,16 @@

    teal.slice coverage - 65.92%

    169 - 67x + 67x +
          checkmate::assert_class(x, "reactive")
    170 - 67x + 67x +
          private$available_teal_slices <- reactive({
    @@ -1314,49 +1335,56 @@

    teal.slice coverage - 65.92%

    172 - 4x + 4x +
            current_state <- isolate(self$get_filter_state())
    173 - 4x + 4x +
            allowed <- attr(current_state, "include_varnames")
    174 - 4x + 4x +
            forbidden <- attr(current_state, "exclude_varnames")
    175 - 4x + 4x +
            foo <- function(slice) {
    176 - 13x + 13x +
              if (slice$dataname %in% self$datanames()) {
    177 - 13x + 13x +
                if (slice$fixed) {
    178 - 4x + 4x +
                  TRUE
    @@ -1370,14 +1398,16 @@

    teal.slice coverage - 65.92%

    180 - 9x + 9x +
                  isTRUE(slice$varname %in% allowed[[slice$dataname]]) ||
    181 - 9x + 9x +
                    isFALSE(slice$varname %in% forbidden[[slice$dataname]])
    @@ -1419,7 +1449,8 @@

    teal.slice coverage - 65.92%

    187 - 4x + 4x +
            Filter(foo, x())
    @@ -1433,7 +1464,8 @@

    teal.slice coverage - 65.92%

    189 - 67x + 67x +
          invisible(NULL)
    @@ -1510,7 +1542,8 @@

    teal.slice coverage - 65.92%

    200 - 4x + 4x +
          private$available_teal_slices
    @@ -1706,14 +1739,16 @@

    teal.slice coverage - 65.92%

    228 - 10x + 10x +
          checkmate::assert_subset(dataname, self$datanames())
    229 - 9x + 9x +
          private$get_filtered_dataset(dataname)$get_call()
    @@ -1811,28 +1846,32 @@

    teal.slice coverage - 65.92%

    243 - 24x + 24x +
          checkmate::assert_subset(dataname, self$datanames())
    244 - 23x + 23x +
          checkmate::assert_flag(filtered)
    245 - 22x + 22x +
          data <- private$get_filtered_dataset(dataname)$get_dataset(filtered)
    246 - 3x + 3x +
          if (filtered) data() else data
    @@ -1895,7 +1934,8 @@

    teal.slice coverage - 65.92%

    255 - 2x + 2x +
          private$join_keys
    @@ -1986,28 +2026,32 @@

    teal.slice coverage - 65.92%

    268 - 9x + 9x +
          rows <- lapply(
    269 - 9x + 9x +
            datanames,
    270 - 9x + 9x +
            function(dataname) {
    271 - 11x + 11x +
              private$get_filtered_dataset(dataname)$get_filter_overview()
    @@ -2028,14 +2072,16 @@

    teal.slice coverage - 65.92%

    274 - 5x + 5x +
          unssuported_idx <- vapply(rows, function(x) all(is.na(x[-1])), logical(1))
    275 - 5x + 5x +
          dplyr::bind_rows(c(rows[!unssuported_idx], rows[unssuported_idx]))
    @@ -2112,7 +2158,8 @@

    teal.slice coverage - 65.92%

    286 - 1x + 1x +
          private$get_filtered_dataset(dataname)$get_keys()
    @@ -2266,14 +2313,16 @@

    teal.slice coverage - 65.92%

    308 - 105x + 105x +
          checkmate::assert_string(dataname)
    309 - 105x + 105x +
          logger::log_trace("FilteredData$set_dataset setting dataset, name: { dataname }")
    @@ -2294,7 +2343,8 @@

    teal.slice coverage - 65.92%

    312 - 105x + 105x +
          check_simple_name(dataname)
    @@ -2308,21 +2358,24 @@

    teal.slice coverage - 65.92%

    314 - 105x + 105x +
          parent_dataname <- teal.data::parent(private$join_keys, dataname)
    315 - 105x + 105x +
          keys <- private$join_keys[dataname, dataname]
    316 - 104x + 104x +
          if (is.null(keys)) keys <- character(0)
    @@ -2336,35 +2389,40 @@

    teal.slice coverage - 65.92%

    318 - 105x + 105x +
          if (length(parent_dataname) == 0) {
    319 - 95x + 95x +
            private$filtered_datasets[[dataname]] <- init_filtered_dataset(
    320 - 95x + 95x +
              dataset = data,
    321 - 95x + 95x +
              dataname = dataname,
    322 - 95x + 95x +
              keys = keys
    @@ -2385,7 +2443,8 @@

    teal.slice coverage - 65.92%

    325 - 10x + 10x +
            join_keys <- private$join_keys[dataname, parent_dataname]
    @@ -2399,49 +2458,56 @@

    teal.slice coverage - 65.92%

    327 - 10x + 10x +
            private$filtered_datasets[[dataname]] <- init_filtered_dataset(
    328 - 10x + 10x +
              dataset = data,
    329 - 10x + 10x +
              dataname = dataname,
    330 - 10x + 10x +
              keys = keys,
    331 - 10x + 10x +
              parent_name = parent_dataname,
    332 - 10x + 10x +
              parent = reactive(self$get_data(parent_dataname, filtered = TRUE)),
    333 - 10x + 10x +
              join_keys = join_keys
    @@ -2469,7 +2535,8 @@

    teal.slice coverage - 65.92%

    337 - 105x + 105x +
          invisible(self)
    @@ -2546,21 +2613,24 @@

    teal.slice coverage - 65.92%

    348 - 66x + 66x +
          checkmate::assert_class(join_keys, "join_keys")
    349 - 66x + 66x +
          private$join_keys <- join_keys
    350 - 66x + 66x +
          invisible(self)
    @@ -2637,35 +2707,40 @@

    teal.slice coverage - 65.92%

    361 - 53x + 53x +
          states <- unname(lapply(private$filtered_datasets, function(x) x$get_filter_state()))
    362 - 53x + 53x +
          slices <- Filter(Negate(is.null), states)
    363 - 53x + 53x +
          slices <- do.call(c, slices)
    364 - 53x + 53x +
          if (!is.null(slices)) {
    365 - 53x + 53x +
            attr(slices, "allow_add") <- private$allow_add
    @@ -2679,7 +2754,8 @@

    teal.slice coverage - 65.92%

    367 - 53x + 53x +
          slices
    @@ -2763,35 +2839,40 @@

    teal.slice coverage - 65.92%

    379 - 5x + 5x +
          datasets <- lapply(self$datanames(), private$get_filtered_dataset)
    380 - 5x + 5x +
          ind <- vapply(datasets, inherits, logical(1L), what = "DefaultFilteredDataset")
    381 - 5x + 5x +
          states <- do.call(c, lapply(datasets[!ind], function(ds) ds$get_filter_state()))
    382 - 5x + 5x +
          states_fmt <- format(states, show_all = show_all, trim_lines = trim_lines)
    383 - 5x + 5x +
          holders_fmt <- vapply(datasets[ind], format, character(1L), show_all = show_all, trim_lines = trim_lines)
    @@ -2805,28 +2886,32 @@

    teal.slice coverage - 65.92%

    385 - 5x + 5x +
          sprintf(
    386 - 5x + 5x +
            "%s:\n%s",
    387 - 5x + 5x +
            class(self)[1],
    388 - 5x + 5x +
            paste(c(states_fmt, holders_fmt), collapse = "\n")
    @@ -2966,42 +3051,48 @@

    teal.slice coverage - 65.92%

    408 - 31x + 31x +
          isolate({
    409 - 31x + 31x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initializing")
    410 - 31x + 31x +
            checkmate::assert_class(state, "teal_slices")
    411 - 31x + 31x +
            allow_add <- attr(state, "allow_add")
    412 - 31x + 31x +
            if (!is.null(allow_add)) {
    413 - 31x + 31x +
              private$allow_add <- allow_add
    @@ -3022,21 +3113,24 @@

    teal.slice coverage - 65.92%

    416 - 31x + 31x +
            lapply(self$datanames(), function(dataname) {
    417 - 63x + 63x +
              states <- Filter(function(x) identical(x$dataname, dataname), state)
    418 - 63x + 63x +
              private$get_filtered_dataset(dataname)$set_filter_state(states)
    @@ -3057,7 +3151,8 @@

    teal.slice coverage - 65.92%

    421 - 31x + 31x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initialized")
    @@ -3078,7 +3173,8 @@

    teal.slice coverage - 65.92%

    424 - 31x + 31x +
          invisible(NULL)
    @@ -3169,28 +3265,32 @@

    teal.slice coverage - 65.92%

    437 - 8x + 8x +
          isolate({
    438 - 8x + 8x +
            checkmate::assert_class(state, "teal_slices")
    439 - 8x + 8x +
            datanames <- unique(vapply(state, "[[", character(1L), "dataname"))
    440 - 8x + 8x +
            checkmate::assert_subset(datanames, self$datanames())
    @@ -3204,14 +3304,16 @@

    teal.slice coverage - 65.92%

    442 - 8x + 8x +
            logger::log_trace(
    443 - 8x + 8x +
              "{ class(self)[1] }$remove_filter_state removing filter(s), dataname: { private$dataname }"
    @@ -3232,21 +3334,24 @@

    teal.slice coverage - 65.92%

    446 - 8x + 8x +
            lapply(datanames, function(dataname) {
    447 - 9x + 9x +
              slices <- Filter(function(x) identical(x$dataname, dataname), state)
    448 - 9x + 9x +
              private$get_filtered_dataset(dataname)$remove_filter_state(slices)
    @@ -3267,14 +3372,16 @@

    teal.slice coverage - 65.92%

    451 - 8x + 8x +
            logger::log_trace(
    452 - 8x + 8x +
              "{ class(self)[1] }$remove_filter_state removed filter(s), dataname: { private$dataname }"
    @@ -3302,7 +3409,8 @@

    teal.slice coverage - 65.92%

    456 - 8x + 8x +
          invisible(NULL)
    @@ -3407,14 +3515,16 @@

    teal.slice coverage - 65.92%

    471 - 7x + 7x +
          logger::log_trace(
    472 - 7x + 7x +
            "FilteredData$clear_filter_states called, datanames: { toString(datanames) }"
    @@ -3435,21 +3545,24 @@

    teal.slice coverage - 65.92%

    475 - 7x + 7x +
          for (dataname in datanames) {
    476 - 12x + 12x +
            fdataset <- private$get_filtered_dataset(dataname = dataname)
    477 - 12x + 12x +
            fdataset$clear_filter_states(force)
    @@ -3470,28 +3583,32 @@

    teal.slice coverage - 65.92%

    480 - 7x + 7x +
          logger::log_trace(
    481 - 7x + 7x +
            paste(
    482 - 7x + 7x +
              "FilteredData$clear_filter_states removed all non-anchored FilterStates,",
    483 - 7x + 7x +
              "datanames: { toString(datanames) }"
    @@ -3519,7 +3636,8 @@

    teal.slice coverage - 65.92%

    487 - 7x + 7x +
          invisible(NULL)
    @@ -3785,35 +3903,40 @@

    teal.slice coverage - 65.92%

    525 - 1x + 1x +
          checkmate::assert_function(active_datanames)
    526 - 1x + 1x +
          moduleServer(
    527 - 1x + 1x +
            id = id,
    528 - 1x + 1x +
            function(input, output, session) {
    529 - 1x + 1x +
              logger::log_trace("FilteredData$srv_filter_panel initializing")
    @@ -3827,14 +3950,16 @@

    teal.slice coverage - 65.92%

    531 - 1x + 1x +
              active_datanames_resolved <- reactive({
    532 - 1x + 1x +
                checkmate::assert_subset(active_datanames(), self$datanames())
    @@ -3862,28 +3987,32 @@

    teal.slice coverage - 65.92%

    536 - 1x + 1x +
              self$srv_overview("overview", active_datanames_resolved)
    537 - 1x + 1x +
              self$srv_active("active", active_datanames_resolved)
    538 - 1x + 1x +
              if (private$allow_add) {
    539 - 1x + 1x +
                self$srv_add("add", active_datanames_resolved)
    @@ -3904,14 +4033,16 @@

    teal.slice coverage - 65.92%

    542 - 1x + 1x +
              logger::log_trace("FilteredData$srv_filter_panel initialized")
    543 - 1x + 1x +
              NULL
    @@ -4352,21 +4483,24 @@

    teal.slice coverage - 65.92%

    606 - 3x + 3x +
          checkmate::assert_function(active_datanames)
    607 - 3x + 3x +
          moduleServer(id, function(input, output, session) {
    608 - 3x + 3x +
            logger::log_trace("FilteredData$srv_active initializing")
    @@ -4380,7 +4514,8 @@

    teal.slice coverage - 65.92%

    610 - 3x + 3x +
            private$srv_available_filters("available_filters")
    @@ -4394,7 +4529,8 @@

    teal.slice coverage - 65.92%

    612 - 3x + 3x +
            observeEvent(input$minimise_filter_active, {
    @@ -4443,42 +4579,48 @@

    teal.slice coverage - 65.92%

    619 - 3x + 3x +
            observeEvent(private$get_filter_count(), {
    620 - 3x + 3x +
              shinyjs::toggle("remove_all_filters", condition = private$get_filter_count() != 0)
    621 - 3x + 3x +
              shinyjs::show("filter_active_vars_contents")
    622 - 3x + 3x +
              shinyjs::hide("filters_active_count")
    623 - 3x + 3x +
              toggle_icon(session$ns("minimise_filter_active"), c("fa-angle-right", "fa-angle-down"), TRUE)
    624 - 3x + 3x +
              toggle_title(session$ns("minimise_filter_active"), c("Restore panel", "Minimise Panel"), TRUE)
    @@ -4499,28 +4641,32 @@

    teal.slice coverage - 65.92%

    627 - 3x + 3x +
            observeEvent(active_datanames(), {
    628 - 2x + 2x +
              lapply(self$datanames(), function(dataname) {
    629 - 4x + 4x +
                if (dataname %in% active_datanames()) {
    630 - 4x + 4x +
                  shinyjs::show(dataname)
    @@ -4583,35 +4729,40 @@

    teal.slice coverage - 65.92%

    639 - 3x + 3x +
            lapply(
    640 - 3x + 3x +
              self$datanames(),
    641 - 3x + 3x +
              function(dataname) {
    642 - 6x + 6x +
                fdataset <- private$get_filtered_dataset(dataname)
    643 - 6x + 6x +
                fdataset$srv_active(id = dataname)
    @@ -4639,49 +4790,56 @@

    teal.slice coverage - 65.92%

    647 - 3x + 3x +
            output$teal_filters_count <- renderText({
    648 - 3x + 3x +
              n_filters_active <- private$get_filter_count()
    649 - 3x + 3x +
              req(n_filters_active > 0L)
    650 - 2x + 2x +
              sprintf(
    651 - 2x + 2x +
                "%s filter%s applied across datasets",
    652 - 2x + 2x +
                n_filters_active,
    653 - 2x + 2x +
                ifelse(n_filters_active == 1, "", "s")
    @@ -4709,28 +4867,32 @@

    teal.slice coverage - 65.92%

    657 - 3x + 3x +
            observeEvent(input$remove_all_filters, {
    658 - 1x + 1x +
              logger::log_trace("FilteredData$srv_filter_panel@1 removing all non-anchored filters")
    659 - 1x + 1x +
              self$clear_filter_states()
    660 - 1x + 1x +
              logger::log_trace("FilteredData$srv_filter_panel@1 removed all non-anchored filters")
    @@ -4744,14 +4906,16 @@

    teal.slice coverage - 65.92%

    662 - 3x + 3x +
            logger::log_trace("FilteredData$srv_active initialized")
    663 - 3x + 3x +
            NULL
    @@ -5129,28 +5293,32 @@

    teal.slice coverage - 65.92%

    717 - 1x + 1x +
          checkmate::assert_class(active_datanames, "reactive")
    718 - 1x + 1x +
          moduleServer(id, function(input, output, session) {
    719 - 1x + 1x +
            logger::log_trace("FilteredData$srv_add initializing")
    720 - 1x + 1x +
            observeEvent(input$minimise_filter_add_vars, {
    @@ -5192,7 +5360,8 @@

    teal.slice coverage - 65.92%

    726 - 1x + 1x +
            observeEvent(active_datanames(), {
    @@ -5276,35 +5445,40 @@

    teal.slice coverage - 65.92%

    738 - 1x + 1x +
            lapply(
    739 - 1x + 1x +
              self$datanames(),
    740 - 1x + 1x +
              function(dataname) {
    741 - 2x + 2x +
                fdataset <- private$get_filtered_dataset(dataname)
    742 - 2x + 2x +
                fdataset$srv_add(id = dataname)
    @@ -5325,14 +5499,16 @@

    teal.slice coverage - 65.92%

    745 - 1x + 1x +
            logger::log_trace("FilteredData$srv_filter_panel initialized")
    746 - 1x + 1x +
            NULL
    @@ -5752,35 +5928,40 @@

    teal.slice coverage - 65.92%

    806 - 1x + 1x +
          checkmate::assert_class(active_datanames, "reactive")
    807 - 1x + 1x +
          moduleServer(
    808 - 1x + 1x +
            id = id,
    809 - 1x + 1x +
            function(input, output, session) {
    810 - 1x + 1x +
              logger::log_trace("FilteredData$srv_filter_overview initializing")
    @@ -5794,7 +5975,8 @@

    teal.slice coverage - 65.92%

    812 - 1x + 1x +
              observeEvent(input$minimise_filter_overview, {
    @@ -5836,7 +6018,8 @@

    teal.slice coverage - 65.92%

    818 - 1x + 1x +
              output$table <- renderUI({
    @@ -6410,14 +6593,16 @@

    teal.slice coverage - 65.92%

    900 - 1x + 1x +
              logger::log_trace("FilteredData$srv_filter_overview initialized")
    901 - 1x + 1x +
              NULL
    @@ -6676,7 +6861,8 @@

    teal.slice coverage - 65.92%

    938 - 147x + 147x +
          if (length(dataname) == 0) {
    @@ -6697,7 +6883,8 @@

    teal.slice coverage - 65.92%

    941 - 147x + 147x +
            private$filtered_datasets[[dataname]]
    @@ -6781,7 +6968,8 @@

    teal.slice coverage - 65.92%

    953 - 11x + 11x +
          length(self$get_filter_state())
    @@ -7047,28 +7235,32 @@

    teal.slice coverage - 65.92%

    991 - 4x + 4x +
          moduleServer(id, function(input, output, session) {
    992 - 4x + 4x +
            slices_available <- self$get_available_teal_slices()
    993 - 4x + 4x +
            slices_interactive <- reactive(
    994 - 4x + 4x +
              Filter(function(slice) isFALSE(slice$fixed), slices_available())
    @@ -7082,14 +7274,16 @@

    teal.slice coverage - 65.92%

    996 - 4x + 4x +
            slices_fixed <- reactive(
    997 - 4x + 4x +
              Filter(function(slice) isTRUE(slice$fixed), slices_available())
    @@ -7103,21 +7297,24 @@

    teal.slice coverage - 65.92%

    999 - 4x + 4x +
            available_slices_id <- reactive(vapply(slices_available(), `[[`, character(1), "id"))
    1000 - 4x + 4x +
            active_slices_id <- reactive(vapply(self$get_filter_state(), `[[`, character(1), "id"))
    1001 - 4x + 4x +
            duplicated_slice_references <- reactive({
    @@ -7131,35 +7328,40 @@

    teal.slice coverage - 65.92%

    1003 - 8x + 8x +
              slice_reference <- vapply(slices_available(), get_default_slice_id, character(1))
    1004 - 8x + 8x +
              is_duplicated_reference <- duplicated(slice_reference) | duplicated(slice_reference, fromLast = TRUE)
    1005 - 8x + 8x +
              is_active <- available_slices_id() %in% active_slices_id()
    1006 - 8x + 8x +
              is_not_expr <- !vapply(slices_available(), inherits, logical(1), "teal_slice_expr")
    1007 - 8x + 8x +
              slice_reference[is_duplicated_reference & is_active & is_not_expr]
    @@ -7180,70 +7382,80 @@

    teal.slice coverage - 65.92%

    1010 - 4x + 4x +
            checkbox_group_element <- function(name, value, label, checked, disabled = FALSE) {
    1011 - 35x + 35x +
              tags$div(
    1012 - 35x + 35x +
                class = "checkbox available-filters",
    1013 - 35x + 35x +
                tags$label(
    1014 - 35x + 35x +
                  tags$input(
    1015 - 35x + 35x +
                    type = "checkbox",
    1016 - 35x + 35x +
                    name = name,
    1017 - 35x + 35x +
                    value = value,
    1018 - 35x + 35x +
                    checked = checked,
    1019 - 35x + 35x +
                    disabled = if (disabled) "disabled"
    @@ -7257,7 +7469,8 @@

    teal.slice coverage - 65.92%

    1021 - 35x + 35x +
                  tags$span(label, disabled = if (disabled) disabled)
    @@ -7292,42 +7505,48 @@

    teal.slice coverage - 65.92%

    1026 - 4x + 4x +
            output$checkbox <- renderUI({
    1027 - 8x + 8x +
              checkbox <- checkboxGroupInput(
    1028 - 8x + 8x +
                session$ns("available_slices_id"),
    1029 - 8x + 8x +
                label = NULL,
    1030 - 8x + 8x +
                choices = NULL,
    1031 - 8x + 8x +
                selected = NULL
    @@ -7341,14 +7560,16 @@

    teal.slice coverage - 65.92%

    1033 - 8x + 8x +
              active_slices_ids <- active_slices_id()
    1034 - 8x + 8x +
              duplicated_slice_refs <- duplicated_slice_references()
    @@ -7362,7 +7583,8 @@

    teal.slice coverage - 65.92%

    1036 - 8x + 8x +
              checkbox_group_slice <- function(slice) {
    @@ -7376,63 +7598,72 @@

    teal.slice coverage - 65.92%

    1038 - 35x + 35x +
                isolate({
    1039 - 35x + 35x +
                  checkbox_group_element(
    1040 - 35x + 35x +
                    name = session$ns("available_slices_id"),
    1041 - 35x + 35x +
                    value = slice$id,
    1042 - 35x + 35x +
                    label = slice$id,
    1043 - 35x + 35x +
                    checked = if (slice$id %in% active_slices_ids) "checked",
    1044 - 35x + 35x +
                    disabled = slice$anchored ||
    1045 - 35x + 35x +
                      get_default_slice_id(slice) %in% duplicated_slice_refs &&
    1046 - 35x + 35x +
                        !slice$id %in% active_slices_ids
    @@ -7467,14 +7698,16 @@

    teal.slice coverage - 65.92%

    1051 - 8x + 8x +
              interactive_choice_mock <- lapply(slices_interactive(), checkbox_group_slice)
    1052 - 8x + 8x +
              non_interactive_choice_mock <- lapply(slices_fixed(), checkbox_group_slice)
    @@ -7488,63 +7721,72 @@

    teal.slice coverage - 65.92%

    1054 - 8x + 8x +
              htmltools::tagInsertChildren(
    1055 - 8x + 8x +
                checkbox,
    1056 - 8x + 8x +
                tags$br(),
    1057 - 8x + 8x +
                if (length(non_interactive_choice_mock)) tags$strong("Fixed filters"),
    1058 - 8x + 8x +
                non_interactive_choice_mock,
    1059 - 8x + 8x +
                if (length(interactive_choice_mock)) tags$strong("Interactive filters"),
    1060 - 8x + 8x +
                interactive_choice_mock,
    1061 - 8x + 8x +
                .cssSelector = "div.shiny-options-group",
    1062 - 8x + 8x +
                after = 0
    @@ -7572,49 +7814,56 @@

    teal.slice coverage - 65.92%

    1066 - 4x + 4x +
            observeEvent(input$available_slices_id, ignoreNULL = FALSE, ignoreInit = TRUE, {
    1067 - 5x + 5x +
              new_slices_id <- setdiff(input$available_slices_id, active_slices_id())
    1068 - 5x + 5x +
              removed_slices_id <- setdiff(active_slices_id(), input$available_slices_id)
    1069 - 5x + 5x +
              if (length(new_slices_id)) {
    1070 - 3x + 3x +
                new_teal_slices <- Filter(
    1071 - 3x + 3x +
                  function(slice) slice$id %in% new_slices_id,
    1072 - 3x + 3x +
                  private$available_teal_slices()
    @@ -7628,7 +7877,8 @@

    teal.slice coverage - 65.92%

    1074 - 3x + 3x +
                self$set_filter_state(new_teal_slices)
    @@ -7649,28 +7899,32 @@

    teal.slice coverage - 65.92%

    1077 - 5x + 5x +
              if (length(removed_slices_id)) {
    1078 - 4x + 4x +
                removed_teal_slices <- Filter(
    1079 - 4x + 4x +
                  function(slice) slice$id %in% removed_slices_id,
    1080 - 4x + 4x +
                  self$get_filter_state()
    @@ -7684,7 +7938,8 @@

    teal.slice coverage - 65.92%

    1082 - 4x + 4x +
                self$remove_filter_state(removed_teal_slices)
    @@ -7712,21 +7967,24 @@

    teal.slice coverage - 65.92%

    1086 - 4x + 4x +
            observeEvent(private$available_teal_slices(), ignoreNULL = FALSE, {
    1087 - 3x + 3x +
              if (length(private$available_teal_slices())) {
    1088 - 1x + 1x +
                shinyjs::show("available_menu")
    @@ -7740,7 +7998,8 @@

    teal.slice coverage - 65.92%

    1090 - 2x + 2x +
                shinyjs::hide("available_menu")
    @@ -8887,56 +9146,64 @@

    teal.slice coverage - 65.92%

    157 - 121x + 121x +
          isolate({
    158 - 121x + 121x +
            checkmate::assert_numeric(x, all.missing = FALSE)
    159 - 2x + 2x +
            if (!any(is.finite(x))) stop("\"x\" contains no finite values")
    160 - 118x + 118x +
            super$initialize(x = x, x_reactive = x_reactive, slice = slice, extract_type = extract_type)
    161 - 118x + 118x +
            private$is_integer <- checkmate::test_integerish(x)
    162 - 118x + 118x +
            private$inf_count <- sum(is.infinite(x))
    163 - 118x + 118x +
            private$inf_filtered_count <- reactive(
    164 - 118x + 118x +
              if (!is.null(private$x_reactive())) sum(is.infinite(private$x_reactive()))
    @@ -8957,14 +9224,16 @@

    teal.slice coverage - 65.92%

    167 - 118x + 118x +
            checkmate::assert_numeric(slice$choices, null.ok = TRUE)
    168 - 3x + 3x +
            if (is.null(slice$keep_inf) && any(is.infinite(x))) slice$keep_inf <- TRUE
    @@ -8978,21 +9247,24 @@

    teal.slice coverage - 65.92%

    170 - 117x + 117x +
            private$set_choices(slice$choices)
    171 - 42x + 42x +
            if (is.null(slice$selected)) slice$selected <- slice$choices
    172 - 117x + 117x +
            private$set_selected(slice$selected)
    @@ -9006,21 +9278,24 @@

    teal.slice coverage - 65.92%

    174 - 114x + 114x +
            private$is_integer <- checkmate::test_integerish(x)
    175 - 114x + 114x +
            private$inf_filtered_count <- reactive(
    176 - 114x + 114x +
              if (!is.null(private$x_reactive())) sum(is.infinite(private$x_reactive()))
    @@ -9034,7 +9309,8 @@

    teal.slice coverage - 65.92%

    178 - 114x + 114x +
            private$inf_count <- sum(is.infinite(x))
    @@ -9048,63 +9324,72 @@

    teal.slice coverage - 65.92%

    180 - 114x + 114x +
            private$plot_data <- list(
    181 - 114x + 114x +
              type = "histogram",
    182 - 114x + 114x +
              nbinsx = 50,
    183 - 114x + 114x +
              x = Filter(Negate(is.na), Filter(is.finite, private$x)),
    184 - 114x + 114x +
              color = I(fetch_bs_color("secondary")),
    185 - 114x + 114x +
              alpha = 0.2,
    186 - 114x + 114x +
              bingroup = 1,
    187 - 114x + 114x +
              showlegend = FALSE,
    188 - 114x + 114x +
              hoverinfo = "none"
    @@ -9118,21 +9403,24 @@

    teal.slice coverage - 65.92%

    190 - 114x + 114x +
            private$plot_mask <- list(list(
    191 - 114x + 114x +
              type = "rect", fillcolor = rgb(1, 1, 1, .65), line = list(width = 0),
    192 - 114x + 114x +
              x0 = -0.5, x1 = 1.5, y0 = -0.5, y1 = 1.5, xref = "paper", yref = "paper"
    @@ -9146,84 +9434,96 @@

    teal.slice coverage - 65.92%

    194 - 114x + 114x +
            private$plot_layout <- reactive({
    195 - 5x + 5x +
              shapes <- private$get_shape_properties(private$get_selected())
    196 - 5x + 5x +
              list(
    197 - 5x + 5x +
                barmode = "overlay",
    198 - 5x + 5x +
                xaxis = list(
    199 - 5x + 5x +
                  range = private$get_choices() * c(0.995, 1.005),
    200 - 5x + 5x +
                  rangeslider = list(thickness = 0),
    201 - 5x + 5x +
                  showticklabels = TRUE,
    202 - 5x + 5x +
                  ticks = "outside",
    203 - 5x + 5x +
                  ticklen = 1.5,
    204 - 5x + 5x +
                  tickmode = "auto",
    205 - 5x + 5x +
                  nticks = 10
    @@ -9237,35 +9537,40 @@

    teal.slice coverage - 65.92%

    207 - 5x + 5x +
                yaxis = list(showgrid = FALSE, showticklabels = FALSE),
    208 - 5x + 5x +
                margin = list(b = 17, l = 0, r = 0, t = 0, autoexpand = FALSE),
    209 - 5x + 5x +
                plot_bgcolor = "#FFFFFF00",
    210 - 5x + 5x +
                paper_bgcolor = "#FFFFFF00",
    211 - 5x + 5x +
                shapes = shapes
    @@ -9286,35 +9591,40 @@

    teal.slice coverage - 65.92%

    214 - 114x + 114x +
            private$plot_config <- reactive({
    215 - 5x + 5x +
              list(
    216 - 5x + 5x +
                doubleClick = "reset",
    217 - 5x + 5x +
                displayModeBar = FALSE,
    218 - 5x + 5x +
                edits = list(shapePosition = TRUE)
    @@ -9335,49 +9645,56 @@

    teal.slice coverage - 65.92%

    221 - 114x + 114x +
            private$plot_filtered <- reactive({
    222 - 5x + 5x +
              finite_values <- Filter(is.finite, private$x_reactive())
    223 - 5x + 5x +
              if (!identical(finite_values, numeric(0))) {
    224 - 5x + 5x +
                list(
    225 - 5x + 5x +
                  x = finite_values,
    226 - 5x + 5x +
                  bingroup = 1,
    227 - 5x + 5x +
                  color = I(fetch_bs_color("primary"))
    @@ -9405,7 +9722,8 @@

    teal.slice coverage - 65.92%

    231 - 114x + 114x +
            invisible(self)
    @@ -9496,14 +9814,16 @@

    teal.slice coverage - 65.92%

    244 - 35x + 35x +
          if (isFALSE(private$is_any_filtered())) {
    245 - 1x + 1x +
            return(NULL)
    @@ -9517,28 +9837,32 @@

    teal.slice coverage - 65.92%

    247 - 4x + 4x +
          if (missing(dataname)) dataname <- private$get_dataname()
    248 - 34x + 34x +
          varname <- private$get_varname_prefixed(dataname)
    249 - 34x + 34x +
          filter_call <-
    250 - 34x + 34x +
            call(
    @@ -9552,14 +9876,16 @@

    teal.slice coverage - 65.92%

    252 - 34x + 34x +
              call(">=", varname, private$get_selected()[1L]),
    253 - 34x + 34x +
              call("<=", varname, private$get_selected()[2L])
    @@ -9573,7 +9899,8 @@

    teal.slice coverage - 65.92%

    255 - 34x + 34x +
          private$add_keep_na_call(private$add_keep_inf_call(filter_call, varname), varname)
    @@ -9755,21 +10082,24 @@

    teal.slice coverage - 65.92%

    281 - 117x + 117x +
          x <- private$x[is.finite(private$x)]
    282 - 117x + 117x +
          if (is.null(choices)) {
    283 - 105x + 105x +
            choices <- range(x)
    @@ -9783,35 +10113,40 @@

    teal.slice coverage - 65.92%

    285 - 12x + 12x +
            choices_adjusted <- c(max(choices[1L], min(x)), min(choices[2L], max(x)))
    286 - 12x + 12x +
            if (any(choices != choices_adjusted)) {
    287 - 1x + 1x +
              warning(sprintf(
    288 - 1x + 1x +
                "Choices adjusted (some values outside of variable range). Varname: %s, dataname: %s.",
    289 - 1x + 1x +
                private$get_varname(), private$get_dataname()
    @@ -9825,7 +10160,8 @@

    teal.slice coverage - 65.92%

    291 - 1x + 1x +
              choices <- choices_adjusted
    @@ -9839,35 +10175,40 @@

    teal.slice coverage - 65.92%

    293 - 12x + 12x +
            if (choices[1L] > choices[2L]) {
    294 - 1x + 1x +
              warning(sprintf(
    295 - 1x + 1x +
                "Invalid choices: lower is higher / equal to upper, or not in range of variable values.
    296 - 1x + 1x +
                Setting defaults. Varname: %s, dataname: %s.",
    297 - 1x + 1x +
                private$get_varname(), private$get_dataname()
    @@ -9881,7 +10222,8 @@

    teal.slice coverage - 65.92%

    299 - 1x + 1x +
              choices <- range(x)
    @@ -9909,21 +10251,24 @@

    teal.slice coverage - 65.92%

    303 - 117x + 117x +
          private$set_is_choice_limited(private$x, choices)
    304 - 117x + 117x +
          private$x <- private$x[
    305 - 117x + 117x +
            (private$x >= choices[1L] & private$x <= choices[2L]) | is.na(private$x) | !is.finite(private$x)
    @@ -9944,7 +10289,8 @@

    teal.slice coverage - 65.92%

    308 - 117x + 117x +
          x_range <- range(private$x, finite = TRUE)
    @@ -9965,14 +10311,16 @@

    teal.slice coverage - 65.92%

    311 - 117x + 117x +
          if (identical(diff(x_range), 0)) {
    312 - 2x + 2x +
            choices <- x_range
    @@ -9986,21 +10334,24 @@

    teal.slice coverage - 65.92%

    314 - 115x + 115x +
            x_pretty <- pretty(x_range, 100L)
    315 - 115x + 115x +
            choices <- range(x_pretty)
    316 - 115x + 115x +
            private$numeric_step <- signif(private$get_pretty_range_step(x_pretty), digits = 10)
    @@ -10014,14 +10365,16 @@

    teal.slice coverage - 65.92%

    318 - 117x + 117x +
          private$teal_slice$choices <- choices
    319 - 117x + 117x +
          invisible(NULL)
    @@ -10063,28 +10416,32 @@

    teal.slice coverage - 65.92%

    325 - 117x + 117x +
          xl <- xl[!is.na(xl)]
    326 - 117x + 117x +
          xl <- xl[is.finite(xl)]
    327 - 117x + 117x +
          private$is_choice_limited <- (any(xl < choices[1L]) | any(xl > choices[2L]))
    328 - 117x + 117x +
          invisible(NULL)
    @@ -10126,14 +10483,16 @@

    teal.slice coverage - 65.92%

    334 - 34x + 34x +
          if (isTRUE(private$get_keep_inf())) {
    335 - 2x + 2x +
            call("|", call("is.infinite", varname), filter_call)
    @@ -10147,7 +10506,8 @@

    teal.slice coverage - 65.92%

    337 - 32x + 32x +
            filter_call
    @@ -10210,14 +10570,16 @@

    teal.slice coverage - 65.92%

    346 - 117x + 117x +
          if (private$is_integer && diff(range(pretty_range) > 2)) {
    347 - 46x + 46x +
            return(1L)
    @@ -10231,14 +10593,16 @@

    teal.slice coverage - 65.92%

    349 - 71x + 71x +
            n_steps <- length(pretty_range) - 1
    350 - 71x + 71x +
            return(signif(digits = 10, (max(pretty_range) - min(pretty_range)) / n_steps))
    @@ -10266,35 +10630,40 @@

    teal.slice coverage - 65.92%

    354 - 133x + 133x +
          tryCatch(
    355 - 133x + 133x +
            expr = {
    356 - 133x + 133x +
              values <- as.numeric(values)
    357 - 4x + 4x +
              if (anyNA(values)) stop()
    358 - 129x + 129x +
              values
    @@ -10308,7 +10677,8 @@

    teal.slice coverage - 65.92%

    360 - 133x + 133x +
            error = function(e) stop("Vector of set values must contain values coercible to numeric")
    @@ -10343,21 +10713,24 @@

    teal.slice coverage - 65.92%

    365 - 2x + 2x +
          if (length(values) != 2L) stop("Vector of set values must have length two.")
    366 - 2x + 2x +
          if (values[1L] > values[2L]) stop("Vector of set values must be sorted.")
    367 - 125x + 125x +
          values
    @@ -10385,21 +10758,24 @@

    teal.slice coverage - 65.92%

    371 - 2x + 2x +
          if (values[1L] < private$get_choices()[1L]) values[1L] <- private$get_choices()[1L]
    372 - 2x + 2x +
          if (values[2L] > private$get_choices()[2L]) values[2L] <- private$get_choices()[2L]
    373 - 125x + 125x +
          values
    @@ -10441,35 +10817,40 @@

    teal.slice coverage - 65.92%

    379 - 35x + 35x +
          if (private$is_choice_limited) {
    380 - 1x + 1x +
            TRUE
    381 - 34x + 34x +
          } else if (!isTRUE(all.equal(private$get_selected(), private$get_choices()))) {
    382 - 32x + 32x +
            TRUE
    383 - 2x + 2x +
          } else if (!isTRUE(private$get_keep_inf()) && private$inf_count > 0) {
    @@ -10483,14 +10864,16 @@

    teal.slice coverage - 65.92%

    385 - 2x + 2x +
          } else if (!isTRUE(private$get_keep_na()) && private$na_count > 0) {
    386 - 1x + 1x +
            TRUE
    @@ -10504,7 +10887,8 @@

    teal.slice coverage - 65.92%

    388 - 1x + 1x +
            FALSE
    @@ -10553,21 +10937,24 @@

    teal.slice coverage - 65.92%

    395 - 5x + 5x +
          list(
    396 - 5x + 5x +
            list(type = "line", x0 = values[1], x1 = values[1], y0 = -100, y1 = 100, yref = "paper"),
    397 - 5x + 5x +
            list(type = "line", x0 = values[2], x1 = values[2], y0 = -100, y1 = 100, yref = "paper")
    @@ -10644,70 +11031,80 @@

    teal.slice coverage - 65.92%

    408 - 5x + 5x +
          ns <- NS(id)
    409 - 5x + 5x +
          isolate({
    410 - 5x + 5x +
            ui_input <- shinyWidgets::numericRangeInput(
    411 - 5x + 5x +
              inputId = ns("selection_manual"),
    412 - 5x + 5x +
              label = NULL,
    413 - 5x + 5x +
              min = private$get_choices()[1L],
    414 - 5x + 5x +
              max = private$get_choices()[2L],
    415 - 5x + 5x +
              value = private$get_selected(),
    416 - 5x + 5x +
              step = private$numeric_step,
    417 - 5x + 5x +
              width = "100%"
    @@ -10721,28 +11118,32 @@

    teal.slice coverage - 65.92%

    419 - 5x + 5x +
            tagList(
    420 - 5x + 5x +
              tags$div(
    421 - 5x + 5x +
                class = "choices_state",
    422 - 5x + 5x +
                tags$head(tags$script(
    @@ -10770,21 +11171,24 @@

    teal.slice coverage - 65.92%

    426 - 5x + 5x +
                  HTML(
    427 - 5x + 5x +
                    '$(document).ready(function() {
    428 - 5x + 5x +
                      $("[data-toggle=\'popover\']").popover();
    @@ -10798,35 +11202,40 @@

    teal.slice coverage - 65.92%

    430 - 5x + 5x +
                      $(document).on("click", function (e) {
    431 - 5x + 5x +
                        if (!$("[data-toggle=\'popover\']").is(e.target) &&
    432 - 5x + 5x +
                            $("[data-toggle=\'popover\']").has(e.target).length === 0 &&
    433 - 5x + 5x +
                            $(".popover").has(e.target).length === 0) {
    434 - 5x + 5x +
                          $("[data-toggle=\'popover\']").popover("hide");
    @@ -10868,105 +11277,120 @@

    teal.slice coverage - 65.92%

    440 - 5x + 5x +
                tags$div(
    441 - 5x + 5x +
                  actionLink(
    442 - 5x + 5x +
                    ns("plotly_info"),
    443 - 5x + 5x +
                    label = NULL,
    444 - 5x + 5x +
                    icon = icon("question-circle"),
    445 - 5x + 5x +
                    "data-toggle" = "popover",
    446 - 5x + 5x +
                    "data-html" = "true",
    447 - 5x + 5x +
                    "data-placement" = "left",
    448 - 5x + 5x +
                    "data-trigger" = "click",
    449 - 5x + 5x +
                    "data-title" = "Plot actions",
    450 - 5x + 5x +
                    "data-content" = "<p>
    451 - 5x + 5x +
                                      Drag vertical lines to set selection.<br>
    452 - 5x + 5x +
                                      Drag across plot to zoom in.<br>
    453 - 5x + 5x +
                                      Drag axis to pan.<br>
    454 - 5x + 5x +
                                      Double click to zoom out."
    @@ -10980,7 +11404,8 @@

    teal.slice coverage - 65.92%

    456 - 5x + 5x +
                  style = "text-align: right; font-size: 0.7em; margin-bottom: -1em; position: relative; z-index: 9;"
    @@ -10994,35 +11419,40 @@

    teal.slice coverage - 65.92%

    458 - 5x + 5x +
                shinycssloaders::withSpinner(
    459 - 5x + 5x +
                  plotly::plotlyOutput(ns("plot"), height = "50px"),
    460 - 5x + 5x +
                  type = 4,
    461 - 5x + 5x +
                  size = 0.25,
    462 - 5x + 5x +
                  hide.ui = FALSE
    @@ -11036,7 +11466,8 @@

    teal.slice coverage - 65.92%

    464 - 5x + 5x +
                ui_input
    @@ -11050,28 +11481,32 @@

    teal.slice coverage - 65.92%

    466 - 5x + 5x +
              tags$div(
    467 - 5x + 5x +
                class = "filter-card-body-keep-na-inf",
    468 - 5x + 5x +
                private$keep_inf_ui(ns("keep_inf")),
    469 - 5x + 5x +
                private$keep_na_ui(ns("keep_na"))
    @@ -11148,28 +11583,32 @@

    teal.slice coverage - 65.92%

    480 - 5x + 5x +
          moduleServer(
    481 - 5x + 5x +
            id = id,
    482 - 5x + 5x +
            function(input, output, session) {
    483 - 5x + 5x +
              logger::log_trace("RangeFilterState$server initializing, id: { private$get_id() }")
    @@ -11190,7 +11629,8 @@

    teal.slice coverage - 65.92%

    486 - 5x + 5x +
              selection_manual <- debounce(reactive(input$selection_manual), 200)
    @@ -11211,7 +11651,8 @@

    teal.slice coverage - 65.92%

    489 - 5x + 5x +
              plot_data <- c(private$plot_data, source = session$ns("histogram_plot"))
    @@ -11232,42 +11673,48 @@

    teal.slice coverage - 65.92%

    492 - 5x + 5x +
              output$plot <- plotly::renderPlotly({
    493 - 5x + 5x +
                histogram <- do.call(plotly::plot_ly, plot_data)
    494 - 5x + 5x +
                histogram <- do.call(plotly::layout, c(list(p = histogram), private$plot_layout()))
    495 - 5x + 5x +
                histogram <- do.call(plotly::config, c(list(p = histogram), private$plot_config()))
    496 - 5x + 5x +
                histogram <- do.call(plotly::add_histogram, c(list(p = histogram), private$plot_filtered()))
    497 - 5x + 5x +
                histogram
    @@ -11295,63 +11742,72 @@

    teal.slice coverage - 65.92%

    501 - 5x + 5x +
              private$observers$relayout <-
    502 - 5x + 5x +
                observeEvent(
    503 - 5x + 5x +
                  ignoreNULL = FALSE,
    504 - 5x + 5x +
                  ignoreInit = TRUE,
    505 - 5x + 5x +
                  eventExpr = plotly::event_data("plotly_relayout", source = session$ns("histogram_plot")),
    506 - 5x + 5x +
                  handlerExpr = {
    507 - 1x + 1x +
                    logger::log_trace("RangeFilterState$server@1 selection changed, id: { private$get_id() }")
    508 - 1x + 1x +
                    event <- plotly::event_data("plotly_relayout", source = session$ns("histogram_plot"))
    509 - 1x + 1x +
                    if (any(grepl("shapes", names(event)))) {
    @@ -11540,42 +11996,48 @@

    teal.slice coverage - 65.92%

    536 - 5x + 5x +
              private$observers$selection_api <-
    537 - 5x + 5x +
                observeEvent(
    538 - 5x + 5x +
                  ignoreNULL = FALSE,
    539 - 5x + 5x +
                  ignoreInit = TRUE,
    540 - 5x + 5x +
                  eventExpr = private$get_selected(),
    541 - 5x + 5x +
                  handlerExpr = {
    @@ -11666,35 +12128,40 @@

    teal.slice coverage - 65.92%

    554 - 5x + 5x +
              private$observers$selection_manual <- observeEvent(
    555 - 5x + 5x +
                ignoreNULL = FALSE,
    556 - 5x + 5x +
                ignoreInit = TRUE,
    557 - 5x + 5x +
                eventExpr = selection_manual(),
    558 - 5x + 5x +
                handlerExpr = {
    @@ -11960,14 +12427,16 @@

    teal.slice coverage - 65.92%

    596 - 5x + 5x +
              private$keep_inf_srv("keep_inf")
    597 - 5x + 5x +
              private$keep_na_srv("keep_na")
    @@ -11981,14 +12450,16 @@

    teal.slice coverage - 65.92%

    599 - 5x + 5x +
              logger::log_trace("RangeFilterState$server initialized, id: { private$get_id() }")
    600 - 5x + 5x +
              NULL
    @@ -12275,42 +12746,48 @@

    teal.slice coverage - 65.92%

    641 - 5x + 5x +
          selection <- private$get_selected()
    642 - 5x + 5x +
          tagList(
    643 - 5x + 5x +
            tags$span(HTML(selection[1], "&ndash;", selection[2]), class = "filter-card-summary-value"),
    644 - 5x + 5x +
            tags$span(
    645 - 5x + 5x +
              class = "filter-card-summary-controls",
    646 - 5x + 5x +
              if (private$na_count > 0) {
    @@ -12331,7 +12808,8 @@

    teal.slice coverage - 65.92%

    649 - 5x + 5x +
              if (private$inf_count > 0) {
    @@ -12415,7 +12893,8 @@

    teal.slice coverage - 65.92%

    661 - 5x + 5x +
          ns <- NS(id)
    @@ -12429,7 +12908,8 @@

    teal.slice coverage - 65.92%

    663 - 5x + 5x +
          if (private$inf_count > 0) {
    @@ -12569,7 +13049,8 @@

    teal.slice coverage - 65.92%

    683 - 5x + 5x +
            NULL
    @@ -12646,7 +13127,8 @@

    teal.slice coverage - 65.92%

    694 - 5x + 5x +
          moduleServer(id, function(input, output, session) {
    @@ -12674,42 +13156,48 @@

    teal.slice coverage - 65.92%

    698 - 5x + 5x +
            output$trigger_visible <- renderUI({
    699 - 5x + 5x +
              updateCountText(
    700 - 5x + 5x +
                inputId = "count_label",
    701 - 5x + 5x +
                label = "Keep Inf",
    702 - 5x + 5x +
                countmax = private$inf_count,
    703 - 5x + 5x +
                countnow = private$inf_filtered_count()
    @@ -12723,7 +13211,8 @@

    teal.slice coverage - 65.92%

    705 - 5x + 5x +
              NULL
    @@ -12765,35 +13254,40 @@

    teal.slice coverage - 65.92%

    711 - 5x + 5x +
            private$observers$keep_inf_api <- observeEvent(
    712 - 5x + 5x +
              ignoreNULL = TRUE, # its not possible for range that NULL is selected
    713 - 5x + 5x +
              ignoreInit = TRUE, # ignoreInit: should not matter because we set the UI with the desired initial state
    714 - 5x + 5x +
              eventExpr = private$get_keep_inf(),
    715 - 5x + 5x +
              handlerExpr = {
    @@ -12870,35 +13364,40 @@

    teal.slice coverage - 65.92%

    726 - 5x + 5x +
            private$observers$keep_inf <- observeEvent(
    727 - 5x + 5x +
              ignoreNULL = TRUE, # it's not possible for range that NULL is selected
    728 - 5x + 5x +
              ignoreInit = TRUE, # ignoreInit: should not matter because we set the UI with the desired initial state
    729 - 5x + 5x +
              eventExpr = input$value,
    730 - 5x + 5x +
              handlerExpr = {
    @@ -12947,7 +13446,8 @@

    teal.slice coverage - 65.92%

    737 - 5x + 5x +
            invisible(NULL)
    @@ -13366,7 +13866,8 @@

    teal.slice coverage - 65.92%

    55 - 23x + 23x +
          if (!requireNamespace("MultiAssayExperiment", quietly = TRUE)) {
    @@ -13387,21 +13888,24 @@

    teal.slice coverage - 65.92%

    58 - 23x + 23x +
          checkmate::assert_class(dataset, "MultiAssayExperiment")
    59 - 21x + 21x +
          super$initialize(dataset, dataname, keys, label)
    60 - 21x + 21x +
          experiment_names <- names(dataset)
    @@ -13422,49 +13926,56 @@

    teal.slice coverage - 65.92%

    63 - 21x + 21x +
          private$add_filter_states(
    64 - 21x + 21x +
            filter_states = init_filter_states(
    65 - 21x + 21x +
              data = dataset,
    66 - 21x + 21x +
              data_reactive = private$data_filtered_fun,
    67 - 21x + 21x +
              dataname = dataname,
    68 - 21x + 21x +
              datalabel = "subjects",
    69 - 21x + 21x +
              keys = self$get_keys()
    @@ -13478,7 +13989,8 @@

    teal.slice coverage - 65.92%

    71 - 21x + 21x +
            id = "subjects"
    @@ -13513,70 +14025,80 @@

    teal.slice coverage - 65.92%

    76 - 21x + 21x +
          lapply(
    77 - 21x + 21x +
            experiment_names,
    78 - 21x + 21x +
            function(experiment_name) {
    79 - 105x + 105x +
              data_reactive <- function(sid = "") private$data_filtered_fun(sid)[[experiment_name]]
    80 - 105x + 105x +
              private$add_filter_states(
    81 - 105x + 105x +
                filter_states = init_filter_states(
    82 - 105x + 105x +
                  data = dataset[[experiment_name]],
    83 - 105x + 105x +
                  data_reactive = data_reactive,
    84 - 105x + 105x +
                  dataname = dataname,
    85 - 105x + 105x +
                  datalabel = experiment_name
    @@ -13590,7 +14112,8 @@

    teal.slice coverage - 65.92%

    87 - 105x + 105x +
                id = experiment_name
    @@ -13681,35 +14204,40 @@

    teal.slice coverage - 65.92%

    100 - 15x + 15x +
          isolate({
    101 - 15x + 15x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initializing, dataname: { private$dataname }")
    102 - 15x + 15x +
            checkmate::assert_class(state, "teal_slices")
    103 - 14x + 14x +
            lapply(state, function(x) {
    104 - 52x + 52x +
              checkmate::assert_true(x$dataname == private$dataname, .var.name = "dataname matches private$dataname")
    @@ -13737,14 +14265,16 @@

    teal.slice coverage - 65.92%

    108 - 14x + 14x +
            subject_state <- Filter(function(x) is.null(x$experiment), state)
    109 - 14x + 14x +
            private$get_filter_states()[["subjects"]]$set_filter_state(subject_state)
    @@ -13772,28 +14302,32 @@

    teal.slice coverage - 65.92%

    113 - 14x + 14x +
            experiments <- unique(unlist(lapply(state, "[[", "experiment")))
    114 - 14x + 14x +
            available_experiments <- setdiff(names(private$get_filter_states()), "subjects")
    115 - 14x + 14x +
            excluded_filters <- setdiff(experiments, available_experiments)
    116 - 14x + 14x +
            if (length(excluded_filters)) {
    @@ -13863,21 +14397,24 @@

    teal.slice coverage - 65.92%

    126 - 14x + 14x +
            lapply(available_experiments, function(experiment) {
    127 - 70x + 70x +
              slices <- Filter(function(x) identical(x$experiment, experiment), state)
    128 - 70x + 70x +
              private$get_filter_states()[[experiment]]$set_filter_state(slices)
    @@ -13898,7 +14435,8 @@

    teal.slice coverage - 65.92%

    131 - 14x + 14x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initialized, dataname: { private$dataname }")
    @@ -13912,7 +14450,8 @@

    teal.slice coverage - 65.92%

    133 - 14x + 14x +
            invisible(NULL)
    @@ -14010,7 +14549,8 @@

    teal.slice coverage - 65.92%

    147 - 1x + 1x +
          checkmate::assert_class(state, "teal_slices")
    @@ -14024,14 +14564,16 @@

    teal.slice coverage - 65.92%

    149 - 1x + 1x +
          isolate({
    150 - 1x + 1x +
            logger::log_trace("{ class(self)[1] }$remove_filter_state removing filter(s), dataname: { private$dataname }")
    @@ -14045,14 +14587,16 @@

    teal.slice coverage - 65.92%

    152 - 1x + 1x +
            subject_state <- Filter(function(x) is.null(x$experiment), state)
    153 - 1x + 1x +
            private$get_filter_states()[["subjects"]]$remove_filter_state(subject_state)
    @@ -14080,28 +14624,32 @@

    teal.slice coverage - 65.92%

    157 - 1x + 1x +
            experiments <- unique(unlist(lapply(state, "[[", "experiment")))
    158 - 1x + 1x +
            available_experiments <- setdiff(names(private$get_filter_states()), "subjects")
    159 - 1x + 1x +
            excluded_filters <- setdiff(experiments, available_experiments)
    160 - 1x + 1x +
            if (length(excluded_filters)) {
    @@ -14164,7 +14712,8 @@

    teal.slice coverage - 65.92%

    169 - 1x + 1x +
            lapply(experiments, function(experiment) {
    @@ -14206,7 +14755,8 @@

    teal.slice coverage - 65.92%

    175 - 1x + 1x +
            logger::log_trace("{ class(self)[1] }$remove_filter_state removed filter(s), dataname: { private$dataname }")
    @@ -14227,7 +14777,8 @@

    teal.slice coverage - 65.92%

    178 - 1x + 1x +
          invisible(NULL)
    @@ -14514,21 +15065,24 @@

    teal.slice coverage - 65.92%

    219 - 2x + 2x +
          data <- self$get_dataset()
    220 - 2x + 2x +
          data_filtered <- self$get_dataset(TRUE)
    221 - 2x + 2x +
          experiment_names <- names(data)
    @@ -14542,28 +15096,32 @@

    teal.slice coverage - 65.92%

    223 - 2x + 2x +
          mae_info <- data.frame(
    224 - 2x + 2x +
            dataname = private$dataname,
    225 - 2x + 2x +
            subjects = nrow(SummarizedExperiment::colData(data)),
    226 - 2x + 2x +
            subjects_filtered = nrow(SummarizedExperiment::colData(data_filtered()))
    @@ -14584,49 +15142,56 @@

    teal.slice coverage - 65.92%

    229 - 2x + 2x +
          experiment_obs_info <- do.call("rbind", lapply(
    230 - 2x + 2x +
            experiment_names,
    231 - 2x + 2x +
            function(experiment_name) {
    232 - 10x + 10x +
              data.frame(
    233 - 10x + 10x +
                dataname = sprintf("- %s", experiment_name),
    234 - 10x + 10x +
                obs = nrow(data[[experiment_name]]),
    235 - 10x + 10x +
                obs_filtered = nrow(data_filtered()[[experiment_name]])
    @@ -14661,21 +15226,24 @@

    teal.slice coverage - 65.92%

    240 - 2x + 2x +
          get_experiment_keys <- function(mae, experiment) {
    241 - 20x + 20x +
            sample_subset <- subset(MultiAssayExperiment::sampleMap(mae), colname %in% colnames(experiment))
    242 - 20x + 20x +
            length(unique(sample_subset$primary))
    @@ -14696,42 +15264,48 @@

    teal.slice coverage - 65.92%

    245 - 2x + 2x +
          experiment_subjects_info <- do.call("rbind", lapply(
    246 - 2x + 2x +
            experiment_names,
    247 - 2x + 2x +
            function(experiment_name) {
    248 - 10x + 10x +
              data.frame(
    249 - 10x + 10x +
                subjects = get_experiment_keys(data, data[[experiment_name]]),
    250 - 10x + 10x +
                subjects_filtered = get_experiment_keys(data_filtered(), data_filtered()[[experiment_name]])
    @@ -14766,14 +15340,16 @@

    teal.slice coverage - 65.92%

    255 - 2x + 2x +
          experiment_info <- cbind(experiment_obs_info, experiment_subjects_info)
    256 - 2x + 2x +
          dplyr::bind_rows(mae_info, experiment_info)
    @@ -15668,21 +16244,24 @@

    teal.slice coverage - 65.92%

    124 - 580x + 580x +
      checkmate::assert_string(dataname)
    125 - 573x + 573x +
      checkmate::assert_flag(fixed)
    126 - 571x + 571x +
      checkmate::assert_flag(anchored)
    @@ -15696,7 +16275,8 @@

    teal.slice coverage - 65.92%

    128 - 569x + 569x +
      formal_args <- as.list(environment())
    @@ -15710,7 +16290,8 @@

    teal.slice coverage - 65.92%

    130 - 569x + 569x +
      if (!missing(expr) && !missing(varname)) {
    @@ -15724,28 +16305,32 @@

    teal.slice coverage - 65.92%

    132 - 569x + 569x +
      } else if (!missing(expr)) {
    133 - 30x + 30x +
        checkmate::assert_string(id)
    134 - 27x + 27x +
        checkmate::assert_string(title)
    135 - 24x + 24x +
        checkmate::assert_string(expr)
    @@ -15759,84 +16344,96 @@

    teal.slice coverage - 65.92%

    137 - 23x + 23x +
        formal_args$fixed <- TRUE
    138 - 23x + 23x +
        ts_expr_args <- c("dataname", "id", "expr", "fixed", "anchored", "title")
    139 - 23x + 23x +
        formal_args <- formal_args[ts_expr_args]
    140 - 23x + 23x +
        ans <- do.call(reactiveValues, c(formal_args, list(...)))
    141 - 23x + 23x +
        class(ans) <- c("teal_slice_expr", "teal_slice", class(ans))
    142 - 539x + 539x +
      } else if (!missing(varname)) {
    143 - 538x + 538x +
        checkmate::assert_string(varname)
    144 - 535x + 535x +
        checkmate::assert_multi_class(choices, .filterable_class, null.ok = TRUE)
    145 - 534x + 534x +
        checkmate::assert_multi_class(selected, .filterable_class, null.ok = TRUE)
    146 - 532x + 532x +
        checkmate::assert_flag(keep_na, null.ok = TRUE)
    147 - 531x + 531x +
        checkmate::assert_flag(keep_inf, null.ok = TRUE)
    148 - 530x + 530x +
        checkmate::assert_flag(multiple)
    @@ -15850,21 +16447,24 @@

    teal.slice coverage - 65.92%

    150 - 530x + 530x +
        ts_var_args <- c(
    151 - 530x + 530x +
          "dataname", "varname", "id", "choices", "selected", "keep_na", "keep_inf",
    152 - 530x + 530x +
          "fixed", "anchored", "multiple"
    @@ -15878,42 +16478,48 @@

    teal.slice coverage - 65.92%

    154 - 530x + 530x +
        formal_args <- formal_args[ts_var_args]
    155 - 530x + 530x +
        args <- c(formal_args, list(...))
    156 - 530x + 530x +
        args[c("choices", "selected")] <-
    157 - 530x + 530x +
          lapply(args[c("choices", "selected")], function(x) if (is.factor(x)) as.character(x) else x)
    158 - 530x + 530x +
        if (missing(id)) {
    159 - 521x + 521x +
          args$id <- get_default_slice_id(args)
    @@ -15927,7 +16533,8 @@

    teal.slice coverage - 65.92%

    161 - 9x + 9x +
          checkmate::assert_string(id)
    @@ -15941,14 +16548,16 @@

    teal.slice coverage - 65.92%

    163 - 527x + 527x +
        ans <- do.call(reactiveValues, args)
    164 - 527x + 527x +
        class(ans) <- c("teal_slice_var", "teal_slice", class(ans))
    @@ -15962,7 +16571,8 @@

    teal.slice coverage - 65.92%

    166 - 1x + 1x +
        stop("Must provide either `expr` or `varname`.")
    @@ -15983,7 +16593,8 @@

    teal.slice coverage - 65.92%

    169 - 550x + 550x +
      ans
    @@ -16116,7 +16727,8 @@

    teal.slice coverage - 65.92%

    188 - 4x + 4x +
      inherits(x, "teal_slice")
    @@ -16221,7 +16833,8 @@

    teal.slice coverage - 65.92%

    203 - 283x + 283x +
      formal_args <- setdiff(names(formals(teal_slice)), "...")
    @@ -16235,7 +16848,8 @@

    teal.slice coverage - 65.92%

    205 - 283x + 283x +
      x <- if (isRunning()) {
    @@ -16256,7 +16870,8 @@

    teal.slice coverage - 65.92%

    208 - 283x + 283x +
        isolate(reactiveValuesToList(x))
    @@ -16277,14 +16892,16 @@

    teal.slice coverage - 65.92%

    211 - 283x + 283x +
      formal_args <- intersect(formal_args, names(x))
    212 - 283x + 283x +
      extra_args <- rev(setdiff(names(x), formal_args))
    @@ -16298,7 +16915,8 @@

    teal.slice coverage - 65.92%

    214 - 283x + 283x +
      x[c(formal_args, extra_args)]
    @@ -16354,14 +16972,16 @@

    teal.slice coverage - 65.92%

    222 - 116x + 116x +
      checkmate::assert_flag(show_all)
    223 - 92x + 92x +
      checkmate::assert_flag(trim_lines)
    @@ -16375,14 +16995,16 @@

    teal.slice coverage - 65.92%

    225 - 86x + 86x +
      x_list <- as.list(x)
    226 - 47x + 47x +
      if (!show_all) x_list <- Filter(Negate(is.null), x_list)
    @@ -16396,7 +17018,8 @@

    teal.slice coverage - 65.92%

    228 - 86x + 86x +
      jsonify(x_list, trim_lines)
    @@ -16445,7 +17068,8 @@

    teal.slice coverage - 65.92%

    235 - 15x + 15x +
      cat(format(x, ...))
    @@ -16571,7 +17195,8 @@

    teal.slice coverage - 65.92%

    253 - 131x + 131x +
      checkmate::assert_list(x)
    @@ -16585,28 +17210,32 @@

    teal.slice coverage - 65.92%

    255 - 131x + 131x +
      x_json <- to_json(x)
    256 - 131x + 131x +
      x_json_justified <- justify_json(x_json)
    257 - 121x + 121x +
      if (trim_lines) x_json_justified <- trim_lines_json(x_json_justified)
    258 - 131x + 131x +
      paste(x_json_justified, collapse = "\n")
    @@ -16711,35 +17340,40 @@

    teal.slice coverage - 65.92%

    273 - 131x + 131x +
      no_unbox <- function(x) {
    274 - 2390x + 2390x +
        vars <- c("selected", "choices")
    275 - 2390x + 2390x +
        if (is.list(x)) {
    276 - 385x + 385x +
          for (var in vars) {
    277 - 307x + 307x +
            if (!is.null(x[[var]])) x[[var]] <- I(format_time(x[[var]]))
    @@ -16753,7 +17387,8 @@

    teal.slice coverage - 65.92%

    279 - 385x + 385x +
          lapply(x, no_unbox)
    @@ -16767,7 +17402,8 @@

    teal.slice coverage - 65.92%

    281 - 2005x + 2005x +
          x
    @@ -16795,7 +17431,8 @@

    teal.slice coverage - 65.92%

    285 - 131x + 131x +
      jsonlite::toJSON(no_unbox(x), pretty = TRUE, auto_unbox = TRUE, digits = 16, null = "null")
    @@ -16907,14 +17544,16 @@

    teal.slice coverage - 65.92%

    301 - 307x + 307x +
      if ("POSIXt" %in% class(x)) {
    302 - 20x + 20x +
        format(x, format = "%Y-%m-%d %H:%M:%S", usetz = TRUE, tz = "UTC")
    @@ -16928,7 +17567,8 @@

    teal.slice coverage - 65.92%

    304 - 287x + 287x +
        x
    @@ -17033,35 +17673,40 @@

    teal.slice coverage - 65.92%

    319 - 131x + 131x +
      format_name <- function(name, name_width) {
    320 - 2775x + 2775x +
        if (nchar(name) == 1 || nchar(gsub("\\s", "", name)) <= 2) {
    321 - 630x + 630x +
          return(name)
    322 - 2145x + 2145x +
        } else if (grepl("slices|attributes", name)) {
    323 - 90x + 90x +
          paste0(name, ":")
    @@ -17075,7 +17720,8 @@

    teal.slice coverage - 65.92%

    325 - 2055x + 2055x +
          paste(format(name, width = name_width), ":")
    @@ -17096,28 +17742,32 @@

    teal.slice coverage - 65.92%

    328 - 131x + 131x +
      json_lines <- strsplit(json, "\n")[[1]]
    329 - 131x + 131x +
      json_lines_split <- regmatches(json_lines, regexpr(":", json_lines), invert = TRUE)
    330 - 131x + 131x +
      name_width <- max(unlist(regexpr(":", json_lines))) - 1
    331 - 131x + 131x +
      vapply(json_lines_split, function(x) paste0(format_name(x[1], name_width), stats::na.omit(x[2])), character(1))
    @@ -17222,35 +17872,40 @@

    teal.slice coverage - 65.92%

    346 - 121x + 121x +
      name_width <- max(unlist(gregexpr(":", x))) - 1
    347 - 121x + 121x +
      trim_position <- name_width + 37L
    348 - 121x + 121x +
      x_trim <- substr(x, 1, trim_position)
    349 - 121x + 121x +
      substr(x_trim, trim_position - 2, trim_position) <- "..."
    350 - 121x + 121x +
      x_trim
    @@ -17418,28 +18073,32 @@

    teal.slice coverage - 65.92%

    374 - 610x + 610x +
      checkmate::assert_multi_class(x, c("teal_slice", "list"))
    375 - 610x + 610x +
      isolate({
    376 - 610x + 610x +
        if (inherits(x, "teal_slice_expr") || is.null(x$varname)) {
    377 - 10x + 10x +
          x$id
    @@ -17453,28 +18112,32 @@

    teal.slice coverage - 65.92%

    379 - 600x + 600x +
          paste(
    380 - 600x + 600x +
            Filter(
    381 - 600x + 600x +
              length,
    382 - 600x + 600x +
              as.list(x)[c("dataname", "varname", "experiment", "arg")]
    @@ -17488,7 +18151,8 @@

    teal.slice coverage - 65.92%

    384 - 600x + 600x +
            collapse = " "
    @@ -18019,14 +18683,16 @@

    teal.slice coverage - 65.92%

    71 - 103x + 103x +
          checkmate::assert_data_frame(dataset)
    72 - 101x + 101x +
          super$initialize(dataset, dataname, keys, label)
    @@ -18047,21 +18713,24 @@

    teal.slice coverage - 65.92%

    75 - 99x + 99x +
          if (!is.null(parent)) {
    76 - 10x + 10x +
            checkmate::assert_character(parent_name, len = 1)
    77 - 10x + 10x +
            checkmate::assert_character(join_keys, min.len = 1)
    @@ -18075,14 +18744,16 @@

    teal.slice coverage - 65.92%

    79 - 10x + 10x +
            private$parent_name <- parent_name
    80 - 10x + 10x +
            private$join_keys <- join_keys
    @@ -18096,28 +18767,32 @@

    teal.slice coverage - 65.92%

    82 - 10x + 10x +
            private$data_filtered_fun <- function(sid = "") {
    83 - 8x + 8x +
              checkmate::assert_character(sid)
    84 - 8x + 8x +
              if (length(sid)) {
    85 - 8x + 8x +
                logger::log_trace("filtering data dataname: { dataname }, sid: { sid }")
    @@ -18145,42 +18820,48 @@

    teal.slice coverage - 65.92%

    89 - 8x + 8x +
              env <- new.env(parent = parent.env(globalenv()))
    90 - 8x + 8x +
              env[[dataname]] <- private$dataset
    91 - 8x + 8x +
              env[[parent_name]] <- parent()
    92 - 8x + 8x +
              filter_call <- self$get_call(sid)
    93 - 8x + 8x +
              eval_expr_with_msg(filter_call, env)
    94 - 8x + 8x +
              get(x = dataname, envir = env)
    @@ -18208,42 +18889,48 @@

    teal.slice coverage - 65.92%

    98 - 99x + 99x +
          private$add_filter_states(
    99 - 99x + 99x +
            filter_states = init_filter_states(
    100 - 99x + 99x +
              data = dataset,
    101 - 99x + 99x +
              data_reactive = private$data_filtered_fun,
    102 - 99x + 99x +
              dataname = dataname,
    103 - 99x + 99x +
              keys = self$get_keys()
    @@ -18257,7 +18944,8 @@

    teal.slice coverage - 65.92%

    105 - 99x + 99x +
            id = "filter"
    @@ -18285,35 +18973,40 @@

    teal.slice coverage - 65.92%

    109 - 99x + 99x +
          if (!is.null(parent)) {
    110 - 10x + 10x +
            fs <- teal_slices(
    111 - 10x + 10x +
              exclude_varnames = structure(
    112 - 10x + 10x +
                list(intersect(colnames(dataset), colnames(isolate(parent())))),
    113 - 10x + 10x +
                names = private$dataname
    @@ -18334,7 +19027,8 @@

    teal.slice coverage - 65.92%

    116 - 10x + 10x +
            self$set_filter_state(fs)
    @@ -18355,7 +19049,8 @@

    teal.slice coverage - 65.92%

    119 - 99x + 99x +
          invisible(self)
    @@ -18481,28 +19176,32 @@

    teal.slice coverage - 65.92%

    137 - 42x + 42x +
          logger::log_trace("DataframeFilteredDataset$get_call initializing for dataname: { private$dataname }")
    138 - 42x + 42x +
          filter_call <- super$get_call(sid)
    139 - 42x + 42x +
          dataname <- private$dataname
    140 - 42x + 42x +
          parent_dataname <- private$parent_name
    @@ -18516,28 +19215,32 @@

    teal.slice coverage - 65.92%

    142 - 42x + 42x +
          if (!identical(parent_dataname, character(0))) {
    143 - 9x + 9x +
            join_keys <- private$join_keys
    144 - 9x + 9x +
            parent_keys <- unname(join_keys)
    145 - 9x + 9x +
            dataset_keys <- names(join_keys)
    @@ -18551,7 +19254,8 @@

    teal.slice coverage - 65.92%

    147 - 9x + 9x +
            y_arg <- if (length(parent_keys) == 0L) {
    @@ -18572,28 +19276,32 @@

    teal.slice coverage - 65.92%

    150 - 9x + 9x +
              sprintf(
    151 - 9x + 9x +
                "%s[, c(%s), drop = FALSE]",
    152 - 9x + 9x +
                parent_dataname,
    153 - 9x + 9x +
                toString(dQuote(parent_keys, q = FALSE))
    @@ -18621,7 +19329,8 @@

    teal.slice coverage - 65.92%

    157 - 9x + 9x +
            more_args <- if (length(parent_keys) == 0 || length(dataset_keys) == 0) {
    @@ -18635,14 +19344,16 @@

    teal.slice coverage - 65.92%

    159 - 9x + 9x +
            } else if (identical(parent_keys, dataset_keys)) {
    160 - 7x + 7x +
              list(by = parent_keys)
    @@ -18656,7 +19367,8 @@

    teal.slice coverage - 65.92%

    162 - 2x + 2x +
              list(by = stats::setNames(parent_keys, dataset_keys))
    @@ -18677,7 +19389,8 @@

    teal.slice coverage - 65.92%

    165 - 9x + 9x +
            merge_call <- call(
    @@ -18691,49 +19404,56 @@

    teal.slice coverage - 65.92%

    167 - 9x + 9x +
              as.name(dataname),
    168 - 9x + 9x +
              as.call(
    169 - 9x + 9x +
                c(
    170 - 9x + 9x +
                  str2lang("dplyr::inner_join"),
    171 - 9x + 9x +
                  x = as.name(dataname),
    172 - 9x + 9x +
                  y = str2lang(y_arg),
    173 - 9x + 9x +
                  more_args
    @@ -18768,7 +19488,8 @@

    teal.slice coverage - 65.92%

    178 - 9x + 9x +
            filter_call <- c(filter_call, merge_call)
    @@ -18782,14 +19503,16 @@

    teal.slice coverage - 65.92%

    180 - 42x + 42x +
          logger::log_trace("DataframeFilteredDataset$get_call initializing for dataname: { private$dataname }")
    181 - 42x + 42x +
          filter_call
    @@ -18859,35 +19582,40 @@

    teal.slice coverage - 65.92%

    191 - 81x + 81x +
          isolate({
    192 - 81x + 81x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initializing, dataname: { private$dataname }")
    193 - 81x + 81x +
            checkmate::assert_class(state, "teal_slices")
    194 - 80x + 80x +
            lapply(state, function(slice) {
    195 - 97x + 97x +
              checkmate::assert_true(slice$dataname == private$dataname)
    @@ -18901,14 +19629,16 @@

    teal.slice coverage - 65.92%

    197 - 80x + 80x +
            private$get_filter_states()[[1L]]$set_filter_state(state = state)
    198 - 80x + 80x +
            invisible(NULL)
    @@ -19006,7 +19736,8 @@

    teal.slice coverage - 65.92%

    212 - 11x + 11x +
          checkmate::assert_class(state, "teal_slices")
    @@ -19020,14 +19751,16 @@

    teal.slice coverage - 65.92%

    214 - 11x + 11x +
          isolate({
    215 - 11x + 11x +
            logger::log_trace("{ class(self)[1] }$remove_filter_state removing filter(s), dataname: { private$dataname }")
    @@ -19041,14 +19774,16 @@

    teal.slice coverage - 65.92%

    217 - 11x + 11x +
            varnames <- unique(unlist(lapply(state, "[[", "varname")))
    218 - 11x + 11x +
            private$get_filter_states()[[1]]$remove_filter_state(state)
    @@ -19062,7 +19797,8 @@

    teal.slice coverage - 65.92%

    220 - 11x + 11x +
            logger::log_trace("{ class(self)[1] }$remove_filter_state removed filter(s), dataname: { private$dataname }")
    @@ -19083,7 +19819,8 @@

    teal.slice coverage - 65.92%

    223 - 11x + 11x +
          invisible(NULL)
    @@ -19244,7 +19981,8 @@

    teal.slice coverage - 65.92%

    246 - 12x + 12x +
          logger::log_trace("FilteredDataset$srv_filter_overview initialized")
    @@ -19265,14 +20003,16 @@

    teal.slice coverage - 65.92%

    249 - 12x + 12x +
          subject_keys <- if (length(private$parent_name) > 0) {
    250 - 1x + 1x +
            names(private$join_keys)
    @@ -19286,7 +20026,8 @@

    teal.slice coverage - 65.92%

    252 - 11x + 11x +
            self$get_keys()
    @@ -19300,49 +20041,56 @@

    teal.slice coverage - 65.92%

    254 - 12x + 12x +
          dataset <- self$get_dataset()
    255 - 12x + 12x +
          data_filtered <- self$get_dataset(TRUE)
    256 - 12x + 12x +
          if (length(subject_keys) == 0) {
    257 - 10x + 10x +
            data.frame(
    258 - 10x + 10x +
              dataname = private$dataname,
    259 - 10x + 10x +
              obs = nrow(dataset),
    260 - 10x + 10x +
              obs_filtered = nrow(data_filtered())
    @@ -19363,42 +20111,48 @@

    teal.slice coverage - 65.92%

    263 - 2x + 2x +
            data.frame(
    264 - 2x + 2x +
              dataname = private$dataname,
    265 - 2x + 2x +
              obs = nrow(dataset),
    266 - 2x + 2x +
              obs_filtered = nrow(data_filtered()),
    267 - 2x + 2x +
              subjects = nrow(unique(dataset[subject_keys])),
    268 - 2x + 2x +
              subjects_filtered = nrow(unique(data_filtered()[subject_keys]))
    @@ -20566,21 +21320,24 @@

    teal.slice coverage - 65.92%

    155 - 25x + 25x +
          isolate({
    156 - 25x + 25x +
            checkmate::assert_multi_class(x, c("POSIXct", "POSIXlt"))
    157 - 24x + 24x +
            checkmate::assert_class(x_reactive, "reactive")
    @@ -20594,35 +21351,40 @@

    teal.slice coverage - 65.92%

    159 - 24x + 24x +
            super$initialize(
    160 - 24x + 24x +
              x = x,
    161 - 24x + 24x +
              x_reactive = x_reactive,
    162 - 24x + 24x +
              slice = slice,
    163 - 24x + 24x +
              extract_type = extract_type
    @@ -20636,28 +21398,32 @@

    teal.slice coverage - 65.92%

    165 - 24x + 24x +
            checkmate::assert_multi_class(slice$choices, c("POSIXct", "POSIXlt"), null.ok = TRUE)
    166 - 23x + 23x +
            private$set_choices(slice$choices)
    167 - 15x + 15x +
            if (is.null(slice$selected)) slice$selected <- slice$choices
    168 - 23x + 23x +
            private$set_selected(slice$selected)
    @@ -20678,7 +21444,8 @@

    teal.slice coverage - 65.92%

    171 - 22x + 22x +
          invisible(self)
    @@ -20755,14 +21522,16 @@

    teal.slice coverage - 65.92%

    182 - 7x + 7x +
          if (isFALSE(private$is_any_filtered())) {
    183 - 1x + 1x +
            return(NULL)
    @@ -20776,63 +21545,72 @@

    teal.slice coverage - 65.92%

    185 - 4x + 4x +
          if (missing(dataname)) dataname <- private$get_dataname()
    186 - 6x + 6x +
          varname <- private$get_varname_prefixed(dataname)
    187 - 6x + 6x +
          choices <- private$get_selected()
    188 - 6x + 6x +
          tzone <- Find(function(x) x != "", attr(as.POSIXlt(choices), "tzone"))
    189 - 6x + 6x +
          class <- class(choices)[1L]
    190 - 6x + 6x +
          date_fun <- as.name(
    191 - 6x + 6x +
            switch(class,
    192 - 6x + 6x +
              "POSIXct" = "as.POSIXct",
    193 - 6x + 6x +
              "POSIXlt" = "as.POSIXlt"
    @@ -20853,21 +21631,24 @@

    teal.slice coverage - 65.92%

    196 - 6x + 6x +
          choices <- as.character(choices + c(0, 1))
    197 - 6x + 6x +
          filter_call <-
    198 - 6x + 6x +
            call(
    @@ -20881,7 +21662,8 @@

    teal.slice coverage - 65.92%

    200 - 6x + 6x +
              call(
    @@ -20895,14 +21677,16 @@

    teal.slice coverage - 65.92%

    202 - 6x + 6x +
                varname,
    203 - 6x + 6x +
                as.call(list(date_fun, choices[1L], tz = tzone))
    @@ -20916,7 +21700,8 @@

    teal.slice coverage - 65.92%

    205 - 6x + 6x +
              call(
    @@ -20930,14 +21715,16 @@

    teal.slice coverage - 65.92%

    207 - 6x + 6x +
                varname,
    208 - 6x + 6x +
                as.call(list(date_fun, choices[2L], tz = tzone))
    @@ -20958,7 +21745,8 @@

    teal.slice coverage - 65.92%

    211 - 6x + 6x +
          private$add_keep_na_call(filter_call, varname)
    @@ -21021,14 +21809,16 @@

    teal.slice coverage - 65.92%

    220 - 23x + 23x +
          if (is.null(choices)) {
    221 - 20x + 20x +
            choices <- as.POSIXct(trunc(range(private$x, na.rm = TRUE), units = "secs"))
    @@ -21042,28 +21832,32 @@

    teal.slice coverage - 65.92%

    223 - 3x + 3x +
            choices <- as.POSIXct(choices, units = "secs")
    224 - 3x + 3x +
            choices_adjusted <- c(
    225 - 3x + 3x +
              max(choices[1L], min(as.POSIXct(private$x), na.rm = TRUE)),
    226 - 3x + 3x +
              min(choices[2L], max(as.POSIXct(private$x), na.rm = TRUE))
    @@ -21077,28 +21871,32 @@

    teal.slice coverage - 65.92%

    228 - 3x + 3x +
            if (any(choices != choices_adjusted)) {
    229 - 1x + 1x +
              warning(sprintf(
    230 - 1x + 1x +
                "Choices adjusted (some values outside of variable range). Varname: %s, dataname: %s.",
    231 - 1x + 1x +
                private$get_varname(), private$get_dataname()
    @@ -21112,7 +21910,8 @@

    teal.slice coverage - 65.92%

    233 - 1x + 1x +
              choices <- choices_adjusted
    @@ -21126,35 +21925,40 @@

    teal.slice coverage - 65.92%

    235 - 3x + 3x +
            if (choices[1L] >= choices[2L]) {
    236 - 1x + 1x +
              warning(sprintf(
    237 - 1x + 1x +
                "Invalid choices: lower is higher / equal to upper, or not in range of variable values.
    238 - 1x + 1x +
                Setting defaults. Varname: %s, dataname: %s.",
    239 - 1x + 1x +
                private$get_varname(), private$get_dataname()
    @@ -21168,7 +21972,8 @@

    teal.slice coverage - 65.92%

    241 - 1x + 1x +
              choices <- range(private$x, na.rm = TRUE)
    @@ -21196,14 +22001,16 @@

    teal.slice coverage - 65.92%

    245 - 23x + 23x +
          private$set_is_choice_limited(private$x, choices)
    246 - 23x + 23x +
          private$x <- private$x[
    @@ -21217,21 +22024,24 @@

    teal.slice coverage - 65.92%

    248 - 23x + 23x +
              as.POSIXct(trunc(private$x, units = "secs")) >= choices[1L] &
    249 - 23x + 23x +
                as.POSIXct(trunc(private$x, units = "secs")) <= choices[2L]
    250 - 23x + 23x +
            ) | is.na(private$x)
    @@ -21245,14 +22055,16 @@

    teal.slice coverage - 65.92%

    252 - 23x + 23x +
          private$teal_slice$choices <- choices
    253 - 23x + 23x +
          invisible(NULL)
    @@ -21294,14 +22106,16 @@

    teal.slice coverage - 65.92%

    259 - 23x + 23x +
          private$is_choice_limited <- (any(xl < choices[1L], na.rm = TRUE) | any(xl > choices[2L], na.rm = TRUE))
    260 - 23x + 23x +
          invisible(NULL)
    @@ -21322,21 +22136,24 @@

    teal.slice coverage - 65.92%

    263 - 34x + 34x +
          tryCatch(
    264 - 34x + 34x +
            expr = {
    265 - 34x + 34x +
              values <- as.POSIXct(values, origin = "1970-01-01 00:00:00")
    @@ -21350,7 +22167,8 @@

    teal.slice coverage - 65.92%

    267 - 31x + 31x +
              values
    @@ -21364,7 +22182,8 @@

    teal.slice coverage - 65.92%

    269 - 34x + 34x +
            error = function(e) stop("Vector of set values must contain values coercible to POSIX.")
    @@ -21392,42 +22211,48 @@

    teal.slice coverage - 65.92%

    273 - 1x + 1x +
          if (length(values) != 2) stop("Vector of set values must have length two.")
    274 - 30x + 30x +
          if (values[1] > values[2]) {
    275 - 1x + 1x +
            warning(
    276 - 1x + 1x +
              sprintf(
    277 - 1x + 1x +
                "Start date '%s' is set after the end date '%s', the values will be replaced by a default datetime range.",
    278 - 1x + 1x +
                values[1], values[2]
    @@ -21448,7 +22273,8 @@

    teal.slice coverage - 65.92%

    281 - 1x + 1x +
            values <- isolate(private$get_choices())
    @@ -21462,7 +22288,8 @@

    teal.slice coverage - 65.92%

    283 - 30x + 30x +
          values
    @@ -21483,42 +22310,48 @@

    teal.slice coverage - 65.92%

    286 - 30x + 30x +
          choices <- private$get_choices()
    287 - 30x + 30x +
          if (values[1] < choices[1L] || values[1] > choices[2L]) {
    288 - 5x + 5x +
            warning(
    289 - 5x + 5x +
              sprintf(
    290 - 5x + 5x +
                "Value: %s is outside of the range for the column '%s' in dataset '%s', setting minimum possible value.",
    291 - 5x + 5x +
                values[1], private$get_varname(), toString(private$get_dataname())
    @@ -21539,7 +22372,8 @@

    teal.slice coverage - 65.92%

    294 - 5x + 5x +
            values[1] <- choices[1L]
    @@ -21560,35 +22394,40 @@

    teal.slice coverage - 65.92%

    297 - 30x + 30x +
          if (values[2] > choices[2L] | values[2] < choices[1L]) {
    298 - 5x + 5x +
            warning(
    299 - 5x + 5x +
              sprintf(
    300 - 5x + 5x +
                "Value: '%s' is outside of the range for the column '%s' in dataset '%s', setting maximum possible value.",
    301 - 5x + 5x +
                values[2], private$get_varname(), toString(private$get_dataname())
    @@ -21609,7 +22448,8 @@

    teal.slice coverage - 65.92%

    304 - 5x + 5x +
            values[2] <- choices[2L]
    @@ -21630,7 +22470,8 @@

    teal.slice coverage - 65.92%

    307 - 30x + 30x +
          values
    @@ -23813,35 +24654,40 @@

    teal.slice coverage - 65.92%

    66 - 195x + 195x +
      checkmate::assert_class(x_reactive, "reactive")
    67 - 194x + 194x +
      checkmate::assert_character(extract_type, max.len = 1, any.missing = FALSE)
    68 - 194x + 194x +
      checkmate::assert_class(slice, "teal_slice")
    69 - 193x + 193x +
      if (length(extract_type) == 1) {
    70 - 43x + 43x +
        checkmate::assert_choice(extract_type, choices = c("list", "matrix"))
    @@ -23862,42 +24708,48 @@

    teal.slice coverage - 65.92%

    73 - 192x + 192x +
      if (all(is.na(x))) {
    74 - 1x + 1x +
        EmptyFilterState$new(
    75 - 1x + 1x +
          x = x,
    76 - 1x + 1x +
          x_reactive = x_reactive,
    77 - 1x + 1x +
          slice = slice,
    78 - 1x + 1x +
          extract_type = extract_type
    @@ -23918,7 +24770,8 @@

    teal.slice coverage - 65.92%

    81 - 191x + 191x +
        UseMethod("init_filter_state")
    @@ -23988,35 +24841,40 @@

    teal.slice coverage - 65.92%

    91 - 1x + 1x +
      args <- list(
    92 - 1x + 1x +
        x = x,
    93 - 1x + 1x +
        x_reactive = x_reactive,
    94 - 1x + 1x +
        extract_type = extract_type,
    95 - 1x + 1x +
        slice
    @@ -24037,7 +24895,8 @@

    teal.slice coverage - 65.92%

    98 - 1x + 1x +
      do.call(FilterState$new, args)
    @@ -24100,35 +24959,40 @@

    teal.slice coverage - 65.92%

    107 - 1x + 1x +
      LogicalFilterState$new(
    108 - 1x + 1x +
        x = x,
    109 - 1x + 1x +
        x_reactive = x_reactive,
    110 - 1x + 1x +
        slice = slice,
    111 - 1x + 1x +
        extract_type = extract_type
    @@ -24198,35 +25062,40 @@

    teal.slice coverage - 65.92%

    121 - 120x + 120x +
      args <- list(
    122 - 120x + 120x +
        x = x,
    123 - 120x + 120x +
        x_reactive = x_reactive,
    124 - 120x + 120x +
        slice = slice,
    125 - 120x + 120x +
        extract_type = extract_type
    @@ -24247,14 +25116,16 @@

    teal.slice coverage - 65.92%

    128 - 120x + 120x +
      if (length(unique(x[!is.na(x)])) < getOption("teal.threshold_slider_vs_checkboxgroup")) {
    129 - 28x + 28x +
        do.call(ChoicesFilterState$new, args)
    @@ -24268,7 +25139,8 @@

    teal.slice coverage - 65.92%

    131 - 92x + 92x +
        do.call(RangeFilterState$new, args)
    @@ -24338,35 +25210,40 @@

    teal.slice coverage - 65.92%

    141 - 31x + 31x +
      ChoicesFilterState$new(
    142 - 31x + 31x +
        x = x,
    143 - 31x + 31x +
        x_reactive = x_reactive,
    144 - 31x + 31x +
        slice = slice,
    145 - 31x + 31x +
        extract_type = extract_type
    @@ -24436,35 +25313,40 @@

    teal.slice coverage - 65.92%

    155 - 32x + 32x +
      ChoicesFilterState$new(
    156 - 32x + 32x +
        x = x,
    157 - 32x + 32x +
        x_reactive = x_reactive,
    158 - 32x + 32x +
        slice = slice,
    159 - 32x + 32x +
        extract_type = extract_type
    @@ -24534,35 +25416,40 @@

    teal.slice coverage - 65.92%

    169 - 2x + 2x +
      args <- list(
    170 - 2x + 2x +
        x = x,
    171 - 2x + 2x +
        x_reactive = x_reactive,
    172 - 2x + 2x +
        slice = slice,
    173 - 2x + 2x +
        extract_type = extract_type
    @@ -24583,14 +25470,16 @@

    teal.slice coverage - 65.92%

    176 - 2x + 2x +
      if (length(unique(x[!is.na(x)])) < getOption("teal.threshold_slider_vs_checkboxgroup")) {
    177 - 1x + 1x +
        do.call(ChoicesFilterState$new, args)
    @@ -24604,7 +25493,8 @@

    teal.slice coverage - 65.92%

    179 - 1x + 1x +
        do.call(DateFilterState$new, args)
    @@ -24674,35 +25564,40 @@

    teal.slice coverage - 65.92%

    189 - 2x + 2x +
      args <- list(
    190 - 2x + 2x +
        x = x,
    191 - 2x + 2x +
        x_reactive = x_reactive,
    192 - 2x + 2x +
        slice = slice,
    193 - 2x + 2x +
        extract_type = extract_type
    @@ -24723,14 +25618,16 @@

    teal.slice coverage - 65.92%

    196 - 2x + 2x +
      if (length(unique(x[!is.na(x)])) < getOption("teal.threshold_slider_vs_checkboxgroup")) {
    197 - 1x + 1x +
        do.call(ChoicesFilterState$new, args)
    @@ -24744,7 +25641,8 @@

    teal.slice coverage - 65.92%

    199 - 1x + 1x +
        do.call(DatetimeFilterState$new, args)
    @@ -24814,35 +25712,40 @@

    teal.slice coverage - 65.92%

    209 - 2x + 2x +
      args <- list(
    210 - 2x + 2x +
        x = x,
    211 - 2x + 2x +
        x_reactive = x_reactive,
    212 - 2x + 2x +
        slice = slice,
    213 - 2x + 2x +
        extract_type = extract_type
    @@ -24863,14 +25766,16 @@

    teal.slice coverage - 65.92%

    216 - 2x + 2x +
      if (length(unique(x[!is.na(x)])) < getOption("teal.threshold_slider_vs_checkboxgroup")) {
    217 - 1x + 1x +
        do.call(ChoicesFilterState$new, args)
    @@ -24884,7 +25789,8 @@

    teal.slice coverage - 65.92%

    219 - 1x + 1x +
        do.call(DatetimeFilterState$new, args)
    @@ -24975,7 +25881,8 @@

    teal.slice coverage - 65.92%

    232 - 6x + 6x +
      FilterStateExpr$new(slice)
    @@ -25143,28 +26050,32 @@

    teal.slice coverage - 65.92%

    256 - 119x + 119x +
      checkmate::assert_string(color)
    257 - 119x + 119x +
      checkmate::assert(
    258 - 119x + 119x +
        checkmate::check_number(alpha, lower = 0, upper = 1, null.ok = TRUE),
    259 - 119x + 119x +
        checkmate::check_string(alpha, pattern = "[0-9a-f]{2}", null.ok = TRUE)
    @@ -25192,7 +26103,8 @@

    teal.slice coverage - 65.92%

    263 - 119x + 119x +
      sass_file <- if (utils::packageVersion("bslib") < as.package_version("0.5.1.9000")) {
    @@ -25213,7 +26125,8 @@

    teal.slice coverage - 65.92%

    266 - 119x + 119x +
        bslib::bs_theme()[["layers"]][[2]][["defaults"]][[1]][[1]]
    @@ -25227,7 +26140,8 @@

    teal.slice coverage - 65.92%

    268 - 119x + 119x +
      sass_file <- attr(sass_file, "sass_file_path")
    @@ -25248,7 +26162,8 @@

    teal.slice coverage - 65.92%

    271 - 119x + 119x +
      variables_file <- readLines(sass_file)
    @@ -25262,14 +26177,16 @@

    teal.slice coverage - 65.92%

    273 - 119x + 119x +
      ind <- grep("// scss-docs-(start|end) theme-color-variables", variables_file)
    274 - 119x + 119x +
      color_definitions <- variables_file[(ind[1] + 1L):(ind[2] - 1L)]
    @@ -25290,7 +26207,8 @@

    teal.slice coverage - 65.92%

    277 - 119x + 119x +
      color_names <- sub("(\\$)(\\w.+)(:.+)", "\\2", color_definitions)
    @@ -25311,7 +26229,8 @@

    teal.slice coverage - 65.92%

    280 - 119x + 119x +
      checkmate::assert_choice(color, color_names)
    @@ -25332,7 +26251,8 @@

    teal.slice coverage - 65.92%

    283 - 119x + 119x +
      color_references <- sub("(\\$)(\\w.+)(:\\s.+\\$)(\\w.+)(\\s.+)", "\\4", color_definitions)
    @@ -25353,42 +26273,48 @@

    teal.slice coverage - 65.92%

    286 - 119x + 119x +
      color_specification <- structure(color_references, names = color_names)
    287 - 119x + 119x +
      color_specification <- vapply(color_specification, function(x) {
    288 - 952x + 952x +
        line <- grep(sprintf("^\\$%s:\\s+#\\w{6}\\s+!default", x), variables_file, value = TRUE)
    289 - 952x + 952x +
        code <- sub("(.+)(#\\w{6})(\\s+.+)", "\\2", line)
    290 - 952x + 952x +
        code
    291 - 119x + 119x +
      }, character(1L))
    @@ -25402,7 +26328,8 @@

    teal.slice coverage - 65.92%

    293 - 119x + 119x +
      if (!is.null(alpha)) {
    @@ -25430,7 +26357,8 @@

    teal.slice coverage - 65.92%

    297 - 119x + 119x +
      paste0(color_specification[color], alpha)
    @@ -26500,42 +27428,48 @@

    teal.slice coverage - 65.92%

    151 - 160x + 160x +
          isolate({
    152 - 160x + 160x +
            checkmate::assert(
    153 - 160x + 160x +
              is.character(x),
    154 - 160x + 160x +
              is.factor(x),
    155 - 160x + 160x +
              length(unique(x[!is.na(x)])) < getOption("teal.threshold_slider_vs_checkboxgroup"),
    156 - 160x + 160x +
              combine = "or"
    @@ -26549,35 +27483,40 @@

    teal.slice coverage - 65.92%

    158 - 160x + 160x +
            super$initialize(
    159 - 160x + 160x +
              x = x,
    160 - 160x + 160x +
              x_reactive = x_reactive,
    161 - 160x + 160x +
              slice = slice,
    162 - 160x + 160x +
              extract_type = extract_type
    @@ -26591,63 +27530,72 @@

    teal.slice coverage - 65.92%

    164 - 160x + 160x +
            private$set_choices(slice$choices)
    165 - 160x + 160x +
            if (is.null(slice$selected) && slice$multiple) {
    166 - 42x + 42x +
              slice$selected <- private$get_choices()
    167 - 118x + 118x +
            } else if (is.null(slice$selected)) {
    168 - 1x + 1x +
              slice$selected <- private$get_choices()[1]
    169 - 117x + 117x +
            } else if (length(slice$selected) > 1 && !slice$multiple) {
    170 - 1x + 1x +
              warning(
    171 - 1x + 1x +
                "ChoicesFilterState allows \"selected\" to be of length 1 when \"multiple\" is FALSE. ",
    172 - 1x + 1x +
                "Only the first value will be used."
    @@ -26661,7 +27609,8 @@

    teal.slice coverage - 65.92%

    174 - 1x + 1x +
              slice$selected <- slice$selected[1]
    @@ -26675,21 +27624,24 @@

    teal.slice coverage - 65.92%

    176 - 160x + 160x +
            private$set_selected(slice$selected)
    177 - 160x + 160x +
            if (inherits(x, "POSIXt")) {
    178 - 9x + 9x +
              private$tzone <- Find(function(x) x != "", attr(as.POSIXlt(x), "tzone"))
    @@ -26710,7 +27662,8 @@

    teal.slice coverage - 65.92%

    181 - 160x + 160x +
          invisible(self)
    @@ -26787,14 +27740,16 @@

    teal.slice coverage - 65.92%

    192 - 61x + 61x +
          if (isFALSE(private$is_any_filtered())) {
    193 - 7x + 7x +
            return(NULL)
    @@ -26808,49 +27763,56 @@

    teal.slice coverage - 65.92%

    195 - 30x + 30x +
          if (missing(dataname)) dataname <- private$get_dataname()
    196 - 54x + 54x +
          varname <- private$get_varname_prefixed(dataname)
    197 - 54x + 54x +
          choices <- private$get_choices()
    198 - 54x + 54x +
          selected <- private$get_selected()
    199 - 54x + 54x +
          fun_compare <- if (length(selected) == 1L) "==" else "%in%"
    200 - 54x + 54x +
          filter_call <- if (length(selected) == 0) {
    201 - 6x + 6x +
            call("!", call(fun_compare, varname, make_c_call(as.character(choices))))
    @@ -26864,70 +27826,80 @@

    teal.slice coverage - 65.92%

    203 - 48x + 48x +
            if (setequal(selected, choices) && !private$is_choice_limited) {
    204 - 2x + 2x +
              NULL
    205 - 46x + 46x +
            } else if (inherits(private$x, "Date")) {
    206 - 1x + 1x +
              call(fun_compare, varname, call("as.Date", make_c_call(as.character(selected))))
    207 - 45x + 45x +
            } else if (inherits(private$x, c("POSIXct", "POSIXlt"))) {
    208 - 2x + 2x +
              class <- class(private$x)[1L]
    209 - 2x + 2x +
              date_fun <- as.name(
    210 - 2x + 2x +
                switch(class,
    211 - 2x + 2x +
                  "POSIXct" = "as.POSIXct",
    212 - 2x + 2x +
                  "POSIXlt" = "as.POSIXlt"
    @@ -26948,28 +27920,32 @@

    teal.slice coverage - 65.92%

    215 - 2x + 2x +
              call(
    216 - 2x + 2x +
                fun_compare,
    217 - 2x + 2x +
                varname,
    218 - 2x + 2x +
                as.call(list(date_fun, make_c_call(as.character(selected)), tz = private$tzone))
    @@ -26983,14 +27959,16 @@

    teal.slice coverage - 65.92%

    220 - 43x + 43x +
            } else if (is.numeric(private$x)) {
    221 - 7x + 7x +
              call(fun_compare, varname, make_c_call(as.numeric(selected)))
    @@ -27011,7 +27989,8 @@

    teal.slice coverage - 65.92%

    224 - 36x + 36x +
              call(fun_compare, varname, make_c_call(selected))
    @@ -27032,7 +28011,8 @@

    teal.slice coverage - 65.92%

    227 - 54x + 54x +
          private$add_keep_na_call(filter_call, varname)
    @@ -27144,28 +28124,32 @@

    teal.slice coverage - 65.92%

    243 - 160x + 160x +
          ordered_counts <- .table(private$x)
    244 - 160x + 160x +
          possible_choices <- names(ordered_counts)
    245 - 160x + 160x +
          if (is.null(choices)) {
    246 - 145x + 145x +
            choices <- possible_choices
    @@ -27179,49 +28163,56 @@

    teal.slice coverage - 65.92%

    248 - 15x + 15x +
            choices <- as.character(choices)
    249 - 15x + 15x +
            choices_adjusted <- choices[choices %in% possible_choices]
    250 - 15x + 15x +
            if (length(setdiff(choices, choices_adjusted)) > 0L) {
    251 - 2x + 2x +
              warning(
    252 - 2x + 2x +
                sprintf(
    253 - 2x + 2x +
                  "Some choices not found in data. Adjusting. Filter id: %s.",
    254 - 2x + 2x +
                  private$get_id()
    @@ -27242,7 +28233,8 @@

    teal.slice coverage - 65.92%

    257 - 2x + 2x +
              choices <- choices_adjusted
    @@ -27256,35 +28248,40 @@

    teal.slice coverage - 65.92%

    259 - 15x + 15x +
            if (length(choices) == 0) {
    260 - 1x + 1x +
              warning(
    261 - 1x + 1x +
                sprintf(
    262 - 1x + 1x +
                  "None of the choices were found in data. Setting defaults. Filter id: %s.",
    263 - 1x + 1x +
                  private$get_id()
    @@ -27305,7 +28302,8 @@

    teal.slice coverage - 65.92%

    266 - 1x + 1x +
              choices <- possible_choices
    @@ -27326,28 +28324,32 @@

    teal.slice coverage - 65.92%

    269 - 160x + 160x +
          private$set_choices_counts(unname(ordered_counts[choices]))
    270 - 160x + 160x +
          private$set_is_choice_limited(possible_choices, choices)
    271 - 160x + 160x +
          private$teal_slice$choices <- choices
    272 - 160x + 160x +
          invisible(NULL)
    @@ -27382,21 +28384,24 @@

    teal.slice coverage - 65.92%

    277 - 160x + 160x +
          xl <- x[!is.na(x)]
    278 - 160x + 160x +
          private$is_choice_limited <- length(setdiff(xl, choices)) > 0L
    279 - 160x + 160x +
          invisible(NULL)
    @@ -27431,14 +28436,16 @@

    teal.slice coverage - 65.92%

    284 - 160x + 160x +
          private$choices_counts <- choices_counts
    285 - 160x + 160x +
          invisible(NULL)
    @@ -27473,7 +28480,8 @@

    teal.slice coverage - 65.92%

    290 - 23x + 23x +
          length(private$get_choices()) <= getOption("teal.threshold_slider_vs_checkboxgroup")
    @@ -27494,21 +28502,24 @@

    teal.slice coverage - 65.92%

    293 - 189x + 189x +
          tryCatch(
    294 - 189x + 189x +
            expr = {
    295 - 189x + 189x +
              values <- as.character(values)
    @@ -27529,7 +28540,8 @@

    teal.slice coverage - 65.92%

    298 - 189x + 189x +
            error = function(e) stop("The vector of set values must contain values coercible to character.")
    @@ -27543,7 +28555,8 @@

    teal.slice coverage - 65.92%

    300 - 189x + 189x +
          values
    @@ -27571,28 +28584,32 @@

    teal.slice coverage - 65.92%

    304 - 189x + 189x +
          if (!private$is_multiple() && length(values) > 1) {
    305 - 1x + 1x +
            warning(
    306 - 1x + 1x +
              sprintf("Selection: %s is not a vector of length one. ", toString(values, width = 360)),
    307 - 1x + 1x +
              "Maintaining previous selection."
    @@ -27606,7 +28623,8 @@

    teal.slice coverage - 65.92%

    309 - 1x + 1x +
            values <- isolate(private$get_selected())
    @@ -27620,7 +28638,8 @@

    teal.slice coverage - 65.92%

    311 - 189x + 189x +
          values
    @@ -27641,35 +28660,40 @@

    teal.slice coverage - 65.92%

    314 - 189x + 189x +
          in_choices_mask <- values %in% private$get_choices()
    315 - 189x + 189x +
          if (length(values[!in_choices_mask]) > 0) {
    316 - 17x + 17x +
            warning(paste(
    317 - 17x + 17x +
              "Values:", toString(values[!in_choices_mask], width = 360),
    318 - 17x + 17x +
              "are not in choices of column", private$get_varname(), "in dataset", private$get_dataname(), "."
    @@ -27690,7 +28714,8 @@

    teal.slice coverage - 65.92%

    321 - 189x + 189x +
          values[in_choices_mask]
    @@ -27767,7 +28792,8 @@

    teal.slice coverage - 65.92%

    332 - 7x + 7x +
          ns <- NS(id)
    @@ -27788,21 +28814,24 @@

    teal.slice coverage - 65.92%

    335 - 7x + 7x +
          isolate({
    336 - 7x + 7x +
            countsmax <- private$choices_counts
    337 - 7x + 7x +
            countsnow <- if (!is.null(private$x_reactive())) {
    @@ -27844,42 +28873,48 @@

    teal.slice coverage - 65.92%

    343 - 7x + 7x +
            ui_input <- if (private$is_checkboxgroup()) {
    344 - 7x + 7x +
              labels <- countBars(
    345 - 7x + 7x +
                inputId = ns("labels"),
    346 - 7x + 7x +
                choices = private$get_choices(),
    347 - 7x + 7x +
                countsnow = countsnow,
    348 - 7x + 7x +
                countsmax = countsmax
    @@ -27893,70 +28928,80 @@

    teal.slice coverage - 65.92%

    350 - 6x + 6x +
              tags$div(
    351 - 6x + 6x +
                class = "choices_state",
    352 - 6x + 6x +
                if (private$is_multiple()) {
    353 - 6x + 6x +
                  checkboxGroupInput(
    354 - 6x + 6x +
                    inputId = ns("selection"),
    355 - 6x + 6x +
                    label = NULL,
    356 - 6x + 6x +
                    selected = private$get_selected(),
    357 - 6x + 6x +
                    choiceNames = labels,
    358 - 6x + 6x +
                    choiceValues = private$get_choices(),
    359 - 6x + 6x +
                    width = "100%"
    @@ -28187,28 +29232,32 @@

    teal.slice coverage - 65.92%

    392 - 6x + 6x +
            tags$div(
    393 - 6x + 6x +
              uiOutput(ns("trigger_visible")),
    394 - 6x + 6x +
              ui_input,
    395 - 6x + 6x +
              private$keep_na_ui(ns("keep_na"))
    @@ -28278,28 +29327,32 @@

    teal.slice coverage - 65.92%

    405 - 7x + 7x +
          moduleServer(
    406 - 7x + 7x +
            id = id,
    407 - 7x + 7x +
            function(input, output, session) {
    408 - 7x + 7x +
              logger::log_trace("ChoicesFilterState$server_inputs initializing, id: { private$get_id() }")
    @@ -28334,21 +29387,24 @@

    teal.slice coverage - 65.92%

    413 - 7x + 7x +
              non_missing_values <- reactive(Filter(Negate(is.na), private$x_reactive()))
    414 - 7x + 7x +
              output$trigger_visible <- renderUI({
    415 - 7x + 7x +
                logger::log_trace("ChoicesFilterState$server_inputs@1 updating count labels, id: { private$get_id() }")
    @@ -28362,7 +29418,8 @@

    teal.slice coverage - 65.92%

    417 - 7x + 7x +
                countsnow <- if (!is.null(private$x_reactive())) {
    @@ -28411,49 +29468,56 @@

    teal.slice coverage - 65.92%

    424 - 7x + 7x +
                isolate({
    425 - 7x + 7x +
                  if (private$is_checkboxgroup()) {
    426 - 7x + 7x +
                    updateCountBars(
    427 - 7x + 7x +
                      inputId = "labels",
    428 - 7x + 7x +
                      choices = private$get_choices(),
    429 - 7x + 7x +
                      countsmax = private$choices_counts,
    430 - 7x + 7x +
                      countsnow = countsnow
    @@ -28565,7 +29629,8 @@

    teal.slice coverage - 65.92%

    446 - 6x + 6x +
                  NULL
    @@ -28593,42 +29658,48 @@

    teal.slice coverage - 65.92%

    450 - 7x + 7x +
              if (private$is_checkboxgroup()) {
    451 - 7x + 7x +
                private$observers$selection <- observeEvent(
    452 - 7x + 7x +
                  ignoreNULL = FALSE,
    453 - 7x + 7x +
                  ignoreInit = TRUE, # ignoreInit: should not matter because we set the UI with the desired initial state
    454 - 7x + 7x +
                  eventExpr = input$selection,
    455 - 7x + 7x +
                  handlerExpr = {
    @@ -28950,7 +30021,8 @@

    teal.slice coverage - 65.92%

    501 - 7x + 7x +
              private$keep_na_srv("keep_na")
    @@ -28985,7 +30057,8 @@

    teal.slice coverage - 65.92%

    506 - 7x + 7x +
              private$observers$selection_api <- observeEvent(private$get_selected(), {
    @@ -29006,49 +30079,56 @@

    teal.slice coverage - 65.92%

    509 - 2x + 2x +
                if (!setequal(input$selection, private$get_selected())) {
    510 - 2x + 2x +
                  logger::log_trace("ChoicesFilterState$server@1 state changed, id: { private$get_id() }")
    511 - 2x + 2x +
                  if (private$is_checkboxgroup()) {
    512 - 2x + 2x +
                    if (private$is_multiple()) {
    513 - 2x + 2x +
                      updateCheckboxGroupInput(
    514 - 2x + 2x +
                        inputId = "selection",
    515 - 2x + 2x +
                        selected = private$get_selected()
    @@ -29167,14 +30247,16 @@

    teal.slice coverage - 65.92%

    532 - 7x + 7x +
              logger::log_trace("ChoicesFilterState$server_inputs initialized, id: { private$get_id() }")
    533 - 7x + 7x +
              NULL
    @@ -29440,21 +30522,24 @@

    teal.slice coverage - 65.92%

    571 - 7x + 7x +
          selected <- private$get_selected()
    572 - 7x + 7x +
          selected_text <-
    573 - 7x + 7x +
            if (length(selected) == 0L) {
    @@ -29475,14 +30560,16 @@

    teal.slice coverage - 65.92%

    576 - 7x + 7x +
              if (sum(nchar(selected)) <= 40L) {
    577 - 7x + 7x +
                paste(selected, collapse = ", ")
    @@ -29517,28 +30604,32 @@

    teal.slice coverage - 65.92%

    582 - 7x + 7x +
          tagList(
    583 - 7x + 7x +
            tags$span(
    584 - 7x + 7x +
              class = "filter-card-summary-value",
    585 - 7x + 7x +
              selected_text
    @@ -29552,21 +30643,24 @@

    teal.slice coverage - 65.92%

    587 - 7x + 7x +
            tags$span(
    588 - 7x + 7x +
              class = "filter-card-summary-controls",
    589 - 7x + 7x +
              if (private$na_count > 0) {
    @@ -29678,21 +30772,24 @@

    teal.slice coverage - 65.92%

    605 - 160x + 160x +
      table(
    606 - 160x + 160x +
        if (is.factor(x)) {
    607 - 36x + 36x +
          x
    @@ -29706,7 +30803,8 @@

    teal.slice coverage - 65.92%

    609 - 124x + 124x +
          as.character(x)
    @@ -30104,28 +31202,32 @@

    teal.slice coverage - 65.92%

    53 - 274x + 274x +
          checkmate::assert_string(dataname)
    54 - 272x + 272x +
          logger::log_trace("Instantiating { class(self)[1] }, dataname: { dataname }")
    55 - 272x + 272x +
          checkmate::assert_function(data_reactive, args = "sid")
    56 - 272x + 272x +
          checkmate::assert_string(datalabel, null.ok = TRUE)
    @@ -30139,42 +31241,48 @@

    teal.slice coverage - 65.92%

    58 - 272x + 272x +
          private$dataname <- dataname
    59 - 272x + 272x +
          private$datalabel <- datalabel
    60 - 272x + 272x +
          private$dataname_prefixed <- dataname
    61 - 272x + 272x +
          private$data <- data
    62 - 272x + 272x +
          private$data_reactive <- data_reactive
    63 - 272x + 272x +
          private$state_list <- reactiveVal()
    @@ -30188,14 +31296,16 @@

    teal.slice coverage - 65.92%

    65 - 272x + 272x +
          logger::log_trace("Instantiated { class(self)[1] }, dataname: { private$dataname }")
    66 - 272x + 272x +
          invisible(self)
    @@ -30622,7 +31732,8 @@

    teal.slice coverage - 65.92%

    127 - 88x + 88x +
          logger::log_trace("FilterStates$get_call initializing")
    @@ -30657,21 +31768,24 @@

    teal.slice coverage - 65.92%

    132 - 88x + 88x +
          states_list <- private$state_list_get()
    133 - 88x + 88x +
          if (length(states_list) == 0) {
    134 - 52x + 52x +
            return(NULL)
    @@ -30685,35 +31799,40 @@

    teal.slice coverage - 65.92%

    136 - 36x + 36x +
          args <- vapply(
    137 - 36x + 36x +
            states_list,
    138 - 36x + 36x +
            function(x) {
    139 - 57x + 57x +
              arg <- x$get_state()$arg
    140 - 7x + 7x +
              `if`(is.null(arg), "", arg) # converting NULL -> "" to enable tapply.
    @@ -30727,7 +31846,8 @@

    teal.slice coverage - 65.92%

    142 - 36x + 36x +
            character(1)
    @@ -30748,35 +31868,40 @@

    teal.slice coverage - 65.92%

    145 - 36x + 36x +
          filter_items <- tapply(
    146 - 36x + 36x +
            X = states_list,
    147 - 36x + 36x +
            INDEX = args,
    148 - 36x + 36x +
            simplify = FALSE,
    149 - 36x + 36x +
            function(items) {
    @@ -30790,14 +31915,16 @@

    teal.slice coverage - 65.92%

    151 - 38x + 38x +
              other_filter_idx <- !names(items) %in% sid
    152 - 38x + 38x +
              filtered_items <- items[other_filter_idx]
    @@ -30811,42 +31938,48 @@

    teal.slice coverage - 65.92%

    154 - 38x + 38x +
              calls <- Filter(
    155 - 38x + 38x +
                Negate(is.null),
    156 - 38x + 38x +
                lapply(
    157 - 38x + 38x +
                  filtered_items,
    158 - 38x + 38x +
                  function(state) {
    159 - 51x + 51x +
                    state$get_call(dataname = private$dataname_prefixed)
    @@ -30874,7 +32007,8 @@

    teal.slice coverage - 65.92%

    163 - 38x + 38x +
              calls_combine_by(calls, operator = "&")
    @@ -30895,21 +32029,24 @@

    teal.slice coverage - 65.92%

    166 - 36x + 36x +
          filter_items <- Filter(
    167 - 36x + 36x +
            x = filter_items,
    168 - 36x + 36x +
            f = Negate(is.null)
    @@ -30923,49 +32060,56 @@

    teal.slice coverage - 65.92%

    170 - 36x + 36x +
          if (length(filter_items) > 0L) {
    171 - 35x + 35x +
            filter_function <- private$fun
    172 - 35x + 35x +
            data_name <- str2lang(private$dataname_prefixed)
    173 - 35x + 35x +
            substitute(
    174 - 35x + 35x +
              env = list(
    175 - 35x + 35x +
                lhs = data_name,
    176 - 35x + 35x +
                rhs = as.call(c(filter_function, c(list(data_name), filter_items)))
    @@ -30979,7 +32123,8 @@

    teal.slice coverage - 65.92%

    178 - 35x + 35x +
              expr = lhs <- rhs
    @@ -31007,7 +32152,8 @@

    teal.slice coverage - 65.92%

    182 - 1x + 1x +
            NULL
    @@ -31161,35 +32307,40 @@

    teal.slice coverage - 65.92%

    204 - 17x + 17x +
          checkmate::assert_class(state, "teal_slices")
    205 - 17x + 17x +
          isolate({
    206 - 17x + 17x +
            state_ids <- vapply(state, `[[`, character(1), "id")
    207 - 17x + 17x +
            logger::log_trace("{ class(self)[1] }$remove_filter_state removing filters, state_id: { toString(state_ids) }")
    208 - 17x + 17x +
            private$state_list_remove(state_ids)
    @@ -31203,7 +32354,8 @@

    teal.slice coverage - 65.92%

    210 - 17x + 17x +
          invisible(NULL)
    @@ -31287,14 +32439,16 @@

    teal.slice coverage - 65.92%

    222 - 364x + 364x +
          slices <- unname(lapply(private$state_list(), function(x) x$get_state()))
    223 - 364x + 364x +
          fs <- do.call(teal_slices, c(slices, list(count_type = private$count_type)))
    @@ -31308,35 +32462,40 @@

    teal.slice coverage - 65.92%

    225 - 364x + 364x +
          include_varnames <- private$include_varnames
    226 - 364x + 364x +
          if (length(include_varnames)) {
    227 - 214x + 214x +
            attr(fs, "include_varnames") <- structure(
    228 - 214x + 214x +
              list(include_varnames),
    229 - 214x + 214x +
              names = private$dataname
    @@ -31364,35 +32523,40 @@

    teal.slice coverage - 65.92%

    233 - 364x + 364x +
          exclude_varnames <- private$exclude_varnames
    234 - 364x + 364x +
          if (length(exclude_varnames)) {
    235 - 9x + 9x +
            attr(fs, "exclude_varnames") <- structure(
    236 - 9x + 9x +
              list(exclude_varnames),
    237 - 9x + 9x +
              names = private$dataname
    @@ -31420,7 +32584,8 @@

    teal.slice coverage - 65.92%

    241 - 364x + 364x +
          fs
    @@ -31476,49 +32641,56 @@

    teal.slice coverage - 65.92%

    249 - 135x + 135x +
          isolate({
    250 - 135x + 135x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initializing, dataname: { private$dataname }")
    251 - 135x + 135x +
            checkmate::assert_class(state, "teal_slices")
    252 - 135x + 135x +
            lapply(state, function(x) {
    253 - 177x + 177x +
              checkmate::assert_true(
    254 - 177x + 177x +
                x$dataname == private$dataname,
    255 - 177x + 177x +
                .var.name = "dataname matches private$dataname"
    @@ -31546,21 +32718,24 @@

    teal.slice coverage - 65.92%

    259 - 135x + 135x +
            private$set_filterable_varnames(
    260 - 135x + 135x +
              include_varnames = attr(state, "include_varnames")[[private$dataname]],
    261 - 135x + 135x +
              exclude_varnames = attr(state, "exclude_varnames")[[private$dataname]]
    @@ -31574,21 +32749,24 @@

    teal.slice coverage - 65.92%

    263 - 135x + 135x +
            count_type <- attr(state, "count_type")
    264 - 135x + 135x +
            if (length(count_type)) {
    265 - 21x + 21x +
              private$count_type <- count_type
    @@ -31616,35 +32794,40 @@

    teal.slice coverage - 65.92%

    269 - 135x + 135x +
            varnames <- unique(unlist(lapply(state, "[[", "varname")))
    270 - 135x + 135x +
            excluded_varnames <- setdiff(varnames, private$get_filterable_varnames())
    271 - 135x + 135x +
            if (length(excluded_varnames)) {
    272 - 3x + 3x +
              state <- Filter(function(x) !isTRUE(x$varname %in% excluded_varnames), state)
    273 - 3x + 3x +
              warning(sprintf("filters for columns: %s excluded from %s", toString(excluded_varnames), private$dataname))
    @@ -31665,35 +32848,40 @@

    teal.slice coverage - 65.92%

    276 - 135x + 135x +
            if (length(state) > 0) {
    277 - 93x + 93x +
              private$set_filter_state_impl(
    278 - 93x + 93x +
                state = state,
    279 - 93x + 93x +
                data = private$data,
    280 - 93x + 93x +
                data_reactive = private$data_reactive
    @@ -31714,7 +32902,8 @@

    teal.slice coverage - 65.92%

    283 - 135x + 135x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initialized, dataname: { private$dataname }")
    @@ -31735,7 +32924,8 @@

    teal.slice coverage - 65.92%

    286 - 135x + 135x +
          invisible(NULL)
    @@ -31819,14 +33009,16 @@

    teal.slice coverage - 65.92%

    298 - 25x + 25x +
          private$state_list_empty(force)
    299 - 25x + 25x +
          invisible(NULL)
    @@ -32078,49 +33270,56 @@

    teal.slice coverage - 65.92%

    335 - 12x + 12x +
          moduleServer(
    336 - 12x + 12x +
            id = id,
    337 - 12x + 12x +
            function(input, output, session) {
    338 - 12x + 12x +
              logger::log_trace("FilterState$srv_active initializing, dataname: { private$dataname }")
    339 - 12x + 12x +
              current_state <- reactive(private$state_list_get())
    340 - 12x + 12x +
              previous_state <- reactiveVal(NULL) # FilterState list
    341 - 12x + 12x +
              added_states <- reactiveVal(NULL) # FilterState list
    @@ -32141,21 +33340,24 @@

    teal.slice coverage - 65.92%

    344 - 12x + 12x +
              fs_to_shiny_ns <- function(x) {
    345 - 24x + 24x +
                checkmate::assert_multi_class(x, c("FilterState", "FilterStateExpr"))
    346 - 24x + 24x +
                gsub("[^[:alnum:]]+", "_", get_default_slice_id(x$get_state()))
    @@ -32176,28 +33378,32 @@

    teal.slice coverage - 65.92%

    349 - 12x + 12x +
              output$trigger_visible_state_change <- renderUI({
    350 - 14x + 14x +
                current_state()
    351 - 14x + 14x +
                isolate({
    352 - 14x + 14x +
                  logger::log_trace("FilterStates$srv_active@1 determining added and removed filter states")
    @@ -32211,21 +33417,24 @@

    teal.slice coverage - 65.92%

    354 - 14x + 14x +
                  added_states(setdiff_teal_slices(current_state(), previous_state()))
    355 - 14x + 14x +
                  previous_state(current_state())
    356 - 14x + 14x +
                  NULL
    @@ -32253,42 +33462,48 @@

    teal.slice coverage - 65.92%

    360 - 12x + 12x +
              output[["cards"]] <- renderUI({
    361 - 14x + 14x +
                lapply(
    362 - 14x + 14x +
                  current_state(), # observes only if added/removed
    363 - 14x + 14x +
                  function(state) {
    364 - 12x + 12x +
                    isolate( # isolates when existing state changes
    365 - 12x + 12x +
                      state$ui(id = session$ns(fs_to_shiny_ns(state)), parent_id = session$ns("cards"))
    @@ -32330,21 +33545,24 @@

    teal.slice coverage - 65.92%

    371 - 12x + 12x +
              observeEvent(
    372 - 12x + 12x +
                added_states(), # we want to call FilterState module only once when it's added
    373 - 12x + 12x +
                ignoreNULL = TRUE,
    @@ -32358,63 +33576,72 @@

    teal.slice coverage - 65.92%

    375 - 10x + 10x +
                  added_state_names <- vapply(added_states(), function(x) x$get_state()$id, character(1L))
    376 - 10x + 10x +
                  logger::log_trace("FilterStates$srv_active@2 triggered by added states: { toString(added_state_names) }")
    377 - 10x + 10x +
                  lapply(added_states(), function(state) {
    378 - 12x + 12x +
                    fs_callback <- state$server(id = fs_to_shiny_ns(state))
    379 - 12x + 12x +
                    observeEvent(
    380 - 12x + 12x +
                      once = TRUE, # remove button can be called once, should be destroyed afterwards
    381 - 12x + 12x +
                      ignoreInit = TRUE, # ignoreInit: should not matter because we destroy the previous input set of the UI
    382 - 12x + 12x +
                      eventExpr = fs_callback(), # when remove button is clicked in the FilterState ui
    383 - 12x + 12x +
                      handlerExpr = private$state_list_remove(state$get_state()$id)
    @@ -32435,7 +33662,8 @@

    teal.slice coverage - 65.92%

    386 - 10x + 10x +
                  added_states(NULL)
    @@ -32463,7 +33691,8 @@

    teal.slice coverage - 65.92%

    390 - 12x + 12x +
              NULL
    @@ -32561,14 +33790,16 @@

    teal.slice coverage - 65.92%

    404 - 1x + 1x +
          checkmate::assert_string(id)
    405 - 1x + 1x +
          data <- private$data
    @@ -32582,7 +33813,8 @@

    teal.slice coverage - 65.92%

    407 - 1x + 1x +
          ns <- NS(id)
    @@ -32596,14 +33828,16 @@

    teal.slice coverage - 65.92%

    409 - 1x + 1x +
          if (ncol(data) == 0) {
    410 - 1x + 1x +
            tags$div("no sample variables available")
    @@ -32743,28 +33977,32 @@

    teal.slice coverage - 65.92%

    430 - 8x + 8x +
          moduleServer(
    431 - 8x + 8x +
            id = id,
    432 - 8x + 8x +
            function(input, output, session) {
    433 - 8x + 8x +
              logger::log_trace("FilterStates$srv_add initializing, dataname: { private$dataname }")
    @@ -32785,42 +34023,48 @@

    teal.slice coverage - 65.92%

    436 - 8x + 8x +
              avail_column_choices <- reactive({
    437 - 9x + 9x +
                data <- private$data
    438 - 9x + 9x +
                vars_include <- private$get_filterable_varnames()
    439 - 9x + 9x +
                active_filter_vars <- unique(unlist(lapply(self$get_filter_state(), "[[", "varname")))
    440 - 9x + 9x +
                choices <- setdiff(vars_include, active_filter_vars)
    441 - 9x + 9x +
                varlabels <- get_varlabels(data)
    @@ -32834,35 +34078,40 @@

    teal.slice coverage - 65.92%

    443 - 9x + 9x +
                data_choices_labeled(
    444 - 9x + 9x +
                  data = data,
    445 - 9x + 9x +
                  choices = choices,
    446 - 9x + 9x +
                  varlabels = varlabels,
    447 - 9x + 9x +
                  keys = private$keys
    @@ -32897,21 +34146,24 @@

    teal.slice coverage - 65.92%

    452 - 8x + 8x +
              output$add_filter <- renderUI({
    453 - 6x + 6x +
                logger::log_trace(
    454 - 6x + 6x +
                  "FilterStates$srv_add@1 updating available column choices, dataname: { private$dataname }"
    @@ -32925,7 +34177,8 @@

    teal.slice coverage - 65.92%

    456 - 6x + 6x +
                if (length(avail_column_choices()) == 0) {
    @@ -32946,56 +34199,64 @@

    teal.slice coverage - 65.92%

    459 - 6x + 6x +
                  tags$div(
    460 - 6x + 6x +
                    teal.widgets::optionalSelectInput(
    461 - 6x + 6x +
                      session$ns("var_to_add"),
    462 - 6x + 6x +
                      choices = avail_column_choices(),
    463 - 6x + 6x +
                      selected = NULL,
    464 - 6x + 6x +
                      options = shinyWidgets::pickerOptions(
    465 - 6x + 6x +
                        liveSearch = TRUE,
    466 - 6x + 6x +
                        noneSelectedText = "Select variable to filter"
    @@ -33044,56 +34305,64 @@

    teal.slice coverage - 65.92%

    473 - 8x + 8x +
              observeEvent(
    474 - 8x + 8x +
                eventExpr = input$var_to_add,
    475 - 8x + 8x +
                handlerExpr = {
    476 - 3x + 3x +
                  logger::log_trace(
    477 - 3x + 3x +
                    sprintf(
    478 - 3x + 3x +
                      "FilterStates$srv_add@2 adding FilterState of variable %s, dataname: %s",
    479 - 3x + 3x +
                      input$var_to_add,
    480 - 3x + 3x +
                      private$dataname
    @@ -33114,21 +34383,24 @@

    teal.slice coverage - 65.92%

    483 - 3x + 3x +
                  self$set_filter_state(
    484 - 3x + 3x +
                    teal_slices(
    485 - 3x + 3x +
                      teal_slice(dataname = private$dataname, varname = input$var_to_add)
    @@ -33149,35 +34421,40 @@

    teal.slice coverage - 65.92%

    488 - 3x + 3x +
                  logger::log_trace(
    489 - 3x + 3x +
                    sprintf(
    490 - 3x + 3x +
                      "FilterStates$srv_add@2 added FilterState of variable %s, dataname: %s",
    491 - 3x + 3x +
                      input$var_to_add,
    492 - 3x + 3x +
                      private$dataname
    @@ -33219,14 +34496,16 @@

    teal.slice coverage - 65.92%

    498 - 8x + 8x +
              logger::log_trace("FilterStates$srv_add initialized, dataname: { private$dataname }")
    499 - 8x + 8x +
              NULL
    @@ -33485,14 +34764,16 @@

    teal.slice coverage - 65.92%

    536 - 288x + 288x +
          if ((length(include_varnames) + length(exclude_varnames)) == 0L) {
    537 - 113x + 113x +
            return(invisible(NULL))
    @@ -33506,21 +34787,24 @@

    teal.slice coverage - 65.92%

    539 - 175x + 175x +
          checkmate::assert_character(include_varnames, any.missing = FALSE, min.len = 0L, null.ok = TRUE)
    540 - 175x + 175x +
          checkmate::assert_character(exclude_varnames, any.missing = FALSE, min.len = 0L, null.ok = TRUE)
    541 - 175x + 175x +
          if (length(include_varnames) && length(exclude_varnames)) {
    @@ -33569,28 +34853,32 @@

    teal.slice coverage - 65.92%

    548 - 175x + 175x +
          supported_vars <- get_supported_filter_varnames(private$data)
    549 - 175x + 175x +
          if (length(include_varnames)) {
    550 - 161x + 161x +
            private$include_varnames <- intersect(include_varnames, supported_vars)
    551 - 161x + 161x +
            private$exclude_varnames <- character(0)
    @@ -33604,14 +34892,16 @@

    teal.slice coverage - 65.92%

    553 - 14x + 14x +
            private$exclude_varnames <- exclude_varnames
    554 - 14x + 14x +
            private$include_varnames <- character(0)
    @@ -33625,7 +34915,8 @@

    teal.slice coverage - 65.92%

    556 - 175x + 175x +
          invisible(NULL)
    @@ -33702,14 +34993,16 @@

    teal.slice coverage - 65.92%

    567 - 144x + 144x +
          if (length(private$include_varnames)) {
    568 - 97x + 97x +
            private$include_varnames
    @@ -33723,14 +35016,16 @@

    teal.slice coverage - 65.92%

    570 - 47x + 47x +
            supported_varnames <- get_supported_filter_varnames(private$data)
    571 - 47x + 47x +
            setdiff(supported_varnames, private$exclude_varnames)
    @@ -33835,7 +35130,8 @@

    teal.slice coverage - 65.92%

    586 - 212x + 212x +
          checkmate::assert_string(state_id, null.ok = TRUE)
    @@ -33849,14 +35145,16 @@

    teal.slice coverage - 65.92%

    588 - 212x + 212x +
          if (is.null(state_id)) {
    589 - 212x + 212x +
            private$state_list()
    @@ -33982,49 +35280,56 @@

    teal.slice coverage - 65.92%

    607 - 183x + 183x +
          logger::log_trace("{ class(self)[1] } pushing into state_list, dataname: { private$dataname }")
    608 - 183x + 183x +
          checkmate::assert_string(state_id)
    609 - 183x + 183x +
          checkmate::assert_multi_class(x, c("FilterState", "FilterStateExpr"))
    610 - 183x + 183x +
          state <- stats::setNames(list(x), state_id)
    611 - 183x + 183x +
          new_state_list <- c(
    612 - 183x + 183x +
            isolate(private$state_list()),
    613 - 183x + 183x +
            state
    @@ -34038,7 +35343,8 @@

    teal.slice coverage - 65.92%

    615 - 183x + 183x +
          isolate(private$state_list(new_state_list))
    @@ -34052,14 +35358,16 @@

    teal.slice coverage - 65.92%

    617 - 183x + 183x +
          logger::log_trace("{ class(self)[1] } pushed into queue, dataname: { private$dataname }")
    618 - 183x + 183x +
          invisible(NULL)
    @@ -34178,14 +35486,16 @@

    teal.slice coverage - 65.92%

    635 - 32x + 32x +
          checkmate::assert_character(state_id)
    636 - 32x + 32x +
          logger::log_trace("{ class(self)[1] } removing a filter, state_id: { toString(state_id) }")
    @@ -34199,63 +35509,72 @@

    teal.slice coverage - 65.92%

    638 - 32x + 32x +
          isolate({
    639 - 32x + 32x +
            current_state_ids <- vapply(private$state_list(), function(x) x$get_state()$id, character(1))
    640 - 32x + 32x +
            to_remove <- state_id %in% current_state_ids
    641 - 32x + 32x +
            if (any(to_remove)) {
    642 - 31x + 31x +
              new_state_list <- Filter(
    643 - 31x + 31x +
                function(state) {
    644 - 68x + 68x +
                  if (state$get_state()$id %in% state_id) {
    645 - 54x + 54x +
                    if (state$get_state()$anchored && !force) {
    646 - 7x + 7x +
                      return(TRUE)
    @@ -34269,14 +35588,16 @@

    teal.slice coverage - 65.92%

    648 - 47x + 47x +
                      state$destroy_observers()
    649 - 47x + 47x +
                      FALSE
    @@ -34297,7 +35618,8 @@

    teal.slice coverage - 65.92%

    652 - 14x + 14x +
                    TRUE
    @@ -34318,7 +35640,8 @@

    teal.slice coverage - 65.92%

    655 - 31x + 31x +
                private$state_list()
    @@ -34332,7 +35655,8 @@

    teal.slice coverage - 65.92%

    657 - 31x + 31x +
              private$state_list(new_state_list)
    @@ -34346,7 +35670,8 @@

    teal.slice coverage - 65.92%

    659 - 1x + 1x +
              warning(sprintf("\"%s\" not found in state list", state_id))
    @@ -34374,7 +35699,8 @@

    teal.slice coverage - 65.92%

    663 - 32x + 32x +
          invisible(NULL)
    @@ -34444,21 +35770,24 @@

    teal.slice coverage - 65.92%

    673 - 25x + 25x +
          isolate({
    674 - 25x + 25x +
            logger::log_trace(
    675 - 25x + 25x +
              "{ class(self)[1] }$state_list_empty removing all non-anchored filters for dataname: { private$dataname }"
    @@ -34479,28 +35808,32 @@

    teal.slice coverage - 65.92%

    678 - 25x + 25x +
            state_list <- private$state_list()
    679 - 25x + 25x +
            if (length(state_list)) {
    680 - 15x + 15x +
              state_ids <- vapply(state_list, function(x) x$get_state()$id, character(1))
    681 - 15x + 15x +
              private$state_list_remove(state_ids, force)
    @@ -34528,7 +35861,8 @@

    teal.slice coverage - 65.92%

    685 - 25x + 25x +
          invisible(NULL)
    @@ -34654,35 +35988,40 @@

    teal.slice coverage - 65.92%

    703 - 211x + 211x +
          checkmate::assert_class(state, "teal_slices")
    704 - 211x + 211x +
          checkmate::assert_multi_class(data, c("data.frame", "matrix", "DataFrame", "HermesData"))
    705 - 211x + 211x +
          checkmate::assert_function(data_reactive, args = "sid")
    706 - 211x + 211x +
          if (length(state) == 0L) {
    707 - 101x + 101x +
            return(invisible(NULL))
    @@ -34703,14 +36042,16 @@

    teal.slice coverage - 65.92%

    710 - 110x + 110x +
          slices_hashed <- vapply(state, `[[`, character(1L), "id")
    711 - 110x + 110x +
          if (any(duplicated(slices_hashed))) {
    @@ -34759,28 +36100,32 @@

    teal.slice coverage - 65.92%

    718 - 110x + 110x +
          state_list <- isolate(private$state_list_get())
    719 - 110x + 110x +
          lapply(state, function(slice) {
    720 - 191x + 191x +
            state_id <- slice$id
    721 - 191x + 191x +
            if (state_id %in% names(state_list)) {
    @@ -34794,7 +36139,8 @@

    teal.slice coverage - 65.92%

    723 - 8x + 8x +
              state_list[[state_id]]$set_state(slice)
    @@ -34808,7 +36154,8 @@

    teal.slice coverage - 65.92%

    725 - 183x + 183x +
              if (inherits(slice, "teal_slice_expr")) {
    @@ -34822,7 +36169,8 @@

    teal.slice coverage - 65.92%

    727 - 6x + 6x +
                fstate <- init_filter_state_expr(slice)
    @@ -34843,14 +36191,16 @@

    teal.slice coverage - 65.92%

    730 - 177x + 177x +
                fstate <- init_filter_state(
    731 - 177x + 177x +
                  x = data[, slice$varname, drop = TRUE],
    @@ -34899,14 +36249,16 @@

    teal.slice coverage - 65.92%

    738 - 177x + 177x +
                  x_reactive = if (private$count_type == "none") {
    739 - 171x + 171x +
                    reactive(NULL)
    @@ -34920,7 +36272,8 @@

    teal.slice coverage - 65.92%

    741 - 6x + 6x +
                    reactive(data_reactive(state_id)[, slice$varname, drop = TRUE])
    @@ -34934,14 +36287,16 @@

    teal.slice coverage - 65.92%

    743 - 177x + 177x +
                  slice = slice,
    744 - 177x + 177x +
                  extract_type = private$extract_type
    @@ -34962,7 +36317,8 @@

    teal.slice coverage - 65.92%

    747 - 183x + 183x +
              private$state_list_push(x = fstate, state_id = state_id)
    @@ -34990,7 +36346,8 @@

    teal.slice coverage - 65.92%

    751 - 110x + 110x +
          invisible(NULL)
    @@ -35542,35 +36899,40 @@

    teal.slice coverage - 65.92%

    75 - 369x + 369x +
          checkmate::assert_class(x_reactive, "reactive")
    76 - 368x + 368x +
          checkmate::assert_class(slice, "teal_slice")
    77 - 366x + 366x +
          checkmate::assert_character(extract_type, max.len = 1, any.missing = FALSE)
    78 - 366x + 366x +
          if (length(extract_type) == 1) {
    79 - 53x + 53x +
            checkmate::assert_choice(extract_type, choices = c("list", "matrix"))
    @@ -35598,14 +36960,16 @@

    teal.slice coverage - 65.92%

    83 - 365x + 365x +
          private$x <- x
    84 - 365x + 365x +
          private$x_reactive <- x_reactive
    @@ -35619,21 +36983,24 @@

    teal.slice coverage - 65.92%

    86 - 365x + 365x +
          private$na_count <- sum(is.na(x))
    87 - 365x + 365x +
          private$filtered_na_count <- reactive(
    88 - 365x + 365x +
            if (!is.null(private$x_reactive())) {
    @@ -35668,7 +37035,8 @@

    teal.slice coverage - 65.92%

    93 - 365x + 365x +
          private$extract_type <- extract_type
    @@ -35689,14 +37057,16 @@

    teal.slice coverage - 65.92%

    96 - 18x + 18x +
          if (is.null(isolate(slice$keep_na)) && anyNA(x)) slice$keep_na <- TRUE
    97 - 365x + 365x +
          private$teal_slice <- slice
    @@ -35710,7 +37080,8 @@

    teal.slice coverage - 65.92%

    99 - 365x + 365x +
          varlabel <- attr(x, "label", exact = TRUE)
    @@ -35724,21 +37095,24 @@

    teal.slice coverage - 65.92%

    101 - 365x + 365x +
          private$varlabel <-
    102 - 365x + 365x +
            if (is.null(varlabel) || identical(varlabel, private$get_varname())) {
    103 - 364x + 364x +
              character(0)
    @@ -35752,7 +37126,8 @@

    teal.slice coverage - 65.92%

    105 - 1x + 1x +
              varlabel
    @@ -35773,7 +37148,8 @@

    teal.slice coverage - 65.92%

    108 - 365x + 365x +
          private$state_history <- reactiveVal(list())
    @@ -35787,7 +37163,8 @@

    teal.slice coverage - 65.92%

    110 - 365x + 365x +
          logger::log_trace("Instantiated FilterState object id: { private$get_id() }")
    @@ -35801,7 +37178,8 @@

    teal.slice coverage - 65.92%

    112 - 365x + 365x +
          invisible(self)
    @@ -35885,28 +37263,32 @@

    teal.slice coverage - 65.92%

    124 - 68x + 68x +
          sprintf(
    125 - 68x + 68x +
            "%s:\n%s",
    126 - 68x + 68x +
            class(self)[1],
    127 - 68x + 68x +
            format(self$get_state(), show_all = show_all, trim_lines = trim_lines)
    @@ -35976,7 +37358,8 @@

    teal.slice coverage - 65.92%

    137 - 14x + 14x +
          cat(isolate(self$format(...)))
    @@ -36067,21 +37450,24 @@

    teal.slice coverage - 65.92%

    150 - 89x + 89x +
          checkmate::assert_class(state, "teal_slice")
    151 - 88x + 88x +
          if (private$is_fixed()) {
    152 - 1x + 1x +
            warning("attempt to set state on fixed filter aborted id: ", private$get_id())
    @@ -36095,28 +37481,32 @@

    teal.slice coverage - 65.92%

    154 - 87x + 87x +
            logger::log_trace("{ class(self)[1] }$set_state setting state of filter id: { private$get_id() }")
    155 - 87x + 87x +
            isolate({
    156 - 87x + 87x +
              if (!is.null(state$selected)) {
    157 - 78x + 78x +
                private$set_selected(state$selected)
    @@ -36130,14 +37520,16 @@

    teal.slice coverage - 65.92%

    159 - 75x + 75x +
              if (!is.null(state$keep_na)) {
    160 - 16x + 16x +
                private$set_keep_na(state$keep_na)
    @@ -36151,14 +37543,16 @@

    teal.slice coverage - 65.92%

    162 - 75x + 75x +
              if (!is.null(state$keep_inf)) {
    163 - 9x + 9x +
                private$set_keep_inf(state$keep_inf)
    @@ -36172,35 +37566,40 @@

    teal.slice coverage - 65.92%

    165 - 75x + 75x +
              current_state <- sprintf(
    166 - 75x + 75x +
                "selected: %s; keep_na: %s; keep_inf: %s",
    167 - 75x + 75x +
                toString(private$get_selected()),
    168 - 75x + 75x +
                private$get_keep_na(),
    169 - 75x + 75x +
                private$get_keep_inf()
    @@ -36235,7 +37634,8 @@

    teal.slice coverage - 65.92%

    174 - 76x + 76x +
          invisible(self)
    @@ -36305,7 +37705,8 @@

    teal.slice coverage - 65.92%

    184 - 747x + 747x +
          private$teal_slice
    @@ -36375,7 +37776,8 @@

    teal.slice coverage - 65.92%

    194 - 1x + 1x +
          stop("this is a virtual method")
    @@ -36459,42 +37861,48 @@

    teal.slice coverage - 65.92%

    206 - 12x + 12x +
          moduleServer(
    207 - 12x + 12x +
            id = id,
    208 - 12x + 12x +
            function(input, output, session) {
    209 - 12x + 12x +
              logger::log_trace("FilterState$server initializing module for slice: { private$get_id() } ")
    210 - 12x + 12x +
              private$server_summary("summary")
    211 - 12x + 12x +
              if (private$is_fixed()) {
    @@ -36515,7 +37923,8 @@

    teal.slice coverage - 65.92%

    214 - 12x + 12x +
                private$server_inputs("inputs")
    @@ -36536,49 +37945,56 @@

    teal.slice coverage - 65.92%

    217 - 12x + 12x +
              private$observers$state <- observeEvent(
    218 - 12x + 12x +
                eventExpr = list(private$get_selected(), private$get_keep_na(), private$get_keep_inf()),
    219 - 12x + 12x +
                handlerExpr = {
    220 - 4x + 4x +
                  current_state <- as.list(self$get_state())
    221 - 4x + 4x +
                  history <- private$state_history()
    222 - 4x + 4x +
                  history_update <- c(history, list(current_state))
    223 - 4x + 4x +
                  private$state_history(history_update)
    @@ -36606,21 +38022,24 @@

    teal.slice coverage - 65.92%

    227 - 12x + 12x +
              private$observers$back <- observeEvent(
    228 - 12x + 12x +
                eventExpr = input$back,
    229 - 12x + 12x +
                handlerExpr = {
    @@ -36683,21 +38102,24 @@

    teal.slice coverage - 65.92%

    238 - 12x + 12x +
              private$observers$reset <- observeEvent(
    239 - 12x + 12x +
                eventExpr = input$reset,
    240 - 12x + 12x +
                handlerExpr = {
    @@ -36753,56 +38175,64 @@

    teal.slice coverage - 65.92%

    248 - 12x + 12x +
              private$observers$state_history <- observeEvent(
    249 - 12x + 12x +
                eventExpr = private$state_history(),
    250 - 12x + 12x +
                handlerExpr = {
    251 - 4x + 4x +
                  shinyjs::disable(id = "back")
    252 - 4x + 4x +
                  shinyjs::disable(id = "reset")
    253 - 4x + 4x +
                  shinyjs::delay(
    254 - 4x + 4x +
                    ms = 100,
    255 - 4x + 4x +
                    expr = {
    @@ -36837,21 +38267,24 @@

    teal.slice coverage - 65.92%

    260 - 4x + 4x +
                  shinyjs::delay(
    261 - 4x + 4x +
                    ms = 100,
    262 - 4x + 4x +
                    expr = {
    @@ -36907,14 +38340,16 @@

    teal.slice coverage - 65.92%

    270 - 12x + 12x +
              private$destroy_shiny <- function() {
    271 - 8x + 8x +
                logger::log_trace("Destroying FilterState inputs and observers; id: { private$get_id() }")
    @@ -36928,7 +38363,8 @@

    teal.slice coverage - 65.92%

    273 - 8x + 8x +
                lapply(session$ns(names(input)), .subset2(input, "impl")$.values$remove)
    @@ -36949,7 +38385,8 @@

    teal.slice coverage - 65.92%

    276 - 8x + 8x +
                lapply(private$observers, function(x) x$destroy())
    @@ -36970,7 +38407,8 @@

    teal.slice coverage - 65.92%

    279 - 12x + 12x +
              reactive(input$remove)
    @@ -37054,7 +38492,8 @@

    teal.slice coverage - 65.92%

    291 - 12x + 12x +
          ns <- NS(id)
    @@ -37110,84 +38549,96 @@

    teal.slice coverage - 65.92%

    299 - 12x + 12x +
          tags$div(
    300 - 12x + 12x +
            id = id,
    301 - 12x + 12x +
            class = "panel filter-card",
    302 - 12x + 12x +
            include_js_files("count-bar-labels.js"),
    303 - 12x + 12x +
            tags$div(
    304 - 12x + 12x +
              class = "filter-card-header",
    305 - 12x + 12x +
              `data-toggle` = "collapse",
    306 - 12x + 12x +
              `data-bs-toggle` = "collapse",
    307 - 12x + 12x +
              href = paste0("#", ns("body")),
    308 - 12x + 12x +
              tags$div(
    309 - 12x + 12x +
                class = "filter-card-title",
    310 - 12x + 12x +
                if (private$is_anchored() && private$is_fixed()) {
    @@ -37201,7 +38652,8 @@

    teal.slice coverage - 65.92%

    312 - 12x + 12x +
                } else if (private$is_anchored() && !private$is_fixed()) {
    @@ -37215,7 +38667,8 @@

    teal.slice coverage - 65.92%

    314 - 12x + 12x +
                } else if (!private$is_anchored() && private$is_fixed()) {
    @@ -37236,28 +38689,32 @@

    teal.slice coverage - 65.92%

    317 - 12x + 12x +
                tags$div(class = "filter-card-varname", tags$strong(private$get_varname())),
    318 - 12x + 12x +
                tags$div(class = "filter-card-varlabel", private$get_varlabel()),
    319 - 12x + 12x +
                tags$div(
    320 - 12x + 12x +
                  class = "filter-card-controls",
    @@ -37278,7 +38735,8 @@

    teal.slice coverage - 65.92%

    323 - 12x + 12x +
                  onclick = "event.stopPropagation();event.preventDefault();",
    @@ -37292,70 +38750,80 @@

    teal.slice coverage - 65.92%

    325 - 12x + 12x +
                  `data-bs-toggle` = "collapse",
    326 - 12x + 12x +
                  `data-bs-target` = NULL,
    327 - 12x + 12x +
                  if (isFALSE(private$is_fixed())) {
    328 - 12x + 12x +
                    actionLink(
    329 - 12x + 12x +
                      inputId = ns("back"),
    330 - 12x + 12x +
                      label = NULL,
    331 - 12x + 12x +
                      icon = icon("circle-arrow-left", lib = "font-awesome"),
    332 - 12x + 12x +
                      title = "Rewind state",
    333 - 12x + 12x +
                      class = "filter-card-back",
    334 - 12x + 12x +
                      style = "display: none"
    @@ -37376,56 +38844,64 @@

    teal.slice coverage - 65.92%

    337 - 12x + 12x +
                  if (isFALSE(private$is_fixed())) {
    338 - 12x + 12x +
                    actionLink(
    339 - 12x + 12x +
                      inputId = ns("reset"),
    340 - 12x + 12x +
                      label = NULL,
    341 - 12x + 12x +
                      icon = icon("circle-arrow-up", lib = "font-awesome"),
    342 - 12x + 12x +
                      title = "Restore original state",
    343 - 12x + 12x +
                      class = "filter-card-back",
    344 - 12x + 12x +
                      style = "display: none"
    @@ -37446,42 +38922,48 @@

    teal.slice coverage - 65.92%

    347 - 12x + 12x +
                  if (isFALSE(private$is_anchored())) {
    348 - 12x + 12x +
                    actionLink(
    349 - 12x + 12x +
                      inputId = ns("remove"),
    350 - 12x + 12x +
                      label = icon("circle-xmark", lib = "font-awesome"),
    351 - 12x + 12x +
                      title = "Remove filter",
    352 - 12x + 12x +
                      class = "filter-card-remove"
    @@ -37516,7 +38998,8 @@

    teal.slice coverage - 65.92%

    357 - 12x + 12x +
              tags$div(class = "filter-card-summary", private$ui_summary(ns("summary")))
    @@ -37530,56 +39013,64 @@

    teal.slice coverage - 65.92%

    359 - 12x + 12x +
            tags$div(
    360 - 12x + 12x +
              id = ns("body"),
    361 - 12x + 12x +
              class = "collapse out",
    362 - 12x + 12x +
              `data-parent` = paste0("#", parent_id),
    363 - 12x + 12x +
              `data-bs-parent` = paste0("#", parent_id),
    364 - 12x + 12x +
              tags$div(
    365 - 12x + 12x +
                class = "filter-card-body",
    366 - 12x + 12x +
                if (private$is_fixed()) {
    @@ -37600,7 +39091,8 @@

    teal.slice coverage - 65.92%

    369 - 12x + 12x +
                  private$ui_inputs(ns("inputs"))
    @@ -37691,14 +39183,16 @@

    teal.slice coverage - 65.92%

    382 - 47x + 47x +
          if (!is.null(private$destroy_shiny)) {
    383 - 8x + 8x +
            private$destroy_shiny()
    @@ -37992,35 +39486,40 @@

    teal.slice coverage - 65.92%

    425 - 421x + 421x +
          logger::log_trace(
    426 - 421x + 421x +
            sprintf(
    427 - 421x + 421x +
              "%s$set_selected setting selection of id: %s",
    428 - 421x + 421x +
              class(self)[1],
    429 - 421x + 421x +
              private$get_id()
    @@ -38041,35 +39540,40 @@

    teal.slice coverage - 65.92%

    432 - 421x + 421x +
          isolate({
    433 - 421x + 421x +
            value <- private$cast_and_validate(value)
    434 - 410x + 410x +
            value <- private$check_length(value)
    435 - 404x + 404x +
            value <- private$remove_out_of_bounds_values(value)
    436 - 404x + 404x +
            private$teal_slice$selected <- value
    @@ -38083,35 +39587,40 @@

    teal.slice coverage - 65.92%

    438 - 404x + 404x +
          logger::log_trace(
    439 - 404x + 404x +
            sprintf(
    440 - 404x + 404x +
              "%s$set_selected selection of id: %s",
    441 - 404x + 404x +
              class(self)[1],
    442 - 404x + 404x +
              private$get_id()
    @@ -38139,7 +39648,8 @@

    teal.slice coverage - 65.92%

    446 - 404x + 404x +
          invisible(NULL)
    @@ -38223,56 +39733,64 @@

    teal.slice coverage - 65.92%

    458 - 16x + 16x +
          checkmate::assert_flag(value)
    459 - 16x + 16x +
          private$teal_slice$keep_na <- value
    460 - 16x + 16x +
          logger::log_trace(
    461 - 16x + 16x +
            sprintf(
    462 - 16x + 16x +
              "%s$set_keep_na set for filter %s to %s.",
    463 - 16x + 16x +
              class(self)[1],
    464 - 16x + 16x +
              private$get_id(),
    465 - 16x + 16x +
              value
    @@ -38293,7 +39811,8 @@

    teal.slice coverage - 65.92%

    468 - 16x + 16x +
          invisible(NULL)
    @@ -38377,56 +39896,64 @@

    teal.slice coverage - 65.92%

    480 - 9x + 9x +
          checkmate::assert_flag(value)
    481 - 9x + 9x +
          private$teal_slice$keep_inf <- value
    482 - 9x + 9x +
          logger::log_trace(
    483 - 9x + 9x +
            sprintf(
    484 - 9x + 9x +
              "%s$set_keep_inf of filter %s set to %s",
    485 - 9x + 9x +
              class(self)[1],
    486 - 9x + 9x +
              private$get_id(),
    487 - 9x + 9x +
              value
    @@ -38454,7 +39981,8 @@

    teal.slice coverage - 65.92%

    491 - 9x + 9x +
          invisible(NULL)
    @@ -38517,7 +40045,8 @@

    teal.slice coverage - 65.92%

    500 - 88x + 88x +
          isolate(private$teal_slice$dataname)
    @@ -38566,7 +40095,8 @@

    teal.slice coverage - 65.92%

    507 - 166x + 166x +
          isolate(private$teal_slice$varname)
    @@ -38615,7 +40145,8 @@

    teal.slice coverage - 65.92%

    514 - 4x + 4x +
          isolate(private$teal_slice$id)
    @@ -38671,7 +40202,8 @@

    teal.slice coverage - 65.92%

    522 - 772x + 772x +
          isolate(private$teal_slice$choices)
    @@ -38727,7 +40259,8 @@

    teal.slice coverage - 65.92%

    530 - 364x + 364x +
          private$teal_slice$selected
    @@ -38776,7 +40309,8 @@

    teal.slice coverage - 65.92%

    537 - 129x + 129x +
          private$teal_slice$keep_na
    @@ -38825,7 +40359,8 @@

    teal.slice coverage - 65.92%

    544 - 117x + 117x +
          private$teal_slice$keep_inf
    @@ -38867,7 +40402,8 @@

    teal.slice coverage - 65.92%

    550 - 148x + 148x +
          isolate(isTRUE(private$teal_slice$fixed))
    @@ -38909,7 +40445,8 @@

    teal.slice coverage - 65.92%

    556 - 48x + 48x +
          isolate(isTRUE(private$teal_slice$anchored))
    @@ -38951,7 +40488,8 @@

    teal.slice coverage - 65.92%

    562 - 217x + 217x +
          isolate(isTRUE(private$teal_slice$multiple))
    @@ -39014,7 +40552,8 @@

    teal.slice coverage - 65.92%

    571 - 12x + 12x +
          private$varlabel
    @@ -39063,49 +40602,56 @@

    teal.slice coverage - 65.92%

    578 - 109x + 109x +
          varname <- private$get_varname()
    579 - 109x + 109x +
          varname_backticked <- sprintf("`%s`", varname)
    580 - 109x + 109x +
          ans <-
    581 - 109x + 109x +
            if (isTRUE(private$extract_type == "list")) {
    582 - 16x + 16x +
              sprintf("%s$%s", dataname, varname_backticked)
    583 - 109x + 109x +
            } else if (isTRUE(private$extract_type == "matrix")) {
    584 - 7x + 7x +
              sprintf("%s[, \"%s\"]", dataname, varname)
    @@ -39119,7 +40665,8 @@

    teal.slice coverage - 65.92%

    586 - 86x + 86x +
              varname_backticked
    @@ -39133,7 +40680,8 @@

    teal.slice coverage - 65.92%

    588 - 109x + 109x +
          str2lang(ans)
    @@ -39203,14 +40751,16 @@

    teal.slice coverage - 65.92%

    598 - 108x + 108x +
          if (private$na_count == 0L) {
    599 - 87x + 87x +
            return(filter_call)
    @@ -39231,42 +40781,48 @@

    teal.slice coverage - 65.92%

    602 - 21x + 21x +
          if (is.null(filter_call) && isFALSE(private$get_keep_na())) {
    603 - 2x + 2x +
            call("!", call("is.na", varname))
    604 - 19x + 19x +
          } else if (!is.null(filter_call) && isTRUE(private$get_keep_na())) {
    605 - 12x + 12x +
            call("|", call("is.na", varname), filter_call)
    606 - 7x + 7x +
          } else if (!is.null(filter_call) && isFALSE(private$get_keep_na())) {
    607 - 7x + 7x +
            call("&", call("!", call("is.na", varname)), filter_call)
    @@ -39343,7 +40899,8 @@

    teal.slice coverage - 65.92%

    618 - 11x + 11x +
          values
    @@ -39378,7 +40935,8 @@

    teal.slice coverage - 65.92%

    623 - 11x + 11x +
          values
    @@ -39441,7 +40999,8 @@

    teal.slice coverage - 65.92%

    632 - 31x + 31x +
          values
    @@ -39539,42 +41098,48 @@

    teal.slice coverage - 65.92%

    646 - 75x + 75x +
          if (private$is_choice_limited) {
    647 - 3x + 3x +
            TRUE
    648 - 72x + 72x +
          } else if (!setequal(private$get_selected(), private$get_choices())) {
    649 - 59x + 59x +
            TRUE
    650 - 13x + 13x +
          } else if (!isTRUE(private$get_keep_na()) && private$na_count > 0) {
    651 - 4x + 4x +
            TRUE
    @@ -39588,7 +41153,8 @@

    teal.slice coverage - 65.92%

    653 - 9x + 9x +
            FALSE
    @@ -39658,14 +41224,16 @@

    teal.slice coverage - 65.92%

    663 - 12x + 12x +
          ns <- NS(id)
    664 - 12x + 12x +
          uiOutput(ns("summary"), class = "filter-card-summary")
    @@ -39721,28 +41289,32 @@

    teal.slice coverage - 65.92%

    672 - 12x + 12x +
          moduleServer(
    673 - 12x + 12x +
            id = id,
    674 - 12x + 12x +
            function(input, output, session) {
    675 - 12x + 12x +
              output$summary <- renderUI(private$content_summary())
    @@ -40008,14 +41580,16 @@

    teal.slice coverage - 65.92%

    713 - 11x + 11x +
          ns <- NS(id)
    714 - 11x + 11x +
          if (private$na_count > 0) {
    @@ -40169,7 +41743,8 @@

    teal.slice coverage - 65.92%

    736 - 11x + 11x +
            NULL
    @@ -40246,7 +41821,8 @@

    teal.slice coverage - 65.92%

    747 - 12x + 12x +
          moduleServer(id, function(input, output, session) {
    @@ -40274,42 +41850,48 @@

    teal.slice coverage - 65.92%

    751 - 12x + 12x +
            output$trigger_visible <- renderUI({
    752 - 12x + 12x +
              updateCountText(
    753 - 12x + 12x +
                inputId = "count_label",
    754 - 12x + 12x +
                label = "Keep NA",
    755 - 12x + 12x +
                countmax = private$na_count,
    756 - 12x + 12x +
                countnow = private$filtered_na_count()
    @@ -40323,7 +41905,8 @@

    teal.slice coverage - 65.92%

    758 - 12x + 12x +
              NULL
    @@ -40365,35 +41948,40 @@

    teal.slice coverage - 65.92%

    764 - 12x + 12x +
            private$observers$keep_na_api <- observeEvent(
    765 - 12x + 12x +
              ignoreNULL = FALSE, # nothing selected is possible for NA
    766 - 12x + 12x +
              ignoreInit = TRUE, # ignoreInit: should not matter because we set the UI with the desired initial state
    767 - 12x + 12x +
              eventExpr = private$get_keep_na(),
    768 - 12x + 12x +
              handlerExpr = {
    @@ -40470,35 +42058,40 @@

    teal.slice coverage - 65.92%

    779 - 12x + 12x +
            private$observers$keep_na <- observeEvent(
    780 - 12x + 12x +
              ignoreNULL = FALSE, # ignoreNULL: we don't want to ignore NULL when nothing is selected in the `selectInput`
    781 - 12x + 12x +
              ignoreInit = TRUE, # ignoreInit: should not matter because we set the UI with the desired initial state
    782 - 12x + 12x +
              eventExpr = input$value,
    783 - 12x + 12x +
              handlerExpr = {
    @@ -40568,7 +42161,8 @@

    teal.slice coverage - 65.92%

    793 - 12x + 12x +
            invisible(NULL)
    @@ -40847,7 +42441,8 @@

    teal.slice coverage - 65.92%

    35 - 92x + 92x +
          if (!requireNamespace("SummarizedExperiment", quietly = TRUE)) {
    @@ -40868,35 +42463,40 @@

    teal.slice coverage - 65.92%

    38 - 92x + 92x +
          checkmate::assert_function(data_reactive, args = "sid")
    39 - 92x + 92x +
          checkmate::assert_class(data, "SummarizedExperiment")
    40 - 91x + 91x +
          super$initialize(data, data_reactive, dataname, datalabel)
    41 - 91x + 91x +
          if (!is.null(datalabel)) {
    42 - 84x + 84x +
            private$dataname_prefixed <- sprintf("%s[['%s']]", dataname, datalabel)
    @@ -40987,35 +42587,40 @@

    teal.slice coverage - 65.92%

    55 - 61x + 61x +
          isolate({
    56 - 61x + 61x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initializing, dataname: { private$dataname }")
    57 - 61x + 61x +
            checkmate::assert_class(state, "teal_slices")
    58 - 59x + 59x +
            lapply(state, function(x) {
    59 - 17x + 17x +
              checkmate::assert_choice(x$arg, choices = c("subset", "select"), null.ok = TRUE, .var.name = "teal_slice$arg")
    @@ -41029,21 +42634,24 @@

    teal.slice coverage - 65.92%

    61 - 59x + 59x +
            count_type <- attr(state, "count_type")
    62 - 59x + 59x +
            if (length(count_type)) {
    63 - 8x + 8x +
              private$count_type <- count_type
    @@ -41064,35 +42672,40 @@

    teal.slice coverage - 65.92%

    66 - 59x + 59x +
            subset_states <- Filter(function(x) x$arg == "subset", state)
    67 - 59x + 59x +
            private$set_filter_state_impl(
    68 - 59x + 59x +
              state = subset_states,
    69 - 59x + 59x +
              data = SummarizedExperiment::rowData(private$data),
    70 - 59x + 59x +
              data_reactive = function(sid = "") {
    @@ -41148,35 +42761,40 @@

    teal.slice coverage - 65.92%

    78 - 59x + 59x +
            select_states <- Filter(function(x) x$arg == "select", state)
    79 - 59x + 59x +
            private$set_filter_state_impl(
    80 - 59x + 59x +
              state = select_states,
    81 - 59x + 59x +
              data = SummarizedExperiment::colData(private$data),
    82 - 59x + 59x +
              data_reactive = function(sid = "") {
    @@ -41232,14 +42850,16 @@

    teal.slice coverage - 65.92%

    90 - 59x + 59x +
            logger::log_trace("{ class(self)[1] }$set_filter_state initialized, dataname: { private$dataname }")
    91 - 59x + 59x +
            invisible(NULL)
    @@ -41309,49 +42929,56 @@

    teal.slice coverage - 65.92%

    101 - 2x + 2x +
          data <- private$data
    102 - 2x + 2x +
          checkmate::assert_string(id)
    103 - 2x + 2x +
          ns <- NS(id)
    104 - 2x + 2x +
          row_input <- if (ncol(SummarizedExperiment::rowData(data)) == 0) {
    105 - 1x + 1x +
            tags$div("no sample variables available")
    106 - 2x + 2x +
          } else if (nrow(SummarizedExperiment::rowData(data)) == 0) {
    107 - 1x + 1x +
            tags$div("no samples available")
    @@ -41435,28 +43062,32 @@

    teal.slice coverage - 65.92%

    119 - 2x + 2x +
          col_input <- if (ncol(SummarizedExperiment::colData(data)) == 0) {
    120 - 1x + 1x +
            tags$div("no sample variables available")
    121 - 2x + 2x +
          } else if (nrow(SummarizedExperiment::colData(data)) == 0) {
    122 - 1x + 1x +
            tags$div("no samples available")
    @@ -41540,21 +43171,24 @@

    teal.slice coverage - 65.92%

    134 - 2x + 2x +
          tags$div(
    135 - 2x + 2x +
            row_input,
    136 - 2x + 2x +
            col_input
    @@ -42974,7 +44608,8 @@

    teal.slice coverage - 65.92%

    33 - 153x + 153x +
          logger::log_trace("Instantiating { class(self)[1] }, dataname: { dataname }")
    @@ -42995,21 +44630,24 @@

    teal.slice coverage - 65.92%

    36 - 153x + 153x +
          check_simple_name(dataname)
    37 - 151x + 151x +
          checkmate::assert_character(keys, any.missing = FALSE)
    38 - 151x + 151x +
          checkmate::assert_character(label, null.ok = TRUE)
    @@ -43023,35 +44661,40 @@

    teal.slice coverage - 65.92%

    40 - 151x + 151x +
          logger::log_trace("Instantiating { class(self)[1] }, dataname: { dataname }")
    41 - 151x + 151x +
          private$dataset <- dataset
    42 - 151x + 151x +
          private$dataname <- dataname
    43 - 151x + 151x +
          private$keys <- keys
    44 - 151x + 151x +
          private$label <- if (is.null(label)) character(0) else label
    @@ -43072,28 +44715,32 @@

    teal.slice coverage - 65.92%

    47 - 151x + 151x +
          private$data_filtered_fun <- function(sid = "") {
    48 - 24x + 24x +
            checkmate::assert_character(sid)
    49 - 24x + 24x +
            if (length(sid)) {
    50 - 24x + 24x +
              logger::log_trace("filtering data dataname: { dataname }, sid: { sid }")
    @@ -43121,35 +44768,40 @@

    teal.slice coverage - 65.92%

    54 - 24x + 24x +
            env <- new.env(parent = parent.env(globalenv()))
    55 - 24x + 24x +
            env[[dataname]] <- private$dataset
    56 - 24x + 24x +
            filter_call <- self$get_call(sid)
    57 - 24x + 24x +
            eval_expr_with_msg(filter_call, env)
    58 - 24x + 24x +
            get(x = dataname, envir = env)
    @@ -43170,21 +44822,24 @@

    teal.slice coverage - 65.92%

    61 - 151x + 151x +
          private$data_filtered <- reactive(private$data_filtered_fun())
    62 - 151x + 151x +
          logger::log_trace("Instantiated { class(self)[1] }, dataname: { private$dataname }")
    63 - 151x + 151x +
          invisible(self)
    @@ -43268,28 +44923,32 @@

    teal.slice coverage - 65.92%

    75 - 24x + 24x +
          sprintf(
    76 - 24x + 24x +
            "%s:\n%s",
    77 - 24x + 24x +
            class(self)[1],
    78 - 24x + 24x +
            format(self$get_filter_state(), show_all = show_all, trim_lines = trim_lines)
    @@ -43359,7 +45018,8 @@

    teal.slice coverage - 65.92%

    88 - 10x + 10x +
          cat(isolate(self$format(...)), "\n")
    @@ -43436,28 +45096,32 @@

    teal.slice coverage - 65.92%

    99 - 14x + 14x +
          logger::log_trace("Removing filters from FilteredDataset: { deparse1(self$get_dataname()) }")
    100 - 14x + 14x +
          lapply(
    101 - 14x + 14x +
            private$get_filter_states(),
    102 - 14x + 14x +
            function(filter_states) filter_states$clear_filter_states(force)
    @@ -43471,14 +45135,16 @@

    teal.slice coverage - 65.92%

    104 - 14x + 14x +
          logger::log_trace("Removed filters from FilteredDataset: { deparse1(self$get_dataname()) }")
    105 - 14x + 14x +
          NULL
    @@ -43611,21 +45277,24 @@

    teal.slice coverage - 65.92%

    124 - 47x + 47x +
          filter_call <- Filter(
    125 - 47x + 47x +
            f = Negate(is.null),
    126 - 47x + 47x +
            x = lapply(private$get_filter_states(), function(x) x$get_call(sid))
    @@ -43639,14 +45308,16 @@

    teal.slice coverage - 65.92%

    128 - 47x + 47x +
          if (length(filter_call) == 0) {
    129 - 29x + 29x +
            return(NULL)
    @@ -43660,7 +45331,8 @@

    teal.slice coverage - 65.92%

    131 - 18x + 18x +
          filter_call
    @@ -43723,14 +45395,16 @@

    teal.slice coverage - 65.92%

    140 - 184x + 184x +
          states <- unname(lapply(private$get_filter_states(), function(x) x$get_filter_state()))
    141 - 184x + 184x +
          do.call(c, states)
    @@ -43856,7 +45530,8 @@

    teal.slice coverage - 65.92%

    159 - 16x + 16x +
          length(self$get_filter_state())
    @@ -43912,7 +45587,8 @@

    teal.slice coverage - 65.92%

    167 - 8x + 8x +
          private$dataname
    @@ -44003,14 +45679,16 @@

    teal.slice coverage - 65.92%

    180 - 51x + 51x +
          if (filtered) {
    181 - 33x + 33x +
            private$data_filtered
    @@ -44024,7 +45702,8 @@

    teal.slice coverage - 65.92%

    183 - 18x + 18x +
            private$dataset
    @@ -44129,7 +45808,8 @@

    teal.slice coverage - 65.92%

    198 - 133x + 133x +
          private$keys
    @@ -44178,7 +45858,8 @@

    teal.slice coverage - 65.92%

    205 - 2x + 2x +
          private$label
    @@ -44724,77 +46405,88 @@

    teal.slice coverage - 65.92%

    283 - 7x + 7x +
          moduleServer(
    284 - 7x + 7x +
            id = id,
    285 - 7x + 7x +
            function(input, output, session) {
    286 - 7x + 7x +
              dataname <- self$get_dataname()
    287 - 7x + 7x +
              logger::log_trace("FilteredDataset$srv_active initializing, dataname: { dataname }")
    288 - 7x + 7x +
              checkmate::assert_string(dataname)
    289 - 7x + 7x +
              output$filter_count <- renderText(
    290 - 7x + 7x +
                sprintf(
    291 - 7x + 7x +
                  "%d filter%s applied",
    292 - 7x + 7x +
                  self$get_filter_count(),
    293 - 7x + 7x +
                  if (self$get_filter_count() != 1) "s" else ""
    @@ -44822,28 +46514,32 @@

    teal.slice coverage - 65.92%

    297 - 7x + 7x +
              lapply(
    298 - 7x + 7x +
                names(private$get_filter_states()),
    299 - 7x + 7x +
                function(x) {
    300 - 12x + 12x +
                  private$get_filter_states()[[x]]$srv_active(id = x)
    @@ -44871,35 +46567,40 @@

    teal.slice coverage - 65.92%

    304 - 7x + 7x +
              observeEvent(self$get_filter_state(), {
    305 - 8x + 8x +
                shinyjs::hide("filter_count_ui")
    306 - 8x + 8x +
                shinyjs::show("filters")
    307 - 8x + 8x +
                shinyjs::toggle("remove_filters", condition = length(self$get_filter_state()) != 0)
    308 - 8x + 8x +
                shinyjs::toggle("collapse", condition = length(self$get_filter_state()) != 0)
    @@ -44920,7 +46621,8 @@

    teal.slice coverage - 65.92%

    311 - 7x + 7x +
              observeEvent(input$collapse, {
    @@ -44962,28 +46664,32 @@

    teal.slice coverage - 65.92%

    317 - 7x + 7x +
              observeEvent(input$remove_filters, {
    318 - 1x + 1x +
                logger::log_trace("FilteredDataset$srv_active@1 removing all non-anchored filters, dataname: { dataname }")
    319 - 1x + 1x +
                self$clear_filter_states()
    320 - 1x + 1x +
                logger::log_trace("FilteredDataset$srv_active@1 removed all non-anchored filters, dataname: { dataname }")
    @@ -45004,7 +46710,8 @@

    teal.slice coverage - 65.92%

    323 - 7x + 7x +
              logger::log_trace("FilteredDataset$initialized, dataname: { dataname }")
    @@ -45018,7 +46725,8 @@

    teal.slice coverage - 65.92%

    325 - 7x + 7x +
              NULL
    @@ -45109,7 +46817,8 @@

    teal.slice coverage - 65.92%

    338 - 1x + 1x +
          stop("Pure virtual method")
    @@ -45207,63 +46916,72 @@

    teal.slice coverage - 65.92%

    352 - 2x + 2x +
          moduleServer(
    353 - 2x + 2x +
            id = id,
    354 - 2x + 2x +
            function(input, output, session) {
    355 - 2x + 2x +
              logger::log_trace("MAEFilteredDataset$srv_add initializing, dataname: { deparse1(self$get_dataname()) }")
    356 - 2x + 2x +
              elems <- private$get_filter_states()
    357 - 2x + 2x +
              elem_names <- names(private$get_filter_states())
    358 - 2x + 2x +
              lapply(
    359 - 2x + 2x +
                elem_names,
    360 - 2x + 2x +
                function(elem_name) elems[[elem_name]]$srv_add(elem_name)
    @@ -45277,14 +46995,16 @@

    teal.slice coverage - 65.92%

    362 - 2x + 2x +
              logger::log_trace("MAEFilteredDataset$srv_add initialized, dataname: { deparse1(self$get_dataname()) }")
    363 - 2x + 2x +
              NULL
    @@ -45424,28 +47144,32 @@

    teal.slice coverage - 65.92%

    383 - 225x + 225x +
          checkmate::assert_class(filter_states, "FilterStates")
    384 - 225x + 225x +
          checkmate::assert_string(id)
    385 - 225x + 225x +
          x <- stats::setNames(list(filter_states), id)
    386 - 225x + 225x +
          private$filter_states <- c(private$get_filter_states(), x)
    @@ -45494,7 +47218,8 @@

    teal.slice coverage - 65.92%

    393 - 684x + 684x +
          private$filter_states
    @@ -45962,42 +47687,48 @@

    teal.slice coverage - 65.92%

    63 - 6x + 6x +
          isolate({
    64 - 6x + 6x +
            super$initialize(
    65 - 6x + 6x +
              x = x,
    66 - 6x + 6x +
              x_reactive = x_reactive,
    67 - 6x + 6x +
              slice = slice,
    68 - 6x + 6x +
              extract_type = extract_type
    @@ -46011,14 +47742,16 @@

    teal.slice coverage - 65.92%

    70 - 6x + 6x +
            private$set_choices(slice$choices)
    71 - 6x + 6x +
            private$set_selected(slice$selected)
    @@ -46039,7 +47772,8 @@

    teal.slice coverage - 65.92%

    74 - 6x + 6x +
          invisible(self)
    @@ -46109,14 +47843,16 @@

    teal.slice coverage - 65.92%

    84 - 2x + 2x +
          if (isFALSE(private$is_any_filtered())) {
    85 - 1x + 1x +
            return(NULL)
    @@ -46130,14 +47866,16 @@

    teal.slice coverage - 65.92%

    87 - 1x + 1x +
          if (missing(dataname)) dataname <- private$get_dataname()
    88 - 1x + 1x +
          filter_call <- if (isTRUE(private$get_keep_na())) {
    @@ -46158,7 +47896,8 @@

    teal.slice coverage - 65.92%

    91 - 1x + 1x +
            substitute(!is.na(varname), list(varname = private$get_varname_prefixed(dataname)))
    @@ -46270,14 +48009,16 @@

    teal.slice coverage - 65.92%

    107 - 6x + 6x +
          private$teal_slice$choices <- choices
    108 - 6x + 6x +
          invisible(NULL)
    @@ -46333,7 +48074,8 @@

    teal.slice coverage - 65.92%

    116 - 2x + 2x +
          if (private$is_choice_limited) {
    @@ -46354,7 +48096,8 @@

    teal.slice coverage - 65.92%

    119 - 2x + 2x +
            !isTRUE(private$get_keep_na())
    @@ -47256,42 +48999,48 @@

    teal.slice coverage - 65.92%

    75 - 25x + 25x +
      checkmate::assert_string(inputId)
    76 - 21x + 21x +
      checkmate::assert_vector(choices)
    77 - 20x + 20x +
      checkmate::assert_numeric(countsmax, len = length(choices))
    78 - 17x + 17x +
      checkmate::assert_numeric(countsnow, len = length(choices), null.ok = TRUE)
    79 - 15x + 15x +
      if (!is.null(countsnow)) {
    80 - 7x + 7x +
        checkmate::assert_true(all(countsnow <= countsmax))
    @@ -47312,7 +49061,8 @@

    teal.slice coverage - 65.92%

    83 - 14x + 14x +
      ns <- NS(inputId)
    @@ -47326,56 +49076,64 @@

    teal.slice coverage - 65.92%

    85 - 14x + 14x +
      mapply(
    86 - 14x + 14x +
        countBar,
    87 - 14x + 14x +
        inputId = ns(seq_along(choices)),
    88 - 14x + 14x +
        label = as.character(choices),
    89 - 14x + 14x +
        countmax = countsmax,
    90 - 14x + 14x +
        countnow = if (is.null(countsnow)) rep(list(NULL), length(choices)) else countsnow,
    91 - 14x + 14x +
        MoreArgs = list(
    92 - 14x + 14x +
          counttotal = sum(countsmax)
    @@ -47389,7 +49147,8 @@

    teal.slice coverage - 65.92%

    94 - 14x + 14x +
        SIMPLIFY = FALSE, USE.NAMES = FALSE
    @@ -47564,35 +49323,40 @@

    teal.slice coverage - 65.92%

    119 - 61x + 61x +
      checkmate::assert_string(inputId)
    120 - 57x + 57x +
      checkmate::assert_string(label)
    121 - 54x + 54x +
      checkmate::assert_number(countmax)
    122 - 51x + 51x +
      checkmate::assert_number(countnow, null.ok = TRUE, upper = countmax)
    123 - 49x + 49x +
      checkmate::assert_number(counttotal, lower = countmax)
    @@ -47606,35 +49370,40 @@

    teal.slice coverage - 65.92%

    125 - 47x + 47x +
      label <- make_count_text(label, countmax = countmax, countnow = countnow)
    126 - 47x + 47x +
      ns <- NS(inputId)
    127 - 24x + 24x +
      if (is.null(countnow)) countnow <- 0
    128 - 47x + 47x +
      tags$div(
    129 - 47x + 47x +
        class = "progress state-count-container",
    @@ -47648,42 +49417,48 @@

    teal.slice coverage - 65.92%

    131 - 47x + 47x +
        tags$div(
    132 - 47x + 47x +
          id = ns("count_bar_filtered"),
    133 - 47x + 47x +
          class = "progress-bar state-count-bar-filtered",
    134 - 47x + 47x +
          style = sprintf("width: %s%%", countnow / counttotal * 100),
    135 - 47x + 47x +
          role = "progressbar",
    136 - 47x + 47x +
          label
    @@ -47697,35 +49472,40 @@

    teal.slice coverage - 65.92%

    138 - 47x + 47x +
        tags$div(
    139 - 47x + 47x +
          id = ns("count_bar_unfiltered"),
    140 - 47x + 47x +
          class = "progress-bar state-count-bar-unfiltered",
    141 - 47x + 47x +
          style = sprintf("width: %s%%", (countmax - countnow) / counttotal * 100),
    142 - 47x + 47x +
          role = "progressbar"
    @@ -47774,28 +49554,32 @@

    teal.slice coverage - 65.92%

    149 - 7x + 7x +
      checkmate::assert_string(inputId)
    150 - 7x + 7x +
      checkmate::assert_vector(choices)
    151 - 7x + 7x +
      checkmate::assert_numeric(countsmax, len = length(choices))
    152 - 7x + 7x +
      checkmate::assert_numeric(countsnow, len = length(choices), null.ok = TRUE)
    @@ -47809,63 +49593,72 @@

    teal.slice coverage - 65.92%

    154 - 7x + 7x +
      ns <- NS(inputId)
    155 - 7x + 7x +
      mapply(
    156 - 7x + 7x +
        updateCountBar,
    157 - 7x + 7x +
        inputId = ns(seq_along(choices)),
    158 - 7x + 7x +
        label = choices,
    159 - 7x + 7x +
        countmax = countsmax,
    160 - 7x + 7x +
        countnow = if (is.null(countsnow)) rep(list(NULL), length(choices)) else countsnow,
    161 - 7x + 7x +
        MoreArgs = list(
    162 - 7x + 7x +
          counttotal = sum(countsmax)
    @@ -47886,7 +49679,8 @@

    teal.slice coverage - 65.92%

    165 - 6x + 6x +
      invisible(NULL)
    @@ -47921,35 +49715,40 @@

    teal.slice coverage - 65.92%

    170 - 17x + 17x +
      checkmate::assert_string(inputId)
    171 - 17x + 17x +
      checkmate::assert_string(label)
    172 - 17x + 17x +
      checkmate::assert_number(countmax)
    173 - 16x + 16x +
      checkmate::assert_number(countnow, null.ok = TRUE)
    174 - 16x + 16x +
      checkmate::assert_number(counttotal)
    @@ -47963,70 +49762,80 @@

    teal.slice coverage - 65.92%

    176 - 16x + 16x +
      label <- make_count_text(label, countmax = countmax, countnow = countnow)
    177 - 16x + 16x +
      if (is.null(countnow)) countnow <- countmax
    178 - 16x + 16x +
      session$sendCustomMessage(
    179 - 16x + 16x +
        type = "updateCountBar",
    180 - 16x + 16x +
        message = list(
    181 - 16x + 16x +
          id = session$ns(inputId),
    182 - 16x + 16x +
          label = label,
    183 - 16x + 16x +
          countmax = countmax,
    184 - 16x + 16x +
          countnow = countnow,
    185 - 16x + 16x +
          counttotal = counttotal
    @@ -48054,7 +49863,8 @@

    teal.slice coverage - 65.92%

    189 - 16x + 16x +
      invisible(NULL)
    @@ -48089,70 +49899,80 @@

    teal.slice coverage - 65.92%

    194 - 17x + 17x +
      checkmate::assert_string(inputId)
    195 - 17x + 17x +
      checkmate::assert_string(label)
    196 - 17x + 17x +
      checkmate::assert_number(countmax)
    197 - 17x + 17x +
      checkmate::assert_number(countnow, null.ok = TRUE)
    198 - 17x + 17x +
      label <- make_count_text(label, countmax = countmax, countnow = countnow)
    199 - 17x + 17x +
      session$sendCustomMessage(
    200 - 17x + 17x +
        type = "updateCountText",
    201 - 17x + 17x +
        message = list(
    202 - 17x + 17x +
          id = session$ns(inputId),
    203 - 17x + 17x +
          label = label
    @@ -48292,56 +50112,64 @@

    teal.slice coverage - 65.92%

    223 - 92x + 92x +
      checkmate::assert_string(label)
    224 - 90x + 90x +
      checkmate::assert_number(countmax)
    225 - 88x + 88x +
      checkmate::assert_number(countnow, null.ok = TRUE)
    226 - 86x + 86x +
      sprintf(
    227 - 86x + 86x +
        "%s (%s%s)",
    228 - 86x + 86x +
        label,
    229 - 86x + 86x +
        if (is.null(countnow)) "" else sprintf("%s/", countnow),
    230 - 86x + 86x +
        countmax
    @@ -48648,7 +50476,8 @@

    teal.slice coverage - 65.92%

    41 - 24x + 24x +
          super$initialize(dataset = dataset, dataname = dataname, label = label)
    @@ -48732,35 +50561,40 @@

    teal.slice coverage - 65.92%

    53 - 4x + 4x +
          class_string <- toString(class(private$dataset))
    54 - 4x + 4x +
          if (trim_lines) {
    55 - 2x + 2x +
            trim_position <- 37L
    56 - 2x + 2x +
            class_string <- strtrim(class_string, trim_position)
    57 - 2x + 2x +
            substr(class_string, 35L, 37L) <- "..."
    @@ -48774,7 +50608,8 @@

    teal.slice coverage - 65.92%

    59 - 4x + 4x +
          sprintf(" - unfiltered dataset:\t\"%s\":   %s", private$dataname, class_string)
    @@ -48816,7 +50651,8 @@

    teal.slice coverage - 65.92%

    65 - 1x + 1x +
          invisible(NULL)
    @@ -48844,7 +50680,8 @@

    teal.slice coverage - 65.92%

    69 - 2x + 2x +
          invisible(NULL)
    @@ -48879,14 +50716,16 @@

    teal.slice coverage - 65.92%

    74 - 3x + 3x +
          if (length(state) != 0L) {
    75 - 1x + 1x +
            warning("DefaultFilterState cannot set state")
    @@ -48900,7 +50739,8 @@

    teal.slice coverage - 65.92%

    77 - 3x + 3x +
          invisible(NULL)
    @@ -48935,7 +50775,8 @@

    teal.slice coverage - 65.92%

    82 - 1x + 1x +
          invisible(NULL)
    @@ -48991,7 +50832,8 @@

    teal.slice coverage - 65.92%

    90 - 1x + 1x +
          data.frame(dataname = private$dataname, obs = NA, obs_filtered = NA)
    @@ -49676,7 +51518,8 @@

    teal.slice coverage - 65.92%

    64 - 229x + 229x +
      UseMethod("init_filter_states")
    @@ -49753,42 +51596,48 @@

    teal.slice coverage - 65.92%

    75 - 100x + 100x +
      DFFilterStates$new(
    76 - 100x + 100x +
        data = data,
    77 - 100x + 100x +
        data_reactive = data_reactive,
    78 - 100x + 100x +
        dataname = dataname,
    79 - 100x + 100x +
        datalabel = datalabel,
    80 - 100x + 100x +
        keys = keys
    @@ -49865,35 +51714,40 @@

    teal.slice coverage - 65.92%

    91 - 22x + 22x +
      MatrixFilterStates$new(
    92 - 22x + 22x +
        data = data,
    93 - 22x + 22x +
        data_reactive = data_reactive,
    94 - 22x + 22x +
        dataname = dataname,
    95 - 22x + 22x +
        datalabel = datalabel
    @@ -49977,7 +51831,8 @@

    teal.slice coverage - 65.92%

    107 - 22x + 22x +
      if (!requireNamespace("MultiAssayExperiment", quietly = TRUE)) {
    @@ -49998,42 +51853,48 @@

    teal.slice coverage - 65.92%

    110 - 22x + 22x +
      MAEFilterStates$new(
    111 - 22x + 22x +
        data = data,
    112 - 22x + 22x +
        data_reactive = data_reactive,
    113 - 22x + 22x +
        dataname = dataname,
    114 - 22x + 22x +
        datalabel = datalabel,
    115 - 22x + 22x +
        keys = keys
    @@ -50110,7 +51971,8 @@

    teal.slice coverage - 65.92%

    126 - 85x + 85x +
      if (!requireNamespace("SummarizedExperiment", quietly = TRUE)) {
    @@ -50131,35 +51993,40 @@

    teal.slice coverage - 65.92%

    129 - 85x + 85x +
      SEFilterStates$new(
    130 - 85x + 85x +
        data = data,
    131 - 85x + 85x +
        data_reactive = data_reactive,
    132 - 85x + 85x +
        dataname = dataname,
    133 - 85x + 85x +
        datalabel = datalabel
    @@ -50341,7 +52208,8 @@

    teal.slice coverage - 65.92%

    159 - 227x + 227x +
      UseMethod("get_supported_filter_varnames")
    @@ -50383,28 +52251,32 @@

    teal.slice coverage - 65.92%

    165 - 198x + 198x +
      is_expected_class <- vapply(
    166 - 198x + 198x +
        X = data,
    167 - 198x + 198x +
        FUN = function(x) any(class(x) %in% .filterable_class),
    168 - 198x + 198x +
        FUN.VALUE = logical(1)
    @@ -50418,7 +52290,8 @@

    teal.slice coverage - 65.92%

    170 - 198x + 198x +
      names(is_expected_class[is_expected_class])
    @@ -50467,21 +52340,24 @@

    teal.slice coverage - 65.92%

    177 - 29x + 29x +
      is_expected_class <- class(data[, 1]) %in% .filterable_class
    178 - 29x + 29x +
      if (is_expected_class && !is.null(colnames(data))) {
    179 - 26x + 26x +
        colnames(data)
    @@ -50495,7 +52371,8 @@

    teal.slice coverage - 65.92%

    181 - 3x + 3x +
        character(0)
    @@ -50733,7 +52610,8 @@

    teal.slice coverage - 65.92%

    215 - 9x + 9x +
      if (length(choices) == 0) {
    @@ -50754,14 +52632,16 @@

    teal.slice coverage - 65.92%

    218 - 9x + 9x +
      choice_types <- variable_types(data = data, columns = choices)
    219 - 9x + 9x +
      choice_types[keys] <- "primary_key"
    @@ -50775,28 +52655,32 @@

    teal.slice coverage - 65.92%

    221 - 9x + 9x +
      choices_labeled(
    222 - 9x + 9x +
        choices = choices,
    223 - 9x + 9x +
        labels = unname(varlabels[choices]),
    224 - 9x + 9x +
        types = choice_types[choices]
    @@ -50845,49 +52729,56 @@

    teal.slice coverage - 65.92%

    231 - 9x + 9x +
      if (!is.array(data)) {
    232 - 9x + 9x +
        vapply(
    233 - 9x + 9x +
          colnames(data),
    234 - 9x + 9x +
          FUN = function(x) {
    235 - 42x + 42x +
            label <- attr(data[[x]], "label")
    236 - 42x + 42x +
            if (is.null(label)) {
    237 - 40x + 40x +
              x
    @@ -50901,7 +52792,8 @@

    teal.slice coverage - 65.92%

    239 - 2x + 2x +
              label
    @@ -50922,7 +52814,8 @@

    teal.slice coverage - 65.92%

    242 - 9x + 9x +
          FUN.VALUE = character(1)
    @@ -51131,7 +53024,8 @@

    teal.slice coverage - 65.92%

    24 - 9x + 9x +
      if (is.factor(choices)) {
    @@ -51159,35 +53053,40 @@

    teal.slice coverage - 65.92%

    28 - 9x + 9x +
      stopifnot(
    29 - 9x + 9x +
        is.character(choices) ||
    30 - 9x + 9x +
          is.numeric(choices) ||
    31 - 9x + 9x +
          is.logical(choices) ||
    32 - 9x + 9x +
          (length(choices) == 1 && is.na(choices))
    @@ -51208,7 +53107,8 @@

    teal.slice coverage - 65.92%

    35 - 9x + 9x +
      if (is.factor(labels)) {
    @@ -51236,14 +53136,16 @@

    teal.slice coverage - 65.92%

    39 - 9x + 9x +
      checkmate::assert_character(labels[!is.na(labels)], any.missing = FALSE)
    40 - 9x + 9x +
      if (length(choices) != length(labels)) {
    @@ -51264,14 +53166,16 @@

    teal.slice coverage - 65.92%

    43 - 9x + 9x +
      stopifnot(is.null(subset) || is.vector(subset))
    44 - 9x + 9x +
      stopifnot(is.null(types) || is.vector(types))
    @@ -51285,14 +53189,16 @@

    teal.slice coverage - 65.92%

    46 - 9x + 9x +
      if (is.vector(types)) {
    47 - 9x + 9x +
        stopifnot(length(choices) == length(types))
    @@ -51313,7 +53219,8 @@

    teal.slice coverage - 65.92%

    50 - 9x + 9x +
      if (!is.null(subset)) {
    @@ -51376,56 +53283,64 @@

    teal.slice coverage - 65.92%

    59 - 9x + 9x +
      is_dupl <- duplicated(choices)
    60 - 9x + 9x +
      choices <- choices[!is_dupl]
    61 - 9x + 9x +
      labels <- labels[!is_dupl]
    62 - 9x + 9x +
      types <- types[!is_dupl]
    63 - 9x + 9x +
      labels[is.na(labels)] <- "Label Missing"
    64 - 9x + 9x +
      raw_labels <- labels
    65 - 9x + 9x +
      combined_labels <- if (length(choices) > 0) {
    66 - 9x + 9x +
        paste0(choices, ": ", labels)
    @@ -51460,7 +53375,8 @@

    teal.slice coverage - 65.92%

    71 - 9x + 9x +
      if (!is.null(subset)) {
    @@ -51509,49 +53425,56 @@

    teal.slice coverage - 65.92%

    78 - 9x + 9x +
      choices <- structure(
    79 - 9x + 9x +
        choices,
    80 - 9x + 9x +
        names = combined_labels,
    81 - 9x + 9x +
        raw_labels = raw_labels,
    82 - 9x + 9x +
        combined_labels = combined_labels,
    83 - 9x + 9x +
        class = c("choices_labeled", "character"),
    84 - 9x + 9x +
        types = types
    @@ -51572,7 +53495,8 @@

    teal.slice coverage - 65.92%

    87 - 9x + 9x +
      choices
    @@ -52600,21 +54524,24 @@

    teal.slice coverage - 65.92%

    145 - 24x + 24x +
          isolate({
    146 - 24x + 24x +
            checkmate::assert_date(x)
    147 - 23x + 23x +
            checkmate::assert_class(x_reactive, "reactive")
    @@ -52628,35 +54555,40 @@

    teal.slice coverage - 65.92%

    149 - 23x + 23x +
            super$initialize(
    150 - 23x + 23x +
              x = x,
    151 - 23x + 23x +
              x_reactive = x_reactive,
    152 - 23x + 23x +
              slice = slice,
    153 - 23x + 23x +
              extract_type = extract_type
    @@ -52670,28 +54602,32 @@

    teal.slice coverage - 65.92%

    155 - 23x + 23x +
            checkmate::assert_date(slice$choices, null.ok = TRUE)
    156 - 22x + 22x +
            private$set_choices(slice$choices)
    157 - 14x + 14x +
            if (is.null(slice$selected)) slice$selected <- slice$choices
    158 - 22x + 22x +
            private$set_selected(slice$selected)
    @@ -52712,7 +54648,8 @@

    teal.slice coverage - 65.92%

    161 - 21x + 21x +
          invisible(self)
    @@ -52789,14 +54726,16 @@

    teal.slice coverage - 65.92%

    172 - 7x + 7x +
          if (isFALSE(private$is_any_filtered())) {
    173 - 1x + 1x +
            return(NULL)
    @@ -52810,28 +54749,32 @@

    teal.slice coverage - 65.92%

    175 - 6x + 6x +
          choices <- as.character(private$get_selected())
    176 - 6x + 6x +
          varname <- private$get_varname_prefixed(dataname)
    177 - 6x + 6x +
          filter_call <-
    178 - 6x + 6x +
            call(
    @@ -52845,14 +54788,16 @@

    teal.slice coverage - 65.92%

    180 - 6x + 6x +
              call(">=", varname, call("as.Date", choices[1L])),
    181 - 6x + 6x +
              call("<=", varname, call("as.Date", choices[2L]))
    @@ -52866,7 +54811,8 @@

    teal.slice coverage - 65.92%

    183 - 6x + 6x +
          private$add_keep_na_call(filter_call, varname)
    @@ -52922,14 +54868,16 @@

    teal.slice coverage - 65.92%

    191 - 22x + 22x +
          if (is.null(choices)) {
    192 - 19x + 19x +
            choices <- range(private$x, na.rm = TRUE)
    @@ -52943,21 +54891,24 @@

    teal.slice coverage - 65.92%

    194 - 3x + 3x +
            choices_adjusted <- c(
    195 - 3x + 3x +
              max(choices[1L], min(private$x, na.rm = TRUE)),
    196 - 3x + 3x +
              min(choices[2L], max(private$x, na.rm = TRUE))
    @@ -52971,28 +54922,32 @@

    teal.slice coverage - 65.92%

    198 - 3x + 3x +
            if (any(choices != choices_adjusted)) {
    199 - 1x + 1x +
              warning(sprintf(
    200 - 1x + 1x +
                "Choices adjusted (some values outside of variable range). Varname: %s, dataname: %s.",
    201 - 1x + 1x +
                private$get_varname(), private$get_dataname()
    @@ -53006,7 +54961,8 @@

    teal.slice coverage - 65.92%

    203 - 1x + 1x +
              choices <- choices_adjusted
    @@ -53020,35 +54976,40 @@

    teal.slice coverage - 65.92%

    205 - 3x + 3x +
            if (choices[1L] >= choices[2L]) {
    206 - 1x + 1x +
              warning(sprintf(
    207 - 1x + 1x +
                "Invalid choices: lower is higher / equal to upper, or not in range of variable values.
    208 - 1x + 1x +
                Setting defaults. Varname: %s, dataname: %s.",
    209 - 1x + 1x +
                private$get_varname(), private$get_dataname()
    @@ -53062,7 +55023,8 @@

    teal.slice coverage - 65.92%

    211 - 1x + 1x +
              choices <- range(private$x, na.rm = TRUE)
    @@ -53083,28 +55045,32 @@

    teal.slice coverage - 65.92%

    214 - 22x + 22x +
          private$set_is_choice_limited(private$x, choices)
    215 - 22x + 22x +
          private$x <- private$x[(private$x >= choices[1L] & private$x <= choices[2L]) | is.na(private$x)]
    216 - 22x + 22x +
          private$teal_slice$choices <- choices
    217 - 22x + 22x +
          invisible(NULL)
    @@ -53146,14 +55112,16 @@

    teal.slice coverage - 65.92%

    223 - 22x + 22x +
          private$is_choice_limited <- (any(xl < choices[1L], na.rm = TRUE) | any(xl > choices[2L], na.rm = TRUE))
    224 - 22x + 22x +
          invisible(NULL)
    @@ -53174,21 +55142,24 @@

    teal.slice coverage - 65.92%

    227 - 33x + 33x +
          tryCatch(
    228 - 33x + 33x +
            expr = {
    229 - 33x + 33x +
              values <- as.Date(values, origin = "1970-01-01")
    @@ -53202,7 +55173,8 @@

    teal.slice coverage - 65.92%

    231 - 30x + 30x +
              values
    @@ -53216,7 +55188,8 @@

    teal.slice coverage - 65.92%

    233 - 33x + 33x +
            error = function(e) stop("Vector of set values must contain values coercible to Date.")
    @@ -53244,42 +55217,48 @@

    teal.slice coverage - 65.92%

    237 - 1x + 1x +
          if (length(values) != 2) stop("Vector of set values must have length two.")
    238 - 29x + 29x +
          if (values[1] > values[2]) {
    239 - 1x + 1x +
            warning(
    240 - 1x + 1x +
              sprintf(
    241 - 1x + 1x +
                "Start date %s is set after the end date %s, the values will be replaced with a default date range.",
    242 - 1x + 1x +
                values[1], values[2]
    @@ -53300,7 +55279,8 @@

    teal.slice coverage - 65.92%

    245 - 1x + 1x +
            values <- isolate(private$get_choices())
    @@ -53314,7 +55294,8 @@

    teal.slice coverage - 65.92%

    247 - 29x + 29x +
          values
    @@ -53335,42 +55316,48 @@

    teal.slice coverage - 65.92%

    250 - 29x + 29x +
          choices <- private$get_choices()
    251 - 29x + 29x +
          if (values[1] < choices[1L] | values[1] > choices[2L]) {
    252 - 5x + 5x +
            warning(
    253 - 5x + 5x +
              sprintf(
    254 - 5x + 5x +
                "Value: %s is outside of the possible range for column %s of dataset %s, setting minimum possible value.",
    255 - 5x + 5x +
                values[1], private$get_varname(), private$get_dataname()
    @@ -53391,7 +55378,8 @@

    teal.slice coverage - 65.92%

    258 - 5x + 5x +
            values[1] <- choices[1L]
    @@ -53412,35 +55400,40 @@

    teal.slice coverage - 65.92%

    261 - 29x + 29x +
          if (values[2] > choices[2L] | values[2] < choices[1L]) {
    262 - 5x + 5x +
            warning(
    263 - 5x + 5x +
              sprintf(
    264 - 5x + 5x +
                "Value: %s is outside of the possible range for column %s of dataset %s, setting maximum possible value.",
    265 - 5x + 5x +
                values[2], private$get_varname(), private$get_dataname()
    @@ -53461,7 +55454,8 @@

    teal.slice coverage - 65.92%

    268 - 5x + 5x +
            values[2] <- choices[2L]
    @@ -53482,7 +55476,8 @@

    teal.slice coverage - 65.92%

    271 - 29x + 29x +
          values
    @@ -55595,28 +57590,32 @@

    teal.slice coverage - 65.92%

    130 - 16x + 16x +
          isolate({
    131 - 16x + 16x +
            checkmate::assert_logical(x)
    132 - 15x + 15x +
            checkmate::assert_logical(slice$selected, null.ok = TRUE)
    133 - 14x + 14x +
            super$initialize(x = x, x_reactive = x_reactive, slice = slice, extract_type = extract_type)
    @@ -55630,7 +57629,8 @@

    teal.slice coverage - 65.92%

    135 - 14x + 14x +
            private$set_choices(slice$choices)
    @@ -55644,28 +57644,32 @@

    teal.slice coverage - 65.92%

    137 - 14x + 14x +
            if (is.null(slice$selected) && slice$multiple) {
    138 - 7x + 7x +
              slice$selected <- private$get_choices()
    139 - 7x + 7x +
            } else if (length(slice$selected) != 1 && !slice$multiple) {
    140 - 3x + 3x +
              slice$selected <- TRUE
    @@ -55679,28 +57683,32 @@

    teal.slice coverage - 65.92%

    142 - 14x + 14x +
            private$set_selected(slice$selected)
    143 - 14x + 14x +
            df <- factor(x, levels = c(TRUE, FALSE))
    144 - 14x + 14x +
            tbl <- table(df)
    145 - 14x + 14x +
            private$set_choices_counts(tbl)
    @@ -55714,7 +57722,8 @@

    teal.slice coverage - 65.92%

    147 - 14x + 14x +
          invisible(self)
    @@ -55784,7 +57793,8 @@

    teal.slice coverage - 65.92%

    157 - 6x + 6x +
          if (isFALSE(private$is_any_filtered())) {
    @@ -55805,28 +57815,32 @@

    teal.slice coverage - 65.92%

    160 - 4x + 4x +
          if (missing(dataname)) dataname <- private$get_dataname()
    161 - 6x + 6x +
          varname <- private$get_varname_prefixed(dataname)
    162 - 6x + 6x +
          choices <- private$get_selected()
    163 - 6x + 6x +
          n_choices <- length(choices)
    @@ -55840,35 +57854,40 @@

    teal.slice coverage - 65.92%

    165 - 6x + 6x +
          filter_call <-
    166 - 6x + 6x +
            if (n_choices == 1 && choices) {
    167 - 1x + 1x +
              varname
    168 - 6x + 6x +
            } else if (n_choices == 1 && !choices) {
    169 - 4x + 4x +
              call("!", varname)
    @@ -55882,7 +57901,8 @@

    teal.slice coverage - 65.92%

    171 - 1x + 1x +
              call("%in%", varname, make_c_call(choices))
    @@ -55896,7 +57916,8 @@

    teal.slice coverage - 65.92%

    173 - 6x + 6x +
          private$add_keep_na_call(filter_call, varname)
    @@ -55966,14 +57987,16 @@

    teal.slice coverage - 65.92%

    183 - 14x + 14x +
          private$teal_slice$choices <- c(TRUE, FALSE)
    184 - 14x + 14x +
          invisible(NULL)
    @@ -56008,14 +58031,16 @@

    teal.slice coverage - 65.92%

    189 - 14x + 14x +
          private$choices_counts <- choices_counts
    190 - 14x + 14x +
          invisible(NULL)
    @@ -56036,35 +58061,40 @@

    teal.slice coverage - 65.92%

    193 - 21x + 21x +
          tryCatch(
    194 - 21x + 21x +
            expr = {
    195 - 21x + 21x +
              values <- as.logical(values)
    196 - 1x + 1x +
              if (anyNA(values)) stop()
    197 - 20x + 20x +
              values
    @@ -56078,7 +58108,8 @@

    teal.slice coverage - 65.92%

    199 - 21x + 21x +
            error = function(e) stop("Vector of set values must contain values coercible to logical.")
    @@ -56113,28 +58144,32 @@

    teal.slice coverage - 65.92%

    204 - 20x + 20x +
          if (!private$is_multiple() && length(values) > 1) {
    205 - 1x + 1x +
            warning(
    206 - 1x + 1x +
              sprintf("Selection: %s is not a vector of length one. ", toString(values, width = 360)),
    207 - 1x + 1x +
              "Maintaining previous selection."
    @@ -56148,7 +58183,8 @@

    teal.slice coverage - 65.92%

    209 - 1x + 1x +
            values <- isolate(private$get_selected())
    @@ -56162,7 +58198,8 @@

    teal.slice coverage - 65.92%

    211 - 20x + 20x +
          values
    @@ -56204,7 +58241,8 @@

    teal.slice coverage - 65.92%

    217 - 6x + 6x +
          if (private$is_choice_limited) {
    @@ -56218,14 +58256,16 @@

    teal.slice coverage - 65.92%

    219 - 6x + 6x +
          } else if (all(private$choices_counts > 0)) {
    220 - 6x + 6x +
            TRUE
    @@ -58219,49 +60259,56 @@

    teal.slice coverage - 65.92%

    95 - 764x + 764x +
      slices <- list(...)
    96 - 764x + 764x +
      checkmate::assert_list(slices, types = "teal_slice", any.missing = FALSE)
    97 - 763x + 763x +
      slices_id <- isolate(vapply(slices, `[[`, character(1L), "id"))
    98 - 763x + 763x +
      if (any(duplicated(slices_id))) {
    99 - 1x + 1x +
        stop(
    100 - 1x + 1x +
          "Some teal_slice objects have the same id:\n",
    101 - 1x + 1x +
          toString(unique(slices_id[duplicated(slices_id)]))
    @@ -58282,35 +60329,40 @@

    teal.slice coverage - 65.92%

    104 - 762x + 762x +
      checkmate::assert_list(exclude_varnames, names = "named", types = "character", null.ok = TRUE, min.len = 1)
    105 - 761x + 761x +
      checkmate::assert_list(include_varnames, names = "named", types = "character", null.ok = TRUE, min.len = 1)
    106 - 760x + 760x +
      checkmate::assert_character(count_type, len = 1, null.ok = TRUE)
    107 - 758x + 758x +
      checkmate::assert_subset(count_type, choices = c("all", "none"), empty.ok = TRUE)
    108 - 757x + 757x +
      checkmate::assert_logical(allow_add)
    @@ -58324,35 +60376,40 @@

    teal.slice coverage - 65.92%

    110 - 756x + 756x +
      duplicated_datasets <- intersect(names(include_varnames), names(exclude_varnames))
    111 - 756x + 756x +
      if (length(duplicated_datasets)) {
    112 - 1x + 1x +
        stop(
    113 - 1x + 1x +
          "Some datasets are specified in both, include_varnames and exclude_varnames:\n",
    114 - 1x + 1x +
          toString(duplicated_datasets)
    @@ -58380,49 +60437,56 @@

    teal.slice coverage - 65.92%

    118 - 755x + 755x +
      structure(
    119 - 755x + 755x +
        slices,
    120 - 755x + 755x +
        exclude_varnames = exclude_varnames,
    121 - 755x + 755x +
        include_varnames = include_varnames,
    122 - 755x + 755x +
        count_type = count_type,
    123 - 755x + 755x +
        allow_add = allow_add,
    124 - 755x + 755x +
        class = c("teal_slices", class(slices))
    @@ -58555,7 +60619,8 @@

    teal.slice coverage - 65.92%

    143 - 465x + 465x +
      inherits(x, "teal_slices")
    @@ -58695,21 +60760,24 @@

    teal.slice coverage - 65.92%

    163 - 1077x + 1077x +
      ans <- unclass(x)
    164 - 45x + 45x +
      if (recursive) ans[] <- lapply(ans, as.list)
    165 - 1077x + 1077x +
      ans
    @@ -58765,21 +60833,24 @@

    teal.slice coverage - 65.92%

    173 - 3x + 3x +
      if (missing(i)) i <- seq_along(x)
    174 - 506x + 506x +
      if (length(i) == 0L) {
    175 - 178x + 178x +
        return(x[0])
    @@ -58793,35 +60864,40 @@

    teal.slice coverage - 65.92%

    177 - 1x + 1x +
      if (is.logical(i) && length(i) > length(x)) stop("subscript out of bounds")
    178 - 1x + 1x +
      if (is.numeric(i) && max(i) > length(x)) stop("subscript out of bounds")
    179 - 326x + 326x +
      if (is.character(i)) {
    180 - 1x + 1x +
        if (!all(is.element(i, names(x)))) stop("subscript out of bounds")
    181 - 2x + 2x +
        i <- which(is.element(i, names(x)))
    @@ -58842,35 +60918,40 @@

    teal.slice coverage - 65.92%

    184 - 325x + 325x +
      y <- NextMethod("[")
    185 - 325x + 325x +
      attrs <- attributes(x)
    186 - 325x + 325x +
      attrs$names <- attrs$names[i]
    187 - 325x + 325x +
      attributes(y) <- attrs
    188 - 325x + 325x +
      y
    @@ -58926,14 +61007,16 @@

    teal.slice coverage - 65.92%

    196 - 252x + 252x +
      x <- list(...)
    197 - 252x + 252x +
      checkmate::assert_true(all(vapply(x, is.teal_slices, logical(1L))), .var.name = "all arguments are teal_slices")
    @@ -58947,21 +61030,24 @@

    teal.slice coverage - 65.92%

    199 - 251x + 251x +
      all_attributes <- lapply(x, attributes)
    200 - 251x + 251x +
      all_attributes <- coalesce_r(all_attributes)
    201 - 251x + 251x +
      all_attributes <- all_attributes[names(all_attributes) != "class"]
    @@ -58975,35 +61061,40 @@

    teal.slice coverage - 65.92%

    203 - 251x + 251x +
      do.call(
    204 - 251x + 251x +
        teal_slices,
    205 - 251x + 251x +
        c(
    206 - 251x + 251x +
          unique(unlist(x, recursive = FALSE)),
    207 - 251x + 251x +
          all_attributes
    @@ -59087,14 +61178,16 @@

    teal.slice coverage - 65.92%

    219 - 45x + 45x +
      checkmate::assert_flag(show_all)
    220 - 45x + 45x +
      checkmate::assert_flag(trim_lines)
    @@ -59108,35 +61201,40 @@

    teal.slice coverage - 65.92%

    222 - 45x + 45x +
      x <- as.list(x, recursive = TRUE)
    223 - 45x + 45x +
      attrs <- attributes(x)
    224 - 45x + 45x +
      attributes(x) <- NULL
    225 - 45x + 45x +
      slices_list <- list(slices = x, attributes = attrs)
    226 - 45x + 45x +
      slices_list <- Filter(Negate(is.null), slices_list) # drop attributes if empty
    @@ -59150,7 +61248,8 @@

    teal.slice coverage - 65.92%

    228 - 20x + 20x +
      if (!show_all) slices_list$slices <- lapply(slices_list$slices, function(slice) Filter(Negate(is.null), slice))
    @@ -59164,7 +61263,8 @@

    teal.slice coverage - 65.92%

    230 - 45x + 45x +
      jsonify(slices_list, trim_lines)
    @@ -59213,7 +61313,8 @@

    teal.slice coverage - 65.92%

    237 - 2x + 2x +
      cat(format(x, ...), "\n")
    @@ -59297,21 +61398,24 @@

    teal.slice coverage - 65.92%

    249 - 14x + 14x +
      Filter(
    250 - 14x + 14x +
        function(xx) {
    251 - 12x + 12x +
          !any(vapply(y, function(yy) identical(yy, xx), logical(1)))
    @@ -59325,7 +61429,8 @@

    teal.slice coverage - 65.92%

    253 - 14x + 14x +
        x
    @@ -59472,28 +61577,32 @@

    teal.slice coverage - 65.92%

    274 - 1569x + 1569x +
      checkmate::assert_list(x)
    275 - 1568x + 1568x +
      xnn <- Filter(Negate(is.null), x)
    276 - 1568x + 1568x +
      if (all(vapply(xnn, is.atomic, logical(1L)))) {
    277 - 1059x + 1059x +
        return(xnn[[1L]])
    @@ -59507,21 +61616,24 @@

    teal.slice coverage - 65.92%

    279 - 509x + 509x +
      lapply(x, checkmate::assert_list, names = "named", null.ok = TRUE, .var.name = "list element")
    280 - 508x + 508x +
      all_names <- unique(unlist(lapply(x, names)))
    281 - 508x + 508x +
      sapply(all_names, function(nm) coalesce_r(lapply(x, `[[`, nm)), simplify = FALSE)
    @@ -59660,21 +61772,24 @@

    teal.slice coverage - 65.92%

    18 - 7x + 7x +
      checkmate::assert_list(x, any.missing = FALSE, names = "unique")
    19 - 6x + 6x +
      checkmate::assert_class(join_keys, "join_keys")
    20 - 5x + 5x +
      if (!missing(code)) {
    @@ -59716,7 +61831,8 @@

    teal.slice coverage - 65.92%

    26 - 5x + 5x +
      if (!missing(check)) {
    @@ -59758,7 +61874,8 @@

    teal.slice coverage - 65.92%

    32 - 5x + 5x +
      FilteredData$new(x, join_keys = join_keys)
    @@ -59856,42 +61973,48 @@

    teal.slice coverage - 65.92%

    46 - 32x + 32x +
      lapply(
    47 - 32x + 32x +
        expr,
    48 - 32x + 32x +
        function(x) {
    49 - 19x + 19x +
          tryCatch(
    50 - 19x + 19x +
            eval(x, envir = env),
    51 - 19x + 19x +
            error = function(e) {
    @@ -59968,7 +62091,8 @@

    teal.slice coverage - 65.92%

    62 - 32x + 32x +
      invisible(NULL)
    @@ -60528,21 +62652,24 @@

    teal.slice coverage - 65.92%

    142 - 3x + 3x +
      checkmate::assert_string(input_id)
    143 - 3x + 3x +
      checkmate::assert_character(icons, len = 2L)
    144 - 3x + 3x +
      checkmate::assert_flag(one_way)
    @@ -60556,35 +62683,40 @@

    teal.slice coverage - 65.92%

    146 - 3x + 3x +
      expr <-
    147 - 3x + 3x +
        if (one_way) {
    148 - 3x + 3x +
          sprintf(
    149 - 3x + 3x +
            "$('#%s i').removeClass('%s').addClass('%s');",
    150 - 3x + 3x +
            input_id, icons[1], icons[2]
    @@ -60626,7 +62758,8 @@

    teal.slice coverage - 65.92%

    156 - 3x + 3x +
      shinyjs::runjs(expr)
    @@ -60640,7 +62773,8 @@

    teal.slice coverage - 65.92%

    158 - 3x + 3x +
      invisible(NULL)
    @@ -60682,21 +62816,24 @@

    teal.slice coverage - 65.92%

    164 - 3x + 3x +
      checkmate::assert_string(input_id)
    165 - 3x + 3x +
      checkmate::assert_character(titles, len = 2L)
    166 - 3x + 3x +
      checkmate::assert_flag(one_way)
    @@ -60710,35 +62847,40 @@

    teal.slice coverage - 65.92%

    168 - 3x + 3x +
      expr <-
    169 - 3x + 3x +
        if (one_way) {
    170 - 3x + 3x +
          sprintf(
    171 - 3x + 3x +
            "$('a#%s').attr('title', '%s');",
    172 - 3x + 3x +
            input_id, titles[2]
    @@ -60843,7 +62985,8 @@

    teal.slice coverage - 65.92%

    187 - 3x + 3x +
      shinyjs::runjs(expr)
    @@ -60857,7 +63000,8 @@

    teal.slice coverage - 65.92%

    189 - 3x + 3x +
      invisible(NULL)
    @@ -60948,7 +63092,8 @@

    teal.slice coverage - 65.92%

    202 - 66x + 66x +
      utils::getFromNamespace("topological_sort", ns = "teal.data")(graph)
    @@ -61493,21 +63638,24 @@

    teal.slice coverage - 65.92%

    76 - 15x + 15x +
          checkmate::assert_class(slice, "teal_slice_expr")
    77 - 14x + 14x +
          private$teal_slice <- slice
    78 - 14x + 14x +
          invisible(self)
    @@ -61591,28 +63739,32 @@

    teal.slice coverage - 65.92%

    90 - 12x + 12x +
          sprintf(
    91 - 12x + 12x +
            "%s:\n%s",
    92 - 12x + 12x +
            class(self)[1],
    93 - 12x + 12x +
            format(self$get_state(), show_all = show_all, trim_lines = trim_lines)
    @@ -61682,7 +63834,8 @@

    teal.slice coverage - 65.92%

    103 - 1x + 1x +
          cat(isolate(self$format(...)))
    @@ -61745,7 +63898,8 @@

    teal.slice coverage - 65.92%

    112 - 26x + 26x +
          private$teal_slice
    @@ -61822,14 +63976,16 @@

    teal.slice coverage - 65.92%

    123 - 1x + 1x +
          checkmate::assert_class(state, "teal_slice_expr")
    124 - 1x + 1x +
          invisible(self)
    @@ -61941,7 +64097,8 @@

    teal.slice coverage - 65.92%

    140 - 2x + 2x +
          isolate(str2lang(private$teal_slice$expr))
    @@ -63102,21 +65259,24 @@

    teal.slice coverage - 65.92%

    30 - 47x + 47x +
      checkmate::assert_list(calls)
    31 - 45x + 45x +
      if (length(calls) > 0L) checkmate::assert_list(calls, types = c("call", "name"))
    32 - 46x + 46x +
      checkmate::assert_string(operator)
    @@ -63130,21 +65290,24 @@

    teal.slice coverage - 65.92%

    34 - 44x + 44x +
      Reduce(
    35 - 44x + 44x +
        x = calls,
    36 - 44x + 44x +
        f = function(x, y) call(operator, x, y)
    @@ -63556,14 +65719,16 @@

    teal.slice coverage - 65.92%

    56 - 8x + 8x +
          checkmate::assert_class(datasets, "FilteredData")
    57 - 6x + 6x +
          private$filtered_data <- datasets
    @@ -63647,7 +65812,8 @@

    teal.slice coverage - 65.92%

    69 - 8x + 8x +
          private$filtered_data$get_filter_state()
    @@ -63717,14 +65883,16 @@

    teal.slice coverage - 65.92%

    79 - 5x + 5x +
          private$filtered_data$set_filter_state(filter)
    80 - 5x + 5x +
          invisible(NULL)
    @@ -63815,14 +65983,16 @@

    teal.slice coverage - 65.92%

    93 - 1x + 1x +
          private$filtered_data$remove_filter_state(filter)
    94 - 1x + 1x +
          invisible(NULL)
    @@ -63913,21 +66083,24 @@

    teal.slice coverage - 65.92%

    107 - 2x + 2x +
          datanames_to_remove <- if (missing(datanames)) private$filtered_data$datanames() else datanames
    108 - 2x + 2x +
          private$filtered_data$clear_filter_states(datanames = datanames_to_remove)
    109 - 2x + 2x +
          invisible(NULL)
    @@ -64626,7 +66799,8 @@

    teal.slice coverage - 65.92%

    92 - 107x + 107x +
      UseMethod("init_filtered_dataset")
    @@ -64710,56 +66884,64 @@

    teal.slice coverage - 65.92%

    104 - 83x + 83x +
      DataframeFilteredDataset$new(
    105 - 83x + 83x +
        dataset = dataset,
    106 - 83x + 83x +
        dataname = dataname,
    107 - 83x + 83x +
        keys = keys,
    108 - 83x + 83x +
        parent_name = parent_name,
    109 - 83x + 83x +
        parent = parent,
    110 - 83x + 83x +
        join_keys = join_keys,
    111 - 83x + 83x +
        label = label
    @@ -64850,7 +67032,8 @@

    teal.slice coverage - 65.92%

    124 - 7x + 7x +
      if (!requireNamespace("MultiAssayExperiment", quietly = TRUE)) {
    @@ -64871,35 +67054,40 @@

    teal.slice coverage - 65.92%

    127 - 7x + 7x +
      MAEFilteredDataset$new(
    128 - 7x + 7x +
        dataset = dataset,
    129 - 7x + 7x +
        dataname = dataname,
    130 - 7x + 7x +
        keys = keys,
    131 - 7x + 7x +
        label = label
    @@ -64990,28 +67178,32 @@

    teal.slice coverage - 65.92%

    144 - 17x + 17x +
      DefaultFilteredDataset$new(
    145 - 17x + 17x +
        dataset = dataset,
    146 - 17x + 17x +
        dataname = dataname,
    147 - 17x + 17x +
        label = label
    @@ -65878,28 +68070,32 @@

    teal.slice coverage - 65.92%

    121 - 3x + 3x +
      checkmate::assert_multi_class(datasets, c("FilteredData", "FilterPanelAPI"))
    122 - 3x + 3x +
      checkmate::assert_class(filter, "teal_slices")
    123 - 3x + 3x +
      datasets$set_filter_state(filter)
    124 - 3x + 3x +
      invisible(NULL)
    @@ -65941,14 +68137,16 @@

    teal.slice coverage - 65.92%

    130 - 4x + 4x +
      checkmate::assert_multi_class(datasets, c("FilteredData", "FilterPanelAPI"))
    131 - 4x + 4x +
      if (isRunning()) {
    @@ -65969,7 +68167,8 @@

    teal.slice coverage - 65.92%

    134 - 4x + 4x +
        isolate(datasets$get_filter_state())
    @@ -66018,14 +68217,16 @@

    teal.slice coverage - 65.92%

    141 - 1x + 1x +
      checkmate::assert_multi_class(datasets, c("FilteredData", "FilterPanelAPI"))
    142 - 1x + 1x +
      checkmate::assert_class(filter, "teal_slices")
    @@ -66039,14 +68240,16 @@

    teal.slice coverage - 65.92%

    144 - 1x + 1x +
      datasets$remove_filter_state(filter)
    145 - 1x + 1x +
      invisible(NULL)
    @@ -66088,21 +68291,24 @@

    teal.slice coverage - 65.92%

    151 - 1x + 1x +
      checkmate::assert_multi_class(datasets, c("FilteredData", "FilterPanelAPI"))
    152 - 1x + 1x +
      datasets$clear_filter_states(force = force)
    153 - 1x + 1x +
      invisible(NULL)
    @@ -66221,28 +68427,32 @@

    teal.slice coverage - 65.92%

    170 - 2x + 2x +
      checkmate::assert_character(datanames, min.len = 1, any.missing = FALSE)
    171 - 2x + 2x +
      stopifnot(
    172 - 2x + 2x +
        is(datasets, "FilteredData"),
    173 - 2x + 2x +
        all(datanames %in% datasets$datanames())
    @@ -66263,35 +68473,40 @@

    teal.slice coverage - 65.92%

    176 - 2x + 2x +
      paste(
    177 - 2x + 2x +
        unlist(lapply(
    178 - 2x + 2x +
          datanames,
    179 - 2x + 2x +
          function(dataname) {
    180 - 4x + 4x +
            datasets$get_call(dataname)
    @@ -66312,7 +68527,8 @@

    teal.slice coverage - 65.92%

    183 - 2x + 2x +
        collapse = "\n"
    @@ -66577,21 +68793,24 @@

    teal.slice coverage - 65.92%

    35 - 26x + 26x +
          checkmate::assert_matrix(data)
    36 - 25x + 25x +
          super$initialize(data, data_reactive, dataname, datalabel)
    37 - 25x + 25x +
          private$set_filterable_varnames(include_varnames = colnames(private$data))
    @@ -66744,49 +68963,56 @@

    teal.slice coverage - 65.92%

    15 - 273x + 273x +
      checkmate::assert_character(name, min.len = 1, any.missing = FALSE)
    16 - 271x + 271x +
      if (!grepl("^[[:alpha:]][a-zA-Z0-9_]*$", name, perl = TRUE)) {
    17 - 5x + 5x +
        stop(
    18 - 5x + 5x +
          "name '",
    19 - 5x + 5x +
          name,
    20 - 5x + 5x +
          "' must only contain alphanumeric characters (with underscores)",
    21 - 5x + 5x +
          " and the first character must be an alphabetic character"
    @@ -66898,35 +69124,40 @@

    teal.slice coverage - 65.92%

    37 - 12x + 12x +
      checkmate::assert_character(pattern, min.len = 1, null.ok = TRUE)
    38 - 12x + 12x +
      js_files <- list.files(
    39 - 12x + 12x +
        system.file("js", package = "teal.slice", mustWork = TRUE),
    40 - 12x + 12x +
        pattern = pattern,
    41 - 12x + 12x +
        full.names = TRUE
    @@ -66940,7 +69171,8 @@

    teal.slice coverage - 65.92%

    43 - 12x + 12x +
      singleton(lapply(js_files, includeScript))
    @@ -67080,14 +69312,16 @@

    teal.slice coverage - 65.92%

    63 - 55x + 55x +
      if (length(choices) > 1) {
    64 - 27x + 27x +
        do.call("call", append(list("c"), choices))
    @@ -67101,7 +69335,8 @@

    teal.slice coverage - 65.92%

    66 - 28x + 28x +
        choices
    @@ -67394,21 +69629,24 @@

    teal.slice coverage - 65.92%

    39 - 9x + 9x +
      checkmate::assert_multi_class(data, c("data.frame", "DataFrame", "matrix"))
    40 - 9x + 9x +
      checkmate::assert_character(columns, any.missing = FALSE, null.ok = TRUE)
    41 - 9x + 9x +
      checkmate::assert_subset(columns, colnames(data))
    @@ -67422,7 +69660,8 @@

    teal.slice coverage - 65.92%

    43 - 9x + 9x +
      if (is.matrix(data)) {
    @@ -67492,14 +69731,16 @@

    teal.slice coverage - 65.92%

    53 - 9x + 9x +
        types <- vapply(data, function(x) class(x)[1L], character(1L))
    54 - 9x + 9x +
        if (!is.null(columns)) types <- types[columns]
    @@ -67520,7 +69761,8 @@

    teal.slice coverage - 65.92%

    57 - 9x + 9x +
      types
    @@ -69205,35 +71447,40 @@

    teal.slice coverage - 65.92%

    187 - 103x + 103x +
          checkmate::assert_function(data_reactive, args = "sid")
    188 - 103x + 103x +
          checkmate::assert_data_frame(data)
    189 - 103x + 103x +
          super$initialize(data, data_reactive, dataname, datalabel)
    190 - 103x + 103x +
          private$keys <- keys
    191 - 103x + 103x +
          private$set_filterable_varnames(include_varnames = colnames(private$data))
    @@ -69568,7 +71815,8 @@

    teal.slice coverage - 65.92%

    39 - 26x + 26x +
          if (!requireNamespace("MultiAssayExperiment", quietly = TRUE)) {
    @@ -69589,14 +71837,16 @@

    teal.slice coverage - 65.92%

    42 - 26x + 26x +
          checkmate::assert_function(data_reactive, args = "sid")
    43 - 26x + 26x +
          checkmate::assert_class(data, "MultiAssayExperiment")
    @@ -69610,35 +71860,40 @@

    teal.slice coverage - 65.92%

    45 - 25x + 25x +
          data <- SummarizedExperiment::colData(data)
    46 - 25x + 25x +
          data_reactive <- function(sid = "") SummarizedExperiment::colData(data_reactive(sid = sid))
    47 - 25x + 25x +
          super$initialize(data, data_reactive, dataname, datalabel)
    48 - 25x + 25x +
          private$keys <- keys
    49 - 25x + 25x +
          private$set_filterable_varnames(include_varnames = colnames(data))
    @@ -69652,7 +71907,8 @@

    teal.slice coverage - 65.92%

    51 - 25x + 25x +
          invisible(self)
    @@ -69777,14 +72033,16 @@

    teal.slice coverage - 65.92%

    7 - 9x + 9x +
      isolate(
    8 - 9x + 9x +
        all(vapply(fields, function(x) identical(ts1[[x]], ts2[[x]]), logical(1L)))
    @@ -69847,35 +72105,40 @@

    teal.slice coverage - 65.92%

    17 - 34x + 34x +
      isolate({
    18 - 34x + 34x +
        testthat::expect_true(
    19 - 34x + 34x +
          setequal(
    20 - 34x + 34x +
            reactiveValuesToList(x),
    21 - 34x + 34x +
            reactiveValuesToList(y)
    @@ -69945,28 +72208,32 @@

    teal.slice coverage - 65.92%

    31 - 12x + 12x +
      isolate({
    32 - 12x + 12x +
        mapply(
    33 - 12x + 12x +
          function(x, y) {
    34 - 27x + 27x +
            expect_identical_slice(x, y)
    @@ -69980,14 +72247,16 @@

    teal.slice coverage - 65.92%

    36 - 12x + 12x +
          x = x,
    37 - 12x + 12x +
          y = y
    @@ -70001,7 +72270,8 @@

    teal.slice coverage - 65.92%

    39 - 12x + 12x +
        testthat::expect_identical(attributes(x), attributes(y))
    diff --git a/v0.5.1/index.html b/v0.5.1/index.html index d8c65f9ba..487ebe528 100644 --- a/v0.5.1/index.html +++ b/v0.5.1/index.html @@ -1,5 +1,4 @@ - - + @@ -52,22 +51,7 @@ - - + - + + diff --git a/v0.5.1/news/index.html b/v0.5.1/news/index.html index e88fec196..7bf6a10a8 100644 --- a/v0.5.1/news/index.html +++ b/v0.5.1/news/index.html @@ -1,8 +1,22 @@ - -Changelog • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -78,49 +98,74 @@
    -

    teal.slice 0.5.1

    CRAN release: 2024-04-30

    +

    teal.slice 0.5.1 +

    +

    CRAN release: 2024-04-30

    -

    Bug fixes

    -
    • Fix how the filter panel handles NA values in a Date column.
    • +

      Bug fixes +

      +
        +
      • Fix how the filter panel handles NA values in a Date column.
      • Fix filtering of ordered column to return the right call.
      • Ensure choices are sorted for factor and ordered data types.
      • -
    + +
    -

    Miscellaneous

    -
    • Added teal_slice and teal_slices to package index.
    • +

      Miscellaneous +

      +
        +
      • Added teal_slice and teal_slices to package index.
      • Implement mouse-over behavior for the filter card when it is selected.
      • -
    + +
    -

    teal.slice 0.5.0

    CRAN release: 2024-02-06

    +

    teal.slice 0.5.0 +

    +

    CRAN release: 2024-02-06

    -

    Enhancements

    -
    • Simplified init_filtered_data to accept a named list of datasets. init_filtered_data does not currently handle a list containing dataset, metadata, datalabel and code.
    • -
    +

    Enhancements +

    +
      +
    • Simplified init_filtered_data to accept a named list of datasets. init_filtered_data does not currently handle a list containing dataset, metadata, datalabel and code.
    • +
    +
    -

    Breaking changes

    -
    • +

      Breaking changes +

      +
        +
      • TealData object is no longer supported by teal.slice.
      • set_filter_state no longer accepts a nested list. Use teal_slices() and teal_slice() instead.
      • Renamed FilteredDataset subclass that handles data.frames from DefaultFilteredDataset to DataframeFilteredDataset. Added new class DefaultFilteredDataset that will store any type of object. Filtering will is not supported.
      • -
    + +
    -

    Bug fixes

    -
    • Performs an exact match when determining the default label of a dataset from attributes.
    • -
    +

    Bug fixes +

    +
      +
    • Performs an exact match when determining the default label of a dataset from attributes.
    • +
    +
    -

    Miscellaneous

    -
    • Specified minimal version of package dependencies.
    • +

      Miscellaneous +

      +
        +
      • Specified minimal version of package dependencies.
      • Removed storing and restoring of teal_slices objects.
      • Update documentation and code to reflect the changes due to the refactor of teal.data::JoinKeys into teal.data::join_keys.
      • -
    + +
    -

    teal.slice 0.4.0

    +

    teal.slice 0.4.0 +

    -

    New features

    -
    + +
    -

    Breaking changes

    -
    • Setting filters using a list is now deprecated. Use teal_slices and teal_slice instead.
    • +

      Breaking changes +

      +
        +
      • Setting filters using a list is now deprecated. Use teal_slices and teal_slice instead.
      • Removed CDISCFilteredData and CDISCFilteredDataset and implementing JoinKeys handling in their parent classes (FilteredData and DefaultFilteredDataset).
      • Specifying set of filterable columns is done through include_varnames and exclude_varnames in teal_slices. Specifying attr(, "filterable") is hard deprecated.
      • Removed private fields $code and $check from FilteredData class and made appropriate changes to constructor and init_filtered_data.
      • -
    + +
    -

    teal.slice 0.3.0

    -
    • Examples now use scda.2022 instead of scda.2021.
    • +

      teal.slice 0.3.0 +

      +
        +
      • Examples now use scda.2022 instead of scda.2021.
      • Transferred data hashing step in FilteredDataset to teal.
      • Removed constructor of Queue class.
      • -
      -

      New features

      -
      • Added a global turn on/off button for the Filter Panel.
      • +
      +
      +

      New features +

      +
        +
      • Added a global turn on/off button for the Filter Panel.
      • Added ability to collapse Active Filter Display panel.
      • Added ability to collapse all filters of an individual dataset.
      • Added fixed filter states.
      • -
      +
    +
    -

    Enhancements

    -
    • Improved filter state presentation in FilterState$format.
    • -
    +

    Enhancements +

    +
      +
    • Improved filter state presentation in FilterState$format.
    • +
    +
    -

    Bug fixes

    -
    • Fixed an error where the RangeFilterState produced an error when using bootstrap 4.
    • +

      Bug fixes +

      +
        +
      • Fixed an error where the RangeFilterState produced an error when using bootstrap 4.
      • Fixed a bug that caused the range slider to omit values selected by the filter API.
      • Fixed a bug where setting incorrect values for Date and Date time ranges caused the app to crash.
      • -
    + +
    -

    Miscellaneous

    -
    • Calculation of step in slider for RangeFilterState now uses checkmate::test_integerish instead of is.integer.
    • +

      Miscellaneous +

      +
        +
      • Calculation of step in slider for RangeFilterState now uses checkmate::test_integerish instead of is.integer.
      • Updated init_filtered_data to take into account the removal of CDISCTealData from teal.data package.
      • Added shinyvalidate validation for Date and Date time ranges.
      • Added examples apps for FilterState child classes and DFFilterStates.
      • -
    + +
    -

    teal.slice 0.2.0

    +

    teal.slice 0.2.0 +

    -

    New features

    -
    + +
    -

    Enhancements

    -
    • Redesigned the count bars for filter panel check box inputs.
    • +

      Enhancements +

      +
        +
      • Redesigned the count bars for filter panel check box inputs.
      • Redesigned the filter panel input for dates to use CSS flexbox.
      • Update icons to be compatible with Font Awesome 6.
      • Updates the FilteredData method get_formatted_filter_state so it no longer appends empty filters.
      • Added clearer installation instructions to README.
      • -
    + +
    -

    Breaking changes

    -
    • Renamed internal S3 method get_filterable_varnames to get_supported_filter_varnames.
    • -
    +

    Breaking changes +

    +
      +
    • Renamed internal S3 method get_filterable_varnames to get_supported_filter_varnames.
    • +
    +
    -

    Bug fixes

    -
    • Fixed a bug when the filter panel overview would not refresh if the panel was hidden during a transition between active modules.
    • +

      Bug fixes +

      +
        +
      • Fixed a bug when the filter panel overview would not refresh if the panel was hidden during a transition between active modules.
      • Fixed a bug in FilterState where sliderInput step values were too precise.
      • -
    + +
    -

    teal.slice 0.1.1

    +

    teal.slice 0.1.1 +

    -

    New features

    -
    • Added a formatting function for filter panel classes.
    • -
    +

    New features +

    +
      +
    • Added a formatting function for filter panel classes.
    • +
    +
    -

    Miscellaneous

    -
    • Added a template to the pkgdown site.
    • +

      Miscellaneous +

      +
        +
      • Added a template to the pkgdown site.
      • Updated package authors.
      • Added package vignettes.
      • -
    + +
    -

    Fix

    -
    • Fixed a bug in FilteredDataset, where launching a shiny application without FilteredData would not attach the appropriate CSS files.
    • -
    +

    Fix +

    +
      +
    • Fixed a bug in FilteredDataset, where launching a shiny application without FilteredData would not attach the appropriate CSS files.
    • +
    +
    -

    teal.slice 0.1.0

    -
    • Initial release of teal.slice - a package providing a filter module for teal applications.
    • -
    -

    Changes (from behavior when functionality was part of teal)

    +

    teal.slice 0.1.0 +

    +
      +
    • Initial release of teal.slice - a package providing a filter module for teal applications.
    • +
    +
    +

    Changes (from behavior when functionality was part of teal) +

    -

    Breaking changes

    -
    • +

      Breaking changes +

      +
        +
      • default_filter has been deprecated - use list() instead for a default filter.
      • -
    + +
    -

    Bug fixes

    -
    • Add counts to filtering categorical variables bar charts in the filtering panel in cases where they were missing.
    • +

      Bug fixes +

      +
        +
      • Add counts to filtering categorical variables bar charts in the filtering panel in cases where they were missing.
      • Fixed a bug causing an error when both sliders of RangeFilterState where put to either end of the allowed range in the UI.
      • -
    + +
    -

    Miscellaneous

    -
    • Added is_any_filtered method to all FilterState classes to detect if selected values actually filters out any data. This is used to decide if an explicit filter statement is added to the call.
    • +

      Miscellaneous +

      +
        +
      • Added is_any_filtered method to all FilterState classes to detect if selected values actually filters out any data. This is used to decide if an explicit filter statement is added to the call.
      • The filter panel now displays a helpful message when data has no rows or columns in place of an empty drop down widget.
      • FilteredData now stores whether its datasets had a reproducibility check or not via two new methods to its class: set_check and get_check.
      • -
    + +
    + + + + - - + + diff --git a/v0.5.1/reference/ChoicesFilterState.html b/v0.5.1/reference/ChoicesFilterState.html index 3e537436b..529e238bb 100644 --- a/v0.5.1/reference/ChoicesFilterState.html +++ b/v0.5.1/reference/ChoicesFilterState.html @@ -1,8 +1,24 @@ - -FilterState object for categorical data — ChoicesFilterState • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,40 +107,60 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterState -> ChoicesFilterState

    +

    Inherited methods


    -

    Method new()

    -

    Initialize a FilterState object.

    -

    Usage

    -

    ChoicesFilterState$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterState object.

    +
    +

    Usage +

    +

    +
    +
    ChoicesFilterState$new(
       x,
       x_reactive = reactive(NULL),
       slice,
       extract_type = character(0)
    -)

    +)
    +

    +
    -

    Returns

    +

    Returns +

    Object of class ChoicesFilterState, invisibly.

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection. For this class returned call looks like -<varname> %in% c(<values selected>) with optional is.na(<varname>).

    -

    Usage

    -

    ChoicesFilterState$get_call(dataname)

    +<varname> %in% c(<values selected>) with optional is.na(<varname>).

    +
    +

    Usage +

    +

    +
    +
    ChoicesFilterState$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of data set; defaults to private$get_dataname()

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    call or NULL

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    ChoicesFilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    ChoicesFilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -197,7 +280,8 @@

    Arguments -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     include_css_files <- getFromNamespace("include_css_files", "teal.slice")
     include_js_files <- getFromNamespace("include_js_files", "teal.slice")
    @@ -313,17 +397,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.5.1/reference/DFFilterStates.html b/v0.5.1/reference/DFFilterStates.html index 6af7a032f..f0020eac4 100644 --- a/v0.5.1/reference/DFFilterStates.html +++ b/v0.5.1/reference/DFFilterStates.html @@ -1,8 +1,24 @@ - -FilterStates subclass for data frames — DFFilterStates • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,18 +107,25 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterStates -> DFFilterStates

    -

    Methods

    +

    Methods +

    -

    Public methods

    +

    Public methods +

    -

    Inherited methods +
    +

    Inherited methods


    -

    Method new()

    +

    +
    +
    +

    Method new() +

    Initializes DFFilterStates object by setting dataname and initializing state_list (shiny::reactiveVal). This class contains a single state_list with no specified name, which means that when calling the subset function associated with this class -(dplyr::filter), a list of conditions is passed to unnamed arguments (...).

    -

    Usage

    -

    DFFilterStates$new(
    +(dplyr::filter), a list of conditions is passed to unnamed arguments (...).

    +
    +

    Usage +

    +

    +
    +
    DFFilterStates$new(
       data,
       data_reactive = function(sid = "") NULL,
       dataname,
       datalabel = NULL,
       keys = character(0)
    -)

    +)
    +

    +
    -

    Arguments

    -

    data
    +

    Arguments +

    +

    +
    +
    +
    data

    (data.frame) the R object which dplyr::filter function will be applied on.

    @@ -154,23 +197,41 @@

    Arguments
    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    DFFilterStates$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    DFFilterStates$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -178,7 +239,8 @@

    Arguments -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     include_css_files <- getFromNamespace("include_css_files", "teal.slice")
     include_js_files <- getFromNamespace("include_js_files", "teal.slice")
    @@ -323,17 +385,19 @@ 

    Examples

    + +

    + +
    - - + + diff --git a/v0.5.1/reference/DataframeFilteredDataset.html b/v0.5.1/reference/DataframeFilteredDataset.html index 164f379e6..cc4f423b6 100644 --- a/v0.5.1/reference/DataframeFilteredDataset.html +++ b/v0.5.1/reference/DataframeFilteredDataset.html @@ -1,10 +1,26 @@ - -The DataframeFilteredDataset R6 class — DataframeFilteredDataset • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + +
    @@ -87,23 +109,30 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilteredDataset -> DataframeFilteredDataset

    +

    Inherited methods


    -

    Method new()

    -

    Initializes this DataframeFilteredDataset object.

    -

    Usage

    -

    DataframeFilteredDataset$new(
    +

    +
    +
    +

    Method new() +

    +

    Initializes this DataframeFilteredDataset object.

    +
    +

    Usage +

    +

    +
    +
    DataframeFilteredDataset$new(
       dataset,
       dataname,
       keys = character(0),
    @@ -127,12 +163,18 @@ 

    Usage

    parent = NULL, join_keys = character(0), label = character(0) -)

    +)
    +

    +
    -

    Arguments

    -

    dataset
    +

    Arguments +

    +

    +
    +
    +
    dataset

    (data.frame) single data.frame for which filters are rendered.

    @@ -170,129 +212,227 @@

    Arguments -

    Returns

    +

    Returns +

    Object of class DataframeFilteredDataset, invisibly.

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Gets the subset expression.

    This function returns subset expressions equivalent to selected items within each of filter_states. Configuration of the expressions is constant and depends on filter_states type and order which are set during initialization. This class contains single FilterStates which contains single state_list -and all FilterState objects apply to one argument (...) in a dplyr::filter call.

    -

    Usage

    -

    DataframeFilteredDataset$get_call(sid = "")

    +and all FilterState objects apply to one argument (...) in a dplyr::filter call.

    +
    +

    Usage +

    +

    +
    +
    DataframeFilteredDataset$get_call(sid = "")
    +

    +
    -

    Arguments

    -

    sid
    +

    Arguments +

    +

    +
    +
    +
    sid

    (character) when specified, the method returns code containing conditions calls of FilterState objects with sid different to that of this sid argument.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Either a list of length 1 containing a filter call, or NULL.

    -


    -

    Method set_filter_state()

    -

    Set filter state.

    -

    Usage

    -

    DataframeFilteredDataset$set_filter_state(state)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Set filter state.

    +
    +

    Usage +

    +

    +
    +
    DataframeFilteredDataset$set_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method remove_filter_state()

    -

    Remove one or more FilterState form a FilteredDataset.

    -

    Usage

    -

    DataframeFilteredDataset$remove_filter_state(state)

    +
    +

    +
    +
    +

    Method remove_filter_state() +

    +

    Remove one or more FilterState form a FilteredDataset.

    +
    +

    Usage +

    +

    +
    +
    DataframeFilteredDataset$remove_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices) specifying FilterState objects to remove; teal_slices may contain only dataname and varname, other elements are ignored

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method ui_add()

    -

    UI module to add filter variable for this dataset.

    -

    Usage

    -

    DataframeFilteredDataset$ui_add(id)

    +
    +

    +
    +
    +

    Method ui_add() +

    +

    UI module to add filter variable for this dataset.

    +
    +

    Usage +

    +

    +
    +
    DataframeFilteredDataset$ui_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method get_filter_overview()

    -

    Creates row for filter overview in the form of
    dataname -- observations (remaining/total) - data.frame

    -

    Usage

    -

    DataframeFilteredDataset$get_filter_overview()

    +
    +

    +
    +
    +

    Method get_filter_overview() +

    +

    Creates row for filter overview in the form of
    dataname -- observations (remaining/total) - data.frame

    +
    +

    Usage +

    +

    +
    +
    DataframeFilteredDataset$get_filter_overview()
    +

    +
    -

    Returns

    +

    Returns +

    A data.frame.

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    DataframeFilteredDataset$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    DataframeFilteredDataset$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -300,7 +440,8 @@

    Arguments -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     DataframeFilteredDataset <- getFromNamespace("DataframeFilteredDataset", "teal.slice")
     
    @@ -394,17 +535,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.5.1/reference/DateFilterState.html b/v0.5.1/reference/DateFilterState.html index 28f1ed1e2..cbe39b936 100644 --- a/v0.5.1/reference/DateFilterState.html +++ b/v0.5.1/reference/DateFilterState.html @@ -1,8 +1,24 @@ - -FilterState object for Date data — DateFilterState • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,40 +107,60 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterState -> DateFilterState

    +

    Inherited methods


    -

    Method new()

    -

    Initialize a FilterState object.

    -

    Usage

    -

    DateFilterState$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterState object.

    +
    +

    Usage +

    +

    +
    +
    DateFilterState$new(
       x,
       x_reactive = reactive(NULL),
       slice,
       extract_type = character(0)
    -)

    +)
    +

    +
    -

    Returns

    +

    Returns +

    Object of class DateFilterState, invisibly.

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection. For this class returned call looks like -<varname> >= <min value> & <varname> <= <max value> with optional is.na(<varname>).

    -

    Usage

    -

    DateFilterState$get_call(dataname)

    +<varname> >= <min value> & <varname> <= <max value> with optional is.na(<varname>).

    +
    +

    Usage +

    +

    +
    +
    DateFilterState$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) containing possibly prefixed name of data set

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    call or NULL

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    DateFilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    DateFilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -197,7 +280,8 @@

    Arguments -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     include_css_files <- getFromNamespace("include_css_files", "teal.slice")
     include_js_files <- getFromNamespace("include_js_files", "teal.slice")
    @@ -299,17 +383,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.5.1/reference/DatetimeFilterState.html b/v0.5.1/reference/DatetimeFilterState.html index 840a81b4f..4b4587b8d 100644 --- a/v0.5.1/reference/DatetimeFilterState.html +++ b/v0.5.1/reference/DatetimeFilterState.html @@ -1,8 +1,24 @@ - -FilterState object for date time data — DatetimeFilterState • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,44 +107,64 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterState -> DatetimeFilterState

    +

    Inherited methods


    -

    Method new()

    +

    +
    +
    +

    Method new() +

    Initialize a FilterState object. This class has an extra field, private$timezone, which is set to Sys.timezone() by default. However, in case when using this module in teal app, one needs timezone of the app user. App user timezone is taken from session$userData$timezone -and is set only if object is initialized in shiny.

    -

    Usage

    -

    DatetimeFilterState$new(
    +and is set only if object is initialized in shiny.

    +
    +

    Usage +

    +

    +
    +
    DatetimeFilterState$new(
       x,
       x_reactive = reactive(NULL),
       extract_type = character(0),
       slice
    -)

    +)
    +

    +
    -

    Arguments

    -

    x
    +

    Arguments +

    +

    +
    +
    +
    x

    (POSIXct or POSIXlt) variable to be filtered.

    @@ -135,11 +178,15 @@

    Arguments varname in the condition call will be returned as <dataname>$<varname>

  • "matrix" varname in the condition call will be returned as <dataname>[, <varname>]

  • - + +
    slice
    @@ -151,49 +198,85 @@

    Arguments -

    Returns

    +

    Returns +

    Object of class DatetimeFilterState, invisibly.

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection. For this class returned call looks like -<varname> >= as.POSIXct(<min>) & <varname> <= <max>) with optional is.na(<varname>).

    -

    Usage

    -

    DatetimeFilterState$get_call(dataname)

    +<varname> >= as.POSIXct(<min>) & <varname> <= <max>) with optional is.na(<varname>).

    +
    +

    Usage +

    +

    +
    +
    DatetimeFilterState$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    name of data set; defaults to private$get_dataname()

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    call

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    DatetimeFilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    DatetimeFilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -201,7 +284,8 @@

    Arguments -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     include_css_files <- getFromNamespace("include_css_files", "teal.slice")
     include_js_files <- getFromNamespace("include_js_files", "teal.slice")
    @@ -311,17 +395,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.5.1/reference/DefaultFilteredDataset.html b/v0.5.1/reference/DefaultFilteredDataset.html index 8efb5a58c..959a4abfc 100644 --- a/v0.5.1/reference/DefaultFilteredDataset.html +++ b/v0.5.1/reference/DefaultFilteredDataset.html @@ -1,8 +1,24 @@ - -DefaultFilteredDataset R6 class — DefaultFilteredDataset • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,16 +107,20 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilteredDataset -> DefaultFilteredDataset

    +

    Inherited methods


    -

    Method new()

    -

    Initializes this DefaultFilteredDataset object.

    -

    Usage

    -

    DefaultFilteredDataset$new(dataset, dataname, label = character(0))

    +

    +
    +
    +

    Method new() +

    +

    Initializes this DefaultFilteredDataset object.

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$new(dataset, dataname, label = character(0))
    +

    +
    -

    Arguments

    -

    dataset
    +

    Arguments +

    +

    +
    +
    +
    dataset

    any type of object; will not be filtered.

    @@ -134,23 +177,40 @@

    Arguments -

    Returns

    +

    Returns +

    Object of class DefaultFilteredDataset, invisibly.

    -


    -

    Method format()

    -

    Returns a formatted string representing this DefaultFilteredDataset object.

    -

    Usage

    -

    DefaultFilteredDataset$format(show_all, trim_lines = FALSE)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns a formatted string representing this DefaultFilteredDataset object.

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$format(show_all, trim_lines = FALSE)
    +

    +
    -

    Arguments

    -

    show_all
    +

    Arguments +

    +

    +
    +
    +
    show_all

    (logical(1)) for method consistency, ignored.

    @@ -158,167 +218,291 @@

    Arguments -

    Returns

    +

    Returns +

    The formatted string.

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    -

    Usage

    -

    DefaultFilteredDataset$get_call(sid)

    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$get_call(sid)
    +

    +
    -

    Arguments

    -

    sid
    +

    Arguments +

    +

    +
    +
    +
    sid

    (character(1)) for method consistency, ignored.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    +

    +
    +
    +

    Method get_filter_state() +

    -

    Usage

    -

    DefaultFilteredDataset$get_filter_state()

    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$get_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    +

    +
    +
    +

    Method set_filter_state() +

    -

    Usage

    -

    DefaultFilteredDataset$set_filter_state(state)

    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$set_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices) for method consistency, ignored.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    +

    +
    +
    +

    Method clear_filter_states() +

    -

    Usage

    -

    DefaultFilteredDataset$clear_filter_states(force)

    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$clear_filter_states(force)
    +

    +
    -

    Arguments

    -

    force
    +

    Arguments +

    +

    +
    +
    +
    force

    (logical(1)) for method consistency, ignored.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method get_filter_overview()

    -

    Creates row for filter overview in the form of
    dataname - unsupported data class

    -

    Usage

    -

    DefaultFilteredDataset$get_filter_overview()

    +
    +

    +
    +
    +

    Method get_filter_overview() +

    +

    Creates row for filter overview in the form of
    dataname - unsupported data class

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$get_filter_overview()
    +

    +
    -

    Returns

    +

    Returns +

    A data.frame.

    -


    -

    Method ui_active()

    -

    Overwrites parent method.

    -

    Usage

    -

    DefaultFilteredDataset$ui_active(id)

    +
    +

    +
    +
    +

    Method ui_active() +

    +

    Overwrites parent method.

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$ui_active(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Details

    +

    Details +

    Blank UI module that would list active filter states for this dataset.

    -

    Returns

    +

    Returns +

    An empty div.

    -


    -

    Method ui_add()

    -

    Overwrites parent method.

    -

    Usage

    -

    DefaultFilteredDataset$ui_add(id)

    +
    +

    +
    +
    +

    Method ui_add() +

    +

    Overwrites parent method.

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$ui_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Details

    +

    Details +

    Blank UI module that would list active filter states for this dataset.

    -

    Returns

    +

    Returns +

    An empty div.

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    DefaultFilteredDataset$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    DefaultFilteredDataset$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -326,7 +510,8 @@

    Arguments -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     DefaultFilteredDataset <- getFromNamespace("DefaultFilteredDataset", "teal.slice")
     
    @@ -339,17 +524,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.5.1/reference/EmptyFilterState.html b/v0.5.1/reference/EmptyFilterState.html index f7dcadc62..0aed053cb 100644 --- a/v0.5.1/reference/EmptyFilterState.html +++ b/v0.5.1/reference/EmptyFilterState.html @@ -1,8 +1,24 @@ - -FilterState object for empty variables — EmptyFilterState • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,40 +107,60 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterState -> EmptyFilterState

    +

    Inherited methods


    -

    Method new()

    -

    Initialize EmptyFilterState object.

    -

    Usage

    -

    EmptyFilterState$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize EmptyFilterState object.

    +
    +

    Usage +

    +

    +
    +
    EmptyFilterState$new(
       x,
       x_reactive = reactive(NULL),
       extract_type = character(0),
       slice
    -)

    +)
    +

    +
    -

    Arguments

    -

    x
    +

    Arguments +

    +

    + -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection relevant for selected variable type. -Uses internal reactive values, hence must be called in reactive or isolated context.

    -

    Usage

    -

    EmptyFilterState$get_call(dataname)

    +Uses internal reactive values, hence must be called in reactive or isolated context.

    +
    +

    Usage +

    +

    +
    +
    EmptyFilterState$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    name of data set; defaults to private$get_dataname()

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    logical(1)

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    EmptyFilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    EmptyFilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -196,7 +279,8 @@

    Arguments -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     include_js_files <- getFromNamespace("include_js_files", "teal.slice")
     EmptyFilterState <- getFromNamespace("EmptyFilterState", "teal.slice")
    @@ -217,17 +301,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.5.1/reference/FilterPanelAPI.html b/v0.5.1/reference/FilterPanelAPI.html index a2e99bf8a..4fbb75ada 100644 --- a/v0.5.1/reference/FilterPanelAPI.html +++ b/v0.5.1/reference/FilterPanelAPI.html @@ -1,8 +1,24 @@ - -Class to encapsulate the API of the filter panel of a teal app — FilterPanelAPI • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,7 +106,8 @@
    -

    Details

    +

    Details +

    The purpose of this class is to encapsulate the API of the filter panel in a new class FilterPanelAPI so that it can be passed and used in the server call of any module instead of passing the whole FilteredData object.

    @@ -92,125 +115,223 @@

    Details

    -

    Methods

    +

    Methods +


    -

    Method new()

    -

    Initialize a FilterPanelAPI object.

    -

    Usage

    -

    FilterPanelAPI$new(datasets)

    + +
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterPanelAPI object.

    +
    +

    Usage +

    +

    +
    +
    FilterPanelAPI$new(datasets)
    +

    +
    -

    Arguments

    -

    datasets
    +

    Arguments +

    +

    +
    +
    +
    datasets

    (FilteredData)

    -

    +
    +

    +
    -


    +

    +
    +
    +

    Method get_filter_state() +

    Gets the reactive values from the active FilterState objects of the FilteredData object.

    Gets all active filters in the form of a nested list. -The output list is a compatible input to set_filter_state.

    -

    Usage

    -

    FilterPanelAPI$get_filter_state()

    +The output list is a compatible input to set_filter_state.

    +
    +

    Usage +

    +

    +
    +
    FilterPanelAPI$get_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    list with named elements corresponding to FilteredDataset objects with active filters.

    -


    -

    Method set_filter_state()

    -

    Sets active filter states.

    -

    Usage

    -

    FilterPanelAPI$set_filter_state(filter)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Sets active filter states.

    +
    +

    Usage +

    +

    +
    +
    FilterPanelAPI$set_filter_state(filter)
    +

    +
    -

    Arguments

    -

    filter
    +

    Arguments +

    +

    +
    +
    +
    filter

    (teal_slices)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method remove_filter_state()

    -

    Remove one or more FilterState of a FilteredDataset in the FilteredData object.

    -

    Usage

    -

    FilterPanelAPI$remove_filter_state(filter)

    +
    +

    +
    +
    +

    Method remove_filter_state() +

    +

    Remove one or more FilterState of a FilteredDataset in the FilteredData object.

    +
    +

    Usage +

    +

    +
    +
    FilterPanelAPI$remove_filter_state(filter)
    +

    +
    -

    Arguments

    -

    filter
    +

    Arguments +

    +

    +
    +
    +
    filter

    (teal_slices) specifying FilterState objects to remove; teal_slices may contain only dataname and varname, other elements are ignored

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method clear_filter_states()

    -

    Remove all FilterStates of the FilteredData object.

    -

    Usage

    -

    FilterPanelAPI$clear_filter_states(datanames)

    +
    +

    +
    +
    +

    Method clear_filter_states() +

    +

    Remove all FilterStates of the FilteredData object.

    +
    +

    Usage +

    +

    +
    +
    FilterPanelAPI$clear_filter_states(datanames)
    +

    +
    -

    Arguments

    -

    datanames
    +

    Arguments +

    +

    +
    +
    +
    datanames

    (character) datanames to remove their FilterStates; omit to remove all FilterStates in the FilteredData object

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    FilterPanelAPI$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    FilterPanelAPI$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -218,7 +339,8 @@

    Arguments -

    Examples

    +

    Examples +

    library(shiny)
     
     fd <- init_filtered_data(list(iris = iris))
    @@ -289,17 +411,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.5.1/reference/FilterState.html b/v0.5.1/reference/FilterState.html index 2ed9dd5b9..2156cd5b6 100644 --- a/v0.5.1/reference/FilterState.html +++ b/v0.5.1/reference/FilterState.html @@ -1,8 +1,24 @@ - -FilterState abstract class — FilterState • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,12 +107,15 @@
    -

    Details

    +

    Details +

    This class is responsible for managing a single filter item within a FilteredData object and outputs a condition call (logical predicate) for subsetting one variable. Filter states depend on the variable type: (logical, integer, numeric, character, factor, Date, POSIXct, POSIXlt) -and FilterState subclasses exist that correspond to those types.

    +

    Each variable's filter state is an R6 object keeps the variable that is filtered, a teal_slice object that describes the filter state, as well as a shiny module (UI and server) that allows the user to alter the filter state. Changes to the filter state that cause some observations to be omitted trigger the get_call method and every R function call up in the reactive chain.

    -

    Modifying state

    +

    Modifying state +

    -

    Modifying a FilterState object is possible in three scenarios:

    • In an interactive session, by passing an appropriate teal_slice to the set_state method.

    • +

      Modifying a FilterState object is possible in three scenarios:

      +
        +
      • In an interactive session, by passing an appropriate teal_slice to the set_state method.

      • In a running application, by changing appropriate inputs.

      • In a running application, by using filter_state_api which directly uses set_state method of the FilterState object.

      • -
    + +
    -

    Methods

    +

    Methods +


    -

    Method new()

    -

    Initialize a FilterState object.

    -

    Usage

    -

    FilterState$new(
    +
    +
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterState object.

    +
    +

    Usage +

    +

    +
    +
    FilterState$new(
       x,
       x_reactive = reactive(NULL),
       slice,
       extract_type = character(0)
    -)

    +)
    +

    +
    -

    Returns

    +

    Returns +

    Object of class FilterState, invisibly.

    -


    -

    Method format()

    -

    Returns a formatted string representing this FilterState object.

    -

    Usage

    -

    FilterState$format(show_all = FALSE, trim_lines = TRUE)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns a formatted string representing this FilterState object.

    +
    +

    Usage +

    +

    +
    +
    FilterState$format(show_all = FALSE, trim_lines = TRUE)
    +

    +
    -

    Arguments

    -

    show_all
    +

    Arguments +

    +

    +
    +
    +
    show_all

    (logical(1)) passed to format.teal_slice

    @@ -197,106 +267,196 @@

    Arguments -

    Returns

    +

    Returns +

    character(1) the formatted string

    -


    -

    Method print()

    -

    Prints this FilterState object.

    -

    Usage

    -

    FilterState$print(...)

    +
    +

    +
    +
    +

    Method print() +

    +

    Prints this FilterState object.

    +
    +

    Usage +

    +

    +
    +
    FilterState$print(...)
    +

    +
    -

    Arguments

    -

    ...
    +

    Arguments +

    +

    +
    +
    +
    ...

    additional arguments

    -

    +
    +

    +
    -


    -

    Method set_state()

    -

    Sets mutable parameters of the filter state.

    • fixed state is prevented from changing state

    • +
    +

    +
    +
    +

    Method set_state() +

    +

    Sets mutable parameters of the filter state.

    +
      +
    • fixed state is prevented from changing state

    • anchored state is prevented from removing state

    • -
    -

    Usage

    -

    FilterState$set_state(state)

    + +
    +

    Usage +

    +

    +
    +
    FilterState$set_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slice)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    self invisibly

    -


    -

    Method get_state()

    -

    Returns a complete description of the filter state.

    -

    Usage

    -

    FilterState$get_state()

    +
    +

    +
    +
    +

    Method get_state() +

    +

    Returns a complete description of the filter state.

    +
    +

    Usage +

    +

    +
    +
    FilterState$get_state()
    +

    +
    -

    Returns

    +

    Returns +

    A teal_slice object.

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection relevant for selected variable type. Method is using internal reactive values which makes it reactive -and must be executed in reactive or isolated context.

    -

    Usage

    -

    FilterState$get_call()

    +and must be executed in reactive or isolated context.

    +
    +

    Usage +

    +

    +
    +
    FilterState$get_call()
    +

    +
    -


    -

    Method server()

    -

    shiny module server.

    -

    Usage

    -

    FilterState$server(id)

    +
    +

    +
    +
    +

    Method server() +

    +

    shiny module server.

    +
    +

    Usage +

    +

    +
    +
    FilterState$server(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Reactive expression signaling that remove button has been clicked.

    -


    -

    Method ui()

    +
    +

    +
    +
    +

    Method ui() +

    shiny UI module. -The UI for this class contains simple message stating that it is not supported.

    -

    Usage

    -

    FilterState$ui(id, parent_id = "cards")

    +The UI for this class contains simple message stating that it is not supported.

    +
    +

    Usage +

    +

    +
    +
    FilterState$ui(id, parent_id = "cards")
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    @@ -305,35 +465,64 @@

    Arguments
    -

    Method destroy_observers()

    -

    Destroy observers stored in private$observers.

    -

    Usage

    -

    FilterState$destroy_observers()

    +
    +

    +
    +
    +

    Method destroy_observers() +

    +

    Destroy observers stored in private$observers.

    +
    +

    Usage +

    +

    +
    +
    FilterState$destroy_observers()
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    FilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    FilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -341,17 +530,19 @@

    Arguments

    + +

    + +
    - - + + diff --git a/v0.5.1/reference/FilterStateExpr.html b/v0.5.1/reference/FilterStateExpr.html index 6b5e6af54..f086f1df5 100644 --- a/v0.5.1/reference/FilterStateExpr.html +++ b/v0.5.1/reference/FilterStateExpr.html @@ -1,8 +1,24 @@ - -FilterStateExpr R6 class — FilterStateExpr • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,18 +107,22 @@
    -

    Details

    +

    Details +

    Creates a filter state around a predefined condition call (logical predicate). The condition call is independent of the data and the filter card allows no interaction (the filter is always fixed).

    -

    Methods

    +

    Methods +


    -

    Method new()

    -

    Initialize a FilterStateExpr object.

    -

    Usage

    -

    FilterStateExpr$new(slice)

    + +
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterStateExpr object.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$new(slice)
    +

    +
    -

    Arguments

    -

    slice
    +

    Arguments +

    +

    +
    +
    +
    slice

    (teal_slice_expr)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Object of class FilterStateExpr, invisibly.

    -


    -

    Method format()

    -

    Returns a formatted string representing this FilterStateExpr object.

    -

    Usage

    -

    FilterStateExpr$format(show_all = FALSE, trim_lines = TRUE)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns a formatted string representing this FilterStateExpr object.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$format(show_all = FALSE, trim_lines = TRUE)
    +

    +
    -

    Arguments

    -

    show_all
    +

    Arguments +

    +

    +
    +
    +
    show_all

    (logical(1)) passed to format.teal_slice

    @@ -142,133 +201,242 @@

    Arguments -

    Returns

    +

    Returns +

    character(1) the formatted string

    -


    -

    Method print()

    -

    Prints this FilterStateExpr object.

    -

    Usage

    -

    FilterStateExpr$print(...)

    +
    +

    +
    +
    +

    Method print() +

    +

    Prints this FilterStateExpr object.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$print(...)
    +

    +
    -

    Arguments

    -

    ...
    +

    Arguments +

    +

    +
    +
    +
    ...

    arguments passed to the format method

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method get_state()

    -

    Returns a complete description of this filter state.

    -

    Usage

    -

    FilterStateExpr$get_state()

    +
    +

    +
    +
    +

    Method get_state() +

    +

    Returns a complete description of this filter state.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$get_state()
    +

    +
    -

    Returns

    +

    Returns +

    A teal_slice object.

    -


    -

    Method set_state()

    -

    Does nothing. Exists for compatibility.

    -

    Usage

    -

    FilterStateExpr$set_state(state)

    +
    +

    +
    +
    +

    Method set_state() +

    +

    Does nothing. Exists for compatibility.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$set_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slice)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    self, invisibly.

    -


    -

    Method get_call()

    -

    Get reproducible call.

    -

    Usage

    -

    FilterStateExpr$get_call(dataname)

    +
    +

    +
    +
    +

    Method get_call() +

    +

    Get reproducible call.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    -

    (ignored) for a consistency with FilterState

    +

    Arguments +

    +

    +
    +
    +
    dataname
    +
    +

    (ignored) for a consistency with FilterState

    Returns reproducible condition call for current selection relevant for selected variable type. Method is using internal reactive values which makes it reactive -and must be executed in reactive or isolated context.

    +and must be executed in reactive or isolated context.

    +
    -

    + +

    +
    -

    Returns

    +

    Returns +

    call or NULL

    -


    -

    Method destroy_observers()

    -

    Destroy observers stored in private$observers.

    -

    Usage

    -

    FilterStateExpr$destroy_observers()

    +
    +

    +
    +
    +

    Method destroy_observers() +

    +

    Destroy observers stored in private$observers.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$destroy_observers()
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method server()

    -

    shiny module server.

    -

    Usage

    -

    FilterStateExpr$server(id)

    +
    +

    +
    +
    +

    Method server() +

    +

    shiny module server.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$server(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Reactive expression signaling that the remove button has been clicked.

    -


    -

    Method ui()

    +
    +

    +
    +
    +

    Method ui() +

    shiny module UI. -The UI for this class contains simple message stating that it is not supported.

    -

    Usage

    -

    FilterStateExpr$ui(id, parent_id = "cards")

    +The UI for this class contains simple message stating that it is not supported.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$ui(id, parent_id = "cards")
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    @@ -278,23 +446,41 @@

    Arguments
    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    FilterStateExpr$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    FilterStateExpr$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -302,7 +488,8 @@

    Arguments -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     include_js_files <- getFromNamespace("include_js_files", "teal.slice")
     include_css_files <- getFromNamespace("include_css_files", "teal.slice")
    @@ -355,17 +542,19 @@ 

    Examples

    + +

    + +
    - - + + diff --git a/v0.5.1/reference/FilterStates.html b/v0.5.1/reference/FilterStates.html index 08f5f0b55..8ed054d79 100644 --- a/v0.5.1/reference/FilterStates.html +++ b/v0.5.1/reference/FilterStates.html @@ -1,5 +1,10 @@ - - + + + + + +FilterStates R6 class — FilterStates • teal.slice +FilterStates R6 class — FilterStates • teal.slice + + + + + + + + + + Skip to contents @@ -38,7 +54,8 @@ + +
    @@ -114,12 +137,15 @@
    -

    Methods

    +

    Methods +


    -

    Method new()

    + +
    +

    +
    +
    +

    Method new() +

    Initializes FilterStates object by setting -dataname, and datalabel.

    -

    Usage

    -

    FilterStates$new(
    +dataname, and datalabel.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$new(
       data,
       data_reactive = function(sid = "") NULL,
       dataname,
       datalabel = NULL
    -)

    +)
    +

    +
    -

    Arguments

    -

    data
    +

    Arguments +

    +

    +
    +
    +
    data

    (data.frame or MultiAssayExperiment or SummarizedExperiment or matrix) the R object which subset function is applied on.

    @@ -171,23 +212,40 @@

    Arguments -

    Returns

    +

    Returns +

    Object of class FilterStates, invisibly.

    -


    -

    Method format()

    -

    Returns a formatted string representing this FilterStates object.

    -

    Usage

    -

    FilterStates$format(show_all = FALSE, trim_lines = TRUE)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns a formatted string representing this FilterStates object.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$format(show_all = FALSE, trim_lines = TRUE)
    +

    +
    -

    Arguments

    -

    show_all
    +

    Arguments +

    +

    +
    +
    +
    show_all

    (logical(1)) passed to format.teal_slices

    @@ -195,28 +253,40 @@

    Arguments -

    Returns

    +

    Returns +

    character(1) the formatted string

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Filter call

    Builds subset expression from condition calls generated by FilterState. The lhs of the expression is a dataname_prefixed, where word prefixed refers to situation when call is evaluated on elements of the original data, for example dataname[[x]]. By default dataname_prefixed = dataname and it's not alterable through class methods. Customization of private$dataname_prefixed is done through inheriting classes.

    -

    The rhs is a call to private$fun with following arguments:

    • dataname_prefixed

    • +

      The rhs is a call to private$fun with following arguments:

      +
        +
      • dataname_prefixed

      • list of logical expressions generated by FilterState objects stored in private$state_list. Each logical predicate is combined with & operator. Variables in these logical expressions by default are not prefixed but this can be changed by setting private$extract_type (change in the similar way as dataname_prefixed) Possible call outputs depending on a custom fields/options:

      • -

      # default
      +
    +

    +
    +
    # default
     dataname <- subset(dataname, col == "x")
     
     # fun = dplyr::filter
    @@ -229,222 +299,399 @@ 

    Method get_call()dataname <- subset(dataname, subset = row_col == "x", select = col_col == "x") # dataname = dataname[[element]] -dataname[[element]] <- subset(dataname[[element]], subset = col == "x")

    -

    If no filters are applied, NULL is returned to avoid no-op calls such as dataname <- dataname.

    -

    Usage

    -

    FilterStates$get_call(sid = "")

    +dataname[[element]] <- subset(dataname[[element]], subset = col == "x")
    +

    +
    +

    If no filters are applied, NULL is returned to avoid no-op calls such as dataname <- dataname.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$get_call(sid = "")
    +

    +
    -

    Arguments

    -

    sid
    +

    Arguments +

    +

    +
    +
    +
    sid

    (character) when specified then method returns code containing condition calls (logical predicates) of FilterState objects which "sid" attribute is different than this sid argument.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    call or NULL

    -


    -

    Method print()

    -

    Prints this FilterStates object.

    -

    Usage

    -

    FilterStates$print(...)

    +
    +

    +
    +
    +

    Method print() +

    +

    Prints this FilterStates object.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$print(...)
    +

    +
    -

    Arguments

    -

    ...
    +

    Arguments +

    +

    +
    +
    +
    ...

    additional arguments passed to format.

    -

    +
    +

    +
    -


    -

    Method remove_filter_state()

    -

    Remove one or more FilterStates from the state_list along with their UI elements.

    -

    Usage

    -

    FilterStates$remove_filter_state(state)

    +
    +

    +
    +
    +

    Method remove_filter_state() +

    +

    Remove one or more FilterStates from the state_list along with their UI elements.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$remove_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices) specifying FilterState objects to remove; teal_slices may contain only dataname and varname, other elements are ignored

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    +

    +
    +
    +

    Method get_filter_state() +

    Gets reactive values from active FilterState objects.

    Get active filter state from FilterState objects stored in state_list(s). -The output is a list compatible with input to self$set_filter_state.

    -

    Usage

    -

    FilterStates$get_filter_state()

    +The output is a list compatible with input to self$set_filter_state.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$get_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    Object of class teal_slices.

    -


    -

    Method set_filter_state()

    -

    Sets active FilterState objects.

    -

    Usage

    -

    FilterStates$set_filter_state(state)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Sets active FilterState objects.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$set_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Function that raises an error.

    -


    -

    Method clear_filter_states()

    -

    Remove all FilterState objects from this FilterStates object.

    -

    Usage

    -

    FilterStates$clear_filter_states(force = FALSE)

    +
    +

    +
    +
    +

    Method clear_filter_states() +

    +

    Remove all FilterState objects from this FilterStates object.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$clear_filter_states(force = FALSE)
    +

    +
    -

    Arguments

    -

    force
    +

    Arguments +

    +

    +
    +
    +
    force

    (logical(1)) flag specifying whether to include anchored filter states.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method ui_active()

    +
    +

    +
    +
    +

    Method ui_active() +

    shiny UI definition that stores FilterState UI elements. -Populated with elements created with renderUI in the module server.

    -

    Usage

    -

    FilterStates$ui_active(id)

    +Populated with elements created with renderUI in the module server.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$ui_active(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_active()

    -

    shiny server module.

    -

    Usage

    -

    FilterStates$srv_active(id)

    +
    +

    +
    +
    +

    Method srv_active() +

    +

    shiny server module.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$srv_active(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL.

    -


    -

    Method ui_add()

    -

    shiny UI module to add filter variable.

    -

    Usage

    -

    FilterStates$ui_add(id)

    +
    +

    +
    +
    +

    Method ui_add() +

    +

    shiny UI module to add filter variable.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$ui_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_add()

    +
    +

    +
    +
    +

    Method srv_add() +

    shiny server module to add filter variable.

    This module controls available choices to select as a filter variable. Once selected, a variable is removed from available choices. -Removing a filter variable adds it back to available choices.

    -

    Usage

    -

    FilterStates$srv_add(id)

    +Removing a filter variable adds it back to available choices.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$srv_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL.

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    FilterStates$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    FilterStates$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -452,17 +699,19 @@

    Arguments

    + +
    + +
    - - + + diff --git a/v0.5.1/reference/FilteredData.html b/v0.5.1/reference/FilteredData.html index 5e690874d..cef5a5636 100644 --- a/v0.5.1/reference/FilteredData.html +++ b/v0.5.1/reference/FilteredData.html @@ -1,8 +1,24 @@ - -Class to encapsulate filtered datasets — FilteredData • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,7 +106,8 @@ + +
    -

    Methods

    +

    Methods +


    -

    Method new()

    -

    Initialize a FilteredData object.

    -

    Usage

    -

    FilteredData$new(data_objects, join_keys = teal.data::join_keys())

    + +
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilteredData object.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$new(data_objects, join_keys = teal.data::join_keys())
    +

    +
    -

    Arguments

    -

    data_objects
    +

    Arguments +

    +

    +
    +
    +
    data_objects

    (named list) List of data objects. Names of the list will be used as dataname for respective datasets.

    @@ -157,65 +204,113 @@

    Argumentsteal.data::join_keys().

    -

    +
    +

    +
    -


    -

    Method datanames()

    -

    Gets datanames.

    -

    Usage

    -

    FilteredData$datanames()

    +
    +

    +
    +
    +

    Method datanames() +

    +

    Gets datanames.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$datanames()
    +

    +
    -

    Details

    +

    Details +

    The datanames are returned in the order in which they must be evaluated (in case of dependencies).

    -

    Returns

    +

    Returns +

    Character vector.

    -


    -

    Method get_datalabel()

    +
    +

    +
    +
    +

    Method get_datalabel() +

    Gets data label for the dataset. -Useful to display in Show R Code.

    -

    Usage

    -

    FilteredData$get_datalabel(dataname)

    +Useful to display in Show R Code.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_datalabel(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Character string.

    -


    -

    Method set_available_teal_slices()

    -

    Set list of external filter states available for activation.

    -

    Usage

    -

    FilteredData$set_available_teal_slices(x)

    +
    +

    +
    +
    +

    Method set_available_teal_slices() +

    +

    Set list of external filter states available for activation.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$set_available_teal_slices(x)
    +

    +
    -

    Arguments

    -

    x
    +

    Arguments +

    +

    +
    +
    +
    x

    (reactive) should return teal_slices

    -

    +
    +

    +
    -

    Details

    +

    Details +

    Unlike adding new filter from the column, these filters can come with some prespecified settings. teal_slices are wrapped in a reactive so they can be updated from elsewhere in the app. Filters passed in x are limited to those that can be set for this FilteredData object, @@ -224,46 +319,76 @@

    Details -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method get_available_teal_slices()

    -

    Get list of filter states available for this object.

    -

    Usage

    -

    FilteredData$get_available_teal_slices()

    +
    +

    +
    +
    +

    Method get_available_teal_slices() +

    +

    Get list of filter states available for this object.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_available_teal_slices()
    +

    +
    -

    Details

    +

    Details +

    All teal_slice objects that have been created since the beginning of the app session are stored in one teal_slices object. This returns a subset of that teal_slices, describing filter states that can be set for this object.

    -

    Returns

    +

    Returns +

    reactive that returns teal_slices.

    -


    -

    Method get_call()

    -

    Gets a call to filter the dataset according to the filter state.

    -

    Usage

    -

    FilteredData$get_call(dataname)

    +
    +

    +
    +
    +

    Method get_call() +

    +

    Gets a call to filter the dataset according to the filter state.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset

    -

    +
    +

    +
    -

    Details

    +

    Details +

    It returns a call to filter the dataset only, assuming the other (filtered) datasets it depends on are available.

    Together with self$datanames() which returns the datasets in the correct @@ -277,21 +402,36 @@

    Details -

    Returns

    +

    Returns +

    A list of calls.

    -


    -

    Method get_data()

    +
    +

    +
    +
    +

    Method get_data() +

    Gets filtered or unfiltered dataset.

    -

    For filtered = FALSE, the original data set with set_data is returned including all attributes.

    -

    Usage

    -

    FilteredData$get_data(dataname, filtered = TRUE)

    +

    For filtered = FALSE, the original data set with set_data is returned including all attributes.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_data(dataname, filtered = TRUE)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset.

    @@ -299,77 +439,139 @@

    Arguments -

    Returns

    +

    Returns +

    A data object, a data.frame or a MultiAssayExperiment.

    -


    -

    Method get_join_keys()

    -

    Get join keys between two datasets.

    -

    Usage

    -

    FilteredData$get_join_keys()

    +
    +

    +
    +
    +

    Method get_join_keys() +

    +

    Get join keys between two datasets.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_join_keys()
    +

    +
    -

    Returns

    +

    Returns +

    join_keys

    -


    -

    Method get_filter_overview()

    +
    +

    +
    +
    +

    Method get_filter_overview() +

    Creates filter overview table to be displayed in the application. One row is created per dataset, according to the get_filter_overview methods -of the contained FilteredDataset objects.

    -

    Usage

    -

    FilteredData$get_filter_overview(datanames)

    +of the contained FilteredDataset objects.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_filter_overview(datanames)
    +

    +
    -

    Arguments

    -

    datanames
    +

    Arguments +

    +

    +
    +
    +
    datanames

    (character) vector of dataset names.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    A data.frame listing the numbers of observations in all datasets.

    -


    -

    Method get_keys()

    -

    Get keys for the dataset.

    -

    Usage

    -

    FilteredData$get_keys(dataname)

    +
    +

    +
    +
    +

    Method get_keys() +

    +

    Get keys for the dataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_keys(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    (character(1)) name of the dataset.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Character vector of key column names.

    -


    -

    Method set_dataset()

    -

    Adds a dataset to this FilteredData.

    -

    Usage

    -

    FilteredData$set_dataset(data, dataname)

    +
    +

    +
    +
    +

    Method set_dataset() +

    +

    Adds a dataset to this FilteredData.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$set_dataset(data, dataname)
    +

    +
    -

    Arguments

    -

    data
    +

    Arguments +

    +

    +
    +
    +
    data

    (data.frame or MultiAssayExperiment) data to be filtered.

    @@ -379,10 +581,13 @@

    Arguments -

    Details

    +

    Details +

    set_dataset creates a FilteredDataset object which keeps dataset for the filtering purpose. If this data has a parent specified in the join_keys object stored in private$join_keys then created FilteredDataset (child) gets linked with other FilteredDataset (parent). @@ -391,52 +596,95 @@

    Details -

    Returns

    +

    Returns +

    self, invisibly.

    -


    -

    Method set_join_keys()

    -

    Set the join_keys.

    -

    Usage

    -

    FilteredData$set_join_keys(join_keys)

    +
    +

    +
    +
    +

    Method set_join_keys() +

    +

    Set the join_keys.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$set_join_keys(join_keys)
    +

    +
    -

    Arguments

    -

    join_keys
    +

    Arguments +

    +

    +
    +
    +
    join_keys

    (join_keys), see teal.data::join_keys().

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    self, invisibly.

    -


    -

    Method get_filter_state()

    -

    Gets states of all contained FilterState objects.

    -

    Usage

    -

    FilteredData$get_filter_state()

    +
    +

    +
    +
    +

    Method get_filter_state() +

    +

    Gets states of all contained FilterState objects.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$get_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    A teal_slices object.

    -


    -

    Method format()

    -

    Returns a formatted string representing this FilteredData object.

    -

    Usage

    -

    FilteredData$format(show_all = FALSE, trim_lines = TRUE)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns a formatted string representing this FilteredData object.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$format(show_all = FALSE, trim_lines = TRUE)
    +

    +
    -

    Arguments

    -

    show_all
    +

    Arguments +

    +

    +
    +
    +
    show_all

    (logical(1)) passed to format.teal_slice.

    @@ -444,81 +692,148 @@

    Arguments -

    Returns

    +

    Returns +

    character(1) the formatted string.

    -


    -

    Method print()

    -

    Prints this FilteredData object.

    -

    Usage

    -

    FilteredData$print(...)

    +
    +

    +
    +
    +

    Method print() +

    +

    Prints this FilteredData object.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$print(...)
    +

    +
    -

    Arguments

    -

    ...
    +

    Arguments +

    +

    +
    +
    +
    ...

    additional arguments passed to format.

    -

    +
    +

    +
    -


    -

    Method set_filter_state()

    -

    Sets active filter states.

    -

    Usage

    -

    FilteredData$set_filter_state(state)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Sets active filter states.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$set_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method remove_filter_state()

    -

    Removes one or more FilterState from a FilteredData object.

    -

    Usage

    -

    FilteredData$remove_filter_state(state)

    +
    +

    +
    +
    +

    Method remove_filter_state() +

    +

    Removes one or more FilterState from a FilteredData object.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$remove_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices) specifying FilterState objects to remove; teal_slices may contain only dataname and varname, other elements are ignored.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method clear_filter_states()

    -

    Remove all FilterStates of a FilteredDataset or all FilterStates of a FilteredData object.

    -

    Usage

    -

    FilteredData$clear_filter_states(datanames = self$datanames(), force = FALSE)

    +
    +

    +
    +
    +

    Method clear_filter_states() +

    +

    Remove all FilterStates of a FilteredDataset or all FilterStates of a FilteredData object.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$clear_filter_states(datanames = self$datanames(), force = FALSE)
    +

    +
    -

    Arguments

    -

    datanames
    +

    Arguments +

    +

    +
    +
    +
    datanames

    (character) names of datasets for which to remove all filter states. Defaults to all datasets in this FilteredData object.

    @@ -529,45 +844,79 @@

    Arguments -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method ui_filter_panel()

    +
    +

    +
    +
    +

    Method ui_filter_panel() +

    top-level shiny module for the filter panel in the teal app. -Contains 1) filter overview panel, 2) filter active panel, and 3) add filters panel.

    -

    Usage

    -

    FilteredData$ui_filter_panel(id)

    +Contains 1) filter overview panel, 2) filter active panel, and 3) add filters panel.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$ui_filter_panel(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_filter_panel()

    -

    Server function for filter panel.

    -

    Usage

    -

    FilteredData$srv_filter_panel(id, active_datanames = self$datanames)

    +
    +

    +
    +
    +

    Method srv_filter_panel() +

    +

    Server function for filter panel.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$srv_filter_panel(id, active_datanames = self$datanames)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    @@ -580,44 +929,78 @@

    Arguments -

    Returns

    +

    Returns +

    NULL.

    -


    -

    Method ui_active()

    -

    Server module responsible for displaying active filters.

    -

    Usage

    -

    FilteredData$ui_active(id)

    +
    +

    +
    +
    +

    Method ui_active() +

    +

    Server module responsible for displaying active filters.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$ui_active(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_active()

    -

    Server module responsible for displaying active filters.

    -

    Usage

    -

    FilteredData$srv_active(id, active_datanames = self$datanames)

    +
    +

    +
    +
    +

    Method srv_active() +

    +

    Server module responsible for displaying active filters.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$srv_active(id, active_datanames = self$datanames)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    @@ -627,44 +1010,78 @@

    Arguments -

    Returns

    +

    Returns +

    NULL.

    -


    -

    Method ui_add()

    -

    Server module responsible for displaying drop-downs with variables to add a filter.

    -

    Usage

    -

    FilteredData$ui_add(id)

    +
    +

    +
    +
    +

    Method ui_add() +

    +

    Server module responsible for displaying drop-downs with variables to add a filter.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$ui_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_add()

    -

    Server module responsible for displaying drop-downs with variables to add a filter.

    -

    Usage

    -

    FilteredData$srv_add(id, active_datanames = reactive(self$datanames()))

    +
    +

    +
    +
    +

    Method srv_add() +

    +

    Server module responsible for displaying drop-downs with variables to add a filter.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$srv_add(id, active_datanames = reactive(self$datanames()))
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    @@ -674,45 +1091,78 @@

    Arguments -

    Returns

    +

    Returns +

    NULL.

    -


    -

    Method ui_overview()

    +
    +

    +
    +
    +

    Method ui_overview() +

    Creates the UI definition for the module showing counts for each dataset contrasting the filtered to the full unfiltered dataset.

    Per dataset, it displays the number of rows/observations in each dataset, -the number of unique subjects.

    -

    Usage

    -

    FilteredData$ui_overview(id)

    +the number of unique subjects.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$ui_overview(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -


    -

    Method srv_overview()

    +
    +

    +
    +
    +

    Method srv_overview() +

    Server function to display the number of records in the filtered and unfiltered -data.

    -

    Usage

    -

    FilteredData$srv_overview(id, active_datanames = self$datanames)

    +data.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$srv_overview(id, active_datanames = self$datanames)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    @@ -725,27 +1175,46 @@

    Arguments -

    Returns

    +

    Returns +

    NULL.

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    FilteredData$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    FilteredData$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -753,7 +1222,8 @@

    Arguments -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     FilteredData <- getFromNamespace("FilteredData", "teal.slice")
     
    @@ -931,17 +1401,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.5.1/reference/FilteredDataset.html b/v0.5.1/reference/FilteredDataset.html index e09e98053..ca6a3587c 100644 --- a/v0.5.1/reference/FilteredDataset.html +++ b/v0.5.1/reference/FilteredDataset.html @@ -1,16 +1,32 @@ - - + + + + + +FilteredDataset R6 class — FilteredDataset • teal.slice +FilteredDataset R6 class — FilteredDataset • teal.slice + + + + + + + + + + Skip to contents @@ -26,7 +42,8 @@ + +
    @@ -96,12 +119,15 @@
    -

    Methods

    +

    Methods +


    -

    Method new()

    -

    Initializes this FilteredDataset object.

    -

    Usage

    -

    +

    +
    +
    +

    Method new() +

    +

    Initializes this FilteredDataset object.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$new(
       dataset,
       dataname,
       keys = character(0),
       label = attr(dataset, "label", exact = TRUE)
    -)

    +)
    +

    +
    -

    Arguments

    -

    dataset
    +

    Arguments +

    +

    +
    +
    +
    dataset

    any object

    @@ -152,23 +193,40 @@

    Arguments -

    Returns

    +

    Returns +

    Object of class FilteredDataset, invisibly.

    -


    -

    Method format()

    -

    Returns a formatted string representing this FilteredDataset object.

    -

    Usage

    -

    FilteredDataset$format(show_all = FALSE, trim_lines = TRUE)

    +
    +

    +
    +
    +

    Method format() +

    +

    Returns a formatted string representing this FilteredDataset object.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$format(show_all = FALSE, trim_lines = TRUE)
    +

    +
    -

    Arguments

    -

    show_all
    +

    Arguments +

    +

    +
    +
    +
    show_all

    (logical(1)) passed to format.teal_slice.

    @@ -176,289 +234,526 @@

    Arguments -

    Returns

    +

    Returns +

    The formatted character string.

    -


    -

    Method print()

    -

    Prints this FilteredDataset object.

    -

    Usage

    -

    FilteredDataset$print(...)

    +
    +

    +
    +
    +

    Method print() +

    +

    Prints this FilteredDataset object.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$print(...)
    +

    +
    -

    Arguments

    -

    ...
    +

    Arguments +

    +

    +
    +
    +
    ...

    additional arguments passed to format.

    -

    +
    +

    +
    -


    -

    Method clear_filter_states()

    -

    Removes all filter items applied to this dataset.

    -

    Usage

    -

    FilteredDataset$clear_filter_states(force = FALSE)

    +
    +

    +
    +
    +

    Method clear_filter_states() +

    +

    Removes all filter items applied to this dataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$clear_filter_states(force = FALSE)
    +

    +
    -

    Arguments

    -

    force
    +

    Arguments +

    +

    +
    +
    +
    force

    (logical(1)) flag specifying whether to include anchored filter states.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL.

    -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Gets a filter expression.

    This function returns filter calls equivalent to selected items within each of filter_states. Configuration of the calls is constant and -depends on filter_states type and order which are set during initialization.

    -

    Usage

    -

    FilteredDataset$get_call(sid = "")

    +depends on filter_states type and order which are set during initialization.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_call(sid = "")
    +

    +
    -

    Arguments

    -

    sid
    +

    Arguments +

    +

    +
    +
    +
    sid

    (character) when specified, the method returns code containing conditions calls of FilterState objects with sid different to this sid argument.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Either a list of filter calls, or NULL.

    -


    -

    Method get_filter_state()

    -

    Gets states of all contained FilterState objects.

    -

    Usage

    -

    FilteredDataset$get_filter_state()

    +
    +

    +
    +
    +

    Method get_filter_state() +

    +

    Gets states of all contained FilterState objects.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_filter_state()
    +

    +
    -

    Returns

    +

    Returns +

    A teal_slices object.

    -


    -

    Method set_filter_state()

    -

    Set filter state.

    -

    Usage

    -

    FilteredDataset$set_filter_state(state)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Set filter state.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$set_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Virtual method, returns nothing and raises error.

    -


    -

    Method get_filter_count()

    -

    Gets the number of FilterState objects in all FilterStates in this FilteredDataset.

    -

    Usage

    -

    FilteredDataset$get_filter_count()

    +
    +

    +
    +
    +

    Method get_filter_count() +

    +

    Gets the number of FilterState objects in all FilterStates in this FilteredDataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_filter_count()
    +

    +
    -

    Returns

    +

    Returns +

    integer(1)

    -


    -

    Method get_dataname()

    -

    Gets the name of the dataset.

    -

    Usage

    -

    FilteredDataset$get_dataname()

    +
    +

    +
    +
    +

    Method get_dataname() +

    +

    Gets the name of the dataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_dataname()
    +

    +
    -

    Returns

    +

    Returns +

    A character string.

    -


    -

    Method get_dataset()

    -

    Gets the dataset object in this FilteredDataset.

    -

    Usage

    -

    FilteredDataset$get_dataset(filtered = FALSE)

    +
    +

    +
    +
    +

    Method get_dataset() +

    +

    Gets the dataset object in this FilteredDataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_dataset(filtered = FALSE)
    +

    +
    -

    Arguments

    -

    filtered
    +

    Arguments +

    +

    +
    +
    +
    filtered

    (logical(1))

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    The stored dataset. If data.frame or MultiAssayExperiment, either raw or as a reactive with current filters applied (depending on filtered).

    -


    -

    Method get_filter_overview()

    -

    Get filter overview of a dataset.

    -

    Usage

    -

    FilteredDataset$get_filter_overview()

    +
    +

    +
    +
    +

    Method get_filter_overview() +

    +

    Get filter overview of a dataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_filter_overview()
    +

    +
    -

    Returns

    +

    Returns +

    Virtual method, returns nothing and raises an error.

    -


    -

    Method get_keys()

    -

    Gets the key columns for this dataset.

    -

    Usage

    -

    FilteredDataset$get_keys()

    +
    +

    +
    +
    +

    Method get_keys() +

    +

    Gets the key columns for this dataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_keys()
    +

    +
    -

    Returns

    +

    Returns +

    Character vector of variable names

    -


    -

    Method get_dataset_label()

    -

    Gets the dataset label.

    -

    Usage

    -

    FilteredDataset$get_dataset_label()

    +
    +

    +
    +
    +

    Method get_dataset_label() +

    +

    Gets the dataset label.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$get_dataset_label()
    +

    +
    -

    Returns

    +

    Returns +

    Character string.

    -


    -

    Method ui_active()

    -

    shiny module containing active filters for a dataset, along with a title and a remove button.

    -

    Usage

    -

    FilteredDataset$ui_active(id)

    +
    +

    +
    +
    +

    Method ui_active() +

    +

    shiny module containing active filters for a dataset, along with a title and a remove button.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$ui_active(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_active()

    -

    Server module for a dataset active filters.

    -

    Usage

    -

    FilteredDataset$srv_active(id)

    +
    +

    +
    +
    +

    Method srv_active() +

    +

    Server module for a dataset active filters.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$srv_active(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL.

    -


    -

    Method ui_add()

    -

    UI module to add filter variable for this dataset.

    -

    Usage

    -

    FilteredDataset$ui_add(id)

    +
    +

    +
    +
    +

    Method ui_add() +

    +

    UI module to add filter variable for this dataset.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$ui_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    Virtual method, returns nothing and raises error.

    -


    -

    Method srv_add()

    +
    +

    +
    +
    +

    Method srv_add() +

    Server module to add filter variable for this dataset. For this class srv_add calls multiple modules of the same name from FilterStates as MAEFilteredDataset -contains one FilterStates object for colData and one for each experiment.

    -

    Usage

    -

    FilteredDataset$srv_add(id)

    +contains one FilterStates object for colData and one for each experiment.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$srv_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL.

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    FilteredDataset$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    FilteredDataset$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -466,17 +761,19 @@

    Arguments

    + +
    + +
    - - + + diff --git a/v0.5.1/reference/LogicalFilterState.html b/v0.5.1/reference/LogicalFilterState.html index 68c34e73e..9e186e794 100644 --- a/v0.5.1/reference/LogicalFilterState.html +++ b/v0.5.1/reference/LogicalFilterState.html @@ -1,8 +1,24 @@ - -FilterState object for logical data — LogicalFilterState • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,40 +107,60 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterState -> LogicalFilterState

    +

    Inherited methods


    -

    Method new()

    -

    Initialize a FilterState object.

    -

    Usage

    -

    LogicalFilterState$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterState object.

    +
    +

    Usage +

    +

    +
    +
    LogicalFilterState$new(
       x,
       x_reactive = reactive(NULL),
       extract_type = character(0),
       slice
    -)

    +)
    +

    +
    -

    Arguments

    -

    x
    +

    Arguments +

    +

    + -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection. -For LogicalFilterState it's a !<varname> or <varname> and optionally is.na(<varname>)

    -

    Usage

    -

    LogicalFilterState$get_call(dataname)

    +For LogicalFilterState it's a !<varname> or <varname> and optionally is.na(<varname>)

    +
    +

    Usage +

    +

    +
    +
    LogicalFilterState$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    name of data set; defaults to private$get_dataname()

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    call

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    LogicalFilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    LogicalFilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -196,7 +279,8 @@

    Arguments -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     include_css_files <- getFromNamespace("include_css_files", "teal.slice")
     include_js_files <- getFromNamespace("include_js_files", "teal.slice")
    @@ -284,17 +368,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.5.1/reference/MAEFilterStates.html b/v0.5.1/reference/MAEFilterStates.html index e234b346d..2a22f92b4 100644 --- a/v0.5.1/reference/MAEFilterStates.html +++ b/v0.5.1/reference/MAEFilterStates.html @@ -1,8 +1,24 @@ - -FilterStates subclass for MultiAssayExperiments — MAEFilterStates • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,18 +107,25 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterStates -> MAEFilterStates

    -

    Methods

    +

    Methods +

    Inherited methods +
    +

    Inherited methods


    -

    Method new()

    -

    Initialize MAEFilterStates object.

    -

    Usage

    -

    MAEFilterStates$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize MAEFilterStates object.

    +
    +

    Usage +

    +

    +
    +
    MAEFilterStates$new(
       data,
       data_reactive = function(sid = "") NULL,
       dataname,
       datalabel = "subjects",
       keys = character(0)
    -)

    +)
    +

    +
    -

    Arguments

    -

    data
    +

    Arguments +

    +

    +
    +
    +
    data

    (MultiAssayExperiment) the R object which MultiAssayExperiment::subsetByColData function is applied on.

    @@ -155,23 +198,41 @@

    Arguments
    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    MAEFilterStates$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    MAEFilterStates$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -179,17 +240,19 @@

    Arguments

    + +

    + +
    - - + + diff --git a/v0.5.1/reference/MAEFilteredDataset.html b/v0.5.1/reference/MAEFilteredDataset.html index 075ae5c20..de644fd92 100644 --- a/v0.5.1/reference/MAEFilteredDataset.html +++ b/v0.5.1/reference/MAEFilteredDataset.html @@ -1,10 +1,26 @@ - -MAEFilteredDataset R6 class — MAEFilteredDataset • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + +
    @@ -87,22 +110,29 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilteredDataset -> MAEFilteredDataset

    +

    Inherited methods


    -

    Method new()

    -

    Initialize MAEFilteredDataset object.

    -

    Usage

    -

    MAEFilteredDataset$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize MAEFilteredDataset object.

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$new(
       dataset,
       dataname,
       keys = character(0),
       label = character(0)
    -)

    +)
    +

    +
    -

    Arguments

    -

    dataset
    +

    Arguments +

    +

    +
    +
    +
    dataset

    (MulitiAssayExperiment) single MulitiAssayExperiment for which filters are rendered.

    @@ -149,102 +192,183 @@

    Arguments -

    Returns

    +

    Returns +

    Object of class MAEFilteredDataset, invisibly.

    -


    -

    Method set_filter_state()

    -

    Set filter state.

    -

    Usage

    -

    MAEFilteredDataset$set_filter_state(state)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Set filter state.

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$set_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices)

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method remove_filter_state()

    -

    Remove one or more FilterState of a MAEFilteredDataset.

    -

    Usage

    -

    MAEFilteredDataset$remove_filter_state(state)

    +
    +

    +
    +
    +

    Method remove_filter_state() +

    +

    Remove one or more FilterState of a MAEFilteredDataset.

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$remove_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices) specifying FilterState objects to remove; teal_slices may contain only dataname and varname, other elements are ignored.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method ui_add()

    -

    UI module to add filter variable for this dataset.

    -

    Usage

    -

    MAEFilteredDataset$ui_add(id)

    +
    +

    +
    +
    +

    Method ui_add() +

    +

    UI module to add filter variable for this dataset.

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$ui_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method get_filter_overview()

    -

    Creates row for filter overview in the form of
    dataname -- observations (remaining/total) -- subjects (remaining/total) - MAE

    -

    Usage

    -

    MAEFilteredDataset$get_filter_overview()

    +
    +

    +
    +
    +

    Method get_filter_overview() +

    +

    Creates row for filter overview in the form of
    dataname -- observations (remaining/total) -- subjects (remaining/total) - MAE

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$get_filter_overview()
    +

    +
    -

    Returns

    +

    Returns +

    A data.frame.

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    MAEFilteredDataset$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    MAEFilteredDataset$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -252,7 +376,8 @@

    Arguments -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     MAEFilteredDataset <- getFromNamespace("MAEFilteredDataset", "teal.slice")
     
    @@ -324,17 +449,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.5.1/reference/MatrixFilterStates.html b/v0.5.1/reference/MatrixFilterStates.html index 4745975bd..ae136b858 100644 --- a/v0.5.1/reference/MatrixFilterStates.html +++ b/v0.5.1/reference/MatrixFilterStates.html @@ -1,8 +1,24 @@ - -FilterStates subclass for matrices — MatrixFilterStates • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,18 +107,25 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterStates -> MatrixFilterStates

    -

    Methods

    +

    Methods +

    Inherited methods +
    +

    Inherited methods


    -

    Method new()

    -

    Initialize MatrixFilterStates object.

    -

    Usage

    -

    MatrixFilterStates$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize MatrixFilterStates object.

    +
    +

    Usage +

    +

    +
    +
    MatrixFilterStates$new(
       data,
       data_reactive = function(sid = "") NULL,
       dataname,
       datalabel = NULL
    -)

    +)
    +

    +
    -

    Arguments

    -

    data
    +

    Arguments +

    +

    +
    +
    +
    data

    (matrix) the R object which subset function is applied on.

    @@ -144,23 +187,41 @@

    Arguments
    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    MatrixFilterStates$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    MatrixFilterStates$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -168,17 +229,19 @@

    Arguments

    + +

    + +
    - - + + diff --git a/v0.5.1/reference/RangeFilterState.html b/v0.5.1/reference/RangeFilterState.html index be948086c..9220dd9be 100644 --- a/v0.5.1/reference/RangeFilterState.html +++ b/v0.5.1/reference/RangeFilterState.html @@ -1,8 +1,24 @@ - -FilterState object for numeric data — RangeFilterState • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,41 +107,61 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterState -> RangeFilterState

    +

    Inherited methods


    -

    Method new()

    -

    Initialize a FilterState object for range selection.

    -

    Usage

    -

    RangeFilterState$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize a FilterState object for range selection.

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$new(
       x,
       x_reactive = reactive(NULL),
       extract_type = character(0),
       slice
    -)

    +)
    +

    +
    -

    Arguments

    -

    x
    +

    Arguments +

    +

    + -


    -

    Method get_call()

    +
    +

    +
    +
    +

    Method get_call() +

    Returns reproducible condition call for current selection. For this class returned call looks like <varname> >= <min value> & <varname> <= <max value> with -optional is.na(<varname>) and is.finite(<varname>).

    -

    Usage

    -

    RangeFilterState$get_call(dataname)

    +optional is.na(<varname>) and is.finite(<varname>).

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$get_call(dataname)
    +

    +
    -

    Arguments

    -

    dataname
    +

    Arguments +

    +

    +
    +
    +
    dataname

    name of data set; defaults to private$get_dataname()

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    call

    -


    -

    Method get_keep_inf()

    -

    Returns current keep_inf selection.

    -

    Usage

    -

    RangeFilterState$get_keep_inf()

    +
    +

    +
    +
    +

    Method get_keep_inf() +

    +

    Returns current keep_inf selection.

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$get_keep_inf()
    +

    +
    -

    Returns

    +

    Returns +

    logical(1)

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    RangeFilterState$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    RangeFilterState$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -211,7 +305,8 @@

    Arguments -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     include_css_files <- getFromNamespace("include_css_files", "teal.slice")
     include_js_files <- getFromNamespace("include_js_files", "teal.slice")
    @@ -327,17 +422,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.5.1/reference/SEFilterStates.html b/v0.5.1/reference/SEFilterStates.html index e1d50e7d4..2c9d32573 100644 --- a/v0.5.1/reference/SEFilterStates.html +++ b/v0.5.1/reference/SEFilterStates.html @@ -1,8 +1,24 @@ - -FilterStates subclass for SummarizedExperiments — SEFilterStates • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,21 +107,28 @@
    -

    Super class

    +

    Super class +

    teal.slice::FilterStates -> SEFilterStates

    +

    Inherited methods


    -

    Method new()

    -

    Initialize SEFilterStates object.

    -

    Usage

    -

    SEFilterStates$new(
    +

    +
    +
    +

    Method new() +

    +

    Initialize SEFilterStates object.

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$new(
       data,
       data_reactive = function(sid = "") NULL,
       dataname,
       datalabel = NULL
    -)

    +)
    +

    +
    -

    Arguments

    -

    data
    +

    Arguments +

    +

    +
    +
    +
    data

    (SummarizedExperiment) the R object which subset function is applied on.

    @@ -144,92 +187,161 @@

    Arguments
    -

    Method set_filter_state()

    -

    Set filter state.

    -

    Usage

    -

    SEFilterStates$set_filter_state(state)

    +
    +

    +
    +
    +

    Method set_filter_state() +

    +

    Set filter state.

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$set_filter_state(state)
    +

    +
    -

    Arguments

    -

    state
    +

    Arguments +

    +

    +
    +
    +
    state

    (teal_slices) teal_slice objects should contain the field arg %in% c("subset", "select")

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL, invisibly.

    -


    -

    Method ui_add()

    -

    shiny UI module to add filter variable.

    -

    Usage

    -

    SEFilterStates$ui_add(id)

    +
    +

    +
    +
    +

    Method ui_add() +

    +

    shiny UI module to add filter variable.

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$ui_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    shiny.tag

    -


    -

    Method srv_add()

    +
    +

    +
    +
    +

    Method srv_add() +

    shiny server module to add filter variable.

    Module controls available choices to select as a filter variable. Selected filter variable is being removed from available choices. Removed filter variable gets back to available choices. This module unlike other FilterStates classes manages two sets of filter variables - one for colData and another for -rowData.

    -

    Usage

    -

    SEFilterStates$srv_add(id)

    +rowData.

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$srv_add(id)
    +

    +
    -

    Arguments

    -

    id
    +

    Arguments +

    +

    +
    +
    +
    id

    (character(1)) shiny module instance id.

    -

    +
    +

    +
    -

    Returns

    +

    Returns +

    NULL

    -


    -

    Method clone()

    -

    The objects of this class are cloneable with this method.

    -

    Usage

    -

    SEFilterStates$clone(deep = FALSE)

    +
    +

    +
    +
    +

    Method clone() +

    +

    The objects of this class are cloneable with this method.

    +
    +

    Usage +

    +

    +
    +
    SEFilterStates$clone(deep = FALSE)
    +

    +
    -

    Arguments

    -

    deep
    +

    Arguments +

    +

    +
    +
    +
    deep

    Whether to make a deep clone.

    -

    +
    +

    +
    @@ -237,17 +349,19 @@

    Arguments

    + +
    + +
    - - + + diff --git a/v0.5.1/reference/calls_combine_by.html b/v0.5.1/reference/calls_combine_by.html index 65b87d277..692c31fa1 100644 --- a/v0.5.1/reference/calls_combine_by.html +++ b/v0.5.1/reference/calls_combine_by.html @@ -1,8 +1,24 @@ - -Compose predicates — calls_combine_by • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +

    @@ -83,13 +105,16 @@
    -

    Usage

    +

    Usage +

    calls_combine_by(calls, operator)
    -

    Arguments

    -
    calls
    +

    Arguments +

    +
    +
    calls

    (list) containing calls (or symbols) to be combined by operator

    @@ -98,21 +123,25 @@

    Arguments

    -

    + +
    -

    Value

    +

    Value +

    A call where elements of calls are composed with operator or NULL if calls is an empty list.

    -

    Details

    +

    Details +

    This function is used to combine logical predicates produced by FilterState objects to build a complete subset expression.

    -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     calls_combine_by <- getFromNamespace("calls_combine_by", "teal.slice")
     
    @@ -127,17 +156,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.5.1/reference/check_simple_name.html b/v0.5.1/reference/check_simple_name.html index 07a32394b..68ee98b31 100644 --- a/v0.5.1/reference/check_simple_name.html +++ b/v0.5.1/reference/check_simple_name.html @@ -1,14 +1,30 @@ - - + + + + + +Test whether variable name can be used within Show R Code — check_simple_name • teal.slice +Test whether variable name can be used within Show R Code — check_simple_name • teal.slice + + + + + + + + + + Skip to contents @@ -24,7 +40,8 @@ + +
    @@ -92,35 +115,42 @@
    -

    Usage

    +

    Usage +

    check_simple_name(name)
    -

    Arguments

    -
    name
    +

    Arguments +

    +
    +
    name

    (character) vector of names to check

    -
    + +
    -

    Value

    +

    Value +

    Returns NULL or raises error.

    + +
    + +
    - - + + diff --git a/v0.5.1/reference/choices_labeled.html b/v0.5.1/reference/choices_labeled.html index 08bb980b8..0dc4ec4d3 100644 --- a/v0.5.1/reference/choices_labeled.html +++ b/v0.5.1/reference/choices_labeled.html @@ -1,10 +1,26 @@ - -Set "<choice>:<label>" type of names — choices_labeled • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + +
    @@ -86,13 +108,16 @@
    -

    Usage

    +

    Usage +

    choices_labeled(choices, labels, subset = NULL, types = NULL)
    -

    Arguments

    -
    choices
    +

    Arguments +

    +
    +
    choices

    (character or numeric or logical) vector

    @@ -110,31 +135,36 @@

    Arguments -

    Value

    +

    Value +

    A named character vector.

    -

    Details

    +

    Details +

    If either choices or labels are factors, they are coerced to character. Duplicated elements from choices get removed.

    + +
    + +
    - - + + diff --git a/v0.5.1/reference/coalesce_r.html b/v0.5.1/reference/coalesce_r.html index 100dd18d9..3af1e6887 100644 --- a/v0.5.1/reference/coalesce_r.html +++ b/v0.5.1/reference/coalesce_r.html @@ -1,8 +1,24 @@ - -Recursively coalesce list elements. — coalesce_r • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,24 +105,30 @@
    -

    Usage

    +

    Usage +

    coalesce_r(x)
    -

    Arguments

    -
    x
    +

    Arguments +

    +
    +
    x

    (list), either of atomic vectors or of named lists

    -
    + +
    -

    Value

    +

    Value +

    Either an atomic vector of length 1 or a (potentially nested) list.

    -

    Details

    +

    Details +

    Given a list of atomic vectors, the first non-null element is returned. Given a list of lists, for all names found in all elements of the list the first non-null element of a given name is returned.

    @@ -108,17 +136,19 @@

    Details

    + +
    + +
    - - + + diff --git a/v0.5.1/reference/countBar.html b/v0.5.1/reference/countBar.html index 64d821d2c..5e9c0487e 100644 --- a/v0.5.1/reference/countBar.html +++ b/v0.5.1/reference/countBar.html @@ -1,8 +1,24 @@ - -Progress bar with label — countBar • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,7 +105,8 @@
    -

    Usage

    +

    Usage +

    countBar(inputId, label, countmax, countnow = NULL, counttotal = countmax)
     
     updateCountBar(
    @@ -105,8 +128,10 @@ 

    Usage

    -

    Arguments

    -
    inputId
    +

    Arguments +

    +
    +
    inputId

    (character(1)) shiny id of the parent element (e.g. a check-box group input).

    @@ -129,32 +154,40 @@

    Arguments -

    Value

    +

    Value +

    shiny.tag object with a progress bar and a label.

    -

    Details

    -

    A progress bar is created to visualize the number of counts in a variable, with filling and a text label.

    • progress bar width is derived as a fraction of the container width: style = "width: <countmax> / <counttotal>%",

    • +

      Details +

      +

      A progress bar is created to visualize the number of counts in a variable, with filling and a text label.

      +
        +
      • progress bar width is derived as a fraction of the container width: style = "width: <countmax> / <counttotal>%",

      • progress bar is filled up to the fraction <countnow> / <countmax>,

      • text label is obtained by <label> (<countnow> / <countmax>).

      • -
    + +
    + +
    + +
    - - + + diff --git a/v0.5.1/reference/countBars.html b/v0.5.1/reference/countBars.html index 9a9ab86c1..0fc83c820 100644 --- a/v0.5.1/reference/countBars.html +++ b/v0.5.1/reference/countBars.html @@ -1,8 +1,24 @@ - -Progress bars with labels — countBars • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,7 +105,8 @@
    -

    Usage

    +

    Usage +

    countBars(inputId, choices, countsmax, countsnow = NULL)
     
     updateCountBars(
    @@ -96,8 +119,10 @@ 

    Usage

    -

    Arguments

    -
    inputId
    +

    Arguments +

    +
    +
    inputId

    (character(1)) shiny id of the parent element (e.g. a check-box group input).

    @@ -116,9 +141,11 @@

    Arguments -

    Value

    +

    Value +

    List of shiny.tags.

    @@ -138,7 +165,8 @@

    Value

    -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     include_js_files <- getFromNamespace("include_js_files", "teal.slice")
     include_css_files <- getFromNamespace("include_css_files", "teal.slice")
    @@ -190,17 +218,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.5.1/reference/data_choices_labeled.html b/v0.5.1/reference/data_choices_labeled.html index c8b28de43..5ee5c15f3 100644 --- a/v0.5.1/reference/data_choices_labeled.html +++ b/v0.5.1/reference/data_choices_labeled.html @@ -1,8 +1,24 @@ - -Returns a choices_labeled object — data_choices_labeled • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,7 +105,8 @@
    -

    Usage

    +

    Usage +

    data_choices_labeled(
       data,
       choices,
    @@ -93,8 +116,10 @@ 

    Usage

    -

    Arguments

    -
    data
    +

    Arguments +

    +
    +
    data

    (data.frame or DFrame or list) where labels can be taken from in case when varlabels is not specified. data must be specified if varlabels is not specified.

    @@ -114,26 +139,30 @@

    Arguments -

    Value

    +

    Value +

    character(0) if choices are empty; a choices_labeled object otherwise

    + +
    + +
    - - + + diff --git a/v0.5.1/reference/dot-table.html b/v0.5.1/reference/dot-table.html index 1c69f977b..a2891a07b 100644 --- a/v0.5.1/reference/dot-table.html +++ b/v0.5.1/reference/dot-table.html @@ -1,8 +1,24 @@ - -table handling POSIXlt — .table • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,35 +107,42 @@
    -

    Usage

    +

    Usage +

    .table(x)
    -

    Arguments

    -
    x
    +

    Arguments +

    +
    +
    x

    (vector) variable to get counts from.

    -
    + +
    -

    Value

    +

    Value +

    vector of counts named by unique values of x.

    + +
    + + - - + + diff --git a/v0.5.1/reference/eval_expr_with_msg.html b/v0.5.1/reference/eval_expr_with_msg.html index ef4d0af0d..2b8f47f10 100644 --- a/v0.5.1/reference/eval_expr_with_msg.html +++ b/v0.5.1/reference/eval_expr_with_msg.html @@ -1,12 +1,28 @@ - - + + + + + +Evaluate expression with meaningful message — eval_expr_with_msg • teal.slice +Evaluate expression with meaningful message — eval_expr_with_msg • teal.slice + + + + + + + + + + Skip to contents @@ -22,7 +38,8 @@ + + @@ -89,39 +111,46 @@
    -

    Usage

    +

    Usage +

    eval_expr_with_msg(expr, env)
    -

    Arguments

    -
    expr
    +

    Arguments +

    +
    +
    expr

    (language)

    env

    (environment) where expression is evaluated.

    -
    + +
    -

    Value

    +

    Value +

    NULL, invisibly.

    + + + + - - + + diff --git a/v0.5.1/reference/fetch_bs_color.html b/v0.5.1/reference/fetch_bs_color.html index 8911cbc5c..e07252870 100644 --- a/v0.5.1/reference/fetch_bs_color.html +++ b/v0.5.1/reference/fetch_bs_color.html @@ -1,8 +1,24 @@ - -Get hex code of the current Bootstrap theme color. — fetch_bs_color • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -83,13 +105,16 @@
    -

    Usage

    +

    Usage +

    fetch_bs_color(color, alpha = NULL)
    -

    Arguments

    -
    color
    +

    Arguments +

    +
    +
    color

    (character(1)) naming one of the available theme colors

    @@ -98,16 +123,19 @@

    Arguments -

    Value

    +

    Value +

    Named character(1) containing a hexadecimal color representation.

    -

    Examples

    +

    Examples +

    fetch_bs_color <- getFromNamespace("fetch_bs_color", "teal.slice")
     fetch_bs_color("primary")
     #> [1] "#0d6efd"
    @@ -119,17 +147,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/v0.5.1/reference/filter_state_api.html b/v0.5.1/reference/filter_state_api.html index 377d718a1..6ae3e54ee 100644 --- a/v0.5.1/reference/filter_state_api.html +++ b/v0.5.1/reference/filter_state_api.html @@ -1,10 +1,26 @@ - -Managing FilteredData states — filter_state_api • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + @@ -86,7 +108,8 @@
    -

    Usage

    +

    Usage +

    set_filter_state(datasets, filter)
     
     get_filter_state(datasets)
    @@ -97,11 +120,15 @@ 

    Usage

    -

    Arguments

    -
    datasets
    -

    (FilteredData) +

    Arguments +

    +
    +
    datasets
    +
    +

    (FilteredData) object to store filter state and filtered datasets, shared across modules

    -

    see FilteredData for details

    +

    see FilteredData for details

    +
    filter
    @@ -113,22 +140,28 @@

    Arguments -

    Value

    +

    Value +

    -
    • set_*, remove_* and clear_filter_state return NULL invisibly

    • +
        +
      • set_*, remove_* and clear_filter_state return NULL invisibly

      • get_filter_state returns a named teal_slices object containing a teal_slice for every existing FilterState

      • -
    + +
    -

    See also

    +

    See also +

    -

    Examples

    +

    Examples +

    datasets <- init_filtered_data(list(iris = iris, mtcars = mtcars))
     fs <- teal_slices(
       teal_slice(dataname = "iris", varname = "Species", selected = c("setosa", "versicolor")),
    @@ -271,17 +304,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/v0.5.1/reference/format_time.html b/v0.5.1/reference/format_time.html index c948a2431..86a8744c8 100644 --- a/v0.5.1/reference/format_time.html +++ b/v0.5.1/reference/format_time.html @@ -1,8 +1,24 @@ - -Format POSIXt for storage — format_time • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -83,40 +105,48 @@
    -

    Usage

    +

    Usage +

    format_time(x)
    -

    Arguments

    -
    x
    +

    Arguments +

    +
    +
    x

    (POSIXt) vector of date time values or anything else

    -
    + +
    -

    Value

    +

    Value +

    If x is of class POSIXt, a character vector, otherwise x itself.

    -

    Details

    +

    Details +

    Date times are stored as string representations expressed in the UTC time zone. The storage format is YYYY-MM-DD HH:MM:SS.

    + + + + - - + + diff --git a/v0.5.1/reference/get_default_slice_id.html b/v0.5.1/reference/get_default_slice_id.html index a06a0a524..855a27f1c 100644 --- a/v0.5.1/reference/get_default_slice_id.html +++ b/v0.5.1/reference/get_default_slice_id.html @@ -1,8 +1,24 @@ - -Default teal_slice id — get_default_slice_id • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -83,48 +105,59 @@
    -

    Usage

    +

    Usage +

    get_default_slice_id(x)
    -

    Arguments

    -
    x
    +

    Arguments +

    +
    +
    x

    (teal_slice or list)

    -
    + +
    -

    Value

    +

    Value +

    (character(1)) id for a teal_slice object.

    -

    Details

    +

    Details +

    Function returns a default id for a teal_slice object which needs to be distinct from other teal_slice objects created for any FilterStates object. Returned id can be treated as a location of -a vector on which FilterState is built:

    • for a data.frame id concatenates dataname and varname.

    • +a vector on which FilterState is built:

      +
        +
      • for a data.frame id concatenates dataname and varname.

      • for a MultiAssayExperiment id concatenates dataname, varname, experiment and arg, so that one can add teal_slice for a varname which exists in multiple SummarizedExperiments or exists in both colData and rowData of given experiment. For such a vector teal.slice doesn't allow to activate more than one filters. In case of teal_slice_expr id is mandatory and must be unique.

      • -
    + + + + + + - - + + diff --git a/v0.5.1/reference/get_filter_expr.html b/v0.5.1/reference/get_filter_expr.html index 3ecb0168d..cbc3af0fd 100644 --- a/v0.5.1/reference/get_filter_expr.html +++ b/v0.5.1/reference/get_filter_expr.html @@ -1,10 +1,26 @@ - -Gets filter expression for multiple datanames taking into account its order. — get_filter_expr • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + @@ -86,39 +108,46 @@
    -

    Usage

    +

    Usage +

    get_filter_expr(datasets, datanames = datasets$datanames())
    -

    Arguments

    -
    datasets
    +

    Arguments +

    +
    +
    datasets

    (FilteredData)

    datanames

    (character) vector of dataset names

    -
    + +
    -

    Value

    +

    Value +

    A character string containing all subset expressions.

    + + + + - - + + diff --git a/v0.5.1/reference/get_supported_filter_varnames.html b/v0.5.1/reference/get_supported_filter_varnames.html index a0d5387b3..6c1cf1f32 100644 --- a/v0.5.1/reference/get_supported_filter_varnames.html +++ b/v0.5.1/reference/get_supported_filter_varnames.html @@ -1,10 +1,26 @@ - -Gets supported filterable variable names — get_supported_filter_varnames • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + @@ -86,25 +108,31 @@
    -

    Usage

    +

    Usage +

    get_supported_filter_varnames(data)
    -

    Arguments

    -
    data
    +

    Arguments +

    +
    +
    data

    the R object containing elements which class can be checked through vapply or apply.

    -
    + +
    -

    Value

    +

    Value +

    character vector of variable names.

    -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     get_supported_filter_varnames <- getFromNamespace("get_supported_filter_varnames", "teal.slice")
     
    @@ -120,17 +148,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/v0.5.1/reference/include_css_files.html b/v0.5.1/reference/include_css_files.html index f2bcc017b..3472b06fe 100644 --- a/v0.5.1/reference/include_css_files.html +++ b/v0.5.1/reference/include_css_files.html @@ -1,12 +1,28 @@ - - + + + + + +Include CSS files from /inst/css/ package directory to application header — include_css_files • teal.slice +Include CSS files from /inst/css/ package directory to application header — include_css_files • teal.slice + + + + + + + + + + Skip to contents @@ -22,7 +38,8 @@ + + @@ -89,35 +111,42 @@
    -

    Usage

    +

    Usage +

    include_css_files(pattern = "*")
    -

    Arguments

    -
    pattern
    +

    Arguments +

    +
    +
    pattern

    (character) pattern of files to be included

    -
    + +
    -

    Value

    +

    Value +

    HTML code that includes CSS files

    + + + + - - + + diff --git a/v0.5.1/reference/include_js_files.html b/v0.5.1/reference/include_js_files.html index 3013e1169..5aa882445 100644 --- a/v0.5.1/reference/include_js_files.html +++ b/v0.5.1/reference/include_js_files.html @@ -1,12 +1,28 @@ - - + + + + + +Include JS files from /inst/js/ package directory to application header — include_js_files • teal.slice +Include JS files from /inst/js/ package directory to application header — include_js_files • teal.slice + + + + + + + + + + Skip to contents @@ -22,7 +38,8 @@ + + @@ -89,35 +111,42 @@
    -

    Usage

    +

    Usage +

    include_js_files(pattern)
    -

    Arguments

    -
    pattern
    +

    Arguments +

    +
    +
    pattern

    (character) pattern of files to be included, passed to system.file

    -
    + +
    -

    Value

    +

    Value +

    HTML code that includes JS files

    + + + + - - + + diff --git a/v0.5.1/reference/index.html b/v0.5.1/reference/index.html index e753fa1f3..daa1c4f4c 100644 --- a/v0.5.1/reference/index.html +++ b/v0.5.1/reference/index.html @@ -1,8 +1,22 @@ - -Function reference • teal.slice + + + + + + + Skip to contents @@ -18,7 +32,8 @@ + + @@ -77,96 +97,129 @@
    -

    teal filter-panel API

    +

    +teal filter-panel API +

    Functions used initialize filter-panel and to modify its states.

    -
    +
    +
    -
    +
    +
    init_filtered_data()
    -
    Initialize FilteredData
    -
    +
    Initialize FilteredData +
    +
    +
    +
    set_filter_state() get_filter_state() remove_filter_state() clear_filter_states()
    Managing FilteredData states
    -
    +
    +
    +
    get_filter_expr()
    Gets filter expression for multiple datanames taking into account its order.
    -
    +
    +
    +
    teal_slice()
    Specify single filter
    -
    +
    +
    +
    teal_slices()
    Complete filter specification
    -
    -

    For developers

    + +
    +
    +

    For developers +

    Abstract and concrete classes used to build teal functionality.

    -
    +
    +
    -

    R6 Classes

    +

    R6 Classes +

    Abstract and concrete classes used to build teal functionality.

    -
    +
    +
    -
    +
    +
    FilteredData
    Class to encapsulate filtered datasets
    -
    +
    +
    +
    FilteredDataset
    -
    FilteredDataset R6 class
    -
    +
    +FilteredDataset R6 class
    +
    +
    +
    FilterPanelAPI
    Class to encapsulate the API of the filter panel of a teal app
    -
    +
    +
    +
    DataframeFilteredDataset
    The DataframeFilteredDataset R6 class
    -
    +
    +
    +
    MAEFilteredDataset
    -
    MAEFilteredDataset R6 class
    -
    +
    +MAEFilteredDataset R6 class
    + + + + + + - - + + diff --git a/v0.5.1/reference/init_filter_state.html b/v0.5.1/reference/init_filter_state.html index e60ece6fc..1e536bc6b 100644 --- a/v0.5.1/reference/init_filter_state.html +++ b/v0.5.1/reference/init_filter_state.html @@ -1,8 +1,24 @@ - -Initialize FilterState — init_filter_state • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,7 +106,8 @@
    -

    Usage

    +

    Usage +

    init_filter_state(
       x,
       x_reactive = reactive(NULL),
    @@ -93,8 +117,10 @@ 

    Usage

    + +
    -

    Value

    +

    Value +

    FilterState object

    -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     init_filter_state <- getFromNamespace("init_filter_state", "teal.slice")
     
    @@ -172,17 +205,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/v0.5.1/reference/init_filter_state_expr.html b/v0.5.1/reference/init_filter_state_expr.html index e922a4357..ef4524df9 100644 --- a/v0.5.1/reference/init_filter_state_expr.html +++ b/v0.5.1/reference/init_filter_state_expr.html @@ -1,8 +1,24 @@ - -Initialize a FilterStateExpr object — init_filter_state_expr • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -83,36 +105,43 @@
    -

    Usage

    +

    Usage +

    init_filter_state_expr(slice)
    -

    Arguments

    -
    slice
    +

    Arguments +

    +
    +
    slice

    (teal_slice_expr) specifying this filter state.

    -
    + +
    -

    Value

    +

    Value +

    FilterStateExpr object

    + + + + - - + + diff --git a/v0.5.1/reference/init_filter_states.html b/v0.5.1/reference/init_filter_states.html index e039d1e65..2d0a2b1bc 100644 --- a/v0.5.1/reference/init_filter_states.html +++ b/v0.5.1/reference/init_filter_states.html @@ -1,8 +1,24 @@ - -Initialize FilterStates object — init_filter_states • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -83,7 +105,8 @@
    -

    Usage

    +

    Usage +

    init_filter_states(
       data,
       data_reactive = reactive(NULL),
    @@ -94,8 +117,10 @@ 

    Usage

    -

    Arguments

    -
    data
    +

    Arguments +

    +
    +
    data

    (data.frame or MultiAssayExperiment or SummarizedExperiment or matrix) object to subset.

    @@ -123,16 +148,19 @@

    Arguments -

    Value

    +

    Value +

    Object of class FilterStates.

    -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     init_filter_states <- getFromNamespace("init_filter_states", "teal.slice")
     
    @@ -171,17 +199,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/v0.5.1/reference/init_filtered_data.html b/v0.5.1/reference/init_filtered_data.html index 86ecbae25..376b5c200 100644 --- a/v0.5.1/reference/init_filtered_data.html +++ b/v0.5.1/reference/init_filtered_data.html @@ -1,8 +1,24 @@ - -Initialize FilteredData — init_filtered_data • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,13 +106,16 @@
    -

    Usage

    +

    Usage +

    init_filtered_data(x, join_keys = teal.data::join_keys(), code, check)
    -

    Arguments

    -
    x
    +

    Arguments +

    +
    +
    x

    (named list) of datasets.

    @@ -104,16 +130,19 @@

    Arguments[Deprecated]

    -

    + +
    -

    Value

    +

    Value +

    Object of class FilteredData.

    -

    Examples

    +

    Examples +

    datasets <- init_filtered_data(list(iris = iris, mtcars = mtcars))
     datasets
     #> FilteredData:
    @@ -132,17 +161,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/v0.5.1/reference/init_filtered_dataset.html b/v0.5.1/reference/init_filtered_dataset.html index bfa701847..47cccbbfc 100644 --- a/v0.5.1/reference/init_filtered_dataset.html +++ b/v0.5.1/reference/init_filtered_dataset.html @@ -1,8 +1,24 @@ - -Initialize FilteredDataset — init_filtered_dataset • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,7 +106,8 @@
    -

    Usage

    +

    Usage +

    init_filtered_dataset(
       dataset,
       dataname,
    @@ -96,8 +120,10 @@ 

    Usage

    -

    Arguments

    -
    dataset
    +

    Arguments +

    +
    +
    dataset

    any object

    @@ -133,15 +159,18 @@

    Arguments -

    Value

    +

    Value +

    Object of class FilteredDataset.

    -

    Warning

    +

    Warning +

    This function is exported to allow other packages to extend teal.slice but it is treated as internal. @@ -150,7 +179,8 @@

    Warning
    -

    Examples

    +

    Examples +

    # DataframeFilteredDataset example
     library(shiny)
     
    @@ -206,17 +236,19 @@ 

    Examples

    + +

    + +
    - - + + diff --git a/v0.5.1/reference/jsonify.html b/v0.5.1/reference/jsonify.html index 92a7010d1..5cb32b26b 100644 --- a/v0.5.1/reference/jsonify.html +++ b/v0.5.1/reference/jsonify.html @@ -1,12 +1,28 @@ - - + + + + + +Convert a list to a justified JSON string — jsonify • teal.slice +Convert a list to a justified JSON string — jsonify • teal.slice + + + + + + + + + + Skip to contents @@ -22,7 +38,8 @@ + +
    @@ -89,39 +111,46 @@
    -

    Usage

    +

    Usage +

    jsonify(x, trim_lines)
    -

    Arguments

    -
    x
    +

    Arguments +

    +
    +
    x

    (list), possibly recursive, obtained from teal_slice or teal_slices.

    trim_lines

    (logical(1)) flag specifying whether to trim lines of the JSON string.

    -
    + +
    -

    Value

    +

    Value +

    A JSON string representation of the input list.

    + + + + - - + + diff --git a/v0.5.1/reference/justify_json.html b/v0.5.1/reference/justify_json.html index c4f6b1f09..d3b21bb06 100644 --- a/v0.5.1/reference/justify_json.html +++ b/v0.5.1/reference/justify_json.html @@ -1,10 +1,26 @@ - -Justify colons in JSON string — justify_json • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + @@ -86,35 +108,42 @@
    -

    Usage

    +

    Usage +

    justify_json(json)
    -

    Arguments

    -
    json
    +

    Arguments +

    +
    +
    json

    (character(1)) a JSON string.

    -
    + +
    -

    Value

    +

    Value +

    A list of character strings, which can be collapsed into a JSON string.

    + + + + - - + + diff --git a/v0.5.1/reference/make_c_call.html b/v0.5.1/reference/make_c_call.html index a0fffd855..75bccd7aa 100644 --- a/v0.5.1/reference/make_c_call.html +++ b/v0.5.1/reference/make_c_call.html @@ -1,10 +1,26 @@ - -Build concatenating call — make_c_call • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + @@ -86,25 +108,31 @@
    -

    Usage

    +

    Usage +

    make_c_call(choices)
    -

    Arguments

    -
    choices
    +

    Arguments +

    +
    +
    choices

    A vector of values.

    -
    + +
    -

    Value

    +

    Value +

    A c call.

    -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     make_c_call <- getFromNamespace("make_c_call", "teal.slice")
     make_c_call(1:3)
    @@ -115,17 +143,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/v0.5.1/reference/make_count_text.html b/v0.5.1/reference/make_count_text.html index d5a3d5ed4..c1ba190af 100644 --- a/v0.5.1/reference/make_count_text.html +++ b/v0.5.1/reference/make_count_text.html @@ -1,16 +1,32 @@ - - + + + + + +Build count text — make_count_text • teal.slice +Build count text — make_count_text • teal.slice + + + + + + + + + + Skip to contents @@ -26,7 +42,8 @@ + + @@ -87,18 +109,24 @@
    -

    Returns a text label describing filtered counts. The text is composed in the following way:

    • when countnow is not NULL: <label> (<countnow>/<countmax>)

    • +

      Returns a text label describing filtered counts. The text is composed in the following way:

      +
        +
      • when countnow is not NULL: <label> (<countnow>/<countmax>)

      • when countnow is NULL: <label> (<countmax>)

      • -
    + +
    -

    Usage

    +

    Usage +

    make_count_text(label, countmax, countnow = NULL)
    -

    Arguments

    -
    label
    +

    Arguments +

    +
    +
    label

    (character(1)) Text displayed before counts.

    @@ -109,26 +137,30 @@

    Arguments -

    Value

    +

    Value +

    A character string.

    + + + + - - + + diff --git a/v0.5.1/reference/setdiff_teal_slices.html b/v0.5.1/reference/setdiff_teal_slices.html index 0b2ac76cb..75aa55a8e 100644 --- a/v0.5.1/reference/setdiff_teal_slices.html +++ b/v0.5.1/reference/setdiff_teal_slices.html @@ -1,8 +1,24 @@ - -setdiff method for teal_slices — setdiff_teal_slices • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,18 +107,23 @@
    -

    Usage

    +

    Usage +

    setdiff_teal_slices(x, y)
    -

    Arguments

    -
    x, y
    +

    Arguments +

    +
    +
    x, y

    (teal_slices)

    -
    + +
    -

    Value

    +

    Value +

    teal_slices

    @@ -103,17 +132,19 @@

    Value

    + + + + - - + + diff --git a/v0.5.1/reference/teal.slice-package.html b/v0.5.1/reference/teal.slice-package.html index 3d179bedc..7d6de92e8 100644 --- a/v0.5.1/reference/teal.slice-package.html +++ b/v0.5.1/reference/teal.slice-package.html @@ -1,8 +1,24 @@ - -teal.slice: Interactive Exploration of Clinical Trials Data — teal.slice-package • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -84,16 +107,24 @@
    -

    Author

    +

    Author +

    Maintainer: Dawid Kaledkowski dawid.kaledkowski@roche.com (ORCID)

    -

    Authors:

    + +
    + + + + - - + + diff --git a/v0.5.1/reference/teal_slice-utilities.html b/v0.5.1/reference/teal_slice-utilities.html index 15eea9cc1..be6471f8c 100644 --- a/v0.5.1/reference/teal_slice-utilities.html +++ b/v0.5.1/reference/teal_slice-utilities.html @@ -1,8 +1,24 @@ - -teal_slice utility functions — teal_slice-utilities • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,7 +106,8 @@
    -

    Usage

    +

    Usage +

    is.teal_slice(x)
     
     as.teal_slice(x)
    @@ -99,8 +123,10 @@ 

    Usage

    -

    Arguments

    -
    x
    +

    Arguments +

    +
    +
    x

    (teal.slice)

    @@ -116,10 +142,12 @@

    Arguments -

    Examples

    +

    Examples +

    x1 <- teal_slice(
       dataname = "data",
       id = "Female adults",
    @@ -196,17 +224,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.5.1/reference/teal_slice.html b/v0.5.1/reference/teal_slice.html index 333f9c1cb..26d9018d3 100644 --- a/v0.5.1/reference/teal_slice.html +++ b/v0.5.1/reference/teal_slice.html @@ -1,10 +1,26 @@ - -Specify single filter — teal_slice • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + @@ -86,7 +108,8 @@
    -

    Usage

    +

    Usage +

    teal_slice(
       dataname,
       varname,
    @@ -105,8 +128,10 @@ 

    Usage

    -

    Arguments

    -
    dataname
    +

    Arguments +

    +
    +
    dataname

    (character(1)) name of data set

    @@ -165,16 +190,19 @@

    Arguments -

    Value

    +

    Value +

    A teal.slice object. Depending on whether varname or expr was specified, the resulting teal_slice also receives class teal_slice_var or teal_slice_expr, respectively.

    -

    Details

    +

    Details +

    teal_slice object fully describes filter state and can be used to create, modify, and delete a filter state. A teal_slice contains a number of common fields (all named arguments of teal_slice), some of which are mandatory, but only @@ -183,7 +211,9 @@

    DetailsSetting any of the other values to NULL means that those properties will not be modified (when setting an existing state) or that they will be determined by data (when creating new a new one). Entire object is FilterState class member and can be accessed with FilterState$get_state().

    -

    A teal_slice can come in two flavors:

    1. teal_slice_var - +

      A teal_slice can come in two flavors:

      +
        +
      1. teal_slice_var - this describes a typical interactive filter that refers to a single variable, managed by the FilterState class. This class is created when varname is specified. The object retains all fields specified in the call. id can be created by default and need not be specified.

      2. @@ -193,7 +223,8 @@

        Detailsexpr is specified. dataname and anchored are retained, fixed is set to TRUE, id becomes mandatory, title remains optional, while other arguments are disregarded.

        -

      A teal_slice can be passed FilterState/FilterStateExpr constructors to instantiate an object. +

    +

    A teal_slice can be passed FilterState/FilterStateExpr constructors to instantiate an object. It can also be passed to FilterState$set_state to modify the state. However, once a FilterState is created, only the mutable features can be set with a teal_slice: selected, keep_na and keep_inf.

    @@ -205,11 +236,13 @@

    DetailsFilterState instantiated with anchored = TRUE cannot be removed.

    -

    Note

    +

    Note +

    Date time objects of POSIX*t classes are printed as strings after converting to UTC timezone.

    -

    Filters in SumarizedExperiment and MultiAssayExperiment objects

    +

    Filters in SumarizedExperiment and MultiAssayExperiment objects +

    @@ -223,13 +256,15 @@

    Filters in order to determine whether the filter refers to the SE's rowData or colData.

    -

    Examples

    +

    Examples +

    x1 <- teal_slice(
       dataname = "data",
       id = "Female adults",
    @@ -306,17 +341,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/v0.5.1/reference/teal_slices-utilities.html b/v0.5.1/reference/teal_slices-utilities.html index 0aea97630..d2478cac7 100644 --- a/v0.5.1/reference/teal_slices-utilities.html +++ b/v0.5.1/reference/teal_slices-utilities.html @@ -1,8 +1,24 @@ - -teal_slices utility functions — teal_slices-utilities • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + +
    @@ -83,7 +106,8 @@
    -

    Usage

    +

    Usage +

    is.teal_slices(x)
     
     as.teal_slices(x)
    @@ -105,8 +129,10 @@ 

    Usage

    -

    Arguments

    -
    x
    +

    Arguments +

    +
    +
    x

    object to test for teal_slices, object to convert to teal_slices or a teal_slices object

    @@ -129,10 +155,12 @@

    Arguments -

    Examples

    +

    Examples +

    filter_1 <- teal_slice(
       dataname = "dataname1",
       varname = "varname1",
    @@ -345,17 +373,19 @@ 

    Examples

    + +
    + +
    - - + + diff --git a/v0.5.1/reference/teal_slices.html b/v0.5.1/reference/teal_slices.html index 74f3eb340..3e0350dce 100644 --- a/v0.5.1/reference/teal_slices.html +++ b/v0.5.1/reference/teal_slices.html @@ -1,10 +1,26 @@ - -Complete filter specification — teal_slices • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + @@ -86,7 +108,8 @@
    -

    Usage

    +

    Usage +

    teal_slices(
       ...,
       exclude_varnames = NULL,
    @@ -97,8 +120,10 @@ 

    Usage

    -

    Arguments

    -
    ...
    +

    Arguments +

    +
    +
    ...

    any number of teal_slice objects.

    @@ -109,29 +134,36 @@

    Arguments[Experimental] +
    +

    [Experimental] This is a new feature. Do kindly share your opinions on teal.slice's GitHub repository.

    (character(1)) string specifying how observations are tallied by these filter states. -Possible options:

    • "none" (default) to have counts of single FilterState to show unfiltered number only.

    • +Possible options:

      +
        +
      • "none" (default) to have counts of single FilterState to show unfiltered number only.

      • "all" to have counts of single FilterState to show number of observation in filtered and unfiltered dataset. Note, that issues were reported when using this option with MultiAssayExperiment. Please make sure that adding new filters doesn't fail on target platform before deploying for production.

      • -
    + +
    allow_add

    (logical(1)) logical flag specifying whether the user will be able to add new filters

    -

    + +
    -

    Value

    +

    Value +

    teal_slices, which is an unnamed list of teal_slice objects.

    -

    Details

    +

    Details +

    teal_slices() collates multiple teal_slice objects into a teal_slices object, a complete filter specification. This is used by all classes above FilterState as well as filter_panel_api wrapper functions. @@ -142,17 +174,21 @@

    Detailsteal_slices.

    -

    See also

    +

    See also +

    -
    + +
    -

    Examples

    +

    Examples +

    filter_1 <- teal_slice(
       dataname = "dataname1",
       varname = "varname1",
    @@ -365,17 +401,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/v0.5.1/reference/to_json.html b/v0.5.1/reference/to_json.html index 766da7489..d77cc5611 100644 --- a/v0.5.1/reference/to_json.html +++ b/v0.5.1/reference/to_json.html @@ -1,12 +1,28 @@ - - + + + + + +Converts a list to a JSON string — to_json • teal.slice +Converts a list to a JSON string — to_json • teal.slice + + + + + + + + + + Skip to contents @@ -22,7 +38,8 @@ + + @@ -89,35 +111,42 @@
    -

    Usage

    +

    Usage +

    to_json(x)
    -

    Arguments

    -
    x
    +

    Arguments +

    +
    +
    x

    (list) representation of teal_slices object.

    -
    + +
    -

    Value

    +

    Value +

    A JSON string.

    + + + + - - + + diff --git a/v0.5.1/reference/toggle_button.html b/v0.5.1/reference/toggle_button.html index f87ce85e7..4a1b70d4e 100644 --- a/v0.5.1/reference/toggle_button.html +++ b/v0.5.1/reference/toggle_button.html @@ -1,8 +1,24 @@ - -Toggle button properties. — toggle_button • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -83,15 +105,18 @@
    -

    Usage

    +

    Usage +

    toggle_icon(input_id, icons, one_way = FALSE)
     
     toggle_title(input_id, titles, one_way = FALSE)
    -

    Arguments

    -
    input_id
    +

    Arguments +

    +
    +
    input_id

    (character(1)) (name-spaced) id of the button

    @@ -104,15 +129,18 @@

    Arguments -

    Value

    +

    Value +

    NULL, invisibly.

    -

    Details

    +

    Details +

    Wrapper functions that use shinyjs::runjs to change button properties in response to events, typically clicking those very buttons. shiny's actionButton and actionLink create <a> tags, @@ -123,7 +151,8 @@

    Details
    -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     toggle_icon <- getFromNamespace("toggle_icon", "teal.slice")
     
    @@ -178,17 +207,19 @@ 

    Examples

    + +

    + + - - + + diff --git a/v0.5.1/reference/topological_sort.html b/v0.5.1/reference/topological_sort.html index 85b576f21..76a94714b 100644 --- a/v0.5.1/reference/topological_sort.html +++ b/v0.5.1/reference/topological_sort.html @@ -1,10 +1,26 @@ - -Topological graph sort — topological_sort • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + @@ -86,23 +108,29 @@
    -

    Usage

    +

    Usage +

    topological_sort(graph)
    -

    Arguments

    -
    graph
    +

    Arguments +

    +
    +
    graph

    (named list) with node vector elements

    -
    + +
    -

    Details

    +

    Details +

    Implementation of Kahn algorithm with a modification to maintain the order of input elements.

    -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     topological_sort <- getFromNamespace("topological_sort", "teal.slice")
     
    @@ -148,17 +176,19 @@ 

    Examples

    + +
    + + - - + + diff --git a/v0.5.1/reference/trim_lines_json.html b/v0.5.1/reference/trim_lines_json.html index 962b55ad5..b5f123b9a 100644 --- a/v0.5.1/reference/trim_lines_json.html +++ b/v0.5.1/reference/trim_lines_json.html @@ -1,10 +1,26 @@ - -Trim lines in JSON string — trim_lines_json • teal.slice + + + + + + + + Skip to contents @@ -20,7 +36,8 @@ + + @@ -86,35 +108,42 @@
    -

    Usage

    +

    Usage +

    trim_lines_json(x)
    -

    Arguments

    -
    x
    +

    Arguments +

    +
    +
    x

    (character)

    -
    + +
    -

    Value

    +

    Value +

    A character string trimmed after a certain hard-coded number of characters in the value portion.

    + + + + - - + + diff --git a/v0.5.1/reference/variable_types.html b/v0.5.1/reference/variable_types.html index d27e6b158..05e7f0d79 100644 --- a/v0.5.1/reference/variable_types.html +++ b/v0.5.1/reference/variable_types.html @@ -1,8 +1,24 @@ - -Get classes of selected columns from dataset — variable_types • teal.slice + + + + + + + + Skip to contents @@ -18,7 +34,8 @@ + + @@ -83,13 +105,16 @@
    -

    Usage

    +

    Usage +

    variable_types(data, columns = NULL)
    -

    Arguments

    -
    data
    +

    Arguments +

    +
    +
    data

    (data.frame or DataFrame or matrix) Object in which to determine variable types.

    @@ -97,16 +122,19 @@

    Arguments -

    Value

    +

    Value +

    Character vector of classes of columns from provided data.

    -

    Examples

    +

    Examples +

    # use non-exported function from teal.slice
     variable_types <- getFromNamespace("variable_types", "teal.slice")
     
    @@ -142,17 +170,19 @@ 

    Examples

    + +
    + + - - + +