From 409bdca2bd404c4ab50629c8d5af20cce4c8a771 Mon Sep 17 00:00:00 2001 From: kener Date: Tue, 29 Apr 2014 12:43:41 +0800 Subject: [PATCH] =?UTF-8?q?modShape=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/chart/chord.js | 11 ++++------- src/chart/force.js | 26 +++++++++++++------------- src/chart/island.js | 4 ++-- src/chart/map.js | 13 +++---------- src/component/dataRange.js | 12 ++++++------ src/component/dataZoom.js | 16 ++++++++-------- src/component/tooltip.js | 10 +++++----- 7 files changed, 41 insertions(+), 51 deletions(-) diff --git a/src/chart/chord.js b/src/chart/chord.js index 82cb41c40..d75254ed2 100644 --- a/src/chart/chord.js +++ b/src/chart/chord.js @@ -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); } } } diff --git a/src/chart/force.js b/src/chart/force.js index ccaf8f518..683b2b114 100644 --- a/src/chart/force.js +++ b/src/chart/force.js @@ -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(); diff --git a/src/chart/island.js b/src/chart/island.js index 2f070ec9f..15296ad5b 100644 --- a/src/chart/island.js +++ b/src/chart/island.js @@ -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; diff --git a/src/chart/map.js b/src/chart/map.js index f380cedf6..2e7ec68d9 100644 --- a/src/chart/map.js +++ b/src/chart/map.js @@ -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飞一会 diff --git a/src/component/dataRange.js b/src/component/dataRange.js index f1ed24561..12fba10f8 100644 --- a/src/component/dataRange.js +++ b/src/component/dataRange.js @@ -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(); }, diff --git a/src/component/dataZoom.js b/src/component/dataZoom.js index be22e604d..1a8e9d25b 100644 --- a/src/component/dataZoom.js +++ b/src/component/dataZoom.js @@ -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(); diff --git a/src/component/tooltip.js b/src/component/tooltip.js index 6020e6783..adaffe4b7 100644 --- a/src/component/tooltip.js +++ b/src/component/tooltip.js @@ -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(); } -- GitLab