From ef441b00f0779acb173305e1d7651c0a504f957f Mon Sep 17 00:00:00 2001 From: rongweikang <1174906669@qq.com> Date: Tue, 5 Mar 2024 10:03:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0echart=E5=9B=BE=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iotCarePlan/components/Echart/index.less | 62 ++++ .../iotCarePlan/components/Echart/index.tsx | 284 ++++++++++++++++++ src/utils/echarts.min.js | 1 + 3 files changed, 347 insertions(+) create mode 100644 src/pages/iotCarePlan/components/Echart/index.less create mode 100644 src/pages/iotCarePlan/components/Echart/index.tsx create mode 100644 src/utils/echarts.min.js diff --git a/src/pages/iotCarePlan/components/Echart/index.less b/src/pages/iotCarePlan/components/Echart/index.less new file mode 100644 index 0000000..aa5e3e3 --- /dev/null +++ b/src/pages/iotCarePlan/components/Echart/index.less @@ -0,0 +1,62 @@ +.box { + width: 690rpx; + height: 320rpx; + margin: 28rpx auto; + background-color: #fff; + border-radius: 30rpx; + padding: 35rpx 25rpx 25rpx 35rpx; + box-sizing: border-box; + position: relative; +} +.box_background { + position: absolute; + top: 0; + left: 0; + width: 690rpx; + height: 320rpx; + border-radius: 30rpx; + background-color: #fff; + .power { + margin: 34rpx 0 28rpx 28rpx; + font-family: PingFang-SC; + font-weight: 500; + font-size: 18rpx; + color: #cccccc; + } + .full{ + width: 24rpx; + height: 24rpx; + position: absolute; + top: 32rpx; + right: 26rpx; + } + .line { + margin: 0 0 6rpx 35rpx; + font-family: PingFang-SC; + font-size: 14rpx; + color: #cccccc; + display: flex; + position: relative; + height: 18rpx; + .bottom_line { + border-bottom: 1rpx #ccc dashed; + width: 550rpx; + margin-left: 20rpx; + position: absolute; + bottom: -6rpx; + right: 74rpx; + height: 4rpx; + color: #fff; + } + } + + + .time { + position: absolute; + bottom: 22rpx; + right: 24rpx; + font-family: PingFang-SC; + font-size: 18rpx; + color: #cccccc; + } +} diff --git a/src/pages/iotCarePlan/components/Echart/index.tsx b/src/pages/iotCarePlan/components/Echart/index.tsx new file mode 100644 index 0000000..cdfcd00 --- /dev/null +++ b/src/pages/iotCarePlan/components/Echart/index.tsx @@ -0,0 +1,284 @@ +import Taro from "@tarojs/taro"; +import classnames from "classnames"; +import { Block, View, Image, Text } from "@tarojs/components"; +import { useRef } from 'react' +import Echarts, { EChartOption, EchartsHandle } from 'taro-react-echarts' +import echarts from '@/utils/echarts.min.js' +import "./index.less"; + +interface Props { + Electricity: any; + matrixElectricity: any; + facialMaskConnectStatus: any; +} + +function Index() { + const echartsRef = useRef(null) + const option: EChartOption = { + grid: { // 让图表占满容器 + top: "28rpx", + left: "18rpx", + right: "28rpx", + bottom: "17rpx" + }, + xAxis: { + // name: '', + // nameGap: 5, + // nameTextStyle: { + // color: '#e4e4e4', + // fontSize:7 + // }, + type: 'category', + axisLine: { + //坐标轴轴线相关设置。数学上的x轴 + show: true, + lineStyle: { + color: '#cccccc' + } + }, + axisLabel: { + //坐标轴刻度标签的相关设置 + color: '#cccccc', + fontSize: 8 + }, + axisTick: { + show: false + }, + data: [ + '00:01', + '00:02', + '00:03', + '00:04', + '00:05', + '00:06', + '00:07', + '00:08', + '00:09', + '00:10' + ] + }, + yAxis: { + type: 'value', + min: 0, + max: 8, + splitNumber: 8, + splitLine: { + show: false, + lineStyle: { + color: '#cccccc', + type: [4, 2], + dashOffset: 4 + } + }, + axisLine: { + show: false + }, + axisLabel: { + show: false + }, + axisTick: { + show: false + } + }, + visualMap: { + z: 1, + top: 0, + right: 0, + seriesIndex: 0, + show: false, + pieces: [ + { + gt: 0, + lte: 1, + color: '#fff8c9' + }, + { + gt: 1, + lte: 2, + color: '#fff0c6' + }, + { + gt: 2, + lte: 3, + color: '#ffe5c3' + }, + { + gt: 3, + lte: 4, + color: '#ffdbbf' + }, + { + gt: 4, + lte: 5, + color: '#ffcfbb' + }, + { + gt: 5, + lte: 6, + color: '#ffbab5' + }, + { + gt: 6, + lte: 7, + color: '#ffb4b3' + }, + { + gt: 7, + lte: 8, + color: '#ffb4b3' + } + ], + outOfRange: { + color: '#ff8410' + } + }, + series: [ + { + data: [2, 3, 5, 3, 5, 6, 8, 5, 6, 4], + type: 'line', + smooth: true, + z: 1, + areaStyle: {}, + color: 'red' + }, + { + data: [2, 3, 5, 3, 5, 6, 8, 5, 6, 4], + type: 'line', + smooth: true, + symbolSize: 5, + lineStyle: { + color: '#ff8410', + width: 1 + }, + itemStyle: { + color: '#ff8410' + } + }, + { + name: 'a', + data: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], + type: 'bar', + barWidth: 12, + z: 2, + stack: 'x', + visualMap: false, + itemStyle: { + color: '#ffcf56' + } + }, + { + name: 'b', + data: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], + type: 'bar', + z: 2, + stack: 'x', + visualMap: false, + itemStyle: { + color: '#febb22' + } + }, + { + name: 'c', + data: [0, 1, 1, 1, 1, 1, 1, 1, 1, 1], + type: 'bar', + z: 2, + stack: 'x', + visualMap: false, + itemStyle: { + color: '#ffac28' + } + }, + { + name: 'd', + data: [0, 0, 1, 0, 1, 1, 1, 1, 1, 1], + type: 'bar', + z: 2, + stack: 'x', + visualMap: false, + itemStyle: { + color: '#ff8410' + } + }, + { + name: 'e', + data: [0, 0, 1, 0, 1, 1, 1, 1, 1, 0], + type: 'bar', + z: 2, + stack: 'x', + visualMap: false, + itemStyle: { + color: '#f85804' + } + }, + { + name: 'f', + data: [0, 0, 0, 0, 0, 1, 1, 0, 1, 0], + type: 'bar', + z: 2, + stack: 'x', + visualMap: false, + itemStyle: { + color: '#e02e14' + } + }, + { + name: 'h', + data: [0, 0, 0, 0, 0, 0, 1, 0, 0, 0], + type: 'bar', + z: 2, + stack: 'x', + visualMap: false, + itemStyle: { + color: '#b30016' + } + }, + { + name: 'i', + data: [0, 0, 0, 0, 0, 0, 1, 0, 0, 0], + type: 'bar', + z: 2, + stack: 'x', + visualMap: false, + itemStyle: { + color: '#750010' + } + } + ] + } + + const level = [8, 7, 6, 5, 4, 3, 2] + + return ( + + + + + 实时能量 + { + level.map(item => ( + + {item}8 + ) + ) + } + + 1 + + 时间 + + + ); + + +} + + + +export default Index; diff --git a/src/utils/echarts.min.js b/src/utils/echarts.min.js new file mode 100644 index 0000000..7b5efdf --- /dev/null +++ b/src/utils/echarts.min.js @@ -0,0 +1 @@ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).echarts={})}(this,function(t){"use strict";var x=function(t,e){return(x=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}))(t,e)};function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}x(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var b=function(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1},p=new function(){this.browser=new b,this.node=!1,this.wxa=!1,this.worker=!1,this.svgSupported=!1,this.touchEventsSupported=!1,this.pointerEventsSupported=!1,this.domSupported=!1,this.transformSupported=!1,this.transform3dSupported=!1,this.hasGlobalWindow="undefined"!=typeof window};"object"==typeof wx&&"function"==typeof wx.getSystemInfoSync?(p.wxa=!0,p.touchEventsSupported=!0):"undefined"==typeof document&&"undefined"!=typeof self?p.worker=!0:"undefined"==typeof navigator||0===navigator.userAgent.indexOf("Node.js")?(p.node=!0,p.svgSupported=!0):(J=navigator.userAgent,ae=(Wt=p).browser,ot=J.match(/Firefox\/([\d.]+)/),W=J.match(/MSIE\s([\d.]+)/)||J.match(/Trident\/.+?rv:(([\d.]+))/),Q=J.match(/Edge?\/([\d.]+)/),J=/micromessenger/i.test(J),ot&&(ae.firefox=!0,ae.version=ot[1]),W&&(ae.ie=!0,ae.version=W[1]),Q&&(ae.edge=!0,ae.version=Q[1],ae.newEdge=18<+Q[1].split(".")[0]),J&&(ae.weChat=!0),Wt.svgSupported="undefined"!=typeof SVGRect,Wt.touchEventsSupported="ontouchstart"in window&&!ae.ie&&!ae.edge,Wt.pointerEventsSupported="onpointerdown"in window&&(ae.edge||ae.ie&&11<=+ae.version),Wt.domSupported="undefined"!=typeof document,ot=document.documentElement.style,Wt.transform3dSupported=(ae.ie&&"transition"in ot||ae.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in ot)&&!("OTransition"in ot),Wt.transformSupported=Wt.transform3dSupported||ae.ie&&9<=+ae.version);var K="12px sans-serif";var w,S,I=function(t){var e={};if("undefined"!=typeof JSON)for(var n=0;n>1)%2;s.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",i[l]+":0",r[u]+":0",i[1-l]+":auto",r[1-u]+":auto",""].join("!important;"),t.appendChild(a),n.push(a)}}return n}(e,o),o,r);if(e)return e(t,n,i),1}}function me(t){return"CANVAS"===t.nodeName.toUpperCase()}var ve=/([&<>"'])/g,_e={"&":"&","<":"<",">":">",'"':""","'":"'"};function xe(t){return null==t?"":(t+"").replace(ve,function(t,e){return _e[e]})}var be=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,we=[],Se=p.browser.firefox&&+p.browser.version.split(".")[0]<39;function Me(t,e,n,i){return n=n||{},i?Ie(t,e,n):Se&&null!=e.layerX&&e.layerX!==e.offsetX?(n.zrX=e.layerX,n.zrY=e.layerY):null!=e.offsetX?(n.zrX=e.offsetX,n.zrY=e.offsetY):Ie(t,e,n),n}function Ie(t,e,n){if(p.domSupported&&t.getBoundingClientRect){var i,r=e.clientX,e=e.clientY;if(me(t))return i=t.getBoundingClientRect(),n.zrX=r-i.left,void(n.zrY=e-i.top);if(ye(we,t,r,e))return n.zrX=we[0],void(n.zrY=we[1])}n.zrX=n.zrY=0}function Te(t){return t||window.event}function Ce(t,e,n){var i;return null==(e=Te(e)).zrX&&((i=e.type)&&0<=i.indexOf("touch")?(i=("touchend"!==i?e.targetTouches:e.changedTouches)[0])&&Me(t,i,e,n):(Me(t,e,e,n),i=function(t){var e=t.wheelDelta;if(e)return e;var n=t.deltaX,t=t.deltaY;return null!=n&&null!=t?3*(0!==t?Math.abs(t):Math.abs(n))*(0=n.x&&t<=n.x+n.width&&e>=n.y&&e<=n.y+n.height},Ke.prototype.clone=function(){return new Ke(this.x,this.y,this.width,this.height)},Ke.prototype.copy=function(t){Ke.copy(this,t)},Ke.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},Ke.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},Ke.prototype.isZero=function(){return 0===this.width||0===this.height},Ke.create=function(t){return new Ke(t.x,t.y,t.width,t.height)},Ke.copy=function(t,e){t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height},Ke.applyTransform=function(t,e,n){var i,r,o,a;n?n[1]<1e-5&&-1e-5t.getWidth()||n<0||n>t.getHeight()}P(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],function(a){sn.prototype[a]=function(t){var e,n,i=t.zrX,r=t.zrY,o=hn(this,i,r);if("mouseup"===a&&o||(n=(e=this.findHover(i,r)).target),"mousedown"===a)this._downEl=n,this._downPoint=[t.zrX,t.zrY],this._upEl=n;else if("mouseup"===a)this._upEl=n;else if("click"===a){if(this._downEl!==this._upEl||!this._downPoint||4>>1])<0?l=o:s=1+o;var u=i-s;switch(u){case 3:t[s+3]=t[s+2];case 2:t[s+2]=t[s+1];case 1:t[s+1]=t[s];break;default:for(;0>>1);0>>1);o(t,e[n+h])<0?l=h:a=h+1}return l}function mn(A,L){var O,P,R=pn,N=0,E=[];function e(t){var e=O[t],n=P[t],i=O[t+1],r=P[t+1],t=(P[t]=n+r,t===N-3&&(O[t+1]=O[t+2],P[t+1]=P[t+2]),N--,yn(A[i],A,e,n,0,L));if(e+=t,0!=(n-=t)&&0!==(r=gn(A[e+n-1],A,i,r,r-1,L)))if(n<=r){var o=e,a=n,t=i,s=r,l=0;for(l=0;lP[t+1])break;e(t)}},forceMergeRuns:function(){for(;1>=1;return t+e}(r);do{}while((o=dn(t,n,i,e))=this._maxSize&&0>4|(3840&r)>>8,240&r|(240&r)>>4,15&r|(15&r)<<4,5===i?parseInt(n.slice(4),16)/15:1),gi(t,e),e):void ci(e,0,0,0,1):7===i||9===i?0<=(r=parseInt(n.slice(1,7),16))&&r<=16777215?(ci(e,(16711680&r)>>16,(65280&r)>>8,255&r,9===i?parseInt(n.slice(7),16)/255:1),gi(t,e),e):void ci(e,0,0,0,1):void 0;var r=n.indexOf("("),o=n.indexOf(")");if(-1!==r&&o+1===i){var i=n.substr(0,r),a=n.substr(r+1,o-(r+1)).split(","),s=1;switch(i){case"rgba":if(4!==a.length)return 3===a.length?ci(e,+a[0],+a[1],+a[2],1):ci(e,0,0,0,1);s=li(a.pop());case"rgb":return 3<=a.length?(ci(e,si(a[0]),si(a[1]),si(a[2]),3===a.length?s:li(a[3])),gi(t,e),e):void ci(e,0,0,0,1);case"hsla":return 4!==a.length?void ci(e,0,0,0,1):(a[3]=li(a[3]),mi(a,e),gi(t,e),e);case"hsl":return 3!==a.length?void ci(e,0,0,0,1):(mi(a,e),gi(t,e),e);default:return}}ci(e,0,0,0,1)}}function mi(t,e){var n=(parseFloat(t[0])%360+360)%360/360,i=li(t[1]),r=li(t[2]),i=r<=.5?r*(i+1):r+i-r*i,r=2*r-i;return ci(e=e||[],oi(255*ui(r,i,n+1/3)),oi(255*ui(r,i,n)),oi(255*ui(r,i,n-1/3)),1),4===t.length&&(e[3]=t[3]),e}function vi(t,e){var n=yi(t);if(n){for(var i=0;i<3;i++)n[i]=e<0?n[i]*(1-e)|0:(255-n[i])*e+n[i]|0,255e);g++);g=f(g-1,h-2)}i=u[g+1],n=u[g]}n&&i&&(this._lastFr=g,this._lastFrP=e,d=i.percent-n.percent,r=0==d?1:f((e-n.percent)/d,1),i.easingFunc&&(r=i.easingFunc(r)),f=a?this._additiveValue:p?zi:t[c],(Ei(l)||p)&&(f=f||(this._additiveValue=[])),this.discrete?t[c]=(r<1?n:i).rawValue:Ei(l)?(1===l?Ai:function(t,e,n,i){for(var r=e.length,o=r&&e[0].length,a=0;athis._sleepAfterStill)&&this.animation.stop()},$r.prototype.setSleepAfterStill=function(t){this._sleepAfterStill=t},$r.prototype.wakeUp=function(){this._disposed||(this.animation.start(),this._stillFrameAccum=0)},$r.prototype.refreshHover=function(){this._needsRefreshHover=!0},$r.prototype.refreshHoverImmediately=function(){this._disposed||(this._needsRefreshHover=!1,this.painter.refreshHover&&"canvas"===this.painter.getType()&&this.painter.refreshHover())},$r.prototype.resize=function(t){this._disposed||(this.painter.resize((t=t||{}).width,t.height),this.handler.resize())},$r.prototype.clearAnimation=function(){this._disposed||this.animation.clear()},$r.prototype.getWidth=function(){if(!this._disposed)return this.painter.getWidth()},$r.prototype.getHeight=function(){if(!this._disposed)return this.painter.getHeight()},$r.prototype.setCursorStyle=function(t){this._disposed||this.handler.setCursorStyle(t)},$r.prototype.findHover=function(t,e){if(!this._disposed)return this.handler.findHover(t,e)},$r.prototype.on=function(t,e,n){return this._disposed||this.handler.on(t,e,n),this},$r.prototype.off=function(t,e){this._disposed||this.handler.off(t,e)},$r.prototype.trigger=function(t,e){this._disposed||this.handler.trigger(t,e)},$r.prototype.clear=function(){if(!this._disposed){for(var t=this.storage.getRoots(),e=0;e=e.maxIterations){t+=e.ellipsis;break}var s=0===a?function(t,e,n,i){for(var r=0,o=0,a=t.length;oo){0i.width&&(o=e.split("\n"),c=!0),i.accumWidth=t):(t=va(e,h,i.width,i.breakAll,i.accumWidth),i.accumWidth=t.accumWidth+n,a=t.linesWidths,o=t.lines)):o=e.split("\n");for(var p=0;pthis._ux||i>this._uy;return this.addData(Y.L,t,e),this._ctx&&r&&this._ctx.lineTo(t,e),r?(this._xi=t,this._yi=e,this._pendingPtDist=0):(r=n*n+i*i)>this._pendingPtDist&&(this._pendingPtX=t,this._pendingPtY=e,this._pendingPtDist=r),this},o.prototype.bezierCurveTo=function(t,e,n,i,r,o){return this._drawPendingPt(),this.addData(Y.C,t,e,n,i,r,o),this._ctx&&this._ctx.bezierCurveTo(t,e,n,i,r,o),this._xi=r,this._yi=o,this},o.prototype.quadraticCurveTo=function(t,e,n,i){return this._drawPendingPt(),this.addData(Y.Q,t,e,n,i),this._ctx&&this._ctx.quadraticCurveTo(t,e,n,i),this._xi=n,this._yi=i,this},o.prototype.arc=function(t,e,n,i,r,o){this._drawPendingPt(),Qa[0]=i,Qa[1]=r,s=o,(l=Ja((a=Qa)[0]))<0&&(l+=Ka),h=l-a[0],u=a[1],u+=h,!s&&Ka<=u-l?u=l+Ka:s&&Ka<=l-u?u=l-Ka:!s&&uu.length&&(this._expandData(),u=this.data);for(var h=0;hn||Za(y)>i||c===e-1)&&(f=Math.sqrt(C*C+y*y),r=g,o=_);break;case Y.C:var m=t[c++],v=t[c++],g=t[c++],_=t[c++],x=t[c++],b=t[c++],f=function(t,e,n,i,r,o,a,s,l){for(var u=t,h=e,c=0,p=1/l,d=1;d<=l;d++){var f=d*p,g=Bn(t,n,r,a,f),f=Bn(e,i,o,s,f),y=g-u,m=f-h;c+=Math.sqrt(y*y+m*m),u=g,h=f}return c}(r,o,m,v,g,_,x,b,10),r=x,o=b;break;case Y.Q:f=function(t,e,n,i,r,o,a){for(var s=t,l=e,u=0,h=1/a,c=1;c<=a;c++){var p=c*h,d=Un(t,n,r,p),p=Un(e,i,o,p),f=d-s,g=p-l;u+=Math.sqrt(f*f+g*g),s=d,l=p}return u}(r,o,m=t[c++],v=t[c++],g=t[c++],_=t[c++],10),r=g,o=_;break;case Y.A:var x=t[c++],b=t[c++],w=t[c++],S=t[c++],M=t[c++],I=t[c++],T=I+M;c+=1,d&&(a=Ya(M)*w+x,s=qa(M)*S+b),f=Xa(w,S)*Ua(Ka,Math.abs(I)),r=Ya(T)*w+x,o=qa(T)*S+b;break;case Y.R:a=r=t[c++],s=o=t[c++];f=2*t[c++]+2*t[c++];break;case Y.Z:var C=a-r,y=s-o;f=Math.sqrt(C*C+y*y),r=a,o=s}0<=f&&(u+=l[h++]=f)}return this._pathLen=u},o.prototype.rebuildPath=function(t,e){var n,i,r,o,a,s,l,u,h=this.data,E=this._ux,z=this._uy,B=this._len,c=e<1,p=0,d=0,f=0;if(!c||(this._pathSegLen||this._calculateLength(),a=this._pathSegLen,s=e*this._pathLen))t:for(var g=0;g=us[i=0]+t&&a<=us[1]+t?h:0;rMath.PI/2&&c<1.5*Math.PI?-h:h)}return l}(y,m,_,x,x+b,w,I,r);u=Math.cos(x+b)*v+y,h=Math.sin(x+b)*_+m;break;case as.R:c=u=a[d++],p=h=a[d++];if(S=c+a[d++],M=p+a[d++],n){if(es(c,p,S,p,e,i,r)||es(S,p,S,M,e,i,r)||es(S,M,c,M,e,i,r)||es(c,M,c,p,e,i,r))return!0}else l=(l+=os(S,p,S,M,i,r))+os(c,M,c,p,i,r);break;case as.Z:if(n){if(es(u,h,c,p,e,i,r))return!0}else l+=os(u,h,c,p,i,r);u=c,h=p}}return n||(t=h,o=p,Math.abs(t-o)i.len()&&(ue)return t[i];return t[n-1]}var sd,ld="\0_ec_inner",ud=(u(s,sd=Ac),s.prototype.init=function(t,e,n,i,r,o){i=i||{},this.option=null,this._theme=new Ac(i),this._locale=new Ac(r),this._optionManager=o},s.prototype.setOption=function(t,e,n){e=pd(e);this._optionManager.setOption(t,n,e),this._resetOption(null,e)},s.prototype.resetOption=function(t,e){return this._resetOption(t,pd(e))},s.prototype._resetOption=function(t,e){var n,i=!1,r=this._optionManager;return t&&"recreate"!==t||(n=r.mountOption("recreate"===t),this.option&&"recreate"!==t?(this.restoreData(),this._mergeOption(n,e)):nd(this,n),i=!0),"timeline"!==t&&"media"!==t||this.restoreData(),t&&"recreate"!==t&&"timeline"!==t||(n=r.getTimelineOption(this))&&(i=!0,this._mergeOption(n,e)),t&&"recreate"!==t&&"media"!==t||(n=r.getMediaOption(this)).length&&P(n,function(t){i=!0,this._mergeOption(t,e)},this),i},s.prototype.mergeOption=function(t){this._mergeOption(t,null)},s.prototype._mergeOption=function(i,t){var r=this.option,h=this._componentsMap,c=this._componentsCount,n=[],o=E(),p=t&&t.replaceMergeMainTypeMap;jp(this).datasetMap=E(),P(i,function(t,e){null!=t&&(g.hasClass(e)?e&&(n.push(e),o.set(e,!0)):r[e]=null==r[e]?y(t):d(r[e],t,!0))}),p&&p.each(function(t,e){g.hasClass(e)&&!o.get(e)&&(n.push(e),o.set(e,!0))}),g.topologicalTravel(n,g.getAllClassMainTypes(),function(o){var a,t=function(t,e,n){return(e=(e=Jp.get(e))&&e(t))?n.concat(e):n}(this,o,Mo(i[o])),e=h.get(o),n=e?p&&p.get(o)?"replaceMerge":"normalMerge":"replaceAll",e=ko(e,t,n),s=(Ro(e,o,g),r[o]=null,h.set(o,null),c.set(o,0),[]),l=[],u=0;P(e,function(t,e){var n=t.existing,i=t.newOption;if(i){var r=g.getClass(o,t.keyInfo.subType,!("series"===o));if(!r)return;if("tooltip"===o){if(a)return;a=!0}n&&n.constructor===r?(n.name=t.keyInfo.name,n.mergeOption(i,this),n.optionUpdated(i,!1)):(e=O({componentIndex:e},t.keyInfo),O(n=new r(i,this,this,e),e),t.brandNew&&(n.__requireNewView=!0),n.init(i,this,this),n.optionUpdated(null,!0))}else n&&(n.mergeOption({},this),n.optionUpdated({},!1));n?(s.push(n.option),l.push(n),u++):(s.push(void 0),l.push(void 0))},this),r[o]=s,h.set(o,l),c.set(o,u),"series"===o&&td(this)},this),this._seriesIndices||td(this)},s.prototype.getOption=function(){var a=y(this.option);return P(a,function(t,e){if(g.hasClass(e)){for(var n=Mo(t),i=n.length,r=!1,o=i-1;0<=o;o--)n[o]&&!Po(n[o])?r=!0:(n[o]=null,r||i--);n.length=i,a[e]=n}}),delete a[ld],a},s.prototype.getTheme=function(){return this._theme},s.prototype.getLocaleModel=function(){return this._locale},s.prototype.setUpdatePayload=function(t){this._payload=t},s.prototype.getUpdatePayload=function(){return this._payload},s.prototype.getComponent=function(t,e){var n=this._componentsMap.get(t);if(n){t=n[e||0];if(t)return t;if(null==e)for(var i=0;ig[1]&&(g[1]=f)}return{start:a,end:this._rawCount=this._count=s}},l.prototype._initDataFromProvider=function(t,e,n){for(var i=this._provider,r=this._chunks,o=this._dimensions,a=o.length,s=this._rawExtent,l=B(o,function(t){return t.property}),u=0;uf[1]&&(f[1]=g)}!i.persistent&&i.clean&&i.clean(),this._rawCount=this._count=e,this._extent=[]},l.prototype.count=function(){return this._count},l.prototype.get=function(t,e){return 0<=e&&e=this._rawCount||t<0)){if(!this._indices)return t;var e=this._indices,n=e[t];if(null!=n&&nt))return o;r=o-1}}}return-1},l.prototype.indicesOfNearest=function(t,e,n){var i=this._chunks[t],r=[];if(i){null==n&&(n=1/0);for(var o=1/0,a=-1,s=0,l=0,u=this.count();lt[S][1])&&(b=!1)}b&&(a[s++]=e.getRawIndex(f))}return sy[1]&&(y[1]=g)}}}},l.prototype.lttbDownSample=function(t,e){var n,i=this.clone([t],!0),r=i._chunks[t],o=this.count(),a=0,s=Math.floor(1/e),l=this.getRawIndex(0),u=new(Jf(this._rawCount))(Math.min(2*(Math.ceil(o/s)+2),o));u[a++]=l;for(var h=1;hh[1]&&(h[1]=y),c[p++]=m}return r._count=p,r._indices=c,r._updateGetRawIdx(),r},l.prototype.each=function(t,e){if(this._count)for(var n=t.length,i=this._chunks,r=0,o=this.count();rthis.getShallow("animationThreshold")?!1:t)},h.prototype.restoreData=function(){this.dataTask.dirty()},h.prototype.getColorFromPalette=function(t,e,n){var i=this.ecModel;return rd.prototype.getColorFromPalette.call(this,t,e,n)||i.getColorFromPalette(t,e,n)},h.prototype.coordDimToDataDim=function(t){return this.getRawData().mapDimensionsAll(t)},h.prototype.getProgressive=function(){return this.get("progressive")},h.prototype.getProgressiveThreshold=function(){return this.get("progressiveThreshold")},h.prototype.select=function(t,e){this._innerSelect(this.getData(e),t)},h.prototype.unselect=function(t,e){var n=this.option.selectedMap;if(n){var i=this.option.selectedMode,r=this.getData(e);if("series"===i||"all"===n)this.option.selectedMap={},this._selectedDataIndicesMap={};else for(var o=0;oe.outputData.count()&&e.model.getRawData().cloneShallow(e.outputData)}function _g(e,n){P(zt(e.CHANGABLE_METHODS,e.DOWNSAMPLE_METHODS),function(t){e.wrapMethod(t,dt(xg,n))})}function xg(t,e){t=bg(t);return t&&t.setOutputEnd((e||this).count()),e}function bg(t){var e,n=(t.ecModel||{}).scheduler,n=n&&n.getPipeline(t.uid);if(n)return(n=n.currentTask)&&(e=n.agentStubMap)?e.get(t.uid):n}st(fg,Cc),st(fg,rd),jo(fg,g);Sg.prototype.init=function(t,e){},Sg.prototype.render=function(t,e,n,i){},Sg.prototype.dispose=function(t,e){},Sg.prototype.updateView=function(t,e,n,i){},Sg.prototype.updateLayout=function(t,e,n,i){},Sg.prototype.updateVisual=function(t,e,n,i){},Sg.prototype.toggleBlurSeries=function(t,e,n){},Sg.prototype.eachRendered=function(t){var e=this.group;e&&e.traverse(t)};var wg=Sg;function Sg(){this.group=new Xr,this.uid=Pc("viewComponent")}function Mg(){var o=Eo();return function(t){var e=o(t),t=t.pipelineContext,n=!!e.large,i=!!e.progressiveRender,r=e.large=!(!t||!t.large),e=e.progressiveRender=!(!t||!t.progressiveRender);return!(n==r&&i==e)&&"reset"}}Zo(wg),Jo(wg);var Ig=Eo(),Tg=Mg(),Cg=(kg.prototype.init=function(t,e){},kg.prototype.render=function(t,e,n,i){},kg.prototype.highlight=function(t,e,n,i){t=t.getData(i&&i.dataType);t&&Ag(t,i,"emphasis")},kg.prototype.downplay=function(t,e,n,i){t=t.getData(i&&i.dataType);t&&Ag(t,i,"normal")},kg.prototype.remove=function(t,e){this.group.removeAll()},kg.prototype.dispose=function(t,e){},kg.prototype.updateView=function(t,e,n,i){this.render(t,e,n,i)},kg.prototype.updateLayout=function(t,e,n,i){this.render(t,e,n,i)},kg.prototype.updateVisual=function(t,e,n,i){this.render(t,e,n,i)},kg.prototype.eachRendered=function(t){nc(this.group,t)},kg.markUpdateMethod=function(t,e){Ig(t).updateMethod=e},kg.protoInitialize=void(kg.prototype.type="chart"),kg);function kg(){this.group=new Xr,this.uid=Pc("viewChart"),this.renderTask=mf({plan:Lg,reset:Og}),this.renderTask.context={view:this}}function Dg(t,e,n){t&&Ul(t)&&("emphasis"===e?Tl:Cl)(t,n)}function Ag(e,t,n){var i,r=No(e,t),o=t&&null!=t.highlightKey?(t=t.highlightKey,i=null==(i=$s[t])&&Ks<=32?$s[t]=Ks++:i):null;null!=r?P(Mo(r),function(t){Dg(e.getItemGraphicEl(t),n,o)}):e.eachItemGraphicEl(function(t){Dg(t,n,o)})}function Lg(t){return Tg(t.model)}function Og(t){var e=t.model,n=t.ecModel,i=t.api,r=t.payload,o=e.pipelineContext.progressiveRender,t=t.view,a=r&&Ig(r).updateMethod,o=o?"incrementalPrepareRender":a&&t[a]?a:"render";return"render"!==o&&t[o](e,n,i,r),Pg[o]}Zo(Cg),Jo(Cg);var Pg={incrementalPrepareRender:{progress:function(t,e){e.view.incrementalRender(t,e.model,e.ecModel,e.api,e.payload)}},render:{forceFirstProgress:!0,progress:function(t,e){e.view.render(e.model,e.ecModel,e.api,e.payload)}}};function Rg(t,r,o){var a,s,l,u,h,c=0,p=0,d=null;function f(){p=(new Date).getTime(),d=null,t.apply(l,u||[])}r=r||0;function e(){for(var t=[],e=0;en.blockIndex?n.step:null,modBy:null!=(t=i&&i.modDataCount)?Math.ceil(t/e):null,modDataCount:t}},Wg.prototype.getPipeline=function(t){return this._pipelineMap.get(t)},Wg.prototype.updateStreamModes=function(t,e){var n=this._pipelineMap.get(t.uid),i=t.getData().count(),e=n.progressiveEnabled&&e.incrementalPrepareRender&&i>=n.threshold,r=t.get("large")&&i>=t.get("largeThreshold"),i="mod"===t.get("progressiveChunkMode")?i:null;t.pipelineContext=n.context={progressiveRender:e,modDataCount:i,large:r}},Wg.prototype.restorePipelines=function(t){var i=this,r=i._pipelineMap=E();t.eachSeries(function(t){var e=t.getProgressive(),n=t.uid;r.set(n,{id:n,head:null,tail:null,threshold:t.getProgressiveThreshold(),progressiveEnabled:e&&!(t.preventIncremental&&t.preventIncremental()),blockIndex:-1,step:Math.round(e||700),count:0}),i._pipe(t,t.dataTask)})},Wg.prototype.prepareStageTasks=function(){var n=this._stageTaskMap,i=this.api.getModel(),r=this.api;P(this._allHandlers,function(t){var e=n.get(t.uid)||n.set(t.uid,{});Ct(!(t.reset&&t.overallReset),""),t.reset&&this._createSeriesStageTask(t,e,i,r),t.overallReset&&this._createOverallStageTask(t,e,i,r)},this)},Wg.prototype.prepareView=function(t,e,n,i){var r=t.renderTask,o=r.context;o.model=e,o.ecModel=n,o.api=i,r.__block=!t.incrementalPrepareRender,this._pipe(e,r)},Wg.prototype.performDataProcessorTasks=function(t,e){this._performStageTasks(this._dataProcessorHandlers,t,e,{block:!0})},Wg.prototype.performVisualTasks=function(t,e,n){this._performStageTasks(this._visualHandlers,t,e,n)},Wg.prototype._performStageTasks=function(t,s,l,u){u=u||{};var h=!1,c=this;function p(t,e){return t.setDirty&&(!t.dirtyMap||t.dirtyMap.get(e.__pipeline.id))}P(t,function(i,t){var e,n,r,o,a;u.visualType&&u.visualType!==i.visualType||(e=(n=c._stageTaskMap.get(i.uid)).seriesTaskMap,(n=n.overallTask)?((o=n.agentStubMap).each(function(t){p(u,t)&&(t.dirty(),r=!0)}),r&&n.dirty(),c.updatePayload(n,l),a=c.getPerformArgs(n,u.block),o.each(function(t){t.perform(a)}),n.perform(a)&&(h=!0)):e&&e.each(function(t,e){p(u,t)&&t.dirty();var n=c.getPerformArgs(t,u.block);n.skip=!i.performRawSeries&&s.isSeriesFiltered(t.context.model),c.updatePayload(t,l),t.perform(n)&&(h=!0)}))}),this.unfinished=h||this.unfinished},Wg.prototype.performSeriesTasks=function(t){var e;t.eachSeries(function(t){e=t.dataTask.perform()||e}),this.unfinished=e||this.unfinished},Wg.prototype.plan=function(){this._pipelineMap.each(function(t){var e=t.tail;do{if(e.__block){t.blockIndex=e.__idxInPipeline;break}}while(e=e.getUpstream())})},Wg.prototype.updatePayload=function(t,e){"remain"!==e&&(t.context.payload=e)},Wg.prototype._createSeriesStageTask=function(n,t,i,r){var o=this,a=t.seriesTaskMap,s=t.seriesTaskMap=E(),t=n.seriesType,e=n.getTargetSeries;function l(t){var e=t.uid,e=s.set(e,a&&a.get(e)||mf({plan:Zg,reset:jg,count:Qg}));e.context={model:t,ecModel:i,api:r,useClearVisual:n.isVisual&&!n.isLayout,plan:n.plan,reset:n.reset,scheduler:o},o._pipe(t,e)}n.createOnAllSeries?i.eachRawSeries(l):t?i.eachRawSeriesByType(t,l):e&&e(i,r).each(l)},Wg.prototype._createOverallStageTask=function(t,e,n,i){var r=this,o=e.overallTask=e.overallTask||mf({reset:Ug}),a=(o.context={ecModel:n,api:i,overallReset:t.overallReset,scheduler:r},o.agentStubMap),s=o.agentStubMap=E(),e=t.seriesType,l=t.getTargetSeries,u=!0,h=!1;function c(t){var e=t.uid,e=s.set(e,a&&a.get(e)||(h=!0,mf({reset:Xg,onDirty:qg})));e.context={model:t,overallProgress:u},e.agent=o,e.__block=u,r._pipe(t,e)}Ct(!t.createOnAllSeries,""),e?n.eachRawSeriesByType(e,c):l?l(n,i).each(c):(u=!1,P(n.getSeries(),c)),h&&o.dirty()},Wg.prototype._pipe=function(t,e){t=t.uid,t=this._pipelineMap.get(t);t.head||(t.head=e),t.tail&&t.tail.pipe(e),(t.tail=e).__idxInPipeline=t.count++,e.__pipeline=t},Wg.wrapStageHandler=function(t,e){return(t=k(t)?{overallReset:t,seriesType:function(t){Jg=null;try{t(ty,ey)}catch(t){}return Jg}(t)}:t).uid=Pc("stageHandler"),e&&(t.visualType=e),t};var Hg=Wg;function Wg(t,e,n,i){this._stageTaskMap=E(),this.ecInstance=t,this.api=e,n=this._dataProcessorHandlers=n.slice(),i=this._visualHandlers=i.slice(),this._allHandlers=n.concat(i)}function Ug(t){t.overallReset(t.ecModel,t.api,t.payload)}function Xg(t){return t.overallProgress&&Yg}function Yg(){this.agent.dirty(),this.getDownstream().dirty()}function qg(){this.agent&&this.agent.dirty()}function Zg(t){return t.plan?t.plan(t.model,t.ecModel,t.api,t.payload):null}function jg(t){t.useClearVisual&&t.data.clearAllVisual();t=t.resetDefines=Mo(t.reset(t.model,t.ecModel,t.api,t.payload));return 1'+t.dom+""}),f.painter.getSvgRoot().innerHTML=g,i.connectedBackgroundColor&&f.painter.setBackgroundColor(i.connectedBackgroundColor),f.refreshImmediately(),f.painter.toDataURL()):(i.connectedBackgroundColor&&f.add(new Ps({shape:{x:0,y:0,width:t,height:n},style:{fill:i.connectedBackgroundColor}})),P(p,function(t){t=new Is({style:{x:t.left*e-l,y:t.top*e-u,image:t.dom}});f.add(t)}),f.refreshImmediately(),d.toDataURL("image/"+(i&&i.type||"png")))):this.getDataURL(i);this.id},c.prototype.convertToPixel=function(t,e){return w0(this,"convertToPixel",t,e)},c.prototype.convertFromPixel=function(t,e){return w0(this,"convertFromPixel",t,e)},c.prototype.containPixel=function(t,i){var r;if(!this._disposed)return P(Bo(this._model,t),function(t,n){0<=n.indexOf("Models")&&P(t,function(t){var e=t.coordinateSystem;e&&e.containPoint?r=r||!!e.containPoint(i):"seriesModels"===n&&(e=this._chartsMap[t.__viewId])&&e.containPoint&&(r=r||e.containPoint(i,t))},this)},this),!!r;this.id},c.prototype.getVisual=function(t,e){var t=Bo(this._model,t,{defaultMainType:"series"}),n=t.seriesModel.getData(),t=t.hasOwnProperty("dataIndexInside")?t.dataIndexInside:t.hasOwnProperty("dataIndex")?n.indexOfRawIndex(t.dataIndex):null;return null!=t?hy(n,t,e):cy(n,e)},c.prototype.getViewOfComponentModel=function(t){return this._componentsMap[t.__viewId]},c.prototype.getViewOfSeriesModel=function(t){return this._chartsMap[t.__viewId]},c.prototype._initEvents=function(){var t,n,i,s=this;P(W0,function(a){function t(t){var n,e,i,r=s.getModel(),o=t.target;"globalout"===a?n={}:o&&dy(o,function(t){var e,t=D(t);return t&&null!=t.dataIndex?(e=t.dataModel||r.getSeriesByIndex(t.seriesIndex),n=e&&e.getDataParams(t.dataIndex,t.dataType,o)||{},1):t.eventData&&(n=O({},t.eventData),1)},!0),n&&(e=n.componentType,i=n.componentIndex,"markLine"!==e&&"markPoint"!==e&&"markArea"!==e||(e="series",i=n.seriesIndex),i=(e=e&&null!=i&&r.getComponent(e,i))&&s["series"===e.mainType?"_chartsMap":"_componentsMap"][e.__viewId],n.event=t,n.type=a,s._$eventProcessor.eventInfo={targetEl:o,packedEvent:n,model:e,view:i},s.trigger(a,n))}t.zrEventfulCallAtLast=!0,s._zr.on(a,t,s)}),P(X0,function(t,e){s._messageCenter.on(e,function(t){this.trigger(e,t)},s)}),P(["selectchanged"],function(e){s._messageCenter.on(e,function(t){this.trigger(e,t)},s)}),t=this._messageCenter,i=(n=this)._api,t.on("selectchanged",function(t){var e=i.getModel();t.isFromClick?(py("map","selectchanged",n,e,t),py("pie","selectchanged",n,e,t)):"select"===t.fromAction?(py("map","selected",n,e,t),py("pie","selected",n,e,t)):"unselect"===t.fromAction&&(py("map","unselected",n,e,t),py("pie","unselected",n,e,t))})},c.prototype.isDisposed=function(){return this._disposed},c.prototype.clear=function(){this._disposed?this.id:this.setOption({series:[]},!0)},c.prototype.dispose=function(){var t,e,n;this._disposed?this.id:(this._disposed=!0,this.getDom()&&Ho(this.getDom(),em,""),e=(t=this)._api,n=t._model,P(t._componentsViews,function(t){t.dispose(n,e)}),P(t._chartsViews,function(t){t.dispose(n,e)}),t._zr.dispose(),t._dom=t._model=t._chartsMap=t._componentsMap=t._chartsViews=t._componentsViews=t._scheduler=t._api=t._zr=t._throttledZrFlush=t._theme=t._coordSysMgr=t._messageCenter=null,delete $0[t.id])},c.prototype.resize=function(t){if(!this[s0])if(this._disposed)this.id;else{this._zr.resize(t);var e=this._model;if(this._loadingFX&&this._loadingFX.resize(),e){var e=e.resetOption("media"),n=t&&t.silent;this[l0]&&(null==n&&(n=this[l0].silent),e=!0,this[l0]=null),this[s0]=!0;try{e&&v0(this),b0.update.call(this,{type:"resize",animation:O({duration:0},t&&t.animation)})}catch(t){throw this[s0]=!1,t}this[s0]=!1,I0.call(this,n),T0.call(this,n)}}},c.prototype.showLoading=function(t,e){this._disposed?this.id:(R(t)&&(e=t,t=""),t=t||"default",this.hideLoading(),K0[t]&&(t=K0[t](this._api,e),e=this._zr,this._loadingFX=t,e.add(t)))},c.prototype.hideLoading=function(){this._disposed?this.id:(this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null)},c.prototype.makeActionFromEvent=function(t){var e=O({},t);return e.type=X0[t.type],e},c.prototype.dispatchAction=function(t,e){var n;this._disposed?this.id:(R(e)||(e={silent:!!e}),U0[t.type]&&this._model&&(this[s0]?this._pendingActions.push(t):(n=e.silent,M0.call(this,t,n),(t=e.flush)?this._zr.flush():!1!==t&&p.browser.weChat&&this._throttledZrFlush(),I0.call(this,n),T0.call(this,n))))},c.prototype.updateLabelLayout=function(){o0.trigger("series:layoutlabels",this._model,this._api,{updatedSeries:[]})},c.prototype.appendData=function(t){var e;this._disposed?this.id:(e=t.seriesIndex,this.getModel().getSeriesByIndex(e).appendData(t),this._scheduler.unfinished=!0,this.getZr().wakeUp())},c.internalField=(v0=function(t){var e=t._scheduler;e.restorePipelines(t._model),e.prepareStageTasks(),_0(t,!0),_0(t,!1),e.plan()},_0=function(t,r){for(var o=t._model,a=t._scheduler,s=r?t._componentsViews:t._chartsViews,l=r?t._componentsMap:t._chartsMap,u=t._zr,h=t._api,e=0;es.get("hoverLayerThreshold")&&!p.node&&!p.worker&&s.eachSeries(function(t){t.preventUsingHoverLayer||(t=i._chartsMap[t.__viewId]).__alive&&t.eachRendered(function(t){t.states.emphasis&&(t.states.emphasis.hoverLayer=!0)})}),o0.trigger("series:afterupdate",t,e,n)},R0=function(t){t[u0]=!0,t.getZr().wakeUp()},N0=function(t){t[u0]&&(t.getZr().storage.traverse(function(t){Rh(t)||V0(t)}),t[u0]=!1)},O0=function(n){return u(t,e=dd),t.prototype.getCoordinateSystems=function(){return n._coordSysMgr.getCoordinateSystems()},t.prototype.getComponentByElement=function(t){for(;t;){var e=t.__ecComponentInfo;if(null!=e)return n._model.getComponent(e.mainType,e.index);t=t.parent}},t.prototype.enterEmphasis=function(t,e){Tl(t,e),R0(n)},t.prototype.leaveEmphasis=function(t,e){Cl(t,e),R0(n)},t.prototype.enterBlur=function(t){kl(t),R0(n)},t.prototype.leaveBlur=function(t){Dl(t),R0(n)},t.prototype.enterSelect=function(t){Al(t),R0(n)},t.prototype.leaveSelect=function(t){Ll(t),R0(n)},t.prototype.getModel=function(){return n.getModel()},t.prototype.getViewOfComponentModel=function(t){return n.getViewOfComponentModel(t)},t.prototype.getViewOfSeriesModel=function(t){return n.getViewOfSeriesModel(t)},new t(n);function t(){return null!==e&&e.apply(this,arguments)||this}var e},void(P0=function(i){function r(t,e){for(var n=0;ne[1]&&(e[1]=t[1])},iv.prototype.unionExtentFromData=function(t,e){this.unionExtent(t.getApproximateExtent(e))},iv.prototype.getExtent=function(){return this._extent.slice()},iv.prototype.setExtent=function(t,e){var n=this._extent;isNaN(t)||(n[0]=t),isNaN(e)||(n[1]=e)},iv.prototype.isInExtentRange=function(t){return this._extent[0]<=t&&this._extent[1]>=t},iv.prototype.isBlank=function(){return this._isBlank},iv.prototype.setBlank=function(t){this._isBlank=t};var nv=iv;function iv(t){this._setting=t||{},this._extent=[1/0,-1/0]}Jo(nv);var rv=0,ov=(av.createByAxisModel=function(t){var t=t.option,e=t.data,e=e&&B(e,sv);return new av({categories:e,needCollect:!e,deduplication:!1!==t.dedplication})},av.prototype.getOrdinal=function(t){return this._getOrCreateMap().get(t)},av.prototype.parseAndCollect=function(t){var e,n,i=this._needCollect;return F(t)||i?(i&&!this._deduplication?(n=this.categories.length,this.categories[n]=t):null==(n=(e=this._getOrCreateMap()).get(t))&&(i?(n=this.categories.length,this.categories[n]=t,e.set(t,n)):n=NaN),n):t},av.prototype._getOrCreateMap=function(){return this._map||(this._map=E(this.categories))},av);function av(t){this.categories=t.categories||[],this._needCollect=t.needCollect,this._deduplication=t.deduplication,this.uid=++rv}function sv(t){return R(t)&&null!=t.value?t.value:t+""}function lv(t){return"interval"===t.type||"log"===t.type}function uv(t,e,n,i){var r={},o=t[1]-t[0],o=r.interval=mo(o/e,!0),e=(null!=n&&oi[1]&&(i[0]=i[1]),r}function hv(t){var e=Math.pow(10,yo(t)),t=t/e;return t?2===t?t=3:3===t?t=5:t*=2:t=1,oo(t*e)}function cv(t){return so(t)+2}function pv(t,e,n){t[e]=Math.max(Math.min(t[e],n[1]),n[0])}function dv(t,e){return t>=e[0]&&t<=e[1]}function fv(t,e){return e[1]===e[0]?.5:(t-e[0])/(e[1]-e[0])}function gv(t,e){return t*(e[1]-e[0])+e[0]}u(vv,yv=nv),vv.prototype.parse=function(t){return null==t?NaN:F(t)?this._ordinalMeta.getOrdinal(t):Math.round(t)},vv.prototype.contain=function(t){return dv(t=this.parse(t),this._extent)&&null!=this._ordinalMeta.categories[t]},vv.prototype.normalize=function(t){return fv(t=this._getTickNumber(this.parse(t)),this._extent)},vv.prototype.scale=function(t){return t=Math.round(gv(t,this._extent)),this.getRawOrdinalNumber(t)},vv.prototype.getTicks=function(){for(var t=[],e=this._extent,n=e[0];n<=e[1];)t.push({value:n}),n++;return t},vv.prototype.getMinorTicks=function(t){},vv.prototype.setSortInfo=function(t){if(null==t)this._ordinalNumbersByTick=this._ticksByOrdinalNumber=null;else{for(var e=t.ordinalNumbers,n=this._ordinalNumbersByTick=[],i=this._ticksByOrdinalNumber=[],r=0,o=this._ordinalMeta.categories.length,a=Math.min(o,e.length);r=t},vv.prototype.getOrdinalMeta=function(){return this._ordinalMeta},vv.prototype.calcNiceTicks=function(){},vv.prototype.calcNiceExtent=function(){},vv.type="ordinal";var yv,mv=vv;function vv(t){var t=yv.call(this,t)||this,e=(t.type="ordinal",t.getSetting("ordinalMeta"));return V(e=e||new ov({}))&&(e=new ov({categories:B(e,function(t){return R(t)?t.value:t})})),t._ordinalMeta=e,t._extent=t.getSetting("extent")||[0,e.categories.length-1],t}nv.registerClass(mv);var _v,xv=oo,bv=(u(wv,_v=nv),wv.prototype.parse=function(t){return t},wv.prototype.contain=function(t){return dv(t,this._extent)},wv.prototype.normalize=function(t){return fv(t,this._extent)},wv.prototype.scale=function(t){return gv(t,this._extent)},wv.prototype.setExtent=function(t,e){var n=this._extent;isNaN(t)||(n[0]=parseFloat(t)),isNaN(e)||(n[1]=parseFloat(e))},wv.prototype.unionExtent=function(t){var e=this._extent;t[0]e[1]&&(e[1]=t[1]),this.setExtent(e[0],e[1])},wv.prototype.getInterval=function(){return this._interval},wv.prototype.setInterval=function(t){this._interval=t,this._niceExtent=this._extent.slice(),this._intervalPrecision=cv(t)},wv.prototype.getTicks=function(t){var e=this._interval,n=this._extent,i=this._niceExtent,r=this._intervalPrecision,o=[];if(e){n[0]s&&o.push(t?{value:xv(s+e,r)}:{value:n[1]})}return o},wv.prototype.getMinorTicks=function(t){for(var e=this.getTicks(!0),n=[],i=this.getExtent(),r=1;ri[0]&&h=M[0]&&d<=M[1]&&a++)}u=(M[1]-M[0])/w;if(1.5*u=M[0]&&t.value<=M[1]&&!t.notAdd})}),function(t){return 0n&&(this._approxInterval=n),zv.length),t=Math.min(function(t,e,n,i){for(;n>>1;t[r][1]>1^-(1&s),l=(l=t.charCodeAt(a+1)-64)>>1^-(1&l);i.push([(r=s+=r)/n,(o=l+=o)/n])}return i}function D_(t,o){var e,n,r;return B(ht((t=(e=t).UTF8Encoding?(null==(r=(n=e).UTF8Scale)&&(r=1024),P(n.features,function(t){var e=t.geometry,n=e.encodeOffsets,i=e.coordinates;if(n)switch(e.type){case"LineString":e.coordinates=k_(i,n,r);break;case"Polygon":case"MultiLineString":C_(i,n,r);break;case"MultiPolygon":P(i,function(t,e){return C_(t,n[e],r)})}}),n.UTF8Encoding=!1,n):e).features,function(t){return t.geometry&&t.properties&&0l&&(l=s[h],u=h);++o[u],s[u]=0,++a}return B(o,function(t){return t/i})}(t,n)[e]||0},getPixelPrecision:uo,getPrecision:so,getPrecisionSafe:lo,isNumeric:xo,isRadianAroundZero:co,linearMap:io,nice:mo,numericToNumber:_o,parseDate:fo,quantile:function(t,e){var e=(t.length-1)*e+1,n=Math.floor(e),i=+t[n-1];return(e=e-n)?i+e*(t[n]-i):i},quantity:go,quantityExponent:yo,reformIntervals:vo,remRadian:ho,round:oo}),_c=Object.freeze({__proto__:null,format:Jc,parse:fo}),qc=Object.freeze({__proto__:null,Arc:uh,BezierCurve:oh,BoundingRect:X,Circle:fu,CompoundPath:ph,Ellipse:vu,Group:Xr,Image:Is,IncrementalDisplayable:n,Line:Ju,LinearGradient:mh,Polygon:Uu,Polyline:Zu,RadialGradient:fh,Rect:Ps,Ring:Vu,Sector:Nu,Text:Bs,clipPointsByRect:function(t,n){return B(t,function(t){var e=t[0],e=Vh(e,n.x),t=(e=Fh(e,n.x+n.width),t[1]),t=Vh(t,n.y);return[e,Fh(t,n.y+n.height)]})},clipRectByRect:function(t,e){var n=Vh(t.x,e.x),i=Fh(t.x+t.width,e.x+e.width),r=Vh(t.y,e.y),t=Fh(t.y+t.height,e.y+e.height);if(n<=i&&r<=t)return{x:n,y:r,width:i-n,height:t-r}},createIcon:Jh,extendPath:function(t,e){return Hh(t,e)},extendShape:function(t){return j.extend(t)},getShapeClass:function(t){if(Gh.hasOwnProperty(t))return Gh[t]},getTransform:Kh,initProps:Ph,makeImage:Xh,makePath:Uh,mergePath:qh,registerShape:Wh,resizePath:Zh,updateProps:Oh}),Sc=Object.freeze({__proto__:null,addCommas:gp,capitalFirst:function(t){return t&&t.charAt(0).toUpperCase()+t.substr(1)},encodeHTML:xe,formatTime:function(t,e,n){"week"!==t&&"month"!==t&&"quarter"!==t&&"half-year"!==t&&"year"!==t||(t="MM-dd\nyyyy");var i=(e=fo(e))[(n=n?"getUTC":"get")+"FullYear"](),r=e[n+"Month"]()+1,o=e[n+"Date"](),a=e[n+"Hours"](),s=e[n+"Minutes"](),l=e[n+"Seconds"](),e=e[n+"Milliseconds"]();return t=t.replace("MM",$c(r,2)).replace("M",r).replace("yyyy",i).replace("yy",$c(i%100+"",2)).replace("dd",$c(o,2)).replace("d",o).replace("hh",$c(a,2)).replace("h",a).replace("mm",$c(s,2)).replace("m",s).replace("ss",$c(l,2)).replace("s",l).replace("SSS",$c(e,3))},formatTpl:_p,getTextRect:function(t,e,n,i,r,o,a,s){return new Bs({style:{text:t,font:e,align:n,verticalAlign:i,padding:r,rich:o,overflow:a?"truncate":null,lineHeight:s}}).getBoundingRect()},getTooltipMarker:function(t,e){var n=(t=F(t)?{color:t,extraCssText:e}:t||{}).color,i=t.type,r=(e=t.extraCssText,t.renderMode||"html");return n?"html"===r?"subItem"===i?'':'':{renderMode:r,content:"{"+(t.markerId||"markerX")+"|} ",style:"subItem"===i?{width:4,height:4,borderRadius:2,backgroundColor:n}:{width:10,height:10,borderRadius:5,backgroundColor:n}}:""},normalizeCssArray:mp,toCamelCase:function(t,e){return t=(t||"").toLowerCase().replace(/-(.)/g,function(t,e){return e.toUpperCase()}),t=e?t&&t.charAt(0).toUpperCase()+t.slice(1):t},truncateText:ua}),uy=Object.freeze({__proto__:null,bind:pt,clone:y,curry:dt,defaults:z,each:P,extend:O,filter:ht,indexOf:C,inherits:at,isArray:V,isFunction:k,isObject:R,isString:F,map:B,merge:d,reduce:ut}),A_=Eo();function L_(t){return"category"===t.type?(r=(e=t).getLabelModel(),o=P_(e,r),!r.get("show")||e.scale.isBlank()?{labels:[],labelCategoryInterval:o.labelCategoryInterval}:o):(r=(n=t).scale.getTicks(),i=r_(n),{labels:B(r,function(t,e){return{level:t.level,formattedLabel:i(t,e),rawLabel:n.scale.getLabel(t),tickValue:t.value}})});var n,i,e,r,o}function O_(t,e){var n,i,r,o,a,s;return"category"===t.type?(e=e,o=R_(n=t,"ticks"),a=a_(e),(s=N_(o,a))||(e.get("show")&&!n.scale.isBlank()||(i=[]),i=k(a)?B_(n,a,!0):"auto"===a?(s=P_(n,n.getLabelModel()),r=s.labelCategoryInterval,B(s.labels,function(t){return t.tickValue})):z_(n,r=a,!0),E_(o,a,{ticks:i,tickCategoryInterval:r}))):{ticks:B(t.scale.getTicks(),function(t){return t.value})}}function P_(t,e){var n,i=R_(t,"labels"),e=a_(e),r=N_(i,e);return r||E_(i,e,{labels:k(e)?B_(t,e):z_(t,n="auto"===e?null!=(i=A_(r=t).autoInterval)?i:A_(r).autoInterval=r.calculateCategoryInterval():e),labelCategoryInterval:n})}function R_(t,e){return A_(t)[e]||(A_(t)[e]=[])}function N_(t,e){for(var n=0;nl[1],h(n[0].coord,l[0])&&(t?n[0].coord=l[0]:n.shift()),t&&h(l[0],n[0].coord)&&n.unshift({coord:l[0]}),h(l[1],i.coord)&&(t?i.coord=l[1]:n.pop()),t)&&h(i.coord,l[1])&&n.push({coord:l[1]}),u},F_.prototype.getMinorTicksCoords=function(){var t;return"ordinal"===this.scale.type?[]:(t=this.model.getModel("minorTick").get("splitNumber"),B(this.scale.getMinorTicks(t=0=u}}for(var o,a=this.__startIndex;ar[0]){for(l=0;lt);l++);s=i[r[l]]}r.splice(l+1,0,t),(i[t]=e).virtual||(s?(n=s.dom).nextSibling?a.insertBefore(e.dom,n.nextSibling):a.appendChild(e.dom):a.firstChild?a.insertBefore(e.dom,a.firstChild):a.appendChild(e.dom)),e.painter||(e.painter=this)}},v.prototype.eachLayer=function(t,e){for(var n=this._zlevelList,i=0;ie&&(e=t[n]);return isFinite(e)?e:NaN},min:function(t){for(var e=1/0,n=0;n=r.r0?"endArc":"startArc":r.endAngle>=r.startAngle?"endAngle":"startAngle":a?0<=r.height?"bottom":"top":0<=r.width?"right":"left"),h=sc(i),l=(ac(t,h,{labelFetcher:o,labelDataIndex:n,defaultText:q1(o.getData(),n),inheritColor:l.fill,defaultOpacity:l.opacity,defaultOutsidePosition:u}),t.getTextContent()),h=(s&&l&&(s=i.get(["label","position"]),t.textConfig.inside="middle"===s||null,function(t,e,n,i){if(gt(i))t.setTextConfig({rotation:i});else if(V(e))t.setTextConfig({rotation:0});else{var r,i=t.shape,o=i.clockwise?i.startAngle:i.endAngle,a=i.clockwise?i.endAngle:i.startAngle,s=(o+a)/2,i=n(e);switch(i){case"startArc":case"insideStartArc":case"middle":case"insideEndArc":case"endArc":r=s;break;case"startAngle":case"insideStartAngle":r=o;break;case"endAngle":case"insideEndAngle":r=a;break;default:return t.setTextConfig({rotation:0})}n=1.5*Math.PI-r;"middle"===i&&n>Math.PI/2&&n<1.5*Math.PI&&(n-=Math.PI),t.setTextConfig({rotation:n})}}(t,"outside"===s?u:s,hx(a),i.get(["label","rotate"]))),u=l,s=h,a=o.getRawValue(n),l=function(t){return Z1(e,t)},u&&((u=fc(u)).prevValue=u.value,u.value=a,a=s.normal,u.valueAnimation=a.get("valueAnimation"),u.valueAnimation)&&(u.precision=a.get("precision"),u.defaultInterpolatedText=l,u.statesModels=s),i.getModel(["emphasis"]));Vl(t,h.get("focus"),h.get("blurScope"),h.get("disabled")),Hl(t,i),null!=(o=r).startAngle&&null!=o.endAngle&&o.startAngle===o.endAngle&&(t.style.fill="none",t.style.stroke="none",P(t.states,function(t){t.style&&(t.style.fill=t.style.stroke="none")}))}var px,dx=function(){},fx=(u(gx,px=j),gx.prototype.getDefaultShape=function(){return new dx},gx.prototype.buildPath=function(t,e){for(var n=e.points,i=this.baseDimIdx,r=1-this.baseDimIdx,o=[],a=[],s=this.barWidth,l=0;le[u-1].coord&&(e.reverse(),h.reverse()),function(t,e){var n,i,r=[],o=t.length;function a(t,e,n){var i=t.coord;return{coord:n,color:bi((n-i)/(e.coord-i),[t.color,e.color])}}for(var s=0;si)return;return 1}(a,e))return r=e.mapDimension(a.dim),o={},P(a.getViewLabels(),function(t){t=a.scale.getRawOrdinalNumber(t.tickValue);o[t]=1}),function(t){return!o.hasOwnProperty(e.get(r,t))}}}function eb(t){for(var e,n,i=t.length/2;0e[1]&&e.reverse(),e},Tb.prototype.pointToData=function(t,e){return this.coordToData(this.toLocalCoord(t["x"===this.dim?0:1]),e)},Tb.prototype.setCategorySortInfo=function(t){if("category"!==this.type)return!1;this.model.option.categorySortInfo=t,this.scale.setSortInfo(t)};var Mb,Ib=Tb;function Tb(t,e,n,i,r){t=Mb.call(this,t,e,n)||this;return t.index=0,t.type=i||"value",t.position=r||"bottom",t}function Cb(t){return"cartesian2d"===t.get("coordinateSystem")}function kb(i){var r={xAxisModel:null,yAxisModel:null};return P(r,function(t,e){var n=e.replace(/Model$/,""),n=i.getReferringComponents(n,Fo).models[0];r[e]=n}),r}var Db=Math.log;Lb.prototype.getRect=function(){return this._rect},Lb.prototype.update=function(t,e){var n=this._axesMap;function i(t){var d,e=ct(t),n=e.length;if(n){for(var i=[],r=n-1;0<=r;r--){var o=t[+e[r]],a=o.model,s=o.scale;lv(s)&&a.get("alignTicks")&&null==a.get("interval")?i.push(o):(n_(s,a),lv(s)&&(d=o))}i.length&&(d||n_((d=i.pop()).scale,d.model),P(i,function(t){var e=t.scale,t=t.model,n=d.scale,i=bv.prototype,r=i.getTicks.call(n),o=i.getTicks.call(n,!0),a=r.length-1,n=i.getInterval.call(n),s=(t=e_(e,t)).extent,l=t.fixMin,t=t.fixMax,u=("log"===e.type&&(u=Db(e.base),s=[Db(s[0])/u,Db(s[1])/u]),e.setExtent(s[0],s[1]),e.calcNiceExtent({splitNumber:a,fixMin:l,fixMax:t}),i.getExtent.call(e)),h=(l&&(s[0]=u[0]),t&&(s[1]=u[1]),i.getInterval.call(e)),c=s[0],p=s[1];if(l&&t)h=(p-c)/a;else if(l)for(p=s[0]+h*a;ps[0]&&isFinite(c)&&isFinite(s[0]);)h=hv(h),c=s[1]-h*a;else{u=(h=ah[1]?-1:1,o=["start"===c?h[0]-o*u:"end"===c?h[1]+o*u:(h[0]+h[1])/2,Gb(c)?t.labelOffset+l*u:0],null!=(u=e.get("nameRotate"))&&(u=u*Nb/180),Gb(c)?a=Eb.innerTextLayout(t.rotation,null!=u?u:t.rotation,l):(a=function(t,e,n,i){var r,n=ho(n-t),t=i[0]>i[1],i="start"===e&&!t||"start"!==e&&t;e=co(n-Nb/2)?(r=i?"bottom":"top","center"):co(n-1.5*Nb)?(r=i?"top":"bottom","center"):(r="middle",n<1.5*Nb&&Nb/2u[1]&&u.reverse(),(s=null==s||s>u[1]?u[1]:s)n[r],f=[-c.x,-c.y],e=(e||(f[i]=l[s]),[0,0]),s=[-p.x,-p.y],g=N(t.get("pageButtonGap",!0),t.get("itemGap",!0)),f=(d&&("end"===t.get("pageButtonPosition",!0)?s[i]+=n[r]-p[r]:e[i]+=p[r]+g),s[1-i]+=c[o]/2-p[o]/2,l.setPosition(f),u.setPosition(e),h.setPosition(s),{x:0,y:0}),c=(f[r]=(d?n:c)[r],f[o]=Math.max(c[o],p[o]),f[a]=Math.min(0,p[a]+s[1-i]),u.__rectSize=n[r],d?((e={x:0,y:0})[r]=Math.max(n[r]-p[r]-g,0),e[o]=f[o],u.setClipPath(new Ps({shape:e})),u.__rectSize=e[r]):h.eachChild(function(t){t.attr({invisible:!0,silent:!0})}),this._getPageInfo(t));return null!=c.pageIndex&&Oh(l,{x:c.contentPosition[0],y:c.contentPosition[1]},d?t:null),this._updatePageInfoView(t,c),f},Fw.prototype._pageGo=function(t,e,n){t=this._getPageInfo(e)[t];null!=t&&n.dispatchAction({type:"legendScroll",scrollDataIndex:t,legendId:e.id})},Fw.prototype._updatePageInfoView=function(n,i){var r=this._controllerGroup,t=(P(["pagePrev","pageNext"],function(t){var e=null!=i[t+"DataIndex"],t=r.childOfName(t);t&&(t.setStyle("fill",e?n.get("pageIconColor",!0):n.get("pageIconInactiveColor",!0)),t.cursor=e?"pointer":"default")}),r.childOfName("pageText")),e=n.get("pageFormatter"),o=i.pageIndex,o=null!=o?o+1:0,a=i.pageCount;t&&e&&t.setStyle("text",F(e)?e.replace("{current}",null==o?"":o+"").replace("{total}",null==a?"":a+""):e({current:o,total:a}))},Fw.prototype._getPageInfo=function(t){var e=t.get("scrollDataIndex",!0),n=this.getContentGroup(),i=this._containerGroup.__rectSize,t=t.getOrient().index,r=zw[t],o=Bw[t],e=this._findTargetItemIndex(e),a=n.children(),s=a[e],l=a.length,u=l?1:0,h={contentPosition:[n.x,n.y],pageCount:u,pageIndex:u-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(s){n=g(s);h.contentPosition[t]=-n.s;for(var c=e+1,p=n,d=n,f=null;c<=l;++c)(!(f=g(a[c]))&&d.e>p.s+i||f&&!y(f,p.s))&&(p=d.i>p.i?d:f)&&(null==h.pageNextDataIndex&&(h.pageNextDataIndex=p.i),++h.pageCount),d=f;for(c=e-1,p=n,d=n,f=null;-1<=c;--c)(f=g(a[c]))&&y(d,f.s)||!(p.i=e&&t.s<=e+i}},Fw.prototype._findTargetItemIndex=function(n){var i,r;return this._showController?(this.getContentGroup().eachChild(function(t,e){t=t.__legendDataIndex;null==r&&null!=t&&(r=e),t===n&&(i=e)}),null!=i?i:r):0},Fw.type="legend.scroll",Fw);function Fw(){var t=null!==Nw&&Nw.apply(this,arguments)||this;return t.type=Fw.type,t.newlineDisabled=!0,t._currentIndex=0,t}function Gw(t,e){if(t)for(var n=V(t)?t:[t],i=0;ih[0]?s:r)[0]:o[0]=(a[0]>h[0]?r:s)[0],"y0"===n[1]?o[1]=(a[1]>h[1]?s:r)[1]:o[1]=(a[1]>h[1]?r:s)[1],i.getMarkerPosition(o,n,!0)):(a=[l=t.get(n[0],e),u=t.get(n[1],e)],c.clampData&&c.clampData(a,a),c.dataToPoint(a,!0)),Y1(c,"cartesian2d")&&(r=c.getAxis("x"),s=c.getAxis("y"),l=t.get(n[0],e),u=t.get(n[1],e),HS(l)?h[0]=r.toGlobalCoord(r.getExtent()["x0"===n[0]?0:1]):HS(u)&&(h[1]=s.toGlobalCoord(s.getExtent()["y0"===n[1]?0:1]))),isNaN(d)||(h[0]=d),isNaN(p)||(h[1]=p)):h=[d,p],h}var YS,qS=[["x0","y0"],["x1","y0"],["x1","y1"],["x0","y1"]],ZS=(u(jS,YS=vu),jS.prototype.updateTransform=function(t,e,r){e.eachSeries(function(n){var i,t=Xw.getMarkerModelFromSeries(n,"markArea");t&&(i=t.getData()).each(function(e){var t=B(qS,function(t){return XS(i,e,t,n,r)});i.setItemLayout(e,t),i.getItemGraphicEl(e).setShape("points",t)})},this)},jS.prototype.renderSeries=function(a,r,t,s){var l=a.coordinateSystem,e=a.id,u=a.getData(),n=this.markerGroupMap,i=n.get(e)||n.set(e,{group:new Xr}),h=(this.group.add(i.group),this.markKeep(i),function(t,n,e){var i,r;{var o;i=t?(o=B(t&&t.dimensions,function(t){var e=n.getData();return O(O({},e.getDimensionInfo(e.mapDimension(t))||{}),{name:t,ordinalMeta:null})}),r=B(["x0","y0","x1","y1"],function(t,e){return{name:t,type:o[e%2].type}}),new qm(r,e)):new qm(r=[{name:"value",type:"float"}],e)}e=B(e.get("data"),dt(FS,n,t,e));t&&(e=ht(e,dt(US,t)));t=t?function(t,e,n,i){return Df(t.coord[Math.floor(i/2)][i%2],r[i])}:function(t,e,n,i){return Df(t.value,r[i])};return i.initData(e,null,t),i.hasItemOption=!0,i}(l,a,r));r.setData(h),h.each(function(e){var t=B(qS,function(t){return XS(h,e,t,a,s)}),n=l.getAxis("x").scale,i=l.getAxis("y").scale,r=n.getExtent(),o=i.getExtent(),n=[n.parse(h.get("x0",e)),n.parse(h.get("x1",e))],i=[i.parse(h.get("y0",e)),i.parse(h.get("y1",e))],r=(ao(n),ao(i),!(r[0]>n[1]||r[1]i[1]||o[1]"],V(t)&&(t=t.slice(),i=!0),e?t:i?[s(t[0]),s(t[1])]:s(t));return F(r)?r.replace("{value}",i?e[0]:e).replace("{value2}",i?e[1]:e):k(r)?i?r(t[0],t[1]):r(t):i?t[0]===a[0]?n[0]+" "+e[1]:t[1]===a[1]?n[1]+" "+e[0]:e[0]+" - "+e[1]:e;function s(t){return t===a[0]?"min":t===a[1]?"max":(+t).toFixed(Math.min(o,20))}},IM.prototype.resetExtent=function(){var t=this.option,t=SM([t.min,t.max]);this._dataExtent=t},IM.prototype.getDataDimensionIndex=function(t){var e=this.option.dimension;if(null!=e)return t.getDimensionIndex(e);for(var n=t.dimensions,i=n.length-1;0<=i;i--){var r=n[i],r=t.getDimensionInfo(r);if(!r.isCalculationCoord)return r.storeDimIndex}},IM.prototype.getExtent=function(){return this._dataExtent.slice()},IM.prototype.completeVisualOption=function(){var e=this.ecModel,n=this.option,t={inRange:n.inRange,outOfRange:n.outOfRange},i=n.target||(n.target={}),r=n.controller||(n.controller={}),u=(d(i,t),d(r,t),this.isCategory());function o(t){bM(n.color)&&!t.inRange&&(t.inRange={color:n.color.slice().reverse()}),t.inRange=t.inRange||{color:e.get("gradientColor")}}o.call(this,i),o.call(this,r),function(t,e,n){var e=t[e],i=t[n];e&&!i&&(i=t[n]={},wM(e,function(t,e){var n;eM.isValidType(e)&&null!=(n=KS(e,"inactive",u))&&(i[e]=n,"color"!==e||i.hasOwnProperty("opacity")||i.hasOwnProperty("colorAlpha")||(i.opacity=[0,0]))}))}.call(this,i,"inRange","outOfRange"),function(r){var o=(r.inRange||{}).symbol||(r.outOfRange||{}).symbol,a=(r.inRange||{}).symbolSize||(r.outOfRange||{}).symbolSize,s=this.get("inactiveColor"),l=this.getItemSymbol()||"roundRect";wM(this.stateList,function(t){var e,n=this.itemSize,i=r[t],t=(null==(i=i||(r[t]={color:u?s:[s]})).symbol&&(i.symbol=o&&y(o)||(u?l:[l])),null==i.symbolSize&&(i.symbolSize=a&&y(a)||(u?n[0]:[n[0],n[0]])),i.symbol=_M(i.symbol,function(t){return"none"===t?l:t}),i.symbolSize);null!=t&&(e=-1/0,xM(t,function(t){ee[1]&&e.reverse(),e[0]=Math.max(e[0],t[0]),e[1]=Math.min(e[1],t[1]))},DM.prototype.completeVisualOption=function(){TM.prototype.completeVisualOption.apply(this,arguments),P(this.stateList,function(t){t=this.option.controller[t].symbolSize;t&&t[0]!==t[1]&&(t[0]=t[1]/3)},this)},DM.prototype.setSelected=function(t){this.option.range=t.slice(),this._resetRange()},DM.prototype.getSelected=function(){var t=this.getExtent(),e=ao((this.get("range")||[]).slice());return e[0]>t[1]&&(e[0]=t[1]),e[1]>t[1]&&(e[1]=t[1]),e[0]=n[1]||t<=e[1])?"inRange":"outOfRange"},DM.prototype.findTargetDataIndices=function(i){var r=[];return this.eachTargetSeries(function(t){var n=[],e=t.getData();e.each(this.getDataDimensionIndex(e),function(t,e){i[0]<=t&&t<=i[1]&&n.push(e)},this),r.push({seriesId:t.id,dataIndex:n})},this),r},DM.prototype.getVisualMeta=function(n){var t=AM(0,0,this.getExtent()),e=AM(0,0,this.option.range.slice()),i=[];function r(t,e){i.push({value:t,color:n(t,e)})}for(var o=0,a=0,s=e.length,l=t.length;ao&&(n[1-t]=n[t]+i.sign*o),s.getExtent());this._dataInterval=[VM(l[0],u,h,!0),VM(l[1],u,h,!0)]},_.prototype._updateView=function(t){var e=this.visualMapModel,n=e.getExtent(),i=this._shapes,e=[0,e.itemSize[1]],t=t?e:this._handleEnds,r=this._createBarVisual(this._dataInterval,n,t,"inRange"),n=this._createBarVisual(n,n,e,"outOfRange");i.inRange.setStyle({fill:r.barColor}).setShape("points",r.barPoints),i.outOfRange.setStyle({fill:n.barColor}).setShape("points",n.barPoints),this._updateHandle(t,r)},_.prototype._createBarVisual=function(t,e,n,i){var i={forceState:i,convertOpacityToAlpha:!0},r=this._makeColorGradient(t,i),t=[this.getControllerVisual(t[0],"symbolSize",i),this.getControllerVisual(t[1],"symbolSize",i)],i=this._createBarPoints(n,t);return{barColor:new mh(0,0,0,1,r),barPoints:i,handlesColor:[r[0].color,r[r.length-1].color]}},_.prototype._makeColorGradient=function(t,e){var n=[],i=(t[1]-t[0])/100;n.push({color:this.getControllerVisual(t[0],"color",e),offset:0});for(var r=1;r<100;r++){var o=t[0]+i*r;if(o>t[1])break;n.push({color:this.getControllerVisual(o,"color",e),offset:r/100})}return n.push({color:this.getControllerVisual(t[1],"color",e),offset:1}),n},_.prototype._createBarPoints=function(t,e){var n=this.visualMapModel.itemSize;return[[n[0]-e[0],t[0]],[n[0],t[0]],[n[0],t[1]],[n[0]-e[1],t[1]]]},_.prototype._createBarGroup=function(t){var e=this._orient,n=this.visualMapModel.get("inverse");return new Xr("horizontal"!==e||n?"horizontal"===e&&n?{scaleX:"bottom"===t?-1:1,rotation:-Math.PI/2}:"vertical"!==e||n?{scaleX:"left"===t?1:-1}:{scaleX:"left"===t?1:-1,scaleY:-1}:{scaleX:"bottom"===t?1:-1,rotation:Math.PI/2})},_.prototype._updateHandle=function(i,r){var o,a,s,l,u,h;this._useHandle&&(o=this._shapes,a=this.visualMapModel,s=o.handleThumbs,l=o.handleLabels,u=a.itemSize,h=a.getExtent(),FM([0,1],function(t){var e=s[t],n=(e.setStyle("fill",r.handlesColor[t]),e.y=i[t],VM(i[t],[0,u[1]],h,!0)),n=this.getControllerVisual(n,"symbolSize"),n=(e.scaleX=e.scaleY=n/u[0],e.x=u[0]-n/2,$h(o.handleLabelPoints[t],Kh(e,this.group)));l[t].setStyle({x:n[0],y:n[1],text:a.formatValueText(this._dataInterval[t]),verticalAlign:"middle",align:"vertical"===this._orient?this._applyTransform("left",o.mainGroup):"center"})},this))},_.prototype._showIndicator=function(t,e,n,i){var r=this.visualMapModel,o=r.getExtent(),a=r.itemSize,s=[0,a[1]],l=this._shapes,u=l.indicator;if(u){u.attr("invisible",!1);var h=this.getControllerVisual(t,"color",{convertOpacityToAlpha:!0}),c=this.getControllerVisual(t,"symbolSize"),t=VM(t,o,s,!0),o=a[0]-c/2,s={x:u.x,y:u.y},a=(u.y=t,u.x=o,$h(l.indicatorLabelPoint,Kh(u,this.group))),c=l.indicatorLabel,l=(c.attr("invisible",!1),this._applyTransform("left",l.mainGroup)),p="horizontal"===this._orient,n=(c.setStyle({text:(n||"")+r.formatValueText(e),verticalAlign:p?l:"middle",align:p?"center":l}),{x:o,y:t,style:{fill:h}}),e={style:{x:a[0],y:a[1]}},d=(r.ecModel.isAnimationEnabled()&&!this._firstShowIndicator?(p={duration:100,easing:"cubicInOut",additive:!0},u.x=s.x,u.y=s.y,u.animateTo(n,p),c.animateTo(e,p)):(u.attr(n),c.attr(e)),this._firstShowIndicator=!1,this._shapes.handleLabels);if(d)for(var f=0;f ",r):this._showIndicator(t,t,"≈ ",r)),a=this._hoverLinkDataIndices,n=[],(e||XM(o))&&(n=this._hoverLinkDataIndices=o.findTargetDataIndices(i)),t=n,r={},s(a||[],e={}),s(t||[],r,e),i=[l(e),l(r)],this._dispatchHighDown("downplay",zM(i[0],o)),this._dispatchHighDown("highlight",zM(i[1],o)))},_.prototype._hoverLinkFromSeriesMouseOver=function(t){var e,n;dy(t.target,function(t){t=D(t);return null!=t.dataIndex&&(e=t,1)},!0),e&&(t=this.ecModel.getSeriesByIndex(e.seriesIndex),(n=this.visualMapModel).isTargetSeries(t))&&(n=(t=t.getData(e.dataType)).getStore().get(n.getDataDimensionIndex(t),e.dataIndex),isNaN(n)||this._showIndicator(n,n))},_.prototype._hideIndicator=function(){var t=this._shapes,e=(t.indicator&&t.indicator.attr("invisible",!0),t.indicatorLabel&&t.indicatorLabel.attr("invisible",!0),this._shapes.handleLabels);if(e)for(var n=0;nMath.abs(e[1])?0n&&s([n,t[0]],"outOfRange"),s(t.slice()),n=t[1])},this),{stops:r,outerColors:o};function s(t,e){var n=a.getRepresentValue({interval:t}),n=(e=e||a.getValueState(n),i(n,e));t[0]===-1/0?o[0]=n:t[1]===1/0?o[1]=n:r.push({value:t[0],color:n},{value:t[1],color:n})}},oI.type="visualMap.piecewise",oI.defaultOption=Rc(n.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});var iI,rI=oI;function oI(){var t=null!==iI&&iI.apply(this,arguments)||this;return t.type=oI.type,t._pieceList=[],t}var aI={splitNumber:function(t){var e=this.option,n=Math.min(e.precision,20),i=this.getExtent(),r=e.splitNumber,r=Math.max(parseInt(r,10),1);e.splitNumber=r;for(var o=(i[1]-i[0])/r;+o.toFixed(n)!==o&&n<5;)n++;e.precision=n,o=+o.toFixed(n),e.minOpen&&t.push({interval:[-1/0,i[0]],close:[0,0]});for(var a=0,s=i[0];a","≥"][e[0]]];t.text=t.text||this.formatValueText(null!=t.value?t.value:t.interval,!1,e)},this)}};function sI(t,e){var n=t.inverse;("vertical"===t.orient?!n:n)&&e.reverse()}u(hI,lI=fh),hI.prototype.doRender=function(){var i=this.group,r=(i.removeAll(),this.visualMapModel),o=r.get("textGap"),t=r.textStyleModel,a=t.getFont(),s=t.getTextColor(),l=this._getItemAlign(),u=r.itemSize,t=this._getViewData(),e=t.endsText,h=St(r.get("showLabel",!0),!e);e&&this._renderEndsText(i,e[0],u,h,l),P(t.viewPieceList,function(t){var e=t.piece,n=new Xr,t=(n.onclick=pt(this._onItemClick,this,e),this._enableHoverLink(n,t.indexInModelPieceList),r.getRepresentValue(e));this._createItemSymbol(n,t,[0,0,u[0],u[1]]),h&&(t=this.visualMapModel.getValueState(t),n.add(new Bs({style:{x:"right"===l?-o:u[0]+o,y:u[1]/2,text:e.text,verticalAlign:"middle",align:l,font:a,fill:s,opacity:"outOfRange"===t?.5:1}}))),i.add(n)},this),e&&this._renderEndsText(i,e[1],u,h,l),Tp(r.get("orient"),i,r.get("itemGap")),this.renderBackground(i),this.positionGroup(i)},hI.prototype._enableHoverLink=function(t,n){var i=this,e=(t.on("mouseover",function(){return e("highlight")}).on("mouseout",function(){return e("downplay")}),function(t){var e=i.visualMapModel;e.option.hoverLink&&i.api.dispatchAction({type:t,batch:zM(e.findTargetDataIndices(n),e)})})},hI.prototype._getItemAlign=function(){var t=this.visualMapModel,e=t.option;return"vertical"===e.orient?EM(t,this.api,t.itemSize):(t=e.align)&&"auto"!==t?t:"left"},hI.prototype._renderEndsText=function(t,e,n,i,r){var o,a;e&&(o=new Xr,a=this.visualMapModel.textStyleModel,o.add(new Bs({style:lc(a,{x:i?"right"===r?n[0]:0:n[0]/2,y:n[1]/2,verticalAlign:"middle",align:i?r:"center",text:e})})),t.add(o))},hI.prototype._getViewData=function(){var t=this.visualMapModel,e=B(t.getPieceList(),function(t,e){return{piece:t,indexInModelPieceList:e}}),n=t.get("text"),i=t.get("orient"),t=t.get("inverse");return("horizontal"===i?t:!t)?e.reverse():n=n&&n.slice().reverse(),{viewPieceList:e,endsText:n}},hI.prototype._createItemSymbol=function(t,e,n){t.add(Ty(this.getControllerVisual(e,"symbol"),n[0],n[1],n[2],n[3],this.getControllerVisual(e,"color")))},hI.prototype._onItemClick=function(t){var n,i,e=this.visualMapModel,r=e.option,o=r.selectedMode;o&&(n=y(r.selected),i=e.getSelectedMapKey(t),"single"===o||!0===o?(n[i]=!0,P(n,function(t,e){n[e]=e===i})):n[i]=!n[i],this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:n}))},hI.type="visualMap.piecewise";var lI,uI=hI;function hI(){var t=null!==lI&&lI.apply(this,arguments)||this;return t.type=hI.type,t}function cI(t){t.registerComponentModel(rI),t.registerComponentView(uI),eI(t)}p_(function(t){p_(nI),p_(cI)}),p_(L1);var pI={value:"eq","<":"lt","<=":"lte",">":"gt",">=":"gte","=":"eq","!=":"ne","<>":"ne"},dI=(fI.prototype.evaluate=function(t){var e=typeof t;return F(e)?this._condVal.test(t):!!gt(e)&&this._condVal.test(t+"")},fI);function fI(t){null==(this._condVal=F(t)?new RegExp(t):bt(t)?t:null)&&f("")}yI.prototype.evaluate=function(){return this.value};var gI=yI;function yI(){}vI.prototype.evaluate=function(){for(var t=this.children,e=0;e