提交 268c7e82 编写于 作者: K kener

update dist

上级 9704655a
......@@ -137,7 +137,7 @@ Desktop.ini
# Packages
*.egg
*.egg-info
dist
# dist
eggs
parts
bin
......
define("echarts/chart/bar",["require","../component/base","./base","zrender/shape/Rectangle","../component/axis","../component/grid","../component/dataZoom","../config","../util/ecData","zrender/tool/util","zrender/tool/color","../chart"],function(e){function t(e,t,a,o,r){i.call(this,e,t,a,o,r),n.call(this),this.refresh(o)}var i=e("../component/base"),n=e("./base"),a=e("zrender/shape/Rectangle");e("../component/axis"),e("../component/grid"),e("../component/dataZoom");var o=e("../config"),r=e("../util/ecData"),s=e("zrender/tool/util"),l=e("zrender/tool/color");return t.prototype={type:o.CHART_TYPE_BAR,_buildShape:function(){this._bulidPosition()},_buildNormal:function(e,t,i,n,o){for(var r,s,l,h,d,m,c,p,u,V,U,g,y=this.series,f=i[0][0],b=y[f],_=b.xAxisIndex,x=b.yAxisIndex,k="horizontal"==o?this.component.xAxis.getAxis(_):this.component.yAxis.getAxis(x),L=this._mapSize(k,i),v=L.gap,W=L.barGap,w=L.barWidthMap,X=L.barMaxWidthMap,I=L.barWidth,K=L.barMinHeightMap,S=L.interval,T=0,C=t;C>T&&null!=k.getNameByIndex(T);T++){"horizontal"==o?h=k.getCoordByIndex(T)-v/2:d=k.getCoordByIndex(T)+v/2;for(var E=0,A=i.length;A>E;E++){x=y[i[E][0]].yAxisIndex||0,_=y[i[E][0]].xAxisIndex||0,r="horizontal"==o?this.component.yAxis.getAxis(x):this.component.xAxis.getAxis(_),c=m=u=p=r.getCoord(0);for(var z=0,M=i[E].length;M>z;z++)if(f=i[E][z],b=y[f],U=b.data[T],g=null!=U?null!=U.value?U.value:U:"-",n[f]=n[f]||{min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY,sum:0,counter:0,average:0},"-"!==g){g>0?(s=z>0?r.getCoordSize(g):"horizontal"==o?c-r.getCoord(g):r.getCoord(g)-c,1===M&&K[f]>s&&(s=K[f]),"horizontal"==o?(m-=s,d=m):(h=m,m+=s)):0>g?(s=z>0?r.getCoordSize(g):"horizontal"==o?r.getCoord(g)-u:u-r.getCoord(g),1===M&&K[f]>s&&(s=K[f]),"horizontal"==o?(d=p,p+=s):(p-=s,h=p)):(s=0,"horizontal"==o?(m-=s,d=m):(h=m,m+=s));var l=Math.min(X[f]||Number.MAX_VALUE,w[f]||I);n[f][T]="horizontal"==o?h+l/2:d-l/2,n[f].min>g&&(n[f].min=g,"horizontal"==o?(n[f].minY=d,n[f].minX=n[f][T]):(n[f].minX=h+s,n[f].minY=n[f][T])),n[f].max<g&&(n[f].max=g,"horizontal"==o?(n[f].maxY=d,n[f].maxX=n[f][T]):(n[f].maxX=h+s,n[f].maxY=n[f][T])),n[f].sum+=g,n[f].counter++,T%S===0&&(V=this._getBarItem(f,T,k.getNameByIndex(T),h,d-("horizontal"==o?0:l),"horizontal"==o?l:s,"horizontal"==o?s:l,"horizontal"==o?"vertical":"horizontal"),this.shapeList.push(new a(V)))}for(var z=0,M=i[E].length;M>z;z++)f=i[E][z],b=y[f],U=b.data[T],g=null!=U?null!=U.value?U.value:U:"-","-"==g&&this.deepQuery([U,b,this.option],"calculable")&&("horizontal"==o?(m-=this.ecTheme.island.r,d=m):(h=m,m+=this.ecTheme.island.r),l=Math.min(X[f]||Number.MAX_VALUE,w[f]||I),V=this._getBarItem(f,T,k.getNameByIndex(T),h+.5,d+.5-("horizontal"==o?0:l),("horizontal"==o?l:this.ecTheme.island.r)-1,("horizontal"==o?this.ecTheme.island.r:l)-1,"horizontal"==o?"vertical":"horizontal"),V.hoverable=!1,V.draggable=!1,V.style.lineWidth=1,V.style.brushType="stroke",V.style.strokeColor=b.calculableHolderColor||this.ecTheme.calculableHolderColor,this.shapeList.push(new a(V)));"horizontal"==o?h+=l+W:d-=l+W}}this._calculMarkMapXY(n,i,"horizontal"==o?"y":"x")},_buildHorizontal:function(e,t,i,n){return this._buildNormal(e,t,i,n,"horizontal")},_buildVertical:function(e,t,i,n){return this._buildNormal(e,t,i,n,"vertical")},_buildOther:function(e,t,i,n){for(var o=this.series,r=0,s=i.length;s>r;r++)for(var l=0,h=i[r].length;h>l;l++){var d=i[r][l],m=o[d],c=m.xAxisIndex||0,p=this.component.xAxis.getAxis(c),u=p.getCoord(0),V=m.yAxisIndex||0,U=this.component.yAxis.getAxis(V),g=U.getCoord(0);n[d]=n[d]||{min0:Number.POSITIVE_INFINITY,min1:Number.POSITIVE_INFINITY,max0:Number.NEGATIVE_INFINITY,max1:Number.NEGATIVE_INFINITY,sum0:0,sum1:0,counter0:0,counter1:0,average0:0,average1:0};for(var y=0,f=m.data.length;f>y;y++){var b=m.data[y],_=null!=b?null!=b.value?b.value:b:"-";if(_ instanceof Array){var x,k,L=p.getCoord(_[0]),v=U.getCoord(_[1]),W=[b,m],w=this.deepQuery(W,"barWidth")||10,X=this.deepQuery(W,"barHeight");null!=X?(x="horizontal",_[0]>0?(w=L-u,L-=w):w=_[0]<0?u-L:0,k=this._getBarItem(d,y,_[0],L,v-X/2,w,X,x)):(x="vertical",_[1]>0?X=g-v:_[1]<0?(X=v-g,v-=X):X=0,k=this._getBarItem(d,y,_[0],L-w/2,v,w,X,x)),this.shapeList.push(new a(k)),L=p.getCoord(_[0]),v=U.getCoord(_[1]),n[d].min0>_[0]&&(n[d].min0=_[0],n[d].minY0=v,n[d].minX0=L),n[d].max0<_[0]&&(n[d].max0=_[0],n[d].maxY0=v,n[d].maxX0=L),n[d].sum0+=_[0],n[d].counter0++,n[d].min1>_[1]&&(n[d].min1=_[1],n[d].minY1=v,n[d].minX1=L),n[d].max1<_[1]&&(n[d].max1=_[1],n[d].maxY1=v,n[d].maxX1=L),n[d].sum1+=_[1],n[d].counter1++}}}this._calculMarkMapXY(n,i,"xy")},_mapSize:function(e,t,i){var n,a,o=this._findSpecialBarSzie(t,i),r=o.barWidthMap,s=o.barMaxWidthMap,l=o.barMinHeightMap,h=o.sBarWidthCounter,d=o.sBarWidthTotal,m=o.barGap,c=o.barCategoryGap,p=1;if(t.length!=h){if(i)n=e.getGap(),m=0,a=Math.floor(n/t.length),0>=a&&(p=Math.floor(t.length/n),a=1);else if(n="string"==typeof c&&c.match(/%$/)?Math.floor(e.getGap()*(100-parseFloat(c))/100):e.getGap()-c,"string"==typeof m&&m.match(/%$/)?(m=parseFloat(m)/100,a=Math.floor((n-d)/((t.length-1)*m+t.length-h)),m=Math.floor(a*m)):(m=parseFloat(m),a=Math.floor((n-d-m*(t.length-1))/(t.length-h))),0>=a)return this._mapSize(e,t,!0)}else if(n=h>1?"string"==typeof c&&c.match(/%$/)?Math.floor(e.getGap()*(100-parseFloat(c))/100):e.getGap()-c:d,a=0,m=h>1?Math.floor((n-d)/(h-1)):0,0>m)return this._mapSize(e,t,!0);return this._recheckBarMaxWidth(t,r,s,l,n,a,m,p)},_findSpecialBarSzie:function(e,t){for(var i,n,a,o,r=this.series,s={},l={},h={},d=0,m=0,c=0,p=e.length;p>c;c++)for(var u={barWidth:!1,barMaxWidth:!1},V=0,U=e[c].length;U>V;V++){var g=e[c][V],y=r[g];if(!t){if(u.barWidth)s[g]=i;else if(i=this.query(y,"barWidth"),null!=i){s[g]=i,m+=i,d++,u.barWidth=!0;for(var f=0,b=V;b>f;f++){var _=e[c][f];s[_]=i}}if(u.barMaxWidth)l[g]=n;else if(n=this.query(y,"barMaxWidth"),null!=n){l[g]=n,u.barMaxWidth=!0;for(var f=0,b=V;b>f;f++){var _=e[c][f];l[_]=n}}}h[g]=this.query(y,"barMinHeight"),a=null!=a?a:this.query(y,"barGap"),o=null!=o?o:this.query(y,"barCategoryGap")}return{barWidthMap:s,barMaxWidthMap:l,barMinHeightMap:h,sBarWidth:i,sBarMaxWidth:n,sBarWidthCounter:d,sBarWidthTotal:m,barGap:a,barCategoryGap:o}},_recheckBarMaxWidth:function(e,t,i,n,a,o,r,s){for(var l=0,h=e.length;h>l;l++)for(var d=0,m=e[l].length;m>d;d++){var c=e[l][d];i[c]&&i[c]<o&&(a-=o-i[c])}return{barWidthMap:t,barMaxWidthMap:i,barMinHeightMap:n,gap:a,barWidth:o,barGap:r,interval:s}},_getBarItem:function(e,t,i,n,a,o,s,h){var d,m=this.series,c=m[e],p=c.data[t],u=this._sIndex2ColorMap[e],V=[p,c],U=this.deepQuery(V,"itemStyle.normal.color")||u,g=this.deepQuery(V,"itemStyle.emphasis.color"),y=this.deepMerge(V,"itemStyle.normal"),f=y.barBorderWidth,b=this.deepMerge(V,"itemStyle.emphasis");if(d={zlevel:this._zlevelBase,clickable:this.deepQuery(V,"clickable"),style:{x:n,y:a,width:o,height:s,brushType:"both",color:this.getItemStyleColor(U,e,t,p),radius:y.barBorderRadius,lineWidth:f,strokeColor:y.barBorderColor},highlightStyle:{color:this.getItemStyleColor(g,e,t,p),radius:b.barBorderRadius,lineWidth:b.barBorderWidth,strokeColor:b.barBorderColor},_orient:h},d.highlightStyle.color=d.highlightStyle.color||("string"==typeof d.style.color?l.lift(d.style.color,-.3):d.style.color),f>0&&d.style.height>f&&d.style.width>f?(d.style.y+=f/2,d.style.height-=f,d.style.x+=f/2,d.style.width-=f):d.style.brushType="fill",d.highlightStyle.textColor=d.highlightStyle.color,d=this.addLabel(d,c,p,i,h),"insideLeft"===d.style.textPosition||"insideRight"===d.style.textPosition||"insideTop"===d.style.textPosition||"insideBottom"===d.style.textPosition){var _=5;switch(d.style.textPosition){case"insideLeft":d.style.textX=d.style.x+_,d.style.textY=d.style.y+d.style.height/2,d.style.textAlign="left",d.style.textBaseline="middle";break;case"insideRight":d.style.textX=d.style.x+d.style.width-_,d.style.textY=d.style.y+d.style.height/2,d.style.textAlign="right",d.style.textBaseline="middle";break;case"insideTop":d.style.textX=d.style.x+d.style.width/2,d.style.textY=d.style.y+_/2,d.style.textAlign="center",d.style.textBaseline="top";break;case"insideBottom":d.style.textX=d.style.x+d.style.width/2,d.style.textY=d.style.y+d.style.height-_/2,d.style.textAlign="center",d.style.textBaseline="bottom"}d.style.textPosition="specific",d.style.textColor=d.style.textColor||"#fff"}return this.deepQuery([p,c,this.option],"calculable")&&(this.setCalculable(d),d.draggable=!0),r.pack(d,m[e],e,m[e].data[t],t,i),d},getMarkCoord:function(e,t){var i,n,a=this.series[e],o=this.xMarkMap[e],r=this.component.xAxis.getAxis(a.xAxisIndex),s=this.component.yAxis.getAxis(a.yAxisIndex);if(!t.type||"max"!==t.type&&"min"!==t.type&&"average"!==t.type)if(o.isHorizontal){i="string"==typeof t.xAxis&&r.getIndexByName?r.getIndexByName(t.xAxis):t.xAxis||0;var l=o[i];l=null!=l?l:"string"!=typeof t.xAxis&&r.getCoordByIndex?r.getCoordByIndex(t.xAxis||0):r.getCoord(t.xAxis||0),n=[l,s.getCoord(t.yAxis||0)]}else{i="string"==typeof t.yAxis&&s.getIndexByName?s.getIndexByName(t.yAxis):t.yAxis||0;var h=o[i];h=null!=h?h:"string"!=typeof t.yAxis&&s.getCoordByIndex?s.getCoordByIndex(t.yAxis||0):s.getCoord(t.yAxis||0),n=[r.getCoord(t.xAxis||0),h]}else{var d=null!=t.valueIndex?t.valueIndex:null!=o.maxX0?"1":"";n=[o[t.type+"X"+d],o[t.type+"Y"+d],o[t.type+"Line"+d],o[t.type+d]]}return n},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()},addDataAnimation:function(e){for(var t=this.series,i={},n=0,a=e.length;a>n;n++)i[e[n][0]]=e[n];for(var o,s,l,h,d,m,c,n=this.shapeList.length-1;n>=0;n--)if(m=r.get(this.shapeList[n],"seriesIndex"),i[m]&&!i[m][3]&&"rectangle"===this.shapeList[n].type){if(c=r.get(this.shapeList[n],"dataIndex"),d=t[m],i[m][2]&&c===d.data.length-1){this.zr.delShape(this.shapeList[n].id);continue}if(!i[m][2]&&0===c){this.zr.delShape(this.shapeList[n].id);continue}"horizontal"===this.shapeList[n]._orient?(h=this.component.yAxis.getAxis(d.yAxisIndex||0).getGap(),l=i[m][2]?-h:h,o=0):(s=this.component.xAxis.getAxis(d.xAxisIndex||0).getGap(),o=i[m][2]?s:-s,l=0),this.shapeList[n].position=[0,0],this.zr.animate(this.shapeList[n].id,"").when(500,{position:[o,l]}).start()}}},s.inherits(t,n),s.inherits(t,i),e("../chart").define("bar",t),t});
\ No newline at end of file
define("echarts/chart/chord",["require","../component/base","./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"],function(e){"use strict";function t(e,t,a,o,s){i.call(this,e,t,a,o,s),n.call(this),this.scaleLineLength=4,this.scaleUnitAngle=4,this.refresh(o)}var i=e("../component/base"),n=e("./base"),a=e("zrender/shape/Text"),o=e("zrender/shape/Line"),s=e("zrender/shape/Sector"),r=e("../util/shape/Ribbon"),l=e("../util/shape/Icon"),h=e("zrender/shape/BezierCurve"),d=e("../config"),p=e("../util/ecData"),m=e("zrender/tool/util"),c=e("zrender/tool/vector"),u=e("../data/Graph"),V=e("../layout/Chord");return t.prototype={type:d.CHART_TYPE_CHORD,_init:function(){var e=this.series;this.selectedMap={};for(var t={},i={},n=0,a=e.length;a>n;n++)if(e[n].type===this.type){var o=this.isSelected(e[n].name);this.selectedMap[e[n].name]=o,o&&this.buildMark(n),this.reformOption(e[n]),t[e[n].name]=e[n]}for(var n=0,a=e.length;a>n;n++)if(e[n].type===this.type)if(e[n].insertToSerie){var s=t[e[n].insertToSerie];e[n]._referenceSerie=s}else i[e[n].name]=[e[n]];for(var n=0,a=e.length;a>n;n++)if(e[n].type===this.type&&e[n].insertToSerie){for(var r=e[n]._referenceSerie;r&&r._referenceSerie;)r=r._referenceSerie;i[r.name]&&this.selectedMap[e[n].name]&&i[r.name].push(e[n])}for(var l in i)this._buildChords(i[l]);this.addShapeList()},_getNodeCategory:function(e,t){return e.categories&&e.categories[t.category||0]},_getNodeQueryTarget:function(e,t){var i=this._getNodeCategory(e,t);return[t,i,e]},_getEdgeQueryTarget:function(e,t,i){return i=i||"normal",[t.itemStyle&&t.itemStyle[i],e.itemStyle[i].chordStyle]},_buildChords:function(e){for(var t=[],i=e[0],n=function(e){return e.layout.size>0},a=0;a<e.length;a++){var o=e[a];if(this.selectedMap[o.name]){var s;o.data&&o.matrix?s=this._getSerieGraphFromDataMatrix(o,i):o.nodes&&o.links&&(s=this._getSerieGraphFromNodeLinks(o,i)),s.filterNode(n,this),t.push(s),s.__serie=o}}if(t.length){var r=t[0];if(!i.ribbonType){var l=i.minRadius,h=i.maxRadius,d=1/0,p=-1/0;r.eachNode(function(e){p=Math.max(e.layout.size,p),d=Math.min(e.layout.size,d)});var m=(h-l)/(p-d);r.eachNode(function(e){var t=this._getNodeQueryTarget(i,e),n=this.query(t,"symbolSize");e.layout.size=p===d?n||d:n||(e.layout.size-d)*m+l},this)}var c=new V;c.clockWise=i.clockWise,c.startAngle=i.startAngle*Math.PI/180,c.clockWise||(c.startAngle=-c.startAngle),c.padding=i.padding*Math.PI/180,c.sort=i.sort,c.sortSub=i.sortSub,c.directed=i.ribbonType,c.run(t);var u=this.query(i,"itemStyle.normal.label.show");if(i.ribbonType){this._buildSectors(i,0,r,i,t),u&&this._buildLabels(i,0,r,i,t);for(var a=0,g=0;a<e.length;a++)this.selectedMap[e[a].name]&&this._buildRibbons(e,a,t[g++],i);i.showScale&&this._buildScales(i,0,r)}else{this._buildNodeIcons(i,0,r,i,t),u&&this._buildLabels(i,0,r,i,t);for(var a=0,g=0;a<e.length;a++)this.selectedMap[e[a].name]&&this._buildEdgeCurves(e,a,t[g++],i,r)}this._initHoverHandler(e,t)}},_getSerieGraphFromDataMatrix:function(e,t){for(var i=[],n=0,a=[],o=0;o<e.matrix.length;o++)a[o]=e.matrix[o].slice();for(var s=e.data||e.nodes,o=0;o<s.length;o++){var r={},l=s[o];l.rawIndex=o;for(var h in l)"name"===h?r.id=l.name:r[h]=l[h];var d=this._getNodeCategory(t,l),p=d?d.name:l.name;if(this.selectedMap[p]=this.isSelected(p),this.selectedMap[p])i.push(r),n++;else{a.splice(n,1);for(var m=0;m<a.length;m++)a[m].splice(n,1)}}var c=u.fromMatrix(i,a,!0);return c.eachNode(function(e){e.layout={size:e.data.outValue},e.rawIndex=e.data.rawIndex}),c.eachEdge(function(e){e.layout={weight:e.data.weight}}),c},_getSerieGraphFromNodeLinks:function(e,t){for(var i=new u(!0),n=e.data||e.nodes,a=0,o=n.length;o>a;a++){var s=n[a];if(s&&!s.ignore){var r=this._getNodeCategory(t,s),l=r?r.name:s.name;if(this.selectedMap[l]=this.isSelected(l),this.selectedMap[l]){var h=i.addNode(s.name,s);h.rawIndex=a}}}for(var a=0,o=e.links.length;o>a;a++){var d=e.links[a],p=d.source,m=d.target;"number"==typeof p&&(p=n[p],p&&(p=p.name)),"number"==typeof m&&(m=n[m],m&&(m=m.name));var c=i.addEdge(p,m,d);c&&(c.rawIndex=a)}return i.eachNode(function(e){var i=e.data.value;if(null==i)if(i=0,t.ribbonType)for(var n=0;n<e.outEdges.length;n++)i+=e.outEdges[n].data.weight||0;else for(var n=0;n<e.edges.length;n++)i+=e.edges[n].data.weight||0;e.layout={size:i}}),i.eachEdge(function(e){e.layout={weight:null==e.data.weight?1:e.data.weight}}),i},_initHoverHandler:function(e,t){var i=e[0],n=t[0],a=this;n.eachNode(function(e){e.shape.onmouseover=function(){n.eachNode(function(e){e.shape.style.opacity=.1,e.labelShape&&(e.labelShape.style.opacity=.1,e.labelShape.modSelf()),e.shape.modSelf()});for(var i=0;i<t.length;i++)for(var o=0;o<t[i].edges.length;o++){var s=t[i].edges[o],r=a._getEdgeQueryTarget(t[i].__serie,s.data);s.shape.style.opacity=.1*a.deepQuery(r,"opacity"),s.shape.modSelf()}e.shape.style.opacity=1,e.labelShape&&(e.labelShape.style.opacity=1);for(var i=0;i<t.length;i++){var l=t[i].getNodeById(e.id);if(l)for(var o=0;o<l.outEdges.length;o++){var s=l.outEdges[o],r=a._getEdgeQueryTarget(t[i].__serie,s.data);s.shape.style.opacity=a.deepQuery(r,"opacity");var h=t[0].getNodeById(s.node2.id);h&&(h.shape&&(h.shape.style.opacity=1),h.labelShape&&(h.labelShape.style.opacity=1))}}a.zr.refreshNextFrame()},e.shape.onmouseout=function(){n.eachNode(function(e){e.shape.style.opacity=1,e.labelShape&&(e.labelShape.style.opacity=1,e.labelShape.modSelf()),e.shape.modSelf()});for(var e=0;e<t.length;e++)for(var o=0;o<t[e].edges.length;o++){var s=t[e].edges[o],r=[s.data,i];s.shape.style.opacity=a.deepQuery(r,"itemStyle.normal.chordStyle.opacity"),s.shape.modSelf()}a.zr.refreshNextFrame()}})},_buildSectors:function(e,t,i,n){var a=this.parseCenter(this.zr,n.center),o=this.parseRadius(this.zr,n.radius),r=n.clockWise,l=r?1:-1;i.eachNode(function(i){var h=this._getNodeCategory(n,i.data),d=this.getColor(h?h.name:i.id),m=i.layout.startAngle/Math.PI*180*l,c=i.layout.endAngle/Math.PI*180*l,u=new s({zlevel:this.getZlevelBase(),style:{x:a[0],y:a[1],r0:o[0],r:o[1],startAngle:m,endAngle:c,brushType:"fill",opacity:1,color:d,clockWise:r},clickable:n.clickable,highlightStyle:{brushType:"fill"}});u.style.lineWidth=this.deepQuery([i.data,n],"itemStyle.normal.borderWidth"),u.highlightStyle.lineWidth=this.deepQuery([i.data,n],"itemStyle.emphasis.borderWidth"),u.style.strokeColor=this.deepQuery([i.data,n],"itemStyle.normal.borderColor"),u.highlightStyle.strokeColor=this.deepQuery([i.data,n],"itemStyle.emphasis.borderColor"),u.style.lineWidth>0&&(u.style.brushType="both"),u.highlightStyle.lineWidth>0&&(u.highlightStyle.brushType="both"),p.pack(u,e,t,i.data,i.rawIndex,i.id,i.category),this.shapeList.push(u),i.shape=u},this)},_buildNodeIcons:function(e,t,i,n){var a=this.parseCenter(this.zr,n.center),o=this.parseRadius(this.zr,n.radius),s=o[1];i.eachNode(function(i){var o=i.layout.startAngle,r=i.layout.endAngle,h=(o+r)/2,d=s*Math.cos(h),m=s*Math.sin(h),c=this._getNodeQueryTarget(n,i.data),u=this._getNodeCategory(n,i.data),V=this.deepQuery(c,"itemStyle.normal.color");V||(V=this.getColor(u?u.name:i.id));var g=new l({zlevel:this.getZlevelBase(),z:1,style:{x:-i.layout.size,y:-i.layout.size,width:2*i.layout.size,height:2*i.layout.size,iconType:this.deepQuery(c,"symbol"),color:V,brushType:"both",lineWidth:this.deepQuery(c,"itemStyle.normal.borderWidth"),strokeColor:this.deepQuery(c,"itemStyle.normal.borderColor")},highlightStyle:{color:this.deepQuery(c,"itemStyle.emphasis.color"),lineWidth:this.deepQuery(c,"itemStyle.emphasis.borderWidth"),strokeColor:this.deepQuery(c,"itemStyle.emphasis.borderColor")},clickable:n.clickable,position:[d+a[0],m+a[1]]});p.pack(g,e,t,i.data,i.rawIndex,i.id,i.category),this.shapeList.push(g),i.shape=g},this)},_buildLabels:function(e,t,i,n){var o=this.query(n,"itemStyle.normal.label.color"),s=this.query(n,"itemStyle.normal.label.rotate"),r=this.query(n,"itemStyle.normal.label.distance"),l=this.parseCenter(this.zr,n.center),h=this.parseRadius(this.zr,n.radius),d=n.clockWise,p=d?1:-1;i.eachNode(function(e){var t=e.layout.startAngle/Math.PI*180*p,i=e.layout.endAngle/Math.PI*180*p,d=(t*-p+i*-p)/2;d%=360,0>d&&(d+=360);var m=90>=d||d>=270;d=d*Math.PI/180;var u=[Math.cos(d),-Math.sin(d)],V=0;V=n.ribbonType?n.showScaleText?35+r:r:r+e.layout.size;var g=c.scale([],u,h[1]+V);c.add(g,g,l);var U={zlevel:this.getZlevelBase()+1,hoverable:!1,style:{text:e.id,textAlign:m?"left":"right",color:o||"#000000"}};s?(U.rotation=m?d:Math.PI+d,U.style.x=m?h[1]+V:-h[1]-V,U.style.y=0,U.position=l.slice()):(U.style.x=g[0],U.style.y=g[1]),U.style.textColor=this.deepQuery([e.data,n],"itemStyle.normal.label.textStyle.color")||"#fff",U.style.textFont=this.getFont(this.deepQuery([e.data,n],"itemStyle.normal.label.textStyle")),U=new a(U),this.shapeList.push(U),e.labelShape=U},this)},_buildRibbons:function(e,t,i,n){var a=e[t],o=this.parseCenter(this.zr,n.center),s=this.parseRadius(this.zr,n.radius);i.eachEdge(function(l,h){var d,m=i.getEdge(l.node2,l.node1);if(m&&!l.shape){if(m.shape)return void(l.shape=m.shape);var c=l.layout.startAngle/Math.PI*180,u=l.layout.endAngle/Math.PI*180,V=m.layout.startAngle/Math.PI*180,g=m.layout.endAngle/Math.PI*180;d=this.getColor(1===e.length?l.layout.weight<=m.layout.weight?l.node1.id:l.node2.id:a.name);var U=this._getEdgeQueryTarget(a,l.data),y=this._getEdgeQueryTarget(a,l.data,"emphasis"),f=new r({zlevel:this.getZlevelBase(),style:{x:o[0],y:o[1],r:s[0],source0:c,source1:u,target0:V,target1:g,brushType:"both",opacity:this.deepQuery(U,"opacity"),color:d,lineWidth:this.deepQuery(U,"borderWidth"),strokeColor:this.deepQuery(U,"borderColor"),clockWise:n.clockWise},clickable:n.clickable,highlightStyle:{brushType:"both",opacity:this.deepQuery(y,"opacity"),lineWidth:this.deepQuery(y,"borderWidth"),strokeColor:this.deepQuery(y,"borderColor")}});p.pack(f,a,t,l.data,null==l.rawIndex?h:l.rawIndex,l.data.name||l.node1.id+"-"+l.node2.id,l.node1.id,l.node2.id),this.shapeList.push(f),l.shape=f}},this)},_buildEdgeCurves:function(e,t,i,n,a){var o=e[t],s=this.parseCenter(this.zr,n.center);i.eachEdge(function(e,i){var n=a.getNodeById(e.node1.id),r=a.getNodeById(e.node2.id),l=n.shape,d=r.shape,m=this._getEdgeQueryTarget(o,e.data),c=this._getEdgeQueryTarget(o,e.data,"emphasis"),u=new h({zlevel:this.getZlevelBase(),z:0,style:{xStart:l.position[0],yStart:l.position[1],xEnd:d.position[0],yEnd:d.position[1],cpX1:s[0],cpY1:s[1],lineWidth:this.deepQuery(m,"width"),strokeColor:this.deepQuery(m,"color"),opacity:this.deepQuery(m,"opacity")},highlightStyle:{lineWidth:this.deepQuery(c,"width"),strokeColor:this.deepQuery(c,"color"),opacity:this.deepQuery(c,"opacity")}});p.pack(u,o,t,e.data,null==e.rawIndex?i:e.rawIndex,e.data.name||e.node1.id+"-"+e.node2.id,e.node1.id,e.node2.id),this.shapeList.push(u),e.shape=u},this)},_buildScales:function(e,t,i){var n,s,r=e.clockWise,l=this.parseCenter(this.zr,e.center),h=this.parseRadius(this.zr,e.radius),d=r?1:-1,p=0,m=-1/0;e.showScaleText&&(i.eachNode(function(e){var t=e.data.value;t>m&&(m=t),p+=t}),m>1e10?(n="b",s=1e-9):m>1e7?(n="m",s=1e-6):m>1e4?(n="k",s=.001):(n="",s=1));var u=p/(360-e.padding);i.eachNode(function(t){for(var i=t.layout.startAngle/Math.PI*180,p=t.layout.endAngle/Math.PI*180,m=i;;){if(r&&m>p||!r&&p>m)break;var V=m/180*Math.PI,g=[Math.cos(V),Math.sin(V)],U=c.scale([],g,h[1]+1);c.add(U,U,l);var y=c.scale([],g,h[1]+this.scaleLineLength);c.add(y,y,l);var f=new o({zlevel:this.getZlevelBase()-1,hoverable:!1,style:{xStart:U[0],yStart:U[1],xEnd:y[0],yEnd:y[1],lineCap:"round",brushType:"stroke",strokeColor:"#666",lineWidth:1}});this.shapeList.push(f),m+=d*this.scaleUnitAngle}if(e.showScaleText)for(var _=i,b=5*u*this.scaleUnitAngle,x=0;;){if(r&&_>p||!r&&p>_)break;var V=_;V%=360,0>V&&(V+=360);var k=90>=V||V>=270,L=new a({zlevel:this.getZlevelBase()-1,hoverable:!1,style:{x:k?h[1]+this.scaleLineLength+4:-h[1]-this.scaleLineLength-4,y:0,text:Math.round(10*x)/10+n,textAlign:k?"left":"right"},position:l.slice(),rotation:k?[-V/180*Math.PI,0,0]:[-(V+180)/180*Math.PI,0,0]});this.shapeList.push(L),x+=b*s,_+=d*this.scaleUnitAngle*5}},this)},refresh:function(e){if(e&&(this.option=e,this.series=e.series),this.legend=this.component.legend,this.legend)this.getColor=function(e){return this.legend.getColor(e)},this.isSelected=function(e){return this.legend.isSelected(e)};else{var t={},i=0;this.getColor=function(e){return t[e]?t[e]:(t[e]||(t[e]=this.zr.getColor(i++)),t[e])},this.isSelected=function(){return!0}}this.backupShapeList(),this._init()},reformOption:function(e){var t=m.merge;e=t(e||{},this.ecTheme.chord),e.itemStyle.normal.label.textStyle=t(e.itemStyle.normal.label.textStyle||{},this.ecTheme.textStyle)}},m.inherits(t,n),m.inherits(t,i),e("../chart").define("chord",t),t}),define("echarts/util/shape/Ribbon",["require","zrender/shape/Base","zrender/shape/util/PathProxy","zrender/tool/util","zrender/tool/area"],function(e){function t(e){i.call(this,e),this._pathProxy=new n}var i=e("zrender/shape/Base"),n=e("zrender/shape/util/PathProxy"),a=e("zrender/tool/util"),o=e("zrender/tool/area");return t.prototype={type:"ribbon",buildPath:function(e,t){var i=t.clockWise||!1,n=this._pathProxy;n.begin(e);var a=t.x,o=t.y,s=t.r,r=t.source0/180*Math.PI,l=t.source1/180*Math.PI,h=t.target0/180*Math.PI,d=t.target1/180*Math.PI,p=a+Math.cos(r)*s,m=o+Math.sin(r)*s,c=a+Math.cos(l)*s,u=o+Math.sin(l)*s,V=a+Math.cos(h)*s,g=o+Math.sin(h)*s,U=a+Math.cos(d)*s,y=o+Math.sin(d)*s;n.moveTo(p,m),n.arc(a,o,t.r,r,l,!i),n.bezierCurveTo(.7*(a-c)+c,.7*(o-u)+u,.7*(a-V)+V,.7*(o-g)+g,V,g),(t.source0!==t.target0||t.source1!==t.target1)&&(n.arc(a,o,t.r,h,d,!i),n.bezierCurveTo(.7*(a-U)+U,.7*(o-y)+y,.7*(a-p)+p,.7*(o-m)+m,p,m))},getRect:function(e){return e.__rect?e.__rect:(this._pathProxy.isEmpty()||this.buildPath(null,e),this._pathProxy.fastBoundingRect())},isCover:function(e,t){var i=this.getRect(this.style);return e>=i.x&&e<=i.x+i.width&&t>=i.y&&t<=i.y+i.height?o.isInsidePath(this._pathProxy.pathCommands,0,"fill",e,t):void 0}},a.inherits(t,i),t}),define("zrender/shape/BezierCurve",["require","./Base","../tool/util"],function(e){"use strict";var t=e("./Base"),i=function(e){this.brushTypeOnly="stroke",this.textPosition="end",t.call(this,e)};return i.prototype={type:"bezier-curve",buildPath:function(e,t){e.moveTo(t.xStart,t.yStart),"undefined"!=typeof t.cpX2&&"undefined"!=typeof t.cpY2?e.bezierCurveTo(t.cpX1,t.cpY1,t.cpX2,t.cpY2,t.xEnd,t.yEnd):e.quadraticCurveTo(t.cpX1,t.cpY1,t.xEnd,t.yEnd)},getRect:function(e){if(e.__rect)return e.__rect;var t=Math.min(e.xStart,e.xEnd,e.cpX1),i=Math.min(e.yStart,e.yEnd,e.cpY1),n=Math.max(e.xStart,e.xEnd,e.cpX1),a=Math.max(e.yStart,e.yEnd,e.cpY1),o=e.cpX2,s=e.cpY2;"undefined"!=typeof o&&"undefined"!=typeof s&&(t=Math.min(t,o),i=Math.min(i,s),n=Math.max(n,o),a=Math.max(a,s));var r=e.lineWidth||1;return e.__rect={x:t-r,y:i-r,width:n-t+r,height:a-i+r},e.__rect}},e("../tool/util").inherits(i,t),i}),define("echarts/data/Graph",["require","zrender/tool/util"],function(e){var t=e("zrender/tool/util"),i=function(e){this._directed=e||!1,this.nodes=[],this.edges=[],this._nodesMap={},this._edgesMap={}};i.prototype.isDirected=function(){return this._directed},i.prototype.addNode=function(e,t){if(this._nodesMap[e])return this._nodesMap[e];var n=new i.Node(e,t);return this.nodes.push(n),this._nodesMap[e]=n,n},i.prototype.getNodeById=function(e){return this._nodesMap[e]},i.prototype.addEdge=function(e,t,n){if("string"==typeof e&&(e=this._nodesMap[e]),"string"==typeof t&&(t=this._nodesMap[t]),e&&t){var a=e.id+"-"+t.id;if(this._edgesMap[a])return this._edgesMap[a];var o=new i.Edge(e,t,n);return this._directed&&(e.outEdges.push(o),t.inEdges.push(o)),e.edges.push(o),e!==t&&t.edges.push(o),this.edges.push(o),this._edgesMap[a]=o,o}},i.prototype.removeEdge=function(e){var i=e.node1,n=e.node2,a=i.id+"-"+n.id;this._directed&&(i.outEdges.splice(t.indexOf(i.outEdges,e),1),n.inEdges.splice(t.indexOf(n.inEdges,e),1)),i.edges.splice(t.indexOf(i.edges,e),1),i!==n&&n.edges.splice(t.indexOf(n.edges,e),1),delete this._edgesMap[a],this.edges.splice(t.indexOf(this.edges,e),1)},i.prototype.getEdge=function(e,t){return"string"!=typeof e&&(e=e.id),"string"!=typeof t&&(t=t.id),this._directed?this._edgesMap[e+"-"+t]||this._edgesMap[t+"-"+e]:this._edgesMap[e+"-"+t]},i.prototype.removeNode=function(e){if("string"!=typeof e||(e=this._nodesMap[e])){delete this._nodesMap[e.id],this.nodes.splice(t.indexOf(this.nodes,e),1);for(var i=0;i<this.edges.length;){var n=this.edges[i];n.node1===e||n.node2===e?this.removeEdge(n):i++}}},i.prototype.filterNode=function(e,t){for(var i=this.nodes.length,n=0;i>n;)e.call(t,this.nodes[n],n)?n++:(this.removeNode(this.nodes[n]),i--)},i.prototype.filterEdge=function(e,t){for(var i=this.edges.length,n=0;i>n;)e.call(t,this.edges[n],n)?n++:(this.removeEdge(this.edges[n]),i--)},i.prototype.eachNode=function(e,t){for(var i=this.nodes.length,n=0;i>n;n++)this.nodes[n]&&e.call(t,this.nodes[n],n)},i.prototype.eachEdge=function(e,t){for(var i=this.edges.length,n=0;i>n;n++)this.edges[n]&&e.call(t,this.edges[n],n)},i.prototype.clear=function(){this.nodes.length=0,this.edges.length=0,this._nodesMap={},this._edgesMap={}},i.prototype.breadthFirstTraverse=function(e,t,i,n){if("string"==typeof t&&(t=this._nodesMap[t]),t){var a="edges";"out"===i?a="outEdges":"in"===i&&(a="inEdges");for(var o=0;o<this.nodes.length;o++)this.nodes[o].__visited=!1;if(!e.call(n,t,null))for(var s=[t];s.length;)for(var r=s.shift(),l=r[a],o=0;o<l.length;o++){var h=l[o],d=h.node1===r?h.node2:h.node1;if(!d.__visited){if(e.call(d,d,r))return;s.push(d),d.__visited=!0}}}},i.prototype.clone=function(){for(var e=new i(this._directed),t=0;t<this.nodes.length;t++)e.addNode(this.nodes[t].id,this.nodes[t].data);for(var t=0;t<this.edges.length;t++){var n=this.edges[t];e.addEdge(n.node1.id,n.node2.id,n.data)}return e};var n=function(e,t){this.id=e,this.data=t||null,this.inEdges=[],this.outEdges=[],this.edges=[]};n.prototype.degree=function(){return this.edges.length},n.prototype.inDegree=function(){return this.inEdges.length},n.prototype.outDegree=function(){return this.outEdges.length};var a=function(e,t,i){this.node1=e,this.node2=t,this.data=i||null};return i.Node=n,i.Edge=a,i.fromMatrix=function(e,t,n){if(t&&t.length&&t[0].length===t.length&&e.length===t.length){for(var a=t.length,o=new i(n),s=0;a>s;s++){var r=o.addNode(e[s].id,e[s]);r.data.value=0,n&&(r.data.outValue=r.data.inValue=0)}for(var s=0;a>s;s++)for(var l=0;a>l;l++){var h=t[s][l];n&&(o.nodes[s].data.outValue+=h,o.nodes[l].data.inValue+=h),o.nodes[s].data.value+=h,o.nodes[l].data.value+=h}for(var s=0;a>s;s++)for(var l=s;a>l;l++){var h=t[s][l];if(0!==h){var d=o.nodes[s],p=o.nodes[l],m=o.addEdge(d,p,{});if(m.data.weight=h,s!==l&&n&&t[l][s]){var c=o.addEdge(p,d,{});c.data.weight=t[l][s]}}}return o}},i}),define("echarts/layout/Chord",["require"],function(){var e=function(e){e=e||{},this.sort=e.sort||null,this.sortSub=e.sortSub||null,this.padding=.05,this.startAngle=e.startAngle||0,this.clockWise=null==e.clockWise?!1:e.clockWise,this.center=e.center||[0,0],this.directed=!0};e.prototype.run=function(e){e instanceof Array||(e=[e]);var n=e.length;if(n){for(var a=e[0],o=a.nodes.length,s=[],r=0,l=0;o>l;l++){var h=a.nodes[l],d={size:0,subGroups:[],node:h};s.push(d);for(var p=0,m=0;m<e.length;m++){var c=e[m],u=c.getNodeById(h.id);if(u){d.size+=u.layout.size;for(var V=this.directed?u.outEdges:u.edges,g=0;g<V.length;g++){var U=V[g],y=U.layout.weight;d.subGroups.push({weight:y,edge:U,graph:c}),p+=y}}}r+=d.size;for(var f=d.size/p,g=0;g<d.subGroups.length;g++)d.subGroups[g].weight*=f;"ascending"===this.sortSub?d.subGroups.sort(t):"descending"===this.sort&&(d.subGroups.sort(t),d.subGroups.reverse())}"ascending"===this.sort?s.sort(i):"descending"===this.sort&&(s.sort(i),s.reverse());for(var f=(2*Math.PI-this.padding*o)/r,_=this.startAngle,b=this.clockWise?1:-1,l=0;o>l;l++){var d=s[l];d.node.layout.startAngle=_,d.node.layout.endAngle=_+b*d.size*f,d.node.layout.subGroups=[];for(var g=0;g<d.subGroups.length;g++){var x=d.subGroups[g];x.edge.layout.startAngle=_,_+=b*x.weight*f,x.edge.layout.endAngle=_}_=d.node.layout.endAngle+b*this.padding}}};var t=function(e,t){return e.weight-t.weight},i=function(e,t){return e.size-t.size};return e});
\ No newline at end of file
define("echarts/chart/eventRiver",["require","../component/base","./base","../layout/eventRiver","zrender/shape/Polygon","../component/axis","../component/grid","../component/dataZoom","../config","../util/ecData","../util/date","zrender/tool/util","zrender/tool/color","../chart"],function(e){function t(e,t,a,o,s){n.call(this,e,t,a,o,s),i.call(this);var r=this;r._ondragend=function(){r.isDragend=!0},this.refresh(o)}var n=e("../component/base"),i=e("./base"),a=e("../layout/eventRiver"),o=e("zrender/shape/Polygon");e("../component/axis"),e("../component/grid"),e("../component/dataZoom");var s=e("../config"),r=e("../util/ecData"),l=e("../util/date"),h=e("zrender/tool/util"),m=e("zrender/tool/color");return t.prototype={type:s.CHART_TYPE_EVENTRIVER,_buildShape:function(){var e=this.series;this.selectedMap={},this._dataPreprocessing();for(var t=this.component.legend,n=[],i=0;i<e.length;i++)if(e[i].type===this.type){e[i]=this.reformOption(e[i]),this.legendHoverLink=e[i].legendHoverLink||this.legendHoverLink;var o=e[i].name||"";if(this.selectedMap[o]=t?t.isSelected(o):!0,!this.selectedMap[o])continue;this.buildMark(i),n.push(this.series[i])}a(n,this._intervalX,this.component.grid.getArea()),this._drawEventRiver(),this.addShapeList()},_dataPreprocessing:function(){for(var e,t,n=this.series,i=0,a=n.length;a>i;i++)if(n[i].type===this.type){e=this.component.xAxis.getAxis(n[i].xAxisIndex||0);for(var o=0,s=n[i].eventList.length;s>o;o++){t=n[i].eventList[o].evolution;for(var r=0,h=t.length;h>r;r++)t[r].timeScale=e.getCoord(l.getNewDate(t[r].time)-0),t[r].valueScale=Math.pow(t[r].value,.8)}}this._intervalX=Math.round(this.component.grid.getWidth()/40)},_drawEventRiver:function(){for(var e=this.series,t=0;t<e.length;t++){var n=e[t].name||"";if(e[t].type===this.type&&this.selectedMap[n])for(var i=0;i<e[t].eventList.length;i++)this._drawEventBubble(e[t].eventList[i],t,i)}},_drawEventBubble:function(e,t,n){var i=this.series,a=i[t],s=a.name||"",l=a.eventList[n],h=[l,a],V=this.component.legend,U=V?V.getColor(s):this.zr.getColor(t),d=this.deepMerge(h,"itemStyle.normal")||{},p=this.deepMerge(h,"itemStyle.emphasis")||{},c=this.getItemStyleColor(d.color,t,n,l)||U,u=this.getItemStyleColor(p.color,t,n,l)||("string"==typeof c?m.lift(c,-.2):c),y=this._calculateControlPoints(e),g={zlevel:this._zlevelBase,clickable:this.deepQuery(h,"clickable"),style:{pointList:y,smooth:"spline",brushType:"both",lineJoin:"round",color:c,lineWidth:d.borderWidth,strokeColor:d.borderColor},highlightStyle:{color:u,lineWidth:p.borderWidth,strokeColor:p.borderColor},draggable:"vertical",ondragend:this._ondragend};g=new o(g),this.addLabel(g,a,l,e.name),r.pack(g,i[t],t,i[t].eventList[n],n,i[t].eventList[n].name),this.shapeList.push(g)},_calculateControlPoints:function(e){var t=this._intervalX,n=e.y,i=e.evolution,a=i.length;if(!(1>a)){for(var o=[],s=[],r=0;a>r;r++)o.push(i[r].timeScale),s.push(i[r].valueScale);var l=[];l.push([o[0],n]);var r=0;for(r=0;a-1>r;r++)l.push([(o[r]+o[r+1])/2,s[r]/-2+n]);for(l.push([(o[r]+(o[r]+t))/2,s[r]/-2+n]),l.push([o[r]+t,n]),l.push([(o[r]+(o[r]+t))/2,s[r]/2+n]),r=a-1;r>0;r--)l.push([(o[r]+o[r-1])/2,s[r-1]/2+n]);return l}},ondragend:function(e,t){this.isDragend&&e.target&&(t.dragOut=!0,t.dragIn=!0,t.needRefresh=!1,this.isDragend=!1)},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()}},h.inherits(t,i),h.inherits(t,n),e("../chart").define("eventRiver",t),t}),define("echarts/layout/eventRiver",["require"],function(){function e(e,o,s){function r(e,t){var n=e.importance,i=t.importance;return n>i?-1:i>n?1:0}function l(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,i=e.length;i>n;n++)if(e[n]===t)return n;return-1}for(var h=5,m=o,V=0;V<e.length;V++){for(var U=0;U<e[V].eventList.length;U++){null==e[V].eventList[U].weight&&(e[V].eventList[U].weight=1);for(var d=0,p=0;p<e[V].eventList[U].evolution.length;p++)d+=e[V].eventList[U].evolution[p].valueScale;e[V].eventList[U].importance=d*e[V].eventList[U].weight}e[V].eventList.sort(r)}for(var V=0;V<e.length;V++){null==e[V].weight&&(e[V].weight=1);for(var d=0,U=0;U<e[V].eventList.length;U++)d+=e[V].eventList[U].weight;e[V].importance=d*e[V].weight}e.sort(r);for(var c=Number.MAX_VALUE,u=0,V=0;V<e.length;V++)for(var U=0;U<e[V].eventList.length;U++)for(var p=0;p<e[V].eventList[U].evolution.length;p++){var y=e[V].eventList[U].evolution[p].timeScale;c=Math.min(c,y),u=Math.max(u,y)}for(var g=n(Math.floor(c),Math.ceil(u)),b=0,V=0;V<e.length;V++)for(var U=0;U<e[V].eventList.length;U++){var f=e[V].eventList[U];f.time=[],f.value=[];for(var p=0;p<e[V].eventList[U].evolution.length;p++)f.time.push(e[V].eventList[U].evolution[p].timeScale),f.value.push(e[V].eventList[U].evolution[p].valueScale);var k=l(f.value,Math.max.apply(Math,f.value)),_=i(g,f.time[k],f.time[k+1]),p=0;for(f.y=_+f.value[k]/2+h,p=0;p<f.time.length-1;p++){var x=i(g,f.time[p],f.time[p+1]);f.y-f.value[p]/2-h<x&&(f.y=x+f.value[p]/2+h)}var x=i(g,f.time[p],f.time[p]+m);for(f.y-f.value[p]/2-h<x&&(f.y=x+f.value[p]/2+h),e[V].y=f.y,b=Math.max(b,f.y+f.value[k]/2),p=0;p<f.time.length-1;p++)a(g,f.time[p],f.time[p+1],f.y+f.value[p]/2);a(g,f.time[p],f.time[p]+m,f.y+f.value[p]/2)}t(e,s,b,h)}function t(e,t,n,i){for(var a=t.y,o=(t.height-i)/n,s=0;s<e.length;s++){e[s].y=e[s].y*o+a;for(var r=e[s].eventList,l=0;l<r.length;l++){r[l].y=r[l].y*o+a;for(var h=r[l].evolution,m=0;m<h.length;m++)h[m].valueScale*=1*o}}}function n(e,t){var i={left:e,right:t,leftChild:null,rightChild:null,maxValue:0};if(t>e+1){var a=Math.round((e+t)/2);i.leftChild=n(e,a),i.rightChild=n(a,t)}return i}function i(e,t,n){if(1>n-t)return 0;var a=Math.round((e.left+e.right)/2),o=0;if(t==e.left&&n==e.right)o=e.maxValue;else if(a>=n&&null!=e.leftChild)o=i(e.leftChild,t,n);else if(t>=a&&null!=e.rightChild)o=i(e.rightChild,t,n);else{var s=0,r=0;null!=e.leftChild&&(s=i(e.leftChild,t,a)),null!=e.rightChild&&(r=i(e.rightChild,a,n)),o=s>r?s:r}return o}function a(e,t,n,i){if(null!=e){var o=Math.round((e.left+e.right)/2);e.maxValue=e.maxValue>i?e.maxValue:i,(Math.floor(10*t)!=Math.floor(10*e.left)||Math.floor(10*n)!=Math.floor(10*e.right))&&(o>=n?a(e.leftChild,t,n,i):t>=o?a(e.rightChild,t,n,i):(a(e.leftChild,t,o,i),a(e.rightChild,o,n,i)))}}return e});
\ No newline at end of file
此差异已折叠。
define("echarts/chart/funnel",["require","../component/base","./base","zrender/shape/Text","zrender/shape/Line","zrender/shape/Polygon","../config","../util/ecData","../util/number","zrender/tool/util","zrender/tool/color","zrender/tool/area","../chart"],function(e){function t(e,t,a,o,s){n.call(this,e,t,a,o,s),i.call(this),this.refresh(o)}var n=e("../component/base"),i=e("./base"),a=e("zrender/shape/Text"),o=e("zrender/shape/Line"),s=e("zrender/shape/Polygon"),r=e("../config"),l=e("../util/ecData"),h=e("../util/number"),m=e("zrender/tool/util"),V=e("zrender/tool/color"),U=e("zrender/tool/area");return t.prototype={type:r.CHART_TYPE_FUNNEL,_buildShape:function(){var e=this.series,t=this.component.legend;this._paramsMap={},this._selected={},this.selectedMap={};for(var n,i=0,a=e.length;a>i;i++)if(e[i].type===r.CHART_TYPE_FUNNEL){if(e[i]=this.reformOption(e[i]),this.legendHoverLink=e[i].legendHoverLink||this.legendHoverLink,n=e[i].name||"",this.selectedMap[n]=t?t.isSelected(n):!0,!this.selectedMap[n])continue;this._buildSingleFunnel(i),this.buildMark(i)}this.addShapeList()},_buildSingleFunnel:function(e){var t=this.component.legend,n=this.series[e],i=this._mapData(e),a=this._getLocation(e);this._paramsMap[e]={location:a,data:i};for(var o,s=0,r=[],l=0,m=i.length;m>l;l++)o=i[l].name,this.selectedMap[o]=t?t.isSelected(o):!0,this.selectedMap[o]&&!isNaN(i[l].value)&&(r.push(i[l]),s++);if(0!==s){for(var V,U,d,p,c=this._buildFunnelCase(e),u=n.funnelAlign,y=n.gap,g=s>1?(a.height-(s-1)*y)/s:a.height,b=a.y,f="descending"===n.sort?this._getItemWidth(e,r[0].value):h.parsePercent(n.minSize,a.width),k="descending"===n.sort?1:0,_=a.centerX,x=[],l=0,m=r.length;m>l;l++)if(o=r[l].name,this.selectedMap[o]&&!isNaN(r[l].value)){switch(V=m-2>=l?this._getItemWidth(e,r[l+k].value):"descending"===n.sort?h.parsePercent(n.minSize,a.width):h.parsePercent(n.maxSize,a.width),u){case"left":U=a.x;break;case"right":U=a.x+a.width-f;break;default:U=_-f/2}d=this._buildItem(e,r[l]._index,t?t.getColor(o):this.zr.getColor(r[l]._index),U,b,f,V,g,u),b+=g+y,p=d.style.pointList,x.unshift([p[0][0]-10,p[0][1]]),x.push([p[1][0]+10,p[1][1]]),0===l&&(0===f?(p=x.pop(),"center"==u&&(x[0][0]+=10),"right"==u&&(x[0][0]=p[0]),x[0][1]-="center"==u?10:15,1==m&&(p=d.style.pointList)):(x[x.length-1][1]-=5,x[0][1]-=5)),f=V}c&&(x.unshift([p[3][0]-10,p[3][1]]),x.push([p[2][0]+10,p[2][1]]),0===f?(p=x.pop(),"center"==u&&(x[0][0]+=10),"right"==u&&(x[0][0]=p[0]),x[0][1]+="center"==u?10:15):(x[x.length-1][1]+=5,x[0][1]+=5),c.style.pointList=x)}},_buildFunnelCase:function(e){var t=this.series[e];if(this.deepQuery([t,this.option],"calculable")){var n=this._paramsMap[e].location,i=10,a={hoverable:!1,style:{pointListd:[[n.x-i,n.y-i],[n.x+n.width+i,n.y-i],[n.x+n.width+i,n.y+n.height+i],[n.x-i,n.y+n.height+i]],brushType:"stroke",lineWidth:1,strokeColor:t.calculableHolderColor||this.ecTheme.calculableHolderColor}};return l.pack(a,t,e,void 0,-1),this.setCalculable(a),a=new s(a),this.shapeList.push(a),a}},_getLocation:function(e){var t,n=this.series[e],i=this.zr.getWidth(),a=this.zr.getHeight(),o=this.parsePercent(n.x,i),s=this.parsePercent(n.y,a);t=null==n.width?i-o-this.parsePercent(n.x2,i):this.parsePercent(n.width,i);var r;return r=null==n.height?a-s-this.parsePercent(n.y2,a):this.parsePercent(n.height,a),{x:o,y:s,width:t,height:r,centerX:o+t/2}},_mapData:function(e){function t(e,t){return"-"===e.value?1:"-"===t.value?-1:t.value-e.value}function n(e,n){return-t(e,n)}for(var i=this.series[e],a=m.clone(i.data),o=0,s=a.length;s>o;o++)a[o]._index=o;return"none"!=i.sort&&a.sort("descending"===i.sort?t:n),a},_buildItem:function(e,t,n,i,a,o,s,r,h){var m=this.series,V=m[e],U=V.data[t],d=this.getPolygon(e,t,n,i,a,o,s,r,h);l.pack(d,m[e],e,m[e].data[t],t,m[e].data[t].name),this.shapeList.push(d);var p=this.getLabel(e,t,n,i,a,o,s,r,h);l.pack(p,m[e],e,m[e].data[t],t,m[e].data[t].name),this.shapeList.push(p),this._needLabel(V,U,!1)||(p.invisible=!0);var c=this.getLabelLine(e,t,n,i,a,o,s,r,h);this.shapeList.push(c),this._needLabelLine(V,U,!1)||(c.invisible=!0);var u=[],y=[];return this._needLabelLine(V,U,!0)&&(u.push(c.id),y.push(c.id)),this._needLabel(V,U,!0)&&(u.push(p.id),y.push(d.id)),d.hoverConnect=u,p.hoverConnect=y,d},_getItemWidth:function(e,t){var n=this.series[e],i=this._paramsMap[e].location,a=n.min,o=n.max,s=h.parsePercent(n.minSize,i.width),r=h.parsePercent(n.maxSize,i.width);return t*(r-s)/(o-a)},getPolygon:function(e,t,n,i,a,o,r,l,h){var m,U=this.series[e],d=U.data[t],p=[d,U],c=this.deepMerge(p,"itemStyle.normal")||{},u=this.deepMerge(p,"itemStyle.emphasis")||{},y=this.getItemStyleColor(c.color,e,t,d)||n,g=this.getItemStyleColor(u.color,e,t,d)||("string"==typeof y?V.lift(y,-.2):y);switch(h){case"left":m=i;break;case"right":m=i+(o-r);break;default:m=i+(o-r)/2}var b={zlevel:this._zlevelBase,clickable:this.deepQuery(p,"clickable"),style:{pointList:[[i,a],[i+o,a],[m+r,a+l],[m,a+l]],brushType:"both",color:y,lineWidth:c.borderWidth,strokeColor:c.borderColor},highlightStyle:{color:g,lineWidth:u.borderWidth,strokeColor:u.borderColor}};return this.deepQuery([d,U,this.option],"calculable")&&(this.setCalculable(b),b.draggable=!0),new s(b)},getLabel:function(e,t,n,i,o,s,r,l,h){var d,p=this.series[e],c=p.data[t],u=this._paramsMap[e].location,y=m.merge(m.clone(c.itemStyle)||{},p.itemStyle),g="normal",b=y[g].label,f=b.textStyle||{},k=y[g].labelLine.length,_=this.getLabelText(e,t,g),x=this.getFont(f),L=n;b.position=b.position||y.normal.label.position,"inner"===b.position||"inside"===b.position||"center"===b.position?(d=h,L=Math.max(s,r)/2>U.getTextWidth(_,x)?"#fff":V.reverse(n)):d="left"===b.position?"right":"left";var W={zlevel:this._zlevelBase+1,style:{x:this._getLabelPoint(b.position,i,u,s,r,k,h),y:o+l/2,color:f.color||L,text:_,textAlign:f.align||d,textBaseline:f.baseline||"middle",textFont:x}};return g="emphasis",b=y[g].label||b,f=b.textStyle||f,k=y[g].labelLine.length||k,b.position=b.position||y.normal.label.position,_=this.getLabelText(e,t,g),x=this.getFont(f),L=n,"inner"===b.position||"inside"===b.position||"center"===b.position?(d=h,L=Math.max(s,r)/2>U.getTextWidth(_,x)?"#fff":V.reverse(n)):d="left"===b.position?"right":"left",W.highlightStyle={x:this._getLabelPoint(b.position,i,u,s,r,k,h),color:f.color||L,text:_,textAlign:f.align||d,textFont:x,brushType:"fill"},new a(W)},getLabelText:function(e,t,n){var i=this.series,a=i[e],o=a.data[t],s=this.deepQuery([o,a],"itemStyle."+n+".label.formatter");return s?"function"==typeof s?s.call(this.myChart,a.name,o.name,o.value):"string"==typeof s?(s=s.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}"),s=s.replace("{a0}",a.name).replace("{b0}",o.name).replace("{c0}",o.value)):void 0:o.name},getLabelLine:function(e,t,n,i,a,s,r,l,h){var V=this.series[e],U=V.data[t],d=this._paramsMap[e].location,p=m.merge(m.clone(U.itemStyle)||{},V.itemStyle),c="normal",u=p[c].labelLine,y=p[c].labelLine.length,g=u.lineStyle||{},b=p[c].label;b.position=b.position||p.normal.label.position;var f={zlevel:this._zlevelBase+1,hoverable:!1,style:{xStart:this._getLabelLineStartPoint(i,d,s,r,h),yStart:a+l/2,xEnd:this._getLabelPoint(b.position,i,d,s,r,y,h),yEnd:a+l/2,strokeColor:g.color||n,lineType:g.type,lineWidth:g.width}};return c="emphasis",u=p[c].labelLine||u,y=p[c].labelLine.length||y,g=u.lineStyle||g,b=p[c].label||b,b.position=b.position,f.highlightStyle={xEnd:this._getLabelPoint(b.position,i,d,s,r,y,h),strokeColor:g.color||n,lineType:g.type,lineWidth:g.width},new o(f)},_getLabelPoint:function(e,t,n,i,a,o,s){switch(e="inner"===e||"inside"===e?"center":e){case"center":return"center"==s?t+i/2:"left"==s?t+10:t+i-10;case"left":return"auto"===o?n.x-10:"center"==s?n.centerX-Math.max(i,a)/2-o:"right"==s?t-(a>i?a-i:0)-o:n.x-o;default:return"auto"===o?n.x+n.width+10:"center"==s?n.centerX+Math.max(i,a)/2+o:"right"==s?n.x+n.width+o:t+Math.max(i,a)+o}},_getLabelLineStartPoint:function(e,t,n,i,a){return"center"==a?t.centerX:i>n?e+Math.min(n,i)/2:e+Math.max(n,i)/2},_needLabel:function(e,t,n){return this.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".label.show")},_needLabelLine:function(e,t,n){return this.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".labelLine.show")},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()}},m.inherits(t,i),m.inherits(t,n),e("../chart").define("funnel",t),t});
\ No newline at end of file
define("echarts/chart/gauge",["require","../component/base","./base","../util/shape/GaugePointer","zrender/shape/Text","zrender/shape/Line","zrender/shape/Rectangle","zrender/shape/Circle","zrender/shape/Sector","../config","../util/ecData","../util/accMath","zrender/tool/util","../chart"],function(e){function t(e,t,a,o,s){n.call(this,e,t,a,o,s),i.call(this),this.refresh(o)}var n=e("../component/base"),i=e("./base"),a=e("../util/shape/GaugePointer"),o=e("zrender/shape/Text"),s=e("zrender/shape/Line"),r=e("zrender/shape/Rectangle"),l=e("zrender/shape/Circle"),h=e("zrender/shape/Sector"),m=e("../config"),V=e("../util/ecData"),U=e("../util/accMath"),d=e("zrender/tool/util");return t.prototype={type:m.CHART_TYPE_GAUGE,_buildShape:function(){var e=this.series;this._paramsMap={};for(var t=0,n=e.length;n>t;t++)e[t].type===m.CHART_TYPE_GAUGE&&(e[t]=this.reformOption(e[t]),this.legendHoverLink=e[t].legendHoverLink||this.legendHoverLink,this._buildSingleGauge(t),this.buildMark(t));this.addShapeList()},_buildSingleGauge:function(e){var t=this.series[e];this._paramsMap[e]={center:this.parseCenter(this.zr,t.center),radius:this.parseRadius(this.zr,t.radius),startAngle:t.startAngle.toFixed(2)-0,endAngle:t.endAngle.toFixed(2)-0},this._paramsMap[e].totalAngle=this._paramsMap[e].startAngle-this._paramsMap[e].endAngle,this._colorMap(e),this._buildAxisLine(e),this._buildSplitLine(e),this._buildAxisTick(e),this._buildAxisLabel(e),this._buildPointer(e),this._buildTitle(e),this._buildDetail(e)},_buildAxisLine:function(e){var t=this.series[e];if(t.axisLine.show)for(var n,i,a=t.min,o=t.max-a,s=this._paramsMap[e],r=s.center,l=s.startAngle,h=s.totalAngle,m=s.colorArray,U=t.axisLine.lineStyle,d=this.parsePercent(U.width,s.radius[1]),p=s.radius[1],c=p-d,u=l,y=0,g=m.length;g>y;y++)i=l-h*(m[y][0]-a)/o,n=this._getSector(r,c,p,i,u,m[y][1],U),u=i,n._animationAdd="r",V.set(n,"seriesIndex",e),V.set(n,"dataIndex",y),this.shapeList.push(n)},_buildSplitLine:function(e){var t=this.series[e];if(t.splitLine.show)for(var n,i,a,o=this._paramsMap[e],r=t.splitNumber,l=t.min,h=t.max-l,m=t.splitLine,V=this.parsePercent(m.length,o.radius[1]),U=m.lineStyle,d=U.color,p=o.center,c=o.startAngle*Math.PI/180,u=o.totalAngle*Math.PI/180,y=o.radius[1],g=y-V,b=0;r>=b;b++)n=c-u/r*b,i=Math.sin(n),a=Math.cos(n),this.shapeList.push(new s({zlevel:this._zlevelBase+1,hoverable:!1,style:{xStart:p[0]+a*y,yStart:p[1]-i*y,xEnd:p[0]+a*g,yEnd:p[1]-i*g,strokeColor:"auto"===d?this._getColor(e,l+h/r*b):d,lineType:U.type,lineWidth:U.width,shadowColor:U.shadowColor,shadowBlur:U.shadowBlur,shadowOffsetX:U.shadowOffsetX,shadowOffsetY:U.shadowOffsetY}}))},_buildAxisTick:function(e){var t=this.series[e];if(t.axisTick.show)for(var n,i,a,o=this._paramsMap[e],r=t.splitNumber,l=t.min,h=t.max-l,m=t.axisTick,V=m.splitNumber,U=this.parsePercent(m.length,o.radius[1]),d=m.lineStyle,p=d.color,c=o.center,u=o.startAngle*Math.PI/180,y=o.totalAngle*Math.PI/180,g=o.radius[1],b=g-U,f=0,k=r*V;k>=f;f++)f%V!==0&&(n=u-y/k*f,i=Math.sin(n),a=Math.cos(n),this.shapeList.push(new s({zlevel:this._zlevelBase+1,hoverable:!1,style:{xStart:c[0]+a*g,yStart:c[1]-i*g,xEnd:c[0]+a*b,yEnd:c[1]-i*b,strokeColor:"auto"===p?this._getColor(e,l+h/k*f):p,lineType:d.type,lineWidth:d.width,shadowColor:d.shadowColor,shadowBlur:d.shadowBlur,shadowOffsetX:d.shadowOffsetX,shadowOffsetY:d.shadowOffsetY}})))},_buildAxisLabel:function(e){var t=this.series[e];if(t.axisLabel.show)for(var n,i,a,s,r=t.splitNumber,l=t.min,h=t.max-l,m=t.axisLabel.textStyle,V=this.getFont(m),d=m.color,p=this._paramsMap[e],c=p.center,u=p.startAngle,y=p.totalAngle,g=p.radius[1]-this.parsePercent(t.splitLine.length,p.radius[1])-10,b=0;r>=b;b++)s=U.accAdd(l,U.accMul(U.accDiv(h,r),b)),n=u-y/r*b,i=Math.sin(n*Math.PI/180),a=Math.cos(n*Math.PI/180),n=(n+360)%360,this.shapeList.push(new o({zlevel:this._zlevelBase+1,hoverable:!1,style:{x:c[0]+a*g,y:c[1]-i*g,color:"auto"===d?this._getColor(e,s):d,text:this._getLabelText(t.axisLabel.formatter,s),textAlign:n>=110&&250>=n?"left":70>=n||n>=290?"right":"center",textBaseline:n>=10&&170>=n?"top":n>=190&&350>=n?"bottom":"middle",textFont:V,shadowColor:m.shadowColor,shadowBlur:m.shadowBlur,shadowOffsetX:m.shadowOffsetX,shadowOffsetY:m.shadowOffsetY}}))},_buildPointer:function(e){var t=this.series[e];if(t.pointer.show){var n=t.max-t.min,i=t.pointer,o=this._paramsMap[e],s=this.parsePercent(i.length,o.radius[1]),r=this.parsePercent(i.width,o.radius[1]),h=o.center,m=this._getValue(e);m=m<t.max?m:t.max;var U=(o.startAngle-o.totalAngle/n*(m-t.min))*Math.PI/180,d="auto"===i.color?this._getColor(e,m):i.color,p=new a({zlevel:this._zlevelBase+1,style:{x:h[0],y:h[1],r:s,startAngle:o.startAngle*Math.PI/180,angle:U,color:d,width:r,shadowColor:i.shadowColor,shadowBlur:i.shadowBlur,shadowOffsetX:i.shadowOffsetX,shadowOffsetY:i.shadowOffsetY},highlightStyle:{brushType:"fill",width:r>2?2:r/2,color:"#fff"}});V.pack(p,this.series[e],e,this.series[e].data[0],0,this.series[e].data[0].name,m),this.shapeList.push(p),this.shapeList.push(new l({zlevel:this._zlevelBase+2,hoverable:!1,style:{x:h[0],y:h[1],r:i.width/2.5,color:"#fff"}}))}},_buildTitle:function(e){var t=this.series[e];if(t.title.show){var n=t.data[0],i=null!=n.name?n.name:"";if(""!==i){var a=t.title,s=a.offsetCenter,r=a.textStyle,l=r.color,h=this._paramsMap[e],m=h.center[0]+this.parsePercent(s[0],h.radius[1]),V=h.center[1]+this.parsePercent(s[1],h.radius[1]);this.shapeList.push(new o({zlevel:this._zlevelBase+(Math.abs(m-h.center[0])+Math.abs(V-h.center[1]))<2*r.fontSize?2:1,hoverable:!1,style:{x:m,y:V,color:"auto"===l?this._getColor(e):l,text:i,textAlign:"center",textFont:this.getFont(r),shadowColor:r.shadowColor,shadowBlur:r.shadowBlur,shadowOffsetX:r.shadowOffsetX,shadowOffsetY:r.shadowOffsetY}}))}}},_buildDetail:function(e){var t=this.series[e];if(t.detail.show){var n=t.detail,i=n.offsetCenter,a=n.backgroundColor,o=n.textStyle,s=o.color,l=this._paramsMap[e],h=this._getValue(e),m=l.center[0]-n.width/2+this.parsePercent(i[0],l.radius[1]),V=l.center[1]+this.parsePercent(i[1],l.radius[1]);this.shapeList.push(new r({zlevel:this._zlevelBase+(Math.abs(m+n.width/2-l.center[0])+Math.abs(V+n.height/2-l.center[1]))<o.fontSize?2:1,hoverable:!1,style:{x:m,y:V,width:n.width,height:n.height,brushType:"both",color:"auto"===a?this._getColor(e,h):a,lineWidth:n.borderWidth,strokeColor:n.borderColor,shadowColor:n.shadowColor,shadowBlur:n.shadowBlur,shadowOffsetX:n.shadowOffsetX,shadowOffsetY:n.shadowOffsetY,text:this._getLabelText(n.formatter,h),textFont:this.getFont(o),textPosition:"inside",textColor:"auto"===s?this._getColor(e,h):s}}))}},_getValue:function(e){var t=this.series[e].data[0];return null!=t.value?t.value:t},_colorMap:function(e){var t=this.series[e],n=t.min,i=t.max-n,a=t.axisLine.lineStyle.color;a instanceof Array||(a=[[1,a]]);for(var o=[],s=0,r=a.length;r>s;s++)o.push([a[s][0]*i+n,a[s][1]]);this._paramsMap[e].colorArray=o},_getColor:function(e,t){null==t&&(t=this._getValue(e));for(var n=this._paramsMap[e].colorArray,i=0,a=n.length;a>i;i++)if(n[i][0]>=t)return n[i][1];return n[n.length-1][1]},_getSector:function(e,t,n,i,a,o,s){return new h({zlevel:this._zlevelBase,hoverable:!1,style:{x:e[0],y:e[1],r0:t,r:n,startAngle:i,endAngle:a,brushType:"fill",color:o,shadowColor:s.shadowColor,shadowBlur:s.shadowBlur,shadowOffsetX:s.shadowOffsetX,shadowOffsetY:s.shadowOffsetY}})},_getLabelText:function(e,t){if(e){if("function"==typeof e)return e.call(this.myChart,t);if("string"==typeof e)return e.replace("{value}",t)}return t},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()}},d.inherits(t,i),d.inherits(t,n),e("../chart").define("gauge",t),t}),define("echarts/util/shape/GaugePointer",["require","zrender/shape/Base","zrender/tool/util","./normalIsCover"],function(e){function t(e){n.call(this,e)}var n=e("zrender/shape/Base"),i=e("zrender/tool/util");return t.prototype={type:"gauge-pointer",buildPath:function(e,t){var n=t.r,i=t.width,a=t.angle,o=t.x-Math.cos(a)*i*(i>=n/3?1:2),s=t.y+Math.sin(a)*i*(i>=n/3?1:2);a=t.angle-Math.PI/2,e.moveTo(o,s),e.lineTo(t.x+Math.cos(a)*i,t.y-Math.sin(a)*i),e.lineTo(t.x+Math.cos(t.angle)*n,t.y-Math.sin(t.angle)*n),e.lineTo(t.x-Math.cos(a)*i,t.y+Math.sin(a)*i),e.lineTo(o,s)},getRect:function(e){if(e.__rect)return e.__rect;var t=2*e.width,n=e.x,i=e.y,a=n+Math.cos(e.angle)*e.r,o=i-Math.sin(e.angle)*e.r;return e.__rect={x:Math.min(n,a)-t,y:Math.min(i,o)-t,width:Math.abs(n-a)+t,height:Math.abs(i-o)+t},e.__rect},isCover:e("./normalIsCover")},i.inherits(t,n),t});
\ No newline at end of file
define("echarts/chart/k",["require","../component/base","./base","../util/shape/Candle","../component/axis","../component/grid","../component/dataZoom","../config","../util/ecData","zrender/tool/util","../chart"],function(e){function t(e,t,a,o,s){i.call(this,e,t,a,o,s),n.call(this),this.refresh(o)}var i=e("../component/base"),n=e("./base"),a=e("../util/shape/Candle");e("../component/axis"),e("../component/grid"),e("../component/dataZoom");var o=e("../config"),s=e("../util/ecData"),r=e("zrender/tool/util");return t.prototype={type:o.CHART_TYPE_K,_buildShape:function(){var e=this.series;this.selectedMap={};for(var t,i={top:[],bottom:[]},n=0,a=e.length;a>n;n++)e[n].type===o.CHART_TYPE_K&&(e[n]=this.reformOption(e[n]),this.legendHoverLink=e[n].legendHoverLink||this.legendHoverLink,t=this.component.xAxis.getAxis(e[n].xAxisIndex),t.type===o.COMPONENT_TYPE_AXIS_CATEGORY&&i[t.getPosition()].push(n));for(var s in i)i[s].length>0&&this._buildSinglePosition(s,i[s]);this.addShapeList()},_buildSinglePosition:function(e,t){var i=this._mapData(t),n=i.locationMap,a=i.maxDataLength;if(0!==a&&0!==n.length){this._buildHorizontal(t,a,n);for(var o=0,s=t.length;s>o;o++)this.buildMark(t[o])}},_mapData:function(e){for(var t,i,n=this.series,a=this.component.legend,o=[],s=0,r=0,l=e.length;l>r;r++)t=n[e[r]],i=t.name,this.selectedMap[i]=a?a.isSelected(i):!0,this.selectedMap[i]&&o.push(e[r]),s=Math.max(s,t.data.length);return{locationMap:o,maxDataLength:s}},_buildHorizontal:function(e,t,i){for(var n,a,o,s,r,l,h,d,m,p,c=this.series,u={},V=0,U=i.length;U>V;V++){n=i[V],a=c[n],o=a.xAxisIndex||0,s=this.component.xAxis.getAxis(o),h=a.barWidth||Math.floor(s.getGap()/2),p=a.barMaxWidth,p&&h>p&&(h=p),r=a.yAxisIndex||0,l=this.component.yAxis.getAxis(r),u[n]=[];for(var g=0,y=t;y>g&&null!=s.getNameByIndex(g);g++)d=a.data[g],m=null!=d?null!=d.value?d.value:d:"-","-"!==m&&4==m.length&&u[n].push([s.getCoordByIndex(g),h,l.getCoord(m[0]),l.getCoord(m[1]),l.getCoord(m[2]),l.getCoord(m[3]),g,s.getNameByIndex(g)])}this._buildKLine(e,u)},_buildKLine:function(e,t){for(var i,n,a,s,r,l,h,d,m,p,c,u,V,U,g,y,f,_=this.series,b=0,x=e.length;x>b;b++)if(f=e[b],c=_[f],U=t[f],this._isLarge(U)&&(U=this._getLargePointList(U)),c.type===o.CHART_TYPE_K&&null!=U){u=c,i=this.query(u,"itemStyle.normal.lineStyle.width"),n=this.query(u,"itemStyle.normal.lineStyle.color"),a=this.query(u,"itemStyle.normal.lineStyle.color0"),s=this.query(u,"itemStyle.normal.color"),r=this.query(u,"itemStyle.normal.color0"),l=this.query(u,"itemStyle.emphasis.lineStyle.width"),h=this.query(u,"itemStyle.emphasis.lineStyle.color"),d=this.query(u,"itemStyle.emphasis.lineStyle.color0"),m=this.query(u,"itemStyle.emphasis.color"),p=this.query(u,"itemStyle.emphasis.color0");for(var k=0,L=U.length;L>k;k++)g=U[k],V=c.data[g[6]],u=V,y=g[3]<g[2],this.shapeList.push(this._getCandle(f,g[6],g[7],g[0],g[1],g[2],g[3],g[4],g[5],y?this.query(u,"itemStyle.normal.color")||s:this.query(u,"itemStyle.normal.color0")||r,this.query(u,"itemStyle.normal.lineStyle.width")||i,y?this.query(u,"itemStyle.normal.lineStyle.color")||n:this.query(u,"itemStyle.normal.lineStyle.color0")||a,y?this.query(u,"itemStyle.emphasis.color")||m||s:this.query(u,"itemStyle.emphasis.color0")||p||r,this.query(u,"itemStyle.emphasis.lineStyle.width")||l||i,y?this.query(u,"itemStyle.emphasis.lineStyle.color")||h||n:this.query(u,"itemStyle.emphasis.lineStyle.color0")||d||a))}},_isLarge:function(e){return e[0][1]<.5},_getLargePointList:function(e){for(var t=this.component.grid.getWidth(),i=e.length,n=[],a=0;t>a;a++)n[a]=e[Math.floor(i/t*a)];return n},_getCandle:function(e,t,i,n,o,r,l,h,d,m,p,c,u,V,U){var g=this.series,y={zlevel:this._zlevelBase,clickable:this.deepQuery([g[e].data[t],g[e]],"clickable"),style:{x:n,y:[r,l,h,d],width:o,color:m,strokeColor:c,lineWidth:p,brushType:"both"},highlightStyle:{color:u,strokeColor:U,lineWidth:V},_seriesIndex:e};return s.pack(y,g[e],e,g[e].data[t],t,i),y=new a(y)},getMarkCoord:function(e,t){var i=this.series[e],n=this.component.xAxis.getAxis(i.xAxisIndex),a=this.component.yAxis.getAxis(i.yAxisIndex);return["string"!=typeof t.xAxis&&n.getCoordByIndex?n.getCoordByIndex(t.xAxis||0):n.getCoord(t.xAxis||0),"string"!=typeof t.yAxis&&a.getCoordByIndex?a.getCoordByIndex(t.yAxis||0):a.getCoord(t.yAxis||0)]},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()},addDataAnimation:function(e){for(var t=this.series,i={},n=0,a=e.length;a>n;n++)i[e[n][0]]=e[n];for(var o,r,l,h,d,m,n=0,a=this.shapeList.length;a>n;n++)if(d=this.shapeList[n]._seriesIndex,i[d]&&!i[d][3]&&"candle"===this.shapeList[n].type){if(m=s.get(this.shapeList[n],"dataIndex"),h=t[d],i[d][2]&&m===h.data.length-1){this.zr.delShape(this.shapeList[n].id);continue}if(!i[d][2]&&0===m){this.zr.delShape(this.shapeList[n].id);continue}r=this.component.xAxis.getAxis(h.xAxisIndex||0).getGap(),o=i[d][2]?r:-r,l=0,this.zr.animate(this.shapeList[n].id,"").when(500,{position:[o,l]}).start()}}},r.inherits(t,n),r.inherits(t,i),e("../chart").define("k",t),t});
\ No newline at end of file
define("echarts/chart/line",["require","../component/base","./base","zrender/shape/BrokenLine","../util/shape/Icon","../util/shape/HalfSmoothPolygon","../component/axis","../component/grid","../component/dataZoom","../config","../util/ecData","zrender/tool/util","zrender/tool/color","../chart"],function(e){function t(e,t,i,o,r){n.call(this,e,t,i,o,r),a.call(this),this.refresh(o)}function i(e,t){var i=t.x,n=t.y,a=t.width,o=t.height,s=o/2;t.symbol.match("empty")&&(e.fillStyle="#fff"),t.brushType="both";var l=t.symbol.replace("empty","").toLowerCase();l.match("star")?(s=l.replace("star","")-0||5,n-=1,l="star"):("rectangle"===l||"arrow"===l)&&(i+=(a-o)/2,a=o);var h="";if(l.match("image")&&(h=l.replace(new RegExp("^image:\\/\\/"),""),l="image",i+=Math.round((a-o)/2)-1,a=o+=2),l=r.prototype.iconLibrary[l]){var d=t.x,m=t.y;e.moveTo(d,m+s),e.lineTo(d+5,m+s),e.moveTo(d+t.width-5,m+s),e.lineTo(d+t.width,m+s),l(e,{x:i+4,y:n+4,width:a-8,height:o-8,n:s,image:h})}else e.moveTo(i,n+s),e.lineTo(i+a,n+s)}var n=e("../component/base"),a=e("./base"),o=e("zrender/shape/BrokenLine"),r=e("../util/shape/Icon"),s=e("../util/shape/HalfSmoothPolygon");e("../component/axis"),e("../component/grid"),e("../component/dataZoom");var l=e("../config"),h=e("../util/ecData"),d=e("zrender/tool/util"),m=e("zrender/tool/color");return t.prototype={type:l.CHART_TYPE_LINE,_buildShape:function(){this.finalPLMap={},this._bulidPosition()},_buildHorizontal:function(e,t,i,n){for(var a,o,r,s,l,h,d,m,c,p,u=this.series,V=i[0][0],U=u[V],g=U.xAxisIndex,y=this.component.xAxis.getAxis(g),f={},b=0,_=t;_>b&&null!=y.getNameByIndex(b);b++){r=y.getCoordByIndex(b);for(var x=0,k=i.length;k>x;x++){a=u[i[x][0]].yAxisIndex||0,o=this.component.yAxis.getAxis(a),h=l=m=d=o.getCoord(0);for(var L=0,v=i[x].length;v>L;L++)V=i[x][L],U=u[V],c=U.data[b],p=null!=c?null!=c.value?c.value:c:"-",f[V]=f[V]||[],n[V]=n[V]||{min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY,sum:0,counter:0,average:0},"-"!==p?(p>=0?(l-=L>0?o.getCoordSize(p):h-o.getCoord(p),s=l):0>p&&(d+=L>0?o.getCoordSize(p):o.getCoord(p)-m,s=d),f[V].push([r,s,b,y.getNameByIndex(b),r,h]),n[V].min>p&&(n[V].min=p,n[V].minY=s,n[V].minX=r),n[V].max<p&&(n[V].max=p,n[V].maxY=s,n[V].maxX=r),n[V].sum+=p,n[V].counter++):f[V].length>0&&(this.finalPLMap[V]=this.finalPLMap[V]||[],this.finalPLMap[V].push(f[V]),f[V]=[])}l=this.component.grid.getY();for(var W,x=0,k=i.length;k>x;x++)for(var L=0,v=i[x].length;v>L;L++)V=i[x][L],U=u[V],c=U.data[b],p=null!=c?null!=c.value?c.value:c:"-","-"==p&&this.deepQuery([c,U,this.option],"calculable")&&(W=this.deepQuery([c,U],"symbolSize"),l+=2*W+5,s=l,this.shapeList.push(this._getCalculableItem(V,b,y.getNameByIndex(b),r,s,"horizontal")))}for(var w in f)f[w].length>0&&(this.finalPLMap[w]=this.finalPLMap[w]||[],this.finalPLMap[w].push(f[w]),f[w]=[]);this._calculMarkMapXY(n,i,"y"),this._buildBorkenLine(e,this.finalPLMap,y,"horizontal")},_buildVertical:function(e,t,i,n){for(var a,o,r,s,l,h,d,m,c,p,u=this.series,V=i[0][0],U=u[V],g=U.yAxisIndex,y=this.component.yAxis.getAxis(g),f={},b=0,_=t;_>b&&null!=y.getNameByIndex(b);b++){s=y.getCoordByIndex(b);for(var x=0,k=i.length;k>x;x++){a=u[i[x][0]].xAxisIndex||0,o=this.component.xAxis.getAxis(a),h=l=m=d=o.getCoord(0);for(var L=0,v=i[x].length;v>L;L++)V=i[x][L],U=u[V],c=U.data[b],p=null!=c?null!=c.value?c.value:c:"-",f[V]=f[V]||[],n[V]=n[V]||{min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY,sum:0,counter:0,average:0},"-"!==p?(p>=0?(l+=L>0?o.getCoordSize(p):o.getCoord(p)-h,r=l):0>p&&(d-=L>0?o.getCoordSize(p):m-o.getCoord(p),r=d),f[V].push([r,s,b,y.getNameByIndex(b),h,s]),n[V].min>p&&(n[V].min=p,n[V].minX=r,n[V].minY=s),n[V].max<p&&(n[V].max=p,n[V].maxX=r,n[V].maxY=s),n[V].sum+=p,n[V].counter++):f[V].length>0&&(this.finalPLMap[V]=this.finalPLMap[V]||[],this.finalPLMap[V].push(f[V]),f[V]=[])}l=this.component.grid.getXend();for(var W,x=0,k=i.length;k>x;x++)for(var L=0,v=i[x].length;v>L;L++)V=i[x][L],U=u[V],c=U.data[b],p=null!=c?null!=c.value?c.value:c:"-","-"==p&&this.deepQuery([c,U,this.option],"calculable")&&(W=this.deepQuery([c,U],"symbolSize"),l-=2*W+5,r=l,this.shapeList.push(this._getCalculableItem(V,b,y.getNameByIndex(b),r,s,"vertical")))}for(var w in f)f[w].length>0&&(this.finalPLMap[w]=this.finalPLMap[w]||[],this.finalPLMap[w].push(f[w]),f[w]=[]);this._calculMarkMapXY(n,i,"x"),this._buildBorkenLine(e,this.finalPLMap,y,"vertical")},_buildOther:function(e,t,i,n){for(var a,o,r=this.series,s={},l=0,h=i.length;h>l;l++)for(var d=0,m=i[l].length;m>d;d++){var c=i[l][d],p=r[c],u=p.xAxisIndex||0;a=this.component.xAxis.getAxis(u);var V=p.yAxisIndex||0;o=this.component.yAxis.getAxis(V);var U=o.getCoord(0);s[c]=s[c]||[],n[c]=n[c]||{min0:Number.POSITIVE_INFINITY,min1:Number.POSITIVE_INFINITY,max0:Number.NEGATIVE_INFINITY,max1:Number.NEGATIVE_INFINITY,sum0:0,sum1:0,counter0:0,counter1:0,average0:0,average1:0};for(var g=0,y=p.data.length;y>g;g++){var f=p.data[g],b=null!=f?null!=f.value?f.value:f:"-";if(b instanceof Array){var _=a.getCoord(b[0]),x=o.getCoord(b[1]);s[c].push([_,x,g,b[0],_,U]),n[c].min0>b[0]&&(n[c].min0=b[0],n[c].minY0=x,n[c].minX0=_),n[c].max0<b[0]&&(n[c].max0=b[0],n[c].maxY0=x,n[c].maxX0=_),n[c].sum0+=b[0],n[c].counter0++,n[c].min1>b[1]&&(n[c].min1=b[1],n[c].minY1=x,n[c].minX1=_),n[c].max1<b[1]&&(n[c].max1=b[1],n[c].maxY1=x,n[c].maxX1=_),n[c].sum1+=b[1],n[c].counter1++}}}for(var k in s)s[k].length>0&&(this.finalPLMap[k]=this.finalPLMap[k]||[],this.finalPLMap[k].push(s[k]),s[k]=[]);this._calculMarkMapXY(n,i,"xy"),this._buildBorkenLine(e,this.finalPLMap,a,"horizontal")},_buildBorkenLine:function(e,t,i,n){for(var a,r=this.series,l=e.length-1;l>=0;l--){var c=e[l],p=r[c],u=t[c];if(p.type===this.type&&null!=u)for(var V=this._getBbox(c,n),U=this._sIndex2ColorMap[c],g=this.query(p,"itemStyle.normal.lineStyle.width"),y=this.query(p,"itemStyle.normal.lineStyle.type"),f=this.query(p,"itemStyle.normal.lineStyle.color"),b=this.getItemStyleColor(this.query(p,"itemStyle.normal.color"),c,-1),_=null!=this.query(p,"itemStyle.normal.areaStyle"),x=this.query(p,"itemStyle.normal.areaStyle.color"),k=0,L=u.length;L>k;k++){var v=u[k],W=this._isLarge(n,v);if(W)v=this._getLargePointList(n,v);else for(var w=0,X=v.length;X>w;w++)a=p.data[v[w][2]],(this.deepQuery([a,p,this.option],"calculable")||this.deepQuery([a,p],"showAllSymbol")||"categoryAxis"===i.type&&i.isMainAxis(v[w][2])&&"none"!=this.deepQuery([a,p],"symbol"))&&this.shapeList.push(this._getSymbol(c,v[w][2],v[w][3],v[w][0],v[w][1],n));var I=new o({zlevel:this._zlevelBase,style:{miterLimit:g,pointList:v,strokeColor:f||b||U,lineWidth:g,lineType:y,smooth:this._getSmooth(p.smooth),smoothConstraint:V,shadowColor:this.query(p,"itemStyle.normal.lineStyle.shadowColor"),shadowBlur:this.query(p,"itemStyle.normal.lineStyle.shadowBlur"),shadowOffsetX:this.query(p,"itemStyle.normal.lineStyle.shadowOffsetX"),shadowOffsetY:this.query(p,"itemStyle.normal.lineStyle.shadowOffsetY")},hoverable:!1,_main:!0,_seriesIndex:c,_orient:n});if(h.pack(I,r[c],c,0,k,r[c].name),this.shapeList.push(I),_){var K=new s({zlevel:this._zlevelBase,style:{miterLimit:g,pointList:d.clone(v).concat([[v[v.length-1][4],v[v.length-1][5]],[v[0][4],v[0][5]]]),brushType:"fill",smooth:this._getSmooth(p.smooth),smoothConstraint:V,color:x?x:m.alpha(U,.5)},highlightStyle:{brushType:"fill"},hoverable:!1,_main:!0,_seriesIndex:c,_orient:n});h.pack(K,r[c],c,0,k,r[c].name),this.shapeList.push(K)}}}},_getBbox:function(e,t){var i=this.component.grid.getBbox(),n=this.xMarkMap[e];return null!=n.minX0?[[Math.min(n.minX0,n.maxX0,n.minX1,n.maxX1),Math.min(n.minY0,n.maxY0,n.minY1,n.maxY1)],[Math.max(n.minX0,n.maxX0,n.minX1,n.maxX1),Math.max(n.minY0,n.maxY0,n.minY1,n.maxY1)]]:("horizontal"===t?(i[0][1]=Math.min(n.minY,n.maxY),i[1][1]=Math.max(n.minY,n.maxY)):(i[0][0]=Math.min(n.minX,n.maxX),i[1][0]=Math.max(n.minX,n.maxX)),i)},_isLarge:function(e,t){return t.length<2?!1:"horizontal"===e?Math.abs(t[0][0]-t[1][0])<.5:Math.abs(t[0][1]-t[1][1])<.5},_getLargePointList:function(e,t){var i;i="horizontal"===e?this.component.grid.getWidth():this.component.grid.getHeight();for(var n=t.length,a=[],o=0;i>o;o++)a[o]=t[Math.floor(n/i*o)];return a},_getSmooth:function(e){return e?.3:0},_getCalculableItem:function(e,t,i,n,a,o){var r=this.series,s=r[e].calculableHolderColor||this.ecTheme.calculableHolderColor,l=this._getSymbol(e,t,i,n,a,o);return l.style.color=s,l.style.strokeColor=s,l.rotation=[0,0],l.hoverable=!1,l.draggable=!1,l.style.text=void 0,l},_getSymbol:function(e,t,i,n,a,o){var r=this.series,s=r[e],l=s.data[t],h=this.getSymbolShape(s,e,l,t,i,n,a,this._sIndex2ShapeMap[e],this._sIndex2ColorMap[e],"#fff","vertical"===o?"horizontal":"vertical");return h.zlevel=this._zlevelBase+1,this.deepQuery([l,s,this.option],"calculable")&&(this.setCalculable(h),h.draggable=!0),h},getMarkCoord:function(e,t){var i=this.series[e],n=this.xMarkMap[e],a=this.component.xAxis.getAxis(i.xAxisIndex),o=this.component.yAxis.getAxis(i.yAxisIndex);if(t.type&&("max"===t.type||"min"===t.type||"average"===t.type)){var r=null!=t.valueIndex?t.valueIndex:null!=n.maxX0?"1":"";return[n[t.type+"X"+r],n[t.type+"Y"+r],n[t.type+"Line"+r],n[t.type+r]]}return["string"!=typeof t.xAxis&&a.getCoordByIndex?a.getCoordByIndex(t.xAxis||0):a.getCoord(t.xAxis||0),"string"!=typeof t.yAxis&&o.getCoordByIndex?o.getCoordByIndex(t.yAxis||0):o.getCoord(t.yAxis||0)]},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()},ontooltipHover:function(e,t){for(var i,n,a=e.seriesIndex,o=e.dataIndex,r=a.length;r--;)if(i=this.finalPLMap[a[r]])for(var s=0,l=i.length;l>s;s++){n=i[s];for(var h=0,d=n.length;d>h;h++)o===n[h][2]&&t.push(this._getSymbol(a[r],n[h][2],n[h][3],n[h][0],n[h][1],"horizontal"))}},addDataAnimation:function(e){for(var t=this.series,i={},n=0,a=e.length;a>n;n++)i[e[n][0]]=e[n];for(var o,r,s,l,h,d,m,n=this.shapeList.length-1;n>=0;n--)if(h=this.shapeList[n]._seriesIndex,i[h]&&!i[h][3]){if(this.shapeList[n]._main&&this.shapeList[n].style.pointList.length>1){if(d=this.shapeList[n].style.pointList,r=Math.abs(d[0][0]-d[1][0]),l=Math.abs(d[0][1]-d[1][1]),m="horizontal"===this.shapeList[n]._orient,i[h][2]){if("half-smooth-polygon"===this.shapeList[n].type){var c=d.length;this.shapeList[n].style.pointList[c-3]=d[c-2],this.shapeList[n].style.pointList[c-3][m?0:1]=d[c-4][m?0:1],this.shapeList[n].style.pointList[c-2]=d[c-1]}this.shapeList[n].style.pointList.pop(),m?(o=r,s=0):(o=0,s=-l)}else{if(this.shapeList[n].style.pointList.shift(),"half-smooth-polygon"===this.shapeList[n].type){var p=this.shapeList[n].style.pointList.pop();m?p[0]=d[0][0]:p[1]=d[0][1],this.shapeList[n].style.pointList.push(p)}m?(o=-r,s=0):(o=0,s=l)}this.zr.modShape(this.shapeList[n].id,{style:{pointList:this.shapeList[n].style.pointList}},!0)}else{if(i[h][2]&&this.shapeList[n]._dataIndex===t[h].data.length-1){this.zr.delShape(this.shapeList[n].id);continue}if(!i[h][2]&&0===this.shapeList[n]._dataIndex){this.zr.delShape(this.shapeList[n].id);continue}}this.shapeList[n].position=[0,0],this.zr.animate(this.shapeList[n].id,"").when(500,{position:[o,s]}).start()}}},r.prototype.iconLibrary.legendLineIcon=i,d.inherits(t,a),d.inherits(t,n),e("../chart").define("line",t),t}),define("echarts/util/shape/HalfSmoothPolygon",["require","zrender/shape/Base","zrender/shape/util/smoothBezier","zrender/tool/util","zrender/shape/Polygon"],function(e){function t(e){i.call(this,e)}var i=e("zrender/shape/Base"),n=e("zrender/shape/util/smoothBezier"),a=e("zrender/tool/util");return t.prototype={type:"half-smooth-polygon",buildPath:function(t,i){var a=i.pointList;if(!(a.length<2))if(i.smooth){var o=n(a.slice(0,-2),i.smooth,!1,i.smoothConstraint);t.moveTo(a[0][0],a[0][1]);for(var r,s,l,h=a.length,d=0;h-3>d;d++)r=o[2*d],s=o[2*d+1],l=a[d+1],t.bezierCurveTo(r[0],r[1],s[0],s[1],l[0],l[1]);t.lineTo(a[h-2][0],a[h-2][1]),t.lineTo(a[h-1][0],a[h-1][1]),t.lineTo(a[0][0],a[0][1])}else e("zrender/shape/Polygon").prototype.buildPath(t,i)}},a.inherits(t,i),t});
\ No newline at end of file
此差异已折叠。
define("echarts/chart/pie",["require","../component/base","./base","zrender/shape/Text","zrender/shape/Ring","zrender/shape/Circle","zrender/shape/Sector","zrender/shape/BrokenLine","../config","../util/ecData","zrender/tool/util","zrender/tool/math","zrender/tool/color","../chart"],function(e){function t(e,t,a,o,s){i.call(this,e,t,a,o,s),n.call(this);var r=this;r.shapeHandler.onmouseover=function(e){var t=e.target,i=d.get(t,"seriesIndex"),n=d.get(t,"dataIndex"),a=d.get(t,"special"),o=[t.style.x,t.style.y],s=t.style.startAngle,l=t.style.endAngle,h=((l+s)/2+360)%360,m=t.highlightStyle.color,p=r.getLabel(i,n,a,o,h,m,!0);p&&r.zr.addHoverShape(p);var c=r.getLabelLine(i,n,o,t.style.r0,t.style.r,h,m,!0);c&&r.zr.addHoverShape(c)},this.refresh(o)}var i=e("../component/base"),n=e("./base"),a=e("zrender/shape/Text"),o=e("zrender/shape/Ring"),s=e("zrender/shape/Circle"),r=e("zrender/shape/Sector"),l=e("zrender/shape/BrokenLine"),h=e("../config"),d=e("../util/ecData"),m=e("zrender/tool/util"),p=e("zrender/tool/math"),c=e("zrender/tool/color");return t.prototype={type:h.CHART_TYPE_PIE,_buildShape:function(){var e=this.series,t=this.component.legend;this.selectedMap={},this._selected={};var i,n,a;this._selectedMode=!1;for(var r,l=0,m=e.length;m>l;l++)if(e[l].type===h.CHART_TYPE_PIE){if(e[l]=this.reformOption(e[l]),this.legendHoverLink=e[l].legendHoverLink||this.legendHoverLink,r=e[l].name||"",this.selectedMap[r]=t?t.isSelected(r):!0,!this.selectedMap[r])continue;i=this.parseCenter(this.zr,e[l].center),n=this.parseRadius(this.zr,e[l].radius),this._selectedMode=this._selectedMode||e[l].selectedMode,this._selected[l]=[],this.deepQuery([e[l],this.option],"calculable")&&(a={zlevel:this._zlevelBase,hoverable:!1,style:{x:i[0],y:i[1],r0:n[0]<=10?0:n[0]-10,r:n[1]+10,brushType:"stroke",lineWidth:1,strokeColor:e[l].calculableHolderColor||this.ecTheme.calculableHolderColor}},d.pack(a,e[l],l,void 0,-1),this.setCalculable(a),a=n[0]<=10?new s(a):new o(a),this.shapeList.push(a)),this._buildSinglePie(l),this.buildMark(l)}this.addShapeList()},_buildSinglePie:function(e){for(var t,i=this.series,n=i[e],a=n.data,o=this.component.legend,s=0,r=0,l=0,h=Number.NEGATIVE_INFINITY,d=[],m=0,p=a.length;p>m;m++)t=a[m].name,this.selectedMap[t]=o?o.isSelected(t):!0,this.selectedMap[t]&&!isNaN(a[m].value)&&(0!==+a[m].value?s++:r++,l+=+a[m].value,h=Math.max(h,+a[m].value));if(0!==l){for(var c,u,V,U,g,y,f=100,_=n.clockWise,b=(n.startAngle.toFixed(2)-0+360)%360,x=n.minAngle||.01,k=360-x*s-.01*r,L=n.roseType,m=0,p=a.length;p>m;m++)if(t=a[m].name,this.selectedMap[t]&&!isNaN(a[m].value)){if(u=o?o.getColor(t):this.zr.getColor(m),f=a[m].value/l,c="area"!=L?_?b-f*k-(0!==f?x:.01):f*k+b+(0!==f?x:.01):_?b-360/p:360/p+b,c=c.toFixed(2)-0,f=(100*f).toFixed(2),V=this.parseCenter(this.zr,n.center),U=this.parseRadius(this.zr,n.radius),g=+U[0],y=+U[1],"radius"===L?y=a[m].value/h*(y-g)*.8+.2*(y-g)+g:"area"===L&&(y=Math.sqrt(a[m].value/h)*(y-g)+g),_){var v;v=b,b=c,c=v}this._buildItem(d,e,m,f,a[m].selected,V,g,y,b,c,u),_||(b=c)}this._autoLabelLayout(d,V,y);for(var m=0,p=d.length;p>m;m++)this.shapeList.push(d[m]);d=null}},_buildItem:function(e,t,i,n,a,o,s,r,l,h,m){var p=this.series,c=((h+l)/2+360)%360,u=this.getSector(t,i,n,a,o,s,r,l,h,m);d.pack(u,p[t],t,p[t].data[i],i,p[t].data[i].name,n),e.push(u);var V=this.getLabel(t,i,n,o,c,m,!1),U=this.getLabelLine(t,i,o,s,r,c,m,!1);U&&(d.pack(U,p[t],t,p[t].data[i],i,p[t].data[i].name,n),e.push(U)),V&&(d.pack(V,p[t],t,p[t].data[i],i,p[t].data[i].name,n),V._labelLine=U,e.push(V))},getSector:function(e,t,i,n,a,o,s,l,h,d){var m=this.series,u=m[e],V=u.data[t],U=[V,u],g=this.deepMerge(U,"itemStyle.normal")||{},y=this.deepMerge(U,"itemStyle.emphasis")||{},f=this.getItemStyleColor(g.color,e,t,V)||d,_=this.getItemStyleColor(y.color,e,t,V)||("string"==typeof f?c.lift(f,-.2):f),b={zlevel:this._zlevelBase,clickable:this.deepQuery(U,"clickable"),style:{x:a[0],y:a[1],r0:o,r:s,startAngle:l,endAngle:h,brushType:"both",color:f,lineWidth:g.borderWidth,strokeColor:g.borderColor,lineJoin:"round"},highlightStyle:{color:_,lineWidth:y.borderWidth,strokeColor:y.borderColor,lineJoin:"round"},_seriesIndex:e,_dataIndex:t};if(n){var x=((b.style.startAngle+b.style.endAngle)/2).toFixed(2)-0;b.style._hasSelected=!0,b.style._x=b.style.x,b.style._y=b.style.y;var k=this.query(u,"selectedOffset");b.style.x+=p.cos(x,!0)*k,b.style.y-=p.sin(x,!0)*k,this._selected[e][t]=!0}else this._selected[e][t]=!1;return this._selectedMode&&(b.onclick=this.shapeHandler.onclick),this.deepQuery([V,u,this.option],"calculable")&&(this.setCalculable(b),b.draggable=!0),(this._needLabel(u,V,!0)||this._needLabelLine(u,V,!0))&&(b.onmouseover=this.shapeHandler.onmouseover),b=new r(b)},getLabel:function(e,t,i,n,o,s,r){var l=this.series,h=l[e],d=h.data[t];if(this._needLabel(h,d,r)){var c,u,V,U=r?"emphasis":"normal",g=m.merge(m.clone(d.itemStyle)||{},h.itemStyle),y=g[U].label,f=y.textStyle||{},_=n[0],b=n[1],x=this.parseRadius(this.zr,h.radius),k="middle";y.position=y.position||g.normal.label.position,"center"===y.position?(c=_,u=b,V="center"):"inner"===y.position?(x=(x[0]+x[1])/2,c=Math.round(_+x*p.cos(o,!0)),u=Math.round(b-x*p.sin(o,!0)),s="#fff",V="center"):(x=x[1]- -g[U].labelLine.length,c=Math.round(_+x*p.cos(o,!0)),u=Math.round(b-x*p.sin(o,!0)),V=o>=90&&270>=o?"right":"left"),"center"!=y.position&&"inner"!=y.position&&(c+="left"===V?20:-20),d.__labelX=c-("left"===V?5:-5),d.__labelY=u;var L=new a({zlevel:this._zlevelBase+1,hoverable:!1,style:{x:c,y:u,color:f.color||s,text:this.getLabelText(e,t,i,U),textAlign:f.align||V,textBaseline:f.baseline||k,textFont:this.getFont(f)},highlightStyle:{brushType:"fill"}});return L._radius=x,L._labelPosition=y.position||"outer",L._rect=L.getRect(L.style),L._seriesIndex=e,L._dataIndex=t,L}},getLabelText:function(e,t,i,n){var a=this.series,o=a[e],s=o.data[t],r=this.deepQuery([s,o],"itemStyle."+n+".label.formatter");return r?"function"==typeof r?r.call(this.myChart,o.name,s.name,s.value,i):"string"==typeof r?(r=r.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}").replace("{d}","{d0}"),r=r.replace("{a0}",o.name).replace("{b0}",s.name).replace("{c0}",s.value).replace("{d0}",i)):void 0:s.name},getLabelLine:function(e,t,i,n,a,o,s,r){var h=this.series,d=h[e],c=d.data[t];if(this._needLabelLine(d,c,r)){var u=r?"emphasis":"normal",V=m.merge(m.clone(c.itemStyle)||{},d.itemStyle),U=V[u].labelLine,g=U.lineStyle||{},y=i[0],f=i[1],_=a,b=this.parseRadius(this.zr,d.radius)[1]- -U.length,x=p.cos(o,!0),k=p.sin(o,!0);return new l({zlevel:this._zlevelBase+1,hoverable:!1,style:{pointList:[[y+_*x,f-_*k],[y+b*x,f-b*k],[c.__labelX,c.__labelY]],strokeColor:g.color||s,lineType:g.type,lineWidth:g.width},_seriesIndex:e,_dataIndex:t})}},_needLabel:function(e,t,i){return this.deepQuery([t,e],"itemStyle."+(i?"emphasis":"normal")+".label.show")},_needLabelLine:function(e,t,i){return this.deepQuery([t,e],"itemStyle."+(i?"emphasis":"normal")+".labelLine.show")},_autoLabelLayout:function(e,t,i){for(var n=[],a=[],o=0,s=e.length;s>o;o++)"outer"===e[o]._labelPosition&&(e[o]._rect._y=e[o]._rect.y,e[o]._rect.x<t[0]?n.push(e[o]):a.push(e[o]));this._layoutCalculate(n,t,i,-1),this._layoutCalculate(a,t,i,1)},_layoutCalculate:function(e,t,i,n){function a(t,i,n){for(var a=t;i>a;a++)if(e[a]._rect.y+=n,e[a].style.y+=n,e[a]._labelLine&&(e[a]._labelLine.style.pointList[1][1]+=n,e[a]._labelLine.style.pointList[2][1]+=n),a>t&&i>a+1&&e[a+1]._rect.y>e[a]._rect.y+e[a]._rect.height)return void o(a,n/2);o(i-1,n/2)}function o(t,i){for(var n=t;n>=0&&(e[n]._rect.y-=i,e[n].style.y-=i,e[n]._labelLine&&(e[n]._labelLine.style.pointList[1][1]-=i,e[n]._labelLine.style.pointList[2][1]-=i),!(n>0&&e[n]._rect.y>e[n-1]._rect.y+e[n-1]._rect.height));n--);}function s(e,t,i,n,a){for(var o,s,r,l=i[0],h=i[1],d=a>0?t?Number.MAX_VALUE:0:t?Number.MAX_VALUE:0,m=0,p=e.length;p>m;m++)s=Math.abs(e[m]._rect.y-h),r=e[m]._radius-n,o=n+r>s?Math.sqrt((n+r+20)*(n+r+20)-Math.pow(e[m]._rect.y-h,2)):Math.abs(e[m]._rect.x+(a>0?0:e[m]._rect.width)-l),t&&o>=d&&(o=d-10),!t&&d>=o&&(o=d+10),e[m]._rect.x=e[m].style.x=l+o*a,e[m]._labelLine.style.pointList[2][0]=l+(o-5)*a,e[m]._labelLine.style.pointList[1][0]=l+(o-20)*a,d=o}e.sort(function(e,t){return e._rect.y-t._rect.y});for(var r,l=0,h=e.length,d=[],m=[],p=0;h>p;p++)r=e[p]._rect.y-l,0>r&&a(p,h,-r,n),l=e[p]._rect.y+e[p]._rect.height;this.zr.getHeight()-l<0&&o(h-1,l-this.zr.getHeight());for(var p=0;h>p;p++)e[p]._rect.y>=t[1]?m.push(e[p]):d.push(e[p]);s(m,!0,t,i,n),s(d,!1,t,i,n)},reformOption:function(e){var t=m.merge;return e=t(e||{},this.ecTheme.pie),e.itemStyle.normal.label.textStyle=t(e.itemStyle.normal.label.textStyle||{},this.ecTheme.textStyle),e.itemStyle.emphasis.label.textStyle=t(e.itemStyle.emphasis.label.textStyle||{},this.ecTheme.textStyle),e},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()},addDataAnimation:function(e){for(var t=this.series,i={},n=0,a=e.length;a>n;n++)i[e[n][0]]=e[n];var o={},s={},r={},l=this.shapeList;this.shapeList=[];for(var d,m,p,c={},n=0,a=e.length;a>n;n++)d=e[n][0],m=e[n][2],p=e[n][3],t[d]&&t[d].type===h.CHART_TYPE_PIE&&(m?(p||(o[d+"_"+t[d].data.length]="delete"),c[d]=1):p?c[d]=0:(o[d+"_-1"]="delete",c[d]=-1),this._buildSinglePie(d));for(var u,V,n=0,a=this.shapeList.length;a>n;n++)switch(d=this.shapeList[n]._seriesIndex,u=this.shapeList[n]._dataIndex,V=d+"_"+u,this.shapeList[n].type){case"sector":o[V]=this.shapeList[n];break;case"text":s[V]=this.shapeList[n];break;case"broken-line":r[V]=this.shapeList[n]}this.shapeList=[];for(var U,n=0,a=l.length;a>n;n++)if(d=l[n]._seriesIndex,i[d]){if(u=l[n]._dataIndex+c[d],V=d+"_"+u,U=o[V],!U)continue;if("sector"===l[n].type)"delete"!=U?this.zr.animate(l[n].id,"style").when(400,{startAngle:U.style.startAngle,endAngle:U.style.endAngle}).start():this.zr.animate(l[n].id,"style").when(400,c[d]<0?{startAngle:l[n].style.startAngle}:{endAngle:l[n].style.endAngle}).start();else if("text"===l[n].type||"broken-line"===l[n].type)if("delete"===U)this.zr.delShape(l[n].id);else switch(l[n].type){case"text":U=s[V],this.zr.animate(l[n].id,"style").when(400,{x:U.style.x,y:U.style.y}).start();break;case"broken-line":U=r[V],this.zr.animate(l[n].id,"style").when(400,{pointList:U.style.pointList}).start()}}this.shapeList=l},onclick:function(e){var t=this.series;if(this.isClick&&e.target){this.isClick=!1;for(var i,n=e.target,a=n.style,o=d.get(n,"seriesIndex"),s=d.get(n,"dataIndex"),r=0,l=this.shapeList.length;l>r;r++)if(this.shapeList[r].id===n.id){if(o=d.get(n,"seriesIndex"),s=d.get(n,"dataIndex"),a._hasSelected)n.style.x=n.style._x,n.style.y=n.style._y,n.style._hasSelected=!1,this._selected[o][s]=!1;else{var m=((a.startAngle+a.endAngle)/2).toFixed(2)-0;n.style._hasSelected=!0,this._selected[o][s]=!0,n.style._x=n.style.x,n.style._y=n.style.y,i=this.query(t[o],"selectedOffset"),n.style.x+=p.cos(m,!0)*i,n.style.y-=p.sin(m,!0)*i}this.zr.modShape(n.id,n)}else this.shapeList[r].style._hasSelected&&"single"===this._selectedMode&&(o=d.get(this.shapeList[r],"seriesIndex"),s=d.get(this.shapeList[r],"dataIndex"),this.shapeList[r].style.x=this.shapeList[r].style._x,this.shapeList[r].style.y=this.shapeList[r].style._y,this.shapeList[r].style._hasSelected=!1,this._selected[o][s]=!1,this.zr.modShape(this.shapeList[r].id,this.shapeList[r]));this.messageCenter.dispatch(h.EVENT.PIE_SELECTED,e.event,{selected:this._selected,target:d.get(n,"name")},this.myChart),this.zr.refresh()}}},m.inherits(t,n),m.inherits(t,i),e("../chart").define("pie",t),t});
\ No newline at end of file
define("echarts/chart/radar",["require","../component/base","./base","zrender/shape/Polygon","../component/polar","../config","../util/ecData","zrender/tool/util","zrender/tool/color","../util/accMath","../chart"],function(e){function t(e,t,a,o,s){i.call(this,e,t,a,o,s),n.call(this),this.refresh(o)}var i=e("../component/base"),n=e("./base"),a=e("zrender/shape/Polygon");e("../component/polar");var o=e("../config"),s=e("../util/ecData"),r=e("zrender/tool/util"),l=e("zrender/tool/color");return t.prototype={type:o.CHART_TYPE_RADAR,_buildShape:function(){this.selectedMap={},this._symbol=this.option.symbolList,this._queryTarget,this._dropBoxList=[],this._radarDataCounter=0;for(var e,t=this.series,i=this.component.legend,n=0,a=t.length;a>n;n++)t[n].type===o.CHART_TYPE_RADAR&&(this.serie=this.reformOption(t[n]),this.legendHoverLink=t[n].legendHoverLink||this.legendHoverLink,e=this.serie.name||"",this.selectedMap[e]=i?i.isSelected(e):!0,this.selectedMap[e]&&(this._queryTarget=[this.serie,this.option],this.deepQuery(this._queryTarget,"calculable")&&this._addDropBox(n),this._buildSingleRadar(n),this.buildMark(n)));this.addShapeList()},_buildSingleRadar:function(e){for(var t,i,n,a,o=this.component.legend,s=this.serie.data,r=this.deepQuery(this._queryTarget,"calculable"),l=0;l<s.length;l++)n=s[l].name||"",this.selectedMap[n]=o?o.isSelected(n):!0,this.selectedMap[n]&&(o?(i=o.getColor(n),t=o.getItemShape(n),t&&(t.style.brushType=this.deepQuery([s[l],this.serie],"itemStyle.normal.areaStyle")?"both":"stroke",o.setItemShape(n,t))):i=this.zr.getColor(l),a=this._getPointList(this.serie.polarIndex,s[l]),this._addSymbol(a,i,l,e,this.serie.polarIndex),this._addDataShape(a,i,s[l],e,l,r),this._radarDataCounter++)},_getPointList:function(e,t){for(var i,n=[],a=this.component.polar,o=0,s=t.value.length;s>o;o++)i=a.getVector(e,o,"undefined"!=typeof t.value[o].value?t.value[o].value:t.value[o]),i&&n.push(i);return n},_addSymbol:function(e,t,i,n,a){for(var o,r=this.series,l=this.component.polar,h=0,d=e.length;d>h;h++)o=this.getSymbolShape(this.deepMerge([r[n].data[i],r[n]]),n,r[n].data[i].value[h],h,l.getIndicatorText(a,h),e[h][0],e[h][1],this._symbol[this._radarDataCounter%this._symbol.length],t,"#fff","vertical"),o.zlevel=this._zlevelBase+1,s.set(o,"data",r[n].data[i]),s.set(o,"value",r[n].data[i].value),s.set(o,"dataIndex",i),s.set(o,"special",h),this.shapeList.push(o)},_addDataShape:function(e,t,i,n,o,r){var h=this.series,d=[i,this.serie],m=this.getItemStyleColor(this.deepQuery(d,"itemStyle.normal.color"),n,o,i),p=this.deepQuery(d,"itemStyle.normal.lineStyle.width"),c=this.deepQuery(d,"itemStyle.normal.lineStyle.type"),u=this.deepQuery(d,"itemStyle.normal.areaStyle.color"),V=this.deepQuery(d,"itemStyle.normal.areaStyle"),U={zlevel:this._zlevelBase,style:{pointList:e,brushType:V?"both":"stroke",color:u||m||("string"==typeof t?l.alpha(t,.5):t),strokeColor:m||t,lineWidth:p,lineType:c},highlightStyle:{brushType:this.deepQuery(d,"itemStyle.emphasis.areaStyle")||V?"both":"stroke",color:this.deepQuery(d,"itemStyle.emphasis.areaStyle.color")||u||m||("string"==typeof t?l.alpha(t,.5<