← Back to all sparks
G

ggmapinset

ANALYTICS
Velocity0.0

R package ggmapinset by cidm-ph — release notes from GitHub.

A ggplot2 inset-map extension that is now infrastructure for other packages

ggplot2geospatialinset-mapsextension-apisfcidm-ph
Current state
ggmapinset adds magnified inset panels to ggplot2 sf maps, handling the coordinate transformation, the inset frame and the sf-related stat layers that have to follow it. The 0.5.0 release is aimed less at end users than at extension authors: coerce_centre() is a new extension point required by sibling package ggautomap, and the inset parameter drops NA in favour of waiver() as its default. It comes from cidm-ph, alongside nswgeo.
Where it's heading
The package has moved steadily from feature to foundation. 0.3.0 replaced confusing parameter names and rebuilt everything on stat_sf_inset() so coordinate limits stayed correct, then exposed transform_to_inset() explicitly for extension developers. 0.4.0 generalised inset shapes beyond circles to rectangles and arbitrary sf geometries. 0.5.0 continues in that direction, changing defaults in ways that require downstream extensions to adapt — the cost of being depended upon.
Prediction
Expect further extension points driven by what ggautomap and the other cidm-ph mapping packages need, with the user-facing inset API staying largely settled after the shape generalisation.

Recent moves

  1. 4mo ago

    New extension point for ggautomap; waiver() replaces NA

    Mostly a change for downstream authors: coerce_centre() is added as an extension point ggautomap requires, and the inset parameter now defaults to waiver() rather than accepting NA, with NULL still disabling insets. Anything built on build_sf_inset_layers() needs updating, and geom_sf_inset() now stays quiet when no inset is configured on the coord.

    View source ↗
  2. 1y ago

    Rectangular and arbitrary sf inset shapes

    shape_rectangle() and shape_sf() lift the inset from a fixed shape to any geometry the user supplies. For maps of administrative areas that are rarely circular, this is the change that makes the inset match the region rather than approximate it.

    View source ↗
  3. 3y ago

    Rebuilt on stat_sf_inset() with corrected coordinate limits

    The structural release. Confusing inset_clip and inset_copy parameters give way to map_base and map_inset, a default inset configuration can live on the coord instead of every layer, and everything moves onto stat_sf_inset() so coordinate limits adjust correctly. Text and label stats complete sf layer coverage, and transform_to_inset() is the first explicit nod to extension developers.

    View source ↗