@c8y/ngx-components 1022.34.0 → 1022.35.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/core/common/date.pipe.d.ts.map +1 -1
- package/datapoint-explorer/view/datapoint-explorer.component.d.ts +7 -3
- package/datapoint-explorer/view/datapoint-explorer.component.d.ts.map +1 -1
- package/echart/charts.component.d.ts +11 -2
- package/echart/charts.component.d.ts.map +1 -1
- package/echart/index.d.ts +1 -0
- package/echart/index.d.ts.map +1 -1
- package/echart/models/chart.model.d.ts +5 -0
- package/echart/models/chart.model.d.ts.map +1 -1
- package/echart/models/datapoints-graph-widget.model.d.ts +2 -0
- package/echart/models/datapoints-graph-widget.model.d.ts.map +1 -1
- package/echart/select-aggregated-datapoint/select-aggregated-datapoint.component.d.ts +18 -0
- package/echart/select-aggregated-datapoint/select-aggregated-datapoint.component.d.ts.map +1 -0
- package/echart/services/chart-helpers.service.d.ts +4 -0
- package/echart/services/chart-helpers.service.d.ts.map +1 -1
- package/echart/services/echarts-options.service.d.ts +2 -2
- package/echart/services/echarts-options.service.d.ts.map +1 -1
- package/fesm2022/c8y-ngx-components-alarm-event-selector.mjs +2 -2
- package/fesm2022/c8y-ngx-components-alarm-event-selector.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-datapoint-explorer-view.mjs +22 -12
- package/fesm2022/c8y-ngx-components-datapoint-explorer-view.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-echart-models.mjs +9 -2
- package/fesm2022/c8y-ngx-components-echart-models.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-echart.mjs +313 -132
- package/fesm2022/c8y-ngx-components-echart.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-graph.mjs +15 -7
- package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-graph.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components.mjs +2 -0
- package/fesm2022/c8y-ngx-components.mjs.map +1 -1
- package/locales/de.po +33 -0
- package/locales/es.po +33 -0
- package/locales/fr.po +33 -0
- package/locales/ja_JP.po +33 -0
- package/locales/ko.po +33 -0
- package/locales/locales.pot +6 -0
- package/locales/nl.po +33 -0
- package/locales/pl.po +33 -0
- package/locales/pt_BR.po +33 -0
- package/locales/zh_CN.po +33 -0
- package/locales/zh_TW.po +33 -0
- package/package.json +1 -1
- package/widgets/implementations/datapoints-graph/datapoints-graph-config/datapoints-graph-widget-config.component.d.ts +4 -1
- package/widgets/implementations/datapoints-graph/datapoints-graph-config/datapoints-graph-widget-config.component.d.ts.map +1 -1
- package/widgets/implementations/datapoints-graph/datapoints-graph-view/datapoints-graph-widget-view.component.d.ts +2 -1
- package/widgets/implementations/datapoints-graph/datapoints-graph-view/datapoints-graph-widget-view.component.d.ts.map +1 -1
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, Input, Component, EventEmitter, inject,
|
|
2
|
+
import { Injectable, Input, Component, EventEmitter, inject, Output, ViewChild } from '@angular/core';
|
|
3
|
+
import { gettext } from '@c8y/ngx-components/gettext';
|
|
3
4
|
import { from, merge, interval, BehaviorSubject, of, lastValueFrom, defer, forkJoin } from 'rxjs';
|
|
4
5
|
import { mergeMap, map, tap, throttleTime, buffer, switchMap } from 'rxjs/operators';
|
|
5
6
|
import * as i1 from '@c8y/ngx-components';
|
|
6
|
-
import {
|
|
7
|
+
import { CommonModule, FormsModule, C8yTranslatePipe, IconDirective, WidgetTimeContextDateRangeService, DismissAlertStrategy, DynamicComponentAlert, CoreModule, MeasurementRealtimeService, AlarmRealtimeService, EventRealtimeService } from '@c8y/ngx-components';
|
|
7
8
|
import * as i1$1 from '@c8y/client';
|
|
8
9
|
import { AlarmStatus, MeasurementService, aggregationType } from '@c8y/client';
|
|
9
10
|
import * as i6 from '@angular/router';
|
|
@@ -12,11 +13,74 @@ import { AlarmsModule, AlarmSeverityToIconPipe, AlarmSeverityToLabelPipe } from
|
|
|
12
13
|
import { INTERVALS } from '@c8y/ngx-components/interval-picker';
|
|
13
14
|
import * as i5 from '@ngx-translate/core';
|
|
14
15
|
import * as i2 from '@angular/common';
|
|
15
|
-
import { CommonModule as CommonModule$1 } from '@angular/common';
|
|
16
|
-
import * as i3 from 'ngx-echarts';
|
|
16
|
+
import { NgIf, NgForOf, CommonModule as CommonModule$1 } from '@angular/common';
|
|
17
|
+
import * as i3$1 from 'ngx-echarts';
|
|
17
18
|
import { NgxEchartsModule, NGX_ECHARTS_CONFIG } from 'ngx-echarts';
|
|
18
19
|
import { TooltipModule } from 'ngx-bootstrap/tooltip';
|
|
20
|
+
import * as i1$2 from 'ngx-bootstrap/popover';
|
|
19
21
|
import { PopoverModule } from 'ngx-bootstrap/popover';
|
|
22
|
+
import * as i2$1 from 'ngx-bootstrap/dropdown';
|
|
23
|
+
import { BsDropdownModule } from 'ngx-bootstrap/dropdown';
|
|
24
|
+
import * as i3 from '@angular/cdk/a11y';
|
|
25
|
+
import { A11yModule } from '@angular/cdk/a11y';
|
|
26
|
+
|
|
27
|
+
var DATE_SELECTION_EXTENDED;
|
|
28
|
+
(function (DATE_SELECTION_EXTENDED) {
|
|
29
|
+
DATE_SELECTION_EXTENDED["CONFIG"] = "config";
|
|
30
|
+
DATE_SELECTION_EXTENDED["DASHBOARD_CONTEXT"] = "dashboard_context";
|
|
31
|
+
})(DATE_SELECTION_EXTENDED || (DATE_SELECTION_EXTENDED = {}));
|
|
32
|
+
const REALTIME_TEXTS = {
|
|
33
|
+
ACTIVE: gettext('Realtime active'),
|
|
34
|
+
INACTIVE: gettext('Realtime inactive')
|
|
35
|
+
};
|
|
36
|
+
const PRODUCT_EXPERIENCE_DATA_EXPLORER_AND_GRAPH = {
|
|
37
|
+
EVENTS: {
|
|
38
|
+
DATA_EXPLORER_AND_GRAPH: 'data-explorer-and-graph'
|
|
39
|
+
},
|
|
40
|
+
COMPONENTS: {
|
|
41
|
+
DATA_EXPLORER_DETAILS: 'data-explorer-details'
|
|
42
|
+
},
|
|
43
|
+
ACTIONS: {
|
|
44
|
+
DATA_EXPLORER_CONFIG_INIT: 'data-explorer-config-init',
|
|
45
|
+
DATA_EXPLORER_CONFIG_CHANGE: 'data-explorer-config-change',
|
|
46
|
+
DATA_GRAPH_WIDGET_CONFIG: 'data-graph-widget-config'
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
const SEVERITY_LABELS = {
|
|
50
|
+
CRITICAL: gettext('Critical`alarm`'),
|
|
51
|
+
MAJOR: gettext('Major`alarm`'),
|
|
52
|
+
MINOR: gettext('Minor`alarm`'),
|
|
53
|
+
WARNING: gettext('Warning`alarm`')
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
var CHART_VIEW_CONTEXT;
|
|
57
|
+
(function (CHART_VIEW_CONTEXT) {
|
|
58
|
+
CHART_VIEW_CONTEXT["WIDGET_VIEW"] = "widget_view";
|
|
59
|
+
CHART_VIEW_CONTEXT["WIDGET_CONFIG"] = "widget_config";
|
|
60
|
+
CHART_VIEW_CONTEXT["DATAPOINT_EXPLORER"] = "datapoint_explorer";
|
|
61
|
+
})(CHART_VIEW_CONTEXT || (CHART_VIEW_CONTEXT = {}));
|
|
62
|
+
|
|
63
|
+
var ICONS;
|
|
64
|
+
(function (ICONS) {
|
|
65
|
+
ICONS["ALARM"] = "path://M18.375 15.8462L20.4423 17.9135V18.9231H4V17.9135L6.06731 15.8462V10.75C6.06731 9.14744 6.47596 7.75321 7.29327 6.56731C8.11058 5.38141 9.24038 4.61218 10.6827 4.25962V3.53846C10.6827 3.12179 10.8269 2.76122 11.1154 2.45673C11.4038 2.15224 11.7724 2 12.2212 2C12.6699 2 13.0385 2.15224 13.3269 2.45673C13.6154 2.76122 13.7596 3.12179 13.7596 3.53846V4.25962C15.2019 4.61218 16.3317 5.38141 17.149 6.56731C17.9663 7.75321 18.375 9.14744 18.375 10.75V15.8462ZM12.2212 22C11.6442 22 11.1554 21.8077 10.7548 21.4231C10.3542 21.0385 10.1538 20.5577 10.1538 19.9808H14.2885C14.2885 20.5256 14.0801 20.9984 13.6635 21.399C13.2468 21.7997 12.766 22 12.2212 22Z";
|
|
66
|
+
ICONS["EVENT"] = "path://M97.3013 63L128.939 95.1315C79.296 134.335 47.7653 191.526 47.7653 255.276C47.7653 319.027 79.296 376.218 128.917 415.421L97.28 447.574C37.76 400.552 0 331.93 0 255.276C0 178.622 37.76 110.001 97.3013 63ZM414.72 63C474.24 110.001 512 178.622 512 255.276C512 331.93 474.24 400.552 414.72 447.574L383.083 415.421C432.704 376.218 464.235 319.027 464.235 255.276C464.235 191.526 432.704 134.335 383.083 95.1315L414.72 63ZM160.405 127.092L192 159.181C162.24 182.681 143.317 217.013 143.317 255.276C143.317 293.539 162.219 327.871 192 351.372L160.405 383.461C120.725 352.119 95.552 306.379 95.552 255.276C95.552 204.174 120.725 158.433 160.405 127.092ZM351.595 127.092C391.296 158.433 416.448 204.174 416.448 255.276C416.448 306.379 391.275 352.119 351.595 383.461L320 351.372C349.781 327.871 368.683 293.539 368.683 255.276C368.683 217.013 349.781 182.703 320 159.181L351.595 127.092ZM256 192.722C291.505 192.722 320.287 221.504 320.287 257.009C320.287 292.514 291.505 321.296 256 321.296C220.495 321.296 191.713 292.514 191.713 257.009C191.713 221.504 220.495 192.722 256 192.722Z";
|
|
67
|
+
ICONS["ACKNOWLEDGED"] = "path://M10.4795 2H13.4807V4.18054C14.1215 4.35248 14.7155 4.61821 15.2626 4.97773C15.8097 5.35287 16.2864 5.79836 16.6928 6.31419C17.0993 6.81438 17.4119 7.3771 17.6307 8.00234C17.8652 8.62759 17.9824 9.29191 17.9824 9.99531V13.7702L16.9742 12.762V12.7855L9.72919 5.54045C9.74482 5.54045 9.75264 5.54045 9.75264 5.54045L9.00234 4.79015C9.22118 4.64947 9.45565 4.53224 9.70574 4.43845C9.95584 4.34467 10.2138 4.25869 10.4795 4.18054V2ZM4.4068 3.03165L21.4291 20.0305L19.9988 21.4373L17.5604 18.9988H13.6917C13.7855 19.1551 13.8558 19.3193 13.9027 19.4912C13.9496 19.6475 13.973 19.8195 13.973 20.007C13.973 20.5541 13.7776 21.0231 13.3869 21.4138C12.9961 21.8046 12.5272 22 11.9801 22C11.4174 22 10.9406 21.8046 10.5498 21.4138C10.159 21.0231 9.96366 20.5541 9.96366 20.007C9.96366 19.8195 9.9871 19.6475 10.034 19.4912C10.0809 19.3193 10.1512 19.1551 10.245 18.9988H3.96131V17.9906L5.97773 15.9977V9.99531C5.97773 9.60453 6.00899 9.22939 6.07151 8.86987C6.14967 8.51036 6.25127 8.15866 6.37632 7.81477L3 4.43845L4.4068 3.03165Z";
|
|
68
|
+
ICONS["CLEARED"] = "path://M9.09375 19.5977C9.09375 20.2617 9.32812 20.8281 9.79688 21.2969C10.2786 21.7656 10.8516 22 11.5156 22C12.1927 22 12.7656 21.7656 13.2344 21.2969C13.7161 20.8281 13.957 20.2617 13.957 19.5977H9.09375ZM16.8672 10.418C16.3203 10.5091 15.7995 10.6784 15.3047 10.9258C14.8229 11.1732 14.3867 11.4922 13.9961 11.8828C13.5013 12.3776 13.1172 12.944 12.8438 13.582C12.5833 14.2201 12.4531 14.8841 12.4531 15.5742C12.4531 16.0299 12.5052 16.4727 12.6094 16.9023C12.7266 17.332 12.8958 17.7422 13.1172 18.1328H3V16.375C4.04167 16.0495 4.74479 15.3919 5.10938 14.4023C5.47396 13.4128 5.76693 12.3385 5.98828 11.1797C6.20964 10.0208 6.48958 8.88802 6.82812 7.78125C7.16667 6.6875 7.83724 5.85417 8.83984 5.28125C9.11328 5.125 9.32812 4.91667 9.48438 4.65625C9.64062 4.38281 9.71875 4.08984 9.71875 3.77734C9.71875 3.28255 9.88802 2.86589 10.2266 2.52734C10.5781 2.17578 11.0013 2 11.4961 2C11.9909 2 12.4076 2.17578 12.7461 2.52734C13.0977 2.86589 13.2734 3.28255 13.2734 3.77734C13.2734 4.08984 13.3516 4.38281 13.5078 4.65625C13.6771 4.91667 13.8984 5.125 14.1719 5.28125C15.0443 5.78906 15.6562 6.51172 16.0078 7.44922C16.3724 8.38672 16.6589 9.3763 16.8672 10.418ZM11.4961 4.48047C11.6914 4.48047 11.8607 4.41536 12.0039 4.28516C12.1471 4.14193 12.2188 3.97266 12.2188 3.77734C12.2188 3.56901 12.1471 3.39974 12.0039 3.26953C11.8607 3.1263 11.6914 3.05469 11.4961 3.05469C11.3008 3.05469 11.1315 3.1263 10.9883 3.26953C10.8451 3.39974 10.7734 3.56901 10.7734 3.77734C10.7734 3.97266 10.8451 4.14193 10.9883 4.28516C11.1315 4.41536 11.3008 4.48047 11.4961 4.48047ZM16.9062 17.6055L19.9922 14.5195L19.2305 13.7773L16.9062 16.1016L15.8906 15.0859L15.1289 15.8477L16.9062 17.6055ZM17.5312 11.8633C18.5599 11.8633 19.4388 12.2279 20.168 12.957C20.8971 13.6862 21.2617 14.5651 21.2617 15.5938C21.2617 16.6224 20.8971 17.5013 20.168 18.2305C19.4388 18.9596 18.5599 19.3242 17.5312 19.3242C16.5026 19.3242 15.6237 18.9596 14.8945 18.2305C14.1654 17.5013 13.8008 16.6224 13.8008 15.5938C13.8008 14.5651 14.1654 13.6862 14.8945 12.957C15.6237 12.2279 16.5026 11.8633 17.5312 11.8633Z";
|
|
69
|
+
ICONS["MINOR"] = "path://M21.9787 11.9894L11.9894 22L2 11.9894L11.9894 2L21.9787 11.9894ZM12.9052 16.5474V14.7157H11.0735V16.5474H12.9052ZM12.9052 12.9052V7.45261H11.0735V12.9052H12.9052Z";
|
|
70
|
+
ICONS["MAJOR"] = "path://M12.8936 13.8936V10.234H11.1064V13.8936H12.8936ZM12.8936 17.5106V15.6809H11.1064V17.5106H12.8936ZM2 20.234L12 3L22 20.234H2Z";
|
|
71
|
+
ICONS["CRITICAL"] = "path://M12.0117 22C10.6362 22 9.3388 21.7343 8.11958 21.2028C6.90035 20.687 5.83744 19.9758 4.93083 19.0692C4.02423 18.1626 3.31301 17.0996 2.79719 15.8804C2.26573 14.6768 2 13.3794 2 11.9883C2 10.6127 2.26573 9.31536 2.79719 8.09613C3.31301 6.89254 4.02423 5.83744 4.93083 4.93083C5.83744 4.02423 6.90035 3.3052 8.11958 2.77374C9.3388 2.25791 10.6362 2 12.0117 2C13.3873 2 14.6846 2.25791 15.9039 2.77374C17.1231 3.3052 18.186 4.02423 19.0926 4.93083C19.9992 5.83744 20.7104 6.89254 21.2263 8.09613C21.7577 9.31536 22.0234 10.6127 22.0234 11.9883C22.0234 13.3794 21.7577 14.6768 21.2263 15.8804C20.7104 17.0996 19.9992 18.1626 19.0926 19.0692C18.186 19.9758 17.1231 20.687 15.9039 21.2028C14.6846 21.7343 13.3873 22 12.0117 22ZM13.0199 6.99414H11.0035V12.9965H13.0199V6.99414ZM13.0199 14.9894H11.0035V17.0059H13.0199V14.9894Z";
|
|
72
|
+
ICONS["WARNING"] = "path://M12 2C13.3772 2 14.6761 2.25822 15.8967 2.77465C17.1174 3.29108 18.1815 4.00313 19.0892 4.9108C19.9969 5.81847 20.7089 6.88263 21.2254 8.10329C21.7418 9.32394 22 10.6228 22 12C22 13.3772 21.7418 14.6761 21.2254 15.8967C20.7089 17.1174 19.9969 18.1815 19.0892 19.0892C18.1815 19.9969 17.1174 20.7089 15.8967 21.2254C14.6761 21.7418 13.3772 22 12 22C10.6228 22 9.32394 21.7418 8.10329 21.2254C6.88263 20.7089 5.81847 19.9969 4.9108 19.0892C4.00313 18.1815 3.29108 17.1174 2.77465 15.8967C2.25822 14.6761 2 13.3772 2 12C2 10.6228 2.25822 9.32394 2.77465 8.10329C3.29108 6.88263 4.00313 5.81847 4.9108 4.9108C5.81847 4.00313 6.88263 3.29108 8.10329 2.77465C9.32394 2.25822 10.6228 2 12 2Z";
|
|
73
|
+
})(ICONS || (ICONS = {}));
|
|
74
|
+
const ICONS_MAP = {
|
|
75
|
+
ALARM: ICONS.ALARM,
|
|
76
|
+
EVENT: ICONS.EVENT,
|
|
77
|
+
ACKNOWLEDGED: ICONS.ACKNOWLEDGED,
|
|
78
|
+
CLEARED: ICONS.CLEARED,
|
|
79
|
+
MINOR: ICONS.MINOR,
|
|
80
|
+
MAJOR: ICONS.MAJOR,
|
|
81
|
+
CRITICAL: ICONS.CRITICAL,
|
|
82
|
+
WARNING: ICONS.WARNING
|
|
83
|
+
};
|
|
20
84
|
|
|
21
85
|
class YAxisService {
|
|
22
86
|
constructor(appStateService) {
|
|
@@ -298,28 +362,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
298
362
|
type: Injectable
|
|
299
363
|
}] });
|
|
300
364
|
|
|
301
|
-
var ICONS;
|
|
302
|
-
(function (ICONS) {
|
|
303
|
-
ICONS["ALARM"] = "path://M18.375 15.8462L20.4423 17.9135V18.9231H4V17.9135L6.06731 15.8462V10.75C6.06731 9.14744 6.47596 7.75321 7.29327 6.56731C8.11058 5.38141 9.24038 4.61218 10.6827 4.25962V3.53846C10.6827 3.12179 10.8269 2.76122 11.1154 2.45673C11.4038 2.15224 11.7724 2 12.2212 2C12.6699 2 13.0385 2.15224 13.3269 2.45673C13.6154 2.76122 13.7596 3.12179 13.7596 3.53846V4.25962C15.2019 4.61218 16.3317 5.38141 17.149 6.56731C17.9663 7.75321 18.375 9.14744 18.375 10.75V15.8462ZM12.2212 22C11.6442 22 11.1554 21.8077 10.7548 21.4231C10.3542 21.0385 10.1538 20.5577 10.1538 19.9808H14.2885C14.2885 20.5256 14.0801 20.9984 13.6635 21.399C13.2468 21.7997 12.766 22 12.2212 22Z";
|
|
304
|
-
ICONS["EVENT"] = "path://M97.3013 63L128.939 95.1315C79.296 134.335 47.7653 191.526 47.7653 255.276C47.7653 319.027 79.296 376.218 128.917 415.421L97.28 447.574C37.76 400.552 0 331.93 0 255.276C0 178.622 37.76 110.001 97.3013 63ZM414.72 63C474.24 110.001 512 178.622 512 255.276C512 331.93 474.24 400.552 414.72 447.574L383.083 415.421C432.704 376.218 464.235 319.027 464.235 255.276C464.235 191.526 432.704 134.335 383.083 95.1315L414.72 63ZM160.405 127.092L192 159.181C162.24 182.681 143.317 217.013 143.317 255.276C143.317 293.539 162.219 327.871 192 351.372L160.405 383.461C120.725 352.119 95.552 306.379 95.552 255.276C95.552 204.174 120.725 158.433 160.405 127.092ZM351.595 127.092C391.296 158.433 416.448 204.174 416.448 255.276C416.448 306.379 391.275 352.119 351.595 383.461L320 351.372C349.781 327.871 368.683 293.539 368.683 255.276C368.683 217.013 349.781 182.703 320 159.181L351.595 127.092ZM256 192.722C291.505 192.722 320.287 221.504 320.287 257.009C320.287 292.514 291.505 321.296 256 321.296C220.495 321.296 191.713 292.514 191.713 257.009C191.713 221.504 220.495 192.722 256 192.722Z";
|
|
305
|
-
ICONS["ACKNOWLEDGED"] = "path://M10.4795 2H13.4807V4.18054C14.1215 4.35248 14.7155 4.61821 15.2626 4.97773C15.8097 5.35287 16.2864 5.79836 16.6928 6.31419C17.0993 6.81438 17.4119 7.3771 17.6307 8.00234C17.8652 8.62759 17.9824 9.29191 17.9824 9.99531V13.7702L16.9742 12.762V12.7855L9.72919 5.54045C9.74482 5.54045 9.75264 5.54045 9.75264 5.54045L9.00234 4.79015C9.22118 4.64947 9.45565 4.53224 9.70574 4.43845C9.95584 4.34467 10.2138 4.25869 10.4795 4.18054V2ZM4.4068 3.03165L21.4291 20.0305L19.9988 21.4373L17.5604 18.9988H13.6917C13.7855 19.1551 13.8558 19.3193 13.9027 19.4912C13.9496 19.6475 13.973 19.8195 13.973 20.007C13.973 20.5541 13.7776 21.0231 13.3869 21.4138C12.9961 21.8046 12.5272 22 11.9801 22C11.4174 22 10.9406 21.8046 10.5498 21.4138C10.159 21.0231 9.96366 20.5541 9.96366 20.007C9.96366 19.8195 9.9871 19.6475 10.034 19.4912C10.0809 19.3193 10.1512 19.1551 10.245 18.9988H3.96131V17.9906L5.97773 15.9977V9.99531C5.97773 9.60453 6.00899 9.22939 6.07151 8.86987C6.14967 8.51036 6.25127 8.15866 6.37632 7.81477L3 4.43845L4.4068 3.03165Z";
|
|
306
|
-
ICONS["CLEARED"] = "path://M9.09375 19.5977C9.09375 20.2617 9.32812 20.8281 9.79688 21.2969C10.2786 21.7656 10.8516 22 11.5156 22C12.1927 22 12.7656 21.7656 13.2344 21.2969C13.7161 20.8281 13.957 20.2617 13.957 19.5977H9.09375ZM16.8672 10.418C16.3203 10.5091 15.7995 10.6784 15.3047 10.9258C14.8229 11.1732 14.3867 11.4922 13.9961 11.8828C13.5013 12.3776 13.1172 12.944 12.8438 13.582C12.5833 14.2201 12.4531 14.8841 12.4531 15.5742C12.4531 16.0299 12.5052 16.4727 12.6094 16.9023C12.7266 17.332 12.8958 17.7422 13.1172 18.1328H3V16.375C4.04167 16.0495 4.74479 15.3919 5.10938 14.4023C5.47396 13.4128 5.76693 12.3385 5.98828 11.1797C6.20964 10.0208 6.48958 8.88802 6.82812 7.78125C7.16667 6.6875 7.83724 5.85417 8.83984 5.28125C9.11328 5.125 9.32812 4.91667 9.48438 4.65625C9.64062 4.38281 9.71875 4.08984 9.71875 3.77734C9.71875 3.28255 9.88802 2.86589 10.2266 2.52734C10.5781 2.17578 11.0013 2 11.4961 2C11.9909 2 12.4076 2.17578 12.7461 2.52734C13.0977 2.86589 13.2734 3.28255 13.2734 3.77734C13.2734 4.08984 13.3516 4.38281 13.5078 4.65625C13.6771 4.91667 13.8984 5.125 14.1719 5.28125C15.0443 5.78906 15.6562 6.51172 16.0078 7.44922C16.3724 8.38672 16.6589 9.3763 16.8672 10.418ZM11.4961 4.48047C11.6914 4.48047 11.8607 4.41536 12.0039 4.28516C12.1471 4.14193 12.2188 3.97266 12.2188 3.77734C12.2188 3.56901 12.1471 3.39974 12.0039 3.26953C11.8607 3.1263 11.6914 3.05469 11.4961 3.05469C11.3008 3.05469 11.1315 3.1263 10.9883 3.26953C10.8451 3.39974 10.7734 3.56901 10.7734 3.77734C10.7734 3.97266 10.8451 4.14193 10.9883 4.28516C11.1315 4.41536 11.3008 4.48047 11.4961 4.48047ZM16.9062 17.6055L19.9922 14.5195L19.2305 13.7773L16.9062 16.1016L15.8906 15.0859L15.1289 15.8477L16.9062 17.6055ZM17.5312 11.8633C18.5599 11.8633 19.4388 12.2279 20.168 12.957C20.8971 13.6862 21.2617 14.5651 21.2617 15.5938C21.2617 16.6224 20.8971 17.5013 20.168 18.2305C19.4388 18.9596 18.5599 19.3242 17.5312 19.3242C16.5026 19.3242 15.6237 18.9596 14.8945 18.2305C14.1654 17.5013 13.8008 16.6224 13.8008 15.5938C13.8008 14.5651 14.1654 13.6862 14.8945 12.957C15.6237 12.2279 16.5026 11.8633 17.5312 11.8633Z";
|
|
307
|
-
ICONS["MINOR"] = "path://M21.9787 11.9894L11.9894 22L2 11.9894L11.9894 2L21.9787 11.9894ZM12.9052 16.5474V14.7157H11.0735V16.5474H12.9052ZM12.9052 12.9052V7.45261H11.0735V12.9052H12.9052Z";
|
|
308
|
-
ICONS["MAJOR"] = "path://M12.8936 13.8936V10.234H11.1064V13.8936H12.8936ZM12.8936 17.5106V15.6809H11.1064V17.5106H12.8936ZM2 20.234L12 3L22 20.234H2Z";
|
|
309
|
-
ICONS["CRITICAL"] = "path://M12.0117 22C10.6362 22 9.3388 21.7343 8.11958 21.2028C6.90035 20.687 5.83744 19.9758 4.93083 19.0692C4.02423 18.1626 3.31301 17.0996 2.79719 15.8804C2.26573 14.6768 2 13.3794 2 11.9883C2 10.6127 2.26573 9.31536 2.79719 8.09613C3.31301 6.89254 4.02423 5.83744 4.93083 4.93083C5.83744 4.02423 6.90035 3.3052 8.11958 2.77374C9.3388 2.25791 10.6362 2 12.0117 2C13.3873 2 14.6846 2.25791 15.9039 2.77374C17.1231 3.3052 18.186 4.02423 19.0926 4.93083C19.9992 5.83744 20.7104 6.89254 21.2263 8.09613C21.7577 9.31536 22.0234 10.6127 22.0234 11.9883C22.0234 13.3794 21.7577 14.6768 21.2263 15.8804C20.7104 17.0996 19.9992 18.1626 19.0926 19.0692C18.186 19.9758 17.1231 20.687 15.9039 21.2028C14.6846 21.7343 13.3873 22 12.0117 22ZM13.0199 6.99414H11.0035V12.9965H13.0199V6.99414ZM13.0199 14.9894H11.0035V17.0059H13.0199V14.9894Z";
|
|
310
|
-
ICONS["WARNING"] = "path://M12 2C13.3772 2 14.6761 2.25822 15.8967 2.77465C17.1174 3.29108 18.1815 4.00313 19.0892 4.9108C19.9969 5.81847 20.7089 6.88263 21.2254 8.10329C21.7418 9.32394 22 10.6228 22 12C22 13.3772 21.7418 14.6761 21.2254 15.8967C20.7089 17.1174 19.9969 18.1815 19.0892 19.0892C18.1815 19.9969 17.1174 20.7089 15.8967 21.2254C14.6761 21.7418 13.3772 22 12 22C10.6228 22 9.32394 21.7418 8.10329 21.2254C6.88263 20.7089 5.81847 19.9969 4.9108 19.0892C4.00313 18.1815 3.29108 17.1174 2.77465 15.8967C2.25822 14.6761 2 13.3772 2 12C2 10.6228 2.25822 9.32394 2.77465 8.10329C3.29108 6.88263 4.00313 5.81847 4.9108 4.9108C5.81847 4.00313 6.88263 3.29108 8.10329 2.77465C9.32394 2.25822 10.6228 2 12 2Z";
|
|
311
|
-
})(ICONS || (ICONS = {}));
|
|
312
|
-
const ICONS_MAP = {
|
|
313
|
-
ALARM: ICONS.ALARM,
|
|
314
|
-
EVENT: ICONS.EVENT,
|
|
315
|
-
ACKNOWLEDGED: ICONS.ACKNOWLEDGED,
|
|
316
|
-
CLEARED: ICONS.CLEARED,
|
|
317
|
-
MINOR: ICONS.MINOR,
|
|
318
|
-
MAJOR: ICONS.MAJOR,
|
|
319
|
-
CRITICAL: ICONS.CRITICAL,
|
|
320
|
-
WARNING: ICONS.WARNING
|
|
321
|
-
};
|
|
322
|
-
|
|
323
365
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
324
366
|
const INDEX_HTML = '/index.html';
|
|
325
367
|
class EchartsOptionsService {
|
|
@@ -334,7 +376,7 @@ class EchartsOptionsService {
|
|
|
334
376
|
this.appState = appState;
|
|
335
377
|
this.TOOLTIP_WIDTH = 300;
|
|
336
378
|
}
|
|
337
|
-
getChartOptions(datapointsWithValues, timeRange, showSplitLines, events, alarms, displayOptions, selectedTimeRange,
|
|
379
|
+
getChartOptions(datapointsWithValues, timeRange, showSplitLines, events, alarms, displayOptions, selectedTimeRange, aggregatedDatapoint, sliderZoomUsed = false) {
|
|
338
380
|
const yAxis = this.yAxisService.getYAxis(datapointsWithValues, {
|
|
339
381
|
showSplitLines: showSplitLines.YAxis,
|
|
340
382
|
mergeMatchingDatapoints: displayOptions.mergeMatchingDatapoints,
|
|
@@ -394,7 +436,28 @@ class EchartsOptionsService {
|
|
|
394
436
|
type: 'slider',
|
|
395
437
|
show: displayOptions.showSlider,
|
|
396
438
|
bottom: 8,
|
|
397
|
-
realtime: false
|
|
439
|
+
realtime: false,
|
|
440
|
+
left: displayOptions.sliderPositionMode === 'compact' ? '64px' : '64px',
|
|
441
|
+
right: displayOptions.sliderPositionMode === 'compact' ? '172px' : '64px',
|
|
442
|
+
labelFormatter(_value, valueStr) {
|
|
443
|
+
const locale = selectedLanguage.replace('_', '-');
|
|
444
|
+
const date = new Date(valueStr);
|
|
445
|
+
const datePart = new Intl.DateTimeFormat(locale, {
|
|
446
|
+
year: 'numeric',
|
|
447
|
+
month: 'short',
|
|
448
|
+
day: '2-digit'
|
|
449
|
+
}).format(date);
|
|
450
|
+
const timePart = new Intl.DateTimeFormat(locale, {
|
|
451
|
+
hour: '2-digit',
|
|
452
|
+
minute: '2-digit',
|
|
453
|
+
second: '2-digit'
|
|
454
|
+
}).format(date);
|
|
455
|
+
return `${datePart}\n${timePart}`;
|
|
456
|
+
},
|
|
457
|
+
textStyle: {
|
|
458
|
+
fontSize: 9,
|
|
459
|
+
lineHeight: 14
|
|
460
|
+
}
|
|
398
461
|
}
|
|
399
462
|
], // on realtime, 'none' will cause extending chart line to left edge of the chart
|
|
400
463
|
animation: false,
|
|
@@ -424,7 +487,11 @@ class EchartsOptionsService {
|
|
|
424
487
|
show: false
|
|
425
488
|
},
|
|
426
489
|
xAxis: {
|
|
427
|
-
min:
|
|
490
|
+
min: aggregatedDatapoint
|
|
491
|
+
? Object.keys(aggregatedDatapoint.values)
|
|
492
|
+
.map(date => new Date(date).valueOf())
|
|
493
|
+
.sort((a, b) => a - b)[0]
|
|
494
|
+
: new Date(timeRange.dateFrom).valueOf() - intervalInMs,
|
|
428
495
|
max: timeRange.dateTo,
|
|
429
496
|
type: 'time',
|
|
430
497
|
animation: false,
|
|
@@ -478,7 +545,7 @@ class EchartsOptionsService {
|
|
|
478
545
|
},
|
|
479
546
|
yAxis,
|
|
480
547
|
series: [
|
|
481
|
-
|
|
548
|
+
this.getAggregatedSeries(aggregatedDatapoint || null, displayOptions),
|
|
482
549
|
...this.getChartSeries(datapointsWithValues, events, alarms, displayOptions)
|
|
483
550
|
]
|
|
484
551
|
};
|
|
@@ -513,18 +580,17 @@ class EchartsOptionsService {
|
|
|
513
580
|
}
|
|
514
581
|
return intervalInMs;
|
|
515
582
|
}
|
|
516
|
-
getAggregatedSeries(
|
|
583
|
+
getAggregatedSeries(aggregatedDatapoint, displayOptions) {
|
|
517
584
|
const series = [];
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
});
|
|
585
|
+
const renderType = aggregatedDatapoint?.renderType || 'min';
|
|
586
|
+
const idx = 0;
|
|
587
|
+
if (renderType === 'area') {
|
|
588
|
+
series.push(this.getSingleSeries(aggregatedDatapoint, 'min', idx, true, displayOptions, 'aggr'));
|
|
589
|
+
series.push(this.getSingleSeries(aggregatedDatapoint, 'max', idx, true, displayOptions, 'aggr'));
|
|
590
|
+
}
|
|
591
|
+
else {
|
|
592
|
+
series.push(this.getSingleSeries(aggregatedDatapoint, renderType, idx, false, displayOptions, 'aggr'));
|
|
593
|
+
}
|
|
528
594
|
series.forEach((s) => {
|
|
529
595
|
s.datapointId = 'aggregated';
|
|
530
596
|
s.typeOfSeries = 'fake';
|
|
@@ -537,7 +603,7 @@ class EchartsOptionsService {
|
|
|
537
603
|
opacity: 0
|
|
538
604
|
};
|
|
539
605
|
});
|
|
540
|
-
return
|
|
606
|
+
return series[0];
|
|
541
607
|
}
|
|
542
608
|
/**
|
|
543
609
|
* This method is used to get the series for alarms and events.
|
|
@@ -1699,6 +1765,103 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
1699
1765
|
type: Injectable
|
|
1700
1766
|
}], ctorParameters: () => [{ type: i1$1.AlarmService }] });
|
|
1701
1767
|
|
|
1768
|
+
class ChartHelpersService {
|
|
1769
|
+
/**
|
|
1770
|
+
* Cleans the widget configuration which will be sent to Gainsight by removing unnecessary properties.
|
|
1771
|
+
* @param config The widget configuration to clean.
|
|
1772
|
+
* @returns The cleaned widget configuration.
|
|
1773
|
+
*/
|
|
1774
|
+
getConfigSummaryForGainsight(config) {
|
|
1775
|
+
return {
|
|
1776
|
+
datapointCount: config.datapoints?.length ?? 0,
|
|
1777
|
+
alarmsEventsCount: config.alarmsEventsConfigs?.length ?? 0,
|
|
1778
|
+
interval: config.interval,
|
|
1779
|
+
forceMergeDatapoints: config.forceMergeDatapoints,
|
|
1780
|
+
mergeMatchingDatapoints: config.mergeMatchingDatapoints,
|
|
1781
|
+
showSlider: config.showSlider,
|
|
1782
|
+
widgetInstanceGlobalTimeContext: config.widgetInstanceGlobalTimeContext,
|
|
1783
|
+
dateFrom: config.dateFrom,
|
|
1784
|
+
dateTo: config.dateTo
|
|
1785
|
+
};
|
|
1786
|
+
}
|
|
1787
|
+
findMatchingDatapoint(datapoints, selected) {
|
|
1788
|
+
if (!selected)
|
|
1789
|
+
return undefined;
|
|
1790
|
+
return datapoints.find(dp => this.getTargetId(dp) === this.getTargetId(selected) &&
|
|
1791
|
+
dp.fragment === selected.fragment &&
|
|
1792
|
+
dp.series === selected.series);
|
|
1793
|
+
}
|
|
1794
|
+
getTargetId(obj) {
|
|
1795
|
+
return obj?.__target?.id ?? obj?.target;
|
|
1796
|
+
}
|
|
1797
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ChartHelpersService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1798
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ChartHelpersService }); }
|
|
1799
|
+
}
|
|
1800
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ChartHelpersService, decorators: [{
|
|
1801
|
+
type: Injectable
|
|
1802
|
+
}] });
|
|
1803
|
+
|
|
1804
|
+
class SelectAggregatedDatapointComponent {
|
|
1805
|
+
constructor() {
|
|
1806
|
+
this.activeDatapoints = [];
|
|
1807
|
+
this.value = null;
|
|
1808
|
+
this.valueChange = new EventEmitter();
|
|
1809
|
+
this.chartHelpersService = inject(ChartHelpersService);
|
|
1810
|
+
this.selectedDatapointLabel = gettext('Select data point');
|
|
1811
|
+
this.selectedDatapointColor = '';
|
|
1812
|
+
}
|
|
1813
|
+
ngOnChanges(changes) {
|
|
1814
|
+
if (changes['value'] || changes['activeDatapoints']) {
|
|
1815
|
+
this.updateSelectedDatapointInfo();
|
|
1816
|
+
}
|
|
1817
|
+
}
|
|
1818
|
+
changeDatapointSelection(datapoint) {
|
|
1819
|
+
const trimmedDatapoint = {
|
|
1820
|
+
target: datapoint.__target.id,
|
|
1821
|
+
fragment: datapoint.fragment,
|
|
1822
|
+
series: datapoint.series
|
|
1823
|
+
};
|
|
1824
|
+
this.valueChange.emit(trimmedDatapoint);
|
|
1825
|
+
}
|
|
1826
|
+
updateSelectedDatapointInfo() {
|
|
1827
|
+
if (!this.value) {
|
|
1828
|
+
return;
|
|
1829
|
+
}
|
|
1830
|
+
const found = this.chartHelpersService.findMatchingDatapoint(this.activeDatapoints, this.value);
|
|
1831
|
+
if (this.value && !found) {
|
|
1832
|
+
this.selectedDatapointLabel = this.value.label || '';
|
|
1833
|
+
this.selectedDatapointColor = this.value.color || '';
|
|
1834
|
+
return;
|
|
1835
|
+
}
|
|
1836
|
+
this.selectedDatapointLabel = found?.label || '';
|
|
1837
|
+
this.selectedDatapointColor = found?.color || '';
|
|
1838
|
+
}
|
|
1839
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: SelectAggregatedDatapointComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1840
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: SelectAggregatedDatapointComponent, isStandalone: true, selector: "c8y-select-aggregated-datapoint", inputs: { activeDatapoints: "activeDatapoints", value: "value" }, outputs: { valueChange: "valueChange" }, host: { classAttribute: "d-contents" }, usesOnChanges: true, ngImport: i0, template: "<div\n class=\"dropdown dropup\"\n dropdown\n #datapointDropdown=\"bs-dropdown\"\n [cdkTrapFocus]=\"datapointDropdown.isOpen\"\n *ngIf=\"activeDatapoints?.length > 0\"\n>\n <ng-template #selectedDatapoint>\n <div class=\"text-left\">\n <strong>{{ selectedDatapointLabel }}</strong>\n <br />\n {{ 'Click to change' | translate }}\n </div>\n </ng-template>\n <button\n class=\"btn btn-default d-flex a-i-center dropdown-toggle c8y-dropdown\"\n title=\"{{'Select a data point to view its aggregated values in the time slider.' | translate }}\"\n type=\"button\"\n dropdownToggle\n >\n <span\n [style.background-color]=\"selectedDatapointColor\"\n style=\"display: inline-block; width: 16px; height: 16px; border-radius: 50%\"\n ></span>\n <span class=\"caret\"></span>\n </button>\n <ul\n class=\"dropdown-menu dropdown-menu-right\"\n *dropdownMenu\n >\n <li *ngFor=\"let datapoint of activeDatapoints\">\n <button\n class=\"p-r-8\"\n type=\"button\"\n (click)=\"changeDatapointSelection(datapoint)\"\n >\n <span\n class=\"d-inline-block m-r-4\"\n [style.background-color]=\"datapoint?.color\"\n style=\"width: 16px; height: 16px; border-radius: 50%\"\n ></span>\n <span class=\"text-truncate\" style=\"max-width:220px!important\" title=\"{{ datapoint?.label || `${datapoint?.fragment}-${datapoint?.series}` }}\">\n {{ datapoint?.label || `${datapoint?.fragment}-${datapoint?.series}` }}\n </span>\n <span\n class=\"m-l-auto flex-no-shrink\"\n *ngIf=\"\n datapoint.__target.id === value?.__target.id &&\n datapoint.fragment === value?.fragment &&\n datapoint.series === value?.series\n \"\n >\n <i\n class=\"text-success h4\"\n [c8yIcon]=\"'check'\"\n ></i>\n </span>\n </button>\n </li>\n </ul>\n</div>\n<button\n class=\"btn-help\"\n [attr.aria-label]=\"'Help' | translate\"\n popover=\"{{\n 'Select a data point to view its aggregated values in the time slider.' | translate\n }}\"\n placement=\"left\"\n triggers=\"focus\"\n container=\"body\"\n></button>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "pipe", type: C8yTranslatePipe, name: "translate" }, { kind: "ngmodule", type: PopoverModule }, { kind: "directive", type: i1$2.PopoverDirective, selector: "[popover]", inputs: ["adaptivePosition", "boundariesElement", "popover", "popoverContext", "popoverTitle", "placement", "outsideClick", "triggers", "container", "containerClass", "isOpen", "delay"], outputs: ["onShown", "onHidden"], exportAs: ["bs-popover"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "ngmodule", type: BsDropdownModule }, { kind: "directive", type: i2$1.BsDropdownMenuDirective, selector: "[bsDropdownMenu],[dropdownMenu]", exportAs: ["bs-dropdown-menu"] }, { kind: "directive", type: i2$1.BsDropdownToggleDirective, selector: "[bsDropdownToggle],[dropdownToggle]", exportAs: ["bs-dropdown-toggle"] }, { kind: "directive", type: i2$1.BsDropdownDirective, selector: "[bsDropdown], [dropdown]", inputs: ["placement", "triggers", "container", "dropup", "autoClose", "isAnimated", "insideClick", "isDisabled", "isOpen"], outputs: ["isOpenChange", "onShown", "onHidden"], exportAs: ["bs-dropdown"] }, { kind: "ngmodule", type: A11yModule }, { kind: "directive", type: i3.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "directive", type: IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] }); }
|
|
1841
|
+
}
|
|
1842
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: SelectAggregatedDatapointComponent, decorators: [{
|
|
1843
|
+
type: Component,
|
|
1844
|
+
args: [{ selector: 'c8y-select-aggregated-datapoint', host: {
|
|
1845
|
+
class: 'd-contents'
|
|
1846
|
+
}, standalone: true, imports: [
|
|
1847
|
+
FormsModule,
|
|
1848
|
+
C8yTranslatePipe,
|
|
1849
|
+
PopoverModule,
|
|
1850
|
+
TooltipModule,
|
|
1851
|
+
BsDropdownModule,
|
|
1852
|
+
A11yModule,
|
|
1853
|
+
IconDirective,
|
|
1854
|
+
NgIf,
|
|
1855
|
+
NgForOf
|
|
1856
|
+
], template: "<div\n class=\"dropdown dropup\"\n dropdown\n #datapointDropdown=\"bs-dropdown\"\n [cdkTrapFocus]=\"datapointDropdown.isOpen\"\n *ngIf=\"activeDatapoints?.length > 0\"\n>\n <ng-template #selectedDatapoint>\n <div class=\"text-left\">\n <strong>{{ selectedDatapointLabel }}</strong>\n <br />\n {{ 'Click to change' | translate }}\n </div>\n </ng-template>\n <button\n class=\"btn btn-default d-flex a-i-center dropdown-toggle c8y-dropdown\"\n title=\"{{'Select a data point to view its aggregated values in the time slider.' | translate }}\"\n type=\"button\"\n dropdownToggle\n >\n <span\n [style.background-color]=\"selectedDatapointColor\"\n style=\"display: inline-block; width: 16px; height: 16px; border-radius: 50%\"\n ></span>\n <span class=\"caret\"></span>\n </button>\n <ul\n class=\"dropdown-menu dropdown-menu-right\"\n *dropdownMenu\n >\n <li *ngFor=\"let datapoint of activeDatapoints\">\n <button\n class=\"p-r-8\"\n type=\"button\"\n (click)=\"changeDatapointSelection(datapoint)\"\n >\n <span\n class=\"d-inline-block m-r-4\"\n [style.background-color]=\"datapoint?.color\"\n style=\"width: 16px; height: 16px; border-radius: 50%\"\n ></span>\n <span class=\"text-truncate\" style=\"max-width:220px!important\" title=\"{{ datapoint?.label || `${datapoint?.fragment}-${datapoint?.series}` }}\">\n {{ datapoint?.label || `${datapoint?.fragment}-${datapoint?.series}` }}\n </span>\n <span\n class=\"m-l-auto flex-no-shrink\"\n *ngIf=\"\n datapoint.__target.id === value?.__target.id &&\n datapoint.fragment === value?.fragment &&\n datapoint.series === value?.series\n \"\n >\n <i\n class=\"text-success h4\"\n [c8yIcon]=\"'check'\"\n ></i>\n </span>\n </button>\n </li>\n </ul>\n</div>\n<button\n class=\"btn-help\"\n [attr.aria-label]=\"'Help' | translate\"\n popover=\"{{\n 'Select a data point to view its aggregated values in the time slider.' | translate\n }}\"\n placement=\"left\"\n triggers=\"focus\"\n container=\"body\"\n></button>\n" }]
|
|
1857
|
+
}], propDecorators: { activeDatapoints: [{
|
|
1858
|
+
type: Input
|
|
1859
|
+
}], value: [{
|
|
1860
|
+
type: Input
|
|
1861
|
+
}], valueChange: [{
|
|
1862
|
+
type: Output
|
|
1863
|
+
}] } });
|
|
1864
|
+
|
|
1702
1865
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
1703
1866
|
class ChartsComponent {
|
|
1704
1867
|
constructor() {
|
|
@@ -1706,11 +1869,15 @@ class ChartsComponent {
|
|
|
1706
1869
|
this.alarms = [];
|
|
1707
1870
|
this.events = [];
|
|
1708
1871
|
this.sliderZoomUsed = false;
|
|
1872
|
+
this.activeDatapoints = [];
|
|
1709
1873
|
this.configChangeOnZoomOut = new EventEmitter();
|
|
1710
1874
|
this.timeRangeChangeOnRealtime = new EventEmitter();
|
|
1711
1875
|
this.datapointOutOfSync = new EventEmitter();
|
|
1712
1876
|
this.updateAlarmsAndEvents = new EventEmitter();
|
|
1713
1877
|
this.isMarkedAreaEnabled = new EventEmitter();
|
|
1878
|
+
this.updateActiveDatapoints = new EventEmitter();
|
|
1879
|
+
this.updateAggregatedSliderDatapoint = new EventEmitter();
|
|
1880
|
+
this.CHART_VIEW_CONTEXT = CHART_VIEW_CONTEXT;
|
|
1714
1881
|
this.configChangedSubject = new BehaviorSubject(null);
|
|
1715
1882
|
this.measurementService = inject(MeasurementService);
|
|
1716
1883
|
this.echartsOptionsService = inject(EchartsOptionsService);
|
|
@@ -2042,12 +2209,12 @@ class ChartsComponent {
|
|
|
2042
2209
|
this.updateAlarmsAndEvents.emit(this.config.alarmsEventsConfigs);
|
|
2043
2210
|
}
|
|
2044
2211
|
startRealtimeIfPossible() {
|
|
2045
|
-
|
|
2046
|
-
if ((activeDatapoints || this.config.alarmsEventsConfigs?.length > 0) &&
|
|
2212
|
+
this.activeDatapoints = this.config?.datapoints?.filter(dp => dp.__active);
|
|
2213
|
+
if ((this.activeDatapoints || this.config.alarmsEventsConfigs?.length > 0) &&
|
|
2047
2214
|
this.config.realtime &&
|
|
2048
2215
|
this.echartsInstance) {
|
|
2049
|
-
const showOnlyAlarmsOrEvents = this.config.alarmsEventsConfigs?.length > 0 && activeDatapoints?.length === 0;
|
|
2050
|
-
this.chartRealtimeService.startRealtime(this.echartsInstance, activeDatapoints, this.getTimeRange(), dp => this.datapointOutOfSync.emit(dp), timeRange => this.timeRangeChangeOnRealtime.emit(timeRange), this.config.alarmsEventsConfigs, {
|
|
2216
|
+
const showOnlyAlarmsOrEvents = this.config.alarmsEventsConfigs?.length > 0 && this.activeDatapoints?.length === 0;
|
|
2217
|
+
this.chartRealtimeService.startRealtime(this.echartsInstance, this.activeDatapoints, this.getTimeRange(), dp => this.datapointOutOfSync.emit(dp), timeRange => this.timeRangeChangeOnRealtime.emit(timeRange), this.config.alarmsEventsConfigs, {
|
|
2051
2218
|
displayMarkedLine: this.config.displayMarkedLine || false,
|
|
2052
2219
|
displayMarkedPoint: this.config.displayMarkedPoint || false,
|
|
2053
2220
|
mergeMatchingDatapoints: this.config.mergeMatchingDatapoints || false,
|
|
@@ -2081,8 +2248,8 @@ class ChartsComponent {
|
|
|
2081
2248
|
}
|
|
2082
2249
|
async getChartOptions(datapointsWithValues) {
|
|
2083
2250
|
const timeRange = { ...this.getTimeRange(), interval: this.config.interval };
|
|
2084
|
-
const
|
|
2085
|
-
if ((!activeDatapoints || activeDatapoints.length === 0) &&
|
|
2251
|
+
const sliderPositionMode = this.getSliderPositionMode();
|
|
2252
|
+
if ((!this.activeDatapoints || this.activeDatapoints.length === 0) &&
|
|
2086
2253
|
this.config.alarmsEventsConfigs?.length > 0) {
|
|
2087
2254
|
return this.echartsOptionsService.getChartOptions(datapointsWithValues, timeRange, {
|
|
2088
2255
|
YAxis: this.config.yAxisSplitLines || false,
|
|
@@ -2098,12 +2265,16 @@ class ChartsComponent {
|
|
|
2098
2265
|
});
|
|
2099
2266
|
}
|
|
2100
2267
|
if (!this.widgetTimeContextDateRangeService.initialTimeRange()) {
|
|
2268
|
+
const extendedDateFrom = new Date(new Date(timeRange.dateFrom).valueOf() -
|
|
2269
|
+
this.echartsOptionsService.calculateExtendedIntervalInMs(this.config.interval || 'custom', {
|
|
2270
|
+
dateFrom: timeRange.dateFrom,
|
|
2271
|
+
dateTo: timeRange.dateTo
|
|
2272
|
+
})).toISOString();
|
|
2101
2273
|
this.widgetTimeContextDateRangeService.updateInitialTimeRange(timeRange);
|
|
2102
|
-
const aggregatedDatapoints = await lastValueFrom(this.
|
|
2103
|
-
dateFrom:
|
|
2104
|
-
this.echartsOptionsService.calculateExtendedIntervalInMs(this.config.interval || 'custom', { dateFrom: timeRange.dateFrom, dateTo: timeRange.dateTo })).toISOString(),
|
|
2274
|
+
const aggregatedDatapoints = await lastValueFrom(this.fetchAggregatedSeriesForSelectedDatapoint$({
|
|
2275
|
+
dateFrom: extendedDateFrom,
|
|
2105
2276
|
dateTo: timeRange.dateTo
|
|
2106
|
-
}));
|
|
2277
|
+
}, this.config.aggregatedDatapoint));
|
|
2107
2278
|
return this.echartsOptionsService.getChartOptions(datapointsWithValues, timeRange, {
|
|
2108
2279
|
YAxis: this.config.yAxisSplitLines || false,
|
|
2109
2280
|
XAxis: this.config.xAxisSplitLines || false
|
|
@@ -2114,18 +2285,23 @@ class ChartsComponent {
|
|
|
2114
2285
|
forceMergeDatapoints: this.config.forceMergeDatapoints || false,
|
|
2115
2286
|
showLabelAndUnit: this.config.showLabelAndUnit || false,
|
|
2116
2287
|
showSlider: this.config.showSlider || false,
|
|
2117
|
-
numberOfDecimalPlaces: this.config.numberOfDecimalPlaces ?? 2
|
|
2288
|
+
numberOfDecimalPlaces: this.config.numberOfDecimalPlaces ?? 2,
|
|
2289
|
+
sliderPositionMode
|
|
2118
2290
|
}, undefined, aggregatedDatapoints);
|
|
2119
2291
|
}
|
|
2120
2292
|
else {
|
|
2121
|
-
const
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2293
|
+
const initialDateFromValue = new Date(this.widgetTimeContextDateRangeService.initialTimeRange().dateFrom).valueOf();
|
|
2294
|
+
const calculateInitialIntervalInMs = this.echartsOptionsService.calculateExtendedIntervalInMs(this.widgetTimeContextDateRangeService.initialTimeRange().interval || 'custom', {
|
|
2295
|
+
dateFrom: this.widgetTimeContextDateRangeService.initialTimeRange().dateFrom,
|
|
2296
|
+
dateTo: this.widgetTimeContextDateRangeService.initialTimeRange().dateTo
|
|
2297
|
+
});
|
|
2298
|
+
// The extended date from is the initial date from (which was selected by the user) minus the calculated interval in milliseconds (this is the extended range for the slider).
|
|
2299
|
+
// This extended date from is used to fetch the aggregated datapoints for the slider.
|
|
2300
|
+
const initialExtendedDateFrom = new Date(initialDateFromValue - calculateInitialIntervalInMs).toISOString();
|
|
2301
|
+
const aggregatedDatapoints = await lastValueFrom(this.fetchAggregatedSeriesForSelectedDatapoint$({
|
|
2302
|
+
dateFrom: initialExtendedDateFrom,
|
|
2127
2303
|
dateTo: new Date(this.widgetTimeContextDateRangeService.initialTimeRange().dateTo).toISOString()
|
|
2128
|
-
}));
|
|
2304
|
+
}, this.config.aggregatedDatapoint));
|
|
2129
2305
|
return this.echartsOptionsService.getChartOptions(datapointsWithValues, this.widgetTimeContextDateRangeService.initialTimeRange(), {
|
|
2130
2306
|
YAxis: this.config.yAxisSplitLines || false,
|
|
2131
2307
|
XAxis: this.config.xAxisSplitLines || false
|
|
@@ -2136,35 +2312,36 @@ class ChartsComponent {
|
|
|
2136
2312
|
forceMergeDatapoints: this.config.forceMergeDatapoints || false,
|
|
2137
2313
|
showLabelAndUnit: this.config.showLabelAndUnit || false,
|
|
2138
2314
|
showSlider: this.config.showSlider || false,
|
|
2139
|
-
numberOfDecimalPlaces: this.config.numberOfDecimalPlaces ?? 2
|
|
2315
|
+
numberOfDecimalPlaces: this.config.numberOfDecimalPlaces ?? 2,
|
|
2316
|
+
sliderPositionMode
|
|
2140
2317
|
}, timeRange, aggregatedDatapoints, true);
|
|
2141
2318
|
}
|
|
2142
2319
|
}
|
|
2143
|
-
fetchSeriesForDatapoints$(
|
|
2144
|
-
|
|
2145
|
-
if (!activeDatapoints || activeDatapoints.length === 0) {
|
|
2320
|
+
fetchSeriesForDatapoints$() {
|
|
2321
|
+
this.activeDatapoints = this.config?.datapoints?.filter(dp => dp.__active);
|
|
2322
|
+
if (!this.activeDatapoints || this.activeDatapoints.length === 0) {
|
|
2323
|
+
this.updateActiveDatapoints.emit([]);
|
|
2146
2324
|
return of([]);
|
|
2147
2325
|
}
|
|
2326
|
+
this.updateActiveDatapoints.emit(this.activeDatapoints);
|
|
2148
2327
|
const datapointsWithValuesRequests = [];
|
|
2149
2328
|
const timeRange = this.getTimeRange(60_000);
|
|
2150
|
-
for (const dp of activeDatapoints) {
|
|
2329
|
+
for (const dp of this.activeDatapoints) {
|
|
2151
2330
|
const request = defer(() => this.measurementService.listSeries({
|
|
2152
2331
|
revert: true,
|
|
2153
|
-
...
|
|
2332
|
+
...timeRange,
|
|
2154
2333
|
source: dp.__target?.id || '',
|
|
2155
2334
|
series: [`${dp.fragment}.${dp.series}`],
|
|
2156
|
-
...(this.config.aggregation
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
}
|
|
2160
|
-
: {})
|
|
2335
|
+
...(this.config.aggregation && {
|
|
2336
|
+
aggregationType: this.config.aggregation
|
|
2337
|
+
})
|
|
2161
2338
|
})).pipe(map(res => {
|
|
2162
2339
|
const values = res.data.values;
|
|
2163
2340
|
if (res.data.truncated && this.config.dateFrom) {
|
|
2164
2341
|
values[new Date(this.config.dateFrom).toISOString()] = [{ min: null, max: null }];
|
|
2165
2342
|
}
|
|
2166
2343
|
else {
|
|
2167
|
-
if (this.alerts
|
|
2344
|
+
if (this.alerts) {
|
|
2168
2345
|
this.alerts.clear();
|
|
2169
2346
|
}
|
|
2170
2347
|
}
|
|
@@ -2178,6 +2355,58 @@ class ChartsComponent {
|
|
|
2178
2355
|
}
|
|
2179
2356
|
}));
|
|
2180
2357
|
}
|
|
2358
|
+
fetchAggregatedSeriesForSelectedDatapoint$(customTimeRange, aggregatedDatapoint) {
|
|
2359
|
+
const timeRange = this.getTimeRange(60_000);
|
|
2360
|
+
aggregatedDatapoint = aggregatedDatapoint
|
|
2361
|
+
? aggregatedDatapoint
|
|
2362
|
+
: this.config?.datapoints?.filter(dp => dp.__active)[0];
|
|
2363
|
+
const request = defer(() => this.measurementService.listSeries({
|
|
2364
|
+
...(customTimeRange ? customTimeRange : timeRange),
|
|
2365
|
+
source: aggregatedDatapoint?.target || aggregatedDatapoint.__target?.id || '',
|
|
2366
|
+
series: [`${aggregatedDatapoint.fragment}.${aggregatedDatapoint.series}`],
|
|
2367
|
+
...(this.config.aggregation || customTimeRange
|
|
2368
|
+
? {
|
|
2369
|
+
aggregationType: this.getAggregationTypeForTimeRange()
|
|
2370
|
+
}
|
|
2371
|
+
: {})
|
|
2372
|
+
})).pipe(map(res => {
|
|
2373
|
+
const values = res.data.values;
|
|
2374
|
+
if (res.data.truncated && this.config.dateFrom) {
|
|
2375
|
+
values[new Date(this.config.dateFrom).toISOString()] = [{ min: null, max: null }];
|
|
2376
|
+
}
|
|
2377
|
+
return { ...aggregatedDatapoint, values, truncated: res.data.truncated };
|
|
2378
|
+
}));
|
|
2379
|
+
return request.pipe(tap((dpsWithValues) => {
|
|
2380
|
+
if (dpsWithValues['truncated']) {
|
|
2381
|
+
this.addTruncatedDataAlert();
|
|
2382
|
+
}
|
|
2383
|
+
}));
|
|
2384
|
+
}
|
|
2385
|
+
getAggregationTypeForTimeRange() {
|
|
2386
|
+
const interval = this.widgetTimeContextDateRangeService.initialTimeRange().interval;
|
|
2387
|
+
switch (interval) {
|
|
2388
|
+
case 'minutes':
|
|
2389
|
+
return aggregationType.MINUTELY;
|
|
2390
|
+
case 'hours':
|
|
2391
|
+
return aggregationType.HOURLY;
|
|
2392
|
+
case 'days':
|
|
2393
|
+
return aggregationType.DAILY;
|
|
2394
|
+
case 'weeks':
|
|
2395
|
+
return aggregationType.DAILY;
|
|
2396
|
+
case 'months':
|
|
2397
|
+
return aggregationType.DAILY;
|
|
2398
|
+
case 'custom':
|
|
2399
|
+
return aggregationType.HOURLY;
|
|
2400
|
+
}
|
|
2401
|
+
}
|
|
2402
|
+
getSliderPositionMode() {
|
|
2403
|
+
if ((this.chartViewContext === CHART_VIEW_CONTEXT.DATAPOINT_EXPLORER ||
|
|
2404
|
+
this.chartViewContext === CHART_VIEW_CONTEXT.WIDGET_CONFIG) &&
|
|
2405
|
+
this.activeDatapoints.length > 1) {
|
|
2406
|
+
return 'compact';
|
|
2407
|
+
}
|
|
2408
|
+
return 'default';
|
|
2409
|
+
}
|
|
2181
2410
|
addTruncatedDataAlert() {
|
|
2182
2411
|
if (this.alerts?.alertGroups.find(a => a.type === 'warning')?.value?.alerts?.length) {
|
|
2183
2412
|
return;
|
|
@@ -2217,7 +2446,7 @@ class ChartsComponent {
|
|
|
2217
2446
|
return { dateFrom: timeRange.dateFrom.toISOString(), dateTo: timeRange.dateTo.toISOString() };
|
|
2218
2447
|
}
|
|
2219
2448
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ChartsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2220
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: ChartsComponent, isStandalone: true, selector: "c8y-charts", inputs: { config: "config", alerts: "alerts" }, outputs: { configChangeOnZoomOut: "configChangeOnZoomOut", timeRangeChangeOnRealtime: "timeRangeChangeOnRealtime", datapointOutOfSync: "datapointOutOfSync", updateAlarmsAndEvents: "updateAlarmsAndEvents", isMarkedAreaEnabled: "isMarkedAreaEnabled" }, providers: [
|
|
2449
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", 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", updateActiveDatapoints: "updateActiveDatapoints", updateAggregatedSliderDatapoint: "updateAggregatedSliderDatapoint" }, providers: [
|
|
2221
2450
|
{ provide: NGX_ECHARTS_CONFIG, useFactory: () => ({ echarts: () => import('echarts') }) },
|
|
2222
2451
|
ChartRealtimeService,
|
|
2223
2452
|
MeasurementRealtimeService,
|
|
@@ -2228,7 +2457,7 @@ class ChartsComponent {
|
|
|
2228
2457
|
YAxisService,
|
|
2229
2458
|
AlarmSeverityToIconPipe,
|
|
2230
2459
|
AlarmSeverityToLabelPipe
|
|
2231
|
-
], viewQueries: [{ propertyName: "chart", first: true, predicate: ["chart"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div
|
|
2460
|
+
], 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 <div\n class=\"chart-load-more\"\n *ngIf=\"showLoadMore\"\n >\n <button\n class=\"btn btn-primary btn-block\"\n (click)=\"loadMoreData()\"\n >\n <i c8yIcon=\"restore\"></i>\n {{ 'Load more' | translate }}\n </button>\n </div>\n\n <div\n class=\"e-charts--aggregated-datapoint\"\n *ngIf=\"\n activeDatapoints.length > 1 &&\n config?.showSlider &&\n chartViewContext !== CHART_VIEW_CONTEXT.WIDGET_VIEW\n \"\n >\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</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule$1 }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }, { kind: "ngmodule", type: CoreModule }, { kind: "directive", type: i1.IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "pipe", type: i1.C8yTranslatePipe, name: "translate" }, { kind: "ngmodule", type: NgxEchartsModule }, { kind: "directive", type: i3$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"] }] }); }
|
|
2232
2461
|
}
|
|
2233
2462
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ChartsComponent, decorators: [{
|
|
2234
2463
|
type: Component,
|
|
@@ -2250,12 +2479,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
2250
2479
|
TooltipModule,
|
|
2251
2480
|
PopoverModule,
|
|
2252
2481
|
ChartAlertsComponent,
|
|
2253
|
-
AlarmsModule
|
|
2254
|
-
|
|
2482
|
+
AlarmsModule,
|
|
2483
|
+
SelectAggregatedDatapointComponent
|
|
2484
|
+
], 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 <div\n class=\"chart-load-more\"\n *ngIf=\"showLoadMore\"\n >\n <button\n class=\"btn btn-primary btn-block\"\n (click)=\"loadMoreData()\"\n >\n <i c8yIcon=\"restore\"></i>\n {{ 'Load more' | translate }}\n </button>\n </div>\n\n <div\n class=\"e-charts--aggregated-datapoint\"\n *ngIf=\"\n activeDatapoints.length > 1 &&\n config?.showSlider &&\n chartViewContext !== CHART_VIEW_CONTEXT.WIDGET_VIEW\n \"\n >\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</div>\n" }]
|
|
2255
2485
|
}], ctorParameters: () => [], propDecorators: { config: [{
|
|
2256
2486
|
type: Input
|
|
2257
2487
|
}], alerts: [{
|
|
2258
2488
|
type: Input
|
|
2489
|
+
}], chartViewContext: [{
|
|
2490
|
+
type: Input
|
|
2259
2491
|
}], configChangeOnZoomOut: [{
|
|
2260
2492
|
type: Output
|
|
2261
2493
|
}], timeRangeChangeOnRealtime: [{
|
|
@@ -2266,69 +2498,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
2266
2498
|
type: Output
|
|
2267
2499
|
}], isMarkedAreaEnabled: [{
|
|
2268
2500
|
type: Output
|
|
2501
|
+
}], updateActiveDatapoints: [{
|
|
2502
|
+
type: Output
|
|
2503
|
+
}], updateAggregatedSliderDatapoint: [{
|
|
2504
|
+
type: Output
|
|
2269
2505
|
}], chart: [{
|
|
2270
2506
|
type: ViewChild,
|
|
2271
2507
|
args: ['chart']
|
|
2272
2508
|
}] } });
|
|
2273
2509
|
|
|
2274
|
-
class ChartHelpersService {
|
|
2275
|
-
/**
|
|
2276
|
-
* Cleans the widget configuration which will be sent to Gainsight by removing unnecessary properties.
|
|
2277
|
-
* @param config The widget configuration to clean.
|
|
2278
|
-
* @returns The cleaned widget configuration.
|
|
2279
|
-
*/
|
|
2280
|
-
getConfigSummaryForGainsight(config) {
|
|
2281
|
-
return {
|
|
2282
|
-
datapointCount: config.datapoints?.length ?? 0,
|
|
2283
|
-
alarmsEventsCount: config.alarmsEventsConfigs?.length ?? 0,
|
|
2284
|
-
interval: config.interval,
|
|
2285
|
-
forceMergeDatapoints: config.forceMergeDatapoints,
|
|
2286
|
-
mergeMatchingDatapoints: config.mergeMatchingDatapoints,
|
|
2287
|
-
showSlider: config.showSlider,
|
|
2288
|
-
widgetInstanceGlobalTimeContext: config.widgetInstanceGlobalTimeContext,
|
|
2289
|
-
dateFrom: config.dateFrom,
|
|
2290
|
-
dateTo: config.dateTo
|
|
2291
|
-
};
|
|
2292
|
-
}
|
|
2293
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ChartHelpersService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2294
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ChartHelpersService }); }
|
|
2295
|
-
}
|
|
2296
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ChartHelpersService, decorators: [{
|
|
2297
|
-
type: Injectable
|
|
2298
|
-
}] });
|
|
2299
|
-
|
|
2300
|
-
var DATE_SELECTION_EXTENDED;
|
|
2301
|
-
(function (DATE_SELECTION_EXTENDED) {
|
|
2302
|
-
DATE_SELECTION_EXTENDED["CONFIG"] = "config";
|
|
2303
|
-
DATE_SELECTION_EXTENDED["DASHBOARD_CONTEXT"] = "dashboard_context";
|
|
2304
|
-
})(DATE_SELECTION_EXTENDED || (DATE_SELECTION_EXTENDED = {}));
|
|
2305
|
-
const REALTIME_TEXTS = {
|
|
2306
|
-
ACTIVE: gettext('Realtime active'),
|
|
2307
|
-
INACTIVE: gettext('Realtime inactive')
|
|
2308
|
-
};
|
|
2309
|
-
const PRODUCT_EXPERIENCE_DATA_EXPLORER_AND_GRAPH = {
|
|
2310
|
-
EVENTS: {
|
|
2311
|
-
DATA_EXPLORER_AND_GRAPH: 'data-explorer-and-graph'
|
|
2312
|
-
},
|
|
2313
|
-
COMPONENTS: {
|
|
2314
|
-
DATA_EXPLORER_DETAILS: 'data-explorer-details'
|
|
2315
|
-
},
|
|
2316
|
-
ACTIONS: {
|
|
2317
|
-
DATA_EXPLORER_CONFIG_INIT: 'data-explorer-config-init',
|
|
2318
|
-
DATA_EXPLORER_CONFIG_CHANGE: 'data-explorer-config-change',
|
|
2319
|
-
DATA_GRAPH_WIDGET_CONFIG: 'data-graph-widget-config'
|
|
2320
|
-
}
|
|
2321
|
-
};
|
|
2322
|
-
const SEVERITY_LABELS = {
|
|
2323
|
-
CRITICAL: gettext('Critical`alarm`'),
|
|
2324
|
-
MAJOR: gettext('Major`alarm`'),
|
|
2325
|
-
MINOR: gettext('Minor`alarm`'),
|
|
2326
|
-
WARNING: gettext('Warning`alarm`')
|
|
2327
|
-
};
|
|
2328
|
-
|
|
2329
2510
|
/**
|
|
2330
2511
|
* Generated bundle index. Do not edit.
|
|
2331
2512
|
*/
|
|
2332
2513
|
|
|
2333
|
-
export { ChartAlarmsService, ChartEventsService, ChartHelpersService, ChartsComponent, DATE_SELECTION_EXTENDED, ICONS_MAP, PRODUCT_EXPERIENCE_DATA_EXPLORER_AND_GRAPH, REALTIME_TEXTS, SEVERITY_LABELS };
|
|
2514
|
+
export { CHART_VIEW_CONTEXT, ChartAlarmsService, ChartEventsService, ChartHelpersService, ChartsComponent, DATE_SELECTION_EXTENDED, ICONS_MAP, PRODUCT_EXPERIENCE_DATA_EXPLORER_AND_GRAPH, REALTIME_TEXTS, SEVERITY_LABELS, SelectAggregatedDatapointComponent };
|
|
2334
2515
|
//# sourceMappingURL=c8y-ngx-components-echart.mjs.map
|