dragmapr 0.3.1
- Fixed
keep_spatial_features()so an empty id vector correctly returns an emptysfobject instead of retaining every feature. - Strengthened
sfvalidation to reject an active geometry column that is not ansfcvector, including at the start ofrender_dragged_map(). - Spatial feature alignment now preserves missing attribute types, including units and list columns, and feature-table metadata names remain unique when source attributes use reserved helper names.
- Package and site images plus the installed cheatsheet are stored as regular Git files so GitHub source archives contain the real assets; only demo MP4s remain in Git LFS.
dragmapr 0.3.0
Release A of the Pipeline Studio extraction adds state comparison helpers:
dragmapr_state_diff()reports changed regions, labels, and interaction fields, whiledragmapr_state_equal()provides the matching predicate with composition/interaction/all comparison modes.summary.dragmapr_state()now reports moved region and label counts, selected feature, CRS, geometry ID, and revision.Spatial feature editing is now first-class. New helpers
spatial_feature_table()/view_spatial_features(),remove_spatial_features()/delete_spatial_features(),keep_spatial_features(),add_spatial_features(), andreplace_spatial_features()let Shiny apps inspect, remove, keep, add, or replace sourcesfgeography without hand-editing geometry columns.updateDragmapr()can now sendremove_features =ordelete_selected = TRUEto the native widget; the browser removes the geography from the live editor and emitsinput$<id>_feature_delete. Pipeline Studio exposes this in the Refine tab with source-row inspection and Undo/Redo so accidental deletions can be reversed.dragmapr_widget()now accepts a directregion_palette =argument, matchingrender_dragged_map()andupdateDragmapr(region_palette = )while keeping the existingdragmapr_display_options(region_palette = )route intact.New
inst/shiny/pipeline-studioShiny app (shipped with both dragmapr and explodemap) demonstrates the full cross-package workflow on real US geography: an explodemap national HHS map and county drill-down, the draggable editor withdragmapr_stateround-trip, and a combined compute -> compose -> render -> persist studio. Run withshiny::runApp(system.file("shiny/pipeline-studio", package = "dragmapr")).Added
inst/examples/explodemap_dragmapr_pipeline.R, a complete cross-package example coveringexplodemaplayout optimization and diagnostics, editabledragmapr_state, JSON persistence,focus_map(), andrender_dragged_map().dragmapr_statecarries aview(viewport) field that round-trips through JSON and the widget snapshot. It is preserved as composition metadata; restoring the browser to a saved viewport on load is intentionally left for a future release (selection restoration is the clean first cut).Every public entry point that accepts
sfgeometry (dragmapr_widget(),dragmapr_edit(),apply_offsets(),apply_dragmapr_state(),render_dragged_map()) now validates the active sf geometry column up front via a shared check, so a malformedsffails with one clear message instead of a deep, cryptic error.New
dragmapr_edit()is a friendly front-door to the interactive editor and the composition step of the state-first workflow. It accepts a projectedsf, an explodemapgrouped_exploded_map, or adragmapr_layout(plus an optionaldragmapr_state) and returns a configureddragmapr_widget(). Capture edits back into a state withdragmapr_widget_state().dragmapr_state()gains three optional, back-compatible fields that make a saved composition durable across sessions:crs(the projected CRS the metre offsets are expressed in, stored as an EPSG integer or WKT string so it round-trips through JSON),geometry_id(a provenance tag identifying the geometry the state was composed against), andselected_feature(the feature focused in an editor or dashboard). The fields are threaded throughvalidate_,merge_,snapshot_/restore_,inherit_drag_offsets()andcollapse_drag_offsets();selected_featureis dropped on a level change.apply_dragmapr_state()now warns when a state’scrsdiffers from the target geometry. Older state JSON written before these fields still restores.explodemap::as_dragmapr_state()is the matching producer: it converts a grouped layout’s absolute anchors intodx_m/dy_mdeltas and emits adragmapr_state, keeping the computed layout and the editorial state as separate objects.The native widget bridge now carries
crs,geometry_idandselected_feature. They are surfaced at the top of the widget payload, the browser highlights the selected region (.is-selected), a region click updates the selection and reports it back to Shiny, and the round-trip state snapshot includes all three fields.updateDragmapr()gains liveselected_featureupdates (passNULLor""to clear).New
dragmapr_widget_state()is the inbound half of the bridge: it reconstructs adragmapr_statefrom thepaste0(outputId, "_state")Shiny input the widget emits, so server code can persist, merge, or re-render a live composition. The browser’srevisionis preserved as the stateversion(the client owns the live counter).New
inst/examples/full_state_roundtrip.RShiny app walks the whole state contract: an upstream layout state is edited in the native widget, every edit is rebuilt server-side withdragmapr_widget_state(), a selection is pushed back from R withupdateDragmapr(), and the livedragmapr_statedrives both a saved JSON file and a staticrender_dragged_map()re-render.render_dragged_map()now acceptsstate =adragmapr_state, using its region and label offsets for static output while preserving the existingregion_offsets/label_offsetstable arguments as explicit overrides.Revision semantics are now monotonic:
merge_dragmapr_state(),inherit_drag_offsets()andcollapse_drag_offsets()bumpversionto one past the highest input revision (via the internalbump_revision()), so a state produced by an accepted edit always sorts after its inputs. Previouslymerge_dragmapr_state()took the maximum of the two revisions unchanged.
dragmapr 0.2.0
CRAN release: 2026-06-22
-
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. - 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).
dragmapr 0.1.0
Initial CRAN release.
-
drag_map_prototype()writes a self-contained D3 browser helper where groupedsfregions, labels, and annotation boxes can be dragged freely. It exports region and label offset CSVs. -
render_dragged_map()reconstructs the dragged layout as aggplot2image from the source geometry plus offset tables. -
render_dragmapr_project()renders a complete Spatial Studio project bundle (ZIP) in one call. -
make_region_labels(),as_drag_labels(), andas_drag_annotations()build label tables;read_label_state()andapply_label_state()restore saved label positions. -
read_offsets()andapply_offsets()handle region offset I/O. -
read_dragmapr_sf_upload(),read_dragmapr_sf_url(), andprepare_dragmapr_sf()read and normalise spatial files for Shiny workflows. -
dragmapr_iframe_bridge()provides the JavaScript bridge for relaying drag state from the helper iframe back to Shiny inputs. -
dragmapr_addin()registers an RStudio gadget under Addins > Launch dragmapr that embeds the prototype in the viewer pane and assignsregion_offsetsandlabel_offsetsto the target environment on completion (.GlobalEnvwhen launched from the RStudio Addins menu). - Interactive and static outputs support selective legend and label rendering with
legend_valuesandlabel_values, preserving stored offsets for hidden labels. - Label connector lines can be styled by color, width, line pattern, and arrow endpoint in both the browser helper and static exports.
- Movement context controls can show origin outlines, movement connector lines, and browser-only drag preview trails. Movement connectors support configurable color, opacity, width, line pattern, and open/closed endpoints.
- Spatial Studio demonstrates legend and label multiselect filters, connector styling, movement context controls, project persistence, and static bundle export.
- Release hardening: package-internal
%||%is defined for the RStudio addin, prototype output defaults to a temporary HTML file unlessfileis supplied, connector linetypes are validated in static exports, the Shiny iframe bridge stops polling on disconnect/unload, CRS-less inputs warn before assuming the target CRS, legacy label helper aliases emit deprecation warnings, and the bundled D3 license is included underinst/prototype/.
