class: center, middle, inverse, title-slide # Lec11: Animation ## Stat41: Data Viz ### Prof Amanda Luby ### Swarthmore College --- # Today: (1) Historical Background (15) - Many examples via [Friendly, 2017](http://euclid.psych.yorku.ca/datavis/papers/history-dynamic-graphics-2x2.pdf) (2) A few more animation examples (5 + 5) (3) "Rules" of animation for data viz (15 + 5) (4) Project 3 brainstorm session (?) --- # 1D Data Viz <img src="images/Grados_de_la_Longitud.jpg" width="793" style="display: block; margin: auto;" /> [van Langren, 1644](https://en.wikipedia.org/wiki/Michael_van_Langren) is often credited for the first "statistical visualization" --- ### 2D Data Viz: Time on X-axis <img src="images/playfair-time-series.png" width="721" style="display: block; margin: auto;" /> [Playfair, 1796](https://en.wikipedia.org/wiki/William_Playfair) --- # 2D Data Viz: Y vs X <img src="images/herschel-scatterplot.png" width="407" style="display: block; margin: auto;" /> [Herschel, 1833](https://www.datavis.ca/papers/friendly-scat.pdf) --- # 3D Data Viz <img src="images/lalanne-3d.png" width="348" style="display: block; margin: auto;" /> [Lalanne, 1843](https://en.wikipedia.org/wiki/L%C3%A9on_Lalanne) --- # Higher Dimensions <img src="images/Minard.png" width="2671" style="display: block; margin: auto;" /> [Minard, 1869](https://en.wikipedia.org/wiki/Charles_Joseph_Minard) --- # Higher Dimensions <img src="images/nightingale-rose-chart.jpg" width="9328" style="display: block; margin: auto;" /> [Nightingale, 1858](https://en.wikipedia.org/wiki/Florence_Nightingale) --- Who decides what "counts" as data viz? <img src="images/khipus-incan-dv.jpg" width="667" style="display: block; margin: auto;" /> [Incan *Khipus*](https://aeon.co/ideas/the-khipu-code-the-knotty-mystery-of-the-inkas-3d-records) encoded information as early as **1500 CE** Great blog post on ["decolonizing data viz"](https://stephanieevergreen.com/decolonizing-data-viz/) gives a few more examples of indigenous data visualization. --- # Animation and Interactivity <iframe width="560" height="315" src="https://www.youtube.com/embed/BPt8ElTQMIg" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> [Rosling, 2006](https://www.gapminder.org/tools/) --- # Statistical Animation: MDS Multi-dimensional scaling: takes distances between points in high dimension and maps them onto 2D space, preserving the distances between points <img src="images/RecentVotes-mds.svg" height="300px" style="display: block; margin: auto;" /> --- # Statistical Animation: MDS <iframe width="560" height="315" src="https://www.youtube.com/embed/p_0WXK8wupU" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> [Bell Labs 1962] --- # Skipping a few years.. <iframe width="560" height="315" src="https://www.youtube.com/embed/osuuHDS9t6k" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> [Narration by Cook, 1995](http://dicook.org/) --- # Where we are now + `ggplot2` and friends -- + `gganimate` (first published in ~2016?) -- + [plotly](https://plotly.com/ggplot2/) -- + Yihui Xie's Thesis (2013): ["Dynamic Graphics and Reporting for Statistics"](https://lib.dr.iastate.edu/etd/13518/) -- + [knitr](https://yihui.org/knitr/) package is how we "knit" our .rmd files -- + [shiny](https://cran.r-project.org/web/packages/shiny/index.html) --- # In your groups Three animation examples on jamboards: + How does animation help? + How does animation detract? --- # Recap --- # In your groups Try to come up with 3-5 "rules" for animation Things to think about: + animation vs static + animation vs interactivity + types of animations --- # Recap --- # (If Time) Brainstorm Project 3