1 line
116 KiB
JSON
1 line
116 KiB
JSON
{"ast":null,"code":"import \"core-js/modules/es.function.name.js\";\nimport \"core-js/modules/es.error.cause.js\";\nimport \"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 { hasOwn, assert, isString, retrieve2, retrieve3, defaults, each, indexOf } from 'zrender/lib/core/util.js';\nimport * as graphicUtil from '../../util/graphic.js';\nimport { setDefaultStateProxy, toggleHoverEmphasis } from '../../util/states.js';\nimport * as labelStyleHelper from '../../label/labelStyle.js';\nimport { getDefaultLabel } from '../helper/labelHelper.js';\nimport { getLayoutOnAxis } from '../../layout/barGrid.js';\nimport DataDiffer from '../../data/DataDiffer.js';\nimport ChartView from '../../view/Chart.js';\nimport { createClipPath } from '../helper/createClipPathFromCoordSys.js';\nimport prepareCartesian2d from '../../coord/cartesian/prepareCustom.js';\nimport prepareGeo from '../../coord/geo/prepareCustom.js';\nimport prepareSingleAxis from '../../coord/single/prepareCustom.js';\nimport preparePolar from '../../coord/polar/prepareCustom.js';\nimport prepareCalendar from '../../coord/calendar/prepareCustom.js';\nimport Displayable from 'zrender/lib/graphic/Displayable.js';\nimport { convertToEC4StyleForCustomSerise, isEC4CompatibleStyle, convertFromEC4CompatibleStyle, warnDeprecated } from '../../util/styleCompat.js';\nimport { throwError } from '../../util/log.js';\nimport { createOrUpdatePatternFromDecal } from '../../util/decal.js';\nimport { STYLE_VISUAL_TYPE, NON_STYLE_VISUAL_PROPS, customInnerStore } from './CustomSeries.js';\nimport { applyLeaveTransition, applyUpdateTransition } from '../../animation/customGraphicTransition.js';\nimport { applyKeyframeAnimation, stopPreviousKeyframeAnimationAndRestore } from '../../animation/customGraphicKeyframeAnimation.js';\nvar EMPHASIS = 'emphasis';\nvar NORMAL = 'normal';\nvar BLUR = 'blur';\nvar SELECT = 'select';\nvar STATES = [NORMAL, EMPHASIS, BLUR, SELECT];\nvar PATH_ITEM_STYLE = {\n normal: ['itemStyle'],\n emphasis: [EMPHASIS, 'itemStyle'],\n blur: [BLUR, 'itemStyle'],\n select: [SELECT, 'itemStyle']\n};\nvar PATH_LABEL = {\n normal: ['label'],\n emphasis: [EMPHASIS, 'label'],\n blur: [BLUR, 'label'],\n select: [SELECT, 'label']\n};\nvar DEFAULT_TRANSITION = ['x', 'y']; // Use prefix to avoid index to be the same as el.name,\n// which will cause weird update animation.\n\nvar GROUP_DIFF_PREFIX = 'e\\0\\0';\nvar attachedTxInfoTmp = {\n normal: {},\n emphasis: {},\n blur: {},\n select: {}\n};\n/**\n * To reduce total package size of each coordinate systems, the modules `prepareCustom`\n * of each coordinate systems are not required by each coordinate systems directly, but\n * required by the module `custom`.\n *\n * prepareInfoForCustomSeries {Function}: optional\n * @return {Object} {coordSys: {...}, api: {\n * coord: function (data, clamp) {}, // return point in global.\n * size: function (dataSize, dataItem) {} // return size of each axis in coordSys.\n * }}\n */\n\nvar prepareCustoms = {\n cartesian2d: prepareCartesian2d,\n geo: prepareGeo,\n single: prepareSingleAxis,\n polar: preparePolar,\n calendar: prepareCalendar\n};\n\nfunction isPath(el) {\n return el instanceof graphicUtil.Path;\n}\n\nfunction isDisplayable(el) {\n return el instanceof Displayable;\n}\n\nfunction copyElement(sourceEl, targetEl) {\n targetEl.copyTransform(sourceEl);\n\n if (isDisplayable(targetEl) && isDisplayable(sourceEl)) {\n targetEl.setStyle(sourceEl.style);\n targetEl.z = sourceEl.z;\n targetEl.z2 = sourceEl.z2;\n targetEl.zlevel = sourceEl.zlevel;\n targetEl.invisible = sourceEl.invisible;\n targetEl.ignore = sourceEl.ignore;\n\n if (isPath(targetEl) && isPath(sourceEl)) {\n targetEl.setShape(sourceEl.shape);\n }\n }\n}\n\nvar CustomChartView =\n/** @class */\nfunction (_super) {\n __extends(CustomChartView, _super);\n\n function CustomChartView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = CustomChartView.type;\n return _this;\n }\n\n CustomChartView.prototype.render = function (customSeries, ecModel, api, payload) {\n // Clear previously rendered progressive elements.\n this._progressiveEls = null;\n var oldData = this._data;\n var data = customSeries.getData();\n var group = this.group;\n var renderItem = makeRenderItem(customSeries, data, ecModel, api);\n\n if (!oldData) {\n // Previous render is incremental render or first render.\n // Needs remove the incremental rendered elements.\n group.removeAll();\n }\n\n data.diff(oldData).add(function (newIdx) {\n createOrUpdateItem(api, null, newIdx, renderItem(newIdx, payload), customSeries, group, data);\n }).remove(function (oldIdx) {\n var el = oldData.getItemGraphicEl(oldIdx);\n el && applyLeaveTransition(el, customInnerStore(el).option, customSeries);\n }).update(function (newIdx, oldIdx) {\n var oldEl = oldData.getItemGraphicEl(oldIdx);\n createOrUpdateItem(api, oldEl, newIdx, renderItem(newIdx, payload), customSeries, group, data);\n }).execute(); // Do clipping\n\n var clipPath = customSeries.get('clip', true) ? createClipPath(customSeries.coordinateSystem, false, customSeries) : null;\n\n if (clipPath) {\n group.setClipPath(clipPath);\n } else {\n group.removeClipPath();\n }\n\n this._data = data;\n };\n\n CustomChartView.prototype.incrementalPrepareRender = function (customSeries, ecModel, api) {\n this.group.removeAll();\n this._data = null;\n };\n\n CustomChartView.prototype.incrementalRender = function (params, customSeries, ecModel, api, payload) {\n var data = customSeries.getData();\n var renderItem = makeRenderItem(customSeries, data, ecModel, api);\n var progressiveEls = this._progressiveEls = [];\n\n function setIncrementalAndHoverLayer(el) {\n if (!el.isGroup) {\n el.incremental = true;\n el.ensureState('emphasis').hoverLayer = true;\n }\n }\n\n for (var idx = params.start; idx < params.end; idx++) {\n var el = createOrUpdateItem(null, null, idx, renderItem(idx, payload), customSeries, this.group, data);\n\n if (el) {\n el.traverse(setIncrementalAndHoverLayer);\n progressiveEls.push(el);\n }\n }\n };\n\n CustomChartView.prototype.eachRendered = function (cb) {\n graphicUtil.traverseElements(this._progressiveEls || this.group, cb);\n };\n\n CustomChartView.prototype.filterForExposedEvent = function (eventType, query, targetEl, packedEvent) {\n var elementName = query.element;\n\n if (elementName == null || targetEl.name === elementName) {\n return true;\n } // Enable to give a name on a group made by `renderItem`, and listen\n // events that are triggered by its descendents.\n\n\n while ((targetEl = targetEl.__hostTarget || targetEl.parent) && targetEl !== this.group) {\n if (targetEl.name === elementName) {\n return true;\n }\n }\n\n return false;\n };\n\n CustomChartView.type = 'custom';\n return CustomChartView;\n}(ChartView);\n\nexport default CustomChartView;\n\nfunction createEl(elOption) {\n var graphicType = elOption.type;\n var el; // Those graphic elements are not shapes. They should not be\n // overwritten by users, so do them first.\n\n if (graphicType === 'path') {\n var shape = elOption.shape; // Using pathRect brings convenience to users sacle svg path.\n\n var pathRect = shape.width != null && shape.height != null ? {\n x: shape.x || 0,\n y: shape.y || 0,\n width: shape.width,\n height: shape.height\n } : null;\n var pathData = getPathData(shape); // Path is also used for icon, so layout 'center' by default.\n\n el = graphicUtil.makePath(pathData, null, pathRect, shape.layout || 'center');\n customInnerStore(el).customPathData = pathData;\n } else if (graphicType === 'image') {\n el = new graphicUtil.Image({});\n customInnerStore(el).customImagePath = elOption.style.image;\n } else if (graphicType === 'text') {\n el = new graphicUtil.Text({}); // customInnerStore(el).customText = (elOption.style as TextStyleProps).text;\n } else if (graphicType === 'group') {\n el = new graphicUtil.Group();\n } else if (graphicType === 'compoundPath') {\n throw new Error('\"compoundPath\" is not supported yet.');\n } else {\n var Clz = graphicUtil.getShapeClass(graphicType);\n\n if (!Clz) {\n var errMsg = '';\n\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'graphic type \"' + graphicType + '\" can not be found.';\n }\n\n throwError(errMsg);\n }\n\n el = new Clz();\n }\n\n customInnerStore(el).customGraphicType = graphicType;\n el.name = elOption.name; // Compat ec4: the default z2 lift is 1. If changing the number,\n // some cases probably be broken: hierarchy layout along z, like circle packing,\n // where emphasis only intending to modify color/border rather than lift z2.\n\n el.z2EmphasisLift = 1;\n el.z2SelectLift = 1;\n return el;\n}\n\nfunction updateElNormal( // Can be null/undefined\napi, el, dataIndex, elOption, attachedTxInfo, seriesModel, isInit) {\n // Stop and restore before update any other attributes.\n stopPreviousKeyframeAnimationAndRestore(el);\n var txCfgOpt = attachedTxInfo && attachedTxInfo.normal.cfg;\n\n if (txCfgOpt) {\n // PENDING: whether use user object directly rather than clone?\n // TODO:5.0 textConfig transition animation?\n el.setTextConfig(txCfgOpt);\n } // Default transition ['x', 'y']\n\n\n if (elOption && elOption.transition == null) {\n elOption.transition = DEFAULT_TRANSITION;\n } // Do some normalization on style.\n\n\n var styleOpt = elOption && elOption.style;\n\n if (styleOpt) {\n if (el.type === 'text') {\n var textOptionStyle = styleOpt; // Compatible with ec4: if `textFill` or `textStroke` exists use them.\n\n hasOwn(textOptionStyle, 'textFill') && (textOptionStyle.fill = textOptionStyle.textFill);\n hasOwn(textOptionStyle, 'textStroke') && (textOptionStyle.stroke = textOptionStyle.textStroke);\n }\n\n var decalPattern = void 0;\n var decalObj = isPath(el) ? styleOpt.decal : null;\n\n if (api && decalObj) {\n decalObj.dirty = true;\n decalPattern = createOrUpdatePatternFromDecal(decalObj, api);\n } // Always overwrite in case user specify this prop.\n\n\n styleOpt.__decalPattern = decalPattern;\n }\n\n if (isDisplayable(el)) {\n if (styleOpt) {\n var decalPattern = styleOpt.__decalPattern;\n\n if (decalPattern) {\n styleOpt.decal = decalPattern;\n }\n }\n }\n\n applyUpdateTransition(el, elOption, seriesModel, {\n dataIndex: dataIndex,\n isInit: isInit,\n clearStyle: true\n });\n applyKeyframeAnimation(el, elOption.keyframeAnimation, seriesModel);\n}\n\nfunction updateElOnState(state, el, elStateOpt, styleOpt, attachedTxInfo) {\n var elDisplayable = el.isGroup ? null : el;\n var txCfgOpt = attachedTxInfo && attachedTxInfo[state].cfg; // PENDING:5.0 support customize scale change and transition animation?\n\n if (elDisplayable) {\n // By default support auto lift color when hover whether `emphasis` specified.\n var stateObj = elDisplayable.ensureState(state);\n\n if (styleOpt === false) {\n var existingEmphasisState = elDisplayable.getState(state);\n\n if (existingEmphasisState) {\n existingEmphasisState.style = null;\n }\n } else {\n // style is needed to enable default emphasis.\n stateObj.style = styleOpt || null;\n } // If `elOption.styleEmphasis` or `elOption.emphasis.style` is `false`,\n // remove hover style.\n // If `elOption.textConfig` or `elOption.emphasis.textConfig` is null/undefined, it does not\n // make sense. So for simplicity, we do not ditinguish `hasOwnProperty` and null/undefined.\n\n\n if (txCfgOpt) {\n stateObj.textConfig = txCfgOpt;\n }\n\n setDefaultStateProxy(elDisplayable);\n }\n}\n\nfunction updateZ(el, elOption, seriesModel) {\n // Group not support textContent and not support z yet.\n if (el.isGroup) {\n return;\n }\n\n var elDisplayable = el;\n var currentZ = seriesModel.currentZ;\n var currentZLevel = seriesModel.currentZLevel; // Always erase.\n\n elDisplayable.z = currentZ;\n elDisplayable.zlevel = currentZLevel; // z2 must not be null/undefined, otherwise sort error may occur.\n\n var optZ2 = elOption.z2;\n optZ2 != null && (elDisplayable.z2 = optZ2 || 0);\n\n for (var i = 0; i < STATES.length; i++) {\n updateZForEachState(elDisplayable, elOption, STATES[i]);\n }\n}\n\nfunction updateZForEachState(elDisplayable, elOption, state) {\n var isNormal = state === NORMAL;\n var elStateOpt = isNormal ? elOption : retrieveStateOption(elOption, state);\n var optZ2 = elStateOpt ? elStateOpt.z2 : null;\n var stateObj;\n\n if (optZ2 != null) {\n // Do not `ensureState` until required.\n stateObj = isNormal ? elDisplayable : elDisplayable.ensureState(state);\n stateObj.z2 = optZ2 || 0;\n }\n}\n\nfunction makeRenderItem(customSeries, data, ecModel, api) {\n var renderItem = customSeries.get('renderItem');\n var coordSys = customSeries.coordinateSystem;\n var prepareResult = {};\n\n if (coordSys) {\n if (process.env.NODE_ENV !== 'production') {\n assert(renderItem, 'series.render is required.');\n assert(coordSys.prepareCustoms || prepareCustoms[coordSys.type], 'This coordSys does not support custom series.');\n } // `coordSys.prepareCustoms` is used for external coord sys like bmap.\n\n\n prepareResult = coordSys.prepareCustoms ? coordSys.prepareCustoms(coordSys) : prepareCustoms[coordSys.type](coordSys);\n }\n\n var userAPI = defaults({\n getWidth: api.getWidth,\n getHeight: api.getHeight,\n getZr: api.getZr,\n getDevicePixelRatio: api.getDevicePixelRatio,\n value: value,\n style: style,\n ordinalRawValue: ordinalRawValue,\n styleEmphasis: styleEmphasis,\n visual: visual,\n barLayout: barLayout,\n currentSeriesIndices: currentSeriesIndices,\n font: font\n }, prepareResult.api || {});\n var userParams = {\n // The life cycle of context: current round of rendering.\n // The global life cycle is probably not necessary, because\n // user can store global status by themselves.\n context: {},\n seriesId: customSeries.id,\n seriesName: customSeries.name,\n seriesIndex: customSeries.seriesIndex,\n coordSys: prepareResult.coordSys,\n dataInsideLength: data.count(),\n encode: wrapEncodeDef(customSeries.getData())\n }; // If someday intending to refactor them to a class, should consider do not\n // break change: currently these attribute member are encapsulated in a closure\n // so that do not need to force user to call these method with a scope.\n // Do not support call `api` asynchronously without dataIndexInside input.\n\n var currDataIndexInside;\n var currItemModel;\n var currItemStyleModels = {};\n var currLabelModels = {};\n var seriesItemStyleModels = {};\n var seriesLabelModels = {};\n\n for (var i = 0; i < STATES.length; i++) {\n var stateName = STATES[i];\n seriesItemStyleModels[stateName] = customSeries.getModel(PATH_ITEM_STYLE[stateName]);\n seriesLabelModels[stateName] = customSeries.getModel(PATH_LABEL[stateName]);\n }\n\n function getItemModel(dataIndexInside) {\n return dataIndexInside === currDataIndexInside ? currItemModel || (currItemModel = data.getItemModel(dataIndexInside)) : data.getItemModel(dataIndexInside);\n }\n\n function getItemStyleModel(dataIndexInside, state) {\n return !data.hasItemOption ? seriesItemStyleModels[state] : dataIndexInside === currDataIndexInside ? currItemStyleModels[state] || (currItemStyleModels[state] = getItemModel(dataIndexInside).getModel(PATH_ITEM_STYLE[state])) : getItemModel(dataIndexInside).getModel(PATH_ITEM_STYLE[state]);\n }\n\n function getLabelModel(dataIndexInside, state) {\n return !data.hasItemOption ? seriesLabelModels[state] : dataIndexInside === currDataIndexInside ? currLabelModels[state] || (currLabelModels[state] = getItemModel(dataIndexInside).getModel(PATH_LABEL[state])) : getItemModel(dataIndexInside).getModel(PATH_LABEL[state]);\n }\n\n return function (dataIndexInside, payload) {\n currDataIndexInside = dataIndexInside;\n currItemModel = null;\n currItemStyleModels = {};\n currLabelModels = {};\n return renderItem && renderItem(defaults({\n dataIndexInside: dataIndexInside,\n dataIndex: data.getRawIndex(dataIndexInside),\n // Can be used for optimization when zoom or roam.\n actionType: payload ? payload.type : null\n }, userParams), userAPI);\n };\n /**\n * @public\n * @param dim by default 0.\n * @param dataIndexInside by default `currDataIndexInside`.\n */\n\n function value(dim, dataIndexInside) {\n dataIndexInside == null && (dataIndexInside = currDataIndexInside);\n return data.getStore().get(data.getDimensionIndex(dim || 0), dataIndexInside);\n }\n /**\n * @public\n * @param dim by default 0.\n * @param dataIndexInside by default `currDataIndexInside`.\n */\n\n\n function ordinalRawValue(dim, dataIndexInside) {\n dataIndexInside == null && (dataIndexInside = currDataIndexInside);\n dim = dim || 0;\n var dimInfo = data.getDimensionInfo(dim);\n\n if (!dimInfo) {\n var dimIndex = data.getDimensionIndex(dim);\n return dimIndex >= 0 ? data.getStore().get(dimIndex, dataIndexInside) : undefined;\n }\n\n var val = data.get(dimInfo.name, dataIndexInside);\n var ordinalMeta = dimInfo && dimInfo.ordinalMeta;\n return ordinalMeta ? ordinalMeta.categories[val] : val;\n }\n /**\n * @deprecated The original intention of `api.style` is enable to set itemStyle\n * like other series. But it is not necessary and not easy to give a strict definition\n * of what it returns. And since echarts5 it needs to be make compat work. So\n * deprecates it since echarts5.\n *\n * By default, `visual` is applied to style (to support visualMap).\n * `visual.color` is applied at `fill`. If user want apply visual.color on `stroke`,\n * it can be implemented as:\n * `api.style({stroke: api.visual('color'), fill: null})`;\n *\n * [Compat]: since ec5, RectText has been separated from its hosts el.\n * so `api.style()` will only return the style from `itemStyle` but not handle `label`\n * any more. But `series.label` config is never published in doc.\n * We still compat it in `api.style()`. But not encourage to use it and will still not\n * to pulish it to doc.\n * @public\n * @param dataIndexInside by default `currDataIndexInside`.\n */\n\n\n function style(userProps, dataIndexInside) {\n if (process.env.NODE_ENV !== 'production') {\n warnDeprecated('api.style', 'Please write literal style directly instead.');\n }\n\n dataIndexInside == null && (dataIndexInside = currDataIndexInside);\n var style = data.getItemVisual(dataIndexInside, 'style');\n var visualColor = style && style.fill;\n var opacity = style && style.opacity;\n var itemStyle = getItemStyleModel(dataIndexInside, NORMAL).getItemStyle();\n visualColor != null && (itemStyle.fill = visualColor);\n opacity != null && (itemStyle.opacity = opacity);\n var opt = {\n inheritColor: isString(visualColor) ? visualColor : '#000'\n };\n var labelModel = getLabelModel(dataIndexInside, NORMAL); // Now that the feature of \"auto adjust text fill/stroke\" has been migrated to zrender\n // since ec5, we should set `isAttached` as `false` here and make compat in\n // `convertToEC4StyleForCustomSerise`.\n\n var textStyle = labelStyleHelper.createTextStyle(labelModel, null, opt, false, true);\n textStyle.text = labelModel.getShallow('show') ? retrieve2(customSeries.getFormattedLabel(dataIndexInside, NORMAL), getDefaultLabel(data, dataIndexInside)) : null;\n var textConfig = labelStyleHelper.createTextConfig(labelModel, opt, false);\n preFetchFromExtra(userProps, itemStyle);\n itemStyle = convertToEC4StyleForCustomSerise(itemStyle, textStyle, textConfig);\n userProps && applyUserPropsAfter(itemStyle, userProps);\n itemStyle.legacy = true;\n return itemStyle;\n }\n /**\n * @deprecated The reason see `api.style()`\n * @public\n * @param dataIndexInside by default `currDataIndexInside`.\n */\n\n\n function styleEmphasis(userProps, dataIndexInside) {\n if (process.env.NODE_ENV !== 'production') {\n warnDeprecated('api.styleEmphasis', 'Please write literal style directly instead.');\n }\n\n dataIndexInside == null && (dataIndexInside = currDataIndexInside);\n var itemStyle = getItemStyleModel(dataIndexInside, EMPHASIS).getItemStyle();\n var labelModel = getLabelModel(dataIndexInside, EMPHASIS);\n var textStyle = labelStyleHelper.createTextStyle(labelModel, null, null, true, true);\n textStyle.text = labelModel.getShallow('show') ? retrieve3(customSeries.getFormattedLabel(dataIndexInside, EMPHASIS), customSeries.getFormattedLabel(dataIndexInside, NORMAL), getDefaultLabel(data, dataIndexInside)) : null;\n var textConfig = labelStyleHelper.createTextConfig(labelModel, null, true);\n preFetchFromExtra(userProps, itemStyle);\n itemStyle = convertToEC4StyleForCustomSerise(itemStyle, textStyle, textConfig);\n userProps && applyUserPropsAfter(itemStyle, userProps);\n itemStyle.legacy = true;\n return itemStyle;\n }\n\n function applyUserPropsAfter(itemStyle, extra) {\n for (var key in extra) {\n if (hasOwn(extra, key)) {\n itemStyle[key] = extra[key];\n }\n }\n }\n\n function preFetchFromExtra(extra, itemStyle) {\n // A trick to retrieve those props firstly, which are used to\n // apply auto inside fill/stroke in `convertToEC4StyleForCustomSerise`.\n // (It's not reasonable but only for a degree of compat)\n if (extra) {\n extra.textFill && (itemStyle.textFill = extra.textFill);\n extra.textPosition && (itemStyle.textPosition = extra.textPosition);\n }\n }\n /**\n * @public\n * @param dataIndexInside by default `currDataIndexInside`.\n */\n\n\n function visual(visualType, dataIndexInside) {\n dataIndexInside == null && (dataIndexInside = currDataIndexInside);\n\n if (hasOwn(STYLE_VISUAL_TYPE, visualType)) {\n var style_1 = data.getItemVisual(dataIndexInside, 'style');\n return style_1 ? style_1[STYLE_VISUAL_TYPE[visualType]] : null;\n } // Only support these visuals. Other visual might be inner tricky\n // for performance (like `style`), do not expose to users.\n\n\n if (hasOwn(NON_STYLE_VISUAL_PROPS, visualType)) {\n return data.getItemVisual(dataIndexInside, visualType);\n }\n }\n /**\n * @public\n * @return If not support, return undefined.\n */\n\n\n function barLayout(opt) {\n if (coordSys.type === 'cartesian2d') {\n var baseAxis = coordSys.getBaseAxis();\n return getLayoutOnAxis(defaults({\n axis: baseAxis\n }, opt));\n }\n }\n /**\n * @public\n */\n\n\n function currentSeriesIndices() {\n return ecModel.getCurrentSeriesIndices();\n }\n /**\n * @public\n * @return font string\n */\n\n\n function font(opt) {\n return labelStyleHelper.getFont(opt, ecModel);\n }\n}\n\nfunction wrapEncodeDef(data) {\n var encodeDef = {};\n each(data.dimensions, function (dimName) {\n var dimInfo = data.getDimensionInfo(dimName);\n\n if (!dimInfo.isExtraCoord) {\n var coordDim = dimInfo.coordDim;\n var dataDims = encodeDef[coordDim] = encodeDef[coordDim] || [];\n dataDims[dimInfo.coordDimIndex] = data.getDimensionIndex(dimName);\n }\n });\n return encodeDef;\n}\n\nfunction createOrUpdateItem(api, existsEl, dataIndex, elOption, seriesModel, group, data) {\n // [Rule]\n // If `renderItem` returns `null`/`undefined`/`false`, remove the previous el if existing.\n // (It seems that violate the \"merge\" principle, but most of users probably intuitively\n // regard \"return;\" as \"show nothing element whatever\", so make a exception to meet the\n // most cases.)\n // The rule or \"merge\" see [STRATEGY_MERGE].\n // If `elOption` is `null`/`undefined`/`false` (when `renderItem` returns nothing).\n if (!elOption) {\n group.remove(existsEl);\n return;\n }\n\n var el = doCreateOrUpdateEl(api, existsEl, dataIndex, elOption, seriesModel, group);\n el && data.setItemGraphicEl(dataIndex, el);\n el && toggleHoverEmphasis(el, elOption.focus, elOption.blurScope, elOption.emphasisDisabled);\n return el;\n}\n\nfunction doCreateOrUpdateEl(api, existsEl, dataIndex, elOption, seriesModel, group) {\n if (process.env.NODE_ENV !== 'production') {\n assert(elOption, 'should not have an null/undefined element setting');\n }\n\n var toBeReplacedIdx = -1;\n var oldEl = existsEl;\n\n if (existsEl && doesElNeedRecreate(existsEl, elOption, seriesModel) // || (\n // // PENDING: even in one-to-one mapping case, if el is marked as morph,\n // // do not sure whether the el will be mapped to another el with different\n // // hierarchy in Group tree. So always recreate el rather than reuse the el.\n // morphHelper && morphHelper.isOneToOneFrom(el)\n // )\n ) {\n // Should keep at the original index, otherwise \"merge by index\" will be incorrect.\n toBeReplacedIdx = indexOf(group.childrenRef(), existsEl);\n existsEl = null;\n }\n\n var isInit = !existsEl;\n var el = existsEl;\n\n if (!el) {\n el = createEl(elOption);\n\n if (oldEl) {\n copyElement(oldEl, el);\n }\n } else {\n // FIMXE:NEXT unified clearState?\n // If in some case the performance issue arised, consider\n // do not clearState but update cached normal state directly.\n el.clearStates();\n } // Need to set morph: false explictly to disable automatically morphing.\n\n\n if (elOption.morph === false) {\n el.disableMorphing = true;\n } else if (el.disableMorphing) {\n el.disableMorphing = false;\n }\n\n attachedTxInfoTmp.normal.cfg = attachedTxInfoTmp.normal.conOpt = attachedTxInfoTmp.emphasis.cfg = attachedTxInfoTmp.emphasis.conOpt = attachedTxInfoTmp.blur.cfg = attachedTxInfoTmp.blur.conOpt = attachedTxInfoTmp.select.cfg = attachedTxInfoTmp.select.conOpt = null;\n attachedTxInfoTmp.isLegacy = false;\n doCreateOrUpdateAttachedTx(el, dataIndex, elOption, seriesModel, isInit, attachedTxInfoTmp);\n doCreateOrUpdateClipPath(el, dataIndex, elOption, seriesModel, isInit);\n updateElNormal(api, el, dataIndex, elOption, attachedTxInfoTmp, seriesModel, isInit); // `elOption.info` enables user to mount some info on\n // elements and use them in event handlers.\n // Update them only when user specified, otherwise, remain.\n\n hasOwn(elOption, 'info') && (customInnerStore(el).info = elOption.info);\n\n for (var i = 0; i < STATES.length; i++) {\n var stateName = STATES[i];\n\n if (stateName !== NORMAL) {\n var otherStateOpt = retrieveStateOption(elOption, stateName);\n var otherStyleOpt = retrieveStyleOptionOnState(elOption, otherStateOpt, stateName);\n updateElOnState(stateName, el, otherStateOpt, otherStyleOpt, attachedTxInfoTmp);\n }\n }\n\n updateZ(el, elOption, seriesModel);\n\n if (elOption.type === 'group') {\n mergeChildren(api, el, dataIndex, elOption, seriesModel);\n }\n\n if (toBeReplacedIdx >= 0) {\n group.replaceAt(el, toBeReplacedIdx);\n } else {\n group.add(el);\n }\n\n return el;\n} // `el` must not be null/undefined.\n\n\nfunction doesElNeedRecreate(el, elOption, seriesModel) {\n var elInner = customInnerStore(el);\n var elOptionType = elOption.type;\n var elOptionShape = elOption.shape;\n var elOptionStyle = elOption.style;\n return (// Always create new if universal transition is enabled.\n // Because we do transition after render. It needs to know what old element is. Replacement will loose it.\n seriesModel.isUniversalTransitionEnabled() // If `elOptionType` is `null`, follow the merge principle.\n || elOptionType != null && elOptionType !== elInner.customGraphicType || elOptionType === 'path' && hasOwnPathData(elOptionShape) && getPathData(elOptionShape) !== elInner.customPathData || elOptionType === 'image' && hasOwn(elOptionStyle, 'image') && elOptionStyle.image !== elInner.customImagePath // // FIXME test and remove this restriction?\n // || (elOptionType === 'text'\n // && hasOwn(elOptionStyle, 'text')\n // && (elOptionStyle as TextStyleProps).text !== elInner.customText\n // )\n\n );\n}\n\nfunction doCreateOrUpdateClipPath(el, dataIndex, elOption, seriesModel, isInit) {\n // Based on the \"merge\" principle, if no clipPath provided,\n // do nothing. The exists clip will be totally removed only if\n // `el.clipPath` is `false`. Otherwise it will be merged/replaced.\n var clipPathOpt = elOption.clipPath;\n\n if (clipPathOpt === false) {\n if (el && el.getClipPath()) {\n el.removeClipPath();\n }\n } else if (clipPathOpt) {\n var clipPath = el.getClipPath();\n\n if (clipPath && doesElNeedRecreate(clipPath, clipPathOpt, seriesModel)) {\n clipPath = null;\n }\n\n if (!clipPath) {\n clipPath = createEl(clipPathOpt);\n\n if (process.env.NODE_ENV !== 'production') {\n assert(isPath(clipPath), 'Only any type of `path` can be used in `clipPath`, rather than ' + clipPath.type + '.');\n }\n\n el.setClipPath(clipPath);\n }\n\n updateElNormal(null, clipPath, dataIndex, clipPathOpt, null, seriesModel, isInit);\n } // If not define `clipPath` in option, do nothing unnecessary.\n\n}\n\nfunction doCreateOrUpdateAttachedTx(el, dataIndex, elOption, seriesModel, isInit, attachedTxInfo) {\n // Group does not support textContent temporarily until necessary.\n if (el.isGroup) {\n return;\n } // Normal must be called before emphasis, for `isLegacy` detection.\n\n\n processTxInfo(elOption, null, attachedTxInfo);\n processTxInfo(elOption, EMPHASIS, attachedTxInfo); // If `elOption.textConfig` or `elOption.textContent` is null/undefined, it does not make sense.\n // So for simplicity, if \"elOption hasOwnProperty of them but be null/undefined\", we do not\n // trade them as set to null to el.\n // Especially:\n // `elOption.textContent: false` means remove textContent.\n // `elOption.textContent.emphasis.style: false` means remove the style from emphasis state.\n\n var txConOptNormal = attachedTxInfo.normal.conOpt;\n var txConOptEmphasis = attachedTxInfo.emphasis.conOpt;\n var txConOptBlur = attachedTxInfo.blur.conOpt;\n var txConOptSelect = attachedTxInfo.select.conOpt;\n\n if (txConOptNormal != null || txConOptEmphasis != null || txConOptSelect != null || txConOptBlur != null) {\n var textContent = el.getTextContent();\n\n if (txConOptNormal === false) {\n textContent && el.removeTextContent();\n } else {\n txConOptNormal = attachedTxInfo.normal.conOpt = txConOptNormal || {\n type: 'text'\n };\n\n if (!textContent) {\n textContent = createEl(txConOptNormal);\n el.setTextContent(textContent);\n } else {\n // If in some case the performance issue arised, consider\n // do not clearState but update cached normal state directly.\n textContent.clearStates();\n }\n\n updateElNormal(null, textContent, dataIndex, txConOptNormal, null, seriesModel, isInit);\n var txConStlOptNormal = txConOptNormal && txConOptNormal.style;\n\n for (var i = 0; i < STATES.length; i++) {\n var stateName = STATES[i];\n\n if (stateName !== NORMAL) {\n var txConOptOtherState = attachedTxInfo[stateName].conOpt;\n updateElOnState(stateName, textContent, txConOptOtherState, retrieveStyleOptionOnState(txConOptNormal, txConOptOtherState, stateName), null);\n }\n }\n\n txConStlOptNormal ? textContent.dirty() : textContent.markRedraw();\n }\n }\n}\n\nfunction processTxInfo(elOption, state, attachedTxInfo) {\n var stateOpt = !state ? elOption : retrieveStateOption(elOption, state);\n var styleOpt = !state ? elOption.style : retrieveStyleOptionOnState(elOption, stateOpt, EMPHASIS);\n var elType = elOption.type;\n var txCfg = stateOpt ? stateOpt.textConfig : null;\n var txConOptNormal = elOption.textContent;\n var txConOpt = !txConOptNormal ? null : !state ? txConOptNormal : retrieveStateOption(txConOptNormal, state);\n\n if (styleOpt && ( // Because emphasis style has little info to detect legacy,\n // if normal is legacy, emphasis is trade as legacy.\n attachedTxInfo.isLegacy || isEC4CompatibleStyle(styleOpt, elType, !!txCfg, !!txConOpt))) {\n attachedTxInfo.isLegacy = true;\n var convertResult = convertFromEC4CompatibleStyle(styleOpt, elType, !state); // Explicitly specified `textConfig` and `textContent` has higher priority than\n // the ones generated by legacy style. Otherwise if users use them and `api.style`\n // at the same time, they not both work and hardly to known why.\n\n if (!txCfg && convertResult.textConfig) {\n txCfg = convertResult.textConfig;\n }\n\n if (!txConOpt && convertResult.textContent) {\n txConOpt = convertResult.textContent;\n }\n }\n\n if (!state && txConOpt) {\n var txConOptNormal_1 = txConOpt; // `textContent: {type: 'text'}`, the \"type\" is easy to be missing. So we tolerate it.\n\n !txConOptNormal_1.type && (txConOptNormal_1.type = 'text');\n\n if (process.env.NODE_ENV !== 'production') {\n // Do not tolerate incorrcet type for forward compat.\n assert(txConOptNormal_1.type === 'text', 'textContent.type must be \"text\"');\n }\n }\n\n var info = !state ? attachedTxInfo.normal : attachedTxInfo[state];\n info.cfg = txCfg;\n info.conOpt = txConOpt;\n}\n\nfunction retrieveStateOption(elOption, state) {\n return !state ? elOption : elOption ? elOption[state] : null;\n}\n\nfunction retrieveStyleOptionOnState(stateOptionNormal, stateOption, state) {\n var style = stateOption && stateOption.style;\n\n if (style == null && state === EMPHASIS && stateOptionNormal) {\n style = stateOptionNormal.styleEmphasis;\n }\n\n return style;\n} // Usage:\n// (1) By default, `elOption.$mergeChildren` is `'byIndex'`, which indicates\n// that the existing children will not be removed, and enables the feature\n// that update some of the props of some of the children simply by construct\n// the returned children of `renderItem` like:\n// `var children = group.children = []; children[3] = {opacity: 0.5};`\n// (2) If `elOption.$mergeChildren` is `'byName'`, add/update/remove children\n// by child.name. But that might be lower performance.\n// (3) If `elOption.$mergeChildren` is `false`, the existing children will be\n// replaced totally.\n// (4) If `!elOption.children`, following the \"merge\" principle, nothing will\n// happen.\n// (5) If `elOption.$mergeChildren` is not `false` neither `'byName'` and the\n// `el` is a group, and if any of the new child is null, it means to remove\n// the element at the same index, if exists. On the other hand, if the new\n// child is and empty object `{}`, it means to keep the element not changed.\n//\n// For implementation simpleness, do not provide a direct way to remove single\n// child (otherwise the total indices of the children array have to be modified).\n// User can remove a single child by setting its `ignore` to `true`.\n\n\nfunction mergeChildren(api, el, dataIndex, elOption, seriesModel) {\n var newChildren = elOption.children;\n var newLen = newChildren ? newChildren.length : 0;\n var mergeChildren = elOption.$mergeChildren; // `diffChildrenByName` has been deprecated.\n\n var byName = mergeChildren === 'byName' || elOption.diffChildrenByName;\n var notMerge = mergeChildren === false; // For better performance on roam update, only enter if necessary.\n\n if (!newLen && !byName && !notMerge) {\n return;\n }\n\n if (byName) {\n diffGroupChildren({\n api: api,\n oldChildren: el.children() || [],\n newChildren: newChildren || [],\n dataIndex: dataIndex,\n seriesModel: seriesModel,\n group: el\n });\n return;\n }\n\n notMerge && el.removeAll(); // Mapping children of a group simply by index, which\n // might be better performance.\n\n var index = 0;\n\n for (; index < newLen; index++) {\n var newChild = newChildren[index];\n var oldChild = el.childAt(index);\n\n if (newChild) {\n if (newChild.ignore == null) {\n // The old child is set to be ignored if null (see comments\n // below). So we need to set ignore to be false back.\n newChild.ignore = false;\n }\n\n doCreateOrUpdateEl(api, oldChild, dataIndex, newChild, seriesModel, el);\n } else {\n if (process.env.NODE_ENV !== 'production') {\n assert(oldChild, 'renderItem should not return a group containing elements' + ' as null/undefined/{} if they do not exist before.');\n } // If the new element option is null, it means to remove the old\n // element. But we cannot really remove the element from the group\n // directly, because the element order may not be stable when this\n // element is added back. So we set the element to be ignored.\n\n\n oldChild.ignore = true;\n }\n }\n\n for (var i = el.childCount() - 1; i >= index; i--) {\n var child = el.childAt(i);\n removeChildFromGroup(el, child, seriesModel);\n }\n}\n\nfunction removeChildFromGroup(group, child, seriesModel) {\n // Do not support leave elements that are not mentioned in the latest\n // `renderItem` return. Otherwise users may not have a clear and simple\n // concept that how to control all of the elements.\n child && applyLeaveTransition(child, customInnerStore(group).option, seriesModel);\n}\n\nfunction diffGroupChildren(context) {\n new DataDiffer(context.oldChildren, context.newChildren, getKey, getKey, context).add(processAddUpdate).update(processAddUpdate).remove(processRemove).execute();\n}\n\nfunction getKey(item, idx) {\n var name = item && item.name;\n return name != null ? name : GROUP_DIFF_PREFIX + idx;\n}\n\nfunction processAddUpdate(newIndex, oldIndex) {\n var context = this.context;\n var childOption = newIndex != null ? context.newChildren[newIndex] : null;\n var child = oldIndex != null ? context.oldChildren[oldIndex] : null;\n doCreateOrUpdateEl(context.api, child, context.dataIndex, childOption, context.seriesModel, context.group);\n}\n\nfunction processRemove(oldIndex) {\n var context = this.context;\n var child = context.oldChildren[oldIndex];\n child && applyLeaveTransition(child, customInnerStore(child).option, context.seriesModel);\n}\n/**\n * @return SVG Path data.\n */\n\n\nfunction getPathData(shape) {\n // \"d\" follows the SVG convention.\n return shape && (shape.pathData || shape.d);\n}\n\nfunction hasOwnPathData(shape) {\n return shape && (hasOwn(shape, 'pathData') || hasOwn(shape, 'd'));\n}","map":{"version":3,"sources":["D:/Work/WorkSpace/GitWorkSpace/TenShop/resource/ElectronicMall/src啊/ElectronicMallVue/node_modules/echarts/lib/chart/custom/CustomView.js"],"names":["__extends","hasOwn","assert","isString","retrieve2","retrieve3","defaults","each","indexOf","graphicUtil","setDefaultStateProxy","toggleHoverEmphasis","labelStyleHelper","getDefaultLabel","getLayoutOnAxis","DataDiffer","ChartView","createClipPath","prepareCartesian2d","prepareGeo","prepareSingleAxis","preparePolar","prepareCalendar","Displayable","convertToEC4StyleForCustomSerise","isEC4CompatibleStyle","convertFromEC4CompatibleStyle","warnDeprecated","throwError","createOrUpdatePatternFromDecal","STYLE_VISUAL_TYPE","NON_STYLE_VISUAL_PROPS","customInnerStore","applyLeaveTransition","applyUpdateTransition","applyKeyframeAnimation","stopPreviousKeyframeAnimationAndRestore","EMPHASIS","NORMAL","BLUR","SELECT","STATES","PATH_ITEM_STYLE","normal","emphasis","blur","select","PATH_LABEL","DEFAULT_TRANSITION","GROUP_DIFF_PREFIX","attachedTxInfoTmp","prepareCustoms","cartesian2d","geo","single","polar","calendar","isPath","el","Path","isDisplayable","copyElement","sourceEl","targetEl","copyTransform","setStyle","style","z","z2","zlevel","invisible","ignore","setShape","shape","CustomChartView","_super","_this","apply","arguments","type","prototype","render","customSeries","ecModel","api","payload","_progressiveEls","oldData","_data","data","getData","group","renderItem","makeRenderItem","removeAll","diff","add","newIdx","createOrUpdateItem","remove","oldIdx","getItemGraphicEl","option","update","oldEl","execute","clipPath","get","coordinateSystem","setClipPath","removeClipPath","incrementalPrepareRender","incrementalRender","params","progressiveEls","setIncrementalAndHoverLayer","isGroup","incremental","ensureState","hoverLayer","idx","start","end","traverse","push","eachRendered","cb","traverseElements","filterForExposedEvent","eventType","query","packedEvent","elementName","element","name","__hostTarget","parent","createEl","elOption","graphicType","pathRect","width","height","x","y","pathData","getPathData","makePath","layout","customPathData","Image","customImagePath","image","Text","Group","Error","Clz","getShapeClass","errMsg","process","env","NODE_ENV","customGraphicType","z2EmphasisLift","z2SelectLift","updateElNormal","dataIndex","attachedTxInfo","seriesModel","isInit","txCfgOpt","cfg","setTextConfig","transition","styleOpt","textOptionStyle","fill","textFill","stroke","textStroke","decalPattern","decalObj","decal","dirty","__decalPattern","clearStyle","keyframeAnimation","updateElOnState","state","elStateOpt","elDisplayable","stateObj","existingEmphasisState","getState","textConfig","updateZ","currentZ","currentZLevel","optZ2","i","length","updateZForEachState","isNormal","retrieveStateOption","coordSys","prepareResult","userAPI","getWidth","getHeight","getZr","getDevicePixelRatio","value","ordinalRawValue","styleEmphasis","visual","barLayout","currentSeriesIndices","font","userParams","context","seriesId","id","seriesName","seriesIndex","dataInsideLength","count","encode","wrapEncodeDef","currDataIndexInside","currItemModel","currItemStyleModels","currLabelModels","seriesItemStyleModels","seriesLabelModels","stateName","getModel","getItemModel","dataIndexInside","getItemStyleModel","hasItemOption","getLabelModel","getRawIndex","actionType","dim","getStore","getDimensionIndex","dimInfo","getDimensionInfo","dimIndex","undefined","val","ordinalMeta","categories","userProps","getItemVisual","visualColor","opacity","itemStyle","getItemStyle","opt","inheritColor","labelModel","textStyle","createTextStyle","text","getShallow","getFormattedLabel","createTextConfig","preFetchFromExtra","applyUserPropsAfter","legacy","extra","key","textPosition","visualType","style_1","baseAxis","getBaseAxis","axis","getCurrentSeriesIndices","getFont","encodeDef","dimensions","dimName","isExtraCoord","coordDim","dataDims","coordDimIndex","existsEl","doCreateOrUpdateEl","setItemGraphicEl","focus","blurScope","emphasisDisabled","toBeReplacedIdx","doesElNeedRecreate","childrenRef","clearStates","morph","disableMorphing","conOpt","isLegacy","doCreateOrUpdateAttachedTx","doCreateOrUpdateClipPath","info","otherStateOpt","otherStyleOpt","retrieveStyleOptionOnState","mergeChildren","replaceAt","elInner","elOptionType","elOptionShape","elOptionStyle","isUniversalTransitionEnabled","hasOwnPathData","clipPathOpt","getClipPath","processTxInfo","txConOptNormal","txConOptEmphasis","txConOptBlur","txConOptSelect","textContent","getTextContent","removeTextContent","setTextContent","txConStlOptNormal","txConOptOtherState","markRedraw","stateOpt","elType","txCfg","txConOpt","convertResult","txConOptNormal_1","stateOptionNormal","stateOption","newChildren","children","newLen","$mergeChildren","byName","diffChildrenByName","notMerge","diffGroupChildren","oldChildren","index","newChild","oldChild","childAt","childCount","child","removeChildFromGroup","getKey","processAddUpdate","processRemove","item","newIndex","oldIndex","childOption","d"],"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,SAASC,MAAT,EAAiBC,MAAjB,EAAyBC,QAAzB,EAAmCC,SAAnC,EAA8CC,SAA9C,EAAyDC,QAAzD,EAAmEC,IAAnE,EAAyEC,OAAzE,QAAwF,0BAAxF;AACA,OAAO,KAAKC,WAAZ,MAA6B,uBAA7B;AACA,SAASC,oBAAT,EAA+BC,mBAA/B,QAA0D,sBAA1D;AACA,OAAO,KAAKC,gBAAZ,MAAkC,2BAAlC;AACA,SAASC,eAAT,QAAgC,0BAAhC;AACA,SAASC,eAAT,QAAgC,yBAAhC;AACA,OAAOC,UAAP,MAAuB,0BAAvB;AACA,OAAOC,SAAP,MAAsB,qBAAtB;AACA,SAASC,cAAT,QAA+B,yCAA/B;AACA,OAAOC,kBAAP,MAA+B,wCAA/B;AACA,OAAOC,UAAP,MAAuB,kCAAvB;AACA,OAAOC,iBAAP,MAA8B,qCAA9B;AACA,OAAOC,YAAP,MAAyB,oCAAzB;AACA,OAAOC,eAAP,MAA4B,uCAA5B;AACA,OAAOC,WAAP,MAAwB,oCAAxB;AACA,SAASC,gCAAT,EAA2CC,oBAA3C,EAAiEC,6BAAjE,EAAgGC,cAAhG,QAAsH,2BAAtH;AACA,SAASC,UAAT,QAA2B,mBAA3B;AACA,SAASC,8BAAT,QAA+C,qBAA/C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GAAT,EAAc4Q,KAAd,EAAqBrI,OAAO,CAACrD,SAA7B,EAAwCkM,WAAxC,EAAqD7I,OAAO,CAACnD,WAA7D,EAA0EmD,OAAO,CAAChI,KAAlF,CAAlB;AACD;;AAED,SAASyQ,aAAT,CAAuBG,QAAvB,EAAiC;AAC/B,MAAI5I,OAAO,GAAG,KAAKA,OAAnB;AACA,MAAIqI,KAAK,GAAGrI,OAAO,CAAC+H,WAAR,CAAoBa,QAApB,CAAZ;AACAP,EAAAA,KAAK,IAAI/T,oBAAoB,CAAC+T,KAAD,EAAQhU,gBAAgB,CAACgU,KAAD,CAAhB,CAAwB1P,MAAhC,EAAwCqH,OAAO,CAACnD,WAAhD,CAA7B;AACD;AACD;AACA;AACA;;;AAGA,SAAStB,WAAT,CAAqBzE,KAArB,EAA4B;AAC1B;AACA,SAAOA,KAAK,KAAKA,KAAK,CAACwE,QAAN,IAAkBxE,KAAK,CAACgS,CAA7B,CAAZ;AACD;;AAED,SAAS9C,cAAT,CAAwBlP,KAAxB,EAA+B;AAC7B,SAAOA,KAAK,KAAKxE,MAAM,CAACwE,KAAD,EAAQ,UAAR,CAAN,IAA6BxE,MAAM,CAACwE,KAAD,EAAQ,GAAR,CAAxC,CAAZ;AACD","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 { hasOwn, assert, isString, retrieve2, retrieve3, defaults, each, indexOf } from 'zrender/lib/core/util.js';\nimport * as graphicUtil from '../../util/graphic.js';\nimport { setDefaultStateProxy, toggleHoverEmphasis } from '../../util/states.js';\nimport * as labelStyleHelper from '../../label/labelStyle.js';\nimport { getDefaultLabel } from '../helper/labelHelper.js';\nimport { getLayoutOnAxis } from '../../layout/barGrid.js';\nimport DataDiffer from '../../data/DataDiffer.js';\nimport ChartView from '../../view/Chart.js';\nimport { createClipPath } from '../helper/createClipPathFromCoordSys.js';\nimport prepareCartesian2d from '../../coord/cartesian/prepareCustom.js';\nimport prepareGeo from '../../coord/geo/prepareCustom.js';\nimport prepareSingleAxis from '../../coord/single/prepareCustom.js';\nimport preparePolar from '../../coord/polar/prepareCustom.js';\nimport prepareCalendar from '../../coord/calendar/prepareCustom.js';\nimport Displayable from 'zrender/lib/graphic/Displayable.js';\nimport { convertToEC4StyleForCustomSerise, isEC4CompatibleStyle, convertFromEC4CompatibleStyle, warnDeprecated } from '../../util/styleCompat.js';\nimport { throwError } from '../../util/log.js';\nimport { createOrUpdatePatternFromDecal } from '../../util/decal.js';\nimport { STYLE_VISUAL_TYPE, NON_STYLE_VISUAL_PROPS, customInnerStore } from './CustomSeries.js';\nimport { applyLeaveTransition, applyUpdateTransition } from '../../animation/customGraphicTransition.js';\nimport { applyKeyframeAnimation, stopPreviousKeyframeAnimationAndRestore } from '../../animation/customGraphicKeyframeAnimation.js';\nvar EMPHASIS = 'emphasis';\nvar NORMAL = 'normal';\nvar BLUR = 'blur';\nvar SELECT = 'select';\nvar STATES = [NORMAL, EMPHASIS, BLUR, SELECT];\nvar PATH_ITEM_STYLE = {\n normal: ['itemStyle'],\n emphasis: [EMPHASIS, 'itemStyle'],\n blur: [BLUR, 'itemStyle'],\n select: [SELECT, 'itemStyle']\n};\nvar PATH_LABEL = {\n normal: ['label'],\n emphasis: [EMPHASIS, 'label'],\n blur: [BLUR, 'label'],\n select: [SELECT, 'label']\n};\nvar DEFAULT_TRANSITION = ['x', 'y']; // Use prefix to avoid index to be the same as el.name,\n// which will cause weird update animation.\n\nvar GROUP_DIFF_PREFIX = 'e\\0\\0';\nvar attachedTxInfoTmp = {\n normal: {},\n emphasis: {},\n blur: {},\n select: {}\n};\n/**\n * To reduce total package size of each coordinate systems, the modules `prepareCustom`\n * of each coordinate systems are not required by each coordinate systems directly, but\n * required by the module `custom`.\n *\n * prepareInfoForCustomSeries {Function}: optional\n * @return {Object} {coordSys: {...}, api: {\n * coord: function (data, clamp) {}, // return point in global.\n * size: function (dataSize, dataItem) {} // return size of each axis in coordSys.\n * }}\n */\n\nvar prepareCustoms = {\n cartesian2d: prepareCartesian2d,\n geo: prepareGeo,\n single: prepareSingleAxis,\n polar: preparePolar,\n calendar: prepareCalendar\n};\n\nfunction isPath(el) {\n return el instanceof graphicUtil.Path;\n}\n\nfunction isDisplayable(el) {\n return el instanceof Displayable;\n}\n\nfunction copyElement(sourceEl, targetEl) {\n targetEl.copyTransform(sourceEl);\n\n if (isDisplayable(targetEl) && isDisplayable(sourceEl)) {\n targetEl.setStyle(sourceEl.style);\n targetEl.z = sourceEl.z;\n targetEl.z2 = sourceEl.z2;\n targetEl.zlevel = sourceEl.zlevel;\n targetEl.invisible = sourceEl.invisible;\n targetEl.ignore = sourceEl.ignore;\n\n if (isPath(targetEl) && isPath(sourceEl)) {\n targetEl.setShape(sourceEl.shape);\n }\n }\n}\n\nvar CustomChartView =\n/** @class */\nfunction (_super) {\n __extends(CustomChartView, _super);\n\n function CustomChartView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = CustomChartView.type;\n return _this;\n }\n\n CustomChartView.prototype.render = function (customSeries, ecModel, api, payload) {\n // Clear previously rendered progressive elements.\n this._progressiveEls = null;\n var oldData = this._data;\n var data = customSeries.getData();\n var group = this.group;\n var renderItem = makeRenderItem(customSeries, data, ecModel, api);\n\n if (!oldData) {\n // Previous render is incremental render or first render.\n // Needs remove the incremental rendered elements.\n group.removeAll();\n }\n\n data.diff(oldData).add(function (newIdx) {\n createOrUpdateItem(api, null, newIdx, renderItem(newIdx, payload), customSeries, group, data);\n }).remove(function (oldIdx) {\n var el = oldData.getItemGraphicEl(oldIdx);\n el && applyLeaveTransition(el, customInnerStore(el).option, customSeries);\n }).update(function (newIdx, oldIdx) {\n var oldEl = oldData.getItemGraphicEl(oldIdx);\n createOrUpdateItem(api, oldEl, newIdx, renderItem(newIdx, payload), customSeries, group, data);\n }).execute(); // Do clipping\n\n var clipPath = customSeries.get('clip', true) ? createClipPath(customSeries.coordinateSystem, false, customSeries) : null;\n\n if (clipPath) {\n group.setClipPath(clipPath);\n } else {\n group.removeClipPath();\n }\n\n this._data = data;\n };\n\n CustomChartView.prototype.incrementalPrepareRender = function (customSeries, ecModel, api) {\n this.group.removeAll();\n this._data = null;\n };\n\n CustomChartView.prototype.incrementalRender = function (params, customSeries, ecModel, api, payload) {\n var data = customSeries.getData();\n var renderItem = makeRenderItem(customSeries, data, ecModel, api);\n var progressiveEls = this._progressiveEls = [];\n\n function setIncrementalAndHoverLayer(el) {\n if (!el.isGroup) {\n el.incremental = true;\n el.ensureState('emphasis').hoverLayer = true;\n }\n }\n\n for (var idx = params.start; idx < params.end; idx++) {\n var el = createOrUpdateItem(null, null, idx, renderItem(idx, payload), customSeries, this.group, data);\n\n if (el) {\n el.traverse(setIncrementalAndHoverLayer);\n progressiveEls.push(el);\n }\n }\n };\n\n CustomChartView.prototype.eachRendered = function (cb) {\n graphicUtil.traverseElements(this._progressiveEls || this.group, cb);\n };\n\n CustomChartView.prototype.filterForExposedEvent = function (eventType, query, targetEl, packedEvent) {\n var elementName = query.element;\n\n if (elementName == null || targetEl.name === elementName) {\n return true;\n } // Enable to give a name on a group made by `renderItem`, and listen\n // events that are triggered by its descendents.\n\n\n while ((targetEl = targetEl.__hostTarget || targetEl.parent) && targetEl !== this.group) {\n if (targetEl.name === elementName) {\n return true;\n }\n }\n\n return false;\n };\n\n CustomChartView.type = 'custom';\n return CustomChartView;\n}(ChartView);\n\nexport default CustomChartView;\n\nfunction createEl(elOption) {\n var graphicType = elOption.type;\n var el; // Those graphic elements are not shapes. They should not be\n // overwritten by users, so do them first.\n\n if (graphicType === 'path') {\n var shape = elOption.shape; // Using pathRect brings convenience to users sacle svg path.\n\n var pathRect = shape.width != null && shape.height != null ? {\n x: shape.x || 0,\n y: shape.y || 0,\n width: shape.width,\n height: shape.height\n } : null;\n var pathData = getPathData(shape); // Path is also used for icon, so layout 'center' by default.\n\n el = graphicUtil.makePath(pathData, null, pathRect, shape.layout || 'center');\n customInnerStore(el).customPathData = pathData;\n } else if (graphicType === 'image') {\n el = new graphicUtil.Image({});\n customInnerStore(el).customImagePath = elOption.style.image;\n } else if (graphicType === 'text') {\n el = new graphicUtil.Text({}); // customInnerStore(el).customText = (elOption.style as TextStyleProps).text;\n } else if (graphicType === 'group') {\n el = new graphicUtil.Group();\n } else if (graphicType === 'compoundPath') {\n throw new Error('\"compoundPath\" is not supported yet.');\n } else {\n var Clz = graphicUtil.getShapeClass(graphicType);\n\n if (!Clz) {\n var errMsg = '';\n\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'graphic type \"' + graphicType + '\" can not be found.';\n }\n\n throwError(errMsg);\n }\n\n el = new Clz();\n }\n\n customInnerStore(el).customGraphicType = graphicType;\n el.name = elOption.name; // Compat ec4: the default z2 lift is 1. If changing the number,\n // some cases probably be broken: hierarchy layout along z, like circle packing,\n // where emphasis only intending to modify color/border rather than lift z2.\n\n el.z2EmphasisLift = 1;\n el.z2SelectLift = 1;\n return el;\n}\n\nfunction updateElNormal( // Can be null/undefined\napi, el, dataIndex, elOption, attachedTxInfo, seriesModel, isInit) {\n // Stop and restore before update any other attributes.\n stopPreviousKeyframeAnimationAndRestore(el);\n var txCfgOpt = attachedTxInfo && attachedTxInfo.normal.cfg;\n\n if (txCfgOpt) {\n // PENDING: whether use user object directly rather than clone?\n // TODO:5.0 textConfig transition animation?\n el.setTextConfig(txCfgOpt);\n } // Default transition ['x', 'y']\n\n\n if (elOption && elOption.transition == null) {\n elOption.transition = DEFAULT_TRANSITION;\n } // Do some normalization on style.\n\n\n var styleOpt = elOption && elOption.style;\n\n if (styleOpt) {\n if (el.type === 'text') {\n var textOptionStyle = styleOpt; // Compatible with ec4: if `textFill` or `textStroke` exists use them.\n\n hasOwn(textOptionStyle, 'textFill') && (textOptionStyle.fill = textOptionStyle.textFill);\n hasOwn(textOptionStyle, 'textStroke') && (textOptionStyle.stroke = textOptionStyle.textStroke);\n }\n\n var decalPattern = void 0;\n var decalObj = isPath(el) ? styleOpt.decal : null;\n\n if (api && decalObj) {\n decalObj.dirty = true;\n decalPattern = createOrUpdatePatternFromDecal(decalObj, api);\n } // Always overwrite in case user specify this prop.\n\n\n styleOpt.__decalPattern = decalPattern;\n }\n\n if (isDisplayable(el)) {\n if (styleOpt) {\n var decalPattern = styleOpt.__decalPattern;\n\n if (decalPattern) {\n styleOpt.decal = decalPattern;\n }\n }\n }\n\n applyUpdateTransition(el, elOption, seriesModel, {\n dataIndex: dataIndex,\n isInit: isInit,\n clearStyle: true\n });\n applyKeyframeAnimation(el, elOption.keyframeAnimation, seriesModel);\n}\n\nfunction updateElOnState(state, el, elStateOpt, styleOpt, attachedTxInfo) {\n var elDisplayable = el.isGroup ? null : el;\n var txCfgOpt = attachedTxInfo && attachedTxInfo[state].cfg; // PENDING:5.0 support customize scale change and transition animation?\n\n if (elDisplayable) {\n // By default support auto lift color when hover whether `emphasis` specified.\n var stateObj = elDisplayable.ensureState(state);\n\n if (styleOpt === false) {\n var existingEmphasisState = elDisplayable.getState(state);\n\n if (existingEmphasisState) {\n existingEmphasisState.style = null;\n }\n } else {\n // style is needed to enable default emphasis.\n stateObj.style = styleOpt || null;\n } // If `elOption.styleEmphasis` or `elOption.emphasis.style` is `false`,\n // remove hover style.\n // If `elOption.textConfig` or `elOption.emphasis.textConfig` is null/undefined, it does not\n // make sense. So for simplicity, we do not ditinguish `hasOwnProperty` and null/undefined.\n\n\n if (txCfgOpt) {\n stateObj.textConfig = txCfgOpt;\n }\n\n setDefaultStateProxy(elDisplayable);\n }\n}\n\nfunction updateZ(el, elOption, seriesModel) {\n // Group not support textContent and not support z yet.\n if (el.isGroup) {\n return;\n }\n\n var elDisplayable = el;\n var currentZ = seriesModel.currentZ;\n var currentZLevel = seriesModel.currentZLevel; // Always erase.\n\n elDisplayable.z = currentZ;\n elDisplayable.zlevel = currentZLevel; // z2 must not be null/undefined, otherwise sort error may occur.\n\n var optZ2 = elOption.z2;\n optZ2 != null && (elDisplayable.z2 = optZ2 || 0);\n\n for (var i = 0; i < STATES.length; i++) {\n updateZForEachState(elDisplayable, elOption, STATES[i]);\n }\n}\n\nfunction updateZForEachState(elDisplayable, elOption, state) {\n var isNormal = state === NORMAL;\n var elStateOpt = isNormal ? elOption : retrieveStateOption(elOption, state);\n var optZ2 = elStateOpt ? elStateOpt.z2 : null;\n var stateObj;\n\n if (optZ2 != null) {\n // Do not `ensureState` until required.\n stateObj = isNormal ? elDisplayable : elDisplayable.ensureState(state);\n stateObj.z2 = optZ2 || 0;\n }\n}\n\nfunction makeRenderItem(customSeries, data, ecModel, api) {\n var renderItem = customSeries.get('renderItem');\n var coordSys = customSeries.coordinateSystem;\n var prepareResult = {};\n\n if (coordSys) {\n if (process.env.NODE_ENV !== 'production') {\n assert(renderItem, 'series.render is required.');\n assert(coordSys.prepareCustoms || prepareCustoms[coordSys.type], 'This coordSys does not support custom series.');\n } // `coordSys.prepareCustoms` is used for external coord sys like bmap.\n\n\n prepareResult = coordSys.prepareCustoms ? coordSys.prepareCustoms(coordSys) : prepareCustoms[coordSys.type](coordSys);\n }\n\n var userAPI = defaults({\n getWidth: api.getWidth,\n getHeight: api.getHeight,\n getZr: api.getZr,\n getDevicePixelRatio: api.getDevicePixelRatio,\n value: value,\n style: style,\n ordinalRawValue: ordinalRawValue,\n styleEmphasis: styleEmphasis,\n visual: visual,\n barLayout: barLayout,\n currentSeriesIndices: currentSeriesIndices,\n font: font\n }, prepareResult.api || {});\n var userParams = {\n // The life cycle of context: current round of rendering.\n // The global life cycle is probably not necessary, because\n // user can store global status by themselves.\n context: {},\n seriesId: customSeries.id,\n seriesName: customSeries.name,\n seriesIndex: customSeries.seriesIndex,\n coordSys: prepareResult.coordSys,\n dataInsideLength: data.count(),\n encode: wrapEncodeDef(customSeries.getData())\n }; // If someday intending to refactor them to a class, should consider do not\n // break change: currently these attribute member are encapsulated in a closure\n // so that do not need to force user to call these method with a scope.\n // Do not support call `api` asynchronously without dataIndexInside input.\n\n var currDataIndexInside;\n var currItemModel;\n var currItemStyleModels = {};\n var currLabelModels = {};\n var seriesItemStyleModels = {};\n var seriesLabelModels = {};\n\n for (var i = 0; i < STATES.length; i++) {\n var stateName = STATES[i];\n seriesItemStyleModels[stateName] = customSeries.getModel(PATH_ITEM_STYLE[stateName]);\n seriesLabelModels[stateName] = customSeries.getModel(PATH_LABEL[stateName]);\n }\n\n function getItemModel(dataIndexInside) {\n return dataIndexInside === currDataIndexInside ? currItemModel || (currItemModel = data.getItemModel(dataIndexInside)) : data.getItemModel(dataIndexInside);\n }\n\n function getItemStyleModel(dataIndexInside, state) {\n return !data.hasItemOption ? seriesItemStyleModels[state] : dataIndexInside === currDataIndexInside ? currItemStyleModels[state] || (currItemStyleModels[state] = getItemModel(dataIndexInside).getModel(PATH_ITEM_STYLE[state])) : getItemModel(dataIndexInside).getModel(PATH_ITEM_STYLE[state]);\n }\n\n function getLabelModel(dataIndexInside, state) {\n return !data.hasItemOption ? seriesLabelModels[state] : dataIndexInside === currDataIndexInside ? currLabelModels[state] || (currLabelModels[state] = getItemModel(dataIndexInside).getModel(PATH_LABEL[state])) : getItemModel(dataIndexInside).getModel(PATH_LABEL[state]);\n }\n\n return function (dataIndexInside, payload) {\n currDataIndexInside = dataIndexInside;\n currItemModel = null;\n currItemStyleModels = {};\n currLabelModels = {};\n return renderItem && renderItem(defaults({\n dataIndexInside: dataIndexInside,\n dataIndex: data.getRawIndex(dataIndexInside),\n // Can be used for optimization when zoom or roam.\n actionType: payload ? payload.type : null\n }, userParams), userAPI);\n };\n /**\n * @public\n * @param dim by default 0.\n * @param dataIndexInside by default `currDataIndexInside`.\n */\n\n function value(dim, dataIndexInside) {\n dataIndexInside == null && (dataIndexInside = currDataIndexInside);\n return data.getStore().get(data.getDimensionIndex(dim || 0), dataIndexInside);\n }\n /**\n * @public\n * @param dim by default 0.\n * @param dataIndexInside by default `currDataIndexInside`.\n */\n\n\n function ordinalRawValue(dim, dataIndexInside) {\n dataIndexInside == null && (dataIndexInside = currDataIndexInside);\n dim = dim || 0;\n var dimInfo = data.getDimensionInfo(dim);\n\n if (!dimInfo) {\n var dimIndex = data.getDimensionIndex(dim);\n return dimIndex >= 0 ? data.getStore().get(dimIndex, dataIndexInside) : undefined;\n }\n\n var val = data.get(dimInfo.name, dataIndexInside);\n var ordinalMeta = dimInfo && dimInfo.ordinalMeta;\n return ordinalMeta ? ordinalMeta.categories[val] : val;\n }\n /**\n * @deprecated The original intention of `api.style` is enable to set itemStyle\n * like other series. But it is not necessary and not easy to give a strict definition\n * of what it returns. And since echarts5 it needs to be make compat work. So\n * deprecates it since echarts5.\n *\n * By default, `visual` is applied to style (to support visualMap).\n * `visual.color` is applied at `fill`. If user want apply visual.color on `stroke`,\n * it can be implemented as:\n * `api.style({stroke: api.visual('color'), fill: null})`;\n *\n * [Compat]: since ec5, RectText has been separated from its hosts el.\n * so `api.style()` will only return the style from `itemStyle` but not handle `label`\n * any more. But `series.label` config is never published in doc.\n * We still compat it in `api.style()`. But not encourage to use it and will still not\n * to pulish it to doc.\n * @public\n * @param dataIndexInside by default `currDataIndexInside`.\n */\n\n\n function style(userProps, dataIndexInside) {\n if (process.env.NODE_ENV !== 'production') {\n warnDeprecated('api.style', 'Please write literal style directly instead.');\n }\n\n dataIndexInside == null && (dataIndexInside = currDataIndexInside);\n var style = data.getItemVisual(dataIndexInside, 'style');\n var visualColor = style && style.fill;\n var opacity = style && style.opacity;\n var itemStyle = getItemStyleModel(dataIndexInside, NORMAL).getItemStyle();\n visualColor != null && (itemStyle.fill = visualColor);\n opacity != null && (itemStyle.opacity = opacity);\n var opt = {\n inheritColor: isString(visualColor) ? visualColor : '#000'\n };\n var labelModel = getLabelModel(dataIndexInside, NORMAL); // Now that the feature of \"auto adjust text fill/stroke\" has been migrated to zrender\n // since ec5, we should set `isAttached` as `false` here and make compat in\n // `convertToEC4StyleForCustomSerise`.\n\n var textStyle = labelStyleHelper.createTextStyle(labelModel, null, opt, false, true);\n textStyle.text = labelModel.getShallow('show') ? retrieve2(customSeries.getFormattedLabel(dataIndexInside, NORMAL), getDefaultLabel(data, dataIndexInside)) : null;\n var textConfig = labelStyleHelper.createTextConfig(labelModel, opt, false);\n preFetchFromExtra(userProps, itemStyle);\n itemStyle = convertToEC4StyleForCustomSerise(itemStyle, textStyle, textConfig);\n userProps && applyUserPropsAfter(itemStyle, userProps);\n itemStyle.legacy = true;\n return itemStyle;\n }\n /**\n * @deprecated The reason see `api.style()`\n * @public\n * @param dataIndexInside by default `currDataIndexInside`.\n */\n\n\n function styleEmphasis(userProps, dataIndexInside) {\n if (process.env.NODE_ENV !== 'production') {\n warnDeprecated('api.styleEmphasis', 'Please write literal style directly instead.');\n }\n\n dataIndexInside == null && (dataIndexInside = currDataIndexInside);\n var itemStyle = getItemStyleModel(dataIndexInside, EMPHASIS).getItemStyle();\n var labelModel = getLabelModel(dataIndexInside, EMPHASIS);\n var textStyle = labelStyleHelper.createTextStyle(labelModel, null, null, true, true);\n textStyle.text = labelModel.getShallow('show') ? retrieve3(customSeries.getFormattedLabel(dataIndexInside, EMPHASIS), customSeries.getFormattedLabel(dataIndexInside, NORMAL), getDefaultLabel(data, dataIndexInside)) : null;\n var textConfig = labelStyleHelper.createTextConfig(labelModel, null, true);\n preFetchFromExtra(userProps, itemStyle);\n itemStyle = convertToEC4StyleForCustomSerise(itemStyle, textStyle, textConfig);\n userProps && applyUserPropsAfter(itemStyle, userProps);\n itemStyle.legacy = true;\n return itemStyle;\n }\n\n function applyUserPropsAfter(itemStyle, extra) {\n for (var key in extra) {\n if (hasOwn(extra, key)) {\n itemStyle[key] = extra[key];\n }\n }\n }\n\n function preFetchFromExtra(extra, itemStyle) {\n // A trick to retrieve those props firstly, which are used to\n // apply auto inside fill/stroke in `convertToEC4StyleForCustomSerise`.\n // (It's not reasonable but only for a degree of compat)\n if (extra) {\n extra.textFill && (itemStyle.textFill = extra.textFill);\n extra.textPosition && (itemStyle.textPosition = extra.textPosition);\n }\n }\n /**\n * @public\n * @param dataIndexInside by default `currDataIndexInside`.\n */\n\n\n function visual(visualType, dataIndexInside) {\n dataIndexInside == null && (dataIndexInside = currDataIndexInside);\n\n if (hasOwn(STYLE_VISUAL_TYPE, visualType)) {\n var style_1 = data.getItemVisual(dataIndexInside, 'style');\n return style_1 ? style_1[STYLE_VISUAL_TYPE[visualType]] : null;\n } // Only support these visuals. Other visual might be inner tricky\n // for performance (like `style`), do not expose to users.\n\n\n if (hasOwn(NON_STYLE_VISUAL_PROPS, visualType)) {\n return data.getItemVisual(dataIndexInside, visualType);\n }\n }\n /**\n * @public\n * @return If not support, return undefined.\n */\n\n\n function barLayout(opt) {\n if (coordSys.type === 'cartesian2d') {\n var baseAxis = coordSys.getBaseAxis();\n return getLayoutOnAxis(defaults({\n axis: baseAxis\n }, opt));\n }\n }\n /**\n * @public\n */\n\n\n function currentSeriesIndices() {\n return ecModel.getCurrentSeriesIndices();\n }\n /**\n * @public\n * @return font string\n */\n\n\n function font(opt) {\n return labelStyleHelper.getFont(opt, ecModel);\n }\n}\n\nfunction wrapEncodeDef(data) {\n var encodeDef = {};\n each(data.dimensions, function (dimName) {\n var dimInfo = data.getDimensionInfo(dimName);\n\n if (!dimInfo.isExtraCoord) {\n var coordDim = dimInfo.coordDim;\n var dataDims = encodeDef[coordDim] = encodeDef[coordDim] || [];\n dataDims[dimInfo.coordDimIndex] = data.getDimensionIndex(dimName);\n }\n });\n return encodeDef;\n}\n\nfunction createOrUpdateItem(api, existsEl, dataIndex, elOption, seriesModel, group, data) {\n // [Rule]\n // If `renderItem` returns `null`/`undefined`/`false`, remove the previous el if existing.\n // (It seems that violate the \"merge\" principle, but most of users probably intuitively\n // regard \"return;\" as \"show nothing element whatever\", so make a exception to meet the\n // most cases.)\n // The rule or \"merge\" see [STRATEGY_MERGE].\n // If `elOption` is `null`/`undefined`/`false` (when `renderItem` returns nothing).\n if (!elOption) {\n group.remove(existsEl);\n return;\n }\n\n var el = doCreateOrUpdateEl(api, existsEl, dataIndex, elOption, seriesModel, group);\n el && data.setItemGraphicEl(dataIndex, el);\n el && toggleHoverEmphasis(el, elOption.focus, elOption.blurScope, elOption.emphasisDisabled);\n return el;\n}\n\nfunction doCreateOrUpdateEl(api, existsEl, dataIndex, elOption, seriesModel, group) {\n if (process.env.NODE_ENV !== 'production') {\n assert(elOption, 'should not have an null/undefined element setting');\n }\n\n var toBeReplacedIdx = -1;\n var oldEl = existsEl;\n\n if (existsEl && doesElNeedRecreate(existsEl, elOption, seriesModel) // || (\n // // PENDING: even in one-to-one mapping case, if el is marked as morph,\n // // do not sure whether the el will be mapped to another el with different\n // // hierarchy in Group tree. So always recreate el rather than reuse the el.\n // morphHelper && morphHelper.isOneToOneFrom(el)\n // )\n ) {\n // Should keep at the original index, otherwise \"merge by index\" will be incorrect.\n toBeReplacedIdx = indexOf(group.childrenRef(), existsEl);\n existsEl = null;\n }\n\n var isInit = !existsEl;\n var el = existsEl;\n\n if (!el) {\n el = createEl(elOption);\n\n if (oldEl) {\n copyElement(oldEl, el);\n }\n } else {\n // FIMXE:NEXT unified clearState?\n // If in some case the performance issue arised, consider\n // do not clearState but update cached normal state directly.\n el.clearStates();\n } // Need to set morph: false explictly to disable automatically morphing.\n\n\n if (elOption.morph === false) {\n el.disableMorphing = true;\n } else if (el.disableMorphing) {\n el.disableMorphing = false;\n }\n\n attachedTxInfoTmp.normal.cfg = attachedTxInfoTmp.normal.conOpt = attachedTxInfoTmp.emphasis.cfg = attachedTxInfoTmp.emphasis.conOpt = attachedTxInfoTmp.blur.cfg = attachedTxInfoTmp.blur.conOpt = attachedTxInfoTmp.select.cfg = attachedTxInfoTmp.select.conOpt = null;\n attachedTxInfoTmp.isLegacy = false;\n doCreateOrUpdateAttachedTx(el, dataIndex, elOption, seriesModel, isInit, attachedTxInfoTmp);\n doCreateOrUpdateClipPath(el, dataIndex, elOption, seriesModel, isInit);\n updateElNormal(api, el, dataIndex, elOption, attachedTxInfoTmp, seriesModel, isInit); // `elOption.info` enables user to mount some info on\n // elements and use them in event handlers.\n // Update them only when user specified, otherwise, remain.\n\n hasOwn(elOption, 'info') && (customInnerStore(el).info = elOption.info);\n\n for (var i = 0; i < STATES.length; i++) {\n var stateName = STATES[i];\n\n if (stateName !== NORMAL) {\n var otherStateOpt = retrieveStateOption(elOption, stateName);\n var otherStyleOpt = retrieveStyleOptionOnState(elOption, otherStateOpt, stateName);\n updateElOnState(stateName, el, otherStateOpt, otherStyleOpt, attachedTxInfoTmp);\n }\n }\n\n updateZ(el, elOption, seriesModel);\n\n if (elOption.type === 'group') {\n mergeChildren(api, el, dataIndex, elOption, seriesModel);\n }\n\n if (toBeReplacedIdx >= 0) {\n group.replaceAt(el, toBeReplacedIdx);\n } else {\n group.add(el);\n }\n\n return el;\n} // `el` must not be null/undefined.\n\n\nfunction doesElNeedRecreate(el, elOption, seriesModel) {\n var elInner = customInnerStore(el);\n var elOptionType = elOption.type;\n var elOptionShape = elOption.shape;\n var elOptionStyle = elOption.style;\n return (// Always create new if universal transition is enabled.\n // Because we do transition after render. It needs to know what old element is. Replacement will loose it.\n seriesModel.isUniversalTransitionEnabled() // If `elOptionType` is `null`, follow the merge principle.\n || elOptionType != null && elOptionType !== elInner.customGraphicType || elOptionType === 'path' && hasOwnPathData(elOptionShape) && getPathData(elOptionShape) !== elInner.customPathData || elOptionType === 'image' && hasOwn(elOptionStyle, 'image') && elOptionStyle.image !== elInner.customImagePath // // FIXME test and remove this restriction?\n // || (elOptionType === 'text'\n // && hasOwn(elOptionStyle, 'text')\n // && (elOptionStyle as TextStyleProps).text !== elInner.customText\n // )\n\n );\n}\n\nfunction doCreateOrUpdateClipPath(el, dataIndex, elOption, seriesModel, isInit) {\n // Based on the \"merge\" principle, if no clipPath provided,\n // do nothing. The exists clip will be totally removed only if\n // `el.clipPath` is `false`. Otherwise it will be merged/replaced.\n var clipPathOpt = elOption.clipPath;\n\n if (clipPathOpt === false) {\n if (el && el.getClipPath()) {\n el.removeClipPath();\n }\n } else if (clipPathOpt) {\n var clipPath = el.getClipPath();\n\n if (clipPath && doesElNeedRecreate(clipPath, clipPathOpt, seriesModel)) {\n clipPath = null;\n }\n\n if (!clipPath) {\n clipPath = createEl(clipPathOpt);\n\n if (process.env.NODE_ENV !== 'production') {\n assert(isPath(clipPath), 'Only any type of `path` can be used in `clipPath`, rather than ' + clipPath.type + '.');\n }\n\n el.setClipPath(clipPath);\n }\n\n updateElNormal(null, clipPath, dataIndex, clipPathOpt, null, seriesModel, isInit);\n } // If not define `clipPath` in option, do nothing unnecessary.\n\n}\n\nfunction doCreateOrUpdateAttachedTx(el, dataIndex, elOption, seriesModel, isInit, attachedTxInfo) {\n // Group does not support textContent temporarily until necessary.\n if (el.isGroup) {\n return;\n } // Normal must be called before emphasis, for `isLegacy` detection.\n\n\n processTxInfo(elOption, null, attachedTxInfo);\n processTxInfo(elOption, EMPHASIS, attachedTxInfo); // If `elOption.textConfig` or `elOption.textContent` is null/undefined, it does not make sense.\n // So for simplicity, if \"elOption hasOwnProperty of them but be null/undefined\", we do not\n // trade them as set to null to el.\n // Especially:\n // `elOption.textContent: false` means remove textContent.\n // `elOption.textContent.emphasis.style: false` means remove the style from emphasis state.\n\n var txConOptNormal = attachedTxInfo.normal.conOpt;\n var txConOptEmphasis = attachedTxInfo.emphasis.conOpt;\n var txConOptBlur = attachedTxInfo.blur.conOpt;\n var txConOptSelect = attachedTxInfo.select.conOpt;\n\n if (txConOptNormal != null || txConOptEmphasis != null || txConOptSelect != null || txConOptBlur != null) {\n var textContent = el.getTextContent();\n\n if (txConOptNormal === false) {\n textContent && el.removeTextContent();\n } else {\n txConOptNormal = attachedTxInfo.normal.conOpt = txConOptNormal || {\n type: 'text'\n };\n\n if (!textContent) {\n textContent = createEl(txConOptNormal);\n el.setTextContent(textContent);\n } else {\n // If in some case the performance issue arised, consider\n // do not clearState but update cached normal state directly.\n textContent.clearStates();\n }\n\n updateElNormal(null, textContent, dataIndex, txConOptNormal, null, seriesModel, isInit);\n var txConStlOptNormal = txConOptNormal && txConOptNormal.style;\n\n for (var i = 0; i < STATES.length; i++) {\n var stateName = STATES[i];\n\n if (stateName !== NORMAL) {\n var txConOptOtherState = attachedTxInfo[stateName].conOpt;\n updateElOnState(stateName, textContent, txConOptOtherState, retrieveStyleOptionOnState(txConOptNormal, txConOptOtherState, stateName), null);\n }\n }\n\n txConStlOptNormal ? textContent.dirty() : textContent.markRedraw();\n }\n }\n}\n\nfunction processTxInfo(elOption, state, attachedTxInfo) {\n var stateOpt = !state ? elOption : retrieveStateOption(elOption, state);\n var styleOpt = !state ? elOption.style : retrieveStyleOptionOnState(elOption, stateOpt, EMPHASIS);\n var elType = elOption.type;\n var txCfg = stateOpt ? stateOpt.textConfig : null;\n var txConOptNormal = elOption.textContent;\n var txConOpt = !txConOptNormal ? null : !state ? txConOptNormal : retrieveStateOption(txConOptNormal, state);\n\n if (styleOpt && ( // Because emphasis style has little info to detect legacy,\n // if normal is legacy, emphasis is trade as legacy.\n attachedTxInfo.isLegacy || isEC4CompatibleStyle(styleOpt, elType, !!txCfg, !!txConOpt))) {\n attachedTxInfo.isLegacy = true;\n var convertResult = convertFromEC4CompatibleStyle(styleOpt, elType, !state); // Explicitly specified `textConfig` and `textContent` has higher priority than\n // the ones generated by legacy style. Otherwise if users use them and `api.style`\n // at the same time, they not both work and hardly to known why.\n\n if (!txCfg && convertResult.textConfig) {\n txCfg = convertResult.textConfig;\n }\n\n if (!txConOpt && convertResult.textContent) {\n txConOpt = convertResult.textContent;\n }\n }\n\n if (!state && txConOpt) {\n var txConOptNormal_1 = txConOpt; // `textContent: {type: 'text'}`, the \"type\" is easy to be missing. So we tolerate it.\n\n !txConOptNormal_1.type && (txConOptNormal_1.type = 'text');\n\n if (process.env.NODE_ENV !== 'production') {\n // Do not tolerate incorrcet type for forward compat.\n assert(txConOptNormal_1.type === 'text', 'textContent.type must be \"text\"');\n }\n }\n\n var info = !state ? attachedTxInfo.normal : attachedTxInfo[state];\n info.cfg = txCfg;\n info.conOpt = txConOpt;\n}\n\nfunction retrieveStateOption(elOption, state) {\n return !state ? elOption : elOption ? elOption[state] : null;\n}\n\nfunction retrieveStyleOptionOnState(stateOptionNormal, stateOption, state) {\n var style = stateOption && stateOption.style;\n\n if (style == null && state === EMPHASIS && stateOptionNormal) {\n style = stateOptionNormal.styleEmphasis;\n }\n\n return style;\n} // Usage:\n// (1) By default, `elOption.$mergeChildren` is `'byIndex'`, which indicates\n// that the existing children will not be removed, and enables the feature\n// that update some of the props of some of the children simply by construct\n// the returned children of `renderItem` like:\n// `var children = group.children = []; children[3] = {opacity: 0.5};`\n// (2) If `elOption.$mergeChildren` is `'byName'`, add/update/remove children\n// by child.name. But that might be lower performance.\n// (3) If `elOption.$mergeChildren` is `false`, the existing children will be\n// replaced totally.\n// (4) If `!elOption.children`, following the \"merge\" principle, nothing will\n// happen.\n// (5) If `elOption.$mergeChildren` is not `false` neither `'byName'` and the\n// `el` is a group, and if any of the new child is null, it means to remove\n// the element at the same index, if exists. On the other hand, if the new\n// child is and empty object `{}`, it means to keep the element not changed.\n//\n// For implementation simpleness, do not provide a direct way to remove single\n// child (otherwise the total indices of the children array have to be modified).\n// User can remove a single child by setting its `ignore` to `true`.\n\n\nfunction mergeChildren(api, el, dataIndex, elOption, seriesModel) {\n var newChildren = elOption.children;\n var newLen = newChildren ? newChildren.length : 0;\n var mergeChildren = elOption.$mergeChildren; // `diffChildrenByName` has been deprecated.\n\n var byName = mergeChildren === 'byName' || elOption.diffChildrenByName;\n var notMerge = mergeChildren === false; // For better performance on roam update, only enter if necessary.\n\n if (!newLen && !byName && !notMerge) {\n return;\n }\n\n if (byName) {\n diffGroupChildren({\n api: api,\n oldChildren: el.children() || [],\n newChildren: newChildren || [],\n dataIndex: dataIndex,\n seriesModel: seriesModel,\n group: el\n });\n return;\n }\n\n notMerge && el.removeAll(); // Mapping children of a group simply by index, which\n // might be better performance.\n\n var index = 0;\n\n for (; index < newLen; index++) {\n var newChild = newChildren[index];\n var oldChild = el.childAt(index);\n\n if (newChild) {\n if (newChild.ignore == null) {\n // The old child is set to be ignored if null (see comments\n // below). So we need to set ignore to be false back.\n newChild.ignore = false;\n }\n\n doCreateOrUpdateEl(api, oldChild, dataIndex, newChild, seriesModel, el);\n } else {\n if (process.env.NODE_ENV !== 'production') {\n assert(oldChild, 'renderItem should not return a group containing elements' + ' as null/undefined/{} if they do not exist before.');\n } // If the new element option is null, it means to remove the old\n // element. But we cannot really remove the element from the group\n // directly, because the element order may not be stable when this\n // element is added back. So we set the element to be ignored.\n\n\n oldChild.ignore = true;\n }\n }\n\n for (var i = el.childCount() - 1; i >= index; i--) {\n var child = el.childAt(i);\n removeChildFromGroup(el, child, seriesModel);\n }\n}\n\nfunction removeChildFromGroup(group, child, seriesModel) {\n // Do not support leave elements that are not mentioned in the latest\n // `renderItem` return. Otherwise users may not have a clear and simple\n // concept that how to control all of the elements.\n child && applyLeaveTransition(child, customInnerStore(group).option, seriesModel);\n}\n\nfunction diffGroupChildren(context) {\n new DataDiffer(context.oldChildren, context.newChildren, getKey, getKey, context).add(processAddUpdate).update(processAddUpdate).remove(processRemove).execute();\n}\n\nfunction getKey(item, idx) {\n var name = item && item.name;\n return name != null ? name : GROUP_DIFF_PREFIX + idx;\n}\n\nfunction processAddUpdate(newIndex, oldIndex) {\n var context = this.context;\n var childOption = newIndex != null ? context.newChildren[newIndex] : null;\n var child = oldIndex != null ? context.oldChildren[oldIndex] : null;\n doCreateOrUpdateEl(context.api, child, context.dataIndex, childOption, context.seriesModel, context.group);\n}\n\nfunction processRemove(oldIndex) {\n var context = this.context;\n var child = context.oldChildren[oldIndex];\n child && applyLeaveTransition(child, customInnerStore(child).option, context.seriesModel);\n}\n/**\n * @return SVG Path data.\n */\n\n\nfunction getPathData(shape) {\n // \"d\" follows the SVG convention.\n return shape && (shape.pathData || shape.d);\n}\n\nfunction hasOwnPathData(shape) {\n return shape && (hasOwn(shape, 'pathData') || hasOwn(shape, 'd'));\n}"]},"metadata":{},"sourceType":"module"} |