Skip to content
Carson edited this page Mar 24, 2015 · 13 revisions

Background

Animint is an R package for making interactive animated data visualizations on the web, using ggplot syntax and 2 new aesthetics:

  • showSelected=variable means that only the subset of the data that corresponds to the selected value of variable will be shown.
  • clickSelects=variable means that clicking a plot element will change the currently selected value of variable.

Toby Dylan Hocking initiated the project in 2013, and Susan VanderPlas (2013) and Carson Sievert (2014) have provided important contributions during previous GSOC projects.

Related work

Standard R graphics are based on the pen and paper model, which makes animations and interactivity difficult to accomplish. Some existing packages that provide interactivity and/or animation are

  • Non-interactive animations can be accomplished with the animation package (animint provides interactions other than moving forward/back in time).
  • Some interactions with non-animated linked plots can be done with the qtbase, qtpaint, and cranvas packages (animint provides animation and showSelected).
  • Linked plots in the web are possible using SVGAnnotation or gridSVG but using these to create such a visualization requires knowledge of Javascript (animint designers write only R/ggplot2 code).
  • The svgmaps package defines interactivity (hrefs, tooltips) in R code using igeoms, and exports SVG plots using gridSVG, but does not support showing/hiding data subsets (animint does).
  • The ggvis package defines a grammar of interactive graphics that relies on shiny’s reactivity model for most of its interactive capabilities.
  • Vega can be used for describing plots in Javascript, but does not implement clickSelects/showSelected (animint does).
  • RIGHT and DC implement interactive plots for some specific plot types (animint uses the multi-layered grammar of graphics so is not limited to pre-defined plot types).

For even more related work see the Graphics and Web technologies task views on CRAN, and Visualization design resources from the UBC InfoVis Group.

Ideas for GSOC 2015 coding projects

An ideal student project will implement several improvements to Animint. Some important items from the TODO list:

Any other ideas for improving Animint are welcome as well!

Mentors

Please get in touch with Toby Dylan Hocking <tdhock5@gmail.com>, Carson Sievert <cpsievert1@gmail.com> and Susan VanderPlas <srvanderplas@gmail.com> as soon as possible.

Tests

Do one or several — doing more hard tests makes you more likely to be selected.

  • Easy: use Animint to visualize some data from your domain of expertise, and upload your visualization to the web using animint2gist.
  • Medium: translate one or several examples of the animation package into an Animint.
    • look at source code of one of the animation package functions e.g. grad.desc() for a demonstration of the gradient descent algorithm. Translate the for loops and plot() calls into code that generates data.frames. In the grad.desc() example, there should be one data.frame for the contour lines, one for the arrows, and one for the values of the objective/gradient at each iteration.
    • Use the data.frames to make some ggplots. In the grad.desc() example, there should be one ggplot with a geom_contour and a geom_path, and another ggplot with a geom_line that shows objective or gradient value versus iteration, and a geom_tallrect in the background for selecting the iteration number.
    • Make a list of ggplots and pass that to animint2dir. For the grad.desc() example the plot list should be something like list(contour=ggplot(), objective=ggplot(), time=list(variable=”iteration”, ms=2000)).
  • Medium-Hard: write a testthat unit test based on one of your Animint visualizations.
  • Hard: fork the animint source code on github, then implement one of the improvements mentioned on the TODO list, and send tdhock a pull request.

Solutions of tests

A repository AnimintTest by Jun Cai is provided as solutions to the project tests.

A second set of solutions is provided by Kevin Ferris.