1 line
23 KiB
JSON
1 line
23 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 { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as graphic from '../../util/graphic.js';\nimport AxisBuilder from './AxisBuilder.js';\nimport AxisView from './AxisView.js';\nvar axisBuilderAttrs = ['axisLine', 'axisTickLabel', 'axisName'];\nvar selfBuilderAttrs = ['splitLine', 'splitArea', 'minorSplitLine'];\n\nvar RadiusAxisView =\n/** @class */\nfunction (_super) {\n __extends(RadiusAxisView, _super);\n\n function RadiusAxisView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = RadiusAxisView.type;\n _this.axisPointerClass = 'PolarAxisPointer';\n return _this;\n }\n\n RadiusAxisView.prototype.render = function (radiusAxisModel, ecModel) {\n this.group.removeAll();\n\n if (!radiusAxisModel.get('show')) {\n return;\n }\n\n var oldAxisGroup = this._axisGroup;\n var newAxisGroup = this._axisGroup = new graphic.Group();\n this.group.add(newAxisGroup);\n var radiusAxis = radiusAxisModel.axis;\n var polar = radiusAxis.polar;\n var angleAxis = polar.getAngleAxis();\n var ticksCoords = radiusAxis.getTicksCoords();\n var minorTicksCoords = radiusAxis.getMinorTicksCoords();\n var axisAngle = angleAxis.getExtent()[0];\n var radiusExtent = radiusAxis.getExtent();\n var layout = layoutAxis(polar, radiusAxisModel, axisAngle);\n var axisBuilder = new AxisBuilder(radiusAxisModel, layout);\n zrUtil.each(axisBuilderAttrs, axisBuilder.add, axisBuilder);\n newAxisGroup.add(axisBuilder.getGroup());\n graphic.groupTransition(oldAxisGroup, newAxisGroup, radiusAxisModel);\n zrUtil.each(selfBuilderAttrs, function (name) {\n if (radiusAxisModel.get([name, 'show']) && !radiusAxis.scale.isBlank()) {\n axisElementBuilders[name](this.group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords, minorTicksCoords);\n }\n }, this);\n };\n\n RadiusAxisView.type = 'radiusAxis';\n return RadiusAxisView;\n}(AxisView);\n\nvar axisElementBuilders = {\n splitLine: function splitLine(group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords) {\n var splitLineModel = radiusAxisModel.getModel('splitLine');\n var lineStyleModel = splitLineModel.getModel('lineStyle');\n var lineColors = lineStyleModel.get('color');\n var lineCount = 0;\n lineColors = lineColors instanceof Array ? lineColors : [lineColors];\n var splitLines = [];\n\n for (var i = 0; i < ticksCoords.length; i++) {\n var colorIndex = lineCount++ % lineColors.length;\n splitLines[colorIndex] = splitLines[colorIndex] || [];\n splitLines[colorIndex].push(new graphic.Circle({\n shape: {\n cx: polar.cx,\n cy: polar.cy,\n // ensure circle radius >= 0\n r: Math.max(ticksCoords[i].coord, 0)\n }\n }));\n } // Simple optimization\n // Batching the lines if color are the same\n\n\n for (var i = 0; i < splitLines.length; i++) {\n group.add(graphic.mergePath(splitLines[i], {\n style: zrUtil.defaults({\n stroke: lineColors[i % lineColors.length],\n fill: null\n }, lineStyleModel.getLineStyle()),\n silent: true\n }));\n }\n },\n minorSplitLine: function minorSplitLine(group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords, minorTicksCoords) {\n if (!minorTicksCoords.length) {\n return;\n }\n\n var minorSplitLineModel = radiusAxisModel.getModel('minorSplitLine');\n var lineStyleModel = minorSplitLineModel.getModel('lineStyle');\n var lines = [];\n\n for (var i = 0; i < minorTicksCoords.length; i++) {\n for (var k = 0; k < minorTicksCoords[i].length; k++) {\n lines.push(new graphic.Circle({\n shape: {\n cx: polar.cx,\n cy: polar.cy,\n r: minorTicksCoords[i][k].coord\n }\n }));\n }\n }\n\n group.add(graphic.mergePath(lines, {\n style: zrUtil.defaults({\n fill: null\n }, lineStyleModel.getLineStyle()),\n silent: true\n }));\n },\n splitArea: function splitArea(group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords) {\n if (!ticksCoords.length) {\n return;\n }\n\n var splitAreaModel = radiusAxisModel.getModel('splitArea');\n var areaStyleModel = splitAreaModel.getModel('areaStyle');\n var areaColors = areaStyleModel.get('color');\n var lineCount = 0;\n areaColors = areaColors instanceof Array ? areaColors : [areaColors];\n var splitAreas = [];\n var prevRadius = ticksCoords[0].coord;\n\n for (var i = 1; i < ticksCoords.length; i++) {\n var colorIndex = lineCount++ % areaColors.length;\n splitAreas[colorIndex] = splitAreas[colorIndex] || [];\n splitAreas[colorIndex].push(new graphic.Sector({\n shape: {\n cx: polar.cx,\n cy: polar.cy,\n r0: prevRadius,\n r: ticksCoords[i].coord,\n startAngle: 0,\n endAngle: Math.PI * 2\n },\n silent: true\n }));\n prevRadius = ticksCoords[i].coord;\n } // Simple optimization\n // Batching the lines if color are the same\n\n\n for (var i = 0; i < splitAreas.length; i++) {\n group.add(graphic.mergePath(splitAreas[i], {\n style: zrUtil.defaults({\n fill: areaColors[i % areaColors.length]\n }, areaStyleModel.getAreaStyle()),\n silent: true\n }));\n }\n }\n};\n/**\n * @inner\n */\n\nfunction layoutAxis(polar, radiusAxisModel, axisAngle) {\n return {\n position: [polar.cx, polar.cy],\n rotation: axisAngle / 180 * Math.PI,\n labelDirection: -1,\n tickDirection: -1,\n nameDirection: 1,\n labelRotate: radiusAxisModel.getModel('axisLabel').get('rotate'),\n // Over splitLine and splitArea\n z2: 1\n };\n}\n\nexport default RadiusAxisView;","map":{"version":3,"sources":["D:/Work/WorkSpace/GitWorkSpace/TenShop/resource/ElectronicMall/src/ElectronicMallVue/node_modules/echarts/lib/component/axis/RadiusAxisView.js"],"names":["__extends","zrUtil","graphic","AxisBuilder","AxisView","axisBuilderAttrs","selfBuilderAttrs","RadiusAxisView","_super","_this","apply","arguments","type","axisPointerClass","prototype","render","radiusAxisModel","ecModel","group","removeAll","get","oldAxisGroup","_axisGroup","newAxisGroup","Group","add","radiusAxis","axis","polar","angleAxis","getAngleAxis","ticksCoords","getTicksCoords","minorTicksCoords","getMinorTicksCoords","axisAngle","getExtent","radiusExtent","layout","layoutAxis","axisBuilder","each","getGroup","groupTransition","name","scale","isBlank","axisElementBuilders","splitLine","splitLineModel","getModel","lineStyleModel","lineColors","lineCount","Array","splitLines","i","length","colorIndex","push","Circle","shape","cx","cy","r","Math","max","coord","mergePath","style","defaults","stroke","fill","getLineStyle","silent","minorSplitLine","minorSplitLineModel","lines","k","splitArea","splitAreaModel","areaStyleModel","areaColors","splitAreas","prevRadius","Sector","r0","startAngle","endAngle","PI","getAreaStyle","position","rotation","labelDirection","tickDirection","nameDirection","labelRotate","z2"],"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,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ACwB,EAF5B;AAGLI,IAAAA,cAAc,EAAE,CAAC,CAHZ;AAILC,IAAAA,aAAa,EAAE,CAAC,CAJX;AAKLC,IAAAA,aAAa,EAAE,CALV;AAMLC,IAAAA,WAAW,EAAEhF,eAAe,CAACkC,QAAhB,CAAyB,WAAzB,EAAsC9B,GAAtC,CAA0C,QAA1C,CANR;AAOL;AACA6E,IAAAA,EAAE,EAAE;AARC,GAAP;AAUD;;AAED,eAAe1F,cAAf","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 zrUtil from 'zrender/lib/core/util.js';\nimport * as graphic from '../../util/graphic.js';\nimport AxisBuilder from './AxisBuilder.js';\nimport AxisView from './AxisView.js';\nvar axisBuilderAttrs = ['axisLine', 'axisTickLabel', 'axisName'];\nvar selfBuilderAttrs = ['splitLine', 'splitArea', 'minorSplitLine'];\n\nvar RadiusAxisView =\n/** @class */\nfunction (_super) {\n __extends(RadiusAxisView, _super);\n\n function RadiusAxisView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = RadiusAxisView.type;\n _this.axisPointerClass = 'PolarAxisPointer';\n return _this;\n }\n\n RadiusAxisView.prototype.render = function (radiusAxisModel, ecModel) {\n this.group.removeAll();\n\n if (!radiusAxisModel.get('show')) {\n return;\n }\n\n var oldAxisGroup = this._axisGroup;\n var newAxisGroup = this._axisGroup = new graphic.Group();\n this.group.add(newAxisGroup);\n var radiusAxis = radiusAxisModel.axis;\n var polar = radiusAxis.polar;\n var angleAxis = polar.getAngleAxis();\n var ticksCoords = radiusAxis.getTicksCoords();\n var minorTicksCoords = radiusAxis.getMinorTicksCoords();\n var axisAngle = angleAxis.getExtent()[0];\n var radiusExtent = radiusAxis.getExtent();\n var layout = layoutAxis(polar, radiusAxisModel, axisAngle);\n var axisBuilder = new AxisBuilder(radiusAxisModel, layout);\n zrUtil.each(axisBuilderAttrs, axisBuilder.add, axisBuilder);\n newAxisGroup.add(axisBuilder.getGroup());\n graphic.groupTransition(oldAxisGroup, newAxisGroup, radiusAxisModel);\n zrUtil.each(selfBuilderAttrs, function (name) {\n if (radiusAxisModel.get([name, 'show']) && !radiusAxis.scale.isBlank()) {\n axisElementBuilders[name](this.group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords, minorTicksCoords);\n }\n }, this);\n };\n\n RadiusAxisView.type = 'radiusAxis';\n return RadiusAxisView;\n}(AxisView);\n\nvar axisElementBuilders = {\n splitLine: function (group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords) {\n var splitLineModel = radiusAxisModel.getModel('splitLine');\n var lineStyleModel = splitLineModel.getModel('lineStyle');\n var lineColors = lineStyleModel.get('color');\n var lineCount = 0;\n lineColors = lineColors instanceof Array ? lineColors : [lineColors];\n var splitLines = [];\n\n for (var i = 0; i < ticksCoords.length; i++) {\n var colorIndex = lineCount++ % lineColors.length;\n splitLines[colorIndex] = splitLines[colorIndex] || [];\n splitLines[colorIndex].push(new graphic.Circle({\n shape: {\n cx: polar.cx,\n cy: polar.cy,\n // ensure circle radius >= 0\n r: Math.max(ticksCoords[i].coord, 0)\n }\n }));\n } // Simple optimization\n // Batching the lines if color are the same\n\n\n for (var i = 0; i < splitLines.length; i++) {\n group.add(graphic.mergePath(splitLines[i], {\n style: zrUtil.defaults({\n stroke: lineColors[i % lineColors.length],\n fill: null\n }, lineStyleModel.getLineStyle()),\n silent: true\n }));\n }\n },\n minorSplitLine: function (group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords, minorTicksCoords) {\n if (!minorTicksCoords.length) {\n return;\n }\n\n var minorSplitLineModel = radiusAxisModel.getModel('minorSplitLine');\n var lineStyleModel = minorSplitLineModel.getModel('lineStyle');\n var lines = [];\n\n for (var i = 0; i < minorTicksCoords.length; i++) {\n for (var k = 0; k < minorTicksCoords[i].length; k++) {\n lines.push(new graphic.Circle({\n shape: {\n cx: polar.cx,\n cy: polar.cy,\n r: minorTicksCoords[i][k].coord\n }\n }));\n }\n }\n\n group.add(graphic.mergePath(lines, {\n style: zrUtil.defaults({\n fill: null\n }, lineStyleModel.getLineStyle()),\n silent: true\n }));\n },\n splitArea: function (group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords) {\n if (!ticksCoords.length) {\n return;\n }\n\n var splitAreaModel = radiusAxisModel.getModel('splitArea');\n var areaStyleModel = splitAreaModel.getModel('areaStyle');\n var areaColors = areaStyleModel.get('color');\n var lineCount = 0;\n areaColors = areaColors instanceof Array ? areaColors : [areaColors];\n var splitAreas = [];\n var prevRadius = ticksCoords[0].coord;\n\n for (var i = 1; i < ticksCoords.length; i++) {\n var colorIndex = lineCount++ % areaColors.length;\n splitAreas[colorIndex] = splitAreas[colorIndex] || [];\n splitAreas[colorIndex].push(new graphic.Sector({\n shape: {\n cx: polar.cx,\n cy: polar.cy,\n r0: prevRadius,\n r: ticksCoords[i].coord,\n startAngle: 0,\n endAngle: Math.PI * 2\n },\n silent: true\n }));\n prevRadius = ticksCoords[i].coord;\n } // Simple optimization\n // Batching the lines if color are the same\n\n\n for (var i = 0; i < splitAreas.length; i++) {\n group.add(graphic.mergePath(splitAreas[i], {\n style: zrUtil.defaults({\n fill: areaColors[i % areaColors.length]\n }, areaStyleModel.getAreaStyle()),\n silent: true\n }));\n }\n }\n};\n/**\n * @inner\n */\n\nfunction layoutAxis(polar, radiusAxisModel, axisAngle) {\n return {\n position: [polar.cx, polar.cy],\n rotation: axisAngle / 180 * Math.PI,\n labelDirection: -1,\n tickDirection: -1,\n nameDirection: 1,\n labelRotate: radiusAxisModel.getModel('axisLabel').get('rotate'),\n // Over splitLine and splitArea\n z2: 1\n };\n}\n\nexport default RadiusAxisView;"]},"metadata":{},"sourceType":"module"} |