qauMaWeb/node_modules/.cache/babel-loader/2b72329889567caca38b96eb129...

1 line
27 KiB
JSON

{"ast":null,"code":"import \"core-js/modules/es.function.name.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 * Simple view coordinate system\r\n * Mapping given x, y to transformd view x, y\r\n */\n\nimport * as vector from 'zrender/lib/core/vector.js';\nimport * as matrix from 'zrender/lib/core/matrix.js';\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nimport Transformable from 'zrender/lib/core/Transformable.js';\nvar v2ApplyTransform = vector.applyTransform;\n\nvar View =\n/** @class */\nfunction (_super) {\n __extends(View, _super);\n\n function View(name) {\n var _this = _super.call(this) || this;\n\n _this.type = 'view';\n _this.dimensions = ['x', 'y'];\n /**\r\n * Represents the transform brought by roam/zoom.\r\n * If `View['_viewRect']` applies roam transform,\r\n * we can get the final displayed rect.\r\n */\n\n _this._roamTransformable = new Transformable();\n /**\r\n * Represents the transform from `View['_rect']` to `View['_viewRect']`.\r\n */\n\n _this._rawTransformable = new Transformable();\n _this.name = name;\n return _this;\n }\n\n View.prototype.setBoundingRect = function (x, y, width, height) {\n this._rect = new BoundingRect(x, y, width, height);\n return this._rect;\n };\n /**\r\n * @return {module:zrender/core/BoundingRect}\r\n */\n\n\n View.prototype.getBoundingRect = function () {\n return this._rect;\n };\n\n View.prototype.setViewRect = function (x, y, width, height) {\n this._transformTo(x, y, width, height);\n\n this._viewRect = new BoundingRect(x, y, width, height);\n };\n /**\r\n * Transformed to particular position and size\r\n */\n\n\n View.prototype._transformTo = function (x, y, width, height) {\n var rect = this.getBoundingRect();\n var rawTransform = this._rawTransformable;\n rawTransform.transform = rect.calculateTransform(new BoundingRect(x, y, width, height));\n var rawParent = rawTransform.parent;\n rawTransform.parent = null;\n rawTransform.decomposeTransform();\n rawTransform.parent = rawParent;\n\n this._updateTransform();\n };\n /**\r\n * Set center of view\r\n */\n\n\n View.prototype.setCenter = function (centerCoord) {\n if (!centerCoord) {\n return;\n }\n\n this._center = centerCoord;\n\n this._updateCenterAndZoom();\n };\n\n View.prototype.setZoom = function (zoom) {\n zoom = zoom || 1;\n var zoomLimit = this.zoomLimit;\n\n if (zoomLimit) {\n if (zoomLimit.max != null) {\n zoom = Math.min(zoomLimit.max, zoom);\n }\n\n if (zoomLimit.min != null) {\n zoom = Math.max(zoomLimit.min, zoom);\n }\n }\n\n this._zoom = zoom;\n\n this._updateCenterAndZoom();\n };\n /**\r\n * Get default center without roam\r\n */\n\n\n View.prototype.getDefaultCenter = function () {\n // Rect before any transform\n var rawRect = this.getBoundingRect();\n var cx = rawRect.x + rawRect.width / 2;\n var cy = rawRect.y + rawRect.height / 2;\n return [cx, cy];\n };\n\n View.prototype.getCenter = function () {\n return this._center || this.getDefaultCenter();\n };\n\n View.prototype.getZoom = function () {\n return this._zoom || 1;\n };\n\n View.prototype.getRoamTransform = function () {\n return this._roamTransformable.getLocalTransform();\n };\n /**\r\n * Remove roam\r\n */\n\n\n View.prototype._updateCenterAndZoom = function () {\n // Must update after view transform updated\n var rawTransformMatrix = this._rawTransformable.getLocalTransform();\n\n var roamTransform = this._roamTransformable;\n var defaultCenter = this.getDefaultCenter();\n var center = this.getCenter();\n var zoom = this.getZoom();\n center = vector.applyTransform([], center, rawTransformMatrix);\n defaultCenter = vector.applyTransform([], defaultCenter, rawTransformMatrix);\n roamTransform.originX = center[0];\n roamTransform.originY = center[1];\n roamTransform.x = defaultCenter[0] - center[0];\n roamTransform.y = defaultCenter[1] - center[1];\n roamTransform.scaleX = roamTransform.scaleY = zoom;\n\n this._updateTransform();\n };\n /**\r\n * Update transform props on `this` based on the current\r\n * `this._roamTransformable` and `this._rawTransformable`.\r\n */\n\n\n View.prototype._updateTransform = function () {\n var roamTransformable = this._roamTransformable;\n var rawTransformable = this._rawTransformable;\n rawTransformable.parent = roamTransformable;\n roamTransformable.updateTransform();\n rawTransformable.updateTransform();\n matrix.copy(this.transform || (this.transform = []), rawTransformable.transform || matrix.create());\n this._rawTransform = rawTransformable.getLocalTransform();\n this.invTransform = this.invTransform || [];\n matrix.invert(this.invTransform, this.transform);\n this.decomposeTransform();\n };\n\n View.prototype.getTransformInfo = function () {\n var rawTransformable = this._rawTransformable;\n var roamTransformable = this._roamTransformable; // Becuase roamTransformabel has `originX/originY` modified,\n // but the caller of `getTransformInfo` can not handle `originX/originY`,\n // so need to recalcualte them.\n\n var dummyTransformable = new Transformable();\n dummyTransformable.transform = roamTransformable.transform;\n dummyTransformable.decomposeTransform();\n return {\n roam: {\n x: dummyTransformable.x,\n y: dummyTransformable.y,\n scaleX: dummyTransformable.scaleX,\n scaleY: dummyTransformable.scaleY\n },\n raw: {\n x: rawTransformable.x,\n y: rawTransformable.y,\n scaleX: rawTransformable.scaleX,\n scaleY: rawTransformable.scaleY\n }\n };\n };\n\n View.prototype.getViewRect = function () {\n return this._viewRect;\n };\n /**\r\n * Get view rect after roam transform\r\n */\n\n\n View.prototype.getViewRectAfterRoam = function () {\n var rect = this.getBoundingRect().clone();\n rect.applyTransform(this.transform);\n return rect;\n };\n /**\r\n * Convert a single (lon, lat) data item to (x, y) point.\r\n */\n\n\n View.prototype.dataToPoint = function (data, noRoam, out) {\n var transform = noRoam ? this._rawTransform : this.transform;\n out = out || [];\n return transform ? v2ApplyTransform(out, data, transform) : vector.copy(out, data);\n };\n /**\r\n * Convert a (x, y) point to (lon, lat) data\r\n */\n\n\n View.prototype.pointToData = function (point) {\n var invTransform = this.invTransform;\n return invTransform ? v2ApplyTransform([], point, invTransform) : [point[0], point[1]];\n };\n\n View.prototype.convertToPixel = function (ecModel, finder, value) {\n var coordSys = getCoordSys(finder);\n return coordSys === this ? coordSys.dataToPoint(value) : null;\n };\n\n View.prototype.convertFromPixel = function (ecModel, finder, pixel) {\n var coordSys = getCoordSys(finder);\n return coordSys === this ? coordSys.pointToData(pixel) : null;\n };\n /**\r\n * @implements\r\n */\n\n\n View.prototype.containPoint = function (point) {\n return this.getViewRectAfterRoam().contain(point[0], point[1]);\n };\n\n View.dimensions = ['x', 'y'];\n return View;\n}(Transformable);\n\nfunction getCoordSys(finder) {\n var seriesModel = finder.seriesModel;\n return seriesModel ? seriesModel.coordinateSystem : null; // e.g., graph.\n}\n\nexport default View;","map":{"version":3,"sources":["D:/Work/WorkSpace/GitWorkSpace/TenShop/resource/ElectronicMall/src/qingge-Market/qingge-vue/node_modules/echarts/lib/coord/View.js"],"names":["__extends","vector","matrix","BoundingRect","Transformable","v2ApplyTransform","applyTransform","View","_super","name","_this","call","type","dimensions","_roamTransformable","_rawTransformable","prototype","setBoundingRect","x","y","width","height","_rect","getBoundingRect","setViewRect","_transformTo","_viewRect","rect","rawTransform","transform","calculateTransform","rawParent","parent","decomposeTransform","_updateTransform","setCenter","centerCoord","_center","_updateCenterAndZoom","setZoom","zoom","zoomLimit","max","Math","min","_zoom","getDefaultCenter","rawRect","cx","cy","getCenter","getZoom","getRoamTransform","getLocalTransform","rawTransformMatrix","roamTransform","defaultCenter","center","originX","originY","scaleX","scaleY","roamTransformable","rawTransformable","updateTransform","copy","create","_rawTransform","invTransform","invert","getTransformInfo","dummyTransformable","roam","raw","getViewRect","getViewRectAfterRoam","clone","dataToPoint","data","noRoam","out","pointToData","point","convertToPixel","ecModel","finder","value","coordSys","getCoordSys","convertFromPixel","pixel","containPoint","contain","seriesModel","coordinateSystem"],"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;AACA;;AAEA,OAAO,KAAKC,MAAZ,MAAwB,4BAAxB;AACA,OAAO,KAAKC,MAAZ,MAAwB,4BAAxB;AACA,OAAOC,YAAP,MAAyB,kCAAzB;AACA,OAAOC,aAAP,MAA0B,mCAA1B;AACA,IAAIC,gBAAgB,GAAGJ,MAAM,CAACK,cAA9B;;AAEA,IAAIC,IAAI;AACR;AACA,UAAUC,MAAV,EAAkB;AAChBR,EAAAA,SAAS,CAACO,IAAD,EAAOC,MAAP,CAAT;;AAEA,WAASD,IAAT,CAAcE,IAAd,EAAoB;AAClB,QAAIC,KAAK,GAAGF,MAAM,CAACG,IAAP,CAAY,IAAZ,KAAqB,IAAjC;;AAEAD,IAAAA,KAAK,CAACE,IAAN,GAAa,MAAb;AACAF,IAAAA,KAAK,CAACG,UAAN,GAAmB,CAAC,GAAD,EAAM,GAAN,CAAnB;AACA;AACJ;AACA;AACA;AACA;;AA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F,CAFA;;AA+OA,SAASoF,WAAT,CAAqBH,MAArB,EAA6B;AAC3B,MAAIQ,WAAW,GAAGR,MAAM,CAACQ,WAAzB;AACA,SAAOA,WAAW,GAAGA,WAAW,CAACC,gBAAf,GAAkC,IAApD,CAF2B,CAE+B;AAC3D;;AAED,eAAevF,IAAf","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 * Simple view coordinate system\r\n * Mapping given x, y to transformd view x, y\r\n */\r\n\r\nimport * as vector from 'zrender/lib/core/vector.js';\r\nimport * as matrix from 'zrender/lib/core/matrix.js';\r\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\r\nimport Transformable from 'zrender/lib/core/Transformable.js';\r\nvar v2ApplyTransform = vector.applyTransform;\r\n\r\nvar View =\r\n/** @class */\r\nfunction (_super) {\r\n __extends(View, _super);\r\n\r\n function View(name) {\r\n var _this = _super.call(this) || this;\r\n\r\n _this.type = 'view';\r\n _this.dimensions = ['x', 'y'];\r\n /**\r\n * Represents the transform brought by roam/zoom.\r\n * If `View['_viewRect']` applies roam transform,\r\n * we can get the final displayed rect.\r\n */\r\n\r\n _this._roamTransformable = new Transformable();\r\n /**\r\n * Represents the transform from `View['_rect']` to `View['_viewRect']`.\r\n */\r\n\r\n _this._rawTransformable = new Transformable();\r\n _this.name = name;\r\n return _this;\r\n }\r\n\r\n View.prototype.setBoundingRect = function (x, y, width, height) {\r\n this._rect = new BoundingRect(x, y, width, height);\r\n return this._rect;\r\n };\r\n /**\r\n * @return {module:zrender/core/BoundingRect}\r\n */\r\n\r\n\r\n View.prototype.getBoundingRect = function () {\r\n return this._rect;\r\n };\r\n\r\n View.prototype.setViewRect = function (x, y, width, height) {\r\n this._transformTo(x, y, width, height);\r\n\r\n this._viewRect = new BoundingRect(x, y, width, height);\r\n };\r\n /**\r\n * Transformed to particular position and size\r\n */\r\n\r\n\r\n View.prototype._transformTo = function (x, y, width, height) {\r\n var rect = this.getBoundingRect();\r\n var rawTransform = this._rawTransformable;\r\n rawTransform.transform = rect.calculateTransform(new BoundingRect(x, y, width, height));\r\n var rawParent = rawTransform.parent;\r\n rawTransform.parent = null;\r\n rawTransform.decomposeTransform();\r\n rawTransform.parent = rawParent;\r\n\r\n this._updateTransform();\r\n };\r\n /**\r\n * Set center of view\r\n */\r\n\r\n\r\n View.prototype.setCenter = function (centerCoord) {\r\n if (!centerCoord) {\r\n return;\r\n }\r\n\r\n this._center = centerCoord;\r\n\r\n this._updateCenterAndZoom();\r\n };\r\n\r\n View.prototype.setZoom = function (zoom) {\r\n zoom = zoom || 1;\r\n var zoomLimit = this.zoomLimit;\r\n\r\n if (zoomLimit) {\r\n if (zoomLimit.max != null) {\r\n zoom = Math.min(zoomLimit.max, zoom);\r\n }\r\n\r\n if (zoomLimit.min != null) {\r\n zoom = Math.max(zoomLimit.min, zoom);\r\n }\r\n }\r\n\r\n this._zoom = zoom;\r\n\r\n this._updateCenterAndZoom();\r\n };\r\n /**\r\n * Get default center without roam\r\n */\r\n\r\n\r\n View.prototype.getDefaultCenter = function () {\r\n // Rect before any transform\r\n var rawRect = this.getBoundingRect();\r\n var cx = rawRect.x + rawRect.width / 2;\r\n var cy = rawRect.y + rawRect.height / 2;\r\n return [cx, cy];\r\n };\r\n\r\n View.prototype.getCenter = function () {\r\n return this._center || this.getDefaultCenter();\r\n };\r\n\r\n View.prototype.getZoom = function () {\r\n return this._zoom || 1;\r\n };\r\n\r\n View.prototype.getRoamTransform = function () {\r\n return this._roamTransformable.getLocalTransform();\r\n };\r\n /**\r\n * Remove roam\r\n */\r\n\r\n\r\n View.prototype._updateCenterAndZoom = function () {\r\n // Must update after view transform updated\r\n var rawTransformMatrix = this._rawTransformable.getLocalTransform();\r\n\r\n var roamTransform = this._roamTransformable;\r\n var defaultCenter = this.getDefaultCenter();\r\n var center = this.getCenter();\r\n var zoom = this.getZoom();\r\n center = vector.applyTransform([], center, rawTransformMatrix);\r\n defaultCenter = vector.applyTransform([], defaultCenter, rawTransformMatrix);\r\n roamTransform.originX = center[0];\r\n roamTransform.originY = center[1];\r\n roamTransform.x = defaultCenter[0] - center[0];\r\n roamTransform.y = defaultCenter[1] - center[1];\r\n roamTransform.scaleX = roamTransform.scaleY = zoom;\r\n\r\n this._updateTransform();\r\n };\r\n /**\r\n * Update transform props on `this` based on the current\r\n * `this._roamTransformable` and `this._rawTransformable`.\r\n */\r\n\r\n\r\n View.prototype._updateTransform = function () {\r\n var roamTransformable = this._roamTransformable;\r\n var rawTransformable = this._rawTransformable;\r\n rawTransformable.parent = roamTransformable;\r\n roamTransformable.updateTransform();\r\n rawTransformable.updateTransform();\r\n matrix.copy(this.transform || (this.transform = []), rawTransformable.transform || matrix.create());\r\n this._rawTransform = rawTransformable.getLocalTransform();\r\n this.invTransform = this.invTransform || [];\r\n matrix.invert(this.invTransform, this.transform);\r\n this.decomposeTransform();\r\n };\r\n\r\n View.prototype.getTransformInfo = function () {\r\n var rawTransformable = this._rawTransformable;\r\n var roamTransformable = this._roamTransformable; // Becuase roamTransformabel has `originX/originY` modified,\r\n // but the caller of `getTransformInfo` can not handle `originX/originY`,\r\n // so need to recalcualte them.\r\n\r\n var dummyTransformable = new Transformable();\r\n dummyTransformable.transform = roamTransformable.transform;\r\n dummyTransformable.decomposeTransform();\r\n return {\r\n roam: {\r\n x: dummyTransformable.x,\r\n y: dummyTransformable.y,\r\n scaleX: dummyTransformable.scaleX,\r\n scaleY: dummyTransformable.scaleY\r\n },\r\n raw: {\r\n x: rawTransformable.x,\r\n y: rawTransformable.y,\r\n scaleX: rawTransformable.scaleX,\r\n scaleY: rawTransformable.scaleY\r\n }\r\n };\r\n };\r\n\r\n View.prototype.getViewRect = function () {\r\n return this._viewRect;\r\n };\r\n /**\r\n * Get view rect after roam transform\r\n */\r\n\r\n\r\n View.prototype.getViewRectAfterRoam = function () {\r\n var rect = this.getBoundingRect().clone();\r\n rect.applyTransform(this.transform);\r\n return rect;\r\n };\r\n /**\r\n * Convert a single (lon, lat) data item to (x, y) point.\r\n */\r\n\r\n\r\n View.prototype.dataToPoint = function (data, noRoam, out) {\r\n var transform = noRoam ? this._rawTransform : this.transform;\r\n out = out || [];\r\n return transform ? v2ApplyTransform(out, data, transform) : vector.copy(out, data);\r\n };\r\n /**\r\n * Convert a (x, y) point to (lon, lat) data\r\n */\r\n\r\n\r\n View.prototype.pointToData = function (point) {\r\n var invTransform = this.invTransform;\r\n return invTransform ? v2ApplyTransform([], point, invTransform) : [point[0], point[1]];\r\n };\r\n\r\n View.prototype.convertToPixel = function (ecModel, finder, value) {\r\n var coordSys = getCoordSys(finder);\r\n return coordSys === this ? coordSys.dataToPoint(value) : null;\r\n };\r\n\r\n View.prototype.convertFromPixel = function (ecModel, finder, pixel) {\r\n var coordSys = getCoordSys(finder);\r\n return coordSys === this ? coordSys.pointToData(pixel) : null;\r\n };\r\n /**\r\n * @implements\r\n */\r\n\r\n\r\n View.prototype.containPoint = function (point) {\r\n return this.getViewRectAfterRoam().contain(point[0], point[1]);\r\n };\r\n\r\n View.dimensions = ['x', 'y'];\r\n return View;\r\n}(Transformable);\r\n\r\nfunction getCoordSys(finder) {\r\n var seriesModel = finder.seriesModel;\r\n return seriesModel ? seriesModel.coordinateSystem : null; // e.g., graph.\r\n}\r\n\r\nexport default View;"]},"metadata":{},"sourceType":"module"}