Shiny app to highlight on a Leaflet map by brushing a Plotly chart. Run for yourself with (provided all of the packages are installed):
shiny::runGist('da941dac84f730adcdde')
To get this to work on another dataset, you're going to need to have a sequential ID variable that matches the pointNumber
column in the data frame generated by Plotly's event_data
. See the setup.R
script for how this was derived.
Thanks! And thanks for the feedback. I didn't use R to obtain and prep the shapefile but I'll include some pointers.
My ultimate goal is to get the Plotly events talking to leafletProxy so that the entire map doesn't re-load every time, and that the selected tracts are simply removed and then re-added - this isn't working for me just yet.