@c8y/ngx-components 1023.14.70 → 1023.14.76
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/asset-properties/index.d.ts +20 -2
- package/asset-properties/index.d.ts.map +1 -1
- package/cockpit-config/index.d.ts.map +1 -1
- package/echart/index.d.ts.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-cockpit-config.mjs +7 -7
- package/fesm2022/c8y-ngx-components-cockpit-config.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-echart.mjs +44 -14
- package/fesm2022/c8y-ngx-components-echart.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-services.mjs +2 -2
- package/fesm2022/c8y-ngx-components-services.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-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-implementations-html-widget.mjs.map +1 -1
- 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.mjs +23 -4
- package/fesm2022/c8y-ngx-components.mjs.map +1 -1
- package/index.d.ts +8 -2
- package/index.d.ts.map +1 -1
- package/locales/de.po +316 -26
- package/locales/es.po +289 -7
- package/locales/fr.po +289 -7
- package/locales/ja_JP.po +289 -7
- package/locales/ko.po +289 -7
- package/locales/locales.pot +4 -4
- package/locales/nl.po +289 -7
- package/locales/pl.po +289 -7
- package/locales/pt_BR.po +289 -7
- package/locales/zh_CN.po +289 -7
- package/locales/zh_TW.po +289 -7
- package/package.json +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/three-d-rotation/index.d.ts.map +1 -1
|
@@ -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
|
|
@@ -2041,6 +2063,12 @@ class ChartsComponent {
|
|
|
2041
2063
|
}
|
|
2042
2064
|
}
|
|
2043
2065
|
else {
|
|
2066
|
+
// Only reset initialTimeRange if the change is NOT from a slider zoom on another widget
|
|
2067
|
+
if (!this.mediator.isSliderZoomUpdate()) {
|
|
2068
|
+
this.widgetTimeContextDateRangeService.updateInitialTimeRange(null);
|
|
2069
|
+
}
|
|
2070
|
+
// Clear the slider zoom flag after processing
|
|
2071
|
+
this.mediator.isSliderZoomUpdate.set(false);
|
|
2044
2072
|
this.configChangedSubject.next();
|
|
2045
2073
|
}
|
|
2046
2074
|
}
|
|
@@ -2065,6 +2093,8 @@ class ChartsComponent {
|
|
|
2065
2093
|
const options = this.echartsInstance.getOption();
|
|
2066
2094
|
const dataZoom = options['dataZoom'][0];
|
|
2067
2095
|
this.isChangeFromZoom = true;
|
|
2096
|
+
// Set global flag so other widgets know this change is from slider zoom
|
|
2097
|
+
this.mediator.isSliderZoomUpdate.set(true);
|
|
2068
2098
|
const zoomDates = {
|
|
2069
2099
|
dateFrom: new Date(dataZoom['startValue']),
|
|
2070
2100
|
dateTo: new Date(dataZoom['endValue']),
|