r&&(r=n),r!==d&&(e.width=r,u-=r+l*r,c--)}})),d=(u-s)/(c+(c-1)*l),d=Math.max(d,0);var f,h=0;Object(I["each"])(r,(function(e,t){e.width||(e.width=d),f=e,h+=e.width*(1+l)})),f&&(h-=f.width*l);var p=-h/2;Object(I["each"])(r,(function(e,r){n[t][r]=n[t][r]||{bandWidth:i,offset:p,width:e.width},p+=e.width*(1+l)}))})),n}function sO(e,t,n){if(e&&t){var r=e[tO(t)];return null!=r&&null!=n?r[eO(n)]:r}}function lO(e,t){var n=rO(e,t),r=aO(n);Object(I["each"])(n,(function(e){var t=e.getData(),n=e.coordinateSystem,i=n.getBaseAxis(),a=eO(e),o=r[tO(i)][a],s=o.offset,l=o.width;t.setLayout({bandWidth:o.bandWidth,offset:s,size:l})}))}function uO(e){return{seriesType:e,plan:um(),reset:function(e){if(cO(e)){var t=e.getData(),n=e.coordinateSystem,r=n.getBaseAxis(),i=n.getOtherAxis(r),a=t.getDimensionIndex(t.mapDimension(i.dim)),o=t.getDimensionIndex(t.mapDimension(r.dim)),s=e.get("showBackground",!0),l=t.mapDimension(i.dim),u=t.getCalculationInfo("stackResultDimension"),c=ww(t,l)&&!!t.getCalculationInfo("stackedOnSeries"),d=i.isHorizontal(),f=fO(r,i),h=dO(e),p=e.get("barMinHeight")||0,m=u&&t.getDimensionIndex(u),v=t.getLayout("size"),g=t.getLayout("offset");return{progress:function(e,t){var r,i=e.count,l=h&&$w(3*i),u=h&&s&&$w(3*i),y=h&&$w(i),b=n.master.getRect(),_=d?b.width:b.height,x=t.getStore(),w=0;while(null!=(r=e.next())){var O=x.get(c?m:a,r),M=x.get(o,r),j=f,S=void 0;c&&(S=+O-x.get(a,r));var k=void 0,C=void 0,L=void 0,T=void 0;if(d){var E=n.dataToPoint([O,M]);if(c){var D=n.dataToPoint([S,M]);j=D[0]}k=j,C=E[1]+g,L=E[0]-j,T=v,Math.abs(L)>>1;e[i][1]n&&(this._approxInterval=n);var a=mO.length,o=Math.min(hO(mO,this._approxInterval,0,a),a-1);this._interval=mO[o][1],this._minLevelUnit=mO[Math.max(o-1,0)][0]},t.prototype.parse=function(e){return Object(I["isNumber"])(e)?e:+ji(e)},t.prototype.contain=function(e){return Vw(this.parse(e),this._extent)},t.prototype.normalize=function(e){return Bw(this.parse(e),this._extent)},t.prototype.scale=function(e){return Ww(e,this._extent)},t.type="time",t}(Xw),mO=[["second",wc],["minute",Oc],["hour",Mc],["quarter-day",6*Mc],["half-day",12*Mc],["day",1.2*jc],["half-week",3.5*jc],["week",7*jc],["month",31*jc],["quarter",95*jc],["half-year",Sc/2],["year",Sc]];function vO(e,t,n,r){var i=ji(t),a=ji(n),o=function(e){return Hc(i,e,r)===Hc(a,e,r)},s=function(){return o("year")},l=function(){return s()&&o("month")},u=function(){return l()&&o("day")},c=function(){return u()&&o("hour")},d=function(){return c()&&o("minute")},f=function(){return d()&&o("second")},h=function(){return f()&&o("millisecond")};switch(e){case"year":return s();case"month":return l();case"day":return u();case"hour":return c();case"minute":return d();case"second":return f();case"millisecond":return h()}}function gO(e,t){return e/=jc,e>16?16:e>7.5?7:e>3.5?4:e>1.5?2:1}function yO(e){var t=30*jc;return e/=t,e>6?6:e>3?3:e>2?2:1}function bO(e){return e/=Mc,e>12?12:e>6?6:e>3.5?4:e>2?2:1}function _O(e,t){return e/=t?Oc:wc,e>30?30:e>20?20:e>15?15:e>10?10:e>5?5:e>2?2:1}function xO(e){return Ci(e,!0)}function wO(e,t,n){var r=new Date(e);switch(Ic(t)){case"year":case"month":r[qc(n)](0);case"day":r[Xc(n)](1);case"hour":r[Zc(n)](0);case"minute":r[Jc(n)](0);case"second":r[$c(n)](0),r[Qc(n)](0)}return r.getTime()}function OO(e,t,n,r){var i=1e4,a=Ec,o=0;function s(e,t,n,i,a,o,s){var l=new Date(t),u=t,c=l[i]();while(u1&&0===u&&a.unshift({value:a[0].value-f})}}for(u=0;u=r[0]&&y<=r[1]&&d++)}var b=(r[1]-r[0])/t;if(d>1.5*b&&f>b/1.5)break;if(u.push(v),d>b||e===a[h])break}c=[]}}}var _=Object(I["filter"])(Object(I["map"])(u,(function(e){return Object(I["filter"])(e,(function(e){return e.value>=r[0]&&e.value<=r[1]&&!e.notAdd}))})),(function(e){return e.length>0})),x=[],w=_.length-1;for(h=0;h<_.length;++h)for(var O=_[h],M=0;M0)r*=10;var a=[pi(LO(t[0]/r)*r),pi(CO(t[1]/r)*r)];this._interval=r,this._niceExtent=a}},t.prototype.calcNiceExtent=function(e){SO.calcNiceExtent.call(this,e),this._fixMin=e.fixMin,this._fixMax=e.fixMax},t.prototype.parse=function(e){return e},t.prototype.contain=function(e){return e=EO(e)/EO(this.base),Vw(e,this._extent)},t.prototype.normalize=function(e){return e=EO(e)/EO(this.base),Bw(e,this._extent)},t.prototype.scale=function(e){return e=Ww(e,this._extent),TO(this.base,e)},t.type="log",t}(Ew),IO=DO.prototype;function AO(e,t){return kO(e,vi(t))}IO.getMinorTicks=SO.getMinorTicks,IO.getLabel=SO.getLabel,Ew.registerClass(DO);var PO=DO,NO=function(){function e(e,t,n){this._prepareParams(e,t,n)}return e.prototype._prepareParams=function(e,t,n){n[1]0&&s>0&&!l&&(o=0),o<0&&s<0&&!u&&(s=0));var d=this._determinedMin,f=this._determinedMax;return null!=d&&(o=d,l=!0),null!=f&&(s=f,u=!0),{min:o,max:s,minFixed:l,maxFixed:u,isBlank:c}},e.prototype.modifyDataMinMax=function(e,t){this[YO[e]]=t},e.prototype.setDeterminedMinMax=function(e,t){var n=RO[e];this[n]=t},e.prototype.freeze=function(){this.frozen=!0},e}(),RO={min:"_determinedMin",max:"_determinedMax"},YO={min:"_dataMin",max:"_dataMax"};function HO(e,t,n){var r=e.rawExtentInfo;return r||(r=new NO(e,t,n),e.rawExtentInfo=r,r)}function FO(e,t){return null==t?null:Object(I["eqNaN"])(t)?NaN:e.parse(t)}function zO(e,t){var n=e.type,r=HO(e,t,e.getExtent()).calculate();e.setBlank(r.isBlank);var i=r.min,a=r.max,o=t.ecModel;if(o&&"time"===n){var s=rO("bar",o),l=!1;if(I["each"](s,(function(e){l=l||e.getBaseAxis()===t.axis})),l){var u=aO(s),c=VO(i,a,t,u);i=c.min,a=c.max}}return{extent:[i,a],fixMin:r.minFixed,fixMax:r.maxFixed}}function VO(e,t,n,r){var i=n.axis.getExtent(),a=i[1]-i[0],o=sO(r,n.axis);if(void 0===o)return{min:e,max:t};var s=1/0;I["each"](o,(function(e){s=Math.min(e.offset,s)}));var l=-1/0;I["each"](o,(function(e){l=Math.max(e.offset+e.width,l)})),s=Math.abs(s),l=Math.abs(l);var u=s+l,c=t-e,d=1-(s+l)/a,f=c/d-c;return t+=f*(l/u),e-=f*(s/u),{min:e,max:t}}function BO(e,t){var n=t,r=zO(e,n),i=r.extent,a=n.get("splitNumber");e instanceof PO&&(e.base=n.get("logBase"));var o=e.type,s=n.get("interval"),l="interval"===o||"time"===o;e.setExtent(i[0],i[1]),e.calcNiceExtent({splitNumber:a,fixMin:r.fixMin,fixMax:r.fixMax,minInterval:l?n.get("minInterval"):null,maxInterval:l?n.get("maxInterval"):null}),null!=s&&e.setInterval&&e.setInterval(s)}function WO(e,t){if(t=t||e.get("type"),t)switch(t){case"category":return new Gw({ordinalMeta:e.getOrdinalMeta?e.getOrdinalMeta():e.getCategories(),extent:[1/0,-1/0]});case"time":return new MO({locale:e.ecModel.getLocaleModel(),useUTC:e.ecModel.get("useUTC")});default:return new(Ew.getClass(t)||Xw)}}function UO(e){var t=e.scale.getExtent(),n=t[0],r=t[1];return!(n>0&&r>0||n<0&&r<0)}function GO(e){var t=e.getLabelModel().get("formatter"),n="category"===e.type?e.scale.getExtent()[0]:null;return"time"===e.scale.type?function(t){return function(n,r){return e.scale.getFormattedLabel(n,r,t)}}(t):I["isString"](t)?function(t){return function(n){var r=e.scale.getLabel(n),i=t.replace("{value}",null!=r?r:"");return i}}(t):I["isFunction"](t)?function(t){return function(r,i){return null!=n&&(i=r.value-n),t(KO(e,r),i,null!=r.level?{level:r.level}:null)}}(t):function(t){return e.scale.getLabel(t)}}function KO(e,t){return"category"===e.type?e.scale.getLabel(t):t.value}function qO(e){var t=e.model,n=e.scale;if(t.get(["axisLabel","show"])&&!n.isBlank()){var r,i,a=n.getExtent();n instanceof Gw?i=n.count():(r=n.getTicks(),i=r.length);var o,s=e.getLabelModel(),l=GO(e),u=1;i>40&&(u=Math.ceil(i/40));for(var c=0;ce[1]&&(e[1]=r[1])}))}var eM=function(){function e(){}return e.prototype.getNeedCrossZero=function(){var e=this.option;return!e.scale},e.prototype.getCoordSysModel=function(){},e}();function tM(e){return Lw(null,e)}var nM={isDimensionStacked:ww,enableDataStack:_w,getStackedDimension:Ow};function rM(e,t){var n=t;t instanceof ic||(n=new ic(t));var r=WO(n);return r.setExtent(e[0],e[1]),BO(r,n),r}function iM(e){I["mixin"](e,eM)}function aM(e,t){return t=t||{},Au(e,null,null,"normal"!==t.state)}var oM=1e-8;function sM(e,t){return Math.abs(e-t)n&&(e=i,n=o)}if(e)return fM(e.exterior);var s=this.getBoundingRect();return[s.x+s.width/2,s.y+s.height/2]},t.prototype.getBoundingRect=function(e){var t=this._rect;if(t&&!e)return t;var n=[1/0,1/0],r=[-1/0,-1/0],i=this.geometries;return Object(I["each"])(i,(function(t){"polygon"===t.type?dM(t.exterior,n,r,e):Object(I["each"])(t.points,(function(t){dM(t,n,r,e)}))})),isFinite(n[0])&&isFinite(n[1])&&isFinite(r[0])&&isFinite(r[1])||(n[0]=n[1]=r[0]=r[1]=0),t=new Mr(n[0],n[1],r[0]-n[0],r[1]-n[1]),e||(this._rect=t),t},t.prototype.contain=function(e){var t=this.getBoundingRect(),n=this.geometries;if(!t.contain(e[0],e[1]))return!1;e:for(var r=0,i=n.length;r>1^-(1&s),l=l>>1^-(1&l),s+=i,l+=a,i=s,a=l,r.push([s/n,l/n])}return r}function xM(e,t){return e=yM(e),I["map"](I["filter"](e.features,(function(e){return e.geometry&&e.properties&&e.geometry.coordinates.length>0})),(function(e){var n=e.properties,r=e.geometry,i=[];switch(r.type){case"Polygon":var a=r.coordinates;i.push(new pM(a[0],a.slice(1)));break;case"MultiPolygon":I["each"](r.coordinates,(function(e){e[0]&&i.push(new pM(e[0],e.slice(1)))}));break;case"LineString":i.push(new mM([r.coordinates]));break;case"MultiLineString":i.push(new mM(r.coordinates))}var o=new vM(n[t||"name"],i,n.cp);return o.properties=n,o}))}function wM(e,t,n,r,i,a,o,s){var l=new tl({style:{text:e,font:t,align:n,verticalAlign:r,padding:i,rich:a,overflow:o?"truncate":null,lineHeight:s}});return l.getBoundingRect()}var OM=sa();function MM(e){return"category"===e.type?SM(e):LM(e)}function jM(e,t){return"category"===e.type?CM(e,t):{ticks:I["map"](e.scale.getTicks(),(function(e){return e.value}))}}function SM(e){var t=e.getLabelModel(),n=kM(e,t);return!t.get("show")||e.scale.isBlank()?{labels:[],labelCategoryInterval:n.labelCategoryInterval}:n}function kM(e,t){var n,r,i=TM(e,"labels"),a=ZO(t),o=EM(i,a);return o||(I["isFunction"](a)?n=RM(e,a):(r="auto"===a?IM(e):a,n=NM(e,r)),DM(i,a,{labels:n,labelCategoryInterval:r}))}function CM(e,t){var n,r,i=TM(e,"ticks"),a=ZO(t),o=EM(i,a);if(o)return o;if(t.get("show")&&!e.scale.isBlank()||(n=[]),I["isFunction"](a))n=RM(e,a,!0);else if("auto"===a){var s=kM(e,e.getLabelModel());r=s.labelCategoryInterval,n=I["map"](s.labels,(function(e){return e.tickValue}))}else r=a,n=NM(e,r,!0);return DM(i,a,{ticks:n,tickCategoryInterval:r})}function LM(e){var t=e.scale.getTicks(),n=GO(e);return{labels:I["map"](t,(function(t,r){return{level:t.level,formattedLabel:n(t,r),rawLabel:e.scale.getLabel(t),tickValue:t.value}}))}}function TM(e,t){return OM(e)[t]||(OM(e)[t]=[])}function EM(e,t){for(var n=0;n40&&(s=Math.max(1,Math.floor(o/40)));for(var l=a[0],u=e.dataToCoord(l+1)-e.dataToCoord(l),c=Math.abs(u*Math.cos(r)),d=Math.abs(u*Math.sin(r)),f=0,h=0;l<=a[1];l+=s){var p=0,m=0,v=Tr(n({value:l}),t.font,"center","top");p=1.3*v.width,m=1.3*v.height,f=Math.max(f,p,7),h=Math.max(h,m,7)}var g=f/c,y=h/d;isNaN(g)&&(g=1/0),isNaN(y)&&(y=1/0);var b=Math.max(0,Math.floor(Math.min(g,y))),_=OM(e.model),x=e.getExtent(),w=_.lastAutoInterval,O=_.lastTickCount;return null!=w&&null!=O&&Math.abs(w-b)<=1&&Math.abs(O-o)<=1&&w>b&&_.axisExtent0===x[0]&&_.axisExtent1===x[1]?b=w:(_.lastTickCount=o,_.lastAutoInterval=b,_.axisExtent0=x[0],_.axisExtent1=x[1]),b}function PM(e){var t=e.getLabelModel();return{axisRotate:e.getRotate?e.getRotate():e.isHorizontal&&!e.isHorizontal()?90:0,labelRotate:t.get("rotate")||0,font:t.getFont()}}function NM(e,t,n){var r=GO(e),i=e.scale,a=i.getExtent(),o=e.getLabelModel(),s=[],l=Math.max((t||0)+1,1),u=a[0],c=i.count();0!==u&&l>1&&c/l>2&&(u=Math.round(Math.ceil(u/l)*l));var d=JO(e),f=o.get("showMinLabel")||d,h=o.get("showMaxLabel")||d;f&&u!==a[0]&&m(a[0]);for(var p=u;p<=a[1];p+=l)m(p);function m(e){var t={value:e};s.push(n?e:{formattedLabel:r(t),rawLabel:i.getLabel(t),tickValue:e})}return h&&p-l!==a[1]&&m(a[1]),s}function RM(e,t,n){var r=e.scale,i=GO(e),a=[];return I["each"](r.getTicks(),(function(e){var o=r.getLabel(e),s=e.value;t(e.value,o)&&a.push(n?s:{formattedLabel:i(e),rawLabel:o,tickValue:s})})),a}var YM=[0,1],HM=function(){function e(e,t,n){this.onBand=!1,this.inverse=!1,this.dim=e,this.scale=t,this._extent=n||[0,0]}return e.prototype.contain=function(e){var t=this._extent,n=Math.min(t[0],t[1]),r=Math.max(t[0],t[1]);return e>=n&&e<=r},e.prototype.containData=function(e){return this.scale.contain(e)},e.prototype.getExtent=function(){return this._extent.slice()},e.prototype.getPixelPrecision=function(e){return yi(e||this.scale.getExtent(),this._extent)},e.prototype.setExtent=function(e,t){var n=this._extent;n[0]=e,n[1]=t},e.prototype.dataToCoord=function(e,t){var n=this._extent,r=this.scale;return e=r.normalize(e),this.onBand&&"ordinal"===r.type&&(n=n.slice(),FM(n,r.count())),fi(e,YM,n,t)},e.prototype.coordToData=function(e,t){var n=this._extent,r=this.scale;this.onBand&&"ordinal"===r.type&&(n=n.slice(),FM(n,r.count()));var i=fi(e,n,YM,t);return this.scale.scale(i)},e.prototype.pointToData=function(e,t){},e.prototype.getTicksCoords=function(e){e=e||{};var t=e.tickModel||this.getTickModel(),n=jM(this,t),r=n.ticks,i=Object(I["map"])(r,(function(e){return{coord:this.dataToCoord("ordinal"===this.scale.type?this.scale.getRawOrdinalNumber(e):e),tickValue:e}}),this),a=t.get("alignWithLabel");return zM(this,i,a,e.clamp),i},e.prototype.getMinorTicksCoords=function(){if("ordinal"===this.scale.type)return[];var e=this.model.getModel("minorTick"),t=e.get("splitNumber");t>0&&t<100||(t=5);var n=this.scale.getMinorTicks(t),r=Object(I["map"])(n,(function(e){return Object(I["map"])(e,(function(e){return{coord:this.dataToCoord(e),tickValue:e}}),this)}),this);return r},e.prototype.getViewLabels=function(){return MM(this).labels},e.prototype.getLabelModel=function(){return this.model.getModel("axisLabel")},e.prototype.getTickModel=function(){return this.model.getModel("axisTick")},e.prototype.getBandWidth=function(){var e=this._extent,t=this.scale.getExtent(),n=t[1]-t[0]+(this.onBand?1:0);0===n&&(n=1);var r=Math.abs(e[1]-e[0]);return Math.abs(r)/n},e.prototype.calculateCategoryInterval=function(){return AM(this)},e}();function FM(e,t){var n=e[1]-e[0],r=t,i=n/r/2;e[0]+=i,e[1]-=i}function zM(e,t,n,r){var i=t.length;if(e.onBand&&!n&&i){var a,o,s=e.getExtent();if(1===i)t[0].coord=s[0],a=t[1]={coord:s[0]};else{var l=t[i-1].tickValue-t[0].tickValue,u=(t[i-1].coord-t[0].coord)/l;Object(I["each"])(t,(function(e){e.coord-=u/2}));var c=e.scale.getExtent();o=1+c[1]-t[i-1].tickValue,a={coord:t[i-1].coord+u*o},t.push(a)}var d=s[0]>s[1];f(t[0].coord,s[0])&&(r?t[0].coord=s[0]:t.shift()),r&&f(s[0],t[0].coord)&&t.unshift({coord:s[0]}),f(s[1],a.coord)&&(r?a.coord=s[1]:t.pop()),r&&f(a.coord,s[1])&&t.push({coord:s[1]})}function f(e,t){return e=pi(e),t=pi(t),d?e>t:ei&&(i+=KM);var h=Math.atan2(s,o);if(h<0&&(h+=KM),h>=r&&h<=i||h+KM>=r&&h+KM<=i)return l[0]=c,l[1]=d,u-n;var p=n*Math.cos(r)+e,m=n*Math.sin(r)+t,v=n*Math.cos(i)+e,g=n*Math.sin(i)+t,y=(p-o)*(p-o)+(m-s)*(m-s),b=(v-o)*(v-o)+(g-s)*(g-s);return y0){t=t/180*Math.PI,rj.fromArray(e[0]),ij.fromArray(e[1]),aj.fromArray(e[2]),pr.sub(oj,rj,ij),pr.sub(sj,aj,ij);var n=oj.len(),r=sj.len();if(!(n<.001||r<.001)){oj.scale(1/n),sj.scale(1/r);var i=oj.dot(sj),a=Math.cos(t);if(a1&&pr.copy(cj,aj),cj.toArray(e[1])}}}}function fj(e,t,n){if(n<=180&&n>0){n=n/180*Math.PI,rj.fromArray(e[0]),ij.fromArray(e[1]),aj.fromArray(e[2]),pr.sub(oj,ij,rj),pr.sub(sj,aj,ij);var r=oj.len(),i=sj.len();if(!(r<.001||i<.001)){oj.scale(1/r),sj.scale(1/i);var a=oj.dot(t),o=Math.cos(n);if(a=l)pr.copy(cj,aj);else{cj.scaleAndAdd(sj,s/Math.tan(Math.PI/2-c));var d=aj.x!==ij.x?(cj.x-ij.x)/(aj.x-ij.x):(cj.y-ij.y)/(aj.y-ij.y);if(isNaN(d))return;d<0?pr.copy(cj,ij):d>1&&pr.copy(cj,aj)}cj.toArray(e[1])}}}}function hj(e,t,n,r){var i="normal"===n,a=i?e:e.ensureState(n);a.ignore=t;var o=r.get("smooth");o&&!0===o&&(o=.3),a.shape=a.shape||{},o>0&&(a.shape.smooth=o);var s=r.getModel("lineStyle").getLineStyle();i?e.useStyle(s):a.style=s}function pj(e,t){var n=t.smooth,r=t.points;if(r)if(e.moveTo(r[0][0],r[0][1]),n>0&&r.length>=3){var i=Q(r[0],r[1]),a=Q(r[1],r[2]);if(!i||!a)return e.lineTo(r[1][0],r[1][1]),void e.lineTo(r[2][0],r[2][1]);var o=Math.min(i,a)*n,s=re([],r[1],r[0],o/i),l=re([],r[1],r[2],o/a),u=re([],s,l,.5);e.bezierCurveTo(s[0],s[1],s[0],s[1],u[0],u[1]),e.bezierCurveTo(l[0],l[1],l[0],l[1],r[2][0],r[2][1])}else for(var c=1;c0&&a&&w(-d/o,0,o);var v,g,y=e[0],b=e[o-1];return _(),v<0&&O(-v,.8),g<0&&O(g,.8),_(),x(v,g,1),x(g,v,-1),_(),v<0&&M(-v),g<0&&M(g),u}function _(){v=y.rect[t]-r,g=i-b.rect[t]-b.rect[n]}function x(e,t,n){if(e<0){var r=Math.min(t,-e);if(r>0){w(r*n,0,o);var i=r+e;i<0&&O(-i*n,1)}else O(-e*n,1)}}function w(n,r,i){0!==n&&(u=!0);for(var a=r;a0)for(l=0;l0;l--){f=a[l-1]*d;w(-f,l,o)}}}function M(e){var t=e<0?-1:1;e=Math.abs(e);for(var n=Math.ceil(e/(o-1)),r=0;r0?w(n,0,r+1):w(-n,o-r-1,o),e-=n,e<=0)return}}function bj(e,t,n,r){return yj(e,"x","width",t,n,r)}function _j(e,t,n,r){return yj(e,"y","height",t,n,r)}function xj(e){var t=[];e.sort((function(e,t){return t.priority-e.priority}));var n=new Mr(0,0,0,0);function r(e){if(!e.ignore){var t=e.ensureState("emphasis");null==t.ignore&&(t.ignore=!1)}e.ignore=!0}for(var i=0;i