qauMaWeb/node_modules/.cache/babel-loader/df5de9f273353800b251b71dc2d...

1 line
22 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*/\n\n/**\n * Single coordinates system.\n */\nimport SingleAxis from './SingleAxis.js';\nimport * as axisHelper from '../axisHelper.js';\nimport { getLayoutRect } from '../../util/layout.js';\nimport { each } from 'zrender/lib/core/util.js';\nexport var singleDimensions = ['single'];\n/**\n * Create a single coordinates system.\n */\n\nvar Single =\n/** @class */\nfunction () {\n function Single(axisModel, ecModel, api) {\n this.type = 'single';\n this.dimension = 'single';\n /**\n * Add it just for draw tooltip.\n */\n\n this.dimensions = singleDimensions;\n this.axisPointerEnabled = true;\n this.model = axisModel;\n\n this._init(axisModel, ecModel, api);\n }\n /**\n * Initialize single coordinate system.\n */\n\n\n Single.prototype._init = function (axisModel, ecModel, api) {\n var dim = this.dimension;\n var axis = new SingleAxis(dim, axisHelper.createScaleByModel(axisModel), [0, 0], axisModel.get('type'), axisModel.get('position'));\n var isCategory = axis.type === 'category';\n axis.onBand = isCategory && axisModel.get('boundaryGap');\n axis.inverse = axisModel.get('inverse');\n axis.orient = axisModel.get('orient');\n axisModel.axis = axis;\n axis.model = axisModel;\n axis.coordinateSystem = this;\n this._axis = axis;\n };\n /**\n * Update axis scale after data processed\n */\n\n\n Single.prototype.update = function (ecModel, api) {\n ecModel.eachSeries(function (seriesModel) {\n if (seriesModel.coordinateSystem === this) {\n var data_1 = seriesModel.getData();\n each(data_1.mapDimensionsAll(this.dimension), function (dim) {\n this._axis.scale.unionExtentFromData(data_1, dim);\n }, this);\n axisHelper.niceScaleExtent(this._axis.scale, this._axis.model);\n }\n }, this);\n };\n /**\n * Resize the single coordinate system.\n */\n\n\n Single.prototype.resize = function (axisModel, api) {\n this._rect = getLayoutRect({\n left: axisModel.get('left'),\n top: axisModel.get('top'),\n right: axisModel.get('right'),\n bottom: axisModel.get('bottom'),\n width: axisModel.get('width'),\n height: axisModel.get('height')\n }, {\n width: api.getWidth(),\n height: api.getHeight()\n });\n\n this._adjustAxis();\n };\n\n Single.prototype.getRect = function () {\n return this._rect;\n };\n\n Single.prototype._adjustAxis = function () {\n var rect = this._rect;\n var axis = this._axis;\n var isHorizontal = axis.isHorizontal();\n var extent = isHorizontal ? [0, rect.width] : [0, rect.height];\n var idx = axis.inverse ? 1 : 0;\n axis.setExtent(extent[idx], extent[1 - idx]);\n\n this._updateAxisTransform(axis, isHorizontal ? rect.x : rect.y);\n };\n\n Single.prototype._updateAxisTransform = function (axis, coordBase) {\n var axisExtent = axis.getExtent();\n var extentSum = axisExtent[0] + axisExtent[1];\n var isHorizontal = axis.isHorizontal();\n axis.toGlobalCoord = isHorizontal ? function (coord) {\n return coord + coordBase;\n } : function (coord) {\n return extentSum - coord + coordBase;\n };\n axis.toLocalCoord = isHorizontal ? function (coord) {\n return coord - coordBase;\n } : function (coord) {\n return extentSum - coord + coordBase;\n };\n };\n /**\n * Get axis.\n */\n\n\n Single.prototype.getAxis = function () {\n return this._axis;\n };\n /**\n * Get axis, add it just for draw tooltip.\n */\n\n\n Single.prototype.getBaseAxis = function () {\n return this._axis;\n };\n\n Single.prototype.getAxes = function () {\n return [this._axis];\n };\n\n Single.prototype.getTooltipAxes = function () {\n return {\n baseAxes: [this.getAxis()],\n // Empty otherAxes\n otherAxes: []\n };\n };\n /**\n * If contain point.\n */\n\n\n Single.prototype.containPoint = function (point) {\n var rect = this.getRect();\n var axis = this.getAxis();\n var orient = axis.orient;\n\n if (orient === 'horizontal') {\n return axis.contain(axis.toLocalCoord(point[0])) && point[1] >= rect.y && point[1] <= rect.y + rect.height;\n } else {\n return axis.contain(axis.toLocalCoord(point[1])) && point[0] >= rect.y && point[0] <= rect.y + rect.height;\n }\n };\n\n Single.prototype.pointToData = function (point) {\n var axis = this.getAxis();\n return [axis.coordToData(axis.toLocalCoord(point[axis.orient === 'horizontal' ? 0 : 1]))];\n };\n /**\n * Convert the series data to concrete point.\n * Can be [val] | val\n */\n\n\n Single.prototype.dataToPoint = function (val) {\n var axis = this.getAxis();\n var rect = this.getRect();\n var pt = [];\n var idx = axis.orient === 'horizontal' ? 0 : 1;\n\n if (val instanceof Array) {\n val = val[0];\n }\n\n pt[idx] = axis.toGlobalCoord(axis.dataToCoord(+val));\n pt[1 - idx] = idx === 0 ? rect.y + rect.height / 2 : rect.x + rect.width / 2;\n return pt;\n };\n\n Single.prototype.convertToPixel = function (ecModel, finder, value) {\n var coordSys = getCoordSys(finder);\n return coordSys === this ? this.dataToPoint(value) : null;\n };\n\n Single.prototype.convertFromPixel = function (ecModel, finder, pixel) {\n var coordSys = getCoordSys(finder);\n return coordSys === this ? this.pointToData(pixel) : null;\n };\n\n return Single;\n}();\n\nfunction getCoordSys(finder) {\n var seriesModel = finder.seriesModel;\n var singleModel = finder.singleAxisModel;\n return singleModel && singleModel.coordinateSystem || seriesModel && seriesModel.coordinateSystem;\n}\n\nexport default Single;","map":{"version":3,"sources":["D:/Work/WorkSpace/GitWorkSpace/TenShop/resource/ElectronicMall/src/ElectronicMallVue/node_modules/echarts/lib/coord/single/Single.js"],"names":["SingleAxis","axisHelper","getLayoutRect","each","singleDimensions","Single","axisModel","ecModel","api","type","dimension","dimensions","axisPointerEnabled","model","_init","prototype","dim","axis","createScaleByModel","get","isCategory","onBand","inverse","orient","coordinateSystem","_axis","update","eachSeries","seriesModel","data_1","getData","mapDimensionsAll","scale","unionExtentFromData","niceScaleExtent","resize","_rect","left","top","right","bottom","width","height","getWidth","getHeight","_adjustAxis","getRect","rect","isHorizontal","extent","idx","setExtent","_updateAxisTransform","x","y","coordBase","axisExtent","getExtent","extentSum","toGlobalCoord","coord","toLocalCoord","getAxis","getBaseAxis","getAxes","getTooltipAxes","baseAxes","otherAxes","containPoint","point","contain","pointToData","coordToData","dataToPoint","val","pt","Array","dataToCoord","convertToPixel","finder","value","coordSys","getCoordSys","convertFromPixel","pixel","singleModel","singleAxisModel"],"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;;AAEA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,iBAAvB;AACA,OAAO,KAAKC,UAAZ,MAA4B,kBAA5B;AACA,SAASC,aAAT,QAA8B,sBAA9B;AACA,SAASC,IAAT,QAAqB,0BAArB;AACA,OAAO,IAAIC,gBAAgB,GAAG,CAAC,QAAD,CAAvB;AACP;AACA;AACA;;AAEA,IAAIC,MAAM;AACV;AACA,YAAY;AACV,WAASA,MAAT,CAAgBC,SAAhB,EAA2BC,OAA3B,EAAoCC,GAApC,EAAyC;AACvC,SAAKC,IAAL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AAF,GAAcA,GAAG,KAAK,CAAR,GAAYH,IAAI,CAACO,CAAL,GAASP,IAAI,CAACL,MAAL,GAAc,CAAnC,GAAuCK,IAAI,CAACM,CAAL,GAASN,IAAI,CAACN,KAAL,GAAa,CAA3E;AACA,WAAOkC,EAAP;AACD,GAbD;;AAeAtE,EAAAA,MAAM,CAACU,SAAP,CAAiB+D,cAAjB,GAAkC,UAAUvE,OAAV,EAAmBwE,MAAnB,EAA2BC,KAA3B,EAAkC;AAClE,QAAIC,QAAQ,GAAGC,WAAW,CAACH,MAAD,CAA1B;AACA,WAAOE,QAAQ,KAAK,IAAb,GAAoB,KAAKR,WAAL,CAAiBO,KAAjB,CAApB,GAA8C,IAArD;AACD,GAHD;;AAKA3E,EAAAA,MAAM,CAACU,SAAP,CAAiBoE,gBAAjB,GAAoC,UAAU5E,OAAV,EAAmBwE,MAAnB,EAA2BK,KAA3B,EAAkC;AACpE,QAAIH,QAAQ,GAAGC,WAAW,CAACH,MAAD,CAA1B;AACA,WAAOE,QAAQ,KAAK,IAAb,GAAoB,KAAKV,WAAL,CAAiBa,KAAjB,CAApB,GAA8C,IAArD;AACD,GAHD;;AAKA,SAAO/E,MAAP;AACD,CAnLD,EAFA;;AAuLA,SAAS6E,WAAT,CAAqBH,MAArB,EAA6B;AAC3B,MAAInD,WAAW,GAAGmD,MAAM,CAACnD,WAAzB;AACA,MAAIyD,WAAW,GAAGN,MAAM,CAACO,eAAzB;AACA,SAAOD,WAAW,IAAIA,WAAW,CAAC7D,gBAA3B,IAA+CI,WAAW,IAAIA,WAAW,CAACJ,gBAAjF;AACD;;AAED,eAAenB,MAAf","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*/\n\n/**\n * Single coordinates system.\n */\nimport SingleAxis from './SingleAxis.js';\nimport * as axisHelper from '../axisHelper.js';\nimport { getLayoutRect } from '../../util/layout.js';\nimport { each } from 'zrender/lib/core/util.js';\nexport var singleDimensions = ['single'];\n/**\n * Create a single coordinates system.\n */\n\nvar Single =\n/** @class */\nfunction () {\n function Single(axisModel, ecModel, api) {\n this.type = 'single';\n this.dimension = 'single';\n /**\n * Add it just for draw tooltip.\n */\n\n this.dimensions = singleDimensions;\n this.axisPointerEnabled = true;\n this.model = axisModel;\n\n this._init(axisModel, ecModel, api);\n }\n /**\n * Initialize single coordinate system.\n */\n\n\n Single.prototype._init = function (axisModel, ecModel, api) {\n var dim = this.dimension;\n var axis = new SingleAxis(dim, axisHelper.createScaleByModel(axisModel), [0, 0], axisModel.get('type'), axisModel.get('position'));\n var isCategory = axis.type === 'category';\n axis.onBand = isCategory && axisModel.get('boundaryGap');\n axis.inverse = axisModel.get('inverse');\n axis.orient = axisModel.get('orient');\n axisModel.axis = axis;\n axis.model = axisModel;\n axis.coordinateSystem = this;\n this._axis = axis;\n };\n /**\n * Update axis scale after data processed\n */\n\n\n Single.prototype.update = function (ecModel, api) {\n ecModel.eachSeries(function (seriesModel) {\n if (seriesModel.coordinateSystem === this) {\n var data_1 = seriesModel.getData();\n each(data_1.mapDimensionsAll(this.dimension), function (dim) {\n this._axis.scale.unionExtentFromData(data_1, dim);\n }, this);\n axisHelper.niceScaleExtent(this._axis.scale, this._axis.model);\n }\n }, this);\n };\n /**\n * Resize the single coordinate system.\n */\n\n\n Single.prototype.resize = function (axisModel, api) {\n this._rect = getLayoutRect({\n left: axisModel.get('left'),\n top: axisModel.get('top'),\n right: axisModel.get('right'),\n bottom: axisModel.get('bottom'),\n width: axisModel.get('width'),\n height: axisModel.get('height')\n }, {\n width: api.getWidth(),\n height: api.getHeight()\n });\n\n this._adjustAxis();\n };\n\n Single.prototype.getRect = function () {\n return this._rect;\n };\n\n Single.prototype._adjustAxis = function () {\n var rect = this._rect;\n var axis = this._axis;\n var isHorizontal = axis.isHorizontal();\n var extent = isHorizontal ? [0, rect.width] : [0, rect.height];\n var idx = axis.inverse ? 1 : 0;\n axis.setExtent(extent[idx], extent[1 - idx]);\n\n this._updateAxisTransform(axis, isHorizontal ? rect.x : rect.y);\n };\n\n Single.prototype._updateAxisTransform = function (axis, coordBase) {\n var axisExtent = axis.getExtent();\n var extentSum = axisExtent[0] + axisExtent[1];\n var isHorizontal = axis.isHorizontal();\n axis.toGlobalCoord = isHorizontal ? function (coord) {\n return coord + coordBase;\n } : function (coord) {\n return extentSum - coord + coordBase;\n };\n axis.toLocalCoord = isHorizontal ? function (coord) {\n return coord - coordBase;\n } : function (coord) {\n return extentSum - coord + coordBase;\n };\n };\n /**\n * Get axis.\n */\n\n\n Single.prototype.getAxis = function () {\n return this._axis;\n };\n /**\n * Get axis, add it just for draw tooltip.\n */\n\n\n Single.prototype.getBaseAxis = function () {\n return this._axis;\n };\n\n Single.prototype.getAxes = function () {\n return [this._axis];\n };\n\n Single.prototype.getTooltipAxes = function () {\n return {\n baseAxes: [this.getAxis()],\n // Empty otherAxes\n otherAxes: []\n };\n };\n /**\n * If contain point.\n */\n\n\n Single.prototype.containPoint = function (point) {\n var rect = this.getRect();\n var axis = this.getAxis();\n var orient = axis.orient;\n\n if (orient === 'horizontal') {\n return axis.contain(axis.toLocalCoord(point[0])) && point[1] >= rect.y && point[1] <= rect.y + rect.height;\n } else {\n return axis.contain(axis.toLocalCoord(point[1])) && point[0] >= rect.y && point[0] <= rect.y + rect.height;\n }\n };\n\n Single.prototype.pointToData = function (point) {\n var axis = this.getAxis();\n return [axis.coordToData(axis.toLocalCoord(point[axis.orient === 'horizontal' ? 0 : 1]))];\n };\n /**\n * Convert the series data to concrete point.\n * Can be [val] | val\n */\n\n\n Single.prototype.dataToPoint = function (val) {\n var axis = this.getAxis();\n var rect = this.getRect();\n var pt = [];\n var idx = axis.orient === 'horizontal' ? 0 : 1;\n\n if (val instanceof Array) {\n val = val[0];\n }\n\n pt[idx] = axis.toGlobalCoord(axis.dataToCoord(+val));\n pt[1 - idx] = idx === 0 ? rect.y + rect.height / 2 : rect.x + rect.width / 2;\n return pt;\n };\n\n Single.prototype.convertToPixel = function (ecModel, finder, value) {\n var coordSys = getCoordSys(finder);\n return coordSys === this ? this.dataToPoint(value) : null;\n };\n\n Single.prototype.convertFromPixel = function (ecModel, finder, pixel) {\n var coordSys = getCoordSys(finder);\n return coordSys === this ? this.pointToData(pixel) : null;\n };\n\n return Single;\n}();\n\nfunction getCoordSys(finder) {\n var seriesModel = finder.seriesModel;\n var singleModel = finder.singleAxisModel;\n return singleModel && singleModel.coordinateSystem || seriesModel && seriesModel.coordinateSystem;\n}\n\nexport default Single;"]},"metadata":{},"sourceType":"module"}