qauMaWeb/node_modules/.cache/babel-loader/1e57106c08b7b627077e5d171bc...

1 line
26 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\";\nimport DataZoomView from './DataZoomView.js';\nimport sliderMove from '../helper/sliderMove.js';\nimport * as roams from './roams.js';\nimport { bind } from 'zrender/lib/core/util.js';\n\nvar InsideZoomView =\n/** @class */\nfunction (_super) {\n __extends(InsideZoomView, _super);\n\n function InsideZoomView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = 'dataZoom.inside';\n return _this;\n }\n\n InsideZoomView.prototype.render = function (dataZoomModel, ecModel, api) {\n _super.prototype.render.apply(this, arguments);\n\n if (dataZoomModel.noTarget()) {\n this._clear();\n\n return;\n } // Hence the `throttle` util ensures to preserve command order,\n // here simply updating range all the time will not cause missing\n // any of the the roam change.\n\n\n this.range = dataZoomModel.getPercentRange(); // Reset controllers.\n\n roams.setViewInfoToCoordSysRecord(api, dataZoomModel, {\n pan: bind(getRangeHandlers.pan, this),\n zoom: bind(getRangeHandlers.zoom, this),\n scrollMove: bind(getRangeHandlers.scrollMove, this)\n });\n };\n\n InsideZoomView.prototype.dispose = function () {\n this._clear();\n\n _super.prototype.dispose.apply(this, arguments);\n };\n\n InsideZoomView.prototype._clear = function () {\n roams.disposeCoordSysRecordIfNeeded(this.api, this.dataZoomModel);\n this.range = null;\n };\n\n InsideZoomView.type = 'dataZoom.inside';\n return InsideZoomView;\n}(DataZoomView);\n\nvar getRangeHandlers = {\n zoom: function zoom(coordSysInfo, coordSysMainType, controller, e) {\n var lastRange = this.range;\n var range = lastRange.slice(); // Calculate transform by the first axis.\n\n var axisModel = coordSysInfo.axisModels[0];\n\n if (!axisModel) {\n return;\n }\n\n var directionInfo = getDirectionInfo[coordSysMainType](null, [e.originX, e.originY], axisModel, controller, coordSysInfo);\n var percentPoint = (directionInfo.signal > 0 ? directionInfo.pixelStart + directionInfo.pixelLength - directionInfo.pixel : directionInfo.pixel - directionInfo.pixelStart) / directionInfo.pixelLength * (range[1] - range[0]) + range[0];\n var scale = Math.max(1 / e.scale, 0);\n range[0] = (range[0] - percentPoint) * scale + percentPoint;\n range[1] = (range[1] - percentPoint) * scale + percentPoint; // Restrict range.\n\n var minMaxSpan = this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();\n sliderMove(0, range, [0, 100], 0, minMaxSpan.minSpan, minMaxSpan.maxSpan);\n this.range = range;\n\n if (lastRange[0] !== range[0] || lastRange[1] !== range[1]) {\n return range;\n }\n },\n pan: makeMover(function (range, axisModel, coordSysInfo, coordSysMainType, controller, e) {\n var directionInfo = getDirectionInfo[coordSysMainType]([e.oldX, e.oldY], [e.newX, e.newY], axisModel, controller, coordSysInfo);\n return directionInfo.signal * (range[1] - range[0]) * directionInfo.pixel / directionInfo.pixelLength;\n }),\n scrollMove: makeMover(function (range, axisModel, coordSysInfo, coordSysMainType, controller, e) {\n var directionInfo = getDirectionInfo[coordSysMainType]([0, 0], [e.scrollDelta, e.scrollDelta], axisModel, controller, coordSysInfo);\n return directionInfo.signal * (range[1] - range[0]) * e.scrollDelta;\n })\n};\n\nfunction makeMover(getPercentDelta) {\n return function (coordSysInfo, coordSysMainType, controller, e) {\n var lastRange = this.range;\n var range = lastRange.slice(); // Calculate transform by the first axis.\n\n var axisModel = coordSysInfo.axisModels[0];\n\n if (!axisModel) {\n return;\n }\n\n var percentDelta = getPercentDelta(range, axisModel, coordSysInfo, coordSysMainType, controller, e);\n sliderMove(percentDelta, range, [0, 100], 'all');\n this.range = range;\n\n if (lastRange[0] !== range[0] || lastRange[1] !== range[1]) {\n return range;\n }\n };\n}\n\nvar getDirectionInfo = {\n grid: function grid(oldPoint, newPoint, axisModel, controller, coordSysInfo) {\n var axis = axisModel.axis;\n var ret = {};\n var rect = coordSysInfo.model.coordinateSystem.getRect();\n oldPoint = oldPoint || [0, 0];\n\n if (axis.dim === 'x') {\n ret.pixel = newPoint[0] - oldPoint[0];\n ret.pixelLength = rect.width;\n ret.pixelStart = rect.x;\n ret.signal = axis.inverse ? 1 : -1;\n } else {\n // axis.dim === 'y'\n ret.pixel = newPoint[1] - oldPoint[1];\n ret.pixelLength = rect.height;\n ret.pixelStart = rect.y;\n ret.signal = axis.inverse ? -1 : 1;\n }\n\n return ret;\n },\n polar: function polar(oldPoint, newPoint, axisModel, controller, coordSysInfo) {\n var axis = axisModel.axis;\n var ret = {};\n var polar = coordSysInfo.model.coordinateSystem;\n var radiusExtent = polar.getRadiusAxis().getExtent();\n var angleExtent = polar.getAngleAxis().getExtent();\n oldPoint = oldPoint ? polar.pointToCoord(oldPoint) : [0, 0];\n newPoint = polar.pointToCoord(newPoint);\n\n if (axisModel.mainType === 'radiusAxis') {\n ret.pixel = newPoint[0] - oldPoint[0]; // ret.pixelLength = Math.abs(radiusExtent[1] - radiusExtent[0]);\n // ret.pixelStart = Math.min(radiusExtent[0], radiusExtent[1]);\n\n ret.pixelLength = radiusExtent[1] - radiusExtent[0];\n ret.pixelStart = radiusExtent[0];\n ret.signal = axis.inverse ? 1 : -1;\n } else {\n // 'angleAxis'\n ret.pixel = newPoint[1] - oldPoint[1]; // ret.pixelLength = Math.abs(angleExtent[1] - angleExtent[0]);\n // ret.pixelStart = Math.min(angleExtent[0], angleExtent[1]);\n\n ret.pixelLength = angleExtent[1] - angleExtent[0];\n ret.pixelStart = angleExtent[0];\n ret.signal = axis.inverse ? -1 : 1;\n }\n\n return ret;\n },\n singleAxis: function singleAxis(oldPoint, newPoint, axisModel, controller, coordSysInfo) {\n var axis = axisModel.axis;\n var rect = coordSysInfo.model.coordinateSystem.getRect();\n var ret = {};\n oldPoint = oldPoint || [0, 0];\n\n if (axis.orient === 'horizontal') {\n ret.pixel = newPoint[0] - oldPoint[0];\n ret.pixelLength = rect.width;\n ret.pixelStart = rect.x;\n ret.signal = axis.inverse ? 1 : -1;\n } else {\n // 'vertical'\n ret.pixel = newPoint[1] - oldPoint[1];\n ret.pixelLength = rect.height;\n ret.pixelStart = rect.y;\n ret.signal = axis.inverse ? -1 : 1;\n }\n\n return ret;\n }\n};\nexport default InsideZoomView;","map":{"version":3,"sources":["D:/Work/WorkSpace/GitWorkSpace/TenShop/resource/ElectronicMall/src/qingge-Market/qingge-vue/node_modules/echarts/lib/component/dataZoom/InsideZoomView.js"],"names":["__extends","DataZoomView","sliderMove","roams","bind","InsideZoomView","_super","_this","apply","arguments","type","prototype","render","dataZoomModel","ecModel","api","noTarget","_clear","range","getPercentRange","setViewInfoToCoordSysRecord","pan","getRangeHandlers","zoom","scrollMove","dispose","disposeCoordSysRecordIfNeeded","coordSysInfo","coordSysMainType","controller","e","lastRange","slice","axisModel","axisModels","directionInfo","getDirectionInfo","originX","originY","percentPoint","signal","pixelStart","pixelLength","pixel","scale","Math","max","minMaxSpan","findRepresentativeAxisProxy","getMinMaxSpan","minSpan","maxSpan","makeMover","oldX","oldY","newX","newY","scrollDelta","getPercentDelta","percentDelta","grid","oldPoint","newPoint","axis","ret","rect","model","coordinateSystem","getRect","dim","width","x","inverse","height","y","polar","radiusExtent","getRadiusAxis","getExtent","angleExtent","getAngleAxis","pointToCoord","mainType","singleAxis","orient"],"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,OAAOC,YAAP,MAAyB,mBAAzB;AACA,OAAOC,UAAP,MAAuB,yBAAvB;AACA,OAAO,KAAKC,KAAZ,MAAuB,YAAvB;AACA,SAASC,IAAT,QAAqB,0BAArB;;AAEA,IAAIC,cAAc;AAClB;AACA,UAAUC,MAAV,EAAkB;AAChBN,EAAAA,SAAS,CAACK,cAAD,EAAiBC,MAAjB,CAAT;;AAEA,WAASD,cAAT,GAA0B;AACxB,QAAIE,KAAK,GAAGD,MAAM,KAAK,IAAX,IAAmBA,MAAM,CAACE,KAAP,CAAa,IAAb,EAAmBC,SAAnB,CAAnB,IAAoD,IAAhE;;AAEAF,IAAAA,KAAK,CAACG,IAAN,GAAa,iBAAb;AACA,WAAOH,KAAP;AACD;;AAEDF,EAAAA,cAAc,CAACM,SAAf,CAAyBC,MAAzB,GAAkC,UAAUC,aAAV,EAAyBC,OAAzB,EAAkCC,GAAlC,EAAuC;AACvET,IAAAA,MAAM,CAACK,SAAP,CAAiBC,MAAjB,CAAwBJ,KAAxB,CAA8B,IAA9B,EAAoCC,SA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oCC,OAApC,EAAX;AACA,QAAIJ,GAAG,GAAG,EAAV;AACAH,IAAAA,QAAQ,GAAGA,QAAQ,IAAI,CAAC,CAAD,EAAI,CAAJ,CAAvB;;AAEA,QAAIE,IAAI,CAACqB,MAAL,KAAgB,YAApB,EAAkC;AAChCpB,MAAAA,GAAG,CAACrB,KAAJ,GAAYmB,QAAQ,CAAC,CAAD,CAAR,GAAcD,QAAQ,CAAC,CAAD,CAAlC;AACAG,MAAAA,GAAG,CAACtB,WAAJ,GAAkBuB,IAAI,CAACK,KAAvB;AACAN,MAAAA,GAAG,CAACvB,UAAJ,GAAiBwB,IAAI,CAACM,CAAtB;AACAP,MAAAA,GAAG,CAACxB,MAAJ,GAAauB,IAAI,CAACS,OAAL,GAAe,CAAf,GAAmB,CAAC,CAAjC;AACD,KALD,MAKO;AACL;AACAR,MAAAA,GAAG,CAACrB,KAAJ,GAAYmB,QAAQ,CAAC,CAAD,CAAR,GAAcD,QAAQ,CAAC,CAAD,CAAlC;AACAG,MAAAA,GAAG,CAACtB,WAAJ,GAAkBuB,IAAI,CAACQ,MAAvB;AACAT,MAAAA,GAAG,CAACvB,UAAJ,GAAiBwB,IAAI,CAACS,CAAtB;AACAV,MAAAA,GAAG,CAACxB,MAAJ,GAAauB,IAAI,CAACS,OAAL,GAAe,CAAC,CAAhB,GAAoB,CAAjC;AACD;;AAED,WAAOR,GAAP;AACD;AAtEoB,CAAvB;AAwEA,eAAe3D,cAAf","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\nimport DataZoomView from './DataZoomView.js';\r\nimport sliderMove from '../helper/sliderMove.js';\r\nimport * as roams from './roams.js';\r\nimport { bind } from 'zrender/lib/core/util.js';\r\n\r\nvar InsideZoomView =\r\n/** @class */\r\nfunction (_super) {\r\n __extends(InsideZoomView, _super);\r\n\r\n function InsideZoomView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n\r\n _this.type = 'dataZoom.inside';\r\n return _this;\r\n }\r\n\r\n InsideZoomView.prototype.render = function (dataZoomModel, ecModel, api) {\r\n _super.prototype.render.apply(this, arguments);\r\n\r\n if (dataZoomModel.noTarget()) {\r\n this._clear();\r\n\r\n return;\r\n } // Hence the `throttle` util ensures to preserve command order,\r\n // here simply updating range all the time will not cause missing\r\n // any of the the roam change.\r\n\r\n\r\n this.range = dataZoomModel.getPercentRange(); // Reset controllers.\r\n\r\n roams.setViewInfoToCoordSysRecord(api, dataZoomModel, {\r\n pan: bind(getRangeHandlers.pan, this),\r\n zoom: bind(getRangeHandlers.zoom, this),\r\n scrollMove: bind(getRangeHandlers.scrollMove, this)\r\n });\r\n };\r\n\r\n InsideZoomView.prototype.dispose = function () {\r\n this._clear();\r\n\r\n _super.prototype.dispose.apply(this, arguments);\r\n };\r\n\r\n InsideZoomView.prototype._clear = function () {\r\n roams.disposeCoordSysRecordIfNeeded(this.api, this.dataZoomModel);\r\n this.range = null;\r\n };\r\n\r\n InsideZoomView.type = 'dataZoom.inside';\r\n return InsideZoomView;\r\n}(DataZoomView);\r\n\r\nvar getRangeHandlers = {\r\n zoom: function (coordSysInfo, coordSysMainType, controller, e) {\r\n var lastRange = this.range;\r\n var range = lastRange.slice(); // Calculate transform by the first axis.\r\n\r\n var axisModel = coordSysInfo.axisModels[0];\r\n\r\n if (!axisModel) {\r\n return;\r\n }\r\n\r\n var directionInfo = getDirectionInfo[coordSysMainType](null, [e.originX, e.originY], axisModel, controller, coordSysInfo);\r\n var percentPoint = (directionInfo.signal > 0 ? directionInfo.pixelStart + directionInfo.pixelLength - directionInfo.pixel : directionInfo.pixel - directionInfo.pixelStart) / directionInfo.pixelLength * (range[1] - range[0]) + range[0];\r\n var scale = Math.max(1 / e.scale, 0);\r\n range[0] = (range[0] - percentPoint) * scale + percentPoint;\r\n range[1] = (range[1] - percentPoint) * scale + percentPoint; // Restrict range.\r\n\r\n var minMaxSpan = this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();\r\n sliderMove(0, range, [0, 100], 0, minMaxSpan.minSpan, minMaxSpan.maxSpan);\r\n this.range = range;\r\n\r\n if (lastRange[0] !== range[0] || lastRange[1] !== range[1]) {\r\n return range;\r\n }\r\n },\r\n pan: makeMover(function (range, axisModel, coordSysInfo, coordSysMainType, controller, e) {\r\n var directionInfo = getDirectionInfo[coordSysMainType]([e.oldX, e.oldY], [e.newX, e.newY], axisModel, controller, coordSysInfo);\r\n return directionInfo.signal * (range[1] - range[0]) * directionInfo.pixel / directionInfo.pixelLength;\r\n }),\r\n scrollMove: makeMover(function (range, axisModel, coordSysInfo, coordSysMainType, controller, e) {\r\n var directionInfo = getDirectionInfo[coordSysMainType]([0, 0], [e.scrollDelta, e.scrollDelta], axisModel, controller, coordSysInfo);\r\n return directionInfo.signal * (range[1] - range[0]) * e.scrollDelta;\r\n })\r\n};\r\n\r\nfunction makeMover(getPercentDelta) {\r\n return function (coordSysInfo, coordSysMainType, controller, e) {\r\n var lastRange = this.range;\r\n var range = lastRange.slice(); // Calculate transform by the first axis.\r\n\r\n var axisModel = coordSysInfo.axisModels[0];\r\n\r\n if (!axisModel) {\r\n return;\r\n }\r\n\r\n var percentDelta = getPercentDelta(range, axisModel, coordSysInfo, coordSysMainType, controller, e);\r\n sliderMove(percentDelta, range, [0, 100], 'all');\r\n this.range = range;\r\n\r\n if (lastRange[0] !== range[0] || lastRange[1] !== range[1]) {\r\n return range;\r\n }\r\n };\r\n}\r\n\r\nvar getDirectionInfo = {\r\n grid: function (oldPoint, newPoint, axisModel, controller, coordSysInfo) {\r\n var axis = axisModel.axis;\r\n var ret = {};\r\n var rect = coordSysInfo.model.coordinateSystem.getRect();\r\n oldPoint = oldPoint || [0, 0];\r\n\r\n if (axis.dim === 'x') {\r\n ret.pixel = newPoint[0] - oldPoint[0];\r\n ret.pixelLength = rect.width;\r\n ret.pixelStart = rect.x;\r\n ret.signal = axis.inverse ? 1 : -1;\r\n } else {\r\n // axis.dim === 'y'\r\n ret.pixel = newPoint[1] - oldPoint[1];\r\n ret.pixelLength = rect.height;\r\n ret.pixelStart = rect.y;\r\n ret.signal = axis.inverse ? -1 : 1;\r\n }\r\n\r\n return ret;\r\n },\r\n polar: function (oldPoint, newPoint, axisModel, controller, coordSysInfo) {\r\n var axis = axisModel.axis;\r\n var ret = {};\r\n var polar = coordSysInfo.model.coordinateSystem;\r\n var radiusExtent = polar.getRadiusAxis().getExtent();\r\n var angleExtent = polar.getAngleAxis().getExtent();\r\n oldPoint = oldPoint ? polar.pointToCoord(oldPoint) : [0, 0];\r\n newPoint = polar.pointToCoord(newPoint);\r\n\r\n if (axisModel.mainType === 'radiusAxis') {\r\n ret.pixel = newPoint[0] - oldPoint[0]; // ret.pixelLength = Math.abs(radiusExtent[1] - radiusExtent[0]);\r\n // ret.pixelStart = Math.min(radiusExtent[0], radiusExtent[1]);\r\n\r\n ret.pixelLength = radiusExtent[1] - radiusExtent[0];\r\n ret.pixelStart = radiusExtent[0];\r\n ret.signal = axis.inverse ? 1 : -1;\r\n } else {\r\n // 'angleAxis'\r\n ret.pixel = newPoint[1] - oldPoint[1]; // ret.pixelLength = Math.abs(angleExtent[1] - angleExtent[0]);\r\n // ret.pixelStart = Math.min(angleExtent[0], angleExtent[1]);\r\n\r\n ret.pixelLength = angleExtent[1] - angleExtent[0];\r\n ret.pixelStart = angleExtent[0];\r\n ret.signal = axis.inverse ? -1 : 1;\r\n }\r\n\r\n return ret;\r\n },\r\n singleAxis: function (oldPoint, newPoint, axisModel, controller, coordSysInfo) {\r\n var axis = axisModel.axis;\r\n var rect = coordSysInfo.model.coordinateSystem.getRect();\r\n var ret = {};\r\n oldPoint = oldPoint || [0, 0];\r\n\r\n if (axis.orient === 'horizontal') {\r\n ret.pixel = newPoint[0] - oldPoint[0];\r\n ret.pixelLength = rect.width;\r\n ret.pixelStart = rect.x;\r\n ret.signal = axis.inverse ? 1 : -1;\r\n } else {\r\n // 'vertical'\r\n ret.pixel = newPoint[1] - oldPoint[1];\r\n ret.pixelLength = rect.height;\r\n ret.pixelStart = rect.y;\r\n ret.signal = axis.inverse ? -1 : 1;\r\n }\r\n\r\n return ret;\r\n }\r\n};\r\nexport default InsideZoomView;"]},"metadata":{},"sourceType":"module"}