MCPcopy Create free account
hub / github.com/chartjs/Chart.js / applyAnimationsDefaults

Function applyAnimationsDefaults

src/core/core.animations.defaults.js:4–72  ·  view source on GitHub ↗
(defaults)

Source from the content-addressed store, hash-verified

2const colors = ['color', 'borderColor', 'backgroundColor'];
3
4export function applyAnimationsDefaults(defaults) {
5 defaults.set('animation', {
6 delay: undefined,
7 duration: 1000,
8 easing: 'easeOutQuart',
9 fn: undefined,
10 from: undefined,
11 loop: undefined,
12 to: undefined,
13 type: undefined,
14 });
15
16 defaults.describe('animation', {
17 _fallback: false,
18 _indexable: false,
19 _scriptable: (name) => name !== 'onProgress' && name !== 'onComplete' && name !== 'fn',
20 });
21
22 defaults.set('animations', {
23 colors: {
24 type: 'color',
25 properties: colors
26 },
27 numbers: {
28 type: 'number',
29 properties: numbers
30 },
31 });
32
33 defaults.describe('animations', {
34 _fallback: 'animation',
35 });
36
37 defaults.set('transitions', {
38 active: {
39 animation: {
40 duration: 400
41 }
42 },
43 resize: {
44 animation: {
45 duration: 0
46 }
47 },
48 show: {
49 animations: {
50 colors: {
51 from: 'transparent'
52 },
53 visible: {
54 type: 'boolean',
55 duration: 0 // show immediately
56 },
57 }
58 },
59 hide: {
60 animations: {
61 colors: {

Callers

nothing calls this directly

Calls 2

setMethod · 0.65
describeMethod · 0.65

Tested by

no test coverage detected