echarts 3.7.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 (94) hide show
  1. package/dist/echarts-en.js +77756 -0
  2. package/dist/echarts-en.min.js +38 -0
  3. package/dist/echarts.common-en.js +50169 -0
  4. package/dist/echarts.common-en.min.js +30 -0
  5. package/dist/echarts.common.js +1408 -1186
  6. package/dist/echarts.common.min.js +14 -14
  7. package/dist/echarts.js +1572 -1278
  8. package/dist/echarts.min.js +22 -22
  9. package/dist/echarts.simple-en.js +34988 -0
  10. package/dist/echarts.simple-en.min.js +27 -0
  11. package/dist/echarts.simple.js +1152 -994
  12. package/dist/echarts.simple.min.js +11 -11
  13. package/index.blank.js +4 -0
  14. package/lib/chart/bar/BaseBarSeries.js +3 -3
  15. package/lib/chart/candlestick/candlestickLayout.js +26 -1
  16. package/lib/chart/graph/forceHelper.js +5 -0
  17. package/lib/chart/graph/forceLayout.js +0 -1
  18. package/lib/chart/helper/whiskerBoxCommon.js +6 -1
  19. package/lib/chart/line/LineView.js +14 -2
  20. package/lib/chart/lines/LinesView.js +22 -7
  21. package/lib/chart/pie/PieSeries.js +3 -1
  22. package/lib/chart/pie/PieView.js +1 -1
  23. package/lib/chart/treemap/TreemapView.js +5 -28
  24. package/lib/component/axis/AxisBuilder.js +249 -178
  25. package/lib/component/axis/CartesianAxisView.js +15 -3
  26. package/lib/component/axis/ParallelAxisView.js +1 -1
  27. package/lib/component/axis/RadiusAxisView.js +1 -1
  28. package/lib/component/axis/SingleAxisView.js +8 -2
  29. package/lib/component/helper/RoamController.js +12 -11
  30. package/lib/component/marker/MarkAreaView.js +1 -1
  31. package/lib/component/radar/RadarView.js +1 -1
  32. package/lib/component/toolbox/feature/Brush.js +3 -8
  33. package/lib/component/toolbox/feature/DataView.js +3 -3
  34. package/lib/component/toolbox/feature/DataZoom.js +3 -4
  35. package/lib/component/toolbox/feature/MagicType.js +3 -6
  36. package/lib/component/toolbox/feature/Restore.js +2 -1
  37. package/lib/component/toolbox/feature/SaveAsImage.js +23 -9
  38. package/lib/component/visualMap/ContinuousModel.js +2 -2
  39. package/lib/component/visualMap/ContinuousView.js +3 -3
  40. package/lib/component/visualMap/PiecewiseModel.js +0 -1
  41. package/lib/component/visualMap/VisualMapModel.js +17 -11
  42. package/lib/coord/calendar/Calendar.js +64 -20
  43. package/lib/echarts.js +5 -4
  44. package/lib/lang/cn.js +4 -0
  45. package/lib/lang/default.js +42 -0
  46. package/lib/lang/en.js +42 -0
  47. package/lib/lang.js +42 -0
  48. package/lib/langEN.js +42 -0
  49. package/lib/preprocessor/helper/compatStyle.js +24 -23
  50. package/lib/scale/Time.js +4 -4
  51. package/lib/util/graphic.js +5 -5
  52. package/lib/util/number.js +42 -21
  53. package/lib/visual/VisualMapping.js +3 -3
  54. package/package.json +3 -3
  55. package/rollup.config.js +49 -0
  56. package/src/chart/bar/BaseBarSeries.js +3 -3
  57. package/src/chart/candlestick/candlestickLayout.js +26 -1
  58. package/src/chart/graph/forceHelper.js +5 -0
  59. package/src/chart/graph/forceLayout.js +0 -1
  60. package/src/chart/helper/whiskerBoxCommon.js +6 -2
  61. package/src/chart/line/LineView.js +14 -2
  62. package/src/chart/lines/LinesView.js +22 -7
  63. package/src/chart/pie/PieSeries.js +3 -1
  64. package/src/chart/pie/PieView.js +1 -1
  65. package/src/chart/treemap/TreemapView.js +5 -28
  66. package/src/component/axis/AxisBuilder.js +249 -178
  67. package/src/component/axis/CartesianAxisView.js +15 -3
  68. package/src/component/axis/ParallelAxisView.js +1 -1
  69. package/src/component/axis/RadiusAxisView.js +1 -1
  70. package/src/component/axis/SingleAxisView.js +8 -2
  71. package/src/component/helper/RoamController.js +12 -11
  72. package/src/component/marker/MarkAreaView.js +1 -1
  73. package/src/component/radar/RadarView.js +1 -1
  74. package/src/component/toolbox/feature/Brush.js +3 -8
  75. package/src/component/toolbox/feature/DataView.js +3 -3
  76. package/src/component/toolbox/feature/DataZoom.js +3 -4
  77. package/src/component/toolbox/feature/MagicType.js +3 -6
  78. package/src/component/toolbox/feature/Restore.js +2 -1
  79. package/src/component/toolbox/feature/SaveAsImage.js +23 -10
  80. package/src/component/visualMap/ContinuousModel.js +2 -2
  81. package/src/component/visualMap/ContinuousView.js +3 -3
  82. package/src/component/visualMap/PiecewiseModel.js +0 -1
  83. package/src/component/visualMap/VisualMapModel.js +17 -11
  84. package/src/coord/calendar/Calendar.js +64 -20
  85. package/src/echarts.js +5 -4
  86. package/src/lang.js +43 -0
  87. package/src/langEN.js +43 -0
  88. package/src/preprocessor/helper/compatStyle.js +24 -23
  89. package/src/scale/Time.js +4 -4
  90. package/src/util/graphic.js +5 -5
  91. package/src/util/number.js +42 -21
  92. package/src/visual/VisualMapping.js +3 -3
  93. package/webpack.config.js +21 -7
  94. package/.npmignore +0 -10
package/dist/echarts.js CHANGED
@@ -92,21 +92,21 @@ return /******/ (function(modules) { // webpackBootstrap
92
92
  __webpack_require__(238);
93
93
  __webpack_require__(294);
94
94
  __webpack_require__(354);
95
- __webpack_require__(365);
96
-
97
- __webpack_require__(369);
95
+ __webpack_require__(366);
98
96
 
99
97
  __webpack_require__(370);
100
- __webpack_require__(383);
101
98
 
102
- __webpack_require__(398);
103
- __webpack_require__(404);
104
- __webpack_require__(407);
99
+ __webpack_require__(371);
100
+ __webpack_require__(384);
101
+
102
+ __webpack_require__(399);
103
+ __webpack_require__(405);
104
+ __webpack_require__(408);
105
105
 
106
- __webpack_require__(410);
107
- __webpack_require__(419);
106
+ __webpack_require__(411);
107
+ __webpack_require__(420);
108
108
 
109
- __webpack_require__(431);
109
+ __webpack_require__(432);
110
110
 
111
111
 
112
112
  /***/ }),
@@ -161,10 +161,11 @@ return /******/ (function(modules) { // webpackBootstrap
161
161
 
162
162
  var zrender = __webpack_require__(87);
163
163
  var zrUtil = __webpack_require__(4);
164
- var colorTool = __webpack_require__(35);
165
- var Eventful = __webpack_require__(29);
164
+ var colorTool = __webpack_require__(33);
165
+ var Eventful = __webpack_require__(27);
166
166
  var timsort = __webpack_require__(91);
167
167
 
168
+
168
169
  var each = zrUtil.each;
169
170
  var parseClassType = ComponentModel.parseClassType;
170
171
 
@@ -190,6 +191,7 @@ return /******/ (function(modules) { // webpackBootstrap
190
191
  var OPTION_UPDATED = '__optionUpdated';
191
192
  var ACTION_REG = /^[a-zA-Z0-9_]+$/;
192
193
 
194
+
193
195
  function createRegisterEventWithLowercaseName(method) {
194
196
  return function (eventName, handler, context) {
195
197
  // Event name is all lowercase
@@ -1639,9 +1641,9 @@ return /******/ (function(modules) { // webpackBootstrap
1639
1641
  /**
1640
1642
  * @type {number}
1641
1643
  */
1642
- version: '3.7.1',
1644
+ version: '3.7.2',
1643
1645
  dependencies: {
1644
- zrender: '3.6.1'
1646
+ zrender: '3.6.2'
1645
1647
  }
1646
1648
  };
1647
1649
 
@@ -2073,7 +2075,6 @@ return /******/ (function(modules) { // webpackBootstrap
2073
2075
  update: 'downplay'
2074
2076
  }, zrUtil.noop);
2075
2077
 
2076
-
2077
2078
  // --------
2078
2079
  // Exports
2079
2080
  // --------
@@ -2090,7 +2091,7 @@ return /******/ (function(modules) { // webpackBootstrap
2090
2091
  echarts.throttle = throttle.throttle;
2091
2092
  echarts.matrix = __webpack_require__(11);
2092
2093
  echarts.vector = __webpack_require__(10);
2093
- echarts.color = __webpack_require__(35);
2094
+ echarts.color = __webpack_require__(33);
2094
2095
 
2095
2096
  echarts.util = {};
2096
2097
  each([
@@ -4786,11 +4787,14 @@ return /******/ (function(modules) { // webpackBootstrap
4786
4787
  var TIME_REG = /^(?:(\d{4})(?:[-\/](\d{1,2})(?:[-\/](\d{1,2})(?:[T ](\d{1,2})(?::(\d\d)(?::(\d\d)(?:[.,](\d+))?)?)?(Z|[\+\-]\d\d:?\d\d)?)?)?)?)?$/; // jshint ignore:line
4787
4788
 
4788
4789
  /**
4790
+ * Consider DST, it is incorrect to provide a method `getTimezoneOffset`
4791
+ * without time specified. So this method is removed.
4792
+ *
4789
4793
  * @return {number} in minutes
4790
4794
  */
4791
- number.getTimezoneOffset = function () {
4792
- return (new Date()).getTimezoneOffset();
4793
- };
4795
+ // number.getTimezoneOffset = function () {
4796
+ // return (new Date()).getTimezoneOffset();
4797
+ // };
4794
4798
 
4795
4799
  /**
4796
4800
  * @param {string|Date|number} value These values can be accepted:
@@ -4824,24 +4828,42 @@ return /******/ (function(modules) { // webpackBootstrap
4824
4828
  return new Date(NaN);
4825
4829
  }
4826
4830
 
4827
- var timezoneOffset = number.getTimezoneOffset();
4828
- var timeOffset = !match[8]
4829
- ? 0
4830
- : match[8].toUpperCase() === 'Z'
4831
- ? timezoneOffset
4832
- : +match[8].slice(0, 3) * 60 + timezoneOffset;
4833
-
4834
- // match[n] can only be string or undefined.
4835
- // But take care of '12' + 1 => '121'.
4836
- return new Date(
4837
- +match[1],
4838
- +(match[2] || 1) - 1,
4839
- +match[3] || 1,
4840
- +match[4] || 0,
4841
- +(match[5] || 0) - timeOffset,
4842
- +match[6] || 0,
4843
- +match[7] || 0
4844
- );
4831
+ // Use local time when no timezone offset specifed.
4832
+ if (!match[8]) {
4833
+ // match[n] can only be string or undefined.
4834
+ // But take care of '12' + 1 => '121'.
4835
+ return new Date(
4836
+ +match[1],
4837
+ +(match[2] || 1) - 1,
4838
+ +match[3] || 1,
4839
+ +match[4] || 0,
4840
+ +(match[5] || 0),
4841
+ +match[6] || 0,
4842
+ +match[7] || 0
4843
+ );
4844
+ }
4845
+ // Timezoneoffset of Javascript Date has considered DST (Daylight Saving Time,
4846
+ // https://tc39.github.io/ecma262/#sec-daylight-saving-time-adjustment).
4847
+ // For example, system timezone is set as "Time Zone: America/Toronto",
4848
+ // then these code will get different result:
4849
+ // `new Date(1478411999999).getTimezoneOffset(); // get 240`
4850
+ // `new Date(1478412000000).getTimezoneOffset(); // get 300`
4851
+ // So we should not use `new Date`, but use `Date.UTC`.
4852
+ else {
4853
+ var hour = +match[4] || 0;
4854
+ if (match[8].toUpperCase() !== 'Z') {
4855
+ hour -= match[8].slice(0, 3);
4856
+ }
4857
+ return new Date(Date.UTC(
4858
+ +match[1],
4859
+ +(match[2] || 1) - 1,
4860
+ +match[3] || 1,
4861
+ hour,
4862
+ +(match[5] || 0),
4863
+ +match[6] || 0,
4864
+ +match[7] || 0
4865
+ ));
4866
+ }
4845
4867
  }
4846
4868
  else if (value == null) {
4847
4869
  return new Date(NaN);
@@ -7269,10 +7291,10 @@ return /******/ (function(modules) { // webpackBootstrap
7269
7291
 
7270
7292
  var pathTool = __webpack_require__(21);
7271
7293
  var Path = __webpack_require__(22);
7272
- var colorTool = __webpack_require__(35);
7294
+ var colorTool = __webpack_require__(33);
7273
7295
  var matrix = __webpack_require__(11);
7274
7296
  var vector = __webpack_require__(10);
7275
- var Transformable = __webpack_require__(30);
7297
+ var Transformable = __webpack_require__(28);
7276
7298
  var BoundingRect = __webpack_require__(9);
7277
7299
 
7278
7300
  var round = Math.round;
@@ -7814,7 +7836,7 @@ return /******/ (function(modules) { // webpackBootstrap
7814
7836
  * for textFill, textStroke, textBackgroundColor, and textBorderColor.
7815
7837
  * If autoColor specified, it is used as default textFill.
7816
7838
  * useInsideStyle:
7817
- * `true`: Use inside style (textFill, textStroke, textLineWidth)
7839
+ * `true`: Use inside style (textFill, textStroke, textStrokeWidth)
7818
7840
  * if `textFill` is not specified.
7819
7841
  * `false`: Do not use inside style.
7820
7842
  * `null/undefined`: use inside style if `isRectText` is true and
@@ -7927,7 +7949,7 @@ return /******/ (function(modules) { // webpackBootstrap
7927
7949
  || globalTextStyle.color;
7928
7950
  textStyle.textStroke = getAutoColor(textStyleModel.getShallow('textBorderColor'), opt)
7929
7951
  || globalTextStyle.textBorderColor;
7930
- textStyle.textLineWidth = zrUtil.retrieve2(
7952
+ textStyle.textStrokeWidth = zrUtil.retrieve2(
7931
7953
  textStyleModel.getShallow('textBorderWidth'),
7932
7954
  globalTextStyle.textBorderWidth
7933
7955
  );
@@ -8011,13 +8033,13 @@ return /******/ (function(modules) { // webpackBootstrap
8011
8033
  insideRollback = {
8012
8034
  textFill: null,
8013
8035
  textStroke: textStyle.textStroke,
8014
- textLineWidth: textStyle.textLineWidth
8036
+ textStrokeWidth: textStyle.textStrokeWidth
8015
8037
  };
8016
8038
  textStyle.textFill = '#fff';
8017
8039
  // Consider text with #fff overflow its container.
8018
8040
  if (textStyle.textStroke == null) {
8019
8041
  textStyle.textStroke = opt.autoColor;
8020
- textStyle.textLineWidth == null && (textStyle.textLineWidth = 2);
8042
+ textStyle.textStrokeWidth == null && (textStyle.textStrokeWidth = 2);
8021
8043
  }
8022
8044
  }
8023
8045
 
@@ -8029,7 +8051,7 @@ return /******/ (function(modules) { // webpackBootstrap
8029
8051
  if (insideRollback) {
8030
8052
  style.textFill = insideRollback.textFill;
8031
8053
  style.textStroke = insideRollback.textStroke;
8032
- style.textLineWidth = insideRollback.textLineWidth;
8054
+ style.textStrokeWidth = insideRollback.textStrokeWidth;
8033
8055
  }
8034
8056
  }
8035
8057
 
@@ -9104,8 +9126,8 @@ return /******/ (function(modules) { // webpackBootstrap
9104
9126
 
9105
9127
  var Style = __webpack_require__(24);
9106
9128
 
9107
- var Element = __webpack_require__(27);
9108
- var RectText = __webpack_require__(38);
9129
+ var Element = __webpack_require__(25);
9130
+ var RectText = __webpack_require__(36);
9109
9131
  // var Stateful = require('./mixin/Stateful');
9110
9132
 
9111
9133
  /**
@@ -9364,15 +9386,13 @@ return /******/ (function(modules) { // webpackBootstrap
9364
9386
 
9365
9387
  /***/ }),
9366
9388
  /* 24 */
9367
- /***/ (function(module, exports, __webpack_require__) {
9389
+ /***/ (function(module, exports) {
9368
9390
 
9369
9391
  /**
9370
9392
  * @module zrender/graphic/Style
9371
9393
  */
9372
9394
 
9373
9395
 
9374
- var textHelper = __webpack_require__(25);
9375
-
9376
9396
  var STYLE_COMMON_PROPS = [
9377
9397
  ['shadowBlur', 0], ['shadowOffsetX', 0], ['shadowOffsetY', 0], ['shadowColor', '#000'],
9378
9398
  ['lineCap', 'butt'], ['lineJoin', 'miter'], ['miterLimit', 10]
@@ -9562,11 +9582,11 @@ return /******/ (function(modules) { // webpackBootstrap
9562
9582
  /**
9563
9583
  * textStroke may be set as some color as a default
9564
9584
  * value in upper applicaion, where the default value
9565
- * of textLineWidth should be 0 to make sure that
9585
+ * of textStrokeWidth should be 0 to make sure that
9566
9586
  * user can choose to do not use text stroke.
9567
9587
  * @type {number}
9568
9588
  */
9569
- textLineWidth: 0,
9589
+ textStrokeWidth: 0,
9570
9590
 
9571
9591
  /**
9572
9592
  * @type {number}
@@ -9846,597 +9866,16 @@ return /******/ (function(modules) { // webpackBootstrap
9846
9866
  /* 25 */
9847
9867
  /***/ (function(module, exports, __webpack_require__) {
9848
9868
 
9849
-
9850
-
9851
- var textContain = __webpack_require__(8);
9852
- var util = __webpack_require__(4);
9853
- var roundRectHelper = __webpack_require__(26);
9854
- var imageHelper = __webpack_require__(12);
9855
-
9856
- var retrieve3 = util.retrieve3;
9857
- var retrieve2 = util.retrieve2;
9858
-
9859
- // TODO: Have not support 'start', 'end' yet.
9860
- var VALID_TEXT_ALIGN = {left: 1, right: 1, center: 1};
9861
- var VALID_TEXT_VERTICAL_ALIGN = {top: 1, bottom: 1, middle: 1};
9862
-
9863
- var helper = {};
9864
-
9865
- /**
9866
- * @param {module:zrender/graphic/Style} style
9867
- * @return {module:zrender/graphic/Style} The input style.
9868
- */
9869
- helper.normalizeTextStyle = function (style) {
9870
- normalizeStyle(style);
9871
- util.each(style.rich, normalizeStyle);
9872
- return style;
9873
- };
9874
-
9875
- function normalizeStyle(style) {
9876
- if (style) {
9877
-
9878
- style.font = textContain.makeFont(style);
9879
-
9880
- var textAlign = style.textAlign;
9881
- textAlign === 'middle' && (textAlign = 'center');
9882
- style.textAlign = (
9883
- textAlign == null || VALID_TEXT_ALIGN[textAlign]
9884
- ) ? textAlign : 'left';
9885
-
9886
- // Compatible with textBaseline.
9887
- var textVerticalAlign = style.textVerticalAlign || style.textBaseline;
9888
- textVerticalAlign === 'center' && (textVerticalAlign = 'middle');
9889
- style.textVerticalAlign = (
9890
- textVerticalAlign == null || VALID_TEXT_VERTICAL_ALIGN[textVerticalAlign]
9891
- ) ? textVerticalAlign : 'top';
9892
-
9893
- var textPadding = style.textPadding;
9894
- if (textPadding) {
9895
- style.textPadding = util.normalizeCssArray(style.textPadding);
9896
- }
9897
- }
9898
- }
9899
-
9900
- /**
9901
- * @param {CanvasRenderingContext2D} ctx
9902
- * @param {string} text
9903
- * @param {module:zrender/graphic/Style} style
9904
- * @param {Object|boolean} [rect] {x, y, width, height}
9905
- * If set false, rect text is not used.
9906
- */
9907
- helper.renderText = function (hostEl, ctx, text, style, rect) {
9908
- style.rich
9909
- ? renderRichText(hostEl, ctx, text, style, rect)
9910
- : renderPlainText(hostEl, ctx, text, style, rect);
9911
- };
9912
-
9913
- function renderPlainText(hostEl, ctx, text, style, rect) {
9914
- var font = setCtx(ctx, 'font', style.font || textContain.DEFAULT_FONT);
9915
-
9916
- var textPadding = style.textPadding;
9917
-
9918
- var contentBlock = hostEl.__textCotentBlock;
9919
- if (!contentBlock || hostEl.__dirty) {
9920
- contentBlock = hostEl.__textCotentBlock = textContain.parsePlainText(
9921
- text, font, textPadding, style.truncate
9922
- );
9923
- }
9924
-
9925
- var outerHeight = contentBlock.outerHeight;
9926
-
9927
- var textLines = contentBlock.lines;
9928
- var lineHeight = contentBlock.lineHeight;
9929
-
9930
- var boxPos = getBoxPosition(outerHeight, style, rect);
9931
- var baseX = boxPos.baseX;
9932
- var baseY = boxPos.baseY;
9933
- var textAlign = boxPos.textAlign;
9934
- var textVerticalAlign = boxPos.textVerticalAlign;
9935
-
9936
- // Origin of textRotation should be the base point of text drawing.
9937
- applyTextRotation(ctx, style, rect, baseX, baseY);
9938
-
9939
- var boxY = textContain.adjustTextY(baseY, outerHeight, textVerticalAlign);
9940
- var textX = baseX;
9941
- var textY = boxY;
9942
-
9943
- var needDrawBg = needDrawBackground(style);
9944
- if (needDrawBg || textPadding) {
9945
- // Consider performance, do not call getTextWidth util necessary.
9946
- var textWidth = textContain.getWidth(text, font);
9947
- var outerWidth = textWidth;
9948
- textPadding && (outerWidth += textPadding[1] + textPadding[3]);
9949
- var boxX = textContain.adjustTextX(baseX, outerWidth, textAlign);
9950
-
9951
- needDrawBg && drawBackground(hostEl, ctx, style, boxX, boxY, outerWidth, outerHeight);
9952
-
9953
- if (textPadding) {
9954
- textX = getTextXForPadding(baseX, textAlign, textPadding);
9955
- textY += textPadding[0];
9956
- }
9957
- }
9958
-
9959
- setCtx(ctx, 'textAlign', textAlign || 'left');
9960
- // Force baseline to be "middle". Otherwise, if using "top", the
9961
- // text will offset downward a little bit in font "Microsoft YaHei".
9962
- setCtx(ctx, 'textBaseline', 'middle');
9963
-
9964
- // Always set shadowBlur and shadowOffset to avoid leak from displayable.
9965
- setCtx(ctx, 'shadowBlur', style.textShadowBlur || 0);
9966
- setCtx(ctx, 'shadowColor', style.textShadowColor || 'transparent');
9967
- setCtx(ctx, 'shadowOffsetX', style.textShadowOffsetX || 0);
9968
- setCtx(ctx, 'shadowOffsetY', style.textShadowOffsetY || 0);
9969
-
9970
- // `textBaseline` is set as 'middle'.
9971
- textY += lineHeight / 2;
9972
-
9973
- var textLineWidth = style.textLineWidth;
9974
- var textStroke = getStroke(style.textStroke, textLineWidth);
9975
- var textFill = getFill(style.textFill);
9976
-
9977
- if (textStroke) {
9978
- setCtx(ctx, 'lineWidth', textLineWidth);
9979
- setCtx(ctx, 'strokeStyle', textStroke);
9980
- }
9981
- if (textFill) {
9982
- setCtx(ctx, 'fillStyle', textFill);
9983
- }
9984
-
9985
- for (var i = 0; i < textLines.length; i++) {
9986
- // Fill after stroke so the outline will not cover the main part.
9987
- textStroke && ctx.strokeText(textLines[i], textX, textY);
9988
- textFill && ctx.fillText(textLines[i], textX, textY);
9989
- textY += lineHeight;
9990
- }
9991
- }
9992
-
9993
- function renderRichText(hostEl, ctx, text, style, rect) {
9994
- var contentBlock = hostEl.__textCotentBlock;
9995
-
9996
- if (!contentBlock || hostEl.__dirty) {
9997
- contentBlock = hostEl.__textCotentBlock = textContain.parseRichText(text, style);
9998
- }
9999
-
10000
- drawRichText(hostEl, ctx, contentBlock, style, rect);
10001
- }
10002
-
10003
- function drawRichText(hostEl, ctx, contentBlock, style, rect) {
10004
- var contentWidth = contentBlock.width;
10005
- var outerWidth = contentBlock.outerWidth;
10006
- var outerHeight = contentBlock.outerHeight;
10007
- var textPadding = style.textPadding;
10008
-
10009
- var boxPos = getBoxPosition(outerHeight, style, rect);
10010
- var baseX = boxPos.baseX;
10011
- var baseY = boxPos.baseY;
10012
- var textAlign = boxPos.textAlign;
10013
- var textVerticalAlign = boxPos.textVerticalAlign;
10014
-
10015
- // Origin of textRotation should be the base point of text drawing.
10016
- applyTextRotation(ctx, style, rect, baseX, baseY);
10017
-
10018
- var boxX = textContain.adjustTextX(baseX, outerWidth, textAlign);
10019
- var boxY = textContain.adjustTextY(baseY, outerHeight, textVerticalAlign);
10020
- var xLeft = boxX;
10021
- var lineTop = boxY;
10022
- if (textPadding) {
10023
- xLeft += textPadding[3];
10024
- lineTop += textPadding[0];
10025
- }
10026
- var xRight = xLeft + contentWidth;
10027
-
10028
- needDrawBackground(style) && drawBackground(
10029
- hostEl, ctx, style, boxX, boxY, outerWidth, outerHeight
10030
- );
10031
-
10032
- for (var i = 0; i < contentBlock.lines.length; i++) {
10033
- var line = contentBlock.lines[i];
10034
- var tokens = line.tokens;
10035
- var tokenCount = tokens.length;
10036
- var lineHeight = line.lineHeight;
10037
- var usedWidth = line.width;
10038
-
10039
- var leftIndex = 0;
10040
- var lineXLeft = xLeft;
10041
- var lineXRight = xRight;
10042
- var rightIndex = tokenCount - 1;
10043
- var token;
10044
-
10045
- while (
10046
- leftIndex < tokenCount
10047
- && (token = tokens[leftIndex], !token.textAlign || token.textAlign === 'left')
10048
- ) {
10049
- placeToken(hostEl, ctx, token, style, lineHeight, lineTop, lineXLeft, 'left');
10050
- usedWidth -= token.width;
10051
- lineXLeft += token.width;
10052
- leftIndex++;
10053
- }
10054
-
10055
- while (
10056
- rightIndex >= 0
10057
- && (token = tokens[rightIndex], token.textAlign === 'right')
10058
- ) {
10059
- placeToken(hostEl, ctx, token, style, lineHeight, lineTop, lineXRight, 'right');
10060
- usedWidth -= token.width;
10061
- lineXRight -= token.width;
10062
- rightIndex--;
10063
- }
10064
-
10065
- // The other tokens are placed as textAlign 'center' if there is enough space.
10066
- lineXLeft += (contentWidth - (lineXLeft - xLeft) - (xRight - lineXRight) - usedWidth) / 2;
10067
- while (leftIndex <= rightIndex) {
10068
- token = tokens[leftIndex];
10069
- // Consider width specified by user, use 'center' rather than 'left'.
10070
- placeToken(hostEl, ctx, token, style, lineHeight, lineTop, lineXLeft + token.width / 2, 'center');
10071
- lineXLeft += token.width;
10072
- leftIndex++;
10073
- }
10074
-
10075
- lineTop += lineHeight;
10076
- }
10077
- }
10078
-
10079
- function applyTextRotation(ctx, style, rect, x, y) {
10080
- // textRotation only apply in RectText.
10081
- if (rect && style.textRotation) {
10082
- var origin = style.textOrigin;
10083
- if (origin === 'center') {
10084
- x = rect.width / 2 + rect.x;
10085
- y = rect.height / 2 + rect.y;
10086
- }
10087
- else if (origin) {
10088
- x = origin[0] + rect.x;
10089
- y = origin[1] + rect.y;
10090
- }
10091
-
10092
- ctx.translate(x, y);
10093
- // Positive: anticlockwise
10094
- ctx.rotate(-style.textRotation);
10095
- ctx.translate(-x, -y);
10096
- }
10097
- }
10098
-
10099
- function placeToken(hostEl, ctx, token, style, lineHeight, lineTop, x, textAlign) {
10100
- var tokenStyle = style.rich[token.styleName] || {};
10101
-
10102
- // 'ctx.textBaseline' is always set as 'middle', for sake of
10103
- // the bias of "Microsoft YaHei".
10104
- var textVerticalAlign = token.textVerticalAlign;
10105
- var y = lineTop + lineHeight / 2;
10106
- if (textVerticalAlign === 'top') {
10107
- y = lineTop + token.height / 2;
10108
- }
10109
- else if (textVerticalAlign === 'bottom') {
10110
- y = lineTop + lineHeight - token.height / 2;
10111
- }
10112
-
10113
- !token.isLineHolder && needDrawBackground(tokenStyle) && drawBackground(
10114
- hostEl,
10115
- ctx,
10116
- tokenStyle,
10117
- textAlign === 'right'
10118
- ? x - token.width
10119
- : textAlign === 'center'
10120
- ? x - token.width / 2
10121
- : x,
10122
- y - token.height / 2,
10123
- token.width,
10124
- token.height
10125
- );
10126
-
10127
- var textPadding = token.textPadding;
10128
- if (textPadding) {
10129
- x = getTextXForPadding(x, textAlign, textPadding);
10130
- y -= token.height / 2 - textPadding[2] - token.textHeight / 2;
10131
- }
10132
-
10133
- setCtx(ctx, 'shadowBlur', retrieve3(tokenStyle.textShadowBlur, style.textShadowBlur, 0));
10134
- setCtx(ctx, 'shadowColor', tokenStyle.textShadowColor || style.textShadowColor || 'transparent');
10135
- setCtx(ctx, 'shadowOffsetX', retrieve3(tokenStyle.textShadowOffsetX, style.textShadowOffsetX, 0));
10136
- setCtx(ctx, 'shadowOffsetY', retrieve3(tokenStyle.textShadowOffsetY, style.textShadowOffsetY, 0));
10137
-
10138
- setCtx(ctx, 'textAlign', textAlign);
10139
- // Force baseline to be "middle". Otherwise, if using "top", the
10140
- // text will offset downward a little bit in font "Microsoft YaHei".
10141
- setCtx(ctx, 'textBaseline', 'middle');
10142
-
10143
- setCtx(ctx, 'font', token.font || textContain.DEFAULT_FONT);
10144
-
10145
- var textStroke = getStroke(tokenStyle.textStroke || style.textStroke, textLineWidth);
10146
- var textFill = getFill(tokenStyle.textFill || style.textFill);
10147
- var textLineWidth = retrieve2(tokenStyle.textLineWidth, style.textLineWidth);
10148
-
10149
- // Fill after stroke so the outline will not cover the main part.
10150
- if (textStroke) {
10151
- setCtx(ctx, 'lineWidth', textLineWidth);
10152
- setCtx(ctx, 'strokeStyle', textStroke);
10153
- ctx.strokeText(token.text, x, y);
10154
- }
10155
- if (textFill) {
10156
- setCtx(ctx, 'fillStyle', textFill);
10157
- ctx.fillText(token.text, x, y);
10158
- }
10159
- }
10160
-
10161
- function needDrawBackground(style) {
10162
- return style.textBackgroundColor
10163
- || (style.textBorderWidth && style.textBorderColor);
10164
- }
10165
-
10166
- // style: {textBackgroundColor, textBorderWidth, textBorderColor, textBorderRadius}
10167
- // shape: {x, y, width, height}
10168
- function drawBackground(hostEl, ctx, style, x, y, width, height) {
10169
- var textBackgroundColor = style.textBackgroundColor;
10170
- var textBorderWidth = style.textBorderWidth;
10171
- var textBorderColor = style.textBorderColor;
10172
- var isPlainBg = util.isString(textBackgroundColor);
10173
-
10174
- setCtx(ctx, 'shadowBlur', style.textBoxShadowBlur || 0);
10175
- setCtx(ctx, 'shadowColor', style.textBoxShadowColor || 'transparent');
10176
- setCtx(ctx, 'shadowOffsetX', style.textBoxShadowOffsetX || 0);
10177
- setCtx(ctx, 'shadowOffsetY', style.textBoxShadowOffsetY || 0);
10178
-
10179
- if (isPlainBg || (textBorderWidth && textBorderColor)) {
10180
- ctx.beginPath();
10181
- var textBorderRadius = style.textBorderRadius;
10182
- if (!textBorderRadius) {
10183
- ctx.rect(x, y, width, height);
10184
- }
10185
- else {
10186
- roundRectHelper.buildPath(ctx, {
10187
- x: x, y: y, width: width, height: height, r: textBorderRadius
10188
- });
10189
- }
10190
- ctx.closePath();
10191
- }
10192
-
10193
- if (isPlainBg) {
10194
- setCtx(ctx, 'fillStyle', textBackgroundColor);
10195
- ctx.fill();
10196
- }
10197
- else if (util.isObject(textBackgroundColor)) {
10198
- var image = textBackgroundColor.image;
10199
-
10200
- image = imageHelper.createOrUpdateImage(
10201
- image, null, hostEl, onBgImageLoaded, textBackgroundColor
10202
- );
10203
- if (image && imageHelper.isImageReady(image)) {
10204
- ctx.drawImage(image, x, y, width, height);
10205
- }
10206
- }
10207
-
10208
- if (textBorderWidth && textBorderColor) {
10209
- setCtx(ctx, 'lineWidth', textBorderWidth);
10210
- setCtx(ctx, 'strokeStyle', textBorderColor);
10211
- ctx.stroke();
10212
- }
10213
- }
10214
-
10215
- function onBgImageLoaded(image, textBackgroundColor) {
10216
- // Replace image, so that `contain/text.js#parseRichText`
10217
- // will get correct result in next tick.
10218
- textBackgroundColor.image = image;
10219
- }
10220
-
10221
- function getBoxPosition(blockHeiht, style, rect) {
10222
- var baseX = style.x || 0;
10223
- var baseY = style.y || 0;
10224
- var textAlign = style.textAlign;
10225
- var textVerticalAlign = style.textVerticalAlign;
10226
-
10227
- // Text position represented by coord
10228
- if (rect) {
10229
- var textPosition = style.textPosition;
10230
- if (textPosition instanceof Array) {
10231
- // Percent
10232
- baseX = rect.x + parsePercent(textPosition[0], rect.width);
10233
- baseY = rect.y + parsePercent(textPosition[1], rect.height);
10234
- }
10235
- else {
10236
- var res = textContain.adjustTextPositionOnRect(
10237
- textPosition, rect, style.textDistance
10238
- );
10239
- baseX = res.x;
10240
- baseY = res.y;
10241
- // Default align and baseline when has textPosition
10242
- textAlign = textAlign || res.textAlign;
10243
- textVerticalAlign = textVerticalAlign || res.textVerticalAlign;
10244
- }
10245
-
10246
- // textOffset is only support in RectText, otherwise
10247
- // we have to adjust boundingRect for textOffset.
10248
- var textOffset = style.textOffset;
10249
- if (textOffset) {
10250
- baseX += textOffset[0];
10251
- baseY += textOffset[1];
10252
- }
10253
- }
10254
-
10255
- return {
10256
- baseX: baseX,
10257
- baseY: baseY,
10258
- textAlign: textAlign,
10259
- textVerticalAlign: textVerticalAlign
10260
- };
10261
- }
10262
-
10263
- function setCtx(ctx, prop, value) {
10264
- // FIXME ??? performance try
10265
- // if (ctx.__currentValues[prop] !== value) {
10266
- ctx[prop] = ctx.__currentValues[prop] = value;
10267
- // }
10268
- return ctx[prop];
10269
- }
10270
-
10271
- /**
10272
- * @param {string} [stroke] If specified, do not check style.textStroke.
10273
- * @param {string} [lineWidth] If specified, do not check style.textStroke.
10274
- * @param {number} style
10275
- */
10276
- var getStroke = helper.getStroke = function (stroke, lineWidth) {
10277
- return (stroke == null || lineWidth <= 0 || stroke === 'transparent' || stroke === 'none')
10278
- ? null
10279
- // TODO pattern and gradient?
10280
- : (stroke.image || stroke.colorStops)
10281
- ? '#000'
10282
- : stroke;
10283
- };
10284
-
10285
- var getFill = helper.getFill = function (fill) {
10286
- return (fill == null || fill === 'none')
10287
- ? null
10288
- // TODO pattern and gradient?
10289
- : (fill.image || fill.colorStops)
10290
- ? '#000'
10291
- : fill;
10292
- };
10293
-
10294
- function parsePercent(value, maxValue) {
10295
- if (typeof value === 'string') {
10296
- if (value.lastIndexOf('%') >= 0) {
10297
- return parseFloat(value) / 100 * maxValue;
10298
- }
10299
- return parseFloat(value);
10300
- }
10301
- return value;
10302
- }
10303
-
10304
- function getTextXForPadding(x, textAlign, textPadding) {
10305
- return textAlign === 'right'
10306
- ? (x - textPadding[1])
10307
- : textAlign === 'center'
10308
- ? (x + textPadding[3] / 2 - textPadding[1] / 2)
10309
- : (x + textPadding[3]);
10310
- }
10311
-
10312
- /**
10313
- * @param {string} text
10314
- * @param {module:zrender/Style} style
10315
- * @return {boolean}
10316
- */
10317
- helper.needDrawText = function (text, style) {
10318
- return text != null
10319
- && (text
10320
- || style.textBackgroundColor
10321
- || (style.textBorderWidth && style.textBorderColor)
10322
- || style.textPadding
10323
- );
10324
- };
10325
-
10326
- module.exports = helper;
10327
-
10328
-
10329
-
10330
-
10331
- /***/ }),
10332
- /* 26 */
10333
- /***/ (function(module, exports) {
10334
-
10335
-
10336
-
10337
- module.exports = {
10338
- buildPath: function (ctx, shape) {
10339
- var x = shape.x;
10340
- var y = shape.y;
10341
- var width = shape.width;
10342
- var height = shape.height;
10343
- var r = shape.r;
10344
- var r1;
10345
- var r2;
10346
- var r3;
10347
- var r4;
10348
-
10349
- // Convert width and height to positive for better borderRadius
10350
- if (width < 0) {
10351
- x = x + width;
10352
- width = -width;
10353
- }
10354
- if (height < 0) {
10355
- y = y + height;
10356
- height = -height;
10357
- }
10358
-
10359
- if (typeof r === 'number') {
10360
- r1 = r2 = r3 = r4 = r;
10361
- }
10362
- else if (r instanceof Array) {
10363
- if (r.length === 1) {
10364
- r1 = r2 = r3 = r4 = r[0];
10365
- }
10366
- else if (r.length === 2) {
10367
- r1 = r3 = r[0];
10368
- r2 = r4 = r[1];
10369
- }
10370
- else if (r.length === 3) {
10371
- r1 = r[0];
10372
- r2 = r4 = r[1];
10373
- r3 = r[2];
10374
- }
10375
- else {
10376
- r1 = r[0];
10377
- r2 = r[1];
10378
- r3 = r[2];
10379
- r4 = r[3];
10380
- }
10381
- }
10382
- else {
10383
- r1 = r2 = r3 = r4 = 0;
10384
- }
10385
-
10386
- var total;
10387
- if (r1 + r2 > width) {
10388
- total = r1 + r2;
10389
- r1 *= width / total;
10390
- r2 *= width / total;
10391
- }
10392
- if (r3 + r4 > width) {
10393
- total = r3 + r4;
10394
- r3 *= width / total;
10395
- r4 *= width / total;
10396
- }
10397
- if (r2 + r3 > height) {
10398
- total = r2 + r3;
10399
- r2 *= height / total;
10400
- r3 *= height / total;
10401
- }
10402
- if (r1 + r4 > height) {
10403
- total = r1 + r4;
10404
- r1 *= height / total;
10405
- r4 *= height / total;
10406
- }
10407
- ctx.moveTo(x + r1, y);
10408
- ctx.lineTo(x + width - r2, y);
10409
- r2 !== 0 && ctx.quadraticCurveTo(
10410
- x + width, y, x + width, y + r2
10411
- );
10412
- ctx.lineTo(x + width, y + height - r3);
10413
- r3 !== 0 && ctx.quadraticCurveTo(
10414
- x + width, y + height, x + width - r3, y + height
10415
- );
10416
- ctx.lineTo(x + r4, y + height);
10417
- r4 !== 0 && ctx.quadraticCurveTo(
10418
- x, y + height, x, y + height - r4
10419
- );
10420
- ctx.lineTo(x, y + r1);
10421
- r1 !== 0 && ctx.quadraticCurveTo(x, y, x + r1, y);
10422
- }
10423
- };
10424
-
10425
-
10426
- /***/ }),
10427
- /* 27 */
10428
- /***/ (function(module, exports, __webpack_require__) {
10429
-
10430
9869
  'use strict';
10431
9870
  /**
10432
9871
  * @module zrender/Element
10433
9872
  */
10434
9873
 
10435
9874
 
10436
- var guid = __webpack_require__(28);
10437
- var Eventful = __webpack_require__(29);
10438
- var Transformable = __webpack_require__(30);
10439
- var Animatable = __webpack_require__(31);
9875
+ var guid = __webpack_require__(26);
9876
+ var Eventful = __webpack_require__(27);
9877
+ var Transformable = __webpack_require__(28);
9878
+ var Animatable = __webpack_require__(29);
10440
9879
  var zrUtil = __webpack_require__(4);
10441
9880
 
10442
9881
  /**
@@ -10692,7 +10131,7 @@ return /******/ (function(modules) { // webpackBootstrap
10692
10131
 
10693
10132
 
10694
10133
  /***/ }),
10695
- /* 28 */
10134
+ /* 26 */
10696
10135
  /***/ (function(module, exports) {
10697
10136
 
10698
10137
  /**
@@ -10711,7 +10150,7 @@ return /******/ (function(modules) { // webpackBootstrap
10711
10150
 
10712
10151
 
10713
10152
  /***/ }),
10714
- /* 29 */
10153
+ /* 27 */
10715
10154
  /***/ (function(module, exports) {
10716
10155
 
10717
10156
  /**
@@ -11019,7 +10458,7 @@ return /******/ (function(modules) { // webpackBootstrap
11019
10458
 
11020
10459
 
11021
10460
  /***/ }),
11022
- /* 30 */
10461
+ /* 28 */
11023
10462
  /***/ (function(module, exports, __webpack_require__) {
11024
10463
 
11025
10464
  'use strict';
@@ -11287,7 +10726,7 @@ return /******/ (function(modules) { // webpackBootstrap
11287
10726
 
11288
10727
 
11289
10728
  /***/ }),
11290
- /* 31 */
10729
+ /* 29 */
11291
10730
  /***/ (function(module, exports, __webpack_require__) {
11292
10731
 
11293
10732
  'use strict';
@@ -11296,12 +10735,12 @@ return /******/ (function(modules) { // webpackBootstrap
11296
10735
  */
11297
10736
 
11298
10737
 
11299
- var Animator = __webpack_require__(32);
10738
+ var Animator = __webpack_require__(30);
11300
10739
  var util = __webpack_require__(4);
11301
10740
  var isString = util.isString;
11302
10741
  var isFunction = util.isFunction;
11303
10742
  var isObject = util.isObject;
11304
- var log = __webpack_require__(36);
10743
+ var log = __webpack_require__(34);
11305
10744
 
11306
10745
  /**
11307
10746
  * @alias modue:zrender/mixin/Animatable
@@ -11566,7 +11005,7 @@ return /******/ (function(modules) { // webpackBootstrap
11566
11005
 
11567
11006
 
11568
11007
  /***/ }),
11569
- /* 32 */
11008
+ /* 30 */
11570
11009
  /***/ (function(module, exports, __webpack_require__) {
11571
11010
 
11572
11011
  /**
@@ -11574,8 +11013,8 @@ return /******/ (function(modules) { // webpackBootstrap
11574
11013
  */
11575
11014
 
11576
11015
 
11577
- var Clip = __webpack_require__(33);
11578
- var color = __webpack_require__(35);
11016
+ var Clip = __webpack_require__(31);
11017
+ var color = __webpack_require__(33);
11579
11018
  var util = __webpack_require__(4);
11580
11019
  var isArrayLike = util.isArrayLike;
11581
11020
 
@@ -12226,7 +11665,7 @@ return /******/ (function(modules) { // webpackBootstrap
12226
11665
 
12227
11666
 
12228
11667
  /***/ }),
12229
- /* 33 */
11668
+ /* 31 */
12230
11669
  /***/ (function(module, exports, __webpack_require__) {
12231
11670
 
12232
11671
  /**
@@ -12245,7 +11684,7 @@ return /******/ (function(modules) { // webpackBootstrap
12245
11684
  */
12246
11685
 
12247
11686
 
12248
- var easingFuncs = __webpack_require__(34);
11687
+ var easingFuncs = __webpack_require__(32);
12249
11688
 
12250
11689
  function Clip(options) {
12251
11690
 
@@ -12355,7 +11794,7 @@ return /******/ (function(modules) { // webpackBootstrap
12355
11794
 
12356
11795
 
12357
11796
  /***/ }),
12358
- /* 34 */
11797
+ /* 32 */
12359
11798
  /***/ (function(module, exports) {
12360
11799
 
12361
11800
  /**
@@ -12706,7 +12145,7 @@ return /******/ (function(modules) { // webpackBootstrap
12706
12145
 
12707
12146
 
12708
12147
  /***/ }),
12709
- /* 35 */
12148
+ /* 33 */
12710
12149
  /***/ (function(module, exports, __webpack_require__) {
12711
12150
 
12712
12151
  /**
@@ -12841,7 +12280,7 @@ return /******/ (function(modules) { // webpackBootstrap
12841
12280
  return m1;
12842
12281
  }
12843
12282
 
12844
- function lerp(a, b, p) {
12283
+ function lerpNumber(a, b, p) {
12845
12284
  return a + (b - a) * p;
12846
12285
  }
12847
12286
 
@@ -13107,13 +12546,13 @@ return /******/ (function(modules) { // webpackBootstrap
13107
12546
  }
13108
12547
 
13109
12548
  /**
13110
- * Map value to color. Faster than mapToColor methods because color is represented by rgba array.
12549
+ * Map value to color. Faster than lerp methods because color is represented by rgba array.
13111
12550
  * @param {number} normalizedValue A float between 0 and 1.
13112
12551
  * @param {Array.<Array.<number>>} colors List of rgba color array
13113
12552
  * @param {Array.<number>} [out] Mapped gba color array
13114
12553
  * @return {Array.<number>} will be null/undefined if input illegal.
13115
12554
  */
13116
- function fastMapToColor(normalizedValue, colors, out) {
12555
+ function fastLerp(normalizedValue, colors, out) {
13117
12556
  if (!(colors && colors.length)
13118
12557
  || !(normalizedValue >= 0 && normalizedValue <= 1)
13119
12558
  ) {
@@ -13128,13 +12567,14 @@ return /******/ (function(modules) { // webpackBootstrap
13128
12567
  var leftColor = colors[leftIndex];
13129
12568
  var rightColor = colors[rightIndex];
13130
12569
  var dv = value - leftIndex;
13131
- out[0] = clampCssByte(lerp(leftColor[0], rightColor[0], dv));
13132
- out[1] = clampCssByte(lerp(leftColor[1], rightColor[1], dv));
13133
- out[2] = clampCssByte(lerp(leftColor[2], rightColor[2], dv));
13134
- out[3] = clampCssFloat(lerp(leftColor[3], rightColor[3], dv));
12570
+ out[0] = clampCssByte(lerpNumber(leftColor[0], rightColor[0], dv));
12571
+ out[1] = clampCssByte(lerpNumber(leftColor[1], rightColor[1], dv));
12572
+ out[2] = clampCssByte(lerpNumber(leftColor[2], rightColor[2], dv));
12573
+ out[3] = clampCssFloat(lerpNumber(leftColor[3], rightColor[3], dv));
13135
12574
 
13136
12575
  return out;
13137
12576
  }
12577
+
13138
12578
  /**
13139
12579
  * @param {number} normalizedValue A float between 0 and 1.
13140
12580
  * @param {Array.<string>} colors Color list.
@@ -13143,7 +12583,7 @@ return /******/ (function(modules) { // webpackBootstrap
13143
12583
  * return {color: ..., leftIndex: ..., rightIndex: ..., value: ...},
13144
12584
  * @memberOf module:zrender/util/color
13145
12585
  */
13146
- function mapToColor(normalizedValue, colors, fullOutput) {
12586
+ function lerp(normalizedValue, colors, fullOutput) {
13147
12587
  if (!(colors && colors.length)
13148
12588
  || !(normalizedValue >= 0 && normalizedValue <= 1)
13149
12589
  ) {
@@ -13159,10 +12599,10 @@ return /******/ (function(modules) { // webpackBootstrap
13159
12599
 
13160
12600
  var color = stringify(
13161
12601
  [
13162
- clampCssByte(lerp(leftColor[0], rightColor[0], dv)),
13163
- clampCssByte(lerp(leftColor[1], rightColor[1], dv)),
13164
- clampCssByte(lerp(leftColor[2], rightColor[2], dv)),
13165
- clampCssFloat(lerp(leftColor[3], rightColor[3], dv))
12602
+ clampCssByte(lerpNumber(leftColor[0], rightColor[0], dv)),
12603
+ clampCssByte(lerpNumber(leftColor[1], rightColor[1], dv)),
12604
+ clampCssByte(lerpNumber(leftColor[2], rightColor[2], dv)),
12605
+ clampCssFloat(lerpNumber(leftColor[3], rightColor[3], dv))
13166
12606
  ],
13167
12607
  'rgba'
13168
12608
  );
@@ -13233,8 +12673,10 @@ return /******/ (function(modules) { // webpackBootstrap
13233
12673
  parse: parse,
13234
12674
  lift: lift,
13235
12675
  toHex: toHex,
13236
- fastMapToColor: fastMapToColor,
13237
- mapToColor: mapToColor,
12676
+ fastLerp: fastLerp,
12677
+ fastMapToColor: fastLerp, // Deprecated
12678
+ lerp: lerp,
12679
+ mapToColor: lerp, // Deprecated
13238
12680
  modifyHSL: modifyHSL,
13239
12681
  modifyAlpha: modifyAlpha,
13240
12682
  stringify: stringify
@@ -13243,145 +12685,727 @@ return /******/ (function(modules) { // webpackBootstrap
13243
12685
 
13244
12686
 
13245
12687
 
13246
- /***/ }),
13247
- /* 36 */
13248
- /***/ (function(module, exports, __webpack_require__) {
12688
+ /***/ }),
12689
+ /* 34 */
12690
+ /***/ (function(module, exports, __webpack_require__) {
12691
+
12692
+
12693
+ var config = __webpack_require__(35);
12694
+
12695
+ /**
12696
+ * @exports zrender/tool/log
12697
+ * @author Kener (@Kener-林峰, kener.linfeng@gmail.com)
12698
+ */
12699
+ module.exports = function() {
12700
+ if (config.debugMode === 0) {
12701
+ return;
12702
+ }
12703
+ else if (config.debugMode == 1) {
12704
+ for (var k in arguments) {
12705
+ throw new Error(arguments[k]);
12706
+ }
12707
+ }
12708
+ else if (config.debugMode > 1) {
12709
+ for (var k in arguments) {
12710
+ console.log(arguments[k]);
12711
+ }
12712
+ }
12713
+ };
12714
+
12715
+ /* for debug
12716
+ return function(mes) {
12717
+ document.getElementById('wrong-message').innerHTML =
12718
+ mes + ' ' + (new Date() - 0)
12719
+ + '<br/>'
12720
+ + document.getElementById('wrong-message').innerHTML;
12721
+ };
12722
+ */
12723
+
12724
+
12725
+
12726
+ /***/ }),
12727
+ /* 35 */
12728
+ /***/ (function(module, exports) {
12729
+
12730
+
12731
+ var dpr = 1;
12732
+ // If in browser environment
12733
+ if (typeof window !== 'undefined') {
12734
+ dpr = Math.max(window.devicePixelRatio || 1, 1);
12735
+ }
12736
+ /**
12737
+ * config默认配置项
12738
+ * @exports zrender/config
12739
+ * @author Kener (@Kener-林峰, kener.linfeng@gmail.com)
12740
+ */
12741
+ var config = {
12742
+ /**
12743
+ * debug日志选项:catchBrushException为true下有效
12744
+ * 0 : 不生成debug数据,发布用
12745
+ * 1 : 异常抛出,调试用
12746
+ * 2 : 控制台输出,调试用
12747
+ */
12748
+ debugMode: 0,
12749
+
12750
+ // retina 屏幕优化
12751
+ devicePixelRatio: dpr
12752
+ };
12753
+ module.exports = config;
12754
+
12755
+
12756
+
12757
+
12758
+ /***/ }),
12759
+ /* 36 */
12760
+ /***/ (function(module, exports, __webpack_require__) {
12761
+
12762
+ /**
12763
+ * Mixin for drawing text in a element bounding rect
12764
+ * @module zrender/mixin/RectText
12765
+ */
12766
+
12767
+
12768
+
12769
+ var textHelper = __webpack_require__(37);
12770
+ var BoundingRect = __webpack_require__(9);
12771
+
12772
+ var tmpRect = new BoundingRect();
12773
+
12774
+ var RectText = function () {};
12775
+
12776
+ RectText.prototype = {
12777
+
12778
+ constructor: RectText,
12779
+
12780
+ /**
12781
+ * Draw text in a rect with specified position.
12782
+ * @param {CanvasRenderingContext2D} ctx
12783
+ * @param {Object} rect Displayable rect
12784
+ */
12785
+ drawRectText: function (ctx, rect) {
12786
+ var style = this.style;
12787
+
12788
+ rect = style.textRect || rect;
12789
+
12790
+ // Optimize, avoid normalize every time.
12791
+ this.__dirty && textHelper.normalizeTextStyle(style, true);
12792
+
12793
+ var text = style.text;
12794
+
12795
+ // Convert to string
12796
+ text != null && (text += '');
12797
+
12798
+ if (!textHelper.needDrawText(text, style)) {
12799
+ return;
12800
+ }
12801
+
12802
+ // FIXME
12803
+ ctx.save();
12804
+
12805
+ // Transform rect to view space
12806
+ var transform = this.transform;
12807
+ if (!style.transformText) {
12808
+ if (transform) {
12809
+ tmpRect.copy(rect);
12810
+ tmpRect.applyTransform(transform);
12811
+ rect = tmpRect;
12812
+ }
12813
+ }
12814
+ else {
12815
+ this.setTransform(ctx);
12816
+ }
12817
+
12818
+ // transformText and textRotation can not be used at the same time.
12819
+ textHelper.renderText(this, ctx, text, style, rect);
12820
+
12821
+ ctx.restore();
12822
+ }
12823
+ };
12824
+
12825
+ module.exports = RectText;
12826
+
12827
+
12828
+ /***/ }),
12829
+ /* 37 */
12830
+ /***/ (function(module, exports, __webpack_require__) {
12831
+
12832
+
12833
+
12834
+ var textContain = __webpack_require__(8);
12835
+ var util = __webpack_require__(4);
12836
+ var roundRectHelper = __webpack_require__(38);
12837
+ var imageHelper = __webpack_require__(12);
12838
+
12839
+ var retrieve3 = util.retrieve3;
12840
+ var retrieve2 = util.retrieve2;
12841
+
12842
+ // TODO: Have not support 'start', 'end' yet.
12843
+ var VALID_TEXT_ALIGN = {left: 1, right: 1, center: 1};
12844
+ var VALID_TEXT_VERTICAL_ALIGN = {top: 1, bottom: 1, middle: 1};
12845
+
12846
+ var helper = {};
12847
+
12848
+ /**
12849
+ * @param {module:zrender/graphic/Style} style
12850
+ * @return {module:zrender/graphic/Style} The input style.
12851
+ */
12852
+ helper.normalizeTextStyle = function (style) {
12853
+ normalizeStyle(style);
12854
+ util.each(style.rich, normalizeStyle);
12855
+ return style;
12856
+ };
12857
+
12858
+ function normalizeStyle(style) {
12859
+ if (style) {
12860
+
12861
+ style.font = textContain.makeFont(style);
12862
+
12863
+ var textAlign = style.textAlign;
12864
+ textAlign === 'middle' && (textAlign = 'center');
12865
+ style.textAlign = (
12866
+ textAlign == null || VALID_TEXT_ALIGN[textAlign]
12867
+ ) ? textAlign : 'left';
12868
+
12869
+ // Compatible with textBaseline.
12870
+ var textVerticalAlign = style.textVerticalAlign || style.textBaseline;
12871
+ textVerticalAlign === 'center' && (textVerticalAlign = 'middle');
12872
+ style.textVerticalAlign = (
12873
+ textVerticalAlign == null || VALID_TEXT_VERTICAL_ALIGN[textVerticalAlign]
12874
+ ) ? textVerticalAlign : 'top';
12875
+
12876
+ var textPadding = style.textPadding;
12877
+ if (textPadding) {
12878
+ style.textPadding = util.normalizeCssArray(style.textPadding);
12879
+ }
12880
+ }
12881
+ }
12882
+
12883
+ /**
12884
+ * @param {CanvasRenderingContext2D} ctx
12885
+ * @param {string} text
12886
+ * @param {module:zrender/graphic/Style} style
12887
+ * @param {Object|boolean} [rect] {x, y, width, height}
12888
+ * If set false, rect text is not used.
12889
+ */
12890
+ helper.renderText = function (hostEl, ctx, text, style, rect) {
12891
+ style.rich
12892
+ ? renderRichText(hostEl, ctx, text, style, rect)
12893
+ : renderPlainText(hostEl, ctx, text, style, rect);
12894
+ };
12895
+
12896
+ function renderPlainText(hostEl, ctx, text, style, rect) {
12897
+ var font = setCtx(ctx, 'font', style.font || textContain.DEFAULT_FONT);
12898
+
12899
+ var textPadding = style.textPadding;
12900
+
12901
+ var contentBlock = hostEl.__textCotentBlock;
12902
+ if (!contentBlock || hostEl.__dirty) {
12903
+ contentBlock = hostEl.__textCotentBlock = textContain.parsePlainText(
12904
+ text, font, textPadding, style.truncate
12905
+ );
12906
+ }
12907
+
12908
+ var outerHeight = contentBlock.outerHeight;
12909
+
12910
+ var textLines = contentBlock.lines;
12911
+ var lineHeight = contentBlock.lineHeight;
12912
+
12913
+ var boxPos = getBoxPosition(outerHeight, style, rect);
12914
+ var baseX = boxPos.baseX;
12915
+ var baseY = boxPos.baseY;
12916
+ var textAlign = boxPos.textAlign;
12917
+ var textVerticalAlign = boxPos.textVerticalAlign;
12918
+
12919
+ // Origin of textRotation should be the base point of text drawing.
12920
+ applyTextRotation(ctx, style, rect, baseX, baseY);
12921
+
12922
+ var boxY = textContain.adjustTextY(baseY, outerHeight, textVerticalAlign);
12923
+ var textX = baseX;
12924
+ var textY = boxY;
12925
+
12926
+ var needDrawBg = needDrawBackground(style);
12927
+ if (needDrawBg || textPadding) {
12928
+ // Consider performance, do not call getTextWidth util necessary.
12929
+ var textWidth = textContain.getWidth(text, font);
12930
+ var outerWidth = textWidth;
12931
+ textPadding && (outerWidth += textPadding[1] + textPadding[3]);
12932
+ var boxX = textContain.adjustTextX(baseX, outerWidth, textAlign);
12933
+
12934
+ needDrawBg && drawBackground(hostEl, ctx, style, boxX, boxY, outerWidth, outerHeight);
12935
+
12936
+ if (textPadding) {
12937
+ textX = getTextXForPadding(baseX, textAlign, textPadding);
12938
+ textY += textPadding[0];
12939
+ }
12940
+ }
12941
+
12942
+ setCtx(ctx, 'textAlign', textAlign || 'left');
12943
+ // Force baseline to be "middle". Otherwise, if using "top", the
12944
+ // text will offset downward a little bit in font "Microsoft YaHei".
12945
+ setCtx(ctx, 'textBaseline', 'middle');
12946
+
12947
+ // Always set shadowBlur and shadowOffset to avoid leak from displayable.
12948
+ setCtx(ctx, 'shadowBlur', style.textShadowBlur || 0);
12949
+ setCtx(ctx, 'shadowColor', style.textShadowColor || 'transparent');
12950
+ setCtx(ctx, 'shadowOffsetX', style.textShadowOffsetX || 0);
12951
+ setCtx(ctx, 'shadowOffsetY', style.textShadowOffsetY || 0);
12952
+
12953
+ // `textBaseline` is set as 'middle'.
12954
+ textY += lineHeight / 2;
12955
+
12956
+ var textStrokeWidth = style.textStrokeWidth;
12957
+ var textStroke = getStroke(style.textStroke, textStrokeWidth);
12958
+ var textFill = getFill(style.textFill);
12959
+
12960
+ if (textStroke) {
12961
+ setCtx(ctx, 'lineWidth', textStrokeWidth);
12962
+ setCtx(ctx, 'strokeStyle', textStroke);
12963
+ }
12964
+ if (textFill) {
12965
+ setCtx(ctx, 'fillStyle', textFill);
12966
+ }
12967
+
12968
+ for (var i = 0; i < textLines.length; i++) {
12969
+ // Fill after stroke so the outline will not cover the main part.
12970
+ textStroke && ctx.strokeText(textLines[i], textX, textY);
12971
+ textFill && ctx.fillText(textLines[i], textX, textY);
12972
+ textY += lineHeight;
12973
+ }
12974
+ }
12975
+
12976
+ function renderRichText(hostEl, ctx, text, style, rect) {
12977
+ var contentBlock = hostEl.__textCotentBlock;
12978
+
12979
+ if (!contentBlock || hostEl.__dirty) {
12980
+ contentBlock = hostEl.__textCotentBlock = textContain.parseRichText(text, style);
12981
+ }
12982
+
12983
+ drawRichText(hostEl, ctx, contentBlock, style, rect);
12984
+ }
12985
+
12986
+ function drawRichText(hostEl, ctx, contentBlock, style, rect) {
12987
+ var contentWidth = contentBlock.width;
12988
+ var outerWidth = contentBlock.outerWidth;
12989
+ var outerHeight = contentBlock.outerHeight;
12990
+ var textPadding = style.textPadding;
12991
+
12992
+ var boxPos = getBoxPosition(outerHeight, style, rect);
12993
+ var baseX = boxPos.baseX;
12994
+ var baseY = boxPos.baseY;
12995
+ var textAlign = boxPos.textAlign;
12996
+ var textVerticalAlign = boxPos.textVerticalAlign;
12997
+
12998
+ // Origin of textRotation should be the base point of text drawing.
12999
+ applyTextRotation(ctx, style, rect, baseX, baseY);
13000
+
13001
+ var boxX = textContain.adjustTextX(baseX, outerWidth, textAlign);
13002
+ var boxY = textContain.adjustTextY(baseY, outerHeight, textVerticalAlign);
13003
+ var xLeft = boxX;
13004
+ var lineTop = boxY;
13005
+ if (textPadding) {
13006
+ xLeft += textPadding[3];
13007
+ lineTop += textPadding[0];
13008
+ }
13009
+ var xRight = xLeft + contentWidth;
13010
+
13011
+ needDrawBackground(style) && drawBackground(
13012
+ hostEl, ctx, style, boxX, boxY, outerWidth, outerHeight
13013
+ );
13014
+
13015
+ for (var i = 0; i < contentBlock.lines.length; i++) {
13016
+ var line = contentBlock.lines[i];
13017
+ var tokens = line.tokens;
13018
+ var tokenCount = tokens.length;
13019
+ var lineHeight = line.lineHeight;
13020
+ var usedWidth = line.width;
13021
+
13022
+ var leftIndex = 0;
13023
+ var lineXLeft = xLeft;
13024
+ var lineXRight = xRight;
13025
+ var rightIndex = tokenCount - 1;
13026
+ var token;
13027
+
13028
+ while (
13029
+ leftIndex < tokenCount
13030
+ && (token = tokens[leftIndex], !token.textAlign || token.textAlign === 'left')
13031
+ ) {
13032
+ placeToken(hostEl, ctx, token, style, lineHeight, lineTop, lineXLeft, 'left');
13033
+ usedWidth -= token.width;
13034
+ lineXLeft += token.width;
13035
+ leftIndex++;
13036
+ }
13037
+
13038
+ while (
13039
+ rightIndex >= 0
13040
+ && (token = tokens[rightIndex], token.textAlign === 'right')
13041
+ ) {
13042
+ placeToken(hostEl, ctx, token, style, lineHeight, lineTop, lineXRight, 'right');
13043
+ usedWidth -= token.width;
13044
+ lineXRight -= token.width;
13045
+ rightIndex--;
13046
+ }
13047
+
13048
+ // The other tokens are placed as textAlign 'center' if there is enough space.
13049
+ lineXLeft += (contentWidth - (lineXLeft - xLeft) - (xRight - lineXRight) - usedWidth) / 2;
13050
+ while (leftIndex <= rightIndex) {
13051
+ token = tokens[leftIndex];
13052
+ // Consider width specified by user, use 'center' rather than 'left'.
13053
+ placeToken(hostEl, ctx, token, style, lineHeight, lineTop, lineXLeft + token.width / 2, 'center');
13054
+ lineXLeft += token.width;
13055
+ leftIndex++;
13056
+ }
13057
+
13058
+ lineTop += lineHeight;
13059
+ }
13060
+ }
13061
+
13062
+ function applyTextRotation(ctx, style, rect, x, y) {
13063
+ // textRotation only apply in RectText.
13064
+ if (rect && style.textRotation) {
13065
+ var origin = style.textOrigin;
13066
+ if (origin === 'center') {
13067
+ x = rect.width / 2 + rect.x;
13068
+ y = rect.height / 2 + rect.y;
13069
+ }
13070
+ else if (origin) {
13071
+ x = origin[0] + rect.x;
13072
+ y = origin[1] + rect.y;
13073
+ }
13074
+
13075
+ ctx.translate(x, y);
13076
+ // Positive: anticlockwise
13077
+ ctx.rotate(-style.textRotation);
13078
+ ctx.translate(-x, -y);
13079
+ }
13080
+ }
13081
+
13082
+ function placeToken(hostEl, ctx, token, style, lineHeight, lineTop, x, textAlign) {
13083
+ var tokenStyle = style.rich[token.styleName] || {};
13084
+
13085
+ // 'ctx.textBaseline' is always set as 'middle', for sake of
13086
+ // the bias of "Microsoft YaHei".
13087
+ var textVerticalAlign = token.textVerticalAlign;
13088
+ var y = lineTop + lineHeight / 2;
13089
+ if (textVerticalAlign === 'top') {
13090
+ y = lineTop + token.height / 2;
13091
+ }
13092
+ else if (textVerticalAlign === 'bottom') {
13093
+ y = lineTop + lineHeight - token.height / 2;
13094
+ }
13095
+
13096
+ !token.isLineHolder && needDrawBackground(tokenStyle) && drawBackground(
13097
+ hostEl,
13098
+ ctx,
13099
+ tokenStyle,
13100
+ textAlign === 'right'
13101
+ ? x - token.width
13102
+ : textAlign === 'center'
13103
+ ? x - token.width / 2
13104
+ : x,
13105
+ y - token.height / 2,
13106
+ token.width,
13107
+ token.height
13108
+ );
13109
+
13110
+ var textPadding = token.textPadding;
13111
+ if (textPadding) {
13112
+ x = getTextXForPadding(x, textAlign, textPadding);
13113
+ y -= token.height / 2 - textPadding[2] - token.textHeight / 2;
13114
+ }
13115
+
13116
+ setCtx(ctx, 'shadowBlur', retrieve3(tokenStyle.textShadowBlur, style.textShadowBlur, 0));
13117
+ setCtx(ctx, 'shadowColor', tokenStyle.textShadowColor || style.textShadowColor || 'transparent');
13118
+ setCtx(ctx, 'shadowOffsetX', retrieve3(tokenStyle.textShadowOffsetX, style.textShadowOffsetX, 0));
13119
+ setCtx(ctx, 'shadowOffsetY', retrieve3(tokenStyle.textShadowOffsetY, style.textShadowOffsetY, 0));
13120
+
13121
+ setCtx(ctx, 'textAlign', textAlign);
13122
+ // Force baseline to be "middle". Otherwise, if using "top", the
13123
+ // text will offset downward a little bit in font "Microsoft YaHei".
13124
+ setCtx(ctx, 'textBaseline', 'middle');
13125
+
13126
+ setCtx(ctx, 'font', token.font || textContain.DEFAULT_FONT);
13127
+
13128
+ var textStroke = getStroke(tokenStyle.textStroke || style.textStroke, textStrokeWidth);
13129
+ var textFill = getFill(tokenStyle.textFill || style.textFill);
13130
+ var textStrokeWidth = retrieve2(tokenStyle.textStrokeWidth, style.textStrokeWidth);
13131
+
13132
+ // Fill after stroke so the outline will not cover the main part.
13133
+ if (textStroke) {
13134
+ setCtx(ctx, 'lineWidth', textStrokeWidth);
13135
+ setCtx(ctx, 'strokeStyle', textStroke);
13136
+ ctx.strokeText(token.text, x, y);
13137
+ }
13138
+ if (textFill) {
13139
+ setCtx(ctx, 'fillStyle', textFill);
13140
+ ctx.fillText(token.text, x, y);
13141
+ }
13142
+ }
13143
+
13144
+ function needDrawBackground(style) {
13145
+ return style.textBackgroundColor
13146
+ || (style.textBorderWidth && style.textBorderColor);
13147
+ }
13148
+
13149
+ // style: {textBackgroundColor, textBorderWidth, textBorderColor, textBorderRadius}
13150
+ // shape: {x, y, width, height}
13151
+ function drawBackground(hostEl, ctx, style, x, y, width, height) {
13152
+ var textBackgroundColor = style.textBackgroundColor;
13153
+ var textBorderWidth = style.textBorderWidth;
13154
+ var textBorderColor = style.textBorderColor;
13155
+ var isPlainBg = util.isString(textBackgroundColor);
13156
+
13157
+ setCtx(ctx, 'shadowBlur', style.textBoxShadowBlur || 0);
13158
+ setCtx(ctx, 'shadowColor', style.textBoxShadowColor || 'transparent');
13159
+ setCtx(ctx, 'shadowOffsetX', style.textBoxShadowOffsetX || 0);
13160
+ setCtx(ctx, 'shadowOffsetY', style.textBoxShadowOffsetY || 0);
13161
+
13162
+ if (isPlainBg || (textBorderWidth && textBorderColor)) {
13163
+ ctx.beginPath();
13164
+ var textBorderRadius = style.textBorderRadius;
13165
+ if (!textBorderRadius) {
13166
+ ctx.rect(x, y, width, height);
13167
+ }
13168
+ else {
13169
+ roundRectHelper.buildPath(ctx, {
13170
+ x: x, y: y, width: width, height: height, r: textBorderRadius
13171
+ });
13172
+ }
13173
+ ctx.closePath();
13174
+ }
13175
+
13176
+ if (isPlainBg) {
13177
+ setCtx(ctx, 'fillStyle', textBackgroundColor);
13178
+ ctx.fill();
13179
+ }
13180
+ else if (util.isObject(textBackgroundColor)) {
13181
+ var image = textBackgroundColor.image;
13182
+
13183
+ image = imageHelper.createOrUpdateImage(
13184
+ image, null, hostEl, onBgImageLoaded, textBackgroundColor
13185
+ );
13186
+ if (image && imageHelper.isImageReady(image)) {
13187
+ ctx.drawImage(image, x, y, width, height);
13188
+ }
13189
+ }
13190
+
13191
+ if (textBorderWidth && textBorderColor) {
13192
+ setCtx(ctx, 'lineWidth', textBorderWidth);
13193
+ setCtx(ctx, 'strokeStyle', textBorderColor);
13194
+ ctx.stroke();
13195
+ }
13196
+ }
13197
+
13198
+ function onBgImageLoaded(image, textBackgroundColor) {
13199
+ // Replace image, so that `contain/text.js#parseRichText`
13200
+ // will get correct result in next tick.
13201
+ textBackgroundColor.image = image;
13202
+ }
13249
13203
 
13250
-
13251
- var config = __webpack_require__(37);
13204
+ function getBoxPosition(blockHeiht, style, rect) {
13205
+ var baseX = style.x || 0;
13206
+ var baseY = style.y || 0;
13207
+ var textAlign = style.textAlign;
13208
+ var textVerticalAlign = style.textVerticalAlign;
13252
13209
 
13253
- /**
13254
- * @exports zrender/tool/log
13255
- * @author Kener (@Kener-林峰, kener.linfeng@gmail.com)
13256
- */
13257
- module.exports = function() {
13258
- if (config.debugMode === 0) {
13259
- return;
13210
+ // Text position represented by coord
13211
+ if (rect) {
13212
+ var textPosition = style.textPosition;
13213
+ if (textPosition instanceof Array) {
13214
+ // Percent
13215
+ baseX = rect.x + parsePercent(textPosition[0], rect.width);
13216
+ baseY = rect.y + parsePercent(textPosition[1], rect.height);
13260
13217
  }
13261
- else if (config.debugMode == 1) {
13262
- for (var k in arguments) {
13263
- throw new Error(arguments[k]);
13264
- }
13218
+ else {
13219
+ var res = textContain.adjustTextPositionOnRect(
13220
+ textPosition, rect, style.textDistance
13221
+ );
13222
+ baseX = res.x;
13223
+ baseY = res.y;
13224
+ // Default align and baseline when has textPosition
13225
+ textAlign = textAlign || res.textAlign;
13226
+ textVerticalAlign = textVerticalAlign || res.textVerticalAlign;
13265
13227
  }
13266
- else if (config.debugMode > 1) {
13267
- for (var k in arguments) {
13268
- console.log(arguments[k]);
13269
- }
13228
+
13229
+ // textOffset is only support in RectText, otherwise
13230
+ // we have to adjust boundingRect for textOffset.
13231
+ var textOffset = style.textOffset;
13232
+ if (textOffset) {
13233
+ baseX += textOffset[0];
13234
+ baseY += textOffset[1];
13270
13235
  }
13271
- };
13236
+ }
13272
13237
 
13273
- /* for debug
13274
- return function(mes) {
13275
- document.getElementById('wrong-message').innerHTML =
13276
- mes + ' ' + (new Date() - 0)
13277
- + '<br/>'
13278
- + document.getElementById('wrong-message').innerHTML;
13238
+ return {
13239
+ baseX: baseX,
13240
+ baseY: baseY,
13241
+ textAlign: textAlign,
13242
+ textVerticalAlign: textVerticalAlign
13279
13243
  };
13280
- */
13281
-
13282
-
13283
-
13284
- /***/ }),
13285
- /* 37 */
13286
- /***/ (function(module, exports) {
13244
+ }
13287
13245
 
13288
-
13289
- var dpr = 1;
13290
- // If in browser environment
13291
- if (typeof window !== 'undefined') {
13292
- dpr = Math.max(window.devicePixelRatio || 1, 1);
13246
+ function setCtx(ctx, prop, value) {
13247
+ // FIXME ??? performance try
13248
+ // if (ctx.__currentValues[prop] !== value) {
13249
+ // ctx[prop] = ctx.__currentValues[prop] = value;
13250
+ ctx[prop] = value;
13251
+ // }
13252
+ return ctx[prop];
13293
13253
  }
13254
+
13294
13255
  /**
13295
- * config默认配置项
13296
- * @exports zrender/config
13297
- * @author Kener (@Kener-林峰, kener.linfeng@gmail.com)
13256
+ * @param {string} [stroke] If specified, do not check style.textStroke.
13257
+ * @param {string} [lineWidth] If specified, do not check style.textStroke.
13258
+ * @param {number} style
13298
13259
  */
13299
- var config = {
13300
- /**
13301
- * debug日志选项:catchBrushException为true下有效
13302
- * 0 : 不生成debug数据,发布用
13303
- * 1 : 异常抛出,调试用
13304
- * 2 : 控制台输出,调试用
13305
- */
13306
- debugMode: 0,
13307
-
13308
- // retina 屏幕优化
13309
- devicePixelRatio: dpr
13260
+ var getStroke = helper.getStroke = function (stroke, lineWidth) {
13261
+ return (stroke == null || lineWidth <= 0 || stroke === 'transparent' || stroke === 'none')
13262
+ ? null
13263
+ // TODO pattern and gradient?
13264
+ : (stroke.image || stroke.colorStops)
13265
+ ? '#000'
13266
+ : stroke;
13310
13267
  };
13311
- module.exports = config;
13312
-
13313
-
13314
-
13315
-
13316
- /***/ }),
13317
- /* 38 */
13318
- /***/ (function(module, exports, __webpack_require__) {
13319
-
13320
- /**
13321
- * Mixin for drawing text in a element bounding rect
13322
- * @module zrender/mixin/RectText
13323
- */
13324
-
13325
13268
 
13269
+ var getFill = helper.getFill = function (fill) {
13270
+ return (fill == null || fill === 'none')
13271
+ ? null
13272
+ // TODO pattern and gradient?
13273
+ : (fill.image || fill.colorStops)
13274
+ ? '#000'
13275
+ : fill;
13276
+ };
13326
13277
 
13327
- var textHelper = __webpack_require__(25);
13328
- var BoundingRect = __webpack_require__(9);
13278
+ function parsePercent(value, maxValue) {
13279
+ if (typeof value === 'string') {
13280
+ if (value.lastIndexOf('%') >= 0) {
13281
+ return parseFloat(value) / 100 * maxValue;
13282
+ }
13283
+ return parseFloat(value);
13284
+ }
13285
+ return value;
13286
+ }
13329
13287
 
13330
- var tmpRect = new BoundingRect();
13288
+ function getTextXForPadding(x, textAlign, textPadding) {
13289
+ return textAlign === 'right'
13290
+ ? (x - textPadding[1])
13291
+ : textAlign === 'center'
13292
+ ? (x + textPadding[3] / 2 - textPadding[1] / 2)
13293
+ : (x + textPadding[3]);
13294
+ }
13331
13295
 
13332
- var RectText = function () {};
13296
+ /**
13297
+ * @param {string} text
13298
+ * @param {module:zrender/Style} style
13299
+ * @return {boolean}
13300
+ */
13301
+ helper.needDrawText = function (text, style) {
13302
+ return text != null
13303
+ && (text
13304
+ || style.textBackgroundColor
13305
+ || (style.textBorderWidth && style.textBorderColor)
13306
+ || style.textPadding
13307
+ );
13308
+ };
13333
13309
 
13334
- RectText.prototype = {
13310
+ module.exports = helper;
13335
13311
 
13336
- constructor: RectText,
13337
13312
 
13338
- /**
13339
- * Draw text in a rect with specified position.
13340
- * @param {CanvasRenderingContext2D} ctx
13341
- * @param {Object} rect Displayable rect
13342
- */
13343
- drawRectText: function (ctx, rect) {
13344
- var style = this.style;
13345
13313
 
13346
- rect = style.textRect || rect;
13347
13314
 
13348
- // Optimize, avoid normalize every time.
13349
- this.__dirty && textHelper.normalizeTextStyle(style, true);
13315
+ /***/ }),
13316
+ /* 38 */
13317
+ /***/ (function(module, exports) {
13350
13318
 
13351
- var text = style.text;
13319
+
13352
13320
 
13353
- // Convert to string
13354
- text != null && (text += '');
13321
+ module.exports = {
13322
+ buildPath: function (ctx, shape) {
13323
+ var x = shape.x;
13324
+ var y = shape.y;
13325
+ var width = shape.width;
13326
+ var height = shape.height;
13327
+ var r = shape.r;
13328
+ var r1;
13329
+ var r2;
13330
+ var r3;
13331
+ var r4;
13355
13332
 
13356
- if (!textHelper.needDrawText(text, style)) {
13357
- return;
13333
+ // Convert width and height to positive for better borderRadius
13334
+ if (width < 0) {
13335
+ x = x + width;
13336
+ width = -width;
13337
+ }
13338
+ if (height < 0) {
13339
+ y = y + height;
13340
+ height = -height;
13358
13341
  }
13359
13342
 
13360
- // FIXME
13361
- ctx.save();
13362
-
13363
- // Transform rect to view space
13364
- var transform = this.transform;
13365
- if (!style.transformText) {
13366
- if (transform) {
13367
- tmpRect.copy(rect);
13368
- tmpRect.applyTransform(transform);
13369
- rect = tmpRect;
13343
+ if (typeof r === 'number') {
13344
+ r1 = r2 = r3 = r4 = r;
13345
+ }
13346
+ else if (r instanceof Array) {
13347
+ if (r.length === 1) {
13348
+ r1 = r2 = r3 = r4 = r[0];
13349
+ }
13350
+ else if (r.length === 2) {
13351
+ r1 = r3 = r[0];
13352
+ r2 = r4 = r[1];
13353
+ }
13354
+ else if (r.length === 3) {
13355
+ r1 = r[0];
13356
+ r2 = r4 = r[1];
13357
+ r3 = r[2];
13358
+ }
13359
+ else {
13360
+ r1 = r[0];
13361
+ r2 = r[1];
13362
+ r3 = r[2];
13363
+ r4 = r[3];
13370
13364
  }
13371
13365
  }
13372
13366
  else {
13373
- this.setTransform(ctx);
13367
+ r1 = r2 = r3 = r4 = 0;
13374
13368
  }
13375
13369
 
13376
- // transformText and textRotation can not be used at the same time.
13377
- textHelper.renderText(this, ctx, text, style, rect);
13378
-
13379
- ctx.restore();
13370
+ var total;
13371
+ if (r1 + r2 > width) {
13372
+ total = r1 + r2;
13373
+ r1 *= width / total;
13374
+ r2 *= width / total;
13375
+ }
13376
+ if (r3 + r4 > width) {
13377
+ total = r3 + r4;
13378
+ r3 *= width / total;
13379
+ r4 *= width / total;
13380
+ }
13381
+ if (r2 + r3 > height) {
13382
+ total = r2 + r3;
13383
+ r2 *= height / total;
13384
+ r3 *= height / total;
13385
+ }
13386
+ if (r1 + r4 > height) {
13387
+ total = r1 + r4;
13388
+ r1 *= height / total;
13389
+ r4 *= height / total;
13390
+ }
13391
+ ctx.moveTo(x + r1, y);
13392
+ ctx.lineTo(x + width - r2, y);
13393
+ r2 !== 0 && ctx.quadraticCurveTo(
13394
+ x + width, y, x + width, y + r2
13395
+ );
13396
+ ctx.lineTo(x + width, y + height - r3);
13397
+ r3 !== 0 && ctx.quadraticCurveTo(
13398
+ x + width, y + height, x + width - r3, y + height
13399
+ );
13400
+ ctx.lineTo(x + r4, y + height);
13401
+ r4 !== 0 && ctx.quadraticCurveTo(
13402
+ x, y + height, x, y + height - r4
13403
+ );
13404
+ ctx.lineTo(x, y + r1);
13405
+ r1 !== 0 && ctx.quadraticCurveTo(x, y, x + r1, y);
13380
13406
  }
13381
13407
  };
13382
13408
 
13383
- module.exports = RectText;
13384
-
13385
13409
 
13386
13410
  /***/ }),
13387
13411
  /* 39 */
@@ -13403,7 +13427,7 @@ return /******/ (function(modules) { // webpackBootstrap
13403
13427
  var vec2 = __webpack_require__(10);
13404
13428
  var bbox = __webpack_require__(41);
13405
13429
  var BoundingRect = __webpack_require__(9);
13406
- var dpr = __webpack_require__(37).devicePixelRatio;
13430
+ var dpr = __webpack_require__(35).devicePixelRatio;
13407
13431
 
13408
13432
  var CMD = {
13409
13433
  M: 1,
@@ -15768,7 +15792,7 @@ return /******/ (function(modules) { // webpackBootstrap
15768
15792
 
15769
15793
 
15770
15794
  var zrUtil = __webpack_require__(4);
15771
- var Element = __webpack_require__(27);
15795
+ var Element = __webpack_require__(25);
15772
15796
  var BoundingRect = __webpack_require__(9);
15773
15797
 
15774
15798
  /**
@@ -16204,7 +16228,7 @@ return /******/ (function(modules) { // webpackBootstrap
16204
16228
  var Displayable = __webpack_require__(23);
16205
16229
  var zrUtil = __webpack_require__(4);
16206
16230
  var textContain = __webpack_require__(8);
16207
- var textHelper = __webpack_require__(25);
16231
+ var textHelper = __webpack_require__(37);
16208
16232
 
16209
16233
  /**
16210
16234
  * @alias zrender/graphic/Text
@@ -16272,8 +16296,8 @@ return /******/ (function(modules) { // webpackBootstrap
16272
16296
  rect.x += style.x || 0;
16273
16297
  rect.y += style.y || 0;
16274
16298
 
16275
- if (textHelper.getStroke(style.textStroke, style.textLineWidth)) {
16276
- var w = style.textLineWidth;
16299
+ if (textHelper.getStroke(style.textStroke, style.textStrokeWidth)) {
16300
+ var w = style.textStrokeWidth;
16277
16301
  rect.x -= w / 2;
16278
16302
  rect.y -= w / 2;
16279
16303
  rect.width += w;
@@ -16820,7 +16844,7 @@ return /******/ (function(modules) { // webpackBootstrap
16820
16844
  */
16821
16845
 
16822
16846
 
16823
- var roundRectHelper = __webpack_require__(26);
16847
+ var roundRectHelper = __webpack_require__(38);
16824
16848
 
16825
16849
  module.exports = __webpack_require__(22).extend({
16826
16850
 
@@ -19085,30 +19109,31 @@ return /******/ (function(modules) { // webpackBootstrap
19085
19109
  compatItemStyle(data[i]);
19086
19110
  compatLabelTextStyle(data[i] && data[i].label);
19087
19111
  }
19088
- // mark point data
19089
- var markPoint = seriesOpt.markPoint;
19090
- if (markPoint && markPoint.data) {
19091
- var mpData = markPoint.data;
19092
- for (var i = 0; i < mpData.length; i++) {
19093
- compatItemStyle(mpData[i]);
19094
- compatLabelTextStyle(mpData[i] && mpData[i].label);
19095
- }
19096
- }
19097
- // mark line data
19098
- var markLine = seriesOpt.markLine;
19099
- if (markLine && markLine.data) {
19100
- var mlData = markLine.data;
19101
- for (var i = 0; i < mlData.length; i++) {
19102
- if (zrUtil.isArray(mlData[i])) {
19103
- compatItemStyle(mlData[i][0]);
19104
- compatLabelTextStyle(mlData[i][0] && mlData[i][0].label);
19105
- compatItemStyle(mlData[i][1]);
19106
- compatLabelTextStyle(mlData[i][1] && mlData[i][1].label);
19107
- }
19108
- else {
19109
- compatItemStyle(mlData[i]);
19110
- compatLabelTextStyle(mlData[i] && mlData[i].label);
19111
- }
19112
+ }
19113
+
19114
+ // mark point data
19115
+ var markPoint = seriesOpt.markPoint;
19116
+ if (markPoint && markPoint.data) {
19117
+ var mpData = markPoint.data;
19118
+ for (var i = 0; i < mpData.length; i++) {
19119
+ compatItemStyle(mpData[i]);
19120
+ compatLabelTextStyle(mpData[i] && mpData[i].label);
19121
+ }
19122
+ }
19123
+ // mark line data
19124
+ var markLine = seriesOpt.markLine;
19125
+ if (markLine && markLine.data) {
19126
+ var mlData = markLine.data;
19127
+ for (var i = 0; i < mlData.length; i++) {
19128
+ if (zrUtil.isArray(mlData[i])) {
19129
+ compatItemStyle(mlData[i][0]);
19130
+ compatLabelTextStyle(mlData[i][0] && mlData[i][0].label);
19131
+ compatItemStyle(mlData[i][1]);
19132
+ compatLabelTextStyle(mlData[i][1] && mlData[i][1].label);
19133
+ }
19134
+ else {
19135
+ compatItemStyle(mlData[i]);
19136
+ compatLabelTextStyle(mlData[i] && mlData[i].label);
19112
19137
  }
19113
19138
  }
19114
19139
  }
@@ -19901,7 +19926,7 @@ return /******/ (function(modules) { // webpackBootstrap
19901
19926
  */
19902
19927
  // Global defines
19903
19928
 
19904
- var guid = __webpack_require__(28);
19929
+ var guid = __webpack_require__(26);
19905
19930
  var env = __webpack_require__(2);
19906
19931
  var zrUtil = __webpack_require__(4);
19907
19932
 
@@ -19923,7 +19948,7 @@ return /******/ (function(modules) { // webpackBootstrap
19923
19948
  /**
19924
19949
  * @type {string}
19925
19950
  */
19926
- zrender.version = '3.6.1';
19951
+ zrender.version = '3.6.2';
19927
19952
 
19928
19953
  /**
19929
19954
  * Initializing a zrender instance
@@ -20346,9 +20371,10 @@ return /******/ (function(modules) { // webpackBootstrap
20346
20371
 
20347
20372
 
20348
20373
  var util = __webpack_require__(4);
20374
+ var vec2 = __webpack_require__(10);
20349
20375
  var Draggable = __webpack_require__(89);
20350
20376
 
20351
- var Eventful = __webpack_require__(29);
20377
+ var Eventful = __webpack_require__(27);
20352
20378
 
20353
20379
  var SILENT = 'silent';
20354
20380
 
@@ -20368,7 +20394,8 @@ return /******/ (function(modules) { // webpackBootstrap
20368
20394
  pinchY: event.pinchY,
20369
20395
  pinchScale: event.pinchScale,
20370
20396
  wheelDelta: event.zrDelta,
20371
- zrByTouch: event.zrByTouch
20397
+ zrByTouch: event.zrByTouch,
20398
+ which: event.which
20372
20399
  };
20373
20400
  }
20374
20401
 
@@ -20623,17 +20650,27 @@ return /******/ (function(modules) { // webpackBootstrap
20623
20650
  var hoveredTarget = hovered.target;
20624
20651
 
20625
20652
  if (name === 'mousedown') {
20626
- this._downel = hoveredTarget;
20653
+ this._downEl = hoveredTarget;
20654
+ this._downPoint = [event.zrX, event.zrY];
20627
20655
  // In case click triggered before mouseup
20628
- this._upel = hoveredTarget;
20656
+ this._upEl = hoveredTarget;
20629
20657
  }
20630
20658
  else if (name === 'mosueup') {
20631
- this._upel = hoveredTarget;
20659
+ this._upEl = hoveredTarget;
20632
20660
  }
20633
20661
  else if (name === 'click') {
20634
- if (this._downel !== this._upel) {
20662
+ if (this._downEl !== this._upEl
20663
+ // Original click event is triggered on the whole canvas element,
20664
+ // including the case that `mousedown` - `mousemove` - `mouseup`,
20665
+ // which should be filtered, otherwise it will bring trouble to
20666
+ // pan and zoom.
20667
+ || !this._downPoint
20668
+ // Arbitrary value
20669
+ || vec2.dist(this._downPoint, [event.zrX, event.zrY]) > 4
20670
+ ) {
20635
20671
  return;
20636
20672
  }
20673
+ this._downPoint = null;
20637
20674
  }
20638
20675
 
20639
20676
  this.dispatchToElement(hovered, name, event);
@@ -21721,7 +21758,7 @@ return /******/ (function(modules) { // webpackBootstrap
21721
21758
 
21722
21759
  var requestAnimationFrame = __webpack_require__(94);
21723
21760
 
21724
- var Animator = __webpack_require__(32);
21761
+ var Animator = __webpack_require__(30);
21725
21762
  /**
21726
21763
  * @typedef {Object} IZRenderStage
21727
21764
  * @property {Function} update
@@ -21972,11 +22009,13 @@ return /******/ (function(modules) { // webpackBootstrap
21972
22009
  */
21973
22010
 
21974
22011
 
21975
- var Eventful = __webpack_require__(29);
22012
+ var Eventful = __webpack_require__(27);
21976
22013
  var env = __webpack_require__(2);
21977
22014
 
21978
22015
  var isDomLevel2 = (typeof window !== 'undefined') && !!window.addEventListener;
21979
22016
 
22017
+ var MOUSE_EVENT_REG = /^(?:mouse|pointer|contextmenu|drag|drop)|click/;
22018
+
21980
22019
  function getBoundingClientRect(el) {
21981
22020
  // BlackBerry 5, iOS 3 (original iPhone) don't have getBoundingRect
21982
22021
  return el.getBoundingClientRect ? el.getBoundingClientRect() : {left: 0, top: 0};
@@ -22057,6 +22096,15 @@ return /******/ (function(modules) { // webpackBootstrap
22057
22096
  touch && clientToLocal(el, touch, e, calculate);
22058
22097
  }
22059
22098
 
22099
+ // Add which for click: 1 === left; 2 === middle; 3 === right; otherwise: 0;
22100
+ // See jQuery: https://github.com/jquery/jquery/blob/master/src/event.js
22101
+ // If e.which has been defined, if may be readonly,
22102
+ // see: https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/which
22103
+ var button = e.button;
22104
+ if (e.which == null && button !== undefined && MOUSE_EVENT_REG.test(e.type)) {
22105
+ e.which = (button & 1 ? 1 : (button & 2 ? 3 : (button & 4 ? 2 : 0)));
22106
+ }
22107
+
22060
22108
  return e;
22061
22109
  }
22062
22110
 
@@ -22098,11 +22146,17 @@ return /******/ (function(modules) { // webpackBootstrap
22098
22146
  e.cancelBubble = true;
22099
22147
  };
22100
22148
 
22149
+ function notLeftMouse(e) {
22150
+ // If e.which is undefined, considered as left mouse event.
22151
+ return e.which > 1;
22152
+ }
22153
+
22101
22154
  module.exports = {
22102
22155
  clientToLocal: clientToLocal,
22103
22156
  normalizeEvent: normalizeEvent,
22104
22157
  addEventListener: addEventListener,
22105
22158
  removeEventListener: removeEventListener,
22159
+ notLeftMouse: notLeftMouse,
22106
22160
 
22107
22161
  stop: stop,
22108
22162
  // 做向上兼容
@@ -22138,7 +22192,7 @@ return /******/ (function(modules) { // webpackBootstrap
22138
22192
 
22139
22193
  var eventTool = __webpack_require__(93);
22140
22194
  var zrUtil = __webpack_require__(4);
22141
- var Eventful = __webpack_require__(29);
22195
+ var Eventful = __webpack_require__(27);
22142
22196
  var env = __webpack_require__(2);
22143
22197
  var GestureMgr = __webpack_require__(96);
22144
22198
 
@@ -22654,9 +22708,9 @@ return /******/ (function(modules) { // webpackBootstrap
22654
22708
  */
22655
22709
 
22656
22710
 
22657
- var config = __webpack_require__(37);
22711
+ var config = __webpack_require__(35);
22658
22712
  var util = __webpack_require__(4);
22659
- var log = __webpack_require__(36);
22713
+ var log = __webpack_require__(34);
22660
22714
  var BoundingRect = __webpack_require__(9);
22661
22715
  var timsort = __webpack_require__(91);
22662
22716
 
@@ -22767,6 +22821,9 @@ return /******/ (function(modules) { // webpackBootstrap
22767
22821
  * @param {Object} opts
22768
22822
  */
22769
22823
  var Painter = function (root, storage, opts) {
22824
+
22825
+ this.type = 'canvas';
22826
+
22770
22827
  // In node environment using node-canvas
22771
22828
  var singleCanvas = !root.nodeName // In node ?
22772
22829
  || root.nodeName.toUpperCase() === 'CANVAS';
@@ -22872,6 +22929,10 @@ return /******/ (function(modules) { // webpackBootstrap
22872
22929
 
22873
22930
  constructor: Painter,
22874
22931
 
22932
+ getType: function () {
22933
+ return 'canvas';
22934
+ },
22935
+
22875
22936
  /**
22876
22937
  * If painter use a single canvas
22877
22938
  * @return {boolean}
@@ -23779,7 +23840,7 @@ return /******/ (function(modules) { // webpackBootstrap
23779
23840
 
23780
23841
 
23781
23842
  var util = __webpack_require__(4);
23782
- var config = __webpack_require__(37);
23843
+ var config = __webpack_require__(35);
23783
23844
  var Style = __webpack_require__(24);
23784
23845
  var Pattern = __webpack_require__(49);
23785
23846
 
@@ -26700,7 +26761,7 @@ return /******/ (function(modules) { // webpackBootstrap
26700
26761
  // If there are no data and extent are [Infinity, -Infinity]
26701
26762
  if (extent[1] === -Infinity && extent[0] === Infinity) {
26702
26763
  var d = new Date();
26703
- extent[1] = new Date(d.getFullYear(), d.getMonth(), d.getDate());
26764
+ extent[1] = +new Date(d.getFullYear(), d.getMonth(), d.getDate());
26704
26765
  extent[0] = extent[1] - ONE_DAY;
26705
26766
  }
26706
26767
 
@@ -26721,8 +26782,6 @@ return /******/ (function(modules) { // webpackBootstrap
26721
26782
  * @override
26722
26783
  */
26723
26784
  niceTicks: function (approxTickNum, minInterval, maxInterval) {
26724
- var timezoneOffset = this.getSetting('useUTC')
26725
- ? 0 : numberUtil.getTimezoneOffset() * 60 * 1000;
26726
26785
  approxTickNum = approxTickNum || 10;
26727
26786
 
26728
26787
  var extent = this._extent;
@@ -26752,9 +26811,11 @@ return /******/ (function(modules) { // webpackBootstrap
26752
26811
  interval *= yearStep;
26753
26812
  }
26754
26813
 
26814
+ var timezoneOffset = this.getSetting('useUTC')
26815
+ ? 0 : (new Date(+extent[0] || +extent[1])).getTimezoneOffset() * 60 * 1000;
26755
26816
  var niceExtent = [
26756
26817
  Math.round(mathCeil((extent[0] - timezoneOffset) / interval) * interval + timezoneOffset),
26757
- Math.round(mathFloor((extent[1] - timezoneOffset)/ interval) * interval + timezoneOffset)
26818
+ Math.round(mathFloor((extent[1] - timezoneOffset) / interval) * interval + timezoneOffset)
26758
26819
  ];
26759
26820
 
26760
26821
  scaleHelper.fixExtent(niceExtent, extent);
@@ -28302,8 +28363,20 @@ return /******/ (function(modules) { // webpackBootstrap
28302
28363
  function getStackedOnPoints(coordSys, data) {
28303
28364
  var baseAxis = coordSys.getBaseAxis();
28304
28365
  var valueAxis = coordSys.getOtherAxis(baseAxis);
28305
- var valueStart = baseAxis.onZero
28306
- ? 0 : valueAxis.scale.getExtent()[0];
28366
+
28367
+ var valueStart = 0;
28368
+ if (!baseAxis.onZero) {
28369
+ var extent = valueAxis.scale.getExtent();
28370
+ if (extent[0] > 0) {
28371
+ // Both positive
28372
+ valueStart = extent[0];
28373
+ }
28374
+ else if (extent[1] < 0) {
28375
+ // Both negative
28376
+ valueStart = extent[1];
28377
+ }
28378
+ // If is one positive, and one negative, onZero shall be true
28379
+ }
28307
28380
 
28308
28381
  var valueDim = valueAxis.dim;
28309
28382
 
@@ -31470,7 +31543,7 @@ return /******/ (function(modules) { // webpackBootstrap
31470
31543
  var getInterval = AxisBuilder.getInterval;
31471
31544
 
31472
31545
  var axisBuilderAttrs = [
31473
- 'axisLine', 'axisLabel', 'axisTick', 'axisName'
31546
+ 'axisLine', 'axisTickLabel', 'axisName'
31474
31547
  ];
31475
31548
  var selfBuilderAttrs = [
31476
31549
  'splitArea', 'splitLine'
@@ -31558,13 +31631,19 @@ return /******/ (function(modules) { // webpackBootstrap
31558
31631
  );
31559
31632
  var ticks = axis.scale.getTicks();
31560
31633
 
31634
+ var showMinLabel = axisModel.get('axisLabel.showMinLabel');
31635
+ var showMaxLabel = axisModel.get('axisLabel.showMaxLabel');
31636
+
31561
31637
  var p1 = [];
31562
31638
  var p2 = [];
31563
31639
  // Simple optimization
31564
31640
  // Batching the lines if color are the same
31565
31641
  var lineStyle = lineStyleModel.getLineStyle();
31566
31642
  for (var i = 0; i < ticksCoords.length; i++) {
31567
- if (ifIgnoreOnTick(axis, i, lineInterval)) {
31643
+ if (ifIgnoreOnTick(
31644
+ axis, i, lineInterval, ticksCoords.length,
31645
+ showMinLabel, showMaxLabel
31646
+ )) {
31568
31647
  continue;
31569
31648
  }
31570
31649
 
@@ -31635,8 +31714,14 @@ return /******/ (function(modules) { // webpackBootstrap
31635
31714
  var areaStyle = areaStyleModel.getAreaStyle();
31636
31715
  areaColors = zrUtil.isArray(areaColors) ? areaColors : [areaColors];
31637
31716
 
31717
+ var showMinLabel = axisModel.get('axisLabel.showMinLabel');
31718
+ var showMaxLabel = axisModel.get('axisLabel.showMaxLabel');
31719
+
31638
31720
  for (var i = 1; i < ticksCoords.length; i++) {
31639
- if (ifIgnoreOnTick(axis, i, areaInterval)) {
31721
+ if (ifIgnoreOnTick(
31722
+ axis, i, areaInterval, ticksCoords.length,
31723
+ showMinLabel, showMaxLabel
31724
+ )) {
31640
31725
  continue;
31641
31726
  }
31642
31727
 
@@ -31745,7 +31830,7 @@ return /******/ (function(modules) { // webpackBootstrap
31745
31830
  * @param {Object} opt Standard axis parameters.
31746
31831
  * @param {Array.<number>} opt.position [x, y]
31747
31832
  * @param {number} opt.rotation by radian
31748
- * @param {number} [opt.nameDirection=1] 1 or -1 Used when nameLocation is 'middle'.
31833
+ * @param {number} [opt.nameDirection=1] 1 or -1 Used when nameLocation is 'middle' or 'center'.
31749
31834
  * @param {number} [opt.tickDirection=1] 1 or -1
31750
31835
  * @param {number} [opt.labelDirection=1] 1 or -1
31751
31836
  * @param {number} [opt.labelOffset=0] Usefull when onZero.
@@ -31867,173 +31952,14 @@ return /******/ (function(modules) { // webpackBootstrap
31867
31952
  /**
31868
31953
  * @private
31869
31954
  */
31870
- axisTick: function () {
31955
+ axisTickLabel: function () {
31871
31956
  var axisModel = this.axisModel;
31872
- var axis = axisModel.axis;
31873
-
31874
- if (!axisModel.get('axisTick.show') || axis.scale.isBlank()) {
31875
- return;
31876
- }
31877
-
31878
- var tickModel = axisModel.getModel('axisTick');
31879
- var opt = this.opt;
31880
-
31881
- var lineStyleModel = tickModel.getModel('lineStyle');
31882
- var tickLen = tickModel.get('length');
31883
-
31884
- var tickInterval = getInterval(tickModel, opt.labelInterval);
31885
- var ticksCoords = axis.getTicksCoords(tickModel.get('alignWithLabel'));
31886
- var ticks = axis.scale.getTicks();
31887
-
31888
- var pt1 = [];
31889
- var pt2 = [];
31890
- var matrix = this._transform;
31891
-
31892
- for (var i = 0; i < ticksCoords.length; i++) {
31893
- // Only ordinal scale support tick interval
31894
- if (ifIgnoreOnTick(axis, i, tickInterval)) {
31895
- continue;
31896
- }
31897
-
31898
- var tickCoord = ticksCoords[i];
31899
-
31900
- pt1[0] = tickCoord;
31901
- pt1[1] = 0;
31902
- pt2[0] = tickCoord;
31903
- pt2[1] = opt.tickDirection * tickLen;
31904
-
31905
- if (matrix) {
31906
- v2ApplyTransform(pt1, pt1, matrix);
31907
- v2ApplyTransform(pt2, pt2, matrix);
31908
- }
31909
- // Tick line, Not use group transform to have better line draw
31910
- this.group.add(new graphic.Line(graphic.subPixelOptimizeLine({
31911
-
31912
- // Id for animation
31913
- anid: 'tick_' + ticks[i],
31914
-
31915
- shape: {
31916
- x1: pt1[0],
31917
- y1: pt1[1],
31918
- x2: pt2[0],
31919
- y2: pt2[1]
31920
- },
31921
- style: zrUtil.defaults(
31922
- lineStyleModel.getLineStyle(),
31923
- {
31924
- stroke: axisModel.get('axisLine.lineStyle.color')
31925
- }
31926
- ),
31927
- z2: 2,
31928
- silent: true
31929
- })));
31930
- }
31931
- },
31932
-
31933
- /**
31934
- * @param {module:echarts/coord/cartesian/AxisModel} axisModel
31935
- * @param {module:echarts/coord/cartesian/GridModel} gridModel
31936
- * @private
31937
- */
31938
- axisLabel: function () {
31939
31957
  var opt = this.opt;
31940
- var axisModel = this.axisModel;
31941
- var axis = axisModel.axis;
31942
- var show = retrieve(opt.axisLabelShow, axisModel.get('axisLabel.show'));
31943
-
31944
- if (!show || axis.scale.isBlank()) {
31945
- return;
31946
- }
31947
-
31948
- var labelModel = axisModel.getModel('axisLabel');
31949
- var labelMargin = labelModel.get('margin');
31950
- var ticks = axis.scale.getTicks();
31951
- var labels = axisModel.getFormattedLabels();
31952
-
31953
- // Special label rotate.
31954
- var labelRotation = (
31955
- retrieve(opt.labelRotate, labelModel.get('rotate')) || 0
31956
- ) * PI / 180;
31957
-
31958
- var labelLayout = innerTextLayout(opt.rotation, labelRotation, opt.labelDirection);
31959
- var categoryData = axisModel.get('data');
31960
-
31961
- var textEls = [];
31962
- var silent = isSilent(axisModel);
31963
- var triggerEvent = axisModel.get('triggerEvent');
31964
-
31965
- zrUtil.each(ticks, function (tickVal, index) {
31966
- if (ifIgnoreOnTick(axis, index, opt.labelInterval)) {
31967
- return;
31968
- }
31969
-
31970
- var itemLabelModel = labelModel;
31971
- if (categoryData && categoryData[tickVal] && categoryData[tickVal].textStyle) {
31972
- itemLabelModel = new Model(
31973
- categoryData[tickVal].textStyle, labelModel, axisModel.ecModel
31974
- );
31975
- }
31976
-
31977
- var textColor = itemLabelModel.getTextColor()
31978
- || axisModel.get('axisLine.lineStyle.color');
31979
-
31980
- var tickCoord = axis.dataToCoord(tickVal);
31981
- var pos = [
31982
- tickCoord,
31983
- opt.labelOffset + opt.labelDirection * labelMargin
31984
- ];
31985
- var labelStr = axis.scale.getLabel(tickVal);
31986
-
31987
- var textEl = new graphic.Text({
31988
- // Id for animation
31989
- anid: 'label_' + tickVal,
31990
- position: pos,
31991
- rotation: labelLayout.rotation,
31992
- silent: silent,
31993
- z2: 10
31994
- });
31995
-
31996
- graphic.setTextStyle(textEl.style, itemLabelModel, {
31997
- text: labels[index],
31998
- textAlign: itemLabelModel.getShallow('align', true)
31999
- || labelLayout.textAlign,
32000
- textVerticalAlign: itemLabelModel.getShallow('verticalAlign', true)
32001
- || itemLabelModel.getShallow('baseline', true)
32002
- || labelLayout.textVerticalAlign,
32003
- textFill: typeof textColor === 'function'
32004
- ? textColor(
32005
- // (1) In category axis with data zoom, tick is not the original
32006
- // index of axis.data. So tick should not be exposed to user
32007
- // in category axis.
32008
- // (2) Compatible with previous version, which always returns labelStr.
32009
- // But in interval scale labelStr is like '223,445', which maked
32010
- // user repalce ','. So we modify it to return original val but remain
32011
- // it as 'string' to avoid error in replacing.
32012
- axis.type === 'category' ? labelStr : axis.type === 'value' ? tickVal + '' : tickVal,
32013
- index
32014
- )
32015
- : textColor
32016
- });
32017
-
32018
- // Pack data for mouse event
32019
- if (triggerEvent) {
32020
- textEl.eventData = makeAxisEventDataBase(axisModel);
32021
- textEl.eventData.targetType = 'axisLabel';
32022
- textEl.eventData.value = labelStr;
32023
- }
32024
-
32025
- // FIXME
32026
- this._dumbGroup.add(textEl);
32027
- textEl.updateTransform();
32028
-
32029
- textEls.push(textEl);
32030
- this.group.add(textEl);
32031
-
32032
- textEl.decomposeTransform();
32033
31958
 
32034
- }, this);
31959
+ var tickEls = buildAxisTick(this, axisModel, opt);
31960
+ var labelEls = buildAxisLabel(this, axisModel, opt);
32035
31961
 
32036
- fixMinMaxLabelShow(axisModel, textEls);
31962
+ fixMinMaxLabelShow(axisModel, labelEls, tickEls);
32037
31963
  },
32038
31964
 
32039
31965
  /**
@@ -32062,7 +31988,7 @@ return /******/ (function(modules) { // webpackBootstrap
32062
31988
  ? extent[1] + gapSignal * gap
32063
31989
  : (extent[0] + extent[1]) / 2, // 'middle'
32064
31990
  // Reuse labelOffset.
32065
- nameLocation === 'middle' ? opt.labelOffset + nameDirection * gap : 0
31991
+ isNameLocationCenter(nameLocation) ? opt.labelOffset + nameDirection * gap : 0
32066
31992
  ];
32067
31993
 
32068
31994
  var labelLayout;
@@ -32074,7 +32000,7 @@ return /******/ (function(modules) { // webpackBootstrap
32074
32000
 
32075
32001
  var axisNameAvailableWidth;
32076
32002
 
32077
- if (nameLocation === 'middle') {
32003
+ if (isNameLocationCenter(nameLocation)) {
32078
32004
  labelLayout = innerTextLayout(
32079
32005
  opt.rotation,
32080
32006
  nameRotation != null ? nameRotation : opt.rotation, // Adapt to axis.
@@ -32255,32 +32181,64 @@ return /******/ (function(modules) { // webpackBootstrap
32255
32181
  );
32256
32182
  }
32257
32183
 
32258
- function fixMinMaxLabelShow(axisModel, textEls) {
32184
+ function fixMinMaxLabelShow(axisModel, labelEls, tickEls) {
32259
32185
  // If min or max are user set, we need to check
32260
32186
  // If the tick on min(max) are overlap on their neighbour tick
32261
32187
  // If they are overlapped, we need to hide the min(max) tick label
32262
32188
  var showMinLabel = axisModel.get('axisLabel.showMinLabel');
32263
32189
  var showMaxLabel = axisModel.get('axisLabel.showMaxLabel');
32264
- var firstLabel = textEls[0];
32265
- var nextLabel = textEls[1];
32266
- var lastLabel = textEls[textEls.length - 1];
32267
- var prevLabel = textEls[textEls.length - 2];
32190
+
32191
+ // FIXME
32192
+ // Have not consider onBand yet, where tick els is more than label els.
32193
+
32194
+ labelEls = labelEls || [];
32195
+ tickEls = tickEls || [];
32196
+
32197
+ var firstLabel = labelEls[0];
32198
+ var nextLabel = labelEls[1];
32199
+ var lastLabel = labelEls[labelEls.length - 1];
32200
+ var prevLabel = labelEls[labelEls.length - 2];
32201
+
32202
+ var firstTick = tickEls[0];
32203
+ var nextTick = tickEls[1];
32204
+ var lastTick = tickEls[tickEls.length - 1];
32205
+ var prevTick = tickEls[tickEls.length - 2];
32268
32206
 
32269
32207
  if (showMinLabel === false) {
32270
- firstLabel.ignore = true;
32208
+ ignoreEl(firstLabel);
32209
+ ignoreEl(firstTick);
32271
32210
  }
32272
- else if (axisModel.getMin() != null && isTwoLabelOverlapped(firstLabel, nextLabel)) {
32273
- showMinLabel ? (nextLabel.ignore = true) : (firstLabel.ignore = true);
32211
+ else if (isTwoLabelOverlapped(firstLabel, nextLabel)) {
32212
+ if (showMinLabel) {
32213
+ ignoreEl(nextLabel);
32214
+ ignoreEl(nextTick);
32215
+ }
32216
+ else {
32217
+ ignoreEl(firstLabel);
32218
+ ignoreEl(firstTick);
32219
+ }
32274
32220
  }
32275
32221
 
32276
32222
  if (showMaxLabel === false) {
32277
- lastLabel.ignore = true;
32223
+ ignoreEl(lastLabel);
32224
+ ignoreEl(lastTick);
32278
32225
  }
32279
- else if (axisModel.getMax() != null && isTwoLabelOverlapped(prevLabel, lastLabel)) {
32280
- showMaxLabel ? (prevLabel.ignore = true) : (lastLabel.ignore = true);
32226
+ else if (isTwoLabelOverlapped(prevLabel, lastLabel)) {
32227
+ if (showMaxLabel) {
32228
+ ignoreEl(prevLabel);
32229
+ ignoreEl(prevTick);
32230
+ }
32231
+ else {
32232
+ ignoreEl(lastLabel);
32233
+ ignoreEl(lastTick);
32234
+ }
32281
32235
  }
32282
32236
  }
32283
32237
 
32238
+ function ignoreEl(el) {
32239
+ el && (el.ignore = true);
32240
+ }
32241
+
32284
32242
  function isTwoLabelOverlapped(current, next, labelLayout) {
32285
32243
  // current and next has the same rotation.
32286
32244
  var firstRect = current && current.getBoundingRect().clone();
@@ -32301,11 +32259,28 @@ return /******/ (function(modules) { // webpackBootstrap
32301
32259
  return firstRect.intersect(nextRect);
32302
32260
  }
32303
32261
 
32262
+ function isNameLocationCenter(nameLocation) {
32263
+ return nameLocation === 'middle' || nameLocation === 'center';
32264
+ }
32304
32265
 
32305
32266
  /**
32306
32267
  * @static
32307
32268
  */
32308
- var ifIgnoreOnTick = AxisBuilder.ifIgnoreOnTick = function (axis, i, interval) {
32269
+ var ifIgnoreOnTick = AxisBuilder.ifIgnoreOnTick = function (
32270
+ axis,
32271
+ i,
32272
+ interval,
32273
+ ticksCnt,
32274
+ showMinLabel,
32275
+ showMaxLabel
32276
+ ) {
32277
+ if (i === 0 && showMinLabel || i === ticksCnt - 1 && showMaxLabel) {
32278
+ return false;
32279
+ }
32280
+
32281
+ // FIXME
32282
+ // Have not consider label overlap (if label is too long) yet.
32283
+
32309
32284
  var rawTick;
32310
32285
  var scale = axis.scale;
32311
32286
  return scale.type === 'ordinal'
@@ -32330,6 +32305,187 @@ return /******/ (function(modules) { // webpackBootstrap
32330
32305
  return interval;
32331
32306
  };
32332
32307
 
32308
+ function buildAxisTick(axisBuilder, axisModel, opt) {
32309
+ var axis = axisModel.axis;
32310
+
32311
+ if (!axisModel.get('axisTick.show') || axis.scale.isBlank()) {
32312
+ return;
32313
+ }
32314
+
32315
+ var tickModel = axisModel.getModel('axisTick');
32316
+
32317
+ var lineStyleModel = tickModel.getModel('lineStyle');
32318
+ var tickLen = tickModel.get('length');
32319
+
32320
+ var tickInterval = getInterval(tickModel, opt.labelInterval);
32321
+ var ticksCoords = axis.getTicksCoords(tickModel.get('alignWithLabel'));
32322
+ // FIXME
32323
+ // Corresponds to ticksCoords ?
32324
+ var ticks = axis.scale.getTicks();
32325
+
32326
+ var showMinLabel = axisModel.get('axisLabel.showMinLabel');
32327
+ var showMaxLabel = axisModel.get('axisLabel.showMaxLabel');
32328
+
32329
+ var pt1 = [];
32330
+ var pt2 = [];
32331
+ var matrix = axisBuilder._transform;
32332
+
32333
+ var tickEls = [];
32334
+
32335
+ var ticksCnt = ticksCoords.length;
32336
+ for (var i = 0; i < ticksCnt; i++) {
32337
+ // Only ordinal scale support tick interval
32338
+ if (ifIgnoreOnTick(
32339
+ axis, i, tickInterval, ticksCnt,
32340
+ showMinLabel, showMaxLabel
32341
+ )) {
32342
+ continue;
32343
+ }
32344
+
32345
+ var tickCoord = ticksCoords[i];
32346
+
32347
+ pt1[0] = tickCoord;
32348
+ pt1[1] = 0;
32349
+ pt2[0] = tickCoord;
32350
+ pt2[1] = opt.tickDirection * tickLen;
32351
+
32352
+ if (matrix) {
32353
+ v2ApplyTransform(pt1, pt1, matrix);
32354
+ v2ApplyTransform(pt2, pt2, matrix);
32355
+ }
32356
+ // Tick line, Not use group transform to have better line draw
32357
+ var tickEl = new graphic.Line(graphic.subPixelOptimizeLine({
32358
+ // Id for animation
32359
+ anid: 'tick_' + ticks[i],
32360
+
32361
+ shape: {
32362
+ x1: pt1[0],
32363
+ y1: pt1[1],
32364
+ x2: pt2[0],
32365
+ y2: pt2[1]
32366
+ },
32367
+ style: zrUtil.defaults(
32368
+ lineStyleModel.getLineStyle(),
32369
+ {
32370
+ stroke: axisModel.get('axisLine.lineStyle.color')
32371
+ }
32372
+ ),
32373
+ z2: 2,
32374
+ silent: true
32375
+ }));
32376
+ axisBuilder.group.add(tickEl);
32377
+ tickEls.push(tickEl);
32378
+ }
32379
+
32380
+ return tickEls;
32381
+ }
32382
+
32383
+ function buildAxisLabel(axisBuilder, axisModel, opt) {
32384
+ var axis = axisModel.axis;
32385
+ var show = retrieve(opt.axisLabelShow, axisModel.get('axisLabel.show'));
32386
+
32387
+ if (!show || axis.scale.isBlank()) {
32388
+ return;
32389
+ }
32390
+
32391
+ var labelModel = axisModel.getModel('axisLabel');
32392
+ var labelMargin = labelModel.get('margin');
32393
+ var ticks = axis.scale.getTicks();
32394
+ var labels = axisModel.getFormattedLabels();
32395
+
32396
+ // Special label rotate.
32397
+ var labelRotation = (
32398
+ retrieve(opt.labelRotate, labelModel.get('rotate')) || 0
32399
+ ) * PI / 180;
32400
+
32401
+ var labelLayout = innerTextLayout(opt.rotation, labelRotation, opt.labelDirection);
32402
+ var categoryData = axisModel.get('data');
32403
+
32404
+ var labelEls = [];
32405
+ var silent = isSilent(axisModel);
32406
+ var triggerEvent = axisModel.get('triggerEvent');
32407
+
32408
+ var showMinLabel = axisModel.get('axisLabel.showMinLabel');
32409
+ var showMaxLabel = axisModel.get('axisLabel.showMaxLabel');
32410
+
32411
+ zrUtil.each(ticks, function (tickVal, index) {
32412
+ if (ifIgnoreOnTick(
32413
+ axis, index, opt.labelInterval, ticks.length,
32414
+ showMinLabel, showMaxLabel
32415
+ )) {
32416
+ return;
32417
+ }
32418
+
32419
+ var itemLabelModel = labelModel;
32420
+ if (categoryData && categoryData[tickVal] && categoryData[tickVal].textStyle) {
32421
+ itemLabelModel = new Model(
32422
+ categoryData[tickVal].textStyle, labelModel, axisModel.ecModel
32423
+ );
32424
+ }
32425
+
32426
+ var textColor = itemLabelModel.getTextColor()
32427
+ || axisModel.get('axisLine.lineStyle.color');
32428
+
32429
+ var tickCoord = axis.dataToCoord(tickVal);
32430
+ var pos = [
32431
+ tickCoord,
32432
+ opt.labelOffset + opt.labelDirection * labelMargin
32433
+ ];
32434
+ var labelStr = axis.scale.getLabel(tickVal);
32435
+
32436
+ var textEl = new graphic.Text({
32437
+ // Id for animation
32438
+ anid: 'label_' + tickVal,
32439
+ position: pos,
32440
+ rotation: labelLayout.rotation,
32441
+ silent: silent,
32442
+ z2: 10
32443
+ });
32444
+
32445
+ graphic.setTextStyle(textEl.style, itemLabelModel, {
32446
+ text: labels[index],
32447
+ textAlign: itemLabelModel.getShallow('align', true)
32448
+ || labelLayout.textAlign,
32449
+ textVerticalAlign: itemLabelModel.getShallow('verticalAlign', true)
32450
+ || itemLabelModel.getShallow('baseline', true)
32451
+ || labelLayout.textVerticalAlign,
32452
+ textFill: typeof textColor === 'function'
32453
+ ? textColor(
32454
+ // (1) In category axis with data zoom, tick is not the original
32455
+ // index of axis.data. So tick should not be exposed to user
32456
+ // in category axis.
32457
+ // (2) Compatible with previous version, which always returns labelStr.
32458
+ // But in interval scale labelStr is like '223,445', which maked
32459
+ // user repalce ','. So we modify it to return original val but remain
32460
+ // it as 'string' to avoid error in replacing.
32461
+ axis.type === 'category' ? labelStr : axis.type === 'value' ? tickVal + '' : tickVal,
32462
+ index
32463
+ )
32464
+ : textColor
32465
+ });
32466
+
32467
+ // Pack data for mouse event
32468
+ if (triggerEvent) {
32469
+ textEl.eventData = makeAxisEventDataBase(axisModel);
32470
+ textEl.eventData.targetType = 'axisLabel';
32471
+ textEl.eventData.value = labelStr;
32472
+ }
32473
+
32474
+ // FIXME
32475
+ axisBuilder._dumbGroup.add(textEl);
32476
+ textEl.updateTransform();
32477
+
32478
+ labelEls.push(textEl);
32479
+ axisBuilder.group.add(textEl);
32480
+
32481
+ textEl.decomposeTransform();
32482
+
32483
+ });
32484
+
32485
+ return labelEls;
32486
+ }
32487
+
32488
+
32333
32489
  module.exports = AxisBuilder;
32334
32490
 
32335
32491
 
@@ -32968,10 +33124,10 @@ return /******/ (function(modules) { // webpackBootstrap
32968
33124
  // }
32969
33125
  // },
32970
33126
  itemStyle: {
32971
- normal: {
33127
+ // normal: {
32972
33128
  // color: '各异'
32973
- },
32974
- emphasis: {}
33129
+ // },
33130
+ // emphasis: {}
32975
33131
  }
32976
33132
  }
32977
33133
  });
@@ -33796,8 +33952,10 @@ return /******/ (function(modules) { // webpackBootstrap
33796
33952
  startAngle: 90,
33797
33953
  // 最小角度改为0
33798
33954
  minAngle: 0,
33799
- // 选中是扇区偏移量
33955
+ // 选中时扇区偏移量
33800
33956
  selectedOffset: 10,
33957
+ // 高亮扇区偏移量
33958
+ hoverOffset: 10,
33801
33959
 
33802
33960
  // If use strategy to avoid label overlapping
33803
33961
  avoidLabelOverlap: true,
@@ -34132,7 +34290,7 @@ return /******/ (function(modules) { // webpackBootstrap
34132
34290
  sector.stopAnimation(true);
34133
34291
  sector.animateTo({
34134
34292
  shape: {
34135
- r: layout.r + 10
34293
+ r: layout.r + seriesModel.get('hoverOffset')
34136
34294
  }
34137
34295
  }, 300, 'elasticOut');
34138
34296
  }
@@ -35640,7 +35798,7 @@ return /******/ (function(modules) { // webpackBootstrap
35640
35798
  var graphic = __webpack_require__(20);
35641
35799
 
35642
35800
  var axisBuilderAttrs = [
35643
- 'axisLine', 'axisLabel', 'axisTick', 'axisName'
35801
+ 'axisLine', 'axisTickLabel', 'axisName'
35644
35802
  ];
35645
35803
 
35646
35804
  module.exports = __webpack_require__(1).extendComponentView({
@@ -37386,7 +37544,7 @@ return /******/ (function(modules) { // webpackBootstrap
37386
37544
  var vector = __webpack_require__(10);
37387
37545
  var matrix = __webpack_require__(11);
37388
37546
 
37389
- var Transformable = __webpack_require__(30);
37547
+ var Transformable = __webpack_require__(28);
37390
37548
  var zrUtil = __webpack_require__(4);
37391
37549
 
37392
37550
  var BoundingRect = __webpack_require__(9);
@@ -38372,7 +38530,7 @@ return /******/ (function(modules) { // webpackBootstrap
38372
38530
  */
38373
38531
 
38374
38532
 
38375
- var Eventful = __webpack_require__(29);
38533
+ var Eventful = __webpack_require__(27);
38376
38534
  var zrUtil = __webpack_require__(4);
38377
38535
  var eventTool = __webpack_require__(93);
38378
38536
  var interactionMutex = __webpack_require__(187);
@@ -38482,7 +38640,9 @@ return /******/ (function(modules) { // webpackBootstrap
38482
38640
 
38483
38641
 
38484
38642
  function mousedown(e) {
38485
- if (e.target && e.target.draggable) {
38643
+ if (eventTool.notLeftMouse(e)
38644
+ || (e.target && e.target.draggable)
38645
+ ) {
38486
38646
  return;
38487
38647
  }
38488
38648
 
@@ -38499,15 +38659,12 @@ return /******/ (function(modules) { // webpackBootstrap
38499
38659
  }
38500
38660
 
38501
38661
  function mousemove(e) {
38502
- if (!checkKeyBinding(this, 'moveOnMouseMove', e) || !this._dragging) {
38503
- return;
38504
- }
38505
-
38506
- if (e.gestureEvent === 'pinch') {
38507
- return;
38508
- }
38509
-
38510
- if (interactionMutex.isTaken(this._zr, 'globalPan')) {
38662
+ if (eventTool.notLeftMouse(e)
38663
+ || !checkKeyBinding(this, 'moveOnMouseMove', e)
38664
+ || !this._dragging
38665
+ || e.gestureEvent === 'pinch'
38666
+ || interactionMutex.isTaken(this._zr, 'globalPan')
38667
+ ) {
38511
38668
  return;
38512
38669
  }
38513
38670
 
@@ -38529,7 +38686,9 @@ return /******/ (function(modules) { // webpackBootstrap
38529
38686
  }
38530
38687
 
38531
38688
  function mouseup(e) {
38532
- this._dragging = false;
38689
+ if (!eventTool.notLeftMouse(e)) {
38690
+ this._dragging = false;
38691
+ }
38533
38692
  }
38534
38693
 
38535
38694
  function mousewheel(e) {
@@ -40178,12 +40337,6 @@ return /******/ (function(modules) { // webpackBootstrap
40178
40337
  * @private
40179
40338
  */
40180
40339
  this._state = 'ready';
40181
-
40182
- /**
40183
- * @private
40184
- * @type {boolean}
40185
- */
40186
- this._mayClick;
40187
40340
  },
40188
40341
 
40189
40342
  /**
@@ -40508,8 +40661,6 @@ return /******/ (function(modules) { // webpackBootstrap
40508
40661
  * @private
40509
40662
  */
40510
40663
  _onPan: function (dx, dy) {
40511
- this._mayClick = false;
40512
-
40513
40664
  if (this._state !== 'animating'
40514
40665
  && (Math.abs(dx) > DRAG_THRESHOLD || Math.abs(dy) > DRAG_THRESHOLD)
40515
40666
  ) {
@@ -40542,8 +40693,6 @@ return /******/ (function(modules) { // webpackBootstrap
40542
40693
  * @private
40543
40694
  */
40544
40695
  _onZoom: function (scale, mouseX, mouseY) {
40545
- this._mayClick = false;
40546
-
40547
40696
  if (this._state !== 'animating') {
40548
40697
  // These param must not be cached.
40549
40698
  var root = this.seriesModel.getData().tree.root;
@@ -40591,25 +40740,11 @@ return /******/ (function(modules) { // webpackBootstrap
40591
40740
  * @private
40592
40741
  */
40593
40742
  _initEvents: function (containerGroup) {
40594
- // FIXME
40595
- // 不用click以及silent的原因是,animate时视图设置silent true来避免click生效,
40596
- // 但是animate中,按下鼠标,animate结束后(silent设回为false)松开鼠标,
40597
- // 还是会触发click,期望是不触发。
40598
-
40599
- // Mousedown occurs when drag start, and mouseup occurs when drag end,
40600
- // click event should not be triggered in that case.
40601
-
40602
- containerGroup.on('mousedown', function (e) {
40603
- this._state === 'ready' && (this._mayClick = true);
40604
- }, this);
40605
- containerGroup.on('mouseup', function (e) {
40606
- if (this._mayClick) {
40607
- this._mayClick = false;
40608
- this._state === 'ready' && onClick.call(this, e);
40743
+ containerGroup.on('click', function (e) {
40744
+ if (this._state !== 'ready') {
40745
+ return;
40609
40746
  }
40610
- }, this);
40611
40747
 
40612
- function onClick(e) {
40613
40748
  var nodeClick = this.seriesModel.get('nodeClick', true);
40614
40749
 
40615
40750
  if (!nodeClick) {
@@ -40637,7 +40772,8 @@ return /******/ (function(modules) { // webpackBootstrap
40637
40772
  link && window.open(link, linkTarget);
40638
40773
  }
40639
40774
  }
40640
- }
40775
+
40776
+ }, this);
40641
40777
  },
40642
40778
 
40643
40779
  /**
@@ -41362,7 +41498,7 @@ return /******/ (function(modules) { // webpackBootstrap
41362
41498
 
41363
41499
 
41364
41500
  var VisualMapping = __webpack_require__(206);
41365
- var zrColor = __webpack_require__(35);
41501
+ var zrColor = __webpack_require__(33);
41366
41502
  var zrUtil = __webpack_require__(4);
41367
41503
  var isArray = zrUtil.isArray;
41368
41504
 
@@ -41597,7 +41733,7 @@ return /******/ (function(modules) { // webpackBootstrap
41597
41733
 
41598
41734
 
41599
41735
  var zrUtil = __webpack_require__(4);
41600
- var zrColor = __webpack_require__(35);
41736
+ var zrColor = __webpack_require__(33);
41601
41737
  var linearMap = __webpack_require__(7).linearMap;
41602
41738
  var each = zrUtil.each;
41603
41739
  var isObject = zrUtil.isObject;
@@ -41735,7 +41871,7 @@ return /******/ (function(modules) { // webpackBootstrap
41735
41871
  // which will be much faster and useful in pixel manipulation
41736
41872
  var returnRGBArray = !!out;
41737
41873
  !isNormalized && (value = this._normalizeData(value));
41738
- out = zrColor.fastMapToColor(value, thisOption.parsedVisual, out);
41874
+ out = zrColor.fastLerp(value, thisOption.parsedVisual, out);
41739
41875
  return returnRGBArray ? out : zrColor.stringify(out, 'rgba');
41740
41876
  },
41741
41877
  this
@@ -41745,7 +41881,7 @@ return /******/ (function(modules) { // webpackBootstrap
41745
41881
  _doMap: {
41746
41882
  linear: function (normalized) {
41747
41883
  return zrColor.stringify(
41748
- zrColor.fastMapToColor(normalized, this.option.parsedVisual),
41884
+ zrColor.fastLerp(normalized, this.option.parsedVisual),
41749
41885
  'rgba'
41750
41886
  );
41751
41887
  },
@@ -41754,7 +41890,7 @@ return /******/ (function(modules) { // webpackBootstrap
41754
41890
  var result = getSpecifiedVisual.call(this, value);
41755
41891
  if (result == null) {
41756
41892
  result = zrColor.stringify(
41757
- zrColor.fastMapToColor(normalized, this.option.parsedVisual),
41893
+ zrColor.fastLerp(normalized, this.option.parsedVisual),
41758
41894
  'rgba'
41759
41895
  );
41760
41896
  }
@@ -47808,7 +47944,7 @@ return /******/ (function(modules) { // webpackBootstrap
47808
47944
  var brushHelper = __webpack_require__(249);
47809
47945
  var graphic = __webpack_require__(20);
47810
47946
 
47811
- var elementList = ['axisLine', 'axisLabel', 'axisTick', 'axisName'];
47947
+ var elementList = ['axisLine', 'axisTickLabel', 'axisName'];
47812
47948
 
47813
47949
  var AxisView = __webpack_require__(1).extendComponentView({
47814
47950
 
@@ -47997,7 +48133,7 @@ return /******/ (function(modules) { // webpackBootstrap
47997
48133
 
47998
48134
 
47999
48135
 
48000
- var Eventful = __webpack_require__(29);
48136
+ var Eventful = __webpack_require__(27);
48001
48137
  var zrUtil = __webpack_require__(4);
48002
48138
  var graphic = __webpack_require__(20);
48003
48139
  var interactionMutex = __webpack_require__(187);
@@ -50572,7 +50708,11 @@ return /******/ (function(modules) { // webpackBootstrap
50572
50708
  var data = option.data;
50573
50709
 
50574
50710
  addOrdinal && zrUtil.each(data, function (item, index) {
50575
- zrUtil.isArray(item) && item.unshift(index);
50711
+ if (item.value && zrUtil.isArray(item.value)) {
50712
+ item.value.unshift(index);
50713
+ } else {
50714
+ zrUtil.isArray(item) && item.unshift(index);
50715
+ }
50576
50716
  });
50577
50717
 
50578
50718
  var defaultValueDimensions = this.defaultValueDimensions;
@@ -50640,6 +50780,7 @@ return /******/ (function(modules) { // webpackBootstrap
50640
50780
  };
50641
50781
 
50642
50782
 
50783
+
50643
50784
  /***/ }),
50644
50785
  /* 263 */
50645
50786
  /***/ (function(module, exports, __webpack_require__) {
@@ -51432,6 +51573,8 @@ return /******/ (function(modules) { // webpackBootstrap
51432
51573
  return;
51433
51574
  }
51434
51575
 
51576
+ var dataIndex = 0;
51577
+
51435
51578
  data.each([cDim].concat(vDims), function () {
51436
51579
  var args = arguments;
51437
51580
  var axisDimVal = args[0];
@@ -51465,9 +51608,30 @@ return /******/ (function(modules) { // webpackBootstrap
51465
51608
  addBodyEnd(ocHighPoint, 0);
51466
51609
  addBodyEnd(ocLowPoint, 1);
51467
51610
 
51611
+ var sign;
51612
+ if (openVal > closeVal) {
51613
+ sign = -1;
51614
+ }
51615
+ else if (openVal < closeVal) {
51616
+ sign = 1;
51617
+ }
51618
+ else {
51619
+ // If close === open, compare with close of last record
51620
+ if (dataIndex > 0) {
51621
+ sign = data.getItemModel(dataIndex - 1).get()[2]
51622
+ <= closeVal
51623
+ ? 1
51624
+ : -1;
51625
+ }
51626
+ else {
51627
+ // No record of previous, set to be positive
51628
+ sign = 1;
51629
+ }
51630
+ }
51631
+
51468
51632
  data.setItemLayout(idx, {
51469
51633
  chartLayout: chartLayout,
51470
- sign: openVal > closeVal ? -1 : openVal < closeVal ? 1 : 0,
51634
+ sign: sign,
51471
51635
  initBaseline: openVal > closeVal
51472
51636
  ? ocHighPoint[constDim] : ocLowPoint[constDim], // open point.
51473
51637
  bodyEnds: bodyEnds,
@@ -51475,6 +51639,8 @@ return /******/ (function(modules) { // webpackBootstrap
51475
51639
  brushRect: makeBrushRect()
51476
51640
  });
51477
51641
 
51642
+ ++dataIndex;
51643
+
51478
51644
  function getPoint(val) {
51479
51645
  var p = [];
51480
51646
  p[variableDim] = axisDimVal;
@@ -52150,9 +52316,13 @@ return /******/ (function(modules) { // webpackBootstrap
52150
52316
  var zr = api.getZr();
52151
52317
  // Avoid the drag cause ghost shadow
52152
52318
  // FIXME Better way ?
52153
- zr.painter.getLayer(zlevel).clear(true);
52319
+ // SVG doesn't support
52320
+ var isSvg = zr.painter.getType() === 'svg';
52321
+ if (!isSvg) {
52322
+ zr.painter.getLayer(zlevel).clear(true);
52323
+ }
52154
52324
  // Config layer with motion blur
52155
- if (this._lastZlevel != null) {
52325
+ if (this._lastZlevel != null && !isSvg) {
52156
52326
  zr.configLayer(this._lastZlevel, {
52157
52327
  motionBlur: false
52158
52328
  });
@@ -52168,10 +52338,12 @@ return /******/ (function(modules) { // webpackBootstrap
52168
52338
  notInIndividual && console.warn('Lines with trail effect should have an individual zlevel');
52169
52339
  }
52170
52340
 
52171
- zr.configLayer(zlevel, {
52172
- motionBlur: true,
52173
- lastFrameAlpha: Math.max(Math.min(trailLength / 10 + 0.9, 1), 0)
52174
- });
52341
+ if (!isSvg) {
52342
+ zr.configLayer(zlevel, {
52343
+ motionBlur: true,
52344
+ lastFrameAlpha: Math.max(Math.min(trailLength / 10 + 0.9, 1), 0)
52345
+ });
52346
+ }
52175
52347
  }
52176
52348
 
52177
52349
  this.group.add(lineDraw.group);
@@ -52185,11 +52357,20 @@ return /******/ (function(modules) { // webpackBootstrap
52185
52357
  this._lineDraw.updateLayout(seriesModel);
52186
52358
  // Not use motion when dragging or zooming
52187
52359
  var zr = api.getZr();
52188
- zr.painter.getLayer(this._lastZlevel).clear(true);
52360
+ var isSvg = zr.painter.getType() === 'svg';
52361
+ if (!isSvg) {
52362
+ zr.painter.getLayer(this._lastZlevel).clear(true);
52363
+ }
52189
52364
  },
52190
52365
 
52191
52366
  remove: function (ecModel, api) {
52192
52367
  this._lineDraw && this._lineDraw.remove(api, true);
52368
+ // Clear motion when lineDraw is removed
52369
+ var zr = api.getZr();
52370
+ var isSvg = zr.painter.getType() === 'svg';
52371
+ if (!isSvg) {
52372
+ zr.painter.getLayer(this._lastZlevel).clear(true);
52373
+ }
52193
52374
  },
52194
52375
 
52195
52376
  dispose: function () {}
@@ -54682,7 +54863,7 @@ return /******/ (function(modules) { // webpackBootstrap
54682
54863
  var ifIgnoreOnTick = AxisBuilder.ifIgnoreOnTick;
54683
54864
 
54684
54865
  var axisBuilderAttrs = [
54685
- 'axisLine', 'axisLabel', 'axisTick', 'axisName'
54866
+ 'axisLine', 'axisTickLabel', 'axisName'
54686
54867
  ];
54687
54868
 
54688
54869
  var selfBuilderAttr = 'splitLine';
@@ -54740,8 +54921,14 @@ return /******/ (function(modules) { // webpackBootstrap
54740
54921
  var p1 = [];
54741
54922
  var p2 = [];
54742
54923
 
54924
+ var showMinLabel = axisModel.get('axisLabel.showMinLabel');
54925
+ var showMaxLabel = axisModel.get('axisLabel.showMaxLabel');
54926
+
54743
54927
  for (var i = 0; i < ticksCoords.length; ++i) {
54744
- if (ifIgnoreOnTick(axis, i, lineInterval)) {
54928
+ if (ifIgnoreOnTick(
54929
+ axis, i, lineInterval, ticksCoords.length,
54930
+ showMinLabel, showMaxLabel
54931
+ )) {
54745
54932
  continue;
54746
54933
  }
54747
54934
  var tickCoord = axis.toGlobalCoord(ticksCoords[i]);
@@ -61190,7 +61377,7 @@ return /******/ (function(modules) { // webpackBootstrap
61190
61377
 
61191
61378
 
61192
61379
  var zrUtil = __webpack_require__(4);
61193
- var zrColor = __webpack_require__(35);
61380
+ var zrColor = __webpack_require__(33);
61194
61381
  var eventUtil = __webpack_require__(93);
61195
61382
  var formatUtil = __webpack_require__(6);
61196
61383
  var each = zrUtil.each;
@@ -62350,7 +62537,7 @@ return /******/ (function(modules) { // webpackBootstrap
62350
62537
  var AxisBuilder = __webpack_require__(138);
62351
62538
 
62352
62539
  var axisBuilderAttrs = [
62353
- 'axisLine', 'axisLabel', 'axisTick', 'axisName'
62540
+ 'axisLine', 'axisTickLabel', 'axisName'
62354
62541
  ];
62355
62542
  var selfBuilderAttrs = [
62356
62543
  'splitLine', 'splitArea'
@@ -64680,6 +64867,7 @@ return /******/ (function(modules) { // webpackBootstrap
64680
64867
 
64681
64868
  var featureManager = __webpack_require__(364);
64682
64869
  var zrUtil = __webpack_require__(4);
64870
+ var lang = __webpack_require__(365).toolbox.brush;
64683
64871
 
64684
64872
  function Brush(model, ecModel, api) {
64685
64873
  this.model = model;
@@ -64710,14 +64898,8 @@ return /******/ (function(modules) { // webpackBootstrap
64710
64898
  keep: 'M4,10.5V1h10.3 M20.7,1h6.1 M33,1h6.1 M55.4,10.5V1H45.2 M4,17.3v6.6 M55.6,17.3v6.6 M4,30.5V40h10.3 M20.7,40 h6.1 M33,40h6.1 M55.4,30.5V40H45.2 M21,18.9h62.9v48.6H21V18.9z', // jshint ignore:line
64711
64899
  clear: 'M22,14.7l30.9,31 M52.9,14.7L22,45.7 M4.7,16.8V4.2h13.1 M26,4.2h7.8 M41.6,4.2h7.8 M70.3,16.8V4.2H57.2 M4.7,25.9v8.6 M70.3,25.9v8.6 M4.7,43.2v12.6h13.1 M26,55.8h7.8 M41.6,55.8h7.8 M70.3,43.2v12.6H57.2' // jshint ignore:line
64712
64900
  },
64713
- title: {
64714
- rect: '矩形选择',
64715
- polygon: '圈选',
64716
- lineX: '横向选择',
64717
- lineY: '纵向选择',
64718
- keep: '保持选择',
64719
- clear: '清除选择'
64720
- }
64901
+ // `rect`, `polygon`, `lineX`, `lineY`, `keep`, `clear`
64902
+ title: zrUtil.clone(lang.title)
64721
64903
  };
64722
64904
 
64723
64905
  var proto = Brush.prototype;
@@ -64825,6 +65007,54 @@ return /******/ (function(modules) { // webpackBootstrap
64825
65007
 
64826
65008
  /***/ }),
64827
65009
  /* 365 */
65010
+ /***/ (function(module, exports) {
65011
+
65012
+
65013
+
65014
+ module.exports = {
65015
+ toolbox: {
65016
+ brush: {
65017
+ title: {
65018
+ rect: '矩形选择',
65019
+ polygon: '圈选',
65020
+ lineX: '横向选择',
65021
+ lineY: '纵向选择',
65022
+ keep: '保持选择',
65023
+ clear: '清除选择'
65024
+ }
65025
+ },
65026
+ dataView: {
65027
+ title: '数据视图',
65028
+ lang: ['数据视图', '关闭', '刷新']
65029
+ },
65030
+ dataZoom: {
65031
+ title: {
65032
+ zoom: '区域缩放',
65033
+ back: '区域缩放还原'
65034
+ }
65035
+ },
65036
+ magicType: {
65037
+ title: {
65038
+ line: '切换为折线图',
65039
+ bar: '切换为柱状图',
65040
+ stack: '切换为堆叠',
65041
+ tiled: '切换为平铺'
65042
+ }
65043
+ },
65044
+ restore: {
65045
+ title: '还原'
65046
+ },
65047
+ saveAsImage: {
65048
+ title: '保存为图片',
65049
+ lang: ['右键另存为图片']
65050
+ }
65051
+ }
65052
+ };
65053
+
65054
+
65055
+
65056
+ /***/ }),
65057
+ /* 366 */
64828
65058
  /***/ (function(module, exports, __webpack_require__) {
64829
65059
 
64830
65060
  'use strict';
@@ -64835,15 +65065,15 @@ return /******/ (function(modules) { // webpackBootstrap
64835
65065
 
64836
65066
 
64837
65067
 
64838
- __webpack_require__(366);
64839
65068
  __webpack_require__(367);
64840
65069
  __webpack_require__(368);
65070
+ __webpack_require__(369);
64841
65071
 
64842
65072
 
64843
65073
 
64844
65074
 
64845
65075
  /***/ }),
64846
- /* 366 */
65076
+ /* 367 */
64847
65077
  /***/ (function(module, exports, __webpack_require__) {
64848
65078
 
64849
65079
  'use strict';
@@ -64854,7 +65084,7 @@ return /******/ (function(modules) { // webpackBootstrap
64854
65084
  var zrUtil = __webpack_require__(4);
64855
65085
 
64856
65086
  // (24*60*60*1000)
64857
- var ONE_DAY = 86400000;
65087
+ var PROXIMATE_ONE_DAY = 86400000;
64858
65088
 
64859
65089
  /**
64860
65090
  * Calendar
@@ -64923,7 +65153,16 @@ return /******/ (function(modules) { // webpackBootstrap
64923
65153
  * get date info
64924
65154
  *
64925
65155
  * @param {string|number} date date
64926
- * @return {Object} info
65156
+ * @return {Object}
65157
+ * {
65158
+ * y: string, local full year, eg., '1940',
65159
+ * m: string, local month, from '01' ot '12',
65160
+ * d: string, local date, from '01' to '31' (if exists),
65161
+ * day: It is not date.getDay(). It is the location of the cell in a week, from 0 to 6,
65162
+ * time: timestamp,
65163
+ * formatedDate: string, yyyy-MM-dd,
65164
+ * date: original date object.
65165
+ * }
64927
65166
  */
64928
65167
  getDateInfo: function (date) {
64929
65168
 
@@ -64958,9 +65197,10 @@ return /******/ (function(modules) { // webpackBootstrap
64958
65197
  return this.getDateInfo(date);
64959
65198
  }
64960
65199
 
64961
- var time = this.getDateInfo(date).time;
65200
+ date = new Date(this.getDateInfo(date).time);
65201
+ date.setDate(date.getDate() + n);
64962
65202
 
64963
- return this.getDateInfo(time + ONE_DAY * n);
65203
+ return this.getDateInfo(date);
64964
65204
  },
64965
65205
 
64966
65206
  update: function (ecModel, api) {
@@ -65026,18 +65266,18 @@ return /******/ (function(modules) { // webpackBootstrap
65026
65266
  }
65027
65267
 
65028
65268
  var week = dayInfo.day;
65029
- var nthWeek = this._getRangeInfo([range.start.time, date]).weeks;
65269
+ var nthWeek = this._getRangeInfo([range.start.time, date]).nthWeek;
65030
65270
 
65031
65271
  if (this._orient === 'vertical') {
65032
65272
  return [
65033
65273
  this._rect.x + week * this._sw + this._sw / 2,
65034
- this._rect.y + (nthWeek - 1) * this._sh + this._sh / 2
65274
+ this._rect.y + nthWeek * this._sh + this._sh / 2
65035
65275
  ];
65036
65276
 
65037
65277
  }
65038
65278
 
65039
65279
  return [
65040
- this._rect.x + (nthWeek - 1) * this._sw + this._sw / 2,
65280
+ this._rect.x + nthWeek * this._sw + this._sw / 2,
65041
65281
  this._rect.y + week * this._sh + this._sh / 2
65042
65282
  ];
65043
65283
 
@@ -65175,25 +65415,60 @@ return /******/ (function(modules) { // webpackBootstrap
65175
65415
  *
65176
65416
  * @private
65177
65417
  * @param {Array} range range ['2017-01-01', '2017-07-08']
65418
+ * If range[0] > range[1], they will not be reversed.
65178
65419
  * @return {Object} obj
65179
65420
  */
65180
65421
  _getRangeInfo: function (range) {
65422
+ range = [
65423
+ this.getDateInfo(range[0]),
65424
+ this.getDateInfo(range[1])
65425
+ ];
65426
+
65427
+ var reversed;
65428
+ if (range[0].time > range[1].time) {
65429
+ reversed = true;
65430
+ range.reverse();
65431
+ }
65181
65432
 
65182
- var start = this.getDateInfo(range[0]);
65183
- var end = this.getDateInfo(range[1]);
65433
+ var allDay = Math.floor(range[1].time / PROXIMATE_ONE_DAY)
65434
+ - Math.floor(range[0].time / PROXIMATE_ONE_DAY) + 1;
65184
65435
 
65185
- var allDay = Math.floor(end.time / ONE_DAY) - Math.floor(start.time / ONE_DAY) + 1;
65436
+ // Consider case:
65437
+ // Firstly set system timezone as "Time Zone: America/Toronto",
65438
+ // ```
65439
+ // var first = new Date(1478412000000 - 3600 * 1000 * 2.5);
65440
+ // var second = new Date(1478412000000);
65441
+ // var allDays = Math.floor(second / ONE_DAY) - Math.floor(first / ONE_DAY) + 1;
65442
+ // ```
65443
+ // will get wrong result because of DST. So we should fix it.
65444
+ var date = new Date(range[0].time);
65445
+ var startDateNum = date.getDate();
65446
+ var endDateNum = range[1].date.getDate();
65447
+ date.setDate(startDateNum + allDay - 1);
65448
+ // The bias can not over a month, so just compare date.
65449
+ if (date.getDate() !== endDateNum) {
65450
+ var sign = date.getTime() - range[1].time > 0 ? 1 : -1;
65451
+ while (date.getDate() !== endDateNum && (date.getTime() - range[1].time) * sign > 0) {
65452
+ allDay -= sign;
65453
+ date.setDate(startDateNum + allDay - 1);
65454
+ }
65455
+ }
65186
65456
 
65187
- var weeks = Math.floor((allDay + start.day + 6) / 7);
65457
+ var weeks = Math.floor((allDay + range[0].day + 6) / 7);
65458
+ var nthWeek = reversed ? -weeks + 1: weeks - 1;
65459
+
65460
+ reversed && range.reverse();
65188
65461
 
65189
65462
  return {
65190
- range: [start.formatedDate, end.formatedDate],
65191
- start: start,
65192
- end: end,
65463
+ range: [range[0].formatedDate, range[1].formatedDate],
65464
+ start: range[0],
65465
+ end: range[1],
65193
65466
  allDay: allDay,
65194
65467
  weeks: weeks,
65195
- fweek: start.day,
65196
- lweek: end.day
65468
+ // From 0.
65469
+ nthWeek: nthWeek,
65470
+ fweek: range[0].day,
65471
+ lweek: range[1].day
65197
65472
  };
65198
65473
  },
65199
65474
 
@@ -65217,11 +65492,10 @@ return /******/ (function(modules) { // webpackBootstrap
65217
65492
  }
65218
65493
 
65219
65494
  var nthDay = (nthWeek - 1) * 7 - rangeInfo.fweek + day;
65495
+ var date = new Date(rangeInfo.start.time);
65496
+ date.setDate(rangeInfo.start.d + nthDay);
65220
65497
 
65221
- var time = rangeInfo.start.time + nthDay * ONE_DAY;
65222
-
65223
- return this.getDateInfo(time);
65224
-
65498
+ return this.getDateInfo(date);
65225
65499
  }
65226
65500
  };
65227
65501
 
@@ -65267,7 +65541,7 @@ return /******/ (function(modules) { // webpackBootstrap
65267
65541
 
65268
65542
 
65269
65543
  /***/ }),
65270
- /* 367 */
65544
+ /* 368 */
65271
65545
  /***/ (function(module, exports, __webpack_require__) {
65272
65546
 
65273
65547
  'use strict';
@@ -65415,7 +65689,7 @@ return /******/ (function(modules) { // webpackBootstrap
65415
65689
 
65416
65690
 
65417
65691
  /***/ }),
65418
- /* 368 */
65692
+ /* 369 */
65419
65693
  /***/ (function(module, exports, __webpack_require__) {
65420
65694
 
65421
65695
  'use strict';
@@ -65901,7 +66175,7 @@ return /******/ (function(modules) { // webpackBootstrap
65901
66175
 
65902
66176
 
65903
66177
  /***/ }),
65904
- /* 369 */
66178
+ /* 370 */
65905
66179
  /***/ (function(module, exports, __webpack_require__) {
65906
66180
 
65907
66181
  'use strict';
@@ -66114,7 +66388,7 @@ return /******/ (function(modules) { // webpackBootstrap
66114
66388
 
66115
66389
 
66116
66390
  /***/ }),
66117
- /* 370 */
66391
+ /* 371 */
66118
66392
  /***/ (function(module, exports, __webpack_require__) {
66119
66393
 
66120
66394
  /**
@@ -66122,24 +66396,24 @@ return /******/ (function(modules) { // webpackBootstrap
66122
66396
  */
66123
66397
 
66124
66398
 
66125
- __webpack_require__(371);
66126
-
66127
66399
  __webpack_require__(372);
66128
- __webpack_require__(375);
66129
66400
 
66401
+ __webpack_require__(373);
66130
66402
  __webpack_require__(376);
66131
- __webpack_require__(377);
66132
66403
 
66404
+ __webpack_require__(377);
66133
66405
  __webpack_require__(378);
66406
+
66134
66407
  __webpack_require__(379);
66408
+ __webpack_require__(380);
66135
66409
 
66136
- __webpack_require__(381);
66137
66410
  __webpack_require__(382);
66411
+ __webpack_require__(383);
66138
66412
 
66139
66413
 
66140
66414
 
66141
66415
  /***/ }),
66142
- /* 371 */
66416
+ /* 372 */
66143
66417
  /***/ (function(module, exports, __webpack_require__) {
66144
66418
 
66145
66419
 
@@ -66152,7 +66426,7 @@ return /******/ (function(modules) { // webpackBootstrap
66152
66426
 
66153
66427
 
66154
66428
  /***/ }),
66155
- /* 372 */
66429
+ /* 373 */
66156
66430
  /***/ (function(module, exports, __webpack_require__) {
66157
66431
 
66158
66432
  /**
@@ -66164,8 +66438,8 @@ return /******/ (function(modules) { // webpackBootstrap
66164
66438
  var env = __webpack_require__(2);
66165
66439
  var echarts = __webpack_require__(1);
66166
66440
  var modelUtil = __webpack_require__(5);
66167
- var helper = __webpack_require__(373);
66168
- var AxisProxy = __webpack_require__(374);
66441
+ var helper = __webpack_require__(374);
66442
+ var AxisProxy = __webpack_require__(375);
66169
66443
  var each = zrUtil.each;
66170
66444
  var eachAxisDim = helper.eachAxisDim;
66171
66445
 
@@ -66714,7 +66988,7 @@ return /******/ (function(modules) { // webpackBootstrap
66714
66988
 
66715
66989
 
66716
66990
  /***/ }),
66717
- /* 373 */
66991
+ /* 374 */
66718
66992
  /***/ (function(module, exports, __webpack_require__) {
66719
66993
 
66720
66994
 
@@ -66852,7 +67126,7 @@ return /******/ (function(modules) { // webpackBootstrap
66852
67126
 
66853
67127
 
66854
67128
  /***/ }),
66855
- /* 374 */
67129
+ /* 375 */
66856
67130
  /***/ (function(module, exports, __webpack_require__) {
66857
67131
 
66858
67132
  /**
@@ -66862,7 +67136,7 @@ return /******/ (function(modules) { // webpackBootstrap
66862
67136
 
66863
67137
  var zrUtil = __webpack_require__(4);
66864
67138
  var numberUtil = __webpack_require__(7);
66865
- var helper = __webpack_require__(373);
67139
+ var helper = __webpack_require__(374);
66866
67140
  var each = zrUtil.each;
66867
67141
  var asc = numberUtil.asc;
66868
67142
 
@@ -67326,7 +67600,7 @@ return /******/ (function(modules) { // webpackBootstrap
67326
67600
 
67327
67601
 
67328
67602
  /***/ }),
67329
- /* 375 */
67603
+ /* 376 */
67330
67604
  /***/ (function(module, exports, __webpack_require__) {
67331
67605
 
67332
67606
 
@@ -67403,7 +67677,7 @@ return /******/ (function(modules) { // webpackBootstrap
67403
67677
 
67404
67678
 
67405
67679
  /***/ }),
67406
- /* 376 */
67680
+ /* 377 */
67407
67681
  /***/ (function(module, exports, __webpack_require__) {
67408
67682
 
67409
67683
  /**
@@ -67411,7 +67685,7 @@ return /******/ (function(modules) { // webpackBootstrap
67411
67685
  */
67412
67686
 
67413
67687
 
67414
- var DataZoomModel = __webpack_require__(372);
67688
+ var DataZoomModel = __webpack_require__(373);
67415
67689
 
67416
67690
  var SliderZoomModel = DataZoomModel.extend({
67417
67691
 
@@ -67482,7 +67756,7 @@ return /******/ (function(modules) { // webpackBootstrap
67482
67756
 
67483
67757
 
67484
67758
  /***/ }),
67485
- /* 377 */
67759
+ /* 378 */
67486
67760
  /***/ (function(module, exports, __webpack_require__) {
67487
67761
 
67488
67762
 
@@ -67490,7 +67764,7 @@ return /******/ (function(modules) { // webpackBootstrap
67490
67764
  var zrUtil = __webpack_require__(4);
67491
67765
  var graphic = __webpack_require__(20);
67492
67766
  var throttle = __webpack_require__(86);
67493
- var DataZoomView = __webpack_require__(375);
67767
+ var DataZoomView = __webpack_require__(376);
67494
67768
  var Rect = graphic.Rect;
67495
67769
  var numberUtil = __webpack_require__(7);
67496
67770
  var linearMap = numberUtil.linearMap;
@@ -68278,7 +68552,7 @@ return /******/ (function(modules) { // webpackBootstrap
68278
68552
 
68279
68553
 
68280
68554
  /***/ }),
68281
- /* 378 */
68555
+ /* 379 */
68282
68556
  /***/ (function(module, exports, __webpack_require__) {
68283
68557
 
68284
68558
  /**
@@ -68286,7 +68560,7 @@ return /******/ (function(modules) { // webpackBootstrap
68286
68560
  */
68287
68561
 
68288
68562
 
68289
- module.exports = __webpack_require__(372).extend({
68563
+ module.exports = __webpack_require__(373).extend({
68290
68564
 
68291
68565
  type: 'dataZoom.inside',
68292
68566
 
@@ -68304,15 +68578,15 @@ return /******/ (function(modules) { // webpackBootstrap
68304
68578
 
68305
68579
 
68306
68580
  /***/ }),
68307
- /* 379 */
68581
+ /* 380 */
68308
68582
  /***/ (function(module, exports, __webpack_require__) {
68309
68583
 
68310
68584
 
68311
68585
 
68312
- var DataZoomView = __webpack_require__(375);
68586
+ var DataZoomView = __webpack_require__(376);
68313
68587
  var zrUtil = __webpack_require__(4);
68314
68588
  var sliderMove = __webpack_require__(242);
68315
- var roams = __webpack_require__(380);
68589
+ var roams = __webpack_require__(381);
68316
68590
  var bind = zrUtil.bind;
68317
68591
 
68318
68592
  var InsideZoomView = DataZoomView.extend({
@@ -68532,7 +68806,7 @@ return /******/ (function(modules) { // webpackBootstrap
68532
68806
 
68533
68807
 
68534
68808
  /***/ }),
68535
- /* 380 */
68809
+ /* 381 */
68536
68810
  /***/ (function(module, exports, __webpack_require__) {
68537
68811
 
68538
68812
  /**
@@ -68756,7 +69030,7 @@ return /******/ (function(modules) { // webpackBootstrap
68756
69030
 
68757
69031
 
68758
69032
  /***/ }),
68759
- /* 381 */
69033
+ /* 382 */
68760
69034
  /***/ (function(module, exports, __webpack_require__) {
68761
69035
 
68762
69036
  /**
@@ -68819,7 +69093,7 @@ return /******/ (function(modules) { // webpackBootstrap
68819
69093
 
68820
69094
 
68821
69095
  /***/ }),
68822
- /* 382 */
69096
+ /* 383 */
68823
69097
  /***/ (function(module, exports, __webpack_require__) {
68824
69098
 
68825
69099
  /**
@@ -68828,7 +69102,7 @@ return /******/ (function(modules) { // webpackBootstrap
68828
69102
 
68829
69103
 
68830
69104
  var zrUtil = __webpack_require__(4);
68831
- var helper = __webpack_require__(373);
69105
+ var helper = __webpack_require__(374);
68832
69106
  var echarts = __webpack_require__(1);
68833
69107
 
68834
69108
 
@@ -68867,7 +69141,7 @@ return /******/ (function(modules) { // webpackBootstrap
68867
69141
 
68868
69142
 
68869
69143
  /***/ }),
68870
- /* 383 */
69144
+ /* 384 */
68871
69145
  /***/ (function(module, exports, __webpack_require__) {
68872
69146
 
68873
69147
  /**
@@ -68875,13 +69149,13 @@ return /******/ (function(modules) { // webpackBootstrap
68875
69149
  */
68876
69150
 
68877
69151
 
68878
- __webpack_require__(384);
68879
- __webpack_require__(395);
69152
+ __webpack_require__(385);
69153
+ __webpack_require__(396);
68880
69154
 
68881
69155
 
68882
69156
 
68883
69157
  /***/ }),
68884
- /* 384 */
69158
+ /* 385 */
68885
69159
  /***/ (function(module, exports, __webpack_require__) {
68886
69160
 
68887
69161
  /**
@@ -68890,19 +69164,19 @@ return /******/ (function(modules) { // webpackBootstrap
68890
69164
 
68891
69165
 
68892
69166
  __webpack_require__(1).registerPreprocessor(
68893
- __webpack_require__(385)
69167
+ __webpack_require__(386)
68894
69168
  );
68895
69169
 
68896
- __webpack_require__(386);
68897
69170
  __webpack_require__(387);
68898
69171
  __webpack_require__(388);
68899
- __webpack_require__(391);
68900
- __webpack_require__(394);
69172
+ __webpack_require__(389);
69173
+ __webpack_require__(392);
69174
+ __webpack_require__(395);
68901
69175
 
68902
69176
 
68903
69177
 
68904
69178
  /***/ }),
68905
- /* 385 */
69179
+ /* 386 */
68906
69180
  /***/ (function(module, exports, __webpack_require__) {
68907
69181
 
68908
69182
  /**
@@ -68954,7 +69228,7 @@ return /******/ (function(modules) { // webpackBootstrap
68954
69228
 
68955
69229
 
68956
69230
  /***/ }),
68957
- /* 386 */
69231
+ /* 387 */
68958
69232
  /***/ (function(module, exports, __webpack_require__) {
68959
69233
 
68960
69234
 
@@ -68978,7 +69252,7 @@ return /******/ (function(modules) { // webpackBootstrap
68978
69252
 
68979
69253
 
68980
69254
  /***/ }),
68981
- /* 387 */
69255
+ /* 388 */
68982
69256
  /***/ (function(module, exports, __webpack_require__) {
68983
69257
 
68984
69258
  /**
@@ -69068,7 +69342,7 @@ return /******/ (function(modules) { // webpackBootstrap
69068
69342
 
69069
69343
 
69070
69344
  /***/ }),
69071
- /* 388 */
69345
+ /* 389 */
69072
69346
  /***/ (function(module, exports, __webpack_require__) {
69073
69347
 
69074
69348
  /**
@@ -69076,7 +69350,7 @@ return /******/ (function(modules) { // webpackBootstrap
69076
69350
  */
69077
69351
 
69078
69352
 
69079
- var VisualMapModel = __webpack_require__(389);
69353
+ var VisualMapModel = __webpack_require__(390);
69080
69354
  var zrUtil = __webpack_require__(4);
69081
69355
  var numberUtil = __webpack_require__(7);
69082
69356
 
@@ -69102,7 +69376,8 @@ return /******/ (function(modules) { // webpackBootstrap
69102
69376
  itemWidth: null, // The length of the other side.
69103
69377
  hoverLink: true, // Enable hover highlight.
69104
69378
  hoverLinkDataSize: null,// The size of hovered data.
69105
- hoverLinkOnHandle: true // Whether trigger hoverLink when hover handle.
69379
+ hoverLinkOnHandle: null // Whether trigger hoverLink when hover handle.
69380
+ // If not specified, follow the value of `realtime`.
69106
69381
  },
69107
69382
 
69108
69383
  /**
@@ -69111,7 +69386,6 @@ return /******/ (function(modules) { // webpackBootstrap
69111
69386
  optionUpdated: function (newOption, isInit) {
69112
69387
  ContinuousModel.superApply(this, 'optionUpdated', arguments);
69113
69388
 
69114
- this.resetTargetSeries();
69115
69389
  this.resetExtent();
69116
69390
 
69117
69391
  this.resetVisual(function (mappingOption) {
@@ -69322,7 +69596,7 @@ return /******/ (function(modules) { // webpackBootstrap
69322
69596
 
69323
69597
 
69324
69598
  /***/ }),
69325
- /* 389 */
69599
+ /* 390 */
69326
69600
  /***/ (function(module, exports, __webpack_require__) {
69327
69601
 
69328
69602
  /**
@@ -69333,7 +69607,7 @@ return /******/ (function(modules) { // webpackBootstrap
69333
69607
  var echarts = __webpack_require__(1);
69334
69608
  var zrUtil = __webpack_require__(4);
69335
69609
  var env = __webpack_require__(2);
69336
- var visualDefault = __webpack_require__(390);
69610
+ var visualDefault = __webpack_require__(391);
69337
69611
  var VisualMapping = __webpack_require__(206);
69338
69612
  var visualSolution = __webpack_require__(357);
69339
69613
  var mapVisual = VisualMapping.mapVisual;
@@ -69391,7 +69665,8 @@ return /******/ (function(modules) { // webpackBootstrap
69391
69665
  zlevel: 0,
69392
69666
  z: 4,
69393
69667
 
69394
- seriesIndex: null, // 所控制的series indices,默认所有有value的series.
69668
+ seriesIndex: 'all', // 'all' or null/undefined: all series.
69669
+ // A number or an array of number: the specified series.
69395
69670
 
69396
69671
  // set min: 0, max: 200, only for campatible with ec2.
69397
69672
  // In fact min max should not have default value.
@@ -69508,26 +69783,31 @@ return /******/ (function(modules) { // webpackBootstrap
69508
69783
  );
69509
69784
  },
69510
69785
 
69511
-
69512
69786
  /**
69513
69787
  * @protected
69788
+ * @return {Array.<number>} An array of series indices.
69514
69789
  */
69515
- resetTargetSeries: function () {
69516
- var thisOption = this.option;
69517
- var allSeriesIndex = thisOption.seriesIndex == null;
69518
- thisOption.seriesIndex = allSeriesIndex
69519
- ? [] : modelUtil.normalizeToArray(thisOption.seriesIndex);
69790
+ getTargetSeriesIndices: function () {
69791
+ var optionSeriesIndex = this.option.seriesIndex;
69792
+ var seriesIndices = [];
69520
69793
 
69521
- allSeriesIndex && this.ecModel.eachSeries(function (seriesModel, index) {
69522
- thisOption.seriesIndex.push(index);
69523
- });
69794
+ if (optionSeriesIndex == null || optionSeriesIndex === 'all') {
69795
+ this.ecModel.eachSeries(function (seriesModel, index) {
69796
+ seriesIndices.push(index);
69797
+ });
69798
+ }
69799
+ else {
69800
+ seriesIndices = modelUtil.normalizeToArray(optionSeriesIndex);
69801
+ }
69802
+
69803
+ return seriesIndices;
69524
69804
  },
69525
69805
 
69526
69806
  /**
69527
69807
  * @public
69528
69808
  */
69529
69809
  eachTargetSeries: function (callback, context) {
69530
- zrUtil.each(this.option.seriesIndex, function (seriesIndex) {
69810
+ zrUtil.each(this.getTargetSeriesIndices(), function (seriesIndex) {
69531
69811
  callback.call(context, this.ecModel.getSeriesByIndex(seriesIndex));
69532
69812
  }, this);
69533
69813
  },
@@ -69849,7 +70129,7 @@ return /******/ (function(modules) { // webpackBootstrap
69849
70129
 
69850
70130
 
69851
70131
  /***/ }),
69852
- /* 390 */
70132
+ /* 391 */
69853
70133
  /***/ (function(module, exports, __webpack_require__) {
69854
70134
 
69855
70135
  /**
@@ -69925,18 +70205,18 @@ return /******/ (function(modules) { // webpackBootstrap
69925
70205
 
69926
70206
 
69927
70207
  /***/ }),
69928
- /* 391 */
70208
+ /* 392 */
69929
70209
  /***/ (function(module, exports, __webpack_require__) {
69930
70210
 
69931
70211
 
69932
70212
 
69933
- var VisualMapView = __webpack_require__(392);
70213
+ var VisualMapView = __webpack_require__(393);
69934
70214
  var graphic = __webpack_require__(20);
69935
70215
  var zrUtil = __webpack_require__(4);
69936
70216
  var numberUtil = __webpack_require__(7);
69937
70217
  var sliderMove = __webpack_require__(242);
69938
70218
  var LinearGradient = __webpack_require__(68);
69939
- var helper = __webpack_require__(393);
70219
+ var helper = __webpack_require__(394);
69940
70220
  var modelUtil = __webpack_require__(5);
69941
70221
  var eventTool = __webpack_require__(93);
69942
70222
 
@@ -70536,7 +70816,6 @@ return /******/ (function(modules) { // webpackBootstrap
70536
70816
  // For hover link show when hover handle, which might be
70537
70817
  // below or upper than sizeExtent.
70538
70818
  pos[1] = mathMin(mathMax(0, pos[1]), itemSize[1]);
70539
-
70540
70819
  self._doHoverLinkToSeries(
70541
70820
  pos[1],
70542
70821
  0 <= pos[0] && pos[0] <= itemSize[0]
@@ -70623,6 +70902,7 @@ return /******/ (function(modules) { // webpackBootstrap
70623
70902
  }
70624
70903
 
70625
70904
  var resultBatches = modelUtil.compressBatches(oldBatch, newBatch);
70905
+
70626
70906
  this._dispatchHighDown('downplay', helper.convertDataIndex(resultBatches[0]));
70627
70907
  this._dispatchHighDown('highlight', helper.convertDataIndex(resultBatches[1]));
70628
70908
  },
@@ -70669,7 +70949,6 @@ return /******/ (function(modules) { // webpackBootstrap
70669
70949
  this._hideIndicator();
70670
70950
 
70671
70951
  var indices = this._hoverLinkDataIndices;
70672
-
70673
70952
  this._dispatchHighDown('downplay', helper.convertDataIndex(indices));
70674
70953
 
70675
70954
  indices.length = 0;
@@ -70767,7 +71046,8 @@ return /******/ (function(modules) { // webpackBootstrap
70767
71046
  }
70768
71047
 
70769
71048
  function useHoverLinkOnHandle(visualMapModel) {
70770
- return !visualMapModel.get('realtime') && visualMapModel.get('hoverLinkOnHandle');
71049
+ var hoverLinkOnHandle = visualMapModel.get('hoverLinkOnHandle');
71050
+ return !!(hoverLinkOnHandle == null ? visualMapModel.get('realtime') : hoverLinkOnHandle);
70771
71051
  }
70772
71052
 
70773
71053
  function getCursor(orient) {
@@ -70779,7 +71059,7 @@ return /******/ (function(modules) { // webpackBootstrap
70779
71059
 
70780
71060
 
70781
71061
  /***/ }),
70782
- /* 392 */
71062
+ /* 393 */
70783
71063
  /***/ (function(module, exports, __webpack_require__) {
70784
71064
 
70785
71065
 
@@ -70939,7 +71219,7 @@ return /******/ (function(modules) { // webpackBootstrap
70939
71219
 
70940
71220
 
70941
71221
  /***/ }),
70942
- /* 393 */
71222
+ /* 394 */
70943
71223
  /***/ (function(module, exports, __webpack_require__) {
70944
71224
 
70945
71225
 
@@ -71011,7 +71291,7 @@ return /******/ (function(modules) { // webpackBootstrap
71011
71291
 
71012
71292
 
71013
71293
  /***/ }),
71014
- /* 394 */
71294
+ /* 395 */
71015
71295
  /***/ (function(module, exports, __webpack_require__) {
71016
71296
 
71017
71297
  /**
@@ -71039,7 +71319,7 @@ return /******/ (function(modules) { // webpackBootstrap
71039
71319
 
71040
71320
 
71041
71321
  /***/ }),
71042
- /* 395 */
71322
+ /* 396 */
71043
71323
  /***/ (function(module, exports, __webpack_require__) {
71044
71324
 
71045
71325
  /**
@@ -71048,27 +71328,27 @@ return /******/ (function(modules) { // webpackBootstrap
71048
71328
 
71049
71329
 
71050
71330
  __webpack_require__(1).registerPreprocessor(
71051
- __webpack_require__(385)
71331
+ __webpack_require__(386)
71052
71332
  );
71053
71333
 
71054
- __webpack_require__(386);
71055
71334
  __webpack_require__(387);
71056
- __webpack_require__(396);
71335
+ __webpack_require__(388);
71057
71336
  __webpack_require__(397);
71058
- __webpack_require__(394);
71337
+ __webpack_require__(398);
71338
+ __webpack_require__(395);
71059
71339
 
71060
71340
 
71061
71341
 
71062
71342
  /***/ }),
71063
- /* 396 */
71343
+ /* 397 */
71064
71344
  /***/ (function(module, exports, __webpack_require__) {
71065
71345
 
71066
71346
 
71067
71347
 
71068
- var VisualMapModel = __webpack_require__(389);
71348
+ var VisualMapModel = __webpack_require__(390);
71069
71349
  var zrUtil = __webpack_require__(4);
71070
71350
  var VisualMapping = __webpack_require__(206);
71071
- var visualDefault = __webpack_require__(390);
71351
+ var visualDefault = __webpack_require__(391);
71072
71352
  var reformIntervals = __webpack_require__(7).reformIntervals;
71073
71353
 
71074
71354
  var PiecewiseModel = VisualMapModel.extend({
@@ -71146,7 +71426,6 @@ return /******/ (function(modules) { // webpackBootstrap
71146
71426
  */
71147
71427
  this._pieceList = [];
71148
71428
 
71149
- this.resetTargetSeries();
71150
71429
  this.resetExtent();
71151
71430
 
71152
71431
  /**
@@ -71593,17 +71872,17 @@ return /******/ (function(modules) { // webpackBootstrap
71593
71872
 
71594
71873
 
71595
71874
  /***/ }),
71596
- /* 397 */
71875
+ /* 398 */
71597
71876
  /***/ (function(module, exports, __webpack_require__) {
71598
71877
 
71599
71878
 
71600
71879
 
71601
- var VisualMapView = __webpack_require__(392);
71880
+ var VisualMapView = __webpack_require__(393);
71602
71881
  var zrUtil = __webpack_require__(4);
71603
71882
  var graphic = __webpack_require__(20);
71604
71883
  var symbolCreators = __webpack_require__(114);
71605
71884
  var layout = __webpack_require__(74);
71606
- var helper = __webpack_require__(393);
71885
+ var helper = __webpack_require__(394);
71607
71886
 
71608
71887
  var PiecewiseVisualMapView = VisualMapView.extend({
71609
71888
 
@@ -71821,14 +72100,14 @@ return /******/ (function(modules) { // webpackBootstrap
71821
72100
 
71822
72101
 
71823
72102
  /***/ }),
71824
- /* 398 */
72103
+ /* 399 */
71825
72104
  /***/ (function(module, exports, __webpack_require__) {
71826
72105
 
71827
72106
  // HINT Markpoint can't be used too much
71828
72107
 
71829
72108
 
71830
- __webpack_require__(399);
71831
- __webpack_require__(401);
72109
+ __webpack_require__(400);
72110
+ __webpack_require__(402);
71832
72111
 
71833
72112
  __webpack_require__(1).registerPreprocessor(function (opt) {
71834
72113
  // Make sure markPoint component is enabled
@@ -71837,12 +72116,12 @@ return /******/ (function(modules) { // webpackBootstrap
71837
72116
 
71838
72117
 
71839
72118
  /***/ }),
71840
- /* 399 */
72119
+ /* 400 */
71841
72120
  /***/ (function(module, exports, __webpack_require__) {
71842
72121
 
71843
72122
 
71844
72123
 
71845
- module.exports = __webpack_require__(400).extend({
72124
+ module.exports = __webpack_require__(401).extend({
71846
72125
 
71847
72126
  type: 'markPoint',
71848
72127
 
@@ -71875,7 +72154,7 @@ return /******/ (function(modules) { // webpackBootstrap
71875
72154
 
71876
72155
 
71877
72156
  /***/ }),
71878
- /* 400 */
72157
+ /* 401 */
71879
72158
  /***/ (function(module, exports, __webpack_require__) {
71880
72159
 
71881
72160
 
@@ -72010,7 +72289,7 @@ return /******/ (function(modules) { // webpackBootstrap
72010
72289
 
72011
72290
 
72012
72291
  /***/ }),
72013
- /* 401 */
72292
+ /* 402 */
72014
72293
  /***/ (function(module, exports, __webpack_require__) {
72015
72294
 
72016
72295
 
@@ -72021,7 +72300,7 @@ return /******/ (function(modules) { // webpackBootstrap
72021
72300
 
72022
72301
  var List = __webpack_require__(101);
72023
72302
 
72024
- var markerHelper = __webpack_require__(402);
72303
+ var markerHelper = __webpack_require__(403);
72025
72304
 
72026
72305
  function updateMarkerLayout(mpData, seriesModel, api) {
72027
72306
  var coordSys = seriesModel.coordinateSystem;
@@ -72059,7 +72338,7 @@ return /******/ (function(modules) { // webpackBootstrap
72059
72338
  });
72060
72339
  }
72061
72340
 
72062
- __webpack_require__(403).extend({
72341
+ __webpack_require__(404).extend({
72063
72342
 
72064
72343
  type: 'markPoint',
72065
72344
 
@@ -72169,7 +72448,7 @@ return /******/ (function(modules) { // webpackBootstrap
72169
72448
 
72170
72449
 
72171
72450
  /***/ }),
72172
- /* 402 */
72451
+ /* 403 */
72173
72452
  /***/ (function(module, exports, __webpack_require__) {
72174
72453
 
72175
72454
 
@@ -72374,7 +72653,7 @@ return /******/ (function(modules) { // webpackBootstrap
72374
72653
 
72375
72654
 
72376
72655
  /***/ }),
72377
- /* 403 */
72656
+ /* 404 */
72378
72657
  /***/ (function(module, exports, __webpack_require__) {
72379
72658
 
72380
72659
 
@@ -72416,13 +72695,13 @@ return /******/ (function(modules) { // webpackBootstrap
72416
72695
 
72417
72696
 
72418
72697
  /***/ }),
72419
- /* 404 */
72698
+ /* 405 */
72420
72699
  /***/ (function(module, exports, __webpack_require__) {
72421
72700
 
72422
72701
 
72423
72702
 
72424
- __webpack_require__(405);
72425
72703
  __webpack_require__(406);
72704
+ __webpack_require__(407);
72426
72705
 
72427
72706
  __webpack_require__(1).registerPreprocessor(function (opt) {
72428
72707
  // Make sure markLine component is enabled
@@ -72431,12 +72710,12 @@ return /******/ (function(modules) { // webpackBootstrap
72431
72710
 
72432
72711
 
72433
72712
  /***/ }),
72434
- /* 405 */
72713
+ /* 406 */
72435
72714
  /***/ (function(module, exports, __webpack_require__) {
72436
72715
 
72437
72716
 
72438
72717
 
72439
- module.exports = __webpack_require__(400).extend({
72718
+ module.exports = __webpack_require__(401).extend({
72440
72719
 
72441
72720
  type: 'markLine',
72442
72721
 
@@ -72476,7 +72755,7 @@ return /******/ (function(modules) { // webpackBootstrap
72476
72755
 
72477
72756
 
72478
72757
  /***/ }),
72479
- /* 406 */
72758
+ /* 407 */
72480
72759
  /***/ (function(module, exports, __webpack_require__) {
72481
72760
 
72482
72761
 
@@ -72485,7 +72764,7 @@ return /******/ (function(modules) { // webpackBootstrap
72485
72764
  var List = __webpack_require__(101);
72486
72765
  var numberUtil = __webpack_require__(7);
72487
72766
 
72488
- var markerHelper = __webpack_require__(402);
72767
+ var markerHelper = __webpack_require__(403);
72489
72768
 
72490
72769
  var LineDraw = __webpack_require__(213);
72491
72770
 
@@ -72657,7 +72936,7 @@ return /******/ (function(modules) { // webpackBootstrap
72657
72936
  data.setItemLayout(idx, point);
72658
72937
  }
72659
72938
 
72660
- __webpack_require__(403).extend({
72939
+ __webpack_require__(404).extend({
72661
72940
 
72662
72941
  type: 'markLine',
72663
72942
 
@@ -72834,13 +73113,13 @@ return /******/ (function(modules) { // webpackBootstrap
72834
73113
 
72835
73114
 
72836
73115
  /***/ }),
72837
- /* 407 */
73116
+ /* 408 */
72838
73117
  /***/ (function(module, exports, __webpack_require__) {
72839
73118
 
72840
73119
 
72841
73120
 
72842
- __webpack_require__(408);
72843
73121
  __webpack_require__(409);
73122
+ __webpack_require__(410);
72844
73123
 
72845
73124
  __webpack_require__(1).registerPreprocessor(function (opt) {
72846
73125
  // Make sure markArea component is enabled
@@ -72849,12 +73128,12 @@ return /******/ (function(modules) { // webpackBootstrap
72849
73128
 
72850
73129
 
72851
73130
  /***/ }),
72852
- /* 408 */
73131
+ /* 409 */
72853
73132
  /***/ (function(module, exports, __webpack_require__) {
72854
73133
 
72855
73134
 
72856
73135
 
72857
- module.exports = __webpack_require__(400).extend({
73136
+ module.exports = __webpack_require__(401).extend({
72858
73137
 
72859
73138
  type: 'markArea',
72860
73139
 
@@ -72890,7 +73169,7 @@ return /******/ (function(modules) { // webpackBootstrap
72890
73169
 
72891
73170
 
72892
73171
  /***/ }),
72893
- /* 409 */
73172
+ /* 410 */
72894
73173
  /***/ (function(module, exports, __webpack_require__) {
72895
73174
 
72896
73175
  // TODO Better on polar
@@ -72900,9 +73179,9 @@ return /******/ (function(modules) { // webpackBootstrap
72900
73179
  var List = __webpack_require__(101);
72901
73180
  var numberUtil = __webpack_require__(7);
72902
73181
  var graphic = __webpack_require__(20);
72903
- var colorUtil = __webpack_require__(35);
73182
+ var colorUtil = __webpack_require__(33);
72904
73183
 
72905
- var markerHelper = __webpack_require__(402);
73184
+ var markerHelper = __webpack_require__(403);
72906
73185
 
72907
73186
  var markAreaTransform = function (seriesModel, coordSys, maModel, item) {
72908
73187
  var lt = markerHelper.dataTransform(seriesModel, item[0]);
@@ -73022,7 +73301,7 @@ return /******/ (function(modules) { // webpackBootstrap
73022
73301
 
73023
73302
  var dimPermutations = [['x0', 'y0'], ['x1', 'y0'], ['x1', 'y1'], ['x0', 'y1']];
73024
73303
 
73025
- __webpack_require__(403).extend({
73304
+ __webpack_require__(404).extend({
73026
73305
 
73027
73306
  type: 'markArea',
73028
73307
 
@@ -73116,7 +73395,7 @@ return /******/ (function(modules) { // webpackBootstrap
73116
73395
  )
73117
73396
  );
73118
73397
 
73119
- polygon.hoverStyle = itemModel.getModel('itemStyle.normal').getItemStyle();
73398
+ polygon.hoverStyle = itemModel.getModel('itemStyle.emphasis').getItemStyle();
73120
73399
 
73121
73400
  graphic.setLabelStyle(
73122
73401
  polygon.style, polygon.hoverStyle, labelModel, labelHoverModel,
@@ -73195,7 +73474,7 @@ return /******/ (function(modules) { // webpackBootstrap
73195
73474
 
73196
73475
 
73197
73476
  /***/ }),
73198
- /* 410 */
73477
+ /* 411 */
73199
73478
  /***/ (function(module, exports, __webpack_require__) {
73200
73479
 
73201
73480
  /**
@@ -73205,17 +73484,17 @@ return /******/ (function(modules) { // webpackBootstrap
73205
73484
 
73206
73485
  var echarts = __webpack_require__(1);
73207
73486
 
73208
- echarts.registerPreprocessor(__webpack_require__(411));
73487
+ echarts.registerPreprocessor(__webpack_require__(412));
73209
73488
 
73210
- __webpack_require__(412);
73211
73489
  __webpack_require__(413);
73212
73490
  __webpack_require__(414);
73213
- __webpack_require__(416);
73491
+ __webpack_require__(415);
73492
+ __webpack_require__(417);
73214
73493
 
73215
73494
 
73216
73495
 
73217
73496
  /***/ }),
73218
- /* 411 */
73497
+ /* 412 */
73219
73498
  /***/ (function(module, exports, __webpack_require__) {
73220
73499
 
73221
73500
  /**
@@ -73306,7 +73585,7 @@ return /******/ (function(modules) { // webpackBootstrap
73306
73585
 
73307
73586
 
73308
73587
  /***/ }),
73309
- /* 412 */
73588
+ /* 413 */
73310
73589
  /***/ (function(module, exports, __webpack_require__) {
73311
73590
 
73312
73591
 
@@ -73319,7 +73598,7 @@ return /******/ (function(modules) { // webpackBootstrap
73319
73598
 
73320
73599
 
73321
73600
  /***/ }),
73322
- /* 413 */
73601
+ /* 414 */
73323
73602
  /***/ (function(module, exports, __webpack_require__) {
73324
73603
 
73325
73604
  /**
@@ -73369,7 +73648,7 @@ return /******/ (function(modules) { // webpackBootstrap
73369
73648
 
73370
73649
 
73371
73650
  /***/ }),
73372
- /* 414 */
73651
+ /* 415 */
73373
73652
  /***/ (function(module, exports, __webpack_require__) {
73374
73653
 
73375
73654
  /**
@@ -73377,7 +73656,7 @@ return /******/ (function(modules) { // webpackBootstrap
73377
73656
  */
73378
73657
 
73379
73658
 
73380
- var TimelineModel = __webpack_require__(415);
73659
+ var TimelineModel = __webpack_require__(416);
73381
73660
  var zrUtil = __webpack_require__(4);
73382
73661
  var modelUtil = __webpack_require__(5);
73383
73662
 
@@ -73483,7 +73762,7 @@ return /******/ (function(modules) { // webpackBootstrap
73483
73762
 
73484
73763
 
73485
73764
  /***/ }),
73486
- /* 415 */
73765
+ /* 416 */
73487
73766
  /***/ (function(module, exports, __webpack_require__) {
73488
73767
 
73489
73768
  /**
@@ -73683,7 +73962,7 @@ return /******/ (function(modules) { // webpackBootstrap
73683
73962
 
73684
73963
 
73685
73964
  /***/ }),
73686
- /* 416 */
73965
+ /* 417 */
73687
73966
  /***/ (function(module, exports, __webpack_require__) {
73688
73967
 
73689
73968
  /**
@@ -73694,8 +73973,8 @@ return /******/ (function(modules) { // webpackBootstrap
73694
73973
  var zrUtil = __webpack_require__(4);
73695
73974
  var graphic = __webpack_require__(20);
73696
73975
  var layout = __webpack_require__(74);
73697
- var TimelineView = __webpack_require__(417);
73698
- var TimelineAxis = __webpack_require__(418);
73976
+ var TimelineView = __webpack_require__(418);
73977
+ var TimelineAxis = __webpack_require__(419);
73699
73978
  var symbolUtil = __webpack_require__(114);
73700
73979
  var axisHelper = __webpack_require__(104);
73701
73980
  var BoundingRect = __webpack_require__(9);
@@ -74399,7 +74678,7 @@ return /******/ (function(modules) { // webpackBootstrap
74399
74678
 
74400
74679
 
74401
74680
  /***/ }),
74402
- /* 417 */
74681
+ /* 418 */
74403
74682
  /***/ (function(module, exports, __webpack_require__) {
74404
74683
 
74405
74684
  /**
@@ -74419,7 +74698,7 @@ return /******/ (function(modules) { // webpackBootstrap
74419
74698
 
74420
74699
 
74421
74700
  /***/ }),
74422
- /* 418 */
74701
+ /* 419 */
74423
74702
  /***/ (function(module, exports, __webpack_require__) {
74424
74703
 
74425
74704
 
@@ -74520,23 +74799,23 @@ return /******/ (function(modules) { // webpackBootstrap
74520
74799
 
74521
74800
 
74522
74801
  /***/ }),
74523
- /* 419 */
74802
+ /* 420 */
74524
74803
  /***/ (function(module, exports, __webpack_require__) {
74525
74804
 
74526
74805
 
74527
74806
 
74528
- __webpack_require__(420);
74529
74807
  __webpack_require__(421);
74530
-
74531
74808
  __webpack_require__(422);
74809
+
74532
74810
  __webpack_require__(423);
74533
74811
  __webpack_require__(424);
74534
74812
  __webpack_require__(425);
74535
- __webpack_require__(430);
74813
+ __webpack_require__(426);
74814
+ __webpack_require__(431);
74536
74815
 
74537
74816
 
74538
74817
  /***/ }),
74539
- /* 420 */
74818
+ /* 421 */
74540
74819
  /***/ (function(module, exports, __webpack_require__) {
74541
74820
 
74542
74821
 
@@ -74614,7 +74893,7 @@ return /******/ (function(modules) { // webpackBootstrap
74614
74893
 
74615
74894
 
74616
74895
  /***/ }),
74617
- /* 421 */
74896
+ /* 422 */
74618
74897
  /***/ (function(module, exports, __webpack_require__) {
74619
74898
 
74620
74899
  /* WEBPACK VAR INJECTION */(function(process) {
@@ -74857,12 +75136,13 @@ return /******/ (function(modules) { // webpackBootstrap
74857
75136
  /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(313)))
74858
75137
 
74859
75138
  /***/ }),
74860
- /* 422 */
75139
+ /* 423 */
74861
75140
  /***/ (function(module, exports, __webpack_require__) {
74862
75141
 
74863
75142
 
74864
75143
 
74865
75144
  var env = __webpack_require__(2);
75145
+ var lang = __webpack_require__(365).toolbox.saveAsImage;
74866
75146
 
74867
75147
  function SaveAsImage (model) {
74868
75148
  this.model = model;
@@ -74871,14 +75151,14 @@ return /******/ (function(modules) { // webpackBootstrap
74871
75151
  SaveAsImage.defaultOption = {
74872
75152
  show: true,
74873
75153
  icon: 'M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0',
74874
- title: '保存为图片',
75154
+ title: lang.title,
74875
75155
  type: 'png',
74876
75156
  // Default use option.backgroundColor
74877
75157
  // backgroundColor: '#fff',
74878
75158
  name: '',
74879
75159
  excludeComponents: ['toolbox'],
74880
75160
  pixelRatio: 1,
74881
- lang: ['右键另存为图片']
75161
+ lang: lang.lang.slice()
74882
75162
  };
74883
75163
 
74884
75164
  SaveAsImage.prototype.unusable = !env.canvasSupported;
@@ -74911,13 +75191,25 @@ return /******/ (function(modules) { // webpackBootstrap
74911
75191
  }
74912
75192
  // IE
74913
75193
  else {
74914
- var lang = model.get('lang');
74915
- var html = ''
74916
- + '<body style="margin:0;">'
74917
- + '<img src="' + url + '" style="max-width:100%;" title="' + ((lang && lang[0]) || '') + '" />'
74918
- + '</body>';
74919
- var tab = window.open();
74920
- tab.document.write(html);
75194
+ if (window.navigator.msSaveOrOpenBlob) {
75195
+ var bstr = atob(url.split(',')[1]);
75196
+ var n = bstr.length;
75197
+ var u8arr = new Uint8Array(n);
75198
+ while(n--) {
75199
+ u8arr[n] = bstr.charCodeAt(n);
75200
+ }
75201
+ var blob = new Blob([u8arr]);
75202
+ window.navigator.msSaveOrOpenBlob(blob, title + '.' + type);
75203
+ }
75204
+ else {
75205
+ var lang = model.get('lang');
75206
+ var html = '' +
75207
+ '<body style="margin:0;">' +
75208
+ '<img src="' + url + '" style="max-width:100%;" title="' + ((lang && lang[0]) || '') + '" />' +
75209
+ '</body>';
75210
+ var tab = window.open();
75211
+ tab.document.write(html);
75212
+ }
74921
75213
  }
74922
75214
  };
74923
75215
 
@@ -74928,14 +75220,16 @@ return /******/ (function(modules) { // webpackBootstrap
74928
75220
  module.exports = SaveAsImage;
74929
75221
 
74930
75222
 
75223
+
74931
75224
  /***/ }),
74932
- /* 423 */
75225
+ /* 424 */
74933
75226
  /***/ (function(module, exports, __webpack_require__) {
74934
75227
 
74935
75228
  'use strict';
74936
75229
 
74937
75230
 
74938
75231
  var zrUtil = __webpack_require__(4);
75232
+ var lang = __webpack_require__(365).toolbox.magicType;
74939
75233
 
74940
75234
  function MagicType(model) {
74941
75235
  this.model = model;
@@ -74951,12 +75245,8 @@ return /******/ (function(modules) { // webpackBootstrap
74951
75245
  stack: 'M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z', // jshint ignore:line
74952
75246
  tiled: 'M2.3,2.2h22.8V25H2.3V2.2z M35,2.2h22.8V25H35V2.2zM2.3,35h22.8v22.8H2.3V35z M35,35h22.8v22.8H35V35z'
74953
75247
  },
74954
- title: {
74955
- line: '切换为折线图',
74956
- bar: '切换为柱状图',
74957
- stack: '切换为堆叠',
74958
- tiled: '切换为平铺'
74959
- },
75248
+ // `line`, `bar`, `stack`, `tiled`
75249
+ title: zrUtil.clone(lang.title),
74960
75250
  option: {},
74961
75251
  seriesIndex: {}
74962
75252
  };
@@ -75109,7 +75399,7 @@ return /******/ (function(modules) { // webpackBootstrap
75109
75399
 
75110
75400
 
75111
75401
  /***/ }),
75112
- /* 424 */
75402
+ /* 425 */
75113
75403
  /***/ (function(module, exports, __webpack_require__) {
75114
75404
 
75115
75405
  /**
@@ -75120,7 +75410,7 @@ return /******/ (function(modules) { // webpackBootstrap
75120
75410
 
75121
75411
  var zrUtil = __webpack_require__(4);
75122
75412
  var eventTool = __webpack_require__(93);
75123
-
75413
+ var lang = __webpack_require__(365).toolbox.dataView;
75124
75414
 
75125
75415
  var BLOCK_SPLITER = new Array(60).join('-');
75126
75416
  var ITEM_SPLITER = '\t';
@@ -75391,8 +75681,8 @@ return /******/ (function(modules) { // webpackBootstrap
75391
75681
  contentToOption: null,
75392
75682
 
75393
75683
  icon: 'M17.5,17.3H33 M17.5,17.3H33 M45.4,29.5h-28 M11.5,2v56H51V14.8L38.4,2H11.5z M38.4,2.2v12.7H51 M45.4,41.7h-28',
75394
- title: '数据视图',
75395
- lang: ['数据视图', '关闭', '刷新'],
75684
+ title: zrUtil.clone(lang.title),
75685
+ lang: zrUtil.clone(lang.lang),
75396
75686
  backgroundColor: '#fff',
75397
75687
  textColor: '#000',
75398
75688
  textareaColor: '#fff',
@@ -75592,7 +75882,7 @@ return /******/ (function(modules) { // webpackBootstrap
75592
75882
 
75593
75883
 
75594
75884
  /***/ }),
75595
- /* 425 */
75885
+ /* 426 */
75596
75886
  /***/ (function(module, exports, __webpack_require__) {
75597
75887
 
75598
75888
  'use strict';
@@ -75601,13 +75891,14 @@ return /******/ (function(modules) { // webpackBootstrap
75601
75891
  var zrUtil = __webpack_require__(4);
75602
75892
  var BrushController = __webpack_require__(248);
75603
75893
  var BrushTargetManager = __webpack_require__(359);
75604
- var history = __webpack_require__(426);
75894
+ var history = __webpack_require__(427);
75605
75895
  var sliderMove = __webpack_require__(242);
75896
+ var lang = __webpack_require__(365).toolbox.dataZoom;
75606
75897
 
75607
75898
  var each = zrUtil.each;
75608
75899
 
75609
75900
  // Use dataZoomSelect
75610
- __webpack_require__(427);
75901
+ __webpack_require__(428);
75611
75902
 
75612
75903
  // Spectial component id start with \0ec\0, see echarts/model/Global.js~hasInnerId
75613
75904
  var DATA_ZOOM_ID_BASE = '\0_ec_\0toolbox-dataZoom_';
@@ -75636,10 +75927,8 @@ return /******/ (function(modules) { // webpackBootstrap
75636
75927
  zoom: 'M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1',
75637
75928
  back: 'M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26'
75638
75929
  },
75639
- title: {
75640
- zoom: '区域缩放',
75641
- back: '区域缩放还原'
75642
- }
75930
+ // `zoom`, `back`
75931
+ title: zrUtil.clone(lang.title)
75643
75932
  };
75644
75933
 
75645
75934
  var proto = DataZoom.prototype;
@@ -75901,7 +76190,7 @@ return /******/ (function(modules) { // webpackBootstrap
75901
76190
 
75902
76191
 
75903
76192
  /***/ }),
75904
- /* 426 */
76193
+ /* 427 */
75905
76194
  /***/ (function(module, exports, __webpack_require__) {
75906
76195
 
75907
76196
  /**
@@ -76015,7 +76304,7 @@ return /******/ (function(modules) { // webpackBootstrap
76015
76304
 
76016
76305
 
76017
76306
  /***/ }),
76018
- /* 427 */
76307
+ /* 428 */
76019
76308
  /***/ (function(module, exports, __webpack_require__) {
76020
76309
 
76021
76310
  /**
@@ -76023,21 +76312,21 @@ return /******/ (function(modules) { // webpackBootstrap
76023
76312
  */
76024
76313
 
76025
76314
 
76026
- __webpack_require__(371);
76027
-
76028
76315
  __webpack_require__(372);
76029
- __webpack_require__(375);
76030
76316
 
76031
- __webpack_require__(428);
76317
+ __webpack_require__(373);
76318
+ __webpack_require__(376);
76319
+
76032
76320
  __webpack_require__(429);
76321
+ __webpack_require__(430);
76033
76322
 
76034
- __webpack_require__(381);
76035
76323
  __webpack_require__(382);
76324
+ __webpack_require__(383);
76036
76325
 
76037
76326
 
76038
76327
 
76039
76328
  /***/ }),
76040
- /* 428 */
76329
+ /* 429 */
76041
76330
  /***/ (function(module, exports, __webpack_require__) {
76042
76331
 
76043
76332
  /**
@@ -76045,7 +76334,7 @@ return /******/ (function(modules) { // webpackBootstrap
76045
76334
  */
76046
76335
 
76047
76336
 
76048
- var DataZoomModel = __webpack_require__(372);
76337
+ var DataZoomModel = __webpack_require__(373);
76049
76338
 
76050
76339
  module.exports = DataZoomModel.extend({
76051
76340
 
@@ -76056,12 +76345,12 @@ return /******/ (function(modules) { // webpackBootstrap
76056
76345
 
76057
76346
 
76058
76347
  /***/ }),
76059
- /* 429 */
76348
+ /* 430 */
76060
76349
  /***/ (function(module, exports, __webpack_require__) {
76061
76350
 
76062
76351
 
76063
76352
 
76064
- module.exports = __webpack_require__(375).extend({
76353
+ module.exports = __webpack_require__(376).extend({
76065
76354
 
76066
76355
  type: 'dataZoom.select'
76067
76356
 
@@ -76070,13 +76359,14 @@ return /******/ (function(modules) { // webpackBootstrap
76070
76359
 
76071
76360
 
76072
76361
  /***/ }),
76073
- /* 430 */
76362
+ /* 431 */
76074
76363
  /***/ (function(module, exports, __webpack_require__) {
76075
76364
 
76076
76365
  'use strict';
76077
76366
 
76078
76367
 
76079
- var history = __webpack_require__(426);
76368
+ var history = __webpack_require__(427);
76369
+ var lang = __webpack_require__(365).toolbox.restore;
76080
76370
 
76081
76371
  function Restore(model) {
76082
76372
  this.model = model;
@@ -76085,7 +76375,7 @@ return /******/ (function(modules) { // webpackBootstrap
76085
76375
  Restore.defaultOption = {
76086
76376
  show: true,
76087
76377
  icon: 'M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5',
76088
- title: '还原'
76378
+ title: lang.title
76089
76379
  };
76090
76380
 
76091
76381
  var proto = Restore.prototype;
@@ -76114,16 +76404,16 @@ return /******/ (function(modules) { // webpackBootstrap
76114
76404
 
76115
76405
 
76116
76406
  /***/ }),
76117
- /* 431 */
76407
+ /* 432 */
76118
76408
  /***/ (function(module, exports, __webpack_require__) {
76119
76409
 
76120
76410
 
76121
- __webpack_require__(432);
76122
- __webpack_require__(87).registerPainter('vml', __webpack_require__(434));
76411
+ __webpack_require__(433);
76412
+ __webpack_require__(87).registerPainter('vml', __webpack_require__(435));
76123
76413
 
76124
76414
 
76125
76415
  /***/ }),
76126
- /* 432 */
76416
+ /* 433 */
76127
76417
  /***/ (function(module, exports, __webpack_require__) {
76128
76418
 
76129
76419
  // http://www.w3.org/TR/NOTE-VML
@@ -76134,10 +76424,10 @@ return /******/ (function(modules) { // webpackBootstrap
76134
76424
  var vec2 = __webpack_require__(10);
76135
76425
  var BoundingRect = __webpack_require__(9);
76136
76426
  var CMD = __webpack_require__(39).CMD;
76137
- var colorTool = __webpack_require__(35);
76427
+ var colorTool = __webpack_require__(33);
76138
76428
  var textContain = __webpack_require__(8);
76139
- var textHelper = __webpack_require__(25);
76140
- var RectText = __webpack_require__(38);
76429
+ var textHelper = __webpack_require__(37);
76430
+ var RectText = __webpack_require__(36);
76141
76431
  var Displayable = __webpack_require__(23);
76142
76432
  var ZImage = __webpack_require__(52);
76143
76433
  var Text = __webpack_require__(53);
@@ -76146,7 +76436,7 @@ return /******/ (function(modules) { // webpackBootstrap
76146
76436
 
76147
76437
  var Gradient = __webpack_require__(69);
76148
76438
 
76149
- var vmlCore = __webpack_require__(433);
76439
+ var vmlCore = __webpack_require__(434);
76150
76440
 
76151
76441
  var round = Math.round;
76152
76442
  var sqrt = Math.sqrt;
@@ -77197,7 +77487,7 @@ return /******/ (function(modules) { // webpackBootstrap
77197
77487
 
77198
77488
 
77199
77489
  /***/ }),
77200
- /* 433 */
77490
+ /* 434 */
77201
77491
  /***/ (function(module, exports, __webpack_require__) {
77202
77492
 
77203
77493
 
@@ -77250,7 +77540,7 @@ return /******/ (function(modules) { // webpackBootstrap
77250
77540
 
77251
77541
 
77252
77542
  /***/ }),
77253
- /* 434 */
77543
+ /* 435 */
77254
77544
  /***/ (function(module, exports, __webpack_require__) {
77255
77545
 
77256
77546
  /**
@@ -77261,8 +77551,8 @@ return /******/ (function(modules) { // webpackBootstrap
77261
77551
 
77262
77552
 
77263
77553
 
77264
- var zrLog = __webpack_require__(36);
77265
- var vmlCore = __webpack_require__(433);
77554
+ var zrLog = __webpack_require__(34);
77555
+ var vmlCore = __webpack_require__(434);
77266
77556
 
77267
77557
  function parseInt10(val) {
77268
77558
  return parseInt(val, 10);
@@ -77319,6 +77609,10 @@ return /******/ (function(modules) { // webpackBootstrap
77319
77609
 
77320
77610
  constructor: VMLPainter,
77321
77611
 
77612
+ getType: function () {
77613
+ return 'vml';
77614
+ },
77615
+
77322
77616
  /**
77323
77617
  * @return {HTMLDivElement}
77324
77618
  */