echarts 4.7.0 → 4.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/dist/echarts-en.common.js +370 -150
  2. package/dist/echarts-en.common.min.js +1 -1
  3. package/dist/echarts-en.js +508 -229
  4. package/dist/echarts-en.js.map +1 -1
  5. package/dist/echarts-en.min.js +1 -1
  6. package/dist/echarts-en.simple.js +312 -123
  7. package/dist/echarts-en.simple.min.js +1 -1
  8. package/dist/echarts.common.js +344 -150
  9. package/dist/echarts.common.min.js +1 -1
  10. package/dist/echarts.js +482 -229
  11. package/dist/echarts.js.map +1 -1
  12. package/dist/echarts.min.js +1 -1
  13. package/dist/echarts.simple.js +286 -123
  14. package/dist/echarts.simple.min.js +1 -1
  15. package/dist/extension/bmap.js +336 -2
  16. package/dist/extension/bmap.js.map +1 -1
  17. package/dist/extension/bmap.min.js +1 -1
  18. package/extension/bmap/BMapView.js +6 -2
  19. package/extension-src/bmap/BMapView.js +3 -2
  20. package/lib/chart/bar/BarView.js +20 -5
  21. package/lib/chart/heatmap/HeatmapView.js +2 -2
  22. package/lib/chart/helper/EffectSymbol.js +2 -1
  23. package/lib/chart/helper/LineDraw.js +5 -1
  24. package/lib/chart/helper/Symbol.js +1 -2
  25. package/lib/chart/helper/createClipPathFromCoordSys.js +4 -1
  26. package/lib/chart/line/LineView.js +33 -0
  27. package/lib/chart/map/MapSeries.js +3 -2
  28. package/lib/chart/pie/PieView.js +20 -13
  29. package/lib/chart/sankey/sankeyLayout.js +18 -0
  30. package/lib/chart/sunburst/SunburstPiece.js +1 -0
  31. package/lib/chart/sunburst/SunburstSeries.js +12 -7
  32. package/lib/chart/sunburst/SunburstView.js +5 -1
  33. package/lib/chart/tree/TreeSeries.js +4 -4
  34. package/lib/chart/treemap/TreemapSeries.js +15 -3
  35. package/lib/chart/treemap/TreemapView.js +23 -11
  36. package/lib/component/helper/MapDraw.js +32 -4
  37. package/lib/component/title.js +6 -2
  38. package/lib/component/toolbox/ToolboxView.js +1 -1
  39. package/lib/component/toolbox/feature/MagicType.js +2 -1
  40. package/lib/component/toolbox/feature/SaveAsImage.js +2 -1
  41. package/lib/component/tooltip/TooltipView.js +1 -1
  42. package/lib/component/visualMap/PiecewiseModel.js +3 -6
  43. package/lib/coord/axisHelper.js +22 -16
  44. package/lib/coord/calendar/Calendar.js +8 -4
  45. package/lib/coord/geo/geoJSONLoader.js +3 -2
  46. package/lib/coord/geo/geoSourceManager.js +3 -2
  47. package/lib/coord/geo/parseGeoJson.js +3 -2
  48. package/lib/coord/radar/Radar.js +1 -1
  49. package/lib/data/Tree.js +8 -19
  50. package/lib/echarts.js +57 -34
  51. package/lib/langEN.js +26 -0
  52. package/lib/loading/default.js +43 -27
  53. package/lib/model/Series.js +1 -1
  54. package/lib/util/format.js +19 -2
  55. package/lib/util/graphic.js +11 -8
  56. package/lib/visual/symbol.js +12 -2
  57. package/map/js/province/gansu.js +2 -2
  58. package/package.json +2 -2
  59. package/src/chart/bar/BarView.js +16 -3
  60. package/src/chart/heatmap/HeatmapView.js +2 -2
  61. package/src/chart/helper/EffectSymbol.js +2 -1
  62. package/src/chart/helper/LineDraw.js +5 -1
  63. package/src/chart/helper/Symbol.js +2 -2
  64. package/src/chart/helper/createClipPathFromCoordSys.js +4 -0
  65. package/src/chart/line/LineView.js +39 -0
  66. package/src/chart/map/MapSeries.js +3 -2
  67. package/src/chart/pie/PieView.js +18 -13
  68. package/src/chart/sankey/sankeyLayout.js +21 -2
  69. package/src/chart/sunburst/SunburstPiece.js +2 -0
  70. package/src/chart/sunburst/SunburstSeries.js +12 -7
  71. package/src/chart/sunburst/SunburstView.js +2 -1
  72. package/src/chart/tree/TreeSeries.js +3 -6
  73. package/src/chart/treemap/TreemapSeries.js +15 -5
  74. package/src/chart/treemap/TreemapView.js +20 -14
  75. package/src/component/helper/MapDraw.js +26 -3
  76. package/src/component/title.js +3 -2
  77. package/src/component/toolbox/ToolboxView.js +1 -1
  78. package/src/component/toolbox/feature/MagicType.js +2 -1
  79. package/src/component/toolbox/feature/SaveAsImage.js +2 -1
  80. package/src/component/tooltip/TooltipView.js +1 -1
  81. package/src/component/visualMap/PiecewiseModel.js +5 -9
  82. package/src/coord/axisHelper.js +26 -19
  83. package/src/coord/calendar/Calendar.js +12 -5
  84. package/src/coord/geo/geoJSONLoader.js +3 -2
  85. package/src/coord/geo/geoSourceManager.js +3 -2
  86. package/src/coord/geo/parseGeoJson.js +3 -2
  87. package/src/coord/radar/Radar.js +1 -1
  88. package/src/data/Tree.js +11 -18
  89. package/src/echarts.js +60 -36
  90. package/src/langEN.js +26 -0
  91. package/src/layout/barGrid.js +4 -2
  92. package/src/loading/default.js +46 -34
  93. package/src/model/Series.js +1 -1
  94. package/src/util/format.js +17 -1
  95. package/src/util/graphic.js +10 -7
  96. package/src/visual/symbol.js +11 -2
@@ -9948,6 +9948,10 @@ Painter.prototype = {
9948
9948
  if (this._layerConfig[zlevel]) {
9949
9949
  merge(layer, this._layerConfig[zlevel], true);
9950
9950
  }
9951
+ // TODO Remove EL_AFTER_INCREMENTAL_INC magic number
9952
+ else if (this._layerConfig[zlevel - EL_AFTER_INCREMENTAL_INC]) {
9953
+ merge(layer, this._layerConfig[zlevel - EL_AFTER_INCREMENTAL_INC], true);
9954
+ }
9951
9955
 
9952
9956
  if (virtual) {
9953
9957
  layer.virtual = virtual;
@@ -10100,12 +10104,26 @@ Painter.prototype = {
10100
10104
 
10101
10105
  var prevLayer = null;
10102
10106
  var incrementalLayerCount = 0;
10107
+ var prevZlevel;
10103
10108
  for (var i = 0; i < list.length; i++) {
10104
10109
  var el = list[i];
10105
10110
  var zlevel = el.zlevel;
10106
10111
  var layer;
10107
- // PENDING If change one incremental element style ?
10108
- // TODO Where there are non-incremental elements between incremental elements.
10112
+
10113
+ if (prevZlevel !== zlevel) {
10114
+ prevZlevel = zlevel;
10115
+ incrementalLayerCount = 0;
10116
+ }
10117
+
10118
+ // TODO Not use magic number on zlevel.
10119
+
10120
+ // Each layer with increment element can be separated to 3 layers.
10121
+ // (Other Element drawn after incremental element)
10122
+ // -----------------zlevel + EL_AFTER_INCREMENTAL_INC--------------------
10123
+ // (Incremental element)
10124
+ // ----------------------zlevel + INCREMENTAL_INC------------------------
10125
+ // (Element drawn before incremental element)
10126
+ // --------------------------------zlevel--------------------------------
10109
10127
  if (el.incremental) {
10110
10128
  layer = this.getLayer(zlevel + INCREMENTAL_INC, this._needsManuallyCompositing);
10111
10129
  layer.incremental = true;
@@ -10200,6 +10218,7 @@ Painter.prototype = {
10200
10218
 
10201
10219
  for (var i = 0; i < this._zlevelList.length; i++) {
10202
10220
  var _zlevel = this._zlevelList[i];
10221
+ // TODO Remove EL_AFTER_INCREMENTAL_INC magic number
10203
10222
  if (_zlevel === zlevel || _zlevel === zlevel + EL_AFTER_INCREMENTAL_INC) {
10204
10223
  var layer = this._layers[_zlevel];
10205
10224
  merge(layer, layerConfig[zlevel], true);
@@ -11270,7 +11289,7 @@ var painterCtors = {
11270
11289
  /**
11271
11290
  * @type {string}
11272
11291
  */
11273
- var version$1 = '4.3.0';
11292
+ var version$1 = '4.3.1';
11274
11293
 
11275
11294
  /**
11276
11295
  * Initializing a zrender instance
@@ -13098,7 +13117,30 @@ var extremity = create();
13098
13117
  * @param {number} min
13099
13118
  * @param {number} max
13100
13119
  */
13120
+ function fromPoints(points, min$$1, max$$1) {
13121
+ if (points.length === 0) {
13122
+ return;
13123
+ }
13124
+ var p = points[0];
13125
+ var left = p[0];
13126
+ var right = p[0];
13127
+ var top = p[1];
13128
+ var bottom = p[1];
13129
+ var i;
13101
13130
 
13131
+ for (i = 1; i < points.length; i++) {
13132
+ p = points[i];
13133
+ left = mathMin$3(left, p[0]);
13134
+ right = mathMax$3(right, p[0]);
13135
+ top = mathMin$3(top, p[1]);
13136
+ bottom = mathMax$3(bottom, p[1]);
13137
+ }
13138
+
13139
+ min$$1[0] = left;
13140
+ min$$1[1] = top;
13141
+ max$$1[0] = right;
13142
+ max$$1[1] = bottom;
13143
+ }
13102
13144
 
13103
13145
  /**
13104
13146
  * @memberOf module:zrender/core/bbox
@@ -17420,11 +17462,13 @@ function getHighlightDigit(highlightKey) {
17420
17462
  * @param {Object} opt Check `opt` of `setTextStyleCommon` to find other props.
17421
17463
  * @param {string|Function} [opt.defaultText]
17422
17464
  * @param {module:echarts/model/Model} [opt.labelFetcher] Fetch text by
17423
- * `opt.labelFetcher.getFormattedLabel(opt.labelDataIndex, 'normal'/'emphasis', null, opt.labelDimIndex)`
17424
- * @param {module:echarts/model/Model} [opt.labelDataIndex] Fetch text by
17425
- * `opt.textFetcher.getFormattedLabel(opt.labelDataIndex, 'normal'/'emphasis', null, opt.labelDimIndex)`
17426
- * @param {module:echarts/model/Model} [opt.labelDimIndex] Fetch text by
17427
- * `opt.textFetcher.getFormattedLabel(opt.labelDataIndex, 'normal'/'emphasis', null, opt.labelDimIndex)`
17465
+ * `opt.labelFetcher.getFormattedLabel(opt.labelDataIndex, 'normal'/'emphasis', null, opt.labelDimIndex, opt.labelProp)`
17466
+ * @param {number} [opt.labelDataIndex] Fetch text by
17467
+ * `opt.textFetcher.getFormattedLabel(opt.labelDataIndex, 'normal'/'emphasis', null, opt.labelDimIndex, opt.labelProp)`
17468
+ * @param {number} [opt.labelDimIndex] Fetch text by
17469
+ * `opt.textFetcher.getFormattedLabel(opt.labelDataIndex, 'normal'/'emphasis', null, opt.labelDimIndex, opt.labelProp)`
17470
+ * @param {string} [opt.labelProp] Fetch text by
17471
+ * `opt.textFetcher.getFormattedLabel(opt.labelDataIndex, 'normal'/'emphasis', null, opt.labelDimIndex, opt.labelProp)`
17428
17472
  * @param {Object} [normalSpecified]
17429
17473
  * @param {Object} [emphasisSpecified]
17430
17474
  */
@@ -17438,6 +17482,7 @@ function setLabelStyle(
17438
17482
  var labelFetcher = opt.labelFetcher;
17439
17483
  var labelDataIndex = opt.labelDataIndex;
17440
17484
  var labelDimIndex = opt.labelDimIndex;
17485
+ var labelProp = opt.labelProp;
17441
17486
 
17442
17487
  // This scenario, `label.normal.show = true; label.emphasis.show = false`,
17443
17488
  // is not supported util someone requests.
@@ -17451,7 +17496,7 @@ function setLabelStyle(
17451
17496
  var baseText;
17452
17497
  if (showNormal || showEmphasis) {
17453
17498
  if (labelFetcher) {
17454
- baseText = labelFetcher.getFormattedLabel(labelDataIndex, 'normal', null, labelDimIndex);
17499
+ baseText = labelFetcher.getFormattedLabel(labelDataIndex, 'normal', null, labelDimIndex, labelProp);
17455
17500
  }
17456
17501
  if (baseText == null) {
17457
17502
  baseText = isFunction$1(opt.defaultText) ? opt.defaultText(labelDataIndex, opt) : opt.defaultText;
@@ -17461,7 +17506,7 @@ function setLabelStyle(
17461
17506
  var emphasisStyleText = showEmphasis
17462
17507
  ? retrieve2(
17463
17508
  labelFetcher
17464
- ? labelFetcher.getFormattedLabel(labelDataIndex, 'emphasis', null, labelDimIndex)
17509
+ ? labelFetcher.getFormattedLabel(labelDataIndex, 'emphasis', null, labelDimIndex, labelProp)
17465
17510
  : null,
17466
17511
  baseText
17467
17512
  )
@@ -19280,7 +19325,7 @@ function nice(val, round) {
19280
19325
  // import Text from 'zrender/src/graphic/Text';
19281
19326
 
19282
19327
  /**
19283
- * 每三位默认加,格式化
19328
+ * add commas after every three numbers
19284
19329
  * @param {string|number} x
19285
19330
  * @return {string}
19286
19331
  */
@@ -19495,6 +19540,13 @@ var truncateText$1 = truncateText;
19495
19540
  * But deprecated this interface. Please use `getTextBoundingRect` instead.
19496
19541
  */
19497
19542
 
19543
+
19544
+ /**
19545
+ * open new tab
19546
+ * @param {string} link url
19547
+ * @param {string} target blank or self
19548
+ */
19549
+
19498
19550
  /*
19499
19551
  * Licensed to the Apache Software Foundation (ASF) under one
19500
19552
  * or more contributor license agreements. See the NOTICE file
@@ -24429,7 +24481,7 @@ function dataTaskReset(context) {
24429
24481
 
24430
24482
  function dataTaskProgress(param, context) {
24431
24483
  // Avoid repead cloneShallow when data just created in reset.
24432
- if (param.end > context.outputData.count()) {
24484
+ if (context.outputData && param.end > context.outputData.count()) {
24433
24485
  context.model.getRawData().cloneShallow(context.outputData);
24434
24486
  }
24435
24487
  }
@@ -25116,6 +25168,32 @@ var lang = {
25116
25168
  lang: ['Right Click to Save Image']
25117
25169
  }
25118
25170
  },
25171
+ series: {
25172
+ typeNames: {
25173
+ pie: 'Pie chart',
25174
+ bar: 'Bar chart',
25175
+ line: 'Line chart',
25176
+ scatter: 'Scatter plot',
25177
+ effectScatter: 'Ripple scatter plot',
25178
+ radar: 'Radar chart',
25179
+ tree: 'Tree',
25180
+ treemap: 'Treemap',
25181
+ boxplot: 'Boxplot',
25182
+ candlestick: 'Candlestick',
25183
+ k: 'K line chart',
25184
+ heatmap: 'Heat map',
25185
+ map: 'Map',
25186
+ parallel: 'Parallel coordinate map',
25187
+ lines: 'Line graph',
25188
+ graph: 'Relationship graph',
25189
+ sankey: 'Sankey diagram',
25190
+ funnel: 'Funnel chart',
25191
+ gauge: 'Guage',
25192
+ pictorialBar: 'Pictorial bar',
25193
+ themeRiver: 'Theme River Map',
25194
+ sunburst: 'Sunburst'
25195
+ }
25196
+ },
25119
25197
  aria: {
25120
25198
  general: {
25121
25199
  withTitle: 'This is a chart about "{title}"',
@@ -25348,11 +25426,16 @@ var loadingDefault = function (api, opts) {
25348
25426
  opts = opts || {};
25349
25427
  defaults(opts, {
25350
25428
  text: 'loading',
25351
- color: '#c23531',
25352
25429
  textColor: '#000',
25430
+ fontSize: '12px',
25353
25431
  maskColor: 'rgba(255, 255, 255, 0.8)',
25432
+ showSpinner: true,
25433
+ color: '#c23531',
25434
+ spinnerRadius: 10,
25435
+ lineWidth: 5,
25354
25436
  zlevel: 0
25355
25437
  });
25438
+ var group = new Group();
25356
25439
  var mask = new Rect({
25357
25440
  style: {
25358
25441
  fill: opts.maskColor
@@ -25360,24 +25443,13 @@ var loadingDefault = function (api, opts) {
25360
25443
  zlevel: opts.zlevel,
25361
25444
  z: 10000
25362
25445
  });
25363
- var arc = new Arc({
25364
- shape: {
25365
- startAngle: -PI$1 / 2,
25366
- endAngle: -PI$1 / 2 + 0.1,
25367
- r: 10
25368
- },
25369
- style: {
25370
- stroke: opts.color,
25371
- lineCap: 'round',
25372
- lineWidth: 5
25373
- },
25374
- zlevel: opts.zlevel,
25375
- z: 10001
25376
- });
25446
+ group.add(mask);
25447
+ var font = opts.fontSize + ' sans-serif';
25377
25448
  var labelRect = new Rect({
25378
25449
  style: {
25379
25450
  fill: 'none',
25380
25451
  text: opts.text,
25452
+ font: font,
25381
25453
  textPosition: 'right',
25382
25454
  textDistance: 10,
25383
25455
  textFill: opts.textColor
@@ -25385,32 +25457,49 @@ var loadingDefault = function (api, opts) {
25385
25457
  zlevel: opts.zlevel,
25386
25458
  z: 10001
25387
25459
  });
25388
-
25389
- arc.animateShape(true)
25390
- .when(1000, {
25391
- endAngle: PI$1 * 3 / 2
25392
- })
25393
- .start('circularInOut');
25394
- arc.animateShape(true)
25395
- .when(1000, {
25396
- startAngle: PI$1 * 3 / 2
25397
- })
25398
- .delay(300)
25399
- .start('circularInOut');
25400
-
25401
- var group = new Group();
25402
- group.add(arc);
25403
25460
  group.add(labelRect);
25404
- group.add(mask);
25461
+ if (opts.showSpinner) {
25462
+ var arc = new Arc({
25463
+ shape: {
25464
+ startAngle: -PI$1 / 2,
25465
+ endAngle: -PI$1 / 2 + 0.1,
25466
+ r: opts.spinnerRadius
25467
+ },
25468
+ style: {
25469
+ stroke: opts.color,
25470
+ lineCap: 'round',
25471
+ lineWidth: opts.lineWidth
25472
+ },
25473
+ zlevel: opts.zlevel,
25474
+ z: 10001
25475
+ });
25476
+ arc.animateShape(true)
25477
+ .when(1000, {
25478
+ endAngle: PI$1 * 3 / 2
25479
+ })
25480
+ .start('circularInOut');
25481
+ arc.animateShape(true)
25482
+ .when(1000, {
25483
+ startAngle: PI$1 * 3 / 2
25484
+ })
25485
+ .delay(300)
25486
+ .start('circularInOut');
25487
+ group.add(arc);
25488
+ }
25405
25489
  // Inject resize
25406
25490
  group.resize = function () {
25407
- var cx = api.getWidth() / 2;
25491
+ var textWidth = getWidth(opts.text, font);
25492
+ var r = opts.showSpinner ? opts.spinnerRadius : 0;
25493
+ // cx = (containerWidth - arcDiameter - textDistance - textWidth) / 2
25494
+ // textDistance needs to be calculated when both animation and text exist
25495
+ var cx = (api.getWidth() - r * 2 - (opts.showSpinner && textWidth ? 10 : 0) - textWidth) / 2
25496
+ // only show the text
25497
+ - (opts.showSpinner ? 0 : textWidth / 2);
25408
25498
  var cy = api.getHeight() / 2;
25409
- arc.setShape({
25499
+ opts.showSpinner && arc.setShape({
25410
25500
  cx: cx,
25411
25501
  cy: cy
25412
25502
  });
25413
- var r = arc.shape.r;
25414
25503
  labelRect.setShape({
25415
25504
  x: cx - r,
25416
25505
  y: cy - r,
@@ -27066,10 +27155,10 @@ var isFunction = isFunction$1;
27066
27155
  var isObject = isObject$1;
27067
27156
  var parseClassType = ComponentModel.parseClassType;
27068
27157
 
27069
- var version = '4.7.0';
27158
+ var version = '4.8.0';
27070
27159
 
27071
27160
  var dependencies = {
27072
- zrender: '4.3.0'
27161
+ zrender: '4.3.1'
27073
27162
  };
27074
27163
 
27075
27164
  var TEST_FRAME_REMAIN_TIME = 1;
@@ -27488,7 +27577,7 @@ echartsProto.getRenderedCanvas = function (opts) {
27488
27577
  * Get svg data url
27489
27578
  * @return {string}
27490
27579
  */
27491
- echartsProto.getSvgDataUrl = function () {
27580
+ echartsProto.getSvgDataURL = function () {
27492
27581
  if (!env$1.svgSupported) {
27493
27582
  return;
27494
27583
  }
@@ -27500,7 +27589,7 @@ echartsProto.getSvgDataUrl = function () {
27500
27589
  el.stopAnimation(true);
27501
27590
  });
27502
27591
 
27503
- return zr.painter.pathToDataUrl();
27592
+ return zr.painter.toDataURL();
27504
27593
  };
27505
27594
 
27506
27595
  /**
@@ -27536,7 +27625,7 @@ echartsProto.getDataURL = function (opts) {
27536
27625
  });
27537
27626
 
27538
27627
  var url = this._zr.painter.getType() === 'svg'
27539
- ? this.getSvgDataUrl()
27628
+ ? this.getSvgDataURL()
27540
27629
  : this.getRenderedCanvas(opts).toDataURL(
27541
27630
  'image/' + (opts && opts.type || 'png')
27542
27631
  );
@@ -27565,6 +27654,7 @@ echartsProto.getConnectedDataURL = function (opts) {
27565
27654
  if (!env$1.canvasSupported) {
27566
27655
  return;
27567
27656
  }
27657
+ var isSvg = opts.type === 'svg';
27568
27658
  var groupId = this.group;
27569
27659
  var mathMin = Math.min;
27570
27660
  var mathMax = Math.max;
@@ -27579,9 +27669,9 @@ echartsProto.getConnectedDataURL = function (opts) {
27579
27669
 
27580
27670
  each$1(instances, function (chart, id) {
27581
27671
  if (chart.group === groupId) {
27582
- var canvas = chart.getRenderedCanvas(
27583
- clone(opts)
27584
- );
27672
+ var canvas = isSvg
27673
+ ? chart.getZr().painter.getSvgDom().innerHTML
27674
+ : chart.getRenderedCanvas(clone(opts));
27585
27675
  var boundingRect = chart.getDom().getBoundingClientRect();
27586
27676
  left = mathMin(boundingRect.left, left);
27587
27677
  top = mathMin(boundingRect.top, top);
@@ -27602,38 +27692,61 @@ echartsProto.getConnectedDataURL = function (opts) {
27602
27692
  var width = right - left;
27603
27693
  var height = bottom - top;
27604
27694
  var targetCanvas = createCanvas();
27605
- targetCanvas.width = width;
27606
- targetCanvas.height = height;
27607
- var zr = init$1(targetCanvas);
27695
+ var zr = init$1(targetCanvas, {
27696
+ renderer: isSvg ? 'svg' : 'canvas'
27697
+ });
27698
+ zr.resize({
27699
+ width: width,
27700
+ height: height
27701
+ });
27608
27702
 
27609
- // Background between the charts
27610
- if (opts.connectedBackgroundColor) {
27611
- zr.add(new Rect({
27612
- shape: {
27613
- x: 0,
27614
- y: 0,
27615
- width: width,
27616
- height: height
27617
- },
27618
- style: {
27619
- fill: opts.connectedBackgroundColor
27620
- }
27621
- }));
27703
+ if (isSvg) {
27704
+ var content = '';
27705
+ each(canvasList, function (item) {
27706
+ var x = item.left - left;
27707
+ var y = item.top - top;
27708
+ content += '<g transform="translate(' + x + ','
27709
+ + y + ')">' + item.dom + '</g>';
27710
+ });
27711
+ zr.painter.getSvgRoot().innerHTML = content;
27712
+
27713
+ if (opts.connectedBackgroundColor) {
27714
+ zr.painter.setBackgroundColor(opts.connectedBackgroundColor);
27715
+ }
27716
+
27717
+ zr.refreshImmediately();
27718
+ return zr.painter.toDataURL();
27622
27719
  }
27720
+ else {
27721
+ // Background between the charts
27722
+ if (opts.connectedBackgroundColor) {
27723
+ zr.add(new Rect({
27724
+ shape: {
27725
+ x: 0,
27726
+ y: 0,
27727
+ width: width,
27728
+ height: height
27729
+ },
27730
+ style: {
27731
+ fill: opts.connectedBackgroundColor
27732
+ }
27733
+ }));
27734
+ }
27623
27735
 
27624
- each(canvasList, function (item) {
27625
- var img = new ZImage({
27626
- style: {
27627
- x: item.left * dpr - left,
27628
- y: item.top * dpr - top,
27629
- image: item.dom
27630
- }
27736
+ each(canvasList, function (item) {
27737
+ var img = new ZImage({
27738
+ style: {
27739
+ x: item.left * dpr - left,
27740
+ y: item.top * dpr - top,
27741
+ image: item.dom
27742
+ }
27743
+ });
27744
+ zr.add(img);
27631
27745
  });
27632
- zr.add(img);
27633
- });
27634
- zr.refreshImmediately();
27635
27746
 
27636
- return targetCanvas.toDataURL('image/' + (opts && opts.type || 'png'));
27747
+ zr.refreshImmediately();
27748
+ return targetCanvas.toDataURL('image/' + (opts && opts.type || 'png'));
27749
+ }
27637
27750
  }
27638
27751
  else {
27639
27752
  return this.getDataURL(opts);
@@ -33491,7 +33604,6 @@ symbolProto._updateCommon = function (data, idx, symbolSize, seriesScope) {
33491
33604
 
33492
33605
  var itemStyle = seriesScope && seriesScope.itemStyle;
33493
33606
  var hoverItemStyle = seriesScope && seriesScope.hoverItemStyle;
33494
- var symbolRotate = seriesScope && seriesScope.symbolRotate;
33495
33607
  var symbolOffset = seriesScope && seriesScope.symbolOffset;
33496
33608
  var labelModel = seriesScope && seriesScope.labelModel;
33497
33609
  var hoverLabelModel = seriesScope && seriesScope.hoverLabelModel;
@@ -33507,7 +33619,6 @@ symbolProto._updateCommon = function (data, idx, symbolSize, seriesScope) {
33507
33619
  itemStyle = itemModel.getModel(normalStyleAccessPath).getItemStyle(['color']);
33508
33620
  hoverItemStyle = itemModel.getModel(emphasisStyleAccessPath).getItemStyle();
33509
33621
 
33510
- symbolRotate = itemModel.getShallow('symbolRotate');
33511
33622
  symbolOffset = itemModel.getShallow('symbolOffset');
33512
33623
 
33513
33624
  labelModel = itemModel.getModel(normalLabelAccessPath);
@@ -33521,6 +33632,8 @@ symbolProto._updateCommon = function (data, idx, symbolSize, seriesScope) {
33521
33632
 
33522
33633
  var elStyle = symbolPath.style;
33523
33634
 
33635
+ var symbolRotate = data.getItemVisual(idx, 'symbolRotate');
33636
+
33524
33637
  symbolPath.attr('rotation', (symbolRotate || 0) * Math.PI / 180 || 0);
33525
33638
 
33526
33639
  if (symbolOffset) {
@@ -34576,6 +34689,10 @@ function createGridClipPath(cartesian, hasAnimation, seriesModel) {
34576
34689
  width += lineWidth;
34577
34690
  height += lineWidth;
34578
34691
 
34692
+ // fix: https://github.com/apache/incubator-echarts/issues/11369
34693
+ x = Math.floor(x);
34694
+ width = Math.round(width);
34695
+
34579
34696
  var clipPath = new Rect({
34580
34697
  shape: {
34581
34698
  x: x,
@@ -34673,6 +34790,26 @@ function isPointsSame(points1, points2) {
34673
34790
  return true;
34674
34791
  }
34675
34792
 
34793
+ function getBoundingDiff(points1, points2) {
34794
+ var min1 = [];
34795
+ var max1 = [];
34796
+
34797
+ var min2 = [];
34798
+ var max2 = [];
34799
+
34800
+ fromPoints(points1, min1, max1);
34801
+ fromPoints(points2, min2, max2);
34802
+
34803
+ // Get a max value from each corner of two boundings.
34804
+ return Math.max(
34805
+ Math.abs(min1[0] - min2[0]),
34806
+ Math.abs(min1[1] - min2[1]),
34807
+
34808
+ Math.abs(max1[0] - max2[0]),
34809
+ Math.abs(max1[1] - max2[1])
34810
+ );
34811
+ }
34812
+
34676
34813
  function getSmooth(smooth) {
34677
34814
  return typeof (smooth) === 'number' ? smooth : (smooth ? 0.5 : 0);
34678
34815
  }
@@ -35285,6 +35422,24 @@ Chart.extend({
35285
35422
  next = turnPointsIntoStep(diff.next, coordSys, step);
35286
35423
  stackedOnNext = turnPointsIntoStep(diff.stackedOnNext, coordSys, step);
35287
35424
  }
35425
+ // Don't apply animation if diff is large.
35426
+ // For better result and avoid memory explosion problems like
35427
+ // https://github.com/apache/incubator-echarts/issues/12229
35428
+ if (getBoundingDiff(current, next) > 3000
35429
+ || (polygon && getBoundingDiff(stackedOnCurrent, stackedOnNext) > 3000)
35430
+ ) {
35431
+ polyline.setShape({
35432
+ points: next
35433
+ });
35434
+ if (polygon) {
35435
+ polygon.setShape({
35436
+ points: next,
35437
+ stackedOnPoints: stackedOnNext
35438
+ });
35439
+ }
35440
+ return;
35441
+ }
35442
+
35288
35443
  // `diff.current` is subset of `current` (which should be ensured by
35289
35444
  // turnPointsIntoStep), so points in `__points` can be updated when
35290
35445
  // points in `current` are update during animation.
@@ -35391,13 +35546,14 @@ var visualSymbol = function (seriesType, defaultSymbolType, legendSymbol) {
35391
35546
  var symbolType = seriesModel.get('symbol');
35392
35547
  var symbolSize = seriesModel.get('symbolSize');
35393
35548
  var keepAspect = seriesModel.get('symbolKeepAspect');
35549
+ var symbolRotate = seriesModel.get('symbolRotate');
35394
35550
 
35395
35551
  var hasSymbolTypeCallback = isFunction$1(symbolType);
35396
35552
  var hasSymbolSizeCallback = isFunction$1(symbolSize);
35397
- var hasCallback = hasSymbolTypeCallback || hasSymbolSizeCallback;
35553
+ var hasSymbolRotateCallback = isFunction$1(symbolRotate);
35554
+ var hasCallback = hasSymbolTypeCallback || hasSymbolSizeCallback || hasSymbolRotateCallback;
35398
35555
  var seriesSymbol = (!hasSymbolTypeCallback && symbolType) ? symbolType : defaultSymbolType;
35399
35556
  var seriesSymbolSize = !hasSymbolSizeCallback ? symbolSize : null;
35400
-
35401
35557
  data.setVisual({
35402
35558
  legendSymbol: legendSymbol || seriesSymbol,
35403
35559
  // If seting callback functions on `symbol` or `symbolSize`, for simplicity and avoiding
@@ -35406,7 +35562,8 @@ var visualSymbol = function (seriesType, defaultSymbolType, legendSymbol) {
35406
35562
  // some cases but generally it is not recommanded.
35407
35563
  symbol: seriesSymbol,
35408
35564
  symbolSize: seriesSymbolSize,
35409
- symbolKeepAspect: keepAspect
35565
+ symbolKeepAspect: keepAspect,
35566
+ symbolRotate: symbolRotate
35410
35567
  });
35411
35568
 
35412
35569
  // Only visible series has each data be visual encoded
@@ -35420,12 +35577,14 @@ var visualSymbol = function (seriesType, defaultSymbolType, legendSymbol) {
35420
35577
  var params = seriesModel.getDataParams(idx);
35421
35578
  hasSymbolTypeCallback && data.setItemVisual(idx, 'symbol', symbolType(rawValue, params));
35422
35579
  hasSymbolSizeCallback && data.setItemVisual(idx, 'symbolSize', symbolSize(rawValue, params));
35580
+ hasSymbolRotateCallback && data.setItemVisual(idx, 'symbolRotate', symbolRotate(rawValue, params));
35423
35581
  }
35424
35582
 
35425
35583
  if (data.hasItemOption) {
35426
35584
  var itemModel = data.getItemModel(idx);
35427
35585
  var itemSymbolType = itemModel.getShallow('symbol', true);
35428
35586
  var itemSymbolSize = itemModel.getShallow('symbolSize', true);
35587
+ var itemSymbolRotate = itemModel.getShallow('symbolRotate', true);
35429
35588
  var itemSymbolKeepAspect = itemModel.getShallow('symbolKeepAspect', true);
35430
35589
 
35431
35590
  // If has item symbol
@@ -35436,6 +35595,9 @@ var visualSymbol = function (seriesType, defaultSymbolType, legendSymbol) {
35436
35595
  // PENDING Transform symbolSize ?
35437
35596
  data.setItemVisual(idx, 'symbolSize', itemSymbolSize);
35438
35597
  }
35598
+ if (itemSymbolRotate != null) {
35599
+ data.setItemVisual(idx, 'symbolRotate', itemSymbolRotate);
35600
+ }
35439
35601
  if (itemSymbolKeepAspect != null) {
35440
35602
  data.setItemVisual(idx, 'symbolKeepAspect', itemSymbolKeepAspect);
35441
35603
  }
@@ -36944,9 +37106,11 @@ var largeLayout = {
36944
37106
 
36945
37107
  coord = cartesian.dataToPoint(valuePair, null, coord);
36946
37108
  // Data index might not be in order, depends on `progressiveChunkMode`.
36947
- largeBackgroundPoints[pointsOffset] = valueAxisHorizontal ? coordLayout.x + coordLayout.width : coord[0];
37109
+ largeBackgroundPoints[pointsOffset] = valueAxisHorizontal
37110
+ ? coordLayout.x + coordLayout.width : coord[0];
36948
37111
  largePoints[pointsOffset++] = coord[0];
36949
- largeBackgroundPoints[pointsOffset] = valueAxisHorizontal ? coord[1] : coordLayout.y + coordLayout.height;
37112
+ largeBackgroundPoints[pointsOffset] = valueAxisHorizontal
37113
+ ? coord[1] : coordLayout.y + coordLayout.height;
36950
37114
  largePoints[pointsOffset++] = coord[1];
36951
37115
  largeDataIndices[idxOffset++] = dataIndex;
36952
37116
  }
@@ -37436,8 +37600,6 @@ function getScaleExtent(scale, model) {
37436
37600
 
37437
37601
  var min = model.getMin();
37438
37602
  var max = model.getMax();
37439
- var fixMin = min != null;
37440
- var fixMax = max != null;
37441
37603
  var originalExtent = scale.getExtent();
37442
37604
 
37443
37605
  var axisDataLen;
@@ -37481,17 +37643,6 @@ function getScaleExtent(scale, model) {
37481
37643
  // (2) When `needCrossZero` and all data is positive/negative, should it be ensured
37482
37644
  // that the results processed by boundaryGap are positive/negative?
37483
37645
 
37484
- if (min == null) {
37485
- min = scaleType === 'ordinal'
37486
- ? (axisDataLen ? 0 : NaN)
37487
- : originalExtent[0] - boundaryGap[0] * span;
37488
- }
37489
- if (max == null) {
37490
- max = scaleType === 'ordinal'
37491
- ? (axisDataLen ? axisDataLen - 1 : NaN)
37492
- : originalExtent[1] + boundaryGap[1] * span;
37493
- }
37494
-
37495
37646
  if (min === 'dataMin') {
37496
37647
  min = originalExtent[0];
37497
37648
  }
@@ -37512,6 +37663,20 @@ function getScaleExtent(scale, model) {
37512
37663
  });
37513
37664
  }
37514
37665
 
37666
+ var fixMin = min != null;
37667
+ var fixMax = max != null;
37668
+
37669
+ if (min == null) {
37670
+ min = scaleType === 'ordinal'
37671
+ ? (axisDataLen ? 0 : NaN)
37672
+ : originalExtent[0] - boundaryGap[0] * span;
37673
+ }
37674
+ if (max == null) {
37675
+ max = scaleType === 'ordinal'
37676
+ ? (axisDataLen ? axisDataLen - 1 : NaN)
37677
+ : originalExtent[1] + boundaryGap[1] * span;
37678
+ }
37679
+
37515
37680
  (min == null || !isFinite(min)) && (min = NaN);
37516
37681
  (max == null || !isFinite(max)) && (max = NaN);
37517
37682
 
@@ -37562,7 +37727,13 @@ function getScaleExtent(scale, model) {
37562
37727
  }
37563
37728
  }
37564
37729
 
37565
- return [min, max];
37730
+ return {
37731
+ extent: [min, max],
37732
+ // "fix" means "fixed", the value should not be
37733
+ // changed in the subsequent steps.
37734
+ fixMin: fixMin,
37735
+ fixMax: fixMax
37736
+ };
37566
37737
  }
37567
37738
 
37568
37739
  function adjustScaleForOverflow(min, max, model, barWidthAndOffset) {
@@ -37601,9 +37772,9 @@ function adjustScaleForOverflow(min, max, model, barWidthAndOffset) {
37601
37772
  }
37602
37773
 
37603
37774
  function niceScaleExtent(scale, model) {
37604
- var extent = getScaleExtent(scale, model);
37605
- var fixMin = model.getMin() != null;
37606
- var fixMax = model.getMax() != null;
37775
+ var extentInfo = getScaleExtent(scale, model);
37776
+ var extent = extentInfo.extent;
37777
+
37607
37778
  var splitNumber = model.get('splitNumber');
37608
37779
 
37609
37780
  if (scale.type === 'log') {
@@ -37614,8 +37785,8 @@ function niceScaleExtent(scale, model) {
37614
37785
  scale.setExtent(extent[0], extent[1]);
37615
37786
  scale.niceExtent({
37616
37787
  splitNumber: splitNumber,
37617
- fixMin: fixMin,
37618
- fixMax: fixMax,
37788
+ fixMin: extentInfo.fixMin,
37789
+ fixMax: extentInfo.fixMax,
37619
37790
  minInterval: (scaleType === 'interval' || scaleType === 'time')
37620
37791
  ? model.get('minInterval') : null,
37621
37792
  maxInterval: (scaleType === 'interval' || scaleType === 'time')
@@ -42055,6 +42226,7 @@ extendChartView({
42055
42226
 
42056
42227
  var drawBackground = seriesModel.get('showBackground', true);
42057
42228
  var backgroundModel = seriesModel.getModel('backgroundStyle');
42229
+ var barBorderRadius = backgroundModel.get('barBorderRadius') || 0;
42058
42230
 
42059
42231
  var bgEls = [];
42060
42232
  var oldBgEls = this._backgroundEls || [];
@@ -42065,8 +42237,13 @@ extendChartView({
42065
42237
  var layout = getLayout[coord.type](data, dataIndex, itemModel);
42066
42238
 
42067
42239
  if (drawBackground) {
42068
- var bgEl = createBackgroundEl(coord, isHorizontalOrRadial, layout);
42240
+ var bgLayout = getLayout[coord.type](data, dataIndex);
42241
+ var bgEl = createBackgroundEl(coord, isHorizontalOrRadial, bgLayout);
42069
42242
  bgEl.useStyle(backgroundModel.getBarItemStyle());
42243
+ // Only cartesian2d support borderRadius.
42244
+ if (coord.type === 'cartesian2d') {
42245
+ bgEl.setShape('r', barBorderRadius);
42246
+ }
42070
42247
  bgEls[dataIndex] = bgEl;
42071
42248
  }
42072
42249
 
@@ -42103,9 +42280,14 @@ extendChartView({
42103
42280
  if (drawBackground) {
42104
42281
  var bgEl = oldBgEls[oldIndex];
42105
42282
  bgEl.useStyle(backgroundModel.getBarItemStyle());
42283
+ // Only cartesian2d support borderRadius.
42284
+ if (coord.type === 'cartesian2d') {
42285
+ bgEl.setShape('r', barBorderRadius);
42286
+ }
42106
42287
  bgEls[newIndex] = bgEl;
42107
42288
 
42108
- var shape = createBackgroundShape(isHorizontalOrRadial, layout, coord);
42289
+ var bgLayout = getLayout[coord.type](data, newIndex);
42290
+ var shape = createBackgroundShape(isHorizontalOrRadial, bgLayout, coord);
42109
42291
  updateProps(bgEl, { shape: shape }, animationModel, newIndex);
42110
42292
  }
42111
42293
 
@@ -42355,9 +42537,11 @@ function removeSector(dataIndex, animationModel, el) {
42355
42537
  }
42356
42538
 
42357
42539
  var getLayout = {
42540
+ // itemModel is only used to get borderWidth, which is not needed
42541
+ // when calculating bar background layout.
42358
42542
  cartesian2d: function (data, dataIndex, itemModel) {
42359
42543
  var layout = data.getItemLayout(dataIndex);
42360
- var fixedLineWidth = getLineWidth(itemModel, layout);
42544
+ var fixedLineWidth = itemModel ? getLineWidth(itemModel, layout) : 0;
42361
42545
 
42362
42546
  // fix layout with lineWidth
42363
42547
  var signX = layout.width > 0 ? 1 : -1;
@@ -43231,31 +43415,36 @@ piePieceProto.updateData = function (data, idx, firstCreate) {
43231
43415
  var withAnimation = !firstCreate && animationTypeUpdate === 'transition';
43232
43416
  this._updateLabel(data, idx, withAnimation);
43233
43417
 
43234
- this.highDownOnUpdate = (itemModel.get('hoverAnimation') && seriesModel.isAnimationEnabled())
43418
+ this.highDownOnUpdate = !seriesModel.get('silent')
43235
43419
  ? function (fromState, toState) {
43420
+ var hasAnimation = seriesModel.isAnimationEnabled() && itemModel.get('hoverAnimation');
43236
43421
  if (toState === 'emphasis') {
43237
43422
  labelLine.ignore = labelLine.hoverIgnore;
43238
43423
  labelText.ignore = labelText.hoverIgnore;
43239
43424
 
43240
43425
  // Sector may has animation of updating data. Force to move to the last frame
43241
43426
  // Or it may stopped on the wrong shape
43242
- sector.stopAnimation(true);
43243
- sector.animateTo({
43244
- shape: {
43245
- r: layout.r + seriesModel.get('hoverOffset')
43246
- }
43247
- }, 300, 'elasticOut');
43427
+ if (hasAnimation) {
43428
+ sector.stopAnimation(true);
43429
+ sector.animateTo({
43430
+ shape: {
43431
+ r: layout.r + seriesModel.get('hoverOffset')
43432
+ }
43433
+ }, 300, 'elasticOut');
43434
+ }
43248
43435
  }
43249
43436
  else {
43250
43437
  labelLine.ignore = labelLine.normalIgnore;
43251
43438
  labelText.ignore = labelText.normalIgnore;
43252
43439
 
43253
- sector.stopAnimation(true);
43254
- sector.animateTo({
43255
- shape: {
43256
- r: layout.r
43257
- }
43258
- }, 300, 'elasticOut');
43440
+ if (hasAnimation) {
43441
+ sector.stopAnimation(true);
43442
+ sector.animateTo({
43443
+ shape: {
43444
+ r: layout.r
43445
+ }
43446
+ }, 300, 'elasticOut');
43447
+ }
43259
43448
  }
43260
43449
  }
43261
43450
  : null;