From d654edb8a3e1f9fe87d56e8218319f112c0e1e57 Mon Sep 17 00:00:00 2001 From: Elias Projahn Date: Tue, 16 Nov 2021 15:20:42 +0100 Subject: [PATCH] methods: Allow negative weights --- R/methods.R | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/R/methods.R b/R/methods.R index fedc4d0..4a44f72 100644 --- a/R/methods.R +++ b/R/methods.R @@ -1,7 +1,5 @@ # Construct UI for the methods editor. methods_ui <- function(id) { - initial_weight <- 100 / length(methods) - verticalLayout( h3("Methods"), div(style = "margin-top: 16px"), @@ -18,11 +16,10 @@ methods_ui <- function(id) { sliderInput( NS(id, sprintf("%s_weight", method$id)), NULL, - post = "%", - min = 0, - max = 100, - step = 1, - value = initial_weight + min = -1.0, + max = 1.0, + step = 0.01, + value = 1.0 ) ) }), @@ -75,7 +72,7 @@ methods_server <- function(id, analysis, min_n_species) { updateSliderInput( session, sprintf("%s_weight", method_id), - value = weights[[method_id]] * 100 + value = weights[[method_id]] ) } })