mirror of
https://github.com/johrpan/geposanui.git
synced 2025-10-26 19:27:24 +01:00
presets: Improve performance
This commit is contained in:
parent
766ffa15cb
commit
69a8326fbc
1 changed files with 39 additions and 28 deletions
|
|
@ -18,8 +18,12 @@ preset_editor_ui <- function(id) {
|
||||||
"Customize" = "custom"
|
"Customize" = "custom"
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
conditionalPanel(
|
tabsetPanel(
|
||||||
sprintf("input['%s'] == 'custom'", NS(id, "preset")),
|
id = NS(id, "customization"),
|
||||||
|
type = "hidden",
|
||||||
|
tabPanelBody(value = "none"),
|
||||||
|
tabPanelBody(
|
||||||
|
value = "custom",
|
||||||
shinyWidgets::pickerInput(
|
shinyWidgets::pickerInput(
|
||||||
inputId = NS(id, "species"),
|
inputId = NS(id, "species"),
|
||||||
label = "Included species",
|
label = "Included species",
|
||||||
|
|
@ -50,6 +54,7 @@ preset_editor_ui <- function(id) {
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
# Create a server for the preset editor.
|
# Create a server for the preset editor.
|
||||||
|
|
@ -62,11 +67,17 @@ preset_editor_server <- function(id) {
|
||||||
result <- reactiveVal(preset_replicative_species)
|
result <- reactiveVal(preset_replicative_species)
|
||||||
|
|
||||||
observeEvent(input$preset, {
|
observeEvent(input$preset, {
|
||||||
if (input$preset == "replicative") {
|
panel <- if (input$preset == "replicative") {
|
||||||
result(preset_replicative_species)
|
result(preset_replicative_species)
|
||||||
|
"none"
|
||||||
} else if (input$preset == "all") {
|
} else if (input$preset == "all") {
|
||||||
result(preset_all_species)
|
result(preset_all_species)
|
||||||
|
"none"
|
||||||
|
} else {
|
||||||
|
"custom"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
updateTabsetPanel(session, "customization", selected = panel)
|
||||||
})
|
})
|
||||||
|
|
||||||
observeEvent(input$apply_button, {
|
observeEvent(input$apply_button, {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue