-
Notifications
You must be signed in to change notification settings - Fork 0
/
modules.R
53 lines (38 loc) · 981 Bytes
/
modules.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
### numeric input module
numericVInput <- function(id, label, value = 0) {
ns <- NS(id)
tagList(
#numericInput usually paired with a text Output
numericInput(inputId = ns("nInput"), label = list(icon("info-circle") |>
bsplus::bs_embed_tooltip(title = tooltipValues(label)), title = label), value = value, width = "100px", max = 100, min = 1)
)
}
numericVServer <- function(id, lbl, val) {
moduleServer(
id,
function(input, output, session) {
bins = reactive(input$nInput)
return(bins)
}
)
}
radioUI <- function(id, label, choices) {
ns <- NS(id)
tagList(
radioGroupButtons(
inputId = ns("radioB"),
label = label,
choices = choices,
justified = TRUE
)
)
}
radioBServer <- function(id){
moduleServer(
id,
function(input, output, session) {
type = reactive(input$radioB)
return(type)
}
)
}