add log scale to normalization chart

This commit is contained in:
2025-07-19 16:49:47 -04:00
parent b0c93563f5
commit b21b814b1d
+12 -8
View File
@@ -346,7 +346,14 @@ output$cost_index_chart <- renderDygraph({
req(storm_yearly_normalization, req(storm_yearly_normalization,
input$storm_overview_cost_index_lf_select, input$storm_overview_cost_index_lf_select,
input$storm_overview_cost_index_mmh_mmp, input$storm_overview_cost_index_mmh_mmp,
input$storm_overview_cost_index_scale) input$storm_overview_cost_index_scale,
input$storm_overview_cost_index_y_scale)
if(input$storm_overview_cost_index_y_scale == "Log") {
is_y_log <- T
}else{
is_y_log <- F
}
normalized_data <- storm_yearly_normalization() %>% normalized_data <- storm_yearly_normalization() %>%
rename( rename(
@@ -396,7 +403,8 @@ output$cost_index_chart <- renderDygraph({
colors = paletteer_d("ggthemes::Classic_Purple_Gray_12", ncol(normalization_index - 1)), colors = paletteer_d("ggthemes::Classic_Purple_Gray_12", ncol(normalization_index - 1)),
fillGraph = T, fillGraph = T,
fillAlpha = .2, fillAlpha = .2,
labelsKMB = T,
logscale = is_y_log
) %>% ) %>%
dyAxis("x", drawGrid = F) %>% dyAxis("x", drawGrid = F) %>%
dyRangeSelector() dyRangeSelector()
@@ -406,17 +414,13 @@ fluidRow(
style = "height: 100%", style = "height: 100%",
column(3, column(3,
virtualSelectInput("storm_overview_cost_index_lf_select", "Landfalls", 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, choices = NULL,
showValueAsTags = T, showValueAsTags = T,
multiple = T, multiple = T,
autoSelectFirstOption = T), autoSelectFirstOption = T),
radioGroupButtons("storm_overview_cost_index_scale", label = "Value", choices = c("Index", "Loss"), status = "outline-primary rounded-0", justified = T), radioGroupButtons("storm_overview_cost_index_scale", 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) 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),
radioGroupButtons("storm_overview_cost_index_y_scale", label = "Y-Axis Scale", choices = c("Linear", "Log"), status = "outline-primary rounded-0", justified = T)
), ),
column(9, column(9,
dygraphOutput("cost_index_chart") dygraphOutput("cost_index_chart")