echarts 4.5.0 → 4.9.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 (329) hide show
  1. package/.DS_Store +0 -0
  2. package/.gitattributes +3 -0
  3. package/.github/pull_request_template.md +66 -0
  4. package/.github/workflows/nodejs.yml +15 -3
  5. package/.huskyrc +5 -0
  6. package/CONTRIBUTING.md +16 -160
  7. package/NOTICE +1 -1
  8. package/README.md +3 -3
  9. package/asset/.DS_Store +0 -0
  10. package/build/.DS_Store +0 -0
  11. package/dist/echarts-en.common.js +3072 -1261
  12. package/dist/echarts-en.common.min.js +1 -1
  13. package/dist/echarts-en.js +4339 -1685
  14. package/dist/echarts-en.js.map +1 -1
  15. package/dist/echarts-en.min.js +1 -1
  16. package/dist/echarts-en.simple.js +2496 -1011
  17. package/dist/echarts-en.simple.min.js +1 -1
  18. package/dist/echarts.common.js +3046 -1261
  19. package/dist/echarts.common.min.js +1 -1
  20. package/dist/echarts.js +4313 -1685
  21. package/dist/echarts.js.map +1 -1
  22. package/dist/echarts.min.js +1 -1
  23. package/dist/echarts.simple.js +2470 -1011
  24. package/dist/echarts.simple.min.js +1 -1
  25. package/dist/extension/bmap.js +33 -11
  26. package/dist/extension/bmap.js.map +1 -1
  27. package/dist/extension/bmap.min.js +1 -1
  28. package/dist/extension/dataTool.js.map +1 -1
  29. package/extension/.DS_Store +0 -0
  30. package/extension/bmap/BMapCoordSys.js +14 -4
  31. package/extension/bmap/BMapModel.js +4 -0
  32. package/extension/bmap/BMapView.js +18 -10
  33. package/extension-src/bmap/BMapCoordSys.js +14 -4
  34. package/extension-src/bmap/BMapModel.js +6 -1
  35. package/extension-src/bmap/BMapView.js +16 -9
  36. package/lib/chart/bar/BarSeries.js +14 -1
  37. package/lib/chart/bar/BarView.js +196 -18
  38. package/lib/chart/bar/BaseBarSeries.js +3 -1
  39. package/lib/chart/bar/PictorialBarSeries.js +1 -1
  40. package/lib/chart/candlestick/candlestickVisual.js +1 -1
  41. package/lib/chart/effectScatter/EffectScatterSeries.js +3 -1
  42. package/lib/chart/funnel/FunnelSeries.js +14 -5
  43. package/lib/chart/funnel/funnelLayout.js +162 -46
  44. package/lib/chart/gauge/GaugeSeries.js +0 -2
  45. package/lib/chart/graph/GraphSeries.js +23 -7
  46. package/lib/chart/graph/GraphView.js +30 -12
  47. package/lib/chart/graph/circularLayoutHelper.js +8 -2
  48. package/lib/chart/graph/forceLayout.js +6 -1
  49. package/lib/chart/graph/simpleLayout.js +1 -1
  50. package/lib/chart/graph/simpleLayoutHelper.js +10 -4
  51. package/lib/chart/heatmap/HeatmapView.js +4 -4
  52. package/lib/chart/helper/EffectLine.js +23 -1
  53. package/lib/chart/helper/EffectSymbol.js +2 -1
  54. package/lib/chart/helper/Line.js +129 -42
  55. package/lib/chart/helper/LineDraw.js +5 -1
  56. package/lib/chart/helper/Symbol.js +2 -3
  57. package/lib/chart/helper/createClipPathFromCoordSys.js +4 -1
  58. package/lib/chart/helper/createListFromArray.js +14 -8
  59. package/lib/chart/helper/createRenderPlanner.js +6 -3
  60. package/lib/chart/helper/multipleGraphEdgeHelper.js +258 -0
  61. package/lib/chart/helper/whiskerBoxCommon.js +22 -16
  62. package/lib/chart/line/LineSeries.js +3 -1
  63. package/lib/chart/line/LineView.js +41 -2
  64. package/lib/chart/lines/LinesSeries.js +0 -2
  65. package/lib/chart/map/MapSeries.js +14 -5
  66. package/lib/chart/pie/PieSeries.js +27 -6
  67. package/lib/chart/pie/PieView.js +22 -15
  68. package/lib/chart/pie/labelLayout.js +102 -19
  69. package/lib/chart/pie/pieLayout.js +19 -7
  70. package/lib/chart/radar/RadarSeries.js +27 -6
  71. package/lib/chart/radar/RadarView.js +3 -1
  72. package/lib/chart/sankey/SankeySeries.js +13 -1
  73. package/lib/chart/sankey/SankeyView.js +70 -32
  74. package/lib/chart/sankey/sankeyLayout.js +22 -3
  75. package/lib/chart/scatter/ScatterSeries.js +3 -1
  76. package/lib/chart/sunburst/SunburstPiece.js +5 -1
  77. package/lib/chart/sunburst/SunburstSeries.js +29 -12
  78. package/lib/chart/sunburst/SunburstView.js +5 -1
  79. package/lib/chart/themeRiver/ThemeRiverSeries.js +24 -33
  80. package/lib/chart/tree/TreeSeries.js +20 -3
  81. package/lib/chart/tree/TreeView.js +149 -23
  82. package/lib/chart/treemap/TreemapSeries.js +25 -4
  83. package/lib/chart/treemap/TreemapView.js +80 -38
  84. package/lib/chart/treemap/treemapLayout.js +1 -1
  85. package/lib/chart/treemap/treemapVisual.js +9 -15
  86. package/lib/component/axis/AngleAxisView.js +64 -7
  87. package/lib/component/axis/AxisBuilder.js +62 -24
  88. package/lib/component/axis/CartesianAxisView.js +52 -85
  89. package/lib/component/axis/RadiusAxisView.js +36 -4
  90. package/lib/component/axis/SingleAxisView.js +21 -6
  91. package/lib/component/axis/axisSplitHelper.js +132 -0
  92. package/lib/component/axisPointer/axisTrigger.js +1 -1
  93. package/lib/component/brush/BrushView.js +11 -1
  94. package/lib/component/brush/visualEncoding.js +13 -2
  95. package/lib/component/dataZoom/SliderZoomView.js +4 -10
  96. package/lib/component/helper/BrushController.js +33 -43
  97. package/lib/component/helper/MapDraw.js +30 -4
  98. package/lib/component/legend/LegendModel.js +3 -3
  99. package/lib/component/legend/LegendView.js +17 -13
  100. package/lib/component/legend/ScrollableLegendView.js +18 -18
  101. package/lib/component/marker/MarkAreaView.js +53 -15
  102. package/lib/component/marker/MarkLineModel.js +2 -1
  103. package/lib/component/marker/MarkLineView.js +3 -0
  104. package/lib/component/marker/MarkPointView.js +8 -1
  105. package/lib/component/marker/MarkerModel.js +3 -2
  106. package/lib/component/marker/markerHelper.js +7 -4
  107. package/lib/component/timeline/SliderTimelineView.js +7 -1
  108. package/lib/component/title.js +6 -2
  109. package/lib/component/toolbox/ToolboxView.js +5 -1
  110. package/lib/component/toolbox/feature/DataView.js +23 -8
  111. package/lib/component/toolbox/feature/DataZoom.js +6 -6
  112. package/lib/component/toolbox/feature/MagicType.js +20 -14
  113. package/lib/component/toolbox/feature/SaveAsImage.js +4 -2
  114. package/lib/component/tooltip/TooltipContent.js +101 -30
  115. package/lib/component/tooltip/TooltipRichContent.js +56 -8
  116. package/lib/component/tooltip/TooltipView.js +11 -12
  117. package/lib/component/visualMap/PiecewiseModel.js +3 -6
  118. package/lib/component/visualMap/VisualMapModel.js +1 -1
  119. package/lib/coord/Axis.js +30 -2
  120. package/lib/coord/View.js +9 -0
  121. package/lib/coord/axisDefault.js +22 -3
  122. package/lib/coord/axisHelper.js +24 -18
  123. package/lib/coord/calendar/Calendar.js +8 -4
  124. package/lib/coord/geo/GeoModel.js +2 -1
  125. package/lib/coord/geo/geoJSONLoader.js +3 -2
  126. package/lib/coord/geo/geoSourceManager.js +3 -2
  127. package/lib/coord/geo/parseGeoJson.js +3 -2
  128. package/lib/coord/radar/Radar.js +5 -5
  129. package/lib/data/DataDimensionInfo.js +157 -0
  130. package/lib/data/Graph.js +1 -6
  131. package/lib/data/List.js +26 -20
  132. package/lib/data/Tree.js +5 -42
  133. package/lib/data/helper/completeDimensions.js +43 -32
  134. package/lib/data/helper/createDimensions.js +2 -0
  135. package/lib/data/helper/sourceHelper.js +214 -114
  136. package/lib/echarts.js +57 -34
  137. package/lib/langEN.js +26 -0
  138. package/lib/layout/barGrid.js +19 -13
  139. package/lib/layout/barPolar.js +1 -6
  140. package/lib/loading/default.js +43 -27
  141. package/lib/model/Series.js +4 -4
  142. package/lib/model/referHelper.js +40 -12
  143. package/lib/processor/dataSample.js +1 -1
  144. package/lib/scale/Interval.js +87 -2
  145. package/lib/scale/Log.js +9 -2
  146. package/lib/scale/helper.js +1 -43
  147. package/lib/stream/Scheduler.js +10 -2
  148. package/lib/theme/dark.js +3 -0
  149. package/lib/util/format.js +19 -2
  150. package/lib/util/graphic.js +14 -12
  151. package/lib/visual/LegendVisualProvider.js +75 -0
  152. package/lib/visual/VisualMapping.js +1 -1
  153. package/lib/visual/dataColor.js +2 -12
  154. package/lib/visual/seriesColor.js +15 -7
  155. package/lib/visual/symbol.js +12 -2
  156. package/map/.DS_Store +0 -0
  157. package/map/js/.DS_Store +0 -0
  158. package/map/js/china.js +1 -1
  159. package/map/js/province/.DS_Store +0 -0
  160. package/map/js/province/chongqing.js +1 -1
  161. package/map/js/province/gansu.js +2 -2
  162. package/map/js/province/tianjin.js +1 -28
  163. package/map/json/.DS_Store +0 -0
  164. package/map/json/china.json +1 -1
  165. package/map/json/province/chongqing.json +1 -1
  166. package/map/json/province/tianjin.json +1 -1
  167. package/package.json +12 -6
  168. package/src/.DS_Store +0 -0
  169. package/src/chart/.DS_Store +0 -0
  170. package/src/chart/bar/BarSeries.js +15 -1
  171. package/src/chart/bar/BarView.js +198 -17
  172. package/src/chart/bar/BaseBarSeries.js +1 -1
  173. package/src/chart/bar/PictorialBarSeries.js +2 -2
  174. package/src/chart/candlestick/candlestickVisual.js +1 -1
  175. package/src/chart/effectScatter/EffectScatterSeries.js +1 -1
  176. package/src/chart/funnel/FunnelSeries.js +11 -4
  177. package/src/chart/funnel/funnelLayout.js +179 -53
  178. package/src/chart/gauge/GaugeSeries.js +0 -1
  179. package/src/chart/graph/GraphSeries.js +19 -7
  180. package/src/chart/graph/GraphView.js +28 -10
  181. package/src/chart/graph/circularLayoutHelper.js +8 -2
  182. package/src/chart/graph/forceLayout.js +7 -1
  183. package/src/chart/graph/simpleLayout.js +1 -1
  184. package/src/chart/graph/simpleLayoutHelper.js +12 -5
  185. package/src/chart/heatmap/HeatmapView.js +4 -4
  186. package/src/chart/helper/EffectLine.js +23 -1
  187. package/src/chart/helper/EffectSymbol.js +2 -1
  188. package/src/chart/helper/Line.js +122 -37
  189. package/src/chart/helper/LineDraw.js +5 -1
  190. package/src/chart/helper/Symbol.js +4 -4
  191. package/src/chart/helper/createClipPathFromCoordSys.js +4 -0
  192. package/src/chart/helper/createGraphFromNodeEdge.js +2 -1
  193. package/src/chart/helper/createListFromArray.js +13 -8
  194. package/src/chart/helper/createRenderPlanner.js +5 -2
  195. package/src/chart/helper/multipleGraphEdgeHelper.js +229 -0
  196. package/src/chart/helper/whiskerBoxCommon.js +21 -16
  197. package/src/chart/line/LineSeries.js +1 -1
  198. package/src/chart/line/LineView.js +45 -1
  199. package/src/chart/lines/LinesSeries.js +1 -3
  200. package/src/chart/map/MapSeries.js +11 -5
  201. package/src/chart/pie/PieSeries.js +26 -5
  202. package/src/chart/pie/PieView.js +20 -15
  203. package/src/chart/pie/labelLayout.js +114 -22
  204. package/src/chart/pie/pieLayout.js +20 -7
  205. package/src/chart/radar/RadarSeries.js +31 -6
  206. package/src/chart/radar/RadarView.js +4 -2
  207. package/src/chart/sankey/SankeySeries.js +12 -1
  208. package/src/chart/sankey/SankeyView.js +75 -30
  209. package/src/chart/sankey/sankeyLayout.js +25 -5
  210. package/src/chart/scatter/ScatterSeries.js +1 -1
  211. package/src/chart/sunburst/SunburstPiece.js +7 -1
  212. package/src/chart/sunburst/SunburstSeries.js +28 -15
  213. package/src/chart/sunburst/SunburstView.js +2 -1
  214. package/src/chart/themeRiver/ThemeRiverSeries.js +25 -30
  215. package/src/chart/tree/TreeSeries.js +19 -6
  216. package/src/chart/tree/TreeView.js +156 -23
  217. package/src/chart/treemap/TreemapSeries.js +23 -5
  218. package/src/chart/treemap/TreemapView.js +77 -41
  219. package/src/chart/treemap/treemapLayout.js +2 -2
  220. package/src/chart/treemap/treemapVisual.js +8 -25
  221. package/src/component/axis/AngleAxisView.js +75 -7
  222. package/src/component/axis/AxisBuilder.js +77 -32
  223. package/src/component/axis/CartesianAxisView.js +47 -83
  224. package/src/component/axis/RadiusAxisView.js +37 -4
  225. package/src/component/axis/SingleAxisView.js +21 -4
  226. package/src/component/axis/axisSplitHelper.js +114 -0
  227. package/src/component/axisPointer/axisTrigger.js +1 -1
  228. package/src/component/brush/BrushView.js +8 -1
  229. package/src/component/brush/visualEncoding.js +6 -3
  230. package/src/component/dataZoom/SliderZoomView.js +4 -9
  231. package/src/component/helper/BrushController.js +40 -47
  232. package/src/component/helper/MapDraw.js +27 -4
  233. package/src/component/legend/LegendModel.js +3 -3
  234. package/src/component/legend/LegendView.js +18 -12
  235. package/src/component/legend/ScrollableLegendView.js +18 -16
  236. package/src/component/marker/MarkAreaView.js +53 -15
  237. package/src/component/marker/MarkLineModel.js +2 -1
  238. package/src/component/marker/MarkLineView.js +3 -1
  239. package/src/component/marker/MarkPointView.js +7 -1
  240. package/src/component/marker/MarkerModel.js +3 -2
  241. package/src/component/marker/markerHelper.js +8 -5
  242. package/src/component/timeline/SliderTimelineView.js +9 -6
  243. package/src/component/title.js +4 -3
  244. package/src/component/toolbox/.DS_Store +0 -0
  245. package/src/component/toolbox/ToolboxView.js +5 -0
  246. package/src/component/toolbox/feature/DataView.js +20 -8
  247. package/src/component/toolbox/feature/DataZoom.js +6 -6
  248. package/src/component/toolbox/feature/MagicType.js +19 -13
  249. package/src/component/toolbox/feature/SaveAsImage.js +4 -2
  250. package/src/component/tooltip/TooltipContent.js +94 -28
  251. package/src/component/tooltip/TooltipRichContent.js +52 -9
  252. package/src/component/tooltip/TooltipView.js +14 -12
  253. package/src/component/visualMap/PiecewiseModel.js +5 -9
  254. package/src/component/visualMap/VisualMapModel.js +1 -1
  255. package/src/coord/Axis.js +29 -2
  256. package/src/coord/View.js +10 -1
  257. package/src/coord/axisDefault.js +26 -2
  258. package/src/coord/axisHelper.js +30 -21
  259. package/src/coord/calendar/Calendar.js +12 -5
  260. package/src/coord/geo/GeoModel.js +3 -6
  261. package/src/coord/geo/geoJSONLoader.js +3 -2
  262. package/src/coord/geo/geoSourceManager.js +3 -2
  263. package/src/coord/geo/parseGeoJson.js +3 -2
  264. package/src/coord/radar/Radar.js +6 -8
  265. package/src/data/DataDimensionInfo.js +135 -0
  266. package/src/data/Graph.js +0 -5
  267. package/src/data/List.js +30 -17
  268. package/src/data/Tree.js +6 -39
  269. package/src/data/helper/completeDimensions.js +49 -30
  270. package/src/data/helper/createDimensions.js +2 -0
  271. package/src/data/helper/sourceHelper.js +216 -124
  272. package/src/echarts.js +60 -36
  273. package/src/langEN.js +26 -0
  274. package/src/layout/barGrid.js +22 -10
  275. package/src/layout/barPolar.js +4 -6
  276. package/src/loading/default.js +46 -34
  277. package/src/model/.DS_Store +0 -0
  278. package/src/model/Series.js +4 -4
  279. package/src/model/referHelper.js +34 -11
  280. package/src/preprocessor/.DS_Store +0 -0
  281. package/src/processor/dataSample.js +1 -1
  282. package/src/scale/Interval.js +84 -4
  283. package/src/scale/Log.js +9 -2
  284. package/src/scale/helper.js +1 -39
  285. package/src/stream/Scheduler.js +9 -1
  286. package/src/theme/dark.js +3 -0
  287. package/src/util/.DS_Store +0 -0
  288. package/src/util/format.js +17 -1
  289. package/src/util/graphic.js +13 -11
  290. package/src/visual/LegendVisualProvider.js +55 -0
  291. package/src/visual/VisualMapping.js +1 -1
  292. package/src/visual/dataColor.js +0 -13
  293. package/src/visual/seriesColor.js +13 -7
  294. package/src/visual/symbol.js +11 -2
  295. package/theme/.DS_Store +0 -0
  296. package/theme/azul.js +163 -0
  297. package/theme/bee-inspired.js +178 -0
  298. package/theme/blue.js +178 -0
  299. package/theme/caravan.js +178 -0
  300. package/theme/carp.js +163 -0
  301. package/theme/cool.js +180 -0
  302. package/theme/dark-blue.js +168 -0
  303. package/theme/dark-bold.js +168 -0
  304. package/theme/dark-digerati.js +168 -0
  305. package/theme/dark-fresh-cut.js +168 -0
  306. package/theme/dark-mushroom.js +168 -0
  307. package/theme/dark.js +69 -62
  308. package/theme/eduardo.js +178 -0
  309. package/theme/forest.js +163 -0
  310. package/theme/fresh-cut.js +163 -0
  311. package/theme/fruit.js +178 -0
  312. package/theme/gray.js +220 -0
  313. package/theme/green.js +222 -0
  314. package/theme/helianthus.js +263 -0
  315. package/theme/infographic.js +72 -57
  316. package/theme/inspired.js +163 -0
  317. package/theme/jazz.js +163 -0
  318. package/theme/london.js +163 -0
  319. package/theme/macarons.js +80 -57
  320. package/theme/macarons2.js +251 -0
  321. package/theme/mint.js +155 -0
  322. package/theme/red-velvet.js +163 -0
  323. package/theme/red.js +225 -0
  324. package/theme/roma.js +55 -22
  325. package/theme/royal.js +163 -0
  326. package/theme/sakura.js +140 -0
  327. package/theme/shine.js +52 -45
  328. package/theme/tech-blue.js +180 -0
  329. package/theme/vintage.js +37 -23
@@ -246,7 +246,6 @@ function doCalBarWidthAndOffset(seriesInfoList) {
246
246
  // only the attributes set on the last series will work.
247
247
  // Do not change this fact unless there will be a break change.
248
248
 
249
- // TODO
250
249
  var barWidth = seriesInfo.barWidth;
251
250
  if (barWidth && !stacks[stackId].width) {
252
251
  // See #6312, do not restrict width.
@@ -286,6 +285,7 @@ function doCalBarWidthAndOffset(seriesInfoList) {
286
285
  zrUtil.each(stacks, function (column) {
287
286
  var maxWidth = column.maxWidth;
288
287
  var minWidth = column.minWidth;
288
+
289
289
  if (!column.width) {
290
290
  var finalWidth = autoWidth;
291
291
  if (maxWidth && maxWidth < finalWidth) {
@@ -301,7 +301,7 @@ function doCalBarWidthAndOffset(seriesInfoList) {
301
301
  }
302
302
  if (finalWidth !== autoWidth) {
303
303
  column.width = finalWidth;
304
- remainedWidth -= finalWidth;
304
+ remainedWidth -= finalWidth + barGapPercent * finalWidth;
305
305
  autoWidthCount--;
306
306
  }
307
307
  }
@@ -318,7 +318,7 @@ function doCalBarWidthAndOffset(seriesInfoList) {
318
318
  finalWidth = Math.max(finalWidth, minWidth);
319
319
  }
320
320
  column.width = finalWidth;
321
- remainedWidth -= finalWidth;
321
+ remainedWidth -= finalWidth + barGapPercent * finalWidth;
322
322
  autoWidthCount--;
323
323
  }
324
324
  });
@@ -326,8 +326,10 @@ function doCalBarWidthAndOffset(seriesInfoList) {
326
326
  // Recalculate width again
327
327
  autoWidth = (remainedWidth - categoryGap)
328
328
  / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);
329
+
329
330
  autoWidth = Math.max(autoWidth, 0);
330
331
 
332
+
331
333
  var widthSum = 0;
332
334
  var lastColumn;
333
335
  zrUtil.each(stacks, function (column, idx) {
@@ -418,11 +420,6 @@ export function layout(seriesType, ecModel) {
418
420
  var value = data.get(valueDim, idx);
419
421
  var baseValue = data.get(baseDim, idx);
420
422
 
421
- // If dataZoom in filteMode: 'empty', the baseValue can be set as NaN in "axisProxy".
422
- if (isNaN(value) || isNaN(baseValue)) {
423
- continue;
424
- }
425
-
426
423
  var sign = value >= 0 ? 'p' : 'n';
427
424
  var baseCoord = valueAxisStart;
428
425
 
@@ -455,7 +452,10 @@ export function layout(seriesType, ecModel) {
455
452
  if (Math.abs(width) < barMinHeight) {
456
453
  width = (width < 0 ? -1 : 1) * barMinHeight;
457
454
  }
458
- stacked && (lastStackCoords[stackId][baseValue][sign] += width);
455
+ // Ignore stack from NaN value
456
+ if (!isNaN(width)) {
457
+ stacked && (lastStackCoords[stackId][baseValue][sign] += width);
458
+ }
459
459
  }
460
460
  else {
461
461
  var coord = cartesian.dataToPoint([baseValue, value]);
@@ -468,8 +468,12 @@ export function layout(seriesType, ecModel) {
468
468
  // Include zero to has a positive bar
469
469
  height = (height <= 0 ? -1 : 1) * barMinHeight;
470
470
  }
471
- stacked && (lastStackCoords[stackId][baseValue][sign] += height);
471
+ // Ignore stack from NaN value
472
+ if (!isNaN(height)) {
473
+ stacked && (lastStackCoords[stackId][baseValue][sign] += height);
474
+ }
472
475
  }
476
+
473
477
  data.setItemLayout(idx, {
474
478
  x: x,
475
479
  y: y,
@@ -495,6 +499,7 @@ export var largeLayout = {
495
499
 
496
500
  var data = seriesModel.getData();
497
501
  var cartesian = seriesModel.coordinateSystem;
502
+ var coordLayout = cartesian.grid.getRect();
498
503
  var baseAxis = cartesian.getBaseAxis();
499
504
  var valueAxis = cartesian.getOtherAxis(baseAxis);
500
505
  var valueDim = data.mapDimension(valueAxis.dim);
@@ -514,6 +519,7 @@ export var largeLayout = {
514
519
  function progress(params, data) {
515
520
  var count = params.count;
516
521
  var largePoints = new LargeArr(count * 2);
522
+ var largeBackgroundPoints = new LargeArr(count * 2);
517
523
  var largeDataIndices = new LargeArr(count);
518
524
  var dataIndex;
519
525
  var coord = [];
@@ -527,7 +533,11 @@ export var largeLayout = {
527
533
 
528
534
  coord = cartesian.dataToPoint(valuePair, null, coord);
529
535
  // Data index might not be in order, depends on `progressiveChunkMode`.
536
+ largeBackgroundPoints[pointsOffset] = valueAxisHorizontal
537
+ ? coordLayout.x + coordLayout.width : coord[0];
530
538
  largePoints[pointsOffset++] = coord[0];
539
+ largeBackgroundPoints[pointsOffset] = valueAxisHorizontal
540
+ ? coord[1] : coordLayout.y + coordLayout.height;
531
541
  largePoints[pointsOffset++] = coord[1];
532
542
  largeDataIndices[idxOffset++] = dataIndex;
533
543
  }
@@ -535,8 +545,10 @@ export var largeLayout = {
535
545
  data.setLayout({
536
546
  largePoints: largePoints,
537
547
  largeDataIndices: largeDataIndices,
548
+ largeBackgroundPoints: largeBackgroundPoints,
538
549
  barWidth: barWidth,
539
550
  valueAxisStart: getValueAxisStart(baseAxis, valueAxis, false),
551
+ backgroundStart: valueAxisHorizontal ? coordLayout.x : coordLayout.y,
540
552
  valueAxisHorizontal: valueAxisHorizontal
541
553
  });
542
554
  }
@@ -82,16 +82,13 @@ function barLayoutPolar(seriesType, ecModel, api) {
82
82
  var clampLayout = baseAxis.dim !== 'radius'
83
83
  || !seriesModel.get('roundCap', true);
84
84
 
85
- var valueAxisStart = valueAxis.getExtent()[0];
86
-
85
+ var valueAxisStart = valueAxis.dim === 'radius'
86
+ ? valueAxis.dataToRadius(0)
87
+ : valueAxis.dataToAngle(0);
87
88
  for (var idx = 0, len = data.count(); idx < len; idx++) {
88
89
  var value = data.get(valueDim, idx);
89
90
  var baseValue = data.get(baseDim, idx);
90
91
 
91
- if (isNaN(value)) {
92
- continue;
93
- }
94
-
95
92
  var sign = value >= 0 ? 'p' : 'n';
96
93
  var baseCoord = valueAxisStart;
97
94
 
@@ -99,6 +96,7 @@ function barLayoutPolar(seriesType, ecModel, api) {
99
96
  // stackResultDimension directly.
100
97
  // Only ordinal axis can be stacked.
101
98
  if (stacked) {
99
+
102
100
  if (!lastStackCoords[stackId][baseValue]) {
103
101
  lastStackCoords[stackId][baseValue] = {
104
102
  p: valueAxisStart, // Positive stack
@@ -19,6 +19,7 @@
19
19
 
20
20
  import * as zrUtil from 'zrender/src/core/util';
21
21
  import * as graphic from '../util/graphic';
22
+ import * as textContain from 'zrender/src/contain/text';
22
23
 
23
24
  var PI = Math.PI;
24
25
 
@@ -34,11 +35,16 @@ export default function (api, opts) {
34
35
  opts = opts || {};
35
36
  zrUtil.defaults(opts, {
36
37
  text: 'loading',
37
- color: '#c23531',
38
38
  textColor: '#000',
39
+ fontSize: '12px',
39
40
  maskColor: 'rgba(255, 255, 255, 0.8)',
41
+ showSpinner: true,
42
+ color: '#c23531',
43
+ spinnerRadius: 10,
44
+ lineWidth: 5,
40
45
  zlevel: 0
41
46
  });
47
+ var group = new graphic.Group();
42
48
  var mask = new graphic.Rect({
43
49
  style: {
44
50
  fill: opts.maskColor
@@ -46,24 +52,13 @@ export default function (api, opts) {
46
52
  zlevel: opts.zlevel,
47
53
  z: 10000
48
54
  });
49
- var arc = new graphic.Arc({
50
- shape: {
51
- startAngle: -PI / 2,
52
- endAngle: -PI / 2 + 0.1,
53
- r: 10
54
- },
55
- style: {
56
- stroke: opts.color,
57
- lineCap: 'round',
58
- lineWidth: 5
59
- },
60
- zlevel: opts.zlevel,
61
- z: 10001
62
- });
55
+ group.add(mask);
56
+ var font = opts.fontSize + ' sans-serif';
63
57
  var labelRect = new graphic.Rect({
64
58
  style: {
65
59
  fill: 'none',
66
60
  text: opts.text,
61
+ font: font,
67
62
  textPosition: 'right',
68
63
  textDistance: 10,
69
64
  textFill: opts.textColor
@@ -71,32 +66,49 @@ export default function (api, opts) {
71
66
  zlevel: opts.zlevel,
72
67
  z: 10001
73
68
  });
74
-
75
- arc.animateShape(true)
76
- .when(1000, {
77
- endAngle: PI * 3 / 2
78
- })
79
- .start('circularInOut');
80
- arc.animateShape(true)
81
- .when(1000, {
82
- startAngle: PI * 3 / 2
83
- })
84
- .delay(300)
85
- .start('circularInOut');
86
-
87
- var group = new graphic.Group();
88
- group.add(arc);
89
69
  group.add(labelRect);
90
- group.add(mask);
70
+ if (opts.showSpinner) {
71
+ var arc = new graphic.Arc({
72
+ shape: {
73
+ startAngle: -PI / 2,
74
+ endAngle: -PI / 2 + 0.1,
75
+ r: opts.spinnerRadius
76
+ },
77
+ style: {
78
+ stroke: opts.color,
79
+ lineCap: 'round',
80
+ lineWidth: opts.lineWidth
81
+ },
82
+ zlevel: opts.zlevel,
83
+ z: 10001
84
+ });
85
+ arc.animateShape(true)
86
+ .when(1000, {
87
+ endAngle: PI * 3 / 2
88
+ })
89
+ .start('circularInOut');
90
+ arc.animateShape(true)
91
+ .when(1000, {
92
+ startAngle: PI * 3 / 2
93
+ })
94
+ .delay(300)
95
+ .start('circularInOut');
96
+ group.add(arc);
97
+ }
91
98
  // Inject resize
92
99
  group.resize = function () {
93
- var cx = api.getWidth() / 2;
100
+ var textWidth = textContain.getWidth(opts.text, font);
101
+ var r = opts.showSpinner ? opts.spinnerRadius : 0;
102
+ // cx = (containerWidth - arcDiameter - textDistance - textWidth) / 2
103
+ // textDistance needs to be calculated when both animation and text exist
104
+ var cx = (api.getWidth() - r * 2 - (opts.showSpinner && textWidth ? 10 : 0) - textWidth) / 2
105
+ // only show the text
106
+ - (opts.showSpinner ? 0 : textWidth / 2);
94
107
  var cy = api.getHeight() / 2;
95
- arc.setShape({
108
+ opts.showSpinner && arc.setShape({
96
109
  cx: cx,
97
110
  cy: cy
98
111
  });
99
- var r = arc.shape.r;
100
112
  labelRect.setShape({
101
113
  x: cx - r,
102
114
  y: cy - r,
Binary file
@@ -62,11 +62,11 @@ var SeriesModel = ComponentModel.extend({
62
62
  defaultOption: null,
63
63
 
64
64
  /**
65
- * Data provided for legend
66
- * @type {Function}
65
+ * legend visual provider to the legend component
66
+ * @type {Object}
67
67
  */
68
68
  // PENDING
69
- legendDataProvider: null,
69
+ legendVisualProvider: null,
70
70
 
71
71
  /**
72
72
  * Access path of color for visual
@@ -584,7 +584,7 @@ function dataTaskReset(context) {
584
584
 
585
585
  function dataTaskProgress(param, context) {
586
586
  // Avoid repead cloneShallow when data just created in reset.
587
- if (param.end > context.outputData.count()) {
587
+ if (context.outputData && param.end > context.outputData.count()) {
588
588
  context.model.getRawData().cloneShallow(context.outputData);
589
589
  }
590
590
  }
@@ -30,7 +30,8 @@ import {__DEV__} from '../config';
30
30
  import {createHashMap, retrieve, each} from 'zrender/src/core/util';
31
31
 
32
32
  /**
33
- * @return {Object} For example:
33
+ * @class
34
+ * For example:
34
35
  * {
35
36
  * coordSysName: 'cartesian2d',
36
37
  * coordSysDims: ['x', 'y', ...],
@@ -42,19 +43,41 @@ import {createHashMap, retrieve, each} from 'zrender/src/core/util';
42
43
  * x: xAxisModel,
43
44
  * y: undefined
44
45
  * }),
45
- * // It also indicate that whether there is category axis.
46
+ * // The index of the first category axis in `coordSysDims`.
47
+ * // `null/undefined` means no category axis exists.
46
48
  * firstCategoryDimIndex: 1,
47
49
  * // To replace user specified encode.
48
50
  * }
49
51
  */
50
- export function getCoordSysDefineBySeries(seriesModel) {
52
+ function CoordSysInfo(coordSysName) {
53
+ /**
54
+ * @type {string}
55
+ */
56
+ this.coordSysName = coordSysName;
57
+ /**
58
+ * @type {Array.<string>}
59
+ */
60
+ this.coordSysDims = [];
61
+ /**
62
+ * @type {module:zrender/core/util#HashMap}
63
+ */
64
+ this.axisMap = createHashMap();
65
+ /**
66
+ * @type {module:zrender/core/util#HashMap}
67
+ */
68
+ this.categoryAxisMap = createHashMap();
69
+ /**
70
+ * @type {number}
71
+ */
72
+ this.firstCategoryDimIndex = null;
73
+ }
74
+
75
+ /**
76
+ * @return {module:model/referHelper#CoordSysInfo}
77
+ */
78
+ export function getCoordSysInfoBySeries(seriesModel) {
51
79
  var coordSysName = seriesModel.get('coordinateSystem');
52
- var result = {
53
- coordSysName: coordSysName,
54
- coordSysDims: [],
55
- axisMap: createHashMap(),
56
- categoryAxisMap: createHashMap()
57
- };
80
+ var result = new CoordSysInfo(coordSysName);
58
81
  var fetch = fetchers[coordSysName];
59
82
  if (fetch) {
60
83
  fetch(seriesModel, result, result.axisMap, result.categoryAxisMap);
@@ -95,7 +118,7 @@ var fetchers = {
95
118
  }
96
119
  if (isCategory(yAxisModel)) {
97
120
  categoryAxisMap.set('y', yAxisModel);
98
- result.firstCategoryDimIndex = 1;
121
+ result.firstCategoryDimIndex == null & (result.firstCategoryDimIndex = 1);
99
122
  }
100
123
  },
101
124
 
@@ -141,7 +164,7 @@ var fetchers = {
141
164
  }
142
165
  if (isCategory(angleAxisModel)) {
143
166
  categoryAxisMap.set('angle', angleAxisModel);
144
- result.firstCategoryDimIndex = 1;
167
+ result.firstCategoryDimIndex == null && (result.firstCategoryDimIndex = 1);
145
168
  }
146
169
  },
147
170
 
Binary file
@@ -83,7 +83,7 @@ export default function (seriesType) {
83
83
  var valueAxis = coordSys.getOtherAxis(baseAxis);
84
84
  var extent = baseAxis.getExtent();
85
85
  // Coordinste system has been resized
86
- var size = extent[1] - extent[0];
86
+ var size = Math.abs(extent[1] - extent[0]);
87
87
  var rate = Math.round(data.count() / size);
88
88
  if (rate > 1) {
89
89
  var sampler;
@@ -81,12 +81,92 @@ var IntervalScale = Scale.extend({
81
81
  },
82
82
 
83
83
  /**
84
+ * @param {boolean} [expandToNicedExtent=false] If expand the ticks to niced extent.
84
85
  * @return {Array.<number>}
85
86
  */
86
- getTicks: function () {
87
- return helper.intervalScaleGetTicks(
88
- this._interval, this._extent, this._niceExtent, this._intervalPrecision
89
- );
87
+ getTicks: function (expandToNicedExtent) {
88
+ var interval = this._interval;
89
+ var extent = this._extent;
90
+ var niceTickExtent = this._niceExtent;
91
+ var intervalPrecision = this._intervalPrecision;
92
+
93
+ var ticks = [];
94
+ // If interval is 0, return [];
95
+ if (!interval) {
96
+ return ticks;
97
+ }
98
+
99
+ // Consider this case: using dataZoom toolbox, zoom and zoom.
100
+ var safeLimit = 10000;
101
+
102
+ if (extent[0] < niceTickExtent[0]) {
103
+ if (expandToNicedExtent) {
104
+ ticks.push(roundNumber(niceTickExtent[0] - interval, intervalPrecision));
105
+ }
106
+ else {
107
+ ticks.push(extent[0]);
108
+ }
109
+ }
110
+ var tick = niceTickExtent[0];
111
+
112
+ while (tick <= niceTickExtent[1]) {
113
+ ticks.push(tick);
114
+ // Avoid rounding error
115
+ tick = roundNumber(tick + interval, intervalPrecision);
116
+ if (tick === ticks[ticks.length - 1]) {
117
+ // Consider out of safe float point, e.g.,
118
+ // -3711126.9907707 + 2e-10 === -3711126.9907707
119
+ break;
120
+ }
121
+ if (ticks.length > safeLimit) {
122
+ return [];
123
+ }
124
+ }
125
+ // Consider this case: the last item of ticks is smaller
126
+ // than niceTickExtent[1] and niceTickExtent[1] === extent[1].
127
+ var lastNiceTick = ticks.length ? ticks[ticks.length - 1] : niceTickExtent[1];
128
+ if (extent[1] > lastNiceTick) {
129
+ if (expandToNicedExtent) {
130
+ ticks.push(roundNumber(lastNiceTick + interval, intervalPrecision));
131
+ }
132
+ else {
133
+ ticks.push(extent[1]);
134
+ }
135
+ }
136
+
137
+ return ticks;
138
+ },
139
+
140
+ /**
141
+ * @param {number} [splitNumber=5]
142
+ * @return {Array.<Array.<number>>}
143
+ */
144
+ getMinorTicks: function (splitNumber) {
145
+ var ticks = this.getTicks(true);
146
+ var minorTicks = [];
147
+ var extent = this.getExtent();
148
+
149
+ for (var i = 1; i < ticks.length; i++) {
150
+ var nextTick = ticks[i];
151
+ var prevTick = ticks[i - 1];
152
+ var count = 0;
153
+ var minorTicksGroup = [];
154
+ var interval = nextTick - prevTick;
155
+ var minorInterval = interval / splitNumber;
156
+
157
+ while (count < splitNumber - 1) {
158
+ var minorTick = numberUtil.round(prevTick + (count + 1) * minorInterval);
159
+
160
+ // For the first and last interval. The count may be less than splitNumber.
161
+ if (minorTick > extent[0] && minorTick < extent[1]) {
162
+ minorTicksGroup.push(minorTick);
163
+ }
164
+ count++;
165
+ }
166
+ minorTicks.push(minorTicksGroup);
167
+ }
168
+
169
+ return minorTicks;
90
170
  },
91
171
 
92
172
  /**
package/src/scale/Log.js CHANGED
@@ -53,14 +53,15 @@ var LogScale = Scale.extend({
53
53
  },
54
54
 
55
55
  /**
56
+ * @param {boolean} [expandToNicedExtent=false] If expand the ticks to niced extent.
56
57
  * @return {Array.<number>}
57
58
  */
58
- getTicks: function () {
59
+ getTicks: function (expandToNicedExtent) {
59
60
  var originalScale = this._originalScale;
60
61
  var extent = this._extent;
61
62
  var originalExtent = originalScale.getExtent();
62
63
 
63
- return zrUtil.map(intervalScaleProto.getTicks.call(this), function (val) {
64
+ return zrUtil.map(intervalScaleProto.getTicks.call(this, expandToNicedExtent), function (val) {
64
65
  var powVal = numberUtil.round(mathPow(this.base, val));
65
66
 
66
67
  // Fix #4158
@@ -75,6 +76,12 @@ var LogScale = Scale.extend({
75
76
  }, this);
76
77
  },
77
78
 
79
+ /**
80
+ * @param {number} splitNumber
81
+ * @return {Array.<Array.<number>>}
82
+ */
83
+ getMinorTicks: intervalScaleProto.getMinorTicks,
84
+
78
85
  /**
79
86
  * @param {number} val
80
87
  * @return {string}
@@ -79,42 +79,4 @@ export function fixExtent(niceTickExtent, extent) {
79
79
  if (niceTickExtent[0] > niceTickExtent[1]) {
80
80
  niceTickExtent[0] = niceTickExtent[1];
81
81
  }
82
- }
83
-
84
- export function intervalScaleGetTicks(interval, extent, niceTickExtent, intervalPrecision) {
85
- var ticks = [];
86
-
87
- // If interval is 0, return [];
88
- if (!interval) {
89
- return ticks;
90
- }
91
-
92
- // Consider this case: using dataZoom toolbox, zoom and zoom.
93
- var safeLimit = 10000;
94
-
95
- if (extent[0] < niceTickExtent[0]) {
96
- ticks.push(extent[0]);
97
- }
98
- var tick = niceTickExtent[0];
99
-
100
- while (tick <= niceTickExtent[1]) {
101
- ticks.push(tick);
102
- // Avoid rounding error
103
- tick = roundNumber(tick + interval, intervalPrecision);
104
- if (tick === ticks[ticks.length - 1]) {
105
- // Consider out of safe float point, e.g.,
106
- // -3711126.9907707 + 2e-10 === -3711126.9907707
107
- break;
108
- }
109
- if (ticks.length > safeLimit) {
110
- return [];
111
- }
112
- }
113
- // Consider this case: the last item of ticks is smaller
114
- // than niceTickExtent[1] and niceTickExtent[1] === extent[1].
115
- if (extent[1] > (ticks.length ? ticks[ticks.length - 1] : niceTickExtent[1])) {
116
- ticks.push(extent[1]);
117
- }
118
-
119
- return ticks;
120
- }
82
+ }
@@ -65,7 +65,7 @@ var proto = Scheduler.prototype;
65
65
  * @param {Object} payload
66
66
  */
67
67
  proto.restoreData = function (ecModel, payload) {
68
- // TODO: Only restroe needed series and components, but not all components.
68
+ // TODO: Only restore needed series and components, but not all components.
69
69
  // Currently `restoreData` of all of the series and component will be called.
70
70
  // But some independent components like `title`, `legend`, `graphic`, `toolbox`,
71
71
  // `tooltip`, `axisPointer`, etc, do not need series refresh when `setOption`,
@@ -260,6 +260,14 @@ function performStageTasks(scheduler, stageHandlers, ecModel, payload, opt) {
260
260
  task.dirty();
261
261
  }
262
262
  var performArgs = scheduler.getPerformArgs(task, opt.block);
263
+ // FIXME
264
+ // if intending to decalare `performRawSeries` in handlers, only
265
+ // stream-independent (specifically, data item independent) operations can be
266
+ // performed. Because is a series is filtered, most of the tasks will not
267
+ // be performed. A stream-dependent operation probably cause wrong biz logic.
268
+ // Perhaps we should not provide a separate callback for this case instead
269
+ // of providing the config `performRawSeries`. The stream-dependent operaions
270
+ // and stream-independent operations should better not be mixed.
263
271
  performArgs.skip = !stageHandler.performRawSeries
264
272
  && ecModel.isSeriesFiltered(task.context.model);
265
273
  updatePayload(task, payload);
package/src/theme/dark.js CHANGED
@@ -63,6 +63,9 @@ var theme = {
63
63
  },
64
64
  crossStyle: {
65
65
  color: contrastColor
66
+ },
67
+ label: {
68
+ color: '#000'
66
69
  }
67
70
  }
68
71
  },
Binary file
@@ -23,7 +23,7 @@ import * as numberUtil from './number';
23
23
  // import Text from 'zrender/src/graphic/Text';
24
24
 
25
25
  /**
26
- * 每三位默认加,格式化
26
+ * add commas after every three numbers
27
27
  * @param {string|number} x
28
28
  * @return {string}
29
29
  */
@@ -275,3 +275,19 @@ export function getTextRect(
275
275
  text, font, textAlign, textVerticalAlign, textPadding, textLineHeight, rich, truncate
276
276
  );
277
277
  }
278
+
279
+ /**
280
+ * open new tab
281
+ * @param {string} link url
282
+ * @param {string} target blank or self
283
+ */
284
+ export function windowOpen(link, target) {
285
+ if (target === '_blank' || target === 'blank') {
286
+ var blank = window.open();
287
+ blank.opener = null;
288
+ blank.location = link;
289
+ }
290
+ else {
291
+ window.open(link, target);
292
+ }
293
+ }