2&&i.push(a),i}function sb(r,e,t,i,a,n,o,s,l,u){if(Kl(r,t)&&Kl(e,i)&&Kl(a,o)&&Kl(n,s)){l.push(o,s);return}var f=2/u,p=f*f,c=o-r,h=s-e,v=Math.sqrt(c*c+h*h);c/=v,h/=v;var d=t-r,m=i-e,g=a-o,y=n-s,x=d*d+m*m,_=g*g+y*y;if(x=0&&C
=0){l.push(o,s);return}var A=[],D=[];ii(r,t,a,o,.5,A),ii(e,i,n,s,.5,D),sb(A[0],D[0],A[1],D[1],A[2],D[2],A[3],D[3],l,u),sb(A[4],D[4],A[5],D[5],A[6],D[6],A[7],D[7],l,u)}function bk(r,e){var t=Jd(r),i=[];e=e||1;for(var a=0;a0)for(var u=0;uMath.abs(u),p=Ak([l,u],f?0:1,e),c=(f?s:u)/p.length,h=0;h
a,o=Ak([i,a],n?0:1,e),s=n?"width":"height",l=n?"height":"width",u=n?"x":"y",f=n?"y":"x",p=r[s]/o.length,c=0;c1?null:new St(d*l+r,d*u+e)}function bq(r,e,t){var i=new St;St.sub(i,t,e),i.normalize();var a=new St;St.sub(a,r,e);var n=a.dot(i);return n}function jl(r,e){var t=r[r.length-1];t&&t[0]===e[0]&&t[1]===e[1]||r.push(e)}function wq(r,e,t){for(var i=r.length,a=[],n=0;no?(u.x=f.x=s+n/2,u.y=l,f.y=l+o):(u.y=f.y=l+o/2,u.x=s,f.x=s+n),wq(e,u,f)}function Qd(r,e,t,i){if(t===1)i.push(e);else{var a=Math.floor(t/2),n=r(e);Qd(r,n[0],a,i),Qd(r,n[1],t-a,i)}return i}function Tq(r,e){for(var t=[],i=0;i0)for(var b=i/t,S=-i/2;S<=i/2;S+=b){for(var T=Math.sin(S),C=Math.cos(S),A=0,x=0;x0;u/=2){var f=0,p=0;(r&u)>0&&(f=1),(e&u)>0&&(p=1),s+=u*u*(3*f^p),p===0&&(f===1&&(r=u-1-r,e=u-1-e),l=r,r=e,e=l)}return s}function tm(r){var e=1/0,t=1/0,i=-1/0,a=-1/0,n=k(r,function(s){var l=s.getBoundingRect(),u=s.getComputedTransform(),f=l.x+l.width/2+(u?u[4]:0),p=l.y+l.height/2+(u?u[5]:0);return e=Math.min(f,e),t=Math.min(p,t),i=Math.max(f,i),a=Math.max(p,a),[f,p]}),o=k(n,function(s,l){return{cp:s,z:Pq(s[0],s[1],e,t,i,a),path:r[l]}});return o.sort(function(s,l){return s.z-l.z}).map(function(s){return s.path})}function Rk(r){return Dk(r.path,r.count)}function lb(){return{fromIndividuals:[],toIndividuals:[],count:0}}function Ok(r,e,t){var i=[];function a(b){for(var S=0;S=0;a--)if(!t[a].many.length){var l=t[s].many;if(l.length<=1)if(s)s=0;else return t;var n=l.length,u=Math.ceil(n/2);t[a].many=l.slice(u,n),t[s].many=l.slice(0,u),s++}return t}var Rq={clone:function(r){for(var e=[],t=1-Math.pow(1-r.path.style.opacity,1/r.count),i=0;i0))return;var s=i.getModel("universalTransition").get("delay"),l=Object.assign({setToFinal:!0},o),u,f;zk(r)&&(u=r,f=e),zk(e)&&(u=e,f=r);function p(g,y,x,_,b){var S=g.many,T=g.one;if(S.length===1&&!b){var C=y?S[0]:T,A=y?T:S[0];if(xp(C))p({many:[C],one:A},!0,x,_,!0);else{var D=s?X({delay:s(x,_)},l):l;em(C,A,D),n(C,A,C,A,D)}}else for(var M=X({dividePath:Rq[t],individualDelay:s&&function(V,U,F,q){return s(V+x,_)}},l),I=y?Ok(S,T,M):Nk(T,S,M),E=I.fromIndividuals,P=I.toIndividuals,R=E.length,O=0;Oe.length,h=u?kk(f,u):kk(c?e:r,[c?r:e]),v=0,d=0;dGk))for(var a=i.getIndices(),n=Nq(i),o=0;o0&&_.group.traverse(function(S){S instanceof it&&!S.animators.length&&S.animateFrom({style:{opacity:0}},b)})})}function Vk(r){var e=r.getModel("universalTransition").get("seriesKey");return e||r.id}function Bk(r){return z(r)?r.sort().join(","):r}function Qn(r){if(r.hostModel)return r.hostModel.getModel("universalTransition").get("divideShape")}function Uq(r,e){var t=Y(),i=Y(),a=Y();w(r.oldSeries,function(o,s){var l=r.oldDataGroupIds[s],u=r.oldData[s],f=Vk(o),p=Bk(f);i.set(p,{dataGroupId:l,data:u}),z(f)&&w(f,function(c){a.set(c,{key:p,dataGroupId:l,data:u})})});function n(o){t.get(o)&&kw("Duplicated seriesKey in universalTransition "+o)}return w(e.updatedSeries,function(o){if(o.isUniversalTransitionEnabled()&&o.isAnimationEnabled()){var s=o.get("dataGroupId"),l=o.getData(),u=Vk(o),f=Bk(u),p=i.get(f);if(p)t.set(f,{oldSeries:[{dataGroupId:p.dataGroupId,divide:Qn(p.data),data:p.data}],newSeries:[{dataGroupId:s,divide:Qn(l),data:l}]});else if(z(u)){var c=[];w(u,function(d){var m=i.get(d);m.data&&c.push({dataGroupId:m.dataGroupId,divide:Qn(m.data),data:m.data})}),c.length&&t.set(f,{oldSeries:c,newSeries:[{dataGroupId:s,data:l,divide:Qn(l)}]})}else{var h=a.get(u);if(h){var v=t.get(h.key);v||(v={oldSeries:[{dataGroupId:h.dataGroupId,data:h.data,divide:Qn(h.data)}],newSeries:[]},t.set(h.key,v)),v.newSeries.push({dataGroupId:s,data:l,divide:Qn(l)})}}}}),t}function Fk(r,e){for(var t=0;t=0&&a.push({dataGroupId:e.oldDataGroupIds[s],data:e.oldData[s],divide:Qn(e.oldData[s]),dim:o.dimension})}),w(Pt(r.to),function(o){var s=Fk(t.updatedSeries,o);if(s>=0){var l=t.updatedSeries[s].getData();n.push({dataGroupId:e.oldDataGroupIds[s],data:l,divide:Qn(l),dim:o.dimension})}}),a.length>0&&n.length>0&&Hk(a,n,i)}function pb(r){r.registerUpdateLifecycle("series:beforeupdate",function(e,t,i){w(Pt(i.seriesTransition),function(a){w(Pt(a.to),function(n){for(var o=i.updatedSeries,s=0;sa[o],m=[-h.x,-h.y];i||(m[n]=f[u]);var g=[0,0],y=[-v.x,-v.y],x=lt(t.get("pageButtonGap",!0),t.get("itemGap",!0));if(d){var _=t.get("pageButtonPosition",!0);_==="end"?y[n]+=a[o]-v[o]:g[n]+=v[o]+x}y[1-n]+=h[s]/2-v[s]/2,f.setPosition(m),p.setPosition(g),c.setPosition(y);var b={x:0,y:0};if(b[o]=d?a[o]:h[o],b[s]=Math.max(h[s],v[s]),b[l]=Math.min(0,v[l]+y[1-n]),p.__rectSize=a[o],d){var S={x:0,y:0};S[o]=Math.max(a[o]-v[o]-x,0),S[s]=b[s],p.setClipPath(new ht({shape:S})),p.__rectSize=S[o]}else c.eachChild(function(C){C.attr({invisible:!0,silent:!0})});var T=this._getPageInfo(t);return T.pageIndex!=null&&xt(f,{x:T.contentPosition[0],y:T.contentPosition[1]},d?t:null),this._updatePageInfoView(t,T),b},e.prototype._pageGo=function(t,i,a){var n=this._getPageInfo(i)[t];n!=null&&a.dispatchAction({type:"legendScroll",scrollDataIndex:n,legendId:i.id})},e.prototype._updatePageInfoView=function(t,i){var a=this._controllerGroup;w(["pagePrev","pageNext"],function(f){var p=f+"DataIndex",c=i[p]!=null,h=a.childOfName(f);h&&(h.setStyle("fill",c?t.get("pageIconColor",!0):t.get("pageIconInactiveColor",!0)),h.cursor=c?"pointer":"default")});var n=a.childOfName("pageText"),o=t.get("pageFormatter"),s=i.pageIndex,l=s!=null?s+1:0,u=i.pageCount;n&&o&&n.setStyle("text",B(o)?o.replace("{current}",l==null?"":l+"").replace("{total}",u==null?"":u+""):o({current:l,total:u}))},e.prototype._getPageInfo=function(t){var i=t.get("scrollDataIndex",!0),a=this.getContentGroup(),n=this._containerGroup.__rectSize,o=t.getOrient().index,s=H1[o],l=W1[o],u=this._findTargetItemIndex(i),f=a.children(),p=f[u],c=f.length,h=c?1:0,v={contentPosition:[a.x,a.y],pageCount:h,pageIndex:h-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!p)return v;var d=_(p);v.contentPosition[o]=-d.s;for(var m=u+1,g=d,y=d,x=null;m<=c;++m)x=_(f[m]),(!x&&y.e>g.s+n||x&&!b(x,g.s))&&(y.i>g.i?g=y:g=x,g&&(v.pageNextDataIndex==null&&(v.pageNextDataIndex=g.i),++v.pageCount)),y=x;for(var m=u-1,g=d,y=d,x=null;m>=-1;--m)x=_(f[m]),(!x||!b(y,x.s))&&g.i=T&&S.s<=T+n}},e.prototype._findTargetItemIndex=function(t){if(!this._showController)return 0;var i,a=this.getContentGroup(),n;return a.eachChild(function(o,s){var l=o.__legendDataIndex;n==null&&l!=null&&(n=s),l===t&&(i=s)}),i??n},e.type="legend.scroll",e}(Zd),Nz=DX;function Y1(r){r.registerAction("legendScroll","legendscroll",function(e,t){var i=e.scrollDataIndex;i!=null&&t.eachComponent({mainType:"legend",subType:"scroll",query:e},function(a){a.setScrollDataIndex(i)})})}function zz(r){_t(Xd),r.registerComponentModel(Rz),r.registerComponentView(Nz),Y1(r)}function Z1(r){_t(Xd),_t(zz)}var MX=function(r){L(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.type="dataZoom.inside",e.defaultOption=rr(Zn.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),e}(Zn),kz=MX;var X1=nt();function Uz(r,e,t){X1(r).coordSysRecordMap.each(function(i){var a=i.dataZoomInfoMap.get(e.uid);a&&(a.getRange=t)})}function Vz(r,e){for(var t=X1(r).coordSysRecordMap,i=t.keys(),a=0;ai[t+e]&&(e=s),a=a&&o.get("preventDefaultMouseMove",!0)}),{controlType:e,opt:{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!a}}}function Fz(r){r.registerProcessor(r.PRIORITY.PROCESSOR.FILTER,function(e,t){var i=X1(t),a=i.coordSysRecordMap||(i.coordSysRecordMap=Y());a.each(function(n){n.dataZoomInfoMap=null}),e.eachComponent({mainType:"dataZoom",subType:"inside"},function(n){var o=Md(n);w(o.infoList,function(s){var l=s.model.uid,u=a.get(l)||a.set(l,LX(t,s.model)),f=u.dataZoomInfoMap||(u.dataZoomInfoMap=Y());f.set(n.uid,{dzReferCoordSysInfo:s,model:n,getRange:null})})}),a.each(function(n){var o=n.controller,s,l=n.dataZoomInfoMap;if(l){var u=l.keys()[0];u!=null&&(s=l.get(u))}if(!s){Bz(a,n);return}var f=PX(l);o.enable(f.controlType,f.opt),o.setPointerChecker(n.containsPoint),di(n,"dispatchAction",s.model.get("throttle",!0),"fixRate")})})}var OX=function(r){L(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="dataZoom.inside",t}return e.prototype.render=function(t,i,a){if(r.prototype.render.apply(this,arguments),t.noTarget()){this._clear();return}this.range=t.getPercentRange(),Uz(a,t,{pan:W(q1.pan,this),zoom:W(q1.zoom,this),scrollMove:W(q1.scrollMove,this)})},e.prototype.dispose=function(){this._clear(),r.prototype.dispose.apply(this,arguments)},e.prototype._clear=function(){Vz(this.api,this.dataZoomModel),this.range=null},e.type="dataZoom.inside",e}(Fl),q1={zoom:function(r,e,t,i){var a=this.range,n=a.slice(),o=r.axisModels[0];if(o){var s=K1[e](null,[i.originX,i.originY],o,t,r),l=(s.signal>0?s.pixelStart+s.pixelLength-s.pixel:s.pixel-s.pixelStart)/s.pixelLength*(n[1]-n[0])+n[0],u=Math.max(1/i.scale,0);n[0]=(n[0]-l)*u+l,n[1]=(n[1]-l)*u+l;var f=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();if(Ur(0,n,[0,100],0,f.minSpan,f.maxSpan),this.range=n,a[0]!==n[0]||a[1]!==n[1])return n}},pan:Gz(function(r,e,t,i,a,n){var o=K1[i]([n.oldX,n.oldY],[n.newX,n.newY],e,a,t);return o.signal*(r[1]-r[0])*o.pixel/o.pixelLength}),scrollMove:Gz(function(r,e,t,i,a,n){var o=K1[i]([0,0],[n.scrollDelta,n.scrollDelta],e,a,t);return o.signal*(r[1]-r[0])*n.scrollDelta})};function Gz(r){return function(e,t,i,a){var n=this.range,o=n.slice(),s=e.axisModels[0];if(s){var l=r(o,s,e,t,i,a);if(Ur(l,o,[0,100],"all"),this.range=o,n[0]!==o[0]||n[1]!==o[1])return o}}}var K1={grid:function(r,e,t,i,a){var n=t.axis,o={},s=a.model.coordinateSystem.getRect();return r=r||[0,0],n.dim==="x"?(o.pixel=e[0]-r[0],o.pixelLength=s.width,o.pixelStart=s.x,o.signal=n.inverse?1:-1):(o.pixel=e[1]-r[1],o.pixelLength=s.height,o.pixelStart=s.y,o.signal=n.inverse?-1:1),o},polar:function(r,e,t,i,a){var n=t.axis,o={},s=a.model.coordinateSystem,l=s.getRadiusAxis().getExtent(),u=s.getAngleAxis().getExtent();return r=r?s.pointToCoord(r):[0,0],e=s.pointToCoord(e),t.mainType==="radiusAxis"?(o.pixel=e[0]-r[0],o.pixelLength=l[1]-l[0],o.pixelStart=l[0],o.signal=n.inverse?1:-1):(o.pixel=e[1]-r[1],o.pixelLength=u[1]-u[0],o.pixelStart=u[0],o.signal=n.inverse?-1:1),o},singleAxis:function(r,e,t,i,a){var n=t.axis,o=a.model.coordinateSystem.getRect(),s={};return r=r||[0,0],n.orient==="horizontal"?(s.pixel=e[0]-r[0],s.pixelLength=o.width,s.pixelStart=o.x,s.signal=n.inverse?1:-1):(s.pixel=e[1]-r[1],s.pixelLength=o.height,s.pixelStart=o.y,s.signal=n.inverse?-1:1),s}},Hz=OX;function pp(r){vs(r),r.registerComponentModel(kz),r.registerComponentView(Hz),Fz(r)}var NX=function(r){L(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.type="dataZoom.slider",e.layoutMode="box",e.defaultOption=rr(Zn.defaultOption,{show:!0,right:"ph",top:"ph",width:"ph",height:"ph",left:null,bottom:null,borderColor:"#d2dbee",borderRadius:3,backgroundColor:"rgba(47,69,84,0)",dataBackground:{lineStyle:{color:"#d2dbee",width:.5},areaStyle:{color:"#d2dbee",opacity:.2}},selectedDataBackground:{lineStyle:{color:"#8fb0f7",width:.5},areaStyle:{color:"#8fb0f7",opacity:.2}},fillerColor:"rgba(135,175,274,0.2)",handleIcon:"path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z",handleSize:"100%",handleStyle:{color:"#fff",borderColor:"#ACB8D1"},moveHandleSize:7,moveHandleIcon:"path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z",moveHandleStyle:{color:"#D2DBEE",opacity:.7},showDetail:!0,showDataShadow:"auto",realtime:!0,zoomLock:!1,textStyle:{color:"#6E7079"},brushSelect:!0,brushStyle:{color:"rgba(135,175,274,0.15)"},emphasis:{handleStyle:{borderColor:"#8FB0F7"},moveHandleStyle:{color:"#8FB0F7"}}}),e}(Zn),Wz=NX;var cp=ht,Yz=7,zX=1,j1=30,kX=7,hp="horizontal",Zz="vertical",UX=5,VX=["line","bar","candlestick","scatter"],BX={easing:"cubicOut",duration:100,delay:0},FX=function(r){L(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t._displayables={},t}return e.prototype.init=function(t,i){this.api=i,this._onBrush=W(this._onBrush,this),this._onBrushEnd=W(this._onBrushEnd,this)},e.prototype.render=function(t,i,a,n){if(r.prototype.render.apply(this,arguments),di(this,"_dispatchZoomAction",t.get("throttle"),"fixRate"),this._orient=t.getOrient(),t.get("show")===!1){this.group.removeAll();return}if(t.noTarget()){this._clear(),this.group.removeAll();return}(!n||n.type!=="dataZoom"||n.from!==this.uid)&&this._buildView(),this._updateView()},e.prototype.dispose=function(){this._clear(),r.prototype.dispose.apply(this,arguments)},e.prototype._clear=function(){Ha(this,"_dispatchZoomAction");var t=this.api.getZr();t.off("mousemove",this._onBrush),t.off("mouseup",this._onBrushEnd)},e.prototype._buildView=function(){var t=this.group;t.removeAll(),this._brushing=!1,this._displayables.brushRect=null,this._resetLocation(),this._resetInterval();var i=this._displayables.sliderGroup=new j;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),t.add(i),this._positionGroup()},e.prototype._resetLocation=function(){var t=this.dataZoomModel,i=this.api,a=t.get("brushSelect"),n=a?kX:0,o=this._findCoordRect(),s={width:i.getWidth(),height:i.getHeight()},l=this._orient===hp?{right:s.width-o.x-o.width,top:s.height-j1-Yz-n,width:o.width,height:j1}:{right:Yz,top:o.y,width:j1,height:o.height},u=ci(t.option);w(["right","top","width","height"],function(p){u[p]==="ph"&&(u[p]=l[p])});var f=Ft(u,s);this._location={x:f.x,y:f.y},this._size=[f.width,f.height],this._orient===Zz&&this._size.reverse()},e.prototype._positionGroup=function(){var t=this.group,i=this._location,a=this._orient,n=this.dataZoomModel.getFirstTargetAxisModel(),o=n&&n.get("inverse"),s=this._displayables.sliderGroup,l=(this._dataShadowInfo||{}).otherAxisInverse;s.attr(a===hp&&!o?{scaleY:l?1:-1,scaleX:1}:a===hp&&o?{scaleY:l?1:-1,scaleX:-1}:a===Zz&&!o?{scaleY:l?-1:1,scaleX:1,rotation:Math.PI/2}:{scaleY:l?-1:1,scaleX:-1,rotation:Math.PI/2});var u=t.getBoundingRect([s]);t.x=i.x-u.x,t.y=i.y-u.y,t.markRedraw()},e.prototype._getViewExtent=function(){return[0,this._size[0]]},e.prototype._renderBackground=function(){var t=this.dataZoomModel,i=this._size,a=this._displayables.sliderGroup,n=t.get("brushSelect");a.add(new cp({silent:!0,shape:{x:0,y:0,width:i[0],height:i[1]},style:{fill:t.get("backgroundColor")},z2:-40}));var o=new cp({shape:{x:0,y:0,width:i[0],height:i[1]},style:{fill:"transparent"},z2:0,onclick:W(this._onClickPanel,this)}),s=this.api.getZr();n?(o.on("mousedown",this._onBrushStart,this),o.cursor="crosshair",s.on("mousemove",this._onBrush),s.on("mouseup",this._onBrushEnd)):(s.off("mousemove",this._onBrush),s.off("mouseup",this._onBrushEnd)),a.add(o)},e.prototype._renderDataShadow=function(){var t=this._dataShadowInfo=this._prepareDataShadowInfo();if(this._displayables.dataShadowSegs=[],!t)return;var i=this._size,a=this._shadowSize||[],n=t.series,o=n.getRawData(),s=n.getShadowDim&&n.getShadowDim(),l=s&&o.getDimensionInfo(s)?n.getShadowDim():t.otherDim;if(l==null)return;var u=this._shadowPolygonPts,f=this._shadowPolylinePts;if(o!==this._shadowData||l!==this._shadowDim||i[0]!==a[0]||i[1]!==a[1]){var p=o.getDataExtent(l),c=(p[1]-p[0])*.3;p=[p[0]-c,p[1]+c];var h=[0,i[1]],v=[0,i[0]],d=[[i[0],0],[0,0]],m=[],g=v[1]/(o.count()-1),y=0,x=Math.round(o.count()/i[0]),_;o.each([l],function(A,D){if(x>0&&D%x){y+=g;return}var M=A==null||isNaN(A)||A==="",I=M?0:kt(A,p,h,!0);M&&!_&&D?(d.push([d[d.length-1][0],0]),m.push([m[m.length-1][0],0])):!M&&_&&(d.push([y,0]),m.push([y,0])),d.push([y,I]),m.push([y,I]),y+=g,_=M}),u=this._shadowPolygonPts=d,f=this._shadowPolylinePts=m}this._shadowData=o,this._shadowDim=l,this._shadowSize=[i[0],i[1]];var b=this.dataZoomModel;function S(A){var D=b.getModel(A?"selectedDataBackground":"dataBackground"),M=new j,I=new oe({shape:{points:u},segmentIgnoreThreshold:1,style:D.getModel("areaStyle").getAreaStyle(),silent:!0,z2:-20}),E=new ae({shape:{points:f},segmentIgnoreThreshold:1,style:D.getModel("lineStyle").getLineStyle(),silent:!0,z2:-19});return M.add(I),M.add(E),M}for(var T=0;T<3;T++){var C=S(T===1);this._displayables.sliderGroup.add(C),this._displayables.dataShadowSegs.push(C)}},e.prototype._prepareDataShadowInfo=function(){var t=this.dataZoomModel,i=t.get("showDataShadow");if(i!==!1){var a,n=this.ecModel;return t.eachTargetAxis(function(o,s){var l=t.getAxisProxy(o,s).getTargetSeriesModels();w(l,function(u){if(!a&&!(i!==!0&&at(VX,u.get("type"))<0)){var f=n.getComponent(Ti(o),s).axis,p=GX(o),c,h=u.coordinateSystem;p!=null&&h.getOtherAxis&&(c=h.getOtherAxis(f).inverse),p=u.getData().mapDimension(p),a={thisAxis:f,series:u,thisDim:o,otherDim:p,otherAxisInverse:c}}},this)},this),a}},e.prototype._renderHandle=function(){var t=this.group,i=this._displayables,a=i.handles=[null,null],n=i.handleLabels=[null,null],o=this._displayables.sliderGroup,s=this._size,l=this.dataZoomModel,u=this.api,f=l.get("borderRadius")||0,p=l.get("brushSelect"),c=i.filler=new cp({silent:p,style:{fill:l.get("fillerColor")},textConfig:{position:"inside"}});o.add(c),o.add(new cp({silent:!0,subPixelOptimize:!0,shape:{x:0,y:0,width:s[0],height:s[1],r:f},style:{stroke:l.get("dataBackgroundColor")||l.get("borderColor"),lineWidth:zX,fill:"rgba(0,0,0,0)"}})),w([0,1],function(x){var _=l.get("handleIcon");!ff[_]&&_.indexOf("path://")<0&&_.indexOf("image://")<0&&(_="path://"+_);var b=Gt(_,-1,0,2,2,null,!0);b.attr({cursor:Xz(this._orient),draggable:!0,drift:W(this._onDragMove,this,x),ondragend:W(this._onDragEnd,this),onmouseover:W(this._showDataInfo,this,!0),onmouseout:W(this._showDataInfo,this,!1),z2:5});var S=b.getBoundingRect(),T=l.get("handleSize");this._handleHeight=H(T,this._size[1]),this._handleWidth=S.width/S.height*this._handleHeight,b.setStyle(l.getModel("handleStyle").getItemStyle()),b.style.strokeNoScale=!0,b.rectHover=!0,b.ensureState("emphasis").style=l.getModel(["emphasis","handleStyle"]).getItemStyle(),oa(b);var C=l.get("handleColor");C!=null&&(b.style.fill=C),o.add(a[x]=b);var A=l.getModel("textStyle");t.add(n[x]=new gt({silent:!0,invisible:!0,style:Vt(A,{x:0,y:0,text:"",verticalAlign:"middle",align:"center",fill:A.getTextColor(),font:A.getFont()}),z2:10}))},this);var h=c;if(p){var v=H(l.get("moveHandleSize"),s[1]),d=i.moveHandle=new ht({style:l.getModel("moveHandleStyle").getItemStyle(),silent:!0,shape:{r:[0,0,2,2],y:s[1]-.5,height:v}}),m=v*.8,g=i.moveHandleIcon=Gt(l.get("moveHandleIcon"),-m/2,-m/2,m,m,"#fff",!0);g.silent=!0,g.y=s[1]+v/2-.5,d.ensureState("emphasis").style=l.getModel(["emphasis","moveHandleStyle"]).getItemStyle();var y=Math.min(s[1]/2,Math.max(v,10));h=i.moveZone=new ht({invisible:!0,shape:{y:s[1]-y,height:v+y}}),h.on("mouseover",function(){u.enterEmphasis(d)}).on("mouseout",function(){u.leaveEmphasis(d)}),o.add(d),o.add(g),o.add(h)}h.attr({draggable:!0,cursor:Xz(this._orient),drift:W(this._onDragMove,this,"all"),ondragstart:W(this._showDataInfo,this,!0),ondragend:W(this._onDragEnd,this),onmouseover:W(this._showDataInfo,this,!0),onmouseout:W(this._showDataInfo,this,!1)})},e.prototype._resetInterval=function(){var t=this._range=this.dataZoomModel.getPercentRange(),i=this._getViewExtent();this._handleEnds=[kt(t[0],[0,100],i,!0),kt(t[1],[0,100],i,!0)]},e.prototype._updateInterval=function(t,i){var a=this.dataZoomModel,n=this._handleEnds,o=this._getViewExtent(),s=a.findRepresentativeAxisProxy().getMinMaxSpan(),l=[0,100];Ur(i,n,o,a.get("zoomLock")?"all":t,s.minSpan!=null?kt(s.minSpan,l,o,!0):null,s.maxSpan!=null?kt(s.maxSpan,l,o,!0):null);var u=this._range,f=this._range=Ae([kt(n[0],o,l,!0),kt(n[1],o,l,!0)]);return!u||u[0]!==f[0]||u[1]!==f[1]},e.prototype._updateView=function(t){var i=this._displayables,a=this._handleEnds,n=Ae(a.slice()),o=this._size;w([0,1],function(h){var v=i.handles[h],d=this._handleHeight;v.attr({scaleX:d/2,scaleY:d/2,x:a[h]+(h?-1:1),y:o[1]/2-d/2})},this),i.filler.setShape({x:n[0],y:0,width:n[1]-n[0],height:o[1]});var s={x:n[0],width:n[1]-n[0]};i.moveHandle&&(i.moveHandle.setShape(s),i.moveZone.setShape(s),i.moveZone.getBoundingRect(),i.moveHandleIcon&&i.moveHandleIcon.attr("x",s.x+s.width/2));for(var l=i.dataShadowSegs,u=[0,n[0],n[1],o[0]],f=0;fi[0]||a[1]<0||a[1]>i[1])){var n=this._handleEnds,o=(n[0]+n[1])/2,s=this._updateInterval("all",a[0]-o);this._updateView(),s&&this._dispatchZoomAction(!1)}},e.prototype._onBrushStart=function(t){var i=t.offsetX,a=t.offsetY;this._brushStart=new St(i,a),this._brushing=!0,this._brushStartTime=+new Date},e.prototype._onBrushEnd=function(t){if(this._brushing){var i=this._displayables.brushRect;if(this._brushing=!1,!!i){i.attr("ignore",!0);var a=i.shape,n=+new Date;if(!(n-this._brushStartTime<200&&Math.abs(a.width)<5)){var o=this._getViewExtent(),s=[0,100];this._range=Ae([kt(a.x,o,s,!0),kt(a.x+a.width,o,s,!0)]),this._handleEnds=[a.x,a.x+a.width],this._updateView(),this._dispatchZoomAction(!1)}}}},e.prototype._onBrush=function(t){this._brushing&&(_r(t.event),this._updateBrushRect(t.offsetX,t.offsetY))},e.prototype._updateBrushRect=function(t,i){var a=this._displayables,n=this.dataZoomModel,o=a.brushRect;o||(o=a.brushRect=new cp({silent:!0,style:n.getModel("brushStyle").getItemStyle()}),a.sliderGroup.add(o)),o.attr("ignore",!1);var s=this._brushStart,l=this._displayables.sliderGroup,u=l.transformCoordToLocal(t,i),f=l.transformCoordToLocal(s.x,s.y),p=this._size;u[0]=Math.max(Math.min(p[0],u[0]),0),o.setShape({x:f[0],y:0,width:u[0]-f[0],height:p[1]})},e.prototype._dispatchZoomAction=function(t){var i=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,animation:t?BX:null,start:i[0],end:i[1]})},e.prototype._findCoordRect=function(){var t,i=Md(this.dataZoomModel).infoList;if(!t&&i.length){var a=i[0].model.coordinateSystem;t=a.getRect&&a.getRect()}if(!t){var n=this.api.getWidth(),o=this.api.getHeight();t={x:n*.2,y:o*.2,width:n*.6,height:o*.6}}return t},e.type="dataZoom.slider",e}(Fl);function GX(r){var e={x:"y",y:"x",radius:"angle",angle:"radius"};return e[r]}function Xz(r){return r==="vertical"?"ns-resize":"ew-resize"}var qz=FX;function vp(r){r.registerComponentModel(Wz),r.registerComponentView(qz),vs(r)}function J1(r){_t(pp),_t(vp)}var HX={get:function(r,e,t){var i=J((WX[r]||{})[e]);return t&&z(i)?i[i.length-1]:i}},WX={color:{active:["#006edd","#e0ffff"],inactive:["rgba(0,0,0,0)"]},colorHue:{active:[0,360],inactive:[0,0]},colorSaturation:{active:[.3,1],inactive:[0,0]},colorLightness:{active:[.9,.5],inactive:[0,0]},colorAlpha:{active:[.3,1],inactive:[0,0]},opacity:{active:[.3,1],inactive:[0,0]},symbol:{active:["circle","roundRect","diamond"],inactive:["none"]},symbolSize:{active:[10,50],inactive:[0,0]}},qd=HX;var Kz=ce.mapVisual,YX=ce.eachVisual,ZX=z,jz=w,XX=Ae,qX=kt,KX=function(r){L(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.stateList=["inRange","outOfRange"],t.replacableOptionKeys=["inRange","outOfRange","target","controller","color"],t.layoutMode={type:"box",ignoreSize:!0},t.dataBound=[-1/0,1/0],t.targetVisuals={},t.controllerVisuals={},t}return e.prototype.init=function(t,i,a){this.mergeDefaultAndTheme(t,a)},e.prototype.optionUpdated=function(t,i){var a=this.option;!i&&Od(a,t,this.replacableOptionKeys),this.textStyleModel=this.getModel("textStyle"),this.resetItemSize(),this.completeVisualOption()},e.prototype.resetVisual=function(t){var i=this.stateList;t=W(t,this),this.controllerVisuals=sp(this.option.controller,i,t),this.targetVisuals=sp(this.option.target,i,t)},e.prototype.getItemSymbol=function(){return null},e.prototype.getTargetSeriesIndices=function(){var t=this.option.seriesIndex,i=[];return t==null||t==="all"?this.ecModel.eachSeries(function(a,n){i.push(n)}):i=Pt(t),i},e.prototype.eachTargetSeries=function(t,i){w(this.getTargetSeriesIndices(),function(a){var n=this.ecModel.getSeriesByIndex(a);n&&t.call(i,n)},this)},e.prototype.isTargetSeries=function(t){var i=!1;return this.eachTargetSeries(function(a){a===t&&(i=!0)}),i},e.prototype.formatValueText=function(t,i,a){var n=this.option,o=n.precision,s=this.dataBound,l=n.formatter,u;a=a||["<",">"],z(t)&&(t=t.slice(),u=!0);var f=i?t:u?[p(t[0]),p(t[1])]:p(t);if(B(l))return l.replace("{value}",u?f[0]:f).replace("{value2}",u?f[1]:f);if(Z(l))return u?l(t[0],t[1]):l(t);if(u)return t[0]===s[0]?a[0]+" "+f[1]:t[1]===s[1]?a[1]+" "+f[0]:f[0]+" - "+f[1];return f;function p(c){return c===s[0]?"min":c===s[1]?"max":(+c).toFixed(Math.min(o,20))}},e.prototype.resetExtent=function(){var t=this.option,i=XX([t.min,t.max]);this._dataExtent=i},e.prototype.getDataDimensionIndex=function(t){var i=this.option.dimension;if(i!=null)return t.getDimensionIndex(i);for(var a=t.dimensions,n=a.length-1;n>=0;n--){var o=a[n],s=t.getDimensionInfo(o);if(!s.isCalculationCoord)return s.storeDimIndex}},e.prototype.getExtent=function(){return this._dataExtent.slice()},e.prototype.completeVisualOption=function(){var t=this.ecModel,i=this.option,a={inRange:i.inRange,outOfRange:i.outOfRange},n=i.target||(i.target={}),o=i.controller||(i.controller={});st(n,a),st(o,a);var s=this.isCategory();l.call(this,n),l.call(this,o),u.call(this,n,"inRange","outOfRange"),f.call(this,o);function l(p){ZX(i.color)&&!p.inRange&&(p.inRange={color:i.color.slice().reverse()}),p.inRange=p.inRange||{color:t.get("gradientColor")}}function u(p,c,h){var v=p[c],d=p[h];v&&!d&&(d=p[h]={},jz(v,function(m,g){if(ce.isValidType(g)){var y=qd.get(g,"inactive",s);y!=null&&(d[g]=y,g==="color"&&!d.hasOwnProperty("opacity")&&!d.hasOwnProperty("colorAlpha")&&(d.opacity=[0,0]))}}))}function f(p){var c=(p.inRange||{}).symbol||(p.outOfRange||{}).symbol,h=(p.inRange||{}).symbolSize||(p.outOfRange||{}).symbolSize,v=this.get("inactiveColor"),d=this.getItemSymbol(),m=d||"roundRect";jz(this.stateList,function(g){var y=this.itemSize,x=p[g];x||(x=p[g]={color:s?v:[v]}),x.symbol==null&&(x.symbol=c&&J(c)||(s?m:[m])),x.symbolSize==null&&(x.symbolSize=h&&J(h)||(s?y[0]:[y[0],y[0]])),x.symbol=Kz(x.symbol,function(S){return S==="none"?m:S});var _=x.symbolSize;if(_!=null){var b=-1/0;YX(_,function(S){S>b&&(b=S)}),x.symbolSize=Kz(_,function(S){return qX(S,[0,b],[0,y[0]],!0)})}},this)}},e.prototype.resetItemSize=function(){this.itemSize=[parseFloat(this.get("itemWidth")),parseFloat(this.get("itemHeight"))]},e.prototype.isCategory=function(){return!!this.option.categories},e.prototype.setSelected=function(t){},e.prototype.getSelected=function(){return null},e.prototype.getValueState=function(t){return null},e.prototype.getVisualMeta=function(t){return null},e.type="visualMap",e.dependencies=["series"],e.defaultOption={show:!0,z:4,seriesIndex:"all",min:0,max:200,left:0,right:null,top:null,bottom:0,itemWidth:null,itemHeight:null,inverse:!1,orient:"vertical",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",contentColor:"#5793f3",inactiveColor:"#aaa",borderWidth:0,padding:5,textGap:10,precision:0,textStyle:{color:"#333"}},e}(yt),Zl=KX;var Jz=[20,140],jX=function(r){L(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.optionUpdated=function(t,i){r.prototype.optionUpdated.apply(this,arguments),this.resetExtent(),this.resetVisual(function(a){a.mappingMethod="linear",a.dataExtent=this.getExtent()}),this._resetRange()},e.prototype.resetItemSize=function(){r.prototype.resetItemSize.apply(this,arguments);var t=this.itemSize;(t[0]==null||isNaN(t[0]))&&(t[0]=Jz[0]),(t[1]==null||isNaN(t[1]))&&(t[1]=Jz[1])},e.prototype._resetRange=function(){var t=this.getExtent(),i=this.option.range;!i||i.auto?(t.auto=1,this.option.range=t):z(i)&&(i[0]>i[1]&&i.reverse(),i[0]=Math.max(i[0],t[0]),i[1]=Math.min(i[1],t[1]))},e.prototype.completeVisualOption=function(){r.prototype.completeVisualOption.apply(this,arguments),w(this.stateList,function(t){var i=this.option.controller[t].symbolSize;i&&i[0]!==i[1]&&(i[0]=i[1]/3)},this)},e.prototype.setSelected=function(t){this.option.range=t.slice(),this._resetRange()},e.prototype.getSelected=function(){var t=this.getExtent(),i=Ae((this.get("range")||[]).slice());return i[0]>t[1]&&(i[0]=t[1]),i[1]>t[1]&&(i[1]=t[1]),i[0]=a[1]||t<=i[1])?"inRange":"outOfRange"},e.prototype.findTargetDataIndices=function(t){var i=[];return this.eachTargetSeries(function(a){var n=[],o=a.getData();o.each(this.getDataDimensionIndex(o),function(s,l){t[0]<=s&&s<=t[1]&&n.push(l)},this),i.push({seriesId:a.id,dataIndex:n})},this),i},e.prototype.getVisualMeta=function(t){var i=Qz(this,"outOfRange",this.getExtent()),a=Qz(this,"inRange",this.option.range.slice()),n=[];function o(h,v){n.push({value:h,color:t(h,v)})}for(var s=0,l=0,u=a.length,f=i.length;lt[1])break;n.push({color:this.getControllerVisual(l,"color",i),offset:s/a})}return n.push({color:this.getControllerVisual(t[1],"color",i),offset:1}),n},e.prototype._createBarPoints=function(t,i){var a=this.visualMapModel.itemSize;return[[a[0]-i[0],t[0]],[a[0],t[0]],[a[0],t[1]],[a[0]-i[1],t[1]]]},e.prototype._createBarGroup=function(t){var i=this._orient,a=this.visualMapModel.get("inverse");return new j(i==="horizontal"&&!a?{scaleX:t==="bottom"?1:-1,rotation:Math.PI/2}:i==="horizontal"&&a?{scaleX:t==="bottom"?-1:1,rotation:-Math.PI/2}:i==="vertical"&&!a?{scaleX:t==="left"?1:-1,scaleY:-1}:{scaleX:t==="left"?1:-1})},e.prototype._updateHandle=function(t,i){if(this._useHandle){var a=this._shapes,n=this.visualMapModel,o=a.handleThumbs,s=a.handleLabels,l=n.itemSize,u=n.getExtent();QX([0,1],function(f){var p=o[f];p.setStyle("fill",i.handlesColor[f]),p.y=t[f];var c=ba(t[f],[0,l[1]],u,!0),h=this.getControllerVisual(c,"symbolSize");p.scaleX=p.scaleY=h/l[0],p.x=l[0]-h/2;var v=Ye(a.handleLabelPoints[f],Pi(p,this.group));s[f].setStyle({x:v[0],y:v[1],text:n.formatValueText(this._dataInterval[f]),verticalAlign:"middle",align:this._orient==="vertical"?this._applyTransform("left",a.mainGroup):"center"})},this)}},e.prototype._showIndicator=function(t,i,a,n){var o=this.visualMapModel,s=o.getExtent(),l=o.itemSize,u=[0,l[1]],f=this._shapes,p=f.indicator;if(p){p.attr("invisible",!1);var c={convertOpacityToAlpha:!0},h=this.getControllerVisual(t,"color",c),v=this.getControllerVisual(t,"symbolSize"),d=ba(t,s,u,!0),m=l[0]-v/2,g={x:p.x,y:p.y};p.y=d,p.x=m;var y=Ye(f.indicatorLabelPoint,Pi(p,this.group)),x=f.indicatorLabel;x.attr("invisible",!1);var _=this._applyTransform("left",f.mainGroup),b=this._orient,S=b==="horizontal";x.setStyle({text:(a||"")+o.formatValueText(i),verticalAlign:S?_:"middle",align:S?"center":_});var T={x:m,y:d,style:{fill:h}},C={style:{x:y[0],y:y[1]}};if(o.ecModel.isAnimationEnabled()&&!this._firstShowIndicator){var A={duration:100,easing:"cubicInOut",additive:!0};p.x=g.x,p.y=g.y,p.animateTo(T,A),x.animateTo(C,A)}else p.attr(T),x.attr(C);this._firstShowIndicator=!1;var D=this._shapes.handleLabels;if(D)for(var M=0;Mo[1]&&(p[1]=1/0),i&&(p[0]===-1/0?this._showIndicator(f,p[1],"< ",l):p[1]===1/0?this._showIndicator(f,p[0],"> ",l):this._showIndicator(f,f,"\u2248 ",l));var c=this._hoverLinkDataIndices,h=[];(i||ak(a))&&(h=this._hoverLinkDataIndices=a.findTargetDataIndices(p));var v=Yw(c,h);this._dispatchHighDown("downplay",Xl(v[0],a)),this._dispatchHighDown("highlight",Xl(v[1],a))}},e.prototype._hoverLinkFromSeriesMouseOver=function(t){var i;if(Ui(t.target,function(l){var u=et(l);if(u.dataIndex!=null)return i=u,!0},!0),!!i){var a=this.ecModel.getSeriesByIndex(i.seriesIndex),n=this.visualMapModel;if(n.isTargetSeries(a)){var o=a.getData(i.dataType),s=o.getStore().get(n.getDataDimensionIndex(o),i.dataIndex);isNaN(s)||this._showIndicator(s,s)}}},e.prototype._hideIndicator=function(){var t=this._shapes;t.indicator&&t.indicator.attr("invisible",!0),t.indicatorLabel&&t.indicatorLabel.attr("invisible",!0);var i=this._shapes.handleLabels;if(i)for(var a=0;a=0&&(n.dimension=o,i.push(n))}}),r.getData().setVisual("visualMeta",i)}}];function iq(r,e,t,i){for(var a=e.targetVisuals[i],n=ce.prepareVisualTypes(a),o={color:fa(r.getData(),"color")},s=0,l=n.length;s0:e.splitNumber>0)||e.calculable)?"continuous":"piecewise"}),r.registerAction(sk,lk),w(uk,function(e){r.registerVisual(r.PRIORITY.VISUAL.COMPONENT,e)}),r.registerPreprocessor($1))}function mp(r){r.registerComponentModel($z),r.registerComponentView(ok),dp(r)}var aq=function(r){L(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t._pieceList=[],t}return e.prototype.optionUpdated=function(t,i){r.prototype.optionUpdated.apply(this,arguments),this.resetExtent();var a=this._mode=this._determineMode();this._pieceList=[],nq[this._mode].call(this,this._pieceList),this._resetSelected(t,i);var n=this.option.categories;this.resetVisual(function(o,s){a==="categories"?(o.mappingMethod="category",o.categories=J(n)):(o.dataExtent=this.getExtent(),o.mappingMethod="piecewise",o.pieceList=k(this._pieceList,function(l){return l=J(l),s!=="inRange"&&(l.visual=null),l}))})},e.prototype.completeVisualOption=function(){var t=this.option,i={},a=ce.listVisualTypes(),n=this.isCategory();w(t.pieces,function(s){w(a,function(l){s.hasOwnProperty(l)&&(i[l]=1)})}),w(i,function(s,l){var u=!1;w(this.stateList,function(f){u=u||o(t,f,l)||o(t.target,f,l)},this),!u&&w(this.stateList,function(f){(t[f]||(t[f]={}))[l]=qd.get(l,f==="inRange"?"active":"inactive",n)})},this);function o(s,l,u){return s&&s[l]&&s[l].hasOwnProperty(u)}r.prototype.completeVisualOption.apply(this,arguments)},e.prototype._resetSelected=function(t,i){var a=this.option,n=this._pieceList,o=(i?a:t).selected||{};if(a.selected=o,w(n,function(l,u){var f=this.getSelectedMapKey(l);o.hasOwnProperty(f)||(o[f]=!0)},this),a.selectedMode==="single"){var s=!1;w(n,function(l,u){var f=this.getSelectedMapKey(l);o[f]&&(s?o[f]=!1:s=!0)},this)}},e.prototype.getItemSymbol=function(){return this.get("itemSymbol")},e.prototype.getSelectedMapKey=function(t){return this._mode==="categories"?t.value+"":t.index+""},e.prototype.getPieceList=function(){return this._pieceList},e.prototype._determineMode=function(){var t=this.option;return t.pieces&&t.pieces.length>0?"pieces":this.option.categories?"categories":"splitNumber"},e.prototype.setSelected=function(t){this.option.selected=J(t)},e.prototype.getValueState=function(t){var i=ce.findPieceIndex(t,this._pieceList);return i!=null&&this.option.selected[this.getSelectedMapKey(this._pieceList[i])]?"inRange":"outOfRange"},e.prototype.findTargetDataIndices=function(t){var i=[],a=this._pieceList;return this.eachTargetSeries(function(n){var o=[],s=n.getData();s.each(this.getDataDimensionIndex(s),function(l,u){var f=ce.findPieceIndex(l,a);f===t&&o.push(u)},this),i.push({seriesId:n.id,dataIndex:o})},this),i},e.prototype.getRepresentValue=function(t){var i;if(this.isCategory())i=t.value;else if(t.value!=null)i=t.value;else{var a=t.interval||[];i=a[0]===-1/0&&a[1]===1/0?0:(a[0]+a[1])/2}return i},e.prototype.getVisualMeta=function(t){if(this.isCategory())return;var i=[],a=["",""],n=this;function o(f,p){var c=n.getRepresentValue({interval:f});p||(p=n.getValueState(c));var h=t(c,p);f[0]===-1/0?a[0]=h:f[1]===1/0?a[1]=h:i.push({value:f[0],color:h},{value:f[1],color:h})}var s=this._pieceList.slice();if(!s.length)s.push({interval:[-1/0,1/0]});else{var l=s[0].interval[0];l!==-1/0&&s.unshift({interval:[-1/0,l]}),l=s[s.length-1].interval[1],l!==1/0&&s.push({interval:[l,1/0]})}var u=-1/0;return w(s,function(f){var p=f.interval;p&&(p[0]>u&&o([u,p[0]],"outOfRange"),o(p.slice()),u=p[1])},this),{stops:i,outerColors:a}},e.type="visualMap.piecewise",e.defaultOption=rr(Zl.defaultOption,{selected:null,minOpen:!1,maxOpen:!1,align:"auto",itemWidth:20,itemHeight:14,itemSymbol:"roundRect",pieces:null,categories:null,splitNumber:5,selectedMode:"multiple",itemGap:10,hoverLink:!0}),e}(Zl),nq={splitNumber:function(r){var e=this.option,t=Math.min(e.precision,20),i=this.getExtent(),a=e.splitNumber;a=Math.max(parseInt(a,10),1),e.splitNumber=a;for(var n=(i[1]-i[0])/a;+n.toFixed(t)!==n&&t<5;)t++;e.precision=t,n=+n.toFixed(t),e.minOpen&&r.push({interval:[-1/0,i[0]],close:[0,0]});for(var o=0,s=i[0];o","\u2265"][i[0]]];t.text=t.text||this.formatValueText(t.value!=null?t.value:t.interval,!1,a)},this)}};function ck(r,e){var t=r.inverse;(r.orient==="vertical"?!t:t)&&e.reverse()}var hk=aq;var oq=function(r){L(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.doRender=function(){var t=this.group;t.removeAll();var i=this.visualMapModel,a=i.get("textGap"),n=i.textStyleModel,o=n.getFont(),s=n.getTextColor(),l=this._getItemAlign(),u=i.itemSize,f=this._getViewData(),p=f.endsText,c=Jt(i.get("showLabel",!0),!p);p&&this._renderEndsText(t,p[0],u,c,l),w(f.viewPieceList,function(h){var v=h.piece,d=new j;d.onclick=W(this._onItemClick,this,v),this._enableHoverLink(d,h.indexInModelPieceList);var m=i.getRepresentValue(v);if(this._createItemSymbol(d,m,[0,0,u[0],u[1]]),c){var g=this.visualMapModel.getValueState(m);d.add(new gt({style:{x:l==="right"?-a:u[0]+a,y:u[1]/2,text:v.text,verticalAlign:"middle",align:l,font:o,fill:s,opacity:g==="outOfRange"?.5:1}}))}t.add(d)},this),p&&this._renderEndsText(t,p[1],u,c,l),zi(i.get("orient"),t,i.get("itemGap")),this.renderBackground(t),this.positionGroup(t)},e.prototype._enableHoverLink=function(t,i){var a=this;t.on("mouseover",function(){return n("highlight")}).on("mouseout",function(){return n("downplay")});var n=function(o){var s=a.visualMapModel;s.option.hoverLink&&a.api.dispatchAction({type:o,batch:Xl(s.findTargetDataIndices(i),s)})}},e.prototype._getItemAlign=function(){var t=this.visualMapModel,i=t.option;if(i.orient==="vertical")return jd(t,this.api,t.itemSize);var a=i.align;return(!a||a==="auto")&&(a="left"),a},e.prototype._renderEndsText=function(t,i,a,n,o){if(i){var s=new j,l=this.visualMapModel.textStyleModel;s.add(new gt({style:Vt(l,{x:n?o==="right"?a[0]:0:a[0]/2,y:a[1]/2,verticalAlign:"middle",align:n?o:"center",text:i})})),t.add(s)}},e.prototype._getViewData=function(){var t=this.visualMapModel,i=k(t.getPieceList(),function(s,l){return{piece:s,indexInModelPieceList:l}}),a=t.get("text"),n=t.get("orient"),o=t.get("inverse");return(n==="horizontal"?o:!o)?i.reverse():a&&(a=a.slice().reverse()),{viewPieceList:i,endsText:a}},e.prototype._createItemSymbol=function(t,i,a){t.add(Gt(this.getControllerVisual(i,"symbol"),a[0],a[1],a[2],a[3],this.getControllerVisual(i,"color")))},e.prototype._onItemClick=function(t){var i=this.visualMapModel,a=i.option,n=a.selectedMode;if(n){var o=J(a.selected),s=i.getSelectedMapKey(t);n==="single"||n===!0?(o[s]=!0,w(o,function(l,u){o[u]=u===s})):o[s]=!o[s],this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:o})}},e.type="visualMap.piecewise",e}(Kd),vk=oq;function gp(r){r.registerComponentModel(hk),r.registerComponentView(vk),dp(r)}function tb(r){_t(mp),_t(gp)}var sq={label:{enabled:!0},decal:{show:!1}},dk=nt(),lq={};function eb(r,e){var t=r.getModel("aria");if(!t.get("enabled"))return;var i=J(sq);st(i.label,r.getLocaleModel().get("aria"),!1),st(t.option,i,!1),a(),n();function a(){var u=t.getModel("decal"),f=u.get("show");if(f){var p=Y();r.eachSeries(function(c){if(!c.isColorBySeries()){var h=p.get(c.type);h||(h={},p.set(c.type,h)),dk(c).scope=h}}),r.eachRawSeries(function(c){if(r.isSeriesFiltered(c))return;if(Z(c.enableAriaDecal)){c.enableAriaDecal();return}var h=c.getData();if(c.isColorBySeries()){var y=ju(c.ecModel,c.name,lq,r.getSeriesCount()),x=h.getVisual("decal");h.setVisual("decal",_(x,y))}else{var v=c.getRawData(),d={},m=dk(c).scope;h.each(function(b){var S=h.getRawIndex(b);d[S]=b});var g=v.count();v.each(function(b){var S=d[b],T=v.getName(b)||b+"",C=ju(c.ecModel,T,m,g),A=h.getItemVisual(S,"decal");h.setItemVisual(S,"decal",_(A,C))})}function _(b,S){var T=b?N(N({},S),b):S;return T.dirty=!0,T}})}}function n(){var u=r.getLocaleModel().get("aria"),f=t.getModel("label");if(f.option=X(f.option,u),!!f.get("enabled")){var p=e.getZr().dom;if(f.get("description")){p.setAttribute("aria-label",f.get("description"));return}var c=r.getSeriesCount(),h=f.get(["data","maxCount"])||10,v=f.get(["series","maxCount"])||10,d=Math.min(c,v),m;if(!(c<1)){var g=s();if(g){var y=f.get(["general","withTitle"]);m=o(y,{title:g})}else m=f.get(["general","withoutTitle"]);var x=[],_=c>1?f.get(["series","multiple","prefix"]):f.get(["series","single","prefix"]);m+=o(_,{seriesCount:c}),r.eachSeries(function(C,A){if(A1?f.get(["series","multiple",I]):f.get(["series","single",I]),D=o(D,{seriesId:C.seriesIndex,seriesName:C.get("name"),seriesType:l(C.subType)});var E=C.getData();if(E.count()>h){var P=f.get(["data","partialData"]);D+=o(P,{displayCnt:h})}else D+=f.get(["data","allData"]);for(var R=f.get(["data","separator","middle"]),O=f.get(["data","separator","end"]),V=[],U=0;U":"gt",">=":"gte","=":"eq","!=":"ne","<>":"ne"},uq=function(){function r(e){var t=this._condVal=B(e)?new RegExp(e):Sb(e)?e:null;if(t==null){var i="";Ut(i)}}return r.prototype.evaluate=function(e){var t=typeof e;return B(t)?this._condVal.test(e):vt(t)?this._condVal.test(e+""):!1},r}(),fq=function(){function r(){}return r.prototype.evaluate=function(){return this.value},r}(),pq=function(){function r(){}return r.prototype.evaluate=function(){for(var e=this.children,t=0;t2&&i.push(a),a=[E,P]}function f(E,P,R,O){Kl(E,R)&&Kl(P,O)||a.push(E,P,R,O,R,O)}function p(E,P,R,O,V,U){var F=Math.abs(P-E),q=Math.tan(F/4)*4/3,Q=PC:M2&&i.push(a),i}function sb(r,e,t,i,a,n,o,s,l,u){if(Kl(r,t)&&Kl(e,i)&&Kl(a,o)&&Kl(n,s)){l.push(o,s);return}var f=2/u,p=f*f,c=o-r,h=s-e,v=Math.sqrt(c*c+h*h);c/=v,h/=v;var d=t-r,m=i-e,g=a-o,y=n-s,x=d*d+m*m,_=g*g+y*y;if(x=0&&C
=0){l.push(o,s);return}var A=[],D=[];ii(r,t,a,o,.5,A),ii(e,i,n,s,.5,D),sb(A[0],D[0],A[1],D[1],A[2],D[2],A[3],D[3],l,u),sb(A[4],D[4],A[5],D[5],A[6],D[6],A[7],D[7],l,u)}function bk(r,e){var t=Jd(r),i=[];e=e||1;for(var a=0;a0)for(var u=0;uMath.abs(u),p=Ak([l,u],f?0:1,e),c=(f?s:u)/p.length,h=0;h
a,o=Ak([i,a],n?0:1,e),s=n?"width":"height",l=n?"height":"width",u=n?"x":"y",f=n?"y":"x",p=r[s]/o.length,c=0;c1?null:new St(d*l+r,d*u+e)}function bq(r,e,t){var i=new St;St.sub(i,t,e),i.normalize();var a=new St;St.sub(a,r,e);var n=a.dot(i);return n}function jl(r,e){var t=r[r.length-1];t&&t[0]===e[0]&&t[1]===e[1]||r.push(e)}function wq(r,e,t){for(var i=r.length,a=[],n=0;no?(u.x=f.x=s+n/2,u.y=l,f.y=l+o):(u.y=f.y=l+o/2,u.x=s,f.x=s+n),wq(e,u,f)}function Qd(r,e,t,i){if(t===1)i.push(e);else{var a=Math.floor(t/2),n=r(e);Qd(r,n[0],a,i),Qd(r,n[1],t-a,i)}return i}function Tq(r,e){for(var t=[],i=0;i0)for(var b=i/t,S=-i/2;S<=i/2;S+=b){for(var T=Math.sin(S),C=Math.cos(S),A=0,x=0;x0;u/=2){var f=0,p=0;(r&u)>0&&(f=1),(e&u)>0&&(p=1),s+=u*u*(3*f^p),p===0&&(f===1&&(r=u-1-r,e=u-1-e),l=r,r=e,e=l)}return s}function tm(r){var e=1/0,t=1/0,i=-1/0,a=-1/0,n=k(r,function(s){var l=s.getBoundingRect(),u=s.getComputedTransform(),f=l.x+l.width/2+(u?u[4]:0),p=l.y+l.height/2+(u?u[5]:0);return e=Math.min(f,e),t=Math.min(p,t),i=Math.max(f,i),a=Math.max(p,a),[f,p]}),o=k(n,function(s,l){return{cp:s,z:Pq(s[0],s[1],e,t,i,a),path:r[l]}});return o.sort(function(s,l){return s.z-l.z}).map(function(s){return s.path})}function Rk(r){return Dk(r.path,r.count)}function lb(){return{fromIndividuals:[],toIndividuals:[],count:0}}function Ok(r,e,t){var i=[];function a(b){for(var S=0;S=0;a--)if(!t[a].many.length){var l=t[s].many;if(l.length<=1)if(s)s=0;else return t;var n=l.length,u=Math.ceil(n/2);t[a].many=l.slice(u,n),t[s].many=l.slice(0,u),s++}return t}var Rq={clone:function(r){for(var e=[],t=1-Math.pow(1-r.path.style.opacity,1/r.count),i=0;i0))return;var s=i.getModel("universalTransition").get("delay"),l=Object.assign({setToFinal:!0},o),u,f;zk(r)&&(u=r,f=e),zk(e)&&(u=e,f=r);function p(g,y,x,_,b){var S=g.many,T=g.one;if(S.length===1&&!b){var C=y?S[0]:T,A=y?T:S[0];if(xp(C))p({many:[C],one:A},!0,x,_,!0);else{var D=s?X({delay:s(x,_)},l):l;em(C,A,D),n(C,A,C,A,D)}}else for(var M=X({dividePath:Rq[t],individualDelay:s&&function(V,U,F,q){return s(V+x,_)}},l),I=y?Ok(S,T,M):Nk(T,S,M),E=I.fromIndividuals,P=I.toIndividuals,R=E.length,O=0;Oe.length,h=u?kk(f,u):kk(c?e:r,[c?r:e]),v=0,d=0;dGk))for(var a=i.getIndices(),n=Nq(i),o=0;o0&&_.group.traverse(function(S){S instanceof it&&!S.animators.length&&S.animateFrom({style:{opacity:0}},b)})})}function Vk(r){var e=r.getModel("universalTransition").get("seriesKey");return e||r.id}function Bk(r){return z(r)?r.sort().join(","):r}function Qn(r){if(r.hostModel)return r.hostModel.getModel("universalTransition").get("divideShape")}function Uq(r,e){var t=Y(),i=Y(),a=Y();w(r.oldSeries,function(o,s){var l=r.oldDataGroupIds[s],u=r.oldData[s],f=Vk(o),p=Bk(f);i.set(p,{dataGroupId:l,data:u}),z(f)&&w(f,function(c){a.set(c,{key:p,dataGroupId:l,data:u})})});function n(o){t.get(o)&&kw("Duplicated seriesKey in universalTransition "+o)}return w(e.updatedSeries,function(o){if(o.isUniversalTransitionEnabled()&&o.isAnimationEnabled()){var s=o.get("dataGroupId"),l=o.getData(),u=Vk(o),f=Bk(u),p=i.get(f);if(p)t.set(f,{oldSeries:[{dataGroupId:p.dataGroupId,divide:Qn(p.data),data:p.data}],newSeries:[{dataGroupId:s,divide:Qn(l),data:l}]});else if(z(u)){var c=[];w(u,function(d){var m=i.get(d);m.data&&c.push({dataGroupId:m.dataGroupId,divide:Qn(m.data),data:m.data})}),c.length&&t.set(f,{oldSeries:c,newSeries:[{dataGroupId:s,data:l,divide:Qn(l)}]})}else{var h=a.get(u);if(h){var v=t.get(h.key);v||(v={oldSeries:[{dataGroupId:h.dataGroupId,data:h.data,divide:Qn(h.data)}],newSeries:[]},t.set(h.key,v)),v.newSeries.push({dataGroupId:s,data:l,divide:Qn(l)})}}}}),t}function Fk(r,e){for(var t=0;t=0&&a.push({dataGroupId:e.oldDataGroupIds[s],data:e.oldData[s],divide:Qn(e.oldData[s]),dim:o.dimension})}),w(Pt(r.to),function(o){var s=Fk(t.updatedSeries,o);if(s>=0){var l=t.updatedSeries[s].getData();n.push({dataGroupId:e.oldDataGroupIds[s],data:l,divide:Qn(l),dim:o.dimension})}}),a.length>0&&n.length>0&&Hk(a,n,i)}function pb(r){r.registerUpdateLifecycle("series:beforeupdate",function(e,t,i){w(Pt(i.seriesTransition),function(a){w(Pt(a.to),function(n){for(var o=i.updatedSeries,s=0;s