@c8y/ngx-components 1023.80.0 → 1023.81.2

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 (41) hide show
  1. package/datapoint-explorer/view/index.d.ts +1 -0
  2. package/datapoint-explorer/view/index.d.ts.map +1 -1
  3. package/echart/index.d.ts +2 -1
  4. package/echart/index.d.ts.map +1 -1
  5. package/fesm2022/c8y-ngx-components-datapoint-explorer-view.mjs +10 -2
  6. package/fesm2022/c8y-ngx-components-datapoint-explorer-view.mjs.map +1 -1
  7. package/fesm2022/c8y-ngx-components-echart.mjs +26 -14
  8. package/fesm2022/c8y-ngx-components-echart.mjs.map +1 -1
  9. package/fesm2022/c8y-ngx-components-global-context.mjs +23 -3
  10. package/fesm2022/c8y-ngx-components-global-context.mjs.map +1 -1
  11. package/fesm2022/c8y-ngx-components-static-assets-data.mjs +9 -5
  12. package/fesm2022/c8y-ngx-components-static-assets-data.mjs.map +1 -1
  13. package/fesm2022/c8y-ngx-components-widgets-implementations-asset-table.mjs +17 -10
  14. package/fesm2022/c8y-ngx-components-widgets-implementations-asset-table.mjs.map +1 -1
  15. package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-graph.mjs +11 -3
  16. package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-graph.mjs.map +1 -1
  17. package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-list.mjs +47 -8
  18. package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-list.mjs.map +1 -1
  19. package/fesm2022/c8y-ngx-components.mjs +83 -63
  20. package/fesm2022/c8y-ngx-components.mjs.map +1 -1
  21. package/global-context/index.d.ts +17 -2
  22. package/global-context/index.d.ts.map +1 -1
  23. package/index.d.ts +33 -29
  24. package/index.d.ts.map +1 -1
  25. package/locales/de.po +3 -0
  26. package/locales/es.po +3 -0
  27. package/locales/fr.po +3 -0
  28. package/locales/ja_JP.po +3 -0
  29. package/locales/ko.po +3 -0
  30. package/locales/nl.po +3 -0
  31. package/locales/pl.po +3 -0
  32. package/locales/pt_BR.po +3 -0
  33. package/locales/zh_CN.po +3 -0
  34. package/locales/zh_TW.po +3 -0
  35. package/package.json +1 -1
  36. package/static-assets/data/index.d.ts.map +1 -1
  37. package/widgets/implementations/asset-table/index.d.ts.map +1 -1
  38. package/widgets/implementations/datapoints-graph/index.d.ts +1 -0
  39. package/widgets/implementations/datapoints-graph/index.d.ts.map +1 -1
  40. package/widgets/implementations/datapoints-list/index.d.ts +5 -0
  41. package/widgets/implementations/datapoints-list/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((this.currentTimeRange?.dateFrom?.valueOf() || 0) + this.INTERVAL),
1631
- dateTo: new Date((this.currentTimeRange?.dateTo?.valueOf() || 0) + this.INTERVAL)
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 300ms tolerance?
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:00.200 (device 200ms ahead)
1851
+ * Measurement: 12:00:01.000 (device 1000ms ahead)
1849
1852
  * Without tolerance: flagged as out-of-sync (false positive)
1850
- * With 300ms tolerance: allowed (200ms < 300ms threshold)
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() + 300;
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: [{