Simple streamgraph Code sample

Here’s a  simple code sample to create a streamgraph in D3.js. I found that there were not enough samples around showing how to make this graph and what kind of data is required. It is based on the sample on this Stackoverflow topic.