diff --git a/dashboard.Rmd b/dashboard.Rmd index 99a23f3..f043726 100644 --- a/dashboard.Rmd +++ b/dashboard.Rmd @@ -143,46 +143,6 @@ Col {data-width=500} ---------------------------------------------- ### {} -```{r eval=FALSE, include=FALSE} -HTML( - ' -

Welcome to the Hurricane Cost Normalization Web App!

- -

Our platform provides access to normalized hurricane dama data spanning from 1900 to 2024, allowing researchers, policymakers, insurance professional, and the public to better understand how hurricane costs have changed over time.

- -
Our Data
- -

The core datasets used in this app are based on research by Muller et al. (2025) and the expanded analysis by Mooney et al. (2025), published in Bulletin of the American Meteorlogical Society and ****JOURNAL**** respectively. These studies update and refine hurricane damage normalization methodologies to provide a more accurate picture of how historical hurricanes would impact today\'s society.

- - - -
Methodology Innovations
- -

Our platform incoroprates several methodological innovations over previously used cost normalization formulas: - -

- ' -) - -``` - - ```{r} HTML( ' @@ -334,25 +294,92 @@ observe({ }) ``` +Col {data-width=500 .tabset} +------------------------------------ + +### Track Map {.no-padding} +```{r} +storm_track <- reactive({ + req(storm_selection$is_selected) + + result <- get_hurdat_track(storm_selection) + + return(result) +}) + +output$track_map <- renderLeaflet({ + leaflet() %>% + addProviderTiles("CartoDB.Positron", option = providerTileOptions(minZoom = 2, maxZoom = 18)) + # %>% setView(lng = -89.8, lat = 29.6, zoom = 8) +}) + +observe({ + req(storm_selection$is_selected) + + storm_track <- storm_track() + + leafletProxy("track_map", data = storm_track) %>% + clearShapes() %>% + clearMarkers() %>% + addPolylines( + data = storm_track, + lng = ~lon, + lat = ~lat, + weight = 4, + color = "blue" + ) %>% + addCircleMarkers( + data = storm_track %>% filter(record_identifier == "L"), + lng = ~lon, + lat = ~lat, + radius = 5, + weight = 0, + color = "red", + fillColor = "red", + fillOpacity = 0.8 + ) %>% + addCircles( + data = storm_track %>% filter(record_identifier == "L"), + lng = ~lon, + lat = ~lat, + radius = ~rmw_meters, + weight = 2, + color = "red", + fillColor = "red", + fillOpacity = 0.3 + ) +}) + +leafletOutput("track_map", height = "100%") +``` + +### Track Data {.no-padding} +```{r} +output$track_data <- renderDT({ + datatable( + storm_track() %>% select(datetime, lon, lat, rmw, pressure, windspeed, record_identifier), + rownames = F, + colnames = c("Date", "Longitude", "Latitude", "RMW (NM)", "Pressure (mb)", "Windpseed (KT)", "Identifier"), + selection = "none", + options = list( + pageLength = 1000, + order = list(0, 'desc'), + searching = F, + paging = F, + info = F, + lengthChange = F, + server = T + ) + ) +}) + +DTOutput("track_data") +``` + Col {data-width=500} ------------------------------------ -### Storm Details {data-height=200} -```{r} -# TODO: add storm details section: name, base loss, base loss source, etc. -HTML(' - -') - -textOutput("current_time") - -output$current_time <- renderText({ - invalidateLater(100) - format(Sys.time(), "%H:%M:%S %p") -}) -``` - -### Normalization Cost Index {data-height=800} +### Normalization Cost Index {data-height=500} ```{r} output$cost_index_chart <- renderDygraph({ @@ -393,24 +420,7 @@ fillCol( ) ``` -Col {data-width=500} ------------------------------------- - -### Fatalities {data-height=200} -```{r} -fluidRow( - column(6, - HTML(' - - ') - ), - column(6, - #actionLink("fatalitiesLink", tagList(icon("arrow-right"), "Fatalities dashboard"), class = "btn btn-outline") - ) -) -``` - -### Landfalls {data-height=300 .no-padding} +### Landfalls {data-height=500 .no-padding} ```{r} output$landfalls_table <- renderDT({ req(storm_selection$is_selected) @@ -436,53 +446,6 @@ output$landfalls_table <- renderDT({ DTOutput("landfalls_table") ``` -### Storm Track {data-height=500 .no-padding} -```{r} -output$track_map <- renderLeaflet({ - leaflet() %>% - addProviderTiles("CartoDB.Positron", option = providerTileOptions(minZoom = 2, maxZoom = 18)) - # %>% setView(lng = -89.8, lat = 29.6, zoom = 8) -}) - -observe({ - req(storm_selection$is_selected) - - storm_track <- get_hurdat_track(storm_selection) - - leafletProxy("track_map", data = storm_track) %>% - clearShapes() %>% - clearMarkers() %>% - addPolylines( - data = storm_track, - lng = ~lon, - lat = ~lat, - weight = 4, - color = "blue" - ) %>% - addCircleMarkers( - data = storm_track %>% filter(record_identifier == "L"), - lng = ~lon, - lat = ~lat, - radius = 5, - weight = 0, - color = "red", - fillColor = "red", - fillOpacity = 0.8 - ) %>% - addCircles( - data = storm_track %>% filter(record_identifier == "L"), - lng = ~lon, - lat = ~lat, - radius = ~rmw_meters, - weight = 2, - color = "red", - fillColor = "red", - fillOpacity = 0.3 - ) -}) - -leafletOutput("track_map", height = "100%") -``` Growth Trends {data-navmenu="Storm Details"} ================================ diff --git a/queries.R b/queries.R index b75ad96..ba0917d 100644 --- a/queries.R +++ b/queries.R @@ -180,6 +180,8 @@ get_hurdat_track <- function(storm) { lon, lat, rmw, + pressure, + windspeed, record_identifier, rmw_meters )