Skip to content
animated and interactive web graphics
R JavaScript HTML Shell
Find file
Latest commit 2a46285 Toby Dylan Hocking comma

README.md

animint - an R package for animated interactive web graphics

Build Status Coverage Status wercker status

Animint makes it possible to design multi-layer, multi-plot, interactive, and possibly animated data visualizations using just a few lines of R code. Animint adds clickSelects and showSelected aesthetics to ggplot2, and renders using D3. For example, this multi-layer facetted interactive animation of WorldBank data was defined using only about 60 lines of R code.

WorldBank viz screenshot

Installation

if (!require(devtools)) install.packages("devtools")
devtools::install_github("tdhock/animint", upgrade_dependencies=FALSE)
library(animint)
example(animint)

NOTE: tdhock/ggplot2 is required since hadley/ggplot2 introduced some backwards-incompatible changes in Aug 2015. We would be more than willing to accept code contributions via a Pull Request that gets Animint working with the most recent version of ggplot2.

Learning animint through examples

The best way to learn animint is through examples. A couple of good introductions are Carson Sievert's Interactive animations of PITCHf/x and Susan VanderPlas' animint tutorial. In addition, there is an examples web site, examples distributed with animint, as well as more complex 'big data' examples in the tdhock/animint-examples repo.

Frequently asked questions (FAQ)

Contribute to animint!

Write tests to increase code coverage

The easiest way to contribute to animint is by writing a new test that would increase the code coverage. First check the coveralls status page and find a part of the code which is not tested. Then fork animint and commit a new test that increases the coverage, and send us a Pull Request. It may be useful to read about our testing framework.

Learn about the design and theory of animint

Before adding features to animint, you should first read about its design. There are two main components, which have separate wiki pages that explain their details:

  • The compiler is written in R code.
  • The renderer is written in JavaScript code.

It would also be useful to read some theory in the academic paper describing Animint. It explains:

  • the purpose of animint: make it easy to design data visualizations which can be both animated and interactive.

  • the clickSelects and showSelected keywords which permit interactive linked plots.

  • the advantages and disadvantages of animint compared to other interactive data viz libraries.

It may also be useful to read our short and long tables of related work.

TODO list of features to implement

We keep a TODO list at top of the NEWS file. Feel free to implement one and send us a PR. They are categorized as follows:

  • BUG: things which used to work but have stopped working. Tests should be added to prevent these. For example at one point in 2013, animint rendered the correct number of legend entries for the WorldBank viz, but in the beginning of 2014 animint rendered too many legend entries.
  • GGPLOT: things which ggplot2 supports but animint does not yet support. For example facets, coord_equal.
  • DSL: changes to the animint domain-specific language (DSL) which would allow interactive/animated features. These involve changes to how we define the ggplots, and how the compiler works. For example custom alpha/color/etc for selected geoms, using selected.alpha/selected.color/etc aesthetics.
  • EXAMPLE: examples to show off animint features, which should affect neither the compiler nor renderer.
  • RENDER: changes to the JavaScript rendering code which would result in better interactive plots, without having to change the definition of the ggplots. For example rendering a selection widget for every selection variable.
  • OUTPUT: different output formats for viewing/sharing an interactive animation.
  • OPTIMIZATION: things which are currently supported, but with an implementation that could be improved in terms of render/compile speed, disk usage, memory, etc. Typically these optimizations are not really noticed for small data sets, but make it easier to visualize large data sets. For example, can we gzip the TSV plot data files to reduce disk space and download times?
Something went wrong with that request. Please try again.