Crosstalk is an add-on to the htmlwidgets package. It extends htmlwidgets with a set of classes, functions, and conventions for implementing cross-widget interactions (currently, linked brushing and filtering).

Play with the example below by manipulating the slider, clicking rows in the data table, and playing with the selection button in the map.

Works anywhere htmlwidgets does

Like regular HTML widgets, Crosstalk doesn’t require Shiny or any other runtime R dependencies. That means you can use it, either alone or with R Markdown, to generate static HTML documents that can be hosted anywhere, including Amazon S3, GitHub, or RPubs. However, it is also designed to work seamlessly with Shiny apps, which lets you combine Crosstalk widget interactions with base plots, ggplot2, and anything else you can do with Shiny.

Important limitations

Crosstalk has inherent limitations that widget authors and users need to be aware of.

  1. HTML widgets must be specifically modified by their authors to support Crosstalk. Crosstalk cannot magically provide cross-widget interactivity with generic HTML widgets.
  2. Crosstalk currently only works for linked brushing and filtering of views that show individual data points, not aggregate or summary views (where “observations” is defined as a single row in a data frame). For example, histograms are not supported since each bar represents multiple data points; but scatter plot points each represent a single data point, so they are supported.
  3. Because all data must be loaded into the browser, Crosstalk is not appropriate for large data sets. (There’s no hard limit, since HTML widgets require varying amounts of CPU cycles and memory for each data point.)

Next steps

Both widget users and widget authors should read the Using Crosstalk guide.

Widget authors should then proceed to read Authoring Crosstalk widgets.