MCPcopy
hub / github.com/apache/echarts / startEffectAnimation

Method startEffectAnimation

src/chart/helper/EffectSymbol.ts:77–119  ·  view source on GitHub ↗
(effectCfg: RippleEffectCfg)

Source from the content-addressed store, hash-verified

75 }
76
77 startEffectAnimation(effectCfg: RippleEffectCfg) {
78 const symbolType = effectCfg.symbolType;
79 const color = effectCfg.color;
80 const rippleNumber = effectCfg.rippleNumber;
81 const rippleGroup = this.childAt(1) as Group;
82
83 for (let i = 0; i < rippleNumber; i++) {
84 // If width/height are set too small (e.g., set to 1) on ios10
85 // and macOS Sierra, a circle stroke become a rect, no matter what
86 // the scale is set. So we set width/height as 2. See #4136.
87 const ripplePath = createSymbol(
88 symbolType, -1, -1, 2, 2, color
89 );
90 ripplePath.attr({
91 style: {
92 strokeNoScale: true
93 },
94 z2: 99,
95 silent: true,
96 scaleX: 0.5,
97 scaleY: 0.5
98 });
99
100 const delay = -i / rippleNumber * effectCfg.period + effectCfg.effectOffset;
101 ripplePath.animate('', true)
102 .when(effectCfg.period, {
103 scaleX: effectCfg.rippleScale / 2,
104 scaleY: effectCfg.rippleScale / 2
105 })
106 .delay(delay)
107 .start();
108 ripplePath.animateStyle(true)
109 .when(effectCfg.period, {
110 opacity: 0
111 })
112 .delay(delay)
113 .start();
114
115 rippleGroup.add(ripplePath);
116 }
117
118 updateRipplePath(rippleGroup, effectCfg);
119 }
120
121 /**
122 * Update effect symbol

Callers 2

updateEffectAnimationMethod · 0.95
updateDataMethod · 0.95

Calls 4

createSymbolFunction · 0.90
updateRipplePathFunction · 0.85
startMethod · 0.80
addMethod · 0.45

Tested by

no test coverage detected