=0?1:-1;return Math.pow(s,a)*r},t.prototype.initCfg=function(){this.tickMethod="pow",this.exponent=2,this.tickCount=5,this.nice=!0},t.prototype.getScalePercent=function(e){var t=this.max,a=this.min;if(t===a)return 0;var i=this.exponent;return(Ht(i,e)-Ht(i,a))/(Ht(i,t)-Ht(i,a))},t}(Vt),Jt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="time",t}return st(t,e),t.prototype.getText=function(e,t){var a=this.translate(e),i=this.formatter;return i?i(a,t):Lt(a,this.mask)},t.prototype.scale=function(t){var a=t;return(m(a)||P(a))&&(a=this.translate(a)),e.prototype.scale.call(this,a)},t.prototype.translate=function(e){return Et(e)},t.prototype.initCfg=function(){this.tickMethod="time-pretty",this.mask="YYYY-MM-DD",this.tickCount=7,this.nice=!1},t.prototype.setDomain=function(){var e=this.values,t=this.getConfig("min"),a=this.getConfig("max");if(u(t)&&w(t)||(this.min=this.translate(this.min)),u(a)&&w(a)||(this.max=this.translate(this.max)),e&&e.length){var i=[],n=1/0,s=n,r=0;f(e,(function(e){var t=Et(e);if(isNaN(t))throw new TypeError("Invalid Time: "+e+" in time scale!");n>t?(s=n,n=t):s>t&&(s=t),r1&&(this.minTickInterval=s-n),u(t)&&(this.min=n),u(a)&&(this.max=r)}},t}(Yt),Qt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="quantize",t}return st(t,e),t.prototype.invert=function(e){var t=this.ticks,a=t.length,i=this.getInvertPercent(e),n=Math.floor(i*(a-1));if(n>=a-1)return b(t);if(n<0)return p(t);var s=t[n],r=n/(a-1);return s+(i-r)/((n+1)/(a-1)-r)*(t[n+1]-s)},t.prototype.initCfg=function(){this.tickMethod="r-pretty",this.tickCount=5,this.nice=!0},t.prototype.calculateTicks=function(){var t=e.prototype.calculateTicks.call(this);return this.nice||(b(t)!==this.max&&t.push(this.max),p(t)!==this.min&&t.unshift(this.min)),t},t.prototype.getScalePercent=function(e){var t=this.ticks;if(eb(t))return 1;var a=0;return f(t,(function(t,i){if(!(e>=t))return!1;a=i})),a/(t.length-1)},t}(Vt),Zt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="quantile",t}return st(t,e),t.prototype.initCfg=function(){this.tickMethod="quantile",this.tickCount=5,this.nice=!0},t}(Qt),Kt={};function ea(e){return Kt[e]}function ta(e,t){if(ea(e))throw new Error("type '"+e+"' existed.");Kt[e]=t}var aa=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="identity",t.isIdentity=!0,t}return st(t,e),t.prototype.calculateTicks=function(){return this.values},t.prototype.scale=function(e){return this.values[0]!==e&&w(e)?e:this.range[0]},t.prototype.invert=function(e){var t=this.range;return et[1]?NaN:this.values[0]},t}(it),ia=[1,5,2,2.5,4,3],na=100*Number.EPSILON;function sa(e,t,a,i,n,s){var r=B(t),o=D(t,e),l=0,u=function(e,t){return(e%t+t)%t}(i,s);return(u=0&&(l=1),1-o/(r-1)-a+l}function ra(e,t,a){var i=B(t);return 1-D(t,e)/(i-1)-a+1}function oa(e,t,a,i,n,s){var r=(e-1)/(s-n),o=(t-1)/(Math.max(s,i)-Math.min(a,n));return 2-Math.max(r/o,o/r)}function la(e,t){return e>=t?2-(e-1)/(t-1):1}function ua(e,t,a,i){var n=t-e;return 1-.5*(Math.pow(t-i,2)+Math.pow(e-a,2))/Math.pow(.1*n,2)}function ca(e,t,a){var i=t-e;if(a>i){var n=(a-i)/2;return 1-Math.pow(n,2)/Math.pow(.1*i,2)}return 1}function da(e,t,a,i,n,s){if(void 0===a&&(a=5),void 0===i&&(i=!0),void 0===n&&(n=ia),void 0===s&&(s=[.25,.2,.5,.05]),"number"!=typeof e||"number"!=typeof t)return{min:0,max:0,ticks:[]};if(e===t||1===a)return{min:e,max:t,ticks:[e]};for(var r={score:-2,lmin:0,lmax:0,lstep:0},o=1;o<1/0;){for(var l=0,u=n;lw)v+=1;else{for(var $=y;$<=w;$+=1){var C=$*(m/o),x=C+m*(f-1),k=m,S=sa(c,n,o,C,x,k),T=ua(e,t,C,x),P=oa(f,a,e,t,C,x),I=s[0]*S+s[1]*T+s[2]*P+1*s[3];I>r.score&&(!i||C<=e&&x>=t)&&(r.lmin=C,r.lmax=x,r.lstep=k,r.score=I)}v+=1}}f+=1}}o+=1}for(var O=Number.isInteger(r.lstep)?0:Math.ceil(Math.abs(Math.log10(r.lstep))),A=[],M=r.lmin;M<=r.lmax;M+=r.lstep)A.push(M);var j=O?R(A,(function(e){return Number.parseFloat(e.toFixed(O))})):A;return{min:Math.min(e,p(j)),max:Math.max(t,b(j)),ticks:j}}function fa(e){var t=e.values,a=e.tickInterval,i=e.tickCount,n=t;if(w(a))return s(n,(function(e,t){return t%a==0}));var r=e.min,o=e.max;if(u(r)&&(r=0),u(o)&&(o=t.length-1),w(i)&&i=r&&e<=o})).map((function(e){return t[e]}))}return t.slice(r,o+1)}var _a=Math.sqrt(50),ha=Math.sqrt(10),va=Math.sqrt(2),ma=function(){function e(){this._domain=[0,1]}return e.prototype.domain=function(e){return e?(this._domain=Array.from(e,Number),this):this._domain.slice()},e.prototype.nice=function(e){var t,a;void 0===e&&(e=5);var i,n=this._domain.slice(),s=0,r=this._domain.length-1,o=this._domain[s],l=this._domain[r];return l0?i=ga(o=Math.floor(o/i)*i,l=Math.ceil(l/i)*i,e):i<0&&(i=ga(o=Math.ceil(o*i)/i,l=Math.floor(l*i)/i,e)),i>0?(n[s]=Math.floor(o/i)*i,n[r]=Math.ceil(l/i)*i,this.domain(n)):i<0&&(n[s]=Math.ceil(o*i)/i,n[r]=Math.floor(l*i)/i,this.domain(n)),this},e.prototype.ticks=function(e){return void 0===e&&(e=5),function(e,t,a){var i,n,s,r,o=-1;if(a=+a,(e=+e)===(t=+t)&&a>0)return[e];if((i=t0)for(e=Math.ceil(e/r),t=Math.floor(t/r),s=new Array(n=Math.ceil(t-e+1));++o=0?(s>=_a?10:s>=ha?5:s>=va?2:1)*Math.pow(10,n):-Math.pow(10,-n)/(s>=_a?10:s>=ha?5:s>=va?2:1)}function pa(e,t,a){return("ceil"===a?Math.ceil(e/t):"floor"===a?Math.floor(e/t):Math.round(e/t))*t}function ba(e,t,a){var i=pa(e,a,"floor"),n=pa(t,a,"ceil");i=y(i,a),n=y(n,a);for(var s=[],r=i;r<=n;r+=a){var o=y(r,a);s.push(o)}return{min:i,max:n,ticks:s}}function ya(e,t,a){var i,n=e.minLimit,s=e.maxLimit,r=e.min,o=e.max,l=e.tickCount,c=void 0===l?5:l,d=u(n)?u(t)?r:t:n,f=u(s)?u(a)?o:a:s;if(d>f&&(f=(i=[d,f])[0],d=i[1]),c<=2)return[d,f];for(var _=(f-d)/(c-1),h=[],v=0;v1&&(n*=Math.ceil(r)),i&&n31536e6)for(var u=Ca(a),c=Math.ceil(r/31536e6),d=l;d<=u+c;d+=c)o.push(xa(d));else if(r>Bt){var f=Math.ceil(r/Bt),_=ka(t),h=function(e,t){var a=Ca(e),i=Ca(t),n=ka(e);return 12*(i-a)+(ka(t)-n)%12}(t,a);for(d=0;d<=h+f;d+=f)o.push(Sa(l,d+_))}else if(r>Rt){var v=(y=new Date(t)).getFullYear(),m=y.getMonth(),g=y.getDate(),p=Math.ceil(r/Rt),b=function(e,t){return Math.ceil((t-e)/Rt)}(t,a);for(d=0;dNt){v=(y=new Date(t)).getFullYear(),m=y.getMonth(),p=y.getDate();var y,w=y.getHours(),$=Math.ceil(r/Nt),C=function(e,t){return Math.ceil((t-e)/Nt)}(t,a);for(d=0;d<=C+$;d+=$)o.push(new Date(v,m,p,w+d).getTime())}else if(r>6e4){var x=function(e,t){return Math.ceil((t-e)/6e4)}(t,a),k=Math.ceil(r/6e4);for(d=0;d<=x+k;d+=k)o.push(t+6e4*d)}else{var S=r;S<1e3&&(S=1e3);var T=1e3*Math.floor(t/1e3),P=Math.ceil((a-t)/1e3),I=Math.ceil(S/1e3);for(d=0;d=512&&i("warn","Notice: current ticks length("+o.length+') >= 512, may cause performance issues, even out of memory. Because of the configure "tickInterval"(in milliseconds, current is '+r+") is too small, increase the value to solve the problem!"," at uni_modules/lime-f2/components/lime-f2/f2.min.js:15"),o})),at("log",(function(e){var t,a=e.base,i=e.tickCount,n=e.min,s=e.max,r=e.values,o=Gt(a,s);if(n>0)t=Math.floor(Gt(a,n));else{var l=Wt(r,a,s);t=Math.floor(Gt(a,l))}for(var u=o-t,c=Math.ceil(u/i),d=[],f=t;f=0?1:-1;return Math.pow(e,t)*a}))})),at("quantile",(function(e){var t=e.tickCount,a=e.values;if(!a||!a.length)return[];for(var i=a.slice().sort((function(e,t){return e-t})),n=[],s=0;s=a?n[n.length-1]=r:n.push(r)),n},Pa=[1,1.2,1.5,2,2.2,2.4,2.5,3,4,5,6,7.5,8,10];function Ia(e){var t=1;if(0===(e=Math.abs(e)))return t;if(e<1){for(var a=0;e<1;)t/=10,e*=10,a++;return t.toString().length>12&&(t=parseFloat(t.toFixed(a))),t}for(;e>10;)t*=10,e/=10;return t}function Oa(e){var t=e.interval,a=e.tickCount,i=e.max,n=e.min;return Math.floor(n/t)*t+(a-1)*t>=i}function Aa(e){var t=e.toString(),a=t.indexOf("."),i=t.indexOf("e-"),n=i>=0?parseInt(t.substr(i+2),10):t.substr(a+1).length;return n>20&&(n=20),n}function Ma(e,t){return parseFloat(e.toFixed(t))}var ja=ea("linear"),Da=ea("identity"),La=ea("category"),Ea=ea("timeCat");function Na(e){Object.keys(e).forEach((function(t){delete e[t]}))}at("cat",Ta),at("time-cat",Ta),at("wilkinson-extended",(function(e){var t=e||{},a=t.tickCount,i=t.tickInterval,n=e||{},s=n.min,r=n.max;s=isNaN(s)?0:s,r=isNaN(r)?0:r;var o=a&&a>=2?a:5,l=i||function(e){var t=e.tickCount,a=e.min,i=e.max;if(a===i)return 1*Ia(i);for(var n=(i-a)/(t-1),s=Ia(n),r=n/s,o=i/s,l=a/s,u=0,c=0;c0?e.change({min:0}):n<0&&e.change({max:0}))},t.clear=function(){Na(this.defs),Na(this.scales),this.data=null},e}(),Ba=function(){var e=t.prototype;function t(e){this._initDefaultCfg(),A(this,e),this.draw()}return e._initDefaultCfg=function(){this.ticks=[],this.tickLine={},this.offsetFactor=1,this.frontContainer=null,this.backContainer=null,this.gridPoints=[]},e.draw=function(){var e=this.line,t=this.tickLine,a=this.label,i=this.grid;i&&this.drawGrid(i),t&&this.drawTicks(t),e&&this.drawLine(e),a&&this.drawLabels()},e.drawTicks=function(e){var t=this,a=t.ticks,i=e.length,n=t.getContainer(e.top);f(a,(function(a){var s=t.getOffsetPoint(a.value),r=t.getSidePoint(s,i);n.addShape("line",{className:"axis-tick",attrs:A({x1:s.x,y1:s.y,x2:r.x,y2:r.y},e)})._id=t._id+"-ticks"}))},e.drawLabels=function(){var e=this,t=e.labelOffset;f(e.labels,(function(a){var i=e.getContainer(a.get("top")),n=e.getOffsetPoint(a.get("value")),s=e.getSidePoint(n,t),r=s.x,o=s.y;a.attr(A({x:r,y:o},e.getTextAlignInfo(n,t),a.get("textStyle"))),a._id=e._id+"-"+a.attr("text"),i.add(a)}))},e.drawLine=function(){},e.drawGrid=function(e){var t=this,a=t.gridPoints,i=t.ticks,n=e,s=a.length;f(a,(function(a,r){if(l(e)){var o=i[r]||{},u=e(o.text,r,s);n=u?A({},be._defaultAxis.grid,u):null}if(n){var c,d=n.type,f=a.points,_=t.getContainer(n.top);if("arc"===d){var h=t.center,v=t.startAngle,m=t.endAngle,g=Pe.length([f[0].x-h.x,f[0].y-h.y]);c=_.addShape("Arc",{className:"axis-grid",attrs:A({x:h.x,y:h.y,startAngle:v,endAngle:m,r:g},n)})}else c=_.addShape("Polyline",{className:"axis-grid",attrs:A({points:f},n)});c._id=a._id}}))},e.getOffsetPoint=function(){},e.getAxisVector=function(){},e.getOffsetVector=function(e,t){var a=this.getAxisVector(e),i=Pe.normalize([],a),n=this.offsetFactor,s=[-1*i[1]*n,i[0]*n];return Pe.scale([],s,t)},e.getSidePoint=function(e,t){var a=this.getOffsetVector(e,t);return{x:e.x+a[0],y:e.y+a[1]}},e.getTextAlignInfo=function(e,t){var a=this.getOffsetVector(e,t);return{textAlign:a[0]>0?"left":a[0]<0?"right":"center",textBaseline:a[1]>0?"top":a[1]<0?"bottom":"middle"}},e.getContainer=function(e){var t=this.frontContainer,a=this.backContainer;return e?t:a},t}(),za=function(e){function t(){return e.apply(this,arguments)||this}$e(t,e);var a=t.prototype;return a._initDefaultCfg=function(){e.prototype._initDefaultCfg.call(this),this.start=null,this.end=null},a.getOffsetPoint=function(e){var t=this.start,a=this.end;return{x:t.x+(a.x-t.x)*e,y:t.y+(a.y-t.y)*e}},a.getAxisVector=function(){var e=this.start,t=this.end;return[t.x-e.x,t.y-e.y]},a.drawLine=function(e){var t=this.getContainer(e.top),a=this.start,i=this.end;t.addShape("line",{className:"axis-line",attrs:A({x1:a.x,y1:a.y,x2:i.x,y2:i.y},e)})},t}(Ba);Ba.Line=za;var Fa=function(){function e(e){this.axisCfg={},this.frontPlot=null,this.backPlot=null,this.axes={},A(this,e)}var t=e.prototype;return t._isHide=function(e){var t=this.axisCfg;return!t||!1===t[e]},t._getLinePosition=function(e,t,a,i){var n="",s=e.field,r=this.axisCfg;return r[s]&&r[s].position?n=r[s].position:"x"===t?n=i?"left":"bottom":"y"===t&&(n=a?"right":"left",i&&(n="bottom")),n},t._getLineCfg=function(e,t,a){var i,n,s=1;return"x"===t?(i={x:0,y:0},n={x:1,y:0}):"right"===a?(i={x:1,y:0},n={x:1,y:1}):(i={x:0,y:0},n={x:0,y:1},s=-1),e.transposed&&(s*=-1),{offsetFactor:s,start:e.convertPoint(i),end:e.convertPoint(n)}},t._getCircleCfg=function(e){return{startAngle:e.startAngle,endAngle:e.endAngle,center:e.center,radius:e.circleRadius}},t._getRadiusCfg=function(e){var t,a;return e.transposed?(t={x:0,y:0},a={x:1,y:0}):(t={x:0,y:0},a={x:0,y:1}),{offsetFactor:-1,start:e.convertPoint(t),end:e.convertPoint(a)}},t._getAxisCfg=function(e,t,a,i,n){var s=this,r=this,o=this.axisCfg,u=t.getTicks(),c=j({ticks:u,frontContainer:this.frontPlot,backContainer:this.backPlot},n,o[t.field]),d=[],_=c.label,h=u.length,v=0,m=0,g=_;return f(u,(function(e,t){if(l(_)){var a=_(e.text,t,h);g=a?A({},be._defaultAxis.label,a):null}if(g){var i={};g.textAlign&&(i.textAlign=g.textAlign),g.textBaseline&&(i.textBaseline=g.textBaseline);var n=(g.top?s.frontPlot:s.backPlot).addShape("text",{className:"axis-label",aria:!1,attrs:A({x:0,y:0,text:e.text,fontFamily:r.chart.get("canvas").get("fontFamily")},g),value:e.value,textStyle:i,top:g.top,context:r.chart.get("canvas").get("context")});d.push(n);var o=n.getBBox(),u=o.width,c=o.height;v=Math.max(v,u),m=Math.max(m,c)}})),c.labels=d,c.maxWidth=v,c.maxHeight=m,c},t._createAxis=function(e,t,a,i,n){void 0===n&&(n="");var s,r,o,l=e.type,u=e.transposed;if("cartesian"===l||"rect"===l){var c=this._getLinePosition(t,i,n,u);(o=be.axis[c]).position=c,s="Line",r=c}else"x"===i&&!u||"y"===i&&u?(o=be.axis.circle,s="Circle",r="circle"):(o=be.axis.radius,s="Line",r="radius");var d=this._getAxisCfg(e,t,a,i,o);d.type=s,d.dimType=i,d.verticalScale=a,d.index=n,this.axes[r]=d},t.createAxis=function(e,t,a){var i=this;t&&!i._isHide(t.field)&&i._createAxis(e,t,a[0],"x"),f(a,(function(a,n){i._isHide(a.field)||i._createAxis(e,a,t,"y",n)}));var n=this.axes,s=i.chart;if(s._isAutoPadding()){var r=fe(s.get("padding")),o=fe(s.get("appendPadding")),l=s.get("legendRange")||{top:0,right:0,bottom:0,left:0},c=["auto"===r[0]?l.top+2*o[0]:r[0],"auto"===r[1]?l.right+o[1]:r[1],"auto"===r[2]?l.bottom+o[2]:r[2],"auto"===r[3]?l.left+o[3]:r[3]];if(e.isPolar){var d=n.circle;if(d){var _=d.maxHeight,h=d.maxWidth,v=d.labelOffset;c[0]+=_+v,c[1]+=h+v,c[2]+=_+v,c[3]+=h+v}}else{if(n.right&&"auto"===r[1]){var m=n.right,g=m.maxWidth,p=m.labelOffset;c[1]+=g+p}if(n.left&&"auto"===r[3]){var b=n.left,y=b.maxWidth,w=b.labelOffset;c[3]+=y+w}if(n.bottom&&"auto"===r[2]){var $=n.bottom,C=$.maxHeight,x=$.labelOffset;c[2]+=C+x}}s.set("_padding",c),s._updateLayout(c)}f(n,(function(t){var a,n=t.type,s=t.grid,r=t.verticalScale,o=t.ticks,l=t.dimType,c=t.position,d=t.index;if(e.isPolar?"Line"===n?a=i._getRadiusCfg(e):"Circle"===n&&(a=i._getCircleCfg(e)):a=i._getLineCfg(e,l,c),s&&r){var _=[],h=function(e){var t=e.slice(0);if(t.length>0){var a=t[0],i=t[t.length-1];0!==a.value&&t.unshift({value:0}),1!==i.value&&t.push({value:1})}return t}(r.getTicks());f(o,(function(t){var a=[];f(h,(function(i){var n="x"===l?t.value:i.value,s="x"===l?i.value:t.value;if(n>=0&&n<=1&&s>=0&&s<=1){var r=e.convertPoint({x:n,y:s});a.push(r)}})),_.push({points:a,_id:"axis-"+l+d+"-grid-"+t.tickValue})})),t.gridPoints=_,e.isPolar&&(t.center=e.center,t.startAngle=e.startAngle,t.endAngle=e.endAngle)}a._id="axis-"+l,u(d)||(a._id="axis-"+l+d),new Ba[n](A(t,a))}))},t.clear=function(){this.axes={},this.frontPlot.clear(),this.backPlot.clear()},e}(),qa=function(e,t){var a=t.x-e.x,i=t.y-e.y;return Math.abs(a)>Math.abs(i)?a>0?"right":"left":i>0?"down":"up"},Va=function(e,t){var a=Math.abs(t.x-e.x),i=Math.abs(t.y-e.y);return Math.sqrt(a*a+i*i)},Ya=function(){function e(e){var t=this,a=e.canvas,i=e.el;ye(this,"_click",(function(e){var a=ue(e,t.canvas);e.points=a,t.emitEvent("click",e)})),ye(this,"_start",(function(e){var a,i,n=ue(e,t.canvas);n&&(e.points=n,t.emitEvent("touchstart",e),t.reset(),t.startTime=Date.now(),t.startPoints=n,n.length>1?(t.startDistance=Va(n[0],n[1]),t.center=(a=n[0],i=n[1],{x:a.x+(i.x-a.x)/2,y:a.y+(i.y-a.y)/2})):t.pressTimeout=setTimeout((function(){e.direction="none",t.emitStart("press",e),t.emitEvent("press",e),t.eventType="press",t.direction="none"}),250))})),ye(this,"_move",(function(e){var a=ue(e,t.canvas);if(a){t.clearPressTimeout(),e.points=a,t.emitEvent("touchmove",e);var i=t.startPoints;if(i)if(a.length>1){var n=t.startDistance,s=Va(a[0],a[1]);e.zoom=s/n,e.center=t.center,t.emitStart("pinch",e),t.emitEvent("pinch",e)}else{var r=a[0].x-i[0].x,o=a[0].y-i[0].y,l=t.direction||qa(i[0],a[0]);t.direction=l;var u=t.getEventType(a);e.direction=l,e.deltaX=r,e.deltaY=o,t.emitStart(u,e),t.emitEvent(u,e);var c=t.lastMoveTime,d=Date.now();d-c>0&&(t.prevMoveTime=c,t.prevMovePoints=t.lastMovePoints,t.lastMoveTime=d,t.lastMovePoints=a)}}})),ye(this,"_end",(function(e){var a=ue(e,t.canvas);e.points=a,t.emitEnd(e),t.emitEvent("touchend",e);var i=t.lastMoveTime;if(Date.now()-i<100){var n=i-(t.prevMoveTime||t.startTime);if(n>0){var s=t.prevMovePoints||t.startPoints,r=t.lastMovePoints,o=Va(s[0],r[0])/n;o>.3&&(e.velocity=o,e.direction=qa(s[0],r[0]),t.emitEvent("swipe",e))}}t.reset();var l=e.touches;l&&l.length>0&&t._start(e)})),ye(this,"_cancel",(function(e){t.emitEvent("touchcancel",e),t.reset()})),this.canvas=a,this.delegateEvent(i),this.processEvent={}}var t=e.prototype;return t.delegateEvent=function(e){e.addEventListener("click",this._click),e.addEventListener("touchstart",this._start),e.addEventListener("touchmove",this._move),e.addEventListener("touchend",this._end),e.addEventListener("touchcancel",this._cancel)},t.emitEvent=function(e,t){this.canvas.emit(e,t)},t.getEventType=function(e){var t,a=this.eventType,i=this.canvas,n=this.startTime,s=this.startPoints;if(a)return a;var r=i.__events.pan;return t=r&&r.length?Date.now()-n>250&&Va(s[0],e[0])<10?"press":"pan":"press",this.eventType=t,t},t.enable=function(e){this.processEvent[e]=!0},t.isProcess=function(e){return this.processEvent[e]},t.emitStart=function(e,t){this.isProcess(e)||(this.enable(e),this.emitEvent(e+"start",t))},t.emitEnd=function(e){var t=this,a=this.processEvent;Object.keys(a).forEach((function(i){t.emitEvent(i+"end",e),delete a[i]}))},t.clearPressTimeout=function(){this.pressTimeout&&(clearTimeout(this.pressTimeout),this.pressTimeout=0)},t.reset=function(){this.clearPressTimeout(),this.startTime=0,this.startPoints=null,this.startDistance=0,this.direction=null,this.eventType=null,this.pinch=!1,this.prevMoveTime=0,this.prevMovePoints=null,this.lastMoveTime=0,this.lastMovePoints=null},e}(),Ha=function(e){function t(t){var a;return(a=e.call(this)||this).context=t,a.width=0,a.height=0,a.style={},a.currentStyle={},a.attrs={},a.isCanvasElement=!0,a}$e(t,e);var a=t.prototype;return a.getContext=function(){return this.context},a.getBoundingClientRect=function(){return{top:0,right:this.width,bottom:this.height,left:0}},a.setAttribute=function(e,t){this.attrs[e]=t},a.addEventListener=function(e,t){this.on(e,t)},a.removeEventListener=function(e,t){this.off(e,t)},a.dispatchEvent=function(e,t){this.emit(e,t)},t}(xe),Ga=function(e){return e?function(e){if(!e)return!1;if(1!==e.nodeType||!e.nodeName||"canvas"!==e.nodeName.toLowerCase())return!1;var t=!1;try{e.addEventListener("eventTest",(function(){t=!0})),e.dispatchEvent(new Event("eventTest"))}catch(e){t=!1}return t}(e.canvas)?e.canvas:new Ha(e):null};function Wa(e,t){f(e,(function(e){e=e.split(":"),t.addColorStop(Number(e[0]),e[1])}))}function Ua(e,t,a){if("("===e[1])try{var n=e[0];if("l"===n)return function(e,t,a){var i,n,s=e.split(" "),r=s[0].slice(2,s[0].length-1);i=parseFloat(r)*Math.PI/180,n=2*Math.PI,r=(i%n+n)%n;var o,l,u=s.slice(1),c=t.getBBox(),d=c.minX,f=c.minY,_=c.maxX,h=c.maxY;r>=0&&r<.5*Math.PI?(o={x:d,y:f},l={x:_,y:h}):.5*Math.PI<=r&&r-1?(null===e.get("canvas")&&(e=Object.assign({},e)),e.set("parent",this.get("parent")),e.set("context",this.get("context")),e):null},e.attr=function(e,t){var a=this;if(a.get("destroyed"))return null;var i=arguments.length;if(0===i)return a._attrs.attrs;if(d(e)){for(var n in this._attrs.bbox=null,e)a._setAttr(n,e[n]);return a._afterAttrsSet&&a._afterAttrsSet(),a}return 2===i?(this._attrs.bbox=null,a._setAttr(e,t),a._afterAttrsSet&&a._afterAttrsSet(),a):a._getAttr(e)},e.getParent=function(){return this.get("parent")},e.draw=function(e){this.get("destroyed")||this.get("visible")&&(this.setContext(e),this.drawInner(e),this.restoreContext(e))},e.setContext=function(e){var t=this._attrs.attrs.clip;e.save(),t&&(t.resetTransform(e),t.createPath(e),e.clip()),this.resetContext(e),this.resetTransform(e)},e.restoreContext=function(e){e.restore()},e.resetContext=function(e){var t=this._attrs.attrs;for(var a in t)if(Ja.indexOf(a)>-1){var i=t[a];"fillStyle"!==a&&"strokeStyle"!==a||!i||(i=Ua(i,this,e)),"lineDash"===a&&e.setLineDash&&c(i)?e.setLineDash(i):e[a]=i}},e.hasFill=function(){return this.get("canFill")&&this._attrs.attrs.fillStyle},e.hasStroke=function(){return this.get("canStroke")&&this._attrs.attrs.strokeStyle},e.drawInner=function(){},e.show=function(){return this.set("visible",!0),this},e.hide=function(){return this.set("visible",!1),this},e.isVisible=function(){return this.get("visible")},e.getAriaLabel=function(){var e=this._attrs,t=e.destroyed,a=e.visible,i=e.isShape,n=e.aria;if(!t&&a&&(!i||n))return this._getAriaLabel()},e._getAriaLabel=function(){return this._attrs.ariaLabel},e._removeFromParent=function(){var e=this.get("parent");return e&&H(e.get("children"),this),this},e.remove=function(e){e?this.destroy():this._removeFromParent()},e.destroy=function(){if(this.get("destroyed"))return null;this._removeFromParent(),this._attrs={},this.set("destroyed",!0)},e.getBBox=function(){return{minX:0,maxX:0,minY:0,maxY:0,width:0,height:0}},e.initTransform=function(){var e=this._attrs.attrs||{};e.matrix||(e.matrix=[1,0,0,1,0,0]),this._attrs.attrs=e},e.getMatrix=function(){return this._attrs.attrs.matrix},e.setMatrix=function(e){this._attrs.attrs.matrix=[e[0],e[1],e[2],e[3],e[4],e[5]]},e.transform=function(e){var t=this._attrs.attrs.matrix;return this._attrs.attrs.matrix=Te.transform(t,e),this},e.setTransform=function(e){return this._attrs.attrs.matrix=[1,0,0,1,0,0],this.transform(e)},e.translate=function(e,t){var a=this._attrs.attrs.matrix;Te.translate(a,a,[e,t])},e.rotate=function(e){var t=this._attrs.attrs.matrix;Te.rotate(t,t,e)},e.scale=function(e,t){var a=this._attrs.attrs.matrix;Te.scale(a,a,[e,t])},e.moveTo=function(e,t){var a=this._attrs.x||0,i=this._attrs.y||0;this.translate(e-a,t-i),this.set("x",e),this.set("y",t)},e.apply=function(e){var t=this._attrs.attrs.matrix;return Pe.transformMat2d(e,e,t),this},e.resetTransform=function(e){var t=this._attrs.attrs.matrix;Te.isChanged(t)&&e.transform(t[0],t[1],t[2],t[3],t[4],t[5],!0)},e.isDestroyed=function(){return this.get("destroyed")},t}(),Ka=function(e){function t(){return e.apply(this,arguments)||this}$e(t,e);var a=t.prototype;return a._initProperties=function(){this._attrs={zIndex:0,visible:!0,destroyed:!1,isShape:!0,attrs:{}}},a.getType=function(){return this._attrs.type},a.drawInner=function(e){var t=this.get("attrs");this.createPath(e);var a=e.globalAlpha;if(this.hasFill()){var i=t.fillOpacity;u(i)||1===i?e.fill():(e.globalAlpha=i,e.fill(),e.globalAlpha=a)}if(this.hasStroke()&&t.lineWidth>0){var n=t.strokeOpacity;u(n)||1===n||(e.globalAlpha=n),e.stroke()}},a.getBBox=function(){var e=this._attrs.bbox;return e||((e=this.calculateBox())&&(e.x=e.minX,e.y=e.minY,e.width=e.maxX-e.minX,e.height=e.maxY-e.minY),this._attrs.bbox=e),e},a.calculateBox=function(){return null},a.createPath=function(){},t}(Za),ei=function(e){function t(){return e.apply(this,arguments)||this}$e(t,e);var a=t.prototype;return a._initProperties=function(){e.prototype._initProperties.call(this),this._attrs.canFill=!0,this._attrs.canStroke=!0,this._attrs.type="rect"},a.getDefaultAttrs=function(){return{x:0,y:0,width:0,height:0,radius:0,lineWidth:0}},a.createRadiusPath=function(e,t,a,i,n,s){s=function(e,t,a){if(!((e=fe(e))[0]||e[1]||e[2]||e[3]))return e;var i=Math.max(e[0]+e[1],e[2]+e[3]),n=Math.max(e[0]+e[3],e[1]+e[2]),s=Math.min(t/i,a/n);return s<1?e.map((function(e){return e*s})):e}(s,i,n),e.moveTo(t+s[0],a),e.lineTo(t+i-s[1],a),e.arc(t+i-s[1],a+s[1],s[1],-Math.PI/2,0,!1),e.lineTo(t+i,a+n-s[2]),e.arc(t+i-s[2],a+n-s[2],s[2],0,Math.PI/2,!1),e.lineTo(t+s[3],a+n),e.arc(t+s[3],a+n-s[3],s[3],Math.PI/2,Math.PI,!1),e.lineTo(t,a+s[0]),e.arc(t+s[0],a+s[0],s[0],Math.PI,3*Math.PI/2,!1),e.closePath()},a.createPath=function(e){var t=this.get("attrs"),a=t.x,i=t.y,n=t.width,s=t.height,r=t.radius;e.beginPath(),r&&n*s?this.createRadiusPath(e,a,i,n,s,r):e.rect(a,i,n,s)},a.calculateBox=function(){var e=this.get("attrs"),t=e.x,a=e.y;return{minX:t,minY:a,maxX:t+e.width,maxY:a+e.height}},t}(Ka),ti=function(e){function t(){return e.apply(this,arguments)||this}$e(t,e);var a=t.prototype;return a._initProperties=function(){e.prototype._initProperties.call(this),this._attrs.canFill=!1,this._attrs.canStroke=!1,this._attrs.loading=!1,this._attrs.image=null,this._attrs.type="image"},a.createPath=function(e){var t=this,a=this.get("attrs").src;if(!this.get("loading")){var i=this.get("image");if(i)this.drawImage(e,i);else if(a&&Image){this.set("loading",!0);var n=new Image;n.src=a,n.crossOrigin="Anonymous",n.onload=function(){t.set("loading",!1),t.set("image",n),t.drawImage(e,n)}}}},a.drawImage=function(e,t){var a=this._attrs,i=a.attrs;if(!a.destroyed){var n=i.x,s=i.y,r=i.width,o=i.height,l=i.sx,c=i.sy,d=i.swidth,f=i.sheight,_=i.radius;_&&(e.save(),this.createRadiusPath(e,n,s,r,o,_),e.clip()),u(l)||u(c)||u(d)||u(f)?e.drawImage(t,n,s,r,o):e.drawImage(t,l,c,d,f,n,s,r,o),_&&e.restore()}},t}(ei),ai=function(e){function t(){return e.apply(this,arguments)||this}$e(t,e);var a=t.prototype;return a._initProperties=function(){e.prototype._initProperties.call(this),this._attrs.canFill=!0,this._attrs.canStroke=!0,this._attrs.type="circle"},a.getDefaultAttrs=function(){return{x:0,y:0,r:0,lineWidth:0}},a.createPath=function(e){var t=this.get("attrs"),a=t.x,i=t.y,n=t.r;e.beginPath(),e.arc(a,i,n,0,2*Math.PI,!1),e.closePath()},a.calculateBox=function(){var e=this.get("attrs"),t=e.x,a=e.y,i=e.r;return{minX:t-i,maxX:t+i,minY:a-i,maxY:a+i}},t}(Ka),ii=Pe.create(),ni=Pe.create(),si=Pe.create();function ri(e,t,a,i,n){var s=e*e;return t+(3*-t+e*(3*t-t*e))*e+(3*a+e*(-6*a+3*a*e))*e+(3*i-3*i*e)*s+n*(s*e)}function oi(e){for(var t,a,i,n,s,r=1/0,o=-1/0,l=1/0,u=-1/0,c={x:e[0],y:e[1]},d={x:e[2],y:e[3]},f={x:e[4],y:e[5]},_={x:e[6],y:e[7]},h=0;h<100;h++){var v={x:ri(s=h/100,(t=c).x,(a=d).x,(i=f).x,(n=_).x),y:ri(s,t.y,a.y,i.y,n.y)};v.xo&&(o=v.x),v.yu&&(u=v.y)}return{minX:r,minY:l,maxX:o,maxY:u}}function li(e,t){if(0!==e.length){for(var a=e[0],i=a.x,n=a.x,s=a.y,r=a.y,o=e.length,l=1;l1e-4)return{minX:e-a,minY:t-a,maxX:e+a,maxY:t+a};ii[0]=Math.cos(i)*a+e,ii[1]=Math.sin(i)*a+t,ni[0]=Math.cos(n)*a+e,ni[1]=Math.sin(n)*a+t;var o=[0,0],l=[0,0];if(Pe.min(o,ii,ni),Pe.max(l,ii,ni),(i%=2*Math.PI)<0&&(i+=2*Math.PI),(n%=2*Math.PI)<0&&(n+=2*Math.PI),i>n&&!s?n+=2*Math.PI:ii&&(si[0]=Math.cos(c)*a+e,si[1]=Math.sin(c)*a+t,Pe.min(o,si,o),Pe.max(l,si,l));return{minX:o[0],minY:o[1],maxX:l[0],maxY:l[1]}}var ci=function(e){function t(){return e.apply(this,arguments)||this}$e(t,e);var a=t.prototype;return a._initProperties=function(){e.prototype._initProperties.call(this),this._attrs.canStroke=!0,this._attrs.type="line"},a.getDefaultAttrs=function(){return{x1:0,y1:0,x2:0,y2:0,lineWidth:1}},a.createPath=function(e){var t=this.get("attrs"),a=t.x1,i=t.y1,n=t.x2,s=t.y2;e.beginPath(),e.moveTo(a,i),e.lineTo(n,s)},a.calculateBox=function(){var e=this.get("attrs");return function(e,t,a,i,n){return n=n/2||0,{minX:Math.min(e,a)-n,minY:Math.min(t,i)-n,maxX:Math.max(e,a)+n,maxY:Math.max(t,i)+n}}(e.x1,e.y1,e.x2,e.y2,e.lineWidth)},t}(Ka),di=function(e){function t(){return e.apply(this,arguments)||this}$e(t,e);var a=t.prototype;return a._initProperties=function(){e.prototype._initProperties.call(this),this._attrs.canFill=!0,this._attrs.canStroke=!0,this._attrs.type="polygon"},a.getDefaultAttrs=function(){return{points:null,lineWidth:0}},a.createPath=function(e){var t=this.get("attrs").points;e.beginPath();for(var a=0,i=t.length;ai&&(i=l.maxX),l.minYs&&(s=l.maxY)}return{minX:a-(t=t/2||0),minY:n-t,maxX:i+t,maxY:s+t}}(s,i)}return li(n,i)},t}(Ka),mi=function(e){function t(){return e.apply(this,arguments)||this}$e(t,e);var a=t.prototype;return a._initProperties=function(){e.prototype._initProperties.call(this),this._attrs.canStroke=!0,this._attrs.canFill=!0,this._attrs.type="arc"},a.getDefaultAttrs=function(){return{x:0,y:0,r:0,startAngle:0,endAngle:2*Math.PI,anticlockwise:!1,lineWidth:1}},a.createPath=function(e){var t=this.get("attrs"),a=t.x,i=t.y,n=t.r,s=t.startAngle,r=t.endAngle,o=t.anticlockwise;e.beginPath(),s!==r&&e.arc(a,i,n,s,r,o)},a.calculateBox=function(){var e=this.get("attrs");return ui(e.x,e.y,e.r,e.startAngle,e.endAngle,e.anticlockwise)},t}(Ka),gi=function(e){function t(){return e.apply(this,arguments)||this}$e(t,e);var a=t.prototype;return a._initProperties=function(){e.prototype._initProperties.call(this),this._attrs.canFill=!0,this._attrs.canStroke=!0,this._attrs.type="sector"},a.getDefaultAttrs=function(){return{x:0,y:0,lineWidth:0,r:0,r0:0,startAngle:0,endAngle:2*Math.PI,anticlockwise:!1}},a.createPath=function(e){var t=this.get("attrs"),a=t.x,i=t.y,n=t.startAngle,s=t.endAngle,r=t.r,o=t.r0,l=t.anticlockwise;e.beginPath();var u=Math.cos(n),c=Math.sin(n);e.moveTo(u*o+a,c*o+i),e.lineTo(u*r+a,c*r+i),(Math.abs(s-n)>1e-4||0===n&&s<0)&&(e.arc(a,i,r,n,s,l),e.lineTo(Math.cos(s)*o+a,Math.sin(s)*o+i),0!==o&&e.arc(a,i,o,s,n,!l)),e.closePath()},a.calculateBox=function(){var e=this.get("attrs"),t=e.x,a=e.y,i=e.r,n=e.r0,s=e.startAngle,r=e.endAngle,o=e.anticlockwise,l=ui(t,a,i,s,r,o),u=ui(t,a,n,s,r,o);return{minX:Math.min(l.minX,u.minX),minY:Math.min(l.minY,u.minY),maxX:Math.max(l.maxX,u.maxX),maxY:Math.max(l.maxY,u.maxY)}},t}(Ka),pi=function(e){var t=e.width,a=e.height,i=e.rotate,n=Math.abs(i);return{width:Math.abs(t*Math.cos(n)+a*Math.sin(n)),height:Math.abs(a*Math.cos(n)+t*Math.sin(n))}},bi=0,yi={},wi=function(e){function t(){return e.apply(this,arguments)||this}$e(t,e);var a=t.prototype;return a._initProperties=function(){e.prototype._initProperties.call(this),this._attrs.canFill=!0,this._attrs.canStroke=!0,this._attrs.type="text"},a.getDefaultAttrs=function(){return{lineWidth:0,lineCount:1,fontSize:12,fontFamily:"sans-serif",fontStyle:"normal",fontWeight:"normal",fontVariant:"normal",textAlign:"start",textBaseline:"bottom",lineHeight:null,textArr:null}},a._getFontStyle=function(){var e=this._attrs.attrs,t=e.fontSize,a=e.fontFamily,i=e.fontWeight;return e.fontStyle+" "+e.fontVariant+" "+i+" "+t+"px "+a},a._afterAttrsSet=function(){var e=this._attrs.attrs;if(e.font=this._getFontStyle(),e.text){var t=e.text,a=null,i=1;m(t)&&-1!==t.indexOf("\n")&&(i=(a=t.split("\n")).length),e.lineCount=i,e.textArr=a}this.set("attrs",e)},a._getTextHeight=function(){var e=this._attrs.attrs;if(e.height)return e.height;var t=e.lineCount,a=1*e.fontSize;return t>1?a*t+this._getSpaceingY()*(t-1):a},a._getSpaceingY=function(){var e=this._attrs.attrs,t=e.lineHeight,a=1*e.fontSize;return t?t-a:.14*a},a.drawInner=function(e){var t=this._attrs.attrs,a=t.text,i=t.x,n=t.y;if(!(u(a)||isNaN(i)||isNaN(n))){var s=t.textArr,r=1*t.fontSize,o=this._getSpaceingY();t.rotate&&(e.translate(i,n),e.rotate(t.rotate),i=0,n=0);var l,c,d=t.textBaseline;if(s&&(l=this._getTextHeight()),this.hasFill()){var f=t.fillOpacity;if(u(f)||1===f||(e.globalAlpha=f),s)for(var _=0,h=s.length;_5e3&&(bi=0,yi={}),bi++,yi[s]=r,r}},t}(Ka),$i=function(e){function t(){return e.apply(this,arguments)||this}$e(t,e);var a=t.prototype;return a._initProperties=function(){e.prototype._initProperties.call(this),this._attrs.canFill=!0,this._attrs.canStroke=!0,this._attrs.createPath=null,this._attrs.type="custom"},a.createPath=function(e){var t=this.get("createPath");t&&t.call(this,e)},a.calculateBox=function(){var e=this.get("calculateBox");return e&&e.call(this)},t}(Ka),Ci={circle:function(e,t,a,i){i.arc(e,t,a,0,2*Math.PI,!1)},square:function(e,t,a,i){i.moveTo(e-a,t-a),i.lineTo(e+a,t-a),i.lineTo(e+a,t+a),i.lineTo(e-a,t+a),i.closePath()}},xi=function(e){function t(){return e.apply(this,arguments)||this}$e(t,e);var a=t.prototype;return a._initProperties=function(){e.prototype._initProperties.call(this),this._attrs.canFill=!0,this._attrs.canStroke=!0,this._attrs.type="marker"},a.getDefaultAttrs=function(){return{x:0,y:0,lineWidth:0}},a.createPath=function(e){var t,a=this.get("attrs"),i=a.x,n=a.y,s=a.radius,r=a.symbol||"circle";t=l(r)?r:Ci[r],e.beginPath(),t(i,n,s,e,this)},a.calculateBox=function(){var e=this.get("attrs"),t=e.x,a=e.y,i=e.radius;return{minX:t-i,minY:a-i,maxX:t+i,maxY:a+i}},t}(Ka);Ka.Rect=ei,Ka.Image=ti,Ka.Circle=ai,Ka.Line=ci,Ka.Polygon=di,Ka.Polyline=vi,Ka.Arc=mi,Ka.Sector=gi,Ka.Text=wi,Ka.Custom=$i,Ka.Marker=xi;var ki={},Si={getGroupClass:function(){},getChildren:function(){return this.get("children")},addShape:function(e,t){void 0===t&&(t={});var a=ki[e];a||(a=k(e),ki[e]=a);var i=new Ka[a](t);return this.add(i),i},addGroup:function(e){var t=new(this.getGroupClass())(e);return this.add(t),t},contain:function(e){return this.get("children").indexOf(e)>-1},sort:function(){for(var e=this.get("children"),t=0,a=e.length;t=n.x&&a<=s.x&&i>=n.y&&i<=r.y}var Ei=Object.freeze({__proto__:null,getClip:Di,isPointInPlot:Li});function Ni(e,t){return e-t}var Ri=function(e){$e(a,e),a.initPlugins=function(){return{_plugins:[],_cacheId:0,register:function(e){var t=this._plugins;[].concat(e).forEach((function(e){-1===t.indexOf(e)&&t.push(e)})),this._cacheId++},unregister:function(e){var t=this._plugins;[].concat(e).forEach((function(e){var a=t.indexOf(e);-1!==a&&t.splice(a,1)})),this._cacheId++},clear:function(){this._plugins=[],this._cacheId++},count:function(){return this._plugins.length},getAll:function(){return this._plugins},notify:function(e,t,a){var i,n,s,r,o=this.descriptors(e),l=o.length;for(i=0;i0;)e.shift().destroy()},t._clearGeoms=function(){for(var e=this.get("geoms"),t=0,a=e.length;t=0&&(t.lineWidth=e.size),A(t,e.style),A({},be.shape.line,t)}(t);return"dash"===e&&(n.lineDash=be.lineDash),function(e,t,a,i){var n=e.points;if(n.length&&c(n[0].y)){for(var s=[],r=[],o=0,l=n.length;o1?be.widthRatio.multiplePie:be.widthRatio.rose:(a.isLinear&&(r*=s[1]-s[0]),o=be.widthRatio.column),r*=o,this.hasAdjust("dodge")&&(r/=i.length),e=r,this.set("defaultSize",e)}return e},getDimWidth:function(e){var t=this.get("coord"),a=t.convertPoint({x:0,y:0}),i=t.convertPoint({x:"x"===e?1:0,y:"x"===e?0:1}),n=0;return a&&i&&(n=Math.sqrt(Math.pow(i.x-a.x,2)+Math.pow(i.y-a.y,2))),n},_getWidth:function(){var e=this.get("_width");if(!e){var t=this.get("coord");e=t&&t.isPolar&&!t.transposed?(t.endAngle-t.startAngle)*t.circleRadius:this.getDimWidth("x"),this.set("_width",e)}return e},_toNormalizedSize:function(e){return e/this._getWidth()},_toCoordSize:function(e){return this._getWidth()*e},getNormalizedSize:function(e){var t=this.getAttrValue("size",e);return u(t)?this.getDefaultSize():this._toNormalizedSize(t)},getSize:function(e){var t=this.getAttrValue("size",e);if(u(t)){var a=this.getDefaultSize();t=this._toCoordSize(a)}return t}};function Zi(e){var t,a,i=e.x,n=e.y,s=e.y0,r=e.size,o=s,l=n;return c(n)&&(l=n[1],o=n[0]),c(i)?(t=i[0],a=i[1]):(t=i-r/2,a=i+r/2),[{x:t,y:o},{x:t,y:l},{x:a,y:l},{x:a,y:o}]}Ye.registerFactory("interval",{defaultShapeType:"rect",getDefaultPoints:function(e){return Zi(e)}}),Ye.registerShape("interval","rect",{draw:function(e,t){var a=this.parsePoints(e.points),i=A({fill:e.color},be.shape.interval,e.style);if(e.isInCircle){var n=a.slice(0);this._coord.transposed&&(n=[a[0],a[3],a[2],a[1]]);var s=e.center,r=s.x,o=s.y,l=[1,0],u=[n[0].x-r,n[0].y-o],c=[n[1].x-r,n[1].y-o],d=[n[2].x-r,n[2].y-o],f=Pe.angleTo(l,c),_=Pe.angleTo(l,d),h=Pe.length(u),v=Pe.length(c);return f>=1.5*Math.PI&&(f-=2*Math.PI),_>=1.5*Math.PI&&(_-=2*Math.PI),t.addShape("Sector",{className:"interval",attrs:A({x:r,y:o,r:v,r0:h,startAngle:f,endAngle:_},i)})}var m=function(e){for(var t=[],a=[],i=0,n=e.length;i=0?"positive":"negative";n[_][f]||(n[_][f]=0),u[a]=[n[_][f],d+n[_][f]],n[_][f]+=d}}},i}(Xe);Xe.Stack=on;var ln="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},un=function(e){var t=void 0===e?"undefined":ln(e);return null!==e&&"object"===t||"function"===t},cn=function(e,t){if(e)if(sn(e))for(var a=0,i=e.length;ai&&(a=e,i=n)})),a}},hn={merge:function(e){for(var t=[],a=0;a0&&l<=1&&(i*=l),this.x={start:this.startAngle,end:this.endAngle},this.y={start:i*s,end:i},this.center=n,this.circleRadius=i},a._convertPoint=function(e){var t=this.center,a=this.transposed,i=a?"y":"x",n=a?"x":"y",s=this.x,r=this.y,o=s.start+(s.end-s.start)*e[i],l=r.start+(r.end-r.start)*e[n];return{x:t.x+Math.cos(o)*l,y:t.y+Math.sin(o)*l}},a._invertPoint=function(e){var t=this.center,a=this.transposed,i=this.x,n=this.y,s=a?"y":"x",r=a?"x":"y",o=[1,0,0,1,0,0];Te.rotate(o,o,i.start);var l=[1,0];Pe.transformMat2d(l,l,o),l=[l[0],l[1]];var u=[e.x-t.x,e.y-t.y];if(Pe.zero(u))return{x:0,y:0};var c=Pe.angleTo(l,u,i.end0?f:-f;var _=(d-n.start)/(n.end-n.start),h={};return h[s]=f,h[r]=_,h},t}(Oe);Oe.Polar=mn;var gn=function(e){function t(){return e.apply(this,arguments)||this}$e(t,e);var a=t.prototype;return a._initDefaultCfg=function(){e.prototype._initDefaultCfg.call(this),this.startAngle=-Math.PI/2,this.endAngle=3*Math.PI/2,this.radius=null,this.center=null},a.getOffsetPoint=function(e){var t=this.startAngle,a=t+(this.endAngle-t)*e;return this._getCirclePoint(a)},a._getCirclePoint=function(e,t){var a=this.center;return t=t||this.radius,{x:a.x+Math.cos(e)*t,y:a.y+Math.sin(e)*t}},a.getTextAlignInfo=function(e,t){var a,i=this.getOffsetVector(e,t),n="middle";return i[0]>0?a="left":i[0]<0?a="right":(a="center",i[1]>0?n="top":i[1]<0&&(n="bottom")),{textAlign:a,textBaseline:n}},a.getAxisVector=function(e){var t=this.center,a=this.offsetFactor;return[(e.y-t.y)*a,-1*(e.x-t.x)*a]},a.drawLine=function(e){var t=this.center,a=this.radius,i=this.startAngle,n=this.endAngle;this.getContainer(e.top).addShape("arc",{className:"axis-line",attrs:A({x:t.x,y:t.y,r:a,startAngle:i,endAngle:n},e)})},t}(Ba);Ba.Circle=gn;var pn={min:0,median:.5,max:1},bn=function(){var e=t.prototype;function t(e){this._initDefaultCfg(),j(this,e)}return e._initDefaultCfg=function(){},e._getNormalizedValue=function(e,t){return u(pn[e])?t.scale(e):pn[e]},e.parsePercentPoint=function(e,t){var a=parseFloat(t[0])/100,i=parseFloat(t[1])/100,n=e.start,s=e.end,r=Math.abs(n.x-s.x),o=Math.abs(n.y-s.y);return{x:r*a+Math.min(n.x,s.x),y:o*i+Math.min(n.y,s.y)}},e.parsePoint=function(e,t){var a=this.xScale,i=this.yScales;if(l(t)&&(t=t(a,i)),m(t[0])&&-1!==t[0].indexOf("%")&&!isNaN(t[0].slice(0,-1)))return this.parsePercentPoint(e,t);var n=this._getNormalizedValue(t[0],a),s=this._getNormalizedValue(t[1],i[0]),r=e.convertPoint({x:n,y:s});return this.limitInPlot?n>=0&&n<=1&&s>=0&&s<=1?r:null:r},e.render=function(){},e.repaint=function(){this.remove();var e=this.coord,t=this.container,a=this.canvas;t&&!t.isDestroyed()&&(this.render(e,t),a.draw())},e.remove=function(){var e=this.element;e&&e.remove(!0)},e.changeVisible=function(e){this.visible=e;var t=this.element;t&&(t.set?t.set("visible",e):t.style.display=e?"":"none")},t}(),yn=function(e){function t(){return e.apply(this,arguments)||this}$e(t,e);var a=t.prototype;return a._initDefaultCfg=function(){this.type="arc",this.start=[],this.end=[],this.style={stroke:"#999",lineWidth:1}},a.render=function(e,t){var a=this.parsePoint(e,this.start),i=this.parsePoint(e,this.end);if(a&&i){var n=e.center,s=Math.sqrt((a.x-n.x)*(a.x-n.x)+(a.y-n.y)*(a.y-n.y)),r=Math.atan2(a.y-n.y,a.x-n.x),o=Math.atan2(i.y-n.y,i.x-n.x),l=t.addShape("arc",{className:"guide-arc",attrs:A({x:n.x,y:n.y,r:s,startAngle:r,endAngle:o},this.style)});return this.element=l,l}},t}(bn);function wn(e,t){for(var a in t)t.hasOwnProperty(a)&&(e.style[a]=t[a]);return e}function $n(e){var t=document.createElement("div");return e=e.replace(/(^\s*)|(\s*$)/g,""),t.innerHTML=""+e,t.childNodes[0]}bn.Arc=yn;var Cn=function(e){function t(){return e.apply(this,arguments)||this}$e(t,e);var a=t.prototype;return a._initDefaultCfg=function(){this.type="html",this.position=null,this.alignX="center",this.alignY="middle",this.offsetX=null,this.offsetY=null,this.html=null},a.render=function(e,t){var a=this.parsePoint(e,this.position);if(a){var i=$n(this.html);i=wn(i,{position:"absolute",top:Math.floor(a.y)+"px",left:Math.floor(a.x)+"px",visibility:"hidden"});var n=t.get("canvas").get("el"),s=n.parentNode;s=wn(s,{position:"relative"});var r=$n('');s.appendChild(r),r.appendChild(i);var o=n.offsetTop,l=n.offsetLeft,u=this.alignX,c=this.alignY,d=this.offsetX,f=this.offsetY,_=function(e,t,a,i){var n=[];return"left"===e&&"top"===t?(n[0]=0,n[1]=0):"right"===e&&"top"===t?(n[0]=-a,n[1]=0):"left"===e&&"bottom"===t?(n[0]=0,n[1]=Math.floor(-i)):"right"===e&&"bottom"===t?(n[0]=Math.floor(-a),n[1]=Math.floor(-i)):"right"===e&&"middle"===t?(n[0]=Math.floor(-a),n[1]=Math.floor(-i/2)):"left"===e&&"middle"===t?(n[0]=0,n[1]=Math.floor(-i/2)):"center"===e&&"bottom"===t?(n[0]=Math.floor(-a/2),n[1]=Math.floor(-i)):"center"===e&&"top"===t?(n[0]=Math.floor(-a/2),n[1]=0):(n[0]=Math.floor(-a/2),n[1]=Math.floor(-i/2)),n}(u,c,ae(i),ie(i));a.x=a.x+_[0]+l,a.y=a.y+_[1]+o,d&&(a.x+=d),f&&(a.y+=f),wn(i,{top:Math.floor(a.y)+"px",left:Math.floor(a.x)+"px",visibility:"visible"}),this.element=r}},a.remove=function(){var e=this.element;e&&e.parentNode&&e.parentNode.removeChild(e)},t}(bn);bn.Html=Cn;var xn=function(e){function t(){return e.apply(this,arguments)||this}$e(t,e);var a=t.prototype;return a._initDefaultCfg=function(){this.type="line",this.start=[],this.end=[],this.style={stroke:"#000",lineWidth:1}},a.render=function(e,t){var a=[];if(a[0]=this.parsePoint(e,this.start),a[1]=this.parsePoint(e,this.end),a[0]&&a[1]){var i=t.addShape("Line",{className:"guide-line",attrs:A({x1:a[0].x,y1:a[0].y,x2:a[1].x,y2:a[1].y},this.style)});return this.element=i,i}},t}(bn);bn.Line=xn;var kn=function(e){function t(){return e.apply(this,arguments)||this}$e(t,e);var a=t.prototype;return a._initDefaultCfg=function(){this.type="rect",this.start=[],this.end=[],this.style={fill:"#CCD7EB",opacity:.4}},a.render=function(e,t){var a=this.parsePoint(e,this.start),i=this.parsePoint(e,this.end);if(a&&i){var n=t.addShape("rect",{className:"guide-rect",attrs:A({x:Math.min(a.x,i.x),y:Math.min(a.y,i.y),width:Math.abs(i.x-a.x),height:Math.abs(a.y-i.y)},this.style)});return this.element=n,n}},t}(bn);bn.Rect=kn;var Sn=function(e){function t(){return e.apply(this,arguments)||this}$e(t,e);var a=t.prototype;return a._initDefaultCfg=function(){this.type="text",this.position=null,this.content=null,this.style={fill:"#000"},this.offsetX=0,this.offsetY=0},a.render=function(e,t){var a=this.position,i=this.parsePoint(e,a);if(i){var n=this.content,s=this.style,r=this.offsetX,o=this.offsetY;r&&(i.x+=r),o&&(i.y+=o);var l=t.addShape("text",{className:"guide-text",attrs:A({x:i.x,y:i.y,text:n},s)});return this.element=l,l}},t}(bn);bn.Text=Sn;var Tn=function(e){function t(){return e.apply(this,arguments)||this}$e(t,e);var a=t.prototype;return a._initDefaultCfg=function(){this.type="tag",this.position=null,this.content=null,this.direct="tl",this.autoAdjust=!0,this.offsetX=0,this.offsetY=0,this.side=4,this.background={padding:5,radius:2,fill:"#1890FF"},this.textStyle={fontSize:12,fill:"#fff",textAlign:"center",textBaseline:"middle"},this.withPoint=!0,this.pointStyle={fill:"#1890FF",r:3,lineWidth:1,stroke:"#fff"}},a._getDirect=function(e,t,a,i){var n=this.direct,s=this.side,r=e.get("canvas"),o=r.get("width"),l=r.get("height"),u=t.x,c=t.y,d=n[0],f=n[1];"t"===d&&c-s-i<0?d="b":"b"===d&&c+s+i>l&&(d="t");var _="c"===d?s:0;return"l"===f&&u-_-a<0?f="r":"r"===f&&u+_+a>o?f="l":"c"===f&&(a/2+u+_>o?f="l":u-a/2-_<0&&(f="r")),d+f},a.render=function(e,t){var a=this.parsePoint(e,this.position);if(a&&!isNaN(a.x)&&!isNaN(a.y)){var i=this.content,n=this.background,s=this.textStyle,r=[],o=t.addGroup({className:"guide-tag"});if(this.withPoint){var l=o.addShape("Circle",{className:"guide-tag-point",attrs:A({x:a.x,y:a.y},this.pointStyle)});r.push(l)}var u=o.addGroup(),c=u.addShape("text",{className:"guide-tag-text",zIndex:1,attrs:A({x:0,y:0,text:i},s)});r.push(c);var d=c.getBBox(),f=fe(n.padding),_=d.width+f[1]+f[3],h=d.height+f[0]+f[2],v=d.minY-f[0],m=d.minX-f[3],g=u.addShape("rect",{className:"guide-tag-bg",zIndex:-1,attrs:A({x:m,y:v,width:_,height:h},n)});r.push(g);var p,b=this.autoAdjust?this._getDirect(t,a,_,h):this.direct,y=this.side,w=a.x+this.offsetX,$=a.y+this.offsetY,C=fe(n.radius);"tl"===b?(p=[{x:_+m-y-1,y:h+v-1},{x:_+m,y:h+v-1},{x:_+m,y:h+y+v}],C[2]=0,w-=_,$=$-y-h):"cl"===b?(p=[{x:_+m-1,y:(h-y)/2+v-1},{x:_+m-1,y:(h+y)/2+v+1},{x:_+y+m,y:h/2+v}],w=w-_-y,$-=h/2):"bl"===b?(p=[{x:_+m,y:-y+v},{x:_+m-y-1,y:v+1},{x:_+m,y:v+1}],C[1]=0,w-=_,$+=y):"bc"===b?(p=[{x:_/2+m,y:-y+v},{x:(_-y)/2+m-1,y:v+1},{x:(_+y)/2+m+1,y:v+1}],w-=_/2,$+=y):"br"===b?(p=[{x:m,y:v-y},{x:m,y:v+1},{x:m+y+1,y:v+1}],C[0]=0,$+=y):"cr"===b?(p=[{x:m-y,y:h/2+v},{x:m+1,y:(h-y)/2+v-1},{x:m+1,y:(h+y)/2+v+1}],w+=y,$-=h/2):"tr"===b?(p=[{x:m,y:h+y+v},{x:m,y:h+v-1},{x:y+m+1,y:h+v-1}],C[3]=0,$=$-h-y):"tc"===b&&(p=[{x:(_-y)/2+m-1,y:h+v-1},{x:(_+y)/2+m+1,y:h+v-1},{x:_/2+m,y:h+y+v}],w-=_/2,$=$-h-y);var x=u.addShape("Polygon",{className:"guide-tag-side",zIndex:0,attrs:{points:p,fill:n.fill}});return r.push(x),g.attr("radius",C),u.moveTo(w-m,$-v),u.sort(),this.element=o,r}},t}(bn);bn.Tag=Tn;var Pn=function(e){function t(){return e.apply(this,arguments)||this}$e(t,e);var a=t.prototype;return a._initDefaultCfg=function(){this.type="point",this.position=null,this.offsetX=0,this.offsetY=0,this.style={fill:"#1890FF",r:3,lineWidth:1,stroke:"#fff"}},a.render=function(e,t){var a=this.parsePoint(e,this.position);if(!a)return null;var i=t.addShape("Circle",{className:"guide-point",attrs:A({x:a.x+this.offsetX,y:a.y+this.offsetY},this.style)});return this.element=i,i},t}(bn);bn.Point=Pn;var In=function(){var e=t.prototype;function t(e){j(this,this.getDefaultCfg(),e),this._init(),this._renderTitle(),this._renderItems()}return e.getDefaultCfg=function(){return{showTitle:!1,title:null,items:null,titleGap:12,itemGap:10,itemMarginBottom:12,itemFormatter:null,itemWidth:null,wordSpace:6,x:0,y:0,layout:"horizontal",joinString:": "}},e._init=function(){var e=this.parent;if(e){var t=e.addGroup({zIndex:this.zIndex||0});this.container=t;var a=t.addGroup();this.wrapper=a;var i=a.addGroup({className:"itemsGroup"});this.itemsGroup=i}},e._renderTitle=function(e){e=e||this.title;var t=this.titleShape,a=0;if(this.showTitle&&e){if(t&&!t.get("destroyed"))t.attr("text",e);else{var i=this.wrapper,n=this.titleStyle;t=i.addShape("text",{className:"title",attrs:A({x:0,y:0,text:e},n)}),this.titleShape=t}a=t.getBBox().height+this.titleGap}this._titleHeight=a},e._renderItems=function(e){var t=this;(e=e||t.items)&&(t.reversed&&e.reverse(),f(e,(function(e,a){t._addItem(e,a)})),e.length>1&&this._adjustItems(),this._renderBackground())},e._renderBackground=function(){var e=this.background;if(e){var t=this.container,a=this.wrapper.getBBox(),i=a.minX,n=a.minY,s=a.width,r=a.height,o=e.padding||[0,0,0,0],l=A({x:i-(o=fe(o))[3],y:n-o[0],width:s+o[1]+o[3],height:r+o[0]+o[2]},e),u=this.backShape;u?u.attr(l):u=t.addShape("Rect",{zIndex:-1,attrs:l}),this.backShape=u,t.sort()}},e._addItem=function(e){var t,a=this.itemsGroup.addGroup({name:e.name,value:e.value,dataValue:e.dataValue,checked:e.checked}),i=this.unCheckStyle,n=this.unCheckColor,s=this.nameStyle,r=this.valueStyle,o=this.wordSpace,l=e.marker,u=e.value,c=0;if(n&&(i.fill=n),l){var d=A({x:l.radius||3,y:this._titleHeight},l);!1===e.checked&&A(d,i),c+=a.addShape("marker",{className:"item-marker",attrs:d}).getBBox().width+o}var f=e.name;if(f){var _=this.joinString||"";f=u?f+_:f,t=a.addShape("text",{className:"name",attrs:A({x:c,y:this._titleHeight,text:this._formatItemValue(f)},s,!1===e.checked?i:null)})}if(u){var h=c;t&&(h+=t.getBBox().width),a.addShape("text",{className:"value",attrs:A({x:h,y:this._titleHeight,text:u},r,!1===e.checked?i:null)})}return a},e._formatItemValue=function(e){var t=this.itemFormatter;return t&&(e=t.call(this,e)),e},e._getMaxItemWidth=function(){var e=this.itemWidth;if(w(e)||u(e))return e;if("auto"===e){for(var t=this.itemsGroup.get("children"),a=t.length,i=0,n=0;n1e-4&&(o++,l=0),_.moveTo(l,o*t),c.push({x:l,y:o*t+r-v/2,width:1.375*m,height:1.375*v}),l+=e+n}this.legendHitBoxes=c},e._adjustVertical=function(){for(var e,t,a=this.maxLength,i=this.itemsGroup,n=this.itemGap,s=this.itemMarginBottom,r=this.itemWidth,o=this._titleHeight,l=i.get("children"),u=0,c=0,d=0,f=[],_=0,h=l.length;_c&&(c=e+n),a-u=t.br.y&&(o=t.br.y-n),r<0&&(r=t.tl.x,a&&a.attr("x1",t.tl.x+s)),i.updatePosition(r,o)}},e.setXTipContent=function(e){var t=this.xTip;e=l(t)?t(e):A({text:e},t),this.xTipBox&&this.xTipBox.updateContent(e)},e.setXTipPosition=function(e){var t=this.showXTip,a=this.canvas,i=this.plotRange,n=this.xTipBox,s=this.crosshairsShapeY;if(t){var r=a.get("height"),o=n.getWidth(),l=n.getHeight(),u=e-o/2,c=i.br.y;u<=i.tl.x&&(u=i.tl.x),u+o>=i.tr.x&&(u=i.tr.x-o),r-c1?(e[0].x+e[e.length-1].x)/2:e[0].x)-d/2+i)<_.x&&(v=_.x),v+d>h.x&&(v=h.x-d),r){var g=m+f;r.attr("points",[{x:o-3,y:g},{x:o+3,y:g},{x:o,y:g+4}]);var p=t.backShape,b=fe(p.attr("radius"));o===_.x?(b[3]=0,r.attr("points",[{x:_.x,y:g},{x:_.x+4,y:g},{x:_.x,y:g+4}])):o===h.x&&(b[2]=0,r.attr("points",[{x:h.x-4,y:g},{x:h.x,y:g},{x:h.x,y:g+4}])),p.attr("radius",b)}t.moveTo(v-u,m-c)}},e.setMarkers=function(e){void 0===e&&(e={});var t=e,a=t.items,i=t.style,n=t.type,s=this._getMarkerGroup(n);if("circle"===n)for(var r=0,o=a.length;r16&&(t.showTooltip(n),t.timeStamp=r)}else t.hideTooltip()}})),ye(this,"handleHideEvent",(function(){t.enable&&t.hideTooltip()})),this.enable=!0,this.cfg={},this.tooltip=null,this.chart=null,this.timeStamp=0,A(this,e);var a=this.chart.get("canvas");this.canvas=a,this.canvasDom=a.get("el")}var t=e.prototype;return t._setCrosshairsCfg=function(){var e=this.chart,t=A({},be.tooltip),a=e.get("geoms"),i=[];f(a,(function(e){var t=e.get("type");-1===i.indexOf(t)&&i.push(t)}));var n=e.get("coord").type;return!a.length||"cartesian"!==n&&"rect"!==n||1===i.length&&-1!==["line","area","path","point"].indexOf(i[0])&&A(t,{showCrosshairs:!0}),t},t._getMaxLength=function(e){void 0===e&&(e={});var t=e,a=t.layout,i=t.plotRange;return"horizontal"===a?i.br.x-i.bl.x:i.bl.y-i.tr.y},t.render=function(){if(!this.tooltip){var e=this.chart,t=e.get("canvas"),a=e.get("frontPlot").addGroup({className:"tooltipContainer",zIndex:10}),i=e.get("backPlot").addGroup({className:"tooltipContainer"}),n=e.get("plotRange"),s=e.get("coord"),r=this._setCrosshairsCfg(),o=this.cfg,l=j({plotRange:n,frontPlot:a,backPlot:i,canvas:t,fixed:s.transposed||s.isPolar},r,o);l.maxLength=this._getMaxLength(l),this._tooltipCfg=l;var u=new An(l);this.tooltip=u,l.alwaysShow&&this.prePoint&&this.showTooltip(this.prePoint),this.bindEvents()}},t.clear=function(){var e=this.tooltip;e&&(e.destroy(),this.unBindEvents()),this.tooltip=null,this._lastActive=null},t._getTooltipMarkerStyle=function(e){void 0===e&&(e={});var t=e,a=t.type,i=t.items,n=this._tooltipCfg;if("rect"===a){var s,r,o,l,u=this.chart,c=u.get("plotRange"),d=c.tl,f=c.br,_=u.get("coord"),h=i[0],v=i[i.length-1],m=h.width;_.transposed?(s=d.x,r=v.y-.75*m,o=f.x-d.x,l=h.y-v.y+1.5*m):(s=h.x-.75*m,r=d.y,o=v.x-h.x+1.5*m,l=f.y-d.y),e.style=A({x:s,y:r,width:o,height:l,fill:"#CCD6EC",opacity:.3},n.tooltipMarkerStyle)}else e.style=A({radius:4,fill:"#fff",lineWidth:2},n.tooltipMarkerStyle);return e},t._setTooltip=function(e,t,a){void 0===a&&(a={}),this.prePoint=e;var i=this._lastActive,n=this.tooltip,s=this._tooltipCfg;t=En(t);var r=this.chart,o=r.get("coord"),l=r.getYScales()[0],u=s.snap;if(!1===u&&l.isLinear){var c,d,f=o.invertPoint(e);Li(e,r.get("plotRange"))&&(o.transposed?(c=l.invert(f.x),d=e.x,n.setXTipContent(c),n.setXTipPosition(d),n.setYCrosshairPosition(d)):(c=l.invert(f.y),d=e.y,n.setYTipContent(c),n.setYTipPosition(d),n.setXCrosshairPosition(d)))}if(s.onShow&&s.onShow({x:e.x,y:e.y,tooltip:n,items:t,tooltipMarkerCfg:a}),_=i,h=t,JSON.stringify(_)!==JSON.stringify(h)){var _,h;this._lastActive=t;var v=s.onChange;v&&v({x:e.x,y:e.y,tooltip:n,items:t,tooltipMarkerCfg:a});var m=t[0],g=m.title||m.name,p=m.x;if(t.length>1&&(p=(t[0].x+t[t.length-1].x)/2),n.setContent(g,t,o.transposed),n.setPosition(t,e),o.transposed){var b=m.y;t.length>1&&(b=(t[0].y+t[t.length-1].y)/2),n.setYTipContent(g),n.setYTipPosition(b),n.setXCrosshairPosition(b),u&&(n.setXTipContent(m.value),n.setXTipPosition(p),n.setYCrosshairPosition(p))}else n.setXTipContent(g),n.setXTipPosition(p),n.setYCrosshairPosition(p),u&&(n.setYTipContent(m.value),n.setYTipPosition(m.y),n.setXCrosshairPosition(m.y));var y=a.items;s.showTooltipMarker&&y.length?(a=this._getTooltipMarkerStyle(a),n.setMarkers(a)):n.clearMarkers(),n.show()}else!1===u&&(_e(s.crosshairsType,"y")||s.showYTip)&&this.chart.get("canvas").draw()},t.showTooltip=function(e){var t,a,i=this.chart,n=[],s=[],r=this._tooltipCfg,o=r.showItemMarker,l=r.itemMarkerStyle,u=r.alwaysShow;o&&(a=l);var d=i.get("geoms"),_=i.get("coord");if(f(d,(function(i){if(i.get("visible")){var r=i.get("type"),o=i.getSnapRecords(e),l=i.get("adjust");if("interval"===r&&l&&"symmetric"===l.type)return;f(o,(function(e){var o=e.x,l=e.y,u=e._origin,d=e.color;if((o||!isNaN(o))&&(l||!isNaN(l))){var f={x:o,y:c(l)?l[1]:l,color:d||be.defaultColor,origin:u,name:jn(i,u),value:Dn(i,u),title:Ln(i,u)};a&&(f.marker=A({fill:d||be.defaultColor},a)),s.push(f),-1!==["line","area","path"].indexOf(r)?(t="circle",n.push(f)):"interval"!==r||"cartesian"!==_.type&&"rect"!==_.type||(t="rect",f.width=i.getSize(e._origin),n.push(f))}}))}})),s.length){var h={items:n,type:t};this._setTooltip(e,s,h)}else u||this.hideTooltip()},t.hideTooltip=function(){var e=this._tooltipCfg;this._lastActive=null;var t=this.tooltip;t&&(t.hide(),e.onHide&&e.onHide({tooltip:t}),this.chart.get("canvas").draw())},t._handleEvent=function(e,t,a){var i=this.canvas;f([].concat(e),(function(e){"bind"===a?i.on(e,t):i.off(e,t)}))},t.bindEvents=function(){var e=this._tooltipCfg,t=e.triggerOn,a=e.triggerOff,i=e.alwaysShow;t&&this._handleEvent(t,this.handleShowEvent,"bind"),i||this._handleEvent(a,this.handleHideEvent,"bind")},t.unBindEvents=function(){var e=this._tooltipCfg,t=e.triggerOn,a=e.triggerOff,i=e.alwaysShow;t&&this._handleEvent(t,this.handleShowEvent,"unBind"),i||this._handleEvent(a,this.handleHideEvent,"unBind")},e}();function Rn(e){var t=new Nn({chart:e});e.set("tooltipController",t),e.tooltip=function(e,a){return d(e)&&(a=e,e=!0),t.enable=e,a&&(t.cfg=a),this}}function Bn(e){var t=e.get("tooltipController");t.render(),e.showTooltip=function(e){return t.showTooltip(e),this},e.hideTooltip=function(){return t.hideTooltip(),this}}function zn(e){e.get("tooltipController").clear()}var Fn={init:Rn,afterGeomDraw:Bn,clearInner:zn},qn=Object.freeze({__proto__:null,init:Rn,afterGeomDraw:Bn,clearInner:zn,default:Fn});be.guide=j({line:{style:{stroke:"#a3a3a3",lineWidth:1},top:!0},text:{style:{fill:"#787878",textAlign:"center",textBaseline:"middle"},offsetX:0,offsetY:0,top:!0},rect:{style:{fill:"#fafafa"},top:!1},arc:{style:{stroke:"#a3a3a3"},top:!0},html:{offsetX:0,offsetY:0,alignX:"center",alignY:"middle"},tag:{top:!0,offsetX:0,offsetY:0,side:4,background:{padding:5,radius:2,fill:"#1890FF"},textStyle:{fontSize:12,fill:"#fff",textAlign:"center",textBaseline:"middle"}},point:{top:!0,offsetX:0,offsetY:0,style:{fill:"#fff",r:3,lineWidth:2,stroke:"#1890ff"}}},be.guide||{});var Vn=function(){function e(e){this.guides=[],this.xScale=null,this.yScales=null,this.guideShapes=[],A(this,e)}var t=e.prototype;return t._toString=function(e){return l(e)&&(e=e(this.xScale,this.yScales)),e.toString()},t._getId=function(e,t){var a=t.id;if(!a){var i=t.type;a="arc"===i||"line"===i||"rect"===i?this._toString(t.start)+"-"+this._toString(t.end):this._toString(t.position)}return a},t.paint=function(e){var t=this,a=t.chart,i=t.guides,n=t.xScale,s=t.yScales,r=[];f(i,(function(i,o){var l;i.xScale=n,i.yScales=s,"regionFilter"===i.type?i.chart=a:l=i.top?t.frontPlot:t.backPlot,i.coord=e,i.container=l,i.canvas=a.get("canvas");var u=i.render(e,l);if(u){var c=t._getId(u,i);[].concat(u).forEach((function(e){e._id=e.get("className")+"-"+c,e.set("index",o),r.push(e)}))}})),t.guideShapes=r},t.clear=function(){return this.reset(),this.guides=[],this},t.reset=function(){f(this.guides,(function(e){e.remove()}))},t._createGuide=function(e,t){var a=k(e),i=new bn[a](j({},be.guide[e],t));return this.guides.push(i),i},t.line=function(e){return void 0===e&&(e={}),this._createGuide("line",e)},t.text=function(e){return void 0===e&&(e={}),this._createGuide("text",e)},t.arc=function(e){return void 0===e&&(e={}),this._createGuide("arc",e)},t.html=function(e){return void 0===e&&(e={}),this._createGuide("html",e)},t.rect=function(e){return void 0===e&&(e={}),this._createGuide("rect",e)},t.tag=function(e){return void 0===e&&(e={}),this._createGuide("tag",e)},t.point=function(e){return void 0===e&&(e={}),this._createGuide("point",e)},t.regionFilter=function(e){return void 0===e&&(e={}),this._createGuide("regionFilter",e)},e}();function Yn(e){var t=new Vn({frontPlot:e.get("frontPlot").addGroup({zIndex:20,className:"guideContainer"}),backPlot:e.get("backPlot").addGroup({className:"guideContainer"})});e.set("guideController",t),e.guide=function(){return t}}function Hn(e){var t=e.get("guideController");if(t.guides.length){var a=e.getXScale(),i=e.getYScales(),n=e.get("coord");t.xScale=a,t.yScales=i,t.chart=e,t.paint(n)}}function Gn(e){e.get("guideController").clear()}function Wn(e){e.get("guideController").reset()}var Un={init:Yn,afterGeomDraw:Hn,clear:Gn,repaint:Wn},Xn=Object.freeze({__proto__:null,init:Yn,afterGeomDraw:Hn,clear:Gn,repaint:Wn,default:Un}),Jn={itemMarginBottom:12,itemGap:10,showTitle:!1,titleStyle:{fontSize:12,fill:"#808080",textAlign:"start",textBaseline:"top"},nameStyle:{fill:"#808080",fontSize:12,textAlign:"start",textBaseline:"middle"},valueStyle:{fill:"#000000",fontSize:12,textAlign:"start",textBaseline:"middle"},unCheckStyle:{fill:"#bfbfbf"},itemWidth:"auto",wordSpace:6,selectedMode:"multiple"};be.legend=j({common:Jn,right:A({position:"right",layout:"vertical"},Jn),left:A({position:"left",layout:"vertical"},Jn),top:A({position:"top",layout:"horizontal"},Jn),bottom:A({position:"bottom",layout:"horizontal"},Jn)},be.legend||{});var Qn=function(){function e(e){var t=this;ye(this,"handleEvent",(function(e){var a=t,i=a.chart,n=ce(e,i),s=function(e,t){var i=null;return f(a.legends,(function(a){f(a,(function(a){var n=a.itemsGroup,s=a.legendHitBoxes,r=n.get("children");if(r.length){var o=a.x,l=a.y;f(s,(function(n,s){if(e>=n.x+o&&e<=n.x+n.width+o&&t>=n.y+l&&t<=n.height+n.y+l)return i={clickedItem:r[s],clickedLegend:a},!1}))}}))})),i}(n.x,n.y);if(s&&!1!==s.clickedLegend.clickable){var r=s.clickedItem,o=s.clickedLegend;if(o.onClick)e.clickedItem=r,o.onClick(e);else if(!o.custom){var l=r.get("checked"),u=r.get("dataValue"),c=o.filteredVals,d=o.field;"single"===o.selectedMode?i.filter(d,(function(e){return e===u})):(l?c.push(u):H(c,u),i.filter(d,(function(e){return-1===c.indexOf(e)}))),i.repaint()}}})),this.legendCfg={},this.enable=!0,this.position="top",A(this,e);var a=this.chart;this.canvasDom=a.get("canvas").get("el"),this.clear()}var t=e.prototype;return t.addLegend=function(e,t,a){var i=this.legendCfg,n=e.field,s=i[n];if(!1===s)return null;if(s&&s.custom)this.addCustomLegend(n);else{var r=i.position||this.position;s&&s.position&&(r=s.position),e.isCategory&&this._addCategoryLegend(e,t,r,a)}},t.addCustomLegend=function(e){var t=this.legendCfg;e&&t[e]&&(t=t[e]);var a=t.position||this.position,i=this.legends;i[a]=i[a]||[];var n=t.items;if(!n)return null;var s=this.container;f(n,(function(e){v(e.marker)?e.marker.radius=e.marker.radius||3:e.marker={symbol:e.marker||"circle",fill:e.fill,radius:3},e.checked=!!u(e.checked)||e.checked,e.name=e.name||e.value}));var r=new In(j({},be.legend[a],t,{maxLength:this._getMaxLength(a),items:n,parent:s}));i[a].push(r)},t.clear=function(){f(this.legends,(function(e){f(e,(function(e){e.clear()}))})),this.legends={},this.unBindEvents()},t._isFiltered=function(e,t,a){var i=!1;return f(t,(function(t){if(i=i||e.getText(t)===e.getText(a))return!1})),i},t._getMaxLength=function(e){var t=this.chart,a=fe(t.get("appendPadding"));return"right"===e||"left"===e?t.get("height")-(a[0]+a[2]):t.get("width")-(a[1]+a[3])},t._addCategoryLegend=function(e,t,a,i){var n=this,s=n.legendCfg,r=n.legends,o=n.container,l=n.chart,u=e.field;r[a]=r[a]||[];var c="circle";s[u]&&s[u].marker?c=s[u].marker:s.marker&&(c=s.marker),f(t,(function(t){v(c)?A(t.marker,c):t.marker.symbol=c,i&&(t.checked=!n._isFiltered(e,i,t.dataValue))})),l.get("legendItems")[u]=t;var d=j({},be.legend[a],s[u]||s,{maxLength:n._getMaxLength(a),items:t,field:u,filteredVals:i,parent:o});d.showTitle&&j(d,{title:e.alias||e.field});var _=new In(d);return r[a].push(_),_},t._alignLegend=function(e,t,a){var i=this.plotRange,n=i.tl,s=i.bl,r=this.chart,o=e.offsetX||0,l=e.offsetY||0,u=r.get("width"),c=r.get("height"),d=fe(r.get("appendPadding")),f=e.getHeight(),_=e.getWidth(),h=0,v=0;if("left"===a||"right"===a){var m=e.verticalAlign||"middle",g=Math.abs(n.y-s.y);h="left"===a?d[3]:u-_-d[1],v=(g-f)/2+n.y,"top"===m?v=n.y:"bottom"===m&&(v=s.y-f),t&&(v=t.get("y")-f-12)}else{var p=e.align||"left";if(h=d[3],"center"===p?h=u/2-_/2:"right"===p&&(h=u-(_+d[1])),v="top"===a?d[0]+Math.abs(e.container.getBBox().minY):c-f,t){var b=t.getWidth();h=t.x+b+12}}"bottom"===a&&l>0&&(l=0),"right"===a&&o>0&&(o=0),e.moveTo(h+o,v+l)},t.alignLegends=function(){var e=this;return f(e.legends,(function(t,a){f(t,(function(i,n){var s=t[n-1];e._alignLegend(i,s,a)}))})),e},t.bindEvents=function(){var e=this.legendCfg.triggerOn||"touchstart";re(this.canvasDom,e,this.handleEvent)},t.unBindEvents=function(){var e=this.legendCfg.triggerOn||"touchstart";oe(this.canvasDom,e,this.handleEvent)},e}();function Zn(e){var t=new Qn({container:e.get("backPlot").addGroup(),plotRange:e.get("plotRange"),chart:e});e.set("legendController",t),e.legend=function(e,a){var i=t.legendCfg;return t.enable=!0,T(e)?(t.enable=e,i=a||{}):d(e)?i=e:i[e]=a,t.legendCfg=i,this}}function Kn(e){var t=e.get("legendController");if(!t.enable)return null;var a=t.legendCfg,i=t.container;if(a&&a.custom)t.addCustomLegend();else{var n=e.getLegendItems(),s=e.get("scales"),r=e.get("filters");f(n,(function(e,a){var i,n=s[a],o=n.values;i=r&&r[a]?o.filter((function(e){return!r[a](e)})):[],t.addLegend(n,e,i)}))}a&&!1!==a.clickable&&t.bindEvents();var o=t.legends,l={top:0,right:0,bottom:0,left:0};f(o,(function(t,a){var i=0;f(t,(function(e){var t=e.getWidth(),n=e.getHeight();"top"===a||"bottom"===a?(i=Math.max(i,n),e.offsetY>0&&(i+=e.offsetY)):(i=Math.max(i,t),e.offsetX>0&&(i+=e.offsetX))})),l[a]=i+function(e,t){var a=0;switch(t=fe(t),e){case"top":a=t[0];break;case"right":a=t[1];break;case"bottom":a=t[2];break;case"left":a=t[3]}return a}(a,e.get("appendPadding"))})),e.set("legendRange",l),Object.keys(o).length?i.set("ariaLabel",pe.legend.prefix):i.set("ariaLabel",null)}function es(e){e.get("legendController").alignLegends()}function ts(e){e.get("legendController").clear(),e.set("legendRange",null)}var as={init:Zn,beforeGeomDraw:Kn,afterGeomDraw:es,clearInner:ts},is=Object.freeze({__proto__:null,init:Zn,beforeGeomDraw:Kn,afterGeomDraw:es,clearInner:ts,default:as}),ns="object"==typeof performance&&performance.now?performance:Date,ss=function(){function e(){this.anims=[],this.time=null,this.playing=!1,this.canvas=[]}var t=e.prototype;return t.play=function(){var e=this;e.time=ns.now(),e.playing=!0,Pi((function t(){e.playing&&(Pi(t),e.update())}))},t.stop=function(){this.playing=!1,this.time=null,this.canvas=[]},t.pushAnim=function(e){this.playing||this.play();var t=e.delay,a=e.duration,i=this.time+t,n=i+a;e.startTime=i,e.endTime=n,this.anims.push(e)},t.update=function(){var e=ns.now();if(this.canvas=[],this.anims.length){for(var t=0;t=a.startTime&&!a.hasStarted&&(a.hasStarted=!0,a.onStart&&a.onStart());var l=(e-a.startTime)/o;if(l=Math.max(0,Math.min(l,1)),l=a.easing(l),a.onFrame)a.onFrame(l);else for(var u in r){var c=(0,r[u])(l),d=void 0;if("points"===u){d=[];for(var f=Math.max(n.points.length,s.points.length),_=0;_=a.endTime&&!a.hasEnded&&(a.hasEnded=!0,a.onEnd&&a.onEnd()),1===l&&(this.anims.splice(t,1),t--)}}}this.canvas.map((function(e){return e.draw(),e})),this.time=ns.now()}else this.stop()},e}();function rs(e){return e}function os(e){return 1-ls(1-e)}function ls(e){return(e/=1)<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375}var us=Object.freeze({__proto__:null,linear:rs,quadraticIn:function(e){return e*e},quadraticOut:function(e){return e*(2-e)},quadraticInOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)},cubicIn:function(e){return e*e*e},cubicOut:function(e){return--e*e*e+1},cubicInOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)},elasticIn:function(e){var t,a=.1;return 0===e?0:1===e?1:(!a||a<1?(a=1,t=.1):t=.4/(2*Math.PI)*Math.asin(1/a),-a*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/.4))},elasticOut:function(e){var t,a=.1;return 0===e?0:1===e?1:(!a||a<1?(a=1,t=.1):t=.4/(2*Math.PI)*Math.asin(1/a),a*Math.pow(2,-10*e)*Math.sin((e-t)*(2*Math.PI)/.4)+1)},elasticInOut:function(e){var t,a=.1,i=.4;return 0===e?0:1===e?1:(!a||a<1?(a=1,t=.1):t=i/(2*Math.PI)*Math.asin(1/a),(e*=2)<1?a*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/i)*-.5:a*Math.pow(2,-10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/i)*.5+1)},backIn:function(e){var t=1.70158;return e*e*((t+1)*e-t)},backOut:function(e){var t=1.70158;return(e-=1)*e*((t+1)*e+t)+1},backInOut:function(e){var t=2.5949095;return(e*=2)<1?e*e*((t+1)*e-t)*.5:.5*((e-=2)*e*((t+1)*e+t)+2)},bounceIn:os,bounceOut:ls,bounceInOut:function(e){return e<.5?.5*os(2*e):.5*ls(2*e-1)+.5}});function cs(e){for(var t=[],a=0,i=e.length;al.x?i.x:l.x,r=l.y+d/2):"xy"===n&&(a.isPolar?(s=a.center.x,r=a.center.y):(s=(l.x+u.x)/2,r=(l.y+u.y)/2));var _=ms(f,[s,r],n);f.isClip=!0,f.endState={matrix:_},f.set("canvas",e.get("canvas")),e.attr("clip",f),gs(f,f.endState,t,(function(){e.attr("clip",null),f.remove(!0)}))}function ws(e,t,a){for(var i=e.get("children"),n=0,s=i.length;n