update select landfalls input for chart

This commit is contained in:
2025-07-14 17:46:29 -04:00
parent b341d9ad45
commit 956729f774
+28 -10
View File
@@ -291,10 +291,17 @@ observe({
unique_lfs <- get_unique_lf_ids(storm_selection) unique_lfs <- get_unique_lf_ids(storm_selection)
updateSelectInput( #updateSelectInput(
session, # session,
"storm_overview_cost_index_lf", # "storm_overview_cost_index_lf",
choices = unique_lfs$full_lf_id, # choices = unique_lfs$full_lf_id,
# selected = unique_lfs$full_lf_id[1]
#)
updateVirtualSelect(
session = session,
"storm_overview_cost_index_lf_select",
choices = prepare_choices(unique_lfs, full_lf_id, full_lf_id, lf_type),
selected = unique_lfs$full_lf_id[1] selected = unique_lfs$full_lf_id[1]
) )
@@ -392,7 +399,7 @@ DTOutput("track_data")
Col {data-width=500} Col {data-width=500}
------------------------------------ ------------------------------------
### Normalization Cost Index {data-height=500} ### Normalization Cost Index {data-height=700}
```{r} ```{r}
output$cost_index_chart <- renderDygraph({ output$cost_index_chart <- renderDygraph({
@@ -411,14 +418,25 @@ output$cost_index_chart <- renderDygraph({
dyRangeSelector(height = 30) dyRangeSelector(height = 30)
}) })
#observeEvent(input$storm_overview_select_base, { df <- data.frame(lf_type = c("LF", "LF", "LF", "DIL", "DIL", "DIL", "DIL", "ID", "ID", "ID", "ID"), lf_id = c("1", "2", "3", "1", "2", "3", "4", "1", "2", "3", "4"))
# TODO: add button to select normalized costs
#}) df_tree <- create_tree(df, levels = names(df))
fluidRow( fluidRow(
style = "height: 100%", style = "height: 100%",
column(3, column(3,
selectInput("storm_overview_cost_index_lf", "Landfall", choices = NULL), #selectInput("storm_overview_cost_index_lf", "Landfall", choices = NULL),
#treeInput("storm_overview_cost_index_lf_tree", "Landfalls", choices = df_tree, returnValue = "text")
virtualSelectInput("storm_overview_cost_index_lf_select", "Landfalls",
#choices = list(
# "LF" = c("LF1", "LF2", "LF3"),
# "DIL" = c("DIL1", "DIL2", "DIL3", "DIL4"),
# "ID" = c("ID1", "ID2", "ID3", "ID4")
#),
choices = NULL,
showValueAsTags = T,
multiple = T,
autoSelectFirstOption = T),
radioGroupButtons("storm_overview_cost_index_value", label = "Value", choices = c("Index", "Loss"), status = "outline-primary rounded-0", justified = T) radioGroupButtons("storm_overview_cost_index_value", label = "Value", choices = c("Index", "Loss"), status = "outline-primary rounded-0", justified = T)
), ),
column(9, column(9,
@@ -427,7 +445,7 @@ fluidRow(
) )
``` ```
### Landfalls {data-height=500 .no-padding} ### Landfalls {data-height=300 .no-padding}
```{r} ```{r}
output$landfalls_table <- renderDT({ output$landfalls_table <- renderDT({
req(storm_selection$is_selected) req(storm_selection$is_selected)