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