update cost graph query

This commit is contained in:
2025-07-14 20:56:36 -04:00
parent 956729f774
commit 8a0c3341dc
2 changed files with 56 additions and 2 deletions
+30 -2
View File
@@ -401,8 +401,35 @@ Col {data-width=500}
### Normalization Cost Index {data-height=700}
```{r}
output$cost_index_chart <- renderDygraph({
req(storm_selection$is_selected, input$storm_overview_cost_index_lf_select, input$storm_overview_cost_index_mmh_mmp)
selected_lfs <- input$storm_overview_cost_index_lf_select
loss_type <- input$storm_overview_cost_index_mmh_mmp
display_columns <- c("normalization_year")
normalizations <- get_normalized_cost_index(storm_selection) %>%
rename(
hindex = mmh_index,
pindex = mmp_index,
) %>%
mutate(
normalization_year = as.Date(paste0(normalization_year, "-01-01"))
) %>%
pivot_wider(
names_from = full_lf_id,
values_from = c(hindex, pindex, mmh, mmp),
names_glue = "{full_lf_id}_{.value}"
) %>%
arrange(normalization_year)
# TODO: add filtering
})
output$cost_index_chart_old <- renderDygraph({
req(storm_selection$is_selected, input$storm_overview_cost_index_lf)
cost_index <- get_normalized_cost_index(storm_selection, input$storm_overview_cost_index_lf) %>%
@@ -437,7 +464,8 @@ fluidRow(
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),
checkboxGroupButtons("storm_overview_cost_index_mmh_mmp", label = "MMH/MMP", choices = c("MMH", "MMP"), selected = c("MMH", "MMP"), status = "outline-primary rounded-0", justified = T)
),
column(9,
dygraphOutput("cost_index_chart")