n?a:o,h=Math.abs(l.label.y-n);if(h>u.maxY){var c=l.label.x-e-l.len2*r,p=i+l.len,f=Math.abs(c)0?"right":"left":L>0?"left":"right"}var H=v.get("rotate");if(O="number"===typeof H?H*(Math.PI/180):H?L<0?-k+Math.PI:-k:0,o=!!O,p.x=T,p.y=C,p.rotation=O,p.setStyle({verticalAlign:"middle"}),R){p.setStyle({align:D});var W=p.states.select;W&&(W.x+=p.x,W.y+=p.y)}else{var Y=p.getBoundingRect().clone();Y.applyTransform(p.getComputedTransform());var X=(p.style.margin||0)+2.1;Y.y-=X/2,Y.height+=X,r.push({label:p,labelLine:g,position:m,len:M,len2:I,minTurnAngle:S.get("minTurnAngle"),maxSurfaceAngle:S.get("maxSurfaceAngle"),surfaceNormal:new Wi(L,P),linePoints:A,textAlign:D,labelDistance:x,labelAlignTo:_,edgeDistance:w,bleedMargin:b,rect:Y})}s.setTextConfig({inside:R})}})),!o&&t.get("avoidLabelOverlap")&&rD(r,e,n,l,u,p,h,c);for(var g=0;g0){for(var l=o.getItemLayout(0),u=1;isNaN(l&&l.startAngle)&&u=i.r0}},e.type="pie",e}(Uv),hD=uD;function cD(t,e,n){e=K(e)&&{coordDimensions:e}||R({},e);var i=t.getSource(),r=uM(i,e),o=new rM(r,t);return o.initData(i,n),o}var pD=function(){function t(t,e){this._getDataWithEncodedVisual=t,this._getRawData=e}return t.prototype.getAllNames=function(){var t=this._getRawData();return t.mapArray(t.getName)},t.prototype.containName=function(t){var e=this._getRawData();return e.indexOfName(t)>=0},t.prototype.indexOfName=function(t){var e=this._getDataWithEncodedVisual();return e.indexOfName(t)},t.prototype.getItemVisual=function(t,e){var n=this._getDataWithEncodedVisual();return n.getItemVisual(t,e)},t}(),dD=pD,fD=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.useColorPaletteOnData=!0,e}return u(e,t),e.prototype.init=function(e){t.prototype.init.apply(this,arguments),this.legendVisualProvider=new dD(q(this.getData,this),q(this.getRawData,this)),this._defaultLabelLine(e)},e.prototype.mergeOption=function(){t.prototype.mergeOption.apply(this,arguments)},e.prototype.getInitialData=function(){return cD(this,{coordDimensions:["value"],encodeDefaulter:j(Gf,this)})},e.prototype.getDataParams=function(e){var n=this.getData(),i=t.prototype.getDataParams.call(this,e),r=[];return n.each(n.mapDimension("value"),(function(t){r.push(t)})),i.percent=Yr(r,e,n.hostModel.get("percentPrecision")),i.$vars.push("percent"),i},e.prototype._defaultLabelLine=function(t){ho(t,"labelLine",["show"]);var e=t.labelLine,n=t.emphasis.labelLine;e.show=e.show&&t.label.show,n.show=n.show&&t.emphasis.label.show},e.type="series.pie",e.defaultOption={zlevel:0,z:2,legendHoverLink:!0,center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,minAngle:0,minShowLabelAngle:0,selectedOffset:10,percentPrecision:2,stillShowZeroSum:!0,left:0,top:0,right:0,bottom:0,width:null,height:null,label:{rotate:0,show:!0,overflow:"truncate",position:"outer",alignTo:"none",edgeDistance:"25%",bleedMargin:10,distanceToLabelLine:5},labelLine:{show:!0,length:15,length2:15,smooth:!1,minTurnAngle:90,maxSurfaceAngle:90,lineStyle:{width:1,type:"solid"}},itemStyle:{borderWidth:1},labelLayout:{hideOverlap:!0},emphasis:{scale:!0,scaleSize:5},avoidLabelOverlap:!0,animationType:"expansion",animationDuration:1e3,animationTypeUpdate:"transition",animationEasingUpdate:"cubicInOut",animationDurationUpdate:500,animationEasing:"cubicInOut"},e}(Rv),gD=fD;function yD(t){t.registerChartView(hD),t.registerSeriesModel(gD),Tx("pie",t.registerAction),t.registerLayout(j(tD,"pie")),t.registerProcessor(eD("pie"))}var vD=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.hasSymbolVisual=!0,n}return u(e,t),e.prototype.getInitialData=function(t,e){return _M(this.getSource(),this,{useEncodeDefaulter:!0})},e.prototype.getProgressive=function(){var t=this.option.progressive;return null==t?this.option.large?5e3:this.get("progressive"):t},e.prototype.getProgressiveThreshold=function(){var t=this.option.progressiveThreshold;return null==t?this.option.large?1e4:this.get("progressiveThreshold"):t},e.prototype.brushSelector=function(t,e,n){return n.point(e.getItemLayout(t))},e.type="series.scatter",e.dependencies=["grid","polar","geo","singleAxis","calendar"],e.defaultOption={coordinateSystem:"cartesian2d",zlevel:0,z:2,legendHoverLink:!0,symbolSize:10,large:!1,largeThreshold:2e3,itemStyle:{opacity:.8},emphasis:{scale:!0},clip:!0,select:{itemStyle:{borderColor:"#212121"}}},e}(Rv),mD=vD,xD=4,_D=function(){function t(){}return t}(),wD=function(t){function e(e){return t.call(this,e)||this}return u(e,t),e.prototype.getDefaultShape=function(){return new _D},e.prototype.buildPath=function(t,e){var n=e.points,i=e.size,r=this.symbolProxy,o=r.shape,a=t.getContext?t.getContext():t,s=a&&i[0]=0;s--){var l=2*s,u=i[l]-o/2,h=i[l+1]-a/2;if(t>=u&&e>=h&&t<=u+o&&e<=h+a)return s}return-1},e}(yl),bD=function(){function t(){this.group=new Ir}return t.prototype.isPersistent=function(){return!this._incremental},t.prototype.updateData=function(t,e){this.group.removeAll();var n=new wD({rectHover:!0,cursor:"default"});n.setShape({points:t.getLayout("points")}),this._setCommon(n,t,!1,e),this.group.add(n),this._incremental=null},t.prototype.updateLayout=function(t){if(!this._incremental){var e=t.getLayout("points");this.group.eachChild((function(t){if(null!=t.startIndex){var n=2*(t.endIndex-t.startIndex),i=4*t.startIndex*2;e=new Float32Array(e.buffer,i,n)}t.setShape("points",e)}))}},t.prototype.incrementalPrepareUpdate=function(t){this.group.removeAll(),this._clearIncremental(),t.count()>2e6?(this._incremental||(this._incremental=new Bc({silent:!0})),this.group.add(this._incremental)):this._incremental=null},t.prototype.incrementalUpdate=function(t,e,n){var i;this._incremental?(i=new wD,this._incremental.addDisplayable(i,!0)):(i=new wD({rectHover:!0,cursor:"default",startIndex:t.start,endIndex:t.end}),i.incremental=!0,this.group.add(i)),i.setShape({points:e.getLayout("points")}),this._setCommon(i,e,!!this._incremental,n)},t.prototype._setCommon=function(t,e,n,i){var r=e.hostModel;i=i||{};var o=e.getVisual("symbolSize");t.setShape("size",o instanceof Array?o:[o,o]),t.softClipShape=i.clipShape||null,t.symbolProxy=Hx(e.getVisual("symbol"),0,0,0,0),t.setColor=t.symbolProxy.setColor;var a=t.shape.size[0]=0&&(u.dataIndex=n+(t.startIndex||0))}))}},t.prototype.remove=function(){this._clearIncremental(),this._incremental=null,this.group.removeAll()},t.prototype._clearIncremental=function(){var t=this._incremental;t&&t.clearDisplaybles()},t}(),SD=bD,MD=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return u(e,t),e.prototype.render=function(t,e,n){var i=t.getData(),r=this._updateSymbolDraw(i,t);r.updateData(i,{clipShape:this._getClipShape(t)}),this._finished=!0},e.prototype.incrementalPrepareRender=function(t,e,n){var i=t.getData(),r=this._updateSymbolDraw(i,t);r.incrementalPrepareUpdate(i),this._finished=!1},e.prototype.incrementalRender=function(t,e,n){this._symbolDraw.incrementalUpdate(t,e.getData(),{clipShape:this._getClipShape(e)}),this._finished=t.end===e.getData().count()},e.prototype.updateTransform=function(t,e,n){var i=t.getData();if(this.group.dirty(),!this._finished||i.count()>1e4||!this._symbolDraw.isPersistent())return{update:!0};var r=gA("").reset(t,e,n);r.progress&&r.progress({start:0,end:i.count(),count:i.count()},i),this._symbolDraw.updateLayout(i)},e.prototype._getClipShape=function(t){var e=t.coordinateSystem,n=e&&e.getArea&&e.getArea();return t.get("clip",!0)?n:null},e.prototype._updateSymbolDraw=function(t,e){var n=this._symbolDraw,i=e.pipelineContext,r=i.large;return n&&r===this._isLargeDraw||(n&&n.remove(),n=this._symbolDraw=r?new SD:new LC,this._isLargeDraw=r,this.group.removeAll()),this.group.add(n.group),n},e.prototype.remove=function(t,e){this._symbolDraw&&this._symbolDraw.remove(!0),this._symbolDraw=null},e.prototype.dispose=function(){},e.type="scatter",e}(Uv),ID=MD,TD=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return u(e,t),e.type="grid",e.dependencies=["xAxis","yAxis"],e.layoutMode="box",e.defaultOption={show:!1,zlevel:0,z:0,left:"10%",top:60,right:"10%",bottom:70,containLabel:!1,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"},e}(Sf),CD=TD,AD=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return u(e,t),e.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",Eo).models[0]},e.type="cartesian2dAxis",e}(Sf);V(AD,HI);var DD={show:!0,zlevel:0,z:0,inverse:!1,name:"",nameLocation:"end",nameRotate:null,nameTruncate:{maxWidth:null,ellipsis:"...",placeholder:"."},nameTextStyle:{},nameGap:15,silent:!1,triggerEvent:!1,tooltip:{show:!1},axisPointer:{},axisLine:{show:!0,onZero:!0,onZeroAxisIndex:null,lineStyle:{color:"#6E7079",width:1,type:"solid"},symbol:["none","none"],symbolSize:[10,15]},axisTick:{show:!0,inside:!1,length:5,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,showMinLabel:null,showMaxLabel:null,margin:8,fontSize:12},splitLine:{show:!0,lineStyle:{color:["#E0E6F1"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(210,219,238,0.2)"]}}},kD=P({boundaryGap:!0,deduplication:null,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"}},DD),LD=P({boundaryGap:[0,0],axisLine:{show:"auto"},axisTick:{show:"auto"},splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:"#F4F7FD",width:1}}},DD),PD=P({scale:!0,splitNumber:6,axisLabel:{showMinLabel:!1,showMaxLabel:!1,rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},LD),OD=N({scale:!0,logBase:10},LD),RD={category:kD,value:LD,time:PD,log:OD},ND={value:1,category:1,time:1,log:1};function ED(t,e,n,i){F(ND,(function(r,o){var a=P(P({},RD[o],!0),i,!0),s=function(t){function n(){for(var n=[],i=0;i40&&(s=Math.max(1,Math.floor(a/40)));for(var l=o[0],u=t.dataToCoord(l+1)-t.dataToCoord(l),h=Math.abs(u*Math.cos(i)),c=Math.abs(u*Math.sin(i)),p=0,d=0;l<=o[1];l+=s){var f=0,g=0,y=ar(n({value:l}),e.font,"center","top");f=1.3*y.width,g=1.3*y.height,p=Math.max(p,f,7),d=Math.max(d,g,7)}var v=p/h,m=d/c;isNaN(v)&&(v=1/0),isNaN(m)&&(m=1/0);var x=Math.max(0,Math.floor(Math.min(v,m))),_=YD(t.model),w=t.getExtent(),b=_.lastAutoInterval,S=_.lastTickCount;return null!=b&&null!=S&&Math.abs(b-x)<=1&&Math.abs(S-a)<=1&&b>x&&_.axisExtent0===w[0]&&_.axisExtent1===w[1]?x=b:(_.lastTickCount=a,_.lastAutoInterval=x,_.axisExtent0=w[0],_.axisExtent1=w[1]),x}function nk(t){var e=t.getLabelModel();return{axisRotate:t.getRotate?t.getRotate():t.isHorizontal&&!t.isHorizontal()?90:0,labelRotate:e.get("rotate")||0,font:e.getFont()}}function ik(t,e,n){var i=RI(t),r=t.scale,o=r.getExtent(),a=t.getLabelModel(),s=[],l=Math.max((e||0)+1,1),u=o[0],h=r.count();0!==u&&l>1&&h/l>2&&(u=Math.round(Math.ceil(u/l)*l));var c=VI(t),p=a.get("showMinLabel")||c,d=a.get("showMaxLabel")||c;p&&u!==o[0]&&g(o[0]);for(var f=u;f<=o[1];f+=l)g(f);function g(t){var e={value:t};s.push(n?t:{formattedLabel:i(e),rawLabel:r.getLabel(e),tickValue:t})}return d&&f-l!==o[1]&&g(o[1]),s}function rk(t,e,n){var i=t.scale,r=RI(t),o=[];return F(i.getTicks(),(function(t){var a=i.getLabel(t),s=t.value;e(t.value,a)&&o.push(n?s:{formattedLabel:r(t),rawLabel:a,tickValue:s})})),o}var ok=[0,1],ak=function(){function t(t,e,n){this.onBand=!1,this.inverse=!1,this.dim=t,this.scale=e,this._extent=n||[0,0]}return t.prototype.contain=function(t){var e=this._extent,n=Math.min(e[0],e[1]),i=Math.max(e[0],e[1]);return t>=n&&t<=i},t.prototype.containData=function(t){return this.scale.contain(t)},t.prototype.getExtent=function(){return this._extent.slice()},t.prototype.getPixelPrecision=function(t){return Wr(t||this.scale.getExtent(),this._extent)},t.prototype.setExtent=function(t,e){var n=this._extent;n[0]=t,n[1]=e},t.prototype.dataToCoord=function(t,e){var n=this._extent,i=this.scale;return t=i.normalize(t),this.onBand&&"ordinal"===i.type&&(n=n.slice(),sk(n,i.count())),zr(t,ok,n,e)},t.prototype.coordToData=function(t,e){var n=this._extent,i=this.scale;this.onBand&&"ordinal"===i.type&&(n=n.slice(),sk(n,i.count()));var r=zr(t,n,ok,e);return this.scale.scale(r)},t.prototype.pointToData=function(t,e){},t.prototype.getTicksCoords=function(t){t=t||{};var e=t.tickModel||this.getTickModel(),n=UD(this,e),i=n.ticks,r=H(i,(function(t){return{coord:this.dataToCoord("ordinal"===this.scale.type?this.scale.getRawOrdinalNumber(t):t),tickValue:t}}),this),o=e.get("alignWithLabel");return lk(this,r,o,t.clamp),r},t.prototype.getMinorTicksCoords=function(){if("ordinal"===this.scale.type)return[];var t=this.model.getModel("minorTick"),e=t.get("splitNumber");e>0&&e<100||(e=5);var n=this.scale.getMinorTicks(e),i=H(n,(function(t){return H(t,(function(t){return{coord:this.dataToCoord(t),tickValue:t}}),this)}),this);return i},t.prototype.getViewLabels=function(){return XD(this).labels},t.prototype.getLabelModel=function(){return this.model.getModel("axisLabel")},t.prototype.getTickModel=function(){return this.model.getModel("axisTick")},t.prototype.getBandWidth=function(){var t=this._extent,e=this.scale.getExtent(),n=e[1]-e[0]+(this.onBand?1:0);0===n&&(n=1);var i=Math.abs(t[1]-t[0]);return Math.abs(i)/n},t.prototype.calculateCategoryInterval=function(){return ek(this)},t}();function sk(t,e){var n=t[1]-t[0],i=e,r=n/i/2;t[0]+=r,t[1]-=r}function lk(t,e,n,i){var r=e.length;if(t.onBand&&!n&&r){var o,a,s=t.getExtent();if(1===r)e[0].coord=s[0],o=e[1]={coord:s[0]};else{var l=e[r-1].tickValue-e[0].tickValue,u=(e[r-1].coord-e[0].coord)/l;F(e,(function(t){t.coord-=u/2}));var h=t.scale.getExtent();a=1+h[1]-e[r-1].tickValue,o={coord:e[r-1].coord+u*a},e.push(o)}var c=s[0]>s[1];p(e[0].coord,s[0])&&(i?e[0].coord=s[0]:e.shift()),i&&p(s[0],e[0].coord)&&e.unshift({coord:s[0]}),p(s[1],o.coord)&&(i?o.coord=s[1]:e.pop()),i&&p(o.coord,s[1])&&e.push({coord:s[1]})}function p(t,e){return t=Vr(t),e=Vr(e),c?t>e:te[1]&&e.reverse(),e},e.prototype.pointToData=function(t,e){return this.coordToData(this.toLocalCoord(t["x"===this.dim?0:1]),e)},e.prototype.setCategorySortInfo=function(t){if("category"!==this.type)return!1;this.model.option.categorySortInfo=t,this.scale.setSortInfo(t)},e}(uk),ck=hk;function pk(t,e,n){n=n||{};var i=t.coordinateSystem,r=e.axis,o={},a=r.getAxesOnZeroOf()[0],s=r.position,l=a?"onZero":s,u=r.dim,h=i.getRect(),c=[h.x,h.x+h.width,h.y,h.y+h.height],p={left:0,right:1,top:0,bottom:1,onZero:2},d=e.get("offset")||0,f="x"===u?[c[2]-d,c[3]+d]:[c[0]-d,c[1]+d];if(a){var g=a.toGlobalCoord(a.dataToCoord(0));f[p.onZero]=Math.max(Math.min(g,f[1]),f[0])}o.position=["y"===u?f[p[l]]:c[0],"x"===u?f[p[l]]:c[3]],o.rotation=Math.PI/2*("x"===u?0:1);var y={top:-1,bottom:1,left:-1,right:1};o.labelDirection=o.tickDirection=o.nameDirection=y[s],o.labelOffset=a?f[p[s]]-f[p.onZero]:0,e.get(["axisTick","inside"])&&(o.tickDirection=-o.tickDirection),ut(n.labelInside,e.get(["axisLabel","inside"]))&&(o.labelDirection=-o.labelDirection);var v=e.get(["axisLabel","rotate"]);return o.labelRotate="top"===l?-v:v,o.z2=1,o}function dk(t){return"cartesian2d"===t.get("coordinateSystem")}function fk(t){var e={xAxisModel:null,yAxisModel:null};return F(e,(function(n,i){var r=i.replace(/Model$/,""),o=t.getReferringComponents(r,Eo).models[0];e[i]=o})),e}var gk=function(){function t(t,e,n){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=GD,this._initCartesian(t,e,n),this.model=t}return t.prototype.getRect=function(){return this._rect},t.prototype.update=function(t,e){var n=this._axesMap;this._updateScale(t,this.model),F(n.x,(function(t){LI(t.scale,t.model)})),F(n.y,(function(t){LI(t.scale,t.model)}));var i={};F(n.x,(function(t){vk(n,"y",t,i)})),F(n.y,(function(t){vk(n,"x",t,i)})),this.resize(this.model,e)},t.prototype.resize=function(t,e,n){var i=t.getBoxLayoutParams(),r=!n&&t.get("containLabel"),o=df(i,{width:e.getWidth(),height:e.getHeight()});this._rect=o;var a=this._axesList;function s(){F(a,(function(t){var e=t.isHorizontal(),n=e?[0,o.width]:[0,o.height],i=t.inverse?1:0;t.setExtent(n[i],n[1-i]),xk(t,e?o.x:o.y)}))}s(),r&&(F(a,(function(t){if(!t.model.get(["axisLabel","inside"])){var e=EI(t);if(e){var n=t.isHorizontal()?"height":"width",i=t.model.get(["axisLabel","margin"]);o[n]-=e[n]+i,"top"===t.position?o.y+=e.height+i:"left"===t.position&&(o.x+=e.width+i)}}})),s()),F(this._coordsList,(function(t){t.calcAffineTransform()}))},t.prototype.getAxis=function(t,e){var n=this._axesMap[t];if(null!=n)return n[e||0]},t.prototype.getAxes=function(){return this._axesList.slice()},t.prototype.getCartesian=function(t,e){if(null!=t&&null!=e){var n="x"+t+"y"+e;return this._coordsMap[n]}et(t)&&(e=t.yAxisIndex,t=t.xAxisIndex);for(var i=0,r=this._coordsList;i0?"top":"bottom",i="center"):qr(o-wk)?(r=n>0?"bottom":"top",i="center"):(r="middle",i=o>0&&o0?"right":"left":n>0?"left":"right"),{rotation:o,textAlign:i,textVerticalAlign:r}},t.makeAxisEventDataBase=function(t){var e={componentType:t.mainType,componentIndex:t.componentIndex};return e[t.mainType+"Index"]=t.componentIndex,e},t.isLabelSilent=function(t){var e=t.get("tooltip");return t.get("silent")||!(t.get("triggerEvent")||e&&e.show)},t}(),Sk={axisLine:function(t,e,n,i){var r=e.get(["axisLine","show"]);if("auto"===r&&t.handleAutoShown&&(r=t.handleAutoShown("axisLine")),r){var o=e.axis.getExtent(),a=i.transform,s=[o[0],0],l=[o[1],0];a&&(Ft(s,s,a),Ft(l,l,a));var u=R({lineCap:"round"},e.getModel(["axisLine","lineStyle"]).getLineStyle()),h=new dc({subPixelOptimize:!0,shape:{x1:s[0],y1:s[1],x2:l[0],y2:l[1]},style:u,strokeContainThreshold:t.strokeContainThreshold||5,silent:!0,z2:1});h.anid="line",n.add(h);var c=e.get(["axisLine","symbol"]),p=e.get(["axisLine","symbolSize"]),d=e.get(["axisLine","symbolOffset"])||0;if("number"===typeof d&&(d=[d,d]),null!=c){"string"===typeof c&&(c=[c,c]),"string"!==typeof p&&"number"!==typeof p||(p=[p,p]);var f=p[0],g=p[1];F([{rotate:t.rotation+Math.PI/2,offset:d[0],r:0},{rotate:t.rotation-Math.PI/2,offset:d[1],r:Math.sqrt((s[0]-l[0])*(s[0]-l[0])+(s[1]-l[1])*(s[1]-l[1]))}],(function(e,i){if("none"!==c[i]&&null!=c[i]){var r=Hx(c[i],-f/2,-g/2,f,g,u.stroke,!0),o=e.r+e.offset;r.attr({rotation:e.rotate,x:s[0]+o*Math.cos(t.rotation),y:s[1]-o*Math.sin(t.rotation),silent:!0,z2:11}),n.add(r)}}))}}},axisTickLabel:function(t,e,n,i){var r=kk(n,i,e,t),o=Pk(n,i,e,t);Ik(e,o,r),Lk(n,i,e,t.tickDirection)},axisName:function(t,e,n,i){var r=ut(t.axisName,e.get("name"));if(r){var o,a,s=e.get("nameLocation"),l=t.nameDirection,u=e.getModel("nameTextStyle"),h=e.get("nameGap")||0,c=e.axis.getExtent(),p=c[0]>c[1]?-1:1,d=["start"===s?c[0]-p*h:"end"===s?c[1]+p*h:(c[0]+c[1])/2,Ak(s)?t.labelOffset+l*h:0],f=e.get("nameRotate");null!=f&&(f=f*wk/180),Ak(s)?o=bk.innerTextLayout(t.rotation,null!=f?f:t.rotation,l):(o=Mk(t.rotation,s,f||0,c),a=t.axisNameAvailableWidth,null!=a&&(a=Math.abs(a/Math.sin(o.rotation)),!isFinite(a)&&(a=null)));var g=u.getFont(),y=e.get("nameTruncate",!0)||{},v=y.ellipsis,m=ut(t.nameTruncateMaxWidth,y.maxWidth,a),x=new Zl({x:d[0],y:d[1],rotation:o.rotation,silent:bk.isLabelSilent(e),style:Cp(u,{text:r,font:g,overflow:"truncate",width:m,ellipsis:v,fill:u.getTextColor()||e.get(["axisLine","lineStyle","color"]),align:u.get("align")||o.textAlign,verticalAlign:u.get("verticalAlign")||o.textVerticalAlign}),z2:1});if(wp({el:x,componentModel:e,itemName:r}),x.__fullText=r,x.anid="name",e.get("triggerEvent")){var _=bk.makeAxisEventDataBase(e);_.targetType="axisName",_.name=r,ql(x).eventData=_}i.add(x),x.updateTransform(),n.add(x),x.decomposeTransform()}}};function Mk(t,e,n,i){var r,o,a=Zr(n-t),s=i[0]>i[1],l="start"===e&&!s||"start"!==e&&s;return qr(a-wk/2)?(o=l?"bottom":"top",r="center"):qr(a-1.5*wk)?(o=l?"top":"bottom",r="center"):(o="middle",r=a<1.5*wk&&a>wk/2?l?"left":"right":l?"right":"left"),{rotation:a,textAlign:r,textVerticalAlign:o}}function Ik(t,e,n){if(!VI(t.axis)){var i=t.get(["axisLabel","showMinLabel"]),r=t.get(["axisLabel","showMaxLabel"]);e=e||[],n=n||[];var o=e[0],a=e[1],s=e[e.length-1],l=e[e.length-2],u=n[0],h=n[1],c=n[n.length-1],p=n[n.length-2];!1===i?(Tk(o),Tk(u)):Ck(o,a)&&(i?(Tk(a),Tk(h)):(Tk(o),Tk(u))),!1===r?(Tk(s),Tk(c)):Ck(l,s)&&(r?(Tk(l),Tk(p)):(Tk(s),Tk(c)))}}function Tk(t){t&&(t.ignore=!0)}function Ck(t,e){var n=t&&t.getBoundingRect().clone(),i=e&&e.getBoundingRect().clone();if(n&&i){var r=Si([]);return Ci(r,r,-t.rotation),n.applyTransform(Ii([],r,t.getLocalTransform())),i.applyTransform(Ii([],r,e.getLocalTransform())),n.intersect(i)}}function Ak(t){return"middle"===t||"center"===t}function Dk(t,e,n,i,r){for(var o=[],a=[],s=[],l=0;l=0||t===e}function Gk(t){var e=Fk(t);if(e){var n=e.axisPointerModel,i=e.axis.scale,r=n.option,o=n.get("status"),a=n.get("value");null!=a&&(a=i.parse(a));var s=Wk(n);null==o&&(r.status=s?"show":"hide");var l=i.getExtent().slice();l[0]>l[1]&&l.reverse(),(null==a||a>l[1])&&(a=l[1]),a0&&!c.min?c.min=0:null!=c.min&&c.min<0&&!c.max&&(c.max=0);var p=a;null!=c.color&&(p=N({color:c.color},a));var d=P(L(c),{boundaryGap:t,splitNumber:e,scale:n,axisLine:i,axisTick:r,axisLabel:o,name:c.text,nameLocation:"end",nameGap:u,nameTextStyle:p,triggerEvent:h},!1);if(s||(d.name=""),"string"===typeof l){var f=d.name;d.name=l.replace("{value}",null!=f?f:"")}else"function"===typeof l&&(d.name=l(d.name,d));var g=new Kp(d,null,this.ecModel);return V(g,HI.prototype),g.mainType="radar",g.componentIndex=this.componentIndex,g}),this);this._indicatorModels=c},e.prototype.getIndicatorModels=function(){return this._indicatorModels},e.type="radar",e.defaultOption={zlevel:0,z:0,center:["50%","50%"],radius:"75%",startAngle:90,axisName:{show:!0},boundaryGap:[0,0],splitNumber:5,axisNameGap:15,scale:!1,shape:"polygon",axisLine:P({lineStyle:{color:"#bbb"}},yL.axisLine),axisLabel:vL(yL.axisLabel,!1),axisTick:vL(yL.axisTick,!1),splitLine:vL(yL.splitLine,!0),splitArea:vL(yL.splitArea,!0),indicator:[]},e}(Sf),xL=mL,_L=["axisLine","axisTickLabel","axisName"],wL=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return u(e,t),e.prototype.render=function(t,e,n){var i=this.group;i.removeAll(),this._buildAxes(t),this._buildSplitLineAndArea(t)},e.prototype._buildAxes=function(t){var e=t.coordinateSystem,n=e.getIndicatorAxes(),i=H(n,(function(t){var n=new Ok(t.model,{position:[e.cx,e.cy],rotation:t.angle,labelDirection:-1,tickDirection:-1,nameDirection:1});return n}));F(i,(function(t){F(_L,t.add,t),this.group.add(t.getGroup())}),this)},e.prototype._buildSplitLineAndArea=function(t){var e=t.coordinateSystem,n=e.getIndicatorAxes();if(n.length){var i=t.get("shape"),r=t.getModel("splitLine"),o=t.getModel("splitArea"),a=r.getModel("lineStyle"),s=o.getModel("areaStyle"),l=r.get("show"),u=o.get("show"),h=a.get("color"),c=s.get("color"),p=K(h)?h:[h],d=K(c)?c:[c],f=[],g=[];if("circle"===i)for(var y=n[0].getTicksCoords(),v=e.cx,m=e.cy,x=0;xn[0]&&isFinite(c)&&isFinite(n[0]))}else{var p=a.getTicks().length-1;p>r&&(u=o(u));h=Math.ceil(n[1]/u)*u,c=Vr(h-u*r);a.setExtent(c,h),a.setInterval(u)}}))},t.prototype.convertToPixel=function(t,e,n){return console.warn("Not implemented."),null},t.prototype.convertFromPixel=function(t,e,n){return console.warn("Not implemented."),null},t.prototype.containPoint=function(t){return console.warn("Not implemented."),!1},t.create=function(e,n){var i=[];return e.eachComponent("radar",(function(r){var o=new t(r,e,n);i.push(o),r.coordinateSystem=o})),e.eachSeriesByType("radar",(function(t){"radar"===t.get("coordinateSystem")&&(t.coordinateSystem=i[t.get("radarIndex")||0])})),i},t.dimensions=[],t}(),TL=IL;function CL(t){t.registerCoordinateSystem("radar",TL),t.registerComponentModel(xL),t.registerComponentView(bL),t.registerVisual({seriesType:"radar",reset:function(t){var e=t.getData();e.each((function(t){e.setItemVisual(t,"legendIcon","roundRect")})),e.setVisual("legendIcon","roundRect")}})}function AL(t){_S(CL),t.registerChartView(dL),t.registerSeriesModel(gL),t.registerLayout(sL),t.registerProcessor(eD("radar")),t.registerPreprocessor(hL)}var DL="\0_ec_interaction_mutex";function kL(t,e,n){var i=OL(t);i[e]=n}function LL(t,e,n){var i=OL(t),r=i[e];r===n&&(i[e]=null)}function PL(t,e){return!!OL(t)[e]}function OL(t){return t[DL]||(t[DL]={})}uS({type:"takeGlobalCursor",event:"globalCursorTaken",update:"update"},(function(){}));var RL=function(t){function e(e){var n=t.call(this)||this;n._zr=e;var i=q(n._mousedownHandler,n),r=q(n._mousemoveHandler,n),o=q(n._mouseupHandler,n),a=q(n._mousewheelHandler,n),s=q(n._pinchHandler,n);return n.enable=function(t,n){this.disable(),this._opt=N(L(n)||{},{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),null==t&&(t=!0),!0!==t&&"move"!==t&&"pan"!==t||(e.on("mousedown",i),e.on("mousemove",r),e.on("mouseup",o)),!0!==t&&"scale"!==t&&"zoom"!==t||(e.on("mousewheel",a),e.on("pinch",s))},n.disable=function(){e.off("mousedown",i),e.off("mousemove",r),e.off("mouseup",o),e.off("mousewheel",a),e.off("pinch",s)},n}return u(e,t),e.prototype.isDragging=function(){return this._dragging},e.prototype.isPinching=function(){return this._pinching},e.prototype.setPointerChecker=function(t){this.pointerChecker=t},e.prototype.dispose=function(){this.disable()},e.prototype._mousedownHandler=function(t){if(!(ye(t)||t.target&&t.target.draggable)){var e=t.offsetX,n=t.offsetY;this.pointerChecker&&this.pointerChecker(t,e,n)&&(this._x=e,this._y=n,this._dragging=!0)}},e.prototype._mousemoveHandler=function(t){if(this._dragging&&zL("moveOnMouseMove",t,this._opt)&&"pinch"!==t.gestureEvent&&!PL(this._zr,"globalPan")){var e=t.offsetX,n=t.offsetY,i=this._x,r=this._y,o=e-i,a=n-r;this._x=e,this._y=n,this._opt.preventDefaultMouseMove&&ge(t.event),EL(this,"pan","moveOnMouseMove",t,{dx:o,dy:a,oldX:i,oldY:r,newX:e,newY:n,isAvailableBehavior:null})}},e.prototype._mouseupHandler=function(t){ye(t)||(this._dragging=!1)},e.prototype._mousewheelHandler=function(t){var e=zL("zoomOnMouseWheel",t,this._opt),n=zL("moveOnMouseWheel",t,this._opt),i=t.wheelDelta,r=Math.abs(i),o=t.offsetX,a=t.offsetY;if(0!==i&&(e||n)){if(e){var s=r>3?1.4:r>1?1.2:1.1,l=i>0?s:1/s;NL(this,"zoom","zoomOnMouseWheel",t,{scale:l,originX:o,originY:a,isAvailableBehavior:null})}if(n){var u=Math.abs(i),h=(i>0?1:-1)*(u>3?.4:u>1?.15:.05);NL(this,"scrollMove","moveOnMouseWheel",t,{scrollDelta:h,originX:o,originY:a,isAvailableBehavior:null})}}},e.prototype._pinchHandler=function(t){if(!PL(this._zr,"globalPan")){var e=t.pinchScale>1?1.1:1/1.1;NL(this,"zoom",null,t,{scale:e,originX:t.pinchX,originY:t.pinchY,isAvailableBehavior:null})}},e}(qt);function NL(t,e,n,i,r){t.pointerChecker&&t.pointerChecker(i,r.originX,r.originY)&&(ge(i.event),EL(t,e,n,i,r))}function EL(t,e,n,i,r){r.isAvailableBehavior=q(zL,null,n,i),t.trigger(e,r)}function zL(t,e,n){var i=n[t];return!t||i&&(!$(i)||e.event[i+"Key"])}var BL=RL;function VL(t,e,n){var i=t.target;i.x+=e,i.y+=n,i.dirty()}function GL(t,e,n,i){var r=t.target,o=t.zoomLimit,a=t.zoom=t.zoom||1;if(a*=e,o){var s=o.min||0,l=o.max||1/0;a=Math.max(Math.min(l,a),s)}var u=a/t.zoom;t.zoom=a,r.x-=(n-r.x)*(u-1),r.y-=(i-r.y)*(u-1),r.scaleX*=u,r.scaleY*=u,r.dirty()}var FL={axisPointer:1,tooltip:1,brush:1};function HL(t,e,n){var i=e.getComponentByElement(t.topTarget),r=i&&i.coordinateSystem;return i&&i!==n&&!FL.hasOwnProperty(i.mainType)&&r&&r.model!==n}var WL=["rect","circle","line","ellipse","polygon","polyline","path"],YL=_t(WL),XL=_t(WL.concat(["g"])),UL=_t(WL.concat(["g"])),ZL=Po();function qL(t){var e=t.getItemStyle(),n=t.get("areaColor");return null!=n&&(e.fill=n),e}var jL=function(){function t(t){var e=new Ir;this.uid=$p("ec_map_draw"),this._controller=new BL(t.getZr()),this._controllerHost={target:e},this.group=e,e.add(this._regionsGroup=new Ir),e.add(this._svgGroup=new Ir)}return t.prototype.draw=function(t,e,n,i,r){var o="geo"===t.mainType,a=t.getData&&t.getData();o&&e.eachComponent({mainType:"series",subType:"map"},(function(e){a||e.getHostGeoModel()!==t||(a=e.getData())}));var s=t.coordinateSystem,l=this._regionsGroup,u=this.group,h=s.getTransformInfo(),c=h.raw,p=h.roam,d=!l.childAt(0)||r;d?(u.x=p.x,u.y=p.y,u.scaleX=p.scaleX,u.scaleY=p.scaleY,u.dirty()):np(u,p,t);var f=a&&a.getVisual("visualMeta")&&a.getVisual("visualMeta").length>0,g={api:n,geo:s,mapOrGeoModel:t,data:a,isVisualEncodedByVisualMap:f,isGeo:o,transformInfoRaw:c};"geoJSON"===s.resourceType?this._buildGeoJSON(g):"geoSVG"===s.resourceType&&this._buildSVG(g),this._updateController(t,e,n),this._updateMapSelectHandler(t,l,n,i)},t.prototype._buildGeoJSON=function(t){var e=this._regionsGroupByName=_t(),n=_t(),i=this._regionsGroup,r=t.transformInfoRaw,o=t.mapOrGeoModel,a=t.data,s=function(t){return[t[0]*r.scaleX+r.x,t[1]*r.scaleY+r.y]};i.removeAll(),F(t.geo.regions,(function(r){var l=r.name,u=e.get(l),h=n.get(l)||{},c=h.dataIdx,p=h.regionModel;u||(u=e.set(l,new Ir),i.add(u),c=a?a.indexOfName(l):null,p=t.isGeo?o.getRegionModel(l):a?a.getItemModel(c):null,n.set(l,{dataIdx:c,regionModel:p}));var d=new Sc({segmentIgnoreThreshold:1,shape:{paths:[]}});u.add(d),F(r.geometries,(function(t){if("polygon"===t.type){for(var e=[],n=0;n=0)&&(p=r);var d=a?{normal:{align:"center",verticalAlign:"middle"}}:null;Ip(e,Tp(i),{labelFetcher:p,labelDataIndex:c,defaultText:n},d);var f=e.getTextContent();if(f&&(ZL(f).ignore=f.ignore,e.textConfig&&a)){var g=e.getBoundingRect().clone();e.textConfig.layoutRect=g,e.textConfig.position=[(a[0]-g.x)/g.width*100+"%",(a[1]-g.y)/g.height*100+"%"]}e.disableLabelAnimation=!0}else e.removeTextContent(),e.removeTextConfig(),e.disableLabelAnimation=null}function $L(t,e,n,i,r,o){t.data?t.data.setItemGraphicEl(o,e):ql(e).eventData={componentType:"geo",componentIndex:r.componentIndex,geoIndex:r.componentIndex,name:n,region:i&&i.option||{}}}function JL(t,e,n,i,r){t.data||wp({el:e,componentModel:r,itemName:n,itemTooltipOption:i.get("tooltip")})}function tP(t,e,n,i,r){e.highDownSilentOnTouch=!!r.get("selectedMode");var o=i.getModel("emphasis"),a=o.get("focus");return qu(e,a,o.get("blurScope")),t.isGeo&&eh(e,r,n),a}var eP=jL,nP=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return u(e,t),e.prototype.render=function(t,e,n,i){if(!i||"mapToggleSelect"!==i.type||i.from!==this.uid){var r=this.group;if(r.removeAll(),!t.getHostGeoModel()){if(this._mapDraw&&i&&"geoRoam"===i.type&&this._mapDraw.resetForLabelLayout(),i&&"geoRoam"===i.type&&"series"===i.componentType&&i.seriesId===t.id){o=this._mapDraw;o&&r.add(o.group)}else if(t.needsDrawMap){var o=this._mapDraw||new eP(n);r.add(o.group),o.draw(t,e,n,this,i),this._mapDraw=o}else this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null;t.get("showLegendSymbol")&&e.getComponent("legend")&&this._renderSymbols(t,e,n)}}},e.prototype.remove=function(){this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null,this.group.removeAll()},e.prototype.dispose=function(){this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null},e.prototype._renderSymbols=function(t,e,n){var i=t.originalData,r=this.group;i.each(i.mapDimension("value"),(function(e,n){if(!isNaN(e)){var o=i.getItemLayout(n);if(o&&o.point){var a=o.point,s=o.offset,l=new kh({style:{fill:t.getData().getVisual("style").fill},shape:{cx:a[0]+9*s,cy:a[1],r:3},silent:!0,z2:8+(s?0:iu+1)});if(!s){var u=t.mainSeries.getData(),h=i.getName(n),c=u.indexOfName(h),p=i.getItemModel(n),d=p.getModel("label"),f=u.getItemGraphicEl(c);Ip(l,Tp(p),{labelFetcher:{getFormattedLabel:function(e,n){return t.getFormattedLabel(c,n)}}}),l.disableLabelAnimation=!0,d.get("position")||l.setTextConfig({position:"bottom"}),f.onHoverStateChange=function(t){bu(l,t)}}r.add(l)}}}))},e.type="map",e}(Uv),iP=nP,rP=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.needsDrawMap=!1,n.seriesGroup=[],n.getTooltipPosition=function(t){if(null!=t){var e=this.getData().getName(t),n=this.coordinateSystem,i=n.getRegion(e);return i&&n.dataToPoint(i.getCenter())}},n}return u(e,t),e.prototype.getInitialData=function(t){for(var e=cD(this,{coordDimensions:["value"],encodeDefaulter:j(Gf,this)}),n=_t(),i=[],r=0,o=e.count();r-1&&(n.style.stroke=n.style.fill,n.style.fill="#fff",n.style.lineWidth=2),n},e.type="series.map",e.dependencies=["geo"],e.layoutMode="box",e.defaultOption={zlevel:0,z:2,coordinateSystem:"geo",map:"",left:"center",top:"center",aspectScale:null,showLegendSymbol:!0,boundingCoords:null,center:null,zoom:1,scaleLimit:null,selectedMode:!0,label:{show:!1,color:"#000"},itemStyle:{borderWidth:.5,borderColor:"#444",areaColor:"#eee"},emphasis:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{areaColor:"rgba(255,215,0,0.8)"}},select:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{color:"rgba(255,215,0,0.8)"}},nameProperty:"name"},e}(Rv),oP=rP;function aP(t,e){var n={};return F(t,(function(t){t.each(t.mapDimension("value"),(function(e,i){var r="ec-"+t.getName(i);n[r]=n[r]||[],isNaN(e)||n[r].push(e)}))})),t[0].map(t[0].mapDimension("value"),(function(i,r){for(var o,a="ec-"+t[0].getName(r),s=0,l=1/0,u=-1/0,h=n[a].length,c=0;c1?(s.width=a,s.height=a/d):(s.height=a,s.width=a*d),s.y=o[1]-s.height/2,s.x=o[0]-s.width/2;else{var g=t.getBoxLayoutParams();g.aspect=d,s=df(g,{width:c,height:p})}this.setViewRect(s.x,s.y,s.width,s.height),this.setCenter(t.get("center")),this.setZoom(t.get("zoom"))}function mP(t,e){F(e.get("geoCoord"),(function(e,n){t.addGeoCoord(n,e)}))}var xP=function(){function t(){this.dimensions=yP.prototype.dimensions}return t.prototype.create=function(t,e){var n=[];t.eachComponent("geo",(function(t,i){var r=t.get("map"),o=new yP(r+i,r,{nameMap:t.get("nameMap"),nameProperty:t.get("nameProperty"),aspectScale:t.get("aspectScale")});o.zoomLimit=t.get("scaleLimit"),n.push(o),t.coordinateSystem=o,o.model=t,o.resize=vP,o.resize(t,e)})),t.eachSeries((function(t){var e=t.get("coordinateSystem");if("geo"===e){var i=t.get("geoIndex")||0;t.coordinateSystem=n[i]}}));var i={};return t.eachSeriesByType("map",(function(t){if(!t.getHostGeoModel()){var e=t.getMapType();i[e]=i[e]||[],i[e].push(t)}})),F(i,(function(t,i){var r=H(t,(function(t){return t.get("nameMap")})),o=new yP(i,i,{nameMap:O(r),nameProperty:t[0].get("nameProperty"),aspectScale:t[0].get("aspectScale")});o.zoomLimit=ut.apply(null,H(t,(function(t){return t.get("scaleLimit")}))),n.push(o),o.resize=vP,o.resize(t[0],e),F(t,(function(t){t.coordinateSystem=o,mP(o,t)}))})),n},t.prototype.getFilledRegions=function(t,e,n,i){for(var r=(t||[]).slice(),o=_t(),a=0;a=0;a--){var s=i[a];s.hierNode={defaultAncestor:null,ancestor:s,prelim:0,modifier:0,change:0,shift:0,i:a,thread:null},r.push(s)}}function kP(t,e){var n=t.isExpand?t.children:[],i=t.parentNode.children,r=t.hierNode.i?i[t.hierNode.i-1]:null;if(n.length){NP(t);var o=(n[0].hierNode.prelim+n[n.length-1].hierNode.prelim)/2;r?(t.hierNode.prelim=r.hierNode.prelim+e(t,r),t.hierNode.modifier=t.hierNode.prelim-o):t.hierNode.prelim=o}else r&&(t.hierNode.prelim=r.hierNode.prelim+e(t,r));t.parentNode.hierNode.defaultAncestor=EP(t,r,t.parentNode.hierNode.defaultAncestor||i[0],e)}function LP(t){var e=t.hierNode.prelim+t.parentNode.hierNode.modifier;t.setLayout({x:e},!0),t.hierNode.modifier+=t.parentNode.hierNode.modifier}function PP(t){return arguments.length?t:FP}function OP(t,e){return t-=Math.PI/2,{x:e*Math.cos(t),y:e*Math.sin(t)}}function RP(t,e){return df(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function NP(t){var e=t.children,n=e.length,i=0,r=0;while(--n>=0){var o=e[n];o.hierNode.prelim+=i,o.hierNode.modifier+=i,r+=o.hierNode.change,i+=o.hierNode.shift+r}}function EP(t,e,n,i){if(e){var r=t,o=t,a=o.parentNode.children[0],s=e,l=r.hierNode.modifier,u=o.hierNode.modifier,h=a.hierNode.modifier,c=s.hierNode.modifier;while(s=zP(s),o=BP(o),s&&o){r=zP(r),a=BP(a),r.hierNode.ancestor=t;var p=s.hierNode.prelim+c-o.hierNode.prelim-u+i(s,o);p>0&&(GP(VP(s,t,n),t,p),u+=p,l+=p),c+=s.hierNode.modifier,u+=o.hierNode.modifier,l+=r.hierNode.modifier,h+=a.hierNode.modifier}s&&!zP(r)&&(r.hierNode.thread=s,r.hierNode.modifier+=c-l),o&&!BP(a)&&(a.hierNode.thread=o,a.hierNode.modifier+=u-h,n=t)}return n}function zP(t){var e=t.children;return e.length&&t.isExpand?e[e.length-1]:t.hierNode.thread}function BP(t){var e=t.children;return e.length&&t.isExpand?e[0]:t.hierNode.thread}function VP(t,e,n){return t.hierNode.ancestor.parentNode===e.parentNode?t.hierNode.ancestor:n}function GP(t,e,n){var i=n/(e.hierNode.i-t.hierNode.i);e.hierNode.change-=i,e.hierNode.shift+=n,e.hierNode.modifier+=n,e.hierNode.prelim+=n,t.hierNode.change+=i}function FP(t,e){return t.parentNode===e.parentNode?1:2}var HP=function(){function t(){this.parentPoint=[],this.childPoints=[]}return t}(),WP=function(t){function e(e){return t.call(this,e)||this}return u(e,t),e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new HP},e.prototype.buildPath=function(t,e){var n=e.childPoints,i=n.length,r=e.parentPoint,o=n[0],a=n[i-1];if(1===i)return t.moveTo(r[0],r[1]),void t.lineTo(o[0],o[1]);var s=e.orient,l="TB"===s||"BT"===s?0:1,u=1-l,h=Br(e.forkPosition,1),c=[];c[l]=r[l],c[u]=r[u]+(a[u]-r[u])*h,t.moveTo(r[0],r[1]),t.lineTo(c[0],c[1]),t.moveTo(o[0],o[1]),c[l]=o[l],t.lineTo(c[0],c[1]),c[l]=a[l],t.lineTo(c[0],c[1]),t.lineTo(a[0],a[1]);for(var p=1;pm.x,w||(_-=Math.PI));var S=w?"left":"right",M=s.getModel("label"),I=M.get("rotate"),T=I*(Math.PI/180),C=y.getTextContent();C&&(y.setTextConfig({position:M.get("position")||S,rotation:null==I?-_:T,origin:"center"}),C.setStyle("verticalAlign","middle"))}var A=s.get(["emphasis","focus"]),D="ancestor"===A?a.getAncestorsIndices():"descendant"===A?a.getDescendantIndices():null;D&&(ql(n).focus=D),ZP(r,a,h,n,f,d,g,i),n.__edge&&(n.onHoverStateChange=function(e){if("blur"!==e){var i=a.parentNode&&t.getItemGraphicEl(a.parentNode.dataIndex);i&&i.hoverState===Jl||bu(n.__edge,e)}})}function ZP(t,e,n,i,r,o,a,s){var l=e.getModel(),u=t.get("edgeShape"),h=t.get("layout"),c=t.getOrient(),p=t.get(["lineStyle","curveness"]),d=t.get("edgeForkPosition"),f=l.getModel("lineStyle").getLineStyle(),g=i.__edge;if("curve"===u)e.parentNode&&e.parentNode!==n&&(g||(g=i.__edge=new mc({shape:jP(h,c,p,r,r)})),np(g,{shape:jP(h,c,p,o,a)},t));else if("polyline"===u)if("orthogonal"===h){if(e!==n&&e.children&&0!==e.children.length&&!0===e.isExpand){for(var y=e.children,v=[],m=0;me&&(e=i.height)}this.height=e+1},t.prototype.getNodeById=function(t){if(this.getId()===t)return this;for(var e=0,n=this.children,i=n.length;e=0&&this.hostTree.data.setItemLayout(this.dataIndex,t,e)},t.prototype.getLayout=function(){return this.hostTree.data.getItemLayout(this.dataIndex)},t.prototype.getModel=function(t){if(!(this.dataIndex<0)){var e=this.hostTree,n=e.data.getItemModel(this.dataIndex);return n.getModel(t)}},t.prototype.getLevelModel=function(){return(this.hostTree.levelModels||[])[this.depth]},t.prototype.setVisual=function(t,e){this.dataIndex>=0&&this.hostTree.data.setItemVisual(this.dataIndex,t,e)},t.prototype.getVisual=function(t){return this.hostTree.data.getItemVisual(this.dataIndex,t)},t.prototype.getRawIndex=function(){return this.hostTree.data.getRawIndex(this.dataIndex)},t.prototype.getId=function(){return this.hostTree.data.getId(this.dataIndex)},t.prototype.isAncestorOf=function(t){var e=t.parentNode;while(e){if(e===this)return!0;e=e.parentNode}return!1},t.prototype.isDescendantOf=function(t){return t!==this&&t.isAncestorOf(this)},t}(),uO=function(){function t(t){this.type="tree",this._nodes=[],this.hostModel=t}return t.prototype.eachNode=function(t,e,n){this.root.eachNode(t,e,n)},t.prototype.getNodeByDataIndex=function(t){var e=this.data.getRawIndex(t);return this._nodes[e]},t.prototype.getNodeById=function(t){return this.root.getNodeById(t)},t.prototype.update=function(){for(var t=this.data,e=this._nodes,n=0,i=e.length;n=0){var i=n.getData().tree.root,r=t.targetNode;if("string"===typeof r&&(r=i.getNodeById(r)),r&&i.contains(r))return{node:r};var o=t.targetNodeId;if(null!=o&&(r=i.getNodeById(o)))return{node:r}}}function dO(t){var e=[];while(t)t=t.parentNode,t&&e.push(t);return e.reverse()}function fO(t,e){var n=dO(t);return z(n,e)>=0}function gO(t,e){var n=[];while(t){var i=t.dataIndex;n.push({name:t.name,dataIndex:i,value:e.getRawValue(i)}),t=t.parentNode}return n.reverse(),n}var yO=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.hasSymbolVisual=!0,e.ignoreStyleOnData=!0,e}return u(e,t),e.prototype.getInitialData=function(t){var e={name:t.name,children:t.data},n=t.leaves||{},i=new Kp(n,this,this.ecModel),r=cO.createTree(e,this,o);function o(t){t.wrapMethod("getItemModel",(function(t,e){var n=r.getNodeByDataIndex(e);return n&&n.children.length&&n.isExpand||(t.parentModel=i),t}))}var a=0;r.eachNode("preorder",(function(t){t.depth>a&&(a=t.depth)}));var s=t.expandAndCollapse,l=s&&t.initialTreeDepth>=0?t.initialTreeDepth:a;return r.root.eachNode("preorder",(function(t){var e=t.hostTree.data.getRawDataItem(t.dataIndex);t.isExpand=e&&null!=e.collapsed?!e.collapsed:t.depth<=l})),r.data},e.prototype.getOrient=function(){var t=this.get("orient");return"horizontal"===t?t="LR":"vertical"===t&&(t="TB"),t},e.prototype.setZoom=function(t){this.option.zoom=t},e.prototype.setCenter=function(t){this.option.center=t},e.prototype.formatTooltip=function(t,e,n){var i=this.getData().tree,r=i.root.children[0],o=i.getNodeByDataIndex(t),a=o.getValue(),s=o.name;while(o&&o!==r)s=o.parentNode.name+"."+s,o=o.parentNode;return sv("nameValue",{name:s,value:a,noValue:isNaN(a)||null==a})},e.prototype.getDataParams=function(e){var n=t.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(e);return n.treeAncestors=gO(i,this),n},e.type="series.tree",e.layoutMode="box",e.defaultOption={zlevel:0,z:2,coordinateSystem:"view",left:"12%",top:"12%",right:"12%",bottom:"12%",layout:"orthogonal",edgeShape:"curve",edgeForkPosition:"50%",roam:!1,nodeScaleRatio:.4,center:null,zoom:1,orient:"LR",symbol:"emptyCircle",symbolSize:7,expandAndCollapse:!0,initialTreeDepth:2,lineStyle:{color:"#ccc",width:1.5,curveness:.5},itemStyle:{color:"lightsteelblue",borderWidth:1.5},label:{show:!0},animationEasing:"linear",animationDuration:700,animationDurationUpdate:500},e}(Rv),vO=yO;function mO(t,e,n){var i,r=[t],o=[];while(i=r.pop())if(o.push(i),i.isExpand){var a=i.children;if(a.length)for(var s=0;s=0;o--)i.push(r[o])}}function _O(t,e){t.eachSeriesByType("tree",(function(t){wO(t,e)}))}function wO(t,e){var n=RP(t,e);t.layoutInfo=n;var i=t.get("layout"),r=0,o=0,a=null;"radial"===i?(r=2*Math.PI,o=Math.min(n.height,n.width)/2,a=PP((function(t,e){return(t.parentNode===e.parentNode?1:2)/t.depth}))):(r=n.width,o=n.height,a=PP());var s=t.getData().tree.root,l=s.children[0];if(l){DP(s),mO(l,kP,a),s.hierNode.modifier=-l.hierNode.prelim,xO(l,LP);var u=l,h=l,c=l;xO(l,(function(t){var e=t.getLayout().x;eh.getLayout().x&&(h=t),t.depth>c.depth&&(c=t)}));var p=u===h?1:a(u,h)/2,d=p-u.getLayout().x,f=0,g=0,y=0,v=0;if("radial"===i)f=r/(h.getLayout().x+p+d),g=o/(c.depth-1||1),xO(l,(function(t){y=(t.getLayout().x+d)*f,v=(t.depth-1)*g;var e=OP(y,v);t.setLayout({x:e.x,y:e.y,rawX:y,rawY:v},!0)}));else{var m=t.getOrient();"RL"===m||"LR"===m?(g=o/(h.getLayout().x+p+d),f=r/(c.depth-1||1),xO(l,(function(t){v=(t.getLayout().x+d)*g,y="LR"===m?(t.depth-1)*f:r-(t.depth-1)*f,t.setLayout({x:y,y:v},!0)}))):"TB"!==m&&"BT"!==m||(f=r/(h.getLayout().x+p+d),g=o/(c.depth-1||1),xO(l,(function(t){y=(t.getLayout().x+d)*f,v="TB"===m?(t.depth-1)*g:o-(t.depth-1)*g,t.setLayout({x:y,y:v},!0)})))}}}function bO(t){t.eachSeriesByType("tree",(function(t){var e=t.getData(),n=e.tree;n.eachNode((function(t){var n=t.getModel(),i=n.getModel("itemStyle").getItemStyle(),r=e.ensureUniqueItemVisual(t.dataIndex,"style");R(r,i)}))}))}function SO(t){t.registerAction({type:"treeExpandAndCollapse",event:"treeExpandAndCollapse",update:"update"},(function(t,e){e.eachComponent({mainType:"series",subType:"tree",query:t},(function(e){var n=t.dataIndex,i=e.getData().tree,r=i.getNodeByDataIndex(n);r.isExpand=!r.isExpand}))})),t.registerAction({type:"treeRoam",event:"treeRoam",update:"none"},(function(t,e){e.eachComponent({mainType:"series",subType:"tree",query:t},(function(e){var n=e.coordinateSystem,i=MP(n,t);e.setCenter&&e.setCenter(i.center),e.setZoom&&e.setZoom(i.zoom)}))}))}function MO(t){t.registerChartView(KP),t.registerSeriesModel(vO),t.registerLayout(_O),t.registerVisual(bO),SO(t)}var IO=function(){},TO=["treemapZoomToNode","treemapRender","treemapMove"];function CO(t){for(var e=0;e1)n=n.parentNode;var r=Qf(t.ecModel,n.name||n.dataIndex+"",i);e.setVisual("decal",r)}))}var DO=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.preventUsingHoverLayer=!0,n}return u(e,t),e.prototype.getInitialData=function(t,e){var n={name:t.name,children:t.data};kO(n);var i=t.levels||[],r=this.designatedVisualItemStyle={},o=new Kp({itemStyle:r},this,e);i=t.levels=LO(i,e);var a=H(i||[],(function(t){return new Kp(t,o,e)}),this),s=cO.createTree(n,this,l);function l(t){t.wrapMethod("getItemModel",(function(t,e){var n=s.getNodeByDataIndex(e),i=n?a[n.depth]:null;return t.parentModel=i||o,t}))}return s.data},e.prototype.optionUpdated=function(){this.resetViewRoot()},e.prototype.formatTooltip=function(t,e,n){var i=this.getData(),r=this.getRawValue(t),o=i.getName(t);return sv("nameValue",{name:o,value:r})},e.prototype.getDataParams=function(e){var n=t.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(e);return n.treePathInfo=gO(i,this),n},e.prototype.setLayoutInfo=function(t){this.layoutInfo=this.layoutInfo||{},R(this.layoutInfo,t)},e.prototype.mapIdToIndex=function(t){var e=this._idIndexMap;e||(e=this._idIndexMap=_t(),this._idIndexMapCount=0);var n=e.get(t);return null==n&&e.set(t,n=this._idIndexMapCount++),n},e.prototype.getViewRoot=function(){return this._viewRoot},e.prototype.resetViewRoot=function(t){t?this._viewRoot=t:t=this._viewRoot;var e=this.getRawData().tree.root;t&&(t===e||e.contains(t))||(this._viewRoot=e)},e.prototype.enableAriaDecal=function(){AO(this)},e.type="series.treemap",e.layoutMode="box",e.defaultOption={progressive:0,left:"center",top:"middle",width:"80%",height:"80%",sort:!0,clipWindow:"origin",squareRatio:.5*(1+Math.sqrt(5)),leafDepth:null,drillDownIcon:"▶",zoomToNodeRatio:.1024,roam:!0,nodeClick:"zoomToNode",animation:!0,animationDurationUpdate:900,animationEasing:"quinticInOut",breadcrumb:{show:!0,height:22,left:"center",top:"bottom",emptyItemWidth:25,itemStyle:{color:"rgba(0,0,0,0.7)",textStyle:{color:"#fff"}}},label:{show:!0,distance:0,padding:5,position:"inside",color:"#fff",overflow:"truncate"},upperLabel:{show:!1,position:[0,"50%"],height:20,overflow:"truncate",verticalAlign:"middle"},itemStyle:{color:null,colorAlpha:null,colorSaturation:null,borderWidth:0,gapWidth:0,borderColor:"#fff",borderColorSaturation:null},emphasis:{upperLabel:{show:!0,position:[0,"50%"],ellipsis:!0,verticalAlign:"middle"}},visualDimension:0,visualMin:null,visualMax:null,color:[],colorAlpha:null,colorSaturation:null,colorMappingBy:"index",visibleMin:10,childrenVisibleMin:null,levels:[]},e}(Rv);function kO(t){var e=0;F(t.children,(function(t){kO(t);var n=t.value;K(n)&&(n=n[0]),e+=n}));var n=t.value;K(n)&&(n=n[0]),(null==n||isNaN(n))&&(n=e),n<0&&(n=0),K(t.value)?t.value[0]=n:t.value=n}function LO(t,e){var n=uo(e.get("color")),i=uo(e.get(["aria","decal","decals"]));if(n){var r,o;t=t||[],F(t,(function(t){var e=new Kp(t),n=e.get("color"),i=e.get("decal");(e.get(["itemStyle","color"])||n&&"none"!==n)&&(r=!0),(e.get(["itemStyle","decal"])||i&&"none"!==i)&&(o=!0)}));var a=t[0]||(t[0]={});return r||(a.color=n.slice()),!o&&i&&(a.decal=i.slice()),t}}var PO=DO,OO=8,RO=8,NO=5,EO=function(){function t(t){this.group=new Ir,t.add(this.group)}return t.prototype.render=function(t,e,n,i){var r=t.getModel("breadcrumb"),o=this.group;if(o.removeAll(),r.get("show")&&n){var a=r.getModel("itemStyle"),s=a.getModel("textStyle"),l={pos:{left:r.get("left"),right:r.get("right"),top:r.get("top"),bottom:r.get("bottom")},box:{width:e.getWidth(),height:e.getHeight()},emptyItemWidth:r.get("emptyItemWidth"),totalWidth:0,renderList:[]};this._prepare(n,l,s),this._renderContent(t,l,a,s,i),ff(o,l.pos,l.box)}},t.prototype._prepare=function(t,e,n){for(var i=t;i;i=i.parentNode){var r=Mo(i.getModel().get("name"),""),o=n.getTextRect(r),a=Math.max(o.width+2*OO,e.emptyItemWidth);e.totalWidth+=a+RO,e.renderList.push({node:i,text:r,width:a})}},t.prototype._renderContent=function(t,e,n,i,r){for(var o=0,a=e.emptyItemWidth,s=t.get(["breadcrumb","height"]),l=pf(e.pos,e.box),u=e.totalWidth,h=e.renderList,c=h.length-1;c>=0;c--){var p=h[c],d=p.node,f=p.width,g=p.text;u>l.width&&(u-=f-a,f=a,g=null);var y=new ac({shape:{points:zO(o,0,f,s,c===h.length-1,0===c)},style:N(n.getItemStyle(),{lineJoin:"bevel"}),textContent:new Zl({style:{text:g,fill:i.getTextColor(),font:i.getFont()}}),textConfig:{position:"inside"},z2:1e4*iu,onclick:j(r,d)});y.disableLabelAnimation=!0,this.group.add(y),BO(y,t,d),o+=f+RO}},t.prototype.remove=function(){this.group.removeAll()},t}();function zO(t,e,n,i,r,o){var a=[[r?t:t-NO,e],[t+n,e],[t+n,e+i],[r?t:t-NO,e+i]];return!o&&a.splice(2,0,[t+n+NO,e+i/2]),!r&&a.push([t,e+i/2]),a}function BO(t,e,n){ql(t).eventData={componentType:"series",componentSubType:"treemap",componentIndex:e.componentIndex,seriesIndex:e.componentIndex,seriesName:e.name,seriesType:"treemap",selfType:"breadcrumb",nodeData:{dataIndex:n&&n.dataIndex,name:n&&n.name},treePathInfo:n&&gO(n,e)}}var VO=EO,GO=function(){function t(){this._storage=[],this._elExistsMap={}}return t.prototype.add=function(t,e,n,i,r){return!this._elExistsMap[t.id]&&(this._elExistsMap[t.id]=!0,this._storage.push({el:t,target:e,duration:n,delay:i,easing:r}),!0)},t.prototype.finished=function(t){return this._finishedCallback=t,this},t.prototype.start=function(){for(var t=this,e=this._storage.length,n=function(){e--,e<=0&&(t._storage.length=0,t._elExistsMap={},t._finishedCallback&&t._finishedCallback())},i=0,r=this._storage.length;iYO||Math.abs(t.dy)>YO)){var e=this.seriesModel.getData().tree.root;if(!e)return;var n=e.getLayout();if(!n)return;this.api.dispatchAction({type:"treemapMove",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:n.x+t.dx,y:n.y+t.dy,width:n.width,height:n.height}})}},e.prototype._onZoom=function(t){var e=t.originX,n=t.originY;if("animating"!==this._state){var i=this.seriesModel.getData().tree.root;if(!i)return;var r=i.getLayout();if(!r)return;var o=new Ji(r.x,r.y,r.width,r.height),a=this.seriesModel.layoutInfo;e-=a.x,n-=a.y;var s=bi();Ti(s,s,[-e,-n]),Ai(s,s,[t.scale,t.scale]),Ti(s,s,[e,n]),o.applyTransform(s),this.api.dispatchAction({type:"treemapRender",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:o.x,y:o.y,width:o.width,height:o.height}})}},e.prototype._initEvents=function(t){var e=this;t.on("click",(function(t){if("ready"===e._state){var n=e.seriesModel.get("nodeClick",!0);if(n){var i=e.findTarget(t.offsetX,t.offsetY);if(i){var r=i.node;if(r.getLayout().isLeafRoot)e._rootToNode(i);else if("zoomToNode"===n)e._zoomToNode(i);else if("link"===n){var o=r.hostTree.data.getItemModel(r.dataIndex),a=o.get("link",!0),s=o.get("target",!0)||"blank";a&&af(a,s)}}}}}),this)},e.prototype._renderBreadcrumb=function(t,e,n){var i=this;n||(n=null!=t.get("leafDepth",!0)?{node:t.getViewRoot()}:this.findTarget(e.getWidth()/2,e.getHeight()/2),n||(n={node:t.getData().tree.root})),(this._breadcrumb||(this._breadcrumb=new VO(this.group))).render(t,e,n.node,(function(e){"animating"!==i._state&&(fO(t.getViewRoot(),e)?i._rootToNode({node:e}):i._zoomToNode({node:e}))}))},e.prototype.remove=function(){this._clearController(),this._containerGroup&&this._containerGroup.removeAll(),this._storage=tR(),this._state="ready",this._breadcrumb&&this._breadcrumb.remove()},e.prototype.dispose=function(){this._clearController()},e.prototype._zoomToNode=function(t){this.api.dispatchAction({type:"treemapZoomToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:t.node})},e.prototype._rootToNode=function(t){this.api.dispatchAction({type:"treemapRootToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:t.node})},e.prototype.findTarget=function(t,e){var n,i=this.seriesModel.getViewRoot();return i.eachNode({attr:"viewChildren",order:"preorder"},(function(i){var r=this._storage.background[i.getRawIndex()];if(r){var o=r.transformCoordToLocal(t,e),a=r.shape;if(!(a.x<=o[0]&&o[0]<=a.x+a.width&&a.y<=o[1]&&o[1]<=a.y+a.height))return!1;n={node:i,offsetX:o[0],offsetY:o[1]}}}),this),n},e.type="treemap",e}(Uv);function tR(){return{nodeGroup:[],background:[],content:[]}}function eR(t,e,n,i,r,o,a,s,l,u){if(a){var h=a.getLayout(),c=t.getData(),p=a.getModel();if(c.setItemGraphicEl(a.dataIndex,null),h&&h.isInView){var d=h.width,f=h.height,g=h.borderWidth,y=h.invisible,v=a.getRawIndex(),m=s&&s.getRawIndex(),x=a.viewChildren,_=h.upperHeight,w=x&&x.length,b=p.getModel("itemStyle"),S=p.getModel(["emphasis","itemStyle"]),M=p.getModel(["blur","itemStyle"]),I=p.getModel(["select","itemStyle"]),T=b.get("borderRadius")||0,C=V("nodeGroup",HO);if(C){if(l.add(C),C.x=h.x||0,C.y=h.y||0,C.markRedraw(),$O(C).nodeWidth=d,$O(C).nodeHeight=f,h.isAboveViewRoot)return C;var A=V("background",WO,u,qO);A&&O(C,A,w&&h.upperLabelHeight);var D=p.get(["emphasis","focus"]),k=p.get(["emphasis","blurScope"]),L="ancestor"===D?a.getAncestorsIndices():"descendant"===D?a.getDescendantIndices():D;if(w)th(C)&&Ju(C,!1),A&&(Ju(A,!0),c.setItemGraphicEl(a.dataIndex,A),ju(A,L,k));else{var P=V("content",WO,u,jO);P&&N(C,P),A&&th(A)&&Ju(A,!1),Ju(C,!0),c.setItemGraphicEl(a.dataIndex,C),ju(C,L,k)}return C}}}function O(e,n,i){var r=ql(n);if(r.dataIndex=a.dataIndex,r.seriesIndex=t.seriesIndex,n.setShape({x:0,y:0,width:d,height:f,r:T}),y)E(n);else{n.invisible=!1;var o=a.getVisual("style"),s=o.stroke,l=QO(b);l.fill=s;var u=KO(S);u.fill=S.get("borderColor");var h=KO(M);h.fill=M.get("borderColor");var c=KO(I);if(c.fill=I.get("borderColor"),i){var p=d-2*g;z(n,s,o.opacity,{x:g,y:0,width:p,height:_})}else n.removeTextContent();n.setStyle(l),n.ensureState("emphasis").style=u,n.ensureState("blur").style=h,n.ensureState("select").style=c,Au(n)}e.add(n)}function N(e,n){var i=ql(n);i.dataIndex=a.dataIndex,i.seriesIndex=t.seriesIndex;var r=Math.max(d-2*g,0),o=Math.max(f-2*g,0);if(n.culling=!0,n.setShape({x:g,y:g,width:r,height:o,r:T}),y)E(n);else{n.invisible=!1;var s=a.getVisual("style"),l=s.fill,u=QO(b);u.fill=l,u.decal=s.decal;var h=KO(S),c=KO(M),p=KO(I);z(n,l,s.opacity,null),n.setStyle(u),n.ensureState("emphasis").style=h,n.ensureState("blur").style=c,n.ensureState("select").style=p,Au(n)}e.add(n)}function E(t){!t.invisible&&o.push(t)}function z(e,n,i,r){var o=p.getModel(r?UO:XO),s=Mo(p.get("name"),null),l=o.getShallow("show");Ip(e,Tp(p,r?UO:XO),{defaultText:l?s:null,inheritColor:n,defaultOpacity:i,labelFetcher:t,labelDataIndex:a.dataIndex});var u=e.getTextContent(),c=u.style,d=dt(c.padding||0);r&&(e.setTextConfig({layoutRect:r}),u.disableLabelLayout=!0),u.beforeUpdate=function(){var t=Math.max((r?r.width:e.shape.width)-d[1]-d[3],0),n=Math.max((r?r.height:e.shape.height)-d[0]-d[2],0);c.width===t&&c.height===n||u.setStyle({width:t,height:n})},c.truncateMinChar=2,c.lineOverflow="truncate",B(c,r,h);var f=u.getState("emphasis");B(f?f.style:null,r,h)}function B(e,n,i){var r=e?e.text:null;if(!n&&i.isLeafRoot&&null!=r){var o=t.get("drillDownIcon",!0);e.text=o?o+" "+r:r}}function V(t,i,o,a){var s=null!=m&&n[t][m],l=r[t];return s?(n[t][m]=null,G(l,s)):y||(s=new i,s instanceof za&&(s.z2=nR(o,a)),F(l,s)),e[t][v]=s}function G(t,e){var n=t[v]={};e instanceof HO?(n.oldX=e.x,n.oldY=e.y):n.oldShape=R({},e.shape)}function F(t,e){var n=t[v]={},o=a.parentNode,s=e instanceof Ir;if(o&&(!i||"drillDown"===i.direction)){var l=0,u=0,h=r.background[o.getRawIndex()];!i&&h&&h.oldShape&&(l=h.oldShape.width,u=h.oldShape.height),s?(n.oldX=0,n.oldY=u):n.oldShape={x:l,y:u,width:0,height:0}}n.fadein=!s}}function nR(t,e){return t*ZO+e}var iR=JO,rR=F,oR=et,aR=-1,sR=function(){function t(e){var n=e.mappingMethod,i=e.type,r=this.option=L(e);this.type=i,this.mappingMethod=n,this._normalizeData=xR[n];var o=t.visualHandlers[i];this.applyVisual=o.applyVisual,this.getColorMapper=o.getColorMapper,this._normalizedToVisual=o._normalizedToVisual[n],"piecewise"===n?(hR(r),lR(r)):"category"===n?r.categories?uR(r):hR(r,!0):(ft("linear"!==n||r.dataExtent),hR(r))}return t.prototype.mapValueToVisual=function(t){var e=this._normalizeData(t);return this._normalizedToVisual(e,t)},t.prototype.getNormalizer=function(){return q(this._normalizeData,this)},t.listVisualTypes=function(){return U(t.visualHandlers)},t.isValidType=function(e){return t.visualHandlers.hasOwnProperty(e)},t.eachVisual=function(t,e,n){et(t)?F(t,e,n):e.call(n,t)},t.mapVisual=function(e,n,i){var r,o=K(e)?[]:et(e)?{}:(r=!0,null);return t.eachVisual(e,(function(t,e){var a=n.call(i,t,e);r?o=a:o[e]=a})),o},t.retrieveVisuals=function(e){var n,i={};return e&&rR(t.visualHandlers,(function(t,r){e.hasOwnProperty(r)&&(i[r]=e[r],n=!0)})),n?i:null},t.prepareVisualTypes=function(t){if(K(t))t=t.slice();else{if(!oR(t))return[];var e=[];rR(t,(function(t,n){e.push(n)})),t=e}return t.sort((function(t,e){return"color"===e&&"color"!==t&&0===t.indexOf("color")?1:-1})),t},t.dependsOn=function(t,e){return"color"===e?!(!t||0!==t.indexOf(e)):t===e},t.findPieceIndex=function(t,e,n){for(var i,r=1/0,o=0,a=e.length;o=0;o--)null==i[o]&&(delete n[e[o]],e.pop())}function hR(t,e){var n=t.visual,i=[];et(n)?rR(n,(function(t){i.push(t)})):null!=n&&i.push(n);var r={color:1,symbol:1};e||1!==i.length||r.hasOwnProperty(t.type)||(i[1]=i[0]),mR(t,i)}function cR(t){return{applyVisual:function(e,n,i){var r=this.mapValueToVisual(e);i("color",t(n("color"),r))},_normalizedToVisual:yR([0,1])}}function pR(t){var e=this.option.visual;return e[Math.round(zr(t,[0,1],[0,e.length-1],!0))]||{}}function dR(t){return function(e,n,i){i(t,this.mapValueToVisual(e))}}function fR(t){var e=this.option.visual;return e[this.option.loop&&t!==aR?t%e.length:t]}function gR(){return this.option.visual[0]}function yR(t){return{linear:function(e){return zr(e,t,this.option.visual,!0)},category:fR,piecewise:function(e,n){var i=vR.call(this,n);return null==i&&(i=zr(e,t,this.option.visual,!0)),i},fixed:gR}}function vR(t){var e=this.option,n=e.pieceList;if(e.hasSpecialVisual){var i=sR.findPieceIndex(t,n),r=n[i];if(r&&r.visual)return r.visual[this.type]}}function mR(t,e){return t.visual=e,"color"===t.type&&(t.parsedVisual=H(e,(function(t){return xn(t)}))),e}var xR={linear:function(t){return zr(t,this.option.dataExtent,[0,1],!0)},piecewise:function(t){var e=this.option.pieceList,n=sR.findPieceIndex(t,e,!0);if(null!=n)return zr(n,[0,e.length-1],[0,1],!0)},category:function(t){var e=this.option.categories?this.option.categoryMap[t]:t;return null==e?aR:e},fixed:Mt};function _R(t,e,n){return t?e<=n:e=n.length||t===n[t.depth]){var o=PR(r,u,t,e,f,i);IR(t,o,n,i)}}))}else s=CR(u),h.fill=s}}function TR(t,e,n){var i=R({},e),r=n.designatedVisualItemStyle;return F(["color","colorAlpha","colorSaturation"],(function(n){r[n]=e[n];var o=t.get(n);r[n]=null,null!=o&&(i[n]=o)})),i}function CR(t){var e=DR(t,"color");if(e){var n=DR(t,"colorAlpha"),i=DR(t,"colorSaturation");return i&&(e=In(e,null,null,i)),n&&(e=Tn(e,n)),e}}function AR(t,e){return null!=e?In(e,null,null,t):null}function DR(t,e){var n=t[e];if(null!=n&&"none"!==n)return n}function kR(t,e,n,i,r,o){if(o&&o.length){var a=LR(e,"color")||null!=r.color&&"none"!==r.color&&(LR(e,"colorAlpha")||LR(e,"colorSaturation"));if(a){var s=e.get("visualMin"),l=e.get("visualMax"),u=n.dataExtent.slice();null!=s&&su[1]&&(u[1]=l);var h=e.get("colorMappingBy"),c={type:a.name,dataExtent:u,visual:a.range};"color"!==c.type||"index"!==h&&"id"!==h?c.mappingMethod="linear":(c.mappingMethod="category",c.loop=!0);var p=new wR(c);return SR(p).drColorMappingBy=h,p}}}function LR(t,e){var n=t.get(e);return K(n)&&n.length?{name:e,range:n}:null}function PR(t,e,n,i,r,o){var a=R({},e);if(r){var s=r.type,l="color"===s&&SR(r).drColorMappingBy,u="index"===l?i:"id"===l?o.mapIdToIndex(n.getId()):n.getValue(t.get("visualDimension"));a[s]=r.mapValueToVisual(u)}return a}var OR=Math.max,RR=Math.min,NR=ut,ER=F,zR=["itemStyle","borderWidth"],BR=["itemStyle","gapWidth"],VR=["upperLabel","show"],GR=["upperLabel","height"],FR={seriesType:"treemap",reset:function(t,e,n,i){var r=n.getWidth(),o=n.getHeight(),a=t.option,s=df(t.getBoxLayoutParams(),{width:n.getWidth(),height:n.getHeight()}),l=a.size||[],u=Br(NR(s.width,l[0]),r),h=Br(NR(s.height,l[1]),o),c=i&&i.type,p=["treemapZoomToNode","treemapRootToNode"],d=pO(i,p,t),f="treemapRender"===c||"treemapMove"===c?i.rootRect:null,g=t.getViewRoot(),y=dO(g);if("treemapMove"!==c){var v="treemapZoomToNode"===c?jR(t,d,g,u,h):f?[f.width,f.height]:[u,h],m=a.sort;m&&"asc"!==m&&"desc"!==m&&(m="desc");var x={squareRatio:a.squareRatio,sort:m,leafDepth:a.leafDepth};g.hostTree.clearLayouts();var _={x:0,y:0,width:v[0],height:v[1],area:v[0]*v[1]};g.setLayout(_),HR(g,x,!1,0),_=g.getLayout(),ER(y,(function(t,e){var n=(y[e+1]||g).getValue();t.setLayout(R({dataExtent:[n,n],borderWidth:0,upperHeight:0},_))}))}var w=t.getData().tree.root;w.setLayout(KR(s,f,d),!0),t.setLayoutInfo(s),QR(w,new Ji(-s.x,-s.y,r,o),y,g,0)}};function HR(t,e,n,i){var r,o;if(!t.isRemoved()){var a=t.getLayout();r=a.width,o=a.height;var s=t.getModel(),l=s.get(zR),u=s.get(BR)/2,h=$R(s),c=Math.max(l,h),p=l-u,d=c-u;t.setLayout({borderWidth:l,upperHeight:c,upperLabelHeight:h},!0),r=OR(r-2*p,0),o=OR(o-p-d,0);var f=r*o,g=WR(t,s,f,e,n,i);if(g.length){var y={x:p,y:d,width:r,height:o},v=RR(r,o),m=1/0,x=[];x.area=0;for(var _=0,w=g.length;_=0;l--){var u=r["asc"===i?a-l-1:l].getValue();u/n*ea[1]&&(a[1]=e)}))):a=[NaN,NaN],{sum:i,dataExtent:a}}function ZR(t,e,n){for(var i=0,r=1/0,o=0,a=void 0,s=t.length;oi&&(i=a));var l=t.area*t.area,u=e*e*n;return l?OR(u*i/l,l/(u*r)):1/0}function qR(t,e,n,i,r){var o=e===n.width?0:1,a=1-o,s=["x","y"],l=["width","height"],u=n[s[o]],h=e?t.area/e:0;(r||h>n[l[a]])&&(h=n[l[a]]);for(var c=0,p=t.length;cUr&&(u=Ur),a=o}ui&&(i=e);var o=i%2?i+2:i+3;r=[];for(var a=0;a0&&(m[0]=-m[0],m[1]=-m[1]);var _=v[0]<0?-1:1;if("start"!==i.__position&&"end"!==i.__position){var w=-Math.atan2(v[1],v[0]);u[0].8?"left":h[0]<-.8?"right":"center",p=h[1]>.8?"top":h[1]<-.8?"bottom":"middle";break;case"start":i.x=-h[0]*f+l[0],i.y=-h[1]*g+l[1],c=h[0]>.8?"right":h[0]<-.8?"left":"center",p=h[1]>.8?"bottom":h[1]<-.8?"top":"middle";break;case"insideStartTop":case"insideStart":case"insideStartBottom":i.x=f*_+l[0],i.y=l[1]+b,c=v[0]<0?"right":"left",i.originX=-f*_,i.originY=-b;break;case"insideMiddleTop":case"insideMiddle":case"insideMiddleBottom":case"middle":i.x=x[0],i.y=x[1]+b,c="center",i.originY=-b;break;case"insideEndTop":case"insideEnd":case"insideEndBottom":i.x=-f*_+u[0],i.y=u[1]+b,c=v[0]>=0?"right":"left",i.originX=f*_,i.originY=-b;break}i.scaleX=i.scaleY=r,i.setStyle({verticalAlign:i.__verticalAlign||p,align:i.__align||c})}}}function S(t,e){var n=t.__specifiedRotation;if(null==n){var i=a.tangentAt(e);t.attr("rotation",(1===e?-1:1)*Math.PI/2-Math.atan2(i[1],i[0]))}else t.attr("rotation",n)}},e}(Ir),HN=FN,WN=function(){function t(t){this.group=new Ir,this._LineCtor=t||HN}return t.prototype.isPersistent=function(){return!0},t.prototype.updateData=function(t){var e=this,n=this,i=n.group,r=n._lineData;n._lineData=t,r||i.removeAll();var o=XN(t);t.diff(r).add((function(n){e._doAdd(t,n,o)})).update((function(n,i){e._doUpdate(r,t,i,n,o)})).remove((function(t){i.remove(r.getItemGraphicEl(t))})).execute()},t.prototype.updateLayout=function(){var t=this._lineData;t&&t.eachItemGraphicEl((function(e,n){e.updateLayout(t,n)}),this)},t.prototype.incrementalPrepareUpdate=function(t){this._seriesScope=XN(t),this._lineData=null,this.group.removeAll()},t.prototype.incrementalUpdate=function(t,e){function n(t){t.isGroup||YN(t)||(t.incremental=!0,t.ensureState("emphasis").hoverLayer=!0)}for(var i=t.start;i0}function XN(t){var e=t.hostModel;return{lineStyle:e.getModel("lineStyle").getLineStyle(),emphasisLineStyle:e.getModel(["emphasis","lineStyle"]).getLineStyle(),blurLineStyle:e.getModel(["blur","lineStyle"]).getLineStyle(),selectLineStyle:e.getModel(["select","lineStyle"]).getLineStyle(),labelStatesModels:Tp(e)}}function UN(t){return isNaN(t[0])||isNaN(t[1])}function ZN(t){return!UN(t[0])&&!UN(t[1])}var qN=WN,jN=[],KN=[],QN=[],$N=ns,JN=Vt,tE=Math.abs;function eE(t,e,n){for(var i,r=t[0],o=t[1],a=t[2],s=1/0,l=n*n,u=.1,h=.1;h<=.9;h+=.1){jN[0]=$N(r[0],o[0],a[0],h),jN[1]=$N(r[1],o[1],a[1],h);var c=tE(JN(jN,e)-l);c=0?i+=u:i-=u:f>=0?i-=u:i+=u}return i}function nE(t,e){var n=[],i=as,r=[[],[],[]],o=[[],[]],a=[];e/=2,t.eachEdge((function(t,s){var l=t.getLayout(),u=t.getVisual("fromSymbol"),h=t.getVisual("toSymbol");l.__original||(l.__original=[Ct(l[0]),Ct(l[1])],l[2]&&l.__original.push(Ct(l[2])));var c=l.__original;if(null!=l[2]){if(Tt(r[0],c[0]),Tt(r[1],c[2]),Tt(r[2],c[1]),u&&"none"!==u){var p=xN(t.node1),d=eE(r,c[0],p*e);i(r[0][0],r[1][0],r[2][0],d,n),r[0][0]=n[3],r[1][0]=n[4],i(r[0][1],r[1][1],r[2][1],d,n),r[0][1]=n[3],r[1][1]=n[4]}if(h&&"none"!==h){p=xN(t.node2),d=eE(r,c[1],p*e);i(r[0][0],r[1][0],r[2][0],d,n),r[1][0]=n[1],r[2][0]=n[2],i(r[0][1],r[1][1],r[2][1],d,n),r[1][1]=n[1],r[2][1]=n[2]}Tt(l[0],r[0]),Tt(l[1],r[2]),Tt(l[2],r[1])}else{if(Tt(o[0],c[0]),Tt(o[1],c[1]),Lt(a,o[1],o[0]),Nt(a,a),u&&"none"!==u){p=xN(t.node1);kt(o[0],o[0],a,p*e)}if(h&&"none"!==h){p=xN(t.node2);kt(o[1],o[1],a,-p*e)}Tt(l[0],o[0]),Tt(l[1],o[1])}}))}function iE(t){return"view"===t.type}var rE=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return u(e,t),e.prototype.init=function(t,e){var n=new LC,i=new qN,r=this.group;this._controller=new BL(e.getZr()),this._controllerHost={target:r},r.add(n.group),r.add(i.group),this._symbolDraw=n,this._lineDraw=i,this._firstRender=!0},e.prototype.render=function(t,e,n){var i=this,r=t.coordinateSystem;this._model=t;var o=this._symbolDraw,a=this._lineDraw,s=this.group;if(iE(r)){var l={x:r.x,y:r.y,scaleX:r.scaleX,scaleY:r.scaleY};this._firstRender?s.attr(l):np(s,l,t)}nE(t.getGraph(),mN(t));var u=t.getData();o.updateData(u);var h=t.getEdgeData();a.updateData(h),this._updateNodeAndLinkScale(),this._updateController(t,e,n),clearTimeout(this._layoutTimeout);var c=t.forceLayout,p=t.get(["force","layoutAnimation"]);c&&this._startForceLayoutIteration(c,p),u.graph.eachNode((function(t){var e=t.dataIndex,n=t.getGraphicEl(),r=t.getModel();n.off("drag").off("dragend");var o=r.get("draggable");o&&n.on("drag",(function(){c&&(c.warmUp(),!i._layouting&&i._startForceLayoutIteration(c,p),c.setFixed(e),u.setItemLayout(e,[n.x,n.y]))})).on("dragend",(function(){c&&c.setUnfixed(e)})),n.setDraggable(o&&!!c);var a=r.get(["emphasis","focus"]);"adjacency"===a&&(ql(n).focus=t.getAdjacentDataIndices())})),u.graph.eachEdge((function(t){var e=t.getGraphicEl(),n=t.getModel().get(["emphasis","focus"]);"adjacency"===n&&(ql(e).focus={edge:[t.dataIndex],node:[t.node1.dataIndex,t.node2.dataIndex]})}));var d="circular"===t.get("layout")&&t.get(["circular","rotateLabel"]),f=u.getLayout("cx"),g=u.getLayout("cy");u.eachItemGraphicEl((function(t,e){var n=u.getItemModel(e),i=n.get(["label","rotate"])||0,r=t.getSymbolPath();if(d){var o=u.getItemLayout(e),a=Math.atan2(o[1]-g,o[0]-f);a<0&&(a=2*Math.PI+a);var s=o[0]=0&&t.call(e,n[r],r)},t.prototype.eachEdge=function(t,e){for(var n=this.edges,i=n.length,r=0;r=0&&n[r].node1.dataIndex>=0&&n[r].node2.dataIndex>=0&&t.call(e,n[r],r)},t.prototype.breadthFirstTraverse=function(t,e,n,i){if(e instanceof lE||(e=this._nodesMap[aE(e)]),e){for(var r="out"===n?"outEdges":"in"===n?"inEdges":"edges",o=0;o=0&&n.node2.dataIndex>=0}));for(r=0,o=i.length;r=0&&this[t][e].setItemVisual(this.dataIndex,n,i)},getVisual:function(n){return this[t][e].getItemVisual(this.dataIndex,n)},setLayout:function(n,i){this.dataIndex>=0&&this[t][e].setItemLayout(this.dataIndex,n,i)},getLayout:function(){return this[t][e].getItemLayout(this.dataIndex)},getGraphicEl:function(){return this[t][e].getItemGraphicEl(this.dataIndex)},getRawIndex:function(){return this[t][e].getRawIndex(this.dataIndex)}}}V(lE,hE("hostGraph","data")),V(uE,hE("hostGraph","edgeData"));var cE=sE;function pE(t,e,n,i,r){for(var o=new cE(i),a=0;a "+p)),u++)}var d,f=n.get("coordinateSystem");if("cartesian2d"===f||"polar"===f)d=_M(t,n);else{var g=_g.get(f),y=g&&g.dimensions||[];z(y,"value")<0&&y.concat(["value"]);var v=uM(t,{coordDimensions:y});d=new rM(v,n),d.initData(t)}var m=new rM(["value"],n);return m.initData(l,s),r&&r(d,m),sO({mainData:d,struct:o,structAttr:"graph",datas:{node:d,edge:m},datasAttr:{node:"data",edge:"edgeData"}}),o.update(),o}var dE=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.hasSymbolVisual=!0,n}return u(e,t),e.prototype.init=function(e){t.prototype.init.apply(this,arguments);var n=this;function i(){return n._categoriesData}this.legendVisualProvider=new dD(i,i),this.fillDataTextStyle(e.edges||e.links),this._updateCategoriesData()},e.prototype.mergeOption=function(e){t.prototype.mergeOption.apply(this,arguments),this.fillDataTextStyle(e.edges||e.links),this._updateCategoriesData()},e.prototype.mergeDefaultAndTheme=function(e){t.prototype.mergeDefaultAndTheme.apply(this,arguments),ho(e,"edgeLabel",["show"])},e.prototype.getInitialData=function(t,e){var n=t.edges||t.links||[],i=t.data||t.nodes||[],r=this;if(i&&n){pN(this);var o=pE(i,n,this,!0,a);return F(o.edges,(function(t){dN(t.node1,t.node2,this,t.dataIndex)}),this),o.data}function a(t,e){t.wrapMethod("getItemModel",(function(t){var e=r._categoriesModels,n=t.getShallow("category"),i=e[n];return i&&(i.parentModel=t.parentModel,t.parentModel=i),t}));var n=Kp.prototype.getModel;function i(t,e){var i=n.call(this,t,e);return i.resolveParentPath=o,i}function o(t){if(t&&("label"===t[0]||"label"===t[1])){var e=t.slice();return"label"===t[0]?e[0]="edgeLabel":"label"===t[1]&&(e[1]="edgeLabel"),e}return t}e.wrapMethod("getItemModel",(function(t){return t.resolveParentPath=o,t.getModel=i,t}))}},e.prototype.getGraph=function(){return this.getData().graph},e.prototype.getEdgeData=function(){return this.getGraph().edgeData},e.prototype.getCategoriesData=function(){return this._categoriesData},e.prototype.formatTooltip=function(t,e,n){if("edge"===n){var i=this.getData(),r=this.getDataParams(t,n),o=i.graph.getEdgeByIndex(t),a=i.getName(o.node1.dataIndex),s=i.getName(o.node2.dataIndex),l=[];return null!=a&&l.push(a),null!=s&&l.push(s),sv("nameValue",{name:l.join(" > "),value:r.value,noValue:null==r.value})}var u=wv({series:this,dataIndex:t,multipleSeries:e});return u},e.prototype._updateCategoriesData=function(){var t=H(this.option.categories||[],(function(t){return null!=t.value?t:R({value:0},t)})),e=new rM(["value"],this);e.initData(t),this._categoriesData=e,this._categoriesModels=e.mapArray((function(t){return e.getItemModel(t)}))},e.prototype.setZoom=function(t){this.option.zoom=t},e.prototype.setCenter=function(t){this.option.center=t},e.prototype.isAnimationEnabled=function(){return t.prototype.isAnimationEnabled.call(this)&&!("force"===this.get("layout")&&this.get(["force","layoutAnimation"]))},e.type="series.graph",e.dependencies=["grid","polar","geo","singleAxis","calendar"],e.defaultOption={zlevel:0,z:2,coordinateSystem:"view",legendHoverLink:!0,layout:null,circular:{rotateLabel:!1},force:{initLayout:null,repulsion:[0,50],gravity:.1,friction:.6,edgeLength:30,layoutAnimation:!0},left:"center",top:"center",symbol:"circle",symbolSize:10,edgeSymbol:["none","none"],edgeSymbolSize:10,edgeLabel:{position:"middle",distance:5},draggable:!1,roam:!1,center:null,zoom:1,nodeScaleRatio:.6,label:{show:!1,formatter:"{b}"},itemStyle:{},lineStyle:{color:"#aaa",width:1,opacity:.5},emphasis:{scale:!0,label:{show:!0}},select:{itemStyle:{borderColor:"#212121"}}},e}(Rv),fE=dE,gE={type:"graphRoam",event:"graphRoam",update:"none"};function yE(t){t.registerChartView(oE),t.registerSeriesModel(fE),t.registerProcessor(tN),t.registerVisual(eN),t.registerVisual(iN),t.registerLayout(vN),t.registerLayout(t.PRIORITY.VISUAL.POST_CHART_LAYOUT,MN),t.registerLayout(CN),t.registerCoordinateSystem("graphView",{dimensions:pP.dimensions,create:DN}),t.registerAction({type:"focusNodeAdjacency",event:"focusNodeAdjacency",update:"series:focusNodeAdjacency"},(function(){})),t.registerAction({type:"unfocusNodeAdjacency",event:"unfocusNodeAdjacency",update:"series:unfocusNodeAdjacency"},(function(){})),t.registerAction(gE,(function(t,e){e.eachComponent({mainType:"series",query:t},(function(e){var n=e.coordinateSystem,i=MP(n,t);e.setCenter&&e.setCenter(i.center),e.setZoom&&e.setZoom(i.zoom)}))}))}var vE=function(){function t(){this.angle=0,this.width=10,this.r=10,this.x=0,this.y=0}return t}(),mE=function(t){function e(e){var n=t.call(this,e)||this;return n.type="pointer",n}return u(e,t),e.prototype.getDefaultShape=function(){return new vE},e.prototype.buildPath=function(t,e){var n=Math.cos,i=Math.sin,r=e.r,o=e.width,a=e.angle,s=e.x-n(a)*o*(o>=r/3?1:2),l=e.y-i(a)*o*(o>=r/3?1:2);a=e.angle-Math.PI/2,t.moveTo(s,l),t.lineTo(e.x+n(a)*o,e.y+i(a)*o),t.lineTo(e.x+n(e.angle)*r,e.y+i(e.angle)*r),t.lineTo(e.x-n(a)*o,e.y-i(a)*o),t.lineTo(s,l)},e}(yl),xE=mE;function _E(t,e){var n=t.get("center"),i=e.getWidth(),r=e.getHeight(),o=Math.min(i,r),a=Br(n[0],e.getWidth()),s=Br(n[1],e.getHeight()),l=Br(t.get("radius"),o/2);return{cx:a,cy:s,r:l}}function wE(t,e){var n=null==t?"":t+"";return e&&("string"===typeof e?n=e.replace("{value}",n):"function"===typeof e&&(n=e(t))),n}var bE=2*Math.PI,SE=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return u(e,t),e.prototype.render=function(t,e,n){this.group.removeAll();var i=t.get(["axisLine","lineStyle","color"]),r=_E(t,n);this._renderMain(t,e,n,i,r),this._data=t.getData()},e.prototype.dispose=function(){},e.prototype._renderMain=function(t,e,n,i,r){for(var o=this.group,a=t.get("clockwise"),s=-t.get("startAngle")/180*Math.PI,l=-t.get("endAngle")/180*Math.PI,u=t.getModel("axisLine"),h=u.get("roundCap"),c=h?TA:Kh,p=u.get("show"),d=u.getModel("lineStyle"),f=d.get("width"),g=(l-s)%bE||l===s?(l-s)%bE:bE,y=s,v=0;p&&v=t&&(0===e?0:i[e-1][0]).8?"bottom":"middle",align:u<-.4?"left":u>.4?"right":"center"},{inheritColor:R}),silent:!0}))}if(m.get("show")&&k!==_){L=m.get("distance");L=L?L+l:l;for(var N=0;N<=w;N++){u=Math.cos(M),h=Math.sin(M);var E=new dc({shape:{x1:u*(f-L)+p,y1:h*(f-L)+d,x2:u*(f-S-L)+p,y2:h*(f-S-L)+d},silent:!0,style:A});"auto"===A.stroke&&E.setStyle({stroke:i((k+N/w)/_)}),c.add(E),M+=T}M-=T}else M+=I}},e.prototype._renderPointer=function(t,e,n,i,r,o,a,s,l){var u=this.group,h=this._data,c=this._progressEls,p=[],d=t.get(["pointer","show"]),f=t.getModel("progress"),g=f.get("show"),y=t.getData(),v=y.mapDimension("value"),m=+t.get("min"),x=+t.get("max"),_=[m,x],w=[o,a];function b(e,n){var i,o=y.getItemModel(e),a=o.getModel("pointer"),s=Br(a.get("width"),r.r),l=Br(a.get("length"),r.r),u=t.get(["pointer","icon"]),h=a.get("offsetCenter"),c=Br(h[0],r.r),p=Br(h[1],r.r),d=a.get("keepAspect");return i=u?Hx(u,c-s/2,p-l,s,l,null,d):new xE({shape:{angle:-Math.PI/2,width:s,r:l,x:c,y:p}}),i.rotation=-(n+Math.PI/2),i.x=r.cx,i.y=r.cy,i}function S(t,e){var n=f.get("roundCap"),i=n?TA:Kh,a=f.get("overlap"),u=a?f.get("width"):l/y.count(),h=a?r.r-u:r.r-(t+1)*u,c=a?r.r:r.r-t*u,p=new i({shape:{startAngle:o,endAngle:e,cx:r.cx,cy:r.cy,clockwise:s,r0:h,r:c}});return a&&(p.z2=x-y.get(v,t)%x),p}(g||d)&&(y.diff(h).add((function(e){if(d){var n=b(e,o);ip(n,{rotation:-(zr(y.get(v,e),_,w,!0)+Math.PI/2)},t),u.add(n),y.setItemGraphicEl(e,n)}if(g){var i=S(e,o),r=f.get("clip");ip(i,{shape:{endAngle:zr(y.get(v,e),_,w,r)}},t),u.add(i),p[e]=i}})).update((function(e,n){if(d){var i=h.getItemGraphicEl(n),r=i?i.rotation:o,a=b(e,r);a.rotation=r,np(a,{rotation:-(zr(y.get(v,e),_,w,!0)+Math.PI/2)},t),u.add(a),y.setItemGraphicEl(e,a)}if(g){var s=c[n],l=s?s.shape.endAngle:o,m=S(e,l),x=f.get("clip");np(m,{shape:{endAngle:zr(y.get(v,e),_,w,x)}},t),u.add(m),p[e]=m}})).execute(),y.each((function(t){var e=y.getItemModel(t),n=e.getModel("emphasis");if(d){var r=y.getItemGraphicEl(t),o=y.getItemVisual(t,"style"),a=o.fill;if(r instanceof Ml){var s=r.style;r.useStyle(R({image:s.image,x:s.x,y:s.y,width:s.width,height:s.height},o))}else r.useStyle(o),"pointer"!==r.type&&r.setColor(a);r.setStyle(e.getModel(["pointer","itemStyle"]).getItemStyle()),"auto"===r.style.fill&&r.setStyle("fill",i(zr(y.get(v,t),_,[0,1],!0))),r.z2EmphasisLift=0,$u(r,e),qu(r,n.get("focus"),n.get("blurScope"))}if(g){var l=p[t];l.useStyle(y.getItemVisual(t,"style")),l.setStyle(e.getModel(["progress","itemStyle"]).getItemStyle()),l.z2EmphasisLift=0,$u(l,e),qu(l,n.get("focus"),n.get("blurScope"))}})),this._progressEls=p)},e.prototype._renderAnchor=function(t,e){var n=t.getModel("anchor"),i=n.get("show");if(i){var r=n.get("size"),o=n.get("icon"),a=n.get("offsetCenter"),s=n.get("keepAspect"),l=Hx(o,e.cx-r/2+Br(a[0],e.r),e.cy-r/2+Br(a[1],e.r),r,r,null,s);l.z2=n.get("showAbove")?1:0,l.setStyle(n.getModel("itemStyle").getItemStyle()),this.group.add(l)}},e.prototype._renderTitleAndDetail=function(t,e,n,i,r){var o=this,a=t.getData(),s=a.mapDimension("value"),l=+t.get("min"),u=+t.get("max"),h=new Ir,c=[],p=[],d=t.isAnimationEnabled();a.diff(this._data).add((function(t){c[t]=new Zl({silent:!0}),p[t]=new Zl({silent:!0})})).update((function(t,e){c[t]=o._titleEls[e],p[t]=o._detailEls[e]})).execute(),a.each((function(e){var n=a.getItemModel(e),o=a.get(s,e),f=new Ir,g=i(zr(o,[l,u],[0,1],!0)),y=n.getModel("title");if(y.get("show")){var v=y.get("offsetCenter"),m=r.cx+Br(v[0],r.r),x=r.cy+Br(v[1],r.r),_=c[e];_.attr({style:Cp(y,{x:m,y:x,text:a.getName(e),align:"center",verticalAlign:"middle"},{inheritColor:g})}),f.add(_)}var w=n.getModel("detail");if(w.get("show")){var b=w.get("offsetCenter"),S=r.cx+Br(b[0],r.r),M=r.cy+Br(b[1],r.r),I=Br(w.get("width"),r.r),T=Br(w.get("height"),r.r),C=t.get(["progress","show"])?a.getItemVisual(e,"style").fill:g,A=(_=p[e],w.get("formatter"));_.attr({style:Cp(w,{x:S,y:M,text:wE(o,A),width:isNaN(I)?null:I,height:isNaN(T)?null:T,align:"center",verticalAlign:"middle"},{inheritColor:C})}),zp(_,{normal:w},o,(function(t){return wE(t,A)})),d&&Bp(_,e,a,t,{getFormattedLabel:function(t,e,n,i,r,a){return wE(a?a.interpolatedValue:o,A)}}),f.add(_)}h.add(f)})),this.group.add(h),this._titleEls=c,this._detailEls=p},e.type="gauge",e}(Uv),ME=SE,IE=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.visualStyleAccessPath="itemStyle",n.useColorPaletteOnData=!0,n}return u(e,t),e.prototype.getInitialData=function(t,e){return cD(this,["value"])},e.type="series.gauge",e.defaultOption={zlevel:0,z:2,center:["50%","50%"],legendHoverLink:!0,radius:"75%",startAngle:225,endAngle:-45,clockwise:!0,min:0,max:100,splitNumber:10,axisLine:{show:!0,roundCap:!1,lineStyle:{color:[[1,"#E6EBF8"]],width:10}},progress:{show:!1,overlap:!0,width:10,roundCap:!1,clip:!0},splitLine:{show:!0,length:10,distance:10,lineStyle:{color:"#63677A",width:3,type:"solid"}},axisTick:{show:!0,splitNumber:5,length:6,distance:10,lineStyle:{color:"#63677A",width:1,type:"solid"}},axisLabel:{show:!0,distance:15,color:"#464646",fontSize:12},pointer:{icon:null,offsetCenter:[0,0],show:!0,length:"60%",width:6,keepAspect:!1},anchor:{show:!1,showAbove:!1,size:6,icon:"circle",offsetCenter:[0,0],keepAspect:!1,itemStyle:{color:"#fff",borderWidth:0,borderColor:"#5470c6"}},title:{show:!0,offsetCenter:[0,"20%"],color:"#464646",fontSize:16,valueAnimation:!1},detail:{show:!0,backgroundColor:"rgba(0,0,0,0)",borderWidth:0,borderColor:"#ccc",width:100,height:null,padding:[5,10],offsetCenter:[0,"40%"],color:"#464646",fontSize:30,fontWeight:"bold",lineHeight:30,valueAnimation:!1}},e}(Rv),TE=IE;function CE(t){t.registerChartView(ME),t.registerSeriesModel(TE)}var AE=["itemStyle","opacity"],DE=function(t){function e(e,n){var i=t.call(this)||this,r=i,o=new uc,a=new Zl;return r.setTextContent(a),i.setTextGuideLine(o),i.updateData(e,n,!0),i}return u(e,t),e.prototype.updateData=function(t,e,n){var i=this,r=t.hostModel,o=t.getItemModel(e),a=t.getItemLayout(e),s=o.getModel("emphasis"),l=o.get(AE);l=null==l?1:l,i.useStyle(t.getItemVisual(e,"style")),i.style.lineJoin="round",n?(i.setShape({points:a.points}),i.style.opacity=0,ip(i,{style:{opacity:l}},r,e)):np(i,{style:{opacity:l},shape:{points:a.points}},r,e),$u(i,o),this._updateLabel(t,e),qu(this,s.get("focus"),s.get("blurScope"))},e.prototype._updateLabel=function(t,e){var n=this,i=this.getTextGuideLine(),r=n.getTextContent(),o=t.hostModel,a=t.getItemModel(e),s=t.getItemLayout(e),l=s.label,u=t.getItemVisual(e,"style"),h=u.fill;Ip(r,Tp(a),{labelFetcher:t.hostModel,labelDataIndex:e,defaultOpacity:u.opacity,defaultText:t.getName(e)},{normal:{align:l.textAlign,verticalAlign:l.verticalAlign}}),n.setTextConfig({local:!0,inside:!!l.inside,insideStroke:h,outsideFill:h});var c=l.linePoints;i.setShape({points:c}),n.textGuideLineConfig={anchor:c?new Wi(c[0][0],c[0][1]):null},np(r,{style:{x:l.x,y:l.y}},o,e),r.attr({rotation:l.rotation,originX:l.x,originY:l.y,z2:10}),lx(n,ux(a),{stroke:h})},e}(ac),kE=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.ignoreLabelLineUpdate=!0,n}return u(e,t),e.prototype.render=function(t,e,n){var i=t.getData(),r=this._data,o=this.group;i.diff(r).add((function(t){var e=new DE(i,t);i.setItemGraphicEl(t,e),o.add(e)})).update((function(t,e){var n=r.getItemGraphicEl(e);n.updateData(i,t),o.add(n),i.setItemGraphicEl(t,n)})).remove((function(e){var n=r.getItemGraphicEl(e);ap(n,t,e)})).execute(),this._data=i},e.prototype.remove=function(){this.group.removeAll(),this._data=null},e.prototype.dispose=function(){},e.type="funnel",e}(Uv),LE=kE,PE=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.useColorPaletteOnData=!0,n}return u(e,t),e.prototype.init=function(e){t.prototype.init.apply(this,arguments),this.legendVisualProvider=new dD(q(this.getData,this),q(this.getRawData,this)),this._defaultLabelLine(e)},e.prototype.getInitialData=function(t,e){return cD(this,{coordDimensions:["value"],encodeDefaulter:j(Gf,this)})},e.prototype._defaultLabelLine=function(t){ho(t,"labelLine",["show"]);var e=t.labelLine,n=t.emphasis.labelLine;e.show=e.show&&t.label.show,n.show=n.show&&t.emphasis.label.show},e.prototype.getDataParams=function(e){var n=this.getData(),i=t.prototype.getDataParams.call(this,e),r=n.mapDimension("value"),o=n.getSum(r);return i.percent=o?+(n.get(r,e)/o*100).toFixed(2):0,i.$vars.push("percent"),i},e.type="series.funnel",e.defaultOption={zlevel:0,z:2,legendHoverLink:!0,left:80,top:60,right:80,bottom:60,minSize:"0%",maxSize:"100%",sort:"descending",orient:"vertical",gap:0,funnelAlign:"center",label:{show:!0,position:"outer"},labelLine:{show:!0,length:20,lineStyle:{width:1}},itemStyle:{borderColor:"#fff",borderWidth:1},emphasis:{label:{show:!0}},select:{itemStyle:{borderColor:"#212121"}}},e}(Rv),OE=PE;function RE(t,e){return df(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function NE(t,e){for(var n=t.mapDimension("value"),i=t.mapArray(n,(function(t){return t})),r=[],o="ascending"===e,a=0,s=t.count();arz)return;var r=this._model.coordinateSystem.getSlidedAxisExpandWindow([t.offsetX,t.offsetY]);"none"!==r.behavior&&this._dispatchExpand({axisExpandWindow:r.axisExpandWindow})}this._mouseDownPoint=null},mousemove:function(t){if(!this._mouseDownPoint&&sz(this,"mousemove")){var e=this._model,n=e.coordinateSystem.getSlidedAxisExpandWindow([t.offsetX,t.offsetY]),i=n.behavior;"jump"===i&&this._throttledDispatchExpand.debounceNextCall(e.get("axisExpandDebounce")),this._throttledDispatchExpand("none"===i?null:{axisExpandWindow:n.axisExpandWindow,animation:"jump"===i?null:{duration:0}})}}};function sz(t,e){var n=t._model;return n.get("axisExpandable")&&n.get("axisExpandTriggerOn")===e}var lz=oz,uz=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return u(e,t),e.prototype.init=function(){t.prototype.init.apply(this,arguments),this.mergeOption({})},e.prototype.mergeOption=function(t){var e=this.option;t&&P(e,t,!0),this._initDimensions()},e.prototype.contains=function(t,e){var n=t.get("parallelIndex");return null!=n&&e.getComponent("parallel",n)===this},e.prototype.setAxisExpand=function(t){F(["axisExpandable","axisExpandCenter","axisExpandCount","axisExpandWidth","axisExpandWindow"],(function(e){t.hasOwnProperty(e)&&(this.option[e]=t[e])}),this)},e.prototype._initDimensions=function(){var t=this.dimensions=[],e=this.parallelAxisIndex=[],n=Y(this.ecModel.queryComponents({mainType:"parallelAxis"}),(function(t){return(t.get("parallelIndex")||0)===this.componentIndex}),this);F(n,(function(n){t.push("dim"+n.get("dim")),e.push(n.componentIndex)}))},e.type="parallel",e.dependencies=["parallelAxis"],e.layoutMode="box",e.defaultOption={zlevel:0,z:0,left:80,top:60,right:80,bottom:60,layout:"horizontal",axisExpandable:!1,axisExpandCenter:null,axisExpandCount:0,axisExpandWidth:50,axisExpandRate:17,axisExpandDebounce:50,axisExpandSlideTriggerArea:[-.15,.05,.4],axisExpandTriggerOn:"click",parallelAxisDefault:null},e}(Sf),hz=uz,cz=function(t){function e(e,n,i,r,o){var a=t.call(this,e,n,i)||this;return a.type=r||"value",a.axisIndex=o,a}return u(e,t),e.prototype.isHorizontal=function(){return"horizontal"!==this.coordinateSystem.getModel().get("layout")},e}(uk),pz=cz;function dz(t,e,n,i,r,o){t=t||0;var a=n[1]-n[0];if(null!=r&&(r=gz(r,[0,a])),null!=o&&(o=Math.max(o,null!=r?r:0)),"all"===i){var s=Math.abs(e[1]-e[0]);s=gz(s,[0,a]),r=o=gz(s,[r,o]),i=0}e[0]=gz(e[0],n),e[1]=gz(e[1],n);var l=fz(e,i);e[i]+=t;var u,h=r||0,c=n.slice();return l.sign<0?c[0]+=h:c[1]-=h,e[i]=gz(e[i],c),u=fz(e,i),null!=r&&(u.sign!==l.sign||u.spano&&(e[1-i]=e[i]+u.sign*o),e}function fz(t,e){var n=t[e]-t[1-e];return{span:Math.abs(n),sign:n>0?-1:n<0?1:e?-1:1}}function gz(t,e){return Math.min(null!=e[1]?e[1]:1/0,Math.max(null!=e[0]?e[0]:-1/0,t))}var yz=F,vz=Math.min,mz=Math.max,xz=Math.floor,_z=Math.ceil,wz=Vr,bz=Math.PI,Sz=function(){function t(t,e,n){this.type="parallel",this._axesMap=_t(),this._axesLayout={},this.dimensions=t.dimensions,this._model=t,this._init(t,e,n)}return t.prototype._init=function(t,e,n){var i=t.dimensions,r=t.parallelAxisIndex;yz(i,(function(t,n){var i=r[n],o=e.getComponent("parallelAxis",i),a=this._axesMap.set(t,new pz(t,PI(o),[0,0],o.get("type"),i)),s="category"===a.type;a.onBand=s&&o.get("boundaryGap"),a.inverse=o.get("inverse"),o.axis=a,a.model=o,a.coordinateSystem=o.coordinateSystem=this}),this)},t.prototype.update=function(t,e){this._updateAxesFromSeries(this._model,t)},t.prototype.containPoint=function(t){var e=this._makeLayoutInfo(),n=e.axisBase,i=e.layoutBase,r=e.pixelDimIndex,o=t[1-r],a=t[r];return o>=n&&o<=n+e.axisLength&&a>=i&&a<=i+e.layoutLength},t.prototype.getModel=function(){return this._model},t.prototype._updateAxesFromSeries=function(t,e){e.eachSeries((function(n){if(t.contains(n,e)){var i=n.getData();yz(this.dimensions,(function(t){var e=this._axesMap.get(t);e.scale.unionExtentFromData(i,i.mapDimension(t)),LI(e.scale,e.model)}),this)}}),this)},t.prototype.resize=function(t,e){this._rect=df(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()}),this._layoutAxes()},t.prototype.getRect=function(){return this._rect},t.prototype._makeLayoutInfo=function(){var t,e=this._model,n=this._rect,i=["x","y"],r=["width","height"],o=e.get("layout"),a="horizontal"===o?0:1,s=n[r[a]],l=[0,s],u=this.dimensions.length,h=Mz(e.get("axisExpandWidth"),l),c=Mz(e.get("axisExpandCount")||0,[0,u]),p=e.get("axisExpandable")&&u>3&&u>c&&c>1&&h>0&&s>0,d=e.get("axisExpandWindow");if(d)t=Mz(d[1]-d[0],l),d[1]=d[0]+t;else{t=Mz(h*(c-1),l);var f=e.get("axisExpandCenter")||xz(u/2);d=[h*f-t/2],d[1]=d[0]+t}var g=(s-t)/(u-c);g<3&&(g=0);var y=[xz(wz(d[0]/h,1))+1,_z(wz(d[1]/h,1))-1],v=g/h*d[0];return{layout:o,pixelDimIndex:a,layoutBase:n[i[a]],layoutLength:s,axisBase:n[i[1-a]],axisLength:n[r[1-a]],axisExpandable:p,axisExpandWidth:h,axisCollapseWidth:g,axisExpandWindow:d,axisCount:u,winInnerIndices:y,axisExpandWindow0Pos:v}},t.prototype._layoutAxes=function(){var t=this._rect,e=this._axesMap,n=this.dimensions,i=this._makeLayoutInfo(),r=i.layout;e.each((function(t){var e=[0,i.axisLength],n=t.inverse?1:0;t.setExtent(e[n],e[1-n])})),yz(n,(function(e,n){var o=(i.axisExpandable?Tz:Iz)(n,i),a={horizontal:{x:o.position,y:i.axisLength},vertical:{x:0,y:o.position}},s={horizontal:bz/2,vertical:0},l=[a[r].x+t.x,a[r].y+t.y],u=s[r],h=bi();Ci(h,h,u),Ti(h,h,l),this._axesLayout[e]={position:l,rotation:u,transform:h,axisNameAvailableWidth:o.axisNameAvailableWidth,axisLabelShow:o.axisLabelShow,nameTruncateMaxWidth:o.nameTruncateMaxWidth,tickDirection:1,labelDirection:1}}),this)},t.prototype.getAxis=function(t){return this._axesMap.get(t)},t.prototype.dataToPoint=function(t,e){return this.axisCoordToPoint(this._axesMap.get(e).dataToCoord(t),e)},t.prototype.eachActiveState=function(t,e,n,i){null==n&&(n=0),null==i&&(i=t.count());var r=this._axesMap,o=this.dimensions,a=[],s=[];F(o,(function(e){a.push(t.mapDimension(e)),s.push(r.get(e).model)}));for(var l=this.hasAxisBrushed(),u=n;ur*(1-h[0])?(l="jump",a=s-r*(1-h[2])):(a=s-r*h[1])>=0&&(a=s-r*(1-h[1]))<=0&&(a=0),a*=e.axisExpandWidth/u,a?dz(a,i,o,"all"):l="none";else{var p=i[1]-i[0],d=o[1]*s/p;i=[mz(0,d-p/2)],i[1]=vz(o[1],i[0]+p),i[0]=i[1]-p}return{axisExpandWindow:i,behavior:l}},t}();function Mz(t,e){return vz(mz(t,e[0]),e[1])}function Iz(t,e){var n=e.layoutLength/(e.axisCount-1);return{position:n*t,axisNameAvailableWidth:n,axisLabelShow:!0}}function Tz(t,e){var n,i,r=e.layoutLength,o=e.axisExpandWidth,a=e.axisCount,s=e.axisCollapseWidth,l=e.winInnerIndices,u=s,h=!1;return t=0;n--)Gr(e[n])},e.prototype.getActiveState=function(t){var e=this.activeIntervals;if(!e.length)return"normal";if(null==t||isNaN(+t))return"inactive";if(1===e.length){var n=e[0];if(n[0]<=t&&t<=n[1])return"active"}else for(var i=0,r=e.length;iBz}function iB(t){var e=t.length-1;return e<0&&(e=0),[t[0],t[e]]}function rB(t,e,n,i){var r=new Ir;return r.add(new Ol({name:"main",style:lB(n),silent:!0,draggable:!0,cursor:"move",drift:j(dB,t,e,r,["n","s","w","e"]),ondragend:j(eB,e,{isEnd:!0})})),F(i,(function(n){r.add(new Ol({name:n.join(""),style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:j(dB,t,e,r,n),ondragend:j(eB,e,{isEnd:!0})}))})),r}function oB(t,e,n,i){var r=i.brushStyle.lineWidth||0,o=Nz(r,Vz),a=n[0][0],s=n[1][0],l=a-r/2,u=s-r/2,h=n[0][1],c=n[1][1],p=h-o+r/2,d=c-o+r/2,f=h-a,g=c-s,y=f+r,v=g+r;sB(t,e,"main",a,s,f,g),i.transformable&&(sB(t,e,"w",l,u,o,v),sB(t,e,"e",p,u,o,v),sB(t,e,"n",l,u,y,o),sB(t,e,"s",l,d,y,o),sB(t,e,"nw",l,u,o,o),sB(t,e,"ne",p,u,o,o),sB(t,e,"sw",l,d,o,o),sB(t,e,"se",p,d,o,o))}function aB(t,e){var n=e.__brushOption,i=n.transformable,r=e.childAt(0);r.useStyle(lB(n)),r.attr({silent:!i,cursor:i?"move":"default"}),F([["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]],(function(n){var r=e.childOfName(n.join("")),o=1===n.length?cB(t,n[0]):pB(t,n);r&&r.attr({silent:!i,invisible:!i,cursor:i?Hz[o]+"-resize":null})}))}function sB(t,e,n,i,r,o,a){var s=e.childOfName(n);s&&s.setShape(vB(yB(t,e,[[i,r],[i+o,r+a]])))}function lB(t){return N({strokeNoScale:!0},t.brushStyle)}function uB(t,e,n,i){var r=[Rz(t,n),Rz(e,i)],o=[Nz(t,n),Nz(e,i)];return[[r[0],o[0]],[r[1],o[1]]]}function hB(t){return lp(t.group)}function cB(t,e){var n={w:"left",e:"right",n:"top",s:"bottom"},i={left:"w",right:"e",top:"n",bottom:"s"},r=hp(n[e],hB(t));return i[r]}function pB(t,e){var n=[cB(t,e[0]),cB(t,e[1])];return("e"===n[0]||"w"===n[0])&&n.reverse(),n.join("")}function dB(t,e,n,i,r,o){var a=n.__brushOption,s=t.toRectRange(a.range),l=gB(e,r,o);F(i,(function(t){var e=Fz[t];s[e[0]][e[1]]+=l[e[0]]})),a.range=t.fromRectRange(uB(s[0][0],s[1][0],s[0][1],s[1][1])),Kz(e,n),eB(e,{isEnd:!1})}function fB(t,e,n,i){var r=e.__brushOption.range,o=gB(t,n,i);F(r,(function(t){t[0]+=o[0],t[1]+=o[1]})),Kz(t,e),eB(t,{isEnd:!1})}function gB(t,e,n){var i=t.group,r=i.transformCoordToLocal(e,n),o=i.transformCoordToLocal(0,0);return[r[0]-o[0],r[1]-o[1]]}function yB(t,e,n){var i=Jz(t,e);return i&&i!==Oz?i.clipPath(n,t._transform):L(n)}function vB(t){var e=Rz(t[0][0],t[1][0]),n=Rz(t[0][1],t[1][1]),i=Nz(t[0][0],t[1][0]),r=Nz(t[0][1],t[1][1]);return{x:e,y:n,width:i-e,height:r-n}}function mB(t,e,n){if(t._brushType&&!IB(t,e.offsetX,e.offsetY)){var i=t._zr,r=t._covers,o=$z(t,e,n);if(!t._dragging)for(var a=0;a