For the first part of this lecture, please watch the final video for March 12 that was previously marked as (optional) in the schedule. It covers adding a mouseover interaction to the plot.
In this lecture we'll explore why d3 data joins (demos here) add flexibility to our code and see some of the neat ways we can smoothen out transitions. To do this, we'll make a bar chart using scaleBand.
The dataset for this page comes from the Bechdel Test Database where users categories movies based on whether they have (1) at least two characters who identify as women in it (2) who talk to each other (3) about something besides a man. The idea behind the test is to characterize gender representation and equity in films. Though it's called a "test", one might better think of it as a way to audit movies as a whole, as it's a very coarse measure for representation. You can see some more analyses and additional context in this FiveThirtyEight article. For our purposes, I've aggregated movie ratings along different decades of release. A genre is counted if more than 20 films have been rated in that category (whether pass or fail).
We will also learn some other handy shortcuts to make life easier. First, from here on we will employ template strings when making transforms and other string elements.