block by curran 02163a13a40112e0ab6f14bbacc986f8

Small Multiples with Reusable Charts

Full Screen

This example is a small multiples experiment based on code written by Mike Bostock in 2012 as part of his tutorial Towards Reusable Charts.

I had heard that the “Towards Reusable Charts” style can be used to easily create small multiples, but I didn’t quite grok how. This example shows one way that it can work, drawing data and inspiration from this other example Small Multiples III. On the way, I upgraded the original reusable line chart code to D3 v4, with minimal modifications. I also wanted to add a title to each instance of the chart, so ended up adding the values and title accessors to make it work well with the output from d3.nest.

forked from curran‘s block: Towards Reusable Charts Example

index.html

stocks.tsv

time-series-chart.js