提交 58336fc9 编写于 作者: K kener

动画过渡升级 scatter

上级 b9698694
......@@ -178,12 +178,13 @@ define(function (require) {
},
addShapeList : function() {
var maxLenth = this.option.animationThreshold / (this.canvasSupported ? 1 : 2);
var lastShapeList = this.lastShapeList;
var shapeList = this.shapeList;
var key;
var oldMap = {};
var newMap = {};
if (lastShapeList && lastShapeList.length > 0) {
if (lastShapeList && lastShapeList.length > 0 && lastShapeList.length < maxLenth) {
// 通过已有的shape做动画过渡
for (var i = 0, l = this.lastShapeList.length; i < l; i++) {
key = ecData.get(lastShapeList[i], 'seriesIndex') + '_'
......@@ -265,6 +266,7 @@ define(function (require) {
.start('ExponentialOut');
break;
case 'rectangle' :
case 'icon' :
var newX = newShape.style.x;
var newY = newShape.style.y;
var newWidth = newShape.style.width;
......
......@@ -112,20 +112,19 @@ define(function (require) {
}
}
}
if (seriesArray.length === 0) {
return;
}
this._buildSeries(seriesArray);
for (var i = 0, l = this.shapeList.length; i < l; i++) {
this.zr.addShape(this.shapeList[i]);
}
this.addShapeList();
},
/**
* 构建类目轴为水平方向的散点图系列
*/
_buildSeries : function (seriesArray) {
if (seriesArray.length === 0) {
return;
}
var series = this.series;
var seriesIndex;
var serie;
......@@ -384,7 +383,6 @@ define(function (require) {
'vertical'
);
itemShape.zlevel = this._zlevelBase;
itemShape._mark = false; // 非mark
itemShape._main = true;
return itemShape;
},
......@@ -459,7 +457,7 @@ define(function (require) {
this.option = newOption;
this.series = newOption.series;
}
this.clear();
this.backupShapeList();
this._buildShape();
},
......@@ -480,6 +478,10 @@ define(function (require) {
* 动画设定
*/
animation : function () {
if (this.lastShapeList && this.lastShapeList.length > 0) {
return;
}
var series = this.series;
var duration = this.query(this.option, 'animationDuration');
var easing = this.query(this.option, 'animationEasing');
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册