f8b955bcde4743ee1003e6d134baa3a746f5f28277fb3fa96e6c16ac0ee79f1a.json 72 KB

1
  1. {"ast":null,"code":"import \"core-js/modules/es.array.push.js\";\nimport \"core-js/modules/es.iterator.constructor.js\";\nimport \"core-js/modules/es.iterator.for-each.js\";\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/*\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// Universal transitions that can animate between any shapes(series) and any properties in any amounts.\nimport { SERIES_UNIVERSAL_TRANSITION_PROP } from '../model/Series.js';\nimport { createHashMap, each, map, filter, isArray, extend } from 'zrender/lib/core/util.js';\nimport { applyMorphAnimation, getPathList } from './morphTransitionHelper.js';\nimport Path from 'zrender/lib/graphic/Path.js';\nimport { initProps } from '../util/graphic.js';\nimport DataDiffer from '../data/DataDiffer.js';\nimport { makeInner, normalizeToArray } from '../util/model.js';\nimport { warn } from '../util/log.js';\nimport { getAnimationConfig, getOldStyle } from './basicTransition.js';\nimport Displayable from 'zrender/lib/graphic/Displayable.js';\nvar DATA_COUNT_THRESHOLD = 1e4;\nvar TRANSITION_NONE = 0;\nvar TRANSITION_P2C = 1;\nvar TRANSITION_C2P = 2;\n;\nvar getUniversalTransitionGlobalStore = makeInner();\nfunction getDimension(data, visualDimension) {\n var dimensions = data.dimensions;\n for (var i = 0; i < dimensions.length; i++) {\n var dimInfo = data.getDimensionInfo(dimensions[i]);\n if (dimInfo && dimInfo.otherDims[visualDimension] === 0) {\n return dimensions[i];\n }\n }\n}\n// get value by dimension. (only get value of itemGroupId or childGroupId, so convert it to string)\nfunction getValueByDimension(data, dataIndex, dimension) {\n var dimInfo = data.getDimensionInfo(dimension);\n var dimOrdinalMeta = dimInfo && dimInfo.ordinalMeta;\n if (dimInfo) {\n var value = data.get(dimInfo.name, dataIndex);\n if (dimOrdinalMeta) {\n return dimOrdinalMeta.categories[value] || value + '';\n }\n return value + '';\n }\n}\nfunction getGroupId(data, dataIndex, dataGroupId, isChild) {\n // try to get groupId from encode\n var visualDimension = isChild ? 'itemChildGroupId' : 'itemGroupId';\n var groupIdDim = getDimension(data, visualDimension);\n if (groupIdDim) {\n var groupId = getValueByDimension(data, dataIndex, groupIdDim);\n return groupId;\n }\n // try to get groupId from raw data item\n var rawDataItem = data.getRawDataItem(dataIndex);\n var property = isChild ? 'childGroupId' : 'groupId';\n if (rawDataItem && rawDataItem[property]) {\n return rawDataItem[property] + '';\n }\n // fallback\n if (isChild) {\n return;\n }\n // try to use series.dataGroupId as groupId, otherwise use dataItem's id as groupId\n return dataGroupId || data.getId(dataIndex);\n}\n// flatten all data items from different serieses into one arrary\nfunction flattenDataDiffItems(list) {\n var items = [];\n each(list, function (seriesInfo) {\n var data = seriesInfo.data;\n var dataGroupId = seriesInfo.dataGroupId;\n if (data.count() > DATA_COUNT_THRESHOLD) {\n if (process.env.NODE_ENV !== 'production') {\n warn('Universal transition is disabled on large data > 10k.');\n }\n return;\n }\n var indices = data.getIndices();\n for (var dataIndex = 0; dataIndex < indices.length; dataIndex++) {\n items.push({\n data: data,\n groupId: getGroupId(data, dataIndex, dataGroupId, false),\n childGroupId: getGroupId(data, dataIndex, dataGroupId, true),\n divide: seriesInfo.divide,\n dataIndex: dataIndex\n });\n }\n });\n return items;\n}\nfunction fadeInElement(newEl, newSeries, newIndex) {\n newEl.traverse(function (el) {\n if (el instanceof Path) {\n // TODO use fade in animation for target element.\n initProps(el, {\n style: {\n opacity: 0\n }\n }, newSeries, {\n dataIndex: newIndex,\n isFrom: true\n });\n }\n });\n}\nfunction removeEl(el) {\n if (el.parent) {\n // Bake parent transform to element.\n // So it can still have proper transform to transition after it's removed.\n var computedTransform = el.getComputedTransform();\n el.setLocalTransform(computedTransform);\n el.parent.remove(el);\n }\n}\nfunction stopAnimation(el) {\n el.stopAnimation();\n if (el.isGroup) {\n el.traverse(function (child) {\n child.stopAnimation();\n });\n }\n}\nfunction animateElementStyles(el, dataIndex, seriesModel) {\n var animationConfig = getAnimationConfig('update', seriesModel, dataIndex);\n animationConfig && el.traverse(function (child) {\n if (child instanceof Displayable) {\n var oldStyle = getOldStyle(child);\n if (oldStyle) {\n child.animateFrom({\n style: oldStyle\n }, animationConfig);\n }\n }\n });\n}\nfunction isAllIdSame(oldDiffItems, newDiffItems) {\n var len = oldDiffItems.length;\n if (len !== newDiffItems.length) {\n return false;\n }\n for (var i = 0; i < len; i++) {\n var oldItem = oldDiffItems[i];\n var newItem = newDiffItems[i];\n if (oldItem.data.getId(oldItem.dataIndex) !== newItem.data.getId(newItem.dataIndex)) {\n return false;\n }\n }\n return true;\n}\nfunction transitionBetween(oldList, newList, api) {\n var oldDiffItems = flattenDataDiffItems(oldList);\n var newDiffItems = flattenDataDiffItems(newList);\n function updateMorphingPathProps(from, to, rawFrom, rawTo, animationCfg) {\n if (rawFrom || from) {\n to.animateFrom({\n style: rawFrom && rawFrom !== from\n // dividingMethod like clone may override the style(opacity)\n // So extend it to raw style.\n ? extend(extend({}, rawFrom.style), from.style) : from.style\n }, animationCfg);\n }\n }\n var hasMorphAnimation = false;\n /**\r\n * With groupId and childGroupId, we can build parent-child relationships between dataItems.\r\n * However, we should mind the parent-child \"direction\" between old and new options.\r\n *\r\n * For example, suppose we have two dataItems from two series.data:\r\n *\r\n * dataA: [ dataB: [\r\n * { {\r\n * value: 5, value: 3,\r\n * groupId: 'creatures', groupId: 'animals',\r\n * childGroupId: 'animals' childGroupId: 'dogs'\r\n * }, },\r\n * ... ...\r\n * ] ]\r\n *\r\n * where dataA is belong to optionA and dataB is belong to optionB.\r\n *\r\n * When we `setOption(optionB)` from optionA, we choose childGroupId of dataItemA and groupId of\r\n * dataItemB as keys so the two keys are matched (both are 'animals'), then universalTransition\r\n * will work. This derection is \"parent -> child\".\r\n *\r\n * If we `setOption(optionA)` from optionB, we also choose groupId of dataItemB and childGroupId\r\n * of dataItemA as keys and universalTransition will work. This derection is \"child -> parent\".\r\n *\r\n * If there is no childGroupId specified, which means no multiLevelDrillDown/Up is needed and no\r\n * parent-child relationship exists. This direction is \"none\".\r\n *\r\n * So we need to know whether to use groupId or childGroupId as the key when we call the keyGetter\r\n * functions. Thus, we need to decide the direction first.\r\n *\r\n * The rule is:\r\n *\r\n * if (all childGroupIds in oldDiffItems and all groupIds in newDiffItems have common value) {\r\n * direction = 'parent -> child';\r\n * } else if (all groupIds in oldDiffItems and all childGroupIds in newDiffItems have common value) {\r\n * direction = 'child -> parent';\r\n * } else {\r\n * direction = 'none';\r\n * }\r\n */\n var direction = TRANSITION_NONE;\n // find all groupIds and childGroupIds from oldDiffItems\n var oldGroupIds = createHashMap();\n var oldChildGroupIds = createHashMap();\n oldDiffItems.forEach(function (item) {\n item.groupId && oldGroupIds.set(item.groupId, true);\n item.childGroupId && oldChildGroupIds.set(item.childGroupId, true);\n });\n // traverse newDiffItems and decide the direction according to the rule\n for (var i = 0; i < newDiffItems.length; i++) {\n var newGroupId = newDiffItems[i].groupId;\n if (oldChildGroupIds.get(newGroupId)) {\n direction = TRANSITION_P2C;\n break;\n }\n var newChildGroupId = newDiffItems[i].childGroupId;\n if (newChildGroupId && oldGroupIds.get(newChildGroupId)) {\n direction = TRANSITION_C2P;\n break;\n }\n }\n function createKeyGetter(isOld, onlyGetId) {\n return function (diffItem) {\n var data = diffItem.data;\n var dataIndex = diffItem.dataIndex;\n // TODO if specified dim\n if (onlyGetId) {\n return data.getId(dataIndex);\n }\n if (isOld) {\n return direction === TRANSITION_P2C ? diffItem.childGroupId : diffItem.groupId;\n } else {\n return direction === TRANSITION_C2P ? diffItem.childGroupId : diffItem.groupId;\n }\n };\n }\n // Use id if it's very likely to be an one to one animation\n // It's more robust than groupId\n // TODO Check if key dimension is specified.\n var useId = isAllIdSame(oldDiffItems, newDiffItems);\n var isElementStillInChart = {};\n if (!useId) {\n // We may have different diff strategy with basicTransition if we use other dimension as key.\n // If so, we can't simply check if oldEl is same with newEl. We need a map to check if oldEl is still being used in the new chart.\n // We can't use the elements that already being morphed. Let it keep it's original basic transition.\n for (var i = 0; i < newDiffItems.length; i++) {\n var newItem = newDiffItems[i];\n var el = newItem.data.getItemGraphicEl(newItem.dataIndex);\n if (el) {\n isElementStillInChart[el.id] = true;\n }\n }\n }\n function updateOneToOne(newIndex, oldIndex) {\n var oldItem = oldDiffItems[oldIndex];\n var newItem = newDiffItems[newIndex];\n var newSeries = newItem.data.hostModel;\n // TODO Mark this elements is morphed and don't morph them anymore\n var oldEl = oldItem.data.getItemGraphicEl(oldItem.dataIndex);\n var newEl = newItem.data.getItemGraphicEl(newItem.dataIndex);\n // Can't handle same elements.\n if (oldEl === newEl) {\n newEl && animateElementStyles(newEl, newItem.dataIndex, newSeries);\n return;\n }\n if (\n // We can't use the elements that already being morphed\n oldEl && isElementStillInChart[oldEl.id]) {\n return;\n }\n if (newEl) {\n // TODO: If keep animating the group in case\n // some of the elements don't want to be morphed.\n // TODO Label?\n stopAnimation(newEl);\n if (oldEl) {\n stopAnimation(oldEl);\n // If old element is doing leaving animation. stop it and remove it immediately.\n removeEl(oldEl);\n hasMorphAnimation = true;\n applyMorphAnimation(getPathList(oldEl), getPathList(newEl), newItem.divide, newSeries, newIndex, updateMorphingPathProps);\n } else {\n fadeInElement(newEl, newSeries, newIndex);\n }\n }\n // else keep oldEl leaving animation.\n }\n new DataDiffer(oldDiffItems, newDiffItems, createKeyGetter(true, useId), createKeyGetter(false, useId), null, 'multiple').update(updateOneToOne).updateManyToOne(function (newIndex, oldIndices) {\n var newItem = newDiffItems[newIndex];\n var newData = newItem.data;\n var newSeries = newData.hostModel;\n var newEl = newData.getItemGraphicEl(newItem.dataIndex);\n var oldElsList = filter(map(oldIndices, function (idx) {\n return oldDiffItems[idx].data.getItemGraphicEl(oldDiffItems[idx].dataIndex);\n }), function (oldEl) {\n return oldEl && oldEl !== newEl && !isElementStillInChart[oldEl.id];\n });\n if (newEl) {\n stopAnimation(newEl);\n if (oldElsList.length) {\n // If old element is doing leaving animation. stop it and remove it immediately.\n each(oldElsList, function (oldEl) {\n stopAnimation(oldEl);\n removeEl(oldEl);\n });\n hasMorphAnimation = true;\n applyMorphAnimation(getPathList(oldElsList), getPathList(newEl), newItem.divide, newSeries, newIndex, updateMorphingPathProps);\n } else {\n fadeInElement(newEl, newSeries, newItem.dataIndex);\n }\n }\n // else keep oldEl leaving animation.\n }).updateOneToMany(function (newIndices, oldIndex) {\n var oldItem = oldDiffItems[oldIndex];\n var oldEl = oldItem.data.getItemGraphicEl(oldItem.dataIndex);\n // We can't use the elements that already being morphed\n if (oldEl && isElementStillInChart[oldEl.id]) {\n return;\n }\n var newElsList = filter(map(newIndices, function (idx) {\n return newDiffItems[idx].data.getItemGraphicEl(newDiffItems[idx].dataIndex);\n }), function (el) {\n return el && el !== oldEl;\n });\n var newSeris = newDiffItems[newIndices[0]].data.hostModel;\n if (newElsList.length) {\n each(newElsList, function (newEl) {\n return stopAnimation(newEl);\n });\n if (oldEl) {\n stopAnimation(oldEl);\n // If old element is doing leaving animation. stop it and remove it immediately.\n removeEl(oldEl);\n hasMorphAnimation = true;\n applyMorphAnimation(getPathList(oldEl), getPathList(newElsList), oldItem.divide,\n // Use divide on old.\n newSeris, newIndices[0], updateMorphingPathProps);\n } else {\n each(newElsList, function (newEl) {\n return fadeInElement(newEl, newSeris, newIndices[0]);\n });\n }\n }\n // else keep oldEl leaving animation.\n }).updateManyToMany(function (newIndices, oldIndices) {\n // If two data are same and both have groupId.\n // Normally they should be diff by id.\n new DataDiffer(oldIndices, newIndices, function (rawIdx) {\n return oldDiffItems[rawIdx].data.getId(oldDiffItems[rawIdx].dataIndex);\n }, function (rawIdx) {\n return newDiffItems[rawIdx].data.getId(newDiffItems[rawIdx].dataIndex);\n }).update(function (newIndex, oldIndex) {\n // Use the original index\n updateOneToOne(newIndices[newIndex], oldIndices[oldIndex]);\n }).execute();\n }).execute();\n if (hasMorphAnimation) {\n each(newList, function (_a) {\n var data = _a.data;\n var seriesModel = data.hostModel;\n var view = seriesModel && api.getViewOfSeriesModel(seriesModel);\n var animationCfg = getAnimationConfig('update', seriesModel, 0); // use 0 index.\n if (view && seriesModel.isAnimationEnabled() && animationCfg && animationCfg.duration > 0) {\n view.group.traverse(function (el) {\n if (el instanceof Path && !el.animators.length) {\n // We can't accept there still exists element that has no animation\n // if universalTransition is enabled\n el.animateFrom({\n style: {\n opacity: 0\n }\n }, animationCfg);\n }\n });\n }\n });\n }\n}\nfunction getSeriesTransitionKey(series) {\n var seriesKey = series.getModel('universalTransition').get('seriesKey');\n if (!seriesKey) {\n // Use series id by default.\n return series.id;\n }\n return seriesKey;\n}\nfunction convertArraySeriesKeyToString(seriesKey) {\n if (isArray(seriesKey)) {\n // Order independent.\n return seriesKey.sort().join(',');\n }\n return seriesKey;\n}\nfunction getDivideShapeFromData(data) {\n if (data.hostModel) {\n return data.hostModel.getModel('universalTransition').get('divideShape');\n }\n}\nfunction findTransitionSeriesBatches(globalStore, params) {\n var updateBatches = createHashMap();\n var oldDataMap = createHashMap();\n // Map that only store key in array seriesKey.\n // Which is used to query the old data when transition from one to multiple series.\n var oldDataMapForSplit = createHashMap();\n each(globalStore.oldSeries, function (series, idx) {\n var oldDataGroupId = globalStore.oldDataGroupIds[idx];\n var oldData = globalStore.oldData[idx];\n var transitionKey = getSeriesTransitionKey(series);\n var transitionKeyStr = convertArraySeriesKeyToString(transitionKey);\n oldDataMap.set(transitionKeyStr, {\n dataGroupId: oldDataGroupId,\n data: oldData\n });\n if (isArray(transitionKey)) {\n // Same key can't in different array seriesKey.\n each(transitionKey, function (key) {\n oldDataMapForSplit.set(key, {\n key: transitionKeyStr,\n dataGroupId: oldDataGroupId,\n data: oldData\n });\n });\n }\n });\n function checkTransitionSeriesKeyDuplicated(transitionKeyStr) {\n if (updateBatches.get(transitionKeyStr)) {\n warn(\"Duplicated seriesKey in universalTransition \" + transitionKeyStr);\n }\n }\n each(params.updatedSeries, function (series) {\n if (series.isUniversalTransitionEnabled() && series.isAnimationEnabled()) {\n var newDataGroupId = series.get('dataGroupId');\n var newData = series.getData();\n var transitionKey = getSeriesTransitionKey(series);\n var transitionKeyStr = convertArraySeriesKeyToString(transitionKey);\n // Only transition between series with same id.\n var oldData = oldDataMap.get(transitionKeyStr);\n // string transition key is the best match.\n if (oldData) {\n if (process.env.NODE_ENV !== 'production') {\n checkTransitionSeriesKeyDuplicated(transitionKeyStr);\n }\n // TODO check if data is same?\n updateBatches.set(transitionKeyStr, {\n oldSeries: [{\n dataGroupId: oldData.dataGroupId,\n divide: getDivideShapeFromData(oldData.data),\n data: oldData.data\n }],\n newSeries: [{\n dataGroupId: newDataGroupId,\n divide: getDivideShapeFromData(newData),\n data: newData\n }]\n });\n } else {\n // Transition from multiple series.\n // e.g. 'female', 'male' -> ['female', 'male']\n if (isArray(transitionKey)) {\n if (process.env.NODE_ENV !== 'production') {\n checkTransitionSeriesKeyDuplicated(transitionKeyStr);\n }\n var oldSeries_1 = [];\n each(transitionKey, function (key) {\n var oldData = oldDataMap.get(key);\n if (oldData.data) {\n oldSeries_1.push({\n dataGroupId: oldData.dataGroupId,\n divide: getDivideShapeFromData(oldData.data),\n data: oldData.data\n });\n }\n });\n if (oldSeries_1.length) {\n updateBatches.set(transitionKeyStr, {\n oldSeries: oldSeries_1,\n newSeries: [{\n dataGroupId: newDataGroupId,\n data: newData,\n divide: getDivideShapeFromData(newData)\n }]\n });\n }\n } else {\n // Try transition to multiple series.\n // e.g. ['female', 'male'] -> 'female', 'male'\n var oldData_1 = oldDataMapForSplit.get(transitionKey);\n if (oldData_1) {\n var batch = updateBatches.get(oldData_1.key);\n if (!batch) {\n batch = {\n oldSeries: [{\n dataGroupId: oldData_1.dataGroupId,\n data: oldData_1.data,\n divide: getDivideShapeFromData(oldData_1.data)\n }],\n newSeries: []\n };\n updateBatches.set(oldData_1.key, batch);\n }\n batch.newSeries.push({\n dataGroupId: newDataGroupId,\n data: newData,\n divide: getDivideShapeFromData(newData)\n });\n }\n }\n }\n }\n });\n return updateBatches;\n}\nfunction querySeries(series, finder) {\n for (var i = 0; i < series.length; i++) {\n var found = finder.seriesIndex != null && finder.seriesIndex === series[i].seriesIndex || finder.seriesId != null && finder.seriesId === series[i].id;\n if (found) {\n return i;\n }\n }\n}\nfunction transitionSeriesFromOpt(transitionOpt, globalStore, params, api) {\n var from = [];\n var to = [];\n each(normalizeToArray(transitionOpt.from), function (finder) {\n var idx = querySeries(globalStore.oldSeries, finder);\n if (idx >= 0) {\n from.push({\n dataGroupId: globalStore.oldDataGroupIds[idx],\n data: globalStore.oldData[idx],\n // TODO can specify divideShape in transition.\n divide: getDivideShapeFromData(globalStore.oldData[idx]),\n groupIdDim: finder.dimension\n });\n }\n });\n each(normalizeToArray(transitionOpt.to), function (finder) {\n var idx = querySeries(params.updatedSeries, finder);\n if (idx >= 0) {\n var data = params.updatedSeries[idx].getData();\n to.push({\n dataGroupId: globalStore.oldDataGroupIds[idx],\n data: data,\n divide: getDivideShapeFromData(data),\n groupIdDim: finder.dimension\n });\n }\n });\n if (from.length > 0 && to.length > 0) {\n transitionBetween(from, to, api);\n }\n}\nexport function installUniversalTransition(registers) {\n registers.registerUpdateLifecycle('series:beforeupdate', function (ecMOdel, api, params) {\n each(normalizeToArray(params.seriesTransition), function (transOpt) {\n each(normalizeToArray(transOpt.to), function (finder) {\n var series = params.updatedSeries;\n for (var i = 0; i < series.length; i++) {\n if (finder.seriesIndex != null && finder.seriesIndex === series[i].seriesIndex || finder.seriesId != null && finder.seriesId === series[i].id) {\n series[i][SERIES_UNIVERSAL_TRANSITION_PROP] = true;\n }\n }\n });\n });\n });\n registers.registerUpdateLifecycle('series:transition', function (ecModel, api, params) {\n // TODO api provide an namespace that can save stuff per instance\n var globalStore = getUniversalTransitionGlobalStore(api);\n // TODO multiple to multiple series.\n if (globalStore.oldSeries && params.updatedSeries && params.optionChanged) {\n // TODO transitionOpt was used in an old implementation and can be removed now\n // Use give transition config if its' give;\n var transitionOpt = params.seriesTransition;\n if (transitionOpt) {\n each(normalizeToArray(transitionOpt), function (opt) {\n transitionSeriesFromOpt(opt, globalStore, params, api);\n });\n } else {\n // Else guess from series based on transition series key.\n var updateBatches_1 = findTransitionSeriesBatches(globalStore, params);\n each(updateBatches_1.keys(), function (key) {\n var batch = updateBatches_1.get(key);\n transitionBetween(batch.oldSeries, batch.newSeries, api);\n });\n }\n // Reset\n each(params.updatedSeries, function (series) {\n // Reset;\n if (series[SERIES_UNIVERSAL_TRANSITION_PROP]) {\n series[SERIES_UNIVERSAL_TRANSITION_PROP] = false;\n }\n });\n }\n // Save all series of current update. Not only the updated one.\n var allSeries = ecModel.getSeries();\n var savedSeries = globalStore.oldSeries = [];\n var savedDataGroupIds = globalStore.oldDataGroupIds = [];\n var savedData = globalStore.oldData = [];\n for (var i = 0; i < allSeries.length; i++) {\n var data = allSeries[i].getData();\n // Only save the data that can have transition.\n // Avoid large data costing too much extra memory\n if (data.count() < DATA_COUNT_THRESHOLD) {\n savedSeries.push(allSeries[i]);\n savedDataGroupIds.push(allSeries[i].get('dataGroupId'));\n savedData.push(data);\n }\n }\n });\n}","map":{"version":3,"names":["SERIES_UNIVERSAL_TRANSITION_PROP","createHashMap","each","map","filter","isArray","extend","applyMorphAnimation","getPathList","Path","initProps","DataDiffer","makeInner","normalizeToArray","warn","getAnimationConfig","getOldStyle","Displayable","DATA_COUNT_THRESHOLD","TRANSITION_NONE","TRANSITION_P2C","TRANSITION_C2P","getUniversalTransitionGlobalStore","getDimension","data","visualDimension","dimensions","i","length","dimInfo","getDimensionInfo","otherDims","getValueByDimension","dataIndex","dimension","dimOrdinalMeta","ordinalMeta","value","get","name","categories","getGroupId","dataGroupId","isChild","groupIdDim","groupId","rawDataItem","getRawDataItem","property","getId","flattenDataDiffItems","list","items","seriesInfo","count","process","env","NODE_ENV","indices","getIndices","push","childGroupId","divide","fadeInElement","newEl","newSeries","newIndex","traverse","el","style","opacity","isFrom","removeEl","parent","computedTransform","getComputedTransform","setLocalTransform","remove","stopAnimation","isGroup","child","animateElementStyles","seriesModel","animationConfig","oldStyle","animateFrom","isAllIdSame","oldDiffItems","newDiffItems","len","oldItem","newItem","transitionBetween","oldList","newList","api","updateMorphingPathProps","from","to","rawFrom","rawTo","animationCfg","hasMorphAnimation","direction","oldGroupIds","oldChildGroupIds","forEach","item","set","newGroupId","newChildGroupId","createKeyGetter","isOld","onlyGetId","diffItem","useId","isElementStillInChart","getItemGraphicEl","id","updateOneToOne","oldIndex","hostModel","oldEl","update","updateManyToOne","oldIndices","newData","oldElsList","idx","updateOneToMany","newIndices","newElsList","newSeris","updateManyToMany","rawIdx","execute","_a","view","getViewOfSeriesModel","isAnimationEnabled","duration","group","animators","getSeriesTransitionKey","series","seriesKey","getModel","convertArraySeriesKeyToString","sort","join","getDivideShapeFromData","findTransitionSeriesBatches","globalStore","params","updateBatches","oldDataMap","oldDataMapForSplit","oldSeries","oldDataGroupId","oldDataGroupIds","oldData","transitionKey","transitionKeyStr","key","checkTransitionSeriesKeyDuplicated","updatedSeries","isUniversalTransitionEnabled","newDataGroupId","getData","oldSeries_1","oldData_1","batch","querySeries","finder","found","seriesIndex","seriesId","transitionSeriesFromOpt","transitionOpt","installUniversalTransition","registers","registerUpdateLifecycle","ecMOdel","seriesTransition","transOpt","ecModel","optionChanged","opt","updateBatches_1","keys","allSeries","getSeries","savedSeries","savedDataGroupIds","savedData"],"sources":["E:/git/2021项目/安科院大屏/node_modules/echarts/lib/animation/universalTransition.js"],"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/*\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// Universal transitions that can animate between any shapes(series) and any properties in any amounts.\nimport { SERIES_UNIVERSAL_TRANSITION_PROP } from '../model/Series.js';\nimport { createHashMap, each, map, filter, isArray, extend } from 'zrender/lib/core/util.js';\nimport { applyMorphAnimation, getPathList } from './morphTransitionHelper.js';\nimport Path from 'zrender/lib/graphic/Path.js';\nimport { initProps } from '../util/graphic.js';\nimport DataDiffer from '../data/DataDiffer.js';\nimport { makeInner, normalizeToArray } from '../util/model.js';\nimport { warn } from '../util/log.js';\nimport { getAnimationConfig, getOldStyle } from './basicTransition.js';\nimport Displayable from 'zrender/lib/graphic/Displayable.js';\nvar DATA_COUNT_THRESHOLD = 1e4;\nvar TRANSITION_NONE = 0;\nvar TRANSITION_P2C = 1;\nvar TRANSITION_C2P = 2;\n;\nvar getUniversalTransitionGlobalStore = makeInner();\nfunction getDimension(data, visualDimension) {\n var dimensions = data.dimensions;\n for (var i = 0; i < dimensions.length; i++) {\n var dimInfo = data.getDimensionInfo(dimensions[i]);\n if (dimInfo && dimInfo.otherDims[visualDimension] === 0) {\n return dimensions[i];\n }\n }\n}\n// get value by dimension. (only get value of itemGroupId or childGroupId, so convert it to string)\nfunction getValueByDimension(data, dataIndex, dimension) {\n var dimInfo = data.getDimensionInfo(dimension);\n var dimOrdinalMeta = dimInfo && dimInfo.ordinalMeta;\n if (dimInfo) {\n var value = data.get(dimInfo.name, dataIndex);\n if (dimOrdinalMeta) {\n return dimOrdinalMeta.categories[value] || value + '';\n }\n return value + '';\n }\n}\nfunction getGroupId(data, dataIndex, dataGroupId, isChild) {\n // try to get groupId from encode\n var visualDimension = isChild ? 'itemChildGroupId' : 'itemGroupId';\n var groupIdDim = getDimension(data, visualDimension);\n if (groupIdDim) {\n var groupId = getValueByDimension(data, dataIndex, groupIdDim);\n return groupId;\n }\n // try to get groupId from raw data item\n var rawDataItem = data.getRawDataItem(dataIndex);\n var property = isChild ? 'childGroupId' : 'groupId';\n if (rawDataItem && rawDataItem[property]) {\n return rawDataItem[property] + '';\n }\n // fallback\n if (isChild) {\n return;\n }\n // try to use series.dataGroupId as groupId, otherwise use dataItem's id as groupId\n return dataGroupId || data.getId(dataIndex);\n}\n// flatten all data items from different serieses into one arrary\nfunction flattenDataDiffItems(list) {\n var items = [];\n each(list, function (seriesInfo) {\n var data = seriesInfo.data;\n var dataGroupId = seriesInfo.dataGroupId;\n if (data.count() > DATA_COUNT_THRESHOLD) {\n if (process.env.NODE_ENV !== 'production') {\n warn('Universal transition is disabled on large data > 10k.');\n }\n return;\n }\n var indices = data.getIndices();\n for (var dataIndex = 0; dataIndex < indices.length; dataIndex++) {\n items.push({\n data: data,\n groupId: getGroupId(data, dataIndex, dataGroupId, false),\n childGroupId: getGroupId(data, dataIndex, dataGroupId, true),\n divide: seriesInfo.divide,\n dataIndex: dataIndex\n });\n }\n });\n return items;\n}\nfunction fadeInElement(newEl, newSeries, newIndex) {\n newEl.traverse(function (el) {\n if (el instanceof Path) {\n // TODO use fade in animation for target element.\n initProps(el, {\n style: {\n opacity: 0\n }\n }, newSeries, {\n dataIndex: newIndex,\n isFrom: true\n });\n }\n });\n}\nfunction removeEl(el) {\n if (el.parent) {\n // Bake parent transform to element.\n // So it can still have proper transform to transition after it's removed.\n var computedTransform = el.getComputedTransform();\n el.setLocalTransform(computedTransform);\n el.parent.remove(el);\n }\n}\nfunction stopAnimation(el) {\n el.stopAnimation();\n if (el.isGroup) {\n el.traverse(function (child) {\n child.stopAnimation();\n });\n }\n}\nfunction animateElementStyles(el, dataIndex, seriesModel) {\n var animationConfig = getAnimationConfig('update', seriesModel, dataIndex);\n animationConfig && el.traverse(function (child) {\n if (child instanceof Displayable) {\n var oldStyle = getOldStyle(child);\n if (oldStyle) {\n child.animateFrom({\n style: oldStyle\n }, animationConfig);\n }\n }\n });\n}\nfunction isAllIdSame(oldDiffItems, newDiffItems) {\n var len = oldDiffItems.length;\n if (len !== newDiffItems.length) {\n return false;\n }\n for (var i = 0; i < len; i++) {\n var oldItem = oldDiffItems[i];\n var newItem = newDiffItems[i];\n if (oldItem.data.getId(oldItem.dataIndex) !== newItem.data.getId(newItem.dataIndex)) {\n return false;\n }\n }\n return true;\n}\nfunction transitionBetween(oldList, newList, api) {\n var oldDiffItems = flattenDataDiffItems(oldList);\n var newDiffItems = flattenDataDiffItems(newList);\n function updateMorphingPathProps(from, to, rawFrom, rawTo, animationCfg) {\n if (rawFrom || from) {\n to.animateFrom({\n style: rawFrom && rawFrom !== from\n // dividingMethod like clone may override the style(opacity)\n // So extend it to raw style.\n ? extend(extend({}, rawFrom.style), from.style) : from.style\n }, animationCfg);\n }\n }\n var hasMorphAnimation = false;\n /**\r\n * With groupId and childGroupId, we can build parent-child relationships between dataItems.\r\n * However, we should mind the parent-child \"direction\" between old and new options.\r\n *\r\n * For example, suppose we have two dataItems from two series.data:\r\n *\r\n * dataA: [ dataB: [\r\n * { {\r\n * value: 5, value: 3,\r\n * groupId: 'creatures', groupId: 'animals',\r\n * childGroupId: 'animals' childGroupId: 'dogs'\r\n * }, },\r\n * ... ...\r\n * ] ]\r\n *\r\n * where dataA is belong to optionA and dataB is belong to optionB.\r\n *\r\n * When we `setOption(optionB)` from optionA, we choose childGroupId of dataItemA and groupId of\r\n * dataItemB as keys so the two keys are matched (both are 'animals'), then universalTransition\r\n * will work. This derection is \"parent -> child\".\r\n *\r\n * If we `setOption(optionA)` from optionB, we also choose groupId of dataItemB and childGroupId\r\n * of dataItemA as keys and universalTransition will work. This derection is \"child -> parent\".\r\n *\r\n * If there is no childGroupId specified, which means no multiLevelDrillDown/Up is needed and no\r\n * parent-child relationship exists. This direction is \"none\".\r\n *\r\n * So we need to know whether to use groupId or childGroupId as the key when we call the keyGetter\r\n * functions. Thus, we need to decide the direction first.\r\n *\r\n * The rule is:\r\n *\r\n * if (all childGroupIds in oldDiffItems and all groupIds in newDiffItems have common value) {\r\n * direction = 'parent -> child';\r\n * } else if (all groupIds in oldDiffItems and all childGroupIds in newDiffItems have common value) {\r\n * direction = 'child -> parent';\r\n * } else {\r\n * direction = 'none';\r\n * }\r\n */\n var direction = TRANSITION_NONE;\n // find all groupIds and childGroupIds from oldDiffItems\n var oldGroupIds = createHashMap();\n var oldChildGroupIds = createHashMap();\n oldDiffItems.forEach(function (item) {\n item.groupId && oldGroupIds.set(item.groupId, true);\n item.childGroupId && oldChildGroupIds.set(item.childGroupId, true);\n });\n // traverse newDiffItems and decide the direction according to the rule\n for (var i = 0; i < newDiffItems.length; i++) {\n var newGroupId = newDiffItems[i].groupId;\n if (oldChildGroupIds.get(newGroupId)) {\n direction = TRANSITION_P2C;\n break;\n }\n var newChildGroupId = newDiffItems[i].childGroupId;\n if (newChildGroupId && oldGroupIds.get(newChildGroupId)) {\n direction = TRANSITION_C2P;\n break;\n }\n }\n function createKeyGetter(isOld, onlyGetId) {\n return function (diffItem) {\n var data = diffItem.data;\n var dataIndex = diffItem.dataIndex;\n // TODO if specified dim\n if (onlyGetId) {\n return data.getId(dataIndex);\n }\n if (isOld) {\n return direction === TRANSITION_P2C ? diffItem.childGroupId : diffItem.groupId;\n } else {\n return direction === TRANSITION_C2P ? diffItem.childGroupId : diffItem.groupId;\n }\n };\n }\n // Use id if it's very likely to be an one to one animation\n // It's more robust than groupId\n // TODO Check if key dimension is specified.\n var useId = isAllIdSame(oldDiffItems, newDiffItems);\n var isElementStillInChart = {};\n if (!useId) {\n // We may have different diff strategy with basicTransition if we use other dimension as key.\n // If so, we can't simply check if oldEl is same with newEl. We need a map to check if oldEl is still being used in the new chart.\n // We can't use the elements that already being morphed. Let it keep it's original basic transition.\n for (var i = 0; i < newDiffItems.length; i++) {\n var newItem = newDiffItems[i];\n var el = newItem.data.getItemGraphicEl(newItem.dataIndex);\n if (el) {\n isElementStillInChart[el.id] = true;\n }\n }\n }\n function updateOneToOne(newIndex, oldIndex) {\n var oldItem = oldDiffItems[oldIndex];\n var newItem = newDiffItems[newIndex];\n var newSeries = newItem.data.hostModel;\n // TODO Mark this elements is morphed and don't morph them anymore\n var oldEl = oldItem.data.getItemGraphicEl(oldItem.dataIndex);\n var newEl = newItem.data.getItemGraphicEl(newItem.dataIndex);\n // Can't handle same elements.\n if (oldEl === newEl) {\n newEl && animateElementStyles(newEl, newItem.dataIndex, newSeries);\n return;\n }\n if (\n // We can't use the elements that already being morphed\n oldEl && isElementStillInChart[oldEl.id]) {\n return;\n }\n if (newEl) {\n // TODO: If keep animating the group in case\n // some of the elements don't want to be morphed.\n // TODO Label?\n stopAnimation(newEl);\n if (oldEl) {\n stopAnimation(oldEl);\n // If old element is doing leaving animation. stop it and remove it immediately.\n removeEl(oldEl);\n hasMorphAnimation = true;\n applyMorphAnimation(getPathList(oldEl), getPathList(newEl), newItem.divide, newSeries, newIndex, updateMorphingPathProps);\n } else {\n fadeInElement(newEl, newSeries, newIndex);\n }\n }\n // else keep oldEl leaving animation.\n }\n new DataDiffer(oldDiffItems, newDiffItems, createKeyGetter(true, useId), createKeyGetter(false, useId), null, 'multiple').update(updateOneToOne).updateManyToOne(function (newIndex, oldIndices) {\n var newItem = newDiffItems[newIndex];\n var newData = newItem.data;\n var newSeries = newData.hostModel;\n var newEl = newData.getItemGraphicEl(newItem.dataIndex);\n var oldElsList = filter(map(oldIndices, function (idx) {\n return oldDiffItems[idx].data.getItemGraphicEl(oldDiffItems[idx].dataIndex);\n }), function (oldEl) {\n return oldEl && oldEl !== newEl && !isElementStillInChart[oldEl.id];\n });\n if (newEl) {\n stopAnimation(newEl);\n if (oldElsList.length) {\n // If old element is doing leaving animation. stop it and remove it immediately.\n each(oldElsList, function (oldEl) {\n stopAnimation(oldEl);\n removeEl(oldEl);\n });\n hasMorphAnimation = true;\n applyMorphAnimation(getPathList(oldElsList), getPathList(newEl), newItem.divide, newSeries, newIndex, updateMorphingPathProps);\n } else {\n fadeInElement(newEl, newSeries, newItem.dataIndex);\n }\n }\n // else keep oldEl leaving animation.\n }).updateOneToMany(function (newIndices, oldIndex) {\n var oldItem = oldDiffItems[oldIndex];\n var oldEl = oldItem.data.getItemGraphicEl(oldItem.dataIndex);\n // We can't use the elements that already being morphed\n if (oldEl && isElementStillInChart[oldEl.id]) {\n return;\n }\n var newElsList = filter(map(newIndices, function (idx) {\n return newDiffItems[idx].data.getItemGraphicEl(newDiffItems[idx].dataIndex);\n }), function (el) {\n return el && el !== oldEl;\n });\n var newSeris = newDiffItems[newIndices[0]].data.hostModel;\n if (newElsList.length) {\n each(newElsList, function (newEl) {\n return stopAnimation(newEl);\n });\n if (oldEl) {\n stopAnimation(oldEl);\n // If old element is doing leaving animation. stop it and remove it immediately.\n removeEl(oldEl);\n hasMorphAnimation = true;\n applyMorphAnimation(getPathList(oldEl), getPathList(newElsList), oldItem.divide,\n // Use divide on old.\n newSeris, newIndices[0], updateMorphingPathProps);\n } else {\n each(newElsList, function (newEl) {\n return fadeInElement(newEl, newSeris, newIndices[0]);\n });\n }\n }\n // else keep oldEl leaving animation.\n }).updateManyToMany(function (newIndices, oldIndices) {\n // If two data are same and both have groupId.\n // Normally they should be diff by id.\n new DataDiffer(oldIndices, newIndices, function (rawIdx) {\n return oldDiffItems[rawIdx].data.getId(oldDiffItems[rawIdx].dataIndex);\n }, function (rawIdx) {\n return newDiffItems[rawIdx].data.getId(newDiffItems[rawIdx].dataIndex);\n }).update(function (newIndex, oldIndex) {\n // Use the original index\n updateOneToOne(newIndices[newIndex], oldIndices[oldIndex]);\n }).execute();\n }).execute();\n if (hasMorphAnimation) {\n each(newList, function (_a) {\n var data = _a.data;\n var seriesModel = data.hostModel;\n var view = seriesModel && api.getViewOfSeriesModel(seriesModel);\n var animationCfg = getAnimationConfig('update', seriesModel, 0); // use 0 index.\n if (view && seriesModel.isAnimationEnabled() && animationCfg && animationCfg.duration > 0) {\n view.group.traverse(function (el) {\n if (el instanceof Path && !el.animators.length) {\n // We can't accept there still exists element that has no animation\n // if universalTransition is enabled\n el.animateFrom({\n style: {\n opacity: 0\n }\n }, animationCfg);\n }\n });\n }\n });\n }\n}\nfunction getSeriesTransitionKey(series) {\n var seriesKey = series.getModel('universalTransition').get('seriesKey');\n if (!seriesKey) {\n // Use series id by default.\n return series.id;\n }\n return seriesKey;\n}\nfunction convertArraySeriesKeyToString(seriesKey) {\n if (isArray(seriesKey)) {\n // Order independent.\n return seriesKey.sort().join(',');\n }\n return seriesKey;\n}\nfunction getDivideShapeFromData(data) {\n if (data.hostModel) {\n return data.hostModel.getModel('universalTransition').get('divideShape');\n }\n}\nfunction findTransitionSeriesBatches(globalStore, params) {\n var updateBatches = createHashMap();\n var oldDataMap = createHashMap();\n // Map that only store key in array seriesKey.\n // Which is used to query the old data when transition from one to multiple series.\n var oldDataMapForSplit = createHashMap();\n each(globalStore.oldSeries, function (series, idx) {\n var oldDataGroupId = globalStore.oldDataGroupIds[idx];\n var oldData = globalStore.oldData[idx];\n var transitionKey = getSeriesTransitionKey(series);\n var transitionKeyStr = convertArraySeriesKeyToString(transitionKey);\n oldDataMap.set(transitionKeyStr, {\n dataGroupId: oldDataGroupId,\n data: oldData\n });\n if (isArray(transitionKey)) {\n // Same key can't in different array seriesKey.\n each(transitionKey, function (key) {\n oldDataMapForSplit.set(key, {\n key: transitionKeyStr,\n dataGroupId: oldDataGroupId,\n data: oldData\n });\n });\n }\n });\n function checkTransitionSeriesKeyDuplicated(transitionKeyStr) {\n if (updateBatches.get(transitionKeyStr)) {\n warn(\"Duplicated seriesKey in universalTransition \" + transitionKeyStr);\n }\n }\n each(params.updatedSeries, function (series) {\n if (series.isUniversalTransitionEnabled() && series.isAnimationEnabled()) {\n var newDataGroupId = series.get('dataGroupId');\n var newData = series.getData();\n var transitionKey = getSeriesTransitionKey(series);\n var transitionKeyStr = convertArraySeriesKeyToString(transitionKey);\n // Only transition between series with same id.\n var oldData = oldDataMap.get(transitionKeyStr);\n // string transition key is the best match.\n if (oldData) {\n if (process.env.NODE_ENV !== 'production') {\n checkTransitionSeriesKeyDuplicated(transitionKeyStr);\n }\n // TODO check if data is same?\n updateBatches.set(transitionKeyStr, {\n oldSeries: [{\n dataGroupId: oldData.dataGroupId,\n divide: getDivideShapeFromData(oldData.data),\n data: oldData.data\n }],\n newSeries: [{\n dataGroupId: newDataGroupId,\n divide: getDivideShapeFromData(newData),\n data: newData\n }]\n });\n } else {\n // Transition from multiple series.\n // e.g. 'female', 'male' -> ['female', 'male']\n if (isArray(transitionKey)) {\n if (process.env.NODE_ENV !== 'production') {\n checkTransitionSeriesKeyDuplicated(transitionKeyStr);\n }\n var oldSeries_1 = [];\n each(transitionKey, function (key) {\n var oldData = oldDataMap.get(key);\n if (oldData.data) {\n oldSeries_1.push({\n dataGroupId: oldData.dataGroupId,\n divide: getDivideShapeFromData(oldData.data),\n data: oldData.data\n });\n }\n });\n if (oldSeries_1.length) {\n updateBatches.set(transitionKeyStr, {\n oldSeries: oldSeries_1,\n newSeries: [{\n dataGroupId: newDataGroupId,\n data: newData,\n divide: getDivideShapeFromData(newData)\n }]\n });\n }\n } else {\n // Try transition to multiple series.\n // e.g. ['female', 'male'] -> 'female', 'male'\n var oldData_1 = oldDataMapForSplit.get(transitionKey);\n if (oldData_1) {\n var batch = updateBatches.get(oldData_1.key);\n if (!batch) {\n batch = {\n oldSeries: [{\n dataGroupId: oldData_1.dataGroupId,\n data: oldData_1.data,\n divide: getDivideShapeFromData(oldData_1.data)\n }],\n newSeries: []\n };\n updateBatches.set(oldData_1.key, batch);\n }\n batch.newSeries.push({\n dataGroupId: newDataGroupId,\n data: newData,\n divide: getDivideShapeFromData(newData)\n });\n }\n }\n }\n }\n });\n return updateBatches;\n}\nfunction querySeries(series, finder) {\n for (var i = 0; i < series.length; i++) {\n var found = finder.seriesIndex != null && finder.seriesIndex === series[i].seriesIndex || finder.seriesId != null && finder.seriesId === series[i].id;\n if (found) {\n return i;\n }\n }\n}\nfunction transitionSeriesFromOpt(transitionOpt, globalStore, params, api) {\n var from = [];\n var to = [];\n each(normalizeToArray(transitionOpt.from), function (finder) {\n var idx = querySeries(globalStore.oldSeries, finder);\n if (idx >= 0) {\n from.push({\n dataGroupId: globalStore.oldDataGroupIds[idx],\n data: globalStore.oldData[idx],\n // TODO can specify divideShape in transition.\n divide: getDivideShapeFromData(globalStore.oldData[idx]),\n groupIdDim: finder.dimension\n });\n }\n });\n each(normalizeToArray(transitionOpt.to), function (finder) {\n var idx = querySeries(params.updatedSeries, finder);\n if (idx >= 0) {\n var data = params.updatedSeries[idx].getData();\n to.push({\n dataGroupId: globalStore.oldDataGroupIds[idx],\n data: data,\n divide: getDivideShapeFromData(data),\n groupIdDim: finder.dimension\n });\n }\n });\n if (from.length > 0 && to.length > 0) {\n transitionBetween(from, to, api);\n }\n}\nexport function installUniversalTransition(registers) {\n registers.registerUpdateLifecycle('series:beforeupdate', function (ecMOdel, api, params) {\n each(normalizeToArray(params.seriesTransition), function (transOpt) {\n each(normalizeToArray(transOpt.to), function (finder) {\n var series = params.updatedSeries;\n for (var i = 0; i < series.length; i++) {\n if (finder.seriesIndex != null && finder.seriesIndex === series[i].seriesIndex || finder.seriesId != null && finder.seriesId === series[i].id) {\n series[i][SERIES_UNIVERSAL_TRANSITION_PROP] = true;\n }\n }\n });\n });\n });\n registers.registerUpdateLifecycle('series:transition', function (ecModel, api, params) {\n // TODO api provide an namespace that can save stuff per instance\n var globalStore = getUniversalTransitionGlobalStore(api);\n // TODO multiple to multiple series.\n if (globalStore.oldSeries && params.updatedSeries && params.optionChanged) {\n // TODO transitionOpt was used in an old implementation and can be removed now\n // Use give transition config if its' give;\n var transitionOpt = params.seriesTransition;\n if (transitionOpt) {\n each(normalizeToArray(transitionOpt), function (opt) {\n transitionSeriesFromOpt(opt, globalStore, params, api);\n });\n } else {\n // Else guess from series based on transition series key.\n var updateBatches_1 = findTransitionSeriesBatches(globalStore, params);\n each(updateBatches_1.keys(), function (key) {\n var batch = updateBatches_1.get(key);\n transitionBetween(batch.oldSeries, batch.newSeries, api);\n });\n }\n // Reset\n each(params.updatedSeries, function (series) {\n // Reset;\n if (series[SERIES_UNIVERSAL_TRANSITION_PROP]) {\n series[SERIES_UNIVERSAL_TRANSITION_PROP] = false;\n }\n });\n }\n // Save all series of current update. Not only the updated one.\n var allSeries = ecModel.getSeries();\n var savedSeries = globalStore.oldSeries = [];\n var savedDataGroupIds = globalStore.oldDataGroupIds = [];\n var savedData = globalStore.oldData = [];\n for (var i = 0; i < allSeries.length; i++) {\n var data = allSeries[i].getData();\n // Only save the data that can have transition.\n // Avoid large data costing too much extra memory\n if (data.count() < DATA_COUNT_THRESHOLD) {\n savedSeries.push(allSeries[i]);\n savedDataGroupIds.push(allSeries[i].get('dataGroupId'));\n savedData.push(data);\n }\n }\n });\n}"],"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;AACA,SAASA,gCAAgC,QAAQ,oBAAoB;AACrE,SAASC,aAAa,EAAEC,IAAI,EAAEC,GAAG,EAAEC,MAAM,EAAEC,OAAO,EAAEC,MAAM,QAAQ,0BAA0B;AAC5F,SAASC,mBAAmB,EAAEC,WAAW,QAAQ,4BAA4B;AAC7E,OAAOC,IAAI,MAAM,6BAA6B;AAC9C,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,OAAOC,UAAU,MAAM,uBAAuB;AAC9C,SAASC,SAAS,EAAEC,gBAAgB,QAAQ,kBAAkB;AAC9D,SAASC,IAAI,QAAQ,gBAAgB;AACrC,SAASC,kBAAkB,EAAEC,WAAW,QAAQ,sBAAsB;AACtE,OAAOC,WAAW,MAAM,oCAAoC;AAC5D,IAAIC,oBAAoB,GAAG,GAAG;AAC9B,IAAIC,eAAe,GAAG,CAAC;AACvB,IAAIC,cAAc,GAAG,CAAC;AACtB,IAAIC,cAAc,GAAG,CAAC;AACtB;AACA,IAAIC,iCAAiC,GAAGV,SAAS,CAAC,CAAC;AACnD,SAASW,YAAYA,CAACC,IAAI,EAAEC,eAAe,EAAE;EAC3C,IAAIC,UAAU,GAAGF,IAAI,CAACE,UAAU;EAChC,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAA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