Open npaszty opened 3 months ago
I think this is a bigger issue, not necesserilly just in modules from teal.goshawk
but with teal
in general.
I think encoding panel gets created the moment when module is opened, and uses what was currently displayed in the filter panel, for the time being of the module till the end of the app.
Encodings do not get refreshed when filters are edited in the filter panel. I will open an issue in teal
or teal.slice
when I will create a reproducible example for developers to help.
This happens for all plots for their all UI elements. I will change the name of the issue. For boxplot I think this part is responsible - it does not get updated when filter panel adds or remove filters.
https://github.com/insightsengineering/teal.goshawk/blob/main/R/tm_g_gh_boxplot.R#L330-L345 https://github.com/insightsengineering/teal.goshawk/blob/28735c89aa4eebaf3b4d38f2e40847ea3b2edb1c/R/tm_g_gh_boxplot.R#L330-L345
Other plots have similar code, so once we figure this out for a boxplot, we can figure this out for the rest of the plots in here.
I was able to create a minimal reproducible example with an open data. I believe the main reason of this behavior is the value_choices
function in param = choices_selected(choices = value_choices("ADLB", "PARAMCD", "PARAM"))
.
To reproduce the issue:
View Data
tab, create ADLB
filter for PARAMCD
variable. Pick 2 levels.Box Plot
tab, check choices under Select an X-Axis Biomarker
- there are only 2.ADLB
+PARAMCD
- there are still 2 choices in Select an X-Axis Biomarker
.Box Plot
tab without any filters created, check choices in Select an X-Axis Biomarker
- there are 3.ADLB
+PARAMCD
now, there will always be 3 choices, no matter how many levels were left in data.@npaszty @gogonzo we are currently running a huge overhaul in teal
and filter panael and the way we manage the data. I would recommend revisiting this issue once we are done with this refactor in teal
https://github.com/insightsengineering/teal/pull/1253
@m7pr @gogonzo
thanks for looking into this. sounds like a big deal. this issue can be replicated in the teal.gallery app so that's a working example.
what I noticed in the teal.gallery app is that all the modules fail to produce a plot because the "Select a Biomarker" UI item doesn't default to the first PARAMCD that is filtered to which is CRP. so a validation error is thrown
however in the study app the module behavior is different. for example, the first PARAMCD in the list is ALBUM so alphabetically before ALT. after filtering in the manner described "What happened" section above and navigating to boxplot, it produces a plot for ALT which is the first PARAMCD selected in the filtered PARAMCD. I updated the "What happened" section of this issue.
@m7pr
removed priority since you think it's a bigger issue with teal itself and may be handled in a current refactoring focus area.
Note to consider when working on the issue:
I think some encoding elements were build back then on unfiltered data (_raw
today).
Note from discussion:
What happened?
"Select Biomarker" menu does not refresh do display all biomarkers available in data after filter panel filter on PARAMCD is removed.
Manifested in study data we are using to test upversioning and can replicate in teal.gallery app as well but there is different behavior as far as the modules producing a plot. none of the teal gallery app plots are produced if ALT is filtered out as a first step. however see below for what happens in the study data app we are using for testing.
Steps
box plot throws validation error. this is actually the sample app behavior. the study app produces a boxplot of ALTsessionInfo()
Relevant log output
Code of Conduct
Contribution Guidelines
Security Policy