Interacting with the user
This is it. This is where all of the UX tidbits I've been dropping throughout the chapter and all the functional programming ideas you've been learning come together; let's make a simple explanatory graphic that uses interaction to walk the viewer through some data.
The first step to any visualization involving user interactivity is to plan exactly what you want the visualization to do, how you want your viewers to interact with it, and what you want to say about the data. What is the data's story and what's the best way to tell it?
In the prison population dataset, we have the numerical product of over a century of incarceration in a western country. There are many ways we can look at this data. We can look at how the prison population has risen versus overall population growth, or we can look at how the prison population has risen or fallen in relation to known historical events. Often, you'll need more than one chart; for instance, when I used this data in a project...