提交 409bdca2 编写于 作者: K kener

modShape优化

上级 d6c8cbcd
......@@ -296,10 +296,7 @@ define(function (require) {
for (var i = 0; i < len; i++) {
self.sectorShapes[i].style.opacity
= i === idx ? 1 : 0.1;
self.zr.modShape(
self.sectorShapes[i].id,
self.sectorShapes[i]
);
self.zr.modShape(self.sectorShapes[i].id);
for (var j = 0; j < len; j++) {
for (var k = 0; k < len2; k++) {
......@@ -308,7 +305,7 @@ define(function (require) {
chordShape.style.opacity
= (i === idx || j === idx)
? 0.5 : 0.03;
self.zr.modShape(chordShape.id, chordShape);
self.zr.modShape(chordShape.id);
}
}
}
......@@ -326,14 +323,14 @@ define(function (require) {
timeout = setTimeout(function (){
for (var i = 0; i < len; i++) {
self.sectorShapes[i].style.opacity = 1.0;
self.zr.modShape(self.sectorShapes[i].id, self.sectorShapes[i]);
self.zr.modShape(self.sectorShapes[i].id);
for (var j = 0; j < len; j++) {
for (var k = 0; k < len2; k++) {
var chordShape = self.chordShapes[i][j][k];
if (chordShape) {
chordShape.style.opacity = 0.5;
self.zr.modShape(chordShape.id, chordShape);
self.zr.modShape(chordShape.id);
}
}
}
......
......@@ -689,25 +689,25 @@ define(function (require) {
_update(stepTime);
_updateLinkShapes();
var tmp = {};
//var tmp = {};
for (var i = 0; i < nodeShapes.length; i++) {
var shape = nodeShapes[i];
tmp.position = shape.position;
zr.modShape(shape.id, tmp, true);
//var shape = nodeShapes[i];
//tmp.position = shape.position;
zr.modShape(nodeShapes[i].id);
}
tmp = {};
//tmp = {};
for (var i = 0; i < linkShapes.length; i++) {
var shape = linkShapes[i];
tmp.style = shape.style;
zr.modShape(shape.id, tmp, true);
//var shape = linkShapes[i];
//tmp.style = shape.style;
zr.modShape(linkShapes[i].id);
}
tmp = {};
//tmp = {};
for (var i = 0; i < arrowShapes.length; i++) {
var shape = arrowShapes[i];
tmp.position = shape.position;
tmp.rotation = shape.rotation;
zr.modShape(shape.id, tmp, true);
//var shape = arrowShapes[i];
//tmp.position = shape.position;
//tmp.rotation = shape.rotation;
zr.modShape(arrowShapes[i].id);
}
zr.refresh();
......
......@@ -62,7 +62,7 @@ define(function (require) {
ecData.set(shape, 'value', value);
ecData.set(shape, 'name', name);
self.zr.modShape(shape.id, shape);
self.zr.modShape(shape.id);
self.zr.refresh();
zrEvent.stop(event);
};
......@@ -209,7 +209,7 @@ define(function (require) {
var dragged = param.dragged; // 当前被拖拽的图形对象
_combine(target, dragged);
this.zr.modShape(target.id, target);
this.zr.modShape(target.id);
status.dragIn = true;
......
......@@ -216,7 +216,6 @@ define(function (require) {
);
self._buildMark(mt, ms);
if (--self._mapDataRequireCounter <= 0) {
self._shapeListMap = {};
for (var i = 0, l = self.shapeList.length; i < l; i++) {
self.zr.addShape(self.shapeList[i]);
}
......@@ -1032,7 +1031,7 @@ define(function (require) {
for (var i = 0, l = this.shapeList.length; i < l; i++) {
if(this.shapeList[i]._mapType == this._curMapType) {
this.shapeList[i].position = position;
this.zr.modShape(this.shapeList[i].id, mod, true);
this.zr.modShape(this.shapeList[i].id);
}
}
......@@ -1085,9 +1084,7 @@ define(function (require) {
if (this.shapeList[i].style._text == p) {
this.shapeList[i].style =
this.shapeList[i]._style;
this.zr.modShape(
this.shapeList[i].id, this.shapeList[i]
);
this.zr.modShape(this.shapeList[i].id);
}
}
p != name && (this._selected[p] = false);
......@@ -1108,10 +1105,7 @@ define(function (require) {
else {
this.shapeList[i].style = this.shapeList[i]._style;
}
this.zr.modShape(
this.shapeList[i].id,
{style : this.shapeList[i].style}
);
this.zr.modShape(this.shapeList[i].id);
}
}
......@@ -1140,7 +1134,6 @@ define(function (require) {
this._selected = {}; // 地图选择状态
this._mapTypeMap = {}; // 图例类型索引
this._mapDataMap = {}; // 根据地图类型索引bbox,transform,path
this._shapeListMap = {}; // 名字到shapeList关联映射
this._nameMap = {}; // 个性化地名
this._specialArea = {}; // 特殊
this._refreshDelayTicket; // 滚轮缩放时让refresh飞一会
......
......@@ -973,7 +973,7 @@ define(function (require) {
this._fillerShae.style.height =
height * (this._range.start - this._range.end) / 100;
}
this.zr.modShape(this._fillerShae.id, this._fillerShae);
this.zr.modShape(this._fillerShae.id);
this._syncHandleShape();
}
}
......@@ -1096,7 +1096,7 @@ define(function (require) {
this._gap * this._range.start + this.dataRangeOption.min
);
this.zr.modShape(this._startShape.id, this._startShape);
this.zr.modShape(this._startShape.id);
this._endShape.position = [
this._endShape.style.x - this._endShape.style._x,
this._endShape.style.y - this._endShape.style._y
......@@ -1114,12 +1114,12 @@ define(function (require) {
this._endShape.style.color = this._endShape.highlightStyle.strokeColor = this.getColor(
this._gap * this._range.end + this.dataRangeOption.min
);
this.zr.modShape(this._endShape.id, this._endShape);
this.zr.modShape(this._endShape.id);
this.zr.modShape(this._startMask.id, this._startMask);
this.zr.modShape(this._endMask.id, this._endMask);
this.zr.modShape(this._startMask.id);
this.zr.modShape(this._endMask.id);
needFiller && this.zr.modShape(this._fillerShae.id, this._fillerShae);
needFiller && this.zr.modShape(this._fillerShae.id);
this.zr.refresh();
},
......
......@@ -584,8 +584,8 @@ define(function (require) {
);
}
this.zr.modShape(this._startShape.id, this._startShape);
this.zr.modShape(this._endShape.id, this._endShape);
this.zr.modShape(this._startShape.id);
this.zr.modShape(this._endShape.id);
// 同步边框
this._syncFrameShape();
......@@ -625,7 +625,7 @@ define(function (require) {
);
}
this.zr.modShape(this._fillerShae.id, this._fillerShae);
this.zr.modShape(this._fillerShae.id);
// 同步边框
this._syncFrameShape();
......@@ -651,8 +651,8 @@ define(function (require) {
this._location.y + this._location.height - this._endFrameShape.style.y;
}
this.zr.modShape(this._startFrameShape.id, this._startFrameShape);
this.zr.modShape(this._endFrameShape.id, this._endFrameShape);
this.zr.modShape(this._startFrameShape.id);
this.zr.modShape(this._endFrameShape.id);
},
_syncShape : function () {
......@@ -685,9 +685,9 @@ define(function (require) {
- this._handleSize;
}
this.zr.modShape(this._startShape.id, this._startShape);
this.zr.modShape(this._endShape.id, this._endShape);
this.zr.modShape(this._fillerShae.id, this._fillerShae);
this.zr.modShape(this._startShape.id);
this.zr.modShape(this._endShape.id);
this.zr.modShape(this._fillerShae.id);
// 同步边框
this._syncFrameShape();
this.zr.refresh();
......
......@@ -177,12 +177,12 @@ define(function (require) {
var needRefresh = false;
if (!this._axisLineShape.invisible) {
this._axisLineShape.invisible = true;
this.zr.modShape(this._axisLineShape.id, this._axisLineShape);
this.zr.modShape(this._axisLineShape.id);
needRefresh = true;
}
if (!this._axisShadowShape.invisible) {
this._axisShadowShape.invisible = true;
this.zr.modShape(this._axisShadowShape.id, this._axisShadowShape);
this.zr.modShape(this._axisShadowShape.id);
needRefresh = true;
}
if (this._lastTipShape && this._lastTipShape.tipShape.length > 0) {
......@@ -948,7 +948,7 @@ define(function (require) {
if (!this._axisLineShape.invisible) {
this._axisLineShape.invisible = true;
this.zr.modShape(this._axisLineShape.id, this._axisLineShape);
this.zr.modShape(this._axisLineShape.id);
this.zr.refresh();
}
......@@ -1035,7 +1035,7 @@ define(function (require) {
lineType : lineType
};
this._axisLineShape.invisible = false;
this.zr.modShape(this._axisLineShape.id, this._axisLineShape);
this.zr.modShape(this._axisLineShape.id);
}
else if (pointType == 'shadow') {
if (typeof areaSize == 'undefined'
......@@ -1082,7 +1082,7 @@ define(function (require) {
lineWidth : lineWidth
};
this._axisShadowShape.invisible = false;
this.zr.modShape(this._axisShadowShape.id, this._axisShadowShape);
this.zr.modShape(this._axisShadowShape.id);
}
this.zr.refresh();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册