// https://d3js.org/d3-chord/ Version 1.0.4. Copyright 2017 Mike Bostock.!function(n,t){"object"==typeofexports&&"undefined"!=typeofmodule?t(exports,require("d3-array"),require("d3-path")):"function"==typeofdefine&&define.amd?define(["exports","d3-array","d3-path"],t):t(n.d3=n.d3||{},n.d3,n.d3)}(this,function(n,t,r){"use strict";functione(n){returnfunction(t,r){returnn(t.source.value+t.target.value,r.source.value+r.target.value)}}functionu(n){returnn.source}functiono(n){returnn.target}functiona(n){returnn.radius}functionl(n){returnn.startAngle}functioni(n){returnn.endAngle}varc=Math.cos,f=Math.sin,s=Math.PI,p=s/2,h=2*s,d=Math.max,g=function(){functionn(n){vare,l,i,c,f,s,p=n.length,g=[],v=t.range(p),y=[],A=[],x=A.groups=newArray(p),b=newArray(p*p);for(e=0,f=-1;++f<p;){for(l=0,s=-1;++s<p;)l+=n[f][s];g.push(l),y.push(t.range(p)),e+=l}for(u&&v.sort(function(n,t){returnu(g[n],g[t])}),o&&y.forEach(function(t,r){t.sort(function(t,e){returno(n[r][t],n[r][e])})}),e=d(0,h-r*p)/e,c=e?r:h/p,l=0,f=-1;++f<p;){for(i=l,s=-1;++s<p;){varM=v[f],m=y[M][s],q=n[M][m],_=l,C=l+=q*e;b[m*p+M]={index:M,subindex:m,startAngle:_,endAngle:C,value:q}}x[M]={index:M,startAngle:i,endAngle:l,value:g[M]},l+=c}for(f=-1;++f<p;)for(s=f-1;++s<p;){varP=b[s*p+f],T=b[f*p+s];(P.value||T.value)&&A.push(P.value<T.value?{source:T,target:P}:{source:P,target:T})}returna?A.sort(a):A}varr=0,u=null,o=null,a=null;returnn.padAngle=function(t){returnarguments.length?(r=d(0,t),n):r},n.sortGroups=function(t){returnarguments.length?(u=t,n):u},n.sortSubgroups=function(t){returnarguments.length?(o=t,n):o},n.sortChords=function(t){returnarguments.length?(null==t?a=null:(a=e(t))._=t,n):a&&a._},n},v=Array.prototype.slice,y=function(n){returnfunction(){returnn}},A=function(){functionn(){varn,u=v.call(arguments),o=t.apply(this,u),a=e.apply(this,u),l=+s.apply(this,(u[0]=o,u)),i=h.apply(this,u)-p,y=d.apply(this,u)-p,A=l*c(i),x=l*f(i),b=+s.apply(this,(u[0]=a,u)),M=h.apply(this,u)-p,m=d.apply(this,u)-p;if(g||(g=n=r.path()),g.moveTo(A,x),g.arc(0,0,l,i,y),i===M&&y===m||(g.quadraticCurveTo(0,0,b*c(M),b*f(M)),g.arc(0,0,b,M,m)),g.quadraticCurveTo(0,0,A,x),g.closePath(),n)returng=null,n+""||null}vart=u,e=o,s=a,h=l,d=i,g=null;returnn.radius=function(t){returnarguments.length?(s="function"==typeoft?t:y(+t),n):s},n.startAngle=function(t){returnarguments.length?(h="function"==typeoft?t:y(+t),n):h},n.endAngle=function(t){returnarguments.length?(d="function"==typeoft?t:y(+t),n):d},n.source=function(r){returnarguments.length?(t=r,n):t},n.target=function(t){returnarguments.length?(e=t,n):e},n.context=function(t){returnarguments.length?(g=null==t?null:t,n):g},n};n.chord=g,n.ribbon=A,Object.defineProperty(n,"__esModule",{value:!0})});