HTML Widgets: Interactive Visualizations from R Made Easy!

Yihui Xie (RStudio, Inc)

2016/08/02 @ JSM Chicago

Keywords

HTML

Widgets/JavaScript

https://www.destroyallsoftware.com/talks/wat

Interactive

Interactive visualization

HTML Widgets

Documentation: http://htmlwidgets.org

Easy (from user’s perspective)

Easy (from user’s perspective)

Easy (from developer’s perspective)

# from CRAN
install.packages("htmlwidgets")
# or development version from Github
devtools::install_github("ramnathv/htmlwidgets")
HTMLWidgets.widget({

  name: "FOO",

  type: "output",

  initialize: function(el, width, height) {
    // initialize the element
  },

  renderValue: function(el, data, instance) {
    // render the data in el, e.g.
    // $(el).DataTable(data.options);
  }

})

Easy?

Programming, in movies vs in reality

Your turn

Move on, and develop a widget package!

Thanks!