qauMaWeb/node_modules/.cache/babel-loader/ff54d30b9f18e30fb2a9cef6a7e...

1 line
25 KiB
JSON

{"ast":null,"code":"import \"core-js/modules/es.array.slice.js\";\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n\n/**\r\n * AUTO-GENERATED FILE. DO NOT MODIFY.\r\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\n/**\r\n * Provide effect for line\r\n */\n\nimport * as graphic from '../../util/graphic.js';\nimport Line from './Line.js';\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { createSymbol } from '../../util/symbol.js';\nimport * as vec2 from 'zrender/lib/core/vector.js';\nimport * as curveUtil from 'zrender/lib/core/curve.js';\n\nvar EffectLine =\n/** @class */\nfunction (_super) {\n __extends(EffectLine, _super);\n\n function EffectLine(lineData, idx, seriesScope) {\n var _this = _super.call(this) || this;\n\n _this.add(_this.createLine(lineData, idx, seriesScope));\n\n _this._updateEffectSymbol(lineData, idx);\n\n return _this;\n }\n\n EffectLine.prototype.createLine = function (lineData, idx, seriesScope) {\n return new Line(lineData, idx, seriesScope);\n };\n\n EffectLine.prototype._updateEffectSymbol = function (lineData, idx) {\n var itemModel = lineData.getItemModel(idx);\n var effectModel = itemModel.getModel('effect');\n var size = effectModel.get('symbolSize');\n var symbolType = effectModel.get('symbol');\n\n if (!zrUtil.isArray(size)) {\n size = [size, size];\n }\n\n var lineStyle = lineData.getItemVisual(idx, 'style');\n var color = effectModel.get('color') || lineStyle && lineStyle.stroke;\n var symbol = this.childAt(1);\n\n if (this._symbolType !== symbolType) {\n // Remove previous\n this.remove(symbol);\n symbol = createSymbol(symbolType, -0.5, -0.5, 1, 1, color);\n symbol.z2 = 100;\n symbol.culling = true;\n this.add(symbol);\n } // Symbol may be removed if loop is false\n\n\n if (!symbol) {\n return;\n } // Shadow color is same with color in default\n\n\n symbol.setStyle('shadowColor', color);\n symbol.setStyle(effectModel.getItemStyle(['color']));\n symbol.scaleX = size[0];\n symbol.scaleY = size[1];\n symbol.setColor(color);\n this._symbolType = symbolType;\n this._symbolScale = size;\n\n this._updateEffectAnimation(lineData, effectModel, idx);\n };\n\n EffectLine.prototype._updateEffectAnimation = function (lineData, effectModel, idx) {\n var symbol = this.childAt(1);\n\n if (!symbol) {\n return;\n }\n\n var points = lineData.getItemLayout(idx);\n var period = effectModel.get('period') * 1000;\n var loop = effectModel.get('loop');\n var constantSpeed = effectModel.get('constantSpeed');\n var delayExpr = zrUtil.retrieve(effectModel.get('delay'), function (idx) {\n return idx / lineData.count() * period / 3;\n }); // Ignore when updating\n\n symbol.ignore = true;\n\n this._updateAnimationPoints(symbol, points);\n\n if (constantSpeed > 0) {\n period = this._getLineLength(symbol) / constantSpeed * 1000;\n }\n\n if (period !== this._period || loop !== this._loop) {\n symbol.stopAnimation();\n var delayNum = void 0;\n\n if (zrUtil.isFunction(delayExpr)) {\n delayNum = delayExpr(idx);\n } else {\n delayNum = delayExpr;\n }\n\n if (symbol.__t > 0) {\n delayNum = -period * symbol.__t;\n }\n\n this._animateSymbol(symbol, period, delayNum, loop);\n }\n\n this._period = period;\n this._loop = loop;\n };\n\n EffectLine.prototype._animateSymbol = function (symbol, period, delayNum, loop) {\n if (period > 0) {\n symbol.__t = 0;\n var self_1 = this;\n var animator = symbol.animate('', loop).when(period, {\n __t: 1\n }).delay(delayNum).during(function () {\n self_1._updateSymbolPosition(symbol);\n });\n\n if (!loop) {\n animator.done(function () {\n self_1.remove(symbol);\n });\n }\n\n animator.start();\n }\n };\n\n EffectLine.prototype._getLineLength = function (symbol) {\n // Not so accurate\n return vec2.dist(symbol.__p1, symbol.__cp1) + vec2.dist(symbol.__cp1, symbol.__p2);\n };\n\n EffectLine.prototype._updateAnimationPoints = function (symbol, points) {\n symbol.__p1 = points[0];\n symbol.__p2 = points[1];\n symbol.__cp1 = points[2] || [(points[0][0] + points[1][0]) / 2, (points[0][1] + points[1][1]) / 2];\n };\n\n EffectLine.prototype.updateData = function (lineData, idx, seriesScope) {\n this.childAt(0).updateData(lineData, idx, seriesScope);\n\n this._updateEffectSymbol(lineData, idx);\n };\n\n EffectLine.prototype._updateSymbolPosition = function (symbol) {\n var p1 = symbol.__p1;\n var p2 = symbol.__p2;\n var cp1 = symbol.__cp1;\n var t = symbol.__t;\n var pos = [symbol.x, symbol.y];\n var lastPos = pos.slice();\n var quadraticAt = curveUtil.quadraticAt;\n var quadraticDerivativeAt = curveUtil.quadraticDerivativeAt;\n pos[0] = quadraticAt(p1[0], cp1[0], p2[0], t);\n pos[1] = quadraticAt(p1[1], cp1[1], p2[1], t); // Tangent\n\n var tx = quadraticDerivativeAt(p1[0], cp1[0], p2[0], t);\n var ty = quadraticDerivativeAt(p1[1], cp1[1], p2[1], t);\n symbol.rotation = -Math.atan2(ty, tx) - Math.PI / 2; // enable continuity trail for 'line', 'rect', 'roundRect' symbolType\n\n if (this._symbolType === 'line' || this._symbolType === 'rect' || this._symbolType === 'roundRect') {\n if (symbol.__lastT !== undefined && symbol.__lastT < symbol.__t) {\n symbol.scaleY = vec2.dist(lastPos, pos) * 1.05; // make sure the last segment render within endPoint\n\n if (t === 1) {\n pos[0] = lastPos[0] + (pos[0] - lastPos[0]) / 2;\n pos[1] = lastPos[1] + (pos[1] - lastPos[1]) / 2;\n }\n } else if (symbol.__lastT === 1) {\n // After first loop, symbol.__t does NOT start with 0, so connect p1 to pos directly.\n symbol.scaleY = 2 * vec2.dist(p1, pos);\n } else {\n symbol.scaleY = this._symbolScale[1];\n }\n }\n\n symbol.__lastT = symbol.__t;\n symbol.ignore = false;\n symbol.x = pos[0];\n symbol.y = pos[1];\n };\n\n EffectLine.prototype.updateLayout = function (lineData, idx) {\n this.childAt(0).updateLayout(lineData, idx);\n var effectModel = lineData.getItemModel(idx).getModel('effect');\n\n this._updateEffectAnimation(lineData, effectModel, idx);\n };\n\n return EffectLine;\n}(graphic.Group);\n\nexport default EffectLine;","map":{"version":3,"sources":["D:/Work/WorkSpace/GitWorkSpace/TenShop/resource/ElectronicMall/src/qingge-Market/qingge-vue/node_modules/echarts/lib/chart/helper/EffectLine.js"],"names":["__extends","graphic","Line","zrUtil","createSymbol","vec2","curveUtil","EffectLine","_super","lineData","idx","seriesScope","_this","call","add","createLine","_updateEffectSymbol","prototype","itemModel","getItemModel","effectModel","getModel","size","get","symbolType","isArray","lineStyle","getItemVisual","color","stroke","symbol","childAt","_symbolType","remove","z2","culling","setStyle","getItemStyle","scaleX","scaleY","setColor","_symbolScale","_updateEffectAnimation","points","getItemLayout","period","loop","constantSpeed","delayExpr","retrieve","count","ignore","_updateAnimationPoints","_getLineLength","_period","_loop","stopAnimation","delayNum","isFunction","__t","_animateSymbol","self_1","animator","animate","when","delay","during","_updateSymbolPosition","done","start","dist","__p1","__cp1","__p2","updateData","p1","p2","cp1","t","pos","x","y","lastPos","slice","quadraticAt","quadraticDerivativeAt","tx","ty","rotation","Math","atan2","PI","__lastT","undefined","updateLayout","Group"],"mappings":";;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,SAAT,QAA0B,OAA1B;AACA;AACA;AACA;;AAEA,OAAO,KAAKC,OAAZ,MAAyB,uBAAzB;AACA,OAAOC,IAAP,MAAiB,WAAjB;AACA,OAAO,KAAKC,MAAZ,MAAwB,0BAAxB;AACA,SAASC,YAAT,QAA6B,sBAA7B;AACA,OAAO,KAAKC,IAAZ,MAAsB,4BAAtB;AACA,OAAO,KAAKC,SAAZ,MAA2B,2BAA3B;;AAEA,IAAIC,UAAU;AACd;AACA,UAAUC,MAAV,EAAkB;AAChBR,EAAAA,SAAS,CAACO,UAAD,EAAaC,MAAb,CAAT;;AAEA,WAASD,UAAT,CAAoBE,QAApB,EAA8BC,GAA9B,EAAmCC,WAAnC,EAAgD;AAC9C,QAAIC,KAAK,GAAGJ,MAAM,CAACK,IAAP,CAAY,IAAZ,KAAqB,IAAjC;;AAEAD,IAAAA,KAAK,CAACE,GAAN,CAAUF,KAAK,CAACG,UAAN,CAAiBN,QAAjB,EAA2BC,GAA3B,EAAgCC,WAAhC,CAAV;;AAEAC,IAAAA,KAAK,CAACI,mBAAN,CAA0BP,QAA1B,EAAoCC,GAApC;;AAEA,WAAOE,KAAP;AACD;;AAEDL,EAAAA,UAAU,CAACU,SAAX,CAAqBF,UAArB,GAAkC,UAAUN,QAAV,EAAoBC,GAApB,EAAyBC,WAAzB,EAAsC;AACtE,WAAO,IAAIT,IAAJ,CAASO,QAAT,EAAmBC,GAAnB,EAAwBC,WAAxB,CAAP;AACD,GAFD;;AAIAJ,EAAAA,UAAU,CAACU,S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ACqB,MAAP,GAAgB,KAAhB;AACArB,IAAAA,MAAM,CAACkD,CAAP,GAAWD,GAAG,CAAC,CAAD,CAAd;AACAjD,IAAAA,MAAM,CAACmD,CAAP,GAAWF,GAAG,CAAC,CAAD,CAAd;AACD,GApCD;;AAsCAxE,EAAAA,UAAU,CAACU,SAAX,CAAqB6E,YAArB,GAAoC,UAAUrF,QAAV,EAAoBC,GAApB,EAAyB;AAC3D,SAAKqB,OAAL,CAAa,CAAb,EAAgB+D,YAAhB,CAA6BrF,QAA7B,EAAuCC,GAAvC;AACA,QAAIU,WAAW,GAAGX,QAAQ,CAACU,YAAT,CAAsBT,GAAtB,EAA2BW,QAA3B,CAAoC,QAApC,CAAlB;;AAEA,SAAKqB,sBAAL,CAA4BjC,QAA5B,EAAsCW,WAAtC,EAAmDV,GAAnD;AACD,GALD;;AAOA,SAAOH,UAAP;AACD,CAxLD,CAwLEN,OAAO,CAAC8F,KAxLV,CAFA;;AA4LA,eAAexF,UAAf","sourcesContent":["\r\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n\r\n/**\r\n * AUTO-GENERATED FILE. DO NOT MODIFY.\r\n */\r\n\r\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * Provide effect for line\r\n */\r\n\r\nimport * as graphic from '../../util/graphic.js';\r\nimport Line from './Line.js';\r\nimport * as zrUtil from 'zrender/lib/core/util.js';\r\nimport { createSymbol } from '../../util/symbol.js';\r\nimport * as vec2 from 'zrender/lib/core/vector.js';\r\nimport * as curveUtil from 'zrender/lib/core/curve.js';\r\n\r\nvar EffectLine =\r\n/** @class */\r\nfunction (_super) {\r\n __extends(EffectLine, _super);\r\n\r\n function EffectLine(lineData, idx, seriesScope) {\r\n var _this = _super.call(this) || this;\r\n\r\n _this.add(_this.createLine(lineData, idx, seriesScope));\r\n\r\n _this._updateEffectSymbol(lineData, idx);\r\n\r\n return _this;\r\n }\r\n\r\n EffectLine.prototype.createLine = function (lineData, idx, seriesScope) {\r\n return new Line(lineData, idx, seriesScope);\r\n };\r\n\r\n EffectLine.prototype._updateEffectSymbol = function (lineData, idx) {\r\n var itemModel = lineData.getItemModel(idx);\r\n var effectModel = itemModel.getModel('effect');\r\n var size = effectModel.get('symbolSize');\r\n var symbolType = effectModel.get('symbol');\r\n\r\n if (!zrUtil.isArray(size)) {\r\n size = [size, size];\r\n }\r\n\r\n var lineStyle = lineData.getItemVisual(idx, 'style');\r\n var color = effectModel.get('color') || lineStyle && lineStyle.stroke;\r\n var symbol = this.childAt(1);\r\n\r\n if (this._symbolType !== symbolType) {\r\n // Remove previous\r\n this.remove(symbol);\r\n symbol = createSymbol(symbolType, -0.5, -0.5, 1, 1, color);\r\n symbol.z2 = 100;\r\n symbol.culling = true;\r\n this.add(symbol);\r\n } // Symbol may be removed if loop is false\r\n\r\n\r\n if (!symbol) {\r\n return;\r\n } // Shadow color is same with color in default\r\n\r\n\r\n symbol.setStyle('shadowColor', color);\r\n symbol.setStyle(effectModel.getItemStyle(['color']));\r\n symbol.scaleX = size[0];\r\n symbol.scaleY = size[1];\r\n symbol.setColor(color);\r\n this._symbolType = symbolType;\r\n this._symbolScale = size;\r\n\r\n this._updateEffectAnimation(lineData, effectModel, idx);\r\n };\r\n\r\n EffectLine.prototype._updateEffectAnimation = function (lineData, effectModel, idx) {\r\n var symbol = this.childAt(1);\r\n\r\n if (!symbol) {\r\n return;\r\n }\r\n\r\n var points = lineData.getItemLayout(idx);\r\n var period = effectModel.get('period') * 1000;\r\n var loop = effectModel.get('loop');\r\n var constantSpeed = effectModel.get('constantSpeed');\r\n var delayExpr = zrUtil.retrieve(effectModel.get('delay'), function (idx) {\r\n return idx / lineData.count() * period / 3;\r\n }); // Ignore when updating\r\n\r\n symbol.ignore = true;\r\n\r\n this._updateAnimationPoints(symbol, points);\r\n\r\n if (constantSpeed > 0) {\r\n period = this._getLineLength(symbol) / constantSpeed * 1000;\r\n }\r\n\r\n if (period !== this._period || loop !== this._loop) {\r\n symbol.stopAnimation();\r\n var delayNum = void 0;\r\n\r\n if (zrUtil.isFunction(delayExpr)) {\r\n delayNum = delayExpr(idx);\r\n } else {\r\n delayNum = delayExpr;\r\n }\r\n\r\n if (symbol.__t > 0) {\r\n delayNum = -period * symbol.__t;\r\n }\r\n\r\n this._animateSymbol(symbol, period, delayNum, loop);\r\n }\r\n\r\n this._period = period;\r\n this._loop = loop;\r\n };\r\n\r\n EffectLine.prototype._animateSymbol = function (symbol, period, delayNum, loop) {\r\n if (period > 0) {\r\n symbol.__t = 0;\r\n var self_1 = this;\r\n var animator = symbol.animate('', loop).when(period, {\r\n __t: 1\r\n }).delay(delayNum).during(function () {\r\n self_1._updateSymbolPosition(symbol);\r\n });\r\n\r\n if (!loop) {\r\n animator.done(function () {\r\n self_1.remove(symbol);\r\n });\r\n }\r\n\r\n animator.start();\r\n }\r\n };\r\n\r\n EffectLine.prototype._getLineLength = function (symbol) {\r\n // Not so accurate\r\n return vec2.dist(symbol.__p1, symbol.__cp1) + vec2.dist(symbol.__cp1, symbol.__p2);\r\n };\r\n\r\n EffectLine.prototype._updateAnimationPoints = function (symbol, points) {\r\n symbol.__p1 = points[0];\r\n symbol.__p2 = points[1];\r\n symbol.__cp1 = points[2] || [(points[0][0] + points[1][0]) / 2, (points[0][1] + points[1][1]) / 2];\r\n };\r\n\r\n EffectLine.prototype.updateData = function (lineData, idx, seriesScope) {\r\n this.childAt(0).updateData(lineData, idx, seriesScope);\r\n\r\n this._updateEffectSymbol(lineData, idx);\r\n };\r\n\r\n EffectLine.prototype._updateSymbolPosition = function (symbol) {\r\n var p1 = symbol.__p1;\r\n var p2 = symbol.__p2;\r\n var cp1 = symbol.__cp1;\r\n var t = symbol.__t;\r\n var pos = [symbol.x, symbol.y];\r\n var lastPos = pos.slice();\r\n var quadraticAt = curveUtil.quadraticAt;\r\n var quadraticDerivativeAt = curveUtil.quadraticDerivativeAt;\r\n pos[0] = quadraticAt(p1[0], cp1[0], p2[0], t);\r\n pos[1] = quadraticAt(p1[1], cp1[1], p2[1], t); // Tangent\r\n\r\n var tx = quadraticDerivativeAt(p1[0], cp1[0], p2[0], t);\r\n var ty = quadraticDerivativeAt(p1[1], cp1[1], p2[1], t);\r\n symbol.rotation = -Math.atan2(ty, tx) - Math.PI / 2; // enable continuity trail for 'line', 'rect', 'roundRect' symbolType\r\n\r\n if (this._symbolType === 'line' || this._symbolType === 'rect' || this._symbolType === 'roundRect') {\r\n if (symbol.__lastT !== undefined && symbol.__lastT < symbol.__t) {\r\n symbol.scaleY = vec2.dist(lastPos, pos) * 1.05; // make sure the last segment render within endPoint\r\n\r\n if (t === 1) {\r\n pos[0] = lastPos[0] + (pos[0] - lastPos[0]) / 2;\r\n pos[1] = lastPos[1] + (pos[1] - lastPos[1]) / 2;\r\n }\r\n } else if (symbol.__lastT === 1) {\r\n // After first loop, symbol.__t does NOT start with 0, so connect p1 to pos directly.\r\n symbol.scaleY = 2 * vec2.dist(p1, pos);\r\n } else {\r\n symbol.scaleY = this._symbolScale[1];\r\n }\r\n }\r\n\r\n symbol.__lastT = symbol.__t;\r\n symbol.ignore = false;\r\n symbol.x = pos[0];\r\n symbol.y = pos[1];\r\n };\r\n\r\n EffectLine.prototype.updateLayout = function (lineData, idx) {\r\n this.childAt(0).updateLayout(lineData, idx);\r\n var effectModel = lineData.getItemModel(idx).getModel('effect');\r\n\r\n this._updateEffectAnimation(lineData, effectModel, idx);\r\n };\r\n\r\n return EffectLine;\r\n}(graphic.Group);\r\n\r\nexport default EffectLine;"]},"metadata":{},"sourceType":"module"}