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.
Files changed (256) hide show
  1. package/.github/pull_request_template.md +66 -0
  2. package/.github/workflows/nodejs.yml +12 -2
  3. package/CONTRIBUTING.md +16 -160
  4. package/NOTICE +1 -1
  5. package/README.md +2 -2
  6. package/dist/echarts-en.common.js +2808 -1188
  7. package/dist/echarts-en.common.min.js +1 -1
  8. package/dist/echarts-en.js +3559 -1437
  9. package/dist/echarts-en.js.map +1 -1
  10. package/dist/echarts-en.min.js +1 -1
  11. package/dist/echarts-en.simple.js +2453 -1002
  12. package/dist/echarts-en.simple.min.js +1 -1
  13. package/dist/echarts.common.js +2782 -1188
  14. package/dist/echarts.common.min.js +1 -1
  15. package/dist/echarts.js +3533 -1437
  16. package/dist/echarts.js.map +1 -1
  17. package/dist/echarts.min.js +1 -1
  18. package/dist/echarts.simple.js +2427 -1002
  19. package/dist/echarts.simple.min.js +1 -1
  20. package/dist/extension/bmap.js +336 -2
  21. package/dist/extension/bmap.js.map +1 -1
  22. package/dist/extension/bmap.min.js +1 -1
  23. package/extension/bmap/BMapView.js +6 -2
  24. package/extension-src/bmap/BMapView.js +3 -2
  25. package/lib/chart/bar/BarSeries.js +14 -1
  26. package/lib/chart/bar/BarView.js +161 -16
  27. package/lib/chart/bar/BaseBarSeries.js +3 -1
  28. package/lib/chart/candlestick/candlestickVisual.js +1 -1
  29. package/lib/chart/effectScatter/EffectScatterSeries.js +3 -1
  30. package/lib/chart/funnel/FunnelSeries.js +13 -5
  31. package/lib/chart/gauge/GaugeSeries.js +0 -2
  32. package/lib/chart/graph/GraphSeries.js +11 -5
  33. package/lib/chart/graph/GraphView.js +30 -12
  34. package/lib/chart/heatmap/HeatmapView.js +4 -4
  35. package/lib/chart/helper/EffectLine.js +23 -1
  36. package/lib/chart/helper/EffectSymbol.js +2 -1
  37. package/lib/chart/helper/Line.js +94 -33
  38. package/lib/chart/helper/LineDraw.js +5 -1
  39. package/lib/chart/helper/Symbol.js +1 -2
  40. package/lib/chart/helper/createClipPathFromCoordSys.js +4 -1
  41. package/lib/chart/helper/createListFromArray.js +14 -8
  42. package/lib/chart/helper/createRenderPlanner.js +6 -3
  43. package/lib/chart/helper/whiskerBoxCommon.js +22 -16
  44. package/lib/chart/line/LineSeries.js +3 -1
  45. package/lib/chart/line/LineView.js +41 -2
  46. package/lib/chart/map/MapSeries.js +11 -3
  47. package/lib/chart/pie/PieSeries.js +27 -6
  48. package/lib/chart/pie/PieView.js +22 -15
  49. package/lib/chart/pie/labelLayout.js +102 -19
  50. package/lib/chart/pie/pieLayout.js +19 -7
  51. package/lib/chart/radar/RadarSeries.js +23 -3
  52. package/lib/chart/sankey/SankeySeries.js +13 -1
  53. package/lib/chart/sankey/SankeyView.js +70 -32
  54. package/lib/chart/sankey/sankeyLayout.js +22 -3
  55. package/lib/chart/scatter/ScatterSeries.js +3 -1
  56. package/lib/chart/sunburst/SunburstPiece.js +1 -0
  57. package/lib/chart/sunburst/SunburstSeries.js +12 -7
  58. package/lib/chart/sunburst/SunburstView.js +5 -1
  59. package/lib/chart/themeRiver/ThemeRiverSeries.js +3 -3
  60. package/lib/chart/tree/TreeSeries.js +20 -3
  61. package/lib/chart/tree/TreeView.js +151 -25
  62. package/lib/chart/treemap/TreemapSeries.js +15 -3
  63. package/lib/chart/treemap/TreemapView.js +80 -38
  64. package/lib/component/axis/AngleAxisView.js +64 -7
  65. package/lib/component/axis/AxisBuilder.js +62 -24
  66. package/lib/component/axis/CartesianAxisView.js +52 -85
  67. package/lib/component/axis/RadiusAxisView.js +36 -4
  68. package/lib/component/axis/SingleAxisView.js +21 -6
  69. package/lib/component/axis/axisSplitHelper.js +132 -0
  70. package/lib/component/brush/BrushView.js +11 -1
  71. package/lib/component/brush/visualEncoding.js +13 -2
  72. package/lib/component/dataZoom/SliderZoomView.js +4 -10
  73. package/lib/component/helper/BrushController.js +33 -43
  74. package/lib/component/helper/MapDraw.js +30 -4
  75. package/lib/component/legend/LegendModel.js +3 -3
  76. package/lib/component/legend/LegendView.js +17 -13
  77. package/lib/component/legend/ScrollableLegendView.js +18 -18
  78. package/lib/component/marker/MarkLineModel.js +2 -1
  79. package/lib/component/marker/markerHelper.js +7 -4
  80. package/lib/component/title.js +6 -2
  81. package/lib/component/toolbox/ToolboxView.js +5 -1
  82. package/lib/component/toolbox/feature/MagicType.js +20 -14
  83. package/lib/component/toolbox/feature/SaveAsImage.js +2 -1
  84. package/lib/component/tooltip/TooltipContent.js +60 -23
  85. package/lib/component/tooltip/TooltipView.js +7 -8
  86. package/lib/component/visualMap/PiecewiseModel.js +3 -6
  87. package/lib/coord/Axis.js +30 -2
  88. package/lib/coord/View.js +9 -0
  89. package/lib/coord/axisDefault.js +21 -2
  90. package/lib/coord/axisHelper.js +22 -16
  91. package/lib/coord/calendar/Calendar.js +8 -4
  92. package/lib/coord/geo/geoJSONLoader.js +3 -2
  93. package/lib/coord/geo/geoSourceManager.js +3 -2
  94. package/lib/coord/geo/parseGeoJson.js +3 -2
  95. package/lib/coord/radar/Radar.js +5 -5
  96. package/lib/data/DataDimensionInfo.js +157 -0
  97. package/lib/data/List.js +25 -19
  98. package/lib/data/Tree.js +9 -19
  99. package/lib/data/helper/completeDimensions.js +43 -32
  100. package/lib/data/helper/createDimensions.js +2 -0
  101. package/lib/data/helper/sourceHelper.js +214 -114
  102. package/lib/echarts.js +57 -34
  103. package/lib/langEN.js +26 -0
  104. package/lib/layout/barGrid.js +19 -13
  105. package/lib/layout/barPolar.js +0 -5
  106. package/lib/loading/default.js +43 -27
  107. package/lib/model/Series.js +4 -4
  108. package/lib/model/referHelper.js +40 -12
  109. package/lib/scale/Interval.js +87 -2
  110. package/lib/scale/Log.js +9 -2
  111. package/lib/scale/helper.js +1 -43
  112. package/lib/stream/Scheduler.js +9 -1
  113. package/lib/theme/dark.js +3 -0
  114. package/lib/util/format.js +19 -2
  115. package/lib/util/graphic.js +14 -12
  116. package/lib/visual/LegendVisualProvider.js +75 -0
  117. package/lib/visual/dataColor.js +2 -12
  118. package/lib/visual/seriesColor.js +15 -7
  119. package/lib/visual/symbol.js +12 -2
  120. package/map/js/china.js +1 -1
  121. package/map/js/province/chongqing.js +1 -1
  122. package/map/js/province/gansu.js +2 -2
  123. package/map/js/province/tianjin.js +1 -28
  124. package/map/json/china.json +1 -1
  125. package/map/json/province/chongqing.json +1 -1
  126. package/map/json/province/tianjin.json +1 -1
  127. package/package.json +11 -6
  128. package/src/chart/bar/BarSeries.js +15 -1
  129. package/src/chart/bar/BarView.js +162 -15
  130. package/src/chart/bar/BaseBarSeries.js +1 -1
  131. package/src/chart/candlestick/candlestickVisual.js +1 -1
  132. package/src/chart/effectScatter/EffectScatterSeries.js +1 -1
  133. package/src/chart/funnel/FunnelSeries.js +10 -4
  134. package/src/chart/gauge/GaugeSeries.js +0 -1
  135. package/src/chart/graph/GraphSeries.js +10 -4
  136. package/src/chart/graph/GraphView.js +28 -10
  137. package/src/chart/heatmap/HeatmapView.js +4 -4
  138. package/src/chart/helper/EffectLine.js +23 -1
  139. package/src/chart/helper/EffectSymbol.js +2 -1
  140. package/src/chart/helper/Line.js +84 -26
  141. package/src/chart/helper/LineDraw.js +5 -1
  142. package/src/chart/helper/Symbol.js +2 -2
  143. package/src/chart/helper/createClipPathFromCoordSys.js +4 -0
  144. package/src/chart/helper/createListFromArray.js +13 -8
  145. package/src/chart/helper/createRenderPlanner.js +5 -2
  146. package/src/chart/helper/whiskerBoxCommon.js +21 -16
  147. package/src/chart/line/LineSeries.js +1 -1
  148. package/src/chart/line/LineView.js +45 -1
  149. package/src/chart/map/MapSeries.js +8 -3
  150. package/src/chart/pie/PieSeries.js +26 -5
  151. package/src/chart/pie/PieView.js +20 -15
  152. package/src/chart/pie/labelLayout.js +114 -22
  153. package/src/chart/pie/pieLayout.js +20 -7
  154. package/src/chart/radar/RadarSeries.js +27 -3
  155. package/src/chart/sankey/SankeySeries.js +12 -1
  156. package/src/chart/sankey/SankeyView.js +75 -30
  157. package/src/chart/sankey/sankeyLayout.js +25 -5
  158. package/src/chart/scatter/ScatterSeries.js +1 -1
  159. package/src/chart/sunburst/SunburstPiece.js +2 -0
  160. package/src/chart/sunburst/SunburstSeries.js +12 -7
  161. package/src/chart/sunburst/SunburstView.js +2 -1
  162. package/src/chart/themeRiver/ThemeRiverSeries.js +4 -3
  163. package/src/chart/tree/TreeSeries.js +19 -6
  164. package/src/chart/tree/TreeView.js +155 -22
  165. package/src/chart/treemap/TreemapSeries.js +15 -5
  166. package/src/chart/treemap/TreemapView.js +77 -41
  167. package/src/component/axis/AngleAxisView.js +75 -7
  168. package/src/component/axis/AxisBuilder.js +77 -32
  169. package/src/component/axis/CartesianAxisView.js +47 -83
  170. package/src/component/axis/RadiusAxisView.js +37 -4
  171. package/src/component/axis/SingleAxisView.js +21 -4
  172. package/src/component/axis/axisSplitHelper.js +114 -0
  173. package/src/component/brush/BrushView.js +8 -1
  174. package/src/component/brush/visualEncoding.js +6 -3
  175. package/src/component/dataZoom/SliderZoomView.js +4 -9
  176. package/src/component/helper/BrushController.js +40 -47
  177. package/src/component/helper/MapDraw.js +27 -4
  178. package/src/component/legend/LegendModel.js +3 -3
  179. package/src/component/legend/LegendView.js +18 -12
  180. package/src/component/legend/ScrollableLegendView.js +18 -16
  181. package/src/component/marker/MarkLineModel.js +2 -1
  182. package/src/component/marker/markerHelper.js +8 -5
  183. package/src/component/title.js +3 -2
  184. package/src/component/toolbox/ToolboxView.js +5 -0
  185. package/src/component/toolbox/feature/MagicType.js +19 -13
  186. package/src/component/toolbox/feature/SaveAsImage.js +2 -1
  187. package/src/component/tooltip/TooltipContent.js +59 -22
  188. package/src/component/tooltip/TooltipView.js +10 -8
  189. package/src/component/visualMap/PiecewiseModel.js +5 -9
  190. package/src/coord/Axis.js +29 -2
  191. package/src/coord/View.js +10 -1
  192. package/src/coord/axisDefault.js +25 -1
  193. package/src/coord/axisHelper.js +26 -19
  194. package/src/coord/calendar/Calendar.js +12 -5
  195. package/src/coord/geo/geoJSONLoader.js +3 -2
  196. package/src/coord/geo/geoSourceManager.js +3 -2
  197. package/src/coord/geo/parseGeoJson.js +3 -2
  198. package/src/coord/radar/Radar.js +6 -8
  199. package/src/data/DataDimensionInfo.js +135 -0
  200. package/src/data/List.js +29 -16
  201. package/src/data/Tree.js +12 -17
  202. package/src/data/helper/completeDimensions.js +49 -30
  203. package/src/data/helper/createDimensions.js +2 -0
  204. package/src/data/helper/sourceHelper.js +216 -124
  205. package/src/echarts.js +60 -36
  206. package/src/langEN.js +26 -0
  207. package/src/layout/barGrid.js +22 -10
  208. package/src/layout/barPolar.js +0 -4
  209. package/src/loading/default.js +46 -34
  210. package/src/model/Series.js +4 -4
  211. package/src/model/referHelper.js +34 -11
  212. package/src/scale/Interval.js +84 -4
  213. package/src/scale/Log.js +9 -2
  214. package/src/scale/helper.js +1 -39
  215. package/src/stream/Scheduler.js +8 -0
  216. package/src/theme/dark.js +3 -0
  217. package/src/util/format.js +17 -1
  218. package/src/util/graphic.js +13 -11
  219. package/src/visual/LegendVisualProvider.js +55 -0
  220. package/src/visual/dataColor.js +0 -13
  221. package/src/visual/seriesColor.js +13 -7
  222. package/src/visual/symbol.js +11 -2
  223. package/theme/azul.js +163 -0
  224. package/theme/bee-inspired.js +178 -0
  225. package/theme/blue.js +178 -0
  226. package/theme/caravan.js +178 -0
  227. package/theme/carp.js +163 -0
  228. package/theme/cool.js +180 -0
  229. package/theme/dark-blue.js +168 -0
  230. package/theme/dark-bold.js +168 -0
  231. package/theme/dark-digerati.js +168 -0
  232. package/theme/dark-fresh-cut.js +168 -0
  233. package/theme/dark-mushroom.js +168 -0
  234. package/theme/dark.js +69 -62
  235. package/theme/eduardo.js +178 -0
  236. package/theme/forest.js +163 -0
  237. package/theme/fresh-cut.js +163 -0
  238. package/theme/fruit.js +178 -0
  239. package/theme/gray.js +220 -0
  240. package/theme/green.js +222 -0
  241. package/theme/helianthus.js +263 -0
  242. package/theme/infographic.js +72 -57
  243. package/theme/inspired.js +163 -0
  244. package/theme/jazz.js +163 -0
  245. package/theme/london.js +163 -0
  246. package/theme/macarons.js +80 -57
  247. package/theme/macarons2.js +251 -0
  248. package/theme/mint.js +155 -0
  249. package/theme/red-velvet.js +163 -0
  250. package/theme/red.js +225 -0
  251. package/theme/roma.js +55 -22
  252. package/theme/royal.js +163 -0
  253. package/theme/sakura.js +140 -0
  254. package/theme/shine.js +52 -45
  255. package/theme/tech-blue.js +180 -0
  256. 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
- rippleGroup.rotation = (itemModel.getShallow('symbolRotate') || 0) * Math.PI / 180 || 0;
186
+ var symbolRotate = data.getItemVisual(idx, 'symbolRotate');
187
+ rippleGroup.rotation = (symbolRotate || 0) * Math.PI / 180 || 0;
187
188
 
188
189
  var effectCfg = {};
189
190
 
@@ -141,39 +141,90 @@ function updateSymbolAndLabelBeforeLineUpdate() {
141
141
  var textPosition;
142
142
  var textAlign;
143
143
  var textVerticalAlign;
144
-
145
- var distance = 5 * invScale;
146
- // End
147
- if (label.__position === 'end') {
148
- textPosition = [d[0] * distance + toPos[0], d[1] * distance + toPos[1]];
149
- textAlign = d[0] > 0.8 ? 'left' : (d[0] < -0.8 ? 'right' : 'center');
150
- textVerticalAlign = d[1] > 0.8 ? 'top' : (d[1] < -0.8 ? 'bottom' : 'middle');
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
- // Middle
153
- else if (label.__position === 'middle') {
154
- var halfPercent = percent / 2;
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
- // Start
172
- else {
173
- textPosition = [-d[0] * distance + fromPos[0], -d[1] * distance + fromPos[1]];
174
- textAlign = d[0] > 0.8 ? 'right' : (d[0] < -0.8 ? 'left' : 'center');
175
- textVerticalAlign = d[1] > 0.8 ? 'bottom' : (d[1] < -0.8 ? 'top' : 'middle');
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 {getCoordSysDefineBySeries} from '../../model/referHelper';
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 coordSysDefine = getCoordSysDefineBySeries(seriesModel);
49
+ var coordSysInfo = getCoordSysInfoBySeries(seriesModel);
48
50
 
49
51
  var coordSysDimDefs;
50
52
 
51
- if (coordSysDefine) {
52
- coordSysDimDefs = zrUtil.map(coordSysDefine.coordSysDims, function (dim) {
53
+ if (coordSysInfo) {
54
+ coordSysDimDefs = zrUtil.map(coordSysInfo.coordSysDims, function (dim) {
53
55
  var dimInfo = {name: dim};
54
- var axisModel = coordSysDefine.axisMap.get(dim);
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
- coordSysDefine && zrUtil.each(dimInfoList, function (dimInfo, dimIndex) {
85
+ coordSysInfo && zrUtil.each(dimInfoList, function (dimInfo, dimIndex) {
81
86
  var coordDim = dimInfo.coordDim;
82
- var categoryAxisModel = coordSysDefine.categoryAxisMap.get(coordDim);
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
- var large = fields.large = pipelineContext.large;
36
- var progressive = fields.progressiveRender = pipelineContext.progressiveRender;
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
- name: baseAxisDim,
104
- type: getDimensionTypeByAxis(baseAxisType),
105
- ordinalMeta: ordinalMeta,
106
- otherDims: {
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, ['value']);
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.legendDataProvider = function () {
40
- return this.getRawData();
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, ['value']);
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位置到圆心的距离与圆半径(环状图为内外半径和)的比例系数
@@ -171,7 +171,7 @@ piePieceProto.updateData = function (data, idx, firstCreate) {
171
171
  toggleItemSelected(
172
172
  this,
173
173
  data.getItemLayout(idx),
174
- seriesModel.isSelected(null, idx),
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 = (itemModel.get('hoverAnimation') && seriesModel.isAnimationEnabled())
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
- sector.stopAnimation(true);
192
- sector.animateTo({
193
- shape: {
194
- r: layout.r + seriesModel.get('hoverOffset')
195
- }
196
- }, 300, 'elasticOut');
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
- sector.stopAnimation(true);
203
- sector.animateTo({
204
- shape: {
205
- r: layout.r
206
- }
207
- }, 300, 'elasticOut');
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: data.getName(idx),
281
+ defaultText: labelLayout.text,
277
282
  autoColor: visualColor,
278
283
  useInsideStyle: !!labelLayout.inside
279
284
  },