echarts 4.5.0-rc.2 → 4.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (256) hide show
  1. package/.github/pull_request_template.md +66 -0
  2. package/.github/workflows/nodejs.yml +12 -2
  3. package/CONTRIBUTING.md +16 -160
  4. package/NOTICE +1 -1
  5. package/README.md +2 -2
  6. package/dist/echarts-en.common.js +2808 -1188
  7. package/dist/echarts-en.common.min.js +1 -1
  8. package/dist/echarts-en.js +3559 -1437
  9. package/dist/echarts-en.js.map +1 -1
  10. package/dist/echarts-en.min.js +1 -1
  11. package/dist/echarts-en.simple.js +2453 -1002
  12. package/dist/echarts-en.simple.min.js +1 -1
  13. package/dist/echarts.common.js +2782 -1188
  14. package/dist/echarts.common.min.js +1 -1
  15. package/dist/echarts.js +3533 -1437
  16. package/dist/echarts.js.map +1 -1
  17. package/dist/echarts.min.js +1 -1
  18. package/dist/echarts.simple.js +2427 -1002
  19. package/dist/echarts.simple.min.js +1 -1
  20. package/dist/extension/bmap.js +336 -2
  21. package/dist/extension/bmap.js.map +1 -1
  22. package/dist/extension/bmap.min.js +1 -1
  23. package/extension/bmap/BMapView.js +6 -2
  24. package/extension-src/bmap/BMapView.js +3 -2
  25. package/lib/chart/bar/BarSeries.js +14 -1
  26. package/lib/chart/bar/BarView.js +161 -16
  27. package/lib/chart/bar/BaseBarSeries.js +3 -1
  28. package/lib/chart/candlestick/candlestickVisual.js +1 -1
  29. package/lib/chart/effectScatter/EffectScatterSeries.js +3 -1
  30. package/lib/chart/funnel/FunnelSeries.js +13 -5
  31. package/lib/chart/gauge/GaugeSeries.js +0 -2
  32. package/lib/chart/graph/GraphSeries.js +11 -5
  33. package/lib/chart/graph/GraphView.js +30 -12
  34. package/lib/chart/heatmap/HeatmapView.js +4 -4
  35. package/lib/chart/helper/EffectLine.js +23 -1
  36. package/lib/chart/helper/EffectSymbol.js +2 -1
  37. package/lib/chart/helper/Line.js +94 -33
  38. package/lib/chart/helper/LineDraw.js +5 -1
  39. package/lib/chart/helper/Symbol.js +1 -2
  40. package/lib/chart/helper/createClipPathFromCoordSys.js +4 -1
  41. package/lib/chart/helper/createListFromArray.js +14 -8
  42. package/lib/chart/helper/createRenderPlanner.js +6 -3
  43. package/lib/chart/helper/whiskerBoxCommon.js +22 -16
  44. package/lib/chart/line/LineSeries.js +3 -1
  45. package/lib/chart/line/LineView.js +41 -2
  46. package/lib/chart/map/MapSeries.js +11 -3
  47. package/lib/chart/pie/PieSeries.js +27 -6
  48. package/lib/chart/pie/PieView.js +22 -15
  49. package/lib/chart/pie/labelLayout.js +102 -19
  50. package/lib/chart/pie/pieLayout.js +19 -7
  51. package/lib/chart/radar/RadarSeries.js +23 -3
  52. package/lib/chart/sankey/SankeySeries.js +13 -1
  53. package/lib/chart/sankey/SankeyView.js +70 -32
  54. package/lib/chart/sankey/sankeyLayout.js +22 -3
  55. package/lib/chart/scatter/ScatterSeries.js +3 -1
  56. package/lib/chart/sunburst/SunburstPiece.js +1 -0
  57. package/lib/chart/sunburst/SunburstSeries.js +12 -7
  58. package/lib/chart/sunburst/SunburstView.js +5 -1
  59. package/lib/chart/themeRiver/ThemeRiverSeries.js +3 -3
  60. package/lib/chart/tree/TreeSeries.js +20 -3
  61. package/lib/chart/tree/TreeView.js +151 -25
  62. package/lib/chart/treemap/TreemapSeries.js +15 -3
  63. package/lib/chart/treemap/TreemapView.js +80 -38
  64. package/lib/component/axis/AngleAxisView.js +64 -7
  65. package/lib/component/axis/AxisBuilder.js +62 -24
  66. package/lib/component/axis/CartesianAxisView.js +52 -85
  67. package/lib/component/axis/RadiusAxisView.js +36 -4
  68. package/lib/component/axis/SingleAxisView.js +21 -6
  69. package/lib/component/axis/axisSplitHelper.js +132 -0
  70. package/lib/component/brush/BrushView.js +11 -1
  71. package/lib/component/brush/visualEncoding.js +13 -2
  72. package/lib/component/dataZoom/SliderZoomView.js +4 -10
  73. package/lib/component/helper/BrushController.js +33 -43
  74. package/lib/component/helper/MapDraw.js +30 -4
  75. package/lib/component/legend/LegendModel.js +3 -3
  76. package/lib/component/legend/LegendView.js +17 -13
  77. package/lib/component/legend/ScrollableLegendView.js +18 -18
  78. package/lib/component/marker/MarkLineModel.js +2 -1
  79. package/lib/component/marker/markerHelper.js +7 -4
  80. package/lib/component/title.js +6 -2
  81. package/lib/component/toolbox/ToolboxView.js +5 -1
  82. package/lib/component/toolbox/feature/MagicType.js +20 -14
  83. package/lib/component/toolbox/feature/SaveAsImage.js +2 -1
  84. package/lib/component/tooltip/TooltipContent.js +60 -23
  85. package/lib/component/tooltip/TooltipView.js +7 -8
  86. package/lib/component/visualMap/PiecewiseModel.js +3 -6
  87. package/lib/coord/Axis.js +30 -2
  88. package/lib/coord/View.js +9 -0
  89. package/lib/coord/axisDefault.js +21 -2
  90. package/lib/coord/axisHelper.js +22 -16
  91. package/lib/coord/calendar/Calendar.js +8 -4
  92. package/lib/coord/geo/geoJSONLoader.js +3 -2
  93. package/lib/coord/geo/geoSourceManager.js +3 -2
  94. package/lib/coord/geo/parseGeoJson.js +3 -2
  95. package/lib/coord/radar/Radar.js +5 -5
  96. package/lib/data/DataDimensionInfo.js +157 -0
  97. package/lib/data/List.js +25 -19
  98. package/lib/data/Tree.js +9 -19
  99. package/lib/data/helper/completeDimensions.js +43 -32
  100. package/lib/data/helper/createDimensions.js +2 -0
  101. package/lib/data/helper/sourceHelper.js +214 -114
  102. package/lib/echarts.js +57 -34
  103. package/lib/langEN.js +26 -0
  104. package/lib/layout/barGrid.js +19 -13
  105. package/lib/layout/barPolar.js +0 -5
  106. package/lib/loading/default.js +43 -27
  107. package/lib/model/Series.js +4 -4
  108. package/lib/model/referHelper.js +40 -12
  109. package/lib/scale/Interval.js +87 -2
  110. package/lib/scale/Log.js +9 -2
  111. package/lib/scale/helper.js +1 -43
  112. package/lib/stream/Scheduler.js +9 -1
  113. package/lib/theme/dark.js +3 -0
  114. package/lib/util/format.js +19 -2
  115. package/lib/util/graphic.js +14 -12
  116. package/lib/visual/LegendVisualProvider.js +75 -0
  117. package/lib/visual/dataColor.js +2 -12
  118. package/lib/visual/seriesColor.js +15 -7
  119. package/lib/visual/symbol.js +12 -2
  120. package/map/js/china.js +1 -1
  121. package/map/js/province/chongqing.js +1 -1
  122. package/map/js/province/gansu.js +2 -2
  123. package/map/js/province/tianjin.js +1 -28
  124. package/map/json/china.json +1 -1
  125. package/map/json/province/chongqing.json +1 -1
  126. package/map/json/province/tianjin.json +1 -1
  127. package/package.json +11 -6
  128. package/src/chart/bar/BarSeries.js +15 -1
  129. package/src/chart/bar/BarView.js +162 -15
  130. package/src/chart/bar/BaseBarSeries.js +1 -1
  131. package/src/chart/candlestick/candlestickVisual.js +1 -1
  132. package/src/chart/effectScatter/EffectScatterSeries.js +1 -1
  133. package/src/chart/funnel/FunnelSeries.js +10 -4
  134. package/src/chart/gauge/GaugeSeries.js +0 -1
  135. package/src/chart/graph/GraphSeries.js +10 -4
  136. package/src/chart/graph/GraphView.js +28 -10
  137. package/src/chart/heatmap/HeatmapView.js +4 -4
  138. package/src/chart/helper/EffectLine.js +23 -1
  139. package/src/chart/helper/EffectSymbol.js +2 -1
  140. package/src/chart/helper/Line.js +84 -26
  141. package/src/chart/helper/LineDraw.js +5 -1
  142. package/src/chart/helper/Symbol.js +2 -2
  143. package/src/chart/helper/createClipPathFromCoordSys.js +4 -0
  144. package/src/chart/helper/createListFromArray.js +13 -8
  145. package/src/chart/helper/createRenderPlanner.js +5 -2
  146. package/src/chart/helper/whiskerBoxCommon.js +21 -16
  147. package/src/chart/line/LineSeries.js +1 -1
  148. package/src/chart/line/LineView.js +45 -1
  149. package/src/chart/map/MapSeries.js +8 -3
  150. package/src/chart/pie/PieSeries.js +26 -5
  151. package/src/chart/pie/PieView.js +20 -15
  152. package/src/chart/pie/labelLayout.js +114 -22
  153. package/src/chart/pie/pieLayout.js +20 -7
  154. package/src/chart/radar/RadarSeries.js +27 -3
  155. package/src/chart/sankey/SankeySeries.js +12 -1
  156. package/src/chart/sankey/SankeyView.js +75 -30
  157. package/src/chart/sankey/sankeyLayout.js +25 -5
  158. package/src/chart/scatter/ScatterSeries.js +1 -1
  159. package/src/chart/sunburst/SunburstPiece.js +2 -0
  160. package/src/chart/sunburst/SunburstSeries.js +12 -7
  161. package/src/chart/sunburst/SunburstView.js +2 -1
  162. package/src/chart/themeRiver/ThemeRiverSeries.js +4 -3
  163. package/src/chart/tree/TreeSeries.js +19 -6
  164. package/src/chart/tree/TreeView.js +155 -22
  165. package/src/chart/treemap/TreemapSeries.js +15 -5
  166. package/src/chart/treemap/TreemapView.js +77 -41
  167. package/src/component/axis/AngleAxisView.js +75 -7
  168. package/src/component/axis/AxisBuilder.js +77 -32
  169. package/src/component/axis/CartesianAxisView.js +47 -83
  170. package/src/component/axis/RadiusAxisView.js +37 -4
  171. package/src/component/axis/SingleAxisView.js +21 -4
  172. package/src/component/axis/axisSplitHelper.js +114 -0
  173. package/src/component/brush/BrushView.js +8 -1
  174. package/src/component/brush/visualEncoding.js +6 -3
  175. package/src/component/dataZoom/SliderZoomView.js +4 -9
  176. package/src/component/helper/BrushController.js +40 -47
  177. package/src/component/helper/MapDraw.js +27 -4
  178. package/src/component/legend/LegendModel.js +3 -3
  179. package/src/component/legend/LegendView.js +18 -12
  180. package/src/component/legend/ScrollableLegendView.js +18 -16
  181. package/src/component/marker/MarkLineModel.js +2 -1
  182. package/src/component/marker/markerHelper.js +8 -5
  183. package/src/component/title.js +3 -2
  184. package/src/component/toolbox/ToolboxView.js +5 -0
  185. package/src/component/toolbox/feature/MagicType.js +19 -13
  186. package/src/component/toolbox/feature/SaveAsImage.js +2 -1
  187. package/src/component/tooltip/TooltipContent.js +59 -22
  188. package/src/component/tooltip/TooltipView.js +10 -8
  189. package/src/component/visualMap/PiecewiseModel.js +5 -9
  190. package/src/coord/Axis.js +29 -2
  191. package/src/coord/View.js +10 -1
  192. package/src/coord/axisDefault.js +25 -1
  193. package/src/coord/axisHelper.js +26 -19
  194. package/src/coord/calendar/Calendar.js +12 -5
  195. package/src/coord/geo/geoJSONLoader.js +3 -2
  196. package/src/coord/geo/geoSourceManager.js +3 -2
  197. package/src/coord/geo/parseGeoJson.js +3 -2
  198. package/src/coord/radar/Radar.js +6 -8
  199. package/src/data/DataDimensionInfo.js +135 -0
  200. package/src/data/List.js +29 -16
  201. package/src/data/Tree.js +12 -17
  202. package/src/data/helper/completeDimensions.js +49 -30
  203. package/src/data/helper/createDimensions.js +2 -0
  204. package/src/data/helper/sourceHelper.js +216 -124
  205. package/src/echarts.js +60 -36
  206. package/src/langEN.js +26 -0
  207. package/src/layout/barGrid.js +22 -10
  208. package/src/layout/barPolar.js +0 -4
  209. package/src/loading/default.js +46 -34
  210. package/src/model/Series.js +4 -4
  211. package/src/model/referHelper.js +34 -11
  212. package/src/scale/Interval.js +84 -4
  213. package/src/scale/Log.js +9 -2
  214. package/src/scale/helper.js +1 -39
  215. package/src/stream/Scheduler.js +8 -0
  216. package/src/theme/dark.js +3 -0
  217. package/src/util/format.js +17 -1
  218. package/src/util/graphic.js +13 -11
  219. package/src/visual/LegendVisualProvider.js +55 -0
  220. package/src/visual/dataColor.js +0 -13
  221. package/src/visual/seriesColor.js +13 -7
  222. package/src/visual/symbol.js +11 -2
  223. package/theme/azul.js +163 -0
  224. package/theme/bee-inspired.js +178 -0
  225. package/theme/blue.js +178 -0
  226. package/theme/caravan.js +178 -0
  227. package/theme/carp.js +163 -0
  228. package/theme/cool.js +180 -0
  229. package/theme/dark-blue.js +168 -0
  230. package/theme/dark-bold.js +168 -0
  231. package/theme/dark-digerati.js +168 -0
  232. package/theme/dark-fresh-cut.js +168 -0
  233. package/theme/dark-mushroom.js +168 -0
  234. package/theme/dark.js +69 -62
  235. package/theme/eduardo.js +178 -0
  236. package/theme/forest.js +163 -0
  237. package/theme/fresh-cut.js +163 -0
  238. package/theme/fruit.js +178 -0
  239. package/theme/gray.js +220 -0
  240. package/theme/green.js +222 -0
  241. package/theme/helianthus.js +263 -0
  242. package/theme/infographic.js +72 -57
  243. package/theme/inspired.js +163 -0
  244. package/theme/jazz.js +163 -0
  245. package/theme/london.js +163 -0
  246. package/theme/macarons.js +80 -57
  247. package/theme/macarons2.js +251 -0
  248. package/theme/mint.js +155 -0
  249. package/theme/red-velvet.js +163 -0
  250. package/theme/red.js +225 -0
  251. package/theme/roma.js +55 -22
  252. package/theme/royal.js +163 -0
  253. package/theme/sakura.js +140 -0
  254. package/theme/shine.js +52 -45
  255. package/theme/tech-blue.js +180 -0
  256. package/theme/vintage.js +37 -23
@@ -0,0 +1,132 @@
1
+
2
+ /*
3
+ * Licensed to the Apache Software Foundation (ASF) under one
4
+ * or more contributor license agreements. See the NOTICE file
5
+ * distributed with this work for additional information
6
+ * regarding copyright ownership. The ASF licenses this file
7
+ * to you under the Apache License, Version 2.0 (the
8
+ * "License"); you may not use this file except in compliance
9
+ * with the License. You may obtain a copy of the License at
10
+ *
11
+ * http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing,
14
+ * software distributed under the License is distributed on an
15
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
+ * KIND, either express or implied. See the License for the
17
+ * specific language governing permissions and limitations
18
+ * under the License.
19
+ */
20
+
21
+ var zrUtil = require("zrender/lib/core/util");
22
+
23
+ var graphic = require("../../util/graphic");
24
+
25
+ /*
26
+ * Licensed to the Apache Software Foundation (ASF) under one
27
+ * or more contributor license agreements. See the NOTICE file
28
+ * distributed with this work for additional information
29
+ * regarding copyright ownership. The ASF licenses this file
30
+ * to you under the Apache License, Version 2.0 (the
31
+ * "License"); you may not use this file except in compliance
32
+ * with the License. You may obtain a copy of the License at
33
+ *
34
+ * http://www.apache.org/licenses/LICENSE-2.0
35
+ *
36
+ * Unless required by applicable law or agreed to in writing,
37
+ * software distributed under the License is distributed on an
38
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
39
+ * KIND, either express or implied. See the License for the
40
+ * specific language governing permissions and limitations
41
+ * under the License.
42
+ */
43
+ function rectCoordAxisBuildSplitArea(axisView, axisGroup, axisModel, gridModel) {
44
+ var axis = axisModel.axis;
45
+
46
+ if (axis.scale.isBlank()) {
47
+ return;
48
+ }
49
+
50
+ var splitAreaModel = axisModel.getModel('splitArea');
51
+ var areaStyleModel = splitAreaModel.getModel('areaStyle');
52
+ var areaColors = areaStyleModel.get('color');
53
+ var gridRect = gridModel.coordinateSystem.getRect();
54
+ var ticksCoords = axis.getTicksCoords({
55
+ tickModel: splitAreaModel,
56
+ clamp: true
57
+ });
58
+
59
+ if (!ticksCoords.length) {
60
+ return;
61
+ } // For Making appropriate splitArea animation, the color and anid
62
+ // should be corresponding to previous one if possible.
63
+
64
+
65
+ var areaColorsLen = areaColors.length;
66
+ var lastSplitAreaColors = axisView.__splitAreaColors;
67
+ var newSplitAreaColors = zrUtil.createHashMap();
68
+ var colorIndex = 0;
69
+
70
+ if (lastSplitAreaColors) {
71
+ for (var i = 0; i < ticksCoords.length; i++) {
72
+ var cIndex = lastSplitAreaColors.get(ticksCoords[i].tickValue);
73
+
74
+ if (cIndex != null) {
75
+ colorIndex = (cIndex + (areaColorsLen - 1) * i) % areaColorsLen;
76
+ break;
77
+ }
78
+ }
79
+ }
80
+
81
+ var prev = axis.toGlobalCoord(ticksCoords[0].coord);
82
+ var areaStyle = areaStyleModel.getAreaStyle();
83
+ areaColors = zrUtil.isArray(areaColors) ? areaColors : [areaColors];
84
+
85
+ for (var i = 1; i < ticksCoords.length; i++) {
86
+ var tickCoord = axis.toGlobalCoord(ticksCoords[i].coord);
87
+ var x;
88
+ var y;
89
+ var width;
90
+ var height;
91
+
92
+ if (axis.isHorizontal()) {
93
+ x = prev;
94
+ y = gridRect.y;
95
+ width = tickCoord - x;
96
+ height = gridRect.height;
97
+ prev = x + width;
98
+ } else {
99
+ x = gridRect.x;
100
+ y = prev;
101
+ width = gridRect.width;
102
+ height = tickCoord - y;
103
+ prev = y + height;
104
+ }
105
+
106
+ var tickValue = ticksCoords[i - 1].tickValue;
107
+ tickValue != null && newSplitAreaColors.set(tickValue, colorIndex);
108
+ axisGroup.add(new graphic.Rect({
109
+ anid: tickValue != null ? 'area_' + tickValue : null,
110
+ shape: {
111
+ x: x,
112
+ y: y,
113
+ width: width,
114
+ height: height
115
+ },
116
+ style: zrUtil.defaults({
117
+ fill: areaColors[colorIndex]
118
+ }, areaStyle),
119
+ silent: true
120
+ }));
121
+ colorIndex = (colorIndex + 1) % areaColorsLen;
122
+ }
123
+
124
+ axisView.__splitAreaColors = newSplitAreaColors;
125
+ }
126
+
127
+ function rectCoordAxisHandleRemove(axisView) {
128
+ axisView.__splitAreaColors = null;
129
+ }
130
+
131
+ exports.rectCoordAxisBuildSplitArea = rectCoordAxisBuildSplitArea;
132
+ exports.rectCoordAxisHandleRemove = rectCoordAxisHandleRemove;
@@ -24,6 +24,10 @@ var zrUtil = require("zrender/lib/core/util");
24
24
 
25
25
  var BrushController = require("../helper/BrushController");
26
26
 
27
+ var _visualEncoding = require("./visualEncoding");
28
+
29
+ var layoutCovers = _visualEncoding.layoutCovers;
30
+
27
31
  /*
28
32
  * Licensed to the Apache Software Foundation (ASF) under one
29
33
  * or more contributor license agreements. See the NOTICE file
@@ -81,7 +85,13 @@ var _default = echarts.extendComponentView({
81
85
  /**
82
86
  * @override
83
87
  */
84
- updateTransform: updateController,
88
+ updateTransform: function (brushModel, ecModel) {
89
+ // PENDING: `updateTransform` is a little tricky, whose layout need
90
+ // to be calculate mandatorily and other stages will not be performed.
91
+ // Take care the correctness of the logic. See #11754 .
92
+ layoutCovers(ecModel);
93
+ return updateController.apply(this, arguments);
94
+ },
85
95
 
86
96
  /**
87
97
  * @override
@@ -65,14 +65,23 @@ echarts.registerLayout(PRIORITY_BRUSH, function (ecModel, api, payload) {
65
65
  payload && payload.type === 'takeGlobalCursor' && brushModel.setBrushOption(payload.key === 'brush' ? payload.brushOption : {
66
66
  brushType: false
67
67
  });
68
+ });
69
+ layoutCovers(ecModel);
70
+ });
71
+
72
+ function layoutCovers(ecModel) {
73
+ ecModel.eachComponent({
74
+ mainType: 'brush'
75
+ }, function (brushModel) {
68
76
  var brushTargetManager = brushModel.brushTargetManager = new BrushTargetManager(brushModel.option, ecModel);
69
77
  brushTargetManager.setInputRanges(brushModel.areas, ecModel);
70
78
  });
71
- });
79
+ }
72
80
  /**
73
81
  * Register the visual encoding if this modules required.
74
82
  */
75
83
 
84
+
76
85
  echarts.registerVisual(PRIORITY_BRUSH, function (ecModel, api, payload) {
77
86
  var brushSelected = [];
78
87
  var throttleType;
@@ -314,4 +323,6 @@ var boundingRectBuilders = {
314
323
 
315
324
  function getBoundingRectFromMinMax(minMax) {
316
325
  return new BoundingRect(minMax[0][0], minMax[1][0], minMax[0][1] - minMax[0][0], minMax[1][1] - minMax[1][0]);
317
- }
326
+ }
327
+
328
+ exports.layoutCovers = layoutCovers;
@@ -435,10 +435,6 @@ var SliderZoomView = DataZoomView.extend({
435
435
  draggable: true,
436
436
  cursor: getCursor(this._orient),
437
437
  drift: bind(this._onDragMove, this, 'all'),
438
- onmousemove: function (e) {
439
- // Fot mobile devicem, prevent screen slider on the button.
440
- eventTool.stop(e.event);
441
- },
442
438
  ondragstart: bind(this._showDataInfo, this, true),
443
439
  ondragend: bind(this._onDragEnd, this),
444
440
  onmouseover: bind(this._showDataInfo, this, true),
@@ -469,10 +465,6 @@ var SliderZoomView = DataZoomView.extend({
469
465
  cursor: getCursor(this._orient),
470
466
  draggable: true,
471
467
  drift: bind(this._onDragMove, this, handleIndex),
472
- onmousemove: function (e) {
473
- // Fot mobile devicem, prevent screen slider on the button.
474
- eventTool.stop(e.event);
475
- },
476
468
  ondragend: bind(this._onDragEnd, this),
477
469
  onmouseover: bind(this._showDataInfo, this, true),
478
470
  onmouseout: bind(this._showDataInfo, this, false)
@@ -647,8 +639,10 @@ var SliderZoomView = DataZoomView.extend({
647
639
  handleLabels[0].attr('invisible', !showOrHide);
648
640
  handleLabels[1].attr('invisible', !showOrHide);
649
641
  },
650
- _onDragMove: function (handleIndex, dx, dy) {
651
- this._dragging = true; // Transform dx, dy to bar coordination.
642
+ _onDragMove: function (handleIndex, dx, dy, event) {
643
+ this._dragging = true; // For mobile device, prevent screen slider on the button.
644
+
645
+ eventTool.stop(event.event); // Transform dx, dy to bar coordination.
652
646
 
653
647
  var barTransform = this._displayables.barGroup.getLocalTransform();
654
648
 
@@ -153,12 +153,6 @@ function BrushController(zr) {
153
153
  */
154
154
 
155
155
  this._dragging;
156
- /**
157
- * @private
158
- * @type {Object}
159
- */
160
-
161
- this._lastMouseMovePoint = {};
162
156
  /**
163
157
  * @private
164
158
  * @type {Array}
@@ -200,7 +194,7 @@ function BrushController(zr) {
200
194
  */
201
195
 
202
196
  this._handlers = {};
203
- each(mouseHandlers, function (handler, eventName) {
197
+ each(pointerHandlers, function (handler, eventName) {
204
198
  this._handlers[eventName] = zrUtil.bind(handler, this);
205
199
  }, this);
206
200
  }
@@ -351,9 +345,7 @@ function doEnableBrush(controller, brushOption) {
351
345
  interactionMutex.take(zr, MUTEX_RESOURCE_KEY, controller._uid);
352
346
  }
353
347
 
354
- each(controller._handlers, function (handler, eventName) {
355
- zr.on(eventName, handler);
356
- });
348
+ mountHandlers(zr, controller._handlers);
357
349
  controller._brushType = brushOption.brushType;
358
350
  controller._brushOption = zrUtil.merge(zrUtil.clone(DEFAULT_BRUSH_OPT), brushOption, true);
359
351
  }
@@ -361,10 +353,20 @@ function doEnableBrush(controller, brushOption) {
361
353
  function doDisableBrush(controller) {
362
354
  var zr = controller._zr;
363
355
  interactionMutex.release(zr, MUTEX_RESOURCE_KEY, controller._uid);
364
- each(controller._handlers, function (handler, eventName) {
356
+ unmountHandlers(zr, controller._handlers);
357
+ controller._brushType = controller._brushOption = null;
358
+ }
359
+
360
+ function mountHandlers(zr, handlers) {
361
+ each(handlers, function (handler, eventName) {
362
+ zr.on(eventName, handler);
363
+ });
364
+ }
365
+
366
+ function unmountHandlers(zr, handlers) {
367
+ each(handlers, function (handler, eventName) {
365
368
  zr.off(eventName, handler);
366
369
  });
367
- controller._brushType = controller._brushOption = null;
368
370
  }
369
371
 
370
372
  function createCover(controller, brushOption) {
@@ -667,8 +669,11 @@ function pointsToRect(points) {
667
669
  }
668
670
 
669
671
  function resetCursor(controller, e, localCursorPoint) {
670
- // Check active
671
- if (!controller._brushType) {
672
+ if ( // Check active
673
+ !controller._brushType // resetCursor should be always called when mouse is in zr area,
674
+ // but not called when mouse is out of zr area to avoid bad influence
675
+ // if `mousemove`, `mouseup` are triggered from `document` event.
676
+ || isOutsideZrArea(controller, e)) {
672
677
  return;
673
678
  }
674
679
 
@@ -758,7 +763,7 @@ function determineBrushType(brushType, panel) {
758
763
  return brushType;
759
764
  }
760
765
 
761
- var mouseHandlers = {
766
+ var pointerHandlers = {
762
767
  mousedown: function (e) {
763
768
  if (this._dragging) {
764
769
  // In case some browser do not support globalOut,
@@ -777,10 +782,9 @@ var mouseHandlers = {
777
782
  }
778
783
  },
779
784
  mousemove: function (e) {
780
- var lastPoint = this._lastMouseMovePoint;
781
- lastPoint.x = e.offsetX;
782
- lastPoint.y = e.offsetY;
783
- var localCursorPoint = this.group.transformCoordToLocal(lastPoint.x, lastPoint.y);
785
+ var x = e.offsetX;
786
+ var y = e.offsetY;
787
+ var localCursorPoint = this.group.transformCoordToLocal(x, y);
784
788
  resetCursor(this, e, localCursorPoint);
785
789
 
786
790
  if (this._dragging) {
@@ -791,34 +795,15 @@ var mouseHandlers = {
791
795
  },
792
796
  mouseup: function (e) {
793
797
  handleDragEnd(this, e);
794
- },
795
- globalout: function (e) {
796
- handleDragEnd(this, e, true);
797
798
  }
798
799
  };
799
800
 
800
- function handleDragEnd(controller, e, isGlobalOut) {
801
+ function handleDragEnd(controller, e) {
801
802
  if (controller._dragging) {
802
- // Just be worried about bring some side effect to the world
803
- // out of echarts, we do not `preventDefault` for globalout.
804
- !isGlobalOut && preventDefault(e);
805
- var pointerX = e.offsetX;
806
- var pointerY = e.offsetY;
807
- var lastPoint = controller._lastMouseMovePoint;
808
-
809
- if (isGlobalOut) {
810
- pointerX = lastPoint.x;
811
- pointerY = lastPoint.y;
812
- }
813
-
814
- var localCursorPoint = controller.group.transformCoordToLocal(pointerX, pointerY); // FIXME
815
- // Here `e` is used only in `onIrrelevantElement` finally. And it's OK
816
- // that pass the `e` of `globalout` to `onIrrelevantElement`. But it is
817
- // not a good design of these interfaces. However, we do not refactor
818
- // these code now because the implementation of `onIrrelevantElement`
819
- // need to be discussed and probably be changed in future, becuase it
820
- // slows down the performance of zrender in some cases.
821
-
803
+ preventDefault(e);
804
+ var x = e.offsetX;
805
+ var y = e.offsetY;
806
+ var localCursorPoint = controller.group.transformCoordToLocal(x, y);
822
807
  var eventParams = updateCoverByMouse(controller, e, localCursorPoint, true);
823
808
  controller._dragging = false;
824
809
  controller._track = [];
@@ -827,6 +812,11 @@ function handleDragEnd(controller, e, isGlobalOut) {
827
812
  eventParams && trigger(controller, eventParams);
828
813
  }
829
814
  }
815
+
816
+ function isOutsideZrArea(controller, x, y) {
817
+ var zr = controller._zr;
818
+ return x < 0 || x > zr.getWidth() || y < 0 || y > zr.getHeight();
819
+ }
830
820
  /**
831
821
  * key: brushType
832
822
  * @type {Object}
@@ -36,6 +36,8 @@ var _component = require("../../util/component");
36
36
 
37
37
  var getUID = _component.getUID;
38
38
 
39
+ var Transformable = require("zrender/lib/mixin/Transformable");
40
+
39
41
  /*
40
42
  * Licensed to the Apache Software Foundation (ASF) under one
41
43
  * or more contributor license agreements. See the NOTICE file
@@ -206,14 +208,29 @@ MapDraw.prototype = {
206
208
 
207
209
  var regionsGroup = this._regionsGroup;
208
210
  var group = this.group;
211
+ var transformInfo = geo.getTransformInfo(); // No animation when first draw or in action
212
+
213
+ var isFirstDraw = !regionsGroup.childAt(0) || payload;
214
+ var targetScale;
209
215
 
210
- if (geo._roamTransformable.transform) {
211
- group.transform = geo._roamTransformable.transform.slice();
216
+ if (isFirstDraw) {
217
+ group.transform = transformInfo.roamTransform;
212
218
  group.decomposeTransform();
219
+ group.dirty();
220
+ } else {
221
+ var target = new Transformable();
222
+ target.transform = transformInfo.roamTransform;
223
+ target.decomposeTransform();
224
+ var props = {
225
+ scale: target.scale,
226
+ position: target.position
227
+ };
228
+ targetScale = target.scale;
229
+ graphic.updateProps(group, props, mapOrGeoModel);
213
230
  }
214
231
 
215
- var scale = geo._rawTransformable.scale;
216
- var position = geo._rawTransformable.position;
232
+ var scale = transformInfo.rawScale;
233
+ var position = transformInfo.rawPosition;
217
234
  regionsGroup.removeAll();
218
235
  var itemStyleAccessPath = ['itemStyle'];
219
236
  var hoverItemStyleAccessPath = ['emphasis', 'itemStyle'];
@@ -333,6 +350,15 @@ MapDraw.prototype = {
333
350
  textAlign: 'center',
334
351
  textVerticalAlign: 'middle'
335
352
  });
353
+
354
+ if (!isFirstDraw) {
355
+ // Text animation
356
+ var textScale = [1 / targetScale[0], 1 / targetScale[1]];
357
+ graphic.updateProps(textEl, {
358
+ scale: textScale
359
+ }, mapOrGeoModel);
360
+ }
361
+
336
362
  regionGroup.add(textEl);
337
363
  } // setItemGraphicEl, setHoverStyle after all polygons and labels
338
364
  // are added to the rigionGroup
@@ -131,9 +131,9 @@ var LegendModel = echarts.extendComponentModel({
131
131
  availableNames.push(seriesName);
132
132
  var isPotential;
133
133
 
134
- if (seriesModel.legendDataProvider) {
135
- var data = seriesModel.legendDataProvider();
136
- var names = data.mapArray(data.getName);
134
+ if (seriesModel.legendVisualProvider) {
135
+ var provider = seriesModel.legendVisualProvider;
136
+ var names = provider.getAllNames();
137
137
 
138
138
  if (!ecModel.isSeriesFiltered(seriesModel)) {
139
139
  availableNames = availableNames.concat(names);
@@ -191,7 +191,7 @@ var _default = echarts.extendComponentView({
191
191
  if (legendDrawnMap.get(name)) {
192
192
  // Have been drawed
193
193
  return;
194
- } // Series legend
194
+ } // Legend to control series.
195
195
 
196
196
 
197
197
  if (seriesModel) {
@@ -216,32 +216,32 @@ var _default = echarts.extendComponentView({
216
216
 
217
217
  var itemGroup = this._createItem(name, dataIndex, itemModel, legendModel, legendSymbolType, symbolType, itemAlign, color, borderColor, selectMode);
218
218
 
219
- itemGroup.on('click', curry(dispatchSelectAction, name, api)).on('mouseover', curry(dispatchHighlightAction, seriesModel.name, null, api, excludeSeriesId)).on('mouseout', curry(dispatchDownplayAction, seriesModel.name, null, api, excludeSeriesId));
219
+ itemGroup.on('click', curry(dispatchSelectAction, name, null, api, excludeSeriesId)).on('mouseover', curry(dispatchHighlightAction, seriesModel.name, null, api, excludeSeriesId)).on('mouseout', curry(dispatchDownplayAction, seriesModel.name, null, api, excludeSeriesId));
220
220
  legendDrawnMap.set(name, true);
221
221
  } else {
222
- // Data legend of pie, funnel
222
+ // Legend to control data. In pie and funnel.
223
223
  ecModel.eachRawSeries(function (seriesModel) {
224
224
  // In case multiple series has same data name
225
225
  if (legendDrawnMap.get(name)) {
226
226
  return;
227
227
  }
228
228
 
229
- if (seriesModel.legendDataProvider) {
230
- var data = seriesModel.legendDataProvider();
231
- var idx = data.indexOfName(name);
229
+ if (seriesModel.legendVisualProvider) {
230
+ var provider = seriesModel.legendVisualProvider;
232
231
 
233
- if (idx < 0) {
232
+ if (!provider.containName(name)) {
234
233
  return;
235
234
  }
236
235
 
237
- var color = data.getItemVisual(idx, 'color');
238
- var borderColor = data.getItemVisual(idx, 'borderColor');
236
+ var idx = provider.indexOfName(name);
237
+ var color = provider.getItemVisual(idx, 'color');
238
+ var borderColor = provider.getItemVisual(idx, 'borderColor');
239
239
  var legendSymbolType = 'roundRect';
240
240
 
241
241
  var itemGroup = this._createItem(name, dataIndex, itemModel, legendModel, legendSymbolType, null, itemAlign, color, borderColor, selectMode); // FIXME: consider different series has items with the same name.
242
242
 
243
243
 
244
- itemGroup.on('click', curry(dispatchSelectAction, name, api)) // Should not specify the series name, consider legend controls
244
+ itemGroup.on('click', curry(dispatchSelectAction, null, name, api, excludeSeriesId)) // Should not specify the series name, consider legend controls
245
245
  // more than one pie series.
246
246
  .on('mouseover', curry(dispatchHighlightAction, null, name, api, excludeSeriesId)).on('mouseout', curry(dispatchDownplayAction, null, name, api, excludeSeriesId));
247
247
  legendDrawnMap.set(name, true);
@@ -442,11 +442,15 @@ function setSymbolStyle(symbol, symbolType, legendModelItemStyle, borderColor, i
442
442
  return symbol.setStyle(itemStyle);
443
443
  }
444
444
 
445
- function dispatchSelectAction(name, api) {
445
+ function dispatchSelectAction(seriesName, dataName, api, excludeSeriesId) {
446
+ // downplay before unselect
447
+ dispatchDownplayAction(seriesName, dataName, api, excludeSeriesId);
446
448
  api.dispatchAction({
447
449
  type: 'legendToggleSelect',
448
- name: name
449
- });
450
+ name: seriesName != null ? seriesName : dataName
451
+ }); // highlight after select
452
+
453
+ dispatchHighlightAction(seriesName, dataName, api, excludeSeriesId);
450
454
  }
451
455
 
452
456
  function dispatchHighlightAction(seriesName, dataName, api, excludeSeriesId) {
@@ -418,28 +418,28 @@ var ScrollableLegendView = LegendView.extend({
418
418
  }
419
419
  },
420
420
  _findTargetItemIndex: function (targetDataIndex) {
421
+ if (!this._showController) {
422
+ return 0;
423
+ }
424
+
421
425
  var index;
422
426
  var contentGroup = this.getContentGroup();
423
427
  var defaultIndex;
428
+ contentGroup.eachChild(function (child, idx) {
429
+ var legendDataIdx = child.__legendDataIndex; // FIXME
430
+ // If the given targetDataIndex (from model) is illegal,
431
+ // we use defualtIndex. But the index on the legend model and
432
+ // action payload is still illegal. That case will not be
433
+ // changed until some scenario requires.
434
+
435
+ if (defaultIndex == null && legendDataIdx != null) {
436
+ defaultIndex = idx;
437
+ }
424
438
 
425
- if (this._showController) {
426
- contentGroup.eachChild(function (child, idx) {
427
- var legendDataIdx = child.__legendDataIndex; // FIXME
428
- // If the given targetDataIndex (from model) is illegal,
429
- // we use defualtIndex. But the index on the legend model and
430
- // action payload is still illegal. That case will not be
431
- // changed until some scenario requires.
432
-
433
- if (defaultIndex == null && legendDataIdx != null) {
434
- defaultIndex = idx;
435
- }
436
-
437
- if (legendDataIdx === targetDataIndex) {
438
- index = idx;
439
- }
440
- });
441
- }
442
-
439
+ if (legendDataIdx === targetDataIndex) {
440
+ index = idx;
441
+ }
442
+ });
443
443
  return index != null ? index : defaultIndex;
444
444
  }
445
445
  });
@@ -52,7 +52,8 @@ var _default = MarkerModel.extend({
52
52
  },
53
53
  label: {
54
54
  show: true,
55
- position: 'end'
55
+ position: 'end',
56
+ distance: 5
56
57
  },
57
58
  lineStyle: {
58
59
  type: 'dashed'
@@ -85,7 +85,8 @@ function markerTypeCalculatorWithExtent(mlType, data, otherDataDim, targetDataDi
85
85
  var value = numCalculate(data, calcDataDim, mlType);
86
86
  var dataIndex = data.indicesOfNearest(calcDataDim, value)[0];
87
87
  coordArr[otherCoordIndex] = data.get(otherDataDim, dataIndex);
88
- coordArr[targetCoordIndex] = data.get(targetDataDim, dataIndex); // Make it simple, do not visit all stacked value to count precision.
88
+ coordArr[targetCoordIndex] = data.get(calcDataDim, dataIndex);
89
+ var coordArrValue = data.get(targetDataDim, dataIndex); // Make it simple, do not visit all stacked value to count precision.
89
90
 
90
91
  var precision = numberUtil.getPrecision(data.get(targetDataDim, dataIndex));
91
92
  precision = Math.min(precision, 20);
@@ -94,7 +95,7 @@ function markerTypeCalculatorWithExtent(mlType, data, otherDataDim, targetDataDi
94
95
  coordArr[targetCoordIndex] = +coordArr[targetCoordIndex].toFixed(precision);
95
96
  }
96
97
 
97
- return coordArr;
98
+ return [coordArr, coordArrValue];
98
99
  }
99
100
 
100
101
  var curry = zrUtil.curry; // TODO Specified percent
@@ -151,9 +152,11 @@ function dataTransform(seriesModel, item) {
151
152
  if (item.type && markerTypeCalculator[item.type] && axisInfo.baseAxis && axisInfo.valueAxis) {
152
153
  var otherCoordIndex = indexOf(dims, axisInfo.baseAxis.dim);
153
154
  var targetCoordIndex = indexOf(dims, axisInfo.valueAxis.dim);
154
- item.coord = markerTypeCalculator[item.type](data, axisInfo.baseDataDim, axisInfo.valueDataDim, otherCoordIndex, targetCoordIndex); // Force to use the value of calculated value.
155
+ var coordInfo = markerTypeCalculator[item.type](data, axisInfo.baseDataDim, axisInfo.valueDataDim, otherCoordIndex, targetCoordIndex);
156
+ item.coord = coordInfo[0]; // Force to use the value of calculated value.
157
+ // let item use the value without stack.
155
158
 
156
- item.value = item.coord[targetCoordIndex];
159
+ item.value = coordInfo[1];
157
160
  } else {
158
161
  // FIXME Only has one of xAxis and yAxis.
159
162
  var coord = [item.xAxis != null ? item.xAxis : item.radiusAxis, item.yAxis != null ? item.yAxis : item.angleAxis]; // Each coord support max, min, average
@@ -28,6 +28,10 @@ var _layout = require("../util/layout");
28
28
 
29
29
  var getLayoutRect = _layout.getLayoutRect;
30
30
 
31
+ var _format = require("../util/format");
32
+
33
+ var windowOpen = _format.windowOpen;
34
+
31
35
  /*
32
36
  * Licensed to the Apache Software Foundation (ASF) under one
33
37
  * or more contributor license agreements. See the NOTICE file
@@ -150,13 +154,13 @@ echarts.extendComponentView({
150
154
 
151
155
  if (link) {
152
156
  textEl.on('click', function () {
153
- window.open(link, '_' + titleModel.get('target'));
157
+ windowOpen(link, '_' + titleModel.get('target'));
154
158
  });
155
159
  }
156
160
 
157
161
  if (sublink) {
158
162
  subTextEl.on('click', function () {
159
- window.open(sublink, '_' + titleModel.get('subtarget'));
163
+ windowOpen(link, '_' + titleModel.get('subtarget'));
160
164
  });
161
165
  }
162
166
 
@@ -78,7 +78,11 @@ var _default = echarts.extendComponentView({
78
78
  var oldName = featureNames[oldIndex];
79
79
  var featureOpt = featureOpts[featureName];
80
80
  var featureModel = new Model(featureOpt, toolboxModel, toolboxModel.ecModel);
81
- var feature;
81
+ var feature; // FIX#11236, merge feature title from MagicType newOption. TODO: consider seriesIndex ?
82
+
83
+ if (payload && payload.newTitle != null && payload.featureName === featureName) {
84
+ featureOpt.title = payload.newTitle;
85
+ }
82
86
 
83
87
  if (featureName && !oldName) {
84
88
  // Create