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