* @private
(index, transition, active)
| 839 | * @private |
| 840 | */ |
| 841 | _resolveAnimations(index, transition, active) { |
| 842 | const chart = this.chart; |
| 843 | const cache = this._cachedDataOpts; |
| 844 | const cacheKey = `animation-${transition}`; |
| 845 | const cached = cache[cacheKey]; |
| 846 | if (cached) { |
| 847 | return cached; |
| 848 | } |
| 849 | let options; |
| 850 | if (chart.options.animation !== false) { |
| 851 | const config = this.chart.config; |
| 852 | const scopeKeys = config.datasetAnimationScopeKeys(this._type, transition); |
| 853 | const scopes = config.getOptionScopes(this.getDataset(), scopeKeys); |
| 854 | options = config.createResolver(scopes, this.getContext(index, active, transition)); |
| 855 | } |
| 856 | const animations = new Animations(chart, options && options.animations); |
| 857 | if (options && options._cacheable) { |
| 858 | cache[cacheKey] = Object.freeze(animations); |
| 859 | } |
| 860 | return animations; |
| 861 | } |
| 862 | |
| 863 | /** |
| 864 | * Utility for getting the options object shared between elements |
no test coverage detected