Package: dragmapr 0.3.1

dragmapr: Create Draggable Plots from Projected Geometry

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 d_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>.

Authors:George Arthur [aut, cre]

dragmapr_0.3.1.tar.gz
dragmapr_0.3.1.zip(r-4.7-any)dragmapr_0.3.1.zip(r-4.6-any)dragmapr_0.3.1.zip(r-4.5-any)
dragmapr_0.3.1.tgz(r-4.6-any)dragmapr_0.3.1.tgz(r-4.5-any)
dragmapr_0.3.1.tar.gz(r-4.7-any)dragmapr_0.3.1.tar.gz(r-4.6-any)
dragmapr_0.3.1.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
dragmapr/json (API)

# Install 'dragmapr' in R:
install.packages('dragmapr', repos = c('https://prigasg.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/prigasg/dragmapr/issues

Pkgdown/docs site:https://prigasg.github.io

On CRAN:

Conda:

5.56 score 383 downloads 111 exports 50 dependencies

Last updated from:7ff659a098. Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-develOK240
source / vignettesOK239
linux-releaseOK232
macos-releaseOK231
macos-oldrelOK115
windows-develOK118
windows-releaseOK129
windows-oldrelOK108
wasm-releaseOK209

Exports:add_spatial_featuresancestors_ofapply_dragmapr_stateapply_label_offsetsapply_label_stateapply_offsetsas_drag_annotationsas_drag_labelsbuild_branch_transition_databuild_elastic_transitionbuild_transition_planchildren_ofcollapse_drag_offsetscompose_offsetsconnector_sfcreate_layout_snapshotd_active_stated_addind_branch_offsetsd_child_stated_diagnosticsd_display_optionsd_editd_effective_offsetsd_geometry_optionsd_hierarchy_stated_historyd_history_pushd_iframe_bridged_interaction_optionsd_move_branchd_nudged_parent_stated_redod_relationshipsd_remove_child_stated_set_active_pathd_set_child_stated_snap_offsetsd_stated_state_diffd_state_equald_stylesd_undod_validate_stated_widgetd_widget_statedelete_spatial_featuresdescendants_ofdetect_hierarchy_columnsdrag_map_prototypedragmaprOutputeffective_offsetsexample_hhs_layoutexample_panel_layouthierarchy_pathinherit_drag_offsetsinherit_layoutkeep_spatial_featureslabel_connectorslayout_metricsmake_branch_bloom_labelsmake_group_boundariesmake_hierarchy_keymake_labelsmake_region_labelsmerge_dragmapr_statemerge_dragmapr_stylesmigrate_dragmapr_stateparent_ofprepare_dragmapr_sfprofile_spatial_uploadread_dragmapr_projectread_dragmapr_sf_uploadread_dragmapr_sf_urlread_dragmapr_stateread_label_offsetsread_label_stateread_offsetsrecommend_dragmapr_hierarchyregion_connectorsremove_spatial_featuresrender_dragged_maprender_dragmapr_projectrenderDragmaprreplace_spatial_featuresreset_allreset_labelreset_labelsreset_regionreset_regionsrestore_dragmapr_hierarchy_staterestore_dragmapr_staterestore_layout_snapshotselect_label_idssnapshot_dragmapr_hierarchy_statesnapshot_dragmapr_statespatial_feature_tablesuggest_offsetssummarise_spatial_crstransition_optionsupdate_label_offsetupdate_region_offsetupdateDragmaprvalidate_bloom_hierarchyvalidate_dragmapr_hierarchy_statevalidate_dragmapr_statevalidate_state_compatibilityview_spatial_featureswrite_dragmapr_projectwrite_dragmapr_state

Dependencies:base64encbslibcachemclassclassIntclicpp11DBIdigeste1071evaluatefarverfastmapfontawesomefsggplot2gluegtablehighrhtmltoolshtmlwidgetsisobandjquerylibjsonliteKernSmoothknitrlabelinglifecyclememoisemimeproxyR6rappdirsRColorBrewerRcpprlangrmarkdowns2S7sassscalessftinytexunitsvctrsviridisLitewithrwkxfunyaml

Editing state: nudge, snap, and undo
Nudge one offset | Snap a layout to a grid | Validate a state | Undo and redo

Last update: 2026-09-21
Started: 2026-09-21

Getting started with dragmapr
Toy geometry | drag_map_prototype() — full parameter reference | Data | Labels | Label styling | Connectors | Movement context | Initial positions | RStudio addin | Colour palette | Legend | Output file and display | Optional: Static rendering | Edit the source features | A small Shiny editor | Working with your own data

Last update: 2026-08-11
Started: 2026-05-27

Shiny workflows
Embed A Draggable Plot | Custom Labels | Export A Report Image | Static Only | Spatial Studio | Removing geography | Loading veil | Reusable Shiny Helpers | Switching Grouping Columns in Spatial Studio | How inheritance works | Example: HHS regions and state names | What resets and what is preserved | Round-trip precision

Last update: 2026-08-11
Started: 2026-05-27

State-first workflow
1. Compute | 2. Compose | 3. Render | The state object

Last update: 2026-08-11
Started: 2026-06-26

Dragmap demo

Last update: 2026-06-22
Started: 2026-06-05

Example gallery
Explodemap-style HHS Fixture | Non-map Panels | CSV Round Trip | Labels, Boxes, And Connectors | Selected Labels And Legend Keys | Movement Context | Shiny

Last update: 2026-06-22
Started: 2026-05-27

HHS placeholder shapes demo

Last update: 2026-06-22
Started: 2026-06-05

Labels and static output
Label Concepts | Info Boxes And Text-only Labels | Connector Lines | Region Movement Plus Label Movement | Legend Filtering And Movement Context | Saving Static Images | Rendering A Spatial Studio Project

Last update: 2026-06-05
Started: 2026-05-27

Readme and manuals

Help Manual

Help pageTopics
Add or replace spatial featuresadd_spatial_features replace_spatial_features
Apply a dragmapr state to sf geometryapply_dragmapr_state
Apply label-specific offsets to a label tableapply_label_offsets
Apply draggable label state to a label tableapply_label_state
Apply rigid offsets to grouped sf geometriesapply_offsets
Coerce data to draggable annotation boxesas_drag_annotations
Coerce data to a drag label tableas_drag_labels
Build leaf-flip transition databuild_branch_transition_data
Build a local elastic parent-to-child transitionbuild_elastic_transition
Build a renderer-neutral transition planbuild_transition_plan
Query hierarchy relationshipsancestors_of children_of descendants_of hierarchy_path parent_of
Collapse drag offsets between hierarchy levelscollapse_drag_offsets
Compose algorithmic, inherited, and manual offsetscompose_offsets effective_offsets
Coerce connector rows to sf linesconnector_sf
Save a layout snapshot for a grouped sf datasetcreate_layout_snapshot
RStudio addin for the interactive drag-map prototyped_addin
Summarise a spatial dataset for use with dragmaprd_diagnostics
Open the interactive dragmapr editord_edit
dragmapr widget optionsd_display_options d_geometry_options d_interaction_options
Create a dragmapr hierarchy stated_hierarchy_state validate_dragmapr_hierarchy_state
Undo/redo history for dragmapr statesd_history d_history_push d_redo d_undo
Build the Shiny iframe bridge JavaScript for a draggable helperd_iframe_bridge
Nudge a region or label offsetd_nudge
Define generic hierarchy relationshipsd_relationships
Operate on a hierarchy stated_active_state d_branch_offsets d_effective_offsets d_move_branch d_parent_state d_set_active_path
Manage child states in a dragmapr hierarchyd_child_state d_remove_child_state d_set_child_state
Snap state offsets to a gridd_snap_offsets
Create a dragmapr state objectd_state
Compare dragmapr statesd_state_diff d_state_equal
Create keyed dragmapr feature stylesd_styles
Validate a dragmapr stated_validate_state
Create a native dragmapr htmlwidgetd_widget
Reconstruct a dragmapr state from a browser state eventd_widget_state
Detect parent-child grouping columnsdetect_hierarchy_columns
Write a draggable map in your browserdrag_map_prototype
Shiny bindings for dragmapr widgetsdragmaprOutput renderDragmapr
Build a small explodemap-style HHS example layoutexample_hhs_layout
Build a non-map panel layout exampleexample_panel_layout
Inherit drag offsets between hierarchy levelsinherit_drag_offsets
Inherit region offsets from a coarser to a finer grouping columninherit_layout
Label connector datalabel_connectors
Measure mental-map stability between two layoutslayout_metrics
Build parent and child labels for branch bloommake_branch_bloom_labels
Build dotted group-drag boundaries for expanded groupsmake_group_boundaries
Build composite group keys from multiple columnsmake_hierarchy_key
Derive one label anchor per draggable regionmake_labels
Derive one default label per draggable regionmake_region_labels
Merge dragmapr state updatesmerge_dragmapr_state
Merge keyed feature stylesmerge_dragmapr_styles
Prepare an sf object for use with dragmaprprepare_dragmapr_sf
Profile a spatial upload for dragmaprprofile_spatial_upload
Read a dragmapr project bundleread_dragmapr_project
Read an sf object from a Shiny file uploadread_dragmapr_sf_upload
Download and read an sf object from a URLread_dragmapr_sf_url
Read label offsets from CSVread_label_offsets
Read draggable label state from CSVread_label_state
Read region offsets from CSVread_offsets
Recommend a hierarchy for dragmaprrecommend_dragmapr_hierarchy
Region connector dataregion_connectors
Remove or keep spatial featuresdelete_spatial_features keep_spatial_features remove_spatial_features
Save the dragged layout as a static imagerender_dragged_map
Render a static map from a Spatial Studio project bundlerender_dragmapr_project
Reset offsets in a dragmapr statereset_all reset_label reset_labels reset_region reset_regions
Restore a layout snapshotrestore_layout_snapshot
Select a readable subset of label IDsselect_label_ids
Snapshot or restore hierarchy staterestore_dragmapr_hierarchy_state snapshot_dragmapr_hierarchy_state
Snapshot or restore dragmapr statemigrate_dragmapr_state restore_dragmapr_state snapshot_dragmapr_state
Inspect editable spatial featuresspatial_feature_table view_spatial_features
Suggest automatic region offsets for a draggable mapsuggest_offsets
Summarise CRS meaning for dragmaprsummarise_spatial_crs
Summarise a dragmapr statesummary.dragmapr_state
Options for local elastic hierarchy transitionstransition_options
Safely update label offsets in a dragmapr stateupdate_label_offset
Safely update region offsets in a dragmapr stateupdate_region_offset
Update a dragmapr widget in placeupdateDragmapr
Validate a parent-child bloom hierarchyvalidate_bloom_hierarchy
Validate a dragmapr state objectvalidate_dragmapr_state
Validate compatibility between geometry and dragmapr statevalidate_state_compatibility
Write a dragmapr project bundlewrite_dragmapr_project
Read and write dragmapr state JSONread_dragmapr_state write_dragmapr_state