@bino-bi/bn-template-engine 1.0.0-alpha.6 → 1.0.0-alpha.8

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