An interactive graphic allows the user to interact with the graphical information presented on the display. It permits to play with the data and makes the information more understandable. Interactive graphics are more and more

widespread in data analysis. It is even used by news papers like the New York Times and scientific papers like Science.

R is excellent for data processing and is awesome for producing

slick graphics as shown in this gallery. But if you want to go to the next level and thus develop interactive vizualisation tools, you have to start looking in other directions: That’s where the D3 JavaScript library comes in.

D3.js makes crazy graphs. You can see loads of example here and here. It allows you to zoom in and out, choose features, add hover text, make animated graphics and much more. Unfortunately, it requires you learn Javascript, which is quite long and difficult. Happily, a couple of solutions are available for R-users, making it possible to call d3.js with R code!

Shiny is an R library that allows you to turn your R analyses into interactive web applications. It makes a two-way communication, meaning you can rerun R scripts based on input from the web application. The ShowMeShiny Gallery contains hundreds of examples. Therefore, this R graph gallery does not show any shiny section.

This page is dedicated to one-way analysis. It lets you play with the image, but no new calculation are done. Several htmlwidgets allow you to draw interactive graphics with R, such as the ones presented below. Note that in my opinion, plotly is the most interesting, especially because it is close to the ggplot2 syntax.


Ggplotly is a function from the plotly library that allows to turn any ggplot2 chart interactive. If you know how to make a ggplot2 chart, you will make it interactive in the next 3 minutes, read the related blog post!


Interactive Maps can be done trough the leaflet library. The Map section proposes several examples, here are a few of them

Plotly | General tips

Plotly | Scatterplot

Plotly | Boxplot

Plotly | Histogram

Plotly | Area Chart


Plotly | Heatmap

Interactive Network with network D3


Interactive Streamgraph are easily done with R using the streamgraph library. A complete section of the R graph gallery is dedicated to it.


Once you understood how to make a treemap using the treemap library, it is straightforward to make it interactive using the d3treeR library.

Leave a Reply

Be the First to Comment!

Notify of