qauMaWeb/node_modules/.cache/babel-loader/090de1b68e23d512d8a83b79461...

1 line
23 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 { separateMorph, combineMorph, morphPath, isCombineMorphing } from 'zrender/lib/tool/morphPath.js';\nimport { Path } from '../util/graphic.js';\nimport { defaults, isArray } from 'zrender/lib/core/util.js';\nimport { getAnimationConfig } from './basicTrasition.js';\nimport { clonePath } from 'zrender/lib/tool/path.js';\n\nfunction isMultiple(elements) {\n return isArray(elements[0]);\n}\n\nfunction prepareMorphBatches(one, many) {\n var batches = [];\n var batchCount = one.length;\n\n for (var i = 0; i < batchCount; i++) {\n batches.push({\n one: one[i],\n many: []\n });\n }\n\n for (var i = 0; i < many.length; i++) {\n var len = many[i].length;\n var k = void 0;\n\n for (k = 0; k < len; k++) {\n batches[k % batchCount].many.push(many[i][k]);\n }\n }\n\n var off = 0; // If one has more paths than each one of many. average them.\n\n for (var i = batchCount - 1; i >= 0; i--) {\n if (!batches[i].many.length) {\n var moveFrom = batches[off].many;\n\n if (moveFrom.length <= 1) {\n // Not enough\n // Start from the first one.\n if (off) {\n off = 0;\n } else {\n return batches;\n }\n }\n\n var len = moveFrom.length;\n var mid = Math.ceil(len / 2);\n batches[i].many = moveFrom.slice(mid, len);\n batches[off].many = moveFrom.slice(0, mid);\n off++;\n }\n }\n\n return batches;\n}\n\nvar pathDividers = {\n clone: function clone(params) {\n var ret = []; // Fitting the alpha\n\n var approxOpacity = 1 - Math.pow(1 - params.path.style.opacity, 1 / params.count);\n\n for (var i = 0; i < params.count; i++) {\n var cloned = clonePath(params.path);\n cloned.setStyle('opacity', approxOpacity);\n ret.push(cloned);\n }\n\n return ret;\n },\n // Use the default divider\n split: null\n};\nexport function applyMorphAnimation(from, to, divideShape, seriesModel, dataIndex, animateOtherProps) {\n if (!from.length || !to.length) {\n return;\n }\n\n var updateAnimationCfg = getAnimationConfig('update', seriesModel, dataIndex);\n\n if (!(updateAnimationCfg && updateAnimationCfg.duration > 0)) {\n return;\n }\n\n var animationDelay = seriesModel.getModel('universalTransition').get('delay');\n var animationCfg = Object.assign({\n // Need to setToFinal so the further calculation based on the style can be correct.\n // Like emphasis color.\n setToFinal: true\n }, updateAnimationCfg);\n var many;\n var one;\n\n if (isMultiple(from)) {\n // manyToOne\n many = from;\n one = to;\n }\n\n if (isMultiple(to)) {\n // oneToMany\n many = to;\n one = from;\n }\n\n function morphOneBatch(batch, fromIsMany, animateIndex, animateCount, forceManyOne) {\n var batchMany = batch.many;\n var batchOne = batch.one;\n\n if (batchMany.length === 1 && !forceManyOne) {\n // Is one to one\n var batchFrom = fromIsMany ? batchMany[0] : batchOne;\n var batchTo = fromIsMany ? batchOne : batchMany[0];\n\n if (isCombineMorphing(batchFrom)) {\n // Keep doing combine animation.\n morphOneBatch({\n many: [batchFrom],\n one: batchTo\n }, true, animateIndex, animateCount, true);\n } else {\n var individualAnimationCfg = animationDelay ? defaults({\n delay: animationDelay(animateIndex, animateCount)\n }, animationCfg) : animationCfg;\n morphPath(batchFrom, batchTo, individualAnimationCfg);\n animateOtherProps(batchFrom, batchTo, batchFrom, batchTo, individualAnimationCfg);\n }\n } else {\n var separateAnimationCfg = defaults({\n dividePath: pathDividers[divideShape],\n individualDelay: animationDelay && function (idx, count, fromPath, toPath) {\n return animationDelay(idx + animateIndex, animateCount);\n }\n }, animationCfg);\n\n var _a = fromIsMany ? combineMorph(batchMany, batchOne, separateAnimationCfg) : separateMorph(batchOne, batchMany, separateAnimationCfg),\n fromIndividuals = _a.fromIndividuals,\n toIndividuals = _a.toIndividuals;\n\n var count = fromIndividuals.length;\n\n for (var k = 0; k < count; k++) {\n var individualAnimationCfg = animationDelay ? defaults({\n delay: animationDelay(k, count)\n }, animationCfg) : animationCfg;\n animateOtherProps(fromIndividuals[k], toIndividuals[k], fromIsMany ? batchMany[k] : batch.one, fromIsMany ? batch.one : batchMany[k], individualAnimationCfg);\n }\n }\n }\n\n var fromIsMany = many ? many === from // Is one to one. If the path number not match. also needs do merge and separate morphing.\n : from.length > to.length;\n var morphBatches = many ? prepareMorphBatches(one, many) : prepareMorphBatches(fromIsMany ? to : from, [fromIsMany ? from : to]);\n var animateCount = 0;\n\n for (var i = 0; i < morphBatches.length; i++) {\n animateCount += morphBatches[i].many.length;\n }\n\n var animateIndex = 0;\n\n for (var i = 0; i < morphBatches.length; i++) {\n morphOneBatch(morphBatches[i], fromIsMany, animateIndex, animateCount);\n animateIndex += morphBatches[i].many.length;\n }\n}\nexport function getPathList(elements) {\n if (!elements) {\n return [];\n }\n\n if (isArray(elements)) {\n var pathList_1 = [];\n\n for (var i = 0; i < elements.length; i++) {\n pathList_1.push(getPathList(elements[i]));\n }\n\n return pathList_1;\n }\n\n var pathList = [];\n elements.traverse(function (el) {\n if (el instanceof Path && !el.disableMorphing && !el.invisible && !el.ignore) {\n pathList.push(el);\n }\n });\n return pathList;\n}","map":{"version":3,"sources":["D:/Work/WorkSpace/GitWorkSpace/TenShop/resource/ElectronicMall/src/qingge-Market/qingge-vue/node_modules/echarts/lib/animation/morphTransitionHelper.js"],"names":["separateMorph","combineMorph","morphPath","isCombineMorphing","Path","defaults","isArray","getAnimationConfig","clonePath","isMultiple","elements","prepareMorphBatches","one","many","batches","batchCount","length","i","push","len","k","off","moveFrom","mid","Math","ceil","slice","pathDividers","clone","params","ret","approxOpacity","pow","path","style","opacity","count","cloned","setStyle","split","applyMorphAnimation","from","to","divideShape","seriesModel","dataIndex","animateOtherProps","updateAnimationCfg","duration","animationDelay","getModel","get","animationCfg","Object","assign","setToFinal","morphOneBatch","batch","fromIsMany","animateIndex","animateCount","forceManyOne","batchMany","batchOne","batchFrom","batchTo","individualAnimationCfg","delay","separateAnimationCfg","dividePath","individualDelay","idx","fromPath","toPath","_a","fromIndividuals","toIndividuals","morphBatches","getPathList","pathList_1","pathList","traverse","el","disableMorphing","invisible","ignore"],"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,aAAT,EAAwBC,YAAxB,EAAsCC,SAAtC,EAAiDC,iBAAjD,QAA0E,+BAA1E;AACA,SAASC,IAAT,QAAqB,oBAArB;AACA,SAASC,QAAT,EAAmBC,OAAnB,QAAkC,0BAAlC;AACA,SAASC,kBAAT,QAAmC,qBAAnC;AACA,SAASC,SAAT,QAA0B,0BAA1B;;AAEA,SAASC,UAAT,CAAoB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AAG,CAAnB;;AAEA,OAAK,IAAI1C,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAG4D,YAAY,CAAC7D,MAAjC,EAAyCC,CAAC,EAA1C,EAA8C;AAC5CuC,IAAAA,aAAa,CAACqB,YAAY,CAAC5D,CAAD,CAAb,EAAkByC,UAAlB,EAA8BC,YAA9B,EAA4CC,YAA5C,CAAb;AACAD,IAAAA,YAAY,IAAIkB,YAAY,CAAC5D,CAAD,CAAZ,CAAgBJ,IAAhB,CAAqBG,MAArC;AACD;AACF;AACD,OAAO,SAAS8D,WAAT,CAAqBpE,QAArB,EAA+B;AACpC,MAAI,CAACA,QAAL,EAAe;AACb,WAAO,EAAP;AACD;;AAED,MAAIJ,OAAO,CAACI,QAAD,CAAX,EAAuB;AACrB,QAAIqE,UAAU,GAAG,EAAjB;;AAEA,SAAK,IAAI9D,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAGP,QAAQ,CAACM,MAA7B,EAAqCC,CAAC,EAAtC,EAA0C;AACxC8D,MAAAA,UAAU,CAAC7D,IAAX,CAAgB4D,WAAW,CAACpE,QAAQ,CAACO,CAAD,CAAT,CAA3B;AACD;;AAED,WAAO8D,UAAP;AACD;;AAED,MAAIC,QAAQ,GAAG,EAAf;AACAtE,EAAAA,QAAQ,CAACuE,QAAT,CAAkB,UAAUC,EAAV,EAAc;AAC9B,QAAIA,EAAE,YAAY9E,IAAd,IAAsB,CAAC8E,EAAE,CAACC,eAA1B,IAA6C,CAACD,EAAE,CAACE,SAAjD,IAA8D,CAACF,EAAE,CAACG,MAAtE,EAA8E;AAC5EL,MAAAA,QAAQ,CAAC9D,IAAT,CAAcgE,EAAd;AACD;AACF,GAJD;AAKA,SAAOF,QAAP;AACD","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 { separateMorph, combineMorph, morphPath, isCombineMorphing } from 'zrender/lib/tool/morphPath.js';\r\nimport { Path } from '../util/graphic.js';\r\nimport { defaults, isArray } from 'zrender/lib/core/util.js';\r\nimport { getAnimationConfig } from './basicTrasition.js';\r\nimport { clonePath } from 'zrender/lib/tool/path.js';\r\n\r\nfunction isMultiple(elements) {\r\n return isArray(elements[0]);\r\n}\r\n\r\nfunction prepareMorphBatches(one, many) {\r\n var batches = [];\r\n var batchCount = one.length;\r\n\r\n for (var i = 0; i < batchCount; i++) {\r\n batches.push({\r\n one: one[i],\r\n many: []\r\n });\r\n }\r\n\r\n for (var i = 0; i < many.length; i++) {\r\n var len = many[i].length;\r\n var k = void 0;\r\n\r\n for (k = 0; k < len; k++) {\r\n batches[k % batchCount].many.push(many[i][k]);\r\n }\r\n }\r\n\r\n var off = 0; // If one has more paths than each one of many. average them.\r\n\r\n for (var i = batchCount - 1; i >= 0; i--) {\r\n if (!batches[i].many.length) {\r\n var moveFrom = batches[off].many;\r\n\r\n if (moveFrom.length <= 1) {\r\n // Not enough\r\n // Start from the first one.\r\n if (off) {\r\n off = 0;\r\n } else {\r\n return batches;\r\n }\r\n }\r\n\r\n var len = moveFrom.length;\r\n var mid = Math.ceil(len / 2);\r\n batches[i].many = moveFrom.slice(mid, len);\r\n batches[off].many = moveFrom.slice(0, mid);\r\n off++;\r\n }\r\n }\r\n\r\n return batches;\r\n}\r\n\r\nvar pathDividers = {\r\n clone: function (params) {\r\n var ret = []; // Fitting the alpha\r\n\r\n var approxOpacity = 1 - Math.pow(1 - params.path.style.opacity, 1 / params.count);\r\n\r\n for (var i = 0; i < params.count; i++) {\r\n var cloned = clonePath(params.path);\r\n cloned.setStyle('opacity', approxOpacity);\r\n ret.push(cloned);\r\n }\r\n\r\n return ret;\r\n },\r\n // Use the default divider\r\n split: null\r\n};\r\nexport function applyMorphAnimation(from, to, divideShape, seriesModel, dataIndex, animateOtherProps) {\r\n if (!from.length || !to.length) {\r\n return;\r\n }\r\n\r\n var updateAnimationCfg = getAnimationConfig('update', seriesModel, dataIndex);\r\n\r\n if (!(updateAnimationCfg && updateAnimationCfg.duration > 0)) {\r\n return;\r\n }\r\n\r\n var animationDelay = seriesModel.getModel('universalTransition').get('delay');\r\n var animationCfg = Object.assign({\r\n // Need to setToFinal so the further calculation based on the style can be correct.\r\n // Like emphasis color.\r\n setToFinal: true\r\n }, updateAnimationCfg);\r\n var many;\r\n var one;\r\n\r\n if (isMultiple(from)) {\r\n // manyToOne\r\n many = from;\r\n one = to;\r\n }\r\n\r\n if (isMultiple(to)) {\r\n // oneToMany\r\n many = to;\r\n one = from;\r\n }\r\n\r\n function morphOneBatch(batch, fromIsMany, animateIndex, animateCount, forceManyOne) {\r\n var batchMany = batch.many;\r\n var batchOne = batch.one;\r\n\r\n if (batchMany.length === 1 && !forceManyOne) {\r\n // Is one to one\r\n var batchFrom = fromIsMany ? batchMany[0] : batchOne;\r\n var batchTo = fromIsMany ? batchOne : batchMany[0];\r\n\r\n if (isCombineMorphing(batchFrom)) {\r\n // Keep doing combine animation.\r\n morphOneBatch({\r\n many: [batchFrom],\r\n one: batchTo\r\n }, true, animateIndex, animateCount, true);\r\n } else {\r\n var individualAnimationCfg = animationDelay ? defaults({\r\n delay: animationDelay(animateIndex, animateCount)\r\n }, animationCfg) : animationCfg;\r\n morphPath(batchFrom, batchTo, individualAnimationCfg);\r\n animateOtherProps(batchFrom, batchTo, batchFrom, batchTo, individualAnimationCfg);\r\n }\r\n } else {\r\n var separateAnimationCfg = defaults({\r\n dividePath: pathDividers[divideShape],\r\n individualDelay: animationDelay && function (idx, count, fromPath, toPath) {\r\n return animationDelay(idx + animateIndex, animateCount);\r\n }\r\n }, animationCfg);\r\n\r\n var _a = fromIsMany ? combineMorph(batchMany, batchOne, separateAnimationCfg) : separateMorph(batchOne, batchMany, separateAnimationCfg),\r\n fromIndividuals = _a.fromIndividuals,\r\n toIndividuals = _a.toIndividuals;\r\n\r\n var count = fromIndividuals.length;\r\n\r\n for (var k = 0; k < count; k++) {\r\n var individualAnimationCfg = animationDelay ? defaults({\r\n delay: animationDelay(k, count)\r\n }, animationCfg) : animationCfg;\r\n animateOtherProps(fromIndividuals[k], toIndividuals[k], fromIsMany ? batchMany[k] : batch.one, fromIsMany ? batch.one : batchMany[k], individualAnimationCfg);\r\n }\r\n }\r\n }\r\n\r\n var fromIsMany = many ? many === from // Is one to one. If the path number not match. also needs do merge and separate morphing.\r\n : from.length > to.length;\r\n var morphBatches = many ? prepareMorphBatches(one, many) : prepareMorphBatches(fromIsMany ? to : from, [fromIsMany ? from : to]);\r\n var animateCount = 0;\r\n\r\n for (var i = 0; i < morphBatches.length; i++) {\r\n animateCount += morphBatches[i].many.length;\r\n }\r\n\r\n var animateIndex = 0;\r\n\r\n for (var i = 0; i < morphBatches.length; i++) {\r\n morphOneBatch(morphBatches[i], fromIsMany, animateIndex, animateCount);\r\n animateIndex += morphBatches[i].many.length;\r\n }\r\n}\r\nexport function getPathList(elements) {\r\n if (!elements) {\r\n return [];\r\n }\r\n\r\n if (isArray(elements)) {\r\n var pathList_1 = [];\r\n\r\n for (var i = 0; i < elements.length; i++) {\r\n pathList_1.push(getPathList(elements[i]));\r\n }\r\n\r\n return pathList_1;\r\n }\r\n\r\n var pathList = [];\r\n elements.traverse(function (el) {\r\n if (el instanceof Path && !el.disableMorphing && !el.invisible && !el.ignore) {\r\n pathList.push(el);\r\n }\r\n });\r\n return pathList;\r\n}"]},"metadata":{},"sourceType":"module"}