block by cmgiven 48f76b7b7e8c482e1d227ab5410fcdcb

Cohort Trails

Full Screen

Block-a-Day #15. An alternative presentation of data from Mike Bostock’s Population Pyramid block. Census observations of population cohorts, those born in the same five-year span, are shown as dots animated over time, with trailing lines showing the decline in population as the cohort ages (increases correspond to net immigration exceeding mortality for the cohort).

Space bar toggles animation.

Data Source: Minnesota Population Center via Mike Bostock.

What I Learned: The animation/slider logic was a good exercise in boiling down more complex code to the bare necessities (all in, it’s about 50 lines). The most fiddly bit is at line 177, where we adjust the slider width to account for the extra space to the left and right of the bar.

What I’d Do With More Time: Highlight a cohort to emphasize it trajectory over time. Break out male and female population. Could be very cool to toggle between absolute and relative (i.e. mortality) values.

Block-a-Day

Just what it sounds like. For fifteen days, I will make a D3.js v4 block every single day. Rules:

  1. Ideas over implementation. Do something novel, don’t sweat the details.
  2. No more than two hours can be spent on coding (give or take).
  3. Every. Single. Day.

Previously

index.html

data.csv