qauMaWeb/node_modules/.cache/babel-loader/3eba09d26c23d80520c9deaf15e...

1 line
64 KiB
JSON

{"ast":null,"code":"import \"core-js/modules/es.function.name.js\";\nimport \"core-js/modules/es.array.fill.js\";\nimport \"core-js/modules/es.regexp.exec.js\";\nimport \"core-js/modules/es.string.replace.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\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { parse, stringify } from 'zrender/lib/tool/color.js';\nimport * as graphic from '../../util/graphic.js';\nimport { enableHoverEmphasis } from '../../util/states.js';\nimport { setLabelStyle, createTextStyle } from '../../label/labelStyle.js';\nimport { makeBackground } from '../helper/listComponent.js';\nimport * as layoutUtil from '../../util/layout.js';\nimport ComponentView from '../../view/Component.js';\nimport { createSymbol } from '../../util/symbol.js';\nvar curry = zrUtil.curry;\nvar each = zrUtil.each;\nvar Group = graphic.Group;\n\nvar LegendView =\n/** @class */\nfunction (_super) {\n __extends(LegendView, _super);\n\n function LegendView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = LegendView.type;\n _this.newlineDisabled = false;\n return _this;\n }\n\n LegendView.prototype.init = function () {\n this.group.add(this._contentGroup = new Group());\n this.group.add(this._selectorGroup = new Group());\n this._isFirstRender = true;\n };\n /**\r\n * @protected\r\n */\n\n\n LegendView.prototype.getContentGroup = function () {\n return this._contentGroup;\n };\n /**\r\n * @protected\r\n */\n\n\n LegendView.prototype.getSelectorGroup = function () {\n return this._selectorGroup;\n };\n /**\r\n * @override\r\n */\n\n\n LegendView.prototype.render = function (legendModel, ecModel, api) {\n var isFirstRender = this._isFirstRender;\n this._isFirstRender = false;\n this.resetInner();\n\n if (!legendModel.get('show', true)) {\n return;\n }\n\n var itemAlign = legendModel.get('align');\n var orient = legendModel.get('orient');\n\n if (!itemAlign || itemAlign === 'auto') {\n itemAlign = legendModel.get('left') === 'right' && orient === 'vertical' ? 'right' : 'left';\n } // selector has been normalized to an array in model\n\n\n var selector = legendModel.get('selector', true);\n var selectorPosition = legendModel.get('selectorPosition', true);\n\n if (selector && (!selectorPosition || selectorPosition === 'auto')) {\n selectorPosition = orient === 'horizontal' ? 'end' : 'start';\n }\n\n this.renderInner(itemAlign, legendModel, ecModel, api, selector, orient, selectorPosition); // Perform layout.\n\n var positionInfo = legendModel.getBoxLayoutParams();\n var viewportSize = {\n width: api.getWidth(),\n height: api.getHeight()\n };\n var padding = legendModel.get('padding');\n var maxSize = layoutUtil.getLayoutRect(positionInfo, viewportSize, padding);\n var mainRect = this.layoutInner(legendModel, itemAlign, maxSize, isFirstRender, selector, selectorPosition); // Place mainGroup, based on the calculated `mainRect`.\n\n var layoutRect = layoutUtil.getLayoutRect(zrUtil.defaults({\n width: mainRect.width,\n height: mainRect.height\n }, positionInfo), viewportSize, padding);\n this.group.x = layoutRect.x - mainRect.x;\n this.group.y = layoutRect.y - mainRect.y;\n this.group.markRedraw(); // Render background after group is layout.\n\n this.group.add(this._backgroundEl = makeBackground(mainRect, legendModel));\n };\n\n LegendView.prototype.resetInner = function () {\n this.getContentGroup().removeAll();\n this._backgroundEl && this.group.remove(this._backgroundEl);\n this.getSelectorGroup().removeAll();\n };\n\n LegendView.prototype.renderInner = function (itemAlign, legendModel, ecModel, api, selector, orient, selectorPosition) {\n var contentGroup = this.getContentGroup();\n var legendDrawnMap = zrUtil.createHashMap();\n var selectMode = legendModel.get('selectedMode');\n var excludeSeriesId = [];\n ecModel.eachRawSeries(function (seriesModel) {\n !seriesModel.get('legendHoverLink') && excludeSeriesId.push(seriesModel.id);\n });\n each(legendModel.getData(), function (legendItemModel, dataIndex) {\n var name = legendItemModel.get('name'); // Use empty string or \\n as a newline string\n\n if (!this.newlineDisabled && (name === '' || name === '\\n')) {\n var g = new Group(); // @ts-ignore\n\n g.newline = true;\n contentGroup.add(g);\n return;\n } // Representitive series.\n\n\n var seriesModel = ecModel.getSeriesByName(name)[0];\n\n if (legendDrawnMap.get(name)) {\n // Have been drawed\n return;\n } // Legend to control series.\n\n\n if (seriesModel) {\n var data = seriesModel.getData();\n var lineVisualStyle = data.getVisual('legendLineStyle') || {};\n var legendIcon = data.getVisual('legendIcon');\n /**\r\n * `data.getVisual('style')` may be the color from the register\r\n * in series. For example, for line series,\r\n */\n\n var style = data.getVisual('style');\n\n var itemGroup = this._createItem(seriesModel, name, dataIndex, legendItemModel, legendModel, itemAlign, lineVisualStyle, style, legendIcon, selectMode);\n\n itemGroup.on('click', curry(dispatchSelectAction, name, null, api, excludeSeriesId)).on('mouseover', curry(dispatchHighlightAction, seriesModel.name, null, api, excludeSeriesId)).on('mouseout', curry(dispatchDownplayAction, seriesModel.name, null, api, excludeSeriesId));\n legendDrawnMap.set(name, true);\n } else {\n // Legend to control data. In pie and funnel.\n ecModel.eachRawSeries(function (seriesModel) {\n // In case multiple series has same data name\n if (legendDrawnMap.get(name)) {\n return;\n }\n\n if (seriesModel.legendVisualProvider) {\n var provider = seriesModel.legendVisualProvider;\n\n if (!provider.containName(name)) {\n return;\n }\n\n var idx = provider.indexOfName(name);\n var style = provider.getItemVisual(idx, 'style');\n var legendIcon = provider.getItemVisual(idx, 'legendIcon');\n var colorArr = parse(style.fill); // Color may be set to transparent in visualMap when data is out of range.\n // Do not show nothing.\n\n if (colorArr && colorArr[3] === 0) {\n colorArr[3] = 0.2; // TODO color is set to 0, 0, 0, 0. Should show correct RGBA\n\n style = zrUtil.extend(zrUtil.extend({}, style), {\n fill: stringify(colorArr, 'rgba')\n });\n }\n\n var itemGroup = this._createItem(seriesModel, name, dataIndex, legendItemModel, legendModel, itemAlign, {}, style, legendIcon, selectMode); // FIXME: consider different series has items with the same name.\n\n\n itemGroup.on('click', curry(dispatchSelectAction, null, name, api, excludeSeriesId)) // Should not specify the series name, consider legend controls\n // more than one pie series.\n .on('mouseover', curry(dispatchHighlightAction, null, name, api, excludeSeriesId)).on('mouseout', curry(dispatchDownplayAction, null, name, api, excludeSeriesId));\n legendDrawnMap.set(name, true);\n }\n }, this);\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (!legendDrawnMap.get(name)) {\n console.warn(name + ' series not exists. Legend data should be same with series name or data name.');\n }\n }\n }, this);\n\n if (selector) {\n this._createSelector(selector, legendModel, api, orient, selectorPosition);\n }\n };\n\n LegendView.prototype._createSelector = function (selector, legendModel, api, orient, selectorPosition) {\n var selectorGroup = this.getSelectorGroup();\n each(selector, function createSelectorButton(selectorItem) {\n var type = selectorItem.type;\n var labelText = new graphic.Text({\n style: {\n x: 0,\n y: 0,\n align: 'center',\n verticalAlign: 'middle'\n },\n onclick: function onclick() {\n api.dispatchAction({\n type: type === 'all' ? 'legendAllSelect' : 'legendInverseSelect'\n });\n }\n });\n selectorGroup.add(labelText);\n var labelModel = legendModel.getModel('selectorLabel');\n var emphasisLabelModel = legendModel.getModel(['emphasis', 'selectorLabel']);\n setLabelStyle(labelText, {\n normal: labelModel,\n emphasis: emphasisLabelModel\n }, {\n defaultText: selectorItem.title\n });\n enableHoverEmphasis(labelText);\n });\n };\n\n LegendView.prototype._createItem = function (seriesModel, name, dataIndex, legendItemModel, legendModel, itemAlign, lineVisualStyle, itemVisualStyle, legendIcon, selectMode) {\n var drawType = seriesModel.visualDrawType;\n var itemWidth = legendModel.get('itemWidth');\n var itemHeight = legendModel.get('itemHeight');\n var isSelected = legendModel.isSelected(name);\n var iconRotate = legendItemModel.get('symbolRotate');\n var symbolKeepAspect = legendItemModel.get('symbolKeepAspect');\n var legendIconType = legendItemModel.get('icon');\n legendIcon = legendIconType || legendIcon || 'roundRect';\n var style = getLegendStyle(legendIcon, legendItemModel, lineVisualStyle, itemVisualStyle, drawType, isSelected);\n var itemGroup = new Group();\n var textStyleModel = legendItemModel.getModel('textStyle');\n\n if (zrUtil.isFunction(seriesModel.getLegendIcon) && (!legendIconType || legendIconType === 'inherit')) {\n // Series has specific way to define legend icon\n itemGroup.add(seriesModel.getLegendIcon({\n itemWidth: itemWidth,\n itemHeight: itemHeight,\n icon: legendIcon,\n iconRotate: iconRotate,\n itemStyle: style.itemStyle,\n lineStyle: style.lineStyle,\n symbolKeepAspect: symbolKeepAspect\n }));\n } else {\n // Use default legend icon policy for most series\n var rotate = legendIconType === 'inherit' && seriesModel.getData().getVisual('symbol') ? iconRotate === 'inherit' ? seriesModel.getData().getVisual('symbolRotate') : iconRotate : 0; // No rotation for no icon\n\n itemGroup.add(getDefaultLegendIcon({\n itemWidth: itemWidth,\n itemHeight: itemHeight,\n icon: legendIcon,\n iconRotate: rotate,\n itemStyle: style.itemStyle,\n lineStyle: style.lineStyle,\n symbolKeepAspect: symbolKeepAspect\n }));\n }\n\n var textX = itemAlign === 'left' ? itemWidth + 5 : -5;\n var textAlign = itemAlign;\n var formatter = legendModel.get('formatter');\n var content = name;\n\n if (zrUtil.isString(formatter) && formatter) {\n content = formatter.replace('{name}', name != null ? name : '');\n } else if (zrUtil.isFunction(formatter)) {\n content = formatter(name);\n }\n\n var inactiveColor = legendItemModel.get('inactiveColor');\n itemGroup.add(new graphic.Text({\n style: createTextStyle(textStyleModel, {\n text: content,\n x: textX,\n y: itemHeight / 2,\n fill: isSelected ? textStyleModel.getTextColor() : inactiveColor,\n align: textAlign,\n verticalAlign: 'middle'\n })\n })); // Add a invisible rect to increase the area of mouse hover\n\n var hitRect = new graphic.Rect({\n shape: itemGroup.getBoundingRect(),\n invisible: true\n });\n var tooltipModel = legendItemModel.getModel('tooltip');\n\n if (tooltipModel.get('show')) {\n graphic.setTooltipConfig({\n el: hitRect,\n componentModel: legendModel,\n itemName: name,\n itemTooltipOption: tooltipModel.option\n });\n }\n\n itemGroup.add(hitRect);\n itemGroup.eachChild(function (child) {\n child.silent = true;\n });\n hitRect.silent = !selectMode;\n this.getContentGroup().add(itemGroup);\n enableHoverEmphasis(itemGroup); // @ts-ignore\n\n itemGroup.__legendDataIndex = dataIndex;\n return itemGroup;\n };\n\n LegendView.prototype.layoutInner = function (legendModel, itemAlign, maxSize, isFirstRender, selector, selectorPosition) {\n var contentGroup = this.getContentGroup();\n var selectorGroup = this.getSelectorGroup(); // Place items in contentGroup.\n\n layoutUtil.box(legendModel.get('orient'), contentGroup, legendModel.get('itemGap'), maxSize.width, maxSize.height);\n var contentRect = contentGroup.getBoundingRect();\n var contentPos = [-contentRect.x, -contentRect.y];\n selectorGroup.markRedraw();\n contentGroup.markRedraw();\n\n if (selector) {\n // Place buttons in selectorGroup\n layoutUtil.box( // Buttons in selectorGroup always layout horizontally\n 'horizontal', selectorGroup, legendModel.get('selectorItemGap', true));\n var selectorRect = selectorGroup.getBoundingRect();\n var selectorPos = [-selectorRect.x, -selectorRect.y];\n var selectorButtonGap = legendModel.get('selectorButtonGap', true);\n var orientIdx = legendModel.getOrient().index;\n var wh = orientIdx === 0 ? 'width' : 'height';\n var hw = orientIdx === 0 ? 'height' : 'width';\n var yx = orientIdx === 0 ? 'y' : 'x';\n\n if (selectorPosition === 'end') {\n selectorPos[orientIdx] += contentRect[wh] + selectorButtonGap;\n } else {\n contentPos[orientIdx] += selectorRect[wh] + selectorButtonGap;\n } //Always align selector to content as 'middle'\n\n\n selectorPos[1 - orientIdx] += contentRect[hw] / 2 - selectorRect[hw] / 2;\n selectorGroup.x = selectorPos[0];\n selectorGroup.y = selectorPos[1];\n contentGroup.x = contentPos[0];\n contentGroup.y = contentPos[1];\n var mainRect = {\n x: 0,\n y: 0\n };\n mainRect[wh] = contentRect[wh] + selectorButtonGap + selectorRect[wh];\n mainRect[hw] = Math.max(contentRect[hw], selectorRect[hw]);\n mainRect[yx] = Math.min(0, selectorRect[yx] + selectorPos[1 - orientIdx]);\n return mainRect;\n } else {\n contentGroup.x = contentPos[0];\n contentGroup.y = contentPos[1];\n return this.group.getBoundingRect();\n }\n };\n /**\r\n * @protected\r\n */\n\n\n LegendView.prototype.remove = function () {\n this.getContentGroup().removeAll();\n this._isFirstRender = true;\n };\n\n LegendView.type = 'legend.plain';\n return LegendView;\n}(ComponentView);\n\nfunction getLegendStyle(iconType, legendModel, lineVisualStyle, itemVisualStyle, drawType, isSelected) {\n /**\r\n * Use series style if is inherit;\r\n * elsewise, use legend style\r\n */\n function handleCommonProps(style, visualStyle) {\n // If lineStyle.width is 'auto', it is set to be 2 if series has border\n if (style.lineWidth === 'auto') {\n style.lineWidth = visualStyle.lineWidth > 0 ? 2 : 0;\n }\n\n each(style, function (propVal, propName) {\n style[propName] === 'inherit' && (style[propName] = visualStyle[propName]);\n });\n } // itemStyle\n\n\n var legendItemModel = legendModel.getModel('itemStyle');\n var itemStyle = legendItemModel.getItemStyle();\n var iconBrushType = iconType.lastIndexOf('empty', 0) === 0 ? 'fill' : 'stroke';\n itemStyle.decal = itemVisualStyle.decal;\n\n if (itemStyle.fill === 'inherit') {\n /**\r\n * Series with visualDrawType as 'stroke' should have\r\n * series stroke as legend fill\r\n */\n itemStyle.fill = itemVisualStyle[drawType];\n }\n\n if (itemStyle.stroke === 'inherit') {\n /**\r\n * icon type with \"emptyXXX\" should use fill color\r\n * in visual style\r\n */\n itemStyle.stroke = itemVisualStyle[iconBrushType];\n }\n\n if (itemStyle.opacity === 'inherit') {\n /**\r\n * Use lineStyle.opacity if drawType is stroke\r\n */\n itemStyle.opacity = (drawType === 'fill' ? itemVisualStyle : lineVisualStyle).opacity;\n }\n\n handleCommonProps(itemStyle, itemVisualStyle); // lineStyle\n\n var legendLineModel = legendModel.getModel('lineStyle');\n var lineStyle = legendLineModel.getLineStyle();\n handleCommonProps(lineStyle, lineVisualStyle); // Fix auto color to real color\n\n itemStyle.fill === 'auto' && (itemStyle.fill = itemVisualStyle.fill);\n itemStyle.stroke === 'auto' && (itemStyle.stroke = itemVisualStyle.fill);\n lineStyle.stroke === 'auto' && (lineStyle.stroke = itemVisualStyle.fill);\n\n if (!isSelected) {\n var borderWidth = legendModel.get('inactiveBorderWidth');\n /**\r\n * Since stroke is set to be inactiveBorderColor, it may occur that\r\n * there is no border in series but border in legend, so we need to\r\n * use border only when series has border if is set to be auto\r\n */\n\n var visualHasBorder = itemStyle[iconBrushType];\n itemStyle.lineWidth = borderWidth === 'auto' ? itemVisualStyle.lineWidth > 0 && visualHasBorder ? 2 : 0 : itemStyle.lineWidth;\n itemStyle.fill = legendModel.get('inactiveColor');\n itemStyle.stroke = legendModel.get('inactiveBorderColor');\n lineStyle.stroke = legendLineModel.get('inactiveColor');\n lineStyle.lineWidth = legendLineModel.get('inactiveWidth');\n }\n\n return {\n itemStyle: itemStyle,\n lineStyle: lineStyle\n };\n}\n\nfunction getDefaultLegendIcon(opt) {\n var symboType = opt.icon || 'roundRect';\n var icon = createSymbol(symboType, 0, 0, opt.itemWidth, opt.itemHeight, opt.itemStyle.fill, opt.symbolKeepAspect);\n icon.setStyle(opt.itemStyle);\n icon.rotation = (opt.iconRotate || 0) * Math.PI / 180;\n icon.setOrigin([opt.itemWidth / 2, opt.itemHeight / 2]);\n\n if (symboType.indexOf('empty') > -1) {\n icon.style.stroke = icon.style.fill;\n icon.style.fill = '#fff';\n icon.style.lineWidth = 2;\n }\n\n return icon;\n}\n\nfunction dispatchSelectAction(seriesName, dataName, api, excludeSeriesId) {\n // downplay before unselect\n dispatchDownplayAction(seriesName, dataName, api, excludeSeriesId);\n api.dispatchAction({\n type: 'legendToggleSelect',\n name: seriesName != null ? seriesName : dataName\n }); // highlight after select\n // TODO higlight immediately may cause animation loss.\n\n dispatchHighlightAction(seriesName, dataName, api, excludeSeriesId);\n}\n\nfunction isUseHoverLayer(api) {\n var list = api.getZr().storage.getDisplayList();\n var emphasisState;\n var i = 0;\n var len = list.length;\n\n while (i < len && !(emphasisState = list[i].states.emphasis)) {\n i++;\n }\n\n return emphasisState && emphasisState.hoverLayer;\n}\n\nfunction dispatchHighlightAction(seriesName, dataName, api, excludeSeriesId) {\n // If element hover will move to a hoverLayer.\n if (!isUseHoverLayer(api)) {\n api.dispatchAction({\n type: 'highlight',\n seriesName: seriesName,\n name: dataName,\n excludeSeriesId: excludeSeriesId\n });\n }\n}\n\nfunction dispatchDownplayAction(seriesName, dataName, api, excludeSeriesId) {\n // If element hover will move to a hoverLayer.\n if (!isUseHoverLayer(api)) {\n api.dispatchAction({\n type: 'downplay',\n seriesName: seriesName,\n name: dataName,\n excludeSeriesId: excludeSeriesId\n });\n }\n}\n\nexport default LegendView;","map":{"version":3,"sources":["D:/Work/WorkSpace/GitWorkSpace/TenShop/resource/ElectronicMall/src/qingge-Market/qingge-vue/node_modules/echarts/lib/component/legend/LegendView.js"],"names":["__extends","zrUtil","parse","stringify","graphic","enableHoverEmphasis","setLabelStyle","createTextStyle","makeBackground","layoutUtil","ComponentView","createSymbol","curry","each","Group","LegendView","_super","_this","apply","arguments","type","newlineDisabled","prototype","init","group","add","_contentGroup","_selectorGroup","_isFirstRender","getContentGroup","getSelectorGroup","render","legendModel","ecModel","api","isFirstRender","resetInner","get","itemAlign","orient","selector","selectorPosition","renderInner","positionInfo","getBoxLayoutParams","viewportSize","width","getWidth","height","getHeight","padding","maxSize","getLayoutRect","mainRect","layoutInner","layoutRect","defaults","x","y","markRedraw","_backgroundEl","removeAll","remove","contentGroup","legendDrawnMap","createHashMap","selectMode","excludeSeriesId","eachRawSeries","seriesModel","push","id","getData","legendItemModel","dataIndex","name","g","newline","getSeriesByName","data","lineVisualStyle","getVisual","legendIcon","style","itemGroup","_createItem","on","dispatchSelectAction","dispatchHighlightAction","dispatchDownplayAction","set","legendVisualProvider","provider","containName","idx","indexOfName","getItemVisual","colorArr","fill","extend","process","env","NODE_ENV","console","warn","_createSelector","selectorGroup","createSelectorButton","selectorItem","labelText","Text","align","verticalAlign","onclick","dispatchAction","labelModel","getModel","emphasisLabelModel","normal","emphasis","defaultText","title","itemVisualStyle","drawType","visualDrawType","itemWidth","itemHeight","isSelected","iconRotate","symbolKeepAspect","legendIconType","getLegendStyle","textStyleModel","isFunction","getLegendIcon","icon","itemStyle","lineStyle","rotate","getDefaultLegendIcon","textX","textAlign","formatter","content","isString","replace","inactiveColor","text","getTextColor","hitRect","Rect","shape","getBoundingRect","invisible","tooltipModel","setTooltipConfig","el","componentModel","itemName","itemTooltipOption","option","eachChild","child","silent","__legendDataIndex","box","contentRect","contentPos","selectorRect","selectorPos","selectorButtonGap","orientIdx","getOrient","index","wh","hw","yx","Math","max","min","iconType","handleCommonProps","visualStyle","lineWidth","propVal","propName","getItemStyle","iconBrushType","lastIndexOf","decal","stroke","opacity","legendLineModel","getLineStyle","borderWidth","visualHasBorder","opt","symboType","setStyle","rotation","PI","setOrigin","indexOf","seriesName","dataName","isUseHoverLayer","list","getZr","storage","getDisplayList","emphasisState","i","len","length","states","hoverLayer"],"mappings":";;;;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA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e,EAAEA;AAJA,KAAnB;AAMD;AACF;;AAED,eAAepD,UAAf","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 { parse, stringify } from 'zrender/lib/tool/color.js';\r\nimport * as graphic from '../../util/graphic.js';\r\nimport { enableHoverEmphasis } from '../../util/states.js';\r\nimport { setLabelStyle, createTextStyle } from '../../label/labelStyle.js';\r\nimport { makeBackground } from '../helper/listComponent.js';\r\nimport * as layoutUtil from '../../util/layout.js';\r\nimport ComponentView from '../../view/Component.js';\r\nimport { createSymbol } from '../../util/symbol.js';\r\nvar curry = zrUtil.curry;\r\nvar each = zrUtil.each;\r\nvar Group = graphic.Group;\r\n\r\nvar LegendView =\r\n/** @class */\r\nfunction (_super) {\r\n __extends(LegendView, _super);\r\n\r\n function LegendView() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n\r\n _this.type = LegendView.type;\r\n _this.newlineDisabled = false;\r\n return _this;\r\n }\r\n\r\n LegendView.prototype.init = function () {\r\n this.group.add(this._contentGroup = new Group());\r\n this.group.add(this._selectorGroup = new Group());\r\n this._isFirstRender = true;\r\n };\r\n /**\r\n * @protected\r\n */\r\n\r\n\r\n LegendView.prototype.getContentGroup = function () {\r\n return this._contentGroup;\r\n };\r\n /**\r\n * @protected\r\n */\r\n\r\n\r\n LegendView.prototype.getSelectorGroup = function () {\r\n return this._selectorGroup;\r\n };\r\n /**\r\n * @override\r\n */\r\n\r\n\r\n LegendView.prototype.render = function (legendModel, ecModel, api) {\r\n var isFirstRender = this._isFirstRender;\r\n this._isFirstRender = false;\r\n this.resetInner();\r\n\r\n if (!legendModel.get('show', true)) {\r\n return;\r\n }\r\n\r\n var itemAlign = legendModel.get('align');\r\n var orient = legendModel.get('orient');\r\n\r\n if (!itemAlign || itemAlign === 'auto') {\r\n itemAlign = legendModel.get('left') === 'right' && orient === 'vertical' ? 'right' : 'left';\r\n } // selector has been normalized to an array in model\r\n\r\n\r\n var selector = legendModel.get('selector', true);\r\n var selectorPosition = legendModel.get('selectorPosition', true);\r\n\r\n if (selector && (!selectorPosition || selectorPosition === 'auto')) {\r\n selectorPosition = orient === 'horizontal' ? 'end' : 'start';\r\n }\r\n\r\n this.renderInner(itemAlign, legendModel, ecModel, api, selector, orient, selectorPosition); // Perform layout.\r\n\r\n var positionInfo = legendModel.getBoxLayoutParams();\r\n var viewportSize = {\r\n width: api.getWidth(),\r\n height: api.getHeight()\r\n };\r\n var padding = legendModel.get('padding');\r\n var maxSize = layoutUtil.getLayoutRect(positionInfo, viewportSize, padding);\r\n var mainRect = this.layoutInner(legendModel, itemAlign, maxSize, isFirstRender, selector, selectorPosition); // Place mainGroup, based on the calculated `mainRect`.\r\n\r\n var layoutRect = layoutUtil.getLayoutRect(zrUtil.defaults({\r\n width: mainRect.width,\r\n height: mainRect.height\r\n }, positionInfo), viewportSize, padding);\r\n this.group.x = layoutRect.x - mainRect.x;\r\n this.group.y = layoutRect.y - mainRect.y;\r\n this.group.markRedraw(); // Render background after group is layout.\r\n\r\n this.group.add(this._backgroundEl = makeBackground(mainRect, legendModel));\r\n };\r\n\r\n LegendView.prototype.resetInner = function () {\r\n this.getContentGroup().removeAll();\r\n this._backgroundEl && this.group.remove(this._backgroundEl);\r\n this.getSelectorGroup().removeAll();\r\n };\r\n\r\n LegendView.prototype.renderInner = function (itemAlign, legendModel, ecModel, api, selector, orient, selectorPosition) {\r\n var contentGroup = this.getContentGroup();\r\n var legendDrawnMap = zrUtil.createHashMap();\r\n var selectMode = legendModel.get('selectedMode');\r\n var excludeSeriesId = [];\r\n ecModel.eachRawSeries(function (seriesModel) {\r\n !seriesModel.get('legendHoverLink') && excludeSeriesId.push(seriesModel.id);\r\n });\r\n each(legendModel.getData(), function (legendItemModel, dataIndex) {\r\n var name = legendItemModel.get('name'); // Use empty string or \\n as a newline string\r\n\r\n if (!this.newlineDisabled && (name === '' || name === '\\n')) {\r\n var g = new Group(); // @ts-ignore\r\n\r\n g.newline = true;\r\n contentGroup.add(g);\r\n return;\r\n } // Representitive series.\r\n\r\n\r\n var seriesModel = ecModel.getSeriesByName(name)[0];\r\n\r\n if (legendDrawnMap.get(name)) {\r\n // Have been drawed\r\n return;\r\n } // Legend to control series.\r\n\r\n\r\n if (seriesModel) {\r\n var data = seriesModel.getData();\r\n var lineVisualStyle = data.getVisual('legendLineStyle') || {};\r\n var legendIcon = data.getVisual('legendIcon');\r\n /**\r\n * `data.getVisual('style')` may be the color from the register\r\n * in series. For example, for line series,\r\n */\r\n\r\n var style = data.getVisual('style');\r\n\r\n var itemGroup = this._createItem(seriesModel, name, dataIndex, legendItemModel, legendModel, itemAlign, lineVisualStyle, style, legendIcon, selectMode);\r\n\r\n itemGroup.on('click', curry(dispatchSelectAction, name, null, api, excludeSeriesId)).on('mouseover', curry(dispatchHighlightAction, seriesModel.name, null, api, excludeSeriesId)).on('mouseout', curry(dispatchDownplayAction, seriesModel.name, null, api, excludeSeriesId));\r\n legendDrawnMap.set(name, true);\r\n } else {\r\n // Legend to control data. In pie and funnel.\r\n ecModel.eachRawSeries(function (seriesModel) {\r\n // In case multiple series has same data name\r\n if (legendDrawnMap.get(name)) {\r\n return;\r\n }\r\n\r\n if (seriesModel.legendVisualProvider) {\r\n var provider = seriesModel.legendVisualProvider;\r\n\r\n if (!provider.containName(name)) {\r\n return;\r\n }\r\n\r\n var idx = provider.indexOfName(name);\r\n var style = provider.getItemVisual(idx, 'style');\r\n var legendIcon = provider.getItemVisual(idx, 'legendIcon');\r\n var colorArr = parse(style.fill); // Color may be set to transparent in visualMap when data is out of range.\r\n // Do not show nothing.\r\n\r\n if (colorArr && colorArr[3] === 0) {\r\n colorArr[3] = 0.2; // TODO color is set to 0, 0, 0, 0. Should show correct RGBA\r\n\r\n style = zrUtil.extend(zrUtil.extend({}, style), {\r\n fill: stringify(colorArr, 'rgba')\r\n });\r\n }\r\n\r\n var itemGroup = this._createItem(seriesModel, name, dataIndex, legendItemModel, legendModel, itemAlign, {}, style, legendIcon, selectMode); // FIXME: consider different series has items with the same name.\r\n\r\n\r\n itemGroup.on('click', curry(dispatchSelectAction, null, name, api, excludeSeriesId)) // Should not specify the series name, consider legend controls\r\n // more than one pie series.\r\n .on('mouseover', curry(dispatchHighlightAction, null, name, api, excludeSeriesId)).on('mouseout', curry(dispatchDownplayAction, null, name, api, excludeSeriesId));\r\n legendDrawnMap.set(name, true);\r\n }\r\n }, this);\r\n }\r\n\r\n if (process.env.NODE_ENV !== 'production') {\r\n if (!legendDrawnMap.get(name)) {\r\n console.warn(name + ' series not exists. Legend data should be same with series name or data name.');\r\n }\r\n }\r\n }, this);\r\n\r\n if (selector) {\r\n this._createSelector(selector, legendModel, api, orient, selectorPosition);\r\n }\r\n };\r\n\r\n LegendView.prototype._createSelector = function (selector, legendModel, api, orient, selectorPosition) {\r\n var selectorGroup = this.getSelectorGroup();\r\n each(selector, function createSelectorButton(selectorItem) {\r\n var type = selectorItem.type;\r\n var labelText = new graphic.Text({\r\n style: {\r\n x: 0,\r\n y: 0,\r\n align: 'center',\r\n verticalAlign: 'middle'\r\n },\r\n onclick: function () {\r\n api.dispatchAction({\r\n type: type === 'all' ? 'legendAllSelect' : 'legendInverseSelect'\r\n });\r\n }\r\n });\r\n selectorGroup.add(labelText);\r\n var labelModel = legendModel.getModel('selectorLabel');\r\n var emphasisLabelModel = legendModel.getModel(['emphasis', 'selectorLabel']);\r\n setLabelStyle(labelText, {\r\n normal: labelModel,\r\n emphasis: emphasisLabelModel\r\n }, {\r\n defaultText: selectorItem.title\r\n });\r\n enableHoverEmphasis(labelText);\r\n });\r\n };\r\n\r\n LegendView.prototype._createItem = function (seriesModel, name, dataIndex, legendItemModel, legendModel, itemAlign, lineVisualStyle, itemVisualStyle, legendIcon, selectMode) {\r\n var drawType = seriesModel.visualDrawType;\r\n var itemWidth = legendModel.get('itemWidth');\r\n var itemHeight = legendModel.get('itemHeight');\r\n var isSelected = legendModel.isSelected(name);\r\n var iconRotate = legendItemModel.get('symbolRotate');\r\n var symbolKeepAspect = legendItemModel.get('symbolKeepAspect');\r\n var legendIconType = legendItemModel.get('icon');\r\n legendIcon = legendIconType || legendIcon || 'roundRect';\r\n var style = getLegendStyle(legendIcon, legendItemModel, lineVisualStyle, itemVisualStyle, drawType, isSelected);\r\n var itemGroup = new Group();\r\n var textStyleModel = legendItemModel.getModel('textStyle');\r\n\r\n if (zrUtil.isFunction(seriesModel.getLegendIcon) && (!legendIconType || legendIconType === 'inherit')) {\r\n // Series has specific way to define legend icon\r\n itemGroup.add(seriesModel.getLegendIcon({\r\n itemWidth: itemWidth,\r\n itemHeight: itemHeight,\r\n icon: legendIcon,\r\n iconRotate: iconRotate,\r\n itemStyle: style.itemStyle,\r\n lineStyle: style.lineStyle,\r\n symbolKeepAspect: symbolKeepAspect\r\n }));\r\n } else {\r\n // Use default legend icon policy for most series\r\n var rotate = legendIconType === 'inherit' && seriesModel.getData().getVisual('symbol') ? iconRotate === 'inherit' ? seriesModel.getData().getVisual('symbolRotate') : iconRotate : 0; // No rotation for no icon\r\n\r\n itemGroup.add(getDefaultLegendIcon({\r\n itemWidth: itemWidth,\r\n itemHeight: itemHeight,\r\n icon: legendIcon,\r\n iconRotate: rotate,\r\n itemStyle: style.itemStyle,\r\n lineStyle: style.lineStyle,\r\n symbolKeepAspect: symbolKeepAspect\r\n }));\r\n }\r\n\r\n var textX = itemAlign === 'left' ? itemWidth + 5 : -5;\r\n var textAlign = itemAlign;\r\n var formatter = legendModel.get('formatter');\r\n var content = name;\r\n\r\n if (zrUtil.isString(formatter) && formatter) {\r\n content = formatter.replace('{name}', name != null ? name : '');\r\n } else if (zrUtil.isFunction(formatter)) {\r\n content = formatter(name);\r\n }\r\n\r\n var inactiveColor = legendItemModel.get('inactiveColor');\r\n itemGroup.add(new graphic.Text({\r\n style: createTextStyle(textStyleModel, {\r\n text: content,\r\n x: textX,\r\n y: itemHeight / 2,\r\n fill: isSelected ? textStyleModel.getTextColor() : inactiveColor,\r\n align: textAlign,\r\n verticalAlign: 'middle'\r\n })\r\n })); // Add a invisible rect to increase the area of mouse hover\r\n\r\n var hitRect = new graphic.Rect({\r\n shape: itemGroup.getBoundingRect(),\r\n invisible: true\r\n });\r\n var tooltipModel = legendItemModel.getModel('tooltip');\r\n\r\n if (tooltipModel.get('show')) {\r\n graphic.setTooltipConfig({\r\n el: hitRect,\r\n componentModel: legendModel,\r\n itemName: name,\r\n itemTooltipOption: tooltipModel.option\r\n });\r\n }\r\n\r\n itemGroup.add(hitRect);\r\n itemGroup.eachChild(function (child) {\r\n child.silent = true;\r\n });\r\n hitRect.silent = !selectMode;\r\n this.getContentGroup().add(itemGroup);\r\n enableHoverEmphasis(itemGroup); // @ts-ignore\r\n\r\n itemGroup.__legendDataIndex = dataIndex;\r\n return itemGroup;\r\n };\r\n\r\n LegendView.prototype.layoutInner = function (legendModel, itemAlign, maxSize, isFirstRender, selector, selectorPosition) {\r\n var contentGroup = this.getContentGroup();\r\n var selectorGroup = this.getSelectorGroup(); // Place items in contentGroup.\r\n\r\n layoutUtil.box(legendModel.get('orient'), contentGroup, legendModel.get('itemGap'), maxSize.width, maxSize.height);\r\n var contentRect = contentGroup.getBoundingRect();\r\n var contentPos = [-contentRect.x, -contentRect.y];\r\n selectorGroup.markRedraw();\r\n contentGroup.markRedraw();\r\n\r\n if (selector) {\r\n // Place buttons in selectorGroup\r\n layoutUtil.box( // Buttons in selectorGroup always layout horizontally\r\n 'horizontal', selectorGroup, legendModel.get('selectorItemGap', true));\r\n var selectorRect = selectorGroup.getBoundingRect();\r\n var selectorPos = [-selectorRect.x, -selectorRect.y];\r\n var selectorButtonGap = legendModel.get('selectorButtonGap', true);\r\n var orientIdx = legendModel.getOrient().index;\r\n var wh = orientIdx === 0 ? 'width' : 'height';\r\n var hw = orientIdx === 0 ? 'height' : 'width';\r\n var yx = orientIdx === 0 ? 'y' : 'x';\r\n\r\n if (selectorPosition === 'end') {\r\n selectorPos[orientIdx] += contentRect[wh] + selectorButtonGap;\r\n } else {\r\n contentPos[orientIdx] += selectorRect[wh] + selectorButtonGap;\r\n } //Always align selector to content as 'middle'\r\n\r\n\r\n selectorPos[1 - orientIdx] += contentRect[hw] / 2 - selectorRect[hw] / 2;\r\n selectorGroup.x = selectorPos[0];\r\n selectorGroup.y = selectorPos[1];\r\n contentGroup.x = contentPos[0];\r\n contentGroup.y = contentPos[1];\r\n var mainRect = {\r\n x: 0,\r\n y: 0\r\n };\r\n mainRect[wh] = contentRect[wh] + selectorButtonGap + selectorRect[wh];\r\n mainRect[hw] = Math.max(contentRect[hw], selectorRect[hw]);\r\n mainRect[yx] = Math.min(0, selectorRect[yx] + selectorPos[1 - orientIdx]);\r\n return mainRect;\r\n } else {\r\n contentGroup.x = contentPos[0];\r\n contentGroup.y = contentPos[1];\r\n return this.group.getBoundingRect();\r\n }\r\n };\r\n /**\r\n * @protected\r\n */\r\n\r\n\r\n LegendView.prototype.remove = function () {\r\n this.getContentGroup().removeAll();\r\n this._isFirstRender = true;\r\n };\r\n\r\n LegendView.type = 'legend.plain';\r\n return LegendView;\r\n}(ComponentView);\r\n\r\nfunction getLegendStyle(iconType, legendModel, lineVisualStyle, itemVisualStyle, drawType, isSelected) {\r\n /**\r\n * Use series style if is inherit;\r\n * elsewise, use legend style\r\n */\r\n function handleCommonProps(style, visualStyle) {\r\n // If lineStyle.width is 'auto', it is set to be 2 if series has border\r\n if (style.lineWidth === 'auto') {\r\n style.lineWidth = visualStyle.lineWidth > 0 ? 2 : 0;\r\n }\r\n\r\n each(style, function (propVal, propName) {\r\n style[propName] === 'inherit' && (style[propName] = visualStyle[propName]);\r\n });\r\n } // itemStyle\r\n\r\n\r\n var legendItemModel = legendModel.getModel('itemStyle');\r\n var itemStyle = legendItemModel.getItemStyle();\r\n var iconBrushType = iconType.lastIndexOf('empty', 0) === 0 ? 'fill' : 'stroke';\r\n itemStyle.decal = itemVisualStyle.decal;\r\n\r\n if (itemStyle.fill === 'inherit') {\r\n /**\r\n * Series with visualDrawType as 'stroke' should have\r\n * series stroke as legend fill\r\n */\r\n itemStyle.fill = itemVisualStyle[drawType];\r\n }\r\n\r\n if (itemStyle.stroke === 'inherit') {\r\n /**\r\n * icon type with \"emptyXXX\" should use fill color\r\n * in visual style\r\n */\r\n itemStyle.stroke = itemVisualStyle[iconBrushType];\r\n }\r\n\r\n if (itemStyle.opacity === 'inherit') {\r\n /**\r\n * Use lineStyle.opacity if drawType is stroke\r\n */\r\n itemStyle.opacity = (drawType === 'fill' ? itemVisualStyle : lineVisualStyle).opacity;\r\n }\r\n\r\n handleCommonProps(itemStyle, itemVisualStyle); // lineStyle\r\n\r\n var legendLineModel = legendModel.getModel('lineStyle');\r\n var lineStyle = legendLineModel.getLineStyle();\r\n handleCommonProps(lineStyle, lineVisualStyle); // Fix auto color to real color\r\n\r\n itemStyle.fill === 'auto' && (itemStyle.fill = itemVisualStyle.fill);\r\n itemStyle.stroke === 'auto' && (itemStyle.stroke = itemVisualStyle.fill);\r\n lineStyle.stroke === 'auto' && (lineStyle.stroke = itemVisualStyle.fill);\r\n\r\n if (!isSelected) {\r\n var borderWidth = legendModel.get('inactiveBorderWidth');\r\n /**\r\n * Since stroke is set to be inactiveBorderColor, it may occur that\r\n * there is no border in series but border in legend, so we need to\r\n * use border only when series has border if is set to be auto\r\n */\r\n\r\n var visualHasBorder = itemStyle[iconBrushType];\r\n itemStyle.lineWidth = borderWidth === 'auto' ? itemVisualStyle.lineWidth > 0 && visualHasBorder ? 2 : 0 : itemStyle.lineWidth;\r\n itemStyle.fill = legendModel.get('inactiveColor');\r\n itemStyle.stroke = legendModel.get('inactiveBorderColor');\r\n lineStyle.stroke = legendLineModel.get('inactiveColor');\r\n lineStyle.lineWidth = legendLineModel.get('inactiveWidth');\r\n }\r\n\r\n return {\r\n itemStyle: itemStyle,\r\n lineStyle: lineStyle\r\n };\r\n}\r\n\r\nfunction getDefaultLegendIcon(opt) {\r\n var symboType = opt.icon || 'roundRect';\r\n var icon = createSymbol(symboType, 0, 0, opt.itemWidth, opt.itemHeight, opt.itemStyle.fill, opt.symbolKeepAspect);\r\n icon.setStyle(opt.itemStyle);\r\n icon.rotation = (opt.iconRotate || 0) * Math.PI / 180;\r\n icon.setOrigin([opt.itemWidth / 2, opt.itemHeight / 2]);\r\n\r\n if (symboType.indexOf('empty') > -1) {\r\n icon.style.stroke = icon.style.fill;\r\n icon.style.fill = '#fff';\r\n icon.style.lineWidth = 2;\r\n }\r\n\r\n return icon;\r\n}\r\n\r\nfunction dispatchSelectAction(seriesName, dataName, api, excludeSeriesId) {\r\n // downplay before unselect\r\n dispatchDownplayAction(seriesName, dataName, api, excludeSeriesId);\r\n api.dispatchAction({\r\n type: 'legendToggleSelect',\r\n name: seriesName != null ? seriesName : dataName\r\n }); // highlight after select\r\n // TODO higlight immediately may cause animation loss.\r\n\r\n dispatchHighlightAction(seriesName, dataName, api, excludeSeriesId);\r\n}\r\n\r\nfunction isUseHoverLayer(api) {\r\n var list = api.getZr().storage.getDisplayList();\r\n var emphasisState;\r\n var i = 0;\r\n var len = list.length;\r\n\r\n while (i < len && !(emphasisState = list[i].states.emphasis)) {\r\n i++;\r\n }\r\n\r\n return emphasisState && emphasisState.hoverLayer;\r\n}\r\n\r\nfunction dispatchHighlightAction(seriesName, dataName, api, excludeSeriesId) {\r\n // If element hover will move to a hoverLayer.\r\n if (!isUseHoverLayer(api)) {\r\n api.dispatchAction({\r\n type: 'highlight',\r\n seriesName: seriesName,\r\n name: dataName,\r\n excludeSeriesId: excludeSeriesId\r\n });\r\n }\r\n}\r\n\r\nfunction dispatchDownplayAction(seriesName, dataName, api, excludeSeriesId) {\r\n // If element hover will move to a hoverLayer.\r\n if (!isUseHoverLayer(api)) {\r\n api.dispatchAction({\r\n type: 'downplay',\r\n seriesName: seriesName,\r\n name: dataName,\r\n excludeSeriesId: excludeSeriesId\r\n });\r\n }\r\n}\r\n\r\nexport default LegendView;"]},"metadata":{},"sourceType":"module"}