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
@@ -469,7 +469,7 @@ function drawEdge(
469
469
 
470
470
  graphic.updateProps(edge, {
471
471
  shape: getEdgeShape(seriesScope, sourceLayout, targetLayout),
472
- style: {opacity: 1}
472
+ style: zrUtil.defaults({opacity: 1}, seriesScope.lineStyle)
473
473
  }, seriesModel);
474
474
  }
475
475
  }
@@ -499,7 +499,7 @@ function drawEdge(
499
499
  parentPoint: [targetLayout.x, targetLayout.y],
500
500
  childPoints: childPoints
501
501
  },
502
- style: {opacity: 1}
502
+ style: zrUtil.defaults({opacity: 1}, seriesScope.lineStyle)
503
503
  }, seriesModel);
504
504
  }
505
505
  }
@@ -637,4 +637,4 @@ function getEdgeShape(seriesScope, sourceLayout, targetLayout) {
637
637
  cpy2: cpy2
638
638
  };
639
639
 
640
- }
640
+ }
@@ -182,21 +182,29 @@ export default SeriesModel.extend({
182
182
 
183
183
  var levels = option.levels || [];
184
184
 
185
+ // Used in "visual priority" in `treemapVisual.js`.
186
+ // This way is a little tricky, must satisfy the precondition:
187
+ // 1. There is no `treeNode.getModel('itemStyle.xxx')` used.
188
+ // 2. The `Model.prototype.getModel()` will not use any clone-like way.
189
+ var designatedVisualItemStyle = this.designatedVisualItemStyle = {};
190
+ var designatedVisualModel = new Model({itemStyle: designatedVisualItemStyle}, this, ecModel);
191
+
185
192
  levels = option.levels = setDefault(levels, ecModel);
186
193
  var levelModels = zrUtil.map(levels || [], function (levelDefine) {
187
- return new Model(levelDefine, this, ecModel);
194
+ return new Model(levelDefine, designatedVisualModel, ecModel);
188
195
  }, this);
189
196
 
190
197
  // Make sure always a new tree is created when setOption,
191
198
  // in TreemapView, we check whether oldTree === newTree
192
199
  // to choose mappings approach among old shapes and new shapes.
193
- var tree = Tree.createTree(root, this, null, beforeLink);
200
+ var tree = Tree.createTree(root, this, beforeLink);
194
201
 
195
202
  function beforeLink(nodeData) {
196
203
  nodeData.wrapMethod('getItemModel', function (model, idx) {
197
204
  var node = tree.getNodeByDataIndex(idx);
198
205
  var levelModel = levelModels[node.depth];
199
- levelModel && (model.parentModel = levelModel);
206
+ // If no levelModel, we also need `designatedVisualModel`.
207
+ model.parentModel = levelModel || designatedVisualModel;
200
208
  return model;
201
209
  });
202
210
  }
@@ -474,7 +474,7 @@ function position(row, rowFixedLength, rect, halfGapWidth, flush) {
474
474
  rect[wh[idx1WhenH]] -= rowOtherLength;
475
475
  }
476
476
 
477
- // Return [containerWidth, containerHeight] as defualt.
477
+ // Return [containerWidth, containerHeight] as default.
478
478
  function estimateRootSize(seriesModel, targetInfo, viewRoot, containerWidth, containerHeight) {
479
479
  // If targetInfo.node exists, we zoom to the node,
480
480
  // so estimate whold width and heigth by target node.
@@ -596,4 +596,4 @@ function prunning(node, clipRect, viewAbovePath, viewRoot, depth) {
596
596
 
597
597
  function getUpperLabelHeight(model) {
598
598
  return model.get(PATH_UPPER_LABEL_SHOW) ? model.get(PATH_UPPER_LABEL_HEIGHT) : 0;
599
- }
599
+ }
@@ -30,21 +30,14 @@ export default {
30
30
  reset: function (seriesModel, ecModel, api, payload) {
31
31
  var tree = seriesModel.getData().tree;
32
32
  var root = tree.root;
33
- var seriesItemStyleModel = seriesModel.getModel(ITEM_STYLE_NORMAL);
34
33
 
35
34
  if (root.isRemoved()) {
36
35
  return;
37
36
  }
38
37
 
39
- var levelItemStyles = zrUtil.map(tree.levelModels, function (levelModel) {
40
- return levelModel ? levelModel.get(ITEM_STYLE_NORMAL) : null;
41
- });
42
-
43
38
  travelTree(
44
39
  root, // Visual should calculate from tree root but not view root.
45
40
  {},
46
- levelItemStyles,
47
- seriesItemStyleModel,
48
41
  seriesModel.getViewRoot().getAncestors(),
49
42
  seriesModel
50
43
  );
@@ -52,8 +45,7 @@ export default {
52
45
  };
53
46
 
54
47
  function travelTree(
55
- node, designatedVisual, levelItemStyles, seriesItemStyleModel,
56
- viewRootAncestors, seriesModel
48
+ node, designatedVisual, viewRootAncestors, seriesModel
57
49
  ) {
58
50
  var nodeModel = node.getModel();
59
51
  var nodeLayout = node.getLayout();
@@ -64,10 +56,7 @@ function travelTree(
64
56
  }
65
57
 
66
58
  var nodeItemStyleModel = node.getModel(ITEM_STYLE_NORMAL);
67
- var levelItemStyle = levelItemStyles[node.depth];
68
- var visuals = buildVisuals(
69
- nodeItemStyleModel, designatedVisual, levelItemStyle, seriesItemStyleModel
70
- );
59
+ var visuals = buildVisuals(nodeItemStyleModel, designatedVisual, seriesModel);
71
60
 
72
61
  // calculate border color
73
62
  var borderColor = nodeItemStyleModel.get('borderColor');
@@ -100,27 +89,21 @@ function travelTree(
100
89
  var childVisual = mapVisual(
101
90
  nodeModel, visuals, child, index, mapping, seriesModel
102
91
  );
103
- travelTree(
104
- child, childVisual, levelItemStyles, seriesItemStyleModel,
105
- viewRootAncestors, seriesModel
106
- );
92
+ travelTree(child, childVisual, viewRootAncestors, seriesModel);
107
93
  }
108
94
  });
109
95
  }
110
96
  }
111
97
 
112
- function buildVisuals(
113
- nodeItemStyleModel, designatedVisual, levelItemStyle, seriesItemStyleModel
114
- ) {
98
+ function buildVisuals(nodeItemStyleModel, designatedVisual, seriesModel) {
115
99
  var visuals = zrUtil.extend({}, designatedVisual);
100
+ var designatedVisualItemStyle = seriesModel.designatedVisualItemStyle;
116
101
 
117
102
  zrUtil.each(['color', 'colorAlpha', 'colorSaturation'], function (visualName) {
118
103
  // Priority: thisNode > thisLevel > parentNodeDesignated > seriesModel
119
- var val = nodeItemStyleModel.get(visualName, true); // Ignore parent
120
- val == null && levelItemStyle && (val = levelItemStyle[visualName]);
121
- val == null && (val = designatedVisual[visualName]);
122
- val == null && (val = seriesItemStyleModel.get(visualName));
123
-
104
+ designatedVisualItemStyle[visualName] = designatedVisual[visualName];
105
+ var val = nodeItemStyleModel.get(visualName);
106
+ designatedVisualItemStyle[visualName] = null;
124
107
  val != null && (visuals[visualName] = val);
125
108
  });
126
109
 
@@ -163,7 +163,7 @@ function processOnAxis(axisInfo, newValue, updaters, dontSnap, outputFinder) {
163
163
  var snapToValue = payloadInfo.snapToValue;
164
164
 
165
165
  // Fill content of event obj for echarts.connect.
166
- // By defualt use the first involved series data as a sample to connect.
166
+ // By default use the first involved series data as a sample to connect.
167
167
  if (payloadBatch[0] && outputFinder.seriesIndex == null) {
168
168
  zrUtil.extend(outputFinder, payloadBatch[0]);
169
169
  }
@@ -471,7 +471,7 @@ var ScrollableLegendView = LegendView.extend({
471
471
  var legendDataIdx = child.__legendDataIndex;
472
472
  // FIXME
473
473
  // If the given targetDataIndex (from model) is illegal,
474
- // we use defualtIndex. But the index on the legend model and
474
+ // we use defaultIndex. But the index on the legend model and
475
475
  // action payload is still illegal. That case will not be
476
476
  // changed until some scenario requires.
477
477
  if (defaultIndex == null && legendDataIdx != null) {
@@ -208,9 +208,29 @@ MarkerView.extend({
208
208
  // Update visual and layout of line
209
209
  areaData.each(function (idx) {
210
210
  // Layout
211
- areaData.setItemLayout(idx, zrUtil.map(dimPermutations, function (dim) {
211
+ var points = zrUtil.map(dimPermutations, function (dim) {
212
212
  return getSingleMarkerEndPoint(areaData, idx, dim, seriesModel, api);
213
- }));
213
+ });
214
+ // If none of the area is inside coordSys, allClipped is set to be true
215
+ // in layout so that label will not be displayed. See #12591
216
+ var allClipped = true;
217
+ zrUtil.each(dimPermutations, function (dim) {
218
+ if (!allClipped) {
219
+ return;
220
+ }
221
+ var xValue = areaData.get(dim[0], idx);
222
+ var yValue = areaData.get(dim[1], idx);
223
+ // If is infinity, the axis should be considered not clipped
224
+ if ((isInifinity(xValue) || coordSys.getAxis('x').containData(xValue))
225
+ && (isInifinity(yValue) || coordSys.getAxis('y').containData(yValue))
226
+ ) {
227
+ allClipped = false;
228
+ }
229
+ });
230
+ areaData.setItemLayout(idx, {
231
+ points: points,
232
+ allClipped: allClipped
233
+ });
214
234
 
215
235
  // Visual
216
236
  areaData.setItemVisual(idx, {
@@ -221,23 +241,41 @@ MarkerView.extend({
221
241
 
222
242
  areaData.diff(polygonGroup.__data)
223
243
  .add(function (idx) {
224
- var polygon = new graphic.Polygon({
225
- shape: {
226
- points: areaData.getItemLayout(idx)
227
- }
228
- });
229
- areaData.setItemGraphicEl(idx, polygon);
230
- polygonGroup.group.add(polygon);
244
+ var layout = areaData.getItemLayout(idx);
245
+ if (!layout.allClipped) {
246
+ var polygon = new graphic.Polygon({
247
+ shape: {
248
+ points: layout.points
249
+ }
250
+ });
251
+ areaData.setItemGraphicEl(idx, polygon);
252
+ polygonGroup.group.add(polygon);
253
+ }
231
254
  })
232
255
  .update(function (newIdx, oldIdx) {
233
256
  var polygon = polygonGroup.__data.getItemGraphicEl(oldIdx);
234
- graphic.updateProps(polygon, {
235
- shape: {
236
- points: areaData.getItemLayout(newIdx)
257
+ var layout = areaData.getItemLayout(newIdx);
258
+ if (!layout.allClipped) {
259
+ if (polygon) {
260
+ graphic.updateProps(polygon, {
261
+ shape: {
262
+ points: layout.points
263
+ }
264
+ }, maModel, newIdx);
237
265
  }
238
- }, maModel, newIdx);
239
- polygonGroup.group.add(polygon);
240
- areaData.setItemGraphicEl(newIdx, polygon);
266
+ else {
267
+ polygon = new graphic.Polygon({
268
+ shape: {
269
+ points: layout.points
270
+ }
271
+ });
272
+ }
273
+ areaData.setItemGraphicEl(newIdx, polygon);
274
+ polygonGroup.group.add(polygon);
275
+ }
276
+ else if (polygon) {
277
+ polygonGroup.group.remove(polygon);
278
+ }
241
279
  })
242
280
  .remove(function (idx) {
243
281
  var polygon = polygonGroup.__data.getItemGraphicEl(idx);
@@ -294,8 +294,10 @@ export default MarkerView.extend({
294
294
  ]);
295
295
 
296
296
  lineData.setItemVisual(idx, {
297
+ 'fromSymbolRotate': fromData.getItemVisual(idx, 'symbolRotate'),
297
298
  'fromSymbolSize': fromData.getItemVisual(idx, 'symbolSize'),
298
299
  'fromSymbol': fromData.getItemVisual(idx, 'symbol'),
300
+ 'toSymbolRotate': toData.getItemVisual(idx, 'symbolRotate'),
299
301
  'toSymbolSize': toData.getItemVisual(idx, 'symbolSize'),
300
302
  'toSymbol': toData.getItemVisual(idx, 'symbol')
301
303
  });
@@ -317,8 +319,8 @@ export default MarkerView.extend({
317
319
  updateSingleMarkerEndLayout(
318
320
  data, idx, isFrom, seriesModel, api
319
321
  );
320
-
321
322
  data.setItemVisual(idx, {
323
+ symbolRotate: itemModel.get('symbolRotate'),
322
324
  symbolSize: itemModel.get('symbolSize') || symbolSize[isFrom ? 0 : 1],
323
325
  symbol: itemModel.get('symbol', true) || symbolType[isFrom ? 0 : 1],
324
326
  color: itemModel.get('itemStyle.color') || seriesData.getVisual('color')
@@ -104,10 +104,12 @@ export default MarkerView.extend({
104
104
  var itemModel = mpData.getItemModel(idx);
105
105
  var symbol = itemModel.getShallow('symbol');
106
106
  var symbolSize = itemModel.getShallow('symbolSize');
107
+ var symbolRotate = itemModel.getShallow('symbolRotate');
107
108
  var isFnSymbol = zrUtil.isFunction(symbol);
108
109
  var isFnSymbolSize = zrUtil.isFunction(symbolSize);
110
+ var isFnSymbolRotate = zrUtil.isFunction(symbolRotate);
109
111
 
110
- if (isFnSymbol || isFnSymbolSize) {
112
+ if (isFnSymbol || isFnSymbolSize || isFnSymbolRotate) {
111
113
  var rawIdx = mpModel.getRawValue(idx);
112
114
  var dataParams = mpModel.getDataParams(idx);
113
115
  if (isFnSymbol) {
@@ -117,11 +119,15 @@ export default MarkerView.extend({
117
119
  // FIXME 这里不兼容 ECharts 2.x,2.x 貌似参数是整个数据?
118
120
  symbolSize = symbolSize(rawIdx, dataParams);
119
121
  }
122
+ if (isFnSymbolRotate) {
123
+ symbolRotate = symbolRotate(rawIdx, dataParams);
124
+ }
120
125
  }
121
126
 
122
127
  mpData.setItemVisual(idx, {
123
128
  symbol: symbol,
124
129
  symbolSize: symbolSize,
130
+ symbolRotate: symbolRotate,
125
131
  color: itemModel.get('itemStyle.color')
126
132
  || seriesData.getVisual('color')
127
133
  });
@@ -121,15 +121,16 @@ var MarkerModel = echarts.extendComponentModel({
121
121
  }
122
122
  },
123
123
 
124
- formatTooltip: function (dataIndex) {
124
+ formatTooltip: function (dataIndex, multipleSeries, dataType, renderMode) {
125
125
  var data = this.getData();
126
126
  var value = this.getRawValue(dataIndex);
127
127
  var formattedValue = zrUtil.isArray(value)
128
128
  ? zrUtil.map(value, addCommas).join(', ') : addCommas(value);
129
129
  var name = data.getName(dataIndex);
130
130
  var html = encodeHTML(this.name);
131
+ var newLine = renderMode === 'html' ? '<br/>' : '\n';
131
132
  if (value != null || name) {
132
- html += '<br />';
133
+ html += newLine;
133
134
  }
134
135
  if (name) {
135
136
  html += encodeHTML(name);
@@ -618,13 +618,16 @@ function getViewRect(model, api) {
618
618
  }
619
619
 
620
620
  function makeIcon(timelineModel, objPath, rect, opts) {
621
- var icon = graphic.makePath(
622
- timelineModel.get(objPath).replace(/^path:\/\//, ''),
623
- zrUtil.clone(opts || {}),
624
- new BoundingRect(rect[0], rect[1], rect[2], rect[3]),
625
- 'center'
621
+ var style = opts.style;
622
+ var icon = graphic.createIcon(
623
+ timelineModel.get(objPath),
624
+ opts || {},
625
+ new BoundingRect(rect[0], rect[1], rect[2], rect[3])
626
626
  );
627
-
627
+ // TODO createIcon won't use style in opt.
628
+ if (style) {
629
+ icon.setStyle(style);
630
+ }
628
631
  return icon;
629
632
  }
630
633
 
@@ -149,7 +149,7 @@ echarts.extendComponentView({
149
149
  }
150
150
  if (sublink) {
151
151
  subTextEl.on('click', function () {
152
- windowOpen(link, '_' + titleModel.get('subtarget'));
152
+ windowOpen(sublink, '_' + titleModel.get('subtarget'));
153
153
  });
154
154
  }
155
155
 
@@ -233,4 +233,4 @@ echarts.extendComponentView({
233
233
 
234
234
  group.add(rect);
235
235
  }
236
- });
236
+ });
Binary file
@@ -93,7 +93,8 @@ function assembleSeriesWithCategoryAxis(series) {
93
93
  }));
94
94
  var columns = [categoryAxis.model.getCategories()];
95
95
  zrUtil.each(group.series, function (series) {
96
- columns.push(series.getRawData().mapArray(valueAxisDim, function (val) {
96
+ var rawData = series.getRawData();
97
+ columns.push(series.getRawData().mapArray(rawData.mapDimension(valueAxisDim), function (val) {
97
98
  return val;
98
99
  }));
99
100
  });
@@ -211,7 +212,13 @@ function parseListContents(str) {
211
212
 
212
213
  var data = [];
213
214
  for (var i = 0; i < lines.length; i++) {
214
- var items = trim(lines[i]).split(itemSplitRegex);
215
+ // if line is empty, ignore it.
216
+ // there is a case that a user forgot to delete `\n`.
217
+ var line = trim(lines[i]);
218
+ if (!line) {
219
+ continue;
220
+ }
221
+ var items = line.split(itemSplitRegex);
215
222
  var name = '';
216
223
  var value;
217
224
  var hasName = false;
@@ -426,13 +433,18 @@ function tryMergeDataOption(newData, originalData) {
426
433
  return zrUtil.map(newData, function (newVal, idx) {
427
434
  var original = originalData && originalData[idx];
428
435
  if (zrUtil.isObject(original) && !zrUtil.isArray(original)) {
429
- if (zrUtil.isObject(newVal) && !zrUtil.isArray(newVal)) {
430
- newVal = newVal.value;
436
+ var newValIsObject = zrUtil.isObject(newVal) && !zrUtil.isArray(newVal);
437
+ if (!newValIsObject) {
438
+ newVal = {
439
+ value: newVal
440
+ };
431
441
  }
442
+ // original data has name but new data has no name
443
+ var shouldDeleteName = original.name != null && newVal.name == null;
432
444
  // Original data has option
433
- return zrUtil.defaults({
434
- value: newVal
435
- }, original);
445
+ newVal = zrUtil.defaults(newVal, original);
446
+ shouldDeleteName && (delete newVal.name);
447
+ return newVal;
436
448
  }
437
449
  else {
438
450
  return newVal;
@@ -472,4 +484,4 @@ echarts.registerAction({
472
484
  }, payload.newOption));
473
485
  });
474
486
 
475
- export default DataView;
487
+ export default DataView;
@@ -61,7 +61,11 @@ DataZoom.defaultOption = {
61
61
  back: 'M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26'
62
62
  },
63
63
  // `zoom`, `back`
64
- title: zrUtil.clone(dataZoomLang.title)
64
+ title: zrUtil.clone(dataZoomLang.title),
65
+ brushStyle: {
66
+ borderWidth: 0,
67
+ color: 'rgba(0,0,0,0.2)'
68
+ }
65
69
  };
66
70
 
67
71
  var proto = DataZoom.prototype;
@@ -236,11 +240,7 @@ function updateZoomBtnStatus(featureModel, ecModel, view, payload, api) {
236
240
  zoomActive
237
241
  ? {
238
242
  brushType: 'auto',
239
- brushStyle: {
240
- // FIXME user customized?
241
- lineWidth: 0,
242
- fill: 'rgba(0,0,0,0.2)'
243
- }
243
+ brushStyle: featureModel.getModel('brushStyle').getItemStyle()
244
244
  }
245
245
  : false
246
246
  );
@@ -67,7 +67,8 @@ proto.onclick = function (ecModel, api) {
67
67
  $a.target = '_blank';
68
68
  $a.href = url;
69
69
  var evt = new MouseEvent('click', {
70
- view: window,
70
+ // some micro front-end framework, window maybe is a Proxy
71
+ view: document.defaultView,
71
72
  bubbles: true,
72
73
  cancelable: false
73
74
  });
@@ -60,8 +60,21 @@ function assembleFont(textStyleModel) {
60
60
 
61
61
  cssText.push('font:' + textStyleModel.getFont());
62
62
 
63
+ var lineHeight = textStyleModel.get('lineHeight');
64
+ if (lineHeight == null) {
65
+ lineHeight = Math.round(fontSize * 3 / 2);
66
+ }
67
+
63
68
  fontSize
64
- && cssText.push('line-height:' + Math.round(fontSize * 3 / 2) + 'px');
69
+ && cssText.push('line-height:' + lineHeight + 'px');
70
+
71
+ var shadowColor = textStyleModel.get('textShadowColor');
72
+ var shadowBlur = textStyleModel.get('textShadowBlur') || 0;
73
+ var shadowOffsetX = textStyleModel.get('textShadowOffsetX') || 0;
74
+ var shadowOffsetY = textStyleModel.get('textShadowOffsetY') || 0;
75
+ shadowBlur
76
+ && cssText.push('text-shadow:' + shadowOffsetX + 'px ' + shadowOffsetY + 'px '
77
+ + shadowBlur + 'px ' + shadowColor);
65
78
 
66
79
  each(['decoration', 'align'], function (name) {
67
80
  var val = textStyleModel.get(name);
@@ -145,6 +158,8 @@ function makeStyleCoord(out, zr, appendToBody, zrX, zrY) {
145
158
  out[1] += viewportRootOffset.offsetTop;
146
159
  }
147
160
  }
161
+ out[2] = out[0] / zr.getWidth(); // The ratio of left to width
162
+ out[3] = out[1] / zr.getHeight(); // The ratio of top to height
148
163
  }
149
164
 
150
165
  /**
@@ -169,7 +184,7 @@ function TooltipContent(container, api, opt) {
169
184
  var zr = this._zr = api.getZr();
170
185
  var appendToBody = this._appendToBody = opt && opt.appendToBody;
171
186
 
172
- this._styleCoord = [0, 0];
187
+ this._styleCoord = [0, 0, 0, 0]; // [left, top, left/width, top/height]
173
188
 
174
189
  makeStyleCoord(this._styleCoord, zr, appendToBody, api.getWidth() / 2, api.getHeight() / 2);
175
190
 
@@ -240,7 +255,7 @@ TooltipContent.prototype = {
240
255
  /**
241
256
  * Update when tooltip is rendered
242
257
  */
243
- update: function () {
258
+ update: function (tooltipModel) {
244
259
  // FIXME
245
260
  // Move this logic to ec main?
246
261
  var container = this._container;
@@ -250,11 +265,25 @@ TooltipContent.prototype = {
250
265
  if (domStyle.position !== 'absolute' && stl.position !== 'absolute') {
251
266
  domStyle.position = 'relative';
252
267
  }
268
+ var alwaysShowContent = tooltipModel.get('alwaysShowContent');
269
+ alwaysShowContent && this._moveTooltipIfResized();
253
270
  // Hide the tooltip
254
271
  // PENDING
255
272
  // this.hide();
256
273
  },
257
274
 
275
+ /**
276
+ * when `alwaysShowContent` is true,
277
+ * we should move the tooltip after chart resized
278
+ */
279
+ _moveTooltipIfResized: function () {
280
+ var ratioX = this._styleCoord[2]; // The ratio of left to width
281
+ var ratioY = this._styleCoord[3]; // The ratio of top to height
282
+ var realX = ratioX * this._zr.getWidth();
283
+ var realY = ratioY * this._zr.getHeight();
284
+ this.moveTo(realX, realY);
285
+ },
286
+
258
287
  show: function (tooltipModel) {
259
288
  clearTimeout(this._hideTimeout);
260
289
  var el = this.el;
@@ -269,10 +298,10 @@ TooltipContent.prototype = {
269
298
 
270
299
  el.style.display = el.innerHTML ? 'block' : 'none';
271
300
 
272
- // If mouse occsionally move over the tooltip, a mouseout event will be
273
- // triggered by canvas, and cuase some unexpectable result like dragging
301
+ // If mouse occasionally move over the tooltip, a mouseout event will be
302
+ // triggered by canvas, and cause some unexpectable result like dragging
274
303
  // stop, "unfocusAdjacency". Here `pointer-events: none` is used to solve
275
- // it. Although it is not suppored by IE8~IE10, fortunately it is a rare
304
+ // it. Although it is not supported by IE8~IE10, fortunately it is a rare
276
305
  // scenario.
277
306
  el.style.pointerEvents = this._enterable ? 'auto' : 'none';
278
307
 
@@ -310,7 +339,7 @@ TooltipContent.prototype = {
310
339
  if (this._show && !(this._inContent && this._enterable)) {
311
340
  if (time) {
312
341
  this._hideDelay = time;
313
- // Set show false to avoid invoke hideLater mutiple times
342
+ // Set show false to avoid invoke hideLater multiple times
314
343
  this._show = false;
315
344
  this._hideTimeout = setTimeout(zrUtil.bind(this.hide, this), time);
316
345
  }