-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(animate waveIn): 修复 waveIn 动画 最后没有给 element 附上更新后样式的问题 (#4000)
Co-authored-by: ai-qing-hai <wb-xcf804241@antgroup.com>
- Loading branch information
1 parent
17c146d
commit beb9766
Showing
2 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
|
||
import { Chart } from '../../src'; | ||
import { createDiv } from '../util/dom'; | ||
|
||
describe('#3694', () => { | ||
const data = [ | ||
{ term: 'Zombieland', count: 9 }, | ||
]; | ||
|
||
const chart = new Chart({ | ||
container: createDiv(), | ||
autoFit: true, | ||
height: 500, | ||
padding: 50, | ||
}); | ||
|
||
chart.data(data); | ||
|
||
chart.scale({ | ||
count: { | ||
min: 1, | ||
max: 10, | ||
}, | ||
}); | ||
chart.tooltip(false) | ||
chart.coordinate('theta', { | ||
innerRadius: 0.7, | ||
radius: 1 | ||
}) | ||
|
||
chart | ||
.interval() | ||
.position('term*count') | ||
.shape('line') | ||
.style({ | ||
lineAppendWidth: 10, | ||
}) // 线状柱状图 | ||
.animate({ | ||
update: { | ||
animation: 'wave-in', // 动画名称 | ||
easing: 'easeQuadIn', // 动画缓动效果 | ||
delay: 100, // 动画延迟执行时间 | ||
duration: 500 // 动画执行时间 | ||
}, | ||
}) | ||
|
||
|
||
chart.render(); | ||
|
||
it('wave-in animation update', () => { | ||
const shape = chart.canvas.findAll((e) => e.cfg.type === 'path')[0]; | ||
const path = shape.attr('path'); | ||
|
||
chart.changeData([{ | ||
count: 5, | ||
term: "Zombieland" | ||
}]); | ||
|
||
expect(path).not.toMatchObject(shape.attr('path')); | ||
}); | ||
}); |