echarts 4.6.0 → 4.7.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 (100) 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 +684 -300
  7. package/dist/echarts-en.common.min.js +1 -1
  8. package/dist/echarts-en.js +1070 -407
  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 +499 -222
  12. package/dist/echarts-en.simple.min.js +1 -1
  13. package/dist/echarts.common.js +684 -300
  14. package/dist/echarts.common.min.js +1 -1
  15. package/dist/echarts.js +1070 -407
  16. package/dist/echarts.js.map +1 -1
  17. package/dist/echarts.min.js +1 -1
  18. package/dist/echarts.simple.js +499 -222
  19. package/dist/echarts.simple.min.js +1 -1
  20. package/lib/chart/bar/BarSeries.js +14 -1
  21. package/lib/chart/bar/BarView.js +134 -14
  22. package/lib/chart/candlestick/candlestickVisual.js +1 -1
  23. package/lib/chart/funnel/FunnelSeries.js +1 -3
  24. package/lib/chart/graph/GraphSeries.js +2 -1
  25. package/lib/chart/graph/GraphView.js +2 -4
  26. package/lib/chart/helper/EffectLine.js +23 -1
  27. package/lib/chart/helper/Line.js +94 -33
  28. package/lib/chart/helper/createRenderPlanner.js +6 -3
  29. package/lib/chart/pie/PieView.js +1 -1
  30. package/lib/chart/radar/RadarSeries.js +20 -0
  31. package/lib/chart/sankey/SankeySeries.js +13 -1
  32. package/lib/chart/sankey/SankeyView.js +42 -23
  33. package/lib/chart/sankey/sankeyLayout.js +4 -3
  34. package/lib/chart/tree/TreeSeries.js +3 -0
  35. package/lib/chart/tree/TreeView.js +151 -25
  36. package/lib/chart/treemap/TreemapView.js +57 -27
  37. package/lib/component/axis/AxisBuilder.js +0 -1
  38. package/lib/component/axis/CartesianAxisView.js +7 -84
  39. package/lib/component/axis/SingleAxisView.js +21 -6
  40. package/lib/component/axis/axisSplitHelper.js +132 -0
  41. package/lib/component/brush/BrushView.js +11 -1
  42. package/lib/component/brush/visualEncoding.js +13 -2
  43. package/lib/component/helper/MapDraw.js +6 -8
  44. package/lib/component/legend/ScrollableLegendView.js +18 -18
  45. package/lib/component/marker/MarkLineModel.js +2 -1
  46. package/lib/component/marker/markerHelper.js +7 -4
  47. package/lib/component/tooltip/TooltipContent.js +60 -23
  48. package/lib/component/tooltip/TooltipView.js +6 -7
  49. package/lib/coord/View.js +9 -0
  50. package/lib/coord/radar/Radar.js +4 -4
  51. package/lib/echarts.js +2 -2
  52. package/lib/layout/barGrid.js +17 -10
  53. package/lib/layout/barPolar.js +0 -5
  54. package/lib/scale/Interval.js +2 -2
  55. package/lib/stream/Scheduler.js +9 -1
  56. package/lib/util/graphic.js +2 -2
  57. package/map/js/china.js +1 -1
  58. package/map/js/province/chongqing.js +1 -1
  59. package/map/js/province/tianjin.js +1 -28
  60. package/map/json/china.json +1 -1
  61. package/map/json/province/chongqing.json +1 -1
  62. package/package.json +10 -6
  63. package/src/chart/bar/BarSeries.js +15 -1
  64. package/src/chart/bar/BarView.js +136 -12
  65. package/src/chart/candlestick/candlestickVisual.js +1 -1
  66. package/src/chart/funnel/FunnelSeries.js +1 -2
  67. package/src/chart/graph/GraphSeries.js +2 -1
  68. package/src/chart/graph/GraphView.js +2 -2
  69. package/src/chart/helper/EffectLine.js +23 -1
  70. package/src/chart/helper/Line.js +84 -26
  71. package/src/chart/helper/createRenderPlanner.js +5 -2
  72. package/src/chart/pie/PieView.js +1 -1
  73. package/src/chart/pie/labelLayout.js +1 -1
  74. package/src/chart/radar/RadarSeries.js +22 -0
  75. package/src/chart/sankey/SankeySeries.js +12 -1
  76. package/src/chart/sankey/SankeyView.js +49 -21
  77. package/src/chart/sankey/sankeyLayout.js +4 -3
  78. package/src/chart/tree/TreeSeries.js +5 -0
  79. package/src/chart/tree/TreeView.js +155 -22
  80. package/src/chart/treemap/TreemapView.js +57 -27
  81. package/src/component/axis/AxisBuilder.js +1 -1
  82. package/src/component/axis/CartesianAxisView.js +3 -86
  83. package/src/component/axis/SingleAxisView.js +21 -4
  84. package/src/component/axis/axisSplitHelper.js +114 -0
  85. package/src/component/brush/BrushView.js +8 -1
  86. package/src/component/brush/visualEncoding.js +6 -3
  87. package/src/component/helper/MapDraw.js +6 -6
  88. package/src/component/legend/ScrollableLegendView.js +18 -16
  89. package/src/component/marker/MarkLineModel.js +2 -1
  90. package/src/component/marker/markerHelper.js +8 -5
  91. package/src/component/tooltip/TooltipContent.js +59 -22
  92. package/src/component/tooltip/TooltipView.js +9 -7
  93. package/src/coord/View.js +10 -1
  94. package/src/coord/radar/Radar.js +5 -7
  95. package/src/echarts.js +2 -2
  96. package/src/layout/barGrid.js +14 -7
  97. package/src/layout/barPolar.js +0 -4
  98. package/src/scale/Interval.js +2 -2
  99. package/src/stream/Scheduler.js +8 -0
  100. package/src/util/graphic.js +2 -2
package/src/coord/View.js CHANGED
@@ -185,7 +185,6 @@ View.prototype = {
185
185
  /**
186
186
  * Remove roam
187
187
  */
188
-
189
188
  _updateCenterAndZoom: function () {
190
189
  // Must update after view transform updated
191
190
  var rawTransformMatrix = this._rawTransformable.getLocalTransform();
@@ -229,6 +228,16 @@ View.prototype = {
229
228
  this.decomposeTransform();
230
229
  },
231
230
 
231
+ getTransformInfo: function () {
232
+ var roamTransform = this._roamTransformable.transform;
233
+ var rawTransformable = this._rawTransformable;
234
+ return {
235
+ roamTransform: roamTransform ? zrUtil.slice(roamTransform) : matrix.create(),
236
+ rawScale: zrUtil.slice(rawTransformable.scale),
237
+ rawPosition: zrUtil.slice(rawTransformable.position)
238
+ };
239
+ },
240
+
232
241
  /**
233
242
  * @return {module:zrender/core/BoundingRect}
234
243
  */
@@ -195,6 +195,7 @@ Radar.prototype.update = function (ecModel, api) {
195
195
  var fixedMax = axisModel.getMax();
196
196
  var interval = scale.getInterval();
197
197
 
198
+
198
199
  if (fixedMin != null && fixedMax != null) {
199
200
  // User set min, max, divide to get new interval
200
201
  scale.setExtent(+fixedMin, +fixedMax);
@@ -230,13 +231,10 @@ Radar.prototype.update = function (ecModel, api) {
230
231
  if (nicedSplitNumber > splitNumber) {
231
232
  interval = increaseInterval(interval);
232
233
  }
233
- // PENDING
234
- var center = Math.round((rawExtent[0] + rawExtent[1]) / 2 / interval) * interval;
235
- var halfSplitNumber = Math.round(splitNumber / 2);
236
- scale.setExtent(
237
- numberUtil.round(center - halfSplitNumber * interval),
238
- numberUtil.round(center + (splitNumber - halfSplitNumber) * interval)
239
- );
234
+ // TODO
235
+ var max = Math.ceil(rawExtent[1] / interval) * interval;
236
+ var min = numberUtil.round(max - interval * splitNumber);
237
+ scale.setExtent(min, max);
240
238
  scale.setInterval(interval);
241
239
  }
242
240
  });
package/src/echarts.js CHANGED
@@ -51,10 +51,10 @@ var isFunction = zrUtil.isFunction;
51
51
  var isObject = zrUtil.isObject;
52
52
  var parseClassType = ComponentModel.parseClassType;
53
53
 
54
- export var version = '4.6.0';
54
+ export var version = '4.7.0';
55
55
 
56
56
  export var dependencies = {
57
- zrender: '4.2.0'
57
+ zrender: '4.3.0'
58
58
  };
59
59
 
60
60
  var TEST_FRAME_REMAIN_TIME = 1;
@@ -420,11 +420,6 @@ export function layout(seriesType, ecModel) {
420
420
  var value = data.get(valueDim, idx);
421
421
  var baseValue = data.get(baseDim, idx);
422
422
 
423
- // If dataZoom in filteMode: 'empty', the baseValue can be set as NaN in "axisProxy".
424
- if (isNaN(value) || isNaN(baseValue)) {
425
- continue;
426
- }
427
-
428
423
  var sign = value >= 0 ? 'p' : 'n';
429
424
  var baseCoord = valueAxisStart;
430
425
 
@@ -457,7 +452,10 @@ export function layout(seriesType, ecModel) {
457
452
  if (Math.abs(width) < barMinHeight) {
458
453
  width = (width < 0 ? -1 : 1) * barMinHeight;
459
454
  }
460
- stacked && (lastStackCoords[stackId][baseValue][sign] += width);
455
+ // Ignore stack from NaN value
456
+ if (!isNaN(width)) {
457
+ stacked && (lastStackCoords[stackId][baseValue][sign] += width);
458
+ }
461
459
  }
462
460
  else {
463
461
  var coord = cartesian.dataToPoint([baseValue, value]);
@@ -470,7 +468,10 @@ export function layout(seriesType, ecModel) {
470
468
  // Include zero to has a positive bar
471
469
  height = (height <= 0 ? -1 : 1) * barMinHeight;
472
470
  }
473
- stacked && (lastStackCoords[stackId][baseValue][sign] += height);
471
+ // Ignore stack from NaN value
472
+ if (!isNaN(height)) {
473
+ stacked && (lastStackCoords[stackId][baseValue][sign] += height);
474
+ }
474
475
  }
475
476
 
476
477
  data.setItemLayout(idx, {
@@ -498,6 +499,7 @@ export var largeLayout = {
498
499
 
499
500
  var data = seriesModel.getData();
500
501
  var cartesian = seriesModel.coordinateSystem;
502
+ var coordLayout = cartesian.grid.getRect();
501
503
  var baseAxis = cartesian.getBaseAxis();
502
504
  var valueAxis = cartesian.getOtherAxis(baseAxis);
503
505
  var valueDim = data.mapDimension(valueAxis.dim);
@@ -517,6 +519,7 @@ export var largeLayout = {
517
519
  function progress(params, data) {
518
520
  var count = params.count;
519
521
  var largePoints = new LargeArr(count * 2);
522
+ var largeBackgroundPoints = new LargeArr(count * 2);
520
523
  var largeDataIndices = new LargeArr(count);
521
524
  var dataIndex;
522
525
  var coord = [];
@@ -530,7 +533,9 @@ export var largeLayout = {
530
533
 
531
534
  coord = cartesian.dataToPoint(valuePair, null, coord);
532
535
  // Data index might not be in order, depends on `progressiveChunkMode`.
536
+ largeBackgroundPoints[pointsOffset] = valueAxisHorizontal ? coordLayout.x + coordLayout.width : coord[0];
533
537
  largePoints[pointsOffset++] = coord[0];
538
+ largeBackgroundPoints[pointsOffset] = valueAxisHorizontal ? coord[1] : coordLayout.y + coordLayout.height;
534
539
  largePoints[pointsOffset++] = coord[1];
535
540
  largeDataIndices[idxOffset++] = dataIndex;
536
541
  }
@@ -538,8 +543,10 @@ export var largeLayout = {
538
543
  data.setLayout({
539
544
  largePoints: largePoints,
540
545
  largeDataIndices: largeDataIndices,
546
+ largeBackgroundPoints: largeBackgroundPoints,
541
547
  barWidth: barWidth,
542
548
  valueAxisStart: getValueAxisStart(baseAxis, valueAxis, false),
549
+ backgroundStart: valueAxisHorizontal ? coordLayout.x : coordLayout.y,
543
550
  valueAxisHorizontal: valueAxisHorizontal
544
551
  });
545
552
  }
@@ -88,10 +88,6 @@ function barLayoutPolar(seriesType, ecModel, api) {
88
88
  var value = data.get(valueDim, idx);
89
89
  var baseValue = data.get(baseDim, idx);
90
90
 
91
- if (isNaN(value)) {
92
- continue;
93
- }
94
-
95
91
  var sign = value >= 0 ? 'p' : 'n';
96
92
  var baseCoord = valueAxisStart;
97
93
 
@@ -101,7 +101,7 @@ var IntervalScale = Scale.extend({
101
101
 
102
102
  if (extent[0] < niceTickExtent[0]) {
103
103
  if (expandToNicedExtent) {
104
- ticks.push(roundNumber(niceTickExtent[0] - interval));
104
+ ticks.push(roundNumber(niceTickExtent[0] - interval, intervalPrecision));
105
105
  }
106
106
  else {
107
107
  ticks.push(extent[0]);
@@ -127,7 +127,7 @@ var IntervalScale = Scale.extend({
127
127
  var lastNiceTick = ticks.length ? ticks[ticks.length - 1] : niceTickExtent[1];
128
128
  if (extent[1] > lastNiceTick) {
129
129
  if (expandToNicedExtent) {
130
- ticks.push(lastNiceTick + interval);
130
+ ticks.push(roundNumber(lastNiceTick + interval, intervalPrecision));
131
131
  }
132
132
  else {
133
133
  ticks.push(extent[1]);
@@ -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);
@@ -1124,7 +1124,7 @@ function animateOrSetProps(isUpdate, el, props, animatableModel, dataIndex, cb)
1124
1124
  * configuration in series.
1125
1125
  *
1126
1126
  * Caution: this method will stop previous animation.
1127
- * So if do not use this method to one element twice before
1127
+ * So do not use this method to one element twice before
1128
1128
  * animation starts, unless you know what you are doing.
1129
1129
  *
1130
1130
  * @param {module:zrender/Element} el
@@ -1150,7 +1150,7 @@ export function updateProps(el, props, animatableModel, dataIndex, cb) {
1150
1150
  * configuration in series.
1151
1151
  *
1152
1152
  * Caution: this method will stop previous animation.
1153
- * So if do not use this method to one element twice before
1153
+ * So do not use this method to one element twice before
1154
1154
  * animation starts, unless you know what you are doing.
1155
1155
  *
1156
1156
  * @param {module:zrender/Element} el