mirror of
https://github.com/johrpan/geposanui.git
synced 2025-10-26 11:17:24 +01:00
methods: Allow negative weights
This commit is contained in:
parent
c009bfa371
commit
d654edb8a3
1 changed files with 5 additions and 8 deletions
13
R/methods.R
13
R/methods.R
|
|
@ -1,7 +1,5 @@
|
||||||
# Construct UI for the methods editor.
|
# Construct UI for the methods editor.
|
||||||
methods_ui <- function(id) {
|
methods_ui <- function(id) {
|
||||||
initial_weight <- 100 / length(methods)
|
|
||||||
|
|
||||||
verticalLayout(
|
verticalLayout(
|
||||||
h3("Methods"),
|
h3("Methods"),
|
||||||
div(style = "margin-top: 16px"),
|
div(style = "margin-top: 16px"),
|
||||||
|
|
@ -18,11 +16,10 @@ methods_ui <- function(id) {
|
||||||
sliderInput(
|
sliderInput(
|
||||||
NS(id, sprintf("%s_weight", method$id)),
|
NS(id, sprintf("%s_weight", method$id)),
|
||||||
NULL,
|
NULL,
|
||||||
post = "%",
|
min = -1.0,
|
||||||
min = 0,
|
max = 1.0,
|
||||||
max = 100,
|
step = 0.01,
|
||||||
step = 1,
|
value = 1.0
|
||||||
value = initial_weight
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}),
|
}),
|
||||||
|
|
@ -75,7 +72,7 @@ methods_server <- function(id, analysis, min_n_species) {
|
||||||
updateSliderInput(
|
updateSliderInput(
|
||||||
session,
|
session,
|
||||||
sprintf("%s_weight", method_id),
|
sprintf("%s_weight", method_id),
|
||||||
value = weights[[method_id]] * 100
|
value = weights[[method_id]]
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue