Making Interactive Graphics: A Discussion

John Muschelli, @StrictlyStat, Johns Hopkins University

presentation: http://johnmuschelli.com/JSM_2017

source: http://github.com/muschellij2/JSM_2017

Carson Sievert: plotly

Create an R interface that is easyfor the user and just "works"

Plotly is awesome - R package easiest implementation of quick, great interactive graphics - but still bound to plotly.js and its implementations

My opinion: ggplotly reinforces
ggplot2 > base

Leo Collado Torres: shinycsv and eQTL browsing

  • Interactive Graphics are good, but have some drawbacks
  • Re-use other tools
  • Make it fast and simple
  • Iterative
  • Minimize user options: make a decision
  • Make interactive beer contests

Yesteryears in R: PDF with multiple images

Sean Kross: p5

  • Use htmlwidgets: 10 lines of JS code
  • enough JS to be dangerous?
  • Models are hard
  • Maybe use shape people vs. people people
  • Formula syntax to pass JS-type variables

Interactive Graphics are Hard

Interactive Graphics are were Hard

But I don't use R!

  • Python has a lot of implementations similar to what we've discussed
  • Dash: Interactive, reactive web apps in pure python (from Plotly)
  • Stata: stata2leaflet, stata2d3, gchart (never have used them)
  • SAS - ActiveX? - not easy to disseminate
  • Tableau

Interactive Graphics are
"Catching up to the 90s"
(Di Cook)

Use of interactive graphics is increasing
(I think)

Custom Interactive Graphics are Still Hard

  • GGobi is the standard to ascribe to in many ways (I haven't used extensively)
  • Implementing many of these widgets for HTML would be good
    • *cough* PhD Thesis *cough*
  • Need to teach these tools

Some rules for using interactive graphics

  1. Make it simple
  2. Give few choices, if any
  3. Ask for specific feedback
  4. Make it fast, use tools available even if clunky.
    • I tend to use Shiny to prototype
    • then ask people better than JS to help

Shiny Apps are good
call them something else
"Interactive Website"?

Collaboration and interactive graphics

  1. Shiny is good, but can't be emailed, need server (DO)
  2. HTML and JavaScript is backended for most (or all) of what we discussed
  3. Collaborators still want to know "how can I put in my presentation"
    • GH Pages - free hosting! Also, standalone HTML
  4. Make it, then ask if it's OK to take some time to do it

Publishing Interactive Graphics in Papers

Faculty Office Hour

Questions to the speakers


  1. How did you learn these skills (class vs. on own)?
  2. Where does someone start?
  3. How do you convince collaborators of the investment in time/energy/adapting HTML?