(animationType, el, props, animatableModel, dataIndex, cb, during)
| 14324 | var subPixelOptimize$1 = subPixelOptimize; |
| 14325 | |
| 14326 | function animateOrSetProps(animationType, el, props, animatableModel, dataIndex, cb, during) { |
| 14327 | var isFrom = false; |
| 14328 | var removeOpt; |
| 14329 | |
| 14330 | if (typeof dataIndex === 'function') { |
| 14331 | during = cb; |
| 14332 | cb = dataIndex; |
| 14333 | dataIndex = null; |
| 14334 | } else if (isObject(dataIndex)) { |
| 14335 | cb = dataIndex.cb; |
| 14336 | during = dataIndex.during; |
| 14337 | isFrom = dataIndex.isFrom; |
| 14338 | removeOpt = dataIndex.removeOpt; |
| 14339 | dataIndex = dataIndex.dataIndex; |
| 14340 | } |
| 14341 | |
| 14342 | var isUpdate = animationType === 'update'; |
| 14343 | var isRemove = animationType === 'remove'; |
| 14344 | var animationPayload; // Check if there is global animation configuration from dataZoom/resize can override the config in option. |
| 14345 | // If animation is enabled. Will use this animation config in payload. |
| 14346 | // If animation is disabled. Just ignore it. |
| 14347 | |
| 14348 | if (animatableModel && animatableModel.ecModel) { |
| 14349 | var updatePayload = animatableModel.ecModel.getUpdatePayload(); |
| 14350 | animationPayload = updatePayload && updatePayload.animation; |
| 14351 | } |
| 14352 | |
| 14353 | var animationEnabled = animatableModel && animatableModel.isAnimationEnabled(); |
| 14354 | |
| 14355 | if (!isRemove) { |
| 14356 | // Must stop the remove animation. |
| 14357 | el.stopAnimation('remove'); |
| 14358 | } |
| 14359 | |
| 14360 | if (animationEnabled) { |
| 14361 | var duration = void 0; |
| 14362 | var animationEasing = void 0; |
| 14363 | var animationDelay = void 0; |
| 14364 | |
| 14365 | if (animationPayload) { |
| 14366 | duration = animationPayload.duration || 0; |
| 14367 | animationEasing = animationPayload.easing || 'cubicOut'; |
| 14368 | animationDelay = animationPayload.delay || 0; |
| 14369 | } else if (isRemove) { |
| 14370 | removeOpt = removeOpt || {}; |
| 14371 | duration = retrieve2(removeOpt.duration, 200); |
| 14372 | animationEasing = retrieve2(removeOpt.easing, 'cubicOut'); |
| 14373 | animationDelay = 0; |
| 14374 | } else { |
| 14375 | duration = animatableModel.getShallow(isUpdate ? 'animationDurationUpdate' : 'animationDuration'); |
| 14376 | animationEasing = animatableModel.getShallow(isUpdate ? 'animationEasingUpdate' : 'animationEasing'); |
| 14377 | animationDelay = animatableModel.getShallow(isUpdate ? 'animationDelayUpdate' : 'animationDelay'); |
| 14378 | } |
| 14379 | |
| 14380 | if (typeof animationDelay === 'function') { |
| 14381 | animationDelay = animationDelay(dataIndex, animatableModel.getAnimationDelayParams ? animatableModel.getAnimationDelayParams(el, dataIndex) : null); |
| 14382 | } |
| 14383 |
no test coverage detected
searching dependent graphs…