From 7449efc6a30dda8d43b124845c00a3bfa96250a8 Mon Sep 17 00:00:00 2001 From: chendaofei <857448963@qq.com> Date: Fri, 9 Aug 2024 09:05:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 6 + .../com/njcn/roma/client/ClientHandler.java | 13 +- .../com/njcn/roma/config/WebSocketConfig.java | 17 + .../njcn/roma/controller/TestController.java | 74 ++ .../roma/pojo/websocket/SocketMessage.java | 13 + .../com/njcn/roma/server/WebSocketServer.java | 67 ++ src/main/resources/static/echarts.min.js | 1 + src/main/resources/static/harmnic.html | 1002 ++++++++++++----- src/main/resources/static/harmnicPinPu.html | 105 ++ src/main/resources/static/index.html | 143 ++- src/main/resources/static/jquery.min.js | 5 + .../resources/static/{aaa.js => vue2.0.js} | 0 12 files changed, 1170 insertions(+), 276 deletions(-) create mode 100644 src/main/java/com/njcn/roma/config/WebSocketConfig.java create mode 100644 src/main/java/com/njcn/roma/pojo/websocket/SocketMessage.java create mode 100644 src/main/java/com/njcn/roma/server/WebSocketServer.java create mode 100644 src/main/resources/static/echarts.min.js create mode 100644 src/main/resources/static/harmnicPinPu.html create mode 100644 src/main/resources/static/jquery.min.js rename src/main/resources/static/{aaa.js => vue2.0.js} (100%) diff --git a/pom.xml b/pom.xml index 3394118..8432e19 100644 --- a/pom.xml +++ b/pom.xml @@ -144,6 +144,12 @@ + + org.springframework.boot + spring-boot-starter-websocket + + + diff --git a/src/main/java/com/njcn/roma/client/ClientHandler.java b/src/main/java/com/njcn/roma/client/ClientHandler.java index 8c69371..678bd7e 100644 --- a/src/main/java/com/njcn/roma/client/ClientHandler.java +++ b/src/main/java/com/njcn/roma/client/ClientHandler.java @@ -9,6 +9,7 @@ import com.huawei.it.eip.ump.client.listener.MessageListener; import com.huawei.it.eip.ump.common.exception.UmpException; import com.huawei.it.eip.ump.common.message.Message; import com.njcn.roma.pojo.MessageBodyDTO; +import com.njcn.roma.server.WebSocketServer; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Component; import org.springframework.web.bind.annotation.*; @@ -28,6 +29,8 @@ import java.util.Map; @RequiredArgsConstructor public class ClientHandler extends Thread { + private final WebSocketServer webSocketServer; + public String topicMsg = "{\"HRPhV_H14_phsC\":\"0.0000\",\"HRPhV_H14_phsB\":\"0.0000\",\"HRPhV_H14_phsA\":\"0.0000\",\"HRPhV_H2_phsB\":\"0.0100\",\"HRPhV_H2_phsA\":\"0.0100\",\"HRPhV_H2_phsC\":\"0.0100\",\"HRPhV_H15_phsA\":\"0.0120\",\"TotW\":\"19771.1367\",\"HRPhV_H15_phsB\":\"0.0120\",\"HRPhV_H15_phsC\":\"0.0120\",\"FreqDev\":\"0.0000\",\"PPV_phsAB\":\"384.0318\",\"A_phsC\":\"60.7116\",\"TotPF\":\"0.4946\",\"A_phsA\":\"60.7123\",\"A_phsB\":\"60.7111\",\"PPV_phsBC\":\"383.3656\",\"HRPhV_H25_phsB\":\"0.0080\",\"HRPhV_H25_phsC\":\"0.0080\",\"HRPhV_H25_phsA\":\"0.0080\",\"DataTag\":\"0\",\"HRPhV_H20_phsA\":\"0.0000\",\"HRPhV_H20_phsB\":\"0.0000\",\"HRPhV_H20_phsC\":\"0.0000\",\"PPV_phsCA\":\"383.3637\",\"HRPhV_H3_phsB\":\"0.0640\",\"HRPhV_H3_phsC\":\"0.0640\",\"HRPhV_H9_phsC\":\"0.0220\",\"ThdPhV_phsA\":\"0.0913\",\"HRPhV_H9_phsB\":\"0.0220\",\"HRPhV_H9_phsA\":\"0.0220\",\"ThdPhV_phsB\":\"0.0913\",\"ThdPhV_phsC\":\"0.0913\",\"HRPhV_H19_phsC\":\"0.0100\",\"HRPhV_H19_phsB\":\"0.0100\",\"HRPhV_H19_phsA\":\"0.0100\",\"HRPhV_H16_phsA\":\"0.0000\",\"HRPhV_H13_phsA\":\"0.0140\",\"HRPhV_H16_phsC\":\"0.0000\",\"HRPhV_H13_phsB\":\"0.0140\",\"HRPhV_H16_phsB\":\"0.0000\",\"TotVA\":\"39977.2305\",\"HRPhV_H13_phsC\":\"0.0140\",\"HRPhV_H6_phsB\":\"0.0026\",\"HRPhV_H3_phsA\":\"0.0640\",\"HRPhV_H6_phsA\":\"0.0026\",\"HRPhV_H10_phsA\":\"0.0026\",\"HRPhV_H10_phsB\":\"0.0026\",\"HRPhV_H6_phsC\":\"0.0026\",\"HRPhV_H10_phsC\":\"0.0026\",\"ImbNgV\":\"0.0012\",\"TotVar\":\"34745.9492\",\"HRPhV_H7_phsC\":\"0.0280\",\"HRPhV_H7_phsB\":\"0.0280\",\"HRPhV_H22_phsC\":\"0.0000\",\"HRPhV_H22_phsB\":\"0.0000\",\"ImbZroV\":\"0.0012\",\"HRPhV_H22_phsA\":\"0.0000\",\"HRPhV_H7_phsA\":\"0.0280\",\"HRPhV_H8_phsA\":\"0.0026\",\"HRPhV_H23_phsB\":\"0.0080\",\"PhV_phsA\":\"221.9935\",\"HRPhV_H8_phsB\":\"0.0026\",\"HRPhV_H23_phsC\":\"0.0080\",\"HRPhV_H8_phsC\":\"0.0026\",\"PhV_phsB\":\"221.9947\",\"PhV_phsC\":\"221.9979\",\"HRPhV_H23_phsA\":\"0.0080\",\"PstPhV_phsC\":\"3.2942\",\"PstPhV_phsA\":\"3.3086\",\"PstPhV_phsB\":\"3.2987\",\"Freq\":\"50.0000\",\"HRPhV_H11_phsA\":\"0.0180\",\"HRPhV_H11_phsB\":\"0.0180\",\"HRPhV_H17_phsC\":\"0.0100\",\"HRPhV_H11_phsC\":\"0.0180\",\"HRPhV_H17_phsB\":\"0.0100\",\"HRPhV_H17_phsA\":\"0.0100\",\"SeqV_C2\":\"0.0715\",\"HRPhV_H4_phsB\":\"0.0050\",\"SeqV_C1\":\"60.4601\",\"HRPhV_H4_phsA\":\"0.0050\",\"SeqV_C0\":\"0.0714\",\"PhVDev_phsC\":\"0.0119\",\"HRPhV_H5_phsA\":\"0.0400\",\"HRPhV_H5_phsB\":\"0.0400\",\"HRPhV_H5_phsC\":\"0.0400\",\"PhVDev_phsB\":\"0.0119\",\"HRPhV_H12_phsC\":\"0.0010\",\"PltPhV_phsA\":\"0.0000\",\"PhVDev_phsA\":\"0.0119\",\"HRPhV_H12_phsB\":\"0.0010\",\"HRPhV_H4_phsC\":\"0.0050\",\"HRPhV_H18_phsB\":\"0.0000\",\"HRPhV_H18_phsC\":\"0.0000\",\"HRPhV_H12_phsA\":\"0.0010\",\"HRPhV_H18_phsA\":\"0.0000\",\"HFundPhV_phsC\":\"220.8052\",\"HRPhV_H21_phsC\":\"0.0080\",\"HRPhV_H21_phsB\":\"0.0080\",\"HRPhV_H24_phsC\":\"0.0000\",\"HFundPhV_phsA\":\"220.8056\",\"HRPhV_H21_phsA\":\"0.0080\",\"HFundPhV_phsB\":\"220.8055\",\"HRPhV_H24_phsB\":\"0.0000\",\"PltPhV_phsC\":\"0.0000\",\"HRPhV_H24_phsA\":\"0.0000\",\"PltPhV_phsB\":\"0.0000\",\"time\":\"20240704T152745Z\"}"; @@ -37,8 +40,8 @@ public class ClientHandler extends Thread { private Consumer consumer; @GetMapping("message") - private Map message() { - Map map = JSONObject.parseObject(topicMsg, Map.class); + private JSONObject message() { + JSONObject map = JSONObject.parseObject(topicMsg); map.put("customDevId",devId); return map; } @@ -62,9 +65,11 @@ public class ClientHandler extends Thread { try { System.out.println("收到新的一轮数据:******************"); topicMsg = new String(message.getBody(), "UTF-8"); - System.out.println("装置信息:========="+message.getProperties()); - devId = message.getProperties().get("deviceId")+"#"+message.getProperties().get("deviceIdentifier"); + devId = message.getProperties().get("deviceIdentifier"); System.out.println("Receive>>>>>>>>>>>>: " + topicMsg); + JSONObject jsonObject = JSONObject.parseObject(topicMsg); + jsonObject.put("customDevId",devId); + webSocketServer.sendSocketMessageToAll(jsonObject.toJSONString()); } catch (Exception e) { System.out.println("帮忙拍个照这个是接收消息的报错------------------------------------------------------------"); e.printStackTrace(); diff --git a/src/main/java/com/njcn/roma/config/WebSocketConfig.java b/src/main/java/com/njcn/roma/config/WebSocketConfig.java new file mode 100644 index 0000000..2b5b911 --- /dev/null +++ b/src/main/java/com/njcn/roma/config/WebSocketConfig.java @@ -0,0 +1,17 @@ +package com.njcn.roma.config; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.socket.server.standard.ServerEndpointExporter; + +@Configuration +public class WebSocketConfig { + + /** + * 用于扫描和注册所有携带ServerEndPoint注解的实例。 + */ + @Bean + public ServerEndpointExporter serverEndpointExporter() { + return new ServerEndpointExporter(); + } +} diff --git a/src/main/java/com/njcn/roma/controller/TestController.java b/src/main/java/com/njcn/roma/controller/TestController.java index 21b8553..e14cb23 100644 --- a/src/main/java/com/njcn/roma/controller/TestController.java +++ b/src/main/java/com/njcn/roma/controller/TestController.java @@ -1,15 +1,19 @@ package com.njcn.roma.controller; +import com.alibaba.fastjson.JSONObject; import com.huawei.it.eip.ump.client.producer.Producer; import com.huawei.it.eip.ump.client.producer.SendResult; import com.huawei.it.eip.ump.common.exception.UmpException; import com.huawei.it.eip.ump.common.message.Message; import com.njcn.roma.client.ClientHandler; +import com.njcn.roma.server.WebSocketServer; import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; import java.io.UnsupportedEncodingException; +import java.util.Map; +import java.util.Random; /** * roma @@ -23,6 +27,8 @@ public class TestController { private final ClientHandler clientHandler; + private final WebSocketServer webSocketServer; + @GetMapping("send") @@ -94,4 +100,72 @@ public class TestController { return clientHandler.topicMsg +" >>>>>>> "+ clientHandler.devId; } + + @GetMapping("simulationWebSocket") + public String simulationWebSocket() { + clientHandler.devId = "NJCN230497"; + // 浮动范围(比如,我们希望数值在原始值的基础上最多变化10%) + double fluctuationRange = 0.10; + + // 创建Random实例 + Random random = new Random(); + + + + for(int i=0;i<300;i++){ + JSONObject map = JSONObject.parseObject(clientHandler.topicMsg); + map.put("customDevId",clientHandler.devId); + double vA = Double.valueOf(map.get("PhV_phsA").toString()); + double vB = Double.valueOf(map.get("PhV_phsB").toString()); + double vC = Double.valueOf(map.get("PhV_phsC").toString()); + // 生成浮动值 + // 注意:因为我们要的是百分比,所以我们将fluctuationRange乘以originalValue得到最大浮动的绝对值 + double fluctuationA = (random.nextDouble() * 2 - 1) * (fluctuationRange * vA); + // 计算新的数值 + double newValueA = vA + fluctuationA; + + double fluctuationB = (random.nextDouble() * 2 - 1) * (fluctuationRange * vB); + // 计算新的数值 + double newValueB = vA + fluctuationB; + double fluctuationC = (random.nextDouble() * 2 - 1) * (fluctuationRange * vC); + // 计算新的数值 + double newValueC = vC + fluctuationC; + map.put("PhV_phsA",String.valueOf(newValueA)); + map.put("PhV_phsB",String.valueOf(newValueB)); + map.put("PhV_phsC",String.valueOf(newValueC)); + + + + double iA = Double.valueOf(map.get("A_phsA").toString()); + double iB = Double.valueOf(map.get("A_phsB").toString()); + double iC = Double.valueOf(map.get("A_phsC").toString()); + // 生成浮动值 + // 注意:因为我们要的是百分比,所以我们将fluctuationRange乘以originalValue得到最大浮动的绝对值 + double fluctuationIA = (random.nextDouble() * 2 - 1) * (fluctuationRange * vA); + // 计算新的数值 + double newValueIA = iA + fluctuationIA; + + double fluctuationIB = (random.nextDouble() * 2 - 1) * (fluctuationRange * iB); + // 计算新的数值 + double newValueIB = iA + fluctuationIB; + double fluctuationIC = (random.nextDouble() * 2 - 1) * (fluctuationRange * iC); + // 计算新的数值 + double newValueIC = iC + fluctuationIC; + map.put("A_phsA",String.valueOf(newValueIA)); + map.put("A_phsB",String.valueOf(newValueIB)); + map.put("A_phsC",String.valueOf(newValueIC)); + + + webSocketServer.sendSocketMessageToAll(map.toJSONString()); + + try { + Thread.sleep(1000); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } + } + + return "推送成功"; + } + } diff --git a/src/main/java/com/njcn/roma/pojo/websocket/SocketMessage.java b/src/main/java/com/njcn/roma/pojo/websocket/SocketMessage.java new file mode 100644 index 0000000..2485cd6 --- /dev/null +++ b/src/main/java/com/njcn/roma/pojo/websocket/SocketMessage.java @@ -0,0 +1,13 @@ +package com.njcn.roma.pojo.websocket; + +import lombok.Data; + +@Data +public class SocketMessage { + + private Integer type; + + private Object body; + + +} diff --git a/src/main/java/com/njcn/roma/server/WebSocketServer.java b/src/main/java/com/njcn/roma/server/WebSocketServer.java new file mode 100644 index 0000000..57123f4 --- /dev/null +++ b/src/main/java/com/njcn/roma/server/WebSocketServer.java @@ -0,0 +1,67 @@ +package com.njcn.roma.server; + + +import org.springframework.stereotype.Component; + +import javax.websocket.*; +import javax.websocket.server.ServerEndpoint; +import java.io.IOException; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +@Component +@ServerEndpoint("/socket") +public class WebSocketServer { + + /** + * 全部在线会话 PS: 基于场景考虑 这里使用线程安全的Map存储会话对象。 + */ + private static Map onlineSessions = new ConcurrentHashMap<>(); + /** + * 当客户端打开连接:1.添加会话对象 2.更新在线人数 + */ + @OnOpen + public void onOpen(Session session) { + onlineSessions.put(session.getId(), session); + System.out.println("websocket客户端"+session.getId()+"连接"); + } + + /** + * 当客户端发送消息:1.获取它的用户名和消息 2.发送消息给所有人 + *

+ * PS: 这里约定传递的消息为JSON字符串 方便传递更多参数! + */ + @OnMessage + public void onSocketMessage(Session session, String jsonStr) { + } + + /** + * 当关闭连接:1.移除会话对象 2.更新在线人数 + */ + @OnClose + public void onClose(Session session) { + onlineSessions.remove(session.getId()); + System.out.println("websocket客户端"+session.getId()+"断开连接"); + } + + /** + * 当通信发生异常:打印错误日志 + */ + @OnError + public void onError(Session session, Throwable error) { + error.printStackTrace(); + } + + /** + * 公共方法:发送信息给所有人 + */ + public void sendSocketMessageToAll(String msg) { + onlineSessions.forEach((id, session) -> { + try { + session.getBasicRemote().sendText(msg); + } catch (IOException e) { + e.printStackTrace(); + } + }); + } +} diff --git a/src/main/resources/static/echarts.min.js b/src/main/resources/static/echarts.min.js new file mode 100644 index 0000000..93526e1 --- /dev/null +++ b/src/main/resources/static/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 m=function(t,e){return(m=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){function n(){this.constructor=t}m(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var v=function(){return(v=Object.assign||function(t){for(var e,n=1,i=arguments.length;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),!0}return!1}function ue(t){return"CANVAS"===t.nodeName.toUpperCase()}var he="undefined"!=typeof window&&!!window.addEventListener,ce=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,pe=[];function de(t,e,n,i){return n=n||{},i||!w.canvasSupported?fe(t,e,n):w.browser.firefox&&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):fe(t,e,n),n}function fe(t,e,n){if(w.domSupported&&t.getBoundingClientRect){var i,r=e.clientX,e=e.clientY;if(ue(t))return i=t.getBoundingClientRect(),n.zrX=r-i.left,void(n.zrY=e-i.top);if(le(pe,t,r,e))return n.zrX=pe[0],void(n.zrY=pe[1])}n.zrX=n.zrY=0}function ge(t){return t||window.event}function ye(t,e,n){var i;return null==(e=ge(e)).zrX&&((i=e.type)&&0<=i.indexOf("touch")?(i=("touchend"!==i?e.targetTouches:e.changedTouches)[0])&&de(t,i,e,n):(de(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))*(0t.getWidth()||n<0||n>t.getHeight()}function Pe(){return[1,0,0,1,0,0]}function Oe(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function Re(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function Ne(t,e,n){var i=e[0]*n[0]+e[2]*n[1],r=e[1]*n[0]+e[3]*n[1],o=e[0]*n[2]+e[2]*n[3],a=e[1]*n[2]+e[3]*n[3],s=e[0]*n[4]+e[2]*n[5]+e[4],n=e[1]*n[4]+e[3]*n[5]+e[5];return t[0]=i,t[1]=r,t[2]=o,t[3]=a,t[4]=s,t[5]=n,t}function Ee(t,e,n){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4]+n[0],t[5]=e[5]+n[1],t}function Be(t,e,n){var i=e[0],r=e[2],o=e[4],a=e[1],s=e[3],e=e[5],l=Math.sin(n),n=Math.cos(n);return t[0]=i*n+a*l,t[1]=-i*l+a*n,t[2]=r*n+s*l,t[3]=-r*l+n*s,t[4]=n*o+l*e,t[5]=n*e-l*o,t}function ze(t,e,n){var i=n[0],n=n[1];return t[0]=e[0]*i,t[1]=e[1]*n,t[2]=e[2]*i,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*n,t}function Fe(t,e){var n=e[0],i=e[2],r=e[4],o=e[1],a=e[3],e=e[5],s=n*a-o*i;return s?(t[0]=a*(s=1/s),t[1]=-o*s,t[2]=-i*s,t[3]=n*s,t[4]=(i*e-a*r)*s,t[5]=(o*r-n*e)*s,t):null}N(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],function(a){De.prototype[a]=function(t){var e,n,i=t.zrX,r=t.zrY,o=Le(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=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),gn(t,e),e):void cn(e,0,0,0,1):7===i||9===i?0<=(r=parseInt(n.slice(1,7),16))&&r<=16777215?(cn(e,(16711680&r)>>16,(65280&r)>>8,255&r,9===i?parseInt(n.slice(7),16)/255:1),gn(t,e),e):void cn(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?cn(e,+a[0],+a[1],+a[2],1):cn(e,0,0,0,1);s=ln(a.pop());case"rgb":return 3!==a.length?void cn(e,0,0,0,1):(cn(e,sn(a[0]),sn(a[1]),sn(a[2]),s),gn(t,e),e);case"hsla":return 4!==a.length?void cn(e,0,0,0,1):(a[3]=ln(a[3]),mn(a,e),gn(t,e),e);case"hsl":return 3!==a.length?void cn(e,0,0,0,1):(mn(a,e),gn(t,e),e);default:return}}cn(e,0,0,0,1)}}function mn(t,e){var n=(parseFloat(t[0])%360+360)%360/360,i=ln(t[1]),r=ln(t[2]),i=r<=.5?r*(i+1):r+i-r*i,r=2*r-i;return cn(e=e||[],on(255*un(r,i,n+1/3)),on(255*un(r,i,n)),on(255*un(r,i,n-1/3)),1),4===t.length&&(e[3]=t[3]),e}function vn(t,e){var n=yn(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,255=this.maxTime?this.maxTime=t:this._needsSort=!0;var n=this.keyframes,i=n.length;if(this.interpolable)if(rt(e)){var r,o=rt((o=e)&&o[0])?2:1;if(0e);u++);u=Math.min(u-1,o-2)}var h,c,p,d,f,g,y,m=r[u+1],v=r[u];v&&m&&(this._lastFrame=u,this._lastFramePercent=e,0!=(h=m.percent-v.percent))&&(h=(e-v.percent)/h,c=n?this._additiveValue:l?Nn:t[a],(0=n.x&&t<=n.x+n.width&&e>=n.y&&e<=n.y+n.height},jn.prototype.clone=function(){return new jn(this.x,this.y,this.width,this.height)},jn.prototype.copy=function(t){jn.copy(this,t)},jn.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},jn.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},jn.prototype.isZero=function(){return 0===this.width||0===this.height},jn.create=function(t){return new jn(t.x,t.y,t.width,t.height)},jn.copy=function(t,e){t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height},jn.applyTransform=function(t,e,n){var i,r,o,a;n?n[1]<1e-5&&-1e-5>>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 Li(k,L){var P,O,R=Ci,N=0,E=(k.length,[]);function e(t){var e=P[t],n=O[t],i=P[t+1],r=O[t+1],t=(O[t]=n+r,t===N-3&&(P[t+1]=P[t+2],O[t+1]=O[t+2]),N--,ki(k[i],k,e,n,0,L));if(e+=t,0!=(n-=t)&&0!==(r=Di(k[e+n-1],k,i,r,r-1,L)))if(n<=r){var o=e,a=n,t=i,s=r,l=0;for(l=0;lO[t+1])break;e(t)}},forceMergeRuns:function(){for(;1>=1;return t+e}(r);do{}while((o=Ii(t,n,i,e))this._sleepAfterStill)&&this.animation.stop()},n.prototype.setSleepAfterStill=function(t){this._sleepAfterStill=t},n.prototype.wakeUp=function(){this.animation.start(),this._stillFrameAccum=0},n.prototype.addHover=function(t){},n.prototype.removeHover=function(t){},n.prototype.clearHover=function(){},n.prototype.refreshHover=function(){this._needsRefreshHover=!0},n.prototype.refreshHoverImmediately=function(){this._needsRefreshHover=!1,this.painter.refreshHover&&"canvas"===this.painter.getType()&&this.painter.refreshHover()},n.prototype.resize=function(t){this.painter.resize((t=t||{}).width,t.height),this.handler.resize()},n.prototype.clearAnimation=function(){this.animation.clear()},n.prototype.getWidth=function(){return this.painter.getWidth()},n.prototype.getHeight=function(){return this.painter.getHeight()},n.prototype.pathToImage=function(t,e){if(this.painter.pathToImage)return this.painter.pathToImage(t,e)},n.prototype.setCursorStyle=function(t){this.handler.setCursorStyle(t)},n.prototype.findHover=function(t,e){return this.handler.findHover(t,e)},n.prototype.on=function(t,e,n){return this.handler.on(t,e,n),this},n.prototype.off=function(t,e){this.handler.off(t,e)},n.prototype.trigger=function(t,e){this.handler.trigger(t,e)},n.prototype.clear=function(){for(var t=this.storage.getRoots(),e=0;e=e[1])return n[1]}else{if(t>=e[0])return n[0];if(t<=e[1])return n[1]}else{if(t===e[0])return n[0];if(t===e[1])return n[1]}return(t-e[0])/r*o+n[0]}function mr(t,e){switch(t){case"center":case"middle":t="50%";break;case"left":case"top":t="0%";break;case"right":case"bottom":t="100%"}return"string"==typeof t?t.replace(/^\s+|\s+$/g,"").match(/%$/)?parseFloat(t)/100*e:parseFloat(t):null==t?NaN:+t}function vr(t,e,n){return null==e&&(e=10),e=Math.min(Math.max(0,e),20),t=(+t).toFixed(e),n?t:+t}function _r(t){var t=t.toString(),e=t.indexOf("e");return 0u&&(u=l[c],h=c);++a[h],l[h]=0,++s}return a[e]/r}function wr(t){var e=2*Math.PI;return(t%e+e)%e}function Sr(t){return-1e-4=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=Do(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||Ta(e-this._yi)>this._uy||this._len<5;return this.addData(X.L,t,e),this._ctx&&n&&(this._needsDash?this._dashedLineTo(t,e):this._ctx.lineTo(t,e)),n&&(this._xi=t,this._yi=e),this},o.prototype.bezierCurveTo=function(t,e,n,i,r,o){return this.addData(X.C,t,e,n,i,r,o),this._ctx&&(this._needsDash?this._dashedBezierTo(t,e,n,i,r,o):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.addData(X.Q,t,e,n,i),this._ctx&&(this._needsDash?this._dashedQuadraticTo(t,e,n,i):this._ctx.quadraticCurveTo(t,e,n,i)),this._xi=n,this._yi=i,this},o.prototype.arc=function(t,e,n,i,r,o){return Da[0]=i,Da[1]=r,La(Da,o),this.addData(X.A,t,e,n,n,i=Da[0],(r=Da[1])-i,0,o?0:1),this._ctx&&this._ctx.arc(t,e,n,i,r,o),this._xi=wa(r)*n+t,this._yi=Sa(r)*n+e,this},o.prototype.arcTo=function(t,e,n,i,r){return this._ctx&&this._ctx.arcTo(t,e,n,i,r),this},o.prototype.rect=function(t,e,n,i){return this._ctx&&this._ctx.rect(t,e,n,i),this.addData(X.R,t,e,n,i),this},o.prototype.closePath=function(){this.addData(X.Z);var t=this._ctx,e=this._x0,n=this._y0;return t&&(this._needsDash&&this._dashedLineTo(e,n),t.closePath()),this._xi=e,this._yi=n,this},o.prototype.fill=function(t){t&&t.fill(),this.toStatic()},o.prototype.stroke=function(t){t&&t.stroke(),this.toStatic()},o.prototype.setLineDash=function(t){if(t instanceof Array){this._lineDash=t;for(var e=this._dashIdx=0,n=0;nu.length&&(this._expandData(),u=this.data);for(var h=0;hn||Ta(y)>i||c===e-1)&&(f=Math.sqrt(I*I+y*y),r=g,o=_);break;case X.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=Xo(t,n,r,a,f),f=Xo(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 X.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=Jo(t,n,r,p),p=Jo(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 X.A:var x=t[c++],b=t[c++],w=t[c++],S=t[c++],M=t[c++],T=t[c++],C=T+M;c+=1,t[c++],d&&(a=wa(M)*w+x,s=Sa(M)*S+b),f=ba(w,S)*xa(Ia,Math.abs(T)),r=wa(C)*w+x,o=Sa(C)*S+b;break;case X.R:a=r=t[c++],s=o=t[c++];f=2*t[c++]+2*t[c++];break;case X.Z:var I=a-r,y=s-o;f=Math.sqrt(I*I+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=this.data,s=this._ux,l=this._uy,u=this._len,h=e<1,c=0,p=0;if(!h||(this._pathSegLen||this._calculateLength(),r=this._pathSegLen,o=e*this._pathLen))t:for(var d=0;ds||Ta(N-i)>l||d===u-1){if(h){if(o=Ha[i=0]+t&&a<=Ha[1]+t?h:0;rMath.PI/2&&c<1.5*Math.PI?-h:h)}return l}(y,m,_,x,x+b,w,T,r);u=Math.cos(x+b)*v+y,h=Math.sin(x+b)*_+m;break;case za.R:c=u=a[d++],p=h=a[d++];if(S=c+a[d++],M=p+a[d++],n){if(Oa(c,p,S,p,e,i,r)||Oa(S,p,S,M,e,i,r)||Oa(S,M,c,M,e,i,r)||Oa(c,M,c,p,e,i,r))return!0}else l=(l+=Ba(S,p,S,M,i,r))+Ba(c,M,c,p,i,r);break;case za.Z:if(n){if(Oa(u,h,c,p,e,i,r))return!0}else l+=Ba(u,h,c,p,i,r);u=c,h=p}}return n||(t=h,o=p,Math.abs(t-o)i.len()&&(uMath.abs(i[1])?0"'])/g,$c={"&":"&","<":"<",">":">",'"':""","'":"'"};function Jc(t){return null==t?"":(t+"").replace(Kc,function(t,e){return $c[e]})}function Qc(t,e,n){function i(t){return t&&Tt(t)?t:"-"}function r(t){return null!=t&&!isNaN(t)&&isFinite(t)}var o="time"===e,a=t instanceof Date;if(o||a){var o=o?Tr(t):t;if(!isNaN(+o))return Lc(o,"{yyyy}-{MM}-{dd} {hh}:{mm}:{ss}",n);if(a)return"-"}return"ordinal"===e?ct(t)?i(t):pt(t)&&r(t)?t+"":"-":r(o=Dr(t))?qc(o):ct(t)?i(t):"-"}function tp(t,e){return"{"+t+(null==e?"":e)+"}"}var ep=["a","b","c","d","e","f","g"];function np(t,e,n){var i=(e=F(e)?e:[e]).length;if(!i)return"";for(var r=e[0].$vars||[],o=0;o':'':{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}}:""}function rp(t,e){return e=e||"transparent",D(t)?t:k(t)&&t.colorStops&&(t.colorStops[0]||{}).color||e}function op(t,e){var n;"_blank"===e||"blank"===e?((n=window.open()).opener=null,n.location.href=t):window.open(t,e)}var ap=N,sp=["left","right","top","bottom","width","height"],lp=[["width","left","right"],["height","top","bottom"]];function up(a,s,l,u,h){var c=0,p=0,d=(null==u&&(u=1/0),null==h&&(h=1/0),0);s.eachChild(function(t,e){var n,i,r,o=t.getBoundingRect(),e=s.childAt(e+1),e=e&&e.getBoundingRect();d="horizontal"===a?(i=o.width+(e?-e.x+o.x:0),u<(n=c+i)||t.newline?(c=0,n=i,p+=d+l,o.height):Math.max(d,o.height)):(i=o.height+(e?-e.y+o.y:0),h<(r=p+i)||t.newline?(c+=d+l,p=0,r=i,o.width):Math.max(d,o.width)),t.newline||(t.x=c,t.y=p,t.markRedraw(),"horizontal"===a?c=n+l:p=r+l)})}var hp=up;function cp(t,e,n){n=Zc(n||0);var i=e.width,r=e.height,o=mr(t.left,i),a=mr(t.top,r),e=mr(t.right,i),s=mr(t.bottom,r),l=mr(t.width,i),u=mr(t.height,r),h=n[2]+n[0],c=n[1]+n[3],p=t.aspect;switch(isNaN(l)&&(l=i-e-c-o),isNaN(u)&&(u=r-s-h-a),null!=p&&(isNaN(l)&&isNaN(u)&&(i/re)return t[i];return t[n-1]}var Xp,qp="\0_ec_inner",jp=(u(s,Xp=lc),s.prototype.init=function(t,e,n,i,r,o){i=i||{},this.option=null,this._theme=new lc(i),this._locale=new lc(r),this._optionManager=o},s.prototype.setOption=function(t,e,n){e=$p(e);this._optionManager.setOption(t,n,e),this._resetOption(null,e)},s.prototype.resetOption=function(t,e){return this._resetOption(t,$p(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)):Hp(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&&N(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,u=this._componentsMap,h=this._componentsCount,n=[],o=L(),c=t&&t.replaceMergeMainTypeMap;Op(this).datasetMap=L(),N(i,function(t,e){null!=t&&(g.hasClass(e)?e&&(n.push(e),o.set(e,!0)):r[e]=null==r[e]?C(t):p(r[e],t,!0))}),c&&c.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 t=function(t,e,n){return(e=(e=zp.get(e))&&e(t))?n.concat(e):n}(this,o,Rr(i[o])),e=u.get(o),n=e?c&&c.get(o)?"replaceMerge":"normalMerge":"replaceAll",e=zr(e,t,n),a=(Ur(e,o,g),r[o]=null,u.set(o,null),h.set(o,0),[]),s=[],l=0;N(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;n&&n.constructor===r?(n.name=t.keyInfo.name,n.mergeOption(i,this),n.optionUpdated(i,!1)):(e=I({componentIndex:e},t.keyInfo),I(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?(a.push(n.option),s.push(n),l++):(a.push(void 0),s.push(void 0))},this),r[o]=a,u.set(o,s),h.set(o,l),"series"===o&&Fp(this)},this),this._seriesIndices||Fp(this)},s.prototype.getOption=function(){var a=C(this.option);return N(a,function(t,e){if(g.hasClass(e)){for(var n=Rr(t),i=n.length,r=!1,o=i-1;0<=o;o--)n[o]&&!Wr(n[o])?r=!0:(n[o]=null,r||i--);n.length=i,a[e]=n}}),delete a[qp],a},s.prototype.getTheme=function(){return this._theme},s.prototype.getLocaleModel=function(){return this._locale},s.prototype.getLocale=function(t){return this.getLocaleModel().get(t)},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;i0?u.html:0,r);n!=null&&o.push(n)}),o.length)return"richText"===i.renderMode?o.join(u.richText):jf(o.join(""),e)}(t,e,r?n:o.html,i);return r?a:(r=Qc(e.header,"ordinal",t.useUTC),e=Vf(i,t.renderMode).nameStyle,"richText"===t.renderMode?Zf(t,r,e)+o.richText+a:jf('

'+Jc(r)+"
"+a,n))}},nameValue:{planLayout:function(t){t.__gapLevelBetweenSubBlocks=0},build:function(t,e,n,i){var r,o,a,s,l=t.renderMode,u=e.noName,h=e.noValue,c=!e.markerType,p=e.name,d=e.value,f=t.useUTC;if(!u||!h)return r=c?"":t.markupStyleCreator.makeTooltipMarker(e.markerType,e.markerColor||"#333",l),p=u?"":Qc(p,"ordinal",f),o=e.valueType,e=h?[]:F(d)?j(d,function(t,e){return Qc(t,F(o)?o[e]:o,f)}):[Qc(d,F(o)?o[0]:o,f)],d=!c||!u,a=!c&&u,i=Vf(i,l),s=i.nameStyle,i=i.valueStyle,"richText"===l?(c?"":r)+(u?"":Zf(t,p,s))+(h?"":function(t,e,n,i,r){r=[r],i=i?10:20;return n&&r.push({padding:[0,0,0,i],align:"right"}),t.markupStyleCreator.wrapRichTextStyle(e.join(" "),r)}(t,e,d,a,i)):jf((c?"":r)+(u?"":''+Jc(p)+"")+(h?"":function(t,e,n,i){n=n?"10px":"20px";return''+j(t,Jc).join("  ")+""}(e,d,a,i)),n)}}};function Xf(t,e,n,i,r,o){var a;if(t)return(a=Uf(t)).planLayout(t),a.build({useUTC:r,renderMode:n,orderMode:i,markupStyleCreator:e},t,0,o)}function qf(t){t=t.__gapLevelBetweenSubBlocks;return{html:Hf[t],richText:Gf[t]}}function jf(t,e){return'
'+t+'
'}function Zf(t,e,n){return t.markupStyleCreator.wrapRichTextStyle(e,n)}function Kf(t,e){t=t.get("padding");return null!=t?t:"richText"===e?[8,10]:10}Jf.prototype._generateStyleName=function(){return"__EC_aUTo_"+this._nextStyleNameId++},Jf.prototype.makeTooltipMarker=function(t,e,n){var i="richText"===n?this._generateStyleName():null,e=ip({color:e,type:t,renderMode:n,markerId:i});return D(e)?e:(this.richTextStyles[i]=e.style,e.content)},Jf.prototype.wrapRichTextStyle=function(t,e){var n={},e=(F(e)?N(e,function(t){return I(n,t)}):I(n,e),this._generateStyleName());return this.richTextStyles[e]=n,"{"+e+"|"+t+"}"};var $f=Jf;function Jf(){this.richTextStyles={},this._nextStyleNameId=Lr()}function Qf(t){var e,n,i,r,o,a,s,l,u,h,c,p=t.series,d=t.dataIndex,t=t.multipleSeries,f=p.getData(),g=f.mapDimensionsAll("defaultedTooltip"),y=g.length,m=p.getRawValue(d),v=F(m),_=(_=d,rp((b=p).getData().getItemVisual(_,"style")[b.visualDrawType]));function x(t,e){e=s.getDimensionInfo(e);e&&!1!==e.otherDims.tooltip&&(l?c.push(Wf("nameValue",{markerType:"subItem",markerColor:a,name:e.displayName,value:t,valueType:e.type})):(u.push(t),h.push(e.type)))}1this.getShallow("animationThreshold")?!1:t)},l.prototype.restoreData=function(){this.dataTask.dirty()},l.prototype.getColorFromPalette=function(t,e,n){var i=this.ecModel;return Wp.prototype.getColorFromPalette.call(this,t,e,n)||i.getColorFromPalette(t,e,n)},l.prototype.coordDimToDataDim=function(t){return this.getRawData().mapDimensionsAll(t)},l.prototype.getProgressive=function(){return this.get("progressive")},l.prototype.getProgressiveThreshold=function(){return this.get("progressiveThreshold")},l.prototype.select=function(t,e){this._innerSelect(this.getData(e),t)},l.prototype.unselect=function(t,e){var n=this.option.selectedMap;if(n)for(var i=this.getData(e),r=0;re.outputData.count()&&e.model.getRawData().cloneShallow(e.outputData)}function lg(e,n){N(_(e.CHANGABLE_METHODS,e.DOWNSAMPLE_METHODS),function(t){e.wrapMethod(t,ut(ug,n))})}function ug(t,e){t=hg(t);return t&&t.setOutputEnd((e||this).count()),e}function hg(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}it(ig,oc),it(ig,Wp),oo(ig,g);pg.prototype.init=function(t,e){},pg.prototype.render=function(t,e,n,i){},pg.prototype.dispose=function(t,e){},pg.prototype.updateView=function(t,e,n,i){},pg.prototype.updateLayout=function(t,e,n,i){},pg.prototype.updateVisual=function(t,e,n,i){},pg.prototype.blurSeries=function(t,e){};var cg=pg;function pg(){this.group=new O,this.uid=cc("viewComponent")}function dg(){var o=Xr();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"}}ro(cg),uo(cg);var fg=Xr(),gg=dg(),yg=(mg.prototype.init=function(t,e){},mg.prototype.render=function(t,e,n,i){},mg.prototype.highlight=function(t,e,n,i){_g(t.getData(),i,"emphasis")},mg.prototype.downplay=function(t,e,n,i){_g(t.getData(),i,"normal")},mg.prototype.remove=function(t,e){this.group.removeAll()},mg.prototype.dispose=function(t,e){},mg.prototype.updateView=function(t,e,n,i){this.render(t,e,n,i)},mg.prototype.updateLayout=function(t,e,n,i){this.render(t,e,n,i)},mg.prototype.updateVisual=function(t,e,n,i){this.render(t,e,n,i)},mg.markUpdateMethod=function(t,e){fg(t).updateMethod=e},mg.protoInitialize=void(mg.prototype.type="chart"),mg);function mg(){this.group=new O,this.uid=cc("viewChart"),this.renderTask=nf({plan:xg,reset:bg}),this.renderTask.context={view:this}}function vg(t,e,n){t&&("emphasis"===e?il:rl)(t,n)}function _g(e,t,n){var i,r=Yr(e,t),o=t&&null!=t.highlightKey?(t=t.highlightKey,i=null==(i=Is[t])&&Cs<=32?Is[t]=Cs++:i):null;null!=r?N(Rr(r),function(t){vg(e.getItemGraphicEl(t),n,o)}):e.eachItemGraphicEl(function(t){vg(t,n,o)})}function xg(t){return gg(t.model)}function bg(t){var e=t.model,n=t.ecModel,i=t.api,r=t.payload,o=e.pipelineContext.progressiveRender,t=t.view,a=r&&fg(r).updateMethod,o=o?"incrementalPrepareRender":a&&t[a]?a:"render";return"render"!==o&&t[o](e,n,i,r),wg[o]}ro(yg),uo(yg);var wg={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)}}},Sg="\0__throttleOriginMethod",Mg="\0__throttleRate",Tg="\0__throttleType";function Cg(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}},Ng.prototype.getPipeline=function(t){return this._pipelineMap.get(t)},Ng.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}},Ng.prototype.restorePipelines=function(t){var i=this,r=i._pipelineMap=L();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)})},Ng.prototype.prepareStageTasks=function(){var n=this._stageTaskMap,i=this.api.getModel(),r=this.api;N(this._allHandlers,function(t){var e=n.get(t.uid)||n.set(t.uid,{});Mt(!(t.reset&&t.overallReset),""),t.reset&&this._createSeriesStageTask(t,e,i,r),t.overallReset&&this._createOverallStageTask(t,e,i,r)},this)},Ng.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)},Ng.prototype.performDataProcessorTasks=function(t,e){this._performStageTasks(this._dataProcessorHandlers,t,e,{block:!0})},Ng.prototype.performVisualTasks=function(t,e,n){this._performStageTasks(this._visualHandlers,t,e,n)},Ng.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))}N(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},Ng.prototype.performSeriesTasks=function(t){var e;t.eachSeries(function(t){e=t.dataTask.perform()||e}),this.unfinished=e||this.unfinished},Ng.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())})},Ng.prototype.updatePayload=function(t,e){"remain"!==e&&(t.context.payload=e)},Ng.prototype._createSeriesStageTask=function(n,t,i,r){var o=this,a=t.seriesTaskMap,s=t.seriesTaskMap=L(),t=n.seriesType,e=n.getTargetSeries;function l(t){var e=t.uid,e=s.set(e,a&&a.get(e)||nf({plan:Vg,reset:Hg,count:Ug}));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)},Ng.prototype._createOverallStageTask=function(t,e,n,i){var r=this,o=e.overallTask=e.overallTask||nf({reset:Eg}),a=(o.context={ecModel:n,api:i,overallReset:t.overallReset,scheduler:r},o.agentStubMap),s=o.agentStubMap=L(),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,nf({reset:Bg,onDirty:Fg})));e.context={model:t,overallProgress:u},e.agent=o,e.__block=u,r._pipe(t,e)}Mt(!t.createOnAllSeries,""),e?n.eachRawSeriesByType(e,c):l?l(n,i).each(c):(u=!1,N(n.getSeries(),c)),h&&o.dirty()},Ng.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},Ng.wrapStageHandler=function(t,e){return(t=ht(t)?{overallReset:t,seriesType:function(t){Yg=null;try{t(Xg,qg)}catch(t){}return Yg}(t)}:t).uid=cc("stageHandler"),e&&(t.visualType=e),t};var Rg=Ng;function Ng(t,e,n,i){this._stageTaskMap=L(),this.ecInstance=t,this.api=e,n=this._dataProcessorHandlers=n.slice(),i=this._visualHandlers=i.slice(),this._allHandlers=n.concat(i)}function Eg(t){t.overallReset(t.ecModel,t.api,t.payload)}function Bg(t){return t.overallProgress&&zg}function zg(){this.agent.dirty(),this.getDownstream().dirty()}function Fg(){this.agent&&this.agent.dirty()}function Vg(t){return t.plan?t.plan(t.model,t.ecModel,t.api,t.payload):null}function Hg(t){t.useClearVisual&&t.data.clearAllVisual();t=t.resetDefines=Rr(t.reset(t.model,t.ecModel,t.api,t.payload));return 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 em(t,r){return j(at((t=function(t){if(t.UTF8Encoding){for(var e=t.UTF8Scale,n=(null==e&&(e=1024),t.features),i=0;i'+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}})),gm(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)},h.prototype.convertToPixel=function(t,e){return Nm(this,"convertToPixel",t,e)},h.prototype.convertFromPixel=function(t,e){return Nm(this,"convertFromPixel",t,e)},h.prototype.containPixel=function(t,i){var r;if(!this._disposed)return N(jr(this._model,t),function(t,n){0<=n.indexOf("Models")&&N(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},h.prototype.getVisual=function(t,e){var t=jr(this._model,t,{defaultMainType:"series"}),n=t.seriesModel.getData(),t=t.hasOwnProperty("dataIndexInside")?t.dataIndexInside:t.hasOwnProperty("dataIndex")?n.indexOfRawIndex(t.dataIndex):null;if(null!=t){var i=n,r=t,o=e;switch(o){case"color":return i.getItemVisual(r,"style")[i.getVisual("drawType")];case"opacity":return i.getItemVisual(r,"style").opacity;case"symbol":case"symbolSize":case"liftZ":return i.getItemVisual(r,o)}}else{var a=n,s=e;switch(s){case"color":return a.getVisual("style")[a.getVisual("drawType")];case"opacity":return a.getVisual("style").opacity;case"symbol":case"symbolSize":case"liftZ":return a.getVisual(s)}}},h.prototype.getViewOfComponentModel=function(t){return this._componentsMap[t.__viewId]},h.prototype.getViewOfSeriesModel=function(t){return this._chartsMap[t.__viewId]},h.prototype._initEvents=function(){var t,n,i,s=this;gm(rv,function(a){function t(t){var n,e,i,r=s.getModel(),o=t.target;"globalout"===a?n={}:o&&Oy(o,function(t){var e,t=R(t);return t&&null!=t.dataIndex?(e=t.dataModel||r.getSeriesByIndex(t.seriesIndex),n=e&&e.getDataParams(t.dataIndex,t.dataType)||{},1):t.eventData&&(n=I({},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)}),gm(av,function(t,e){s._messageCenter.on(e,function(t){this.trigger(e,t)},s)}),gm(["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))})},h.prototype.isDisposed=function(){return this._disposed},h.prototype.clear=function(){this._disposed?this.id:this.setOption({series:[]},!0)},h.prototype.dispose=function(){var e,n;this._disposed?this.id:(this._disposed=!0,Jr(this.getDom(),vv,""),e=this._api,n=this._model,gm(this._componentsViews,function(t){t.dispose(n,e)}),gm(this._chartsViews,function(t){t.dispose(n,e)}),this._zr.dispose(),delete fv[this.id])},h.prototype.resize=function(t){var e,n;this._disposed?this.id:(this._zr.resize(t),e=this._model,this._loadingFX&&this._loadingFX.resize(),e&&(e=e.resetOption("media"),n=t&&t.silent,this[xm]=!0,e&&Lm(this),Rm.update.call(this,{type:"resize",animation:I({duration:0},t&&t.animation)}),this[xm]=!1,zm.call(this,n),Fm.call(this,n)))},h.prototype.showLoading=function(t,e){this._disposed?this.id:(mm(t)&&(e=t,t=""),t=t||"default",this.hideLoading(),dv[t]&&(t=dv[t](this._api,e),e=this._zr,this._loadingFX=t,e.add(t)))},h.prototype.hideLoading=function(){this._disposed?this.id:(this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null)},h.prototype.makeActionFromEvent=function(t){var e=I({},t);return e.type=av[t.type],e},h.prototype.dispatchAction=function(t,e){var n;this._disposed?this.id:(mm(e)||(e={silent:!!e}),ov[t.type]&&this._model&&(this[xm]?this._pendingActions.push(t):(n=e.silent,Bm.call(this,t,n),(t=e.flush)?this._zr.flush():!1!==t&&w.browser.weChat&&this._throttledZrFlush(),zm.call(this,n),Fm.call(this,n))))},h.prototype.updateLabelLayout=function(){var t=this._labelManager;t.updateLayoutConfig(this._api),t.layout(this._api),t.processLabelsOverall()},h.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())},h.internalField=(Lm=function(t){var e=t._scheduler;e.restorePipelines(t._model),e.prepareStageTasks(),Pm(t,!0),Pm(t,!1),e.plan()},Pm=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;ee.get("hoverLayerThreshold")&&!w.node&&!w.worker&&e.eachSeries(function(t){t.preventUsingHoverLayer||(t=n._chartsMap[t.__viewId]).__alive&&t.group.traverse(function(t){t.states.emphasis&&(t.states.emphasis.hoverLayer=!0)})})},Xm=function(e,n){gm(hv,function(t){t(e,n)})},Km=function(t){t[wm]=!0,t.getZr().wakeUp()},$m=function(t){t[wm]&&(t.getZr().storage.traverse(function(t){Ih(t)||tv(t)}),t[wm]=!1)},qm=function(n){return u(t,e=Jp),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){il(t,e),Km(n)},t.prototype.leaveEmphasis=function(t,e){rl(t,e),Km(n)},t.prototype.enterBlur=function(t){Ks(t,Ys),Km(n)},t.prototype.leaveBlur=function(t){ol(t),Km(n)},t.prototype.enterSelect=function(t){al(t),Km(n)},t.prototype.leaveSelect=function(t){sl(t),Km(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},jm=function(i){function r(t,e){for(var n=0;nm[1]&&(m[1]=y)}e&&(this._nameList[d]=e[f],this._dontMakeIdFromName||Zv(this,d))}this._rawCount=this._count=s,this._extent={},Gv(this)},c.prototype._initDataFromProvider=function(t,e,n){if(!(e<=t)){for(var i=this._rawData,r=this._storage,o=this.dimensions,a=o.length,s=this._dimensionInfos,l=this._nameList,u=this._idList,h=this._rawExtent,c=i.getSource().sourceFormat===Mp,p=0;px[1]&&(x[1]=b)}c&&!i.pure&&y&&(v=y.name,null==l[m]&&null!=v&&(l[m]=Hr(v,null)),v=y.id,null==u[m])&&null!=v&&(u[m]=Hr(v,null)),this._dontMakeIdFromName||Zv(this,m)}!i.persistent&&i.clean&&i.clean(),this._rawCount=this._count=e,this._extent={},Gv(this)}},c.prototype.count=function(){return this._count},c.prototype.getIndices=function(){var t=this._indices;if(t){var e=t.constructor,n=this._count;if(e===Array)for(var i=new e(n),r=0;r=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},c.prototype.indicesOfNearest=function(t,e,n){var i=this._storage[t],r=[];if(i){null==n&&(n=1/0);for(var o=1/0,a=-1,s=0,l=0,u=this.count();lt[T][1])&&(S=!1)}S&&(s[l++]=this.getRawIndex(y))}return l_[1]&&(_[1]=v)}}}return n},c.prototype.downSample=function(t,e,n,i){for(var r=$v(this,[t]),o=r._storage,a=[],s=n_(1/e),l=o[t],u=this.count(),h=r._rawExtent[t],c=new(Wv(this))(u),p=0,d=0;dh[1]&&(h[1]=y),c[p++]=m}return r._count=p,r._indices=c,r.getRawIndex=Xv,r},c.prototype.lttbDownSample=function(t,e){var n,i=$v(this,[]),r=i._storage[t],o=this.count(),a=new(Wv(this))(o),s=0,l=n_(1/e),u=this.getRawIndex(0);a[s++]=u;for(var h=1;he[1]&&(e[1]=t[1])},M_.prototype.unionExtentFromData=function(t,e){this.unionExtent(t.getApproximateExtent(e))},M_.prototype.getExtent=function(){return this._extent.slice()},M_.prototype.setExtent=function(t,e){var n=this._extent;isNaN(t)||(n[0]=t),isNaN(e)||(n[1]=e)},M_.prototype.isInExtentRange=function(t){return this._extent[0]<=t&&this._extent[1]>=t},M_.prototype.isBlank=function(){return this._isBlank},M_.prototype.setBlank=function(t){this._isBlank=t};var S_=M_;function M_(t){this._setting=t||{},this._extent=[1/0,-1/0]}uo(S_);C_.createByAxisModel=function(t){var t=t.option,e=t.data,e=e&&j(e,I_);return new C_({categories:e,needCollect:!e,deduplication:!1!==t.dedplication})},C_.prototype.getOrdinal=function(t){return this._getOrCreateMap().get(t)},C_.prototype.parseAndCollect=function(t){var e,n,i=this._needCollect;return"string"==typeof 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},C_.prototype._getOrCreateMap=function(){return this._map||(this._map=L(this.categories))};var T_=C_;function C_(t){this.categories=t.categories||[],this._needCollect=t.needCollect,this._deduplication=t.deduplication}function I_(t){return k(t)&&null!=t.value?t.value:t+""}var A_=vr;function D_(t,e,n,i){var r={},o=t[1]-t[0],o=r.interval=Ar(o/e,!0),e=(null!=n&&oi[1]&&(i[0]=i[1]),r}function k_(t){return _r(t)+2}function L_(t,e,n){t[e]=Math.max(Math.min(t[e],n[1]),n[0])}function P_(t,e){return t>=e[0]&&t<=e[1]}function O_(t,e){return e[1]===e[0]?.5:(t-e[0])/(e[1]-e[0])}function R_(t,e){return t*(e[1]-e[0])+e[0]}u(B_,N_=S_),B_.prototype.parse=function(t){return"string"==typeof t?this._ordinalMeta.getOrdinal(t):Math.round(t)},B_.prototype.contain=function(t){return P_(t=this.parse(t),this._extent)&&null!=this._ordinalMeta.categories[t]},B_.prototype.normalize=function(t){return O_(t=this._getTickNumber(this.parse(t)),this._extent)},B_.prototype.scale=function(t){return t=Math.round(R_(t,this._extent)),this.getRawOrdinalNumber(t)},B_.prototype.getTicks=function(){for(var t=[],e=this._extent,n=e[0];n<=e[1];)t.push({value:n}),n++;return t},B_.prototype.getMinorTicks=function(t){},B_.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},B_.prototype.getOrdinalMeta=function(){return this._ordinalMeta},B_.prototype.niceTicks=function(){},B_.prototype.niceExtent=function(){},B_.type="ordinal";var N_,E_=B_;function B_(t){var t=N_.call(this,t)||this,e=(t.type="ordinal",t.getSetting("ordinalMeta"));return F(e=e||new T_({}))&&(e=new T_({categories:j(e,function(t){return k(t)?t.value:t})})),t._ordinalMeta=e,t._extent=t.getSetting("extent")||[0,e.categories.length-1],t}S_.registerClass(E_);var z_,F_=vr,V_=(u(H_,z_=S_),H_.prototype.parse=function(t){return t},H_.prototype.contain=function(t){return P_(t,this._extent)},H_.prototype.normalize=function(t){return O_(t,this._extent)},H_.prototype.scale=function(t){return R_(t,this._extent)},H_.prototype.setExtent=function(t,e){var n=this._extent;isNaN(t)||(n[0]=parseFloat(t)),isNaN(e)||(n[1]=parseFloat(e))},H_.prototype.unionExtent=function(t){var e=this._extent;t[0]e[1]&&(e[1]=t[1]),this.setExtent(e[0],e[1])},H_.prototype.getInterval=function(){return this._interval},H_.prototype.setInterval=function(t){this._interval=t,this._niceExtent=this._extent.slice(),this._intervalPrecision=k_(t)},H_.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:F_(s+e,r)}:{value:n[1]})}return o},H_.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),i1.length),t=Math.min(function(t,e,n,i){for(;n>>1;t[r][1]l[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},Y1.prototype.getMinorTicksCoords=function(){var t;return"ordinal"===this.scale.type?[]:(t=this.model.getModel("minorTick").get("splitNumber"),j(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=this}else tt("Layer of zlevel "+t+" is not valid")},y.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;ni)return;return 1}(a,e))return r=e.mapDimension(a.dim),o={},N(a.getViewLabels(),function(t){t=a.scale.getRawOrdinalNumber(t.tickValue);o[t]=1}),function(t){return!o.hasOwnProperty(e.get(r,t))}}}function Ib(t){for(var e,n,i=t.length/2;0e[l-1].coord&&(e.reverse(),u.reverse()),e[0].coord-10),c=e[l-1].coord+10,p=c-h;if(p<.001)return"transparent";N(e,function(t){t.offset=(t.coord-h)/p}),e.push({offset:l?e[l-1].offset:.5,color:u[1]||"transparent"}),e.unshift({offset:l?e[0].offset:.5,color:u[0]||"transparent"});l=new qu(0,0,0,0,e,!0);return l[o]=h,l[o+"2"]=c,l}}}(l,a)||l.getVisual("style")[l.getVisual("drawType")]),d=(g&&d.type===a.type&&T===this._step?(_&&!y?y=this._newPolygon(c,b):y&&!_&&(m.remove(y),y=this._polygon=null),p||this._initOrUpdateEndLabel(t,a,rp(C)),m.setClipPath(Db(this,a,!1,t)),w&&f.updateData(l,{isIgnore:S,clipShape:r,disableAnimation:!0,getSymbolPoint:function(t){return[c[2*t],c[2*t+1]]}}),bb(this._stackedOnPoints,b)&&bb(this._points,c)||(v?this._doUpdateAnimation(l,b,a,n,T,x):(T&&(c=Tb(c,a,T),b=b&&Tb(b,a,T)),g.setShape({points:c}),y&&y.setShape({points:c,stackedOnPoints:b})))):(w&&f.updateData(l,{isIgnore:S,clipShape:r,disableAnimation:!0,getSymbolPoint:function(t){return[c[2*t],c[2*t+1]]}}),v&&this._initSymbolLabelAnimation(l,a,r),T&&(c=Tb(c,a,T),b=b&&Tb(b,a,T)),g=this._newPolyline(c),_&&(y=this._newPolygon(c,b)),p||this._initOrUpdateEndLabel(t,a,rp(C)),m.setClipPath(Db(this,a,!0,t))),t.get(["emphasis","focus"])),n=t.get(["emphasis","blurScope"]),w=(g.useStyle(z(u.getLineStyle(),{fill:"none",stroke:C,lineJoin:"bevel"})),ml(g,t,"lineStyle"),0l?x:_,(g=Math.abs(d.label.y-l))>f.maxY&&(m=d.label.x-s-d.len2*h,y=u+d.len,m=Math.abs(m)=e.r0},Xb.type="pie";var Ub,Yb=Xb;function Xb(){var t=null!==Ub&&Ub.apply(this,arguments)||this;return t.ignoreLabelLineUpdate=!0,t}jb.prototype.getAllNames=function(){var t=this._getRawData();return t.mapArray(t.getName)},jb.prototype.containName=function(t){return 0<=this._getRawData().indexOfName(t)},jb.prototype.indexOfName=function(t){return this._getDataWithEncodedVisual().indexOfName(t)},jb.prototype.getItemVisual=function(t,e){return this._getDataWithEncodedVisual().getItemVisual(t,e)};var qb=jb;function jb(t,e){this._getDataWithEncodedVisual=t,this._getRawData=e}u($b,Zb=ig),$b.prototype.init=function(t){Zb.prototype.init.apply(this,arguments),this.legendVisualProvider=new qb(lt(this.getData,this),lt(this.getRawData,this)),this._defaultLabelLine(t)},$b.prototype.mergeOption=function(){Zb.prototype.mergeOption.apply(this,arguments)},$b.prototype.getInitialData=function(){return e=F(e={coordDimensions:["value"],encodeDefaulter:ut(Np,t=this)})?{coordDimensions:e}:I({},e),i=t.getSource(),e=g_(i,e),(e=new c_(e,t)).initData(i,n),e;var t,e,n,i},$b.prototype.getDataParams=function(t){var e=this.getData(),n=Zb.prototype.getDataParams.call(this,t),i=[];return e.each(e.mapDimension("value"),function(t){i.push(t)}),n.percent=br(i,t,e.hostModel.get("percentPrecision")),n.$vars.push("percent"),n},$b.prototype._defaultLabelLine=function(t){Nr(t,"labelLine",["show"]);var e=t.labelLine,n=t.emphasis.labelLine;e.show=e.show&&t.label.show,n.show=n.show&&t.emphasis.label.show},$b.type="series.pie",$b.defaultOption={zlevel:0,z:2,legendHoverLink:!0,center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,minAngle:0,minShowLabelAngle:0,selectedOffset:10,percentPrecision:2,stillShowZeroSum:!0,left:0,top:0,right:0,bottom:0,width:null,height:null,label:{rotate:0,show:!0,overflow:"truncate",position:"outer",alignTo:"none",edgeDistance:"25%",bleedMargin:10,distanceToLabelLine:5},labelLine:{show:!0,length:15,length2:15,smooth:!1,minTurnAngle:90,maxSurfaceAngle:90,lineStyle:{width:1,type:"solid"}},itemStyle:{borderWidth:1},labelLayout:{hideOverlap:!0},emphasis:{scale:!0,scaleSize:5},avoidLabelOverlap:!0,animationType:"expansion",animationDuration:1e3,animationTypeUpdate:"transition",animationEasingUpdate:"cubicInOut",animationDurationUpdate:500,animationEasing:"cubicInOut"};var Zb,Kb=$b;function $b(){var t=null!==Zb&&Zb.apply(this,arguments)||this;return t.useColorPaletteOnData=!0,t}R1(function(t){t.registerChartView(Yb),t.registerSeriesModel(Kb),Ly("pie",t.registerAction),t.registerLayout(ut(Nb,"pie")),t.registerProcessor({seriesType:"pie",reset:function(t,e){var i,r=e.findComponents({mainType:"legend"});r&&r.length&&(i=t.getData()).filterSelf(function(t){for(var e=i.getName(t),n=0;ne[1]&&e.reverse(),e},yw.prototype.pointToData=function(t,e){return this.coordToData(this.toLocalCoord(t["x"===this.dim?0:1]),e)},yw.prototype.setCategorySortInfo=function(t){if("category"!==this.type)return!1;this.model.option.categorySortInfo=t,this.scale.setSortInfo(t)};var fw,gw=yw;function yw(t,e,n,i,r){t=fw.call(this,t,e,n)||this;return t.index=0,t.type=i||"value",t.position=r||"bottom",t}function mw(t,e,n){n=n||{};var t=t.coordinateSystem,i=e.axis,r={},o=i.getAxesOnZeroOf()[0],a=i.position,s=o?"onZero":a,i=i.dim,t=t.getRect(),t=[t.x,t.x+t.width,t.y,t.y+t.height],l={left:0,right:1,top:0,bottom:1,onZero:2},u=e.get("offset")||0,u="x"===i?[t[2]-u,t[3]+u]:[t[0]-u,t[1]+u],h=(o&&(h=o.toGlobalCoord(o.dataToCoord(0)),u[l.onZero]=Math.max(Math.min(h,u[1]),u[0])),r.position=["y"===i?u[l[s]]:t[0],"x"===i?u[l[s]]:t[3]],r.rotation=Math.PI/2*("x"===i?0:1),r.labelDirection=r.tickDirection=r.nameDirection={top:-1,bottom:1,left:-1,right:1}[a],r.labelOffset=o?u[l[a]]-u[l.onZero]:0,e.get(["axisTick","inside"])&&(r.tickDirection=-r.tickDirection),xt(n.labelInside,e.get(["axisLabel","inside"]))&&(r.labelDirection=-r.labelDirection),e.get(["axisLabel","rotate"]));return r.labelRotate="top"===s?-h:h,r.z2=1,r}function vw(t){return"cartesian2d"===t.get("coordinateSystem")}function _w(i){var r={xAxisModel:null,yAxisModel:null};return N(r,function(t,e){var n=e.replace(/Model$/,""),n=i.getReferringComponents(n,Kr).models[0];r[e]=n}),r}bw.prototype.getRect=function(){return this._rect},bw.prototype.update=function(t,e){var n=this._axesMap,i=(this._updateScale(t,this.model),N(n.x,function(t){S1(t.scale,t.model)}),N(n.y,function(t){S1(t.scale,t.model)}),{});N(n.x,function(t){Sw(n,"y",t,i)}),N(n.y,function(t){Sw(n,"x",t,i)}),this.resize(this.model,e)},bw.prototype.resize=function(t,e,n){var i=t.getBoxLayoutParams(),n=!n&&t.get("containLabel"),a=cp(i,{width:e.getWidth(),height:e.getHeight()}),r=(this._rect=a,this._axesList);function o(){N(r,function(t){var e,n,i=t.isHorizontal(),r=i?[0,a.width]:[0,a.height],o=t.inverse?1:0;t.setExtent(r[o],r[1-o]),r=t,e=i?a.x:a.y,o=r.getExtent(),n=o[0]+o[1],r.toGlobalCoord="x"===r.dim?function(t){return t+e}:function(t){return n-t+e},r.toLocalCoord="x"===r.dim?function(t){return t-e}:function(t){return n-t+e}})}o(),n&&(N(r,function(t){var e,n,i;t.model.get(["axisLabel","inside"])||(e=I1(t))&&(n=t.isHorizontal()?"height":"width",i=t.model.get(["axisLabel","margin"]),a[n]-=e[n]+i,"top"===t.position?a.y+=e.height+i:"left"===t.position&&(a.x+=e.width+i))}),o()),N(this._coordsList,function(t){t.calcAffineTransform()})},bw.prototype.getAxis=function(t,e){t=this._axesMap[t];if(null!=t)return t[e||0]},bw.prototype.getAxes=function(){return this._axesList.slice()},bw.prototype.getCartesian=function(t,e){if(null!=t&&null!=e)return this._coordsMap["x"+t+"y"+e];k(t)&&(e=t.yAxisIndex,t=t.xAxisIndex);for(var n=0,i=this._coordsList;nh[1]?-1:1,o=["start"===c?h[0]-o*u:"end"===c?h[1]+o*u:(h[0]+h[1])/2,Lw(c)?t.labelOffset+l*u:0],null!=(u=e.get("nameRotate"))&&(u=u*Tw/180),Lw(c)?a=Cw.innerTextLayout(t.rotation,null!=u?u:t.rotation,l):(a=function(t,e,n,i){var r,n=wr(n-t),t=i[0]>i[1],i="start"===e&&!t||"start"!==e&&t;e=Sr(n-Tw/2)?(r=i?"bottom":"top","center"):Sr(n-1.5*Tw)?(r=i?"top":"bottom","center"):(r="middle",n<1.5*Tw&&Tw/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=P(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&&wh(l,{x:c.contentPosition[0],y:c.contentPosition[1]},d?t:null),this._updatePageInfoView(t,c),f},NS.prototype._pageGo=function(t,e,n){t=this._getPageInfo(e)[t];null!=t&&n.dispatchAction({type:"legendScroll",scrollDataIndex:t,legendId:e.id})},NS.prototype._updatePageInfoView=function(n,i){var r=this._controllerGroup,t=(N(["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",D(e)?e.replace("{current}",null==o?"":o+"").replace("{total}",null==a?"":a+""):e({current:o,total:a}))},NS.prototype._getPageInfo=function(t){var e=t.get("scrollDataIndex",!0),n=this.getContentGroup(),i=this._containerGroup.__rectSize,t=t.getOrient().index,r=PS[t],o=OS[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}},NS.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},NS.type="legend.scroll",NS);function NS(){var t=null!==kS&&kS.apply(this,arguments)||this;return t.type=NS.type,t.newlineDisabled=!0,t._currentIndex=0,t}R1(function(t){R1(TS),t.registerComponentModel(IS),t.registerComponentView(RS),t.registerAction("legendScroll","legendscroll",function(t,e){var n=t.scrollDataIndex;null!=n&&e.eachComponent({mainType:"legend",subType:"scroll",query:t},function(t){t.setScrollDataIndex(n)})})});var ES=Xr(),BS=C,zS=lt;function FS(){this._dragging=!1,this.animationThreshold=15}function VS(t,e,n,i){!function n(i,t){{var r;return k(i)&&k(t)?(r=!0,N(t,function(t,e){r=r&&n(i[e],t)}),!!r):i===t}}(ES(n).lastProp,i)&&(ES(n).lastProp=i,e?wh(n,i,t):(n.stopAnimation(),n.attr(i)))}function HS(t,e){t[e.get(["label","show"])?"show":"hide"]()}function GS(t){return{x:t.x||0,y:t.y||0,rotation:t.rotation||0}}function WS(t,e,n){var i=e.get("z"),r=e.get("zlevel");t&&t.traverse(function(t){"group"!==t.type&&(null!=i&&(t.z=i),null!=r&&(t.zlevel=r),t.silent=n)})}function US(t,e,n,i,r){var o=YS(n.get("value"),e.axis,e.ecModel,n.get("seriesDataIndices"),{precision:n.get(["label","precision"]),formatter:n.get(["label","formatter"])}),n=n.getModel("label"),a=Zc(n.get("padding")||0),s=n.getFont(),l=ni(o,s),u=r.position,h=l.width+a[1]+a[3],l=l.height+a[0]+a[2],c=r.align,c=("right"===c&&(u[0]-=h),"center"===c&&(u[0]-=h/2),r.verticalAlign),i=("bottom"===c&&(u[1]-=l),"middle"===c&&(u[1]-=l/2),r=u,c=h,h=l,i=(l=i).getWidth(),l=l.getHeight(),r[0]=Math.min(r[0]+c,i)-c,r[1]=Math.min(r[1]+h,l)-h,r[0]=Math.max(r[0],0),r[1]=Math.max(r[1],0),n.get("backgroundColor"));i&&"auto"!==i||(i=e.get(["axisLine","lineStyle","color"])),t.label={x:u[0],y:u[1],style:Wh(n,{text:o,font:s,fill:n.getTextColor(),padding:a,backgroundColor:i}),z2:10}}function YS(t,e,n,i,r){t=e.scale.parse(t);var o,a=e.scale.getLabel({value:t},{precision:r.precision}),r=r.formatter;return r&&(o={value:C1(e,{value:t}),axisDimension:e.dim,axisIndex:e.index,seriesData:[]},N(i,function(t){var e=n.getSeriesByIndex(t.seriesIndex),t=t.dataIndexInside,e=e&&e.getDataParams(t);e&&o.seriesData.push(e)}),D(r)?a=r.replace("{value}",a):ht(r)&&(a=r(o))),a}function XS(t,e,n){var i=Pe();return Be(i,i,n.rotation),Ee(i,i,n.position),Dh([t.dataToCoord(e),(n.labelOffset||0)+(n.labelDirection||1)*(n.labelMargin||0)],i)}FS.prototype.render=function(t,e,n,i){var r,o,a=e.get("value"),s=e.get("status");this._axisModel=t,this._axisPointerModel=e,this._api=n,!i&&this._lastValue===a&&this._lastStatus===s||(this._lastValue=a,this._lastStatus=s,i=this._group,r=this._handle,s&&"hide"!==s?(i&&i.show(),r&&r.show(),this.makeElOption(s={},a,t,e,n),(o=s.graphicKey)!==this._lastGraphicKey&&this.clear(n),this._lastGraphicKey=o,o=this._moveAnimation=this.determineAnimation(t,e),i?(o=ut(VS,e,o),this.updatePointerEl(i,s,o),this.updateLabelEl(i,s,o,e)):(i=this._group=new O,this.createPointerEl(i,s,t,e),this.createLabelEl(i,s,t,e),n.getZr().add(i)),WS(i,e,!0),this._renderHandle(a)):(i&&i.hide(),r&&r.hide()))},FS.prototype.remove=function(t){this.clear(t)},FS.prototype.dispose=function(t){this.clear(t)},FS.prototype.determineAnimation=function(t,e){var n,i=e.get("animation"),r=t.axis,o="category"===r.type,e=e.get("snap");return!(!e&&!o)&&("auto"===i||null==i?(n=this.animationThreshold,o&&r.getBandWidth()>n||!!e&&(o=Nw(t).seriesDataCount,e=r.getExtent(),Math.abs(e[0]-e[1])/o>n)):!0===i)},FS.prototype.makeElOption=function(t,e,n,i,r){},FS.prototype.createPointerEl=function(t,e,n,i){var r=e.pointer;r&&(r=ES(t).pointerEl=new Bh[r.type](BS(e.pointer)),t.add(r))},FS.prototype.createLabelEl=function(t,e,n,i){e.label&&(e=ES(t).labelEl=new ms(BS(e.label)),t.add(e),HS(e,i))},FS.prototype.updatePointerEl=function(t,e,n){t=ES(t).pointerEl;t&&e.pointer&&(t.setStyle(e.pointer.style),n(t,{shape:e.pointer.shape}))},FS.prototype.updateLabelEl=function(t,e,n,i){t=ES(t).labelEl;t&&(t.setStyle(e.label.style),n(t,{x:e.label.x,y:e.label.y}),HS(t,i))},FS.prototype._renderHandle=function(t){var e,n,i,r,o,a;!this._dragging&&this.updateHandleTransform&&(e=this._axisPointerModel,n=this._api.getZr(),i=this._handle,r=e.getModel("handle"),a=e.get("status"),r.get("show")&&a&&"hide"!==a?(this._handle||(o=!0,i=this._handle=Rh(r.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(t){me(t.event)},onmousedown:zS(this._onHandleDragMove,this,0,0),drift:zS(this._onHandleDragMove,this),ondragend:zS(this._onHandleDragEnd,this)}),n.add(i)),WS(i,e,!1),i.setStyle(r.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"])),F(a=r.get("size"))||(a=[a,a]),i.scaleX=a[0]/2,i.scaleY=a[1]/2,function(t,e,n,i){var r=t[e];if(r){var o=r[Sg]||r,a=r[Tg];if(r[Mg]!==n||a!==i){if(null==n||!i)return t[e]=o;(r=t[e]=Cg(o,n,"debounce"===i))[Sg]=o,r[Tg]=i,r[Mg]=n}}}(this,"_doDispatchAxisPointer",r.get("throttle")||0,"fixRate"),this._moveHandleToValue(t,o)):(i&&n.remove(i),this._handle=null))},FS.prototype._moveHandleToValue=function(t,e){VS(this._axisPointerModel,!e&&this._moveAnimation,this._handle,GS(this.getHandleTransform(t,this._axisModel,this._axisPointerModel)))},FS.prototype._onHandleDragMove=function(t,e){var n=this._handle;n&&(this._dragging=!0,t=this.updateHandleTransform(GS(n),[t,e],this._axisModel,this._axisPointerModel),this._payloadInfo=t,n.stopAnimation(),n.attr(GS(t)),ES(n).lastProp=null,this._doDispatchAxisPointer())},FS.prototype._doDispatchAxisPointer=function(){var t,e;this._handle&&(t=this._payloadInfo,e=this._axisModel,this._api.dispatchAction({type:"updateAxisPointer",x:t.cursorPoint[0],y:t.cursorPoint[1],tooltipOption:t.tooltipOption,axesInfo:[{axisDim:e.axis.dim,axisIndex:e.componentIndex}]}))},FS.prototype._onHandleDragEnd=function(){var t;this._dragging=!1,this._handle&&(t=this._axisPointerModel.get("value"),this._moveHandleToValue(t),this._api.dispatchAction({type:"hideTip"}))},FS.prototype.clear=function(t){this._lastValue=null,this._lastStatus=null;var t=t.getZr(),e=this._group,n=this._handle;t&&e&&(this._lastGraphicKey=null,e&&t.remove(e),n&&t.remove(n),this._group=null,this._handle=null,this._payloadInfo=null)},FS.prototype.doClear=function(){},FS.prototype.buildLabel=function(t,e,n){return{x:t[n=n||0],y:t[1-n],width:e[n],height:e[1-n]}};u(ZS,qS=FS),ZS.prototype.makeElOption=function(t,e,n,i,r){var o,a,s=n.axis,l=s.grid,u=i.get("type"),h=KS(l,s).getOtherAxis(s).getGlobalExtent(),c=s.toGlobalCoord(s.dataToCoord(e,!0)),p=(u&&"none"!==u&&(o=(a=i).get("type"),a=a.getModel(o+"Style"),"line"===o?(p=a.getLineStyle()).fill=null:"shadow"===o&&((p=a.getAreaStyle()).stroke=null),o=p,(a=$S[u](s,c,h)).style=o,t.graphicKey=a.type,t.pointer=a),mw(l.model,n));u=e,s=t,c=p,h=n,o=i,a=r,l=Cw.innerTextLayout(c.rotation,0,c.labelDirection),c.labelMargin=o.get(["label","margin"]),US(s,h,o,a,{position:XS(h.axis,u,c),align:l.textAlign,verticalAlign:l.textVerticalAlign})},ZS.prototype.getHandleTransform=function(t,e,n){var i=mw(e.axis.grid.model,e,{labelInside:!1}),n=(i.labelMargin=n.get(["handle","margin"]),XS(e.axis,t,i));return{x:n[0],y:n[1],rotation:i.rotation+(i.labelDirection<0?Math.PI:0)}},ZS.prototype.updateHandleTransform=function(t,e,n,i){var n=n.axis,r=n.grid,o=n.getGlobalExtent(!0),r=KS(r,n).getOtherAxis(n).getGlobalExtent(),n="x"===n.dim?0:1,a=[t.x,t.y],e=(a[n]+=e[n],a[n]=Math.min(o[1],a[n]),a[n]=Math.max(o[0],a[n]),(r[1]+r[0])/2),o=[e,e];o[n]=a[n];return{x:a[0],y:a[1],rotation:t.rotation,cursorPoint:o,tooltipOption:[{verticalAlign:"middle"},{align:"center"}][n]}};var qS,jS=ZS;function ZS(){return null!==qS&&qS.apply(this,arguments)||this}function KS(t,e){var n={};return n[e.dim+"AxisIndex"]=e.index,t.getCartesian(n)}var $S={line:function(t,e,n){var i;return i=[e,n[0]],e=[e,n[1]],n=JS(t),{type:"Line",subPixelOptimize:!0,shape:{x1:i[n=n||0],y1:i[1-n],x2:e[n],y2:e[1-n]}}},shadow:function(t,e,n){var i=Math.max(1,t.getBandWidth()),r=n[1]-n[0];return{type:"Rect",shape:(e=[e-i/2,n[0]],n=[i,r],i=JS(t),{x:e[i=i||0],y:e[1-i],width:n[i],height:n[1-i]})}}};function JS(t){return"x"===t.dim?0:1}u(eM,QS=g),eM.type="axisPointer",eM.defaultOption={show:"auto",zlevel:0,z:50,type:"line",snap:!1,triggerTooltip:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:"#B9BEC9",width:1,type:"dashed"},shadowStyle:{color:"rgba(210,219,238,0.2)"},label:{show:!0,formatter:null,precision:"auto",margin:3,color:"#fff",padding:[5,7,5,7],backgroundColor:"auto",borderColor:null,borderWidth:0,borderRadius:3},handle:{show:!1,icon:"M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z",size:45,margin:50,color:"#333",shadowBlur:3,shadowColor:"#aaa",shadowOffsetX:0,shadowOffsetY:2,throttle:40}};var QS,tM=eM;function eM(){var t=null!==QS&&QS.apply(this,arguments)||this;return t.type=eM.type,t}var nM=Xr(),iM=N;function rM(t,e,n){var i,c,p;function r(t,h){c.on(t,function(e){n=p;var n,i,r={dispatchAction:o,pendings:i={showTip:[],hideTip:[]}};function o(t){var e=i[t.type];e?e.push(t):(t.dispatchAction=o,n.dispatchAction(t))}iM(nM(c).records,function(t){t&&h(t,e,r.dispatchAction)});var t,a=r.pendings,s=p,l=a.showTip.length,u=a.hideTip.length;l?t=a.showTip[l-1]:u&&(t=a.hideTip[u-1]),t&&(t.dispatchAction=null,s.dispatchAction(t))})}w.node||(i=e.getZr(),nM(i).records||(nM(i).records={}),p=e,nM(c=i).initialized||(nM(c).initialized=!0,r("click",ut(aM,"click")),r("mousemove",ut(aM,"mousemove")),r("globalout",oM)),(nM(i).records[t]||(nM(i).records[t]={})).handler=n)}function oM(t,e,n){t.handler("leave",null,n)}function aM(t,e,n,i){e.handler(t,n,i)}function sM(t,e){w.node||(e=e.getZr(),(nM(e).records||{})[t]&&(nM(e).records[t]=null))}u(hM,lM=cg),hM.prototype.render=function(t,e,n){var e=e.getComponent("tooltip"),i=t.get("triggerOn")||e&&e.get("triggerOn")||"mousemove|click";rM("axisPointer",n,function(t,e,n){"none"!==i&&("leave"===t||0<=i.indexOf(t))&&n({type:"updateAxisPointer",currTrigger:t,x:e&&e.offsetX,y:e&&e.offsetY})})},hM.prototype.remove=function(t,e){sM("axisPointer",e)},hM.prototype.dispose=function(t,e){sM("axisPointer",e)},hM.type="axisPointer";var lM,uM=hM;function hM(){var t=null!==lM&&lM.apply(this,arguments)||this;return t.type=hM.type,t}function cM(t,e){var n,i,r,o,a=[],s=t.seriesIndex;return null==s||!(e=e.getSeriesByIndex(s))||null==(s=Yr(n=e.getData(),t))||s<0||F(s)?{point:[]}:(i=n.getItemGraphicEl(s),r=e.coordinateSystem,e.getTooltipPosition?a=e.getTooltipPosition(s)||[]:r&&r.dataToPoint?a=t.isStacked?(e=r.getBaseAxis(),t=r.getOtherAxis(e).dim,e=e.dim,t="x"===t||"radius"===t?1:0,e=n.mapDimension(e),(o=[])[t]=n.get(e,s),o[1-t]=n.get(n.getCalculationInfo("stackResultDimension"),s),r.dataToPoint(o)||[]):r.dataToPoint(n.getValues(j(r.dimensions,function(t){return n.mapDimension(t)}),s))||[]:i&&((e=i.getBoundingRect().clone()).applyTransform(i.transform),a=[e.x+e.width/2,e.y+e.height/2]),{point:a,el:i})}var pM=Xr();function dM(t,e,n){var o,a,i,s,l,r,u,h,c,p,d,f,g,y,m=t.currTrigger,v=[t.x,t.y],_=t,x=t.dispatchAction||lt(n.dispatchAction,n),b=e.getComponent("axisPointer").coordSysAxesInfo;if(b)return vM(v)&&(v=cM({seriesIndex:_.seriesIndex,dataIndex:_.dataIndex},e).point),o=vM(v),a=_.axesInfo,i=b.axesInfo,s="leave"===m||vM(v),l={},e={list:[],map:{}},u={showPointer:ut(gM,r={}),showTooltip:ut(yM,e)},N(b.coordSysMap,function(t,e){var r=o||t.containPoint(v);N(b.coordSysAxesInfo[e],function(t,e){var n=t.axis,i=function(t,e){for(var n=0;n<(t||[]).length;n++){var i=t[n];if(e.axis.dim===i.axisDim&&e.axis.model.componentIndex===i.axisIndex)return i}}(a,t);s||!r||a&&!i||null!=(i=null!=(i=i&&i.value)||o?i:n.pointToData(v))&&fM(t,i,u,!1,l)})}),h={},N(i,function(n,t){var i=n.linkGroup;i&&!r[t]&&N(i.axesInfo,function(t,e){var e=r[e];t!==n&&e&&(e=e.value,i.mapper&&(e=n.axis.scale.parse(i.mapper(e,mM(t),mM(n)))),h[n.key]=e)})}),N(h,function(t,e){fM(i[e],t,u,!0,l)}),c=r,_=i,p=l.axesInfo=[],N(_,function(t,e){var n=t.axisPointerModel.option,e=c[e];e?(t.useHandle||(n.status="show"),n.value=e.value,n.seriesDataIndices=(e.payloadBatch||[]).slice()):t.useHandle||(n.status="hide"),"show"===n.status&&p.push({axisDim:t.axis.dim,axisIndex:t.axis.model.componentIndex,value:n.value})}),m=e,_=t,e=x,vM(t=v)||!m.list.length?e({type:"hideTip"}):(x=((m.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{},e({type:"showTip",escapeConnect:!0,x:t[0],y:t[1],tooltipOption:_.tooltipOption,position:_.position,dataIndexInside:x.dataIndexInside,dataIndex:x.dataIndex,seriesIndex:x.seriesIndex,dataByCoordSys:m.list})),e=i,_=(t=n).getZr(),x="axisPointerLastHighlights",d=pM(_)[x]||{},f=pM(_)[x]={},N(e,function(t,e){t=t.axisPointerModel.option;"show"===t.status&&N(t.seriesDataIndices,function(t){var e=t.seriesIndex+" | "+t.dataIndex;f[e]=t})}),g=[],y=[],N(d,function(t,e){f[e]||y.push(t)}),N(f,function(t,e){d[e]||g.push(t)}),y.length&&t.dispatchAction({type:"downplay",escapeConnect:!0,notBlur:!0,batch:y}),g.length&&t.dispatchAction({type:"highlight",escapeConnect:!0,notBlur:!0,batch:g}),l}function fM(t,e,n,i,r){var o,a,s,l,u,h,c,p,d,f,g=t.axis;!g.scale.isBlank()&&g.containData(e)&&(t.involveSeries?(a=e,s=t.axis,l=s.dim,u=a,h=[],c=Number.MAX_VALUE,p=-1,N(t.seriesModels,function(e,t){var n,i=e.getData().mapDimensionsAll(l);if(e.getAxisTooltipData)var r=e.getAxisTooltipData(i,a,s),o=r.dataIndices,r=r.nestestValue;else{if(!(o=e.getData().indicesOfNearest(i[0],a,"category"===s.type?.5:null)).length)return;r=e.getData().get(i[0],o[0])}null!=r&&isFinite(r)&&(i=a-r,(n=Math.abs(i))<=c)&&((n'}(n.get("backgroundColor"),i,r)),D(t))o.innerHTML=t;else if(t){o.innerHTML="",F(t)||(t=[t]);for(var a=0;a"),a=p.join(n);this._showOrMove(r,function(){this._updateContentNotChangedOnAxis(t)?this._updatePosition(r,o,i[0],i[1],this._tooltipContent,h):this._showTooltipContent(r,a,h,Math.random()+"",i[0],i[1],o,null,d)})},qM.prototype._showSeriesItemTooltip=function(t,e,n){var i,r,o,a,s=this._ecModel,e=R(e),l=e.seriesIndex,u=s.getSeriesByIndex(l),h=e.dataModel||u,c=e.dataIndex,e=e.dataType,p=h.getData(e),d=this._renderMode,f=t.positionDefault,g=jM([p.getItemModel(c),h,u&&(u.coordinateSystem||{}).model],this._tooltipModel,f?{position:f}:null),u=g.get("trigger");null!=u&&"item"!==u||(i=h.getDataParams(c,e),r=new $f,i.marker=r.makeTooltipMarker("item",rp(i.color),d),f=ef(h.formatTooltip(c,!1,e)),u=g.get("order"),o=f.markupFragment?Xf(f.markupFragment,r,d,u,s.get("useUTC"),g.get("textStyle")):f.markupText,a="item_"+h.name+"_"+c,this._showOrMove(g,function(){this._showTooltipContent(g,o,i,a,t.offsetX,t.offsetY,t.position,t.target,r)}),n({type:"showTip",dataIndexInside:c,dataIndex:p.getRawIndex(c),seriesIndex:l,from:this.uid}))},qM.prototype._showComponentItemTooltip=function(e,n,t){var i=R(n),r=i.tooltipConfig.option,r=[r=D(r)?{content:r,formatter:r}:r],i=this._ecModel.getComponent(i.componentMainType,i.componentIndex),i=(i&&r.push(i),e.positionDefault),o=jM(r,this._tooltipModel,i?{position:i}:null),a=o.get("content"),s=Math.random()+"",l=new $f;this._showOrMove(o,function(){var t=C(o.get("formatterParams")||{});this._showTooltipContent(o,a,t,s,e.offsetX,e.offsetY,e.position,n,l)}),t({type:"showTip",from:this.uid})},qM.prototype._showTooltipContent=function(n,t,i,e,r,o,a,s,l){var u,h,c,p,d;this._ticket="",n.get("showContent")&&n.get("show")&&(u=this._tooltipContent,h=n.get("formatter"),a=a||n.get("position"),t=t,c=this._getNearestPoint([r,o],i,n.get("trigger"),n.get("borderColor")).color,h&&D(h)?(p=n.ecModel.get("useUTC"),t=h,t=np(t=(d=F(i)?i[0]:i)&&d.axisType&&0<=d.axisType.indexOf("time")?Lc(d.axisValue,t,p):t,i,!0)):ht(h)&&(d=GM(function(t,e){t===this._ticket&&(u.setContent(e,l,n,c,a),this._updatePosition(n,a,r,o,u,i,s))},this),this._ticket=e,t=h(i,e,d)),u.setContent(t,l,n,c,a),u.show(n,c),this._updatePosition(n,a,r,o,u,i,s))},qM.prototype._getNearestPoint=function(t,e,n,i){return"axis"===n||F(e)?{color:i||("html"===this._renderMode?"#fff":"none")}:F(e)?void 0:{color:i||e.color||e.borderColor}},qM.prototype._updatePosition=function(t,e,n,i,r,o,a){var s,l=this._api.getWidth(),u=this._api.getHeight(),h=(e=e||t.get("position"),r.getSize()),c=t.get("align"),p=t.get("verticalAlign"),d=a&&a.getBoundingRect().clone();a&&d.applyTransform(a.transform),F(e=ht(e)?e([n,i],o,r.el,d,{viewSize:[l,u],contentSize:h.slice()}):e)?(n=UM(e[0],l),i=UM(e[1],u)):k(e)?((o=e).width=h[0],o.height=h[1],n=(o=cp(o,{width:l,height:u})).x,i=o.y,p=c=null):i=(n=(s=D(e)&&a?function(t,e,n){var i=n[0],r=n[1],o=0,a=0,s=e.width,l=e.height;switch(t){case"inside":o=e.x+s/2-i/2,a=e.y+l/2-r/2;break;case"top":o=e.x+s/2-i/2,a=e.y-r-10;break;case"bottom":o=e.x+s/2-i/2,a=e.y+l+10;break;case"left":o=e.x-i-10-5,a=e.y+l/2-r/2;break;case"right":o=e.x+s+10+5,a=e.y+l/2-r/2}return[o,a]}(e,d,h):function(t,e,n,i,r,o,a){var n=n.getOuterSize(),s=n.width,n=n.height;null!=o&&(i":"gt",">=":"gte","=":"eq","!=":"ne","<>":"ne"},JM=(QM.prototype.evaluate=function(t){var e=typeof t;return"string"==e?this._condVal.test(t):"number"==e&&this._condVal.test(t+"")},QM);function QM(t){null==(this._condVal=D(t)?new RegExp(t):vt(t)?t:null)&&f("")}eT.prototype.evaluate=function(){return this.value};var tT=eT;function eT(){}iT.prototype.evaluate=function(){for(var t=this.children,e=0;e--> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + 稳态数据 + + + + + + +
- - - - - - + + - + + - - - - - - +xxxxxxxxxxxxxx - +yyyy-MM-dd HH:mm:ss + +
+
+
+
+ + +
+--> - - + vEchar.setOption({ + xAxis: [ + { + data: vTime + } + ], + series: [ + { + data: vA + }, + { + data: vB + }, + { + data: vC + } + ] + }) - - + iEchar.setOption({ + xAxis: [ + { + data: vTime + } + ], + series: [ + { + data: iA + }, + { + data: iB + }, + { + data: iC + } + ] + }) - - - - - - - - - - - - - - + serviseV = [] + for(let i=2;i<26;i++){ - - - - - - - - - - - - - + let temValV = (Number(message['HRPhV_H'+i+'_phsA'])+Number(message['HRPhV_H'+i+'_phsB'])+Number(message['HRPhV_H'+i+'_phsC']))/3 + serviseV.push(temValV.toFixed(3)) + } - - - - - + pinPuEcharts.setOption({ + series: [ + { + data: serviseV + }, + ] + }) - - - - - - - - - + }; - - - + /** + * 关闭连接 + */ + webSocket.onclose = function (event) { + console.log('WebSocket关闭连接'); + }; - - - + /** + * 通信失败 + */ + webSocket.onerror = function (event) { + console.log('WebSocket发生异常'); - - - + }; + return webSocket; + } - - - - - - - - - + + var serviseV = [] + var pinPuEcharts + $('#buttonPinPu').click(function () { + $('#pinPu').show() + $('#history').hide() + + var pinPuX = [] + for(let i=2;i<26;i++){ + pinPuX.push(i+'次') + } + + // 基于准备好的dom,初始化echarts实例 + pinPuEcharts= echarts.init(document.getElementById('pinPuChar')); + pinPuEcharts.clear() + + // 指定图表的配置项和数据 + var option = { + title: { + left: 'center', + text: '2~25次谐波电压含有率', + textStyle: { + color: 'black' + } + }, + tooltip: { + trigger: 'axis', + axisPointer: { + type: 'cross', + label: { + backgroundColor: '#283b56' + } + } + }, + legend: { + left: '80px', + verticalAlign: 'top', + enabled: true, + itemDistance: 5, + textStyle: { + rich: { + a: { + verticalAlign: 'middle' + } + }, + + padding: [0, 0, 0, 0] //[上、右、下、左] + } + + }, + xAxis: { + name:'次数', + data: pinPuX, + boundaryGap: true, + axisLine: { + show: true, + onZero: false, + lineStyle: { + color: '#000000' + } + }, + axisLabel: { + textStyle: { + fontFamily: 'dinproRegular', + color: '#000000' + } + } + }, + yAxis: { + name:'%', + boundaryGap: true, + axisLine: { + show: true, + onZero: false, + lineStyle: { + color: '#000000' + } + }, + axisLabel: { + textStyle: { + fontFamily: 'dinproRegular', + color: '#000000' + } + } + }, + series: [ + { + name: '谐波电压含有率', + type: 'bar', + data: serviseV, + color:'#339966' + }, + { + color:'#FF9900', + name: '限值', + type: 'bar', + data: [ + 0.8, + 1.6, + 0.8, + 1.6, + 0.8, + 1.6, + 0.8, + 1.6, + 0.8, + 1.6, + 0.8, + 1.6, + 0.8, + 1.6, + 0.8, + 1.6, + 0.8, + 1.6, + 0.8, + 1.6, + 0.8, + 1.6, + 0.8, + 1.6, + 0.8, + 1.6, + 0.8, + 1.6, + 0.8, + 1.6, + 0.8, + 1.6, + 0.8, + 1.6, + 0.8, + 1.6, + 0.8, + 1.6, + 0.8, + 1.6, + 0.8, + 1.6, + 0.8, + 1.6, + 0.8, + 1.6, + 0.8, + 1.6, + 0.8 + ] + } + ] + }; + + // 使用刚指定的配置项和数据显示图表。 + pinPuEcharts.setOption(option); + }) + + + $("#selectId").change(function () { + vTime = [] + vA = [] + vB = [] + vC = [] + iA = [] + iB = [] + iC = [] + + serviseV = [] + + vEchar.setOption({ + xAxis: [ + { + data: vTime + } + ], + series: [ + { + data: vA + }, + { + data: vB + }, + { + data: vC + } + ] + }) + + iEchar.setOption({ + xAxis: [ + { + data: vTime + } + ], + series: [ + { + data: iA + }, + { + data: iB + }, + { + data: iC + } + ] + }) + + pinPuEcharts.setOption({ + series: [ + { + data: serviseV + }, + ] + }) + }) + + + + + + diff --git a/src/main/resources/static/harmnicPinPu.html b/src/main/resources/static/harmnicPinPu.html new file mode 100644 index 0000000..bfe1efb --- /dev/null +++ b/src/main/resources/static/harmnicPinPu.html @@ -0,0 +1,105 @@ + + + + + + 稳态数据 + + + + + + + + + + + + diff --git a/src/main/resources/static/index.html b/src/main/resources/static/index.html index 0d5e2c2..5583457 100644 --- a/src/main/resources/static/index.html +++ b/src/main/resources/static/index.html @@ -6,7 +6,7 @@ 谐波次 (%)数表格 - +
@@ -25,12 +25,25 @@
+
+ + +
+ +
装置标识:{{data.customDevId}}
{{data.time.substring(0,4)+'-'+data.time.substring(4,6)+'-'+data.time.substring(6,8)+' '+data.time.substring(9,11)+':'+data.time.substring(11,13)+':'+data.time.substring(13,15)}}
+ + + @@ -390,15 +403,7 @@ - - - - - - - -