Beyond One-Shot Rendering: Interactive R htmlwidgets in Jupyter
R has a rich ecosystem of interactive visualizations built on {htmlwidgets}, including packages such as {leaflet}, {plotly}, and {DT}. In Jupyter notebooks, however, these widgets are typically rendered as self-contained HTML documents. While they remain interactive in the browser, their connection to the R session is lost after rendering.
The {jupyter.htmlwidgets} project takes a different approach, leveraging the xeus-r kernel and Jupyter’s communication infrastructure to establish bidirectional communication between R and JavaScript.
This opens up a middle ground between one-shot rendering and a full Shiny application: existing htmlwidgets can become connected components of a notebook, responding to commands from R and sending user interactions back to the kernel, without introducing a full reactive framework. This approach preserves the exploratory, cell-driven workflow and rhythm of notebooks.
Through live demonstrations and a look at the underlying architecture, we’ll explore how this approach works, how it builds on the existing R ecosystem, and what it could mean for interactive computing in Jupyter.