@vaadin/charts 23.0.6 → 23.1.0-alpha3
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 +5 -5
- package/src/vaadin-chart.js +36 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/charts",
|
|
3
|
-
"version": "23.0
|
|
3
|
+
"version": "23.1.0-alpha3",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -34,15 +34,15 @@
|
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@polymer/polymer": "^3.0.0",
|
|
37
|
-
"@vaadin/component-base": "
|
|
37
|
+
"@vaadin/component-base": "23.1.0-alpha3",
|
|
38
38
|
"@vaadin/vaadin-license-checker": "^2.1.0",
|
|
39
|
-
"@vaadin/vaadin-themable-mixin": "
|
|
39
|
+
"@vaadin/vaadin-themable-mixin": "23.1.0-alpha3",
|
|
40
40
|
"highcharts": "9.2.2"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@esm-bundle/chai": "^4.3.4",
|
|
44
44
|
"@vaadin/testing-helpers": "^0.3.2",
|
|
45
|
-
"sinon": "^
|
|
45
|
+
"sinon": "^13.0.2"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "8c9e64e8dfa158dd52a9bf6da351ff038c88ca85"
|
|
48
48
|
}
|
package/src/vaadin-chart.js
CHANGED
|
@@ -535,9 +535,17 @@ class Chart extends ResizeMixin(ElementMixin(ThemableMixin(PolymerElement))) {
|
|
|
535
535
|
this._jsonConfigurationBuffer = null;
|
|
536
536
|
this.__initChart(options);
|
|
537
537
|
this.__addChildObserver();
|
|
538
|
+
this.__checkTurboMode();
|
|
538
539
|
});
|
|
539
540
|
}
|
|
540
541
|
|
|
542
|
+
/** @protected */
|
|
543
|
+
ready() {
|
|
544
|
+
super.ready();
|
|
545
|
+
|
|
546
|
+
this.addEventListener('chart-redraw', this.__onRedraw.bind(this));
|
|
547
|
+
}
|
|
548
|
+
|
|
541
549
|
/**
|
|
542
550
|
* @return {!Options}
|
|
543
551
|
*/
|
|
@@ -1781,6 +1789,34 @@ class Chart extends ResizeMixin(ElementMixin(ThemableMixin(PolymerElement))) {
|
|
|
1781
1789
|
__showWarn(propertyName, acceptedValues) {
|
|
1782
1790
|
console.warn('<vaadin-chart> Acceptable values for "' + propertyName + '" are ' + acceptedValues);
|
|
1783
1791
|
}
|
|
1792
|
+
|
|
1793
|
+
/** @private */
|
|
1794
|
+
__onRedraw() {
|
|
1795
|
+
this.__checkTurboMode();
|
|
1796
|
+
}
|
|
1797
|
+
|
|
1798
|
+
/** @private */
|
|
1799
|
+
__checkTurboMode() {
|
|
1800
|
+
const isDevelopmentMode = !!window.Vaadin.developmentMode;
|
|
1801
|
+
|
|
1802
|
+
if (!this.configuration || !isDevelopmentMode || this.__turboModeWarningAlreadyLogged) {
|
|
1803
|
+
return;
|
|
1804
|
+
}
|
|
1805
|
+
|
|
1806
|
+
const exceedsTurboThreshold = this.configuration.series.some((series) => {
|
|
1807
|
+
const threshold = (series.options && series.options.turboThreshold) || 0;
|
|
1808
|
+
const dataLength = series.data.length;
|
|
1809
|
+
|
|
1810
|
+
return threshold > 0 && dataLength > threshold;
|
|
1811
|
+
});
|
|
1812
|
+
|
|
1813
|
+
if (exceedsTurboThreshold) {
|
|
1814
|
+
this.__turboModeWarningAlreadyLogged = true;
|
|
1815
|
+
console.warn(
|
|
1816
|
+
'<vaadin-chart> Turbo mode has been enabled for one or more series, because the number of data items exceeds the configured threshold. Turbo mode improves the performance of charts with lots of data, but is not compatible with every type of series. Please consult the documentation on compatibility, or how to disable turbo mode.'
|
|
1817
|
+
);
|
|
1818
|
+
}
|
|
1819
|
+
}
|
|
1784
1820
|
}
|
|
1785
1821
|
|
|
1786
1822
|
customElements.define(Chart.is, Chart);
|