insightsengineering / insightsengineering/teal.picks
[Feature Request]: Splitting values into multiple inputs with teal.picks
- Dominant language
- R
- Stars
- 4
- Forks
- 0
- Avg merge
- 6d 11h
- Merged PRs (30d)
- 3
Description
### Feature description
Many modules have a pattern that is the selection of a variable and then some comparison of the values on it: Usually there is a control/reference group and then other groups (treatment or all the other groups):
How we implement that with picks being used to select the variable?
If we use picks for the variable selection then the UI will be different between variables and the values used for the comparison.
```r
var = picks(dataset(...), variables(...))
control = selectInput()
treatment = selectInput()
```
If we internally use picks to select all of them we can end up with a similar looking UI but the user could select the same variable on control and treatment (if we don't add some validation):
```r
var = picks(dataset(...), variables(...))
control = c(var, values(selected = 1))
treatment = c(var, values(selected = 2))
```
My personal opinion is that with the second approach we can create a function/widget on teal.picks that does that validation automatically. We could detect automatically what's on the control/reference group and extract it from the other choices.
### Code of Conduct
- [x] I agree to follow this project's Code of Conduct.
### Contribution Guidelines
- [x] I agree to follow this project's Contribution Guidelines.
### Security Policy
- [x] I agree to follow this project's Security Policy.
Contributor guide
Assessment
This issue has not been assessed yet.