Building a climate risk dashboard - UI

Application exercise

April 11, 2024

Communicating climate risk

FEMA has asked us to build an improved dashboard that visualizes the risk of climate change in the United States.

Based on your submitted designs and our skill level, we will work to implement this Shiny dashboard.

Construct a user interface

Structure the dashboard layout

Position the outputs


Review the documentation for how to display different types of data (e.g. plots, tables, value boxes). Remember that for most of the outputs, they will be generated in the server function so you won’t see them rendered in the dashboard yet.

    • climate_risk |>
        gt() |>

Define the inputs


Use your Shiny cheatsheet and the reference documentation to find appropriate input types.

National tab

County tab


You can get all county names using

climate_sf |>
  arrange(STATEFP) |>

You can get all risk measures using

# hazard types
hazard_types <- climate_risk |>
  select(contains("hazard")) |>

# human-readable labels
hazard_types_labels <- hazard_types |>
  str_remove(pattern = "_hazard_type_risk_index_score") |>
  make_clean_names(case = "title")

Define code context

    • setup
    • data
    • server
    • Nothing (no context required, so omit the chunk option entirely)