This is an experiment with the notion of composable visualization components that follow the Towards Reusable Charts pattern (which I think I'm finally grokking after all these years).
The idea is that visualization components can be composed in kind of a recursive way. This would make it straightforward to create, say, stacked bar charts by simply composing components in an almost algebraic expression like barChart * verticalStack * rect
. Making that into small multiples would simply require the addition of a facet
component to the expression: facetVertical * barChart * verticalStack * rect
.
This kind of thing is present in the Grammar of Graphics, the ggplot2 paper, and Vega. It would be amazing to discover straightforward JavaScript/D3 patterns that enable this kind of thing.
Built with blockbuilder.org
https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js