$(window).on("load",(function(){var t=d3.select("#chord-diagram"),e=.37*Math.min(800,800),a=1.1*e,n=d3.scale.ordinal().range(["#99B898","#FECEA8","#FF847C","#E84A5F","#F8B195","#F67280","#C06C84"]),r=d3.layout.chord().padding(.05).sortSubgroups(d3.descending).matrix([[6,32,47,81,31,89,24,68,50,39],[37,83,57,80,87,7,85,7,68,17],[50,15,31,3,1,85,36,95,83,99],[37,25,37,81,72,98,32,13,70,25],[19,99,97,79,74,43,78,18,4,57],[77,2,87,41,93,52,6,42,11,76],[44,54,60,69,36,44,76,58,50,16]]),l=t.append("svg").attr("width",800).attr("height",800).append("g").attr("transform","translate(400,400)");l.append("g").selectAll(".chord-path").data(r.groups).enter().append("path").attr("class","chord-path").style("fill",(function(t){return n(t.index)})).style("stroke",(function(t){return n(t.index)})).attr("d",d3.svg.arc().innerRadius(e).outerRadius(a)).on("mouseover",o(.1,l)).on("mouseout",o(1,l));var d=l.append("g").selectAll("g").data(r.groups).enter().append("g").selectAll("g").data((function(t){var e=(t.endAngle-t.startAngle)/t.value;return d3.range(0,t.value,50).map((function(a,n){return{angle:a*e+t.startAngle,label:n%2?null:a}}))})).enter().append("g").attr("transform",(function(t){return"rotate("+(180*t.angle/Math.PI-90)+")translate("+a+",0)"}));function o(t,e){return function(a,n){e.selectAll(".d3-chord path").filter((function(t){return t.source.index!=n&&t.target.index!=n})).transition().style("opacity",t)}}d.append("line").attr("x1",1).attr("y1",0).attr("x2",5).attr("y2",0).style("stroke","#2A363B"),d.append("text").attr("x",8).attr("dy",".35em").attr("text-anchor",(function(t){return t.angle>Math.PI?"end":null})).attr("transform",(function(t){return t.angle>Math.PI?"rotate(180)translate(-16)":null})).style("font-size",12).text((function(t){return t.label})),l.append("g").attr("class","d3-chord").selectAll("path").data(r.chords).enter().append("path").style("fill",(function(t){return n(t.target.index)})).style("stroke","#000").style("stroke-width",.5).style("fill-opacity",.7).attr("d",d3.svg.chord().radius(e)).style("opacity",1)}));