1 line
27 KiB
JSON
1 line
27 KiB
JSON
{"ast":null,"code":"/*\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 * 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';\nimport * as cartesianAxisHelper from '../../coord/cartesian/cartesianAxisHelper.js';\nimport { rectCoordAxisBuildSplitArea, rectCoordAxisHandleRemove } from './axisSplitHelper.js';\nimport { isIntervalOrLogScale } from '../../scale/helper.js';\nvar axisBuilderAttrs = ['axisLine', 'axisTickLabel', 'axisName'];\nvar selfBuilderAttrs = ['splitArea', 'splitLine', 'minorSplitLine'];\n\nvar CartesianAxisView =\n/** @class */\nfunction (_super) {\n __extends(CartesianAxisView, _super);\n\n function CartesianAxisView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = CartesianAxisView.type;\n _this.axisPointerClass = 'CartesianAxisPointer';\n return _this;\n }\n /**\r\n * @override\r\n */\n\n\n CartesianAxisView.prototype.render = function (axisModel, ecModel, api, payload) {\n this.group.removeAll();\n var oldAxisGroup = this._axisGroup;\n this._axisGroup = new graphic.Group();\n this.group.add(this._axisGroup);\n\n if (!axisModel.get('show')) {\n return;\n }\n\n var gridModel = axisModel.getCoordSysModel();\n var layout = cartesianAxisHelper.layout(gridModel, axisModel);\n var axisBuilder = new AxisBuilder(axisModel, zrUtil.extend({\n handleAutoShown: function handleAutoShown(elementType) {\n var cartesians = gridModel.coordinateSystem.getCartesians();\n\n for (var i = 0; i < cartesians.length; i++) {\n if (isIntervalOrLogScale(cartesians[i].getOtherAxis(axisModel.axis).scale)) {\n // Still show axis tick or axisLine if other axis is value / log\n return true;\n }\n } // Not show axisTick or axisLine if other axis is category / time\n\n\n return false;\n }\n }, layout));\n zrUtil.each(axisBuilderAttrs, axisBuilder.add, axisBuilder);\n\n this._axisGroup.add(axisBuilder.getGroup());\n\n zrUtil.each(selfBuilderAttrs, function (name) {\n if (axisModel.get([name, 'show'])) {\n axisElementBuilders[name](this, this._axisGroup, axisModel, gridModel);\n }\n }, this); // THIS is a special case for bar racing chart.\n // Update the axis label from the natural initial layout to\n // sorted layout should has no animation.\n\n var isInitialSortFromBarRacing = payload && payload.type === 'changeAxisOrder' && payload.isInitSort;\n\n if (!isInitialSortFromBarRacing) {\n graphic.groupTransition(oldAxisGroup, this._axisGroup, axisModel);\n }\n\n _super.prototype.render.call(this, axisModel, ecModel, api, payload);\n };\n\n CartesianAxisView.prototype.remove = function () {\n rectCoordAxisHandleRemove(this);\n };\n\n CartesianAxisView.type = 'cartesianAxis';\n return CartesianAxisView;\n}(AxisView);\n\nvar axisElementBuilders = {\n splitLine: function splitLine(axisView, axisGroup, axisModel, gridModel) {\n var axis = axisModel.axis;\n\n if (axis.scale.isBlank()) {\n return;\n }\n\n var splitLineModel = axisModel.getModel('splitLine');\n var lineStyleModel = splitLineModel.getModel('lineStyle');\n var lineColors = lineStyleModel.get('color');\n lineColors = zrUtil.isArray(lineColors) ? lineColors : [lineColors];\n var gridRect = gridModel.coordinateSystem.getRect();\n var isHorizontal = axis.isHorizontal();\n var lineCount = 0;\n var ticksCoords = axis.getTicksCoords({\n tickModel: splitLineModel\n });\n var p1 = [];\n var p2 = [];\n var lineStyle = lineStyleModel.getLineStyle();\n\n for (var i = 0; i < ticksCoords.length; i++) {\n var tickCoord = axis.toGlobalCoord(ticksCoords[i].coord);\n\n if (isHorizontal) {\n p1[0] = tickCoord;\n p1[1] = gridRect.y;\n p2[0] = tickCoord;\n p2[1] = gridRect.y + gridRect.height;\n } else {\n p1[0] = gridRect.x;\n p1[1] = tickCoord;\n p2[0] = gridRect.x + gridRect.width;\n p2[1] = tickCoord;\n }\n\n var colorIndex = lineCount++ % lineColors.length;\n var tickValue = ticksCoords[i].tickValue;\n axisGroup.add(new graphic.Line({\n anid: tickValue != null ? 'line_' + ticksCoords[i].tickValue : null,\n subPixelOptimize: true,\n autoBatch: true,\n shape: {\n x1: p1[0],\n y1: p1[1],\n x2: p2[0],\n y2: p2[1]\n },\n style: zrUtil.defaults({\n stroke: lineColors[colorIndex]\n }, lineStyle),\n silent: true\n }));\n }\n },\n minorSplitLine: function minorSplitLine(axisView, axisGroup, axisModel, gridModel) {\n var axis = axisModel.axis;\n var minorSplitLineModel = axisModel.getModel('minorSplitLine');\n var lineStyleModel = minorSplitLineModel.getModel('lineStyle');\n var gridRect = gridModel.coordinateSystem.getRect();\n var isHorizontal = axis.isHorizontal();\n var minorTicksCoords = axis.getMinorTicksCoords();\n\n if (!minorTicksCoords.length) {\n return;\n }\n\n var p1 = [];\n var p2 = [];\n var lineStyle = lineStyleModel.getLineStyle();\n\n for (var i = 0; i < minorTicksCoords.length; i++) {\n for (var k = 0; k < minorTicksCoords[i].length; k++) {\n var tickCoord = axis.toGlobalCoord(minorTicksCoords[i][k].coord);\n\n if (isHorizontal) {\n p1[0] = tickCoord;\n p1[1] = gridRect.y;\n p2[0] = tickCoord;\n p2[1] = gridRect.y + gridRect.height;\n } else {\n p1[0] = gridRect.x;\n p1[1] = tickCoord;\n p2[0] = gridRect.x + gridRect.width;\n p2[1] = tickCoord;\n }\n\n axisGroup.add(new graphic.Line({\n anid: 'minor_line_' + minorTicksCoords[i][k].tickValue,\n subPixelOptimize: true,\n autoBatch: true,\n shape: {\n x1: p1[0],\n y1: p1[1],\n x2: p2[0],\n y2: p2[1]\n },\n style: lineStyle,\n silent: true\n }));\n }\n }\n },\n splitArea: function splitArea(axisView, axisGroup, axisModel, gridModel) {\n rectCoordAxisBuildSplitArea(axisView, axisGroup, axisModel, gridModel);\n }\n};\n\nvar CartesianXAxisView =\n/** @class */\nfunction (_super) {\n __extends(CartesianXAxisView, _super);\n\n function CartesianXAxisView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = CartesianXAxisView.type;\n return _this;\n }\n\n CartesianXAxisView.type = 'xAxis';\n return CartesianXAxisView;\n}(CartesianAxisView);\n\nexport { CartesianXAxisView };\n\nvar CartesianYAxisView =\n/** @class */\nfunction (_super) {\n __extends(CartesianYAxisView, _super);\n\n function CartesianYAxisView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = CartesianXAxisView.type;\n return _this;\n }\n\n CartesianYAxisView.type = 'yAxis';\n return CartesianYAxisView;\n}(CartesianAxisView);\n\nexport { CartesianYAxisView };\nexport default CartesianAxisView;","map":{"version":3,"sources":["D:/Work/WorkSpace/GitWorkSpace/TenShop/resource/ElectronicMall/src/qingge-Market/qingge-vue/node_modules/echarts/lib/component/axis/CartesianAxisView.js"],"names":["__extends","zrUtil","graphic","AxisBuilder","AxisView","cartesianAxisHelper","rectCoordAxisBuildSplitArea","rectCoordAxisHandleRemove","isIntervalOrLogScale","axisBuilderAttrs","selfBuilderAttrs","CartesianAxisView","_super","_this","apply","arguments","type","axisPointerClass","prototype","render","axisModel","ecModel","api","payload","group","removeAll","oldAxisGroup","_axisGroup","Group","add","get","gridModel","getCoordSysModel","layout","axisBuilder","extend","handleAutoShown","elementType","cartesians","coordinateSystem","getCartesians","i","length","getOtherAxis","axis","scale","each","getGroup","name","axisElementBuilders","isInitialSortFromBarRacing","isInitSort","groupTransition","call","remove","splitLine","axisView","axisGroup","isBlank","splitLineModel","getModel","lineStyleModel","lineColors","isArray","gridRect","getRect","isHorizontal","lineCount","ticksCoords","getTicksCoords","tickModel","p1","p2","lineStyle","getLineStyle","tickCoord","toGlobalCoord","coord","y","height","x","width","colorIndex","tickValue","Line","anid","subPixelOptimize","autoBatch","shape","x1","y1","x2","y2","style","defaults","stroke","silent","minorSplitLine","minorSplitLineModel","minorTicksCoords","getMinorTicksCoords","k","splitArea","CartesianXAxisView","CartesianYAxisView"],"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,OAAO,KAAKC,MAAZ,MAAwB,0BAAxB;AACA,OAAO,KAAKC,OAAZ,MAAyB,uBAAzB;AACA,OAAOC,WAAP,MAAwB,kBAAxB;AACA,OAAOC,QAAP,MAAqB,eAArB;AACA,OAAO,KAAKC,mBAAZ,MAAqC,8CAArC;AACA,SAASC,2BAAT,EAAsCC,yBAAtC,QAAuE,sBAAvE;AACA,SAASC,oBAAT,QAAqC,uBAArC;AACA,IAAIC,gBAAgB,GAAG,CAAC,UAAD,EAAa,eAAb,EAA8B,UAA9B,CAAvB;AACA,I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BAAf","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 * as zrUtil from 'zrender/lib/core/util.js';\r\nimport * as graphic from '../../util/graphic.js';\r\nimport AxisBuilder from './AxisBuilder.js';\r\nimport AxisView from './AxisView.js';\r\nimport * as cartesianAxisHelper from '../../coord/cartesian/cartesianAxisHelper.js';\r\nimport { rectCoordAxisBuildSplitArea, rectCoordAxisHandleRemove } from './axisSplitHelper.js';\r\nimport { isIntervalOrLogScale } from '../../scale/helper.js';\r\nvar axisBuilderAttrs = ['axisLine', 'axisTickLabel', 'axisName'];\r\nvar selfBuilderAttrs = ['splitArea', 'splitLine', 'minorSplitLine'];\r\n\r\nvar CartesianAxisView =\r\n/** @class */\r\nfunction (_super) {\r\n __extends(CartesianAxisView, _super);\r\n\r\n function CartesianAxisView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n\r\n _this.type = CartesianAxisView.type;\r\n _this.axisPointerClass = 'CartesianAxisPointer';\r\n return _this;\r\n }\r\n /**\r\n * @override\r\n */\r\n\r\n\r\n CartesianAxisView.prototype.render = function (axisModel, ecModel, api, payload) {\r\n this.group.removeAll();\r\n var oldAxisGroup = this._axisGroup;\r\n this._axisGroup = new graphic.Group();\r\n this.group.add(this._axisGroup);\r\n\r\n if (!axisModel.get('show')) {\r\n return;\r\n }\r\n\r\n var gridModel = axisModel.getCoordSysModel();\r\n var layout = cartesianAxisHelper.layout(gridModel, axisModel);\r\n var axisBuilder = new AxisBuilder(axisModel, zrUtil.extend({\r\n handleAutoShown: function (elementType) {\r\n var cartesians = gridModel.coordinateSystem.getCartesians();\r\n\r\n for (var i = 0; i < cartesians.length; i++) {\r\n if (isIntervalOrLogScale(cartesians[i].getOtherAxis(axisModel.axis).scale)) {\r\n // Still show axis tick or axisLine if other axis is value / log\r\n return true;\r\n }\r\n } // Not show axisTick or axisLine if other axis is category / time\r\n\r\n\r\n return false;\r\n }\r\n }, layout));\r\n zrUtil.each(axisBuilderAttrs, axisBuilder.add, axisBuilder);\r\n\r\n this._axisGroup.add(axisBuilder.getGroup());\r\n\r\n zrUtil.each(selfBuilderAttrs, function (name) {\r\n if (axisModel.get([name, 'show'])) {\r\n axisElementBuilders[name](this, this._axisGroup, axisModel, gridModel);\r\n }\r\n }, this); // THIS is a special case for bar racing chart.\r\n // Update the axis label from the natural initial layout to\r\n // sorted layout should has no animation.\r\n\r\n var isInitialSortFromBarRacing = payload && payload.type === 'changeAxisOrder' && payload.isInitSort;\r\n\r\n if (!isInitialSortFromBarRacing) {\r\n graphic.groupTransition(oldAxisGroup, this._axisGroup, axisModel);\r\n }\r\n\r\n _super.prototype.render.call(this, axisModel, ecModel, api, payload);\r\n };\r\n\r\n CartesianAxisView.prototype.remove = function () {\r\n rectCoordAxisHandleRemove(this);\r\n };\r\n\r\n CartesianAxisView.type = 'cartesianAxis';\r\n return CartesianAxisView;\r\n}(AxisView);\r\n\r\nvar axisElementBuilders = {\r\n splitLine: function (axisView, axisGroup, axisModel, gridModel) {\r\n var axis = axisModel.axis;\r\n\r\n if (axis.scale.isBlank()) {\r\n return;\r\n }\r\n\r\n var splitLineModel = axisModel.getModel('splitLine');\r\n var lineStyleModel = splitLineModel.getModel('lineStyle');\r\n var lineColors = lineStyleModel.get('color');\r\n lineColors = zrUtil.isArray(lineColors) ? lineColors : [lineColors];\r\n var gridRect = gridModel.coordinateSystem.getRect();\r\n var isHorizontal = axis.isHorizontal();\r\n var lineCount = 0;\r\n var ticksCoords = axis.getTicksCoords({\r\n tickModel: splitLineModel\r\n });\r\n var p1 = [];\r\n var p2 = [];\r\n var lineStyle = lineStyleModel.getLineStyle();\r\n\r\n for (var i = 0; i < ticksCoords.length; i++) {\r\n var tickCoord = axis.toGlobalCoord(ticksCoords[i].coord);\r\n\r\n if (isHorizontal) {\r\n p1[0] = tickCoord;\r\n p1[1] = gridRect.y;\r\n p2[0] = tickCoord;\r\n p2[1] = gridRect.y + gridRect.height;\r\n } else {\r\n p1[0] = gridRect.x;\r\n p1[1] = tickCoord;\r\n p2[0] = gridRect.x + gridRect.width;\r\n p2[1] = tickCoord;\r\n }\r\n\r\n var colorIndex = lineCount++ % lineColors.length;\r\n var tickValue = ticksCoords[i].tickValue;\r\n axisGroup.add(new graphic.Line({\r\n anid: tickValue != null ? 'line_' + ticksCoords[i].tickValue : null,\r\n subPixelOptimize: true,\r\n autoBatch: true,\r\n shape: {\r\n x1: p1[0],\r\n y1: p1[1],\r\n x2: p2[0],\r\n y2: p2[1]\r\n },\r\n style: zrUtil.defaults({\r\n stroke: lineColors[colorIndex]\r\n }, lineStyle),\r\n silent: true\r\n }));\r\n }\r\n },\r\n minorSplitLine: function (axisView, axisGroup, axisModel, gridModel) {\r\n var axis = axisModel.axis;\r\n var minorSplitLineModel = axisModel.getModel('minorSplitLine');\r\n var lineStyleModel = minorSplitLineModel.getModel('lineStyle');\r\n var gridRect = gridModel.coordinateSystem.getRect();\r\n var isHorizontal = axis.isHorizontal();\r\n var minorTicksCoords = axis.getMinorTicksCoords();\r\n\r\n if (!minorTicksCoords.length) {\r\n return;\r\n }\r\n\r\n var p1 = [];\r\n var p2 = [];\r\n var lineStyle = lineStyleModel.getLineStyle();\r\n\r\n for (var i = 0; i < minorTicksCoords.length; i++) {\r\n for (var k = 0; k < minorTicksCoords[i].length; k++) {\r\n var tickCoord = axis.toGlobalCoord(minorTicksCoords[i][k].coord);\r\n\r\n if (isHorizontal) {\r\n p1[0] = tickCoord;\r\n p1[1] = gridRect.y;\r\n p2[0] = tickCoord;\r\n p2[1] = gridRect.y + gridRect.height;\r\n } else {\r\n p1[0] = gridRect.x;\r\n p1[1] = tickCoord;\r\n p2[0] = gridRect.x + gridRect.width;\r\n p2[1] = tickCoord;\r\n }\r\n\r\n axisGroup.add(new graphic.Line({\r\n anid: 'minor_line_' + minorTicksCoords[i][k].tickValue,\r\n subPixelOptimize: true,\r\n autoBatch: true,\r\n shape: {\r\n x1: p1[0],\r\n y1: p1[1],\r\n x2: p2[0],\r\n y2: p2[1]\r\n },\r\n style: lineStyle,\r\n silent: true\r\n }));\r\n }\r\n }\r\n },\r\n splitArea: function (axisView, axisGroup, axisModel, gridModel) {\r\n rectCoordAxisBuildSplitArea(axisView, axisGroup, axisModel, gridModel);\r\n }\r\n};\r\n\r\nvar CartesianXAxisView =\r\n/** @class */\r\nfunction (_super) {\r\n __extends(CartesianXAxisView, _super);\r\n\r\n function CartesianXAxisView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n\r\n _this.type = CartesianXAxisView.type;\r\n return _this;\r\n }\r\n\r\n CartesianXAxisView.type = 'xAxis';\r\n return CartesianXAxisView;\r\n}(CartesianAxisView);\r\n\r\nexport { CartesianXAxisView };\r\n\r\nvar CartesianYAxisView =\r\n/** @class */\r\nfunction (_super) {\r\n __extends(CartesianYAxisView, _super);\r\n\r\n function CartesianYAxisView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n\r\n _this.type = CartesianXAxisView.type;\r\n return _this;\r\n }\r\n\r\n CartesianYAxisView.type = 'yAxis';\r\n return CartesianYAxisView;\r\n}(CartesianAxisView);\r\n\r\nexport { CartesianYAxisView };\r\nexport default CartesianAxisView;"]},"metadata":{},"sourceType":"module"} |