@c8y/ngx-components 1023.81.3 → 1023.82.1
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 +11 -1
- package/datapoint-explorer/view/index.d.ts.map +1 -1
- package/echart/index.d.ts.map +1 -1
- package/fesm2022/c8y-ngx-components-datapoint-explorer-view.mjs +59 -8
- package/fesm2022/c8y-ngx-components-datapoint-explorer-view.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-echart.mjs +29 -16
- package/fesm2022/c8y-ngx-components-echart.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-device-management-welcome.mjs +2 -2
- package/fesm2022/c8y-ngx-components-widgets-implementations-device-management-welcome.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components.mjs +3 -3
- package/fesm2022/c8y-ngx-components.mjs.map +1 -1
- package/locales/de.po +23 -16
- package/locales/es.po +6 -0
- package/locales/fr.po +186 -175
- package/locales/ja_JP.po +393 -290
- package/locales/ko.po +6 -0
- package/locales/locales.pot +6 -0
- package/locales/nl.po +6 -0
- package/locales/pl.po +6 -0
- package/locales/pt_BR.po +6 -0
- package/locales/zh_CN.po +6 -0
- package/locales/zh_TW.po +6 -0
- package/package.json +1 -1
|
@@ -105,12 +105,14 @@ class YAxisService {
|
|
|
105
105
|
constructor(appStateService) {
|
|
106
106
|
this.appStateService = appStateService;
|
|
107
107
|
this.Y_AXIS_OFFSET = 48;
|
|
108
|
+
this.Y_AXIS_OFFSET_WITH_DP_VALUES = 22;
|
|
109
|
+
this.Y_AXIS_OFFSET_WITHOUT_DP_VALUES = 15;
|
|
108
110
|
this.intlNumberFormatCompliantLocale = this.appStateService.state.lang.replace('_', '-');
|
|
109
111
|
}
|
|
110
112
|
getYAxis(datapointsWithValues, YAxisOptions) {
|
|
111
113
|
const YAxisPlacement = this.getYAxisPlacement(datapointsWithValues, YAxisOptions);
|
|
112
|
-
const hasValues =
|
|
113
|
-
const
|
|
114
|
+
const hasValues = dp => dp.values && Object.keys(dp.values).length > 0;
|
|
115
|
+
const anyDpHasValues = datapointsWithValues.some(dp => hasValues(dp));
|
|
114
116
|
if (YAxisOptions.forceMergeDatapoints) {
|
|
115
117
|
return {
|
|
116
118
|
name: Array.from(datapointsWithValues)
|
|
@@ -120,7 +122,9 @@ class YAxisService {
|
|
|
120
122
|
nameTruncate: {
|
|
121
123
|
maxWidth: 350
|
|
122
124
|
},
|
|
123
|
-
nameGap
|
|
125
|
+
nameGap: anyDpHasValues
|
|
126
|
+
? this.Y_AXIS_OFFSET_WITH_DP_VALUES
|
|
127
|
+
: this.Y_AXIS_OFFSET_WITHOUT_DP_VALUES,
|
|
124
128
|
nameTextStyle: {
|
|
125
129
|
// add rich text to support multiple colors for different dp units
|
|
126
130
|
rich: this.buildRichTextStyle(datapointsWithValues)
|
|
@@ -187,7 +191,9 @@ class YAxisService {
|
|
|
187
191
|
nameTruncate: {
|
|
188
192
|
maxWidth: 350
|
|
189
193
|
},
|
|
190
|
-
nameGap
|
|
194
|
+
nameGap: hasValues(dp)
|
|
195
|
+
? this.Y_AXIS_OFFSET_WITH_DP_VALUES
|
|
196
|
+
: this.Y_AXIS_OFFSET_WITHOUT_DP_VALUES,
|
|
191
197
|
nameTextStyle: {
|
|
192
198
|
rich: this.buildRichTextStyle(uniqueUnitDps)
|
|
193
199
|
},
|
|
@@ -576,8 +582,8 @@ class EchartsOptionsService {
|
|
|
576
582
|
show: false
|
|
577
583
|
},
|
|
578
584
|
xAxis: {
|
|
579
|
-
min: Object.keys(aggregatedDatapoint
|
|
580
|
-
? Math.min(Object.keys(aggregatedDatapoint
|
|
585
|
+
min: Object.keys(aggregatedDatapoint?.values || {}).length > 0
|
|
586
|
+
? Math.min(Object.keys(aggregatedDatapoint?.values || {})
|
|
581
587
|
.map(date => new Date(date).valueOf())
|
|
582
588
|
.sort((a, b) => a - b)[0], new Date(timeRange.dateFrom).valueOf())
|
|
583
589
|
: new Date(timeRange.dateFrom).valueOf() - intervalInMs,
|
|
@@ -673,6 +679,9 @@ class EchartsOptionsService {
|
|
|
673
679
|
return intervalInMs;
|
|
674
680
|
}
|
|
675
681
|
getAggregatedSeries(aggregatedDatapoint, displayOptions) {
|
|
682
|
+
if (!aggregatedDatapoint) {
|
|
683
|
+
return { type: 'line', data: [], id: 'aggregated-empty' };
|
|
684
|
+
}
|
|
676
685
|
const series = [];
|
|
677
686
|
const renderType = aggregatedDatapoint?.renderType || 'min';
|
|
678
687
|
const idx = 0;
|
|
@@ -2641,17 +2650,19 @@ class ChartsComponent {
|
|
|
2641
2650
|
});
|
|
2642
2651
|
const extendedDateFrom = new Date(new Date(timeRange.dateFrom).valueOf() - extendedIntervalMs).toISOString();
|
|
2643
2652
|
this.widgetTimeContextDateRangeService.updateInitialTimeRange(timeRange);
|
|
2644
|
-
const
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2653
|
+
const aggregatedDatapoint = this.config.showSlider
|
|
2654
|
+
? await lastValueFrom(this.fetchAggregatedSeriesForSelectedDatapoint$({
|
|
2655
|
+
dateFrom: extendedDateFrom,
|
|
2656
|
+
dateTo: timeRange.dateTo
|
|
2657
|
+
}, this.config.aggregatedDatapoint))
|
|
2658
|
+
: undefined;
|
|
2648
2659
|
return this.echartsOptionsService.getChartOptions(datapointsWithValues, timeRange, {
|
|
2649
2660
|
YAxis: this.config.yAxisSplitLines || false,
|
|
2650
2661
|
XAxis: this.config.xAxisSplitLines || false
|
|
2651
2662
|
}, this.events, this.alarms, {
|
|
2652
2663
|
sliderPositionMode,
|
|
2653
2664
|
...this.displayOptions
|
|
2654
|
-
}, undefined,
|
|
2665
|
+
}, undefined, aggregatedDatapoint);
|
|
2655
2666
|
}
|
|
2656
2667
|
else {
|
|
2657
2668
|
const cachedTimeRange = this.widgetTimeContextDateRangeService.initialTimeRange();
|
|
@@ -2661,10 +2672,12 @@ class ChartsComponent {
|
|
|
2661
2672
|
dateTo: cachedTimeRange.dateTo
|
|
2662
2673
|
});
|
|
2663
2674
|
const initialExtendedDateFrom = new Date(initialDateFromValue - calculateInitialIntervalInMs).toISOString();
|
|
2664
|
-
const
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2675
|
+
const aggregatedDatapoint = this.config.showSlider
|
|
2676
|
+
? await lastValueFrom(this.fetchAggregatedSeriesForSelectedDatapoint$({
|
|
2677
|
+
dateFrom: initialExtendedDateFrom,
|
|
2678
|
+
dateTo: new Date(this.widgetTimeContextDateRangeService.initialTimeRange().dateTo).toISOString()
|
|
2679
|
+
}, this.config.aggregatedDatapoint))
|
|
2680
|
+
: undefined;
|
|
2668
2681
|
// we need to update the initial time range by adding the refresh interval to the dateFrom and dateTo
|
|
2669
2682
|
const initialTimeRange = this.widgetTimeContextDateRangeService.initialTimeRange();
|
|
2670
2683
|
// needed due to a race condition where the time range is updated before the chart options are fetched...
|
|
@@ -2683,7 +2696,7 @@ class ChartsComponent {
|
|
|
2683
2696
|
}, this.events, this.alarms, {
|
|
2684
2697
|
sliderPositionMode,
|
|
2685
2698
|
...this.displayOptions
|
|
2686
|
-
}, timeRange,
|
|
2699
|
+
}, timeRange, aggregatedDatapoint, true);
|
|
2687
2700
|
}
|
|
2688
2701
|
}
|
|
2689
2702
|
fetchSeriesForDatapoints$() {
|