Skip to contents

State-first composition

Keep manual edits in a dragmapr_state, then use the same state for browser editing, Shiny apps, static rendering, snapshots, and JSON round-trips.

dragmapr_edit()
Open the interactive dragmapr editor
dragmapr_state()
Create a dragmapr state object
dragmapr_state_diff() dragmapr_state_equal()
Compare dragmapr states
summary(<dragmapr_state>)
Summarise a dragmapr state
validate_dragmapr_state()
Validate a dragmapr state object
validate_state_compatibility()
Validate compatibility between geometry and dragmapr state
merge_dragmapr_state()
Merge dragmapr state updates
dragmapr_hierarchy_state() validate_dragmapr_hierarchy_state()
Create a dragmapr hierarchy state
dragmapr_set_child_state() dragmapr_child_state() dragmapr_remove_child_state()
Manage child states in a dragmapr hierarchy
update_region_offset()
Safely update region offsets in a dragmapr state
update_label_offset()
Safely update label offsets in a dragmapr state
reset_region() reset_regions() reset_label() reset_labels() reset_all()
Reset offsets in a dragmapr state
inherit_drag_offsets()
Inherit drag offsets between hierarchy levels
collapse_drag_offsets()
Collapse drag offsets between hierarchy levels
apply_dragmapr_state()
Apply a dragmapr state to sf geometry
snapshot_dragmapr_state() migrate_dragmapr_state() restore_dragmapr_state()
Snapshot or restore dragmapr state
write_dragmapr_state() read_dragmapr_state()
Read and write dragmapr state JSON

Native widget (htmlwidget and Shiny)

Render a draggable map directly in Shiny, receive structured edit events, and update display options without rebuilding the geometry.

dragmapr_widget()
Create a native dragmapr htmlwidget
dragmapr_widget_state()
Reconstruct a dragmapr state from a browser state event
dragmaprOutput() renderDragmapr()
Shiny bindings for dragmapr widgets
updateDragmapr()
Update a dragmapr widget in place
dragmapr_geometry_options() dragmapr_display_options() dragmapr_interaction_options()
dragmapr widget options
region_connectors()
Region connector data
label_connectors()
Label connector data
connector_sf()
Coerce connector rows to sf lines

Interactive prototype

Write a standalone HTML editor for quick layout work outside a Shiny app.

drag_map_prototype()
Write a draggable map in your browser

Region offsets

Read and apply exported region movement tables.

read_offsets()
Read region offsets from CSV
apply_offsets()
Apply rigid offsets to grouped sf geometries

Labels

Derive default label anchors, supply custom labels or annotation boxes, configure connectors, and restore label positions from exported state.

make_region_labels()
Derive one default label per draggable region
as_drag_labels()
Coerce data to a drag label table
as_drag_annotations()
Coerce data to draggable annotation boxes
select_label_ids()
Select a readable subset of label IDs
read_label_state()
Read draggable label state from CSV
apply_label_state()
Apply draggable label state to a label table

Static rendering

Rebuild edited layouts as ggplot2 images, PNGs, PDFs, or project bundles.

render_dragged_map()
Save the dragged layout as a static image
render_dragmapr_project()
Render a static map from a Spatial Studio project bundle
read_dragmapr_project()
Read a dragmapr project bundle
write_dragmapr_project()
Write a dragmapr project bundle

Built-in examples

Self-contained fixtures for testing and demonstrations.

example_hhs_layout()
Build a small explodemap-style HHS example layout
example_panel_layout()
Build a non-map panel layout example

Hierarchy and branch bloom

Detect parent-child grouping columns, prepare branch-bloom helper data, and explain CRS meaning for uploaded spatial files.

make_hierarchy_key()
Build composite group keys from multiple columns
inherit_layout()
Inherit region offsets from a coarser to a finer grouping column
create_layout_snapshot()
Save a layout snapshot for a grouped sf dataset
restore_layout_snapshot()
Restore a layout snapshot
detect_hierarchy_columns()
Detect parent-child grouping columns
recommend_dragmapr_hierarchy()
Recommend a hierarchy for dragmapr
validate_bloom_hierarchy()
Validate a parent-child bloom hierarchy
build_branch_transition_data()
Build leaf-flip transition data
make_branch_bloom_labels()
Build parent and child labels for branch bloom
transition_options()
Options for local elastic hierarchy transitions
build_elastic_transition()
Build a local elastic parent-to-child transition
make_group_boundaries()
Build dotted group-drag boundaries for expanded groups
layout_metrics()
Measure mental-map stability between two layouts
summarise_spatial_crs()
Summarise CRS meaning for dragmapr
profile_spatial_upload()
Profile a spatial upload for dragmapr
suggest_offsets()
Suggest automatic region offsets for a draggable map
dragmapr_diagnostics()
Summarise a spatial dataset for use with dragmapr

Spatial I/O helpers

Read spatial files from Shiny uploads or URLs, project and validate geometry, and reuse the bridge helpers that power the spatial studio apps.

read_dragmapr_sf_upload()
Read an sf object from a Shiny file upload
read_dragmapr_sf_url()
Download and read an sf object from a URL
prepare_dragmapr_sf()
Prepare an sf object for use with dragmapr
dragmapr_iframe_bridge()
Build the Shiny iframe bridge JavaScript for a draggable helper

Editable spatial features

Inspect, remove, keep, add, or replace source geography before or during a dragmapr workflow. These helpers support Shiny review tables and reversible geography edits.

RStudio addin

Launch the interactive prototype from the RStudio Addins menu.

dragmapr_addin()
RStudio addin for the interactive drag-map prototype

Compatibility aliases

Earlier names kept for backward compatibility.

make_labels()
Derive one label anchor per draggable region
read_label_offsets()
Read label offsets from CSV
apply_label_offsets()
Apply label-specific offsets to a label table