Move methods to separate module

This commit is contained in:
Elias Projahn 2021-10-19 16:44:29 +02:00
parent 079deb0faf
commit bf6df6af86
3 changed files with 105 additions and 77 deletions

31
ui.R
View file

@ -3,6 +3,8 @@ library(plotly)
library(rclipboard)
library(shiny)
source("methods.R")
ui <- fluidPage(
shinyjs::useShinyjs(),
rclipboardSetup(),
@ -29,34 +31,7 @@ ui <- fluidPage(
step = 1,
value = 50
),
h3("Methods"),
actionButton(
"optimize_button",
"Find optimal weights",
icon = icon("check-double")
),
div(style = "margin-top: 16px"),
lapply(methods, function(method) {
verticalLayout(
checkboxInput(
method$id,
span(
method$description,
style = "font-weight: bold"
),
value = TRUE
),
sliderInput(
sprintf("%s_weight", method$id),
NULL,
post = "%",
min = 0,
max = 100,
step = 1,
value = 100
)
)
})
methods_ui("methods")
),
mainPanel(
tabsetPanel(