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

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 (164) hide show
  1. package/dist/bn-template-engine/bn-template-engine.esm.js +1 -1
  2. package/dist/bn-template-engine/{p-28d5c266.entry.js → p-0a49cf00.entry.js} +1 -1
  3. package/dist/bn-template-engine/{p-b9e94127.entry.js → p-22b8d044.entry.js} +1 -1
  4. package/dist/bn-template-engine/{p-6c7f0076.entry.js → p-251bb53d.entry.js} +1 -1
  5. package/dist/bn-template-engine/p-2aed639e.entry.js +1 -0
  6. package/dist/bn-template-engine/{p-7e9dbc93.entry.js → p-4616b879.entry.js} +1 -1
  7. package/dist/bn-template-engine/{p-99477a27.entry.js → p-629edcca.entry.js} +1 -1
  8. package/dist/bn-template-engine/p-686d8e44.entry.js +1 -0
  9. package/dist/bn-template-engine/{p-a4ea9a79.entry.js → p-68aa61cc.entry.js} +1 -1
  10. package/dist/bn-template-engine/{p-DwYUTvvI.js → p-B5x8M8OC.js} +1 -1
  11. package/dist/bn-template-engine/{p-fFtEvsY-.js → p-BGrnfif3.js} +1 -1
  12. package/dist/bn-template-engine/{p-6lOdN-fB.js → p-BVfLus3u.js} +1 -1
  13. package/dist/bn-template-engine/{p-CJThzFZm.js → p-BcZ5GQZ8.js} +1 -1
  14. package/dist/bn-template-engine/{p-CYE0I1Mx.js → p-Bca5V28_.js} +1 -1
  15. package/dist/bn-template-engine/p-C5UYpZUU.js +2 -0
  16. package/dist/bn-template-engine/{p-BgIpdpfH.js → p-C7T4DAAW.js} +1 -1
  17. package/dist/bn-template-engine/p-CDo04UEU.js +1 -0
  18. package/dist/bn-template-engine/p-CTrNbSXN.js +1 -0
  19. package/dist/bn-template-engine/{p-C5uvAEKI.js → p-CbciPY-M.js} +1 -1
  20. package/dist/bn-template-engine/{p-BpWWgN6k.js → p-CuR4S456.js} +1 -1
  21. package/dist/bn-template-engine/p-DWtTjg0f.js +1 -0
  22. package/dist/bn-template-engine/{p-eEfqksk-.js → p-DdqXNsKP.js} +1 -1
  23. package/dist/bn-template-engine/{p-B4JfKvVT.js → p-DtLI_CzV.js} +1 -1
  24. package/dist/bn-template-engine/p-UtNHLX1j.js +1 -0
  25. package/dist/bn-template-engine/{p-ba912130.entry.js → p-aecb5de3.entry.js} +1 -1
  26. package/dist/bn-template-engine/{p-687032d5.entry.js → p-ba43d46e.entry.js} +1 -1
  27. package/dist/bn-template-engine/{p-6077155f.entry.js → p-c476e7bb.entry.js} +1 -1
  28. package/dist/bn-template-engine/{p-2d3ea756.entry.js → p-d7c670ec.entry.js} +1 -1
  29. package/dist/bn-template-engine/{p-a1380d7c.entry.js → p-e4a584a8.entry.js} +1 -1
  30. package/dist/bn-template-engine/{p-de29986f.entry.js → p-f12fb09b.entry.js} +1 -1
  31. package/dist/bn-template-engine/p-f9a721bb.entry.js +1 -0
  32. package/dist/cjs/{AxisConfig-D7CAyPLO.js → AxisConfig-DmP4U3JM.js} +1 -1
  33. package/dist/cjs/{LabelCollisionManager-DkdQ9Xdg.js → LabelCollisionManager-Cet3WPm0.js} +2 -2
  34. package/dist/cjs/{Order-IPfAP0q8.js → Order-DlKLywO_.js} +1 -1
  35. package/dist/cjs/{SVGStyle-BD8jApd4.js → SVGStyle-D78RaNnj.js} +2 -2
  36. package/dist/cjs/{SVGVariancesStyleGroup-BaWzR951.js → SVGVariancesStyleGroup-XvNAnYYA.js} +1 -1
  37. package/dist/cjs/{VarianceMeasure-BBWTgv2e.js → VarianceMeasure-BfZLlICl.js} +4 -4
  38. package/dist/cjs/{XYChartDataRow-BoR0CTfl.js → XYChartDataRow-B0NNOqxB.js} +4 -4
  39. package/dist/cjs/bn-asset_21.cjs.entry.js +1052 -314
  40. package/dist/cjs/bn-chart-bubble.cjs.entry.js +25 -15
  41. package/dist/cjs/bn-chart-bullet.cjs.entry.js +9 -9
  42. package/dist/cjs/bn-chart-scatter.cjs.entry.js +9 -9
  43. package/dist/cjs/bn-grid.cjs.entry.js +6 -6
  44. package/dist/cjs/bn-image.cjs.entry.js +6 -6
  45. package/dist/cjs/bn-internationalization.cjs.entry.js +4 -4
  46. package/dist/cjs/bn-ruleset.cjs.entry.js +4 -4
  47. package/dist/cjs/bn-template-engine.cjs.js +3 -3
  48. package/dist/cjs/bn-template.cjs.entry.js +2 -2
  49. package/dist/cjs/bn-text.cjs.entry.js +7 -7
  50. package/dist/cjs/bn-tree.cjs.entry.js +6 -6
  51. package/dist/cjs/{context-protocol-BBhT9B52.js → context-protocol-DeLmu5s2.js} +1 -1
  52. package/dist/cjs/editor-companion.cjs.entry.js +2 -2
  53. package/dist/cjs/ibcs-chart-bubble.cjs.entry.js +6 -6
  54. package/dist/cjs/ibcs-chart-bullet.cjs.entry.js +6 -6
  55. package/dist/cjs/ibcs-chart-scatter.cjs.entry.js +6 -6
  56. package/dist/cjs/{index-CDKG4xmO.js → index-C1Z9vO7z.js} +61 -19
  57. package/dist/cjs/{layoutObserver-DUYYkDMQ.js → layoutObserver-CrzQQGpv.js} +5 -5
  58. package/dist/cjs/loader.cjs.js +2 -2
  59. package/dist/cjs/{scaling-BIJQ2NV1.js → scaling-JAU6IJnR.js} +85 -3
  60. package/dist/cjs/{withBodyObserver-BKUE_ypL.js → withBodyObserver-DJO98AJ-.js} +2 -2
  61. package/dist/cjs/{withHasError-Cl2gTQzA.js → withHasError-BdDmiOXM.js} +1 -1
  62. package/dist/cjs/{withScalingGroup-D5clRvRe.js → withScalingGroup-Bu5gatHT.js} +3 -3
  63. package/dist/cjs/{withStyled-Cm9dWQhu.js → withStyled-50UepUwV.js} +8 -8
  64. package/dist/collection/collection-manifest.json +1 -1
  65. package/dist/collection/components/bn-chart-bubble/bn-chart-bubble.js +15 -5
  66. package/dist/collection/components/bn-chart-structure/bn-chart-structure.css +6 -0
  67. package/dist/collection/components/bn-chart-structure/bn-chart-structure.js +149 -57
  68. package/dist/collection/components/bn-chart-structure/ibcs-chart-structure.js +135 -28
  69. package/dist/collection/components/bn-chart-structure/utils/StructureChart.js +30 -19
  70. package/dist/collection/components/bn-chart-time/bn-chart-time.js +186 -49
  71. package/dist/collection/components/bn-chart-time/ibcs-chart-time.css +9 -3
  72. package/dist/collection/components/bn-chart-time/ibcs-chart-time.js +141 -22
  73. package/dist/collection/components/bn-chart-time/utils/TimeChart.js +36 -0
  74. package/dist/collection/components/bn-scaling-group/bn-scaling-group.js +76 -19
  75. package/dist/collection/components/bn-table/bn-table.js +121 -49
  76. package/dist/collection/components/bn-table/ibcs-table.js +83 -42
  77. package/dist/collection/components/bn-table/utils/elements/CellBarChart.js +20 -34
  78. package/dist/collection/components/bn-table/utils/elements/WaterfallBar.js +4 -5
  79. package/dist/collection/components/bn-table/utils/helper/barColumnGeometry.js +89 -0
  80. package/dist/collection/utils/autoFit.js +63 -0
  81. package/dist/collection/utils/constants.js +3 -3
  82. package/dist/collection/utils/dataAnalyzer.js +17 -8
  83. package/dist/collection/utils/scaling.js +79 -0
  84. package/dist/collection/utils/validate.js +3 -3
  85. package/dist/components/DataFormatDigits.js +1 -1
  86. package/dist/components/autoFit.js +1 -0
  87. package/dist/components/bn-chart-bubble.js +1 -1
  88. package/dist/components/bn-chart-bullet.js +1 -1
  89. package/dist/components/bn-chart-scatter.js +1 -1
  90. package/dist/components/bn-chart-structure.js +1 -1
  91. package/dist/components/bn-chart-time.js +1 -1
  92. package/dist/components/bn-grid.js +1 -1
  93. package/dist/components/bn-scaling-group.js +1 -1
  94. package/dist/components/bn-table.js +1 -1
  95. package/dist/components/bn-text.js +1 -1
  96. package/dist/components/bn-tree.js +1 -1
  97. package/dist/components/ibcs-chart-structure2.js +1 -1
  98. package/dist/components/ibcs-chart-time2.js +1 -1
  99. package/dist/components/ibcs-table2.js +1 -1
  100. package/dist/components/scaling.js +1 -0
  101. package/dist/components/validate.js +1 -1
  102. package/dist/components/withDataset.js +1 -1
  103. package/dist/components/withStyled.js +1 -1
  104. package/dist/esm/{AxisConfig-ByIP5J-9.js → AxisConfig-Cjy_RANi.js} +1 -1
  105. package/dist/esm/{LabelCollisionManager-DaNiDiM9.js → LabelCollisionManager-B_NUM9yq.js} +2 -2
  106. package/dist/esm/{Order-BQeJE_yi.js → Order-B-aF6Rwn.js} +1 -1
  107. package/dist/esm/{SVGStyle-BwBlY3Km.js → SVGStyle-8FfAtUF-.js} +2 -2
  108. package/dist/esm/{SVGVariancesStyleGroup-BpGW4CvN.js → SVGVariancesStyleGroup-DD4mIOjT.js} +1 -1
  109. package/dist/esm/{VarianceMeasure-CE3N8Bea.js → VarianceMeasure-DLOuIIJ7.js} +4 -4
  110. package/dist/esm/{XYChartDataRow-DeMI1JKU.js → XYChartDataRow-CKfILBFG.js} +4 -4
  111. package/dist/esm/bn-asset_21.entry.js +1052 -314
  112. package/dist/esm/bn-chart-bubble.entry.js +25 -15
  113. package/dist/esm/bn-chart-bullet.entry.js +9 -9
  114. package/dist/esm/bn-chart-scatter.entry.js +9 -9
  115. package/dist/esm/bn-grid.entry.js +6 -6
  116. package/dist/esm/bn-image.entry.js +6 -6
  117. package/dist/esm/bn-internationalization.entry.js +4 -4
  118. package/dist/esm/bn-ruleset.entry.js +4 -4
  119. package/dist/esm/bn-template-engine.js +4 -4
  120. package/dist/esm/bn-template.entry.js +2 -2
  121. package/dist/esm/bn-text.entry.js +7 -7
  122. package/dist/esm/bn-tree.entry.js +6 -6
  123. package/dist/esm/{context-protocol-d8MHrEo8.js → context-protocol-BoEL0caI.js} +1 -1
  124. package/dist/esm/editor-companion.entry.js +2 -2
  125. package/dist/esm/ibcs-chart-bubble.entry.js +6 -6
  126. package/dist/esm/ibcs-chart-bullet.entry.js +6 -6
  127. package/dist/esm/ibcs-chart-scatter.entry.js +6 -6
  128. package/dist/esm/{index-B_d-jp99.js → index-C5UYpZUU.js} +61 -19
  129. package/dist/esm/{layoutObserver-BJBEyhNf.js → layoutObserver-cgIXg2sg.js} +5 -5
  130. package/dist/esm/loader.js +3 -3
  131. package/dist/esm/{scaling-BGnpSN1j.js → scaling-CxyNpMQM.js} +83 -4
  132. package/dist/esm/{withBodyObserver-IokS6fHD.js → withBodyObserver-Cb9ZC5_J.js} +2 -2
  133. package/dist/esm/{withHasError-DW_vMDUp.js → withHasError-Bh1Viz52.js} +1 -1
  134. package/dist/esm/{withScalingGroup-CC3UcvC5.js → withScalingGroup-Yv9nGGe1.js} +3 -3
  135. package/dist/esm/{withStyled-2l5Tx3cf.js → withStyled-By9Jd-Oy.js} +8 -8
  136. package/dist/types/components/bn-chart-bubble/bn-chart-bubble.d.ts +5 -2
  137. package/dist/types/components/bn-chart-structure/bn-chart-structure.d.ts +47 -19
  138. package/dist/types/components/bn-chart-structure/ibcs-chart-structure.d.ts +17 -3
  139. package/dist/types/components/bn-chart-structure/utils/StructureChart.d.ts +11 -3
  140. package/dist/types/components/bn-chart-time/bn-chart-time.d.ts +52 -18
  141. package/dist/types/components/bn-chart-time/ibcs-chart-time.d.ts +18 -3
  142. package/dist/types/components/bn-chart-time/utils/TimeChart.d.ts +12 -0
  143. package/dist/types/components/bn-scaling-group/bn-scaling-group.d.ts +28 -8
  144. package/dist/types/components/bn-table/bn-table.d.ts +45 -19
  145. package/dist/types/components/bn-table/ibcs-table.d.ts +23 -6
  146. package/dist/types/components/bn-table/utils/elements/CellBarChart.d.ts +9 -1
  147. package/dist/types/components/bn-table/utils/helper/barColumnGeometry.d.ts +51 -0
  148. package/dist/types/components.d.ts +91 -55
  149. package/dist/types/stencil-public-runtime.d.ts +1 -0
  150. package/dist/types/utils/autoFit.d.ts +79 -0
  151. package/dist/types/utils/constants.d.ts +3 -3
  152. package/dist/types/utils/dataAnalyzer.d.ts +5 -1
  153. package/dist/types/utils/scaling.d.ts +63 -0
  154. package/dist/types/utils/validate.d.ts +2 -2
  155. package/package.json +1 -1
  156. package/readme.md +2 -0
  157. package/dist/bn-template-engine/p-2fba7c99.entry.js +0 -1
  158. package/dist/bn-template-engine/p-A8xyE4b1.js +0 -1
  159. package/dist/bn-template-engine/p-B_d-jp99.js +0 -2
  160. package/dist/bn-template-engine/p-BjBz5cSL.js +0 -1
  161. package/dist/bn-template-engine/p-C8Q0lsaU.js +0 -1
  162. package/dist/bn-template-engine/p-C9i1Xsib.js +0 -1
  163. package/dist/bn-template-engine/p-a8291de2.entry.js +0 -1
  164. package/dist/bn-template-engine/p-b5274369.entry.js +0 -1
@@ -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;
@@ -52,9 +60,16 @@ export declare class IbcsChartTime {
52
60
  componentWillLoad(): Promise<void>;
53
61
  componentWillUpdate(): Promise<void>;
54
62
  /**
55
- * Two-pass auto-fit for pixelPerUnit and/or pixelPerPercentage.
56
- * When either is 0 (auto mode), renders a measurement pass at 1,
57
- * computes the ratio to fit ~90% of the available height, and rebuilds.
63
+ * Auto-fit for pixelPerUnit and/or pixelPerPercentage (0 = auto mode).
64
+ * Time charts grow vertically, so we fit to height.
65
+ *
66
+ * The chart height is affine in the pixel scales (height = fixed labels +
67
+ * column extent × scale), but label allocations shift between passes, so a
68
+ * single analytic solve is not enough: measure at 1, solve, then verify
69
+ * against fresh measurements and re-solve until the chart fits. The loop
70
+ * never ends on an overshoot — the last fitting values are restored, or
71
+ * when even the minimum scale cannot fit (labels alone exceed the
72
+ * container) the values are floored and the wrapper reports the overflow.
58
73
  * Explicit (> 0) values are never overridden.
59
74
  */
60
75
  private autoFitScaling;
@@ -105,6 +105,18 @@ export declare class TimeChart {
105
105
  setSource(filter: string): void;
106
106
  getAllocatedCanvasWidth(): number;
107
107
  getAllocatedCanvasHeight(): number;
108
+ /**
109
+ * Total column extent (data units) proportional to pixelPerUnit, covering
110
+ * both sides of the axis (negative columns extend below it). Mirrors the
111
+ * DataPoints getAllocatedCanvasHeight allocates with; used by autoFitScaling
112
+ * to separate fixed from variable height components.
113
+ */
114
+ getUnitBarExtent(): number;
115
+ /**
116
+ * Total column extent (fraction units) proportional to pixelPerPercentage.
117
+ * Only relative variances scale with it; each side clamps at +/-145%.
118
+ */
119
+ getPercentBarExtent(): number;
108
120
  toString(): string;
109
121
  draw(svgContainer: Svg): void;
110
122
  private determineEffectiveChartMode;
@@ -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
  }
@@ -155,7 +155,10 @@ export declare class Table {
155
155
  readonly barColumns: string;
156
156
  validateBarColumns(newValue: string): void;
157
157
  /**
158
- * Set width of bar chart columns. Controls the max bar/pin width in pixels.
158
+ * Set the total width of bar chart columns, in em of the table font — the same
159
+ * unit and vocabulary as ```categoryWidth```, so ```bar-column-width="w15"```
160
+ * renders exactly as wide as ```category-width="w15"```. The bar/pin drawing
161
+ * area is that width minus the value-label gutters.
159
162
  * <br /><br />
160
163
  * values:<br />
161
164
  * ``` w5 // w10 // w15 // w20 // w25 // w30 // w40 // w60 // w80 // w100 ```
@@ -163,29 +166,38 @@ export declare class Table {
163
166
  barColumnWidth: string;
164
167
  validateBarColumnWidth(newValue: string): void;
165
168
  /**
166
- * Pixels per unit for absolute variance bar charts (ΔPY).
167
- * Controls bar width: barWidth = value × unitScaling.
169
+ * Data units displayed per 1 em of bar length for absolute variance bar
170
+ * charts (ΔPY) — map-scale semantics: a larger value means smaller bars.
168
171
  * 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
172
  *
174
- * @example unit-scaling="0.01"
173
+ * | Value | Behavior |
174
+ * |------------------|----------------------------------------------------------------|
175
+ * | `"auto"` | Auto-fit the largest bar to the bar column width |
176
+ * | `"250000"`, `"1M"` | Units per em; optional SI suffix `k`/`K`/`M`/`G`/`T` |
177
+ * | group name | References a `<bn-scaling-group>` for synchronized scaling |
178
+ * | invalid / unknown | Auto-fit + `AUTO_unitScaling` warning |
179
+ *
180
+ * Default: `"100"` (1 em of bar represents 100 units)
181
+ *
182
+ * @example unit-scaling="1M"
175
183
  * @example unit-scaling="revenue-scale"
176
184
  */
177
185
  unitScaling: string | number;
178
186
  validateUnitScaling(newValue: string | number): void;
179
187
  /**
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
188
+ * Percentage points displayed per 1 em of pin length for relative variance
189
+ * pin charts (ΔPY%) — a larger value means shorter pins.
190
+ *
191
+ * | Value | Behavior |
192
+ * |------------------|----------------------------------------------------------------|
193
+ * | `"auto"` | Auto-fit the largest pin to the pin area |
194
+ * | `"10"`, `"2.5"` | Percentage points per em; optional SI suffix `k`/`K`/`M`/`G`/`T` |
195
+ * | group name | References a `<bn-scaling-group>` for synchronized scaling |
196
+ * | invalid / unknown | Auto-fit + `AUTO_percentageScaling` warning |
197
+ *
198
+ * Default: `"2"` (a +2 % variance pin is 1 em long)
187
199
  *
188
- * @example percentage-scaling="0.5"
200
+ * @example percentage-scaling="10"
189
201
  * @example percentage-scaling="pct-scale"
190
202
  */
191
203
  percentageScaling: string | number;
@@ -313,7 +325,7 @@ export declare class Table {
313
325
  * original value.
314
326
  * <br /><br />
315
327
  * values: <br />
316
- * ```_ // k // M // G // T // P // E // Z // Y // m // μ // n // p // P // f // a // z // y // GREATEST // LEAST```
328
+ * ```_ // k // M // G // T // P // E // Z // Y // m // my (μ) // n // p // f // a // z // y // GREATEST // LEAST```
317
329
  * <br /><br />
318
330
  * SiPrefix overview:
319
331
  * ``` "Y": 1E+24,```<br />
@@ -326,7 +338,7 @@ export declare class Table {
326
338
  * ``` "k": 1000,```<br />
327
339
  * <br />
328
340
  * ``` "m": 0.001,```<br />
329
- * ``` "μ": 0.000001,```<br />
341
+ * ``` "my" (μ): 0.000001,```<br />
330
342
  * ``` "n": 0.000000001,```<br />
331
343
  * ``` "p": 0.000000000001,```<br />
332
344
  * ``` "f": 0.000000000000001,```<br />
@@ -355,10 +367,13 @@ export declare class Table {
355
367
  dataFormatDigitsPercent: number;
356
368
  validateDateFormatDigitsPercent(newValue: number): void;
357
369
  /**
358
- * Set width of category column. <br />
370
+ * Set width of category column, in em of the table font. <br />
359
371
  * If INF is selected the columns scaling to the min space they need
360
372
  * seperatly.
361
373
  * <br /><br />
374
+ * The column is fixed at this width; a category label too long to fit is
375
+ * truncated with an ellipsis.
376
+ * <br /><br />
362
377
  * values:<br />
363
378
  * ``` w5 // w10 // w15 // w20 // w25 // w50 // inf ```
364
379
  */
@@ -433,8 +448,19 @@ export declare class Table {
433
448
  private prepareFilter;
434
449
  private prepareBarColumnWidth;
435
450
  private prepareBarColumns;
451
+ private autoUnitWarningActive;
452
+ private autoPctWarningActive;
453
+ private lastReportedUnitsPerEm?;
454
+ private lastReportedPpPerEm?;
436
455
  private prepareUnitScaling;
437
456
  private preparePercentageScaling;
457
+ /**
458
+ * Receives the auto-fitted scaling values from the inner ibcs-table
459
+ * (em per unit / em per percentage point) and surfaces them in the AUTO_*
460
+ * warnings, converted back to the attribute's units-per-em form so users
461
+ * can copy them into a bn-scaling-group.
462
+ */
463
+ private handleAutoScalingReport;
438
464
  getDataStructure(): any;
439
465
  private getEffectiveScaleFactor;
440
466
  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
  *
@@ -61,9 +62,20 @@ export declare class IbcsTable {
61
62
  filter: string;
62
63
  barColumns: string[];
63
64
  interval: string;
65
+ /**
66
+ * Total width of a bar chart column, in em of the table font — the same unit
67
+ * `categoryWidth` uses, so the two render at the same width for the same value.
68
+ */
64
69
  barColumnMaxWidth: number;
65
70
  unitScaling: number;
66
71
  percentageScaling: number;
72
+ /**
73
+ * Internal wrapper channel: called with the auto-fitted scaling values
74
+ * (em per unit / em per percentage point) whenever one of them was
75
+ * auto-resolved, so the outer `bn-table` can surface them in its AUTO_*
76
+ * warnings. Not for end users.
77
+ */
78
+ reportAutoScaling?: (report: AutoScalingReport) => void;
67
79
  scaleFactor: number;
68
80
  private table;
69
81
  private componentDataFormatDigits;
@@ -80,9 +92,11 @@ export declare class IbcsTable {
80
92
  * Scenario styles (ac, pp, fc, pl) use barStyles for IBCS-compliant grayscale coloring.
81
93
  */
82
94
  private prepareBarChartStyles;
95
+ /** The table's true em in px — the unit `.category-wN` and the bar columns share. */
96
+ private emPx;
83
97
  /**
84
98
  * Auto-calculate unitScaling so the largest absolute variance bar
85
- * fills ~80% of the bar column width.
99
+ * fills ~80% of its side of the bar area, without tripping the overdrive break.
86
100
  */
87
101
  private autoUnitScaling;
88
102
  /**
@@ -91,12 +105,15 @@ export declare class IbcsTable {
91
105
  */
92
106
  private autoPercentageScaling;
93
107
  /**
94
- * Find the maximum absolute value across all absolute variance columns (d_*) in the table body.
108
+ * Maximum value and sign coverage across all absolute variance columns (d_*) in the table body.
109
+ * Sign coverage decides how much of the column the bar area gets (see barColumnGeometry.ts);
110
+ * OR-ing it across columns keeps the single shared scaling inside the narrowest bar area.
95
111
  */
96
- private getMaxAbsValue;
112
+ private getAbsBarColumnStats;
97
113
  /**
98
- * Find the maximum percentage value across all relative variance columns (dr_*) in the table body.
99
- * Values are stored as decimals (e.g. 0.2 = 20%), returned as percentage (20).
114
+ * Same for the relative variance columns (dr_*). Values are stored as decimals
115
+ * (e.g. 0.2 = 20%), returned as percentage (20).
100
116
  */
101
- private getMaxRelativeValue;
117
+ private getRelativeBarColumnStats;
118
+ private collectBarColumnStats;
102
119
  }
@@ -17,7 +17,14 @@ export interface CellBarChartStyles {
17
17
  neutral: VarianceStyle;
18
18
  scenarios: ScenarioStyles;
19
19
  fontColor: string;
20
+ /**
21
+ * SVG label font size in px — BAR_LABEL_FONT_RATIO × emPx. It is also the multiplier in
22
+ * the unitScaling / percentageScaling math below, so changing it rescales every user-set
23
+ * scaling value. Column geometry deliberately uses emPx instead.
24
+ */
20
25
  fontSize: number;
26
+ /** The table's true em in px (`global.fontSizePx` × scaleFactor) — column geometry only. */
27
+ emPx: number;
21
28
  fontFamily: string;
22
29
  unitScaling: number;
23
30
  percentageScaling: number;
@@ -32,7 +39,8 @@ export interface CellBarChartProps {
32
39
  isPositiveGood: boolean;
33
40
  formattedValue?: string;
34
41
  measureScale?: number;
35
- maxBarWidth?: number;
42
+ /** Total column width in table em — see barColumnGeometry.ts. */
43
+ columnWidthEm?: number;
36
44
  styles?: CellBarChartStyles;
37
45
  }
38
46
  export declare const DEFAULT_STYLES: CellBarChartStyles;
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Column geometry for the inline bar / pin / waterfall charts of bn-table.
3
+ *
4
+ * `bar-column-width="wN"` and `category-width="wN"` both mean "N em of the table font",
5
+ * so both columns render at the same width for the same N. The em used here is the TRUE
6
+ * table em (`--bn-font-size`, i.e. `global.fontSizePx × scaleFactor`) — deliberately NOT
7
+ * `CellBarChartStyles.fontSize`, which is 0.85 of it and doubles as the unitScaling /
8
+ * percentageScaling basis.
9
+ *
10
+ * Every quantity is returned in px so the SVG renderers stay in one coordinate space.
11
+ */
12
+ /**
13
+ * SVG label font size relative to the table em. Also the multiplier in the
14
+ * unitScaling / percentageScaling math, so changing it rescales every user-set value.
15
+ */
16
+ export declare const BAR_LABEL_FONT_RATIO = 0.85;
17
+ export interface AbsoluteBarGeometry {
18
+ /** SVG width — the cell's content box. */
19
+ totalWidth: number;
20
+ /** Width of one value-label gutter; one is drawn per side in use. */
21
+ labelAreaWidth: number;
22
+ /** Max bar extent on one side of the axis. */
23
+ maxBarWidth: number;
24
+ axisX: number;
25
+ breakGap: number;
26
+ overdriveZoneWidth: number;
27
+ /** Bar length above which the overdrive break kicks in. */
28
+ cutWidth: number;
29
+ /** Gap between the bar end and its value label. */
30
+ labelGap: number;
31
+ }
32
+ export declare function absoluteBarGeometry(widthEm: number, emPx: number, hasNeg: boolean, hasPos: boolean): AbsoluteBarGeometry;
33
+ export interface RelativePinGeometry {
34
+ totalWidth: number;
35
+ /** Single gutter, always on the right. */
36
+ labelAreaWidth: number;
37
+ /** Max pin extent on one side of the axis. */
38
+ maxPinLength: number;
39
+ pinPadding: number;
40
+ axisX: number;
41
+ labelX: number;
42
+ }
43
+ export declare function relativePinGeometry(widthEm: number, emPx: number, hasNeg: boolean, hasPos: boolean): RelativePinGeometry;
44
+ export interface WaterfallGeometry {
45
+ totalWidth: number;
46
+ /** One gutter on each side; a waterfall always spans its full range. */
47
+ labelAreaWidth: number;
48
+ barAreaWidth: number;
49
+ labelGap: number;
50
+ }
51
+ export declare function waterfallGeometry(widthEm: number, emPx: number): WaterfallGeometry;