Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modified maps x2 #9

Merged
merged 1 commit into from
Jan 7, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions Indicator_Dashboard/IndicatorDashboard.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,6 @@ indicator_data <- read_csv(here('Data', paste0('Dashboard_Data_', report_year, '
indicator_map_data <- read_csv(here('Data', paste0('Dashboard_Map_Data_', report_year, '.csv')))

#Access map base data
land_proj_global <- readRDS(here('Data', 'rnatearth_land.RData'))
coast_proj_global <- readRDS(here('Data', 'rnatearth_coast.RData'))
land_proj <- readRDS(here('Data', 'rnatearth_MH_land.RData'))
coast_proj <- readRDS(here('Data', 'rnatearth_MH_coast.RData'))
land_proj_enso <- readRDS(here('Data', 'rnatearth_enso_land.RData'))
Expand Down Expand Up @@ -519,7 +517,7 @@ output$map <- renderPlotly({

} else{ #indicators without spatial data (CO2, pH, ENSO, PDO, Rainfall)

ext <- st_bbox(land_proj_global)
ext <- st_bbox(land_proj)

#make base map
p <- ggplot() +
Expand All @@ -537,8 +535,8 @@ output$map <- renderPlotly({

#show Mauna Loa Observatory location
p <- p +
geom_sf(data = land_proj_global, fill = "#A5A5A5", color = "#A5A5A5", linewidth = 0.5) +
geom_sf(data = coast_proj_global, color = "black", linewidth = 0.5) +
geom_sf(data = land_proj, fill = "#A5A5A5", color = "#A5A5A5", linewidth = 0.5) +
geom_sf(data = coast_proj, color = "black", linewidth = 0.5) +
coord_sf(xlim = c(ext$xmin, ext$xmax), ylim = c(ext$ymin, ext$ymax), expand = F) +
annotate(geom = "point", x = 24.4, y = 19.5, color = crustacean[2]) +
annotate(geom = "text", x = 33.5, y = 19.5, color = "black", size = 3.2,
Expand All @@ -560,8 +558,8 @@ output$map <- renderPlotly({

#show station ALOHA location
p <- p +
geom_sf(data = land_proj_global, fill = "#A5A5A5", color = "#A5A5A5", linewidth = 0.5) +
geom_sf(data = coast_proj_global, color = "black", linewidth = 0.5) +
geom_sf(data = land_proj, fill = "#A5A5A5", color = "#A5A5A5", linewidth = 0.5) +
geom_sf(data = coast_proj, color = "black", linewidth = 0.5) +
coord_sf(xlim = c(ext$xmin, ext$xmax), ylim = c(ext$ymin, ext$ymax), expand = F) +
annotate(geom = "point", x = 22.0, y = 22.75, color = crustacean[2]) +
annotate(geom = "text", x = 22.0, y = 26.5, color = "black", size = 3.2,
Expand Down Expand Up @@ -611,8 +609,8 @@ output$map <- renderPlotly({
geom_rect(aes(xmin = ext$xmin, xmax = ext$xmax, ymin = 20, ymax = ext$ymax),
color = crustacean[3], fill = crustacean[2],
alpha = 0.5, linewidth = 0.5) +
geom_sf(data = land_proj_global, fill = "#A5A5A5", color = "#A5A5A5", linewidth = 0.5) +
geom_sf(data = coast_proj_global, color = "black", linewidth = 0.5) +
geom_sf(data = land_proj, fill = "#A5A5A5", color = "#A5A5A5", linewidth = 0.5) +
geom_sf(data = coast_proj, color = "black", linewidth = 0.5) +
coord_sf(xlim = c(ext$xmin, ext$xmax), ylim = c(ext$ymin, ext$ymax), expand = F) +
annotate("text", x = 160, y = 22,
label = "PDO Region", size = 3.2, color = "black")
Expand Down