-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodule_search.R
50 lines (49 loc) · 1.77 KB
/
module_search.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
49
50
# UI module
searchBarUI <- function(id_bar, id_button, id_reset){
tagList(
tags$style(HTML("
.selectize-control.single .selectize-input::after {
content: none !important;
}
")),
fluidRow(
column(6, align = "right",
selectizeInput(inputId = id_bar,
label = "Enter a gene ID/name to explore",
choices = NULL,
selected = "", # Set to empty string
multiple = FALSE,
options = list(
placeholder = 'e.g ENSG00000141510 / TP53',
create = FALSE,
maxOptions = 10,
loadThrottle = 100
)
)
),
column(6, align = "left",
actionButton(inputId = id_button,
label = "Submit",
style = "margin-top: 25px;"),
actionButton(inputId = id_reset,
label = "Reset",
style = "margin-top: 25px;")
)
)
)
}
# Server function
searchBarServer <- function(id_bar, autocomplete_list) {
updateSelectizeInput(inputId = id_bar,
server = TRUE,
choices = autocomplete_list,
selected = "", # Set to empty string when updating the search bars
session = getDefaultReactiveDomain(),
options = list(
placeholder = 'e.g ENSG00000141510 / TP53',
create = FALSE,
maxOptions = 10,
loadThrottle = 100
)
)
}