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

Modularise code #40

Open
1 of 4 tasks
fredjaya opened this issue May 16, 2024 · 0 comments
Open
1 of 4 tasks

Modularise code #40

fredjaya opened this issue May 16, 2024 · 0 comments
Labels

Comments

@fredjaya
Copy link
Collaborator

fredjaya commented May 16, 2024

Overview

This issue will track repetitive components that can be modularised.

  • 1. Updating of reactiveValues() (numerics) boundNumericInput() and saveNumericInput`
  • 2. Ditto, but with processOther()
  • 3. Validation
  • 4. numericInput with "Other"

1. Updating of reactiveValues()

Either updating numeric values (a):

  observeEvent(input$optsCostUnit, {
    costs$unit <- as.numeric(input$optsCostUnit)
  }, ignoreNULL = TRUE)

Inputs unit, pool, cluster, and period all share:

  • numericInput(inputId = ns(X), label, value = isolate(Y), min = 1e-6, step = 0.5)

And the UI, to make a module pair, is the above.

2. For processOther():

  observeEvent(input$optsPrevalence, {
    design_opts$prev <- processOther(input, "optsPrevalence")
  }, ignoreNULL = TRUE)

3. Validation

Where mod_ui = The error text displayed and mod_server = maybe

reactiveValues(
    exists = FALSE,
    valid = FALSE
)

where the validation logic should req(exists) to avoid propogating NULL etc.

4. numericInput with "Other"

e.g. Prevalence, Correlation, Sensitivity, Specificity

@fredjaya fredjaya mentioned this issue May 16, 2024
5 tasks
fredjaya added a commit that referenced this issue May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant