echarts 4.5.0-rc.2 → 4.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/pull_request_template.md +66 -0
- package/.github/workflows/nodejs.yml +12 -2
- package/CONTRIBUTING.md +16 -160
- package/NOTICE +1 -1
- package/README.md +2 -2
- package/dist/echarts-en.common.js +2808 -1188
- package/dist/echarts-en.common.min.js +1 -1
- package/dist/echarts-en.js +3559 -1437
- package/dist/echarts-en.js.map +1 -1
- package/dist/echarts-en.min.js +1 -1
- package/dist/echarts-en.simple.js +2453 -1002
- package/dist/echarts-en.simple.min.js +1 -1
- package/dist/echarts.common.js +2782 -1188
- package/dist/echarts.common.min.js +1 -1
- package/dist/echarts.js +3533 -1437
- package/dist/echarts.js.map +1 -1
- package/dist/echarts.min.js +1 -1
- package/dist/echarts.simple.js +2427 -1002
- package/dist/echarts.simple.min.js +1 -1
- package/dist/extension/bmap.js +336 -2
- package/dist/extension/bmap.js.map +1 -1
- package/dist/extension/bmap.min.js +1 -1
- package/extension/bmap/BMapView.js +6 -2
- package/extension-src/bmap/BMapView.js +3 -2
- package/lib/chart/bar/BarSeries.js +14 -1
- package/lib/chart/bar/BarView.js +161 -16
- package/lib/chart/bar/BaseBarSeries.js +3 -1
- package/lib/chart/candlestick/candlestickVisual.js +1 -1
- package/lib/chart/effectScatter/EffectScatterSeries.js +3 -1
- package/lib/chart/funnel/FunnelSeries.js +13 -5
- package/lib/chart/gauge/GaugeSeries.js +0 -2
- package/lib/chart/graph/GraphSeries.js +11 -5
- package/lib/chart/graph/GraphView.js +30 -12
- package/lib/chart/heatmap/HeatmapView.js +4 -4
- package/lib/chart/helper/EffectLine.js +23 -1
- package/lib/chart/helper/EffectSymbol.js +2 -1
- package/lib/chart/helper/Line.js +94 -33
- package/lib/chart/helper/LineDraw.js +5 -1
- package/lib/chart/helper/Symbol.js +1 -2
- package/lib/chart/helper/createClipPathFromCoordSys.js +4 -1
- package/lib/chart/helper/createListFromArray.js +14 -8
- package/lib/chart/helper/createRenderPlanner.js +6 -3
- package/lib/chart/helper/whiskerBoxCommon.js +22 -16
- package/lib/chart/line/LineSeries.js +3 -1
- package/lib/chart/line/LineView.js +41 -2
- package/lib/chart/map/MapSeries.js +11 -3
- package/lib/chart/pie/PieSeries.js +27 -6
- package/lib/chart/pie/PieView.js +22 -15
- package/lib/chart/pie/labelLayout.js +102 -19
- package/lib/chart/pie/pieLayout.js +19 -7
- package/lib/chart/radar/RadarSeries.js +23 -3
- package/lib/chart/sankey/SankeySeries.js +13 -1
- package/lib/chart/sankey/SankeyView.js +70 -32
- package/lib/chart/sankey/sankeyLayout.js +22 -3
- package/lib/chart/scatter/ScatterSeries.js +3 -1
- package/lib/chart/sunburst/SunburstPiece.js +1 -0
- package/lib/chart/sunburst/SunburstSeries.js +12 -7
- package/lib/chart/sunburst/SunburstView.js +5 -1
- package/lib/chart/themeRiver/ThemeRiverSeries.js +3 -3
- package/lib/chart/tree/TreeSeries.js +20 -3
- package/lib/chart/tree/TreeView.js +151 -25
- package/lib/chart/treemap/TreemapSeries.js +15 -3
- package/lib/chart/treemap/TreemapView.js +80 -38
- package/lib/component/axis/AngleAxisView.js +64 -7
- package/lib/component/axis/AxisBuilder.js +62 -24
- package/lib/component/axis/CartesianAxisView.js +52 -85
- package/lib/component/axis/RadiusAxisView.js +36 -4
- package/lib/component/axis/SingleAxisView.js +21 -6
- package/lib/component/axis/axisSplitHelper.js +132 -0
- package/lib/component/brush/BrushView.js +11 -1
- package/lib/component/brush/visualEncoding.js +13 -2
- package/lib/component/dataZoom/SliderZoomView.js +4 -10
- package/lib/component/helper/BrushController.js +33 -43
- package/lib/component/helper/MapDraw.js +30 -4
- package/lib/component/legend/LegendModel.js +3 -3
- package/lib/component/legend/LegendView.js +17 -13
- package/lib/component/legend/ScrollableLegendView.js +18 -18
- package/lib/component/marker/MarkLineModel.js +2 -1
- package/lib/component/marker/markerHelper.js +7 -4
- package/lib/component/title.js +6 -2
- package/lib/component/toolbox/ToolboxView.js +5 -1
- package/lib/component/toolbox/feature/MagicType.js +20 -14
- package/lib/component/toolbox/feature/SaveAsImage.js +2 -1
- package/lib/component/tooltip/TooltipContent.js +60 -23
- package/lib/component/tooltip/TooltipView.js +7 -8
- package/lib/component/visualMap/PiecewiseModel.js +3 -6
- package/lib/coord/Axis.js +30 -2
- package/lib/coord/View.js +9 -0
- package/lib/coord/axisDefault.js +21 -2
- package/lib/coord/axisHelper.js +22 -16
- package/lib/coord/calendar/Calendar.js +8 -4
- package/lib/coord/geo/geoJSONLoader.js +3 -2
- package/lib/coord/geo/geoSourceManager.js +3 -2
- package/lib/coord/geo/parseGeoJson.js +3 -2
- package/lib/coord/radar/Radar.js +5 -5
- package/lib/data/DataDimensionInfo.js +157 -0
- package/lib/data/List.js +25 -19
- package/lib/data/Tree.js +9 -19
- package/lib/data/helper/completeDimensions.js +43 -32
- package/lib/data/helper/createDimensions.js +2 -0
- package/lib/data/helper/sourceHelper.js +214 -114
- package/lib/echarts.js +57 -34
- package/lib/langEN.js +26 -0
- package/lib/layout/barGrid.js +19 -13
- package/lib/layout/barPolar.js +0 -5
- package/lib/loading/default.js +43 -27
- package/lib/model/Series.js +4 -4
- package/lib/model/referHelper.js +40 -12
- package/lib/scale/Interval.js +87 -2
- package/lib/scale/Log.js +9 -2
- package/lib/scale/helper.js +1 -43
- package/lib/stream/Scheduler.js +9 -1
- package/lib/theme/dark.js +3 -0
- package/lib/util/format.js +19 -2
- package/lib/util/graphic.js +14 -12
- package/lib/visual/LegendVisualProvider.js +75 -0
- package/lib/visual/dataColor.js +2 -12
- package/lib/visual/seriesColor.js +15 -7
- package/lib/visual/symbol.js +12 -2
- package/map/js/china.js +1 -1
- package/map/js/province/chongqing.js +1 -1
- package/map/js/province/gansu.js +2 -2
- package/map/js/province/tianjin.js +1 -28
- package/map/json/china.json +1 -1
- package/map/json/province/chongqing.json +1 -1
- package/map/json/province/tianjin.json +1 -1
- package/package.json +11 -6
- package/src/chart/bar/BarSeries.js +15 -1
- package/src/chart/bar/BarView.js +162 -15
- package/src/chart/bar/BaseBarSeries.js +1 -1
- package/src/chart/candlestick/candlestickVisual.js +1 -1
- package/src/chart/effectScatter/EffectScatterSeries.js +1 -1
- package/src/chart/funnel/FunnelSeries.js +10 -4
- package/src/chart/gauge/GaugeSeries.js +0 -1
- package/src/chart/graph/GraphSeries.js +10 -4
- package/src/chart/graph/GraphView.js +28 -10
- package/src/chart/heatmap/HeatmapView.js +4 -4
- package/src/chart/helper/EffectLine.js +23 -1
- package/src/chart/helper/EffectSymbol.js +2 -1
- package/src/chart/helper/Line.js +84 -26
- package/src/chart/helper/LineDraw.js +5 -1
- package/src/chart/helper/Symbol.js +2 -2
- package/src/chart/helper/createClipPathFromCoordSys.js +4 -0
- package/src/chart/helper/createListFromArray.js +13 -8
- package/src/chart/helper/createRenderPlanner.js +5 -2
- package/src/chart/helper/whiskerBoxCommon.js +21 -16
- package/src/chart/line/LineSeries.js +1 -1
- package/src/chart/line/LineView.js +45 -1
- package/src/chart/map/MapSeries.js +8 -3
- package/src/chart/pie/PieSeries.js +26 -5
- package/src/chart/pie/PieView.js +20 -15
- package/src/chart/pie/labelLayout.js +114 -22
- package/src/chart/pie/pieLayout.js +20 -7
- package/src/chart/radar/RadarSeries.js +27 -3
- package/src/chart/sankey/SankeySeries.js +12 -1
- package/src/chart/sankey/SankeyView.js +75 -30
- package/src/chart/sankey/sankeyLayout.js +25 -5
- package/src/chart/scatter/ScatterSeries.js +1 -1
- package/src/chart/sunburst/SunburstPiece.js +2 -0
- package/src/chart/sunburst/SunburstSeries.js +12 -7
- package/src/chart/sunburst/SunburstView.js +2 -1
- package/src/chart/themeRiver/ThemeRiverSeries.js +4 -3
- package/src/chart/tree/TreeSeries.js +19 -6
- package/src/chart/tree/TreeView.js +155 -22
- package/src/chart/treemap/TreemapSeries.js +15 -5
- package/src/chart/treemap/TreemapView.js +77 -41
- package/src/component/axis/AngleAxisView.js +75 -7
- package/src/component/axis/AxisBuilder.js +77 -32
- package/src/component/axis/CartesianAxisView.js +47 -83
- package/src/component/axis/RadiusAxisView.js +37 -4
- package/src/component/axis/SingleAxisView.js +21 -4
- package/src/component/axis/axisSplitHelper.js +114 -0
- package/src/component/brush/BrushView.js +8 -1
- package/src/component/brush/visualEncoding.js +6 -3
- package/src/component/dataZoom/SliderZoomView.js +4 -9
- package/src/component/helper/BrushController.js +40 -47
- package/src/component/helper/MapDraw.js +27 -4
- package/src/component/legend/LegendModel.js +3 -3
- package/src/component/legend/LegendView.js +18 -12
- package/src/component/legend/ScrollableLegendView.js +18 -16
- package/src/component/marker/MarkLineModel.js +2 -1
- package/src/component/marker/markerHelper.js +8 -5
- package/src/component/title.js +3 -2
- package/src/component/toolbox/ToolboxView.js +5 -0
- package/src/component/toolbox/feature/MagicType.js +19 -13
- package/src/component/toolbox/feature/SaveAsImage.js +2 -1
- package/src/component/tooltip/TooltipContent.js +59 -22
- package/src/component/tooltip/TooltipView.js +10 -8
- package/src/component/visualMap/PiecewiseModel.js +5 -9
- package/src/coord/Axis.js +29 -2
- package/src/coord/View.js +10 -1
- package/src/coord/axisDefault.js +25 -1
- package/src/coord/axisHelper.js +26 -19
- package/src/coord/calendar/Calendar.js +12 -5
- package/src/coord/geo/geoJSONLoader.js +3 -2
- package/src/coord/geo/geoSourceManager.js +3 -2
- package/src/coord/geo/parseGeoJson.js +3 -2
- package/src/coord/radar/Radar.js +6 -8
- package/src/data/DataDimensionInfo.js +135 -0
- package/src/data/List.js +29 -16
- package/src/data/Tree.js +12 -17
- package/src/data/helper/completeDimensions.js +49 -30
- package/src/data/helper/createDimensions.js +2 -0
- package/src/data/helper/sourceHelper.js +216 -124
- package/src/echarts.js +60 -36
- package/src/langEN.js +26 -0
- package/src/layout/barGrid.js +22 -10
- package/src/layout/barPolar.js +0 -4
- package/src/loading/default.js +46 -34
- package/src/model/Series.js +4 -4
- package/src/model/referHelper.js +34 -11
- package/src/scale/Interval.js +84 -4
- package/src/scale/Log.js +9 -2
- package/src/scale/helper.js +1 -39
- package/src/stream/Scheduler.js +8 -0
- package/src/theme/dark.js +3 -0
- package/src/util/format.js +17 -1
- package/src/util/graphic.js +13 -11
- package/src/visual/LegendVisualProvider.js +55 -0
- package/src/visual/dataColor.js +0 -13
- package/src/visual/seriesColor.js +13 -7
- package/src/visual/symbol.js +11 -2
- package/theme/azul.js +163 -0
- package/theme/bee-inspired.js +178 -0
- package/theme/blue.js +178 -0
- package/theme/caravan.js +178 -0
- package/theme/carp.js +163 -0
- package/theme/cool.js +180 -0
- package/theme/dark-blue.js +168 -0
- package/theme/dark-bold.js +168 -0
- package/theme/dark-digerati.js +168 -0
- package/theme/dark-fresh-cut.js +168 -0
- package/theme/dark-mushroom.js +168 -0
- package/theme/dark.js +69 -62
- package/theme/eduardo.js +178 -0
- package/theme/forest.js +163 -0
- package/theme/fresh-cut.js +163 -0
- package/theme/fruit.js +178 -0
- package/theme/gray.js +220 -0
- package/theme/green.js +222 -0
- package/theme/helianthus.js +263 -0
- package/theme/infographic.js +72 -57
- package/theme/inspired.js +163 -0
- package/theme/jazz.js +163 -0
- package/theme/london.js +163 -0
- package/theme/macarons.js +80 -57
- package/theme/macarons2.js +251 -0
- package/theme/mint.js +155 -0
- package/theme/red-velvet.js +163 -0
- package/theme/red.js +225 -0
- package/theme/roma.js +55 -22
- package/theme/royal.js +163 -0
- package/theme/sakura.js +140 -0
- package/theme/shine.js +52 -45
- package/theme/tech-blue.js +180 -0
- package/theme/vintage.js +37 -23
|
@@ -87,6 +87,7 @@ effectLineProto._updateEffectSymbol = function (lineData, idx) {
|
|
|
87
87
|
symbol.attr('scale', size);
|
|
88
88
|
|
|
89
89
|
this._symbolType = symbolType;
|
|
90
|
+
this._symbolScale = size;
|
|
90
91
|
|
|
91
92
|
this._updateEffectAnimation(lineData, effectModel, idx);
|
|
92
93
|
};
|
|
@@ -177,6 +178,7 @@ effectLineProto.updateSymbolPosition = function (symbol) {
|
|
|
177
178
|
var cp1 = symbol.__cp1;
|
|
178
179
|
var t = symbol.__t;
|
|
179
180
|
var pos = symbol.position;
|
|
181
|
+
var lastPos = [pos[0], pos[1]];
|
|
180
182
|
var quadraticAt = curveUtil.quadraticAt;
|
|
181
183
|
var quadraticDerivativeAt = curveUtil.quadraticDerivativeAt;
|
|
182
184
|
pos[0] = quadraticAt(p1[0], cp1[0], p2[0], t);
|
|
@@ -187,7 +189,27 @@ effectLineProto.updateSymbolPosition = function (symbol) {
|
|
|
187
189
|
var ty = quadraticDerivativeAt(p1[1], cp1[1], p2[1], t);
|
|
188
190
|
|
|
189
191
|
symbol.rotation = -Math.atan2(ty, tx) - Math.PI / 2;
|
|
190
|
-
|
|
192
|
+
// enable continuity trail for 'line', 'rect', 'roundRect' symbolType
|
|
193
|
+
if (this._symbolType === 'line' || this._symbolType === 'rect' || this._symbolType === 'roundRect') {
|
|
194
|
+
if (symbol.__lastT !== undefined && symbol.__lastT < symbol.__t) {
|
|
195
|
+
var scaleY = vec2.dist(lastPos, pos) * 1.05;
|
|
196
|
+
symbol.attr('scale', [symbol.scale[0], scaleY]);
|
|
197
|
+
// make sure the last segment render within endPoint
|
|
198
|
+
if (t === 1) {
|
|
199
|
+
pos[0] = lastPos[0] + (pos[0] - lastPos[0]) / 2;
|
|
200
|
+
pos[1] = lastPos[1] + (pos[1] - lastPos[1]) / 2;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
else if (symbol.__lastT === 1) {
|
|
204
|
+
// After first loop, symbol.__t does NOT start with 0, so connect p1 to pos directly.
|
|
205
|
+
var scaleY = 2 * vec2.dist(p1, pos);
|
|
206
|
+
symbol.attr('scale', [symbol.scale[0], scaleY ]);
|
|
207
|
+
}
|
|
208
|
+
else {
|
|
209
|
+
symbol.attr('scale', this._symbolScale);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
symbol.__lastT = symbol.__t;
|
|
191
213
|
symbol.ignore = false;
|
|
192
214
|
};
|
|
193
215
|
|
|
@@ -183,7 +183,8 @@ effectSymbolProto.updateData = function (data, idx) {
|
|
|
183
183
|
pos[0] = parsePercent(symbolOffset[0], symbolSize[0]);
|
|
184
184
|
pos[1] = parsePercent(symbolOffset[1], symbolSize[1]);
|
|
185
185
|
}
|
|
186
|
-
|
|
186
|
+
var symbolRotate = data.getItemVisual(idx, 'symbolRotate');
|
|
187
|
+
rippleGroup.rotation = (symbolRotate || 0) * Math.PI / 180 || 0;
|
|
187
188
|
|
|
188
189
|
var effectCfg = {};
|
|
189
190
|
|
package/src/chart/helper/Line.js
CHANGED
|
@@ -141,39 +141,90 @@ function updateSymbolAndLabelBeforeLineUpdate() {
|
|
|
141
141
|
var textPosition;
|
|
142
142
|
var textAlign;
|
|
143
143
|
var textVerticalAlign;
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
144
|
+
var textOrigin;
|
|
145
|
+
|
|
146
|
+
var distance = label.__labelDistance;
|
|
147
|
+
var distanceX = distance[0] * invScale;
|
|
148
|
+
var distanceY = distance[1] * invScale;
|
|
149
|
+
var halfPercent = percent / 2;
|
|
150
|
+
var tangent = line.tangentAt(halfPercent);
|
|
151
|
+
var n = [tangent[1], -tangent[0]];
|
|
152
|
+
var cp = line.pointAt(halfPercent);
|
|
153
|
+
if (n[1] > 0) {
|
|
154
|
+
n[0] = -n[0];
|
|
155
|
+
n[1] = -n[1];
|
|
151
156
|
}
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
var tangent = line.tangentAt(halfPercent);
|
|
156
|
-
var n = [tangent[1], -tangent[0]];
|
|
157
|
-
var cp = line.pointAt(halfPercent);
|
|
158
|
-
if (n[1] > 0) {
|
|
159
|
-
n[0] = -n[0];
|
|
160
|
-
n[1] = -n[1];
|
|
161
|
-
}
|
|
162
|
-
textPosition = [cp[0] + n[0] * distance, cp[1] + n[1] * distance];
|
|
163
|
-
textAlign = 'center';
|
|
164
|
-
textVerticalAlign = 'bottom';
|
|
157
|
+
var dir = tangent[0] < 0 ? -1 : 1;
|
|
158
|
+
|
|
159
|
+
if (label.__position !== 'start' && label.__position !== 'end') {
|
|
165
160
|
var rotation = -Math.atan2(tangent[1], tangent[0]);
|
|
166
161
|
if (toPos[0] < fromPos[0]) {
|
|
167
162
|
rotation = Math.PI + rotation;
|
|
168
163
|
}
|
|
169
164
|
label.attr('rotation', rotation);
|
|
170
165
|
}
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
166
|
+
|
|
167
|
+
var dy;
|
|
168
|
+
switch (label.__position) {
|
|
169
|
+
case 'insideStartTop':
|
|
170
|
+
case 'insideMiddleTop':
|
|
171
|
+
case 'insideEndTop':
|
|
172
|
+
case 'middle':
|
|
173
|
+
dy = -distanceY;
|
|
174
|
+
textVerticalAlign = 'bottom';
|
|
175
|
+
break;
|
|
176
|
+
|
|
177
|
+
case 'insideStartBottom':
|
|
178
|
+
case 'insideMiddleBottom':
|
|
179
|
+
case 'insideEndBottom':
|
|
180
|
+
dy = distanceY;
|
|
181
|
+
textVerticalAlign = 'top';
|
|
182
|
+
break;
|
|
183
|
+
|
|
184
|
+
default:
|
|
185
|
+
dy = 0;
|
|
186
|
+
textVerticalAlign = 'middle';
|
|
176
187
|
}
|
|
188
|
+
|
|
189
|
+
switch (label.__position) {
|
|
190
|
+
case 'end':
|
|
191
|
+
textPosition = [d[0] * distanceX + toPos[0], d[1] * distanceY + toPos[1]];
|
|
192
|
+
textAlign = d[0] > 0.8 ? 'left' : (d[0] < -0.8 ? 'right' : 'center');
|
|
193
|
+
textVerticalAlign = d[1] > 0.8 ? 'top' : (d[1] < -0.8 ? 'bottom' : 'middle');
|
|
194
|
+
break;
|
|
195
|
+
|
|
196
|
+
case 'start':
|
|
197
|
+
textPosition = [-d[0] * distanceX + fromPos[0], -d[1] * distanceY + fromPos[1]];
|
|
198
|
+
textAlign = d[0] > 0.8 ? 'right' : (d[0] < -0.8 ? 'left' : 'center');
|
|
199
|
+
textVerticalAlign = d[1] > 0.8 ? 'bottom' : (d[1] < -0.8 ? 'top' : 'middle');
|
|
200
|
+
break;
|
|
201
|
+
|
|
202
|
+
case 'insideStartTop':
|
|
203
|
+
case 'insideStart':
|
|
204
|
+
case 'insideStartBottom':
|
|
205
|
+
textPosition = [distanceX * dir + fromPos[0], fromPos[1] + dy];
|
|
206
|
+
textAlign = tangent[0] < 0 ? 'right' : 'left';
|
|
207
|
+
textOrigin = [-distanceX * dir, -dy];
|
|
208
|
+
break;
|
|
209
|
+
|
|
210
|
+
case 'insideMiddleTop':
|
|
211
|
+
case 'insideMiddle':
|
|
212
|
+
case 'insideMiddleBottom':
|
|
213
|
+
case 'middle':
|
|
214
|
+
textPosition = [cp[0], cp[1] + dy];
|
|
215
|
+
textAlign = 'center';
|
|
216
|
+
textOrigin = [0, -dy];
|
|
217
|
+
break;
|
|
218
|
+
|
|
219
|
+
case 'insideEndTop':
|
|
220
|
+
case 'insideEnd':
|
|
221
|
+
case 'insideEndBottom':
|
|
222
|
+
textPosition = [-distanceX * dir + toPos[0], toPos[1] + dy];
|
|
223
|
+
textAlign = tangent[0] >= 0 ? 'right' : 'left';
|
|
224
|
+
textOrigin = [distanceX * dir, -dy];
|
|
225
|
+
break;
|
|
226
|
+
}
|
|
227
|
+
|
|
177
228
|
label.attr({
|
|
178
229
|
style: {
|
|
179
230
|
// Use the user specified text align and baseline first
|
|
@@ -181,7 +232,8 @@ function updateSymbolAndLabelBeforeLineUpdate() {
|
|
|
181
232
|
textAlign: label.__textAlign || textAlign
|
|
182
233
|
},
|
|
183
234
|
position: textPosition,
|
|
184
|
-
scale: [invScale, invScale]
|
|
235
|
+
scale: [invScale, invScale],
|
|
236
|
+
origin: textOrigin
|
|
185
237
|
});
|
|
186
238
|
}
|
|
187
239
|
}
|
|
@@ -357,6 +409,12 @@ lineProto._updateCommonStl = function (lineData, idx, seriesScope) {
|
|
|
357
409
|
label.__verticalAlign = labelStyle.textVerticalAlign;
|
|
358
410
|
// 'start', 'middle', 'end'
|
|
359
411
|
label.__position = labelModel.get('position') || 'middle';
|
|
412
|
+
|
|
413
|
+
var distance = labelModel.get('distance');
|
|
414
|
+
if (!zrUtil.isArray(distance)) {
|
|
415
|
+
distance = [distance, distance];
|
|
416
|
+
}
|
|
417
|
+
label.__labelDistance = distance;
|
|
360
418
|
}
|
|
361
419
|
|
|
362
420
|
if (emphasisText != null) {
|
|
@@ -123,9 +123,13 @@ lineDrawProto.incrementalPrepareUpdate = function (lineData) {
|
|
|
123
123
|
this.group.removeAll();
|
|
124
124
|
};
|
|
125
125
|
|
|
126
|
+
function isEffectObject(el) {
|
|
127
|
+
return el.animators && el.animators.length > 0;
|
|
128
|
+
}
|
|
129
|
+
|
|
126
130
|
lineDrawProto.incrementalUpdate = function (taskParams, lineData) {
|
|
127
131
|
function updateIncrementalAndHover(el) {
|
|
128
|
-
if (!el.isGroup) {
|
|
132
|
+
if (!el.isGroup && !isEffectObject(el)) {
|
|
129
133
|
el.incremental = el.useHoverLayer = true;
|
|
130
134
|
}
|
|
131
135
|
}
|
|
@@ -248,7 +248,6 @@ symbolProto._updateCommon = function (data, idx, symbolSize, seriesScope) {
|
|
|
248
248
|
|
|
249
249
|
var itemStyle = seriesScope && seriesScope.itemStyle;
|
|
250
250
|
var hoverItemStyle = seriesScope && seriesScope.hoverItemStyle;
|
|
251
|
-
var symbolRotate = seriesScope && seriesScope.symbolRotate;
|
|
252
251
|
var symbolOffset = seriesScope && seriesScope.symbolOffset;
|
|
253
252
|
var labelModel = seriesScope && seriesScope.labelModel;
|
|
254
253
|
var hoverLabelModel = seriesScope && seriesScope.hoverLabelModel;
|
|
@@ -264,7 +263,6 @@ symbolProto._updateCommon = function (data, idx, symbolSize, seriesScope) {
|
|
|
264
263
|
itemStyle = itemModel.getModel(normalStyleAccessPath).getItemStyle(['color']);
|
|
265
264
|
hoverItemStyle = itemModel.getModel(emphasisStyleAccessPath).getItemStyle();
|
|
266
265
|
|
|
267
|
-
symbolRotate = itemModel.getShallow('symbolRotate');
|
|
268
266
|
symbolOffset = itemModel.getShallow('symbolOffset');
|
|
269
267
|
|
|
270
268
|
labelModel = itemModel.getModel(normalLabelAccessPath);
|
|
@@ -278,6 +276,8 @@ symbolProto._updateCommon = function (data, idx, symbolSize, seriesScope) {
|
|
|
278
276
|
|
|
279
277
|
var elStyle = symbolPath.style;
|
|
280
278
|
|
|
279
|
+
var symbolRotate = data.getItemVisual(idx, 'symbolRotate');
|
|
280
|
+
|
|
281
281
|
symbolPath.attr('rotation', (symbolRotate || 0) * Math.PI / 180 || 0);
|
|
282
282
|
|
|
283
283
|
if (symbolOffset) {
|
|
@@ -35,6 +35,10 @@ function createGridClipPath(cartesian, hasAnimation, seriesModel) {
|
|
|
35
35
|
width += lineWidth;
|
|
36
36
|
height += lineWidth;
|
|
37
37
|
|
|
38
|
+
// fix: https://github.com/apache/incubator-echarts/issues/11369
|
|
39
|
+
x = Math.floor(x);
|
|
40
|
+
width = Math.round(width);
|
|
41
|
+
|
|
38
42
|
var clipPath = new graphic.Rect({
|
|
39
43
|
shape: {
|
|
40
44
|
x: x,
|
|
@@ -24,15 +24,17 @@ import {SOURCE_FORMAT_ORIGINAL} from '../../data/helper/sourceType';
|
|
|
24
24
|
import {getDimensionTypeByAxis} from '../../data/helper/dimensionHelper';
|
|
25
25
|
import {getDataItemValue} from '../../util/model';
|
|
26
26
|
import CoordinateSystem from '../../CoordinateSystem';
|
|
27
|
-
import {
|
|
27
|
+
import {getCoordSysInfoBySeries} from '../../model/referHelper';
|
|
28
28
|
import Source from '../../data/Source';
|
|
29
29
|
import {enableDataStack} from '../../data/helper/dataStackHelper';
|
|
30
|
+
import {makeSeriesEncodeForAxisCoordSys} from '../../data/helper/sourceHelper';
|
|
30
31
|
|
|
31
32
|
/**
|
|
32
33
|
* @param {module:echarts/data/Source|Array} source Or raw data.
|
|
33
34
|
* @param {module:echarts/model/Series} seriesModel
|
|
34
35
|
* @param {Object} [opt]
|
|
35
36
|
* @param {string} [opt.generateCoord]
|
|
37
|
+
* @param {boolean} [opt.useEncodeDefaulter]
|
|
36
38
|
*/
|
|
37
39
|
function createListFromArray(source, seriesModel, opt) {
|
|
38
40
|
opt = opt || {};
|
|
@@ -44,14 +46,14 @@ function createListFromArray(source, seriesModel, opt) {
|
|
|
44
46
|
var coordSysName = seriesModel.get('coordinateSystem');
|
|
45
47
|
var registeredCoordSys = CoordinateSystem.get(coordSysName);
|
|
46
48
|
|
|
47
|
-
var
|
|
49
|
+
var coordSysInfo = getCoordSysInfoBySeries(seriesModel);
|
|
48
50
|
|
|
49
51
|
var coordSysDimDefs;
|
|
50
52
|
|
|
51
|
-
if (
|
|
52
|
-
coordSysDimDefs = zrUtil.map(
|
|
53
|
+
if (coordSysInfo) {
|
|
54
|
+
coordSysDimDefs = zrUtil.map(coordSysInfo.coordSysDims, function (dim) {
|
|
53
55
|
var dimInfo = {name: dim};
|
|
54
|
-
var axisModel =
|
|
56
|
+
var axisModel = coordSysInfo.axisMap.get(dim);
|
|
55
57
|
if (axisModel) {
|
|
56
58
|
var axisType = axisModel.get('type');
|
|
57
59
|
dimInfo.type = getDimensionTypeByAxis(axisType);
|
|
@@ -72,14 +74,17 @@ function createListFromArray(source, seriesModel, opt) {
|
|
|
72
74
|
|
|
73
75
|
var dimInfoList = createDimensions(source, {
|
|
74
76
|
coordDimensions: coordSysDimDefs,
|
|
75
|
-
generateCoord: opt.generateCoord
|
|
77
|
+
generateCoord: opt.generateCoord,
|
|
78
|
+
encodeDefaulter: opt.useEncodeDefaulter
|
|
79
|
+
? zrUtil.curry(makeSeriesEncodeForAxisCoordSys, coordSysDimDefs, seriesModel)
|
|
80
|
+
: null
|
|
76
81
|
});
|
|
77
82
|
|
|
78
83
|
var firstCategoryDimIndex;
|
|
79
84
|
var hasNameEncode;
|
|
80
|
-
|
|
85
|
+
coordSysInfo && zrUtil.each(dimInfoList, function (dimInfo, dimIndex) {
|
|
81
86
|
var coordDim = dimInfo.coordDim;
|
|
82
|
-
var categoryAxisModel =
|
|
87
|
+
var categoryAxisModel = coordSysInfo.categoryAxisMap.get(coordDim);
|
|
83
88
|
if (categoryAxisModel) {
|
|
84
89
|
if (firstCategoryDimIndex == null) {
|
|
85
90
|
firstCategoryDimIndex = dimIndex;
|
|
@@ -32,8 +32,11 @@ export default function () {
|
|
|
32
32
|
var originalLarge = fields.large;
|
|
33
33
|
var originalProgressive = fields.progressiveRender;
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
// FIXME: if the planner works on a filtered series, `pipelineContext` does not
|
|
36
|
+
// exists. See #11611 . Probably we need to modify this structure, see the comment
|
|
37
|
+
// on `performRawSeries` in `Schedular.js`.
|
|
38
|
+
var large = fields.large = pipelineContext && pipelineContext.large;
|
|
39
|
+
var progressive = fields.progressiveRender = pipelineContext && pipelineContext.progressiveRender;
|
|
37
40
|
|
|
38
41
|
return !!((originalLarge ^ large) || (originalProgressive ^ progressive)) && 'reset';
|
|
39
42
|
};
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
import createListSimply from '../helper/createListSimply';
|
|
22
22
|
import * as zrUtil from 'zrender/src/core/util';
|
|
23
23
|
import {getDimensionTypeByAxis} from '../../data/helper/dimensionHelper';
|
|
24
|
+
import {makeSeriesEncodeForAxisCoordSys} from '../../data/helper/sourceHelper';
|
|
24
25
|
|
|
25
26
|
export var seriesModelMixin = {
|
|
26
27
|
|
|
@@ -47,7 +48,7 @@ export var seriesModelMixin = {
|
|
|
47
48
|
var addOrdinal;
|
|
48
49
|
|
|
49
50
|
// FIXME
|
|
50
|
-
//
|
|
51
|
+
// Consider time axis.
|
|
51
52
|
|
|
52
53
|
if (xAxisType === 'category') {
|
|
53
54
|
option.layout = 'horizontal';
|
|
@@ -95,25 +96,29 @@ export var seriesModelMixin = {
|
|
|
95
96
|
}
|
|
96
97
|
|
|
97
98
|
var defaultValueDimensions = this.defaultValueDimensions;
|
|
99
|
+
var coordDimensions = [{
|
|
100
|
+
name: baseAxisDim,
|
|
101
|
+
type: getDimensionTypeByAxis(baseAxisType),
|
|
102
|
+
ordinalMeta: ordinalMeta,
|
|
103
|
+
otherDims: {
|
|
104
|
+
tooltip: false,
|
|
105
|
+
itemName: 0
|
|
106
|
+
},
|
|
107
|
+
dimsDef: ['base']
|
|
108
|
+
}, {
|
|
109
|
+
name: otherAxisDim,
|
|
110
|
+
type: getDimensionTypeByAxis(otherAxisType),
|
|
111
|
+
dimsDef: defaultValueDimensions.slice()
|
|
112
|
+
}];
|
|
98
113
|
|
|
99
114
|
return createListSimply(
|
|
100
115
|
this,
|
|
101
116
|
{
|
|
102
|
-
coordDimensions:
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
tooltip: false,
|
|
108
|
-
itemName: 0
|
|
109
|
-
},
|
|
110
|
-
dimsDef: ['base']
|
|
111
|
-
}, {
|
|
112
|
-
name: otherAxisDim,
|
|
113
|
-
type: getDimensionTypeByAxis(otherAxisType),
|
|
114
|
-
dimsDef: defaultValueDimensions.slice()
|
|
115
|
-
}],
|
|
116
|
-
dimensionsCount: defaultValueDimensions.length + 1
|
|
117
|
+
coordDimensions: coordDimensions,
|
|
118
|
+
dimensionsCount: defaultValueDimensions.length + 1,
|
|
119
|
+
encodeDefaulter: zrUtil.curry(
|
|
120
|
+
makeSeriesEncodeForAxisCoordSys, coordDimensions, this
|
|
121
|
+
)
|
|
117
122
|
}
|
|
118
123
|
);
|
|
119
124
|
},
|
|
@@ -34,7 +34,7 @@ export default SeriesModel.extend({
|
|
|
34
34
|
throw new Error('Line not support coordinateSystem besides cartesian and polar');
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
return createListFromArray(this.getSource(), this);
|
|
37
|
+
return createListFromArray(this.getSource(), this, {useEncodeDefaulter: true});
|
|
38
38
|
},
|
|
39
39
|
|
|
40
40
|
defaultOption: {
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
|
|
22
22
|
import {__DEV__} from '../../config';
|
|
23
23
|
import * as zrUtil from 'zrender/src/core/util';
|
|
24
|
+
import {fromPoints} from 'zrender/src/core/bbox';
|
|
24
25
|
import SymbolDraw from '../helper/SymbolDraw';
|
|
25
26
|
import SymbolClz from '../helper/Symbol';
|
|
26
27
|
import lineAnimationDiff from './lineAnimationDiff';
|
|
@@ -45,6 +46,26 @@ function isPointsSame(points1, points2) {
|
|
|
45
46
|
return true;
|
|
46
47
|
}
|
|
47
48
|
|
|
49
|
+
function getBoundingDiff(points1, points2) {
|
|
50
|
+
var min1 = [];
|
|
51
|
+
var max1 = [];
|
|
52
|
+
|
|
53
|
+
var min2 = [];
|
|
54
|
+
var max2 = [];
|
|
55
|
+
|
|
56
|
+
fromPoints(points1, min1, max1);
|
|
57
|
+
fromPoints(points2, min2, max2);
|
|
58
|
+
|
|
59
|
+
// Get a max value from each corner of two boundings.
|
|
60
|
+
return Math.max(
|
|
61
|
+
Math.abs(min1[0] - min2[0]),
|
|
62
|
+
Math.abs(min1[1] - min2[1]),
|
|
63
|
+
|
|
64
|
+
Math.abs(max1[0] - max2[0]),
|
|
65
|
+
Math.abs(max1[1] - max2[1])
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
|
|
48
69
|
function getSmooth(smooth) {
|
|
49
70
|
return typeof (smooth) === 'number' ? smooth : (smooth ? 0.5 : 0);
|
|
50
71
|
}
|
|
@@ -354,7 +375,7 @@ export default ChartView.extend({
|
|
|
354
375
|
// FIXME step not support polar
|
|
355
376
|
var step = !isCoordSysPolar && seriesModel.get('step');
|
|
356
377
|
var clipShapeForSymbol;
|
|
357
|
-
if (coordSys && coordSys.getArea) {
|
|
378
|
+
if (coordSys && coordSys.getArea && seriesModel.get('clip', true)) {
|
|
358
379
|
clipShapeForSymbol = coordSys.getArea();
|
|
359
380
|
// Avoid float number rounding error for symbol on the edge of axis extent.
|
|
360
381
|
// See #7913 and `test/dataZoom-clip.html`.
|
|
@@ -369,6 +390,7 @@ export default ChartView.extend({
|
|
|
369
390
|
clipShapeForSymbol.r1 += 0.5;
|
|
370
391
|
}
|
|
371
392
|
}
|
|
393
|
+
this._clipShapeForSymbol = clipShapeForSymbol;
|
|
372
394
|
// Initialization animation or coordinate system changed
|
|
373
395
|
if (
|
|
374
396
|
!(polyline && prevCoordSys.type === coordSys.type && step === this._step)
|
|
@@ -521,6 +543,10 @@ export default ChartView.extend({
|
|
|
521
543
|
// Null data
|
|
522
544
|
return;
|
|
523
545
|
}
|
|
546
|
+
// fix #11360: should't draw symbol outside clipShapeForSymbol
|
|
547
|
+
if (this._clipShapeForSymbol && !this._clipShapeForSymbol.contain(pt[0], pt[1])) {
|
|
548
|
+
return;
|
|
549
|
+
}
|
|
524
550
|
symbol = new SymbolClz(data, dataIndex);
|
|
525
551
|
symbol.position = pt;
|
|
526
552
|
symbol.setZ(
|
|
@@ -652,6 +678,24 @@ export default ChartView.extend({
|
|
|
652
678
|
next = turnPointsIntoStep(diff.next, coordSys, step);
|
|
653
679
|
stackedOnNext = turnPointsIntoStep(diff.stackedOnNext, coordSys, step);
|
|
654
680
|
}
|
|
681
|
+
// Don't apply animation if diff is large.
|
|
682
|
+
// For better result and avoid memory explosion problems like
|
|
683
|
+
// https://github.com/apache/incubator-echarts/issues/12229
|
|
684
|
+
if (getBoundingDiff(current, next) > 3000
|
|
685
|
+
|| (polygon && getBoundingDiff(stackedOnCurrent, stackedOnNext) > 3000)
|
|
686
|
+
) {
|
|
687
|
+
polyline.setShape({
|
|
688
|
+
points: next
|
|
689
|
+
});
|
|
690
|
+
if (polygon) {
|
|
691
|
+
polygon.setShape({
|
|
692
|
+
points: next,
|
|
693
|
+
stackedOnPoints: stackedOnNext
|
|
694
|
+
});
|
|
695
|
+
}
|
|
696
|
+
return;
|
|
697
|
+
}
|
|
698
|
+
|
|
655
699
|
// `diff.current` is subset of `current` (which should be ensured by
|
|
656
700
|
// turnPointsIntoStep), so points in `__points` can be updated when
|
|
657
701
|
// points in `current` are update during animation.
|
|
@@ -24,6 +24,7 @@ import {encodeHTML, addCommas} from '../../util/format';
|
|
|
24
24
|
import dataSelectableMixin from '../../component/helper/selectableMixin';
|
|
25
25
|
import {retrieveRawAttr} from '../../data/helper/dataProvider';
|
|
26
26
|
import geoSourceManager from '../../coord/geo/geoSourceManager';
|
|
27
|
+
import {makeSeriesEncodeForNameBased} from '../../data/helper/sourceHelper';
|
|
27
28
|
|
|
28
29
|
var MapSeries = SeriesModel.extend({
|
|
29
30
|
|
|
@@ -46,7 +47,10 @@ var MapSeries = SeriesModel.extend({
|
|
|
46
47
|
seriesGroup: [],
|
|
47
48
|
|
|
48
49
|
getInitialData: function (option) {
|
|
49
|
-
var data = createListSimply(this,
|
|
50
|
+
var data = createListSimply(this, {
|
|
51
|
+
coordDimensions: ['value'],
|
|
52
|
+
encodeDefaulter: zrUtil.curry(makeSeriesEncodeForNameBased, this)
|
|
53
|
+
});
|
|
50
54
|
var valueDim = data.mapDimension('value');
|
|
51
55
|
var dataNameMap = zrUtil.createHashMap();
|
|
52
56
|
var selectTargetList = [];
|
|
@@ -62,7 +66,7 @@ var MapSeries = SeriesModel.extend({
|
|
|
62
66
|
});
|
|
63
67
|
}
|
|
64
68
|
|
|
65
|
-
var geoSource = geoSourceManager.load(this.getMapType(), this.option.nameMap);
|
|
69
|
+
var geoSource = geoSourceManager.load(this.getMapType(), this.option.nameMap, this.option.nameProperty);
|
|
66
70
|
zrUtil.each(geoSource.regions, function (region) {
|
|
67
71
|
var name = region.name;
|
|
68
72
|
if (!dataNameMap.get(name)) {
|
|
@@ -252,7 +256,8 @@ var MapSeries = SeriesModel.extend({
|
|
|
252
256
|
itemStyle: {
|
|
253
257
|
areaColor: 'rgba(255,215,0,0.8)'
|
|
254
258
|
}
|
|
255
|
-
}
|
|
259
|
+
},
|
|
260
|
+
nameProperty: 'name'
|
|
256
261
|
}
|
|
257
262
|
|
|
258
263
|
});
|
|
@@ -24,6 +24,8 @@ import * as modelUtil from '../../util/model';
|
|
|
24
24
|
import {getPercentWithPrecision} from '../../util/number';
|
|
25
25
|
import dataSelectableMixin from '../../component/helper/selectableMixin';
|
|
26
26
|
import {retrieveRawAttr} from '../../data/helper/dataProvider';
|
|
27
|
+
import {makeSeriesEncodeForNameBased} from '../../data/helper/sourceHelper';
|
|
28
|
+
import LegendVisualProvider from '../../visual/LegendVisualProvider';
|
|
27
29
|
|
|
28
30
|
|
|
29
31
|
var PieSeries = echarts.extendSeriesModel({
|
|
@@ -36,9 +38,9 @@ var PieSeries = echarts.extendSeriesModel({
|
|
|
36
38
|
|
|
37
39
|
// Enable legend selection for each data item
|
|
38
40
|
// Use a function instead of direct access because data reference may changed
|
|
39
|
-
this.
|
|
40
|
-
|
|
41
|
-
|
|
41
|
+
this.legendVisualProvider = new LegendVisualProvider(
|
|
42
|
+
zrUtil.bind(this.getData, this), zrUtil.bind(this.getRawData, this)
|
|
43
|
+
);
|
|
42
44
|
|
|
43
45
|
this.updateSelectedMap(this._createSelectableList());
|
|
44
46
|
|
|
@@ -53,7 +55,10 @@ var PieSeries = echarts.extendSeriesModel({
|
|
|
53
55
|
},
|
|
54
56
|
|
|
55
57
|
getInitialData: function (option, ecModel) {
|
|
56
|
-
return createListSimply(this,
|
|
58
|
+
return createListSimply(this, {
|
|
59
|
+
coordDimensions: ['value'],
|
|
60
|
+
encodeDefaulter: zrUtil.curry(makeSeriesEncodeForNameBased, this)
|
|
61
|
+
});
|
|
57
62
|
},
|
|
58
63
|
|
|
59
64
|
_createSelectableList: function () {
|
|
@@ -142,12 +147,28 @@ var PieSeries = echarts.extendSeriesModel({
|
|
|
142
147
|
|
|
143
148
|
// cursor: null,
|
|
144
149
|
|
|
150
|
+
left: 0,
|
|
151
|
+
top: 0,
|
|
152
|
+
right: 0,
|
|
153
|
+
bottom: 0,
|
|
154
|
+
width: null,
|
|
155
|
+
height: null,
|
|
156
|
+
|
|
145
157
|
label: {
|
|
146
158
|
// If rotate around circle
|
|
147
159
|
rotate: false,
|
|
148
160
|
show: true,
|
|
149
161
|
// 'outer', 'inside', 'center'
|
|
150
|
-
position: 'outer'
|
|
162
|
+
position: 'outer',
|
|
163
|
+
// 'none', 'labelLine', 'edge'. Works only when position is 'outer'
|
|
164
|
+
alignTo: 'none',
|
|
165
|
+
// Closest distance between label and chart edge.
|
|
166
|
+
// Works only position is 'outer' and alignTo is 'edge'.
|
|
167
|
+
margin: '25%',
|
|
168
|
+
// Works only position is 'outer' and alignTo is not 'edge'.
|
|
169
|
+
bleedMargin: 10,
|
|
170
|
+
// Distance between text and label line.
|
|
171
|
+
distanceToLabelLine: 5
|
|
151
172
|
// formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调
|
|
152
173
|
// 默认使用全局文本样式,详见TEXTSTYLE
|
|
153
174
|
// distance: 当position为inner时有效,为label位置到圆心的距离与圆半径(环状图为内外半径和)的比例系数
|
package/src/chart/pie/PieView.js
CHANGED
|
@@ -171,7 +171,7 @@ piePieceProto.updateData = function (data, idx, firstCreate) {
|
|
|
171
171
|
toggleItemSelected(
|
|
172
172
|
this,
|
|
173
173
|
data.getItemLayout(idx),
|
|
174
|
-
seriesModel.isSelected(
|
|
174
|
+
seriesModel.isSelected(data.getName(idx)),
|
|
175
175
|
seriesModel.get('selectedOffset'),
|
|
176
176
|
seriesModel.get('animation')
|
|
177
177
|
);
|
|
@@ -180,31 +180,36 @@ piePieceProto.updateData = function (data, idx, firstCreate) {
|
|
|
180
180
|
var withAnimation = !firstCreate && animationTypeUpdate === 'transition';
|
|
181
181
|
this._updateLabel(data, idx, withAnimation);
|
|
182
182
|
|
|
183
|
-
this.highDownOnUpdate =
|
|
183
|
+
this.highDownOnUpdate = !seriesModel.get('silent')
|
|
184
184
|
? function (fromState, toState) {
|
|
185
|
+
var hasAnimation = seriesModel.isAnimationEnabled() && itemModel.get('hoverAnimation');
|
|
185
186
|
if (toState === 'emphasis') {
|
|
186
187
|
labelLine.ignore = labelLine.hoverIgnore;
|
|
187
188
|
labelText.ignore = labelText.hoverIgnore;
|
|
188
189
|
|
|
189
190
|
// Sector may has animation of updating data. Force to move to the last frame
|
|
190
191
|
// Or it may stopped on the wrong shape
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
192
|
+
if (hasAnimation) {
|
|
193
|
+
sector.stopAnimation(true);
|
|
194
|
+
sector.animateTo({
|
|
195
|
+
shape: {
|
|
196
|
+
r: layout.r + seriesModel.get('hoverOffset')
|
|
197
|
+
}
|
|
198
|
+
}, 300, 'elasticOut');
|
|
199
|
+
}
|
|
197
200
|
}
|
|
198
201
|
else {
|
|
199
202
|
labelLine.ignore = labelLine.normalIgnore;
|
|
200
203
|
labelText.ignore = labelText.normalIgnore;
|
|
201
204
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
205
|
+
if (hasAnimation) {
|
|
206
|
+
sector.stopAnimation(true);
|
|
207
|
+
sector.animateTo({
|
|
208
|
+
shape: {
|
|
209
|
+
r: layout.r
|
|
210
|
+
}
|
|
211
|
+
}, 300, 'elasticOut');
|
|
212
|
+
}
|
|
208
213
|
}
|
|
209
214
|
}
|
|
210
215
|
: null;
|
|
@@ -273,7 +278,7 @@ piePieceProto._updateLabel = function (data, idx, withAnimation) {
|
|
|
273
278
|
{
|
|
274
279
|
labelFetcher: data.hostModel,
|
|
275
280
|
labelDataIndex: idx,
|
|
276
|
-
defaultText:
|
|
281
|
+
defaultText: labelLayout.text,
|
|
277
282
|
autoColor: visualColor,
|
|
278
283
|
useInsideStyle: !!labelLayout.inside
|
|
279
284
|
},
|