Crosstalk is a package for R that enhances the htmlwidgets package. It extends htmlwidgets with a set of classes, functions, and conventions for implementing cross-widget interactions (currently, linked brushing and filtering).
Find out more at the documentation website: http://rstudio.github.io/crosstalk/
(This section is only for developers who intend to modify the JavaScript source code in Crosstalk itself.)
The JavaScript source code in this package lives under javascript/
, however the copy that is actually loaded and used during runtime is in minified form at inst/www/js/
. Anytime you make changes to javascript/
source files, you must rebuild the minified JS.
To set up your repo for building the minified JS:
nvm install
; this will install the version of Node.js we need.nvm use
to switch to our version of Node.js.npm install
to install all Node.js dependencies.To actually build the minified JS:
nvm use
(only needed once per terminal session).node node_modules/.bin/grunt
(or if you have installed grunt-cli
globally, you can just run grunt
).This will run unit tests, lint, and build the JavaScript dist bundle. When making changes to the JavaScript code, you must always do this first, and then build the R package as normal.