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
@@ -9,7 +9,7 @@ define(function (require) {
9
9
  var getInterval = AxisBuilder.getInterval;
10
10
 
11
11
  var axisBuilderAttrs = [
12
- 'axisLine', 'axisLabel', 'axisTick', 'axisName'
12
+ 'axisLine', 'axisTickLabel', 'axisName'
13
13
  ];
14
14
  var selfBuilderAttrs = [
15
15
  'splitArea', 'splitLine'
@@ -97,13 +97,19 @@ define(function (require) {
97
97
  );
98
98
  var ticks = axis.scale.getTicks();
99
99
 
100
+ var showMinLabel = axisModel.get('axisLabel.showMinLabel');
101
+ var showMaxLabel = axisModel.get('axisLabel.showMaxLabel');
102
+
100
103
  var p1 = [];
101
104
  var p2 = [];
102
105
  // Simple optimization
103
106
  // Batching the lines if color are the same
104
107
  var lineStyle = lineStyleModel.getLineStyle();
105
108
  for (var i = 0; i < ticksCoords.length; i++) {
106
- if (ifIgnoreOnTick(axis, i, lineInterval)) {
109
+ if (ifIgnoreOnTick(
110
+ axis, i, lineInterval, ticksCoords.length,
111
+ showMinLabel, showMaxLabel
112
+ )) {
107
113
  continue;
108
114
  }
109
115
 
@@ -174,8 +180,14 @@ define(function (require) {
174
180
  var areaStyle = areaStyleModel.getAreaStyle();
175
181
  areaColors = zrUtil.isArray(areaColors) ? areaColors : [areaColors];
176
182
 
183
+ var showMinLabel = axisModel.get('axisLabel.showMinLabel');
184
+ var showMaxLabel = axisModel.get('axisLabel.showMaxLabel');
185
+
177
186
  for (var i = 1; i < ticksCoords.length; i++) {
178
- if (ifIgnoreOnTick(axis, i, areaInterval)) {
187
+ if (ifIgnoreOnTick(
188
+ axis, i, areaInterval, ticksCoords.length,
189
+ showMinLabel, showMaxLabel
190
+ )) {
179
191
  continue;
180
192
  }
181
193
 
@@ -6,7 +6,7 @@ define(function (require) {
6
6
  var brushHelper = require('../helper/brushHelper');
7
7
  var graphic = require('../../util/graphic');
8
8
 
9
- var elementList = ['axisLine', 'axisLabel', 'axisTick', 'axisName'];
9
+ var elementList = ['axisLine', 'axisTickLabel', 'axisName'];
10
10
 
11
11
  var AxisView = require('../../echarts').extendComponentView({
12
12
 
@@ -7,7 +7,7 @@ define(function (require) {
7
7
  var AxisBuilder = require('./AxisBuilder');
8
8
 
9
9
  var axisBuilderAttrs = [
10
- 'axisLine', 'axisLabel', 'axisTick', 'axisName'
10
+ 'axisLine', 'axisTickLabel', 'axisName'
11
11
  ];
12
12
  var selfBuilderAttrs = [
13
13
  'splitLine', 'splitArea'
@@ -8,7 +8,7 @@ define(function (require) {
8
8
  var ifIgnoreOnTick = AxisBuilder.ifIgnoreOnTick;
9
9
 
10
10
  var axisBuilderAttrs = [
11
- 'axisLine', 'axisLabel', 'axisTick', 'axisName'
11
+ 'axisLine', 'axisTickLabel', 'axisName'
12
12
  ];
13
13
 
14
14
  var selfBuilderAttr = 'splitLine';
@@ -66,8 +66,14 @@ define(function (require) {
66
66
  var p1 = [];
67
67
  var p2 = [];
68
68
 
69
+ var showMinLabel = axisModel.get('axisLabel.showMinLabel');
70
+ var showMaxLabel = axisModel.get('axisLabel.showMaxLabel');
71
+
69
72
  for (var i = 0; i < ticksCoords.length; ++i) {
70
- if (ifIgnoreOnTick(axis, i, lineInterval)) {
73
+ if (ifIgnoreOnTick(
74
+ axis, i, lineInterval, ticksCoords.length,
75
+ showMinLabel, showMaxLabel
76
+ )) {
71
77
  continue;
72
78
  }
73
79
  var tickCoord = axis.toGlobalCoord(ticksCoords[i]);
@@ -21,29 +21,25 @@ define(function (require) {
21
21
  var axisPosition = axis.onZero ? 'onZero' : rawAxisPosition;
22
22
  var axisDim = axis.dim;
23
23
 
24
- // [left, right, top, bottom]
25
24
  var rect = grid.getRect();
26
25
  var rectBound = [rect.x, rect.x + rect.width, rect.y, rect.y + rect.height];
27
-
26
+ var idx = {left: 0, right: 1, top: 0, bottom: 1, onZero: 2};
28
27
  var axisOffset = axisModel.get('offset') || 0;
29
28
 
30
- var posMap = {
31
- x: { top: rectBound[2] - axisOffset, bottom: rectBound[3] + axisOffset },
32
- y: { left: rectBound[0] - axisOffset, right: rectBound[1] + axisOffset }
33
- };
34
-
35
- posMap.x.onZero = Math.max(Math.min(getZero('y'), posMap.x.bottom), posMap.x.top);
36
- posMap.y.onZero = Math.max(Math.min(getZero('x'), posMap.y.right), posMap.y.left);
29
+ var posBound = axisDim === 'x'
30
+ ? [rectBound[2] - axisOffset, rectBound[3] + axisOffset]
31
+ : [rectBound[0] - axisOffset, rectBound[1] + axisOffset];
37
32
 
38
- function getZero(dim, val) {
39
- var theAxis = grid.getAxis(dim);
40
- return theAxis.toGlobalCoord(theAxis.dataToCoord(0));
33
+ if (axis.onZero) {
34
+ var otherAxis = grid.getAxis(axisDim === 'x' ? 'y' : 'x', axis.onZeroAxisIndex);
35
+ var onZeroCoord = otherAxis.toGlobalCoord(otherAxis.dataToCoord(0));
36
+ posBound[idx['onZero']] = Math.max(Math.min(onZeroCoord, posBound[1]), posBound[0]);
41
37
  }
42
38
 
43
39
  // Axis position
44
40
  layout.position = [
45
- axisDim === 'y' ? posMap.y[axisPosition] : rectBound[0],
46
- axisDim === 'x' ? posMap.x[axisPosition] : rectBound[3]
41
+ axisDim === 'y' ? posBound[idx[axisPosition]] : rectBound[0],
42
+ axisDim === 'x' ? posBound[idx[axisPosition]] : rectBound[3]
47
43
  ];
48
44
 
49
45
  // Axis rotation
@@ -53,7 +49,7 @@ define(function (require) {
53
49
  var dirMap = {top: -1, bottom: 1, left: -1, right: 1};
54
50
 
55
51
  layout.labelDirection = layout.tickDirection = layout.nameDirection = dirMap[rawAxisPosition];
56
- layout.labelOffset = axis.onZero ? posMap[axisDim][rawAxisPosition] - posMap[axisDim].onZero : 0;
52
+ layout.labelOffset = axis.onZero ? posBound[idx[rawAxisPosition]] - posBound[idx['onZero']] : 0;
57
53
 
58
54
  if (axisModel.get('axisTick.inside')) {
59
55
  layout.tickDirection = -layout.tickDirection;
@@ -59,9 +59,7 @@ define(function(require) {
59
59
  formatter: null, // string | Function
60
60
  precision: 'auto', // Or a number like 0, 1, 2 ...
61
61
  margin: 3,
62
- textStyle: {
63
- color: '#fff'
64
- },
62
+ color: '#fff',
65
63
  padding: [5, 7, 5, 7],
66
64
  backgroundColor: 'auto', // default: axis line color
67
65
  borderColor: null,
@@ -268,15 +268,20 @@ define(function(require) {
268
268
  var isInit;
269
269
  if (!this._handle) {
270
270
  isInit = true;
271
- handle = this._handle = createIcon(handleModel, {
272
- onmousemove: function (e) {
273
- // Fot mobile devicem, prevent screen slider on the button.
274
- eventTool.stop(e.event);
275
- },
276
- onmousedown: bind(this._onHandleDragMove, this, 0, 0),
277
- drift: bind(this._onHandleDragMove, this),
278
- ondragend: bind(this._onHandleDragEnd, this)
279
- });
271
+ handle = this._handle = graphic.createIcon(
272
+ handleModel.get('icon'),
273
+ {
274
+ cursor: 'move',
275
+ draggable: true,
276
+ onmousemove: function (e) {
277
+ // Fot mobile devicem, prevent screen slider on the button.
278
+ eventTool.stop(e.event);
279
+ },
280
+ onmousedown: bind(this._onHandleDragMove, this, 0, 0),
281
+ drift: bind(this._onHandleDragMove, this),
282
+ ondragend: bind(this._onHandleDragEnd, this)
283
+ }
284
+ );
280
285
  zr.add(handle);
281
286
  }
282
287
 
@@ -476,7 +481,7 @@ define(function(require) {
476
481
  if (zrUtil.isObject(lastProps) && zrUtil.isObject(newProps)) {
477
482
  var equals = true;
478
483
  zrUtil.each(newProps, function (item, key) {
479
- equals &= propsEqual(lastProps[key], item);
484
+ equals = equals && propsEqual(lastProps[key], item);
480
485
  });
481
486
  return !!equals;
482
487
  }
@@ -496,34 +501,6 @@ define(function(require) {
496
501
  };
497
502
  }
498
503
 
499
- function createIcon(handleModel, handlers) {
500
- var iconStr = handleModel.get('icon');
501
- var style = {
502
- x: -1, y: -1, width: 2, height: 2
503
- };
504
- var opt = zrUtil.extend({
505
- style: {
506
- strokeNoScale: true
507
- },
508
- rectHover: true,
509
- cursor: 'move',
510
- draggable: true
511
- }, handlers);
512
-
513
- return iconStr.indexOf('image://') === 0
514
- ? (
515
- style.image = iconStr.slice(8),
516
- opt.style = style,
517
- new graphic.Image(opt)
518
- )
519
- : graphic.makePath(
520
- iconStr.replace('path://', ''),
521
- opt,
522
- style,
523
- 'center'
524
- );
525
- }
526
-
527
504
  function updateMandatoryProps(group, axisPointerModel, silent) {
528
505
  var z = axisPointerModel.get('z');
529
506
  var zlevel = axisPointerModel.get('zlevel');
@@ -14,26 +14,41 @@ define(function(require) {
14
14
  * then hide/downplay them.
15
15
  *
16
16
  * @param {Object} coordSysAxesInfo
17
- * @param {string} [currTrigger] 'click' | 'mousemove' | 'leave'
18
- * @param {Array.<number>} [point] x and y, which are mandatory, specify a point to
19
- * tigger axisPointer and tooltip.
20
- * @param {Object} [finder] {
21
- * seriesIndex, dataIndex,
22
- * axesInfo: [{
23
- * axisDim: 'x'|'y'|'angle'|..., axisIndex: ..., value: ...
24
- * }, ...]
25
- * }
26
- * These properties, which are optional, restrict target axes.
27
- * @param {Function} dispatchAction
17
+ * @param {Object} payload
18
+ * @param {string} [payload.currTrigger] 'click' | 'mousemove' | 'leave'
19
+ * @param {Array.<number>} [payload.x] x and y, which are mandatory, specify a point to
20
+ * trigger axisPointer and tooltip.
21
+ * @param {Array.<number>} [payload.y] x and y, which are mandatory, specify a point to
22
+ * trigger axisPointer and tooltip.
23
+ * @param {Object} [payload.seriesIndex] finder, optional, restrict target axes.
24
+ * @param {Object} [payload.dataIndex] finder, restrict target axes.
25
+ * @param {Object} [payload.axesInfo] finder, restrict target axes.
26
+ * [{
27
+ * axisDim: 'x'|'y'|'angle'|...,
28
+ * axisIndex: ...,
29
+ * value: ...
30
+ * }, ...]
31
+ * @param {Function} [payload.dispatchAction]
32
+ * @param {Object} [payload.tooltipOption]
33
+ * @param {Object|Array.<number>|Function} [payload.position] Tooltip position,
34
+ * which can be specified in dispatchAction
35
+ * @param {module:echarts/model/Global} ecModel
28
36
  * @param {module:echarts/ExtensionAPI} api
29
- * @param {Object} [tooltipOption]
30
37
  * @return {Object} content of event obj for echarts.connect.
31
38
  */
32
- function axisTrigger(
33
- coordSysAxesInfo, currTrigger, point, finder, dispatchAction,
34
- ecModel, api, tooltipOption
35
- ) {
36
- finder = finder || {};
39
+ function axisTrigger(payload, ecModel, api) {
40
+ var currTrigger = payload.currTrigger;
41
+ var point = [payload.x, payload.y];
42
+ var finder = payload;
43
+ var dispatchAction = payload.dispatchAction || zrUtil.bind(api.dispatchAction, api);
44
+ var coordSysAxesInfo = ecModel.getComponent('axisPointer').coordSysAxesInfo;
45
+
46
+ // Pending
47
+ // See #6121. But we are not able to reproduce it yet.
48
+ if (!coordSysAxesInfo) {
49
+ return;
50
+ }
51
+
37
52
  if (illegalPoint(point)) {
38
53
  // Used in the default behavior of `connection`: use the sample seriesIndex
39
54
  // and dataIndex. And also used in the tooltipView trigger.
@@ -107,7 +122,7 @@ define(function(require) {
107
122
  });
108
123
 
109
124
  updateModelActually(showValueMap, axesInfo, outputFinder);
110
- dispatchTooltipActually(dataByCoordSys, point, tooltipOption, dispatchAction);
125
+ dispatchTooltipActually(dataByCoordSys, point, payload, dispatchAction);
111
126
  dispatchHighDownActually(axesInfo, dispatchAction, api);
112
127
 
113
128
  return outputFinder;
@@ -290,7 +305,7 @@ define(function(require) {
290
305
  });
291
306
  }
292
307
 
293
- function dispatchTooltipActually(dataByCoordSys, point, tooltipOption, dispatchAction) {
308
+ function dispatchTooltipActually(dataByCoordSys, point, payload, dispatchAction) {
294
309
  // Basic logic: If no showTip required, hideTip will be dispatched.
295
310
  if (illegalPoint(point) || !dataByCoordSys.list.length) {
296
311
  dispatchAction({type: 'hideTip'});
@@ -308,7 +323,8 @@ define(function(require) {
308
323
  escapeConnect: true,
309
324
  x: point[0],
310
325
  y: point[1],
311
- tooltipOption: tooltipOption,
326
+ tooltipOption: payload.tooltipOption,
327
+ position: payload.position,
312
328
  dataIndexInside: sampleItem.dataIndexInside,
313
329
  dataIndex: sampleItem.dataIndex,
314
330
  seriesIndex: sampleItem.seriesIndex,
@@ -182,10 +182,7 @@ define(function(require) {
182
182
  // (cross style is dashed by default)
183
183
  if (!triggerTooltip) {
184
184
  var crossStyle = volatileOption.lineStyle = tooltipAxisPointerModel.get('crossStyle');
185
- crossStyle && zrUtil.defaults(
186
- labelOption.textStyle || (labelOption.textStyle = {}),
187
- crossStyle.textStyle
188
- );
185
+ crossStyle && zrUtil.defaults(labelOption, crossStyle.textStyle);
189
186
  }
190
187
  }
191
188
 
@@ -202,10 +199,12 @@ define(function(require) {
202
199
  // Notice this case: this coordSys is `cartesian2D` but not `grid`.
203
200
  var coordSys = seriesModel.coordinateSystem;
204
201
  var seriesTooltipTrigger = seriesModel.get('tooltip.trigger', true);
202
+ var seriesTooltipShow = seriesModel.get('tooltip.show', true);
205
203
  if (!coordSys
206
204
  || seriesTooltipTrigger === 'none'
207
205
  || seriesTooltipTrigger === false
208
206
  || seriesTooltipTrigger === 'item'
207
+ || seriesTooltipShow === false
209
208
  || seriesModel.get('axisPointer.show', true) === false
210
209
  ) {
211
210
  return;
@@ -45,13 +45,10 @@ define(function(require) {
45
45
  }
46
46
  );
47
47
  var labelModel = axisPointerModel.getModel('label');
48
- var textStyleModel = labelModel.getModel('textStyle');
49
48
  var paddings = formatUtil.normalizeCssArray(labelModel.get('padding') || 0);
50
49
 
51
- var font = textStyleModel.getFont();
52
- var textRect = textContain.getBoundingRect(
53
- text, font, labelPos.textAlign, labelPos.textBaseline
54
- );
50
+ var font = labelModel.getFont();
51
+ var textRect = textContain.getBoundingRect(text, font);
55
52
 
56
53
  var position = labelPos.position;
57
54
  var width = textRect.width + paddings[1] + paddings[3];
@@ -76,10 +73,11 @@ define(function(require) {
76
73
  elOption.label = {
77
74
  shape: {x: 0, y: 0, width: width, height: height, r: labelModel.get('borderRadius')},
78
75
  position: position.slice(),
76
+ // TODO: rich
79
77
  style: {
80
78
  text: text,
81
79
  textFont: font,
82
- textFill: textStyleModel.getTextColor(),
80
+ textFill: labelModel.getTextColor(),
83
81
  textPosition: 'inside',
84
82
  fill: bgColor,
85
83
  stroke: labelModel.get('borderColor') || 'transparent',
@@ -43,19 +43,6 @@ define(function (require) {
43
43
  type: 'updateAxisPointer',
44
44
  event: 'updateAxisPointer',
45
45
  update: ':updateAxisPointer'
46
- }, function (payload, ecModel, api) {
47
- var outputFinder = axisTrigger(
48
- ecModel.getComponent('axisPointer').coordSysAxesInfo,
49
- payload.currTrigger,
50
- [payload.x, payload.y],
51
- payload,
52
- payload.dispatchAction || zrUtil.bind(api.dispatchAction, api),
53
- ecModel,
54
- api,
55
- payload.tooltipOption
56
- );
57
-
58
- return outputFinder;
59
- });
46
+ }, axisTrigger);
60
47
 
61
48
  });
@@ -101,6 +101,7 @@ define(function (require) {
101
101
  width: sw,
102
102
  height: sh
103
103
  },
104
+ cursor: 'default',
104
105
  style: itemRectStyleModel
105
106
  });
106
107
 
@@ -226,25 +227,25 @@ define(function (require) {
226
227
 
227
228
  },
228
229
 
229
- _yearTextPositionControl: function (point, orient, position, margin) {
230
+ _yearTextPositionControl: function (textEl, point, orient, position, margin) {
230
231
 
231
232
  point = point.slice();
232
233
  var aligns = ['center', 'bottom'];
233
234
 
234
- if (position === 'top') {
235
- point[1] -= margin;
236
- }
237
235
  if (position === 'bottom') {
238
236
  point[1] += margin;
239
237
  aligns = ['center', 'top'];
240
238
  }
241
- if (position === 'left') {
239
+ else if (position === 'left') {
242
240
  point[0] -= margin;
243
241
  }
244
- if (position === 'right') {
242
+ else if (position === 'right') {
245
243
  point[0] += margin;
246
244
  aligns = ['center', 'top'];
247
245
  }
246
+ else { // top
247
+ point[1] -= margin;
248
+ }
248
249
 
249
250
  var rotate = 0;
250
251
  if (position === 'left' || position === 'right') {
@@ -253,10 +254,8 @@ define(function (require) {
253
254
 
254
255
  return {
255
256
  rotation: rotate,
256
- origin: point,
257
+ position: point,
257
258
  style: {
258
- x: point[0],
259
- y: point[1],
260
259
  textAlign: aligns[0],
261
260
  textVerticalAlign: aligns[1]
262
261
  }
@@ -271,7 +270,6 @@ define(function (require) {
271
270
  return;
272
271
  }
273
272
 
274
- var yearLabelStyleModel = calendarModel.getModel('yearLabel.textStyle');
275
273
  var margin = yearLabel.get('margin');
276
274
  var pos = yearLabel.get('position');
277
275
 
@@ -285,7 +283,6 @@ define(function (require) {
285
283
 
286
284
  var idx = orient === 'horizontal' ? 0 : 1;
287
285
 
288
-
289
286
  var posPoints = {
290
287
  top: [xc, points[idx][1]],
291
288
  bottom: [xc, points[1 - idx][1]],
@@ -309,16 +306,9 @@ define(function (require) {
309
306
 
310
307
  var content = this._formatterLabel(formatter, params);
311
308
 
312
- var yearText = new graphic.Text(
313
- zrUtil.merge({
314
- z2: 30,
315
- style: {
316
- text: content,
317
- font: yearLabelStyleModel.getFont(),
318
- fill: yearLabelStyleModel.getTextColor()
319
- }
320
- }, this._yearTextPositionControl(posPoints[pos], orient, pos, margin))
321
- );
309
+ var yearText = new graphic.Text({z2: 30});
310
+ graphic.setTextStyle(yearText.style, yearLabel, {text: content}),
311
+ yearText.attr(this._yearTextPositionControl(yearText, posPoints[pos], orient, pos, margin));
322
312
 
323
313
  group.add(yearText);
324
314
  },
@@ -368,7 +358,6 @@ define(function (require) {
368
358
  return;
369
359
  }
370
360
 
371
- var monthLabelStyleModel = calendarModel.getModel('monthLabel.textStyle');
372
361
  var nameMap = monthLabel.get('nameMap');
373
362
  var margin = monthLabel.get('margin');
374
363
  var pos = monthLabel.get('position');
@@ -407,14 +396,11 @@ define(function (require) {
407
396
 
408
397
  var content = this._formatterLabel(formatter, params);
409
398
 
410
- var monthText = new graphic.Text({
411
- z2: 30,
412
- style: zrUtil.extend({
413
- text: content,
414
- font: monthLabelStyleModel.getFont(),
415
- fill: monthLabelStyleModel.getTextColor()
416
- }, this._monthTextPositionControl(tmp, isCenter, orient, pos, margin))
417
- });
399
+ var monthText = new graphic.Text({z2: 30});
400
+ zrUtil.extend(
401
+ graphic.setTextStyle(monthText.style, monthLabel, {text: content}),
402
+ this._monthTextPositionControl(tmp, isCenter, orient, pos, margin)
403
+ );
418
404
 
419
405
  group.add(monthText);
420
406
  }
@@ -453,7 +439,6 @@ define(function (require) {
453
439
  }
454
440
 
455
441
  var coordSys = calendarModel.coordinateSystem;
456
- var dayLabelStyleModel = calendarModel.getModel('dayLabel.textStyle');
457
442
  var pos = dayLabel.get('position');
458
443
  var nameMap = dayLabel.get('nameMap');
459
444
  var margin = dayLabel.get('margin');
@@ -483,14 +468,12 @@ define(function (require) {
483
468
  var point = coordSys.dataToRect([tmpD.time], false).center;
484
469
  var day = i;
485
470
  day = Math.abs((i + firstDayOfWeek) % 7);
486
- var weekText = new graphic.Text({
487
- z2: 30,
488
- style: zrUtil.extend({
489
- text: nameMap[day],
490
- font: dayLabelStyleModel.getFont(),
491
- fill: dayLabelStyleModel.getTextColor()
492
- }, this._weekTextPositionControl(point, orient, pos, margin, cellSize))
493
- });
471
+ var weekText = new graphic.Text({z2: 30});
472
+
473
+ zrUtil.extend(
474
+ graphic.setTextStyle(weekText.style, dayLabel, {text: nameMap[day]}),
475
+ this._weekTextPositionControl(point, orient, pos, margin, cellSize)
476
+ );
494
477
  group.add(weekText);
495
478
  }
496
479
  }
@@ -392,7 +392,7 @@ define(function(require) {
392
392
  var isCategoryAxis = axisModel.get('type') === 'category';
393
393
  var axisDataLen = isCategoryAxis && (axisModel.get('data') || []).length;
394
394
 
395
- if (min != null && min !== 'dataMin') {
395
+ if (min != null && min !== 'dataMin' && typeof min !== 'function') {
396
396
  dataExtent[0] = min;
397
397
  }
398
398
  else if (isCategoryAxis) {
@@ -400,7 +400,7 @@ define(function(require) {
400
400
  }
401
401
 
402
402
  var max = axisModel.getMax(true);
403
- if (max != null && max !== 'dataMax') {
403
+ if (max != null && max !== 'dataMax' && typeof max !== 'function') {
404
404
  dataExtent[1] = max;
405
405
  }
406
406
  else if (isCategoryAxis) {
@@ -432,6 +432,7 @@ define(function(require) {
432
432
 
433
433
  // [0, 500]: arbitrary value, guess axis extent.
434
434
  var precision = numberUtil.getPixelPrecision(valueWindow, [0, 500]);
435
+ precision = Math.min(precision, 20);
435
436
  // isRestore or isFull
436
437
  var useOrigin = isRestore || (percentWindow[0] === 0 && percentWindow[1] === 100);
437
438
 
@@ -57,7 +57,8 @@ define(function(require) {
57
57
  minSpan: null, // 0 ~ 100
58
58
  maxSpan: null, // 0 ~ 100
59
59
  minValueSpan: null, // The range of dataZoom can not be smaller than that.
60
- maxValueSpan: null // The range of dataZoom can not be larger than that.
60
+ maxValueSpan: null, // The range of dataZoom can not be larger than that.
61
+ rangeMode: null // Array, can be 'value' or 'percent'.
61
62
  },
62
63
 
63
64
  /**
@@ -514,6 +515,7 @@ define(function(require) {
514
515
  getRangePropMode: function () {
515
516
  return this._rangePropMode.slice();
516
517
  }
518
+
517
519
  });
518
520
 
519
521
  function retrieveRaw(option) {
@@ -528,14 +530,24 @@ define(function(require) {
528
530
  }
529
531
 
530
532
  function updateRangeUse(dataZoomModel, rawOption) {
533
+ var rangePropMode = dataZoomModel._rangePropMode;
534
+ var rangeModeInOption = dataZoomModel.get('rangeMode');
535
+
531
536
  each([['start', 'startValue'], ['end', 'endValue']], function (names, index) {
532
- var rangePropMode = dataZoomModel._rangePropMode;
533
- if (rawOption[names[0]] != null) {
537
+ var percentSpecified = rawOption[names[0]] != null;
538
+ var valueSpecified = rawOption[names[1]] != null;
539
+ if (percentSpecified && !valueSpecified) {
534
540
  rangePropMode[index] = 'percent';
535
541
  }
536
- else if (rawOption[names[1]] != null) {
542
+ else if (!percentSpecified && valueSpecified) {
537
543
  rangePropMode[index] = 'value';
538
544
  }
545
+ else if (rangeModeInOption) {
546
+ rangePropMode[index] = rangeModeInOption[index];
547
+ }
548
+ else if (percentSpecified) { // percentSpecified && valueSpecified
549
+ rangePropMode[index] = 'percent';
550
+ }
539
551
  // else remain its original setting.
540
552
  });
541
553
  }
@@ -122,9 +122,11 @@ define(function (require) {
122
122
  var directionInfo = getDirectionInfo[coordSysName](
123
123
  null, [mouseX, mouseY], axisModel, controller, coordInfo
124
124
  );
125
-
126
- var percentPoint = (directionInfo.pixel - directionInfo.pixelStart) /
127
- directionInfo.pixelLength * (range[1] - range[0]) + range[0];
125
+ var percentPoint = (
126
+ directionInfo.signal > 0
127
+ ? (directionInfo.pixelStart + directionInfo.pixelLength - directionInfo.pixel)
128
+ : (directionInfo.pixel - directionInfo.pixelStart)
129
+ ) / directionInfo.pixelLength * (range[1] - range[0]) + range[0];
128
130
 
129
131
  scale = Math.max(1 / scale, 0);
130
132
  range[0] = (range[0] - percentPoint) * scale + percentPoint;