htmlwidgets

With htmlwidgets for R you can generate interactive plots using R’s flexible syntax and environment. Databricks notebooks support htmlwidgets.

The setup has two steps:

  1. Install pandoc, a Linux package used by htmlwidgets to generate HTML.
  2. Change one function in the htmlwidgets package to make it work in Databricks.

You can automate the first step using an init script so that the cluster installs pandoc when it launches. You should do the second step, changing an htmlwidgets function, in every notebook that uses the htmlwidgets package.

The notebook demonstrates using htmlwidgets with the dygraphs, leaflet, and plotly. With each library invocation, an HTML file containing the rendered plot is downloaded.