1 line
65 KiB
JSON
1 line
65 KiB
JSON
{"ast":null,"code":"import \"core-js/modules/es.function.name.js\";\nimport \"core-js/modules/es.array.join.js\";\nimport \"core-js/modules/es.array.sort.js\";\nimport \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/web.dom-collections.iterator.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*/\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;\n;\nvar getUniversalTransitionGlobalStore = makeInner();\n\nfunction getGroupIdDimension(data) {\n var dimensions = data.dimensions;\n\n for (var i = 0; i < dimensions.length; i++) {\n var dimInfo = data.getDimensionInfo(dimensions[i]);\n\n if (dimInfo && dimInfo.otherDims.itemGroupId === 0) {\n return dimensions[i];\n }\n }\n}\n\nfunction flattenDataDiffItems(list) {\n var items = [];\n each(list, function (seriesInfo) {\n var data = seriesInfo.data;\n\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\n return;\n }\n\n var indices = data.getIndices();\n var groupDim = getGroupIdDimension(data);\n\n for (var dataIndex = 0; dataIndex < indices.length; dataIndex++) {\n items.push({\n dataGroupId: seriesInfo.dataGroupId,\n data: data,\n dim: seriesInfo.dim || groupDim,\n divide: seriesInfo.divide,\n dataIndex: dataIndex\n });\n }\n });\n return items;\n}\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}\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}\n\nfunction stopAnimation(el) {\n el.stopAnimation();\n\n if (el.isGroup) {\n el.traverse(function (child) {\n child.stopAnimation();\n });\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\n if (oldStyle) {\n child.animateFrom({\n style: oldStyle\n }, animationConfig);\n }\n }\n });\n}\n\nfunction isAllIdSame(oldDiffItems, newDiffItems) {\n var len = oldDiffItems.length;\n\n if (len !== newDiffItems.length) {\n return false;\n }\n\n for (var i = 0; i < len; i++) {\n var oldItem = oldDiffItems[i];\n var newItem = newDiffItems[i];\n\n if (oldItem.data.getId(oldItem.dataIndex) !== newItem.data.getId(newItem.dataIndex)) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction transitionBetween(oldList, newList, api) {\n var oldDiffItems = flattenDataDiffItems(oldList);\n var newDiffItems = flattenDataDiffItems(newList);\n\n function updateMorphingPathProps(from, to, rawFrom, rawTo, animationCfg) {\n if (rawFrom || from) {\n to.animateFrom({\n style: rawFrom && rawFrom !== from ? // 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\n function findKeyDim(items) {\n for (var i = 0; i < items.length; i++) {\n if (items[i].dim) {\n return items[i].dim;\n }\n }\n }\n\n var oldKeyDim = findKeyDim(oldDiffItems);\n var newKeyDim = findKeyDim(newDiffItems);\n var hasMorphAnimation = false;\n\n function createKeyGetter(isOld, onlyGetId) {\n return function (diffItem) {\n var data = diffItem.data;\n var dataIndex = diffItem.dataIndex; // TODO if specified dim\n\n if (onlyGetId) {\n return data.getId(dataIndex);\n } // Use group id as transition key by default.\n // So we can achieve multiple to multiple animation like drilldown / up naturally.\n // If group id not exits. Use id instead. If so, only one to one transition will be applied.\n\n\n var dataGroupId = diffItem.dataGroupId; // If specified key dimension(itemGroupId by default). Use this same dimension from other data.\n // PENDING: If only use key dimension of newData.\n\n var keyDim = isOld ? oldKeyDim || newKeyDim : newKeyDim || oldKeyDim;\n var dimInfo = keyDim && data.getDimensionInfo(keyDim);\n var dimOrdinalMeta = dimInfo && dimInfo.ordinalMeta;\n\n if (dimInfo) {\n // Get from encode.itemGroupId.\n var key = data.get(dimInfo.name, dataIndex);\n\n if (dimOrdinalMeta) {\n return dimOrdinalMeta.categories[key] || key + '';\n }\n\n return key + '';\n } // Get groupId from raw item. { groupId: '' }\n\n\n var itemVal = data.getRawDataItem(dataIndex);\n\n if (itemVal && itemVal.groupId) {\n return itemVal.groupId + '';\n }\n\n return dataGroupId || data.getId(dataIndex);\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\n\n var useId = isAllIdSame(oldDiffItems, newDiffItems);\n var isElementStillInChart = {};\n\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\n if (el) {\n isElementStillInChart[el.id] = true;\n }\n }\n }\n\n function updateOneToOne(newIndex, oldIndex) {\n var oldItem = oldDiffItems[oldIndex];\n var newItem = newDiffItems[newIndex];\n var newSeries = newItem.data.hostModel; // TODO Mark this elements is morphed and don't morph them anymore\n\n var oldEl = oldItem.data.getItemGraphicEl(oldItem.dataIndex);\n var newEl = newItem.data.getItemGraphicEl(newItem.dataIndex); // Can't handle same elements.\n\n if (oldEl === newEl) {\n newEl && animateElementStyles(newEl, newItem.dataIndex, newSeries);\n return;\n }\n\n if ( // We can't use the elements that already being morphed\n oldEl && isElementStillInChart[oldEl.id]) {\n return;\n }\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\n if (oldEl) {\n stopAnimation(oldEl); // If old element is doing leaving animation. stop it and remove it immediately.\n\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 } // else keep oldEl leaving animation.\n\n }\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\n if (newEl) {\n stopAnimation(newEl);\n\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 } // else keep oldEl leaving animation.\n\n }).updateOneToMany(function (newIndices, oldIndex) {\n var oldItem = oldDiffItems[oldIndex];\n var oldEl = oldItem.data.getItemGraphicEl(oldItem.dataIndex); // We can't use the elements that already being morphed\n\n if (oldEl && isElementStillInChart[oldEl.id]) {\n return;\n }\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\n if (newElsList.length) {\n each(newElsList, function (newEl) {\n return stopAnimation(newEl);\n });\n\n if (oldEl) {\n stopAnimation(oldEl); // If old element is doing leaving animation. stop it and remove it immediately.\n\n removeEl(oldEl);\n hasMorphAnimation = true;\n applyMorphAnimation(getPathList(oldEl), getPathList(newElsList), oldItem.divide, // 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 } // else keep oldEl leaving animation.\n\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\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\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}\n\nfunction getSeriesTransitionKey(series) {\n var seriesKey = series.getModel('universalTransition').get('seriesKey');\n\n if (!seriesKey) {\n // Use series id by default.\n return series.id;\n }\n\n return seriesKey;\n}\n\nfunction convertArraySeriesKeyToString(seriesKey) {\n if (isArray(seriesKey)) {\n // Order independent.\n return seriesKey.sort().join(',');\n }\n\n return seriesKey;\n}\n\nfunction getDivideShapeFromData(data) {\n if (data.hostModel) {\n return data.hostModel.getModel('universalTransition').get('divideShape');\n }\n}\n\nfunction findTransitionSeriesBatches(globalStore, params) {\n var updateBatches = createHashMap();\n var oldDataMap = createHashMap(); // 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\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\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\n function checkTransitionSeriesKeyDuplicated(transitionKeyStr) {\n if (updateBatches.get(transitionKeyStr)) {\n warn(\"Duplicated seriesKey in universalTransition \" + transitionKeyStr);\n }\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); // Only transition between series with same id.\n\n var oldData = oldDataMap.get(transitionKeyStr); // string transition key is the best match.\n\n if (oldData) {\n if (process.env.NODE_ENV !== 'production') {\n checkTransitionSeriesKeyDuplicated(transitionKeyStr);\n } // TODO check if data is same?\n\n\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 if (isArray(transitionKey)) {\n if (process.env.NODE_ENV !== 'production') {\n checkTransitionSeriesKeyDuplicated(transitionKeyStr);\n }\n\n var oldSeries_1 = [];\n each(transitionKey, function (key) {\n var oldData = oldDataMap.get(key);\n\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\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 var oldData_1 = oldDataMapForSplit.get(transitionKey);\n\n if (oldData_1) {\n var batch = updateBatches.get(oldData_1.key);\n\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\n batch.newSeries.push({\n dataGroupId: newDataGroupId,\n data: newData,\n divide: getDivideShapeFromData(newData)\n });\n }\n }\n }\n }\n });\n return updateBatches;\n}\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\n if (found) {\n return i;\n }\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\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 dim: finder.dimension\n });\n }\n });\n each(normalizeToArray(transitionOpt.to), function (finder) {\n var idx = querySeries(params.updatedSeries, finder);\n\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 dim: finder.dimension\n });\n }\n });\n\n if (from.length > 0 && to.length > 0) {\n transitionBetween(from, to, api);\n }\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\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); // TODO multiple to multiple series.\n\n if (globalStore.oldSeries && params.updatedSeries && params.optionChanged) {\n // Use give transition config if its' give;\n var transitionOpt = params.seriesTransition;\n\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 } // Reset\n\n\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 } // Save all series of current update. Not only the updated one.\n\n\n var allSeries = ecModel.getSeries();\n var savedSeries = globalStore.oldSeries = [];\n var savedDataGroupIds = globalStore.oldDataGroupIds = [];\n var savedData = globalStore.oldData = [];\n\n for (var i = 0; i < allSeries.length; i++) {\n var data = allSeries[i].getData(); // Only save the data that can have transition.\n // Avoid large data costing too much extra memory\n\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,"sources":["D:/Work/WorkSpace/GitWorkSpace/TenShop/resource/ElectronicMall/src/ElectronicMallVue/node_modules/echarts/lib/animation/universalTransition.js"],"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","getUniversalTransitionGlobalStore","getGroupIdDimension","data","dimensions","i","length","dimInfo","getDimensionInfo","otherDims","itemGroupId","flattenDataDiffItems","list","items","seriesInfo","count","process","env","NODE_ENV","indices","getIndices","groupDim","dataIndex","push","dataGroupId","dim","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","getId","transitionBetween","oldList","newList","api","updateMorphingPathProps","from","to","rawFrom","rawTo","animationCfg","findKeyDim","oldKeyDim","newKeyDim","hasMorphAnimation","createKeyGetter","isOld","onlyGetId","diffItem","keyDim","dimOrdinalMeta","ordinalMeta","key","get","name","categories","itemVal","getRawDataItem","groupId","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","set","checkTransitionSeriesKeyDuplicated","updatedSeries","isUniversalTransitionEnabled","newDataGroupId","getData","oldSeries_1","oldData_1","batch","querySeries","finder","found","seriesIndex","seriesId","transitionSeriesFromOpt","transitionOpt","dimension","installUniversalTransition","registers","registerUpdateLifecycle","ecMOdel","seriesTransition","transOpt","ecModel","optionChanged","opt","updateBatches_1","keys","allSeries","getSeries","savedSeries","savedDataGroupIds","savedData"],"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,gCAAT,QAAiD,oBAAjD;AACA,SAASC,aAAT,EAAwBC,IAAxB,EAA8BC,GAA9B,EAAmCC,MAAnC,EAA2CC,OAA3C,EAAoDC,MAApD,QAAkE,0BAAlE;AACA,SAASC,mBAAT,EAA8BC,WAA9B,QAAiD,4BAAjD;AACA,OAAOC,IAAP,MAAiB,6BAAjB;AACA,SAASC,SAAT,QAA0B,oBAA1B;AACA,OAAOC,UAAP,MAAuB,uBAAvB;AACA,SAASC,SAAT,EAAoBC,gBAApB,QAA4C,kBAA5C;AACA,SAASC,IAAT,QAAqB,gBAArB;AACA,SAASC,kBAAT,EAA6BC,WAA7B,QAAgD,sBAAhD;AACA,OAAOC,WAAP,MAAwB,oCAAxB;AACA,IAAIC,oBAAoB,GAAG,GAA3B;AACA;AACA,IAAIC,iCAAiC,GAAGP,SAAS,EAAjD;;AAEA,SAASQ,mBAAT,CAA6BC,IAA7B,EAAmC;AACjC,MAAIC,UAAU,GAAGD,IAAI,CAACC,UAAtB;;AAEA,OAAK,IAAIC,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAGD,UAAU,CAACE,MAA/B,EAAuCD,CAAC,EAAxC,EAA4C;AAC1C,QAAIE,OAAO,GAAGJ,IAAI,CAACK,gBAAL,CAAsBJ,UAAU,CAACC,CAAD,CAAhC,CAAd;;AAEA,QAAIE,OAAO,IAAIA,OAAO,CAACE,SAAR,CAAkBC,WAAlB,KAAkC,CAAjD,EAAoD;AAClD,aAAON,UAAU,CAACC,CAAD,CAAjB;AACD;AACF;AACF;;AAED,SAASM,oBAAT,CA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jB,CAAvB;AACAsF,QAAAA,SAAS,CAAC9I,IAAV,CAAepB,IAAf;AACD;AACF;AACF,GA9CD;AA+CD","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*/\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;\n;\nvar getUniversalTransitionGlobalStore = makeInner();\n\nfunction getGroupIdDimension(data) {\n var dimensions = data.dimensions;\n\n for (var i = 0; i < dimensions.length; i++) {\n var dimInfo = data.getDimensionInfo(dimensions[i]);\n\n if (dimInfo && dimInfo.otherDims.itemGroupId === 0) {\n return dimensions[i];\n }\n }\n}\n\nfunction flattenDataDiffItems(list) {\n var items = [];\n each(list, function (seriesInfo) {\n var data = seriesInfo.data;\n\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\n return;\n }\n\n var indices = data.getIndices();\n var groupDim = getGroupIdDimension(data);\n\n for (var dataIndex = 0; dataIndex < indices.length; dataIndex++) {\n items.push({\n dataGroupId: seriesInfo.dataGroupId,\n data: data,\n dim: seriesInfo.dim || groupDim,\n divide: seriesInfo.divide,\n dataIndex: dataIndex\n });\n }\n });\n return items;\n}\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}\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}\n\nfunction stopAnimation(el) {\n el.stopAnimation();\n\n if (el.isGroup) {\n el.traverse(function (child) {\n child.stopAnimation();\n });\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\n if (oldStyle) {\n child.animateFrom({\n style: oldStyle\n }, animationConfig);\n }\n }\n });\n}\n\nfunction isAllIdSame(oldDiffItems, newDiffItems) {\n var len = oldDiffItems.length;\n\n if (len !== newDiffItems.length) {\n return false;\n }\n\n for (var i = 0; i < len; i++) {\n var oldItem = oldDiffItems[i];\n var newItem = newDiffItems[i];\n\n if (oldItem.data.getId(oldItem.dataIndex) !== newItem.data.getId(newItem.dataIndex)) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction transitionBetween(oldList, newList, api) {\n var oldDiffItems = flattenDataDiffItems(oldList);\n var newDiffItems = flattenDataDiffItems(newList);\n\n function updateMorphingPathProps(from, to, rawFrom, rawTo, animationCfg) {\n if (rawFrom || from) {\n to.animateFrom({\n style: rawFrom && rawFrom !== from ? // 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\n function findKeyDim(items) {\n for (var i = 0; i < items.length; i++) {\n if (items[i].dim) {\n return items[i].dim;\n }\n }\n }\n\n var oldKeyDim = findKeyDim(oldDiffItems);\n var newKeyDim = findKeyDim(newDiffItems);\n var hasMorphAnimation = false;\n\n function createKeyGetter(isOld, onlyGetId) {\n return function (diffItem) {\n var data = diffItem.data;\n var dataIndex = diffItem.dataIndex; // TODO if specified dim\n\n if (onlyGetId) {\n return data.getId(dataIndex);\n } // Use group id as transition key by default.\n // So we can achieve multiple to multiple animation like drilldown / up naturally.\n // If group id not exits. Use id instead. If so, only one to one transition will be applied.\n\n\n var dataGroupId = diffItem.dataGroupId; // If specified key dimension(itemGroupId by default). Use this same dimension from other data.\n // PENDING: If only use key dimension of newData.\n\n var keyDim = isOld ? oldKeyDim || newKeyDim : newKeyDim || oldKeyDim;\n var dimInfo = keyDim && data.getDimensionInfo(keyDim);\n var dimOrdinalMeta = dimInfo && dimInfo.ordinalMeta;\n\n if (dimInfo) {\n // Get from encode.itemGroupId.\n var key = data.get(dimInfo.name, dataIndex);\n\n if (dimOrdinalMeta) {\n return dimOrdinalMeta.categories[key] || key + '';\n }\n\n return key + '';\n } // Get groupId from raw item. { groupId: '' }\n\n\n var itemVal = data.getRawDataItem(dataIndex);\n\n if (itemVal && itemVal.groupId) {\n return itemVal.groupId + '';\n }\n\n return dataGroupId || data.getId(dataIndex);\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\n\n var useId = isAllIdSame(oldDiffItems, newDiffItems);\n var isElementStillInChart = {};\n\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\n if (el) {\n isElementStillInChart[el.id] = true;\n }\n }\n }\n\n function updateOneToOne(newIndex, oldIndex) {\n var oldItem = oldDiffItems[oldIndex];\n var newItem = newDiffItems[newIndex];\n var newSeries = newItem.data.hostModel; // TODO Mark this elements is morphed and don't morph them anymore\n\n var oldEl = oldItem.data.getItemGraphicEl(oldItem.dataIndex);\n var newEl = newItem.data.getItemGraphicEl(newItem.dataIndex); // Can't handle same elements.\n\n if (oldEl === newEl) {\n newEl && animateElementStyles(newEl, newItem.dataIndex, newSeries);\n return;\n }\n\n if ( // We can't use the elements that already being morphed\n oldEl && isElementStillInChart[oldEl.id]) {\n return;\n }\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\n if (oldEl) {\n stopAnimation(oldEl); // If old element is doing leaving animation. stop it and remove it immediately.\n\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 } // else keep oldEl leaving animation.\n\n }\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\n if (newEl) {\n stopAnimation(newEl);\n\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 } // else keep oldEl leaving animation.\n\n }).updateOneToMany(function (newIndices, oldIndex) {\n var oldItem = oldDiffItems[oldIndex];\n var oldEl = oldItem.data.getItemGraphicEl(oldItem.dataIndex); // We can't use the elements that already being morphed\n\n if (oldEl && isElementStillInChart[oldEl.id]) {\n return;\n }\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\n if (newElsList.length) {\n each(newElsList, function (newEl) {\n return stopAnimation(newEl);\n });\n\n if (oldEl) {\n stopAnimation(oldEl); // If old element is doing leaving animation. stop it and remove it immediately.\n\n removeEl(oldEl);\n hasMorphAnimation = true;\n applyMorphAnimation(getPathList(oldEl), getPathList(newElsList), oldItem.divide, // 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 } // else keep oldEl leaving animation.\n\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\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\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}\n\nfunction getSeriesTransitionKey(series) {\n var seriesKey = series.getModel('universalTransition').get('seriesKey');\n\n if (!seriesKey) {\n // Use series id by default.\n return series.id;\n }\n\n return seriesKey;\n}\n\nfunction convertArraySeriesKeyToString(seriesKey) {\n if (isArray(seriesKey)) {\n // Order independent.\n return seriesKey.sort().join(',');\n }\n\n return seriesKey;\n}\n\nfunction getDivideShapeFromData(data) {\n if (data.hostModel) {\n return data.hostModel.getModel('universalTransition').get('divideShape');\n }\n}\n\nfunction findTransitionSeriesBatches(globalStore, params) {\n var updateBatches = createHashMap();\n var oldDataMap = createHashMap(); // 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\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\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\n function checkTransitionSeriesKeyDuplicated(transitionKeyStr) {\n if (updateBatches.get(transitionKeyStr)) {\n warn(\"Duplicated seriesKey in universalTransition \" + transitionKeyStr);\n }\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); // Only transition between series with same id.\n\n var oldData = oldDataMap.get(transitionKeyStr); // string transition key is the best match.\n\n if (oldData) {\n if (process.env.NODE_ENV !== 'production') {\n checkTransitionSeriesKeyDuplicated(transitionKeyStr);\n } // TODO check if data is same?\n\n\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 if (isArray(transitionKey)) {\n if (process.env.NODE_ENV !== 'production') {\n checkTransitionSeriesKeyDuplicated(transitionKeyStr);\n }\n\n var oldSeries_1 = [];\n each(transitionKey, function (key) {\n var oldData = oldDataMap.get(key);\n\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\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 var oldData_1 = oldDataMapForSplit.get(transitionKey);\n\n if (oldData_1) {\n var batch = updateBatches.get(oldData_1.key);\n\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\n batch.newSeries.push({\n dataGroupId: newDataGroupId,\n data: newData,\n divide: getDivideShapeFromData(newData)\n });\n }\n }\n }\n }\n });\n return updateBatches;\n}\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\n if (found) {\n return i;\n }\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\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 dim: finder.dimension\n });\n }\n });\n each(normalizeToArray(transitionOpt.to), function (finder) {\n var idx = querySeries(params.updatedSeries, finder);\n\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 dim: finder.dimension\n });\n }\n });\n\n if (from.length > 0 && to.length > 0) {\n transitionBetween(from, to, api);\n }\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\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); // TODO multiple to multiple series.\n\n if (globalStore.oldSeries && params.updatedSeries && params.optionChanged) {\n // Use give transition config if its' give;\n var transitionOpt = params.seriesTransition;\n\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 } // Reset\n\n\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 } // Save all series of current update. Not only the updated one.\n\n\n var allSeries = ecModel.getSeries();\n var savedSeries = globalStore.oldSeries = [];\n var savedDataGroupIds = globalStore.oldDataGroupIds = [];\n var savedData = globalStore.oldData = [];\n\n for (var i = 0; i < allSeries.length; i++) {\n var data = allSeries[i].getData(); // Only save the data that can have transition.\n // Avoid large data costing too much extra memory\n\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}"]},"metadata":{},"sourceType":"module"} |