@amcharts/amcharts5 5.3.6 → 5.3.7

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 (186) hide show
  1. package/.internal/charts/stock/StockChart.d.ts +14 -1
  2. package/.internal/charts/stock/StockChart.d.ts.map +1 -1
  3. package/.internal/charts/stock/StockChart.js +44 -0
  4. package/.internal/charts/stock/StockChart.js.map +1 -1
  5. package/.internal/charts/stock/StockChartDefaultTheme.d.ts.map +1 -1
  6. package/.internal/charts/stock/StockChartDefaultTheme.js +3 -1
  7. package/.internal/charts/stock/StockChartDefaultTheme.js.map +1 -1
  8. package/.internal/charts/stock/drawing/DrawingSeries.d.ts +1 -0
  9. package/.internal/charts/stock/drawing/DrawingSeries.d.ts.map +1 -1
  10. package/.internal/charts/stock/drawing/DrawingSeries.js +15 -0
  11. package/.internal/charts/stock/drawing/DrawingSeries.js.map +1 -1
  12. package/.internal/charts/stock/toolbar/DateRangeSelector.d.ts +21 -0
  13. package/.internal/charts/stock/toolbar/DateRangeSelector.d.ts.map +1 -1
  14. package/.internal/charts/stock/toolbar/DateRangeSelector.js +49 -6
  15. package/.internal/charts/stock/toolbar/DateRangeSelector.js.map +1 -1
  16. package/.internal/charts/xy/axes/AxisRendererX.d.ts.map +1 -1
  17. package/.internal/charts/xy/axes/AxisRendererX.js +1 -0
  18. package/.internal/charts/xy/axes/AxisRendererX.js.map +1 -1
  19. package/.internal/charts/xy/axes/AxisRendererY.d.ts.map +1 -1
  20. package/.internal/charts/xy/axes/AxisRendererY.js +1 -0
  21. package/.internal/charts/xy/axes/AxisRendererY.js.map +1 -1
  22. package/.internal/charts/xy/series/XYSeries.d.ts.map +1 -1
  23. package/.internal/charts/xy/series/XYSeries.js +20 -1
  24. package/.internal/charts/xy/series/XYSeries.js.map +1 -1
  25. package/.internal/core/Registry.js +1 -1
  26. package/.internal/core/Registry.js.map +1 -1
  27. package/.internal/core/Root.d.ts +13 -0
  28. package/.internal/core/Root.d.ts.map +1 -1
  29. package/.internal/core/Root.js +44 -14
  30. package/.internal/core/Root.js.map +1 -1
  31. package/.internal/core/render/Component.d.ts.map +1 -1
  32. package/.internal/core/render/Component.js +1 -0
  33. package/.internal/core/render/Component.js.map +1 -1
  34. package/.internal/core/render/Container.d.ts.map +1 -1
  35. package/.internal/core/render/Container.js +8 -2
  36. package/.internal/core/render/Container.js.map +1 -1
  37. package/.internal/core/render/backend/CanvasRenderer.d.ts +7 -7
  38. package/.internal/core/render/backend/CanvasRenderer.d.ts.map +1 -1
  39. package/.internal/core/render/backend/CanvasRenderer.js +55 -47
  40. package/.internal/core/render/backend/CanvasRenderer.js.map +1 -1
  41. package/.internal/core/render/backend/Renderer.d.ts +1 -1
  42. package/.internal/core/render/backend/Renderer.d.ts.map +1 -1
  43. package/.internal/core/render/backend/Renderer.js.map +1 -1
  44. package/.internal/plugins/exporting/Exporting.d.ts.map +1 -1
  45. package/.internal/plugins/exporting/Exporting.js +4 -4
  46. package/.internal/plugins/exporting/Exporting.js.map +1 -1
  47. package/CHANGELOG.md +17 -0
  48. package/examples/javascript/flow-chord/package.json +1 -1
  49. package/examples/javascript/flow-chord-directed/package.json +1 -1
  50. package/examples/javascript/flow-chord-non-ribbon/package.json +1 -1
  51. package/examples/javascript/flow-sankey/package.json +1 -1
  52. package/examples/javascript/gauge/package.json +1 -1
  53. package/examples/javascript/gauge-bands/package.json +1 -1
  54. package/examples/javascript/hierarchy-force-directed/package.json +1 -1
  55. package/examples/javascript/hierarchy-pack/package.json +1 -1
  56. package/examples/javascript/hierarchy-partition/package.json +1 -1
  57. package/examples/javascript/hierarchy-sunburst/package.json +1 -1
  58. package/examples/javascript/hierarchy-tree/package.json +1 -1
  59. package/examples/javascript/hierarchy-treemap/package.json +1 -1
  60. package/examples/javascript/jest/package.json +1 -1
  61. package/examples/javascript/json-pie/package.json +1 -1
  62. package/examples/javascript/json-xy/package.json +1 -1
  63. package/examples/javascript/map-animating-along-lines/package.json +1 -1
  64. package/examples/javascript/map-day-and-night/package.json +1 -1
  65. package/examples/javascript/map-globe-rotate-to-country/package.json +1 -1
  66. package/examples/javascript/map-globe-with-projected-circles/package.json +1 -1
  67. package/examples/javascript/map-with-bubbles/package.json +1 -1
  68. package/examples/javascript/map-zoom-to-country/package.json +1 -1
  69. package/examples/javascript/misc-40-charts/package.json +1 -1
  70. package/examples/javascript/misc-microchart-grid/package.json +1 -1
  71. package/examples/javascript/pie-chart/package.json +1 -1
  72. package/examples/javascript/pie-donut-chart/package.json +1 -1
  73. package/examples/javascript/pie-variable-radius/package.json +1 -1
  74. package/examples/javascript/radar-column-iwatch-style/package.json +1 -1
  75. package/examples/javascript/radar-heat-map/package.json +1 -1
  76. package/examples/javascript/radar-line/package.json +1 -1
  77. package/examples/javascript/radar-time-line/package.json +1 -1
  78. package/examples/javascript/sliced-funnel/package.json +1 -1
  79. package/examples/javascript/sliced-pictorial-stacked/package.json +1 -1
  80. package/examples/javascript/sliced-pyramid/package.json +1 -1
  81. package/examples/javascript/stock-chart/package.json +1 -1
  82. package/examples/javascript/stock-chart-comparing-stocks/package.json +1 -1
  83. package/examples/javascript/stock-chart-data-granularity/package.json +1 -1
  84. package/examples/javascript/stock-chart-data-grouping/package.json +1 -1
  85. package/examples/javascript/stock-chart-intraday/package.json +1 -1
  86. package/examples/javascript/stock-chart-live/package.json +1 -1
  87. package/examples/javascript/stock-chart-volume-separate-panel/package.json +1 -1
  88. package/examples/javascript/venn-diagram/package.json +1 -1
  89. package/examples/javascript/wordcloud-with-data/package.json +1 -1
  90. package/examples/javascript/wordcloud-with-text/package.json +1 -1
  91. package/examples/javascript/xy-100-percent-stacked-column/package.json +1 -1
  92. package/examples/javascript/xy-animated-bullet-at-the-end-of-the-series/package.json +1 -1
  93. package/examples/javascript/xy-bubble/package.json +1 -1
  94. package/examples/javascript/xy-candlestick/package.json +1 -1
  95. package/examples/javascript/xy-clustered-column/package.json +1 -1
  96. package/examples/javascript/xy-column/package.json +1 -1
  97. package/examples/javascript/xy-comparing-series-google-analytics-style/package.json +1 -1
  98. package/examples/javascript/xy-data-grouping/package.json +1 -1
  99. package/examples/javascript/xy-draggable-range/package.json +1 -1
  100. package/examples/javascript/xy-drawing-series-with-mouse-or-touch/package.json +1 -1
  101. package/examples/javascript/xy-dumbbell plot/package.json +1 -1
  102. package/examples/javascript/xy-evenly-spaced-date-axis/package.json +1 -1
  103. package/examples/javascript/xy-line/package.json +1 -1
  104. package/examples/javascript/xy-line-highlight-on-legend-hover/package.json +1 -1
  105. package/examples/javascript/xy-live-data/package.json +1 -1
  106. package/examples/javascript/xy-multiple-synced-value-axes/package.json +1 -1
  107. package/examples/javascript/xy-ohlc/package.json +1 -1
  108. package/examples/javascript/xy-real-time-data-sorting/package.json +1 -1
  109. package/examples/javascript/xy-smoothed-line/package.json +1 -1
  110. package/examples/javascript/xy-stacked-and-clustered-column/package.json +1 -1
  111. package/examples/javascript/xy-stacked-column/package.json +1 -1
  112. package/examples/javascript/xy-stacked-step/package.json +1 -1
  113. package/examples/javascript/xy-stock/package.json +1 -1
  114. package/examples/javascript/xy-stock-comparing/package.json +1 -1
  115. package/examples/typescript/flow-chord/package.json +1 -1
  116. package/examples/typescript/flow-chord-directed/package.json +1 -1
  117. package/examples/typescript/flow-chord-non-ribbon/package.json +1 -1
  118. package/examples/typescript/flow-sankey/package.json +1 -1
  119. package/examples/typescript/gauge/package.json +1 -1
  120. package/examples/typescript/gauge-bands/package.json +1 -1
  121. package/examples/typescript/hierarchy-force-directed/package.json +1 -1
  122. package/examples/typescript/hierarchy-pack/package.json +1 -1
  123. package/examples/typescript/hierarchy-partition/package.json +1 -1
  124. package/examples/typescript/hierarchy-sunburst/package.json +1 -1
  125. package/examples/typescript/hierarchy-tree/package.json +1 -1
  126. package/examples/typescript/hierarchy-treemap/package.json +1 -1
  127. package/examples/typescript/jest/package.json +1 -1
  128. package/examples/typescript/json-pie/package.json +1 -1
  129. package/examples/typescript/json-xy/package.json +1 -1
  130. package/examples/typescript/map-animating-along-lines/package.json +1 -1
  131. package/examples/typescript/map-day-and-night/package.json +1 -1
  132. package/examples/typescript/map-globe-rotate-to-country/package.json +1 -1
  133. package/examples/typescript/map-globe-with-projected-circles/package.json +1 -1
  134. package/examples/typescript/map-with-bubbles/package.json +1 -1
  135. package/examples/typescript/map-zoom-to-country/package.json +1 -1
  136. package/examples/typescript/misc-40-charts/package.json +1 -1
  137. package/examples/typescript/misc-microchart-grid/package.json +1 -1
  138. package/examples/typescript/pie-chart/package.json +1 -1
  139. package/examples/typescript/pie-donut-chart/package.json +1 -1
  140. package/examples/typescript/pie-variable-radius/package.json +1 -1
  141. package/examples/typescript/radar-column-iwatch-style/package.json +1 -1
  142. package/examples/typescript/radar-heat-map/package.json +1 -1
  143. package/examples/typescript/radar-line/package.json +1 -1
  144. package/examples/typescript/radar-time-line/package.json +1 -1
  145. package/examples/typescript/sliced-funnel/package.json +1 -1
  146. package/examples/typescript/sliced-pictorial-stacked/package.json +1 -1
  147. package/examples/typescript/sliced-pyramid/package.json +1 -1
  148. package/examples/typescript/stock-chart/package.json +1 -1
  149. package/examples/typescript/stock-chart-comparing-stocks/package.json +1 -1
  150. package/examples/typescript/stock-chart-data-granularity/package.json +1 -1
  151. package/examples/typescript/stock-chart-data-grouping/package.json +1 -1
  152. package/examples/typescript/stock-chart-intraday/package.json +1 -1
  153. package/examples/typescript/stock-chart-live/package.json +1 -1
  154. package/examples/typescript/stock-chart-volume-separate-panel/package.json +1 -1
  155. package/examples/typescript/venn-diagram/package.json +1 -1
  156. package/examples/typescript/wordcloud-with-data/package.json +1 -1
  157. package/examples/typescript/wordcloud-with-text/package.json +1 -1
  158. package/examples/typescript/xy-100-percent-stacked-column/package.json +1 -1
  159. package/examples/typescript/xy-animated-bullet-at-the-end-of-the-series/package.json +1 -1
  160. package/examples/typescript/xy-bubble/package.json +1 -1
  161. package/examples/typescript/xy-candlestick/package.json +1 -1
  162. package/examples/typescript/xy-clustered-column/package.json +1 -1
  163. package/examples/typescript/xy-column/package.json +1 -1
  164. package/examples/typescript/xy-comparing-series-google-analytics-style/package.json +1 -1
  165. package/examples/typescript/xy-data-grouping/package.json +1 -1
  166. package/examples/typescript/xy-draggable-range/package.json +1 -1
  167. package/examples/typescript/xy-drawing-series-with-mouse-or-touch/package.json +1 -1
  168. package/examples/typescript/xy-dumbbell plot/package.json +1 -1
  169. package/examples/typescript/xy-evenly-spaced-date-axis/package.json +1 -1
  170. package/examples/typescript/xy-line/package.json +1 -1
  171. package/examples/typescript/xy-line-highlight-on-legend-hover/package.json +1 -1
  172. package/examples/typescript/xy-live-data/package.json +1 -1
  173. package/examples/typescript/xy-multiple-synced-value-axes/package.json +1 -1
  174. package/examples/typescript/xy-ohlc/package.json +1 -1
  175. package/examples/typescript/xy-real-time-data-sorting/package.json +1 -1
  176. package/examples/typescript/xy-smoothed-line/package.json +1 -1
  177. package/examples/typescript/xy-stacked-and-clustered-column/package.json +1 -1
  178. package/examples/typescript/xy-stacked-column/package.json +1 -1
  179. package/examples/typescript/xy-stacked-step/package.json +1 -1
  180. package/examples/typescript/xy-stock/package.json +1 -1
  181. package/examples/typescript/xy-stock-comparing/package.json +1 -1
  182. package/map.d.ts +1 -1
  183. package/map.d.ts.map +1 -1
  184. package/map.js +1 -1
  185. package/map.js.map +1 -1
  186. package/package.json +1 -1
@@ -447,6 +447,7 @@ export class CanvasDisplayObject extends DisposerClass {
447
447
  if (this._parent) {
448
448
  this._parent.registerChildLayer(this._layer);
449
449
  }
450
+ this._layer.dirty = true;
450
451
  this._renderer.resizeLayer(this._layer);
451
452
  this._renderer.resizeGhost();
452
453
  }
@@ -3331,25 +3332,25 @@ export class CanvasRenderer extends ArrayDisposer {
3331
3332
  writable: true,
3332
3333
  value: this._patternCanvas.getContext("2d")
3333
3334
  });
3334
- Object.defineProperty(this, "_width", {
3335
+ Object.defineProperty(this, "_domWidth", {
3335
3336
  enumerable: true,
3336
3337
  configurable: true,
3337
3338
  writable: true,
3338
3339
  value: 0
3339
3340
  });
3340
- Object.defineProperty(this, "_height", {
3341
+ Object.defineProperty(this, "_domHeight", {
3341
3342
  enumerable: true,
3342
3343
  configurable: true,
3343
3344
  writable: true,
3344
3345
  value: 0
3345
3346
  });
3346
- Object.defineProperty(this, "_clientWidth", {
3347
+ Object.defineProperty(this, "_canvasWidth", {
3347
3348
  enumerable: true,
3348
3349
  configurable: true,
3349
3350
  writable: true,
3350
3351
  value: 0
3351
3352
  });
3352
- Object.defineProperty(this, "_clientHeight", {
3353
+ Object.defineProperty(this, "_canvasHeight", {
3353
3354
  enumerable: true,
3354
3355
  configurable: true,
3355
3356
  writable: true,
@@ -3620,25 +3621,25 @@ export class CanvasRenderer extends ArrayDisposer {
3620
3621
  return new CanvasImage(this, image);
3621
3622
  }
3622
3623
  resizeLayer(layer) {
3623
- layer.dirty = true;
3624
- layer.resize(this._clientWidth, this._clientHeight, this.resolution);
3624
+ layer.resize(this._canvasWidth, this._canvasHeight, this._domWidth, this._domHeight, this.resolution);
3625
3625
  }
3626
3626
  resizeGhost() {
3627
- this._ghostLayer.resize(this._clientWidth, this._clientHeight, this.resolution);
3627
+ this._ghostLayer.resize(this._canvasWidth, this._canvasHeight, this._domWidth, this._domHeight, this.resolution);
3628
3628
  }
3629
- resize(width, height) {
3630
- this._clientWidth = width;
3631
- this._clientHeight = height;
3632
- this._width = Math.floor(width * this.resolution);
3633
- this._height = Math.floor(height * this.resolution);
3629
+ resize(canvasWidth, canvasHeight, domWidth, domHeight) {
3630
+ this._canvasWidth = canvasWidth;
3631
+ this._canvasHeight = canvasHeight;
3632
+ this._domWidth = domWidth;
3633
+ this._domHeight = domHeight;
3634
3634
  $array.each(this.layers, (layer) => {
3635
3635
  if (layer) {
3636
+ layer.dirty = true;
3636
3637
  this.resizeLayer(layer);
3637
3638
  }
3638
3639
  });
3639
3640
  this.resizeGhost();
3640
- this.view.style.width = width + "px";
3641
- this.view.style.height = height + "px";
3641
+ this.view.style.width = domWidth + "px";
3642
+ this.view.style.height = domHeight + "px";
3642
3643
  }
3643
3644
  createDetachedLayer(willReadFrequently = false) {
3644
3645
  const view = document.createElement("canvas");
@@ -3667,11 +3668,8 @@ export class CanvasRenderer extends ArrayDisposer {
3667
3668
  const layer = this.createDetachedLayer(order == 99);
3668
3669
  layer.order = order;
3669
3670
  layer.visible = visible;
3670
- if (layer.visible && this._width) {
3671
- layer.view.width = this._width;
3672
- layer.view.style.width = this._clientWidth + "px";
3673
- layer.view.height = this._height;
3674
- layer.view.style.height = this._clientHeight + "px";
3671
+ if (layer.visible) {
3672
+ this.resizeLayer(layer);
3675
3673
  }
3676
3674
  const layers = this.layers;
3677
3675
  layers.push(layer);
@@ -4160,27 +4158,29 @@ export class CanvasRenderer extends ArrayDisposer {
4160
4158
  options = {};
4161
4159
  }
4162
4160
  let scale = this.resolution;
4161
+ let canvasWidth = Math.floor(this._canvasWidth * this.resolution);
4162
+ let canvasHeight = Math.floor(this._canvasHeight * this.resolution);
4163
4163
  // Check if we need to scale
4164
- if (options.minWidth && (options.minWidth > this._width)) {
4165
- let minScale = options.minWidth / this._width;
4164
+ if (options.minWidth && (options.minWidth > canvasWidth)) {
4165
+ let minScale = options.minWidth / canvasWidth;
4166
4166
  if (minScale > scale) {
4167
4167
  scale = minScale * this.resolution;
4168
4168
  }
4169
4169
  }
4170
- if (options.minHeight && (options.minHeight > this._height)) {
4171
- let minScale = options.minHeight / this._height;
4170
+ if (options.minHeight && (options.minHeight > canvasHeight)) {
4171
+ let minScale = options.minHeight / canvasHeight;
4172
4172
  if (minScale > scale) {
4173
4173
  scale = minScale * this.resolution;
4174
4174
  }
4175
4175
  }
4176
- if (options.maxWidth && (options.maxWidth < this._width)) {
4177
- let maxScale = options.maxWidth / this._width;
4176
+ if (options.maxWidth && (options.maxWidth < canvasWidth)) {
4177
+ let maxScale = options.maxWidth / canvasWidth;
4178
4178
  if (maxScale < scale) {
4179
4179
  scale = maxScale * this.resolution;
4180
4180
  }
4181
4181
  }
4182
- if (options.maxHeight && (options.maxHeight > this._height)) {
4183
- let maxScale = options.maxHeight / this._height;
4182
+ if (options.maxHeight && (options.maxHeight > canvasHeight)) {
4183
+ let maxScale = options.maxHeight / canvasHeight;
4184
4184
  if (maxScale < scale) {
4185
4185
  scale = maxScale * this.resolution;
4186
4186
  }
@@ -4193,13 +4193,11 @@ export class CanvasRenderer extends ArrayDisposer {
4193
4193
  const canvases = [];
4194
4194
  // Set up new canvas for export
4195
4195
  let forceRender = false;
4196
- let canvasWidth = this._width;
4197
- let canvasHeight = this._height;
4198
4196
  const canvas = document.createElement("canvas");
4199
4197
  if (scale != this.resolution) {
4200
4198
  forceRender = true;
4201
- canvasWidth = this._width * scale / this.resolution;
4202
- canvasHeight = this._height * scale / this.resolution;
4199
+ canvasWidth = canvasWidth * scale / this.resolution;
4200
+ canvasHeight = canvasHeight * scale / this.resolution;
4203
4201
  }
4204
4202
  canvas.width = canvasWidth;
4205
4203
  canvas.height = canvasHeight;
@@ -4314,17 +4312,20 @@ class GhostLayer {
4314
4312
  this.view.style.top = "0px";
4315
4313
  this.view.style.left = "0px";
4316
4314
  }
4317
- resize(width, height, resolution) {
4318
- width += (this.margin.left + this.margin.right);
4319
- height += (this.margin.top + this.margin.bottom);
4315
+ resize(canvasWidth, canvasHeight, domWidth, domHeight, resolution) {
4316
+ canvasWidth += (this.margin.left + this.margin.right);
4317
+ canvasHeight += (this.margin.top + this.margin.bottom);
4318
+ // TODO this should take into account calculateSize
4319
+ domWidth += (this.margin.left + this.margin.right);
4320
+ domHeight += (this.margin.top + this.margin.bottom);
4320
4321
  this.view.style.left = -this.margin.left + "px";
4321
4322
  this.view.style.top = -this.margin.top + "px";
4322
- this._width = Math.floor(width * resolution);
4323
- this._height = Math.floor(height * resolution);
4323
+ this._width = Math.floor(canvasWidth * resolution);
4324
+ this._height = Math.floor(canvasHeight * resolution);
4324
4325
  this.view.width = this._width;
4325
- this.view.style.width = width + "px";
4326
+ this.view.style.width = domWidth + "px";
4326
4327
  this.view.height = this._height;
4327
- this.view.style.height = height + "px";
4328
+ this.view.style.height = domHeight + "px";
4328
4329
  }
4329
4330
  getImageData(point, bbox) {
4330
4331
  return this.context.getImageData(
@@ -4443,16 +4444,23 @@ export class CanvasLayer {
4443
4444
  this.view = view;
4444
4445
  this.context = context;
4445
4446
  }
4446
- resize(width, height, resolution) {
4447
+ resize(canvasWidth, canvasHeight, domWidth, domHeight, resolution) {
4448
+ // TODO should this take into account calculateSize ?
4447
4449
  if (this.width != null) {
4448
- width = this.width;
4450
+ canvasWidth = this.width;
4451
+ domWidth = this.width;
4449
4452
  }
4453
+ // TODO should this take into account calculateSize ?
4450
4454
  if (this.height != null) {
4451
- height = this.height;
4455
+ canvasHeight = this.height;
4456
+ domHeight = this.height;
4452
4457
  }
4453
4458
  if (this.margin) {
4454
- width += (this.margin.left + this.margin.right);
4455
- height += (this.margin.top + this.margin.bottom);
4459
+ canvasWidth += (this.margin.left + this.margin.right);
4460
+ canvasHeight += (this.margin.top + this.margin.bottom);
4461
+ // TODO this should take into account calculateSize
4462
+ domWidth += (this.margin.left + this.margin.right);
4463
+ domHeight += (this.margin.top + this.margin.bottom);
4456
4464
  this.view.style.left = -this.margin.left + "px";
4457
4465
  this.view.style.top = -this.margin.top + "px";
4458
4466
  }
@@ -4460,12 +4468,12 @@ export class CanvasLayer {
4460
4468
  this.view.style.left = "0px";
4461
4469
  this.view.style.top = "0px";
4462
4470
  }
4463
- this._width = Math.floor(width * resolution);
4464
- this._height = Math.floor(height * resolution);
4471
+ this._width = Math.floor(canvasWidth * resolution);
4472
+ this._height = Math.floor(canvasHeight * resolution);
4465
4473
  this.view.width = this._width;
4466
- this.view.style.width = width + "px";
4474
+ this.view.style.width = domWidth + "px";
4467
4475
  this.view.height = this._height;
4468
- this.view.style.height = height + "px";
4476
+ this.view.style.height = domHeight + "px";
4469
4477
  }
4470
4478
  clear() {
4471
4479
  this.context.save();