echarts 4.8.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 (145) hide show
  1. package/.DS_Store +0 -0
  2. package/.gitattributes +3 -0
  3. package/.github/workflows/nodejs.yml +3 -1
  4. package/.huskyrc +5 -0
  5. package/README.md +1 -1
  6. package/asset/.DS_Store +0 -0
  7. package/build/.DS_Store +0 -0
  8. package/dist/echarts-en.common.js +284 -93
  9. package/dist/echarts-en.common.min.js +1 -1
  10. package/dist/echarts-en.js +816 -284
  11. package/dist/echarts-en.js.map +1 -1
  12. package/dist/echarts-en.min.js +1 -1
  13. package/dist/echarts-en.simple.js +60 -26
  14. package/dist/echarts-en.simple.min.js +1 -1
  15. package/dist/echarts.common.js +284 -93
  16. package/dist/echarts.common.min.js +1 -1
  17. package/dist/echarts.js +816 -284
  18. package/dist/echarts.js.map +1 -1
  19. package/dist/echarts.min.js +1 -1
  20. package/dist/echarts.simple.js +60 -26
  21. package/dist/echarts.simple.min.js +1 -1
  22. package/dist/extension/bmap.js +33 -345
  23. package/dist/extension/bmap.js.map +1 -1
  24. package/dist/extension/bmap.min.js +1 -1
  25. package/dist/extension/dataTool.js.map +1 -1
  26. package/extension/.DS_Store +0 -0
  27. package/extension/bmap/BMapCoordSys.js +14 -4
  28. package/extension/bmap/BMapModel.js +4 -0
  29. package/extension/bmap/BMapView.js +18 -14
  30. package/extension-src/bmap/BMapCoordSys.js +14 -4
  31. package/extension-src/bmap/BMapModel.js +6 -1
  32. package/extension-src/bmap/BMapView.js +16 -10
  33. package/lib/chart/bar/BarView.js +49 -16
  34. package/lib/chart/bar/PictorialBarSeries.js +1 -1
  35. package/lib/chart/funnel/FunnelSeries.js +1 -0
  36. package/lib/chart/funnel/funnelLayout.js +162 -46
  37. package/lib/chart/graph/GraphSeries.js +12 -2
  38. package/lib/chart/graph/circularLayoutHelper.js +8 -2
  39. package/lib/chart/graph/forceLayout.js +6 -1
  40. package/lib/chart/graph/simpleLayout.js +1 -1
  41. package/lib/chart/graph/simpleLayoutHelper.js +10 -4
  42. package/lib/chart/helper/Line.js +35 -9
  43. package/lib/chart/helper/Symbol.js +1 -1
  44. package/lib/chart/helper/multipleGraphEdgeHelper.js +258 -0
  45. package/lib/chart/lines/LinesSeries.js +0 -2
  46. package/lib/chart/map/MapSeries.js +3 -2
  47. package/lib/chart/radar/RadarSeries.js +4 -3
  48. package/lib/chart/radar/RadarView.js +3 -1
  49. package/lib/chart/sunburst/SunburstPiece.js +4 -1
  50. package/lib/chart/sunburst/SunburstSeries.js +17 -5
  51. package/lib/chart/themeRiver/ThemeRiverSeries.js +21 -30
  52. package/lib/chart/tree/TreeSeries.js +1 -1
  53. package/lib/chart/tree/TreeView.js +4 -4
  54. package/lib/chart/treemap/TreemapSeries.js +14 -5
  55. package/lib/chart/treemap/treemapLayout.js +1 -1
  56. package/lib/chart/treemap/treemapVisual.js +9 -15
  57. package/lib/component/axisPointer/axisTrigger.js +1 -1
  58. package/lib/component/legend/ScrollableLegendView.js +1 -1
  59. package/lib/component/marker/MarkAreaView.js +53 -15
  60. package/lib/component/marker/MarkLineView.js +3 -0
  61. package/lib/component/marker/MarkPointView.js +8 -1
  62. package/lib/component/marker/MarkerModel.js +3 -2
  63. package/lib/component/timeline/SliderTimelineView.js +7 -1
  64. package/lib/component/title.js +1 -1
  65. package/lib/component/toolbox/feature/DataView.js +23 -8
  66. package/lib/component/toolbox/feature/DataZoom.js +6 -6
  67. package/lib/component/toolbox/feature/SaveAsImage.js +2 -1
  68. package/lib/component/tooltip/TooltipContent.js +42 -8
  69. package/lib/component/tooltip/TooltipRichContent.js +56 -8
  70. package/lib/component/tooltip/TooltipView.js +4 -4
  71. package/lib/component/visualMap/VisualMapModel.js +1 -1
  72. package/lib/coord/axisDefault.js +1 -1
  73. package/lib/coord/axisHelper.js +2 -2
  74. package/lib/coord/geo/GeoModel.js +2 -1
  75. package/lib/data/Graph.js +1 -6
  76. package/lib/data/List.js +1 -1
  77. package/lib/data/Tree.js +4 -31
  78. package/lib/echarts.js +2 -2
  79. package/lib/layout/barPolar.js +1 -1
  80. package/lib/processor/dataSample.js +1 -1
  81. package/lib/stream/Scheduler.js +1 -1
  82. package/lib/visual/VisualMapping.js +1 -1
  83. package/map/.DS_Store +0 -0
  84. package/map/js/.DS_Store +0 -0
  85. package/map/js/province/.DS_Store +0 -0
  86. package/map/json/.DS_Store +0 -0
  87. package/package.json +3 -2
  88. package/src/.DS_Store +0 -0
  89. package/src/chart/.DS_Store +0 -0
  90. package/src/chart/bar/BarView.js +50 -16
  91. package/src/chart/bar/PictorialBarSeries.js +2 -2
  92. package/src/chart/funnel/FunnelSeries.js +1 -0
  93. package/src/chart/funnel/funnelLayout.js +179 -53
  94. package/src/chart/graph/GraphSeries.js +9 -3
  95. package/src/chart/graph/circularLayoutHelper.js +8 -2
  96. package/src/chart/graph/forceLayout.js +7 -1
  97. package/src/chart/graph/simpleLayout.js +1 -1
  98. package/src/chart/graph/simpleLayoutHelper.js +12 -5
  99. package/src/chart/helper/Line.js +38 -11
  100. package/src/chart/helper/Symbol.js +2 -2
  101. package/src/chart/helper/createGraphFromNodeEdge.js +2 -1
  102. package/src/chart/helper/multipleGraphEdgeHelper.js +229 -0
  103. package/src/chart/lines/LinesSeries.js +1 -3
  104. package/src/chart/map/MapSeries.js +3 -2
  105. package/src/chart/radar/RadarSeries.js +4 -3
  106. package/src/chart/radar/RadarView.js +4 -2
  107. package/src/chart/sunburst/SunburstPiece.js +5 -1
  108. package/src/chart/sunburst/SunburstSeries.js +16 -8
  109. package/src/chart/themeRiver/ThemeRiverSeries.js +21 -27
  110. package/src/chart/tree/TreeSeries.js +1 -1
  111. package/src/chart/tree/TreeView.js +3 -3
  112. package/src/chart/treemap/TreemapSeries.js +11 -3
  113. package/src/chart/treemap/treemapLayout.js +2 -2
  114. package/src/chart/treemap/treemapVisual.js +8 -25
  115. package/src/component/axisPointer/axisTrigger.js +1 -1
  116. package/src/component/legend/ScrollableLegendView.js +1 -1
  117. package/src/component/marker/MarkAreaView.js +53 -15
  118. package/src/component/marker/MarkLineView.js +3 -1
  119. package/src/component/marker/MarkPointView.js +7 -1
  120. package/src/component/marker/MarkerModel.js +3 -2
  121. package/src/component/timeline/SliderTimelineView.js +9 -6
  122. package/src/component/title.js +2 -2
  123. package/src/component/toolbox/.DS_Store +0 -0
  124. package/src/component/toolbox/feature/DataView.js +20 -8
  125. package/src/component/toolbox/feature/DataZoom.js +6 -6
  126. package/src/component/toolbox/feature/SaveAsImage.js +2 -1
  127. package/src/component/tooltip/TooltipContent.js +36 -7
  128. package/src/component/tooltip/TooltipRichContent.js +52 -9
  129. package/src/component/tooltip/TooltipView.js +4 -4
  130. package/src/component/visualMap/VisualMapModel.js +1 -1
  131. package/src/coord/axisDefault.js +1 -1
  132. package/src/coord/axisHelper.js +4 -2
  133. package/src/coord/geo/GeoModel.js +3 -6
  134. package/src/data/Graph.js +0 -5
  135. package/src/data/List.js +1 -1
  136. package/src/data/Tree.js +4 -32
  137. package/src/echarts.js +2 -2
  138. package/src/layout/barPolar.js +4 -2
  139. package/src/model/.DS_Store +0 -0
  140. package/src/preprocessor/.DS_Store +0 -0
  141. package/src/processor/dataSample.js +1 -1
  142. package/src/stream/Scheduler.js +1 -1
  143. package/src/util/.DS_Store +0 -0
  144. package/src/visual/VisualMapping.js +1 -1
  145. package/theme/.DS_Store +0 -0
@@ -11595,7 +11595,7 @@ var instances$1 = {}; // ZRender实例map索引
11595
11595
  /**
11596
11596
  * @type {string}
11597
11597
  */
11598
- var version$1 = '4.3.1';
11598
+ var version$1 = '4.3.2';
11599
11599
 
11600
11600
  /**
11601
11601
  * Initializing a zrender instance
@@ -26152,7 +26152,7 @@ var proto = Scheduler.prototype;
26152
26152
  * @param {Object} payload
26153
26153
  */
26154
26154
  proto.restoreData = function (ecModel, payload) {
26155
- // TODO: Only restroe needed series and components, but not all components.
26155
+ // TODO: Only restore needed series and components, but not all components.
26156
26156
  // Currently `restoreData` of all of the series and component will be called.
26157
26157
  // But some independent components like `title`, `legend`, `graphic`, `toolbox`,
26158
26158
  // `tooltip`, `axisPointer`, etc, do not need series refresh when `setOption`,
@@ -27729,10 +27729,10 @@ var isFunction = isFunction$1;
27729
27729
  var isObject = isObject$1;
27730
27730
  var parseClassType = ComponentModel.parseClassType;
27731
27731
 
27732
- var version = '4.8.0';
27732
+ var version = '4.9.0';
27733
27733
 
27734
27734
  var dependencies = {
27735
- zrender: '4.3.1'
27735
+ zrender: '4.3.2'
27736
27736
  };
27737
27737
 
27738
27738
  var TEST_FRAME_REMAIN_TIME = 1;
@@ -30975,7 +30975,7 @@ listProto.mapDimension = function (coordDim, idx) {
30975
30975
  * Initialize from data
30976
30976
  * @param {Array.<Object|number|Array>} data source or data or data provider.
30977
30977
  * @param {Array.<string>} [nameLIst] The name of a datum is used on data diff and
30978
- * defualt label/tooltip.
30978
+ * default label/tooltip.
30979
30979
  * A name can be specified in encode.itemName,
30980
30980
  * or dataItem.name (only for series option data),
30981
30981
  * or provided in nameList from outside.
@@ -35567,8 +35567,8 @@ function rotateTextRect(textRect, rotate) {
35567
35567
  var boundingBox = textRect.plain();
35568
35568
  var beforeWidth = boundingBox.width;
35569
35569
  var beforeHeight = boundingBox.height;
35570
- var afterWidth = beforeWidth * Math.cos(rotateRadians) + beforeHeight * Math.sin(rotateRadians);
35571
- var afterHeight = beforeWidth * Math.sin(rotateRadians) + beforeHeight * Math.cos(rotateRadians);
35570
+ var afterWidth = beforeWidth * Math.abs(Math.cos(rotateRadians)) + Math.abs(beforeHeight * Math.sin(rotateRadians));
35571
+ var afterHeight = beforeWidth * Math.abs(Math.sin(rotateRadians)) + Math.abs(beforeHeight * Math.cos(rotateRadians));
35572
35572
  var rotatedRect = new BoundingRect(boundingBox.x, boundingBox.y, afterWidth, afterHeight);
35573
35573
 
35574
35574
  return rotatedRect;
@@ -37669,7 +37669,7 @@ symbolProto._updateCommon = function (data, idx, symbolSize, seriesScope) {
37669
37669
  }
37670
37670
  else {
37671
37671
  symbolPath.setStyle({
37672
- opacity: null,
37672
+ opacity: 1,
37673
37673
  shadowBlur: null,
37674
37674
  shadowOffsetX: null,
37675
37675
  shadowOffsetY: null,
@@ -39854,7 +39854,7 @@ var dataSample = function (seriesType) {
39854
39854
  var valueAxis = coordSys.getOtherAxis(baseAxis);
39855
39855
  var extent = baseAxis.getExtent();
39856
39856
  // Coordinste system has been resized
39857
- var size = extent[1] - extent[0];
39857
+ var size = Math.abs(extent[1] - extent[0]);
39858
39858
  var rate = Math.round(data.count() / size);
39859
39859
  if (rate > 1) {
39860
39860
  var sampler;
@@ -40310,7 +40310,7 @@ var defaultOption = {
40310
40310
  name: '',
40311
40311
  // 'start' | 'middle' | 'end'
40312
40312
  nameLocation: 'end',
40313
- // By degree. By defualt auto rotate by nameLocation.
40313
+ // By degree. By default auto rotate by nameLocation.
40314
40314
  nameRotate: null,
40315
40315
  nameTruncate: {
40316
40316
  maxWidth: null,
@@ -43553,20 +43553,25 @@ extendChartView({
43553
43553
  var bgEls = [];
43554
43554
  var oldBgEls = this._backgroundEls || [];
43555
43555
 
43556
+ var createBackground = function (dataIndex) {
43557
+ var bgLayout = getLayout[coord.type](data, dataIndex);
43558
+ var bgEl = createBackgroundEl(coord, isHorizontalOrRadial, bgLayout);
43559
+ bgEl.useStyle(backgroundModel.getBarItemStyle());
43560
+ // Only cartesian2d support borderRadius.
43561
+ if (coord.type === 'cartesian2d') {
43562
+ bgEl.setShape('r', barBorderRadius);
43563
+ }
43564
+ bgEls[dataIndex] = bgEl;
43565
+ return bgEl;
43566
+ };
43567
+
43556
43568
  data.diff(oldData)
43557
43569
  .add(function (dataIndex) {
43558
43570
  var itemModel = data.getItemModel(dataIndex);
43559
43571
  var layout = getLayout[coord.type](data, dataIndex, itemModel);
43560
43572
 
43561
43573
  if (drawBackground) {
43562
- var bgLayout = getLayout[coord.type](data, dataIndex);
43563
- var bgEl = createBackgroundEl(coord, isHorizontalOrRadial, bgLayout);
43564
- bgEl.useStyle(backgroundModel.getBarItemStyle());
43565
- // Only cartesian2d support borderRadius.
43566
- if (coord.type === 'cartesian2d') {
43567
- bgEl.setShape('r', barBorderRadius);
43568
- }
43569
- bgEls[dataIndex] = bgEl;
43574
+ createBackground(dataIndex);
43570
43575
  }
43571
43576
 
43572
43577
  // If dataZoom in filteMode: 'empty', the baseValue can be set as NaN in "axisProxy".
@@ -43600,13 +43605,19 @@ extendChartView({
43600
43605
  var layout = getLayout[coord.type](data, newIndex, itemModel);
43601
43606
 
43602
43607
  if (drawBackground) {
43603
- var bgEl = oldBgEls[oldIndex];
43604
- bgEl.useStyle(backgroundModel.getBarItemStyle());
43605
- // Only cartesian2d support borderRadius.
43606
- if (coord.type === 'cartesian2d') {
43607
- bgEl.setShape('r', barBorderRadius);
43608
+ var bgEl;
43609
+ if (oldBgEls.length === 0) {
43610
+ bgEl = createBackground(oldIndex);
43611
+ }
43612
+ else {
43613
+ bgEl = oldBgEls[oldIndex];
43614
+ bgEl.useStyle(backgroundModel.getBarItemStyle());
43615
+ // Only cartesian2d support borderRadius.
43616
+ if (coord.type === 'cartesian2d') {
43617
+ bgEl.setShape('r', barBorderRadius);
43618
+ }
43619
+ bgEls[newIndex] = bgEl;
43608
43620
  }
43609
- bgEls[newIndex] = bgEl;
43610
43621
 
43611
43622
  var bgLayout = getLayout[coord.type](data, newIndex);
43612
43623
  var shape = createBackgroundShape(isHorizontalOrRadial, bgLayout, coord);
@@ -43766,8 +43777,31 @@ var clip = {
43766
43777
  return clipped;
43767
43778
  },
43768
43779
 
43769
- polar: function (coordSysClipArea) {
43770
- return false;
43780
+ polar: function (coordSysClipArea, layout) {
43781
+ var signR = layout.r0 <= layout.r ? 1 : -1;
43782
+ // Make sure r is larger than r0
43783
+ if (signR < 0) {
43784
+ var r = layout.r;
43785
+ layout.r = layout.r0;
43786
+ layout.r0 = r;
43787
+ }
43788
+
43789
+ var r = mathMin$4(layout.r, coordSysClipArea.r);
43790
+ var r0 = mathMax$4(layout.r0, coordSysClipArea.r0);
43791
+
43792
+ layout.r = r;
43793
+ layout.r0 = r0;
43794
+
43795
+ var clipped = r - r0 < 0;
43796
+
43797
+ // Reverse back
43798
+ if (signR < 0) {
43799
+ var r = layout.r;
43800
+ layout.r = layout.r0;
43801
+ layout.r0 = r;
43802
+ }
43803
+
43804
+ return clipped;
43771
43805
  }
43772
43806
  };
43773
43807
 
@@ -47110,7 +47144,7 @@ function processOnAxis(axisInfo, newValue, updaters, dontSnap, outputFinder) {
47110
47144
  var snapToValue = payloadInfo.snapToValue;
47111
47145
 
47112
47146
  // Fill content of event obj for echarts.connect.
47113
- // By defualt use the first involved series data as a sample to connect.
47147
+ // By default use the first involved series data as a sample to connect.
47114
47148
  if (payloadBatch[0] && outputFinder.seriesIndex == null) {
47115
47149
  extend(outputFinder, payloadBatch[0]);
47116
47150
  }
@@ -48788,8 +48822,21 @@ function assembleFont(textStyleModel) {
48788
48822
 
48789
48823
  cssText.push('font:' + textStyleModel.getFont());
48790
48824
 
48825
+ var lineHeight = textStyleModel.get('lineHeight');
48826
+ if (lineHeight == null) {
48827
+ lineHeight = Math.round(fontSize * 3 / 2);
48828
+ }
48829
+
48791
48830
  fontSize
48792
- && cssText.push('line-height:' + Math.round(fontSize * 3 / 2) + 'px');
48831
+ && cssText.push('line-height:' + lineHeight + 'px');
48832
+
48833
+ var shadowColor = textStyleModel.get('textShadowColor');
48834
+ var shadowBlur = textStyleModel.get('textShadowBlur') || 0;
48835
+ var shadowOffsetX = textStyleModel.get('textShadowOffsetX') || 0;
48836
+ var shadowOffsetY = textStyleModel.get('textShadowOffsetY') || 0;
48837
+ shadowBlur
48838
+ && cssText.push('text-shadow:' + shadowOffsetX + 'px ' + shadowOffsetY + 'px '
48839
+ + shadowBlur + 'px ' + shadowColor);
48793
48840
 
48794
48841
  each$10(['decoration', 'align'], function (name) {
48795
48842
  var val = textStyleModel.get(name);
@@ -48873,6 +48920,8 @@ function makeStyleCoord(out, zr, appendToBody, zrX, zrY) {
48873
48920
  out[1] += viewportRootOffset.offsetTop;
48874
48921
  }
48875
48922
  }
48923
+ out[2] = out[0] / zr.getWidth(); // The ratio of left to width
48924
+ out[3] = out[1] / zr.getHeight(); // The ratio of top to height
48876
48925
  }
48877
48926
 
48878
48927
  /**
@@ -48897,7 +48946,7 @@ function TooltipContent(container, api, opt) {
48897
48946
  var zr = this._zr = api.getZr();
48898
48947
  var appendToBody = this._appendToBody = opt && opt.appendToBody;
48899
48948
 
48900
- this._styleCoord = [0, 0];
48949
+ this._styleCoord = [0, 0, 0, 0]; // [left, top, left/width, top/height]
48901
48950
 
48902
48951
  makeStyleCoord(this._styleCoord, zr, appendToBody, api.getWidth() / 2, api.getHeight() / 2);
48903
48952
 
@@ -48968,7 +49017,7 @@ TooltipContent.prototype = {
48968
49017
  /**
48969
49018
  * Update when tooltip is rendered
48970
49019
  */
48971
- update: function () {
49020
+ update: function (tooltipModel) {
48972
49021
  // FIXME
48973
49022
  // Move this logic to ec main?
48974
49023
  var container = this._container;
@@ -48978,11 +49027,25 @@ TooltipContent.prototype = {
48978
49027
  if (domStyle.position !== 'absolute' && stl.position !== 'absolute') {
48979
49028
  domStyle.position = 'relative';
48980
49029
  }
49030
+ var alwaysShowContent = tooltipModel.get('alwaysShowContent');
49031
+ alwaysShowContent && this._moveTooltipIfResized();
48981
49032
  // Hide the tooltip
48982
49033
  // PENDING
48983
49034
  // this.hide();
48984
49035
  },
48985
49036
 
49037
+ /**
49038
+ * when `alwaysShowContent` is true,
49039
+ * we should move the tooltip after chart resized
49040
+ */
49041
+ _moveTooltipIfResized: function () {
49042
+ var ratioX = this._styleCoord[2]; // The ratio of left to width
49043
+ var ratioY = this._styleCoord[3]; // The ratio of top to height
49044
+ var realX = ratioX * this._zr.getWidth();
49045
+ var realY = ratioY * this._zr.getHeight();
49046
+ this.moveTo(realX, realY);
49047
+ },
49048
+
48986
49049
  show: function (tooltipModel) {
48987
49050
  clearTimeout(this._hideTimeout);
48988
49051
  var el = this.el;
@@ -48997,10 +49060,10 @@ TooltipContent.prototype = {
48997
49060
 
48998
49061
  el.style.display = el.innerHTML ? 'block' : 'none';
48999
49062
 
49000
- // If mouse occsionally move over the tooltip, a mouseout event will be
49001
- // triggered by canvas, and cuase some unexpectable result like dragging
49063
+ // If mouse occasionally move over the tooltip, a mouseout event will be
49064
+ // triggered by canvas, and cause some unexpectable result like dragging
49002
49065
  // stop, "unfocusAdjacency". Here `pointer-events: none` is used to solve
49003
- // it. Although it is not suppored by IE8~IE10, fortunately it is a rare
49066
+ // it. Although it is not supported by IE8~IE10, fortunately it is a rare
49004
49067
  // scenario.
49005
49068
  el.style.pointerEvents = this._enterable ? 'auto' : 'none';
49006
49069
 
@@ -49038,7 +49101,7 @@ TooltipContent.prototype = {
49038
49101
  if (this._show && !(this._inContent && this._enterable)) {
49039
49102
  if (time) {
49040
49103
  this._hideDelay = time;
49041
- // Set show false to avoid invoke hideLater mutiple times
49104
+ // Set show false to avoid invoke hideLater multiple times
49042
49105
  this._show = false;
49043
49106
  this._hideTimeout = setTimeout(bind(this.hide, this), time);
49044
49107
  }
@@ -49095,13 +49158,24 @@ TooltipContent.prototype = {
49095
49158
  */
49096
49159
 
49097
49160
  // import Group from 'zrender/src/container/Group';
49161
+ function makeStyleCoord$1(out, zr, zrX, zrY) {
49162
+ out[0] = zrX;
49163
+ out[1] = zrY;
49164
+ out[2] = out[0] / zr.getWidth(); // The ratio of left to width
49165
+ out[3] = out[1] / zr.getHeight(); // The ratio of top to height
49166
+ }
49167
+
49098
49168
  /**
49099
49169
  * @alias module:echarts/component/tooltip/TooltipRichContent
49100
49170
  * @constructor
49101
49171
  */
49102
49172
  function TooltipRichContent(api) {
49103
49173
 
49104
- this._zr = api.getZr();
49174
+ var zr = this._zr = api.getZr();
49175
+
49176
+ this._styleCoord = [0, 0, 0, 0]; // [left, top, left/width, top/height]
49177
+
49178
+ makeStyleCoord$1(this._styleCoord, zr, api.getWidth() / 2, api.getHeight() / 2);
49105
49179
 
49106
49180
  this._show = false;
49107
49181
 
@@ -49124,8 +49198,21 @@ TooltipRichContent.prototype = {
49124
49198
  /**
49125
49199
  * Update when tooltip is rendered
49126
49200
  */
49127
- update: function () {
49128
- // noop
49201
+ update: function (tooltipModel) {
49202
+ var alwaysShowContent = tooltipModel.get('alwaysShowContent');
49203
+ alwaysShowContent && this._moveTooltipIfResized();
49204
+ },
49205
+
49206
+ /**
49207
+ * when `alwaysShowContent` is true,
49208
+ * we should move the tooltip after chart resized
49209
+ */
49210
+ _moveTooltipIfResized: function () {
49211
+ var ratioX = this._styleCoord[2]; // The ratio of left to width
49212
+ var ratioY = this._styleCoord[3]; // The ratio of top to height
49213
+ var realX = ratioX * this._zr.getWidth();
49214
+ var realY = ratioY * this._zr.getHeight();
49215
+ this.moveTo(realX, realY);
49129
49216
  },
49130
49217
 
49131
49218
  show: function (tooltipModel) {
@@ -49180,16 +49267,23 @@ TooltipRichContent.prototype = {
49180
49267
  startId = text.indexOf('{marker');
49181
49268
  }
49182
49269
 
49270
+ var textStyleModel = tooltipModel.getModel('textStyle');
49271
+ var fontSize = textStyleModel.get('fontSize');
49272
+ var lineHeight = tooltipModel.get('textLineHeight');
49273
+ if (lineHeight == null) {
49274
+ lineHeight = Math.round(fontSize * 3 / 2);
49275
+ }
49276
+
49183
49277
  this.el = new Text({
49184
- style: {
49278
+ style: setTextStyle({}, textStyleModel, {
49185
49279
  rich: markers,
49186
49280
  text: content,
49187
- textLineHeight: 20,
49188
49281
  textBackgroundColor: tooltipModel.get('backgroundColor'),
49189
49282
  textBorderRadius: tooltipModel.get('borderRadius'),
49190
49283
  textFill: tooltipModel.get('textStyle.color'),
49191
- textPadding: tooltipModel.get('padding')
49192
- },
49284
+ textPadding: tooltipModel.get('padding'),
49285
+ textLineHeight: lineHeight
49286
+ }),
49193
49287
  z: tooltipModel.get('z')
49194
49288
  });
49195
49289
  this._zr.add(this.el);
@@ -49224,7 +49318,9 @@ TooltipRichContent.prototype = {
49224
49318
 
49225
49319
  moveTo: function (x, y) {
49226
49320
  if (this.el) {
49227
- this.el.attr('position', [x, y]);
49321
+ var styleCoord = this._styleCoord;
49322
+ makeStyleCoord$1(styleCoord, this._zr, x, y);
49323
+ this.el.attr('position', [styleCoord[0], styleCoord[1]]);
49228
49324
  }
49229
49325
  },
49230
49326
 
@@ -49239,7 +49335,7 @@ TooltipRichContent.prototype = {
49239
49335
  if (this._show && !(this._inContent && this._enterable)) {
49240
49336
  if (time) {
49241
49337
  this._hideDelay = time;
49242
- // Set show false to avoid invoke hideLater mutiple times
49338
+ // Set show false to avoid invoke hideLater multiple times
49243
49339
  this._show = false;
49244
49340
  this._hideTimeout = setTimeout(bind(this.hide, this), time);
49245
49341
  }
@@ -49253,6 +49349,14 @@ TooltipRichContent.prototype = {
49253
49349
  return this._show;
49254
49350
  },
49255
49351
 
49352
+ dispose: function () {
49353
+ clearTimeout(this._hideTimeout);
49354
+
49355
+ if (this.el) {
49356
+ this._zr.remove(this.el);
49357
+ }
49358
+ },
49359
+
49256
49360
  getOuterSize: function () {
49257
49361
  var size = this.getSize();
49258
49362
  return {
@@ -49357,7 +49461,7 @@ extendComponentView({
49357
49461
  this._alwaysShowContent = tooltipModel.get('alwaysShowContent');
49358
49462
 
49359
49463
  var tooltipContent = this._tooltipContent;
49360
- tooltipContent.update();
49464
+ tooltipContent.update(tooltipModel);
49361
49465
  tooltipContent.setEnterable(tooltipModel.get('enterable'));
49362
49466
 
49363
49467
  this._initGlobalListener();
@@ -49587,7 +49691,7 @@ extendComponentView({
49587
49691
  _showOrMove: function (tooltipModel, cb) {
49588
49692
  // showDelay is used in this case: tooltip.enterable is set
49589
49693
  // as true. User intent to move mouse into tooltip and click
49590
- // something. `showDelay` makes it easyer to enter the content
49694
+ // something. `showDelay` makes it easier to enter the content
49591
49695
  // but tooltip do not move immediately.
49592
49696
  var delay = tooltipModel.get('showDelay');
49593
49697
  cb = bind(cb, this);
@@ -49672,7 +49776,7 @@ extendComponentView({
49672
49776
 
49673
49777
  // Default tooltip content
49674
49778
  // FIXME
49675
- // (1) shold be the first data which has name?
49779
+ // (1) should be the first data which has name?
49676
49780
  // (2) themeRiver, firstDataIndex is array, and first line is unnecessary.
49677
49781
  var firstLine = valueLabel;
49678
49782
  if (renderMode !== 'html') {
@@ -49788,7 +49892,7 @@ extendComponentView({
49788
49892
  var asyncTicket = Math.random();
49789
49893
 
49790
49894
  // Do not check whether `trigger` is 'none' here, because `trigger`
49791
- // only works on cooridinate system. In fact, we have not found case
49895
+ // only works on coordinate system. In fact, we have not found case
49792
49896
  // that requires setting `trigger` nothing on component yet.
49793
49897
 
49794
49898
  this._showOrMove(subTooltipModel, function () {
@@ -51834,7 +51938,7 @@ var ScrollableLegendView = LegendView.extend({
51834
51938
  var legendDataIdx = child.__legendDataIndex;
51835
51939
  // FIXME
51836
51940
  // If the given targetDataIndex (from model) is illegal,
51837
- // we use defualtIndex. But the index on the legend model and
51941
+ // we use defaultIndex. But the index on the legend model and
51838
51942
  // action payload is still illegal. That case will not be
51839
51943
  // changed until some scenario requires.
51840
51944
  if (defaultIndex == null && legendDataIdx != null) {
@@ -52076,7 +52180,7 @@ extendComponentView({
52076
52180
  }
52077
52181
  if (sublink) {
52078
52182
  subTextEl.on('click', function () {
52079
- windowOpen(link, '_' + titleModel.get('subtarget'));
52183
+ windowOpen(sublink, '_' + titleModel.get('subtarget'));
52080
52184
  });
52081
52185
  }
52082
52186
 
@@ -52277,15 +52381,16 @@ var MarkerModel = extendComponentModel({
52277
52381
  }
52278
52382
  },
52279
52383
 
52280
- formatTooltip: function (dataIndex) {
52384
+ formatTooltip: function (dataIndex, multipleSeries, dataType, renderMode) {
52281
52385
  var data = this.getData();
52282
52386
  var value = this.getRawValue(dataIndex);
52283
52387
  var formattedValue = isArray(value)
52284
52388
  ? map(value, addCommas$1).join(', ') : addCommas$1(value);
52285
52389
  var name = data.getName(dataIndex);
52286
52390
  var html = encodeHTML$1(this.name);
52391
+ var newLine = renderMode === 'html' ? '<br/>' : '\n';
52287
52392
  if (value != null || name) {
52288
- html += '<br />';
52393
+ html += newLine;
52289
52394
  }
52290
52395
  if (name) {
52291
52396
  html += encodeHTML$1(name);
@@ -52750,10 +52855,12 @@ MarkerView.extend({
52750
52855
  var itemModel = mpData.getItemModel(idx);
52751
52856
  var symbol = itemModel.getShallow('symbol');
52752
52857
  var symbolSize = itemModel.getShallow('symbolSize');
52858
+ var symbolRotate = itemModel.getShallow('symbolRotate');
52753
52859
  var isFnSymbol = isFunction$1(symbol);
52754
52860
  var isFnSymbolSize = isFunction$1(symbolSize);
52861
+ var isFnSymbolRotate = isFunction$1(symbolRotate);
52755
52862
 
52756
- if (isFnSymbol || isFnSymbolSize) {
52863
+ if (isFnSymbol || isFnSymbolSize || isFnSymbolRotate) {
52757
52864
  var rawIdx = mpModel.getRawValue(idx);
52758
52865
  var dataParams = mpModel.getDataParams(idx);
52759
52866
  if (isFnSymbol) {
@@ -52763,11 +52870,15 @@ MarkerView.extend({
52763
52870
  // FIXME 这里不兼容 ECharts 2.x,2.x 貌似参数是整个数据?
52764
52871
  symbolSize = symbolSize(rawIdx, dataParams);
52765
52872
  }
52873
+ if (isFnSymbolRotate) {
52874
+ symbolRotate = symbolRotate(rawIdx, dataParams);
52875
+ }
52766
52876
  }
52767
52877
 
52768
52878
  mpData.setItemVisual(idx, {
52769
52879
  symbol: symbol,
52770
52880
  symbolSize: symbolSize,
52881
+ symbolRotate: symbolRotate,
52771
52882
  color: itemModel.get('itemStyle.color')
52772
52883
  || seriesData.getVisual('color')
52773
52884
  });
@@ -53019,22 +53130,29 @@ function makeSymbolTypeKey(symbolCategory) {
53019
53130
  * @inner
53020
53131
  */
53021
53132
  function createSymbol$1(name, lineData, idx) {
53022
- var color = lineData.getItemVisual(idx, 'color');
53023
53133
  var symbolType = lineData.getItemVisual(idx, name);
53024
- var symbolSize = lineData.getItemVisual(idx, name + 'Size');
53025
53134
 
53026
53135
  if (!symbolType || symbolType === 'none') {
53027
53136
  return;
53028
53137
  }
53029
53138
 
53139
+ var color = lineData.getItemVisual(idx, 'color');
53140
+ var symbolSize = lineData.getItemVisual(idx, name + 'Size');
53141
+ var symbolRotate = lineData.getItemVisual(idx, name + 'Rotate');
53142
+
53030
53143
  if (!isArray(symbolSize)) {
53031
53144
  symbolSize = [symbolSize, symbolSize];
53032
53145
  }
53146
+
53033
53147
  var symbolPath = createSymbol(
53034
53148
  symbolType, -symbolSize[0] / 2, -symbolSize[1] / 2,
53035
53149
  symbolSize[0], symbolSize[1], color
53036
53150
  );
53037
53151
 
53152
+ // rotate by default if symbolRotate is not specified or NaN
53153
+ symbolPath.__specifiedRotation = symbolRotate == null || isNaN(symbolRotate)
53154
+ ? void 0
53155
+ : +symbolRotate * Math.PI / 180 || 0;
53038
53156
  symbolPath.name = name;
53039
53157
 
53040
53158
  return symbolPath;
@@ -53102,18 +53220,38 @@ function updateSymbolAndLabelBeforeLineUpdate() {
53102
53220
 
53103
53221
  if (symbolFrom) {
53104
53222
  symbolFrom.attr('position', fromPos);
53105
- var tangent = line.tangentAt(0);
53106
- symbolFrom.attr('rotation', Math.PI / 2 - Math.atan2(
53107
- tangent[1], tangent[0]
53108
- ));
53223
+ // Fix #12388
53224
+ // when symbol is set to be 'arrow' in markLine,
53225
+ // symbolRotate value will be ignored, and compulsively use tangent angle.
53226
+ // rotate by default if symbol rotation is not specified
53227
+ var specifiedRotation = symbolFrom.__specifiedRotation;
53228
+ if (specifiedRotation == null) {
53229
+ var tangent = line.tangentAt(0);
53230
+ symbolFrom.attr('rotation', Math.PI / 2 - Math.atan2(
53231
+ tangent[1], tangent[0]
53232
+ ));
53233
+ }
53234
+ else {
53235
+ symbolFrom.attr('rotation', specifiedRotation);
53236
+ }
53109
53237
  symbolFrom.attr('scale', [invScale * percent, invScale * percent]);
53110
53238
  }
53111
53239
  if (symbolTo) {
53112
53240
  symbolTo.attr('position', toPos);
53113
- var tangent = line.tangentAt(1);
53114
- symbolTo.attr('rotation', -Math.PI / 2 - Math.atan2(
53115
- tangent[1], tangent[0]
53116
- ));
53241
+ // Fix #12388
53242
+ // when symbol is set to be 'arrow' in markLine,
53243
+ // symbolRotate value will be ignored, and compulsively use tangent angle.
53244
+ // rotate by default if symbol rotation is not specified
53245
+ var specifiedRotation = symbolTo.__specifiedRotation;
53246
+ if (specifiedRotation == null) {
53247
+ var tangent = line.tangentAt(1);
53248
+ symbolTo.attr('rotation', -Math.PI / 2 - Math.atan2(
53249
+ tangent[1], tangent[0]
53250
+ ));
53251
+ }
53252
+ else {
53253
+ symbolTo.attr('rotation', specifiedRotation);
53254
+ }
53117
53255
  symbolTo.attr('scale', [invScale * percent, invScale * percent]);
53118
53256
  }
53119
53257
 
@@ -53909,8 +54047,10 @@ MarkerView.extend({
53909
54047
  ]);
53910
54048
 
53911
54049
  lineData.setItemVisual(idx, {
54050
+ 'fromSymbolRotate': fromData.getItemVisual(idx, 'symbolRotate'),
53912
54051
  'fromSymbolSize': fromData.getItemVisual(idx, 'symbolSize'),
53913
54052
  'fromSymbol': fromData.getItemVisual(idx, 'symbol'),
54053
+ 'toSymbolRotate': toData.getItemVisual(idx, 'symbolRotate'),
53914
54054
  'toSymbolSize': toData.getItemVisual(idx, 'symbolSize'),
53915
54055
  'toSymbol': toData.getItemVisual(idx, 'symbol')
53916
54056
  });
@@ -53932,8 +54072,8 @@ MarkerView.extend({
53932
54072
  updateSingleMarkerEndLayout(
53933
54073
  data, idx, isFrom, seriesModel, api
53934
54074
  );
53935
-
53936
54075
  data.setItemVisual(idx, {
54076
+ symbolRotate: itemModel.get('symbolRotate'),
53937
54077
  symbolSize: itemModel.get('symbolSize') || symbolSize[isFrom ? 0 : 1],
53938
54078
  symbol: itemModel.get('symbol', true) || symbolType[isFrom ? 0 : 1],
53939
54079
  color: itemModel.get('itemStyle.color') || seriesData.getVisual('color')
@@ -54292,9 +54432,29 @@ MarkerView.extend({
54292
54432
  // Update visual and layout of line
54293
54433
  areaData.each(function (idx) {
54294
54434
  // Layout
54295
- areaData.setItemLayout(idx, map(dimPermutations, function (dim) {
54435
+ var points = map(dimPermutations, function (dim) {
54296
54436
  return getSingleMarkerEndPoint(areaData, idx, dim, seriesModel, api);
54297
- }));
54437
+ });
54438
+ // If none of the area is inside coordSys, allClipped is set to be true
54439
+ // in layout so that label will not be displayed. See #12591
54440
+ var allClipped = true;
54441
+ each$1(dimPermutations, function (dim) {
54442
+ if (!allClipped) {
54443
+ return;
54444
+ }
54445
+ var xValue = areaData.get(dim[0], idx);
54446
+ var yValue = areaData.get(dim[1], idx);
54447
+ // If is infinity, the axis should be considered not clipped
54448
+ if ((isInifinity$1(xValue) || coordSys.getAxis('x').containData(xValue))
54449
+ && (isInifinity$1(yValue) || coordSys.getAxis('y').containData(yValue))
54450
+ ) {
54451
+ allClipped = false;
54452
+ }
54453
+ });
54454
+ areaData.setItemLayout(idx, {
54455
+ points: points,
54456
+ allClipped: allClipped
54457
+ });
54298
54458
 
54299
54459
  // Visual
54300
54460
  areaData.setItemVisual(idx, {
@@ -54305,23 +54465,41 @@ MarkerView.extend({
54305
54465
 
54306
54466
  areaData.diff(polygonGroup.__data)
54307
54467
  .add(function (idx) {
54308
- var polygon = new Polygon({
54309
- shape: {
54310
- points: areaData.getItemLayout(idx)
54311
- }
54312
- });
54313
- areaData.setItemGraphicEl(idx, polygon);
54314
- polygonGroup.group.add(polygon);
54468
+ var layout = areaData.getItemLayout(idx);
54469
+ if (!layout.allClipped) {
54470
+ var polygon = new Polygon({
54471
+ shape: {
54472
+ points: layout.points
54473
+ }
54474
+ });
54475
+ areaData.setItemGraphicEl(idx, polygon);
54476
+ polygonGroup.group.add(polygon);
54477
+ }
54315
54478
  })
54316
54479
  .update(function (newIdx, oldIdx) {
54317
54480
  var polygon = polygonGroup.__data.getItemGraphicEl(oldIdx);
54318
- updateProps(polygon, {
54319
- shape: {
54320
- points: areaData.getItemLayout(newIdx)
54481
+ var layout = areaData.getItemLayout(newIdx);
54482
+ if (!layout.allClipped) {
54483
+ if (polygon) {
54484
+ updateProps(polygon, {
54485
+ shape: {
54486
+ points: layout.points
54487
+ }
54488
+ }, maModel, newIdx);
54321
54489
  }
54322
- }, maModel, newIdx);
54323
- polygonGroup.group.add(polygon);
54324
- areaData.setItemGraphicEl(newIdx, polygon);
54490
+ else {
54491
+ polygon = new Polygon({
54492
+ shape: {
54493
+ points: layout.points
54494
+ }
54495
+ });
54496
+ }
54497
+ areaData.setItemGraphicEl(newIdx, polygon);
54498
+ polygonGroup.group.add(polygon);
54499
+ }
54500
+ else if (polygon) {
54501
+ polygonGroup.group.remove(polygon);
54502
+ }
54325
54503
  })
54326
54504
  .remove(function (idx) {
54327
54505
  var polygon = polygonGroup.__data.getItemGraphicEl(idx);
@@ -58370,7 +58548,8 @@ proto$2.onclick = function (ecModel, api) {
58370
58548
  $a.target = '_blank';
58371
58549
  $a.href = url;
58372
58550
  var evt = new MouseEvent('click', {
58373
- view: window,
58551
+ // some micro front-end framework, window maybe is a Proxy
58552
+ view: document.defaultView,
58374
58553
  bubbles: true,
58375
58554
  cancelable: false
58376
58555
  });
@@ -58685,7 +58864,8 @@ function assembleSeriesWithCategoryAxis(series) {
58685
58864
  }));
58686
58865
  var columns = [categoryAxis.model.getCategories()];
58687
58866
  each$1(group.series, function (series) {
58688
- columns.push(series.getRawData().mapArray(valueAxisDim, function (val) {
58867
+ var rawData = series.getRawData();
58868
+ columns.push(series.getRawData().mapArray(rawData.mapDimension(valueAxisDim), function (val) {
58689
58869
  return val;
58690
58870
  }));
58691
58871
  });
@@ -58803,7 +58983,13 @@ function parseListContents(str) {
58803
58983
 
58804
58984
  var data = [];
58805
58985
  for (var i = 0; i < lines.length; i++) {
58806
- var items = trim$1(lines[i]).split(itemSplitRegex);
58986
+ // if line is empty, ignore it.
58987
+ // there is a case that a user forgot to delete `\n`.
58988
+ var line = trim$1(lines[i]);
58989
+ if (!line) {
58990
+ continue;
58991
+ }
58992
+ var items = line.split(itemSplitRegex);
58807
58993
  var name = '';
58808
58994
  var value;
58809
58995
  var hasName = false;
@@ -59018,13 +59204,18 @@ function tryMergeDataOption(newData, originalData) {
59018
59204
  return map(newData, function (newVal, idx) {
59019
59205
  var original = originalData && originalData[idx];
59020
59206
  if (isObject$1(original) && !isArray(original)) {
59021
- if (isObject$1(newVal) && !isArray(newVal)) {
59022
- newVal = newVal.value;
59207
+ var newValIsObject = isObject$1(newVal) && !isArray(newVal);
59208
+ if (!newValIsObject) {
59209
+ newVal = {
59210
+ value: newVal
59211
+ };
59023
59212
  }
59213
+ // original data has name but new data has no name
59214
+ var shouldDeleteName = original.name != null && newVal.name == null;
59024
59215
  // Original data has option
59025
- return defaults({
59026
- value: newVal
59027
- }, original);
59216
+ newVal = defaults(newVal, original);
59217
+ shouldDeleteName && (delete newVal.name);
59218
+ return newVal;
59028
59219
  }
59029
59220
  else {
59030
59221
  return newVal;
@@ -60855,7 +61046,11 @@ DataZoom.defaultOption = {
60855
61046
  back: 'M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26'
60856
61047
  },
60857
61048
  // `zoom`, `back`
60858
- title: clone(dataZoomLang.title)
61049
+ title: clone(dataZoomLang.title),
61050
+ brushStyle: {
61051
+ borderWidth: 0,
61052
+ color: 'rgba(0,0,0,0.2)'
61053
+ }
60859
61054
  };
60860
61055
 
60861
61056
  var proto$4 = DataZoom.prototype;
@@ -61030,11 +61225,7 @@ function updateZoomBtnStatus(featureModel, ecModel, view, payload, api) {
61030
61225
  zoomActive
61031
61226
  ? {
61032
61227
  brushType: 'auto',
61033
- brushStyle: {
61034
- // FIXME user customized?
61035
- lineWidth: 0,
61036
- fill: 'rgba(0,0,0,0.2)'
61037
- }
61228
+ brushStyle: featureModel.getModel('brushStyle').getItemStyle()
61038
61229
  }
61039
61230
  : false
61040
61231
  );
@@ -63616,7 +63807,7 @@ GradientManager.prototype.updateDom = function (gradient, dom) {
63616
63807
  stop.setAttribute('offset', colors[i].offset * 100 + '%');
63617
63808
 
63618
63809
  var color = colors[i].color;
63619
- if (color.indexOf('rgba' > -1)) {
63810
+ if (color.indexOf('rgba') > -1) {
63620
63811
  // Fix Safari bug that stop-color not recognizing alpha #9014
63621
63812
  var opacity = parse(color)[3];
63622
63813
  var hex = toHex(color);