Skip to content

Commit

Permalink
Adjust m slider so that always m>n
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavdelius committed May 3, 2024
1 parent fb7bdbc commit 244b48c
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions R/reproductionControl.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ reproductionControl <- function(input, output, session, params, params_old,
updateSliderInput(session, "w_max",
min = signif(input$w_max / 2, 2),
max = signif(input$w_max * 1.5, 2))
updateSliderInput(session, "m",
min = signif(input$m / 2, 2),
max = signif(input$m * 1.5, 2))

p@species_params[sp, "w_mat25"] <- input$w_mat * input$wfrac
p@species_params[sp, "w_mat"] <- input$w_mat
Expand Down Expand Up @@ -50,9 +47,10 @@ reproductionControlUI <- function(p, input) {
sliderInput("w_max", "w_max", value = sp$w_max,
min = signif(sp$w_max / 2, 2),
max = signif(sp$w_max * 1.5, 2)),
# m must always be larger than n
sliderInput("m", "m", value = sp$m,
min = signif(sp$m / 2, 2),
max = signif(sp$m * 1.5, 2),
min = signif(sp$n, 2),
max = signif(1.5, 2),
step = 0.01)
)
}
Expand Down

0 comments on commit 244b48c

Please sign in to comment.