mirror of
https://github.com/dylanbenzi/hurricane_normalization_app.git
synced 2026-07-29 21:01:27 +00:00
update select landfalls input for chart
This commit is contained in:
+28
-10
@@ -291,10 +291,17 @@ observe({
|
||||
|
||||
unique_lfs <- get_unique_lf_ids(storm_selection)
|
||||
|
||||
updateSelectInput(
|
||||
session,
|
||||
"storm_overview_cost_index_lf",
|
||||
choices = unique_lfs$full_lf_id,
|
||||
#updateSelectInput(
|
||||
# session,
|
||||
# "storm_overview_cost_index_lf",
|
||||
# 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]
|
||||
)
|
||||
|
||||
@@ -392,7 +399,7 @@ DTOutput("track_data")
|
||||
Col {data-width=500}
|
||||
------------------------------------
|
||||
|
||||
### Normalization Cost Index {data-height=500}
|
||||
### Normalization Cost Index {data-height=700}
|
||||
```{r}
|
||||
|
||||
output$cost_index_chart <- renderDygraph({
|
||||
@@ -411,14 +418,25 @@ output$cost_index_chart <- renderDygraph({
|
||||
dyRangeSelector(height = 30)
|
||||
})
|
||||
|
||||
#observeEvent(input$storm_overview_select_base, {
|
||||
# TODO: add button to select normalized costs
|
||||
#})
|
||||
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"))
|
||||
|
||||
df_tree <- create_tree(df, levels = names(df))
|
||||
|
||||
fluidRow(
|
||||
style = "height: 100%",
|
||||
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)
|
||||
),
|
||||
column(9,
|
||||
@@ -427,7 +445,7 @@ fluidRow(
|
||||
)
|
||||
```
|
||||
|
||||
### Landfalls {data-height=500 .no-padding}
|
||||
### Landfalls {data-height=300 .no-padding}
|
||||
```{r}
|
||||
output$landfalls_table <- renderDT({
|
||||
req(storm_selection$is_selected)
|
||||
|
||||
Reference in New Issue
Block a user