@c8y/ngx-components 1023.28.5 → 1023.37.0
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/alarms/cockpit/index.d.ts.map +1 -1
- package/alarms/devicemanagement/index.d.ts.map +1 -1
- package/alarms/index.d.ts +25 -2
- package/alarms/index.d.ts.map +1 -1
- package/asset-properties/index.d.ts +20 -2
- package/asset-properties/index.d.ts.map +1 -1
- package/bookmarks/index.d.ts +15 -7
- package/bookmarks/index.d.ts.map +1 -1
- package/cockpit-config/index.d.ts.map +1 -1
- package/datapoint-explorer/view/index.d.ts +2 -0
- package/datapoint-explorer/view/index.d.ts.map +1 -1
- package/datapoint-selector/index.d.ts.map +1 -1
- package/device-grid/index.d.ts.map +1 -1
- package/echart/index.d.ts +19 -3
- package/echart/index.d.ts.map +1 -1
- package/feature-toggles/index.d.ts +6 -0
- package/feature-toggles/index.d.ts.map +1 -0
- package/feature-toggles/list/index.d.ts +63 -0
- package/feature-toggles/list/index.d.ts.map +1 -0
- package/fesm2022/c8y-ngx-components-alarms-cockpit.mjs +6 -11
- package/fesm2022/c8y-ngx-components-alarms-cockpit.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-alarms-devicemanagement.mjs +37 -11
- package/fesm2022/c8y-ngx-components-alarms-devicemanagement.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-alarms.mjs +58 -10
- package/fesm2022/c8y-ngx-components-alarms.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-asset-properties.mjs +36 -12
- package/fesm2022/c8y-ngx-components-asset-properties.mjs.map +1 -1
- package/fesm2022/{c8y-ngx-components-asset-property-grid.component-B04ixTyA.mjs → c8y-ngx-components-asset-property-grid.component-BoVrIpap.mjs} +5 -12
- package/fesm2022/c8y-ngx-components-asset-property-grid.component-BoVrIpap.mjs.map +1 -0
- package/fesm2022/c8y-ngx-components-bookmarks.mjs +86 -39
- package/fesm2022/c8y-ngx-components-bookmarks.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-cockpit-config.mjs +9 -9
- package/fesm2022/c8y-ngx-components-cockpit-config.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-context-dashboard.mjs +1 -1
- package/fesm2022/c8y-ngx-components-context-dashboard.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-datapoint-explorer-view.mjs +21 -36
- package/fesm2022/c8y-ngx-components-datapoint-explorer-view.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-datapoint-selector.mjs +3 -11
- package/fesm2022/c8y-ngx-components-datapoint-selector.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-device-grid.mjs +5 -2
- package/fesm2022/c8y-ngx-components-device-grid.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-echart.mjs +101 -42
- package/fesm2022/c8y-ngx-components-echart.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-ecosystem-plugin-setup-stepper.mjs +3 -3
- package/fesm2022/c8y-ngx-components-ecosystem-plugin-setup-stepper.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-feature-toggles-list.mjs +242 -0
- package/fesm2022/c8y-ngx-components-feature-toggles-list.mjs.map +1 -0
- package/fesm2022/c8y-ngx-components-feature-toggles.mjs +36 -0
- package/fesm2022/c8y-ngx-components-feature-toggles.mjs.map +1 -0
- package/fesm2022/c8y-ngx-components-global-context.mjs +21 -6
- package/fesm2022/c8y-ngx-components-global-context.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-map.mjs +127 -33
- package/fesm2022/c8y-ngx-components-map.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-tenants.mjs +2 -2
- package/fesm2022/c8y-ngx-components-tenants.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-trusted-certificates.mjs +5 -1
- package/fesm2022/c8y-ngx-components-trusted-certificates.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-upgrade-not-found.component-CuCuYAkK.mjs +19 -0
- package/fesm2022/c8y-ngx-components-upgrade-not-found.component-CuCuYAkK.mjs.map +1 -0
- package/fesm2022/c8y-ngx-components-upgrade.mjs +33 -3
- package/fesm2022/c8y-ngx-components-upgrade.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions-html-widget.mjs +3 -3
- package/fesm2022/c8y-ngx-components-widgets-definitions-html-widget.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions-pie-chart.mjs +30 -0
- package/fesm2022/c8y-ngx-components-widgets-definitions-pie-chart.mjs.map +1 -0
- package/fesm2022/c8y-ngx-components-widgets-definitions.mjs +2 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-exports.mjs +8 -1
- package/fesm2022/c8y-ngx-components-widgets-exports.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-alarms.mjs +4 -4
- package/fesm2022/c8y-ngx-components-widgets-implementations-alarms.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-graph.mjs +3 -3
- package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-graph.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-table.mjs +2 -2
- package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-table.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-html-widget.mjs +4 -3
- package/fesm2022/c8y-ngx-components-widgets-implementations-html-widget.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-map.mjs +18 -11
- package/fesm2022/c8y-ngx-components-widgets-implementations-map.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-pie-chart.mjs +366 -0
- package/fesm2022/c8y-ngx-components-widgets-implementations-pie-chart.mjs.map +1 -0
- package/fesm2022/c8y-ngx-components-widgets-implementations-three-d-rotation.mjs +4 -0
- package/fesm2022/c8y-ngx-components-widgets-implementations-three-d-rotation.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-widget-providers.mjs +5 -2
- package/fesm2022/c8y-ngx-components-widgets-widget-providers.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components.mjs +57 -18
- package/fesm2022/c8y-ngx-components.mjs.map +1 -1
- package/global-context/index.d.ts +12 -2
- package/global-context/index.d.ts.map +1 -1
- package/index.d.ts +9 -3
- package/index.d.ts.map +1 -1
- package/locales/de.po +88 -66
- package/locales/es.po +26 -20
- package/locales/fr.po +25 -20
- package/locales/ja_JP.po +18 -20
- package/locales/ko.po +24 -20
- package/locales/locales.pot +130 -32
- package/locales/nl.po +26 -20
- package/locales/pl.po +26 -20
- package/locales/pt_BR.po +24 -20
- package/locales/zh_CN.po +26 -20
- package/locales/zh_TW.po +26 -20
- package/map/index.d.ts +41 -10
- package/map/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/trusted-certificates/index.d.ts +2 -0
- package/trusted-certificates/index.d.ts.map +1 -1
- package/upgrade/index.d.ts.map +1 -1
- package/widgets/cockpit-exports/index.d.ts +6 -0
- package/widgets/cockpit-exports/index.d.ts.map +1 -1
- package/widgets/definitions/index.d.ts +1 -0
- package/widgets/definitions/index.d.ts.map +1 -1
- package/widgets/definitions/pie-chart/index.d.ts +25 -0
- package/widgets/definitions/pie-chart/index.d.ts.map +1 -0
- package/widgets/device-management-exports/index.d.ts +6 -0
- package/widgets/device-management-exports/index.d.ts.map +1 -1
- package/widgets/exports/index.d.ts +8 -1
- package/widgets/exports/index.d.ts.map +1 -1
- package/widgets/implementations/html-widget/index.d.ts +2 -2
- package/widgets/implementations/html-widget/index.d.ts.map +1 -1
- package/widgets/implementations/map/index.d.ts +1 -0
- package/widgets/implementations/map/index.d.ts.map +1 -1
- package/widgets/implementations/pie-chart/index.d.ts +129 -0
- package/widgets/implementations/pie-chart/index.d.ts.map +1 -0
- package/widgets/implementations/three-d-rotation/index.d.ts.map +1 -1
- package/widgets/widget-providers/index.d.ts.map +1 -1
- package/fesm2022/c8y-ngx-components-asset-property-grid.component-B04ixTyA.mjs.map +0 -1
|
@@ -15,7 +15,7 @@ import { INTERVALS } from '@c8y/ngx-components/interval-picker';
|
|
|
15
15
|
import * as i5 from '@ngx-translate/core';
|
|
16
16
|
import * as i1$1 from '@angular/common';
|
|
17
17
|
import { NgIf, NgForOf, CommonModule as CommonModule$1 } from '@angular/common';
|
|
18
|
-
import * as
|
|
18
|
+
import * as i2$1 from 'ngx-echarts';
|
|
19
19
|
import { NgxEchartsModule, NGX_ECHARTS_CONFIG } from 'ngx-echarts';
|
|
20
20
|
import { TooltipModule } from 'ngx-bootstrap/tooltip';
|
|
21
21
|
import * as i1$3 from 'ngx-bootstrap/popover';
|
|
@@ -97,6 +97,8 @@ class YAxisService {
|
|
|
97
97
|
}
|
|
98
98
|
getYAxis(datapointsWithValues, YAxisOptions) {
|
|
99
99
|
const YAxisPlacement = this.getYAxisPlacement(datapointsWithValues, YAxisOptions);
|
|
100
|
+
const hasValues = datapointsWithValues.some(dp => dp.values && Object.keys(dp.values).length > 0);
|
|
101
|
+
const nameGap = hasValues ? 25 : 15;
|
|
100
102
|
if (YAxisOptions.forceMergeDatapoints) {
|
|
101
103
|
return {
|
|
102
104
|
name: Array.from(datapointsWithValues)
|
|
@@ -106,7 +108,7 @@ class YAxisService {
|
|
|
106
108
|
nameTruncate: {
|
|
107
109
|
maxWidth: 350
|
|
108
110
|
},
|
|
109
|
-
nameGap
|
|
111
|
+
nameGap,
|
|
110
112
|
nameTextStyle: {
|
|
111
113
|
// add rich text to support multiple colors for different dp units
|
|
112
114
|
rich: this.buildRichTextStyle(datapointsWithValues)
|
|
@@ -172,7 +174,7 @@ class YAxisService {
|
|
|
172
174
|
nameTruncate: {
|
|
173
175
|
maxWidth: 350
|
|
174
176
|
},
|
|
175
|
-
nameGap
|
|
177
|
+
nameGap,
|
|
176
178
|
nameTextStyle: {
|
|
177
179
|
rich: this.buildRichTextStyle(uniqueUnitDps)
|
|
178
180
|
},
|
|
@@ -440,15 +442,11 @@ class EchartsOptionsService {
|
|
|
440
442
|
setYaxisStartToZero: displayOptions.setYaxisStartToZero,
|
|
441
443
|
showLabelAndUnit: displayOptions.showLabelAndUnit
|
|
442
444
|
});
|
|
443
|
-
const
|
|
445
|
+
const hasValues = datapointsWithValues.some(dp => dp.values && Object.keys(dp.values).length > 0);
|
|
444
446
|
const leftAxis = Array.isArray(yAxis) ? yAxis.filter(yx => yx.position === 'left') : [];
|
|
445
|
-
const gridLeft = leftAxis.length
|
|
446
|
-
? leftAxis.length * (this.yAxisService.Y_AXIS_OFFSET - AXIS_PADDING)
|
|
447
|
-
: 32;
|
|
448
447
|
const rightAxis = Array.isArray(yAxis) ? yAxis.filter(yx => yx.position === 'right') : [];
|
|
449
|
-
const
|
|
450
|
-
|
|
451
|
-
: 16;
|
|
448
|
+
const gridLeft = this.calculateGridLeft(leftAxis.length, displayOptions.forceMergeDatapoints);
|
|
449
|
+
const gridRight = this.calculateGridRight(rightAxis.length, hasValues);
|
|
452
450
|
const selectedLanguage = this.translate.currentLang;
|
|
453
451
|
let intervalInMs = this.calculateExtendedIntervalInMs(selectedTimeRange?.interval || timeRange.interval || 'hours', selectedTimeRange || timeRange);
|
|
454
452
|
if (sliderZoomUsed) {
|
|
@@ -487,17 +485,23 @@ class EchartsOptionsService {
|
|
|
487
485
|
filterMode: datapointsWithValues.some(dp => dp.lineType === 'bars') ? 'filter' : 'none',
|
|
488
486
|
zoomOnMouseWheel: true,
|
|
489
487
|
startValue: selectedTimeRange
|
|
490
|
-
? selectedTimeRange.dateFrom.valueOf()
|
|
491
|
-
: timeRange.dateFrom.valueOf(),
|
|
488
|
+
? new Date(selectedTimeRange.dateFrom).valueOf()
|
|
489
|
+
: new Date(timeRange.dateFrom).valueOf(),
|
|
492
490
|
endValue: selectedTimeRange
|
|
493
|
-
? selectedTimeRange.dateTo.valueOf()
|
|
494
|
-
: timeRange.dateTo.valueOf()
|
|
491
|
+
? new Date(selectedTimeRange.dateTo).valueOf()
|
|
492
|
+
: new Date(timeRange.dateTo).valueOf()
|
|
495
493
|
},
|
|
496
494
|
{
|
|
497
495
|
type: 'slider',
|
|
498
496
|
show: displayOptions.showSlider,
|
|
499
497
|
bottom: 8,
|
|
500
498
|
realtime: false,
|
|
499
|
+
startValue: selectedTimeRange
|
|
500
|
+
? new Date(selectedTimeRange.dateFrom).valueOf()
|
|
501
|
+
: new Date(timeRange.dateFrom).valueOf(),
|
|
502
|
+
endValue: selectedTimeRange
|
|
503
|
+
? new Date(selectedTimeRange.dateTo).valueOf()
|
|
504
|
+
: new Date(timeRange.dateTo).valueOf(),
|
|
501
505
|
left: displayOptions.sliderPositionMode === 'compact' ? '64px' : '64px',
|
|
502
506
|
right: displayOptions.sliderPositionMode === 'compact' ? '172px' : '64px',
|
|
503
507
|
labelFormatter(_value, valueStr) {
|
|
@@ -557,7 +561,7 @@ class EchartsOptionsService {
|
|
|
557
561
|
.map(date => new Date(date).valueOf())
|
|
558
562
|
.sort((a, b) => a - b)[0]
|
|
559
563
|
: new Date(timeRange.dateFrom).valueOf() - intervalInMs,
|
|
560
|
-
max: timeRange.dateTo,
|
|
564
|
+
max: new Date(timeRange.dateTo).valueOf(),
|
|
561
565
|
type: 'time',
|
|
562
566
|
animation: false,
|
|
563
567
|
axisPointer: {
|
|
@@ -1123,6 +1127,24 @@ class EchartsOptionsService {
|
|
|
1123
1127
|
return grouped;
|
|
1124
1128
|
}, {});
|
|
1125
1129
|
}
|
|
1130
|
+
calculateGridLeft(leftAxisCount, forceMergeDatapoints) {
|
|
1131
|
+
const AXIS_PADDING = 20;
|
|
1132
|
+
if (!leftAxisCount) {
|
|
1133
|
+
return forceMergeDatapoints ? this.yAxisService.Y_AXIS_OFFSET : 32;
|
|
1134
|
+
}
|
|
1135
|
+
return leftAxisCount * (this.yAxisService.Y_AXIS_OFFSET - AXIS_PADDING);
|
|
1136
|
+
}
|
|
1137
|
+
calculateGridRight(rightAxisCount, hasValues) {
|
|
1138
|
+
const RIGHT_AXIS_BASE_SPACE = 48;
|
|
1139
|
+
const RIGHT_AXIS_INCREMENT_WITH_DATA = 32;
|
|
1140
|
+
if (!rightAxisCount) {
|
|
1141
|
+
return 32;
|
|
1142
|
+
}
|
|
1143
|
+
if (hasValues) {
|
|
1144
|
+
return rightAxisCount * RIGHT_AXIS_INCREMENT_WITH_DATA;
|
|
1145
|
+
}
|
|
1146
|
+
return (rightAxisCount - 1) * this.yAxisService.Y_AXIS_OFFSET + RIGHT_AXIS_BASE_SPACE;
|
|
1147
|
+
}
|
|
1126
1148
|
/**
|
|
1127
1149
|
* This method interpolates between two data points. The goal is to place the markPoint on the chart in the right place.
|
|
1128
1150
|
* @param dpValuesArray array of data points
|
|
@@ -1716,10 +1738,25 @@ class ChartRealtimeService {
|
|
|
1716
1738
|
series: allDataSeries
|
|
1717
1739
|
});
|
|
1718
1740
|
}
|
|
1741
|
+
/**
|
|
1742
|
+
* Detects if a datapoint has measurements with future timestamps (out-of-sync).
|
|
1743
|
+
*
|
|
1744
|
+
* Why 300ms tolerance?
|
|
1745
|
+
* Device clocks may be slightly ahead of browser time, network latency, or processing delays.
|
|
1746
|
+
* Without tolerance, these minor drifts would cause false positive warnings.
|
|
1747
|
+
*
|
|
1748
|
+
* Example:
|
|
1749
|
+
* Browser time: 12:00:00.000
|
|
1750
|
+
* Measurement: 12:00:00.200 (device 200ms ahead)
|
|
1751
|
+
* Without tolerance: flagged as out-of-sync (false positive)
|
|
1752
|
+
* With 300ms tolerance: allowed (200ms < 300ms threshold)
|
|
1753
|
+
*
|
|
1754
|
+
* When triggered, a warning icon appears next to the datapoint in the legend.
|
|
1755
|
+
*/
|
|
1719
1756
|
checkForValuesAfterTimeRange(data, datapoint, datapointOutOfSyncCallback) {
|
|
1720
|
-
const
|
|
1721
|
-
const valueAfterNowExists = data.some(([dateString
|
|
1722
|
-
return new Date(dateString).valueOf() >
|
|
1757
|
+
const nowWithTolerance = Date.now() + 300;
|
|
1758
|
+
const valueAfterNowExists = data.some(([dateString]) => {
|
|
1759
|
+
return new Date(dateString).valueOf() > nowWithTolerance;
|
|
1723
1760
|
});
|
|
1724
1761
|
if (valueAfterNowExists) {
|
|
1725
1762
|
datapointOutOfSyncCallback(datapoint);
|
|
@@ -1952,6 +1989,8 @@ class ChartsComponent {
|
|
|
1952
1989
|
this.alarms = [];
|
|
1953
1990
|
this.events = [];
|
|
1954
1991
|
this.activeDatapoints = [];
|
|
1992
|
+
/** Internal flag to track when chart data is being fetched */
|
|
1993
|
+
this.isFetching = false;
|
|
1955
1994
|
this.configChangeOnZoomOut = new EventEmitter();
|
|
1956
1995
|
this.timeRangeChangeOnRealtime = new EventEmitter();
|
|
1957
1996
|
this.datapointOutOfSync = new EventEmitter();
|
|
@@ -1970,15 +2009,21 @@ class ChartsComponent {
|
|
|
1970
2009
|
this.mediator = inject(WidgetTimeContextMediatorService);
|
|
1971
2010
|
this.widgetTimeContextDateRangeService = inject(WidgetTimeContextDateRangeService);
|
|
1972
2011
|
this.loadedTimeRange = null;
|
|
1973
|
-
|
|
2012
|
+
/** Tracks if the last data fetch returned truncated data */
|
|
2013
|
+
this.dataWasTruncated = false;
|
|
2014
|
+
/** Tracks if current change originated from zoom interaction */
|
|
2015
|
+
this.isChangeFromZoom = false;
|
|
2016
|
+
this.chartOption$ = this.configChangedSubject.pipe(tap(() => (this.isFetching = true)), switchMap(() => this.loadAlarmsAndEvents()), switchMap(() => this.fetchSeriesForDatapoints$()), switchMap((datapointsWithValues) => {
|
|
1974
2017
|
if (datapointsWithValues.length === 0 && this.config.alarmsEventsConfigs?.length === 0) {
|
|
1975
2018
|
this.echartsInstance?.clear();
|
|
1976
2019
|
this.showLoadMore = false;
|
|
1977
2020
|
return of(this.getDefaultChartOptions());
|
|
1978
2021
|
}
|
|
1979
|
-
|
|
2022
|
+
// Use padded range since data is fetched with 60s padding
|
|
2023
|
+
this.loadedTimeRange = { ...this.getTimeRange(60_000) };
|
|
1980
2024
|
return this.getChartOptions(datapointsWithValues);
|
|
1981
2025
|
}), tap(v => {
|
|
2026
|
+
this.isFetching = false;
|
|
1982
2027
|
this.finishLoading.emit(false);
|
|
1983
2028
|
if (v['empty']) {
|
|
1984
2029
|
return;
|
|
@@ -1999,26 +2044,35 @@ class ChartsComponent {
|
|
|
1999
2044
|
this.configChangedSubject.next();
|
|
2000
2045
|
});
|
|
2001
2046
|
}
|
|
2002
|
-
ngOnChanges(
|
|
2003
|
-
const
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
//
|
|
2011
|
-
// and one of them changes the time range which is loaded, the other one should update the zoom level accordingly
|
|
2047
|
+
ngOnChanges() {
|
|
2048
|
+
const wasFromZoom = this.isChangeFromZoom;
|
|
2049
|
+
this.isChangeFromZoom = false;
|
|
2050
|
+
if (wasFromZoom) {
|
|
2051
|
+
const currentRange = this.getTimeRange();
|
|
2052
|
+
const isWithinLoadedRange = this.loadedTimeRange &&
|
|
2053
|
+
new Date(currentRange.dateFrom) >= new Date(this.loadedTimeRange.dateFrom) &&
|
|
2054
|
+
new Date(currentRange.dateTo) <= new Date(this.loadedTimeRange.dateTo);
|
|
2055
|
+
// Sync zoom level across multiple data point graph widgets on the same dashboard
|
|
2012
2056
|
if (this.echartsInstance) {
|
|
2013
2057
|
this.echartsInstance.dispatchAction({
|
|
2014
2058
|
type: 'dataZoom',
|
|
2015
|
-
startValue: new Date(
|
|
2016
|
-
endValue: new Date(
|
|
2059
|
+
startValue: new Date(currentRange.dateFrom).getTime(),
|
|
2060
|
+
endValue: new Date(currentRange.dateTo).getTime()
|
|
2017
2061
|
}, { silent: true });
|
|
2018
2062
|
}
|
|
2019
|
-
|
|
2063
|
+
if (!isWithinLoadedRange || this.dataWasTruncated) {
|
|
2064
|
+
this.configChangedSubject.next();
|
|
2065
|
+
}
|
|
2066
|
+
}
|
|
2067
|
+
else {
|
|
2068
|
+
// Only reset initialTimeRange if the change is NOT from a slider zoom on another widget
|
|
2069
|
+
if (!this.mediator.isSliderZoomUpdate()) {
|
|
2070
|
+
this.widgetTimeContextDateRangeService.updateInitialTimeRange(null);
|
|
2071
|
+
}
|
|
2072
|
+
// Clear the slider zoom flag after processing
|
|
2073
|
+
this.mediator.isSliderZoomUpdate.set(false);
|
|
2074
|
+
this.configChangedSubject.next();
|
|
2020
2075
|
}
|
|
2021
|
-
this.configChangedSubject.next();
|
|
2022
2076
|
}
|
|
2023
2077
|
ngOnInit() {
|
|
2024
2078
|
if (this.alerts) {
|
|
@@ -2040,17 +2094,21 @@ class ChartsComponent {
|
|
|
2040
2094
|
}
|
|
2041
2095
|
const options = this.echartsInstance.getOption();
|
|
2042
2096
|
const dataZoom = options['dataZoom'][0];
|
|
2043
|
-
this.
|
|
2097
|
+
this.isChangeFromZoom = true;
|
|
2098
|
+
// Set global flag so other widgets know this change is from slider zoom
|
|
2099
|
+
this.mediator.isSliderZoomUpdate.set(true);
|
|
2100
|
+
const zoomDates = {
|
|
2044
2101
|
dateFrom: new Date(dataZoom['startValue']),
|
|
2045
2102
|
dateTo: new Date(dataZoom['endValue']),
|
|
2046
2103
|
interval: 'custom'
|
|
2047
|
-
}
|
|
2104
|
+
};
|
|
2105
|
+
this.configChangeOnZoomOut.emit(zoomDates);
|
|
2048
2106
|
this.echartsInstance.setOption(options);
|
|
2049
2107
|
this.chartRealtimeService.stopRealtime();
|
|
2050
2108
|
};
|
|
2051
2109
|
const debouncedDataZoomHandler = this.config.realtime
|
|
2052
2110
|
? dataZoomHandler
|
|
2053
|
-
: this.debounce(dataZoomHandler,
|
|
2111
|
+
: this.debounce(dataZoomHandler, 100);
|
|
2054
2112
|
this.echartsInstance.on('dataZoom', debouncedDataZoomHandler);
|
|
2055
2113
|
this.echartsInstance.on('click', this.onChartClick.bind(this));
|
|
2056
2114
|
let originalFormatter = null;
|
|
@@ -2477,7 +2535,8 @@ class ChartsComponent {
|
|
|
2477
2535
|
datapointsWithValuesRequests.push(request);
|
|
2478
2536
|
}
|
|
2479
2537
|
return forkJoin(datapointsWithValuesRequests).pipe(tap((dpsWithValues) => {
|
|
2480
|
-
|
|
2538
|
+
this.dataWasTruncated = dpsWithValues.some(dp => dp['truncated']);
|
|
2539
|
+
if (this.dataWasTruncated) {
|
|
2481
2540
|
this.addTruncatedDataAlert();
|
|
2482
2541
|
}
|
|
2483
2542
|
}));
|
|
@@ -2573,7 +2632,7 @@ class ChartsComponent {
|
|
|
2573
2632
|
return { dateFrom: timeRange.dateFrom.toISOString(), dateTo: timeRange.dateTo.toISOString() };
|
|
2574
2633
|
}
|
|
2575
2634
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ChartsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2576
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
2635
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", 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: [
|
|
2577
2636
|
{ provide: NGX_ECHARTS_CONFIG, useFactory: () => ({ echarts: () => import('echarts') }) },
|
|
2578
2637
|
ChartRealtimeService,
|
|
2579
2638
|
MeasurementRealtimeService,
|
|
@@ -2584,7 +2643,7 @@ class ChartsComponent {
|
|
|
2584
2643
|
YAxisService,
|
|
2585
2644
|
AlarmSeverityToIconPipe,
|
|
2586
2645
|
AlarmSeverityToLabelPipe
|
|
2587
|
-
], viewQueries: [{ propertyName: "chart", first: true, predicate: ["chart"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"p-relative fit-h chart-container\">\n <div\n class=\"fit-w fit-h\"\n #chart\n echarts\n [options]=\"chartOption$ | async\"\n (chartInit)=\"onChartInit($event)\"\n ></div>\n\n <c8y-chart-alerts [alerts]=\"alerts\"></c8y-chart-alerts>\n\n
|
|
2646
|
+
], viewQueries: [{ propertyName: "chart", first: true, predicate: ["chart"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"p-relative fit-h chart-container\">\n <div\n class=\"fit-w fit-h\"\n #chart\n echarts\n [options]=\"chartOption$ | async\"\n (chartInit)=\"onChartInit($event)\"\n ></div>\n\n <c8y-chart-alerts [alerts]=\"alerts\"></c8y-chart-alerts>\n\n @if (showLoadMore) {\n <div class=\"chart-load-more\">\n <button\n class=\"btn btn-primary btn-block\"\n [disabled]=\"isFetching\"\n (click)=\"loadMoreData()\"\n >\n <i c8yIcon=\"restore\"></i>\n {{ 'Load more' | translate }}\n </button>\n </div>\n }\n\n @if (\n activeDatapoints.length > 1 &&\n config?.showSlider &&\n chartViewContext !== CHART_VIEW_CONTEXT.WIDGET_VIEW\n ) {\n <div class=\"e-charts--aggregated-datapoint\">\n <c8y-select-aggregated-datapoint\n [value]=\"config?.aggregatedDatapoint || activeDatapoints[0]\"\n (valueChange)=\"updateAggregatedSliderDatapoint.emit($event)\"\n [activeDatapoints]=\"activeDatapoints\"\n ></c8y-select-aggregated-datapoint>\n </div>\n }\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule$1 }, { kind: "ngmodule", type: CoreModule }, { kind: "directive", type: i1.IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "ngmodule", type: NgxEchartsModule }, { kind: "directive", type: i2$1.NgxEchartsDirective, selector: "echarts, [echarts]", inputs: ["options", "theme", "initOpts", "merge", "autoResize", "loading", "loadingType", "loadingOpts"], outputs: ["chartInit", "optionsError", "chartClick", "chartDblClick", "chartMouseDown", "chartMouseMove", "chartMouseUp", "chartMouseOver", "chartMouseOut", "chartGlobalOut", "chartContextMenu", "chartHighlight", "chartDownplay", "chartSelectChanged", "chartLegendSelectChanged", "chartLegendSelected", "chartLegendUnselected", "chartLegendLegendSelectAll", "chartLegendLegendInverseSelect", "chartLegendScroll", "chartDataZoom", "chartDataRangeSelected", "chartGraphRoam", "chartGeoRoam", "chartTreeRoam", "chartTimelineChanged", "chartTimelinePlayChanged", "chartRestore", "chartDataViewChanged", "chartMagicTypeChanged", "chartGeoSelectChanged", "chartGeoSelected", "chartGeoUnselected", "chartAxisAreaSelected", "chartBrush", "chartBrushEnd", "chartBrushSelected", "chartGlobalCursorTaken", "chartRendered", "chartFinished"], exportAs: ["echarts"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "ngmodule", type: PopoverModule }, { kind: "component", type: ChartAlertsComponent, selector: "c8y-chart-alerts", inputs: ["alerts"] }, { kind: "ngmodule", type: AlarmsModule }, { kind: "component", type: SelectAggregatedDatapointComponent, selector: "c8y-select-aggregated-datapoint", inputs: ["activeDatapoints", "value"], outputs: ["valueChange"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i1.C8yTranslatePipe, name: "translate" }] }); }
|
|
2588
2647
|
}
|
|
2589
2648
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ChartsComponent, decorators: [{
|
|
2590
2649
|
type: Component,
|
|
@@ -2608,7 +2667,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
|
|
|
2608
2667
|
ChartAlertsComponent,
|
|
2609
2668
|
AlarmsModule,
|
|
2610
2669
|
SelectAggregatedDatapointComponent
|
|
2611
|
-
], template: "<div class=\"p-relative fit-h chart-container\">\n <div\n class=\"fit-w fit-h\"\n #chart\n echarts\n [options]=\"chartOption$ | async\"\n (chartInit)=\"onChartInit($event)\"\n ></div>\n\n <c8y-chart-alerts [alerts]=\"alerts\"></c8y-chart-alerts>\n\n
|
|
2670
|
+
], template: "<div class=\"p-relative fit-h chart-container\">\n <div\n class=\"fit-w fit-h\"\n #chart\n echarts\n [options]=\"chartOption$ | async\"\n (chartInit)=\"onChartInit($event)\"\n ></div>\n\n <c8y-chart-alerts [alerts]=\"alerts\"></c8y-chart-alerts>\n\n @if (showLoadMore) {\n <div class=\"chart-load-more\">\n <button\n class=\"btn btn-primary btn-block\"\n [disabled]=\"isFetching\"\n (click)=\"loadMoreData()\"\n >\n <i c8yIcon=\"restore\"></i>\n {{ 'Load more' | translate }}\n </button>\n </div>\n }\n\n @if (\n activeDatapoints.length > 1 &&\n config?.showSlider &&\n chartViewContext !== CHART_VIEW_CONTEXT.WIDGET_VIEW\n ) {\n <div class=\"e-charts--aggregated-datapoint\">\n <c8y-select-aggregated-datapoint\n [value]=\"config?.aggregatedDatapoint || activeDatapoints[0]\"\n (valueChange)=\"updateAggregatedSliderDatapoint.emit($event)\"\n [activeDatapoints]=\"activeDatapoints\"\n ></c8y-select-aggregated-datapoint>\n </div>\n }\n</div>\n" }]
|
|
2612
2671
|
}], ctorParameters: () => [], propDecorators: { config: [{
|
|
2613
2672
|
type: Input
|
|
2614
2673
|
}], alerts: [{
|
|
@@ -2640,5 +2699,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
|
|
|
2640
2699
|
* Generated bundle index. Do not edit.
|
|
2641
2700
|
*/
|
|
2642
2701
|
|
|
2643
|
-
export { CHART_VIEW_CONTEXT, ChartAlarmsService, ChartEventsService, ChartHelpersService, ChartsComponent, DATE_SELECTION_EXTENDED, ICONS_MAP, LEGEND_DISPLAY_OPTIONS, PRODUCT_EXPERIENCE_DATA_EXPLORER_AND_GRAPH, REALTIME_TEXTS, SEVERITY_LABELS, SelectAggregatedDatapointComponent };
|
|
2702
|
+
export { CHART_VIEW_CONTEXT, ChartAlarmsService, ChartAlertsComponent, ChartEventsService, ChartHelpersService, ChartsComponent, DATE_SELECTION_EXTENDED, ICONS_MAP, LEGEND_DISPLAY_OPTIONS, PRODUCT_EXPERIENCE_DATA_EXPLORER_AND_GRAPH, REALTIME_TEXTS, SEVERITY_LABELS, SelectAggregatedDatapointComponent };
|
|
2644
2703
|
//# sourceMappingURL=c8y-ngx-components-echart.mjs.map
|