Pixels or Perish
The art of scientific illustration will have to adapt to the new age of online publishing
At the heart of the D3 framework is a simple but general mechanism for creating or modifying elements of the DOM based on supplied data. For example, in the pyramid figure, the length of each bar is determined by an entry in a table that lists population by age, gender and year. When the year changes, each bar length is relinked to a different entry in the table. The updating of the display and the animated transitions are handled behind the scenes by the D3 library.
In designing my population pyramid I was inspired by several examples and tutorials on the D3 website (https://github.com/mbostock/d3/wiki) and I borrowed snippets of code from them. There are at least two more population pyramids among the examples, and many other delightful tools and toys worth exploring.