text: $(window).on("load",(function(){var t=d3.select("#chord-diagram"),n=d3.formatPrefix(",.0",1e3),e=d3.scale.ordinal().domain(d3.range(4)).range(["#99B898","#FECEA8","#FF847C","#E84A5F"]),r=t.append("svg"),a=.5*Math.min(600,600)-40,d=a-30,l=d3.chord().padAngle(.05).sortSubgroups(d3.descending),u=d3.svg.arc().innerRadius(d).outerRadius(a),o=d3.ribbon().radius(d),i=r.append("g").attr("transform","translate(300,300)").datum(l([[11975,5871,8916,2868],[1951,10048,2060,6171],[8010,16145,8090,8045],[1013,990,940,6907]])),s=i.append("g").attr("class","groups").selectAll("g").data((function(t){return t.groups})).enter().append("g");s.append("path").style("fill",(function(t){return e(t.index)})).style("stroke",(function(t){return d3.rgb(e(t.index)).darker()})).attr("d",u);var c=s.selectAll(".group-tick").data((function(t){return function(t,n){var e=(t.endAngle-t.startAngle)/t.value;return d3.range(0,t.value,n).map((function(n){return{value:n,angle:n*e+t.startAngle}}))}(t,1e3)})).enter().append("g").attr("class","group-tick").attr("transform",(function(t){return"rotate("+(180*t.angle/Math.PI-90)+") translate("+a+",0)"}));c.append("line").attr("x2",6),c.filter((function(t){return t.value%5e3==0})).append("text").attr("x",8).attr("dy",".35em").attr("transform",(function(t){return t.angle>Math.PI?"rotate(180) translate(-16)":null})).style("text-anchor",(function(t){return t.angle>Math.PI?"end":null})).text((function(t){return n(t.value)})),i.append("g").attr("class","ribbons").selectAll("path").data((function(t){return t})).enter().append("path").attr("d",o).style("fill",(function(t){return e(t.target.index)})).style("stroke",(function(t){return d3.rgb(e(t.target.index)).darker()}))}));