提交 2e8e9599 编写于 作者: O Ovilia

fix(sunburst): fix animation

上级 d13ecedb
......@@ -62,6 +62,7 @@ SunburstPieceProto.updateData = function (
node.piece = this;
var sector = this.childAt(0);
sector.dataIndex = node.dataIndex;
var itemModel = node.getModel();
var layout = node.getLayout();
......@@ -71,17 +72,16 @@ SunburstPieceProto.updateData = function (
if (firstCreate) {
sector.setShape(sectorShape);
sector.shape.r = layout.r0;
var duration = seriesModel.getShallow('animationDuration')
/ Math.max(node.depth + node.height, 1);
var delay = (node.depth - 1) * duration;
var easing = seriesModel.getShallow('animationEasing');
sector.animateTo({
shape: {
r: layout.r
}
}, duration, delay, easing);
graphic.updateProps(
sector,
{
shape: {
r: layout.r
}
},
seriesModel,
node.dataIndex
);
}
else {
graphic.updateProps(sector, {
......@@ -104,8 +104,6 @@ SunburstPieceProto.updateData = function (
);
sector.hoverStyle = itemStyleModel.getModel('emphasis').getItemStyle();
sector.dataIndex = node.dataIndex;
var cursorStyle = itemModel.getShallow('cursor');
cursorStyle && sector.attr('cursor', cursorStyle);
......
......@@ -109,8 +109,8 @@ export default SeriesModel.extend({
// Animation type canbe expansion, scale
animationType: 'expansion',
animationDuration: 1000,
animationUpdateDuration: 300,
animationEasing: 'sinusoidalInOut',
animationUpdateDuration: 500,
animationEasing: 'cubicOut',
data: [],
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册