Skip to contents

Interactive prototype

Create the browser-based D3 helper. This is the primary deliverable: open it, drag, then copy or download the offset tables.

drag_map_prototype()
Write a draggable plot prototype HTML file

Region offsets

Read and apply the region movement tables exported by the helper.

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
read_label_state()
Read draggable label state from CSV
apply_label_state()
Apply draggable label state to a label table

Static rendering

Optionally reconstruct the dragged layout as a ggplot2 image from the source geometry plus exported region and label offset tables.

render_dragged_map()
Render an adjusted draggable plot with labels
render_dragmapr_project()
Render a static map from a Spatial Studio 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

Spatial I/O helpers

Read spatial files from Shiny uploads or URLs, project and validate geometry, and build the JavaScript bridge that relays drag state from the helper iframe back to Shiny inputs. These helpers are extracted from the spatial studio example so apps can reuse them independently.

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

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