Example code from the book Interactive Data Visualization for the Web