echarts 3.6.1 → 3.7.2

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 (321) hide show
  1. package/README.md +1 -0
  2. package/dist/echarts-en.js +77756 -0
  3. package/dist/echarts-en.min.js +38 -0
  4. package/dist/echarts.common-en.js +50169 -0
  5. package/dist/echarts.common-en.min.js +30 -0
  6. package/dist/echarts.common.js +5799 -3093
  7. package/dist/echarts.common.min.js +14 -13
  8. package/dist/echarts.js +7628 -4679
  9. package/dist/echarts.min.js +22 -22
  10. package/dist/echarts.simple-en.js +34988 -0
  11. package/dist/echarts.simple-en.min.js +27 -0
  12. package/dist/echarts.simple.js +4472 -2493
  13. package/dist/echarts.simple.min.js +11 -9
  14. package/dist/extension/bmap.js +50 -11
  15. package/dist/extension/bmap.min.js +1 -1
  16. package/dist/extension/dataTool.js +10 -10
  17. package/extension/bmap/BMapCoordSys.js +40 -1
  18. package/index.blank.js +4 -0
  19. package/index.common.js +1 -1
  20. package/index.js +1 -1
  21. package/lib/action/createDataSelectAction.js +6 -2
  22. package/lib/chart/bar/BarView.js +6 -3
  23. package/lib/chart/bar/BaseBarSeries.js +4 -3
  24. package/lib/chart/bar/PictorialBarSeries.js +1 -1
  25. package/lib/chart/bar/PictorialBarView.js +29 -7
  26. package/lib/chart/bar/helper.js +14 -31
  27. package/lib/chart/candlestick/candlestickLayout.js +49 -6
  28. package/lib/chart/chord/chordCircularLayout.js +2 -2
  29. package/lib/chart/custom.js +135 -21
  30. package/lib/chart/funnel/FunnelSeries.js +0 -1
  31. package/lib/chart/funnel/FunnelView.js +15 -22
  32. package/lib/chart/funnel/funnelLayout.js +1 -1
  33. package/lib/chart/gauge/GaugeSeries.js +7 -12
  34. package/lib/chart/gauge/GaugeView.js +32 -53
  35. package/lib/chart/graph/GraphSeries.js +2 -1
  36. package/lib/chart/graph/GraphView.js +39 -45
  37. package/lib/chart/graph/forceHelper.js +5 -0
  38. package/lib/chart/graph/forceLayout.js +1 -1
  39. package/lib/chart/heatmap/HeatmapLayer.js +7 -0
  40. package/lib/chart/heatmap/HeatmapView.js +10 -9
  41. package/lib/chart/helper/EffectSymbol.js +3 -3
  42. package/lib/chart/helper/LargeSymbolDraw.js +6 -1
  43. package/lib/chart/helper/Line.js +40 -22
  44. package/lib/chart/helper/Symbol.js +20 -7
  45. package/lib/chart/helper/SymbolDraw.js +2 -1
  46. package/lib/chart/helper/labelHelper.js +0 -17
  47. package/lib/chart/helper/whiskerBoxCommon.js +11 -3
  48. package/lib/chart/line/LineSeries.js +1 -0
  49. package/lib/chart/line/LineView.js +14 -2
  50. package/lib/chart/line/poly.js +5 -0
  51. package/lib/chart/lines/LinesView.js +22 -7
  52. package/lib/chart/map/MapSeries.js +3 -7
  53. package/lib/chart/map/MapView.js +29 -18
  54. package/lib/chart/pie/PieSeries.js +20 -6
  55. package/lib/chart/pie/PieView.js +20 -23
  56. package/lib/chart/pie/labelLayout.js +3 -3
  57. package/lib/chart/radar/RadarView.js +16 -20
  58. package/lib/chart/sankey/SankeySeries.js +2 -4
  59. package/lib/chart/sankey/SankeyView.js +13 -29
  60. package/lib/chart/sankey/sankeyLayout.js +1 -1
  61. package/lib/chart/scatter/ScatterSeries.js +2 -1
  62. package/lib/chart/themeRiver/ThemeRiverSeries.js +2 -4
  63. package/lib/chart/themeRiver/ThemeRiverView.js +2 -5
  64. package/lib/chart/themeRiver/themeRiverLayout.js +1 -1
  65. package/lib/chart/treemap/Breadcrumb.js +1 -1
  66. package/lib/chart/treemap/TreemapSeries.js +28 -8
  67. package/lib/chart/treemap/TreemapView.js +88 -77
  68. package/lib/chart/treemap/treemapLayout.js +29 -13
  69. package/lib/component/axis/AngleAxisView.js +13 -19
  70. package/lib/component/axis/AxisBuilder.js +260 -186
  71. package/lib/component/axis/CartesianAxisView.js +15 -3
  72. package/lib/component/axis/ParallelAxisView.js +1 -1
  73. package/lib/component/axis/RadiusAxisView.js +1 -1
  74. package/lib/component/axis/SingleAxisView.js +8 -2
  75. package/lib/component/axis/cartesianAxisHelper.js +11 -15
  76. package/lib/component/axisPointer/AxisPointerModel.js +1 -3
  77. package/lib/component/axisPointer/BaseAxisPointer.js +15 -38
  78. package/lib/component/axisPointer/axisTrigger.js +36 -20
  79. package/lib/component/axisPointer/modelHelper.js +3 -4
  80. package/lib/component/axisPointer/viewHelper.js +4 -6
  81. package/lib/component/axisPointer.js +1 -14
  82. package/lib/component/calendar/CalendarView.js +22 -39
  83. package/lib/component/dataZoom/AxisProxy.js +3 -2
  84. package/lib/component/dataZoom/DataZoomModel.js +16 -4
  85. package/lib/component/dataZoom/InsideZoomView.js +5 -3
  86. package/lib/component/dataZoom/SliderZoomView.js +21 -32
  87. package/lib/component/dataZoom/roams.js +33 -9
  88. package/lib/component/dataZoom/typeDefaulter.js +1 -1
  89. package/lib/component/graphic.js +17 -5
  90. package/lib/component/helper/BrushTargetManager.js +1 -1
  91. package/lib/component/helper/MapDraw.js +26 -22
  92. package/lib/component/helper/RoamController.js +12 -11
  93. package/lib/component/helper/listComponent.js +27 -24
  94. package/lib/component/helper/selectableMixin.js +40 -15
  95. package/lib/component/legend/LegendModel.js +11 -3
  96. package/lib/component/legend/LegendView.js +151 -70
  97. package/lib/component/legend/ScrollableLegendModel.js +75 -0
  98. package/lib/component/legend/ScrollableLegendView.js +367 -0
  99. package/lib/component/legend/legendAction.js +1 -0
  100. package/lib/component/legend/scrollableLegendAction.js +24 -0
  101. package/lib/component/legend.js +8 -3
  102. package/lib/component/legendScroll.js +11 -0
  103. package/lib/component/marker/MarkAreaView.js +12 -26
  104. package/lib/component/marker/MarkLineView.js +5 -5
  105. package/lib/component/marker/MarkPointView.js +4 -4
  106. package/lib/component/marker/MarkerModel.js +1 -4
  107. package/lib/component/marker/markerHelper.js +1 -0
  108. package/lib/component/radar/RadarView.js +6 -3
  109. package/lib/component/timeline/SliderTimelineModel.js +4 -6
  110. package/lib/component/timeline/SliderTimelineView.js +14 -16
  111. package/lib/component/timeline/TimelineAxis.js +1 -1
  112. package/lib/component/timeline/TimelineModel.js +1 -3
  113. package/lib/component/title.js +9 -10
  114. package/lib/component/toolbox/ToolboxModel.js +2 -0
  115. package/lib/component/toolbox/ToolboxView.js +15 -27
  116. package/lib/component/toolbox/feature/Brush.js +3 -8
  117. package/lib/component/toolbox/feature/DataView.js +5 -5
  118. package/lib/component/toolbox/feature/DataZoom.js +3 -4
  119. package/lib/component/toolbox/feature/MagicType.js +3 -6
  120. package/lib/component/toolbox/feature/Restore.js +2 -1
  121. package/lib/component/toolbox/feature/SaveAsImage.js +23 -9
  122. package/lib/component/tooltip/TooltipContent.js +4 -4
  123. package/lib/component/tooltip/TooltipView.js +29 -6
  124. package/lib/component/visualMap/ContinuousModel.js +2 -2
  125. package/lib/component/visualMap/ContinuousView.js +12 -8
  126. package/lib/component/visualMap/PiecewiseModel.js +1 -2
  127. package/lib/component/visualMap/PiecewiseView.js +2 -2
  128. package/lib/component/visualMap/VisualMapModel.js +18 -12
  129. package/lib/coord/Axis.js +1 -1
  130. package/lib/coord/axisDefault.js +3 -3
  131. package/lib/coord/axisHelper.js +18 -1
  132. package/lib/coord/axisModelCommonMixin.js +12 -2
  133. package/lib/coord/calendar/Calendar.js +65 -21
  134. package/lib/coord/calendar/CalendarModel.js +6 -12
  135. package/lib/coord/cartesian/Cartesian2D.js +0 -14
  136. package/lib/coord/cartesian/Grid.js +47 -28
  137. package/lib/coord/geo/Geo.js +2 -18
  138. package/lib/coord/geo/GeoModel.js +6 -13
  139. package/lib/coord/geo/fix/diaoyuIsland.js +30 -0
  140. package/lib/coord/geo/geoCreator.js +6 -1
  141. package/lib/coord/polar/Polar.js +0 -13
  142. package/lib/coord/radar/Radar.js +1 -1
  143. package/lib/coord/radar/RadarModel.js +6 -2
  144. package/lib/data/DataDiffer.js +14 -7
  145. package/lib/data/Graph.js +3 -0
  146. package/lib/data/List.js +1 -1
  147. package/lib/data/Tree.js +2 -2
  148. package/lib/data/helper/completeDimensions.js +2 -11
  149. package/lib/echarts.js +33 -10
  150. package/lib/lang/cn.js +4 -0
  151. package/lib/lang/default.js +42 -0
  152. package/lib/lang/en.js +42 -0
  153. package/lib/lang.js +42 -0
  154. package/lib/langEN.js +42 -0
  155. package/lib/layout/barGrid.js +11 -3
  156. package/lib/layout/barPolar.js +9 -2
  157. package/lib/model/Model.js +2 -1
  158. package/lib/model/Series.js +14 -6
  159. package/lib/model/mixin/textStyle.js +11 -9
  160. package/lib/preprocessor/backwardCompat.js +5 -4
  161. package/lib/preprocessor/helper/compatStyle.js +157 -45
  162. package/lib/scale/Interval.js +10 -4
  163. package/lib/scale/Time.js +14 -6
  164. package/lib/scale/helper.js +15 -2
  165. package/lib/util/format.js +4 -24
  166. package/lib/util/graphic.js +412 -21
  167. package/lib/util/layout.js +28 -16
  168. package/lib/util/model.js +26 -11
  169. package/lib/util/number.js +106 -21
  170. package/lib/visual/VisualMapping.js +4 -4
  171. package/package.json +3 -3
  172. package/rollup.config.js +49 -0
  173. package/src/action/createDataSelectAction.js +6 -2
  174. package/src/chart/bar/BarView.js +6 -3
  175. package/src/chart/bar/BaseBarSeries.js +4 -3
  176. package/src/chart/bar/PictorialBarSeries.js +1 -1
  177. package/src/chart/bar/PictorialBarView.js +29 -7
  178. package/src/chart/bar/helper.js +13 -30
  179. package/src/chart/candlestick/candlestickLayout.js +49 -6
  180. package/src/chart/chord/chordCircularLayout.js +2 -2
  181. package/src/chart/custom.js +135 -21
  182. package/src/chart/funnel/FunnelSeries.js +0 -1
  183. package/src/chart/funnel/FunnelView.js +15 -22
  184. package/src/chart/funnel/funnelLayout.js +1 -1
  185. package/src/chart/gauge/GaugeSeries.js +7 -12
  186. package/src/chart/gauge/GaugeView.js +32 -53
  187. package/src/chart/graph/GraphSeries.js +2 -1
  188. package/src/chart/graph/GraphView.js +39 -45
  189. package/src/chart/graph/forceHelper.js +5 -0
  190. package/src/chart/graph/forceLayout.js +1 -1
  191. package/src/chart/heatmap/HeatmapLayer.js +7 -0
  192. package/src/chart/heatmap/HeatmapView.js +10 -9
  193. package/src/chart/helper/EffectSymbol.js +3 -3
  194. package/src/chart/helper/LargeSymbolDraw.js +6 -1
  195. package/src/chart/helper/Line.js +40 -22
  196. package/src/chart/helper/Symbol.js +20 -7
  197. package/src/chart/helper/SymbolDraw.js +2 -1
  198. package/src/chart/helper/labelHelper.js +0 -17
  199. package/src/chart/helper/whiskerBoxCommon.js +11 -4
  200. package/src/chart/line/LineSeries.js +1 -0
  201. package/src/chart/line/LineView.js +14 -2
  202. package/src/chart/line/poly.js +5 -0
  203. package/src/chart/lines/LinesView.js +22 -7
  204. package/src/chart/map/MapSeries.js +3 -7
  205. package/src/chart/map/MapView.js +29 -18
  206. package/src/chart/pie/PieSeries.js +20 -6
  207. package/src/chart/pie/PieView.js +20 -23
  208. package/src/chart/pie/labelLayout.js +3 -3
  209. package/src/chart/radar/RadarView.js +16 -20
  210. package/src/chart/sankey/SankeySeries.js +2 -4
  211. package/src/chart/sankey/SankeyView.js +13 -29
  212. package/src/chart/sankey/sankeyLayout.js +1 -1
  213. package/src/chart/scatter/ScatterSeries.js +2 -1
  214. package/src/chart/themeRiver/ThemeRiverSeries.js +2 -4
  215. package/src/chart/themeRiver/ThemeRiverView.js +2 -5
  216. package/src/chart/themeRiver/themeRiverLayout.js +1 -1
  217. package/src/chart/treemap/Breadcrumb.js +1 -1
  218. package/src/chart/treemap/TreemapSeries.js +28 -8
  219. package/src/chart/treemap/TreemapView.js +88 -77
  220. package/src/chart/treemap/treemapLayout.js +29 -13
  221. package/src/component/axis/AngleAxisView.js +13 -19
  222. package/src/component/axis/AxisBuilder.js +260 -186
  223. package/src/component/axis/CartesianAxisView.js +15 -3
  224. package/src/component/axis/ParallelAxisView.js +1 -1
  225. package/src/component/axis/RadiusAxisView.js +1 -1
  226. package/src/component/axis/SingleAxisView.js +8 -2
  227. package/src/component/axis/cartesianAxisHelper.js +11 -15
  228. package/src/component/axisPointer/AxisPointerModel.js +1 -3
  229. package/src/component/axisPointer/BaseAxisPointer.js +15 -38
  230. package/src/component/axisPointer/axisTrigger.js +36 -20
  231. package/src/component/axisPointer/modelHelper.js +3 -4
  232. package/src/component/axisPointer/viewHelper.js +4 -6
  233. package/src/component/axisPointer.js +1 -14
  234. package/src/component/calendar/CalendarView.js +22 -39
  235. package/src/component/dataZoom/AxisProxy.js +3 -2
  236. package/src/component/dataZoom/DataZoomModel.js +16 -4
  237. package/src/component/dataZoom/InsideZoomView.js +5 -3
  238. package/src/component/dataZoom/SliderZoomView.js +21 -32
  239. package/src/component/dataZoom/roams.js +33 -9
  240. package/src/component/dataZoom/typeDefaulter.js +1 -1
  241. package/src/component/graphic.js +17 -5
  242. package/src/component/helper/BrushTargetManager.js +1 -1
  243. package/src/component/helper/MapDraw.js +26 -22
  244. package/src/component/helper/RoamController.js +12 -11
  245. package/src/component/helper/listComponent.js +27 -24
  246. package/src/component/helper/selectableMixin.js +40 -15
  247. package/src/component/legend/LegendModel.js +11 -3
  248. package/src/component/legend/LegendView.js +151 -70
  249. package/src/component/legend/ScrollableLegendModel.js +76 -0
  250. package/src/component/legend/ScrollableLegendView.js +368 -0
  251. package/src/component/legend/legendAction.js +1 -0
  252. package/src/component/legend/scrollableLegendAction.js +25 -0
  253. package/src/component/legend.js +8 -3
  254. package/src/component/legendScroll.js +12 -0
  255. package/src/component/marker/MarkAreaView.js +12 -26
  256. package/src/component/marker/MarkLineView.js +5 -5
  257. package/src/component/marker/MarkPointView.js +4 -4
  258. package/src/component/marker/MarkerModel.js +1 -4
  259. package/src/component/marker/markerHelper.js +1 -0
  260. package/src/component/radar/RadarView.js +6 -3
  261. package/src/component/timeline/SliderTimelineModel.js +4 -6
  262. package/src/component/timeline/SliderTimelineView.js +14 -16
  263. package/src/component/timeline/TimelineAxis.js +1 -1
  264. package/src/component/timeline/TimelineModel.js +1 -3
  265. package/src/component/title.js +9 -10
  266. package/src/component/toolbox/ToolboxModel.js +2 -0
  267. package/src/component/toolbox/ToolboxView.js +15 -27
  268. package/src/component/toolbox/feature/Brush.js +3 -8
  269. package/src/component/toolbox/feature/DataView.js +5 -5
  270. package/src/component/toolbox/feature/DataZoom.js +3 -4
  271. package/src/component/toolbox/feature/MagicType.js +3 -6
  272. package/src/component/toolbox/feature/Restore.js +2 -1
  273. package/src/component/toolbox/feature/SaveAsImage.js +23 -10
  274. package/src/component/tooltip/TooltipContent.js +4 -4
  275. package/src/component/tooltip/TooltipView.js +29 -7
  276. package/src/component/visualMap/ContinuousModel.js +2 -2
  277. package/src/component/visualMap/ContinuousView.js +12 -8
  278. package/src/component/visualMap/PiecewiseModel.js +1 -2
  279. package/src/component/visualMap/PiecewiseView.js +2 -2
  280. package/src/component/visualMap/VisualMapModel.js +18 -12
  281. package/src/coord/Axis.js +1 -1
  282. package/src/coord/axisDefault.js +3 -3
  283. package/src/coord/axisHelper.js +18 -1
  284. package/src/coord/axisModelCommonMixin.js +12 -2
  285. package/src/coord/calendar/Calendar.js +65 -21
  286. package/src/coord/calendar/CalendarModel.js +6 -12
  287. package/src/coord/cartesian/Cartesian2D.js +0 -14
  288. package/src/coord/cartesian/Grid.js +47 -28
  289. package/src/coord/geo/Geo.js +2 -18
  290. package/src/coord/geo/GeoModel.js +6 -13
  291. package/src/coord/geo/fix/diaoyuIsland.js +30 -0
  292. package/src/coord/geo/geoCreator.js +6 -1
  293. package/src/coord/polar/Polar.js +0 -13
  294. package/src/coord/radar/Radar.js +1 -1
  295. package/src/coord/radar/RadarModel.js +6 -2
  296. package/src/data/DataDiffer.js +14 -7
  297. package/src/data/Graph.js +3 -0
  298. package/src/data/List.js +1 -1
  299. package/src/data/Tree.js +2 -2
  300. package/src/data/helper/completeDimensions.js +2 -11
  301. package/src/echarts.js +33 -10
  302. package/src/lang.js +43 -0
  303. package/src/langEN.js +43 -0
  304. package/src/layout/barGrid.js +11 -3
  305. package/src/layout/barPolar.js +9 -2
  306. package/src/model/Model.js +2 -1
  307. package/src/model/Series.js +14 -6
  308. package/src/model/mixin/textStyle.js +11 -9
  309. package/src/preprocessor/backwardCompat.js +5 -4
  310. package/src/preprocessor/helper/compatStyle.js +157 -45
  311. package/src/scale/Interval.js +10 -4
  312. package/src/scale/Time.js +14 -6
  313. package/src/scale/helper.js +15 -2
  314. package/src/util/format.js +4 -24
  315. package/src/util/graphic.js +412 -21
  316. package/src/util/layout.js +28 -16
  317. package/src/util/model.js +26 -11
  318. package/src/util/number.js +106 -21
  319. package/src/visual/VisualMapping.js +4 -4
  320. package/webpack.config.js +21 -7
  321. package/.npmignore +0 -10
package/src/data/List.js CHANGED
@@ -983,7 +983,7 @@ define(function (require) {
983
983
 
984
984
  /**
985
985
  * Set layout property.
986
- * @param {string} key
986
+ * @param {string|Object} key
987
987
  * @param {*} [val]
988
988
  */
989
989
  listProto.setLayout = function (key, val) {
package/src/data/Tree.js CHANGED
@@ -220,7 +220,7 @@ define(function(require) {
220
220
  },
221
221
 
222
222
  /**
223
- * @param {string} path
223
+ * @param {string} [path]
224
224
  * @return {module:echarts/model/Model}
225
225
  */
226
226
  getModel: function (path) {
@@ -405,7 +405,7 @@ define(function(require) {
405
405
  * }
406
406
  *
407
407
  * @static
408
- * @param {Objec} dataRoot Root node.
408
+ * @param {Object} dataRoot Root node.
409
409
  * @param {module:echarts/model/Model} hostModel
410
410
  * @param {Array.<Object>} levelOptions
411
411
  * @return module:echarts/data/Tree
@@ -97,7 +97,6 @@ define(function (require) {
97
97
  if (resultDimIdx != null && resultDimIdx < dimCount) {
98
98
  dataDims[coordDimIndex] = resultDimIdx;
99
99
  applyDim(result[resultDimIdx], coordDim, coordDimIndex);
100
- // coordDim === 'value' && valueCandidate == null && (valueCandidate = resultDimIdx);
101
100
  }
102
101
  });
103
102
  });
@@ -137,7 +136,6 @@ define(function (require) {
137
136
  each(dataDims, function (resultDimIdx, coordDimIndex) {
138
137
  var resultItem = result[resultDimIdx];
139
138
  applyDim(defaults(resultItem, sysDimItem), coordDim, coordDimIndex);
140
- // coordDim === 'value' && valueCandidate == null && (valueCandidate = resultDimIdx);
141
139
  if (resultItem.name == null && sysDimItemDimsDef) {
142
140
  resultItem.name = resultItem.tooltipName = sysDimItemDimsDef[coordDimIndex];
143
141
  }
@@ -160,14 +158,6 @@ define(function (require) {
160
158
  );
161
159
 
162
160
  resultItem.name == null && (resultItem.name = genName(
163
- // Ensure At least one value dim.
164
- // (dataDimNameMap.get('value') == null
165
- // && (valueCandidate == null || valueCandidate === resultDimIdx)
166
- // // Try to set as 'value' only if coordDim is not set as 'extra'.
167
- // && coordDim == null
168
- // )
169
- // ? 'value'
170
- // :
171
161
  resultItem.coordDim,
172
162
  dataDimNameMap
173
163
  ));
@@ -214,7 +204,8 @@ define(function (require) {
214
204
 
215
205
  var value = value[dimIndex];
216
206
  // Consider usage convenience, '1', '2' will be treated as "number".
217
- if (value != null && isFinite(value)) {
207
+ // `isFinit('')` get `true`.
208
+ if (value != null && isFinite(value) && value !== '') {
218
209
  return false;
219
210
  }
220
211
  else if (isString(value) && value !== '-') {
package/src/echarts.js CHANGED
@@ -33,6 +33,7 @@ define(function (require) {
33
33
  var ExtensionAPI = require('./ExtensionAPI');
34
34
  var CoordinateSystemManager = require('./CoordinateSystem');
35
35
  var OptionManager = require('./model/OptionManager');
36
+ var backwardCompat = require('./preprocessor/backwardCompat');
36
37
 
37
38
  var ComponentModel = require('./model/Component');
38
39
  var SeriesModel = require('./model/Series');
@@ -43,12 +44,13 @@ define(function (require) {
43
44
  var modelUtil = require('./util/model');
44
45
  var throttle = require('./util/throttle');
45
46
 
46
- var zrender = require('zrender');
47
+ var zrender = require('zrender/zrender');
47
48
  var zrUtil = require('zrender/core/util');
48
49
  var colorTool = require('zrender/tool/color');
49
50
  var Eventful = require('zrender/mixin/Eventful');
50
51
  var timsort = require('zrender/core/timsort');
51
52
 
53
+
52
54
  var each = zrUtil.each;
53
55
  var parseClassType = ComponentModel.parseClassType;
54
56
 
@@ -74,6 +76,7 @@ define(function (require) {
74
76
  var OPTION_UPDATED = '__optionUpdated';
75
77
  var ACTION_REG = /^[a-zA-Z0-9_]+$/;
76
78
 
79
+
77
80
  function createRegisterEventWithLowercaseName(method) {
78
81
  return function (eventName, handler, context) {
79
82
  // Event name is all lowercase
@@ -114,7 +117,7 @@ define(function (require) {
114
117
  */
115
118
  this.group;
116
119
  /**
117
- * @type {HTMLDomElement}
120
+ * @type {HTMLElement}
118
121
  * @private
119
122
  */
120
123
  this._dom = dom;
@@ -136,11 +139,13 @@ define(function (require) {
136
139
  */
137
140
  this._throttledZrFlush = throttle.throttle(zrUtil.bind(zr.flush, zr), 17);
138
141
 
142
+ var theme = zrUtil.clone(theme);
143
+ theme && backwardCompat(theme, true);
139
144
  /**
140
145
  * @type {Object}
141
146
  * @private
142
147
  */
143
- this._theme = zrUtil.clone(theme);
148
+ this._theme = theme;
144
149
 
145
150
  /**
146
151
  * @type {Array.<module:echarts/view/Chart>}
@@ -228,7 +233,7 @@ define(function (require) {
228
233
  }
229
234
  };
230
235
  /**
231
- * @return {HTMLDomElement}
236
+ * @return {HTMLElement}
232
237
  */
233
238
  echartsProto.getDom = function () {
234
239
  return this._dom;
@@ -938,6 +943,11 @@ define(function (require) {
938
943
  return;
939
944
  }
940
945
 
946
+ // Avoid dispatch action before setOption. Especially in `connect`.
947
+ if (!this._model) {
948
+ return;
949
+ }
950
+
941
951
  // May dispatchAction in rendering procedure
942
952
  if (this[IN_MAIN_PROCESS]) {
943
953
  this._pendingActions.push(payload);
@@ -1516,9 +1526,9 @@ define(function (require) {
1516
1526
  /**
1517
1527
  * @type {number}
1518
1528
  */
1519
- version: '3.6.1',
1529
+ version: '3.7.2',
1520
1530
  dependencies: {
1521
- zrender: '3.5.1'
1531
+ zrender: '3.6.2'
1522
1532
  }
1523
1533
  };
1524
1534
 
@@ -1564,7 +1574,7 @@ define(function (require) {
1564
1574
  }
1565
1575
 
1566
1576
  /**
1567
- * @param {HTMLDomElement} dom
1577
+ * @param {HTMLElement} dom
1568
1578
  * @param {Object} [theme]
1569
1579
  * @param {Object} opts
1570
1580
  * @param {number} [opts.devicePixelRatio] Use window.devicePixelRatio by default
@@ -1681,7 +1691,7 @@ define(function (require) {
1681
1691
  };
1682
1692
 
1683
1693
  /**
1684
- * @param {HTMLDomElement} dom
1694
+ * @param {HTMLElement} dom
1685
1695
  * @return {echarts~ECharts}
1686
1696
  */
1687
1697
  echarts.getInstanceByDom = function (dom) {
@@ -1794,6 +1804,20 @@ define(function (require) {
1794
1804
  CoordinateSystemManager.register(type, CoordinateSystem);
1795
1805
  };
1796
1806
 
1807
+ /**
1808
+ * Get dimensions of specified coordinate system.
1809
+ * @param {string} type
1810
+ * @return {Array.<string|Object>}
1811
+ */
1812
+ echarts.getCoordinateSystemDimensions = function (type) {
1813
+ var coordSysCreator = CoordinateSystemManager.get(type);
1814
+ if (coordSysCreator) {
1815
+ return coordSysCreator.getDimensionsInfo
1816
+ ? coordSysCreator.getDimensionsInfo()
1817
+ : coordSysCreator.dimensions.slice();
1818
+ }
1819
+ };
1820
+
1797
1821
  /**
1798
1822
  * Layout is a special stage of visual encoding
1799
1823
  * Most visual encoding like color are common for different chart
@@ -1921,7 +1945,7 @@ define(function (require) {
1921
1945
  };
1922
1946
 
1923
1947
  echarts.registerVisual(PRIORITY_VISUAL_GLOBAL, require('./visual/seriesColor'));
1924
- echarts.registerPreprocessor(require('./preprocessor/backwardCompat'));
1948
+ echarts.registerPreprocessor(backwardCompat);
1925
1949
  echarts.registerLoading('default', require('./loading/default'));
1926
1950
 
1927
1951
  // Default action
@@ -1936,7 +1960,6 @@ define(function (require) {
1936
1960
  update: 'downplay'
1937
1961
  }, zrUtil.noop);
1938
1962
 
1939
-
1940
1963
  // --------
1941
1964
  // Exports
1942
1965
  // --------
package/src/lang.js ADDED
@@ -0,0 +1,43 @@
1
+ define(function(require) {
2
+
3
+ return {
4
+ toolbox: {
5
+ brush: {
6
+ title: {
7
+ rect: '矩形选择',
8
+ polygon: '圈选',
9
+ lineX: '横向选择',
10
+ lineY: '纵向选择',
11
+ keep: '保持选择',
12
+ clear: '清除选择'
13
+ }
14
+ },
15
+ dataView: {
16
+ title: '数据视图',
17
+ lang: ['数据视图', '关闭', '刷新']
18
+ },
19
+ dataZoom: {
20
+ title: {
21
+ zoom: '区域缩放',
22
+ back: '区域缩放还原'
23
+ }
24
+ },
25
+ magicType: {
26
+ title: {
27
+ line: '切换为折线图',
28
+ bar: '切换为柱状图',
29
+ stack: '切换为堆叠',
30
+ tiled: '切换为平铺'
31
+ }
32
+ },
33
+ restore: {
34
+ title: '还原'
35
+ },
36
+ saveAsImage: {
37
+ title: '保存为图片',
38
+ lang: ['右键另存为图片']
39
+ }
40
+ }
41
+ };
42
+
43
+ });
package/src/langEN.js ADDED
@@ -0,0 +1,43 @@
1
+ define(function(require) {
2
+
3
+ return {
4
+ toolbox: {
5
+ brush: {
6
+ title: {
7
+ rect: 'Box Select',
8
+ polygon: 'Lasso Select',
9
+ lineX: 'Horizontally Select',
10
+ lineY: 'Vertically Select',
11
+ keep: 'Keep Selections',
12
+ clear: 'Clear Selections'
13
+ }
14
+ },
15
+ dataView: {
16
+ title: 'Data View',
17
+ lang: ['Data View', 'Close', 'Refresh']
18
+ },
19
+ dataZoom: {
20
+ title: {
21
+ zoom: 'Zoom',
22
+ back: 'Zoom Reset'
23
+ }
24
+ },
25
+ magicType: {
26
+ title: {
27
+ line: 'Switch to Line Chart',
28
+ bar: 'Switch to Bar Chart',
29
+ stack: 'Stack',
30
+ tiled: 'Tile'
31
+ }
32
+ },
33
+ restore: {
34
+ title: 'Restore'
35
+ },
36
+ saveAsImage: {
37
+ title: 'Save as Image',
38
+ lang: ['Right Click to Save Image']
39
+ }
40
+ }
41
+ };
42
+
43
+ });
@@ -124,8 +124,9 @@ define(function(require) {
124
124
  // TODO
125
125
  var barWidth = seriesInfo.barWidth;
126
126
  if (barWidth && !stacks[stackId].width) {
127
- barWidth = Math.min(columnsOnAxis.remainedWidth, barWidth);
127
+ // See #6312, do not restrict width.
128
128
  stacks[stackId].width = barWidth;
129
+ barWidth = Math.min(columnsOnAxis.remainedWidth, barWidth);
129
130
  columnsOnAxis.remainedWidth -= barWidth;
130
131
  }
131
132
 
@@ -244,7 +245,14 @@ define(function(require) {
244
245
  ? valueAxis.toGlobalCoord(valueAxis.dataToCoord(0))
245
246
  : valueAxis.getGlobalExtent()[0];
246
247
 
247
- var coords = cartesian.dataToPoints(data, true);
248
+ var coordDims = [
249
+ seriesModel.coordDimToDataDim('x')[0],
250
+ seriesModel.coordDimToDataDim('y')[0]
251
+ ];
252
+ var coords = data.mapArray(coordDims, function (x, y) {
253
+ return cartesian.dataToPoint([x, y]);
254
+ }, true);
255
+
248
256
  lastStackCoords[stackId] = lastStackCoords[stackId] || [];
249
257
  lastStackCoordsOrigin[stackId] = lastStackCoordsOrigin[stackId] || []; // Fix #4243
250
258
 
@@ -253,7 +261,7 @@ define(function(require) {
253
261
  size: columnWidth
254
262
  });
255
263
 
256
- data.each(valueAxis.dim, function (value, idx) {
264
+ data.each(seriesModel.coordDimToDataDim(valueAxis.dim)[0], function (value, idx) {
257
265
  if (isNaN(value)) {
258
266
  return;
259
267
  }
@@ -67,11 +67,18 @@ define(function (require) {
67
67
  var valueMax = valueAxis.model.get('max');
68
68
  var valueMin = valueAxis.model.get('min');
69
69
 
70
- var coords = polar.dataToPoints(data);
70
+ var coordDims = [
71
+ seriesModel.coordDimToDataDim('radius')[0],
72
+ seriesModel.coordDimToDataDim('angle')[0]
73
+ ];
74
+ var coords = data.mapArray(coordDims, function (radius, angle) {
75
+ return polar.dataToPoint([radius, angle]);
76
+ }, true);
77
+
71
78
  lastStackCoords[stackId] = lastStackCoords[stackId] || [];
72
79
  lastStackCoordsOrigin[stackId] = lastStackCoordsOrigin[stackId] || []; // Fix #4243
73
80
 
74
- data.each(valueAxis.dim, function (value, idx) {
81
+ data.each(seriesModel.coordDimToDataDim(valueAxis.dim)[0], function (value, idx) {
75
82
  if (isNaN(value)) {
76
83
  return;
77
84
  }
@@ -95,7 +95,7 @@ define(function (require) {
95
95
  },
96
96
 
97
97
  /**
98
- * @param {string|Array.<string>} path
98
+ * @param {string|Array.<string>} [path]
99
99
  * @param {module:echarts/model/Model} [parentModel]
100
100
  * @return {module:echarts/model/Model}
101
101
  */
@@ -179,6 +179,7 @@ define(function (require) {
179
179
  return obj;
180
180
  }
181
181
 
182
+ // `path` can be null/undefined
182
183
  function getParent(model, path) {
183
184
  var getParentMethod = clazzUtil.get(model, 'getParent');
184
185
  return getParentMethod ? getParentMethod.call(model, path) : model.parentModel;
@@ -92,15 +92,22 @@ define(function(require) {
92
92
  var inputPositionParams = layoutMode
93
93
  ? layout.getLayoutParams(option) : {};
94
94
 
95
+ // Backward compat: using subType on theme.
96
+ // But if name duplicate between series subType
97
+ // (for example: parallel) add component mainType,
98
+ // add suffix 'Series'.
99
+ var themeSubType = this.subType;
100
+ if (ComponentModel.hasClass(themeSubType)) {
101
+ themeSubType += 'Series';
102
+ }
95
103
  zrUtil.merge(
96
104
  option,
97
105
  ecModel.getTheme().get(this.subType)
98
106
  );
99
107
  zrUtil.merge(option, this.getDefaultOption());
100
108
 
101
- // Default label emphasis `position` and `show`
102
- // FIXME Set label in mergeOption
103
- modelUtil.defaultEmphasis(option.label, modelUtil.LABEL_OPTIONS);
109
+ // Default label emphasis `show`
110
+ modelUtil.defaultEmphasis(option.label, ['show']);
104
111
 
105
112
  this.fillDataTextStyle(option.data);
106
113
 
@@ -127,13 +134,14 @@ define(function(require) {
127
134
  },
128
135
 
129
136
  fillDataTextStyle: function (data) {
130
- // Default data label emphasis `position` and `show`
137
+ // Default data label emphasis `show`
131
138
  // FIXME Tree structure data ?
132
139
  // FIXME Performance ?
133
140
  if (data) {
141
+ var props = ['show'];
134
142
  for (var i = 0; i < data.length; i++) {
135
143
  if (data[i] && data[i].label) {
136
- modelUtil.defaultEmphasis(data[i].label, modelUtil.LABEL_OPTIONS);
144
+ modelUtil.defaultEmphasis(data[i].label, props);
137
145
  }
138
146
  }
139
147
  }
@@ -218,7 +226,7 @@ define(function(require) {
218
226
  function formatArrayValue(value) {
219
227
  var vertially = zrUtil.reduce(value, function (vertially, val, idx) {
220
228
  var dimItem = data.getDimensionInfo(idx);
221
- return vertially |= dimItem.tooltip !== false && dimItem.tooltipName != null;
229
+ return vertially |= dimItem && dimItem.tooltip !== false && dimItem.tooltipName != null;
222
230
  }, 0);
223
231
 
224
232
  var result = [];
@@ -3,15 +3,20 @@ define(function (require) {
3
3
  var textContain = require('zrender/contain/text');
4
4
  var graphicUtil = require('../../util/graphic');
5
5
 
6
+ var PATH_COLOR = ['textStyle', 'color'];
7
+
6
8
  return {
7
9
  /**
8
10
  * Get color property or get color from option.textStyle.color
11
+ * @param {boolean} [isEmphasis]
9
12
  * @return {string}
10
13
  */
11
- getTextColor: function () {
14
+ getTextColor: function (isEmphasis) {
12
15
  var ecModel = this.ecModel;
13
16
  return this.getShallow('color')
14
- || (ecModel && ecModel.get('textStyle.color'));
17
+ || (
18
+ (!isEmphasis && ecModel) ? ecModel.get(PATH_COLOR) : null
19
+ );
15
20
  },
16
21
 
17
22
  /**
@@ -32,13 +37,10 @@ define(function (require) {
32
37
  text,
33
38
  this.getFont(),
34
39
  this.getShallow('align'),
35
- this.getShallow('baseline')
36
- );
37
- },
38
-
39
- truncateText: function (text, containerWidth, ellipsis, options) {
40
- return textContain.truncateText(
41
- text, containerWidth, this.getFont(), ellipsis, options
40
+ this.getShallow('verticalAlign') || this.getShallow('baseline'),
41
+ this.getShallow('padding'),
42
+ this.getShallow('rich'),
43
+ this.getShallow('truncateText')
42
44
  );
43
45
  }
44
46
  };
@@ -56,16 +56,17 @@ define(function (require) {
56
56
 
57
57
  var each = zrUtil.each;
58
58
 
59
- return function (option) {
60
- each(option.series, function (seriesOpt) {
59
+ return function (option, isTheme) {
60
+ compatStyle(option, isTheme);
61
+
62
+ var series = option.series;
63
+ each(zrUtil.isArray(series) ? series : [series], function (seriesOpt) {
61
64
  if (!zrUtil.isObject(seriesOpt)) {
62
65
  return;
63
66
  }
64
67
 
65
68
  var seriesType = seriesOpt.type;
66
69
 
67
- compatStyle(seriesOpt);
68
-
69
70
  if (seriesType === 'pie' || seriesType === 'gauge') {
70
71
  if (seriesOpt.clockWise != null) {
71
72
  seriesOpt.clockwise = seriesOpt.clockWise;