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
@@ -551,7 +551,7 @@ define(function(require) {
551
551
  * for textFill, textStroke, textBackgroundColor, and textBorderColor.
552
552
  * If autoColor specified, it is used as default textFill.
553
553
  * useInsideStyle:
554
- * `true`: Use inside style (textFill, textStroke, textLineWidth)
554
+ * `true`: Use inside style (textFill, textStroke, textStrokeWidth)
555
555
  * if `textFill` is not specified.
556
556
  * `false`: Do not use inside style.
557
557
  * `null/undefined`: use inside style if `isRectText` is true and
@@ -664,7 +664,7 @@ define(function(require) {
664
664
  || globalTextStyle.color;
665
665
  textStyle.textStroke = getAutoColor(textStyleModel.getShallow('textBorderColor'), opt)
666
666
  || globalTextStyle.textBorderColor;
667
- textStyle.textLineWidth = zrUtil.retrieve2(
667
+ textStyle.textStrokeWidth = zrUtil.retrieve2(
668
668
  textStyleModel.getShallow('textBorderWidth'),
669
669
  globalTextStyle.textBorderWidth
670
670
  );
@@ -748,13 +748,13 @@ define(function(require) {
748
748
  insideRollback = {
749
749
  textFill: null,
750
750
  textStroke: textStyle.textStroke,
751
- textLineWidth: textStyle.textLineWidth
751
+ textStrokeWidth: textStyle.textStrokeWidth
752
752
  };
753
753
  textStyle.textFill = '#fff';
754
754
  // Consider text with #fff overflow its container.
755
755
  if (textStyle.textStroke == null) {
756
756
  textStyle.textStroke = opt.autoColor;
757
- textStyle.textLineWidth == null && (textStyle.textLineWidth = 2);
757
+ textStyle.textStrokeWidth == null && (textStyle.textStrokeWidth = 2);
758
758
  }
759
759
  }
760
760
 
@@ -766,7 +766,7 @@ define(function(require) {
766
766
  if (insideRollback) {
767
767
  style.textFill = insideRollback.textFill;
768
768
  style.textStroke = insideRollback.textStroke;
769
- style.textLineWidth = insideRollback.textLineWidth;
769
+ style.textStrokeWidth = insideRollback.textStrokeWidth;
770
770
  }
771
771
  }
772
772
 
@@ -273,11 +273,14 @@ define(function (require) {
273
273
  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
274
274
 
275
275
  /**
276
+ * Consider DST, it is incorrect to provide a method `getTimezoneOffset`
277
+ * without time specified. So this method is removed.
278
+ *
276
279
  * @return {number} in minutes
277
280
  */
278
- number.getTimezoneOffset = function () {
279
- return (new Date()).getTimezoneOffset();
280
- };
281
+ // number.getTimezoneOffset = function () {
282
+ // return (new Date()).getTimezoneOffset();
283
+ // };
281
284
 
282
285
  /**
283
286
  * @param {string|Date|number} value These values can be accepted:
@@ -311,24 +314,42 @@ define(function (require) {
311
314
  return new Date(NaN);
312
315
  }
313
316
 
314
- var timezoneOffset = number.getTimezoneOffset();
315
- var timeOffset = !match[8]
316
- ? 0
317
- : match[8].toUpperCase() === 'Z'
318
- ? timezoneOffset
319
- : +match[8].slice(0, 3) * 60 + timezoneOffset;
320
-
321
- // match[n] can only be string or undefined.
322
- // But take care of '12' + 1 => '121'.
323
- return new Date(
324
- +match[1],
325
- +(match[2] || 1) - 1,
326
- +match[3] || 1,
327
- +match[4] || 0,
328
- +(match[5] || 0) - timeOffset,
329
- +match[6] || 0,
330
- +match[7] || 0
331
- );
317
+ // Use local time when no timezone offset specifed.
318
+ if (!match[8]) {
319
+ // match[n] can only be string or undefined.
320
+ // But take care of '12' + 1 => '121'.
321
+ return new Date(
322
+ +match[1],
323
+ +(match[2] || 1) - 1,
324
+ +match[3] || 1,
325
+ +match[4] || 0,
326
+ +(match[5] || 0),
327
+ +match[6] || 0,
328
+ +match[7] || 0
329
+ );
330
+ }
331
+ // Timezoneoffset of Javascript Date has considered DST (Daylight Saving Time,
332
+ // https://tc39.github.io/ecma262/#sec-daylight-saving-time-adjustment).
333
+ // For example, system timezone is set as "Time Zone: America/Toronto",
334
+ // then these code will get different result:
335
+ // `new Date(1478411999999).getTimezoneOffset(); // get 240`
336
+ // `new Date(1478412000000).getTimezoneOffset(); // get 300`
337
+ // So we should not use `new Date`, but use `Date.UTC`.
338
+ else {
339
+ var hour = +match[4] || 0;
340
+ if (match[8].toUpperCase() !== 'Z') {
341
+ hour -= match[8].slice(0, 3);
342
+ }
343
+ return new Date(Date.UTC(
344
+ +match[1],
345
+ +(match[2] || 1) - 1,
346
+ +match[3] || 1,
347
+ hour,
348
+ +(match[5] || 0),
349
+ +match[6] || 0,
350
+ +match[7] || 0
351
+ ));
352
+ }
332
353
  }
333
354
  else if (value == null) {
334
355
  return new Date(NaN);
@@ -142,7 +142,7 @@ define(function (require) {
142
142
  // which will be much faster and useful in pixel manipulation
143
143
  var returnRGBArray = !!out;
144
144
  !isNormalized && (value = this._normalizeData(value));
145
- out = zrColor.fastMapToColor(value, thisOption.parsedVisual, out);
145
+ out = zrColor.fastLerp(value, thisOption.parsedVisual, out);
146
146
  return returnRGBArray ? out : zrColor.stringify(out, 'rgba');
147
147
  },
148
148
  this
@@ -152,7 +152,7 @@ define(function (require) {
152
152
  _doMap: {
153
153
  linear: function (normalized) {
154
154
  return zrColor.stringify(
155
- zrColor.fastMapToColor(normalized, this.option.parsedVisual),
155
+ zrColor.fastLerp(normalized, this.option.parsedVisual),
156
156
  'rgba'
157
157
  );
158
158
  },
@@ -161,7 +161,7 @@ define(function (require) {
161
161
  var result = getSpecifiedVisual.call(this, value);
162
162
  if (result == null) {
163
163
  result = zrColor.stringify(
164
- zrColor.fastMapToColor(normalized, this.option.parsedVisual),
164
+ zrColor.fastLerp(normalized, this.option.parsedVisual),
165
165
  'rgba'
166
166
  );
167
167
  }
package/webpack.config.js CHANGED
@@ -1,13 +1,25 @@
1
1
  var PROD = process.argv.indexOf('-p') >= 0;
2
2
  var webpack = require('webpack');
3
3
 
4
+ var IS_EN = process.argv.indexOf('--lang-en') >= 0;
5
+
6
+ var plugins = [
7
+ new webpack.DefinePlugin({
8
+ 'typeof __DEV__': JSON.stringify('boolean'),
9
+ __DEV__: PROD ? false : true
10
+ })
11
+ ];
12
+ var outputSuffix = '';
13
+
14
+ if (IS_EN) {
15
+ plugins.unshift(
16
+ new webpack.NormalModuleReplacementPlugin(/\/lang[.]js/, './langEN.js')
17
+ );
18
+ outputSuffix = '-en';
19
+ }
20
+
4
21
  module.exports = {
5
- plugins: [
6
- new webpack.DefinePlugin({
7
- 'typeof __DEV__': JSON.stringify('boolean'),
8
- __DEV__: PROD ? false : true
9
- })
10
- ],
22
+ plugins: plugins,
11
23
  entry: {
12
24
  'echarts': __dirname + '/index.js',
13
25
  'echarts.simple': __dirname + '/index.simple.js',
@@ -17,6 +29,8 @@ module.exports = {
17
29
  libraryTarget: 'umd',
18
30
  library: 'echarts',
19
31
  path: __dirname + '/dist',
20
- filename: PROD ? '[name].min.js' : '[name].js'
32
+ filename: PROD
33
+ ? '[name]' + outputSuffix + '.min.js'
34
+ : '[name]' + outputSuffix + '.js'
21
35
  }
22
36
  };
package/.npmignore DELETED
@@ -1,10 +0,0 @@
1
- /build
2
- /test
3
- /map/tool
4
- /map/raw
5
- /theme/tool
6
- /theme/thumb
7
- todo
8
- npm-debug.log
9
- /benchmark
10
- echarts.d.ts