@c8y/ngx-components 1023.80.2 → 1023.81.3
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/datapoint-explorer/view/index.d.ts +1 -0
- package/datapoint-explorer/view/index.d.ts.map +1 -1
- package/echart/index.d.ts +2 -1
- package/echart/index.d.ts.map +1 -1
- package/fesm2022/c8y-ngx-components-datapoint-explorer-view.mjs +10 -2
- package/fesm2022/c8y-ngx-components-datapoint-explorer-view.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-echart.mjs +26 -14
- package/fesm2022/c8y-ngx-components-echart.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-static-assets-data.mjs +9 -5
- package/fesm2022/c8y-ngx-components-static-assets-data.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-asset-table.mjs +17 -10
- package/fesm2022/c8y-ngx-components-widgets-implementations-asset-table.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-graph.mjs +11 -3
- package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-graph.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components.mjs +83 -63
- package/fesm2022/c8y-ngx-components.mjs.map +1 -1
- package/index.d.ts +33 -29
- package/index.d.ts.map +1 -1
- package/locales/de.po +134 -134
- package/package.json +1 -1
- package/static-assets/data/index.d.ts.map +1 -1
- package/widgets/implementations/asset-table/index.d.ts.map +1 -1
- package/widgets/implementations/datapoints-graph/index.d.ts +1 -0
- package/widgets/implementations/datapoints-graph/index.d.ts.map +1 -1
|
@@ -1560,8 +1560,9 @@ class ChartRealtimeService {
|
|
|
1560
1560
|
this.currentAlarms = [];
|
|
1561
1561
|
this.currentEvents = [];
|
|
1562
1562
|
this.activeDatapoints = [];
|
|
1563
|
+
this.outOfSyncDatapoints = new Set();
|
|
1563
1564
|
}
|
|
1564
|
-
startRealtime(echartsInstance, datapoints, timeRange, datapointOutOfSyncCallback, timeRangeChangedCallback, alarmOrEventConfig = [], displayOptions, alarms, events, alarmOrEventReceivedCallback) {
|
|
1565
|
+
startRealtime(echartsInstance, datapoints, timeRange, datapointOutOfSyncCallback, datapointBackInSyncCallback, timeRangeChangedCallback, alarmOrEventConfig = [], displayOptions, alarms, events, alarmOrEventReceivedCallback) {
|
|
1565
1566
|
this.echartsInstance = echartsInstance;
|
|
1566
1567
|
this.activeDatapoints = datapoints;
|
|
1567
1568
|
this.currentTimeRange = {
|
|
@@ -1626,9 +1627,11 @@ class ChartRealtimeService {
|
|
|
1626
1627
|
const updateThrottleTime = this.getRealtimeUpdateThrottleTime(timeRange);
|
|
1627
1628
|
const measurement$ = merge(...measurementsForDatapoints);
|
|
1628
1629
|
const bufferReset$ = merge(measurement$.pipe(throttleTime(updateThrottleTime)), interval(this.INTERVAL).pipe(tap(() => {
|
|
1630
|
+
const windowSize = this.currentTimeRange.dateTo.valueOf() - this.currentTimeRange.dateFrom.valueOf();
|
|
1631
|
+
const now = Date.now();
|
|
1629
1632
|
this.currentTimeRange = {
|
|
1630
|
-
dateFrom: new Date(
|
|
1631
|
-
dateTo: new Date(
|
|
1633
|
+
dateFrom: new Date(now - windowSize),
|
|
1634
|
+
dateTo: new Date(now)
|
|
1632
1635
|
};
|
|
1633
1636
|
timeRangeChangedCallback(this.currentTimeRange);
|
|
1634
1637
|
}), throttleTime(updateThrottleTime))).pipe(throttleTime(this.MIN_REALTIME_TIMEOUT));
|
|
@@ -1639,11 +1642,11 @@ class ChartRealtimeService {
|
|
|
1639
1642
|
this.pendingAlarmsOrEvents.clear();
|
|
1640
1643
|
if (alarmsOrEvents.length) {
|
|
1641
1644
|
alarmsOrEvents.forEach(alarmOrEvent => {
|
|
1642
|
-
this.updateChartInstance(measurements, alarmOrEvent, displayOptions, datapointOutOfSyncCallback);
|
|
1645
|
+
this.updateChartInstance(measurements, alarmOrEvent, displayOptions, datapointOutOfSyncCallback, datapointBackInSyncCallback);
|
|
1643
1646
|
});
|
|
1644
1647
|
}
|
|
1645
1648
|
else {
|
|
1646
|
-
this.updateChartInstance(measurements, null, displayOptions, datapointOutOfSyncCallback);
|
|
1649
|
+
this.updateChartInstance(measurements, null, displayOptions, datapointOutOfSyncCallback, datapointBackInSyncCallback);
|
|
1647
1650
|
}
|
|
1648
1651
|
// Store the last measurements
|
|
1649
1652
|
measurements.forEach(measurement => {
|
|
@@ -1712,7 +1715,7 @@ class ChartRealtimeService {
|
|
|
1712
1715
|
}
|
|
1713
1716
|
return calculatedThrottleTime;
|
|
1714
1717
|
}
|
|
1715
|
-
updateChartInstance(receivedMeasurements, alarmOrEvent, displayOptions, datapointOutOfSyncCallback) {
|
|
1718
|
+
updateChartInstance(receivedMeasurements, alarmOrEvent, displayOptions, datapointOutOfSyncCallback, datapointBackInSyncCallback) {
|
|
1716
1719
|
const isEvent = (item) => !('severity' in item);
|
|
1717
1720
|
const isAlarm = (item) => 'severity' in item;
|
|
1718
1721
|
const seriesDataToUpdate = new Map();
|
|
@@ -1747,7 +1750,7 @@ class ChartRealtimeService {
|
|
|
1747
1750
|
}
|
|
1748
1751
|
}
|
|
1749
1752
|
seriesMatchingDatapoint['data'] = this.removeValuesBeforeTimeRange(seriesMatchingDatapoint);
|
|
1750
|
-
this.checkForValuesAfterTimeRange(seriesMatchingDatapoint['data'], datapoint, datapointOutOfSyncCallback);
|
|
1753
|
+
this.checkForValuesAfterTimeRange(seriesMatchingDatapoint['data'], datapoint, datapointOutOfSyncCallback, datapointBackInSyncCallback);
|
|
1751
1754
|
});
|
|
1752
1755
|
// Process alarm/event OUTSIDE the measurement loop.
|
|
1753
1756
|
// Previously this was inside seriesDataToUpdate.forEach(), which meant alarms/events
|
|
@@ -1839,26 +1842,32 @@ class ChartRealtimeService {
|
|
|
1839
1842
|
/**
|
|
1840
1843
|
* Detects if a datapoint has measurements with future timestamps (out-of-sync).
|
|
1841
1844
|
*
|
|
1842
|
-
* Why
|
|
1845
|
+
* Why 2000ms tolerance?
|
|
1843
1846
|
* Device clocks may be slightly ahead of browser time, network latency, or processing delays.
|
|
1844
1847
|
* Without tolerance, these minor drifts would cause false positive warnings.
|
|
1845
1848
|
*
|
|
1846
1849
|
* Example:
|
|
1847
1850
|
* Browser time: 12:00:00.000
|
|
1848
|
-
* Measurement: 12:00:
|
|
1851
|
+
* Measurement: 12:00:01.000 (device 1000ms ahead)
|
|
1849
1852
|
* Without tolerance: flagged as out-of-sync (false positive)
|
|
1850
|
-
* With
|
|
1853
|
+
* With 2000ms tolerance: allowed (1000ms < 2000ms threshold)
|
|
1851
1854
|
*
|
|
1852
1855
|
* When triggered, a warning icon appears next to the datapoint in the legend.
|
|
1853
1856
|
*/
|
|
1854
|
-
checkForValuesAfterTimeRange(data, datapoint, datapointOutOfSyncCallback) {
|
|
1855
|
-
const nowWithTolerance = Date.now() +
|
|
1857
|
+
checkForValuesAfterTimeRange(data, datapoint, datapointOutOfSyncCallback, datapointBackInSyncCallback) {
|
|
1858
|
+
const nowWithTolerance = Date.now() + 2000;
|
|
1856
1859
|
const valueAfterNowExists = data.some(([dateString]) => {
|
|
1857
1860
|
return new Date(dateString).valueOf() > nowWithTolerance;
|
|
1858
1861
|
});
|
|
1862
|
+
const datapointId = datapoint.__target?.id + datapoint.fragment + datapoint.series;
|
|
1859
1863
|
if (valueAfterNowExists) {
|
|
1864
|
+
this.outOfSyncDatapoints.add(datapointId);
|
|
1860
1865
|
datapointOutOfSyncCallback(datapoint);
|
|
1861
1866
|
}
|
|
1867
|
+
else if (this.outOfSyncDatapoints.has(datapointId)) {
|
|
1868
|
+
this.outOfSyncDatapoints.delete(datapointId);
|
|
1869
|
+
datapointBackInSyncCallback(datapoint);
|
|
1870
|
+
}
|
|
1862
1871
|
}
|
|
1863
1872
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: ChartRealtimeService, deps: [{ token: i1.MeasurementRealtimeService }, { token: i1.AlarmRealtimeService }, { token: i1.EventRealtimeService }, { token: EchartsOptionsService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1864
1873
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: ChartRealtimeService }); }
|
|
@@ -2096,6 +2105,7 @@ class ChartsComponent {
|
|
|
2096
2105
|
this.configChangeOnZoomOut = new EventEmitter();
|
|
2097
2106
|
this.timeRangeChangeOnRealtime = new EventEmitter();
|
|
2098
2107
|
this.datapointOutOfSync = new EventEmitter();
|
|
2108
|
+
this.datapointBackInSync = new EventEmitter();
|
|
2099
2109
|
this.updateAlarmsAndEvents = new EventEmitter();
|
|
2100
2110
|
this.isMarkedAreaEnabled = new EventEmitter();
|
|
2101
2111
|
this.finishLoading = new EventEmitter(false);
|
|
@@ -2549,7 +2559,7 @@ class ChartsComponent {
|
|
|
2549
2559
|
this.config.realtime &&
|
|
2550
2560
|
this.echartsInstance) {
|
|
2551
2561
|
const showOnlyAlarmsOrEvents = this.config.alarmsEventsConfigs?.length > 0 && this.activeDatapoints?.length === 0;
|
|
2552
|
-
this.chartRealtimeService.startRealtime(this.echartsInstance, this.activeDatapoints, this.getTimeRange(), dp => this.datapointOutOfSync.emit(dp), timeRange => this.timeRangeChangeOnRealtime.emit(timeRange), this.config.alarmsEventsConfigs, {
|
|
2562
|
+
this.chartRealtimeService.startRealtime(this.echartsInstance, this.activeDatapoints, this.getTimeRange(), dp => this.datapointOutOfSync.emit(dp), dp => this.datapointBackInSync.emit(dp), timeRange => this.timeRangeChangeOnRealtime.emit(timeRange), this.config.alarmsEventsConfigs, {
|
|
2553
2563
|
...this.displayOptions,
|
|
2554
2564
|
showOnlyAlarmsOrEvents
|
|
2555
2565
|
}, this.alarms, this.events,
|
|
@@ -2830,7 +2840,7 @@ class ChartsComponent {
|
|
|
2830
2840
|
return { dateFrom: timeRange.dateFrom.toISOString(), dateTo: timeRange.dateTo.toISOString() };
|
|
2831
2841
|
}
|
|
2832
2842
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: ChartsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2833
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: ChartsComponent, isStandalone: true, selector: "c8y-charts", inputs: { config: "config", alerts: "alerts", chartViewContext: "chartViewContext" }, outputs: { configChangeOnZoomOut: "configChangeOnZoomOut", timeRangeChangeOnRealtime: "timeRangeChangeOnRealtime", datapointOutOfSync: "datapointOutOfSync", updateAlarmsAndEvents: "updateAlarmsAndEvents", isMarkedAreaEnabled: "isMarkedAreaEnabled", finishLoading: "finishLoading", updateActiveDatapoints: "updateActiveDatapoints", updateAggregatedSliderDatapoint: "updateAggregatedSliderDatapoint" }, providers: [
|
|
2843
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: ChartsComponent, isStandalone: true, selector: "c8y-charts", inputs: { config: "config", alerts: "alerts", chartViewContext: "chartViewContext" }, outputs: { configChangeOnZoomOut: "configChangeOnZoomOut", timeRangeChangeOnRealtime: "timeRangeChangeOnRealtime", datapointOutOfSync: "datapointOutOfSync", datapointBackInSync: "datapointBackInSync", updateAlarmsAndEvents: "updateAlarmsAndEvents", isMarkedAreaEnabled: "isMarkedAreaEnabled", finishLoading: "finishLoading", updateActiveDatapoints: "updateActiveDatapoints", updateAggregatedSliderDatapoint: "updateAggregatedSliderDatapoint" }, providers: [
|
|
2834
2844
|
{ provide: NGX_ECHARTS_CONFIG, useFactory: () => ({ echarts: () => import('echarts') }) },
|
|
2835
2845
|
ChartRealtimeService,
|
|
2836
2846
|
MeasurementRealtimeService,
|
|
@@ -2878,6 +2888,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImpo
|
|
|
2878
2888
|
type: Output
|
|
2879
2889
|
}], datapointOutOfSync: [{
|
|
2880
2890
|
type: Output
|
|
2891
|
+
}], datapointBackInSync: [{
|
|
2892
|
+
type: Output
|
|
2881
2893
|
}], updateAlarmsAndEvents: [{
|
|
2882
2894
|
type: Output
|
|
2883
2895
|
}], isMarkedAreaEnabled: [{
|