echarts 4.5.0 → 4.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (329) hide show
  1. package/.DS_Store +0 -0
  2. package/.gitattributes +3 -0
  3. package/.github/pull_request_template.md +66 -0
  4. package/.github/workflows/nodejs.yml +15 -3
  5. package/.huskyrc +5 -0
  6. package/CONTRIBUTING.md +16 -160
  7. package/NOTICE +1 -1
  8. package/README.md +3 -3
  9. package/asset/.DS_Store +0 -0
  10. package/build/.DS_Store +0 -0
  11. package/dist/echarts-en.common.js +3072 -1261
  12. package/dist/echarts-en.common.min.js +1 -1
  13. package/dist/echarts-en.js +4339 -1685
  14. package/dist/echarts-en.js.map +1 -1
  15. package/dist/echarts-en.min.js +1 -1
  16. package/dist/echarts-en.simple.js +2496 -1011
  17. package/dist/echarts-en.simple.min.js +1 -1
  18. package/dist/echarts.common.js +3046 -1261
  19. package/dist/echarts.common.min.js +1 -1
  20. package/dist/echarts.js +4313 -1685
  21. package/dist/echarts.js.map +1 -1
  22. package/dist/echarts.min.js +1 -1
  23. package/dist/echarts.simple.js +2470 -1011
  24. package/dist/echarts.simple.min.js +1 -1
  25. package/dist/extension/bmap.js +33 -11
  26. package/dist/extension/bmap.js.map +1 -1
  27. package/dist/extension/bmap.min.js +1 -1
  28. package/dist/extension/dataTool.js.map +1 -1
  29. package/extension/.DS_Store +0 -0
  30. package/extension/bmap/BMapCoordSys.js +14 -4
  31. package/extension/bmap/BMapModel.js +4 -0
  32. package/extension/bmap/BMapView.js +18 -10
  33. package/extension-src/bmap/BMapCoordSys.js +14 -4
  34. package/extension-src/bmap/BMapModel.js +6 -1
  35. package/extension-src/bmap/BMapView.js +16 -9
  36. package/lib/chart/bar/BarSeries.js +14 -1
  37. package/lib/chart/bar/BarView.js +196 -18
  38. package/lib/chart/bar/BaseBarSeries.js +3 -1
  39. package/lib/chart/bar/PictorialBarSeries.js +1 -1
  40. package/lib/chart/candlestick/candlestickVisual.js +1 -1
  41. package/lib/chart/effectScatter/EffectScatterSeries.js +3 -1
  42. package/lib/chart/funnel/FunnelSeries.js +14 -5
  43. package/lib/chart/funnel/funnelLayout.js +162 -46
  44. package/lib/chart/gauge/GaugeSeries.js +0 -2
  45. package/lib/chart/graph/GraphSeries.js +23 -7
  46. package/lib/chart/graph/GraphView.js +30 -12
  47. package/lib/chart/graph/circularLayoutHelper.js +8 -2
  48. package/lib/chart/graph/forceLayout.js +6 -1
  49. package/lib/chart/graph/simpleLayout.js +1 -1
  50. package/lib/chart/graph/simpleLayoutHelper.js +10 -4
  51. package/lib/chart/heatmap/HeatmapView.js +4 -4
  52. package/lib/chart/helper/EffectLine.js +23 -1
  53. package/lib/chart/helper/EffectSymbol.js +2 -1
  54. package/lib/chart/helper/Line.js +129 -42
  55. package/lib/chart/helper/LineDraw.js +5 -1
  56. package/lib/chart/helper/Symbol.js +2 -3
  57. package/lib/chart/helper/createClipPathFromCoordSys.js +4 -1
  58. package/lib/chart/helper/createListFromArray.js +14 -8
  59. package/lib/chart/helper/createRenderPlanner.js +6 -3
  60. package/lib/chart/helper/multipleGraphEdgeHelper.js +258 -0
  61. package/lib/chart/helper/whiskerBoxCommon.js +22 -16
  62. package/lib/chart/line/LineSeries.js +3 -1
  63. package/lib/chart/line/LineView.js +41 -2
  64. package/lib/chart/lines/LinesSeries.js +0 -2
  65. package/lib/chart/map/MapSeries.js +14 -5
  66. package/lib/chart/pie/PieSeries.js +27 -6
  67. package/lib/chart/pie/PieView.js +22 -15
  68. package/lib/chart/pie/labelLayout.js +102 -19
  69. package/lib/chart/pie/pieLayout.js +19 -7
  70. package/lib/chart/radar/RadarSeries.js +27 -6
  71. package/lib/chart/radar/RadarView.js +3 -1
  72. package/lib/chart/sankey/SankeySeries.js +13 -1
  73. package/lib/chart/sankey/SankeyView.js +70 -32
  74. package/lib/chart/sankey/sankeyLayout.js +22 -3
  75. package/lib/chart/scatter/ScatterSeries.js +3 -1
  76. package/lib/chart/sunburst/SunburstPiece.js +5 -1
  77. package/lib/chart/sunburst/SunburstSeries.js +29 -12
  78. package/lib/chart/sunburst/SunburstView.js +5 -1
  79. package/lib/chart/themeRiver/ThemeRiverSeries.js +24 -33
  80. package/lib/chart/tree/TreeSeries.js +20 -3
  81. package/lib/chart/tree/TreeView.js +149 -23
  82. package/lib/chart/treemap/TreemapSeries.js +25 -4
  83. package/lib/chart/treemap/TreemapView.js +80 -38
  84. package/lib/chart/treemap/treemapLayout.js +1 -1
  85. package/lib/chart/treemap/treemapVisual.js +9 -15
  86. package/lib/component/axis/AngleAxisView.js +64 -7
  87. package/lib/component/axis/AxisBuilder.js +62 -24
  88. package/lib/component/axis/CartesianAxisView.js +52 -85
  89. package/lib/component/axis/RadiusAxisView.js +36 -4
  90. package/lib/component/axis/SingleAxisView.js +21 -6
  91. package/lib/component/axis/axisSplitHelper.js +132 -0
  92. package/lib/component/axisPointer/axisTrigger.js +1 -1
  93. package/lib/component/brush/BrushView.js +11 -1
  94. package/lib/component/brush/visualEncoding.js +13 -2
  95. package/lib/component/dataZoom/SliderZoomView.js +4 -10
  96. package/lib/component/helper/BrushController.js +33 -43
  97. package/lib/component/helper/MapDraw.js +30 -4
  98. package/lib/component/legend/LegendModel.js +3 -3
  99. package/lib/component/legend/LegendView.js +17 -13
  100. package/lib/component/legend/ScrollableLegendView.js +18 -18
  101. package/lib/component/marker/MarkAreaView.js +53 -15
  102. package/lib/component/marker/MarkLineModel.js +2 -1
  103. package/lib/component/marker/MarkLineView.js +3 -0
  104. package/lib/component/marker/MarkPointView.js +8 -1
  105. package/lib/component/marker/MarkerModel.js +3 -2
  106. package/lib/component/marker/markerHelper.js +7 -4
  107. package/lib/component/timeline/SliderTimelineView.js +7 -1
  108. package/lib/component/title.js +6 -2
  109. package/lib/component/toolbox/ToolboxView.js +5 -1
  110. package/lib/component/toolbox/feature/DataView.js +23 -8
  111. package/lib/component/toolbox/feature/DataZoom.js +6 -6
  112. package/lib/component/toolbox/feature/MagicType.js +20 -14
  113. package/lib/component/toolbox/feature/SaveAsImage.js +4 -2
  114. package/lib/component/tooltip/TooltipContent.js +101 -30
  115. package/lib/component/tooltip/TooltipRichContent.js +56 -8
  116. package/lib/component/tooltip/TooltipView.js +11 -12
  117. package/lib/component/visualMap/PiecewiseModel.js +3 -6
  118. package/lib/component/visualMap/VisualMapModel.js +1 -1
  119. package/lib/coord/Axis.js +30 -2
  120. package/lib/coord/View.js +9 -0
  121. package/lib/coord/axisDefault.js +22 -3
  122. package/lib/coord/axisHelper.js +24 -18
  123. package/lib/coord/calendar/Calendar.js +8 -4
  124. package/lib/coord/geo/GeoModel.js +2 -1
  125. package/lib/coord/geo/geoJSONLoader.js +3 -2
  126. package/lib/coord/geo/geoSourceManager.js +3 -2
  127. package/lib/coord/geo/parseGeoJson.js +3 -2
  128. package/lib/coord/radar/Radar.js +5 -5
  129. package/lib/data/DataDimensionInfo.js +157 -0
  130. package/lib/data/Graph.js +1 -6
  131. package/lib/data/List.js +26 -20
  132. package/lib/data/Tree.js +5 -42
  133. package/lib/data/helper/completeDimensions.js +43 -32
  134. package/lib/data/helper/createDimensions.js +2 -0
  135. package/lib/data/helper/sourceHelper.js +214 -114
  136. package/lib/echarts.js +57 -34
  137. package/lib/langEN.js +26 -0
  138. package/lib/layout/barGrid.js +19 -13
  139. package/lib/layout/barPolar.js +1 -6
  140. package/lib/loading/default.js +43 -27
  141. package/lib/model/Series.js +4 -4
  142. package/lib/model/referHelper.js +40 -12
  143. package/lib/processor/dataSample.js +1 -1
  144. package/lib/scale/Interval.js +87 -2
  145. package/lib/scale/Log.js +9 -2
  146. package/lib/scale/helper.js +1 -43
  147. package/lib/stream/Scheduler.js +10 -2
  148. package/lib/theme/dark.js +3 -0
  149. package/lib/util/format.js +19 -2
  150. package/lib/util/graphic.js +14 -12
  151. package/lib/visual/LegendVisualProvider.js +75 -0
  152. package/lib/visual/VisualMapping.js +1 -1
  153. package/lib/visual/dataColor.js +2 -12
  154. package/lib/visual/seriesColor.js +15 -7
  155. package/lib/visual/symbol.js +12 -2
  156. package/map/.DS_Store +0 -0
  157. package/map/js/.DS_Store +0 -0
  158. package/map/js/china.js +1 -1
  159. package/map/js/province/.DS_Store +0 -0
  160. package/map/js/province/chongqing.js +1 -1
  161. package/map/js/province/gansu.js +2 -2
  162. package/map/js/province/tianjin.js +1 -28
  163. package/map/json/.DS_Store +0 -0
  164. package/map/json/china.json +1 -1
  165. package/map/json/province/chongqing.json +1 -1
  166. package/map/json/province/tianjin.json +1 -1
  167. package/package.json +12 -6
  168. package/src/.DS_Store +0 -0
  169. package/src/chart/.DS_Store +0 -0
  170. package/src/chart/bar/BarSeries.js +15 -1
  171. package/src/chart/bar/BarView.js +198 -17
  172. package/src/chart/bar/BaseBarSeries.js +1 -1
  173. package/src/chart/bar/PictorialBarSeries.js +2 -2
  174. package/src/chart/candlestick/candlestickVisual.js +1 -1
  175. package/src/chart/effectScatter/EffectScatterSeries.js +1 -1
  176. package/src/chart/funnel/FunnelSeries.js +11 -4
  177. package/src/chart/funnel/funnelLayout.js +179 -53
  178. package/src/chart/gauge/GaugeSeries.js +0 -1
  179. package/src/chart/graph/GraphSeries.js +19 -7
  180. package/src/chart/graph/GraphView.js +28 -10
  181. package/src/chart/graph/circularLayoutHelper.js +8 -2
  182. package/src/chart/graph/forceLayout.js +7 -1
  183. package/src/chart/graph/simpleLayout.js +1 -1
  184. package/src/chart/graph/simpleLayoutHelper.js +12 -5
  185. package/src/chart/heatmap/HeatmapView.js +4 -4
  186. package/src/chart/helper/EffectLine.js +23 -1
  187. package/src/chart/helper/EffectSymbol.js +2 -1
  188. package/src/chart/helper/Line.js +122 -37
  189. package/src/chart/helper/LineDraw.js +5 -1
  190. package/src/chart/helper/Symbol.js +4 -4
  191. package/src/chart/helper/createClipPathFromCoordSys.js +4 -0
  192. package/src/chart/helper/createGraphFromNodeEdge.js +2 -1
  193. package/src/chart/helper/createListFromArray.js +13 -8
  194. package/src/chart/helper/createRenderPlanner.js +5 -2
  195. package/src/chart/helper/multipleGraphEdgeHelper.js +229 -0
  196. package/src/chart/helper/whiskerBoxCommon.js +21 -16
  197. package/src/chart/line/LineSeries.js +1 -1
  198. package/src/chart/line/LineView.js +45 -1
  199. package/src/chart/lines/LinesSeries.js +1 -3
  200. package/src/chart/map/MapSeries.js +11 -5
  201. package/src/chart/pie/PieSeries.js +26 -5
  202. package/src/chart/pie/PieView.js +20 -15
  203. package/src/chart/pie/labelLayout.js +114 -22
  204. package/src/chart/pie/pieLayout.js +20 -7
  205. package/src/chart/radar/RadarSeries.js +31 -6
  206. package/src/chart/radar/RadarView.js +4 -2
  207. package/src/chart/sankey/SankeySeries.js +12 -1
  208. package/src/chart/sankey/SankeyView.js +75 -30
  209. package/src/chart/sankey/sankeyLayout.js +25 -5
  210. package/src/chart/scatter/ScatterSeries.js +1 -1
  211. package/src/chart/sunburst/SunburstPiece.js +7 -1
  212. package/src/chart/sunburst/SunburstSeries.js +28 -15
  213. package/src/chart/sunburst/SunburstView.js +2 -1
  214. package/src/chart/themeRiver/ThemeRiverSeries.js +25 -30
  215. package/src/chart/tree/TreeSeries.js +19 -6
  216. package/src/chart/tree/TreeView.js +156 -23
  217. package/src/chart/treemap/TreemapSeries.js +23 -5
  218. package/src/chart/treemap/TreemapView.js +77 -41
  219. package/src/chart/treemap/treemapLayout.js +2 -2
  220. package/src/chart/treemap/treemapVisual.js +8 -25
  221. package/src/component/axis/AngleAxisView.js +75 -7
  222. package/src/component/axis/AxisBuilder.js +77 -32
  223. package/src/component/axis/CartesianAxisView.js +47 -83
  224. package/src/component/axis/RadiusAxisView.js +37 -4
  225. package/src/component/axis/SingleAxisView.js +21 -4
  226. package/src/component/axis/axisSplitHelper.js +114 -0
  227. package/src/component/axisPointer/axisTrigger.js +1 -1
  228. package/src/component/brush/BrushView.js +8 -1
  229. package/src/component/brush/visualEncoding.js +6 -3
  230. package/src/component/dataZoom/SliderZoomView.js +4 -9
  231. package/src/component/helper/BrushController.js +40 -47
  232. package/src/component/helper/MapDraw.js +27 -4
  233. package/src/component/legend/LegendModel.js +3 -3
  234. package/src/component/legend/LegendView.js +18 -12
  235. package/src/component/legend/ScrollableLegendView.js +18 -16
  236. package/src/component/marker/MarkAreaView.js +53 -15
  237. package/src/component/marker/MarkLineModel.js +2 -1
  238. package/src/component/marker/MarkLineView.js +3 -1
  239. package/src/component/marker/MarkPointView.js +7 -1
  240. package/src/component/marker/MarkerModel.js +3 -2
  241. package/src/component/marker/markerHelper.js +8 -5
  242. package/src/component/timeline/SliderTimelineView.js +9 -6
  243. package/src/component/title.js +4 -3
  244. package/src/component/toolbox/.DS_Store +0 -0
  245. package/src/component/toolbox/ToolboxView.js +5 -0
  246. package/src/component/toolbox/feature/DataView.js +20 -8
  247. package/src/component/toolbox/feature/DataZoom.js +6 -6
  248. package/src/component/toolbox/feature/MagicType.js +19 -13
  249. package/src/component/toolbox/feature/SaveAsImage.js +4 -2
  250. package/src/component/tooltip/TooltipContent.js +94 -28
  251. package/src/component/tooltip/TooltipRichContent.js +52 -9
  252. package/src/component/tooltip/TooltipView.js +14 -12
  253. package/src/component/visualMap/PiecewiseModel.js +5 -9
  254. package/src/component/visualMap/VisualMapModel.js +1 -1
  255. package/src/coord/Axis.js +29 -2
  256. package/src/coord/View.js +10 -1
  257. package/src/coord/axisDefault.js +26 -2
  258. package/src/coord/axisHelper.js +30 -21
  259. package/src/coord/calendar/Calendar.js +12 -5
  260. package/src/coord/geo/GeoModel.js +3 -6
  261. package/src/coord/geo/geoJSONLoader.js +3 -2
  262. package/src/coord/geo/geoSourceManager.js +3 -2
  263. package/src/coord/geo/parseGeoJson.js +3 -2
  264. package/src/coord/radar/Radar.js +6 -8
  265. package/src/data/DataDimensionInfo.js +135 -0
  266. package/src/data/Graph.js +0 -5
  267. package/src/data/List.js +30 -17
  268. package/src/data/Tree.js +6 -39
  269. package/src/data/helper/completeDimensions.js +49 -30
  270. package/src/data/helper/createDimensions.js +2 -0
  271. package/src/data/helper/sourceHelper.js +216 -124
  272. package/src/echarts.js +60 -36
  273. package/src/langEN.js +26 -0
  274. package/src/layout/barGrid.js +22 -10
  275. package/src/layout/barPolar.js +4 -6
  276. package/src/loading/default.js +46 -34
  277. package/src/model/.DS_Store +0 -0
  278. package/src/model/Series.js +4 -4
  279. package/src/model/referHelper.js +34 -11
  280. package/src/preprocessor/.DS_Store +0 -0
  281. package/src/processor/dataSample.js +1 -1
  282. package/src/scale/Interval.js +84 -4
  283. package/src/scale/Log.js +9 -2
  284. package/src/scale/helper.js +1 -39
  285. package/src/stream/Scheduler.js +9 -1
  286. package/src/theme/dark.js +3 -0
  287. package/src/util/.DS_Store +0 -0
  288. package/src/util/format.js +17 -1
  289. package/src/util/graphic.js +13 -11
  290. package/src/visual/LegendVisualProvider.js +55 -0
  291. package/src/visual/VisualMapping.js +1 -1
  292. package/src/visual/dataColor.js +0 -13
  293. package/src/visual/seriesColor.js +13 -7
  294. package/src/visual/symbol.js +11 -2
  295. package/theme/.DS_Store +0 -0
  296. package/theme/azul.js +163 -0
  297. package/theme/bee-inspired.js +178 -0
  298. package/theme/blue.js +178 -0
  299. package/theme/caravan.js +178 -0
  300. package/theme/carp.js +163 -0
  301. package/theme/cool.js +180 -0
  302. package/theme/dark-blue.js +168 -0
  303. package/theme/dark-bold.js +168 -0
  304. package/theme/dark-digerati.js +168 -0
  305. package/theme/dark-fresh-cut.js +168 -0
  306. package/theme/dark-mushroom.js +168 -0
  307. package/theme/dark.js +69 -62
  308. package/theme/eduardo.js +178 -0
  309. package/theme/forest.js +163 -0
  310. package/theme/fresh-cut.js +163 -0
  311. package/theme/fruit.js +178 -0
  312. package/theme/gray.js +220 -0
  313. package/theme/green.js +222 -0
  314. package/theme/helianthus.js +263 -0
  315. package/theme/infographic.js +72 -57
  316. package/theme/inspired.js +163 -0
  317. package/theme/jazz.js +163 -0
  318. package/theme/london.js +163 -0
  319. package/theme/macarons.js +80 -57
  320. package/theme/macarons2.js +251 -0
  321. package/theme/mint.js +155 -0
  322. package/theme/red-velvet.js +163 -0
  323. package/theme/red.js +225 -0
  324. package/theme/roma.js +55 -22
  325. package/theme/royal.js +163 -0
  326. package/theme/sakura.js +140 -0
  327. package/theme/shine.js +52 -45
  328. package/theme/tech-blue.js +180 -0
  329. package/theme/vintage.js +37 -23
@@ -38,6 +38,16 @@ var echarts = require("echarts");
38
38
  * specific language governing permissions and limitations
39
39
  * under the License.
40
40
  */
41
+ function isEmptyObject(obj) {
42
+ for (var key in obj) {
43
+ if (obj.hasOwnProperty(key)) {
44
+ return false;
45
+ }
46
+ }
47
+
48
+ return true;
49
+ }
50
+
41
51
  var _default = echarts.extendComponentView({
42
52
  type: 'bmap',
43
53
  render: function (bMapModel, ecModel, api) {
@@ -72,13 +82,11 @@ var _default = echarts.extendComponentView({
72
82
  });
73
83
  }
74
84
 
75
- bmap.removeEventListener('moving', this._oldMoveHandler); // FIXME
76
- // Moveend may be triggered by centerAndZoom method when creating coordSys next time
77
- // bmap.removeEventListener('moveend', this._oldMoveHandler);
78
-
85
+ bmap.removeEventListener('moving', this._oldMoveHandler);
86
+ bmap.removeEventListener('moveend', this._oldMoveHandler);
79
87
  bmap.removeEventListener('zoomend', this._oldZoomEndHandler);
80
- bmap.addEventListener('moving', moveHandler); // bmap.addEventListener('moveend', moveHandler);
81
-
88
+ bmap.addEventListener('moving', moveHandler);
89
+ bmap.addEventListener('moveend', moveHandler);
82
90
  bmap.addEventListener('zoomend', zoomEndHandler);
83
91
  this._oldMoveHandler = moveHandler;
84
92
  this._oldZoomEndHandler = zoomEndHandler;
@@ -109,8 +117,8 @@ var _default = echarts.extendComponentView({
109
117
 
110
118
  if (JSON.stringify(originalStyle) !== mapStyleStr) {
111
119
  // FIXME May have blank tile when dragging if setMapStyle
112
- if (Object.keys(newMapStyle).length) {
113
- bmap.setMapStyle(newMapStyle);
120
+ if (!isEmptyObject(newMapStyle2)) {
121
+ bmap.setMapStyle(echarts.util.clone(newMapStyle));
114
122
  }
115
123
 
116
124
  bMapModel.__mapStyle = JSON.parse(mapStyleStr);
@@ -125,8 +133,8 @@ var _default = echarts.extendComponentView({
125
133
 
126
134
  if (JSON.stringify(originalStyle2) !== mapStyleStr2) {
127
135
  // FIXME May have blank tile when dragging if setMapStyle
128
- if (Object.keys(newMapStyle2).length) {
129
- bmap.setMapStyleV2(newMapStyle2);
136
+ if (!isEmptyObject(newMapStyle2)) {
137
+ bmap.setMapStyleV2(echarts.util.clone(newMapStyle2));
130
138
  }
131
139
 
132
140
  bMapModel.__mapStyle2 = JSON.parse(mapStyleStr2);
@@ -179,7 +179,12 @@ BMapCoordSys.create = function (ecModel, api) {
179
179
  // Not support IE8
180
180
  bmapRoot.classList.add('ec-extension-bmap');
181
181
  root.appendChild(bmapRoot);
182
- var bmap = bmapModel.__bmap = new BMap.Map(bmapRoot);
182
+
183
+ // initialize bmap
184
+ var mapOptions = bmapModel.get('mapOptions') || {};
185
+ // Not support `mapType`, use `bmap.setMapType(MapType)` instead.
186
+ delete mapOptions.mapType;
187
+ var bmap = bmapModel.__bmap = new BMap.Map(bmapRoot, mapOptions);
183
188
 
184
189
  var overlay = new Overlay(viewportRoot);
185
190
  bmap.addOverlay(overlay);
@@ -196,8 +201,13 @@ BMapCoordSys.create = function (ecModel, api) {
196
201
  var center = bmapModel.get('center');
197
202
  var zoom = bmapModel.get('zoom');
198
203
  if (center && zoom) {
199
- var pt = new BMap.Point(center[0], center[1]);
200
- bmap.centerAndZoom(pt, zoom);
204
+ var bmapCenter = bmap.getCenter();
205
+ var bmapZoom = bmap.getZoom();
206
+ var centerOrZoomChanged = bmapModel.centerOrZoomChanged([bmapCenter.lng, bmapCenter.lat], bmapZoom);
207
+ if (centerOrZoomChanged) {
208
+ var pt = new BMap.Point(center[0], center[1]);
209
+ bmap.centerAndZoom(pt, zoom);
210
+ }
201
211
  }
202
212
 
203
213
  bmapCoordSys = new BMapCoordSys(bmap, api);
@@ -215,4 +225,4 @@ BMapCoordSys.create = function (ecModel, api) {
215
225
  });
216
226
  };
217
227
 
218
- export default BMapCoordSys;
228
+ export default BMapCoordSys;
@@ -47,10 +47,15 @@ export default echarts.extendComponentModel({
47
47
 
48
48
  zoom: 5,
49
49
 
50
+ // 2.0 http://lbsyun.baidu.com/custom/index.htm
50
51
  mapStyle: {},
51
52
 
53
+ // 3.0 http://lbsyun.baidu.com/index.php?title=open/custom
52
54
  mapStyleV2: {},
53
55
 
56
+ // See https://lbsyun.baidu.com/cms/jsapi/reference/jsapi_reference.html#a0b1
57
+ mapOptions: {},
58
+
54
59
  roam: false
55
60
  }
56
- });
61
+ });
@@ -19,6 +19,15 @@
19
19
 
20
20
  import * as echarts from 'echarts';
21
21
 
22
+ function isEmptyObject(obj) {
23
+ for (var key in obj) {
24
+ if (obj.hasOwnProperty(key)) {
25
+ return false;
26
+ }
27
+ }
28
+ return true;
29
+ }
30
+
22
31
  export default echarts.extendComponentView({
23
32
  type: 'bmap',
24
33
 
@@ -58,12 +67,10 @@ export default echarts.extendComponentView({
58
67
  }
59
68
 
60
69
  bmap.removeEventListener('moving', this._oldMoveHandler);
61
- // FIXME
62
- // Moveend may be triggered by centerAndZoom method when creating coordSys next time
63
- // bmap.removeEventListener('moveend', this._oldMoveHandler);
70
+ bmap.removeEventListener('moveend', this._oldMoveHandler);
64
71
  bmap.removeEventListener('zoomend', this._oldZoomEndHandler);
65
72
  bmap.addEventListener('moving', moveHandler);
66
- // bmap.addEventListener('moveend', moveHandler);
73
+ bmap.addEventListener('moveend', moveHandler);
67
74
  bmap.addEventListener('zoomend', zoomEndHandler);
68
75
 
69
76
  this._oldMoveHandler = moveHandler;
@@ -95,8 +102,8 @@ export default echarts.extendComponentView({
95
102
  var mapStyleStr = JSON.stringify(newMapStyle);
96
103
  if (JSON.stringify(originalStyle) !== mapStyleStr) {
97
104
  // FIXME May have blank tile when dragging if setMapStyle
98
- if (Object.keys(newMapStyle).length) {
99
- bmap.setMapStyle(newMapStyle);
105
+ if (!isEmptyObject(newMapStyle2)) {
106
+ bmap.setMapStyle(echarts.util.clone(newMapStyle));
100
107
  }
101
108
  bMapModel.__mapStyle = JSON.parse(mapStyleStr);
102
109
  }
@@ -109,12 +116,12 @@ export default echarts.extendComponentView({
109
116
  var mapStyleStr2 = JSON.stringify(newMapStyle2);
110
117
  if (JSON.stringify(originalStyle2) !== mapStyleStr2) {
111
118
  // FIXME May have blank tile when dragging if setMapStyle
112
- if (Object.keys(newMapStyle2).length) {
113
- bmap.setMapStyleV2(newMapStyle2);
119
+ if (!isEmptyObject(newMapStyle2)) {
120
+ bmap.setMapStyleV2(echarts.util.clone(newMapStyle2));
114
121
  }
115
122
  bMapModel.__mapStyle2 = JSON.parse(mapStyleStr2);
116
123
  }
117
124
 
118
125
  rendering = false;
119
126
  }
120
- });
127
+ });
@@ -71,7 +71,20 @@ var _default = BaseBarSeries.extend({
71
71
  clip: true,
72
72
  // If use caps on two sides of bars
73
73
  // Only available on tangential polar bar
74
- roundCap: false
74
+ roundCap: false,
75
+ showBackground: false,
76
+ backgroundStyle: {
77
+ color: 'rgba(180, 180, 180, 0.2)',
78
+ borderColor: null,
79
+ borderWidth: 0,
80
+ borderType: 'solid',
81
+ borderRadius: 0,
82
+ shadowBlur: 0,
83
+ shadowColor: null,
84
+ shadowOffsetX: 0,
85
+ shadowOffsetY: 0,
86
+ opacity: 1
87
+ }
75
88
  }
76
89
  });
77
90
 
@@ -38,6 +38,8 @@ var barItemStyle = require("./barItemStyle");
38
38
 
39
39
  var Path = require("zrender/lib/graphic/Path");
40
40
 
41
+ var Group = require("zrender/lib/container/Group");
42
+
41
43
  var _throttle = require("../../util/throttle");
42
44
 
43
45
  var throttle = _throttle.throttle;
@@ -149,14 +151,38 @@ var _default = echarts.extendChartView({
149
151
  // And don't want the label are clipped.
150
152
 
151
153
  var roundCap = seriesModel.get('roundCap', true);
152
- data.diff(oldData).add(function (dataIndex) {
153
- if (!data.hasValue(dataIndex)) {
154
- return;
154
+ var drawBackground = seriesModel.get('showBackground', true);
155
+ var backgroundModel = seriesModel.getModel('backgroundStyle');
156
+ var barBorderRadius = backgroundModel.get('barBorderRadius') || 0;
157
+ var bgEls = [];
158
+ var oldBgEls = this._backgroundEls || [];
159
+
160
+ var createBackground = function (dataIndex) {
161
+ var bgLayout = getLayout[coord.type](data, dataIndex);
162
+ var bgEl = createBackgroundEl(coord, isHorizontalOrRadial, bgLayout);
163
+ bgEl.useStyle(backgroundModel.getBarItemStyle()); // Only cartesian2d support borderRadius.
164
+
165
+ if (coord.type === 'cartesian2d') {
166
+ bgEl.setShape('r', barBorderRadius);
155
167
  }
156
168
 
169
+ bgEls[dataIndex] = bgEl;
170
+ return bgEl;
171
+ };
172
+
173
+ data.diff(oldData).add(function (dataIndex) {
157
174
  var itemModel = data.getItemModel(dataIndex);
158
175
  var layout = getLayout[coord.type](data, dataIndex, itemModel);
159
176
 
177
+ if (drawBackground) {
178
+ createBackground(dataIndex);
179
+ } // If dataZoom in filteMode: 'empty', the baseValue can be set as NaN in "axisProxy".
180
+
181
+
182
+ if (!data.hasValue(dataIndex)) {
183
+ return;
184
+ }
185
+
160
186
  if (needsClip) {
161
187
  // Clip will modify the layout params.
162
188
  // And return a boolean to determine if the shape are fully clipped.
@@ -173,6 +199,32 @@ var _default = echarts.extendChartView({
173
199
  group.add(el);
174
200
  updateStyle(el, data, dataIndex, itemModel, layout, seriesModel, isHorizontalOrRadial, coord.type === 'polar');
175
201
  }).update(function (newIndex, oldIndex) {
202
+ var itemModel = data.getItemModel(newIndex);
203
+ var layout = getLayout[coord.type](data, newIndex, itemModel);
204
+
205
+ if (drawBackground) {
206
+ var bgEl;
207
+
208
+ if (oldBgEls.length === 0) {
209
+ bgEl = createBackground(oldIndex);
210
+ } else {
211
+ bgEl = oldBgEls[oldIndex];
212
+ bgEl.useStyle(backgroundModel.getBarItemStyle()); // Only cartesian2d support borderRadius.
213
+
214
+ if (coord.type === 'cartesian2d') {
215
+ bgEl.setShape('r', barBorderRadius);
216
+ }
217
+
218
+ bgEls[newIndex] = bgEl;
219
+ }
220
+
221
+ var bgLayout = getLayout[coord.type](data, newIndex);
222
+ var shape = createBackgroundShape(isHorizontalOrRadial, bgLayout, coord);
223
+ graphic.updateProps(bgEl, {
224
+ shape: shape
225
+ }, animationModel, newIndex);
226
+ }
227
+
176
228
  var el = oldData.getItemGraphicEl(oldIndex);
177
229
 
178
230
  if (!data.hasValue(newIndex)) {
@@ -180,9 +232,6 @@ var _default = echarts.extendChartView({
180
232
  return;
181
233
  }
182
234
 
183
- var itemModel = data.getItemModel(newIndex);
184
- var layout = getLayout[coord.type](data, newIndex, itemModel);
185
-
186
235
  if (needsClip) {
187
236
  var isClipped = clip[coord.type](coordSysClipArea, layout);
188
237
 
@@ -213,6 +262,15 @@ var _default = echarts.extendChartView({
213
262
  el && removeSector(dataIndex, animationModel, el);
214
263
  }
215
264
  }).execute();
265
+ var bgGroup = this._backgroundGroup || (this._backgroundGroup = new Group());
266
+ bgGroup.removeAll();
267
+
268
+ for (var i = 0; i < bgEls.length; ++i) {
269
+ bgGroup.add(bgEls[i]);
270
+ }
271
+
272
+ group.add(bgGroup);
273
+ this._backgroundEls = bgEls;
216
274
  this._data = data;
217
275
  },
218
276
  _renderLarge: function (seriesModel, ecModel, api) {
@@ -229,6 +287,8 @@ var _default = echarts.extendChartView({
229
287
  }
230
288
  },
231
289
  _incrementalRenderLarge: function (params, seriesModel) {
290
+ this._removeBackground();
291
+
232
292
  createLarge(seriesModel, this.group, true);
233
293
  },
234
294
  dispose: zrUtil.noop,
@@ -240,6 +300,9 @@ var _default = echarts.extendChartView({
240
300
  var data = this._data;
241
301
 
242
302
  if (ecModel && ecModel.get('animation') && data && !this._isLargeDraw) {
303
+ this._removeBackground();
304
+
305
+ this._backgroundEls = [];
243
306
  data.eachItemGraphicEl(function (el) {
244
307
  if (el.type === 'sector') {
245
308
  removeSector(el.dataIndex, ecModel, el);
@@ -252,6 +315,10 @@ var _default = echarts.extendChartView({
252
315
  }
253
316
 
254
317
  this._data = null;
318
+ },
319
+ _removeBackground: function () {
320
+ this.group.remove(this._backgroundGroup);
321
+ this._backgroundGroup = null;
255
322
  }
256
323
  });
257
324
 
@@ -294,15 +361,37 @@ var clip = {
294
361
 
295
362
  return clipped;
296
363
  },
297
- polar: function (coordSysClipArea) {
298
- return false;
364
+ polar: function (coordSysClipArea, layout) {
365
+ var signR = layout.r0 <= layout.r ? 1 : -1; // Make sure r is larger than r0
366
+
367
+ if (signR < 0) {
368
+ var r = layout.r;
369
+ layout.r = layout.r0;
370
+ layout.r0 = r;
371
+ }
372
+
373
+ var r = mathMin(layout.r, coordSysClipArea.r);
374
+ var r0 = mathMax(layout.r0, coordSysClipArea.r0);
375
+ layout.r = r;
376
+ layout.r0 = r0;
377
+ var clipped = r - r0 < 0; // Reverse back
378
+
379
+ if (signR < 0) {
380
+ var r = layout.r;
381
+ layout.r = layout.r0;
382
+ layout.r0 = r;
383
+ }
384
+
385
+ return clipped;
299
386
  }
300
387
  };
301
388
  var elementCreator = {
302
389
  cartesian2d: function (dataIndex, layout, isHorizontal, animationModel, isUpdate) {
303
390
  var rect = new graphic.Rect({
304
- shape: zrUtil.extend({}, layout)
305
- }); // Animation
391
+ shape: zrUtil.extend({}, layout),
392
+ z2: 1
393
+ });
394
+ rect.name = 'item'; // Animation
306
395
 
307
396
  if (animationModel) {
308
397
  var rectShape = rect.shape;
@@ -327,8 +416,10 @@ var elementCreator = {
327
416
  var sector = new ShapeClass({
328
417
  shape: zrUtil.defaults({
329
418
  clockwise: clockwise
330
- }, layout)
331
- }); // Animation
419
+ }, layout),
420
+ z2: 1
421
+ });
422
+ sector.name = 'item'; // Animation
332
423
 
333
424
  if (animationModel) {
334
425
  var sectorShape = sector.shape;
@@ -370,9 +461,11 @@ function removeSector(dataIndex, animationModel, el) {
370
461
  }
371
462
 
372
463
  var getLayout = {
464
+ // itemModel is only used to get borderWidth, which is not needed
465
+ // when calculating bar background layout.
373
466
  cartesian2d: function (data, dataIndex, itemModel) {
374
467
  var layout = data.getItemLayout(dataIndex);
375
- var fixedLineWidth = getLineWidth(itemModel, layout); // fix layout with lineWidth
468
+ var fixedLineWidth = itemModel ? getLineWidth(itemModel, layout) : 0; // fix layout with lineWidth
376
469
 
377
470
  var signX = layout.width > 0 ? 1 : -1;
378
471
  var signY = layout.height > 0 ? 1 : -1;
@@ -396,9 +489,14 @@ var getLayout = {
396
489
  }
397
490
  };
398
491
 
492
+ function isZeroOnPolar(layout) {
493
+ return layout.startAngle != null && layout.endAngle != null && layout.startAngle === layout.endAngle;
494
+ }
495
+
399
496
  function updateStyle(el, data, dataIndex, itemModel, layout, seriesModel, isHorizontal, isPolar) {
400
497
  var color = data.getItemVisual(dataIndex, 'color');
401
498
  var opacity = data.getItemVisual(dataIndex, 'opacity');
499
+ var stroke = data.getVisual('borderColor');
402
500
  var itemStyleModel = itemModel.getModel('itemStyle');
403
501
  var hoverStyle = itemModel.getModel('emphasis.itemStyle').getBarItemStyle();
404
502
 
@@ -407,7 +505,8 @@ function updateStyle(el, data, dataIndex, itemModel, layout, seriesModel, isHori
407
505
  }
408
506
 
409
507
  el.useStyle(zrUtil.defaults({
410
- fill: color,
508
+ stroke: isZeroOnPolar(layout) ? 'none' : stroke,
509
+ fill: isZeroOnPolar(layout) ? 'none' : color,
411
510
  opacity: opacity
412
511
  }, itemStyleModel.getBarItemStyle()));
413
512
  var cursorStyle = itemModel.getShallow('cursor');
@@ -418,13 +517,20 @@ function updateStyle(el, data, dataIndex, itemModel, layout, seriesModel, isHori
418
517
  setLabel(el.style, hoverStyle, itemModel, color, seriesModel, dataIndex, labelPositionOutside);
419
518
  }
420
519
 
520
+ if (isZeroOnPolar(layout)) {
521
+ hoverStyle.fill = hoverStyle.stroke = 'none';
522
+ }
523
+
421
524
  graphic.setHoverStyle(el, hoverStyle);
422
525
  } // In case width or height are too small.
423
526
 
424
527
 
425
528
  function getLineWidth(itemModel, rawLayout) {
426
- var lineWidth = itemModel.get(BAR_BORDER_WIDTH_QUERY) || 0;
427
- return Math.min(lineWidth, Math.abs(rawLayout.width), Math.abs(rawLayout.height));
529
+ var lineWidth = itemModel.get(BAR_BORDER_WIDTH_QUERY) || 0; // width or height may be NaN for empty data
530
+
531
+ var width = isNaN(rawLayout.width) ? Number.MAX_VALUE : Math.abs(rawLayout.width);
532
+ var height = isNaN(rawLayout.height) ? Number.MAX_VALUE : Math.abs(rawLayout.height);
533
+ return Math.min(lineWidth, width, height);
428
534
  }
429
535
 
430
536
  var LargePath = Path.extend({
@@ -453,6 +559,31 @@ function createLarge(seriesModel, group, incremental) {
453
559
  var startPoint = [];
454
560
  var baseDimIdx = data.getLayout('valueAxisHorizontal') ? 1 : 0;
455
561
  startPoint[1 - baseDimIdx] = data.getLayout('valueAxisStart');
562
+ var largeDataIndices = data.getLayout('largeDataIndices');
563
+ var barWidth = data.getLayout('barWidth');
564
+ var backgroundModel = seriesModel.getModel('backgroundStyle');
565
+ var drawBackground = seriesModel.get('showBackground', true);
566
+
567
+ if (drawBackground) {
568
+ var points = data.getLayout('largeBackgroundPoints');
569
+ var backgroundStartPoint = [];
570
+ backgroundStartPoint[1 - baseDimIdx] = data.getLayout('backgroundStart');
571
+ var bgEl = new LargePath({
572
+ shape: {
573
+ points: points
574
+ },
575
+ incremental: !!incremental,
576
+ __startPoint: backgroundStartPoint,
577
+ __baseDimIdx: baseDimIdx,
578
+ __largeDataIndices: largeDataIndices,
579
+ __barWidth: barWidth,
580
+ silent: true,
581
+ z2: 0
582
+ });
583
+ setLargeBackgroundStyle(bgEl, backgroundModel, data);
584
+ group.add(bgEl);
585
+ }
586
+
456
587
  var el = new LargePath({
457
588
  shape: {
458
589
  points: data.getLayout('largePoints')
@@ -460,8 +591,8 @@ function createLarge(seriesModel, group, incremental) {
460
591
  incremental: !!incremental,
461
592
  __startPoint: startPoint,
462
593
  __baseDimIdx: baseDimIdx,
463
- __largeDataIndices: data.getLayout('largeDataIndices'),
464
- __barWidth: data.getLayout('barWidth')
594
+ __largeDataIndices: largeDataIndices,
595
+ __barWidth: barWidth
465
596
  });
466
597
  group.add(el);
467
598
  setLargeStyle(el, seriesModel, data); // Enable tooltip and user mouse/touch event handlers.
@@ -517,4 +648,51 @@ function setLargeStyle(el, seriesModel, data) {
517
648
  el.style.lineWidth = data.getLayout('barWidth');
518
649
  }
519
650
 
651
+ function setLargeBackgroundStyle(el, backgroundModel, data) {
652
+ var borderColor = backgroundModel.get('borderColor') || backgroundModel.get('color');
653
+ var itemStyle = backgroundModel.getItemStyle(['color', 'borderColor']);
654
+ el.useStyle(itemStyle);
655
+ el.style.fill = null;
656
+ el.style.stroke = borderColor;
657
+ el.style.lineWidth = data.getLayout('barWidth');
658
+ }
659
+
660
+ function createBackgroundShape(isHorizontalOrRadial, layout, coord) {
661
+ var coordLayout;
662
+ var isPolar = coord.type === 'polar';
663
+
664
+ if (isPolar) {
665
+ coordLayout = coord.getArea();
666
+ } else {
667
+ coordLayout = coord.grid.getRect();
668
+ }
669
+
670
+ if (isPolar) {
671
+ return {
672
+ cx: coordLayout.cx,
673
+ cy: coordLayout.cy,
674
+ r0: isHorizontalOrRadial ? coordLayout.r0 : layout.r0,
675
+ r: isHorizontalOrRadial ? coordLayout.r : layout.r,
676
+ startAngle: isHorizontalOrRadial ? layout.startAngle : 0,
677
+ endAngle: isHorizontalOrRadial ? layout.endAngle : Math.PI * 2
678
+ };
679
+ } else {
680
+ return {
681
+ x: isHorizontalOrRadial ? layout.x : coordLayout.x,
682
+ y: isHorizontalOrRadial ? coordLayout.y : layout.y,
683
+ width: isHorizontalOrRadial ? layout.width : coordLayout.width,
684
+ height: isHorizontalOrRadial ? coordLayout.height : layout.height
685
+ };
686
+ }
687
+ }
688
+
689
+ function createBackgroundEl(coord, isHorizontalOrRadial, layout) {
690
+ var ElementClz = coord.type === 'polar' ? graphic.Sector : graphic.Rect;
691
+ return new ElementClz({
692
+ shape: createBackgroundShape(isHorizontalOrRadial, layout, coord),
693
+ silent: true,
694
+ z2: 0
695
+ });
696
+ }
697
+
520
698
  module.exports = _default;
@@ -43,7 +43,9 @@ var createListFromArray = require("../helper/createListFromArray");
43
43
  var _default = SeriesModel.extend({
44
44
  type: 'series.__base_bar__',
45
45
  getInitialData: function (option, ecModel) {
46
- return createListFromArray(this.getSource(), this);
46
+ return createListFromArray(this.getSource(), this, {
47
+ useEncodeDefaulter: true
48
+ });
47
49
  },
48
50
  getMarkerPosition: function (value) {
49
51
  var coordSys = this.coordinateSystem;
@@ -52,7 +52,7 @@ var PictorialBarSeries = BaseBarSeries.extend({
52
52
  symbolOffset: null,
53
53
  symbolMargin: null,
54
54
  // start margin and end margin. Can be a number or a percent string.
55
- // Auto margin by defualt.
55
+ // Auto margin by default.
56
56
  symbolRepeat: false,
57
57
  // false/null/undefined, means no repeat.
58
58
  // Can be true, means auto calculate repeat times and cut by data.
@@ -49,7 +49,6 @@ var _default = {
49
49
  performRawSeries: true,
50
50
  reset: function (seriesModel, ecModel) {
51
51
  var data = seriesModel.getData();
52
- var isLargeRender = seriesModel.pipelineContext.large;
53
52
  data.setVisual({
54
53
  legendSymbol: 'roundRect',
55
54
  colorP: getColor(1, seriesModel),
@@ -62,6 +61,7 @@ var _default = {
62
61
  return;
63
62
  }
64
63
 
64
+ var isLargeRender = seriesModel.pipelineContext.large;
65
65
  return !isLargeRender && {
66
66
  progress: progress
67
67
  };
@@ -44,7 +44,9 @@ var _default = SeriesModel.extend({
44
44
  type: 'series.effectScatter',
45
45
  dependencies: ['grid', 'polar'],
46
46
  getInitialData: function (option, ecModel) {
47
- return createListFromArray(this.getSource(), this);
47
+ return createListFromArray(this.getSource(), this, {
48
+ useEncodeDefaulter: true
49
+ });
48
50
  },
49
51
  brushSelector: 'point',
50
52
  defaultOption: {
@@ -20,12 +20,20 @@
20
20
 
21
21
  var echarts = require("../../echarts");
22
22
 
23
+ var zrUtil = require("zrender/lib/core/util");
24
+
23
25
  var createListSimply = require("../helper/createListSimply");
24
26
 
25
27
  var _model = require("../../util/model");
26
28
 
27
29
  var defaultEmphasis = _model.defaultEmphasis;
28
30
 
31
+ var _sourceHelper = require("../../data/helper/sourceHelper");
32
+
33
+ var makeSeriesEncodeForNameBased = _sourceHelper.makeSeriesEncodeForNameBased;
34
+
35
+ var LegendVisualProvider = require("../../visual/LegendVisualProvider");
36
+
29
37
  /*
30
38
  * Licensed to the Apache Software Foundation (ASF) under one
31
39
  * or more contributor license agreements. See the NOTICE file
@@ -50,15 +58,15 @@ var FunnelSeries = echarts.extendSeriesModel({
50
58
  FunnelSeries.superApply(this, 'init', arguments); // Enable legend selection for each data item
51
59
  // Use a function instead of direct access because data reference may changed
52
60
 
53
- this.legendDataProvider = function () {
54
- return this.getRawData();
55
- }; // Extend labelLine emphasis
56
-
61
+ this.legendVisualProvider = new LegendVisualProvider(zrUtil.bind(this.getData, this), zrUtil.bind(this.getRawData, this)); // Extend labelLine emphasis
57
62
 
58
63
  this._defaultLabelLine(option);
59
64
  },
60
65
  getInitialData: function (option, ecModel) {
61
- return createListSimply(this, ['value']);
66
+ return createListSimply(this, {
67
+ coordDimensions: ['value'],
68
+ encodeDefaulter: zrUtil.curry(makeSeriesEncodeForNameBased, this)
69
+ });
62
70
  },
63
71
  _defaultLabelLine: function (option) {
64
72
  // Extend labelLine emphasis
@@ -99,6 +107,7 @@ var FunnelSeries = echarts.extendSeriesModel({
99
107
  maxSize: '100%',
100
108
  sort: 'descending',
101
109
  // 'ascending', 'descending'
110
+ orient: 'vertical',
102
111
  gap: 0,
103
112
  funnelAlign: 'center',
104
113
  label: {