qauMaWeb/node_modules/.cache/babel-loader/66d20b9ded5db6d9fc08b49b5d9...

1 line
28 KiB
JSON

{"ast":null,"code":"import \"core-js/modules/es.array.slice.js\";\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as numberUtil from '../util/number.js';\nimport * as formatUtil from '../util/format.js';\nimport Scale from './Scale.js';\nimport * as helper from './helper.js';\nvar roundNumber = numberUtil.round;\n\nvar IntervalScale =\n/** @class */\nfunction (_super) {\n __extends(IntervalScale, _super);\n\n function IntervalScale() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = 'interval'; // Step is calculated in adjustExtent.\n\n _this._interval = 0;\n _this._intervalPrecision = 2;\n return _this;\n }\n\n IntervalScale.prototype.parse = function (val) {\n return val;\n };\n\n IntervalScale.prototype.contain = function (val) {\n return helper.contain(val, this._extent);\n };\n\n IntervalScale.prototype.normalize = function (val) {\n return helper.normalize(val, this._extent);\n };\n\n IntervalScale.prototype.scale = function (val) {\n return helper.scale(val, this._extent);\n };\n\n IntervalScale.prototype.setExtent = function (start, end) {\n var thisExtent = this._extent; // start,end may be a Number like '25',so...\n\n if (!isNaN(start)) {\n thisExtent[0] = parseFloat(start);\n }\n\n if (!isNaN(end)) {\n thisExtent[1] = parseFloat(end);\n }\n };\n\n IntervalScale.prototype.unionExtent = function (other) {\n var extent = this._extent;\n other[0] < extent[0] && (extent[0] = other[0]);\n other[1] > extent[1] && (extent[1] = other[1]); // unionExtent may called by it's sub classes\n\n this.setExtent(extent[0], extent[1]);\n };\n\n IntervalScale.prototype.getInterval = function () {\n return this._interval;\n };\n\n IntervalScale.prototype.setInterval = function (interval) {\n this._interval = interval; // Dropped auto calculated niceExtent and use user-set extent.\n // We assume user wants to set both interval, min, max to get a better result.\n\n this._niceExtent = this._extent.slice();\n this._intervalPrecision = helper.getIntervalPrecision(interval);\n };\n /**\n * @param expandToNicedExtent Whether expand the ticks to niced extent.\n */\n\n\n IntervalScale.prototype.getTicks = function (expandToNicedExtent) {\n var interval = this._interval;\n var extent = this._extent;\n var niceTickExtent = this._niceExtent;\n var intervalPrecision = this._intervalPrecision;\n var ticks = []; // If interval is 0, return [];\n\n if (!interval) {\n return ticks;\n } // Consider this case: using dataZoom toolbox, zoom and zoom.\n\n\n var safeLimit = 10000;\n\n if (extent[0] < niceTickExtent[0]) {\n if (expandToNicedExtent) {\n ticks.push({\n value: roundNumber(niceTickExtent[0] - interval, intervalPrecision)\n });\n } else {\n ticks.push({\n value: extent[0]\n });\n }\n }\n\n var tick = niceTickExtent[0];\n\n while (tick <= niceTickExtent[1]) {\n ticks.push({\n value: tick\n }); // Avoid rounding error\n\n tick = roundNumber(tick + interval, intervalPrecision);\n\n if (tick === ticks[ticks.length - 1].value) {\n // Consider out of safe float point, e.g.,\n // -3711126.9907707 + 2e-10 === -3711126.9907707\n break;\n }\n\n if (ticks.length > safeLimit) {\n return [];\n }\n } // Consider this case: the last item of ticks is smaller\n // than niceTickExtent[1] and niceTickExtent[1] === extent[1].\n\n\n var lastNiceTick = ticks.length ? ticks[ticks.length - 1].value : niceTickExtent[1];\n\n if (extent[1] > lastNiceTick) {\n if (expandToNicedExtent) {\n ticks.push({\n value: roundNumber(lastNiceTick + interval, intervalPrecision)\n });\n } else {\n ticks.push({\n value: extent[1]\n });\n }\n }\n\n return ticks;\n };\n\n IntervalScale.prototype.getMinorTicks = function (splitNumber) {\n var ticks = this.getTicks(true);\n var minorTicks = [];\n var extent = this.getExtent();\n\n for (var i = 1; i < ticks.length; i++) {\n var nextTick = ticks[i];\n var prevTick = ticks[i - 1];\n var count = 0;\n var minorTicksGroup = [];\n var interval = nextTick.value - prevTick.value;\n var minorInterval = interval / splitNumber;\n\n while (count < splitNumber - 1) {\n var minorTick = roundNumber(prevTick.value + (count + 1) * minorInterval); // For the first and last interval. The count may be less than splitNumber.\n\n if (minorTick > extent[0] && minorTick < extent[1]) {\n minorTicksGroup.push(minorTick);\n }\n\n count++;\n }\n\n minorTicks.push(minorTicksGroup);\n }\n\n return minorTicks;\n };\n /**\n * @param opt.precision If 'auto', use nice presision.\n * @param opt.pad returns 1.50 but not 1.5 if precision is 2.\n */\n\n\n IntervalScale.prototype.getLabel = function (data, opt) {\n if (data == null) {\n return '';\n }\n\n var precision = opt && opt.precision;\n\n if (precision == null) {\n precision = numberUtil.getPrecision(data.value) || 0;\n } else if (precision === 'auto') {\n // Should be more precise then tick.\n precision = this._intervalPrecision;\n } // (1) If `precision` is set, 12.005 should be display as '12.00500'.\n // (2) Use roundNumber (toFixed) to avoid scientific notation like '3.5e-7'.\n\n\n var dataNum = roundNumber(data.value, precision, true);\n return formatUtil.addCommas(dataNum);\n };\n /**\n * @param splitNumber By default `5`.\n */\n\n\n IntervalScale.prototype.calcNiceTicks = function (splitNumber, minInterval, maxInterval) {\n splitNumber = splitNumber || 5;\n var extent = this._extent;\n var span = extent[1] - extent[0];\n\n if (!isFinite(span)) {\n return;\n } // User may set axis min 0 and data are all negative\n // FIXME If it needs to reverse ?\n\n\n if (span < 0) {\n span = -span;\n extent.reverse();\n }\n\n var result = helper.intervalScaleNiceTicks(extent, splitNumber, minInterval, maxInterval);\n this._intervalPrecision = result.intervalPrecision;\n this._interval = result.interval;\n this._niceExtent = result.niceTickExtent;\n };\n\n IntervalScale.prototype.calcNiceExtent = function (opt) {\n var extent = this._extent; // If extent start and end are same, expand them\n\n if (extent[0] === extent[1]) {\n if (extent[0] !== 0) {\n // Expand extent\n // Note that extents can be both negative. See #13154\n var expandSize = Math.abs(extent[0]); // In the fowllowing case\n // Axis has been fixed max 100\n // Plus data are all 100 and axis extent are [100, 100].\n // Extend to the both side will cause expanded max is larger than fixed max.\n // So only expand to the smaller side.\n\n if (!opt.fixMax) {\n extent[1] += expandSize / 2;\n extent[0] -= expandSize / 2;\n } else {\n extent[0] -= expandSize / 2;\n }\n } else {\n extent[1] = 1;\n }\n }\n\n var span = extent[1] - extent[0]; // If there are no data and extent are [Infinity, -Infinity]\n\n if (!isFinite(span)) {\n extent[0] = 0;\n extent[1] = 1;\n }\n\n this.calcNiceTicks(opt.splitNumber, opt.minInterval, opt.maxInterval); // let extent = this._extent;\n\n var interval = this._interval;\n\n if (!opt.fixMin) {\n extent[0] = roundNumber(Math.floor(extent[0] / interval) * interval);\n }\n\n if (!opt.fixMax) {\n extent[1] = roundNumber(Math.ceil(extent[1] / interval) * interval);\n }\n };\n\n IntervalScale.prototype.setNiceExtent = function (min, max) {\n this._niceExtent = [min, max];\n };\n\n IntervalScale.type = 'interval';\n return IntervalScale;\n}(Scale);\n\nScale.registerClass(IntervalScale);\nexport default IntervalScale;","map":{"version":3,"sources":["D:/Work/WorkSpace/GitWorkSpace/TenShop/resource/ElectronicMall/src啊/ElectronicMallVue/node_modules/echarts/lib/scale/Interval.js"],"names":["__extends","numberUtil","formatUtil","Scale","helper","roundNumber","round","IntervalScale","_super","_this","apply","arguments","type","_interval","_intervalPrecision","prototype","parse","val","contain","_extent","normalize","scale","setExtent","start","end","thisExtent","isNaN","parseFloat","unionExtent","other","extent","getInterval","setInterval","interval","_niceExtent","slice","getIntervalPrecision","getTicks","expandToNicedExtent","niceTickExtent","intervalPrecision","ticks","safeLimit","push","value","tick","length","lastNiceTick","getMinorTicks","splitNumber","minorTicks","getExtent","i","nextTick","prevTick","count","minorTicksGroup","minorInterval","minorTick","getLabel","data","opt","precision","getPrecision","dataNum","addCommas","calcNiceTicks","minInterval","maxInterval","span","isFinite","reverse","result","intervalScaleNiceTicks","calcNiceExtent","expandSize","Math","abs","fixMax","fixMin","floor","ceil","setNiceExtent","min","max","registerClass"],"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,OAAO,KAAKC,UAAZ,MAA4B,mBAA5B;AACA,OAAO,KAAKC,UAAZ,MAA4B,mBAA5B;AACA,OAAOC,KAAP,MAAkB,YAAlB;AACA,OAAO,KAAKC,MAAZ,MAAwB,aAAxB;AACA,IAAIC,WAAW,GAAGJ,UAAU,CAACK,KAA7B;;AAEA,IAAIC,aAAa;AACjB;AACA,UAAUC,MAAV,EAAkB;AAChBR,EAAAA,SAAS,CAACO,aAAD,EAAgBC,MAAhB,CAAT;;AAEA,WAASD,aAAT,GAAyB;AACvB,QAAIE,KAAK,GAAGD,MAAM,KAAK,IAAX,IAAmBA,MAAM,CAACE,KAAP,CAAa,IAAb,EAAmBC,SAAnB,CAAnB,IAAoD,IAAhE;;AAEAF,IAAAA,KAAK,CAACG,IAAN,GAAa,UAAb,CAHuB,CAGE;;AAEzBH,I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SAAKoC,aAAL,CAAmBL,GAAG,CAACZ,WAAvB,EAAoCY,GAAG,CAACM,WAAxC,EAAqDN,GAAG,CAACO,WAAzD,EA/BsD,CA+BiB;;AAEvE,QAAInC,QAAQ,GAAG,KAAKpB,SAApB;;AAEA,QAAI,CAACgD,GAAG,CAACkB,MAAT,EAAiB;AACfjD,MAAAA,MAAM,CAAC,CAAD,CAAN,GAAYzB,WAAW,CAACuE,IAAI,CAACI,KAAL,CAAWlD,MAAM,CAAC,CAAD,CAAN,GAAYG,QAAvB,IAAmCA,QAApC,CAAvB;AACD;;AAED,QAAI,CAAC4B,GAAG,CAACiB,MAAT,EAAiB;AACfhD,MAAAA,MAAM,CAAC,CAAD,CAAN,GAAYzB,WAAW,CAACuE,IAAI,CAACK,IAAL,CAAUnD,MAAM,CAAC,CAAD,CAAN,GAAYG,QAAtB,IAAkCA,QAAnC,CAAvB;AACD;AACF,GA1CD;;AA4CA1B,EAAAA,aAAa,CAACQ,SAAd,CAAwBmE,aAAxB,GAAwC,UAAUC,GAAV,EAAeC,GAAf,EAAoB;AAC1D,SAAKlD,WAAL,GAAmB,CAACiD,GAAD,EAAMC,GAAN,CAAnB;AACD,GAFD;;AAIA7E,EAAAA,aAAa,CAACK,IAAd,GAAqB,UAArB;AACA,SAAOL,aAAP;AACD,CApQD,CAoQEJ,KApQF,CAFA;;AAwQAA,KAAK,CAACkF,aAAN,CAAoB9E,aAApB;AACA,eAAeA,aAAf","sourcesContent":["\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as numberUtil from '../util/number.js';\nimport * as formatUtil from '../util/format.js';\nimport Scale from './Scale.js';\nimport * as helper from './helper.js';\nvar roundNumber = numberUtil.round;\n\nvar IntervalScale =\n/** @class */\nfunction (_super) {\n __extends(IntervalScale, _super);\n\n function IntervalScale() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = 'interval'; // Step is calculated in adjustExtent.\n\n _this._interval = 0;\n _this._intervalPrecision = 2;\n return _this;\n }\n\n IntervalScale.prototype.parse = function (val) {\n return val;\n };\n\n IntervalScale.prototype.contain = function (val) {\n return helper.contain(val, this._extent);\n };\n\n IntervalScale.prototype.normalize = function (val) {\n return helper.normalize(val, this._extent);\n };\n\n IntervalScale.prototype.scale = function (val) {\n return helper.scale(val, this._extent);\n };\n\n IntervalScale.prototype.setExtent = function (start, end) {\n var thisExtent = this._extent; // start,end may be a Number like '25',so...\n\n if (!isNaN(start)) {\n thisExtent[0] = parseFloat(start);\n }\n\n if (!isNaN(end)) {\n thisExtent[1] = parseFloat(end);\n }\n };\n\n IntervalScale.prototype.unionExtent = function (other) {\n var extent = this._extent;\n other[0] < extent[0] && (extent[0] = other[0]);\n other[1] > extent[1] && (extent[1] = other[1]); // unionExtent may called by it's sub classes\n\n this.setExtent(extent[0], extent[1]);\n };\n\n IntervalScale.prototype.getInterval = function () {\n return this._interval;\n };\n\n IntervalScale.prototype.setInterval = function (interval) {\n this._interval = interval; // Dropped auto calculated niceExtent and use user-set extent.\n // We assume user wants to set both interval, min, max to get a better result.\n\n this._niceExtent = this._extent.slice();\n this._intervalPrecision = helper.getIntervalPrecision(interval);\n };\n /**\n * @param expandToNicedExtent Whether expand the ticks to niced extent.\n */\n\n\n IntervalScale.prototype.getTicks = function (expandToNicedExtent) {\n var interval = this._interval;\n var extent = this._extent;\n var niceTickExtent = this._niceExtent;\n var intervalPrecision = this._intervalPrecision;\n var ticks = []; // If interval is 0, return [];\n\n if (!interval) {\n return ticks;\n } // Consider this case: using dataZoom toolbox, zoom and zoom.\n\n\n var safeLimit = 10000;\n\n if (extent[0] < niceTickExtent[0]) {\n if (expandToNicedExtent) {\n ticks.push({\n value: roundNumber(niceTickExtent[0] - interval, intervalPrecision)\n });\n } else {\n ticks.push({\n value: extent[0]\n });\n }\n }\n\n var tick = niceTickExtent[0];\n\n while (tick <= niceTickExtent[1]) {\n ticks.push({\n value: tick\n }); // Avoid rounding error\n\n tick = roundNumber(tick + interval, intervalPrecision);\n\n if (tick === ticks[ticks.length - 1].value) {\n // Consider out of safe float point, e.g.,\n // -3711126.9907707 + 2e-10 === -3711126.9907707\n break;\n }\n\n if (ticks.length > safeLimit) {\n return [];\n }\n } // Consider this case: the last item of ticks is smaller\n // than niceTickExtent[1] and niceTickExtent[1] === extent[1].\n\n\n var lastNiceTick = ticks.length ? ticks[ticks.length - 1].value : niceTickExtent[1];\n\n if (extent[1] > lastNiceTick) {\n if (expandToNicedExtent) {\n ticks.push({\n value: roundNumber(lastNiceTick + interval, intervalPrecision)\n });\n } else {\n ticks.push({\n value: extent[1]\n });\n }\n }\n\n return ticks;\n };\n\n IntervalScale.prototype.getMinorTicks = function (splitNumber) {\n var ticks = this.getTicks(true);\n var minorTicks = [];\n var extent = this.getExtent();\n\n for (var i = 1; i < ticks.length; i++) {\n var nextTick = ticks[i];\n var prevTick = ticks[i - 1];\n var count = 0;\n var minorTicksGroup = [];\n var interval = nextTick.value - prevTick.value;\n var minorInterval = interval / splitNumber;\n\n while (count < splitNumber - 1) {\n var minorTick = roundNumber(prevTick.value + (count + 1) * minorInterval); // For the first and last interval. The count may be less than splitNumber.\n\n if (minorTick > extent[0] && minorTick < extent[1]) {\n minorTicksGroup.push(minorTick);\n }\n\n count++;\n }\n\n minorTicks.push(minorTicksGroup);\n }\n\n return minorTicks;\n };\n /**\n * @param opt.precision If 'auto', use nice presision.\n * @param opt.pad returns 1.50 but not 1.5 if precision is 2.\n */\n\n\n IntervalScale.prototype.getLabel = function (data, opt) {\n if (data == null) {\n return '';\n }\n\n var precision = opt && opt.precision;\n\n if (precision == null) {\n precision = numberUtil.getPrecision(data.value) || 0;\n } else if (precision === 'auto') {\n // Should be more precise then tick.\n precision = this._intervalPrecision;\n } // (1) If `precision` is set, 12.005 should be display as '12.00500'.\n // (2) Use roundNumber (toFixed) to avoid scientific notation like '3.5e-7'.\n\n\n var dataNum = roundNumber(data.value, precision, true);\n return formatUtil.addCommas(dataNum);\n };\n /**\n * @param splitNumber By default `5`.\n */\n\n\n IntervalScale.prototype.calcNiceTicks = function (splitNumber, minInterval, maxInterval) {\n splitNumber = splitNumber || 5;\n var extent = this._extent;\n var span = extent[1] - extent[0];\n\n if (!isFinite(span)) {\n return;\n } // User may set axis min 0 and data are all negative\n // FIXME If it needs to reverse ?\n\n\n if (span < 0) {\n span = -span;\n extent.reverse();\n }\n\n var result = helper.intervalScaleNiceTicks(extent, splitNumber, minInterval, maxInterval);\n this._intervalPrecision = result.intervalPrecision;\n this._interval = result.interval;\n this._niceExtent = result.niceTickExtent;\n };\n\n IntervalScale.prototype.calcNiceExtent = function (opt) {\n var extent = this._extent; // If extent start and end are same, expand them\n\n if (extent[0] === extent[1]) {\n if (extent[0] !== 0) {\n // Expand extent\n // Note that extents can be both negative. See #13154\n var expandSize = Math.abs(extent[0]); // In the fowllowing case\n // Axis has been fixed max 100\n // Plus data are all 100 and axis extent are [100, 100].\n // Extend to the both side will cause expanded max is larger than fixed max.\n // So only expand to the smaller side.\n\n if (!opt.fixMax) {\n extent[1] += expandSize / 2;\n extent[0] -= expandSize / 2;\n } else {\n extent[0] -= expandSize / 2;\n }\n } else {\n extent[1] = 1;\n }\n }\n\n var span = extent[1] - extent[0]; // If there are no data and extent are [Infinity, -Infinity]\n\n if (!isFinite(span)) {\n extent[0] = 0;\n extent[1] = 1;\n }\n\n this.calcNiceTicks(opt.splitNumber, opt.minInterval, opt.maxInterval); // let extent = this._extent;\n\n var interval = this._interval;\n\n if (!opt.fixMin) {\n extent[0] = roundNumber(Math.floor(extent[0] / interval) * interval);\n }\n\n if (!opt.fixMax) {\n extent[1] = roundNumber(Math.ceil(extent[1] / interval) * interval);\n }\n };\n\n IntervalScale.prototype.setNiceExtent = function (min, max) {\n this._niceExtent = [min, max];\n };\n\n IntervalScale.type = 'interval';\n return IntervalScale;\n}(Scale);\n\nScale.registerClass(IntervalScale);\nexport default IntervalScale;"]},"metadata":{},"sourceType":"module"}