Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Handle delayed choices #256

Merged
merged 8 commits into from
Feb 14, 2024
Merged

Handle delayed choices #256

merged 8 commits into from
Feb 14, 2024

Conversation

vedhav
Copy link
Contributor

@vedhav vedhav commented Jan 29, 2024

Closes #255

Fixes the modules to get delayed choices:

  • tm_g_gh_boxplot
  • tm_g_gh_correlationplot
  • tm_g_gh_density_distribution_plot
  • tm_g_gh_lineplot
  • tm_g_gh_scatterplot
  • tm_g_gh_spaghettiplot

@vedhav vedhav added bug Something isn't working core labels Jan 29, 2024
@vedhav vedhav requested a review from gogonzo January 29, 2024 11:45
@vedhav
Copy link
Contributor Author

vedhav commented Jan 29, 2024

@gogonzo Before I went ahead and implemented this fix for all the modules I wanted to check with you if this is the best solution we have for this. I was not so sure about doing it this way.

Copy link
Contributor

github-actions bot commented Jan 29, 2024

badge

Code Coverage Summary

Filename                                 Stmts    Miss  Cover    Missing
-------------------------------------  -------  ------  -------  ---------
R/tm_g_gh_boxplot.R                        359     359  0.00%    172-599
R/tm_g_gh_correlationplot.R                570     570  0.00%    222-900
R/tm_g_gh_density_distribution_plot.R      285     285  0.00%    134-470
R/tm_g_gh_lineplot.R                       576     576  0.00%    160-833
R/tm_g_gh_scatterplot.R                    252     252  0.00%    142-447
R/tm_g_gh_spaghettiplot.R                  304     304  0.00%    189-561
R/toggleable_slider.R                      154     154  0.00%    82-253
R/utils-arbitrary_lines.r                  125     125  0.00%    19-175
R/utils-data_constraints.r                 190     190  0.00%    2-257
R/utils-keep_range_slider_updated.r         23      23  0.00%    8-38
R/utils-maptrt.r                             9       9  0.00%    25-37
R/utils-templ_ui.r                          48      48  0.00%    2-73
R/utils.R                                   39      39  0.00%    12-83
R/zzz.R                                      1       1  0.00%    2
TOTAL                                     2935    2935  0.00%

Diff against main

Filename                                 Stmts    Miss  Cover
-------------------------------------  -------  ------  --------
R/tm_g_gh_boxplot.R                         +8      +8  +100.00%
R/tm_g_gh_correlationplot.R                +13     +13  +100.00%
R/tm_g_gh_density_distribution_plot.R      +10     +10  +100.00%
R/tm_g_gh_lineplot.R                       +12     +12  +100.00%
R/tm_g_gh_scatterplot.R                    +12     +12  +100.00%
R/tm_g_gh_spaghettiplot.R                  +12     +12  +100.00%
TOTAL                                      +67     +67  +100.00%

Results for commit: b146d0d

Minimum allowed coverage is 80%

♻️ This comment has been updated with latest results

R/tm_g_gh_boxplot.R Outdated Show resolved Hide resolved
@m7pr
Copy link
Contributor

m7pr commented Feb 9, 2024

Hey @vedhav would you be able to summarize the current state of this PR?

@vedhav
Copy link
Contributor Author

vedhav commented Feb 9, 2024

It's ready to review and merge. The test would be to check if you can run the examples listed in the issue on main and reproduce the error which will go away when you checkout to this branch.
This issue was observed in tmc earlier and the root cause of this issue was that the delayed logic from the modules was moved to teal.transform but, looks like there were some inputs which was breaking the modules when delayed_data was being passed.

@vedhav
Copy link
Contributor Author

vedhav commented Feb 9, 2024

The fix was to use the teal.transform::resolve_delayed and convert these delayed data into spec and choices values.

@m7pr
Copy link
Contributor

m7pr commented Feb 12, 2024

Alrighty, thanks for the update. Taking a look now

@m7pr
Copy link
Contributor

m7pr commented Feb 12, 2024

Hey, this branch fixed the issue for tm_g_gh_boxplot (I run the code from #255 (comment)) .

Can you potentially share example app with other modules using delayed_choices?

@m7pr
Copy link
Contributor

m7pr commented Feb 13, 2024

Ok, I will test the whole longititudinal app run locally on my machine, but built from this branch https://github.com/insightsengineering/teal.gallery/blob/main/longitudinal/app.R

@m7pr
Copy link
Contributor

m7pr commented Feb 13, 2024

Hey @vedhav when I run teal.gallery app (on dev branch) called longitudinal on teal.goshawk from this branch I get error for Visualizations -> Line Plot tab. Everything else is smooth besides Variable Browser but I get it's out of scope of this issue.

Line Plot

Listening on http://127.0.0.1:7618
[INFO] 2024-02-13 16:17:03.5299 pid:6356 token:[dff910ff] teal Initializing reporter_previewer_module
Warning: The 'plotly_relayout' event tied a source ID of 'teal-main_ui-filter_panel-active-ADSL-filter-ADSL_AGE-inputs-histogram_plot' is not registered. In order to obtain this event data, please add `event_register(p, 'plotly_relayout')` to the plot (`p`) that you wish to obtain event data from.
Warning: Error in [[: subscript out of bounds
  168: <Anonymous>
  167: FUN [C:/Rprojects/teal.goshawk/R/tm_g_gh_lineplot.R#523]
  166: vapply
  164: <reactive> [C:/Rprojects/teal.goshawk/R/tm_g_gh_lineplot.R#518]
  148: line_type_selected
  141: <reactive> [C:/Rprojects/teal.goshawk/R/tm_g_gh_lineplot.R#679]
  125: plot_q
  124: <reactive>
  108: plot_r
   99: renderUI
   98: func
   85: renderFunc
   84: output$teal-main_ui-root-visualizations-Line_Plot-module-plot-plot_out_main
    3: runApp
    2: print.shiny.appobj
    1: <Anonymous>
Warning: Error in [[: subscript out of bounds
  3: runApp
  2: print.shiny.appobj
  1: <Anonymous>

Variable Browser

image

@vedhav
Copy link
Contributor Author

vedhav commented Feb 13, 2024

Thanks for testing. I think it's a new bug that has popped up as Variable Browser comes from tmg. I'll have a deeper look and create a relevant issue on GitHub.

@m7pr
Copy link
Contributor

m7pr commented Feb 13, 2024

Let me know when you will fix teal.gallery on dev and I'll pull and review again. Thanks!

@vedhav
Copy link
Contributor Author

vedhav commented Feb 14, 2024

@m7pr This PR will fix the issue. Looks like it was broken for a long time. Not sure how we missed it.

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.

Alrighty, so this issue is fixed, and the other one (new one) that arrised is discussed in another thread. You are good to merge, when you fix the R CMD CHECK failing.

@vedhav vedhav enabled auto-merge (squash) February 14, 2024 15:45
@vedhav vedhav merged commit 7fd5c73 into main Feb 14, 2024
23 checks passed
@vedhav vedhav deleted the 255-fix-resolve-delayed branch February 14, 2024 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Error in some modules due to delayed_value_choices
3 participants