@bino-bi/bn-template-engine 1.0.0-alpha.7 → 1.0.0-alpha.9
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/dist/bn-template-engine/bn-template-engine.esm.js +1 -1
- package/dist/bn-template-engine/p-3141c4a2.entry.js +1 -0
- package/dist/bn-template-engine/p-67538176.entry.js +1 -0
- package/dist/bn-template-engine/p-916296a5.entry.js +1 -0
- package/dist/bn-template-engine/{p-1164c0b0.entry.js → p-96006b06.entry.js} +1 -1
- package/dist/bn-template-engine/p-B4JfKvVT.js +1 -0
- package/dist/bn-template-engine/{p-JNHhIe7t.js → p-B_d-jp99.js} +1 -1
- package/dist/bn-template-engine/p-Ck-NYtot.js +1 -0
- package/dist/bn-template-engine/p-CnDq0oVa.js +1 -0
- package/dist/bn-template-engine/p-DSXNgKLa.js +1 -0
- package/dist/bn-template-engine/p-bc711fb0.entry.js +1 -0
- package/dist/bn-template-engine/p-c86395b8.entry.js +1 -0
- package/dist/bn-template-engine/p-e6f646b1.entry.js +1 -0
- package/dist/bn-template-engine/p-f41d9242.entry.js +1 -0
- package/dist/bn-template-engine/{p-B0lsgVuN.js → p-gFbbuhtl.js} +1 -1
- package/dist/cjs/{SVGVariancesStyleGroup-BqAdPYtL.js → bn-asset_20.cjs.entry.js} +21955 -6939
- package/dist/cjs/bn-grid.cjs.entry.js +6 -9
- package/dist/cjs/bn-image.cjs.entry.js +6 -9
- package/dist/cjs/bn-internationalization.cjs.entry.js +5 -6
- package/dist/cjs/bn-template-engine.cjs.js +2 -2
- package/dist/cjs/bn-template.cjs.entry.js +3 -4
- package/dist/cjs/bn-text.cjs.entry.js +7 -10
- package/dist/cjs/bn-tree.cjs.entry.js +11 -10
- package/dist/cjs/{context-protocol-DRQWrwsA.js → context-protocol-ohYzcb5F.js} +1 -1
- package/dist/cjs/editor-companion.cjs.entry.js +2 -2
- package/dist/cjs/{index-Cjw0q6gP.js → index-CDKG4xmO.js} +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{scaling-BidPsO53.js → scaling-CIAClQR5.js} +3 -3
- package/dist/cjs/{withBodyObserver-C6gLgq_e.js → withBodyObserver-D7BKWN2N.js} +2 -2
- package/dist/cjs/{withHasError-B8gHkfV2.js → withHasError-Cl2gTQzA.js} +106 -2
- package/dist/cjs/{Order-BGx39pS5.js → withStyled-qd94SSb4.js} +648 -6
- package/dist/collection/components/bn-chart-structure/bn-chart-structure.js +24 -5
- package/dist/collection/components/bn-chart-time/bn-chart-time.js +24 -5
- package/dist/collection/components/bn-layout-card/bn-layout-card.js +12 -6
- package/dist/collection/components/bn-layout-page/bn-layout-page.js +12 -7
- package/dist/collection/components/bn-table/bn-table.js +25 -7
- package/dist/collection/components/bn-table/ibcs-table.js +68 -3
- package/dist/collection/components/bn-tree/bn-tree.js +5 -1
- package/dist/components/bn-chart-structure.js +1 -1
- package/dist/components/bn-chart-time.js +1 -1
- package/dist/components/bn-layout-card.js +1 -1
- package/dist/components/bn-layout-page.js +1 -1
- package/dist/components/bn-table.js +1 -1
- package/dist/components/bn-tree.js +1 -1
- package/dist/components/ibcs-table2.js +1 -1
- package/dist/esm/{SVGVariancesStyleGroup-DOIT-zvI.js → bn-asset_20.entry.js} +22055 -7043
- package/dist/esm/bn-grid.entry.js +4 -7
- package/dist/esm/bn-image.entry.js +4 -7
- package/dist/esm/bn-internationalization.entry.js +4 -5
- package/dist/esm/bn-template-engine.js +3 -3
- package/dist/esm/bn-template.entry.js +2 -3
- package/dist/esm/bn-text.entry.js +5 -8
- package/dist/esm/bn-tree.entry.js +9 -8
- package/dist/esm/{context-protocol-2peaD4y8.js → context-protocol-DdbSplvE.js} +2 -2
- package/dist/esm/editor-companion.entry.js +2 -2
- package/dist/esm/{index-JNHhIe7t.js → index-B_d-jp99.js} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{scaling-BOcjT8M0.js → scaling-DGKKkuL9.js} +4 -4
- package/dist/esm/{withBodyObserver-DczL5ia8.js → withBodyObserver-AFk2wwHT.js} +2 -2
- package/dist/esm/{withHasError-B3QX2emi.js → withHasError-DW_vMDUp.js} +106 -2
- package/dist/esm/{Order-sRO-lj7X.js → withStyled-BIkqU2w4.js} +616 -1
- package/dist/types/components/bn-chart-structure/bn-chart-structure.d.ts +1 -0
- package/dist/types/components/bn-chart-time/bn-chart-time.d.ts +1 -0
- package/dist/types/components/bn-layout-card/bn-layout-card.d.ts +8 -2
- package/dist/types/components/bn-layout-page/bn-layout-page.d.ts +8 -3
- package/dist/types/components/bn-table/ibcs-table.d.ts +19 -0
- package/dist/types/components.d.ts +8 -8
- package/package.json +1 -1
- package/dist/bn-template-engine/p-0fabe296.entry.js +0 -1
- package/dist/bn-template-engine/p-355abdf0.entry.js +0 -1
- package/dist/bn-template-engine/p-79KuA4Ox.js +0 -1
- package/dist/bn-template-engine/p-859cc06d.entry.js +0 -1
- package/dist/bn-template-engine/p-8acec99e.entry.js +0 -1
- package/dist/bn-template-engine/p-8f490c45.entry.js +0 -1
- package/dist/bn-template-engine/p-9721a5bb.entry.js +0 -1
- package/dist/bn-template-engine/p-9a564f8f.entry.js +0 -1
- package/dist/bn-template-engine/p-9cee22fa.entry.js +0 -1
- package/dist/bn-template-engine/p-B7p8beYH.js +0 -1
- package/dist/bn-template-engine/p-BDh7GfC5.js +0 -1
- package/dist/bn-template-engine/p-BoMtoHJB.js +0 -1
- package/dist/bn-template-engine/p-Bs8BqBsb.js +0 -1
- package/dist/bn-template-engine/p-CYjZRKdI.js +0 -1
- package/dist/bn-template-engine/p-DG-1MR_T.js +0 -1
- package/dist/bn-template-engine/p-Dnkv5rt8.js +0 -1
- package/dist/bn-template-engine/p-bdd2b243.entry.js +0 -1
- package/dist/bn-template-engine/p-f27995c9.entry.js +0 -1
- package/dist/bn-template-engine/p-f6ecb265.entry.js +0 -1
- package/dist/bn-template-engine/p-sRO-lj7X.js +0 -1
- package/dist/bn-template-engine/p-tzFCK9qn.js +0 -1
- package/dist/cjs/bn-asset_16.cjs.entry.js +0 -9099
- package/dist/cjs/bn-card.cjs.entry.js +0 -36
- package/dist/cjs/bn-chart-time.cjs.entry.js +0 -1031
- package/dist/cjs/bn-layout-card.cjs.entry.js +0 -279
- package/dist/cjs/formatter-4XCS0d2B.js +0 -221
- package/dist/cjs/ibcs-chart-time.cjs.entry.js +0 -4137
- package/dist/cjs/withComponentStatus-_x4LQZ0N.js +0 -109
- package/dist/cjs/withComponentStyle-ClSJfCku.js +0 -128
- package/dist/cjs/withInheritedProps-BH2KNER3.js +0 -157
- package/dist/cjs/withStyled-9tG024gQ.js +0 -522
- package/dist/esm/bn-asset_16.entry.js +0 -9082
- package/dist/esm/bn-card.entry.js +0 -34
- package/dist/esm/bn-chart-time.entry.js +0 -1029
- package/dist/esm/bn-layout-card.entry.js +0 -277
- package/dist/esm/formatter-BDh7GfC5.js +0 -215
- package/dist/esm/ibcs-chart-time.entry.js +0 -4135
- package/dist/esm/withComponentStatus-DodoSXe-.js +0 -107
- package/dist/esm/withComponentStyle-D3VWOsto.js +0 -126
- package/dist/esm/withInheritedProps-BlXDxhHK.js +0 -154
- package/dist/esm/withStyled-CE3_3taP.js +0 -495
|
@@ -1,1031 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var index = require('./index-Cjw0q6gP.js');
|
|
4
|
-
var withStyled = require('./withStyled-9tG024gQ.js');
|
|
5
|
-
var scaling = require('./scaling-BidPsO53.js');
|
|
6
|
-
var withComponentStatus = require('./withComponentStatus-_x4LQZ0N.js');
|
|
7
|
-
var contextProtocol = require('./context-protocol-DRQWrwsA.js');
|
|
8
|
-
var withComponentStyle = require('./withComponentStyle-ClSJfCku.js');
|
|
9
|
-
var withHasError = require('./withHasError-B8gHkfV2.js');
|
|
10
|
-
var withInheritedProps = require('./withInheritedProps-BH2KNER3.js');
|
|
11
|
-
var Order = require('./Order-BGx39pS5.js');
|
|
12
|
-
var formatter = require('./formatter-4XCS0d2B.js');
|
|
13
|
-
|
|
14
|
-
const bnChartTimeCss = () => `:host{display:inline-block;position:relative;overflow:visible;}.container{display:flex;flex-direction:column-reverse}.background-image{display:flex;flex-wrap:wrap;justify-content:flex-end}`;
|
|
15
|
-
|
|
16
|
-
var AggregationLevel;
|
|
17
|
-
(function (AggregationLevel) {
|
|
18
|
-
AggregationLevel["ROWGROUP"] = "rowGroup";
|
|
19
|
-
AggregationLevel["ROWGROUPINDEX"] = "rowGroupIndex";
|
|
20
|
-
AggregationLevel["CATEGORY"] = "category";
|
|
21
|
-
AggregationLevel["CATEGORYINDEX"] = "categoryIndex";
|
|
22
|
-
AggregationLevel["SUBCATEGORY"] = "subCategory";
|
|
23
|
-
AggregationLevel["SUBCATEGORYINDEX"] = "subCategoryIndex";
|
|
24
|
-
})(AggregationLevel || (AggregationLevel = {}));
|
|
25
|
-
const Chart = class {
|
|
26
|
-
validateScenario(newValue) {
|
|
27
|
-
const errId = "ERR_scenarios";
|
|
28
|
-
if (withInheritedProps.isInheritedValue(newValue)) {
|
|
29
|
-
this.errors.remove(errId);
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
const invalidScenarios = withStyled.validateScenarioList(newValue);
|
|
33
|
-
if (invalidScenarios.length > 0) {
|
|
34
|
-
this.errors.addOrReplace({
|
|
35
|
-
id: errId,
|
|
36
|
-
type: "warning",
|
|
37
|
-
message: "scenarios: invalid value(s) '" + JSON.stringify(invalidScenarios) + "' are not supported.",
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
this.errors.remove(errId);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
validateVariances(newValue) {
|
|
45
|
-
const errIdVar = "ERR_variances";
|
|
46
|
-
if (withInheritedProps.isInheritedValue(newValue)) {
|
|
47
|
-
this.errors.remove(errIdVar);
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
const invalidVariances = withStyled.validateVariancesList(newValue);
|
|
51
|
-
if (invalidVariances.length > 0) {
|
|
52
|
-
this.errors.addOrReplace({
|
|
53
|
-
id: errIdVar,
|
|
54
|
-
type: "warning",
|
|
55
|
-
message: "variances: invalid value(s) '" + JSON.stringify(invalidVariances) + "' are not supported.",
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
else {
|
|
59
|
-
this.errors.remove(errIdVar);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
validateLeftSync(newValue) {
|
|
63
|
-
const errId = "ERR_syncSpaceLeft";
|
|
64
|
-
if (!withStyled.isValidNumber(newValue)) {
|
|
65
|
-
this.errors.addOrReplace({
|
|
66
|
-
id: errId,
|
|
67
|
-
type: "warning",
|
|
68
|
-
message: "syncSpaceLeft: invalid value(s) '" + newValue + "' are not supported.",
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
else {
|
|
72
|
-
this.errors.remove(errId);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
validateLimit(newValue) {
|
|
76
|
-
const errId = "ERR_limit";
|
|
77
|
-
if (!withStyled.isValidInteger(newValue)) {
|
|
78
|
-
this.errors.addOrReplace({
|
|
79
|
-
id: errId,
|
|
80
|
-
type: "warning",
|
|
81
|
-
message: "limit: invalid value '" + (newValue === null || newValue === void 0 ? void 0 : newValue.toString()) + "' is not supported.",
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
else {
|
|
85
|
-
this.errors.remove(errId);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
validateUnitScaling(newValue) {
|
|
89
|
-
const errId = "ERR_unitScaling";
|
|
90
|
-
if (!withStyled.isValidNumber(newValue) && !this.pixelPerUnitGroupMap.has(newValue)) {
|
|
91
|
-
this.errors.addOrReplace({
|
|
92
|
-
id: errId,
|
|
93
|
-
type: "warning",
|
|
94
|
-
message: "unitScaling: invalid value(s) '" + newValue + "' are not supported.",
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
else {
|
|
98
|
-
this.errors.remove(errId);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
validatePercentageScaling(newValue) {
|
|
102
|
-
const errId = "ERR_percentageScaling";
|
|
103
|
-
if (!withStyled.isValidNumber(newValue) && !this.pixelPerUnitGroupMap.has(newValue)) {
|
|
104
|
-
this.errors.addOrReplace({
|
|
105
|
-
id: errId,
|
|
106
|
-
type: "warning",
|
|
107
|
-
message: "percentageScaling: invalid value(s) '" + newValue + "' are not supported.",
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
else {
|
|
111
|
-
this.errors.remove(errId);
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
validateLevel(newValue) {
|
|
115
|
-
const errId = "ERR_level";
|
|
116
|
-
if (!withStyled.isValidLevel(newValue)) {
|
|
117
|
-
this.errors.addOrReplace({
|
|
118
|
-
id: errId,
|
|
119
|
-
type: "warning",
|
|
120
|
-
message: "level: invalid value(s) '" + newValue + "' are not supported.",
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
else {
|
|
124
|
-
this.errors.remove(errId);
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
validateOrderList(newValue) {
|
|
128
|
-
const errId = "ERR_order";
|
|
129
|
-
if (withInheritedProps.isInheritedValue(newValue)) {
|
|
130
|
-
this.errors.remove(errId);
|
|
131
|
-
return;
|
|
132
|
-
}
|
|
133
|
-
const invalidElements = withStyled.validateOrderList(newValue);
|
|
134
|
-
if (invalidElements.length > 0) {
|
|
135
|
-
this.errors.addOrReplace({
|
|
136
|
-
id: errId,
|
|
137
|
-
type: "warning",
|
|
138
|
-
message: "order: invalid value(s) '" + JSON.stringify(invalidElements) + "' are not supported.",
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
else {
|
|
142
|
-
this.errors.remove(errId);
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
validateOrderDirection(newValue) {
|
|
146
|
-
const errId = "ERR_orderDirection";
|
|
147
|
-
if (withInheritedProps.isInheritedValue(newValue)) {
|
|
148
|
-
this.errors.remove(errId);
|
|
149
|
-
return;
|
|
150
|
-
}
|
|
151
|
-
if (!withStyled.isValidDirection(newValue)) {
|
|
152
|
-
this.errors.addOrReplace({
|
|
153
|
-
id: errId,
|
|
154
|
-
type: "warning",
|
|
155
|
-
message: "orderDirection: invalid value '" + (newValue === null || newValue === void 0 ? void 0 : newValue.toString()) + "' is not supported.",
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
else {
|
|
159
|
-
this.errors.remove(errId);
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
validateDateInterval(newValue) {
|
|
163
|
-
const errId = "ERR_dateInterval";
|
|
164
|
-
if (!withStyled.isValidDateFormat(newValue)) {
|
|
165
|
-
this.errors.addOrReplace({
|
|
166
|
-
id: errId,
|
|
167
|
-
type: "warning",
|
|
168
|
-
message: "dateInterval: invalid value '" + (newValue === null || newValue === void 0 ? void 0 : newValue.toString()) + "' is not supported.",
|
|
169
|
-
});
|
|
170
|
-
}
|
|
171
|
-
else {
|
|
172
|
-
this.errors.remove(errId);
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
validateChartMode(newValue) {
|
|
176
|
-
const errId = "ERR_chartMode";
|
|
177
|
-
const validModes = ["bar", "line", "auto"];
|
|
178
|
-
if (!validModes.includes(newValue === null || newValue === void 0 ? void 0 : newValue.toLowerCase())) {
|
|
179
|
-
this.errors.addOrReplace({
|
|
180
|
-
id: errId,
|
|
181
|
-
type: "warning",
|
|
182
|
-
message: "chartMode: invalid value '" +
|
|
183
|
-
(newValue === null || newValue === void 0 ? void 0 : newValue.toString()) +
|
|
184
|
-
"' is not supported. Valid values are: bar, line, auto.",
|
|
185
|
-
});
|
|
186
|
-
}
|
|
187
|
-
else {
|
|
188
|
-
this.errors.remove(errId);
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
validateMaxBars(newValue) {
|
|
192
|
-
const errId = "ERR_maxBars";
|
|
193
|
-
if (!withStyled.isValidInteger(newValue) || newValue < 1) {
|
|
194
|
-
this.errors.addOrReplace({
|
|
195
|
-
id: errId,
|
|
196
|
-
type: "warning",
|
|
197
|
-
message: "maxBars: invalid value '" + (newValue === null || newValue === void 0 ? void 0 : newValue.toString()) + "' is not supported. Must be a positive integer.",
|
|
198
|
-
});
|
|
199
|
-
}
|
|
200
|
-
else {
|
|
201
|
-
this.errors.remove(errId);
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
validateStack(newValue) {
|
|
205
|
-
const errId = "ERR_stack";
|
|
206
|
-
const errors = withStyled.validateStackConfig(newValue);
|
|
207
|
-
if (errors.length > 0) {
|
|
208
|
-
this.errors.addOrReplace({
|
|
209
|
-
id: errId,
|
|
210
|
-
type: "warning",
|
|
211
|
-
message: errors.join("; "),
|
|
212
|
-
});
|
|
213
|
-
}
|
|
214
|
-
else {
|
|
215
|
-
this.errors.remove(errId);
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
validateScaling(newValue) {
|
|
219
|
-
if (newValue == null || newValue === "" || newValue === "none" || newValue === "auto") {
|
|
220
|
-
this.errors.remove("ERR_scale");
|
|
221
|
-
return;
|
|
222
|
-
}
|
|
223
|
-
const num = Number(newValue);
|
|
224
|
-
if (isNaN(num) || num <= 0) {
|
|
225
|
-
this.errors.addOrReplace({
|
|
226
|
-
id: "ERR_scale",
|
|
227
|
-
type: "warning",
|
|
228
|
-
message: `Invalid scale value: "${newValue}". Use "none", "auto", or a positive number.`,
|
|
229
|
-
});
|
|
230
|
-
}
|
|
231
|
-
else {
|
|
232
|
-
this.errors.remove("ERR_scale");
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
validateAxisLabelsMode(newValue) {
|
|
236
|
-
const errId = "ERR_axisLabelsMode";
|
|
237
|
-
if (!withStyled.isValidAxisLabelsMode(newValue)) {
|
|
238
|
-
this.errors.addOrReplace({
|
|
239
|
-
id: errId,
|
|
240
|
-
type: "warning",
|
|
241
|
-
message: "axisLabelsMode: invalid value '" + (newValue === null || newValue === void 0 ? void 0 : newValue.toString()) + "' is not supported.",
|
|
242
|
-
});
|
|
243
|
-
}
|
|
244
|
-
else {
|
|
245
|
-
this.errors.remove(errId);
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
validateLineFullWidth(newValue) {
|
|
249
|
-
const errId = "ERR_lineFullWidth";
|
|
250
|
-
if (!withStyled.isValidBoolean(newValue)) {
|
|
251
|
-
this.errors.addOrReplace({
|
|
252
|
-
id: errId,
|
|
253
|
-
type: "warning",
|
|
254
|
-
message: "lineFullWidth: invalid value(s) '" + (newValue === null || newValue === void 0 ? void 0 : newValue.toString()) + "' are not supported.",
|
|
255
|
-
});
|
|
256
|
-
}
|
|
257
|
-
else {
|
|
258
|
-
this.errors.remove(errId);
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
validateShowCategories(newValue) {
|
|
262
|
-
const errId = "ERR_showCategories";
|
|
263
|
-
if (!withStyled.isValidBoolean(newValue)) {
|
|
264
|
-
this.errors.addOrReplace({
|
|
265
|
-
id: errId,
|
|
266
|
-
type: "warning",
|
|
267
|
-
message: "showCategories: invalid value(s) '" + (newValue === null || newValue === void 0 ? void 0 : newValue.toString()) + "' are not supported.",
|
|
268
|
-
});
|
|
269
|
-
}
|
|
270
|
-
else {
|
|
271
|
-
this.errors.remove(errId);
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
validateMeasureScale(newValue) {
|
|
275
|
-
const errId = "ERR_measureScale";
|
|
276
|
-
if (!withStyled.isValidMeasureScale(newValue)) {
|
|
277
|
-
this.errors.addOrReplace({
|
|
278
|
-
id: errId,
|
|
279
|
-
type: "warning",
|
|
280
|
-
message: "measureScale: invalid value '" + (newValue === null || newValue === void 0 ? void 0 : newValue.toString()) + "' is not supported.",
|
|
281
|
-
});
|
|
282
|
-
}
|
|
283
|
-
else {
|
|
284
|
-
this.errors.remove(errId);
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
validateShowMeasureScale(newValue) {
|
|
288
|
-
const errId = "ERR_grouped";
|
|
289
|
-
if (!withStyled.isValidBoolean(newValue)) {
|
|
290
|
-
this.errors.addOrReplace({
|
|
291
|
-
id: errId,
|
|
292
|
-
type: "warning",
|
|
293
|
-
message: "showMeasureScale: invalid value(s) '" + (newValue === null || newValue === void 0 ? void 0 : newValue.toString()) + "' are not supported.",
|
|
294
|
-
});
|
|
295
|
-
}
|
|
296
|
-
else {
|
|
297
|
-
this.errors.remove(errId);
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
validateShowOverlayAvg(newValue) {
|
|
301
|
-
const errId = "ERR_grouped";
|
|
302
|
-
if (!withStyled.isValidBoolean(newValue)) {
|
|
303
|
-
this.errors.addOrReplace({
|
|
304
|
-
id: errId,
|
|
305
|
-
type: "warning",
|
|
306
|
-
message: "showOverlayAvg: invalid value(s) '" + (newValue === null || newValue === void 0 ? void 0 : newValue.toString()) + "' are not supported.",
|
|
307
|
-
});
|
|
308
|
-
}
|
|
309
|
-
else {
|
|
310
|
-
this.errors.remove(errId);
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
validateShowOverlayMedian(newValue) {
|
|
314
|
-
const errId = "ERR_grouped";
|
|
315
|
-
if (!withStyled.isValidBoolean(newValue)) {
|
|
316
|
-
this.errors.addOrReplace({
|
|
317
|
-
id: errId,
|
|
318
|
-
type: "warning",
|
|
319
|
-
message: "showOverlayMedian: invalid value(s) '" + (newValue === null || newValue === void 0 ? void 0 : newValue.toString()) + "' are not supported.",
|
|
320
|
-
});
|
|
321
|
-
}
|
|
322
|
-
else {
|
|
323
|
-
this.errors.remove(errId);
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
constructor(hostRef) {
|
|
327
|
-
index.registerInstance(this, hostRef);
|
|
328
|
-
this.data = [];
|
|
329
|
-
this.datasetMeta = null;
|
|
330
|
-
this.appliedScaleFactor = 1;
|
|
331
|
-
/**
|
|
332
|
-
* Custom chart title
|
|
333
|
-
*/
|
|
334
|
-
this.chartTitle = "";
|
|
335
|
-
/**
|
|
336
|
-
* AlaSQL WHERE clause fragment injected into the data query to filter
|
|
337
|
-
* rows before rendering (e.g. `"rowGroup = 'Revenue'"`).
|
|
338
|
-
*/
|
|
339
|
-
this.filter = "";
|
|
340
|
-
this.syncSpaceLeft = -1;
|
|
341
|
-
/**
|
|
342
|
-
* Set the maximum number of columns stacks The value 0 means *no limit*
|
|
343
|
-
* <br /><br />
|
|
344
|
-
*
|
|
345
|
-
* columns stacks wich where cut by the limit are cumulated as REST
|
|
346
|
-
*
|
|
347
|
-
*/
|
|
348
|
-
this.limit = 0;
|
|
349
|
-
/** Chart Mode - controls how the chart is rendered
|
|
350
|
-
* <br /><br />
|
|
351
|
-
* values:<br />
|
|
352
|
-
* ```bar // line // auto```
|
|
353
|
-
* <br /><br />
|
|
354
|
-
* When set to 'auto', the chart will switch to line mode
|
|
355
|
-
* when the number of data points exceeds maxBars.
|
|
356
|
-
*/
|
|
357
|
-
this.chartMode = "bar";
|
|
358
|
-
/** Max Bars - threshold for auto-switching to line mode
|
|
359
|
-
* <br /><br />
|
|
360
|
-
* When chartMode is set to 'auto' and the number of data points
|
|
361
|
-
* exceeds this value, the chart will render as a line chart.
|
|
362
|
-
*/
|
|
363
|
-
this.maxBars = 28;
|
|
364
|
-
/**
|
|
365
|
-
* Stacking configuration for the chart as a JSON string.
|
|
366
|
-
*
|
|
367
|
-
* When set, bars/columns are drawn stacked (additive layers) instead of
|
|
368
|
-
* side-by-side. In line mode (`chart-mode="line"`), stacking produces a
|
|
369
|
-
* stacked area chart with filled regions between cumulative lines.
|
|
370
|
-
*
|
|
371
|
-
* **JSON schema:**
|
|
372
|
-
* ```json
|
|
373
|
-
* {
|
|
374
|
-
* "by": "scenario" | "category" | "subcategory" | "rowgroup",
|
|
375
|
-
* "mode": "absolute" | "relative" | "absolute-relative",
|
|
376
|
-
* "order": "asc" | "desc" | "dataset"
|
|
377
|
-
* }
|
|
378
|
-
* ```
|
|
379
|
-
*
|
|
380
|
-
* - `by` (required): The dimension to stack.
|
|
381
|
-
* - `"scenario"` — stack the scenarios from the `scenarios` prop as layers.
|
|
382
|
-
* - `"category"` / `"subcategory"` / `"rowgroup"` — decompose a single
|
|
383
|
-
* scenario by this data dimension. Must be finer than `level`.
|
|
384
|
-
* - `mode` (optional, default `"absolute"`):
|
|
385
|
-
* - `"absolute"` — additive stacking, axis shows absolute units.
|
|
386
|
-
* - `"relative"` — 100% stacking, axis shows 0%–100%.
|
|
387
|
-
* - `"absolute-relative"` — bar height is absolute (real value), but
|
|
388
|
-
* segment labels inside show percentages.
|
|
389
|
-
* - `order` (optional, default `"dataset"`): Segment order within each stack.
|
|
390
|
-
* `"asc"` / `"desc"` sort segments by value; `"dataset"` preserves the
|
|
391
|
-
* original data/scenario order.
|
|
392
|
-
*
|
|
393
|
-
* @default '' (empty — no stacking)
|
|
394
|
-
*
|
|
395
|
-
* @example
|
|
396
|
-
* // Stack scenarios
|
|
397
|
-
* stack='{"by":"scenario"}'
|
|
398
|
-
*
|
|
399
|
-
* @example
|
|
400
|
-
* // Stack by category, relative mode
|
|
401
|
-
* stack='{"by":"category","mode":"relative"}'
|
|
402
|
-
*/
|
|
403
|
-
this.stack = "";
|
|
404
|
-
/** Max number of collumns
|
|
405
|
-
* is used to calculate Axis Date Interval (if dateInterval is set to AUTO)
|
|
406
|
-
*/
|
|
407
|
-
this.intervalSpanLimit = 28;
|
|
408
|
-
/** When true (default), line charts stretch to fill the full parent width
|
|
409
|
-
* instead of using fixed per-data-point spacing.
|
|
410
|
-
* Has no effect in bar mode.
|
|
411
|
-
* <br /><br />
|
|
412
|
-
* values:<br />
|
|
413
|
-
* ```true // false```
|
|
414
|
-
*/
|
|
415
|
-
this.lineFullWidth = "true";
|
|
416
|
-
this.showCategories = "true";
|
|
417
|
-
/**
|
|
418
|
-
* Sets the SiPrefix of the Mesaurements and converts the
|
|
419
|
-
* original value.
|
|
420
|
-
* <br /><br />
|
|
421
|
-
* values: <br />
|
|
422
|
-
* ```_ // k // M // G // T // P // E // Z // Y // m // μ // n // p // P // f // a // z // y // GREATEST // LEAST```
|
|
423
|
-
* <br /><br />
|
|
424
|
-
* SiPrefix overview:
|
|
425
|
-
* ``` "Y": 1E+24,```<br />
|
|
426
|
-
* ``` "Z": 1E+21,```<br />
|
|
427
|
-
* ``` "E": 1E+18,```<br />
|
|
428
|
-
* ``` "P": 1E+15,```<br />
|
|
429
|
-
* ``` "T": 1E+12,```<br />
|
|
430
|
-
* ``` "G": 1000000000,```<br />
|
|
431
|
-
* ``` "M": 1000000,```<br />
|
|
432
|
-
* ``` "k": 1000,```<br />
|
|
433
|
-
* <br />
|
|
434
|
-
* ``` "m": 0.001,```<br />
|
|
435
|
-
* ``` "μ": 0.000001,```<br />
|
|
436
|
-
* ``` "n": 0.000000001,```<br />
|
|
437
|
-
* ``` "p": 0.000000000001,```<br />
|
|
438
|
-
* ``` "f": 0.000000000000001,```<br />
|
|
439
|
-
* ``` "a": 0.000000000000000001,```<br />
|
|
440
|
-
* ``` "z": 0.000000000000000000001,```<br />
|
|
441
|
-
* ``` "y": 0.000000000000000000000001,```<br />
|
|
442
|
-
* <br /><br />
|
|
443
|
-
* Special modes:
|
|
444
|
-
* ```GREATEST``` seaches for the bigest (farest to zero) Value in the dataset and sets this value to SiPrefix<br />
|
|
445
|
-
* ```LEAST``` searches for smallest (closest to zero) Value in the dataset and sets this value to SiPrefix<br />
|
|
446
|
-
*<br /><br />
|
|
447
|
-
* ```_``` is the value for no SiPrefix the value is displayed as in the dataset stored.
|
|
448
|
-
*
|
|
449
|
-
*
|
|
450
|
-
*/
|
|
451
|
-
this.measureScale = "greatest";
|
|
452
|
-
/**
|
|
453
|
-
* Toggles display of measure units in table header
|
|
454
|
-
* <br /><br />
|
|
455
|
-
* values: <br />
|
|
456
|
-
* ```true // false```
|
|
457
|
-
*/
|
|
458
|
-
this.showMeasureScale = "false";
|
|
459
|
-
this.showOverlayAvg = "true";
|
|
460
|
-
this.showOverlayMedian = "false";
|
|
461
|
-
/**
|
|
462
|
-
* measureUnit displayed in table.
|
|
463
|
-
*/
|
|
464
|
-
this.measureUnit = "";
|
|
465
|
-
this.pixelPerUnitGroupMap = new Map();
|
|
466
|
-
this._autoScaleGuard = false;
|
|
467
|
-
withStyled.withStyled(this);
|
|
468
|
-
withComponentStatus.withComponentStatus(this);
|
|
469
|
-
scaling.withDataset(this, (_name, data) => {
|
|
470
|
-
this.data = (data || []);
|
|
471
|
-
}, (_name, meta) => {
|
|
472
|
-
this.datasetMeta = meta;
|
|
473
|
-
});
|
|
474
|
-
this.chartTemplate = this.chartTemplate.bind(this);
|
|
475
|
-
this.errors = withHasError.withHasError(this);
|
|
476
|
-
this.componentStyle = withComponentStyle.withComponentStyle(this);
|
|
477
|
-
this.t = scaling.withTranslation(this).t;
|
|
478
|
-
this.resolveInherited = withInheritedProps.withInheritedProps(this, [
|
|
479
|
-
{ propName: "scenarios", ancestorAttr: "title-scenarios" },
|
|
480
|
-
{ propName: "variances", ancestorAttr: "title-variances" },
|
|
481
|
-
{ propName: "order", ancestorAttr: "title-order" },
|
|
482
|
-
{ propName: "orderDirection", ancestorAttr: "title-order-direction" },
|
|
483
|
-
]);
|
|
484
|
-
}
|
|
485
|
-
componentWillLoad() {
|
|
486
|
-
this.validateScenario(this.scenarios);
|
|
487
|
-
this.validateVariances(this.variances);
|
|
488
|
-
this.validateUnitScaling(this.unitScaling);
|
|
489
|
-
this.validateLimit(this.limit);
|
|
490
|
-
// this.validateStyles(this.styles);
|
|
491
|
-
this.validateLevel(this.level);
|
|
492
|
-
this.validateOrderDirection(this.orderDirection);
|
|
493
|
-
this.validateOrderList(this.order);
|
|
494
|
-
this.validateLeftSync(this.syncSpaceLeft);
|
|
495
|
-
this.validateDateInterval(this.dateInterval);
|
|
496
|
-
this.validateAxisLabelsMode(this.axisLabelsMode);
|
|
497
|
-
this.validateLineFullWidth(this.lineFullWidth);
|
|
498
|
-
this.validateShowCategories(this.showCategories);
|
|
499
|
-
this.validateMeasureScale(this.measureScale);
|
|
500
|
-
this.validateShowMeasureScale(this.showMeasureScale);
|
|
501
|
-
this.validateShowOverlayAvg(this.showOverlayAvg);
|
|
502
|
-
this.validateShowOverlayMedian(this.showOverlayMedian);
|
|
503
|
-
this.validateChartMode(this.chartMode);
|
|
504
|
-
this.validateMaxBars(this.maxBars);
|
|
505
|
-
this.validateStack(this.stack);
|
|
506
|
-
this.validateScaling(this.scale);
|
|
507
|
-
}
|
|
508
|
-
componentDidRender() {
|
|
509
|
-
var _a, _b;
|
|
510
|
-
const { mode } = scaling.parseScaling(this.scale);
|
|
511
|
-
if (mode !== "auto" && mode !== "empty") {
|
|
512
|
-
this._autoScaleGuard = false;
|
|
513
|
-
// Keep existing width-based overflow warning for non-auto modes
|
|
514
|
-
const parent = scaling.getParentDimensions(this.element);
|
|
515
|
-
const errId = "WARN_overflow";
|
|
516
|
-
if (parent.width > 0 && this.element.scrollWidth > parent.width + 1) {
|
|
517
|
-
this.errors.addOrReplace({
|
|
518
|
-
id: errId,
|
|
519
|
-
type: "warning",
|
|
520
|
-
message: "Chart exceeds available space and will be cut off. Check unit-scaling value.",
|
|
521
|
-
});
|
|
522
|
-
}
|
|
523
|
-
else {
|
|
524
|
-
this.errors.remove(errId);
|
|
525
|
-
}
|
|
526
|
-
return;
|
|
527
|
-
}
|
|
528
|
-
if (this._autoScaleGuard) {
|
|
529
|
-
this._autoScaleGuard = false;
|
|
530
|
-
return;
|
|
531
|
-
}
|
|
532
|
-
const host = this.element;
|
|
533
|
-
const { width: parentWidth } = scaling.getParentDimensions(host);
|
|
534
|
-
if (parentWidth <= 0)
|
|
535
|
-
return;
|
|
536
|
-
// Measure at base (unscaled) font size to get true content width
|
|
537
|
-
const baseFontSize = this.componentStyle(($) => { var _a; return ((_a = $["global"]) === null || _a === void 0 ? void 0 : _a["fontSizePx"]) || 13.3333; });
|
|
538
|
-
host.style.setProperty("--bn-font-size", `${baseFontSize}px`);
|
|
539
|
-
// Reading scrollWidth forces a synchronous reflow at base size
|
|
540
|
-
const div = (_a = host.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(".container");
|
|
541
|
-
const unscaledWidth = (_b = div === null || div === void 0 ? void 0 : div.scrollWidth) !== null && _b !== void 0 ? _b : host.scrollWidth;
|
|
542
|
-
if (unscaledWidth <= parentWidth + 1) {
|
|
543
|
-
this.errors.remove("AUTO_scale");
|
|
544
|
-
if (this.appliedScaleFactor !== 1) {
|
|
545
|
-
this._autoScaleGuard = true;
|
|
546
|
-
this.appliedScaleFactor = 1;
|
|
547
|
-
}
|
|
548
|
-
return;
|
|
549
|
-
}
|
|
550
|
-
const computedFactor = (parentWidth - 1) / unscaledWidth;
|
|
551
|
-
host.style.setProperty("--bn-font-size", `${baseFontSize * computedFactor}px`);
|
|
552
|
-
if (mode === "empty") {
|
|
553
|
-
this.errors.addOrReplace({
|
|
554
|
-
id: "AUTO_scale",
|
|
555
|
-
type: "warning",
|
|
556
|
-
message: `Auto-scaled chart by factor ${computedFactor.toFixed(3)}`,
|
|
557
|
-
});
|
|
558
|
-
}
|
|
559
|
-
else {
|
|
560
|
-
this.errors.remove("AUTO_scale");
|
|
561
|
-
}
|
|
562
|
-
if (Math.abs(computedFactor - this.appliedScaleFactor) > 0.001) {
|
|
563
|
-
this._autoScaleGuard = true;
|
|
564
|
-
this.appliedScaleFactor = computedFactor;
|
|
565
|
-
}
|
|
566
|
-
}
|
|
567
|
-
prepareDimension() {
|
|
568
|
-
const parent = scaling.getParentDimensions(this.element);
|
|
569
|
-
const scenariosList = this.prepareScenarios();
|
|
570
|
-
const variancesList = this.prepareVariances();
|
|
571
|
-
this.canvasWidthSegmented = parent.width / (scenariosList.length + variancesList.length || 1);
|
|
572
|
-
return { width: this.canvasWidthSegmented, height: parent.height };
|
|
573
|
-
}
|
|
574
|
-
prepareScenarios() {
|
|
575
|
-
var _a, _b, _c, _d;
|
|
576
|
-
const inherited = this.resolveInherited("scenarios", this.scenarios);
|
|
577
|
-
if (inherited !== undefined) {
|
|
578
|
-
this.errors.remove("AUTO_scenarios");
|
|
579
|
-
return inherited.split(",").map((entry) => entry.trim());
|
|
580
|
-
}
|
|
581
|
-
const isAuto = ((_a = this.scenarios) === null || _a === void 0 ? void 0 : _a.trim().toLowerCase()) === "auto";
|
|
582
|
-
if (withStyled.isBlankInput(this.scenarios) || isAuto) {
|
|
583
|
-
if (((_c = (_b = this.datasetMeta) === null || _b === void 0 ? void 0 : _b.availableScenarios) === null || _c === void 0 ? void 0 : _c.length) > 0) {
|
|
584
|
-
if (!isAuto) {
|
|
585
|
-
this.errors.addOrReplace({
|
|
586
|
-
id: "AUTO_scenarios",
|
|
587
|
-
type: "warning",
|
|
588
|
-
message: `scenarios: not set, auto-detected: ${this.datasetMeta.availableScenarios.join(",")}`,
|
|
589
|
-
});
|
|
590
|
-
}
|
|
591
|
-
else {
|
|
592
|
-
this.errors.remove("AUTO_scenarios");
|
|
593
|
-
}
|
|
594
|
-
return this.datasetMeta.availableScenarios;
|
|
595
|
-
}
|
|
596
|
-
return [];
|
|
597
|
-
}
|
|
598
|
-
this.errors.remove("AUTO_scenarios");
|
|
599
|
-
return (_d = this.scenarios) === null || _d === void 0 ? void 0 : _d.split(",").map((entry) => entry.trim());
|
|
600
|
-
}
|
|
601
|
-
prepareAvg() {
|
|
602
|
-
return this.showOverlayAvg === "true";
|
|
603
|
-
}
|
|
604
|
-
prepareMedian() {
|
|
605
|
-
return this.showOverlayMedian === "true";
|
|
606
|
-
}
|
|
607
|
-
prepareVariances() {
|
|
608
|
-
var _a;
|
|
609
|
-
const inherited = this.resolveInherited("variances", this.variances);
|
|
610
|
-
if (inherited !== undefined) {
|
|
611
|
-
return inherited.split(",").map((entry) => entry.trim());
|
|
612
|
-
}
|
|
613
|
-
if (withStyled.isBlankInput(this.variances)) {
|
|
614
|
-
return [];
|
|
615
|
-
}
|
|
616
|
-
return (_a = this.variances) === null || _a === void 0 ? void 0 : _a.split(",").map((entry) => entry.trim());
|
|
617
|
-
}
|
|
618
|
-
prepareHideAxisLabels(idx) {
|
|
619
|
-
return idx >= 1 || this.showCategories !== "true";
|
|
620
|
-
}
|
|
621
|
-
prepareI18n() {
|
|
622
|
-
const i18nMetaLabelsLocal = [];
|
|
623
|
-
const i18nMetaLabelsGlobal = contextProtocol.globalLabelKeys;
|
|
624
|
-
const i18nMapLocal = new Map(i18nMetaLabelsLocal.map((key) => [key, this.t(".".concat(key))]));
|
|
625
|
-
const i18nMapGlobal = new Map(i18nMetaLabelsGlobal.map((key) => [key, this.t("global.".concat(key))]));
|
|
626
|
-
return new Map([...i18nMapGlobal.entries(), ...i18nMapLocal.entries()]);
|
|
627
|
-
}
|
|
628
|
-
preparePixelPerUnit() {
|
|
629
|
-
var _a;
|
|
630
|
-
if (this.pixelPerUnitGroupMap.has(this.unitScaling)) {
|
|
631
|
-
this.errors.remove("AUTO_unitScaling");
|
|
632
|
-
return this.pixelPerUnitGroupMap.get(this.unitScaling);
|
|
633
|
-
}
|
|
634
|
-
// Explicit 'auto' → auto-calculate silently
|
|
635
|
-
if (((_a = this.unitScaling) === null || _a === void 0 ? void 0 : _a.toString().trim().toLowerCase()) === "auto") {
|
|
636
|
-
this.errors.remove("AUTO_unitScaling");
|
|
637
|
-
return 0;
|
|
638
|
-
}
|
|
639
|
-
const numeric = Number(this.unitScaling);
|
|
640
|
-
if (!isNaN(numeric) && numeric > 0) {
|
|
641
|
-
this.errors.remove("AUTO_unitScaling");
|
|
642
|
-
return numeric;
|
|
643
|
-
}
|
|
644
|
-
// Not set / invalid → auto-calculate with warning
|
|
645
|
-
this.errors.addOrReplace({
|
|
646
|
-
id: "AUTO_unitScaling",
|
|
647
|
-
type: "warning",
|
|
648
|
-
message: `unit-scaling: not set, auto-calculated to fit available space.`,
|
|
649
|
-
});
|
|
650
|
-
return 0;
|
|
651
|
-
}
|
|
652
|
-
preparePixelPerPercentage() {
|
|
653
|
-
if (this.pixelPerUnitGroupMap.has(this.percentageScaling)) {
|
|
654
|
-
return this.pixelPerUnitGroupMap.get(this.percentageScaling);
|
|
655
|
-
}
|
|
656
|
-
return Number(this.percentageScaling) * 100;
|
|
657
|
-
}
|
|
658
|
-
prepareLevel() {
|
|
659
|
-
var _a, _b, _c;
|
|
660
|
-
const isAuto = ((_a = this.level) === null || _a === void 0 ? void 0 : _a.trim().toLowerCase()) === "auto";
|
|
661
|
-
if (withStyled.isBlankInput(this.level) || isAuto) {
|
|
662
|
-
if ((_b = this.datasetMeta) === null || _b === void 0 ? void 0 : _b.suggestedLevel) {
|
|
663
|
-
if (!isAuto) {
|
|
664
|
-
this.errors.addOrReplace({
|
|
665
|
-
id: "AUTO_level",
|
|
666
|
-
type: "warning",
|
|
667
|
-
message: `level: not set, auto-detected: ${this.datasetMeta.suggestedLevel}`,
|
|
668
|
-
});
|
|
669
|
-
}
|
|
670
|
-
else {
|
|
671
|
-
this.errors.remove("AUTO_level");
|
|
672
|
-
}
|
|
673
|
-
return AggregationLevel[this.datasetMeta.suggestedLevel.toUpperCase()];
|
|
674
|
-
}
|
|
675
|
-
return undefined;
|
|
676
|
-
}
|
|
677
|
-
this.errors.remove("AUTO_level");
|
|
678
|
-
return AggregationLevel[(_c = this.level) === null || _c === void 0 ? void 0 : _c.toUpperCase()];
|
|
679
|
-
}
|
|
680
|
-
prepareOrder() {
|
|
681
|
-
var _a, _b, _c;
|
|
682
|
-
const inheritedOrder = this.resolveInherited("order", this.order);
|
|
683
|
-
const inheritedDirection = this.resolveInherited("orderDirection", this.orderDirection);
|
|
684
|
-
const effectiveOrder = inheritedOrder !== null && inheritedOrder !== void 0 ? inheritedOrder : this.order;
|
|
685
|
-
const effectiveDirection = inheritedDirection !== null && inheritedDirection !== void 0 ? inheritedDirection : this.orderDirection;
|
|
686
|
-
const isLevelAuto = withStyled.isBlankInput(this.level) || ((_a = this.level) === null || _a === void 0 ? void 0 : _a.trim().toLowerCase()) === "auto";
|
|
687
|
-
let entryValue = isLevelAuto && ((_b = this.datasetMeta) === null || _b === void 0 ? void 0 : _b.suggestedLevel) ? this.datasetMeta.suggestedLevel : this.level;
|
|
688
|
-
const isOrderAuto = (effectiveOrder === null || effectiveOrder === void 0 ? void 0 : effectiveOrder.trim().toLowerCase()) === "auto";
|
|
689
|
-
if (withStyled.isBlankInput(effectiveOrder) || isOrderAuto) {
|
|
690
|
-
if ((_c = this.datasetMeta) === null || _c === void 0 ? void 0 : _c.suggestedLevel) {
|
|
691
|
-
if (!isOrderAuto) {
|
|
692
|
-
this.errors.addOrReplace({
|
|
693
|
-
id: "AUTO_order",
|
|
694
|
-
type: "warning",
|
|
695
|
-
message: `order: not set, auto-detected: ${entryValue}`,
|
|
696
|
-
});
|
|
697
|
-
}
|
|
698
|
-
else {
|
|
699
|
-
this.errors.remove("AUTO_order");
|
|
700
|
-
}
|
|
701
|
-
}
|
|
702
|
-
}
|
|
703
|
-
else {
|
|
704
|
-
this.errors.remove("AUTO_order");
|
|
705
|
-
if ((effectiveOrder === null || effectiveOrder === void 0 ? void 0 : effectiveOrder.toLocaleLowerCase()) === "levelindex") {
|
|
706
|
-
entryValue += "Index";
|
|
707
|
-
}
|
|
708
|
-
}
|
|
709
|
-
const tableOrder = {
|
|
710
|
-
hierarchy: [Order.OrderColumn[entryValue === null || entryValue === void 0 ? void 0 : entryValue.toUpperCase()]],
|
|
711
|
-
direction: Order.OrderDirection[effectiveDirection === null || effectiveDirection === void 0 ? void 0 : effectiveDirection.toUpperCase()],
|
|
712
|
-
};
|
|
713
|
-
return tableOrder;
|
|
714
|
-
}
|
|
715
|
-
prepareStyle() {
|
|
716
|
-
const effectiveFactor = this.getEffectiveScaleFactor();
|
|
717
|
-
return this.componentStyle(($) => {
|
|
718
|
-
const baseFontSize = $["global"]["fontSizePx"];
|
|
719
|
-
const scaledFontSize = baseFontSize * effectiveFactor;
|
|
720
|
-
return {
|
|
721
|
-
scaleFactors: {
|
|
722
|
-
scenarioOffset: $["bn-chart-time"]["scaleFactors"]["scenarioOffset"],
|
|
723
|
-
scenarioLabelToColumn: $["bn-chart-time"]["scaleFactors"]["scenarioLabelToColumn"],
|
|
724
|
-
labelToColumn: 0.3,
|
|
725
|
-
labelToColum: $["bn-chart-time"]["scaleFactors"]["labelToColum"],
|
|
726
|
-
labelToAxis: $["bn-chart-time"]["scaleFactors"]["labelToAxis"],
|
|
727
|
-
needleWidth: $["bn-chart-time"]["scaleFactors"]["needleWidth"],
|
|
728
|
-
needleHeadWidth: $["bn-chart-time"]["scaleFactors"]["needleHeadWidth"],
|
|
729
|
-
columnWidth: $["bn-chart-time"]["scaleFactors"]["columnWidth"],
|
|
730
|
-
varianceAxisLineWidth: $["bn-chart-time"]["scaleFactors"]["varianceAxisLineWidth"],
|
|
731
|
-
axisLineWidth: $["bn-chart-time"]["scaleFactors"]["axisLineWidth"],
|
|
732
|
-
auxiliaryLineWidth: $["bn-chart-time"]["scaleFactors"]["auxiliaryLineWidth"],
|
|
733
|
-
scenarioLineWidth: $["bn-chart-time"]["scaleFactors"]["scenarioLineWidth"],
|
|
734
|
-
markerWidth: $["bn-chart-time"]["scaleFactors"]["markerWidth"],
|
|
735
|
-
markerOffset: $["bn-chart-time"]["scaleFactors"]["markerOffset"],
|
|
736
|
-
categoryWidth: $["bn-chart-time"]["scaleFactors"]["categoryWidth"],
|
|
737
|
-
axisTickLength: $["bn-chart-time"]["scaleFactors"]["axisTickLength"],
|
|
738
|
-
},
|
|
739
|
-
fontStyles: {
|
|
740
|
-
font: `${scaledFontSize}px ${$["global"]["fontFamily"]}`,
|
|
741
|
-
size: scaledFontSize,
|
|
742
|
-
color: $["global"]["fontColor"],
|
|
743
|
-
background: $["global"]["fontBackgroundColor"],
|
|
744
|
-
leading: 1.8,
|
|
745
|
-
},
|
|
746
|
-
axisStyles: $["bn-chart-time"]["axisStyles"],
|
|
747
|
-
barStyles: $["bn-chart-time"]["barStyles"],
|
|
748
|
-
varianceStyles: $["bn-chart-time"]["varianceStyles"],
|
|
749
|
-
stackColors: $["bn-chart-time"]["stackColors"],
|
|
750
|
-
padding: $["bn-chart-time"]["padding"],
|
|
751
|
-
pattern: null,
|
|
752
|
-
};
|
|
753
|
-
});
|
|
754
|
-
}
|
|
755
|
-
prepareLeftSideOffset(preparedI18n, preparedStyle) {
|
|
756
|
-
if (this.syncSpaceLeft > -1) {
|
|
757
|
-
return this.syncSpaceLeft;
|
|
758
|
-
}
|
|
759
|
-
const leftSideOffset = formatter.Formatter.getMaxWidthOfArrayItems([...this.prepareVariances(), ...this.prepareScenarios(), this.chartTitle], preparedI18n, preparedStyle);
|
|
760
|
-
//if(leftSideOffset < this.syncSpaceLeft) {
|
|
761
|
-
// return this.syncSpaceLeft;
|
|
762
|
-
//}
|
|
763
|
-
return leftSideOffset;
|
|
764
|
-
}
|
|
765
|
-
prepareChartTitle(idx) {
|
|
766
|
-
if (idx >= 1) {
|
|
767
|
-
return "";
|
|
768
|
-
}
|
|
769
|
-
return this.chartTitle;
|
|
770
|
-
}
|
|
771
|
-
prepareLimit() {
|
|
772
|
-
return Math.floor(Number(this.limit) || 0);
|
|
773
|
-
}
|
|
774
|
-
prepareDateInterval() {
|
|
775
|
-
var _a, _b, _c;
|
|
776
|
-
const isAuto = ((_a = this.dateInterval) === null || _a === void 0 ? void 0 : _a.trim().toLowerCase()) === "auto";
|
|
777
|
-
if (withStyled.isBlankInput(this.dateInterval) || isAuto) {
|
|
778
|
-
if ((_b = this.datasetMeta) === null || _b === void 0 ? void 0 : _b.suggestedDateInterval) {
|
|
779
|
-
if (!isAuto) {
|
|
780
|
-
this.errors.addOrReplace({
|
|
781
|
-
id: "AUTO_dateInterval",
|
|
782
|
-
type: "warning",
|
|
783
|
-
message: `dateInterval: not set, auto-detected: ${this.datasetMeta.suggestedDateInterval}`,
|
|
784
|
-
});
|
|
785
|
-
}
|
|
786
|
-
else {
|
|
787
|
-
this.errors.remove("AUTO_dateInterval");
|
|
788
|
-
}
|
|
789
|
-
return Order.DateDistance[this.datasetMeta.suggestedDateInterval.toUpperCase()];
|
|
790
|
-
}
|
|
791
|
-
return isAuto ? Order.DateDistance.AUTO : undefined;
|
|
792
|
-
}
|
|
793
|
-
this.errors.remove("AUTO_dateInterval");
|
|
794
|
-
return Order.DateDistance[(_c = this.dateInterval) === null || _c === void 0 ? void 0 : _c.toUpperCase()];
|
|
795
|
-
}
|
|
796
|
-
prepareIntervalSpanLimit() {
|
|
797
|
-
return this.intervalSpanLimit;
|
|
798
|
-
}
|
|
799
|
-
prepareAxisLabelsMode() {
|
|
800
|
-
var _a;
|
|
801
|
-
return Order.AxisLabelsMode[(_a = this.axisLabelsMode) === null || _a === void 0 ? void 0 : _a.toUpperCase()];
|
|
802
|
-
}
|
|
803
|
-
prepareFilter() {
|
|
804
|
-
if (this.filter.length === 0) {
|
|
805
|
-
return "";
|
|
806
|
-
}
|
|
807
|
-
return this.filter;
|
|
808
|
-
}
|
|
809
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
810
|
-
getDataStructure() {
|
|
811
|
-
const dataSetStructure = {
|
|
812
|
-
ITimeChartDataRow: {
|
|
813
|
-
setName: { type: "string", isOptional: false, description: "" },
|
|
814
|
-
date: { type: "string", isOptional: false, description: "" },
|
|
815
|
-
operation: { type: "string", isOptional: false, description: "" },
|
|
816
|
-
rowGroup: { type: "string", isOptional: false, description: "" },
|
|
817
|
-
rowGroupIndex: { type: "number", isOptional: false, description: "" },
|
|
818
|
-
category: { type: "string", isOptional: false, description: "" },
|
|
819
|
-
categoryIndex: { type: "number", isOptional: false, description: "" },
|
|
820
|
-
subCategory: { type: "string", isOptional: false, description: "" },
|
|
821
|
-
subCategoryIndex: { type: "number", isOptional: false, description: "" },
|
|
822
|
-
columnGroup: { type: "string", isOptional: false, description: "" },
|
|
823
|
-
columnGroupIndex: { type: "number", isOptional: false, description: "" },
|
|
824
|
-
columnSubGroup: { type: "string", isOptional: false, description: "" },
|
|
825
|
-
columnSubGroupIndex: { type: "number", isOptional: false, description: "" },
|
|
826
|
-
ac1: { type: "number", isOptional: false, description: "" },
|
|
827
|
-
ac2: { type: "number", isOptional: false, description: "" },
|
|
828
|
-
ac3: { type: "number", isOptional: false, description: "" },
|
|
829
|
-
ac4: { type: "number", isOptional: false, description: "" },
|
|
830
|
-
pp1: { type: "number", isOptional: false, description: "" },
|
|
831
|
-
pp2: { type: "number", isOptional: false, description: "" },
|
|
832
|
-
pp3: { type: "number", isOptional: false, description: "" },
|
|
833
|
-
pp4: { type: "number", isOptional: false, description: "" },
|
|
834
|
-
fc1: { type: "number", isOptional: false, description: "" },
|
|
835
|
-
fc2: { type: "number", isOptional: false, description: "" },
|
|
836
|
-
fc3: { type: "number", isOptional: false, description: "" },
|
|
837
|
-
fc4: { type: "number", isOptional: false, description: "" },
|
|
838
|
-
pl1: { type: "number", isOptional: false, description: "" },
|
|
839
|
-
pl2: { type: "number", isOptional: false, description: "" },
|
|
840
|
-
pl3: { type: "number", isOptional: false, description: "" },
|
|
841
|
-
pl4: { type: "number", isOptional: false, description: "" },
|
|
842
|
-
},
|
|
843
|
-
};
|
|
844
|
-
return dataSetStructure;
|
|
845
|
-
}
|
|
846
|
-
prepareMeasureScale() {
|
|
847
|
-
if (withStyled.isBlankInput(this.measureScale)) {
|
|
848
|
-
return "GREATEST";
|
|
849
|
-
}
|
|
850
|
-
if (["_", "k", "M", "G", "T", "P", "E", "Z", "Y", "m", "μ", "n", "p", "P", "f", "a", "z", "y"].includes(this.measureScale.trim())) {
|
|
851
|
-
return this.measureScale.trim();
|
|
852
|
-
}
|
|
853
|
-
if (this.measureScale.trim().toUpperCase() === "LEAST") {
|
|
854
|
-
return this.measureScale.trim();
|
|
855
|
-
}
|
|
856
|
-
return "GREATEST";
|
|
857
|
-
}
|
|
858
|
-
prepareShowMeasureScale(idx) {
|
|
859
|
-
return idx === 0 && this.showMeasureScale === "true";
|
|
860
|
-
}
|
|
861
|
-
prepareMeasureUnit() {
|
|
862
|
-
if (this.measureUnit === "" || this.measureUnit == null) {
|
|
863
|
-
return "";
|
|
864
|
-
}
|
|
865
|
-
return this.measureUnit;
|
|
866
|
-
}
|
|
867
|
-
prepareStackConfig() {
|
|
868
|
-
if (withStyled.isBlankInput(this.stack)) {
|
|
869
|
-
this.errors.remove("WARN_stack_dimensions_scenarios");
|
|
870
|
-
return null;
|
|
871
|
-
}
|
|
872
|
-
try {
|
|
873
|
-
const parsed = JSON.parse(this.stack);
|
|
874
|
-
const by = parsed.by;
|
|
875
|
-
const errId = "WARN_stack_dimensions_scenarios";
|
|
876
|
-
if (by === Order.StackBy.DIMENSIONS) {
|
|
877
|
-
const scenarios = this.prepareScenarios();
|
|
878
|
-
if (scenarios.length > 1) {
|
|
879
|
-
this.errors.addOrReplace({
|
|
880
|
-
id: errId,
|
|
881
|
-
type: "warning",
|
|
882
|
-
message: `stack by dimensions: only the first scenario "${scenarios[0]}" is used, the rest (${scenarios.slice(1).join(", ")}) are discarded.`,
|
|
883
|
-
});
|
|
884
|
-
}
|
|
885
|
-
else {
|
|
886
|
-
this.errors.remove(errId);
|
|
887
|
-
}
|
|
888
|
-
}
|
|
889
|
-
else {
|
|
890
|
-
this.errors.remove(errId);
|
|
891
|
-
}
|
|
892
|
-
return {
|
|
893
|
-
by,
|
|
894
|
-
mode: parsed.mode || Order.StackMode.ABSOLUTE,
|
|
895
|
-
order: parsed.order || Order.StackOrder.DATASET,
|
|
896
|
-
};
|
|
897
|
-
}
|
|
898
|
-
catch (_a) {
|
|
899
|
-
this.errors.remove("WARN_stack_dimensions_scenarios");
|
|
900
|
-
return null;
|
|
901
|
-
}
|
|
902
|
-
}
|
|
903
|
-
prepareLineFullWidth() {
|
|
904
|
-
return this.lineFullWidth === "true";
|
|
905
|
-
}
|
|
906
|
-
prepareChartMode() {
|
|
907
|
-
var _a;
|
|
908
|
-
const mode = (_a = this.chartMode) === null || _a === void 0 ? void 0 : _a.toLowerCase();
|
|
909
|
-
if (mode === "line") {
|
|
910
|
-
return Order.ChartMode.LINE;
|
|
911
|
-
}
|
|
912
|
-
else if (mode === "auto") {
|
|
913
|
-
return Order.ChartMode.AUTO;
|
|
914
|
-
}
|
|
915
|
-
return Order.ChartMode.BAR;
|
|
916
|
-
}
|
|
917
|
-
prepareMaxBars() {
|
|
918
|
-
return Math.floor(Number(this.maxBars) || 28);
|
|
919
|
-
}
|
|
920
|
-
chartTemplate(localScenarioString, idx) {
|
|
921
|
-
const preparedI18n = this.prepareI18n();
|
|
922
|
-
const preparedStyle = this.prepareStyle();
|
|
923
|
-
const fullParentWidth = scaling.getParentDimensions(this.element).width;
|
|
924
|
-
const effectiveFactor = this.getEffectiveScaleFactor();
|
|
925
|
-
const ppu = this.preparePixelPerUnit();
|
|
926
|
-
const ppp = this.preparePixelPerPercentage();
|
|
927
|
-
const stackConfig = this.prepareStackConfig();
|
|
928
|
-
const scenarios = this.prepareScenarios();
|
|
929
|
-
const effectiveScenarios = (stackConfig === null || stackConfig === void 0 ? void 0 : stackConfig.by) === Order.StackBy.DIMENSIONS ? scenarios.slice(0, 1) : scenarios;
|
|
930
|
-
return (index.h("ibcs-chart-time", { data: this.data, chartTitle: this.prepareChartTitle(idx), scenarios: effectiveScenarios, variances: [localScenarioString], hideAxisLabels: this.prepareHideAxisLabels(idx), pixelPerUnit: ppu > 0 ? ppu * effectiveFactor : 0, pixelPerPercentage: ppp > 0 ? ppp * effectiveFactor : 0, limit: this.prepareLimit(), leftSideOffsetForHorizontalSync: this.prepareLeftSideOffset(preparedI18n, preparedStyle), styles: preparedStyle, i18n: preparedI18n, order: this.prepareOrder(), level: this.prepareLevel(), dateInterval: this.prepareDateInterval(), intervalSpanLimit: this.prepareIntervalSpanLimit(), axisLabelsMode: this.prepareAxisLabelsMode(), filter: this.prepareFilter(), "measure-scale": this.prepareMeasureScale(), "measure-unit": this.prepareMeasureUnit(), showOverlayAvg: this.prepareAvg(), showOverlayMedian: this.prepareMedian(), showMeasureScale: this.prepareShowMeasureScale(idx), chartMode: this.prepareChartMode(), maxBars: this.prepareMaxBars(), stackConfig: stackConfig, lineFullWidth: this.prepareLineFullWidth(), containerWidth: fullParentWidth, parentDimensions: this.prepareDimension() }));
|
|
931
|
-
}
|
|
932
|
-
getEffectiveScaleFactor() {
|
|
933
|
-
const { mode, factor } = scaling.parseScaling(this.scale);
|
|
934
|
-
if (mode === "factor")
|
|
935
|
-
return factor;
|
|
936
|
-
if (mode === "auto" || mode === "empty")
|
|
937
|
-
return this.appliedScaleFactor;
|
|
938
|
-
return 1;
|
|
939
|
-
}
|
|
940
|
-
getFontStyles() {
|
|
941
|
-
const effectiveFactor = this.getEffectiveScaleFactor();
|
|
942
|
-
return this.componentStyle(($) => {
|
|
943
|
-
var _a, _b, _c, _d;
|
|
944
|
-
const baseFontSize = ((_a = $["global"]) === null || _a === void 0 ? void 0 : _a["fontSizePx"]) || 13.3333;
|
|
945
|
-
return {
|
|
946
|
-
"--bn-font-family": ((_b = $["global"]) === null || _b === void 0 ? void 0 : _b["fontFamily"]) || "'Noto Sans', sans-serif",
|
|
947
|
-
"--bn-font-size": `${baseFontSize * effectiveFactor}px`,
|
|
948
|
-
"--bn-font-color": ((_c = $["global"]) === null || _c === void 0 ? void 0 : _c["fontColor"]) || "#000000",
|
|
949
|
-
"--bn-font-background": ((_d = $["global"]) === null || _d === void 0 ? void 0 : _d["fontBackgroundColor"]) || "#ffffff",
|
|
950
|
-
};
|
|
951
|
-
});
|
|
952
|
-
}
|
|
953
|
-
render() {
|
|
954
|
-
let scenariosArray = [""];
|
|
955
|
-
const variancesArray = this.prepareVariances();
|
|
956
|
-
if (variancesArray.length > 0) {
|
|
957
|
-
scenariosArray = [...scenariosArray, ...variancesArray];
|
|
958
|
-
}
|
|
959
|
-
const fontStyles = this.getFontStyles();
|
|
960
|
-
return (index.h(index.Host, { key: 'd0625657fc6ddbacf7ad5c4cede189cc321109e1', style: fontStyles }, index.h("div", { key: '393a0c8b00028b3edd08d6e199ffe55014251a5d', class: "container" }, scenariosArray.map(this.chartTemplate))));
|
|
961
|
-
}
|
|
962
|
-
get element() { return index.getElement(this); }
|
|
963
|
-
static get watchers() { return {
|
|
964
|
-
"scenarios": [{
|
|
965
|
-
"validateScenario": 0
|
|
966
|
-
}],
|
|
967
|
-
"variances": [{
|
|
968
|
-
"validateVariances": 0
|
|
969
|
-
}],
|
|
970
|
-
"syncSpaceLeft": [{
|
|
971
|
-
"validateLeftSync": 0
|
|
972
|
-
}],
|
|
973
|
-
"limit": [{
|
|
974
|
-
"validateLimit": 0
|
|
975
|
-
}],
|
|
976
|
-
"unitScaling": [{
|
|
977
|
-
"validateUnitScaling": 0
|
|
978
|
-
}],
|
|
979
|
-
"percentageScaling": [{
|
|
980
|
-
"validatePercentageScaling": 0
|
|
981
|
-
}],
|
|
982
|
-
"level": [{
|
|
983
|
-
"validateLevel": 0
|
|
984
|
-
}],
|
|
985
|
-
"order": [{
|
|
986
|
-
"validateOrderList": 0
|
|
987
|
-
}],
|
|
988
|
-
"orderDirection": [{
|
|
989
|
-
"validateOrderDirection": 0
|
|
990
|
-
}],
|
|
991
|
-
"dateInterval": [{
|
|
992
|
-
"validateDateInterval": 0
|
|
993
|
-
}],
|
|
994
|
-
"chartMode": [{
|
|
995
|
-
"validateChartMode": 0
|
|
996
|
-
}],
|
|
997
|
-
"maxBars": [{
|
|
998
|
-
"validateMaxBars": 0
|
|
999
|
-
}],
|
|
1000
|
-
"stack": [{
|
|
1001
|
-
"validateStack": 0
|
|
1002
|
-
}],
|
|
1003
|
-
"scale": [{
|
|
1004
|
-
"validateScaling": 0
|
|
1005
|
-
}],
|
|
1006
|
-
"axisLabelsMode": [{
|
|
1007
|
-
"validateAxisLabelsMode": 0
|
|
1008
|
-
}],
|
|
1009
|
-
"lineFullWidth": [{
|
|
1010
|
-
"validateLineFullWidth": 0
|
|
1011
|
-
}],
|
|
1012
|
-
"showCategories": [{
|
|
1013
|
-
"validateShowCategories": 0
|
|
1014
|
-
}],
|
|
1015
|
-
"measureScale": [{
|
|
1016
|
-
"validateMeasureScale": 0
|
|
1017
|
-
}],
|
|
1018
|
-
"showMeasureScale": [{
|
|
1019
|
-
"validateShowMeasureScale": 0
|
|
1020
|
-
}],
|
|
1021
|
-
"showOverlayAvg": [{
|
|
1022
|
-
"validateShowOverlayAvg": 0
|
|
1023
|
-
}],
|
|
1024
|
-
"showOverlayMedian": [{
|
|
1025
|
-
"validateShowOverlayMedian": 0
|
|
1026
|
-
}]
|
|
1027
|
-
}; }
|
|
1028
|
-
};
|
|
1029
|
-
Chart.style = bnChartTimeCss();
|
|
1030
|
-
|
|
1031
|
-
exports.bn_chart_time = Chart;
|