mirror of
https://github.com/dylanbenzi/hurricane_normalization_app.git
synced 2026-07-30 05:08:57 +00:00
update cost graph query
This commit is contained in:
+30
-2
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user