@vaadin/charts 24.5.0-alpha9 → 24.5.0-beta1

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/charts",
3
- "version": "24.5.0-alpha9",
3
+ "version": "24.5.0-beta1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -36,14 +36,14 @@
36
36
  ],
37
37
  "dependencies": {
38
38
  "@polymer/polymer": "^3.0.0",
39
- "@vaadin/component-base": "24.5.0-alpha9",
40
- "@vaadin/vaadin-lumo-styles": "24.5.0-alpha9",
41
- "@vaadin/vaadin-material-styles": "24.5.0-alpha9",
42
- "@vaadin/vaadin-themable-mixin": "24.5.0-alpha9",
39
+ "@vaadin/component-base": "24.5.0-beta1",
40
+ "@vaadin/vaadin-lumo-styles": "24.5.0-beta1",
41
+ "@vaadin/vaadin-material-styles": "24.5.0-beta1",
42
+ "@vaadin/vaadin-themable-mixin": "24.5.0-beta1",
43
43
  "highcharts": "9.2.2"
44
44
  },
45
45
  "devDependencies": {
46
- "@vaadin/chai-plugins": "24.5.0-alpha9",
46
+ "@vaadin/chai-plugins": "24.5.0-beta1",
47
47
  "@vaadin/testing-helpers": "^1.0.0",
48
48
  "sinon": "^18.0.0"
49
49
  },
@@ -52,5 +52,5 @@
52
52
  "web-types.json",
53
53
  "web-types.lit.json"
54
54
  ],
55
- "gitHead": "804744762f3bec0a2247c4bbcbbb204dbcd78bc0"
55
+ "gitHead": "da4b57724d7089e3766d59d01068159322adb2b8"
56
56
  }
@@ -33,6 +33,7 @@ import Pointer from 'highcharts/es-modules/Core/Pointer.js';
33
33
  import Highcharts from 'highcharts/es-modules/masters/highstock.src.js';
34
34
  import { defineCustomElement } from '@vaadin/component-base/src/define.js';
35
35
  import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
36
+ import { get } from '@vaadin/component-base/src/path-utils.js';
36
37
  import { ResizeMixin } from '@vaadin/component-base/src/resize-mixin.js';
37
38
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
38
39
  import { inflateFunctions } from './helpers.js';
@@ -488,7 +489,14 @@ class Chart extends ResizeMixin(ElementMixin(ThemableMixin(PolymerElement))) {
488
489
  args.forEach((arg) => inflateFunctions(arg));
489
490
  functionToCall.apply(this.configuration, args);
490
491
  if (redrawCharts) {
491
- Highcharts.charts.forEach((c) => c.redraw());
492
+ Highcharts.charts.forEach((c) => {
493
+ // Ignore `undefined` values that are preserved in the array
494
+ // after their corresponding chart instances are destroyed.
495
+ // See https://github.com/vaadin/flow-components/issues/6607
496
+ if (c !== undefined) {
497
+ c.redraw();
498
+ }
499
+ });
492
500
  }
493
501
  }
494
502
  }
@@ -916,9 +924,7 @@ class Chart extends ResizeMixin(ElementMixin(ThemableMixin(PolymerElement))) {
916
924
  return;
917
925
  }
918
926
 
919
- const options = { ...this.options, ...this._jsonConfigurationBuffer };
920
- this._jsonConfigurationBuffer = null;
921
- this.__initChart(options);
927
+ this.__resetChart();
922
928
  this.__addChildObserver();
923
929
  this.__checkTurboMode();
924
930
  });
@@ -1071,11 +1077,24 @@ class Chart extends ResizeMixin(ElementMixin(ThemableMixin(PolymerElement))) {
1071
1077
  /** @protected */
1072
1078
  disconnectedCallback() {
1073
1079
  super.disconnectedCallback();
1080
+
1081
+ if (this.configuration) {
1082
+ this.configuration.destroy();
1083
+ this.configuration = undefined;
1084
+ }
1085
+
1074
1086
  if (this._childObserver) {
1075
1087
  this._childObserver.disconnect();
1076
1088
  }
1077
1089
  }
1078
1090
 
1091
+ /** @private */
1092
+ __resetChart() {
1093
+ const initialOptions = { ...this.options, ...this._jsonConfigurationBuffer };
1094
+ this.__initChart(initialOptions);
1095
+ this._jsonConfigurationBuffer = null;
1096
+ }
1097
+
1079
1098
  /**
1080
1099
  * Search for axis with given `id`.
1081
1100
  *
@@ -1172,11 +1191,7 @@ class Chart extends ResizeMixin(ElementMixin(ThemableMixin(PolymerElement))) {
1172
1191
  }
1173
1192
 
1174
1193
  if (resetConfiguration) {
1175
- const initialOptions = { ...this.options, ...this._jsonConfigurationBuffer };
1176
-
1177
- this.__initChart(initialOptions);
1178
-
1179
- this._jsonConfigurationBuffer = null;
1194
+ this.__resetChart();
1180
1195
  return;
1181
1196
  }
1182
1197
 
@@ -1386,6 +1401,11 @@ class Chart extends ResizeMixin(ElementMixin(ThemableMixin(PolymerElement))) {
1386
1401
  }, object);
1387
1402
  }
1388
1403
 
1404
+ /** @private */
1405
+ __hasConfigurationBuffer(path) {
1406
+ return get(path, this._jsonConfigurationBuffer) !== undefined;
1407
+ }
1408
+
1389
1409
  /** @private */
1390
1410
  __updateOrAddCredits(credits) {
1391
1411
  if (this.configuration.credits) {
@@ -1434,7 +1454,7 @@ class Chart extends ResizeMixin(ElementMixin(ThemableMixin(PolymerElement))) {
1434
1454
 
1435
1455
  /** @private */
1436
1456
  __updateCategories(categories, config) {
1437
- if (categories === undefined || !config) {
1457
+ if (categories === undefined || !config || this.__hasConfigurationBuffer('xAxis.categories')) {
1438
1458
  return;
1439
1459
  }
1440
1460
 
@@ -1443,7 +1463,7 @@ class Chart extends ResizeMixin(ElementMixin(ThemableMixin(PolymerElement))) {
1443
1463
 
1444
1464
  /** @private */
1445
1465
  __updateCategoryMax(max, config) {
1446
- if (max === undefined || !config) {
1466
+ if (max === undefined || !config || this.__hasConfigurationBuffer('xAxis.max')) {
1447
1467
  return;
1448
1468
  }
1449
1469
 
@@ -1457,7 +1477,7 @@ class Chart extends ResizeMixin(ElementMixin(ThemableMixin(PolymerElement))) {
1457
1477
 
1458
1478
  /** @private */
1459
1479
  __updateCategoryMin(min, config) {
1460
- if (min === undefined || !config) {
1480
+ if (min === undefined || !config || this.__hasConfigurationBuffer('xAxis.min')) {
1461
1481
  return;
1462
1482
  }
1463
1483
 
@@ -1492,7 +1512,7 @@ class Chart extends ResizeMixin(ElementMixin(ThemableMixin(PolymerElement))) {
1492
1512
 
1493
1513
  /** @private */
1494
1514
  __updateCategoryPosition(categoryPosition, config) {
1495
- if (categoryPosition === undefined || !config) {
1515
+ if (categoryPosition === undefined || !config || this.__hasConfigurationBuffer('chart.inverted')) {
1496
1516
  return;
1497
1517
  }
1498
1518
 
@@ -1518,7 +1538,7 @@ class Chart extends ResizeMixin(ElementMixin(ThemableMixin(PolymerElement))) {
1518
1538
 
1519
1539
  /** @private */
1520
1540
  __hideLegend(noLegend, config) {
1521
- if (noLegend === undefined || !config) {
1541
+ if (noLegend === undefined || !config || this.__hasConfigurationBuffer('legend')) {
1522
1542
  return;
1523
1543
  }
1524
1544
 
@@ -1531,7 +1551,7 @@ class Chart extends ResizeMixin(ElementMixin(ThemableMixin(PolymerElement))) {
1531
1551
 
1532
1552
  /** @private */
1533
1553
  __updateTitle(title, config) {
1534
- if (title === undefined || !config) {
1554
+ if (title === undefined || !config || this.__hasConfigurationBuffer('title')) {
1535
1555
  return;
1536
1556
  }
1537
1557
 
@@ -1542,7 +1562,7 @@ class Chart extends ResizeMixin(ElementMixin(ThemableMixin(PolymerElement))) {
1542
1562
 
1543
1563
  /** @private */
1544
1564
  __tooltipObserver(tooltip, config) {
1545
- if (tooltip === undefined || !config) {
1565
+ if (tooltip === undefined || !config || this.__hasConfigurationBuffer('tooltip')) {
1546
1566
  return;
1547
1567
  }
1548
1568
 
@@ -1551,7 +1571,7 @@ class Chart extends ResizeMixin(ElementMixin(ThemableMixin(PolymerElement))) {
1551
1571
 
1552
1572
  /** @private */
1553
1573
  __updateType(type, config) {
1554
- if (type === undefined || !config) {
1574
+ if (type === undefined || !config || this.__hasConfigurationBuffer('chart.type')) {
1555
1575
  return;
1556
1576
  }
1557
1577
 
@@ -1564,7 +1584,7 @@ class Chart extends ResizeMixin(ElementMixin(ThemableMixin(PolymerElement))) {
1564
1584
 
1565
1585
  /** @private */
1566
1586
  __updateSubtitle(subtitle, config) {
1567
- if (subtitle === undefined || !config) {
1587
+ if (subtitle === undefined || !config || this.__hasConfigurationBuffer('subtitle')) {
1568
1588
  return;
1569
1589
  }
1570
1590
 
@@ -1595,7 +1615,7 @@ class Chart extends ResizeMixin(ElementMixin(ThemableMixin(PolymerElement))) {
1595
1615
 
1596
1616
  /** @private */
1597
1617
  __stackingObserver(stacking, config) {
1598
- if (stacking === undefined || !config) {
1618
+ if (stacking === undefined || !config || this.__hasConfigurationBuffer('plotOptions.series.stacking')) {
1599
1619
  return;
1600
1620
  }
1601
1621
 
@@ -1613,7 +1633,7 @@ class Chart extends ResizeMixin(ElementMixin(ThemableMixin(PolymerElement))) {
1613
1633
 
1614
1634
  /** @private */
1615
1635
  __chart3dObserver(chart3d, config) {
1616
- if (chart3d === undefined || !config) {
1636
+ if (chart3d === undefined || !config || this.__hasConfigurationBuffer('chart.options3d')) {
1617
1637
  return;
1618
1638
  }
1619
1639
 
@@ -1640,7 +1660,7 @@ class Chart extends ResizeMixin(ElementMixin(ThemableMixin(PolymerElement))) {
1640
1660
 
1641
1661
  /** @private */
1642
1662
  __polarObserver(polar, config) {
1643
- if (polar === undefined || !config) {
1663
+ if (polar === undefined || !config || this.__hasConfigurationBuffer('chart.polar')) {
1644
1664
  return;
1645
1665
  }
1646
1666
 
@@ -1651,7 +1671,7 @@ class Chart extends ResizeMixin(ElementMixin(ThemableMixin(PolymerElement))) {
1651
1671
 
1652
1672
  /** @private */
1653
1673
  __emptyTextObserver(emptyText, config) {
1654
- if (emptyText === undefined || !config) {
1674
+ if (emptyText === undefined || !config || this.__hasConfigurationBuffer('lang.noData')) {
1655
1675
  return;
1656
1676
  }
1657
1677
 
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/charts",
4
- "version": "24.5.0-alpha9",
4
+ "version": "24.5.0-beta1",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/charts",
4
- "version": "24.5.0-alpha9",
4
+ "version": "24.5.0-beta1",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {