Skip to content

Conversation

@llrs-roche
Copy link
Contributor

@llrs-roche llrs-roche commented Oct 27, 2025

Pull Request

Fixes #936

Generates code inside the qenv for it to be reproducible and make the module functional.

I tried to make minimal changes but at the same time to make it fast to render by adding new req() to invalidate reactives.

Note that the code created for the plot has some changes as it has the construct for the new S7 labels. Maybe there are other issues with it.

@llrs-roche llrs-roche marked this pull request as ready for review October 28, 2025 13:05
@github-actions
Copy link
Contributor

github-actions bot commented Oct 28, 2025

badge

Code Coverage Summary

Filename                      Stmts    Miss  Cover    Missing
--------------------------  -------  ------  -------  -------------------------------------------
R/tm_a_pca.R                    864     864  0.00%    141-1132
R/tm_a_regression.R             751     751  0.00%    180-1027
R/tm_data_table.R               201     201  0.00%    100-348
R/tm_file_viewer.R              172     172  0.00%    47-254
R/tm_front_page.R               143     132  7.69%    77-246
R/tm_g_association.R            320     320  0.00%    161-547
R/tm_g_bivariate.R              664     406  38.86%   332-786, 827, 932, 949, 967, 978-1000
R/tm_g_distribution.R          1106    1106  0.00%    156-1404
R/tm_g_response.R               345     345  0.00%    179-594
R/tm_g_scatterplot.R            709     709  0.00%    261-1065
R/tm_g_scatterplotmatrix.R      272     253  6.99%    200-501, 562, 576
R/tm_missing_data.R            1080    1080  0.00%    124-1380
R/tm_outliers.R                1029    1029  0.00%    162-1341
R/tm_t_crosstable.R             263     263  0.00%    177-482
R/tm_variable_browser.R         887     881  0.68%    89-1113, 1164-1347
R/utils.R                       185     120  35.14%   87-249, 278-304, 316-325, 330, 344-363, 452
R/zzz.R                           2       2  0.00%    2-3
TOTAL                          8993    8634  3.99%

Diff against main

Filename                   Stmts    Miss  Cover
-----------------------  -------  ------  -------
R/tm_variable_browser.R     +100     +99  +0.04%
TOTAL                       +100     +99  -0.03%

Results for commit: 4c8ff97

Minimum allowed coverage is 80%

♻️ This comment has been updated with latest results

@github-actions
Copy link
Contributor

github-actions bot commented Oct 28, 2025

Unit Tests Summary

  1 files   23 suites   15m 44s ⏱️
152 tests 143 ✅ 5 💤  4 ❌
474 runs  456 ✅ 5 💤 13 ❌

For more details on these failures, see this check.

Results for commit 4c8ff97.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 28, 2025

Unit Test Performance Difference

Test Suite $Status$ Time on main $±Time$ $±Tests$ $±Skipped$ $±Failures$ $±Errors$
examples 💔 $0.53$ $+4.93$ $+2$ $-36$ $0$ $0$
shinytest2-tm_a_pca 💔 $1.02$ $+153.21$ $+38$ $-11$ $0$ $0$
shinytest2-tm_a_regression 💔 $0.59$ $+68.52$ $+24$ $-7$ $0$ $0$
shinytest2-tm_data_table 💔 $0.36$ $+28.09$ $+6$ $-4$ $0$ $0$
shinytest2-tm_file_viewer 💔 $0.89$ $+32.37$ $+9$ $-4$ $0$ $0$
shinytest2-tm_front_page 💔 $0.40$ $+25.65$ $+6$ $-3$ $0$ $0$
shinytest2-tm_g_bivariate 💔 $0.41$ $+89.91$ $+40$ $-4$ $0$ $0$
shinytest2-tm_g_distribution 💔 $0.25$ $+68.31$ $+17$ $-3$ $0$ $0$
shinytest2-tm_g_response 💔 $0.35$ $+36.85$ $+13$ $-4$ $0$ $0$
shinytest2-tm_g_scatterplot 💔 $0.47$ $+83.78$ $+30$ $-5$ $0$ $0$
shinytest2-tm_g_scatterplotmatrix 💔 $0.58$ $+33.36$ $+5$ $-4$ $0$ $0$
shinytest2-tm_misssing_data 💔 $1.05$ $+62.21$ $+17$ $-5$ $0$ $0$
shinytest2-tm_outliers 💔 $1.03$ $+146.73$ $+51$ $-10$ $0$ $0$
shinytest2-tm_t_crosstable 💔 $0.78$ $+37.98$ $+5$ $-4$ $0$ $0$
shinytest2-tm_variable_browser 💔 $0.84$ $+62.64$ $+17$ $-6$ $+13$ $0$
Additional test case details
Test Suite $Status$ Time on main $±Time$ Test Case
examples 💔 $0.01$ $+1.85$ example_add_facet_labels.Rd
examples 👶 $+0.01$ example_filter_outliers.Rd
shinytest2-tm_a_pca 💔 $0.08$ $+13.23$ e2e_tm_a_pca_Changing_output_encodings_for_plot_type_does_not_generate_errors.
shinytest2-tm_a_pca 💔 $0.08$ $+7.74$ e2e_tm_a_pca_Changing_output_encodings_of_NA_action_does_not_generate_errors.
shinytest2-tm_a_pca 💔 $0.08$ $+30.88$ e2e_tm_a_pca_Changing_output_encodings_of_font_size_does_not_generate_errors.
shinytest2-tm_a_pca 💔 $0.08$ $+30.88$ e2e_tm_a_pca_Changing_output_encodings_of_plot_type_hides_and_shows_options.
shinytest2-tm_a_pca 💔 $0.08$ $+12.65$ e2e_tm_a_pca_Changing_output_encodings_of_standardization_does_not_generate_errors.
shinytest2-tm_a_pca 💔 $0.08$ $+8.40$ e2e_tm_a_pca_Changing_output_encodings_of_tables_display_does_not_generate_errors.
shinytest2-tm_a_pca 💔 $0.08$ $+9.28$ e2e_tm_a_pca_Changing_output_encodings_of_theme_does_not_generate_errors.
shinytest2-tm_a_pca 💔 $0.08$ $+11.67$ e2e_tm_a_pca_Color_by_columns_data_extract_must_be_from_non_selected_variable_set.
shinytest2-tm_a_pca 💔 $0.10$ $+8.10$ e2e_tm_a_pca_Eigenvector_table_should_have_data_extract_selection_Murder_Assault_on_header.
shinytest2-tm_a_pca 💔 $0.08$ $+11.69$ e2e_tm_a_pca_Eigenvector_table_should_have_data_extract_selection_Murder_UrbanPop_on_header.
shinytest2-tm_a_pca 💔 $0.20$ $+8.68$ e2e_tm_a_pca_Module_is_initialised_with_the_specified_defaults_in_function_call.
shinytest2-tm_a_regression 💔 $0.09$ $+6.48$ e2e_tm_a_regression_Data_extract_spec_elements_are_initialized_with_the_default_values_specified_by_response_and_regressor_arg.
shinytest2-tm_a_regression 💔 $0.10$ $+6.52$ e2e_tm_a_regression_Data_parameter_and_module_label_is_passed_properly.
shinytest2-tm_a_regression 💔 $0.08$ $+10.87$ e2e_tm_a_regression_Outlier_definition_and_label_are_visible_by_default.
shinytest2-tm_a_regression 💔 $0.08$ $+7.06$ e2e_tm_a_regression_Outlier_definition_and_label_have_default_values_and_label_text.
shinytest2-tm_a_regression 💔 $0.08$ $+16.98$ e2e_tm_a_regression_Plot_type_has_7_specific_choices_changing_choices_does_not_throw_errors.
shinytest2-tm_a_regression 💔 $0.08$ $+8.61$ e2e_tm_a_regression_Plot_type_is_set_properly.
shinytest2-tm_a_regression 💔 $0.08$ $+12.01$ e2e_tm_a_regression_Unchecking_display_outlier_hides_outlier_label_and_definition.
shinytest2-tm_data_table 💔 $0.10$ $+6.04$ e2e_tm_data_table_Initializes_without_errors
shinytest2-tm_data_table 💔 $0.08$ $+6.09$ e2e_tm_data_table_Verify_checkbox_displayed_over_data_table
shinytest2-tm_data_table 💔 $0.09$ $+6.86$ e2e_tm_data_table_Verify_default_variable_selection_and_set_new_selection
shinytest2-tm_data_table 💔 $0.09$ $+9.09$ e2e_tm_data_table_Verify_module_displays_data_table
shinytest2-tm_file_viewer 💔 $0.51$ $+6.22$ e2e_tm_file_viewer_Initializes_without_errors_and_shows_files_tree_specified_in_input_path_argument
shinytest2-tm_file_viewer 💔 $0.12$ $+8.65$ e2e_tm_file_viewer_Shows_selected_image_file
shinytest2-tm_file_viewer 💔 $0.12$ $+8.78$ e2e_tm_file_viewer_Shows_selected_text_file
shinytest2-tm_file_viewer 💔 $0.13$ $+8.72$ e2e_tm_file_viewer_Shows_selected_url
shinytest2-tm_front_page 💔 $0.14$ $+5.47$ e2e_tm_front_page_Initializes_without_errors_and_check_html_elements
shinytest2-tm_front_page 💔 $0.13$ $+10.41$ e2e_tm_front_page_Verify_the_module_displays_metadata
shinytest2-tm_front_page 💔 $0.13$ $+9.77$ e2e_tm_front_page_Verify_the_module_displays_tables
shinytest2-tm_g_bivariate 💔 $0.11$ $+21.10$ e2e_tm_g_bivariate_Coloring_options_are_hidden_when_coloring_is_toggled_off.
shinytest2-tm_g_bivariate 💔 $0.09$ $+25.00$ e2e_tm_g_bivariate_Facetting_options_are_hidden_when_facet_is_toggled_off.
shinytest2-tm_g_bivariate 💔 $0.12$ $+7.71$ e2e_tm_g_bivariate_Module_is_initialised_with_the_specified_defaults.
shinytest2-tm_g_bivariate 💔 $0.09$ $+36.09$ e2e_tm_g_bivariate_Setting_encoding_inputs_produces_outputs_without_validation_errors.
shinytest2-tm_g_distribution 💔 $0.09$ $+21.18$ e2e_tm_g_distribution_Histogram_encoding_inputs_produce_output_without_validation_errors.
shinytest2-tm_g_distribution 💔 $0.08$ $+34.47$ e2e_tm_g_distribution_Module_is_initialised_with_the_specified_defaults.
shinytest2-tm_g_distribution 💔 $0.08$ $+12.66$ e2e_tm_g_distribution_QQ_plot_encoding_inputs_produce_output_without_validation_errors.
shinytest2-tm_g_response 💔 $0.08$ $+7.13$ e2e_tm_g_response_deselecting_response_produces_validation_error.
shinytest2-tm_g_response 💔 $0.09$ $+7.02$ e2e_tm_g_response_deselecting_x_produces_validation_error.
shinytest2-tm_g_response 💔 $0.09$ $+15.85$ e2e_tm_g_response_encoding_inputs_produce_output_without_validation_errors.
shinytest2-tm_g_response 💔 $0.09$ $+6.86$ e2e_tm_g_response_module_is_initialised_with_the_specified_defaults.
shinytest2-tm_g_scatterplot 💔 $0.11$ $+10.82$ e2e_tm_g_scatterplot_Base_for_the_log_transformation_can_be_applied.
shinytest2-tm_g_scatterplot 💔 $0.09$ $+8.86$ e2e_tm_g_scatterplot_Get_validation_error_when_facetting_with_the_same_row_col_variable.
shinytest2-tm_g_scatterplot 💔 $0.09$ $+7.24$ e2e_tm_g_scatterplot_Module_is_initialised_with_the_specified_defaults.
shinytest2-tm_g_scatterplot 💔 $0.09$ $+45.78$ e2e_tm_g_scatterplot_The_encoding_inputs_are_set_without_validation_errors.
shinytest2-tm_g_scatterplot 💔 $0.09$ $+11.08$ e2e_tm_g_scatterplot_The_log_transform_is_only_possible_for_positive_numeric_vars.
shinytest2-tm_g_scatterplotmatrix 💔 $0.14$ $+10.48$ e2e_tm_g_scatterplotmatrix_Change_plot_settings
shinytest2-tm_g_scatterplotmatrix 💔 $0.15$ $+6.38$ e2e_tm_g_scatterplotmatrix_Initializes_without_errors
shinytest2-tm_g_scatterplotmatrix 💔 $0.14$ $+7.96$ e2e_tm_g_scatterplotmatrix_Verify_default_values_and_settings_data_extracts_for_data_selection
shinytest2-tm_g_scatterplotmatrix 💔 $0.15$ $+8.54$ e2e_tm_g_scatterplotmatrix_Verify_module_displays_data_table
shinytest2-tm_misssing_data 💔 $0.20$ $+15.38$ e2e_tm_missing_data_Check_default_settings_and_visibility_of_the_combinations_graph_and_encodings
shinytest2-tm_misssing_data 💔 $0.22$ $+16.32$ e2e_tm_missing_data_Default_settings_and_visibility_of_the_summary_graph
shinytest2-tm_misssing_data 💔 $0.21$ $+7.50$ e2e_tm_missing_data_Initializes_without_errors
shinytest2-tm_misssing_data 💔 $0.21$ $+9.31$ e2e_tm_missing_data_Validate_By_Variable_Levels_table_values
shinytest2-tm_misssing_data 💔 $0.22$ $+13.71$ e2e_tm_missing_data_Validate_functionality_and_UI_response_for_By_Variable_Levels_
shinytest2-tm_outliers 💔 $0.12$ $+13.77$ e2e_tm_outliers_Data_extract_spec_elements_are_initialized_with_the_default_values_specified_by_outlier_var_and_categorical_var_argument.
shinytest2-tm_outliers 💔 $0.10$ $+9.00$ e2e_tm_outliers_Data_parameter_and_module_label_is_passed_properly.
shinytest2-tm_outliers 💔 $0.10$ $+13.87$ e2e_tm_outliers_Default_radio_buttons_are_set_properly.
shinytest2-tm_outliers 💔 $0.10$ $+9.10$ e2e_tm_outliers_Method_parameters_are_set_properly.
shinytest2-tm_outliers 💔 $0.10$ $+8.94$ e2e_tm_outliers_Module_is_divided_into_3_tabs.
shinytest2-tm_outliers 💔 $0.10$ $+30.92$ e2e_tm_outliers_Outlier_definition_text_and_range_are_displayed_properly_depending_on_method.
shinytest2-tm_outliers 💔 $0.10$ $+13.58$ e2e_tm_outliers_Outlier_table_is_displayed_with_proper_content.
shinytest2-tm_outliers 💔 $0.10$ $+15.57$ e2e_tm_outliers_Outliers_summary_table_is_displayed_with_proper_content.
shinytest2-tm_outliers 💔 $0.10$ $+11.41$ e2e_tm_outliers_Plot_type_is_correctly_set_by_default_and_has_appropriate_possible_options.
shinytest2-tm_outliers 💔 $0.10$ $+20.58$ e2e_tm_outliers_Plot_type_is_hidden_when_Boxplot_tab_is_not_selected.
shinytest2-tm_t_crosstable 💔 $0.13$ $+12.18$ e2e_tm_t_crosstable_Change_plot_settings
shinytest2-tm_t_crosstable 💔 $0.39$ $+6.90$ e2e_tm_t_crosstable_Initializes_without_errors
shinytest2-tm_t_crosstable 💔 $0.12$ $+9.58$ e2e_tm_t_crosstable_Verify_default_values_and_settings_data_extracts_for_data_selection
shinytest2-tm_t_crosstable 💔 $0.13$ $+9.32$ e2e_tm_t_crosstable_Verify_module_displays_data_table
shinytest2-tm_variable_browser 💔 $0.11$ $+9.17$ e2e_tm_variable_browser_Selecting_treat_variable_as_factor_changes_the_table_headers.
shinytest2-tm_variable_browser 💔 $0.12$ $+11.62$ e2e_tm_variable_browser_changing_display_density_encoding_doesn_t_show_errors.
shinytest2-tm_variable_browser 💔 $0.13$ $+12.69$ e2e_tm_variable_browser_changing_outlier_definition_encoding_doesn_t_show_errors.
shinytest2-tm_variable_browser 💔 $0.10$ $+11.89$ e2e_tm_variable_browser_changing_plot_setting_encodings_doesn_t_show_errors.
shinytest2-tm_variable_browser 💔 $0.12$ $+9.16$ e2e_tm_variable_browser_content_is_displayed_correctly.
shinytest2-tm_variable_browser 💔 $0.27$ $+8.11$ e2e_tm_variable_browser_selection_of_categorical_variable_has_a_table_with_level_header.

Results for commit 38b63dd

♻️ This comment has been updated with latest results.

@llrs-roche llrs-roche requested a review from m7pr October 28, 2025 14:38
@m7pr m7pr requested a review from Copilot October 29, 2025 12:06
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the plot_var_summary function to work with teal_data objects (qenv) instead of raw vectors, enabling better code tracking and reproducibility. The changes support integration with the teal.reporter framework for generating reproducible reports.

  • Refactored plot_var_summary to accept qenv (teal_data object) instead of raw var and var_lab parameters
  • Added filter_outliers function to return logical vectors suitable for dplyr::filter()
  • Modified internal code to build plots within teal_data environment using within() calls

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.

File Description
man/plot_var_summary.Rd Updated function signature documentation to reflect new qenv parameter instead of var and var_lab
man/filter_outliers.Rd Added documentation for new filter_outliers helper function
R/tm_variable_browser.R Refactored plot_var_summary to work with qenv, added filter_outliers, updated callers to use new API

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@m7pr m7pr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested with #913

And I was able to add a card and see the output with the code.

Great job @llrs-roche

image

@llrs-roche llrs-roche enabled auto-merge (squash) October 29, 2025 13:55
@llrs-roche llrs-roche merged commit 2c2bf2b into main Oct 30, 2025
27 of 29 checks passed
@llrs-roche llrs-roche deleted the 936_variable_browser@main branch October 30, 2025 09:24
@github-actions github-actions bot locked and limited conversation to collaborators Oct 30, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: issue with tm_variable_browser: Warning: Error in if: argument is of length zero

3 participants