qauMaWeb/node_modules/.cache/babel-loader/9eb40c4d847baa38044214da5e7...

1 line
13 KiB
JSON

{"ast":null,"code":"/*\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 { isFunction, isString } from 'zrender/lib/core/util.js';\nvar samplers = {\n average: function average(frame) {\n var sum = 0;\n var count = 0;\n\n for (var i = 0; i < frame.length; i++) {\n if (!isNaN(frame[i])) {\n sum += frame[i];\n count++;\n }\n } // Return NaN if count is 0\n\n\n return count === 0 ? NaN : sum / count;\n },\n sum: function sum(frame) {\n var sum = 0;\n\n for (var i = 0; i < frame.length; i++) {\n // Ignore NaN\n sum += frame[i] || 0;\n }\n\n return sum;\n },\n max: function max(frame) {\n var max = -Infinity;\n\n for (var i = 0; i < frame.length; i++) {\n frame[i] > max && (max = frame[i]);\n } // NaN will cause illegal axis extent.\n\n\n return isFinite(max) ? max : NaN;\n },\n min: function min(frame) {\n var min = Infinity;\n\n for (var i = 0; i < frame.length; i++) {\n frame[i] < min && (min = frame[i]);\n } // NaN will cause illegal axis extent.\n\n\n return isFinite(min) ? min : NaN;\n },\n // TODO\n // Median\n nearest: function nearest(frame) {\n return frame[0];\n }\n};\n\nvar indexSampler = function indexSampler(frame) {\n return Math.round(frame.length / 2);\n};\n\nexport default function dataSample(seriesType) {\n return {\n seriesType: seriesType,\n // FIXME:TS never used, so comment it\n // modifyOutputEnd: true,\n reset: function reset(seriesModel, ecModel, api) {\n var data = seriesModel.getData();\n var sampling = seriesModel.get('sampling');\n var coordSys = seriesModel.coordinateSystem;\n var count = data.count(); // Only cartesian2d support down sampling. Disable it when there is few data.\n\n if (count > 10 && coordSys.type === 'cartesian2d' && sampling) {\n var baseAxis = coordSys.getBaseAxis();\n var valueAxis = coordSys.getOtherAxis(baseAxis);\n var extent = baseAxis.getExtent();\n var dpr = api.getDevicePixelRatio(); // Coordinste system has been resized\n\n var size = Math.abs(extent[1] - extent[0]) * (dpr || 1);\n var rate = Math.round(count / size);\n\n if (isFinite(rate) && rate > 1) {\n if (sampling === 'lttb') {\n seriesModel.setData(data.lttbDownSample(data.mapDimension(valueAxis.dim), 1 / rate));\n }\n\n var sampler = void 0;\n\n if (isString(sampling)) {\n sampler = samplers[sampling];\n } else if (isFunction(sampling)) {\n sampler = sampling;\n }\n\n if (sampler) {\n // Only support sample the first dim mapped from value axis.\n seriesModel.setData(data.downSample(data.mapDimension(valueAxis.dim), 1 / rate, sampler, indexSampler));\n }\n }\n }\n }\n };\n}","map":{"version":3,"sources":["D:/Work/WorkSpace/GitWorkSpace/TenShop/resource/ElectronicMall/src/ElectronicMallVue/node_modules/echarts/lib/processor/dataSample.js"],"names":["isFunction","isString","samplers","average","frame","sum","count","i","length","isNaN","NaN","max","Infinity","isFinite","min","nearest","indexSampler","Math","round","dataSample","seriesType","reset","seriesModel","ecModel","api","data","getData","sampling","get","coordSys","coordinateSystem","type","baseAxis","getBaseAxis","valueAxis","getOtherAxis","extent","getExtent","dpr","getDevicePixelRatio","size","abs","rate","setData","lttbDownSample","mapDimension","dim","sampler","downSample"],"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,UAAT,EAAqBC,QAArB,QAAqC,0BAArC;AACA,IAAIC,QAAQ,GAAG;AACbC,EAAAA,OAAO,EAAE,iBAAUC,KAAV,EAAiB;AACxB,QAAIC,GAAG,GAAG,CAAV;AACA,QAAIC,KAAK,GAAG,CAAZ;;AAEA,SAAK,IAAIC,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAGH,KAAK,CAACI,MAA1B,EAAkCD,CAAC,EAAnC,EAAuC;AACrC,UAAI,CAACE,KAAK,CAACL,KAAK,CAACG,CAAD,CAAN,CAAV,EAAsB;AACpBF,QAAAA,GAAG,IAAID,KAAK,CAACG,CAAD,CAAZ;AACAD,QAAAA,KAAK;AACN;AACF,KATuB,CAStB;;;AAGF,WAAOA,KAAK,KAAK,CAAV,GAAcI,GAAd,GAAoBL,GAAG,GAAGC,KAAjC;AACD,GAdY;AAebD,EAAAA,GAAG,EAAE,aAAUD,KAAV,EAAiB;AACpB,QAAIC,GAAG,GAAG,CAAV;;AAEA,SAAK,IAAIE,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAGH,KAAK,CAACI,MAA1B,EAAkCD,CAAC,EAAnC,EAAuC;AACrC;AACAF,MAAAA,GAAG,IAAID,KAAK,CAACG,CAAD,CAAL,IAAY,CAAnB;AACD;;AAED,WAAOF,GAAP;AACD,GAxBY;AAyBbM,EAAAA,GAAG,EAAE,aAAUP,KAAV,EAAiB;AACpB,QAAIO,GAAG,GAAG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AO,GAAGpB,QAAV;AACD;;AAED,cAAIoB,OAAJ,EAAa;AACX;AACAzB,YAAAA,WAAW,CAACqB,OAAZ,CAAoBlB,IAAI,CAACuB,UAAL,CAAgBvB,IAAI,CAACoB,YAAL,CAAkBX,SAAS,CAACY,GAA5B,CAAhB,EAAkD,IAAIJ,IAAtD,EAA4DK,OAA5D,EAAqE/B,YAArE,CAApB;AACD;AACF;AACF;AACF;AAtCI,GAAP;AAwCD","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 { isFunction, isString } from 'zrender/lib/core/util.js';\nvar samplers = {\n average: function (frame) {\n var sum = 0;\n var count = 0;\n\n for (var i = 0; i < frame.length; i++) {\n if (!isNaN(frame[i])) {\n sum += frame[i];\n count++;\n }\n } // Return NaN if count is 0\n\n\n return count === 0 ? NaN : sum / count;\n },\n sum: function (frame) {\n var sum = 0;\n\n for (var i = 0; i < frame.length; i++) {\n // Ignore NaN\n sum += frame[i] || 0;\n }\n\n return sum;\n },\n max: function (frame) {\n var max = -Infinity;\n\n for (var i = 0; i < frame.length; i++) {\n frame[i] > max && (max = frame[i]);\n } // NaN will cause illegal axis extent.\n\n\n return isFinite(max) ? max : NaN;\n },\n min: function (frame) {\n var min = Infinity;\n\n for (var i = 0; i < frame.length; i++) {\n frame[i] < min && (min = frame[i]);\n } // NaN will cause illegal axis extent.\n\n\n return isFinite(min) ? min : NaN;\n },\n // TODO\n // Median\n nearest: function (frame) {\n return frame[0];\n }\n};\n\nvar indexSampler = function (frame) {\n return Math.round(frame.length / 2);\n};\n\nexport default function dataSample(seriesType) {\n return {\n seriesType: seriesType,\n // FIXME:TS never used, so comment it\n // modifyOutputEnd: true,\n reset: function (seriesModel, ecModel, api) {\n var data = seriesModel.getData();\n var sampling = seriesModel.get('sampling');\n var coordSys = seriesModel.coordinateSystem;\n var count = data.count(); // Only cartesian2d support down sampling. Disable it when there is few data.\n\n if (count > 10 && coordSys.type === 'cartesian2d' && sampling) {\n var baseAxis = coordSys.getBaseAxis();\n var valueAxis = coordSys.getOtherAxis(baseAxis);\n var extent = baseAxis.getExtent();\n var dpr = api.getDevicePixelRatio(); // Coordinste system has been resized\n\n var size = Math.abs(extent[1] - extent[0]) * (dpr || 1);\n var rate = Math.round(count / size);\n\n if (isFinite(rate) && rate > 1) {\n if (sampling === 'lttb') {\n seriesModel.setData(data.lttbDownSample(data.mapDimension(valueAxis.dim), 1 / rate));\n }\n\n var sampler = void 0;\n\n if (isString(sampling)) {\n sampler = samplers[sampling];\n } else if (isFunction(sampling)) {\n sampler = sampling;\n }\n\n if (sampler) {\n // Only support sample the first dim mapped from value axis.\n seriesModel.setData(data.downSample(data.mapDimension(valueAxis.dim), 1 / rate, sampler, indexSampler));\n }\n }\n }\n }\n };\n}"]},"metadata":{},"sourceType":"module"}