text: $(window).on("load",function(){function t(t){function n(n){for(var a=1/(.1+Math.random()),r=2*Math.random()-.5,e=10/(.1+Math.random()),o=0;o<t;o++){var i=(o/t-r)*e;n[o]+=a*Math.exp(-i*i)}}var a,r=[];for(a=0;a<t;++a)r[a]=0;for(a=0;a<5;++a)n(r);return r.map(function(t,n){return{x:n,y:Math.max(0,t)}})}var n=d3.select("#streamgraph"),a={top:20,right:20,bottom:30,left:50},r=n.node().getBoundingClientRect().width-a.left-a.right,e=500-a.top-a.bottom,o=20,i=200,d=d3.layout.stack().offset("wiggle"),u=d(d3.range(o).map(function(){return t(i)})),c=d(d3.range(o).map(function(){return t(i)})),f=d3.scale.linear().domain([0,i-1]).range([0,r]),l=d3.scale.linear().domain([0,d3.max(u.concat(c),function(t){return d3.max(t,function(t){return t.y0+t.y})})]).range([e,0]),g=d3.scale.linear().range(["#99B898","#FECEA8"]),h=d3.svg.area().x(function(t){return f(t.x)}).y0(function(t){return l(t.y0)}).y1(function(t){return l(t.y0+t.y)}),m=n.append("svg"),p=m.attr("width",r).attr("height",e);p.selectAll("path").data(u).enter().append("path").attr("d",h).style("fill",function(){return g(Math.random())})});