Skip to contents

Builds a Leaflet map of H3 fishing effort with one layer per year, toggled via a radio-button year control. Hexagon colour reflects a log-scaled effort metric. A basemap switcher (Dark / Light / Satellite) is provided via a custom control in the top-right corner.

Usage

plot_effort_map(effort, metric = c("fishing_hours", "n_trips"))

Arguments

effort

A data frame with columns h3_index, year, fishing_hours, unique_trips (as returned by aggregate_pds_effort()).

metric

Column to colour hexagons by: "fishing_hours" (default) or "n_trips".

Value

A leaflet htmlwidget.

Details

The function accepts the output of aggregate_pds_effort() (which includes a year column) and aggregates effort to the H3 cell level within each year before building the map layers. An all-time view can be approximated by first collapsing the data across years:

all_time <- h3_grid |>
  dplyr::group_by(h3_index) |>
  dplyr::summarise(
    fishing_hours = sum(fishing_hours),
    n_trips       = sum(unique_trips),
    .groups = "drop"
  ) |>
  dplyr::mutate(year = "All years")
plot_effort_map(all_time)