(
oldList: TransitionSeries[],
newList: TransitionSeries[],
api: ExtensionAPI
)
| 207 | } |
| 208 | |
| 209 | function transitionBetween( |
| 210 | oldList: TransitionSeries[], |
| 211 | newList: TransitionSeries[], |
| 212 | api: ExtensionAPI |
| 213 | ) { |
| 214 | |
| 215 | const oldDiffItems = flattenDataDiffItems(oldList); |
| 216 | const newDiffItems = flattenDataDiffItems(newList); |
| 217 | |
| 218 | function updateMorphingPathProps( |
| 219 | from: Path, to: Path, |
| 220 | rawFrom: Path, rawTo: Path, |
| 221 | animationCfg: ElementAnimateConfig |
| 222 | ) { |
| 223 | if (rawFrom || from) { |
| 224 | to.animateFrom({ |
| 225 | style: (rawFrom && rawFrom !== from) |
| 226 | // dividingMethod like clone may override the style(opacity) |
| 227 | // So extend it to raw style. |
| 228 | ? extend(extend({}, rawFrom.style), from.style) |
| 229 | : from.style |
| 230 | }, animationCfg); |
| 231 | } |
| 232 | } |
| 233 | |
| 234 | let hasMorphAnimation = false; |
| 235 | |
| 236 | /** |
| 237 | * With groupId and childGroupId, we can build parent-child relationships between dataItems. |
| 238 | * However, we should mind the parent-child "direction" between old and new options. |
| 239 | * |
| 240 | * For example, suppose we have two dataItems from two series.data: |
| 241 | * |
| 242 | * dataA: [ dataB: [ |
| 243 | * { { |
| 244 | * value: 5, value: 3, |
| 245 | * groupId: 'creatures', groupId: 'animals', |
| 246 | * childGroupId: 'animals' childGroupId: 'dogs' |
| 247 | * }, }, |
| 248 | * ... ... |
| 249 | * ] ] |
| 250 | * |
| 251 | * where dataA is belong to optionA and dataB is belong to optionB. |
| 252 | * |
| 253 | * When we `setOption(optionB)` from optionA, we choose childGroupId of dataItemA and groupId of |
| 254 | * dataItemB as keys so the two keys are matched (both are 'animals'), then universalTransition |
| 255 | * will work. This derection is "parent -> child". |
| 256 | * |
| 257 | * If we `setOption(optionA)` from optionB, we also choose groupId of dataItemB and childGroupId |
| 258 | * of dataItemA as keys and universalTransition will work. This derection is "child -> parent". |
| 259 | * |
| 260 | * If there is no childGroupId specified, which means no multiLevelDrillDown/Up is needed and no |
| 261 | * parent-child relationship exists. This direction is "none". |
| 262 | * |
| 263 | * So we need to know whether to use groupId or childGroupId as the key when we call the keyGetter |
| 264 | * functions. Thus, we need to decide the direction first. |
| 265 | * |
| 266 | * The rule is: |
no test coverage detected
searching dependent graphs…