Create Draggable Plots from Projected Geometry
Overview
Creates interactive draggable plots from grouped projected 'sf' geometry. The primary deliverable is a browser-based 'D3' helper where regions and labels can be moved freely; users drag, then copy or download the resulting offset tables. Labels can be derived automatically with make_region_labels(), supplied directly with as_drag_labels(), and their moved positions saved and restored with read_label_state() and apply_label_state(). Hierarchical spatial datasets are supported via hierarchy detection, upload profiling, make_hierarchy_key(), and inherit_layout(), which recommend parent-child groupings and propagate parent-level drag offsets to finer child groupings. Automatic starting layouts are provided by suggest_offsets() using radial, grid, or directional algorithms. Spatial file diagnostics are available through dragmapr_diagnostics(). When a reproducible static image is also needed, render_dragged_map() reconstructs the layout as a 'ggplot2' plot from the source geometry plus the exported offset tables. Project bundles can be written with write_dragmapr_project() and rendered with render_dragmapr_project(). The interactive layer is built on the 'D3' library: Bostock, Ogievetsky and Heer (2011) doi:10.1109/TVCG.2011.185. Spatial data handling uses the 'sf' package: Pebesma (2018) doi:10.32614/RJ-2018-009.
drag_map_prototype()gains an optionaltransitionargument: the browser helper runs one client-side leaf-flip branch animation for parent-to-child bloom and child-to-parent unbloom, and draws a dotted group-drag boundary per expanded group. Clicking a boundary posts adragmapr-collapse-branchmessage to the embedding page, or resets the branch when the helper runs standalone; a plain click on a region postsdragmapr-region-click.- New
inst/examples/branch-bloom-tester.RShiny example isolates the branch-bloom helper so clean bloom and leaf-flip behavior can be tested without the full Spatial Studio shell. - New packaged cheatsheet in
inst/cheatsheets/covers the core workflow, labels, static rendering, Spatial Studio, hierarchy/bloom helpers, CRS diagnostics, layout snapshots, and transition utilities.
Show all changes in 0.2.0Hide the rest of the changes in 0.2.0
- New upload intelligence helpers:
detect_hierarchy_columns(),recommend_dragmapr_hierarchy(),validate_bloom_hierarchy(),build_branch_transition_data(),make_branch_bloom_labels(),summarise_spatial_crs(), andprofile_spatial_upload()move parent/child detection, CRS meaning, branch-bloom data prep, and safe parent-first label setup into reusable package functions. - Spatial Studio: new **Bloom** sidebar section. Pick a child column ("bloom into"), then click a parent region on the map (or choose parents in the panel) to expand just that parent into its children with a leaf flip - the rest of the map keeps the parent grouping. At most two parents can be expanded at a time (expanding another replaces the oldest), the dotted reset boundary can be toggled off, and clicking the boundary or the children compresses the branch and restores the parent's saved position. The bloom target must genuinely nest inside the current grouping (data-driven check with a clear error otherwise). Arming bloom embeds both parent and child keys in the helper once; expanding and collapsing then run fully client-side over postMessage, so there is no iframe rebuild, no loading overlay, and the animation always plays. The dotted frame is also the group's drag handle: dragging it moves the whole expanded branch (children, labels, and frame together), and collapsing places the parent at the mean of its children's positions. With "Dissolve to parent shells when collapsed" (on by default), child-level uploads display as clean dissolved parent outlines until a parent blooms, which both sharpens the reveal and reduces the number of drawn shapes.
- Spatial Studio: the Bloom panel now includes an animation selector so users can switch between the leaf-flip proxy animation and the clean branch-bloom animation. The selected mode is sent to the live helper without rebuilding the iframe.
- Spatial Studio: one unified full-app busy veil replaces the previous mix of map overlay, sidebar freeze, and full veil. Two modes share the same blocker - "Loading spatial data" (uploads, project opens) and "Processing changes" (helper rebuilds) - with lock counting so overlapping tasks never hide the veil early, a short show delay so fast rebuilds don't flash, and safety timers so a missed release can never freeze the app. The Shiny busy state only drives the slim top progress bar; client-side bloom interactions never show a veil.
- Spatial Studio fixes for files with arbitrary column names: hierarchy detection on column switches is data-driven (the child column must actually nest inside the parent grouping), and the default group/region column detection no longer assumes specific column names or excludes one-row-per-region files (e.g.
COUNTY_NAMinstead ofCOUNTY).
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK6 OK2026-06-23
Documentation
- Help pages
- 40
- Examples that run
- 100%30 run in a plain check (7 of them under a condition)
- Exported functions with examples
- 75%
- Documented parameters
- 94%
- Return-value docs
- 100%
- Help pages citing references
- 0%
Downloads
Repository
- PRs merged (all time)
- 100%
- Median days to close, 50 most recently updated closed issues
- not measured
- Median days to close, 50 most recently updated closed PRs
- 1
Releases over time
PRs over time
Commits over time
10 development-tooling and community-health practices detected across 6 families in the upstream repository
Checks run against github.com/prigasg/dragmapr on 2026-10-22.
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
GitHub Pages site last deployed 2026-09-21 · The repository has a site deploy workflow
pkgdown site last built 2026-07-31
Show all practicesHide 2 practices
Dependencies
Code & Tests
Datasets
People & History
- 0.2.0Latestfirst seen 2026-06-22 · current release
- RR 4.6.0 released · 2026-04-24
Package metadata
- First seen
- 2026-06-22
- Total releases
- 1 / 1 yrs
- License
- MIT + file LICENSE OSI
- Download size
- 1.9 MB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("dragmapr")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-24, which the citation names so these numbers can be found later. More on citing and the projects behind them.