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

113 adjust toggle_slider ranges #315

Merged
merged 7 commits into from
Oct 9, 2024
Merged

113 adjust toggle_slider ranges #315

merged 7 commits into from
Oct 9, 2024

Conversation

m7pr
Copy link
Contributor

@m7pr m7pr commented Oct 7, 2024

This is solution for #133

toggle_slider is a component that is a sliderInput that can be toggled to become a numericInput.

image image

The PR fixes the issue with ranges on sliderInput that should be adjusted based on numericInput.

So if slider had ranges min_sliderInput and max_sliderInput and values for numercInput are changed, so that min(numercInput) is lower than min_sliderInput or max(numercInput) is greater than max_sliderInput, then min_sliderInput or max_sliderInput should be extended for new ranges.

Example 1

min_sliderInput, max_sliderInput - on start 0, 55

image

hence numericInput on start 0, 55

image

numericInput changes to -5, 65

image

sliderInput changes to -5, 65

image

Example 2

Continuation of the previous one, if you change numericInput from -5, 65

image

to 4, 45

image

sliderInput is reset (the min and max) to original 0, 55 but values are set to 4, 45

image

@m7pr m7pr added the core label Oct 7, 2024
@m7pr m7pr requested review from donyunardi and vedhav October 7, 2024 12:01
Copy link
Contributor

github-actions bot commented Oct 7, 2024

badge

Code Coverage Summary

Filename                                 Stmts    Miss  Cover    Missing
-------------------------------------  -------  ------  -------  ---------
R/tm_g_gh_boxplot.R                        349     349  0.00%    175-591
R/tm_g_gh_correlationplot.R                554     554  0.00%    227-890
R/tm_g_gh_density_distribution_plot.R      276     276  0.00%    135-462
R/tm_g_gh_lineplot.R                       560     560  0.00%    161-815
R/tm_g_gh_scatterplot.R                    244     244  0.00%    144-440
R/tm_g_gh_spaghettiplot.R                  314     314  0.00%    194-590
R/toggleable_slider.R                      158     158  0.00%    73-248
R/utils-arbitrary_lines.r                  125     125  0.00%    19-176
R/utils-data_constraints.r                 190     190  0.00%    2-257
R/utils-keep_range_slider_updated.r         29      29  0.00%    9-45
R/utils-maptrt.r                             9       9  0.00%    24-36
R/utils-templ_ui.r                          66      66  0.00%    2-98
R/utils.R                                   49      49  0.00%    12-112
R/zzz.R                                      2       2  0.00%    2-3
TOTAL                                     2925    2925  0.00%

Diff against main

Filename                 Stmts    Miss  Cover
---------------------  -------  ------  --------
R/toggleable_slider.R       +4      +4  +100.00%
TOTAL                       +4      +4  +100.00%

Results for commit: a54d7f2

Minimum allowed coverage is 80%

♻️ This comment has been updated with latest results

Copy link
Contributor

@donyunardi donyunardi left a comment

Choose a reason for hiding this comment

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

I still see the same problem.

I used the example code that's provided in this comment and changed the "Select an X-Axis Biomarker" to "CRP".

Is it because the range is too short?

image

@m7pr
Copy link
Contributor Author

m7pr commented Oct 8, 2024

I still see the same problem.

What problem do you see? I would assume you show the state of sliderInput and numericInput to describe the problem. Here you only posted sliderInput. What the user really wanted is to get sliderInput adjusted once numericInput get's changes and exceeds the limits of sliderInput

Screen.Recording.2024-10-08.094314.mp4

@m7pr
Copy link
Contributor Author

m7pr commented Oct 8, 2024

Ah, ok I see. This issue is related to two things. The second thing are the ticks on slider that are non-unique. Will have a look at it as well

Copy link
Contributor

@donyunardi donyunardi left a comment

Choose a reason for hiding this comment

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

Looks good to me.
As discussed, we'll address the tick issue with a different PR.

@m7pr m7pr merged commit ad93f3c into main Oct 9, 2024
28 checks passed
@m7pr m7pr deleted the 113_toggle_slider_ranges@main branch October 9, 2024 08:50
@github-actions github-actions bot locked and limited conversation to collaborators Oct 9, 2024
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.

2 participants