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

动画过渡升级 scatter

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