Week 39 | timelineR

This Week’s Widget - timelineR

The stream of d3.js layouts and plugins has slowed considerably, so I got excited when I saw Elijah Meeks’ new d3.layout.timeline. This swimlane timeline layout fills a void for both the JavaScript and R world, so I thought let’s make an htmlwidget with it. I very creatively call it timelineR.

For those not familiar, a layout is not a reusable chart and certainly not a full-featured charting library that we have incorporated into other htmlwidgets. Rather, a layout takes in data and spits out coordinates leaving the rest to the user. This is nice because we can do what I call super-isomorphic stuff like use d3.layout.timeline in ggplot2 (see the examples below). However, layouts require much more work for the htmlwidget author, so I’ll warn timelineR is just a start and still very JavaScripty.

I encourage you to look at Elijah Meeks examples and also this more full-featured, nicely styled Wars of the United States from Jason Heppler. If you want more, both of these guys host a podcast First Draft.

Installation

devtools::install_github("timelyportfolio/timelineR")

Example

I ran out of time, so I’ll iframe the vignette again.

Thanks

  • Elijah Meeks for all your contributions to the d3.js community.

  • Mike Bostock for it seems like everything, but especially d3.js.

As always, thanks to

  • Ramnath Vaidyanathan and RStudio for htmlwidgets
  • all the contributors to R and JavaScript