1 line
28 KiB
JSON
1 line
28 KiB
JSON
{"ast":null,"code":"import \"core-js/modules/es.array.fill.js\";\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 * 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 graphic from '../../util/graphic.js';\nimport { setStatesStylesFromModel, toggleHoverEmphasis } from '../../util/states.js';\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as symbolUtil from '../../util/symbol.js';\nimport ChartView from '../../view/Chart.js';\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle.js';\nimport ZRImage from 'zrender/lib/graphic/Image.js';\nimport { saveOldStyle } from '../../animation/basicTransition.js';\n\nvar RadarView =\n/** @class */\nfunction (_super) {\n __extends(RadarView, _super);\n\n function RadarView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = RadarView.type;\n return _this;\n }\n\n RadarView.prototype.render = function (seriesModel, ecModel, api) {\n var polar = seriesModel.coordinateSystem;\n var group = this.group;\n var data = seriesModel.getData();\n var oldData = this._data;\n\n function createSymbol(data, idx) {\n var symbolType = data.getItemVisual(idx, 'symbol') || 'circle';\n\n if (symbolType === 'none') {\n return;\n }\n\n var symbolSize = symbolUtil.normalizeSymbolSize(data.getItemVisual(idx, 'symbolSize'));\n var symbolPath = symbolUtil.createSymbol(symbolType, -1, -1, 2, 2);\n var symbolRotate = data.getItemVisual(idx, 'symbolRotate') || 0;\n symbolPath.attr({\n style: {\n strokeNoScale: true\n },\n z2: 100,\n scaleX: symbolSize[0] / 2,\n scaleY: symbolSize[1] / 2,\n rotation: symbolRotate * Math.PI / 180 || 0\n });\n return symbolPath;\n }\n\n function updateSymbols(oldPoints, newPoints, symbolGroup, data, idx, isInit) {\n // Simply rerender all\n symbolGroup.removeAll();\n\n for (var i = 0; i < newPoints.length - 1; i++) {\n var symbolPath = createSymbol(data, idx);\n\n if (symbolPath) {\n symbolPath.__dimIdx = i;\n\n if (oldPoints[i]) {\n symbolPath.setPosition(oldPoints[i]);\n graphic[isInit ? 'initProps' : 'updateProps'](symbolPath, {\n x: newPoints[i][0],\n y: newPoints[i][1]\n }, seriesModel, idx);\n } else {\n symbolPath.setPosition(newPoints[i]);\n }\n\n symbolGroup.add(symbolPath);\n }\n }\n }\n\n function getInitialPoints(points) {\n return zrUtil.map(points, function (pt) {\n return [polar.cx, polar.cy];\n });\n }\n\n data.diff(oldData).add(function (idx) {\n var points = data.getItemLayout(idx);\n\n if (!points) {\n return;\n }\n\n var polygon = new graphic.Polygon();\n var polyline = new graphic.Polyline();\n var target = {\n shape: {\n points: points\n }\n };\n polygon.shape.points = getInitialPoints(points);\n polyline.shape.points = getInitialPoints(points);\n graphic.initProps(polygon, target, seriesModel, idx);\n graphic.initProps(polyline, target, seriesModel, idx);\n var itemGroup = new graphic.Group();\n var symbolGroup = new graphic.Group();\n itemGroup.add(polyline);\n itemGroup.add(polygon);\n itemGroup.add(symbolGroup);\n updateSymbols(polyline.shape.points, points, symbolGroup, data, idx, true);\n data.setItemGraphicEl(idx, itemGroup);\n }).update(function (newIdx, oldIdx) {\n var itemGroup = oldData.getItemGraphicEl(oldIdx);\n var polyline = itemGroup.childAt(0);\n var polygon = itemGroup.childAt(1);\n var symbolGroup = itemGroup.childAt(2);\n var target = {\n shape: {\n points: data.getItemLayout(newIdx)\n }\n };\n\n if (!target.shape.points) {\n return;\n }\n\n updateSymbols(polyline.shape.points, target.shape.points, symbolGroup, data, newIdx, false);\n saveOldStyle(polygon);\n saveOldStyle(polyline);\n graphic.updateProps(polyline, target, seriesModel);\n graphic.updateProps(polygon, target, seriesModel);\n data.setItemGraphicEl(newIdx, itemGroup);\n }).remove(function (idx) {\n group.remove(oldData.getItemGraphicEl(idx));\n }).execute();\n data.eachItemGraphicEl(function (itemGroup, idx) {\n var itemModel = data.getItemModel(idx);\n var polyline = itemGroup.childAt(0);\n var polygon = itemGroup.childAt(1);\n var symbolGroup = itemGroup.childAt(2); // Radar uses the visual encoded from itemStyle.\n\n var itemStyle = data.getItemVisual(idx, 'style');\n var color = itemStyle.fill;\n group.add(itemGroup);\n polyline.useStyle(zrUtil.defaults(itemModel.getModel('lineStyle').getLineStyle(), {\n fill: 'none',\n stroke: color\n }));\n setStatesStylesFromModel(polyline, itemModel, 'lineStyle');\n setStatesStylesFromModel(polygon, itemModel, 'areaStyle');\n var areaStyleModel = itemModel.getModel('areaStyle');\n var polygonIgnore = areaStyleModel.isEmpty() && areaStyleModel.parentModel.isEmpty();\n polygon.ignore = polygonIgnore;\n zrUtil.each(['emphasis', 'select', 'blur'], function (stateName) {\n var stateModel = itemModel.getModel([stateName, 'areaStyle']);\n var stateIgnore = stateModel.isEmpty() && stateModel.parentModel.isEmpty(); // Won't be ignore if normal state is not ignore.\n\n polygon.ensureState(stateName).ignore = stateIgnore && polygonIgnore;\n });\n polygon.useStyle(zrUtil.defaults(areaStyleModel.getAreaStyle(), {\n fill: color,\n opacity: 0.7,\n decal: itemStyle.decal\n }));\n var emphasisModel = itemModel.getModel('emphasis');\n var itemHoverStyle = emphasisModel.getModel('itemStyle').getItemStyle();\n symbolGroup.eachChild(function (symbolPath) {\n if (symbolPath instanceof ZRImage) {\n var pathStyle = symbolPath.style;\n symbolPath.useStyle(zrUtil.extend({\n // TODO other properties like x, y ?\n image: pathStyle.image,\n x: pathStyle.x,\n y: pathStyle.y,\n width: pathStyle.width,\n height: pathStyle.height\n }, itemStyle));\n } else {\n symbolPath.useStyle(itemStyle);\n symbolPath.setColor(color);\n symbolPath.style.strokeNoScale = true;\n }\n\n var pathEmphasisState = symbolPath.ensureState('emphasis');\n pathEmphasisState.style = zrUtil.clone(itemHoverStyle);\n var defaultText = data.getStore().get(data.getDimensionIndex(symbolPath.__dimIdx), idx);\n (defaultText == null || isNaN(defaultText)) && (defaultText = '');\n setLabelStyle(symbolPath, getLabelStatesModels(itemModel), {\n labelFetcher: data.hostModel,\n labelDataIndex: idx,\n labelDimIndex: symbolPath.__dimIdx,\n defaultText: defaultText,\n inheritColor: color,\n defaultOpacity: itemStyle.opacity\n });\n });\n toggleHoverEmphasis(itemGroup, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled'));\n });\n this._data = data;\n };\n\n RadarView.prototype.remove = function () {\n this.group.removeAll();\n this._data = null;\n };\n\n RadarView.type = 'radar';\n return RadarView;\n}(ChartView);\n\nexport default RadarView;","map":{"version":3,"sources":["D:/Work/WorkSpace/GitWorkSpace/TenShop/resource/ElectronicMall/src啊/ElectronicMallVue/node_modules/echarts/lib/chart/radar/RadarView.js"],"names":["__extends","graphic","setStatesStylesFromModel","toggleHoverEmphasis","zrUtil","symbolUtil","ChartView","setLabelStyle","getLabelStatesModels","ZRImage","saveOldStyle","RadarView","_super","_this","apply","arguments","type","prototype","render","seriesModel","ecModel","api","polar","coordinateSystem","group","data","getData","oldData","_data","createSymbol","idx","symbolType","getItemVisual","symbolSize","normalizeSymbolSize","symbolPath","symbolRotate","attr","style","strokeNoScale","z2","scaleX","scaleY","rotation","Math","PI","updateSymbols","oldPoints","newPoints","symbolGroup","isInit","removeAll","i","length","__dimIdx","setPosition","x","y","add","getInitialPoints","points","map","pt","cx","cy","diff","getItemLayout","polygon","Polygon","polyline","Polyline","target","shape","initProps","itemGroup","Group","setItemGraphicEl","update","newIdx","oldIdx","getItemGraphicEl","childAt","updateProps","remove","execute","eachItemGraphicEl","itemModel","getItemModel","itemStyle","color","fill","useStyle","defaults","getModel","getLineStyle","stroke","areaStyleModel","polygonIgnore","isEmpty","parentModel","ignore","each","stateName","stateModel","stateIgnore","ensureState","getAreaStyle","opacity","decal","emphasisModel","itemHoverStyle","getItemStyle","eachChild","pathStyle","extend","image","width","height","setColor","pathEmphasisState","clone","defaultText","getStore","get","getDimensionIndex","isNaN","labelFetcher","hostModel","labelDataIndex","labelDimIndex","inheritColor","defaultOpacity"],"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,OAAZ,MAAyB,uBAAzB;AACA,SAASC,wBAAT,EAAmCC,mBAAnC,QAA8D,sBAA9D;AACA,OAAO,KAAKC,MAAZ,MAAwB,0BAAxB;AACA,OAAO,KAAKC,UAAZ,MAA4B,sBAA5B;AACA,OAAOC,SAAP,MAAsB,qBAAtB;AACA,SAASC,aAAT,EAAwBC,oBAAxB,QAAoD,2BAApD;AACA,OAAOC,OAAP,MAAoB,8BAApB;AACA,SAASC,YAAT,QAA6B,oCAA7B;;AAEA,IAAIC,SAAS;AACb;AACA,UAAUC,MAAV,EAAkB;AAChBZ,EAAAA,SAAS,CA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CAAkB,UAAlB,CAAxE,CAAnB;AACD,KA9DD;AA+DA,SAAK/F,KAAL,GAAaH,IAAb;AACD,GA5KD;;AA8KAd,EAAAA,SAAS,CAACM,SAAV,CAAoBkE,MAApB,GAA6B,YAAY;AACvC,SAAK3D,KAAL,CAAW2B,SAAX;AACA,SAAKvB,KAAL,GAAa,IAAb;AACD,GAHD;;AAKAjB,EAAAA,SAAS,CAACK,IAAV,GAAiB,OAAjB;AACA,SAAOL,SAAP;AACD,CA/LD,CA+LEL,SA/LF,CAFA;;AAmMA,eAAeK,SAAf","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 graphic from '../../util/graphic.js';\nimport { setStatesStylesFromModel, toggleHoverEmphasis } from '../../util/states.js';\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as symbolUtil from '../../util/symbol.js';\nimport ChartView from '../../view/Chart.js';\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle.js';\nimport ZRImage from 'zrender/lib/graphic/Image.js';\nimport { saveOldStyle } from '../../animation/basicTransition.js';\n\nvar RadarView =\n/** @class */\nfunction (_super) {\n __extends(RadarView, _super);\n\n function RadarView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = RadarView.type;\n return _this;\n }\n\n RadarView.prototype.render = function (seriesModel, ecModel, api) {\n var polar = seriesModel.coordinateSystem;\n var group = this.group;\n var data = seriesModel.getData();\n var oldData = this._data;\n\n function createSymbol(data, idx) {\n var symbolType = data.getItemVisual(idx, 'symbol') || 'circle';\n\n if (symbolType === 'none') {\n return;\n }\n\n var symbolSize = symbolUtil.normalizeSymbolSize(data.getItemVisual(idx, 'symbolSize'));\n var symbolPath = symbolUtil.createSymbol(symbolType, -1, -1, 2, 2);\n var symbolRotate = data.getItemVisual(idx, 'symbolRotate') || 0;\n symbolPath.attr({\n style: {\n strokeNoScale: true\n },\n z2: 100,\n scaleX: symbolSize[0] / 2,\n scaleY: symbolSize[1] / 2,\n rotation: symbolRotate * Math.PI / 180 || 0\n });\n return symbolPath;\n }\n\n function updateSymbols(oldPoints, newPoints, symbolGroup, data, idx, isInit) {\n // Simply rerender all\n symbolGroup.removeAll();\n\n for (var i = 0; i < newPoints.length - 1; i++) {\n var symbolPath = createSymbol(data, idx);\n\n if (symbolPath) {\n symbolPath.__dimIdx = i;\n\n if (oldPoints[i]) {\n symbolPath.setPosition(oldPoints[i]);\n graphic[isInit ? 'initProps' : 'updateProps'](symbolPath, {\n x: newPoints[i][0],\n y: newPoints[i][1]\n }, seriesModel, idx);\n } else {\n symbolPath.setPosition(newPoints[i]);\n }\n\n symbolGroup.add(symbolPath);\n }\n }\n }\n\n function getInitialPoints(points) {\n return zrUtil.map(points, function (pt) {\n return [polar.cx, polar.cy];\n });\n }\n\n data.diff(oldData).add(function (idx) {\n var points = data.getItemLayout(idx);\n\n if (!points) {\n return;\n }\n\n var polygon = new graphic.Polygon();\n var polyline = new graphic.Polyline();\n var target = {\n shape: {\n points: points\n }\n };\n polygon.shape.points = getInitialPoints(points);\n polyline.shape.points = getInitialPoints(points);\n graphic.initProps(polygon, target, seriesModel, idx);\n graphic.initProps(polyline, target, seriesModel, idx);\n var itemGroup = new graphic.Group();\n var symbolGroup = new graphic.Group();\n itemGroup.add(polyline);\n itemGroup.add(polygon);\n itemGroup.add(symbolGroup);\n updateSymbols(polyline.shape.points, points, symbolGroup, data, idx, true);\n data.setItemGraphicEl(idx, itemGroup);\n }).update(function (newIdx, oldIdx) {\n var itemGroup = oldData.getItemGraphicEl(oldIdx);\n var polyline = itemGroup.childAt(0);\n var polygon = itemGroup.childAt(1);\n var symbolGroup = itemGroup.childAt(2);\n var target = {\n shape: {\n points: data.getItemLayout(newIdx)\n }\n };\n\n if (!target.shape.points) {\n return;\n }\n\n updateSymbols(polyline.shape.points, target.shape.points, symbolGroup, data, newIdx, false);\n saveOldStyle(polygon);\n saveOldStyle(polyline);\n graphic.updateProps(polyline, target, seriesModel);\n graphic.updateProps(polygon, target, seriesModel);\n data.setItemGraphicEl(newIdx, itemGroup);\n }).remove(function (idx) {\n group.remove(oldData.getItemGraphicEl(idx));\n }).execute();\n data.eachItemGraphicEl(function (itemGroup, idx) {\n var itemModel = data.getItemModel(idx);\n var polyline = itemGroup.childAt(0);\n var polygon = itemGroup.childAt(1);\n var symbolGroup = itemGroup.childAt(2); // Radar uses the visual encoded from itemStyle.\n\n var itemStyle = data.getItemVisual(idx, 'style');\n var color = itemStyle.fill;\n group.add(itemGroup);\n polyline.useStyle(zrUtil.defaults(itemModel.getModel('lineStyle').getLineStyle(), {\n fill: 'none',\n stroke: color\n }));\n setStatesStylesFromModel(polyline, itemModel, 'lineStyle');\n setStatesStylesFromModel(polygon, itemModel, 'areaStyle');\n var areaStyleModel = itemModel.getModel('areaStyle');\n var polygonIgnore = areaStyleModel.isEmpty() && areaStyleModel.parentModel.isEmpty();\n polygon.ignore = polygonIgnore;\n zrUtil.each(['emphasis', 'select', 'blur'], function (stateName) {\n var stateModel = itemModel.getModel([stateName, 'areaStyle']);\n var stateIgnore = stateModel.isEmpty() && stateModel.parentModel.isEmpty(); // Won't be ignore if normal state is not ignore.\n\n polygon.ensureState(stateName).ignore = stateIgnore && polygonIgnore;\n });\n polygon.useStyle(zrUtil.defaults(areaStyleModel.getAreaStyle(), {\n fill: color,\n opacity: 0.7,\n decal: itemStyle.decal\n }));\n var emphasisModel = itemModel.getModel('emphasis');\n var itemHoverStyle = emphasisModel.getModel('itemStyle').getItemStyle();\n symbolGroup.eachChild(function (symbolPath) {\n if (symbolPath instanceof ZRImage) {\n var pathStyle = symbolPath.style;\n symbolPath.useStyle(zrUtil.extend({\n // TODO other properties like x, y ?\n image: pathStyle.image,\n x: pathStyle.x,\n y: pathStyle.y,\n width: pathStyle.width,\n height: pathStyle.height\n }, itemStyle));\n } else {\n symbolPath.useStyle(itemStyle);\n symbolPath.setColor(color);\n symbolPath.style.strokeNoScale = true;\n }\n\n var pathEmphasisState = symbolPath.ensureState('emphasis');\n pathEmphasisState.style = zrUtil.clone(itemHoverStyle);\n var defaultText = data.getStore().get(data.getDimensionIndex(symbolPath.__dimIdx), idx);\n (defaultText == null || isNaN(defaultText)) && (defaultText = '');\n setLabelStyle(symbolPath, getLabelStatesModels(itemModel), {\n labelFetcher: data.hostModel,\n labelDataIndex: idx,\n labelDimIndex: symbolPath.__dimIdx,\n defaultText: defaultText,\n inheritColor: color,\n defaultOpacity: itemStyle.opacity\n });\n });\n toggleHoverEmphasis(itemGroup, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled'));\n });\n this._data = data;\n };\n\n RadarView.prototype.remove = function () {\n this.group.removeAll();\n this._data = null;\n };\n\n RadarView.type = 'radar';\n return RadarView;\n}(ChartView);\n\nexport default RadarView;"]},"metadata":{},"sourceType":"module"} |