r-tmap / tmap

R package for thematic maps
https://r-tmap.github.io/tmap
GNU General Public License v3.0
868 stars 121 forks source link

Support for Crosstalk? #807

Open mayeulk opened 1 year ago

mayeulk commented 1 year ago

Is there any support for interaction between various widgets with crosstalk? (one of these widgets being a tmap object.) Given that tmap uses leaflet (which supports crosstalk), is it possible to use crosstalk right away with current version of tmap? If so, are there any examples available? Would using tmap_leaflet() be the way to do it? If not, is there any plan to enable crosstalk with tmap?

For reference, the guide on how to modify an htmlwidget for crosstalk support: https://rstudio.github.io/crosstalk/authoring.html

mtennekes commented 1 year ago

Great idea! Any volunteers to implement it? (Or at least show how it is done in leaflet)

mayeulk commented 1 year ago

Here is a link for users: tutorial on how to use leaflet and crosstalk:

https://www.zajichekstats.com/post/filterable-maps/

A nice example is here too: https://matt-dray.github.io/earl18-crosstalk/04_leaflet-flexdash-dt-crosstalk.html#interactives (with source code).

It does not explain how leaflet was modified to allow for crosstalk. I guess it requires looking at the commits in the R leaflet package, as well as looking at the guide on how to modify an htmlwidget for crosstalk support: https://rstudio.github.io/crosstalk/authoring.html I've no idea on how to do this, though.