Monday, December 10, 2012

d3 Showreel Combined with R and Shiny

Since the d3 portion of the example provide in my last post d3 and r interacting through shiny was so weak, I thought it would be interesting to combine the much more compelling Showreel Example with the same stock data.  However, this time the data will come from R getSymbols.  Also, most of the plots would be better using cumulative return data, so we will use R to convert the price data into a cumulative return series.

Almost all credit for the code contained in this example goes to Mike Bostock, and although much of the code is now gone, the structure and idea belong to Trestle Technology's Jeff Allen.

See it live in the browser at, and all code is hosted on Github, so please play, experiment, and let me know what great things you do with this.


  1. Pretty durn amazing! Really well done. Do you have a suggested tutorial for beginning D3? Also, have to ask-what is name of the music in the soundtrack? Matches the pace of the animation perfectly. Thanks for sharing this application.

  2. Glad you enjoyed. Unfortunately, I have not found a comprehensive one-stop shop for d3 learning, but here are a couple of sources that helped me get started:

    think this is the best
    3 part series

    For a full book, there is This was helpful, but I really wish the author provided more examples.

    The music is A Dirty Trick by Franco Micalizzi. It was a suggestion from youtube that I thought fit very nicely in music and title. Glad you like it.