@bino-bi/bn-template-engine 1.0.0-next.21 → 1.0.0-next.22

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 (84) hide show
  1. package/dist/bn-template-engine/bn-template-engine.esm.js +1 -1
  2. package/dist/bn-template-engine/{p-99477a27.entry.js → p-445c76cd.entry.js} +1 -1
  3. package/dist/bn-template-engine/p-7d1083f6.entry.js +1 -0
  4. package/dist/bn-template-engine/{p-7e9dbc93.entry.js → p-91e5dddf.entry.js} +1 -1
  5. package/dist/bn-template-engine/{p-b9e94127.entry.js → p-93eaded3.entry.js} +1 -1
  6. package/dist/bn-template-engine/{p-BpWWgN6k.js → p-D1SJ10zl.js} +1 -1
  7. package/dist/bn-template-engine/p-D75i_YOP.js +1 -0
  8. package/dist/bn-template-engine/{p-A8xyE4b1.js → p-Da6p_F4J.js} +1 -1
  9. package/dist/bn-template-engine/{p-a1380d7c.entry.js → p-c3383557.entry.js} +1 -1
  10. package/dist/bn-template-engine/{p-ba912130.entry.js → p-cda4322a.entry.js} +1 -1
  11. package/dist/bn-template-engine/{p-6c7f0076.entry.js → p-e49f9170.entry.js} +1 -1
  12. package/dist/bn-template-engine/{p-6077155f.entry.js → p-f275b9fe.entry.js} +1 -1
  13. package/dist/cjs/bn-asset_21.cjs.entry.js +369 -122
  14. package/dist/cjs/bn-chart-bubble.cjs.entry.js +18 -8
  15. package/dist/cjs/bn-chart-bullet.cjs.entry.js +3 -3
  16. package/dist/cjs/bn-chart-scatter.cjs.entry.js +3 -3
  17. package/dist/cjs/bn-grid.cjs.entry.js +1 -1
  18. package/dist/cjs/bn-image.cjs.entry.js +1 -1
  19. package/dist/cjs/bn-template-engine.cjs.js +1 -1
  20. package/dist/cjs/bn-text.cjs.entry.js +2 -2
  21. package/dist/cjs/bn-tree.cjs.entry.js +1 -1
  22. package/dist/cjs/{layoutObserver-DUYYkDMQ.js → layoutObserver-D8leSb4j.js} +1 -1
  23. package/dist/cjs/loader.cjs.js +1 -1
  24. package/dist/cjs/{scaling-BIJQ2NV1.js → scaling-B6_M_HWH.js} +82 -0
  25. package/dist/cjs/{withStyled-Cm9dWQhu.js → withStyled-DuwvaDMp.js} +3 -3
  26. package/dist/collection/components/bn-chart-bubble/bn-chart-bubble.js +15 -5
  27. package/dist/collection/components/bn-chart-structure/bn-chart-structure.js +81 -39
  28. package/dist/collection/components/bn-chart-structure/ibcs-chart-structure.js +34 -0
  29. package/dist/collection/components/bn-chart-time/bn-chart-time.js +80 -35
  30. package/dist/collection/components/bn-chart-time/ibcs-chart-time.js +34 -0
  31. package/dist/collection/components/bn-scaling-group/bn-scaling-group.js +76 -19
  32. package/dist/collection/components/bn-table/bn-table.js +111 -45
  33. package/dist/collection/components/bn-table/ibcs-table.js +37 -2
  34. package/dist/collection/components/bn-table/utils/elements/CellBarChart.js +2 -2
  35. package/dist/collection/utils/dataAnalyzer.js +17 -8
  36. package/dist/collection/utils/scaling.js +79 -0
  37. package/dist/collection/utils/validate.js +3 -3
  38. package/dist/components/DataFormatDigits.js +1 -1
  39. package/dist/components/bn-chart-bubble.js +1 -1
  40. package/dist/components/bn-chart-bullet.js +1 -1
  41. package/dist/components/bn-chart-scatter.js +1 -1
  42. package/dist/components/bn-chart-structure.js +1 -1
  43. package/dist/components/bn-chart-time.js +1 -1
  44. package/dist/components/bn-grid.js +1 -1
  45. package/dist/components/bn-scaling-group.js +1 -1
  46. package/dist/components/bn-table.js +1 -1
  47. package/dist/components/bn-text.js +1 -1
  48. package/dist/components/bn-tree.js +1 -1
  49. package/dist/components/ibcs-chart-structure2.js +1 -1
  50. package/dist/components/ibcs-chart-time2.js +1 -1
  51. package/dist/components/ibcs-table2.js +1 -1
  52. package/dist/components/scaling.js +1 -0
  53. package/dist/components/validate.js +1 -1
  54. package/dist/components/withDataset.js +1 -1
  55. package/dist/components/withStyled.js +1 -1
  56. package/dist/esm/bn-asset_21.entry.js +369 -122
  57. package/dist/esm/bn-chart-bubble.entry.js +18 -8
  58. package/dist/esm/bn-chart-bullet.entry.js +3 -3
  59. package/dist/esm/bn-chart-scatter.entry.js +3 -3
  60. package/dist/esm/bn-grid.entry.js +1 -1
  61. package/dist/esm/bn-image.entry.js +1 -1
  62. package/dist/esm/bn-template-engine.js +1 -1
  63. package/dist/esm/bn-text.entry.js +2 -2
  64. package/dist/esm/bn-tree.entry.js +1 -1
  65. package/dist/esm/{layoutObserver-BJBEyhNf.js → layoutObserver-DtZb2vdM.js} +1 -1
  66. package/dist/esm/loader.js +1 -1
  67. package/dist/esm/{scaling-BGnpSN1j.js → scaling-Bw8XyrFq.js} +80 -1
  68. package/dist/esm/{withStyled-2l5Tx3cf.js → withStyled-41rsCSM1.js} +3 -3
  69. package/dist/types/components/bn-chart-bubble/bn-chart-bubble.d.ts +5 -2
  70. package/dist/types/components/bn-chart-structure/bn-chart-structure.d.ts +33 -16
  71. package/dist/types/components/bn-chart-structure/ibcs-chart-structure.d.ts +8 -0
  72. package/dist/types/components/bn-chart-time/bn-chart-time.d.ts +35 -18
  73. package/dist/types/components/bn-chart-time/ibcs-chart-time.d.ts +8 -0
  74. package/dist/types/components/bn-scaling-group/bn-scaling-group.d.ts +28 -8
  75. package/dist/types/components/bn-table/bn-table.d.ts +37 -17
  76. package/dist/types/components/bn-table/ibcs-table.d.ts +8 -0
  77. package/dist/types/components.d.ts +85 -51
  78. package/dist/types/utils/dataAnalyzer.d.ts +5 -1
  79. package/dist/types/utils/scaling.d.ts +63 -0
  80. package/dist/types/utils/validate.d.ts +2 -2
  81. package/package.json +1 -1
  82. package/readme.md +2 -0
  83. package/dist/bn-template-engine/p-C9i1Xsib.js +0 -1
  84. package/dist/bn-template-engine/p-b5274369.entry.js +0 -1
@@ -3,6 +3,7 @@ import { StructureChartStyle } from "./utils/model/styles/StructureChartStyle";
3
3
  import { Order } from "../../utils/model/Order";
4
4
  import { AggregationLevel } from "../../utils/constants";
5
5
  import { ParentDimensions } from "../../utils/parentDimensions";
6
+ import { AutoScalingReport } from "../../utils/scaling";
6
7
  import { DataFormatDigits } from "../../utils/model/DataFormatDigits";
7
8
  import { RuleSetConfig } from "../../stores/ruleSets";
8
9
  export declare class IbcsChartStructure {
@@ -17,6 +18,13 @@ export declare class IbcsChartStructure {
17
18
  hideCategories: boolean;
18
19
  pixelPerUnit: number;
19
20
  pixelPerPercentage: number;
21
+ /**
22
+ * Internal wrapper channel: called with the auto-fitted values (px for one
23
+ * data unit / px per 1.0 fraction) whenever one of them was auto-resolved, so
24
+ * the outer `bn-chart-structure` can surface them in its AUTO_* warnings.
25
+ * Not for end users.
26
+ */
27
+ reportAutoScaling?: (report: AutoScalingReport) => void;
20
28
  limit: number;
21
29
  styles: StructureChartStyle | undefined;
22
30
  i18n: Map<string, string>;
@@ -90,32 +90,34 @@ export declare class Chart {
90
90
  limit: number;
91
91
  validateLimit(newValue: number): void;
92
92
  /**
93
- * Controls vertical bar scaling (pixels per data unit).
93
+ * Data units displayed per 1 em of bar length (vertical bars) — map-scale
94
+ * semantics: a larger value means smaller bars.
94
95
  *
95
- * | Value | Behavior |
96
- * |----------------|-----------------------------------------------------------------|
97
- * | `"auto"` | Auto-fit bars to fill the available container height |
98
- * | not set / `""` | Same as auto, but emits `AUTO_unitScaling` warning |
99
- * | `"0.03"`, `1` | Explicit pixels-per-unit value; bars scale proportionally |
100
- * | group name | References a `<bn-scaling-group>` for synchronized scaling |
96
+ * | Value | Behavior |
97
+ * |--------------------|-------------------------------------------------------------|
98
+ * | `"auto"` | Auto-fit bars to fill the available container height |
99
+ * | not set / invalid | Same as auto, but emits `AUTO_unitScaling` warning |
100
+ * | `"250000"`, `"1M"` | Units per em; optional SI suffix `k`/`K`/`M`/`G`/`T` |
101
+ * | group name | References a `<bn-scaling-group>` for synchronized scaling |
101
102
  *
102
103
  * @example unit-scaling="auto"
103
- * @example unit-scaling="0.05"
104
+ * @example unit-scaling="1M"
104
105
  * @example unit-scaling="revenue-scale"
105
106
  */
106
107
  unitScaling: string | number;
107
108
  validateUnitScaling(newValue: string | number): void;
108
109
  /**
109
- * Pixels per percentage point for relative variance bars/pins.
110
+ * Percentage points displayed per 1 em of pin/bar length for relative
111
+ * variances — a larger value means shorter pins.
110
112
  *
111
- * | Value | Behavior |
112
- * |----------------|---------------------------------------------------------------|
113
- * | `"auto"` | Auto-fit to available height (same two-pass as unit-scaling) |
114
- * | not set / `""` | Same as auto with `AUTO_percentageScaling` warning |
115
- * | `"50"`, `1.5` | Explicit pixels-per-percentage-point value |
116
- * | group name | References a `<bn-scaling-group>` for synchronized scaling |
113
+ * | Value | Behavior |
114
+ * |-------------------|---------------------------------------------------------------|
115
+ * | `"auto"` | Auto-fit to available height (same two-pass as unit-scaling) |
116
+ * | not set / invalid | Same as auto with `AUTO_percentageScaling` warning |
117
+ * | `"10"`, `"2.5"` | Percentage points per em; optional SI suffix `k`/`K`/`M`/`G`/`T` |
118
+ * | group name | References a `<bn-scaling-group>` for synchronized scaling |
117
119
  *
118
- * @example percentage-scaling="50"
120
+ * @example percentage-scaling="10"
119
121
  * @example percentage-scaling="pct-scale"
120
122
  */
121
123
  percentageScaling: string | number;
@@ -263,7 +265,7 @@ export declare class Chart {
263
265
  * original value.
264
266
  * <br /><br />
265
267
  * values: <br />
266
- * ```_ // k // M // G // T // P // E // Z // Y // m // μ // n // p // P // f // a // z // y // GREATEST // LEAST```
268
+ * ```_ // k // M // G // T // P // E // Z // Y // m // my (μ) // n // p // f // a // z // y // GREATEST // LEAST```
267
269
  * <br /><br />
268
270
  * SiPrefix overview:
269
271
  * ``` "Y": 1E+24,```<br />
@@ -276,7 +278,7 @@ export declare class Chart {
276
278
  * ``` "k": 1000,```<br />
277
279
  * <br />
278
280
  * ``` "m": 0.001,```<br />
279
- * ``` "μ": 0.000001,```<br />
281
+ * ``` "my" (μ): 0.000001,```<br />
280
282
  * ``` "n": 0.000000001,```<br />
281
283
  * ``` "p": 0.000000000001,```<br />
282
284
  * ``` "f": 0.000000000000001,```<br />
@@ -339,8 +341,21 @@ export declare class Chart {
339
341
  private prepareVariances;
340
342
  private prepareHideAxisLabels;
341
343
  private prepareI18n;
344
+ private autoUnitWarningActive;
345
+ private autoPctWarningActive;
346
+ private lastReportedUnitsPerEm?;
347
+ private lastReportedPpPerEm?;
348
+ /** "not set" for blank input, `invalid value "x"` otherwise — for AUTO_* messages. */
349
+ private static describeScalingInput;
342
350
  private preparePixelPerUnit;
343
351
  private preparePixelPerPercentage;
352
+ /**
353
+ * Receives the auto-fitted values from the inner ibcs-chart-time (px per
354
+ * unit / px per 1.0 fraction) and surfaces them in the AUTO_* warnings,
355
+ * converted back to the attribute's units-per-em form so users can copy
356
+ * them into a bn-scaling-group.
357
+ */
358
+ private handleAutoScalingReport;
344
359
  private prepareLevel;
345
360
  private prepareOrder;
346
361
  private prepareStyle;
@@ -361,6 +376,8 @@ export declare class Chart {
361
376
  private prepareMaxBars;
362
377
  chartTemplate(localScenarioString: string, idx: number): any;
363
378
  private getEffectiveScaleFactor;
379
+ /** Effective font size in px: base font from the style store × effective scale factor. */
380
+ private getEffectiveFontPx;
364
381
  private getFontStyles;
365
382
  render(): any;
366
383
  }
@@ -3,6 +3,7 @@ import { TimeChartStyle } from "./utils/model/styles/TimeChartStyle";
3
3
  import { DateDistance } from "../../utils/DateStringFactory";
4
4
  import { AggregationLevel, AxisLabelsMode, ChartMode } from "../../utils/constants";
5
5
  import { ParentDimensions } from "../../utils/parentDimensions";
6
+ import { AutoScalingReport } from "../../utils/scaling";
6
7
  import { RuleSetConfig } from "../../stores/ruleSets";
7
8
  import { DataFormatDigits } from "../../utils/model/DataFormatDigits";
8
9
  import { Order } from "../../utils/model/Order";
@@ -18,6 +19,13 @@ export declare class IbcsChartTime {
18
19
  hideAxisLabels: boolean;
19
20
  pixelPerUnit: number;
20
21
  pixelPerPercentage: number;
22
+ /**
23
+ * Internal wrapper channel: called with the auto-fitted values (px for one
24
+ * data unit / px per 1.0 fraction) whenever one of them was auto-resolved, so
25
+ * the outer `bn-chart-time` can surface them in its AUTO_* warnings.
26
+ * Not for end users.
27
+ */
28
+ reportAutoScaling?: (report: AutoScalingReport) => void;
21
29
  limit: number;
22
30
  leftSideOffsetForHorizontalSync: number;
23
31
  styles: TimeChartStyle | undefined;
@@ -1,14 +1,16 @@
1
1
  /**
2
2
  * Defines a named scaling value that chart and table components can reference
3
- * via their `unit-scaling` or `percentage-scaling` attributes.
3
+ * via their `unit-scaling` or `percentage-scaling` attributes, or a bubble
4
+ * chart via its `size` spec's `group` key.
4
5
  *
5
6
  * Multiple components sharing the same group name will use the same scaling
6
7
  * value, allowing synchronized scaling across an entire page or section.
7
8
  *
8
- * The reserved name `"auto"` is not allowed and will be ignored with a warning.
9
+ * The reserved name `"auto"` is not allowed, and neither is a name that would
10
+ * parse as a number/SI value (e.g. `"1M"`); both are rejected with a warning.
9
11
  *
10
12
  * @example
11
- * <bn-scaling-group name="revenue" value="0.05"></bn-scaling-group>
13
+ * <bn-scaling-group name="revenue" value="250k"></bn-scaling-group>
12
14
  * <bn-chart-structure unit-scaling="revenue" ...></bn-chart-structure>
13
15
  * <bn-table unit-scaling="revenue" ...></bn-table>
14
16
  */
@@ -16,22 +18,40 @@ export declare class ScalingGroup {
16
18
  private element;
17
19
  /**
18
20
  * Unique name identifying this scaling group.
19
- * Components reference this name in their `unit-scaling` or `percentage-scaling` attributes.
21
+ * Components reference this name in their `unit-scaling` or `percentage-scaling`
22
+ * attributes, or in a bubble chart's `size.group`.
20
23
  *
21
- * The name `"auto"` is reserved and cannot be used.
24
+ * The name `"auto"` is reserved, and names that parse as a number/SI value
25
+ * (`"100"`, `"1M"`) are rejected — they would be ambiguous with a literal
26
+ * scaling value.
22
27
  */
23
28
  name: string;
24
29
  /**
25
- * The scaling value (pixels per data unit or pixels per percentage point,
26
- * depending on which attribute references this group).
30
+ * The scaling value: a positive number with optional SI suffix
31
+ * (`k`/`K` = 1e3, `M` = 1e6, `G` = 1e9, `T` = 1e12), e.g. `"250k"` or `2.5`.
32
+ *
33
+ * The unit depends on which attribute references this group:
34
+ * - from `unit-scaling`: data units per 1 em of bar length
35
+ * - from `percentage-scaling`: percentage points per 1 em of pin length
36
+ * - from a bubble chart's `size.group`: data units per 1 em² of bubble area
27
37
  */
28
- value: number;
38
+ value: string | number;
29
39
  private readonly errors;
30
40
  private stores;
41
+ /** Name/value of the store entry this element last wrote (ownership tracking). */
42
+ private storedName?;
43
+ private storedValue?;
31
44
  constructor();
32
45
  connectedCallback(): void;
46
+ disconnectedCallback(): void;
33
47
  onNameChange(newName: string, oldName: string): void;
34
48
  onValueChange(): void;
49
+ /**
50
+ * Removes the store entry for `name` — but only if it still holds the value
51
+ * this element wrote (another bn-scaling-group with the same name may have
52
+ * overwritten it).
53
+ */
54
+ private removeEntryIfOurs;
35
55
  private pushToStore;
36
56
  render(): any;
37
57
  }
@@ -163,29 +163,38 @@ export declare class Table {
163
163
  barColumnWidth: string;
164
164
  validateBarColumnWidth(newValue: string): void;
165
165
  /**
166
- * Pixels per unit for absolute variance bar charts (ΔPY).
167
- * Controls bar width: barWidth = value × unitScaling.
166
+ * Data units displayed per 1 em of bar length for absolute variance bar
167
+ * charts (ΔPY) — map-scale semantics: a larger value means smaller bars.
168
168
  * Bars exceeding barColumnWidth are shown with an arrow indicator.
169
- * <br /><br />
170
- * Accepts a number, `"auto"`, or a `<bn-scaling-group>` name for synchronized scaling.
171
- * <br /><br />
172
- * Default: 0.01
173
169
  *
174
- * @example unit-scaling="0.01"
170
+ * | Value | Behavior |
171
+ * |------------------|----------------------------------------------------------------|
172
+ * | `"auto"` | Auto-fit the largest bar to the bar column width |
173
+ * | `"250000"`, `"1M"` | Units per em; optional SI suffix `k`/`K`/`M`/`G`/`T` |
174
+ * | group name | References a `<bn-scaling-group>` for synchronized scaling |
175
+ * | invalid / unknown | Auto-fit + `AUTO_unitScaling` warning |
176
+ *
177
+ * Default: `"100"` (1 em of bar represents 100 units)
178
+ *
179
+ * @example unit-scaling="1M"
175
180
  * @example unit-scaling="revenue-scale"
176
181
  */
177
182
  unitScaling: string | number;
178
183
  validateUnitScaling(newValue: string | number): void;
179
184
  /**
180
- * Scaling for relative variance pin charts (ΔPY%).
181
- * <br /><br />
182
- * Accepts a number, `"auto"`, or a `<bn-scaling-group>` name for synchronized scaling.
183
- * <br /><br />
184
- * Example: 0.5 means 100% = 50 pixels width.
185
- * <br /><br />
186
- * Default: 0.5
185
+ * Percentage points displayed per 1 em of pin length for relative variance
186
+ * pin charts (ΔPY%) — a larger value means shorter pins.
187
+ *
188
+ * | Value | Behavior |
189
+ * |------------------|----------------------------------------------------------------|
190
+ * | `"auto"` | Auto-fit the largest pin to the pin area |
191
+ * | `"10"`, `"2.5"` | Percentage points per em; optional SI suffix `k`/`K`/`M`/`G`/`T` |
192
+ * | group name | References a `<bn-scaling-group>` for synchronized scaling |
193
+ * | invalid / unknown | Auto-fit + `AUTO_percentageScaling` warning |
194
+ *
195
+ * Default: `"2"` (a +2 % variance pin is 1 em long)
187
196
  *
188
- * @example percentage-scaling="0.5"
197
+ * @example percentage-scaling="10"
189
198
  * @example percentage-scaling="pct-scale"
190
199
  */
191
200
  percentageScaling: string | number;
@@ -313,7 +322,7 @@ export declare class Table {
313
322
  * original value.
314
323
  * <br /><br />
315
324
  * values: <br />
316
- * ```_ // k // M // G // T // P // E // Z // Y // m // μ // n // p // P // f // a // z // y // GREATEST // LEAST```
325
+ * ```_ // k // M // G // T // P // E // Z // Y // m // my (μ) // n // p // f // a // z // y // GREATEST // LEAST```
317
326
  * <br /><br />
318
327
  * SiPrefix overview:
319
328
  * ``` "Y": 1E+24,```<br />
@@ -326,7 +335,7 @@ export declare class Table {
326
335
  * ``` "k": 1000,```<br />
327
336
  * <br />
328
337
  * ``` "m": 0.001,```<br />
329
- * ``` "μ": 0.000001,```<br />
338
+ * ``` "my" (μ): 0.000001,```<br />
330
339
  * ``` "n": 0.000000001,```<br />
331
340
  * ``` "p": 0.000000000001,```<br />
332
341
  * ``` "f": 0.000000000000001,```<br />
@@ -433,8 +442,19 @@ export declare class Table {
433
442
  private prepareFilter;
434
443
  private prepareBarColumnWidth;
435
444
  private prepareBarColumns;
445
+ private autoUnitWarningActive;
446
+ private autoPctWarningActive;
447
+ private lastReportedUnitsPerEm?;
448
+ private lastReportedPpPerEm?;
436
449
  private prepareUnitScaling;
437
450
  private preparePercentageScaling;
451
+ /**
452
+ * Receives the auto-fitted scaling values from the inner ibcs-table
453
+ * (em per unit / em per percentage point) and surfaces them in the AUTO_*
454
+ * warnings, converted back to the attribute's units-per-em form so users
455
+ * can copy them into a bn-scaling-group.
456
+ */
457
+ private handleAutoScalingReport;
438
458
  getDataStructure(): any;
439
459
  private getEffectiveScaleFactor;
440
460
  private getFontStyles;
@@ -5,6 +5,7 @@ import { DataFormat, I18nMode, MeasureType, TableCategoryWidth } from "../../uti
5
5
  import { RuleSetConfig } from "../../stores/ruleSets";
6
6
  import { DataFormatDigits } from "../../utils/model/DataFormatDigits";
7
7
  import { Order } from "../../utils/model/Order";
8
+ import { AutoScalingReport } from "../../utils/scaling";
8
9
  /**
9
10
  * Internal rendering engine for `bn-table`.
10
11
  *
@@ -64,6 +65,13 @@ export declare class IbcsTable {
64
65
  barColumnMaxWidth: number;
65
66
  unitScaling: number;
66
67
  percentageScaling: number;
68
+ /**
69
+ * Internal wrapper channel: called with the auto-fitted scaling values
70
+ * (em per unit / em per percentage point) whenever one of them was
71
+ * auto-resolved, so the outer `bn-table` can surface them in its AUTO_*
72
+ * warnings. Not for end users.
73
+ */
74
+ reportAutoScaling?: (report: AutoScalingReport) => void;
67
75
  scaleFactor: number;
68
76
  private table;
69
77
  private componentDataFormatDigits;