Link Interactive Plots and Tables in 'shiny' Applications
Apply Default Leaflet Behavior for Selection Events
Apply Default Plotly Behavior for Selection Highlighting
Create a Link Registry for 'shiny' Component Coordination
Detect Component Type Based on Output ID Patterns
Extract ID from Plotly Event Data
Simple Plot Linking Function for Non-Modular 'shiny' Apps
Package imports
Prepare Plotly for Linking
Process SF Data for Leaflet Integration
Register a DT DataTable Component
Register a Leaflet Component
Register a Plotly Component
Set up observers for different component types
Setup DataTable Observers
Setup Leaflet Map Observers
Setup Plotly Observers
Smart Coordinate-Based ID Lookup
Update DT Selection Based on Shared ID
Update Leaflet Map Selection
Update Plotly Selection Based on Shared ID
Build powerful, linked-view dashboards in 'shiny' applications. With a declarative, one-line setup, you can create bidirectional links between interactive components. When a user interacts with one element (e.g., clicking a map marker), all linked components (such as 'DT' tables or other charts) instantly update. Supports 'leaflet' maps, 'DT' tables, 'plotly' charts, and spatial data via 'sf' objects out-of-the-box, with an extensible API for custom components.
Useful links