modify storm detail ui

This commit is contained in:
2025-07-07 17:56:59 -04:00
parent 7d8a0593ef
commit 50d8ab9745
2 changed files with 86 additions and 121 deletions
+84 -121
View File
@@ -143,46 +143,6 @@ Col {data-width=500}
---------------------------------------------- ----------------------------------------------
### {} ### {}
```{r eval=FALSE, include=FALSE}
HTML(
'
<h4>Welcome to the Hurricane Cost Normalization Web App!</h4>
<p>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.</p>
<h6>Our Data</h6>
<p>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 <i>Bulletin of the American Meteorlogical Society</i> and <i>****JOURNAL****</i> 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.</p>
<ul>
<li><b>PL22:</b> The Pielke-Landsea (2022) normalization that adjusts for inflation, wealth per capita, and population changes. This data has been updated to 2022.</li>
<li><b>CL22:</b> The Collins-Lowe (2022) normalization that adjusts for inflation, wealth per housing unit, and housing unit changes. This data has been updated to 2022.</li>
<li><b>MMP24:</b> The Muller-Mooney Population (2024) normalization with RMW weighting on affected population.</li>
<li><b>MMH24:</b> The Muller-Mooney Housing (2024) normalization with RMW weighting on affected housing units.</li>
</ul>
<h6>Methodology Innovations</h6>
<p>Our platform incoroprates several methodological innovations over previously used cost normalization formulas:
<ul>
<li><b>Radius of Maximum Wind (RMW) Data:</b> Using landfalling RMWs to identify impacted coastal counties.</li>
<li><b>RMW Affected Area Weighting:</b> Determining affected population and housing unit figures based on RMW.</li>
<li><b>Expanded Storm Coverage:</b> Inlcuding over 200 storms analyzed with interactive data.</li>
<li><b>Up-to-date Data:</b> Using the latest population, housing unit, and economic data through 2024.</li>
</ul>
'
)
```
```{r} ```{r}
HTML( 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} Col {data-width=500}
------------------------------------ ------------------------------------
### Storm Details {data-height=200} ### Normalization Cost Index {data-height=500}
```{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}
```{r} ```{r}
output$cost_index_chart <- renderDygraph({ output$cost_index_chart <- renderDygraph({
@@ -393,24 +420,7 @@ fillCol(
) )
``` ```
Col {data-width=500} ### Landfalls {data-height=500 .no-padding}
------------------------------------
### 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}
```{r} ```{r}
output$landfalls_table <- renderDT({ output$landfalls_table <- renderDT({
req(storm_selection$is_selected) req(storm_selection$is_selected)
@@ -436,53 +446,6 @@ output$landfalls_table <- renderDT({
DTOutput("landfalls_table") 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"} Growth Trends {data-navmenu="Storm Details"}
================================ ================================
+2
View File
@@ -180,6 +180,8 @@ get_hurdat_track <- function(storm) {
lon, lon,
lat, lat,
rmw, rmw,
pressure,
windspeed,
record_identifier, record_identifier,
rmw_meters rmw_meters
) )