MCPcopy
hub / github.com/chartjs/Chart.js / _animateOptions

Method _animateOptions

src/core/core.animations.js:43–63  ·  view source on GitHub ↗

* Utility to handle animation of `options`. * @private

(target, values)

Source from the content-addressed store, hash-verified

41 * @private
42 */
43 _animateOptions(target, values) {
44 const newOptions = values.options;
45 const options = resolveTargetOptions(target, newOptions);
46 if (!options) {
47 return [];
48 }
49
50 const animations = this._createAnimations(options, newOptions);
51 if (newOptions.$shared) {
52 // Going to shared options:
53 // After all animations are done, assign the shared options object to the element
54 // So any new updates to the shared options are observed
55 awaitAll(target.options.$animations, newOptions).then(() => {
56 target.options = newOptions;
57 }, () => {
58 // rejected, noop
59 });
60 }
61
62 return animations;
63 }
64
65 /**
66 * @private

Callers 1

_createAnimationsMethod · 0.95

Calls 3

_createAnimationsMethod · 0.95
resolveTargetOptionsFunction · 0.85
awaitAllFunction · 0.85

Tested by

no test coverage detected