define("echarts/chart/chord","require ./base zrender/shape/Text zrender/shape/Line zrender/shape/Sector ../util/shape/Ribbon ../util/shape/Icon zrender/shape/BezierCurve ../config ../util/ecData zrender/tool/util zrender/tool/vector ../data/Graph ../layout/Chord ../chart".split(" "),function(q){function v(a,c,b,e,w){n.call(this,a,c,b,e,w);this.scaleUnitAngle=this.scaleLineLength=4;this.refresh(e)}var n=q("./base"),a=q("zrender/shape/Text"),c=q("zrender/shape/Line"),b=q("zrender/shape/Sector"),d=q("../util/shape/Ribbon"),l=q("../util/shape/Icon"),f=q("zrender/shape/BezierCurve"),m=q("../config");m.chord={zlevel:0,z:2,clickable:!0,radius:["60%","70%"],center:["50%","50%"],padding:2,sort:"none",sortSub:"none",startAngle:90,clockWise:!0,ribbonType:!0,minRadius:10,maxRadius:20,symbol:"circle",showScale:!1,showScaleText:!1,itemStyle:{normal:{borderWidth:0,borderColor:"#000",label:{show:!0,rotate:!1,distance:5},chordStyle:{width:1,color:"black",borderWidth:1,borderColor:"#999",opacity:.5}},emphasis:{borderWidth:0,borderColor:"#000",chordStyle:{width:1,color:"black",borderWidth:1,borderColor:"#999"}}}};var k=q("../util/ecData"),B=q("zrender/tool/util"),x=q("zrender/tool/vector"),y=q("../data/Graph"),t=q("../layout/Chord");return v.prototype={type:m.CHART_TYPE_CHORD,_init:function(){var a=this.series;this.selectedMap={};for(var c={},b={},e=0,w=a.length;w>e;e++)if(a[e].type===this.type){var h=this.isSelected(a[e].name);(this.selectedMap[a[e].name]=h)&&this.buildMark(e);this.reformOption(a[e]);c[a[e].name]=a[e]}e=0;for(w=a.length;w>e;e++)a[e].type===this.type&&(a[e].insertToSerie?a[e]._referenceSerie=c[a[e].insertToSerie]:b[a[e].name]=[a[e]]);e=0;for(w=a.length;w>e;e++)if(a[e].type===this.type&&a[e].insertToSerie){for(c=a[e]._referenceSerie;c&&c._referenceSerie;)c=c._referenceSerie;b[c.name]&&this.selectedMap[a[e].name]&&b[c.name].push(a[e])}for(var u in b)this._buildChords(b[u]);this.addShapeList()},_getNodeCategory:function(a,c){return a.categories&&a.categories[c.category||0]},_getNodeQueryTarget:function(a,c){var b=this._getNodeCategory(a,c);return[c,b,a]},_getEdgeQueryTarget:function(a,c,b){return b=b||"normal",[c.itemStyle&&c.itemStyle[b],a.itemStyle[b].chordStyle]},_buildChords:function(a){for(var c=[],b=a[0],e=function(a){return 0d;d++){var u=e[d];if(u&&!u.ignore){var g=this._getNodeCategory(c,u),g=g?g.name:u.name;if(this.selectedMap[g]=this.isSelected(g),this.selectedMap[g])b.addNode(u.name,u).rawIndex=d}}d=0;for(h=a.links.length;h>d;d++){var u=a.links[d],g=u.source,r=u.target;"number"==typeof g&&(g=e[g],g&&(g=g.name));"number"==typeof r&&(r=e[r],r&&(r=r.name));(u=b.addEdge(g,r,u))&&(u.rawIndex=d)}return b.eachNode(function(a){var b=a.data.value;if(null==b)if(b=0,c.ribbonType)for(var e=0;eb&&(b+=360);var d=90>=b||270<=b,b=b*Math.PI/180,l=[Math.cos(b),-Math.sin(b)],k;k=e.ribbonType?e.showScaleText?35+m:m:m+c.layout.size;l=x.scale([],l,r[1]+k);x.add(l,l,g);var n={zlevel:this.getZlevelBase(),z:this.getZBase()+1,hoverable:!1,style:{text:null==c.data.label?c.id:c.data.label,textAlign:d?"left":"right",color:f||"#000000"}};h?(n.rotation=d?b:Math.PI+b,n.style.x=d?r[1]+k:-r[1]-k,n.style.y=0,n.position=g.slice()):(n.style.x=l[0],n.style.y=l[1]);n.style.textColor=this.deepQuery([c.data,e],"itemStyle.normal.label.textStyle.color")||"#fff";n.style.textFont=this.getFont(this.deepQuery([c.data,e],"itemStyle.normal.label.textStyle"));n=new a(n);this.shapeList.push(n);c.labelShape=n},this)},_buildRibbons:function(a,b,c,e){var f=a[b],h=this.parseCenter(this.zr,e.center),m=this.parseRadius(this.zr,e.radius);c.eachEdge(function(g,n){var p,l=c.getEdge(g.node2,g.node1);if(l&&!g.shape){if(l.shape)return void(g.shape=l.shape);var q=g.layout.startAngle/Math.PI*180,t=g.layout.endAngle/Math.PI*180,v=l.layout.startAngle/Math.PI*180,x=l.layout.endAngle/Math.PI*180;p=this.getColor(1===a.length?g.layout.weight<=l.layout.weight?g.node1.id:g.node2.id:f.name);var D,E,B=this._getEdgeQueryTarget(f,g.data),y=this._getEdgeQueryTarget(f,g.data,"emphasis");p=new d({zlevel:this.getZlevelBase(),z:this.getZBase(),style:{x:h[0],y:h[1],r:m[0],source0:q,source1:t,target0:v,target1:x,brushType:"both",opacity:this.deepQuery(B,"opacity"),color:p,lineWidth:this.deepQuery(B,"borderWidth"),strokeColor:this.deepQuery(B,"borderColor"),clockWise:e.clockWise},clickable:e.clickable,highlightStyle:{brushType:"both",opacity:this.deepQuery(y,"opacity"),lineWidth:this.deepQuery(y,"borderWidth"),strokeColor:this.deepQuery(y,"borderColor")}});g.layout.weight<=l.layout.weight?(D=l.node1,E=l.node2):(D=g.node1,E=g.node2);k.pack(p,f,b,g.data,null==g.rawIndex?n:g.rawIndex,g.data.name||D.id+"-"+E.id,D.id,E.id);this.shapeList.push(p);g.shape=p}},this)},_buildEdgeCurves:function(a,b,c,e,d){var h=a[b],m=this.parseCenter(this.zr,e.center);c.eachEdge(function(a,c){var e=d.getNodeById(a.node1.id),l=d.getNodeById(a.node2.id),e=e.shape,l=l.shape,n=this._getEdgeQueryTarget(h,a.data),q=this._getEdgeQueryTarget(h,a.data,"emphasis"),e=new f({zlevel:this.getZlevelBase(),z:this.getZBase(),style:{xStart:e.position[0],yStart:e.position[1],xEnd:l.position[0],yEnd:l.position[1],cpX1:m[0],cpY1:m[1],lineWidth:this.deepQuery(n,"width"),strokeColor:this.deepQuery(n,"color"),opacity:this.deepQuery(n,"opacity")},highlightStyle:{lineWidth:this.deepQuery(q,"width"),strokeColor:this.deepQuery(q,"color"),opacity:this.deepQuery(q,"opacity")}});k.pack(e,h,b,a.data,null==a.rawIndex?c:a.rawIndex,a.data.name||a.node1.id+"-"+a.node2.id,a.node1.id,a.node2.id);this.shapeList.push(e);a.shape=e},this)},_buildScales:function(b,d,f){var e,l,h=b.clockWise,m=this.parseCenter(this.zr,b.center),g=this.parseRadius(this.zr,b.radius),n=h?1:-1,p=0,k=-1/0;b.showScaleText&&(f.eachNode(function(a){a=a.data.value;a>k&&(k=a);p+=a}),1E10d||!h&&d>p);){var k=p/180*Math.PI,t=[Math.cos(k),Math.sin(k)],k=x.scale([],t,g[1]+1);x.add(k,k,m);t=x.scale([],t,g[1]+this.scaleLineLength);x.add(t,t,m);k=new c({zlevel:this.getZlevelBase(),z:this.getZBase()-1,hoverable:!1,style:{xStart:k[0],yStart:k[1],xEnd:t[0],yEnd:t[1],lineCap:"round",brushType:"stroke",strokeColor:"#666",lineWidth:1}});this.shapeList.push(k);p+=n*this.scaleUnitAngle}if(b.showScaleText)for(p=5*q*this.scaleUnitAngle,t=0;!(h&&f>d||!h&&d>f);){k=f;k%=360;0>k&&(k+=360);var v=90>=k||270<=k,k=new a({zlevel:this.getZlevelBase(),z:this.getZBase()-1,hoverable:!1,style:{x:v?g[1]+this.scaleLineLength+4:-g[1]-this.scaleLineLength-4,y:0,text:Math.round(10*t)/10+e,textAlign:v?"left":"right"},position:m.slice(),rotation:v?[-k/180*Math.PI,0,0]:[-(k+180)/180*Math.PI,0,0]});this.shapeList.push(k);t+=p*l;f+=n*this.scaleUnitAngle*5}},this)},refresh:function(a){if(a&&(this.option=a,this.series=a.series),this.legend=this.component.legend,this.legend)this.getColor=function(a){return this.legend.getColor(a)},this.isSelected=function(a){return this.legend.isSelected(a)};else{var b={},c=0;this.getColor=function(a){return b[a]?b[a]:(b[a]||(b[a]=this.zr.getColor(c++)),b[a])};this.isSelected=function(){return!0}}this.backupShapeList();this._init()},reformOption:function(a){var b=B.merge;a=b(b(a||{},this.ecTheme.chord),m.chord);a.itemStyle.normal.label.textStyle=this.getTextStyle(a.itemStyle.normal.label.textStyle)}},B.inherits(v,n),q("../chart").define("chord",v),v});define("echarts/util/shape/Ribbon",["require","zrender/shape/Base","zrender/shape/util/PathProxy","zrender/tool/util"],function(q){function v(c){n.call(this,c);this._pathProxy=new a}var n=q("zrender/shape/Base"),a=q("zrender/shape/util/PathProxy");q=q("zrender/tool/util");return v.prototype={type:"ribbon",buildPath:function(a,b){var d=b.clockWise||!1,l=this._pathProxy;l.begin(a);var f=b.x,m=b.y,k=b.r,n=b.source0/180*Math.PI,q=b.source1/180*Math.PI,v=b.target0/180*Math.PI,t=b.target1/180*Math.PI,z=f+Math.cos(n)*k,A=m+Math.sin(n)*k,C=f+Math.cos(q)*k,e=m+Math.sin(q)*k,w=f+Math.cos(v)*k,h=m+Math.sin(v)*k,u=f+Math.cos(t)*k,k=m+Math.sin(t)*k;l.moveTo(z,A);l.arc(f,m,b.r,n,q,!d);l.bezierCurveTo(.7*(f-C)+C,.7*(m-e)+e,.7*(f-w)+w,.7*(m-h)+h,w,h);b.source0===b.target0&&b.source1===b.target1||(l.arc(f,m,b.r,v,t,!d),l.bezierCurveTo(.7*(f-u)+u,.7*(m-k)+k,.7*(f-z)+z,.7*(m-A)+A,z,A))},getRect:function(a){return a.__rect?a.__rect:(this._pathProxy.isEmpty()||this.buildPath(null,a),this._pathProxy.fastBoundingRect())}},q.inherits(v,n),v});define("zrender/shape/BezierCurve",["require","./Base","../tool/util"],function(q){var v=q("./Base"),n=function(a){this.brushTypeOnly="stroke";this.textPosition="end";v.call(this,a)};return n.prototype={type:"bezier-curve",buildPath:function(a,c){a.moveTo(c.xStart,c.yStart);"undefined"!=typeof c.cpX2&&"undefined"!=typeof c.cpY2?a.bezierCurveTo(c.cpX1,c.cpY1,c.cpX2,c.cpY2,c.xEnd,c.yEnd):a.quadraticCurveTo(c.cpX1,c.cpY1,c.xEnd,c.yEnd)},getRect:function(a){if(a.__rect)return a.__rect;var c=Math.min(a.xStart,a.xEnd,a.cpX1),b=Math.min(a.yStart,a.yEnd,a.cpY1),d=Math.max(a.xStart,a.xEnd,a.cpX1),l=Math.max(a.yStart,a.yEnd,a.cpY1),f=a.cpX2,m=a.cpY2;"undefined"!=typeof f&&"undefined"!=typeof m&&(c=Math.min(c,f),b=Math.min(b,m),d=Math.max(d,f),l=Math.max(l,m));f=a.lineWidth||1;return a.__rect={x:c-f,y:b-f,width:d-c+f,height:l-b+f},a.__rect}},q("../tool/util").inherits(n,v),n});define("echarts/data/Graph",["require","zrender/tool/util"],function(q){var v=q("zrender/tool/util"),n=function(a){this._directed=a||!1;this.nodes=[];this.edges=[];this._nodesMap={};this._edgesMap={}};n.prototype.isDirected=function(){return this._directed};n.prototype.addNode=function(a,c){if(this._nodesMap[a])return this._nodesMap[a];var b=new n.Node(a,c);return this.nodes.push(b),this._nodesMap[a]=b,b};n.prototype.getNodeById=function(a){return this._nodesMap[a]};n.prototype.addEdge=function(a,c,b){if("string"==typeof a&&(a=this._nodesMap[a]),"string"==typeof c&&(c=this._nodesMap[c]),a&&c){var d=a.id+"-"+c.id;if(this._edgesMap[d])return this._edgesMap[d];b=new n.Edge(a,c,b);return this._directed&&(a.outEdges.push(b),c.inEdges.push(b)),a.edges.push(b),a!==c&&c.edges.push(b),this.edges.push(b),this._edgesMap[d]=b,b}};n.prototype.removeEdge=function(a){var c=a.node1,b=a.node2,d=c.id+"-"+b.id;this._directed&&(c.outEdges.splice(v.indexOf(c.outEdges,a),1),b.inEdges.splice(v.indexOf(b.inEdges,a),1));c.edges.splice(v.indexOf(c.edges,a),1);c!==b&&b.edges.splice(v.indexOf(b.edges,a),1);delete this._edgesMap[d];this.edges.splice(v.indexOf(this.edges,a),1)};n.prototype.getEdge=function(a,c){return"string"!=typeof a&&(a=a.id),"string"!=typeof c&&(c=c.id),this._directed?this._edgesMap[a+"-"+c]:this._edgesMap[a+"-"+c]||this._edgesMap[c+"-"+a]};n.prototype.removeNode=function(a){if("string"!=typeof a||(a=this._nodesMap[a])){delete this._nodesMap[a.id];this.nodes.splice(v.indexOf(this.nodes,a),1);for(var c=0;cd;)a.call(c,this.nodes[d],d)?d++:(this.removeNode(this.nodes[d]),b--)};n.prototype.filterEdge=function(a,c){for(var b=this.edges.length,d=0;b>d;)a.call(c,this.edges[d],d)?d++:(this.removeEdge(this.edges[d]),b--)};n.prototype.eachNode=function(a,c){for(var b=this.nodes.length,d=0;b>d;d++)this.nodes[d]&&a.call(c,this.nodes[d],d)};n.prototype.eachEdge=function(a,c){for(var b=this.edges.length,d=0;b>d;d++)this.edges[d]&&a.call(c,this.edges[d],d)};n.prototype.clear=function(){this.nodes.length=0;this.edges.length=0;this._nodesMap={};this._edgesMap={}};n.prototype.breadthFirstTraverse=function(a,c,b,d){if("string"==typeof c&&(c=this._nodesMap[c]),c){var l="edges";"out"===b?l="outEdges":"in"===b&&(l="inEdges");for(b=0;bf;f++){var m=l.addNode(a[f].id,a[f]);m.data.value=0;b&&(m.data.outValue=m.data.inValue=0)}for(f=0;d>f;f++)for(a=0;d>a;a++)m=c[f][a],b&&(l.nodes[f].data.outValue+=m,l.nodes[a].data.inValue+=m),l.nodes[f].data.value+=m,l.nodes[a].data.value+=m;for(f=0;d>f;f++)for(a=f;d>a;a++)if(m=c[f][a],0!==m){var k=l.nodes[f],q=l.nodes[a];if(l.addEdge(k,q,{}).data.weight=m,f!==a&&b&&c[a][f])l.addEdge(q,k,{}).data.weight=c[a][f]}return l}},n});define("echarts/layout/Chord",["require"],function(){var q=function(a){a=a||{};this.sort=a.sort||null;this.sortSub=a.sortSub||null;this.padding=.05;this.startAngle=a.startAngle||0;this.clockWise=null==a.clockWise?!1:a.clockWise;this.center=a.center||[0,0];this.directed=!0};q.prototype.run=function(a){a instanceof Array||(a=[a]);if(a.length){for(var c=a[0],b=c.nodes.length,d=[],l=0,f=0;b>f;f++){var m=c.nodes[f],k={size:0,subGroups:[],node:m};d.push(k);for(var q=0,x=0;xf;f++){k=d[f];k.node.layout.startAngle=a;k.node.layout.endAngle=a+c*k.size*m;k.node.layout.subGroups=[];for(t=0;t