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

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 (392) hide show
  1. package/LICENSE +203 -21
  2. package/dist/bn-template-engine/bn-template-engine.esm.js +1 -1
  3. package/dist/bn-template-engine/p-19bbac66.entry.js +1 -0
  4. package/dist/bn-template-engine/p-209351c9.entry.js +1 -0
  5. package/dist/bn-template-engine/p-22d0fb7a.entry.js +1 -0
  6. package/dist/bn-template-engine/p-2e6dc267.entry.js +1 -0
  7. package/dist/bn-template-engine/p-485d23d7.entry.js +1 -0
  8. package/dist/bn-template-engine/p-74c5a95d.entry.js +1 -0
  9. package/dist/bn-template-engine/p-7bdc0e28.entry.js +1 -0
  10. package/dist/bn-template-engine/p-83c71b16.entry.js +1 -0
  11. package/dist/bn-template-engine/p-90806e7a.entry.js +1 -0
  12. package/dist/bn-template-engine/p-9879c9b2.entry.js +1 -0
  13. package/dist/bn-template-engine/p-BA48JiHe.js +1 -0
  14. package/dist/bn-template-engine/p-BWKdb9ym.js +1 -0
  15. package/dist/bn-template-engine/p-BZV1b5VH.js +1 -0
  16. package/dist/bn-template-engine/p-Bdfxd_Ke.js +1 -0
  17. package/dist/bn-template-engine/p-BjBz5cSL.js +1 -0
  18. package/dist/bn-template-engine/p-BqhIhYr1.js +1 -0
  19. package/dist/bn-template-engine/p-C0Pwqx-O.js +1 -0
  20. package/dist/bn-template-engine/p-CiudZRQr.js +1 -0
  21. package/dist/bn-template-engine/p-DTuaq8Pj.js +1 -0
  22. package/dist/bn-template-engine/p-DY7YYmpa.js +1 -0
  23. package/dist/bn-template-engine/p-Dg9OcXAO.js +1 -0
  24. package/dist/bn-template-engine/p-DsTzlzxQ.js +1 -0
  25. package/dist/bn-template-engine/p-X6CxL6W-.js +1 -0
  26. package/dist/bn-template-engine/p-a8291de2.entry.js +1 -0
  27. package/dist/bn-template-engine/p-aakBGfzL.js +1 -0
  28. package/dist/bn-template-engine/p-b25455a7.entry.js +1 -0
  29. package/dist/bn-template-engine/p-e96da91f.entry.js +1 -0
  30. package/dist/bn-template-engine/p-eca8e2e2.entry.js +1 -0
  31. package/dist/bn-template-engine/p-f9dfd120.entry.js +1 -0
  32. package/dist/bn-template-engine/p-rdqTC0_5.js +1 -0
  33. package/dist/cjs/AxisConfig-VnVelfSV.js +233 -0
  34. package/dist/cjs/LabelCollisionManager-nfD5P__k.js +412 -0
  35. package/dist/cjs/NumericScale-BAyYXpKL.js +107 -0
  36. package/dist/cjs/Order-DobBozQC.js +87 -0
  37. package/dist/cjs/SVGStyle-BQOmGWLX.js +8209 -0
  38. package/dist/cjs/SVGVariancesStyleGroup-DCGfHrqh.js +50 -0
  39. package/dist/cjs/VarianceMeasure-NY9yhiNV.js +372 -0
  40. package/dist/cjs/XYChartDataRow-B7OKrAcC.js +829 -0
  41. package/dist/cjs/bn-asset_21.cjs.entry.js +16047 -0
  42. package/dist/cjs/bn-chart-bubble.cjs.entry.js +762 -0
  43. package/dist/cjs/bn-chart-bullet.cjs.entry.js +785 -0
  44. package/dist/cjs/bn-chart-scatter.cjs.entry.js +658 -0
  45. package/dist/cjs/bn-grid.cjs.entry.js +5 -3
  46. package/dist/cjs/bn-image.cjs.entry.js +5 -3
  47. package/dist/cjs/bn-internationalization.cjs.entry.js +10 -8
  48. package/dist/cjs/bn-ruleset.cjs.entry.js +41 -0
  49. package/dist/cjs/bn-template-engine.cjs.js +1 -1
  50. package/dist/cjs/bn-template.cjs.entry.js +1 -1
  51. package/dist/cjs/bn-text.cjs.entry.js +8 -79
  52. package/dist/cjs/bn-tree.cjs.entry.js +9 -3
  53. package/dist/cjs/context-protocol-BDrMkhc4.js +9499 -0
  54. package/dist/cjs/editor-companion.cjs.entry.js +13 -6
  55. package/dist/cjs/ibcs-chart-bubble.cjs.entry.js +624 -0
  56. package/dist/cjs/ibcs-chart-bullet.cjs.entry.js +673 -0
  57. package/dist/cjs/ibcs-chart-scatter.cjs.entry.js +667 -0
  58. package/dist/cjs/layoutObserver-o03YUfn_.js +199 -0
  59. package/dist/cjs/loader.cjs.js +1 -1
  60. package/dist/cjs/sanitizeHtml-LuZr1IMd.js +85 -0
  61. package/dist/cjs/scaling-DKZyjWj5.js +587 -0
  62. package/dist/cjs/{withBodyObserver-D7BKWN2N.js → withBodyObserver-BKUE_ypL.js} +12 -7
  63. package/dist/cjs/withScalingGroup-BmcRlWBs.js +73 -0
  64. package/dist/cjs/withStyled-CRiC9fzc.js +1137 -0
  65. package/dist/collection/collection-manifest.json +9 -1
  66. package/dist/collection/components/bn-body/bn-body.css +1 -0
  67. package/dist/collection/components/bn-card/bn-card.css +2 -0
  68. package/dist/collection/components/bn-chart-bubble/bn-chart-bubble.css +10 -0
  69. package/dist/collection/components/bn-chart-bubble/bn-chart-bubble.js +1110 -0
  70. package/dist/collection/components/bn-chart-bubble/ibcs-chart-bubble.css +9 -0
  71. package/dist/collection/components/bn-chart-bubble/ibcs-chart-bubble.js +653 -0
  72. package/dist/collection/components/bn-chart-bubble/utils/BubbleChart.js +472 -0
  73. package/dist/collection/components/bn-chart-bullet/bn-chart-bullet.css +10 -0
  74. package/dist/collection/components/bn-chart-bullet/bn-chart-bullet.js +1014 -0
  75. package/dist/collection/components/bn-chart-bullet/ibcs-chart-bullet.css +9 -0
  76. package/dist/collection/components/bn-chart-bullet/ibcs-chart-bullet.js +538 -0
  77. package/dist/collection/components/bn-chart-bullet/utils/BulletChart.js +440 -0
  78. package/dist/collection/components/bn-chart-bullet/utils/model/BulletChartStyle.js +132 -0
  79. package/dist/collection/components/bn-chart-bullet/utils/model/BulletConfig.js +89 -0
  80. package/dist/collection/components/bn-chart-bullet/utils/model/index.js +2 -0
  81. package/dist/collection/components/bn-chart-scatter/bn-chart-scatter.css +10 -0
  82. package/dist/collection/components/bn-chart-scatter/bn-chart-scatter.js +965 -0
  83. package/dist/collection/components/bn-chart-scatter/ibcs-chart-scatter.css +9 -0
  84. package/dist/collection/components/bn-chart-scatter/ibcs-chart-scatter.js +580 -0
  85. package/dist/collection/components/bn-chart-scatter/utils/ScatterChart.js +409 -0
  86. package/dist/collection/components/bn-chart-structure/bn-chart-structure.js +127 -41
  87. package/dist/collection/components/bn-chart-structure/ibcs-chart-structure.js +103 -36
  88. package/dist/collection/components/bn-chart-structure/utils/StructureChart.js +82 -58
  89. package/dist/collection/components/bn-chart-structure/utils/helper/ElementPositions.js +46 -4
  90. package/dist/collection/components/bn-chart-structure/utils/model/StructureChartComponentConfig.js +5 -4
  91. package/dist/collection/components/bn-chart-time/bn-chart-time.css +1 -1
  92. package/dist/collection/components/bn-chart-time/bn-chart-time.js +162 -42
  93. package/dist/collection/components/bn-chart-time/ibcs-chart-time.js +94 -31
  94. package/dist/collection/components/bn-chart-time/utils/TimeChart.js +132 -74
  95. package/dist/collection/components/bn-chart-time/utils/elements/StackedColumn.js +3 -3
  96. package/dist/collection/components/bn-chart-time/utils/model/TimeChartComponentConfig.js +5 -4
  97. package/dist/collection/components/bn-chart-time/utils/model/TimeChartDataRow.js +2 -0
  98. package/dist/collection/components/bn-component-style/bn-component-style.js +1 -1
  99. package/dist/collection/components/bn-context/bn-context.js +1 -1
  100. package/dist/collection/components/bn-dataset/bn-dataset.js +226 -23
  101. package/dist/collection/components/bn-datasource/bn-datasource.js +163 -12
  102. package/dist/collection/components/bn-footer/bn-footer.js +1 -1
  103. package/dist/collection/components/bn-grid/bn-grid.js +1 -1
  104. package/dist/collection/components/bn-image/bn-image.js +1 -1
  105. package/dist/collection/components/bn-internationalization/bn-internationalization.js +10 -7
  106. package/dist/collection/components/bn-layout-card/bn-layout-card.css +8 -3
  107. package/dist/collection/components/bn-layout-card/bn-layout-card.js +98 -35
  108. package/dist/collection/components/bn-layout-page/bn-layout-page.css +5 -3
  109. package/dist/collection/components/bn-layout-page/bn-layout-page.js +98 -25
  110. package/dist/collection/components/bn-message/bn-message.css +6 -2
  111. package/dist/collection/components/bn-message/bn-message.js +3 -2
  112. package/dist/collection/components/bn-page/bn-page.js +1 -1
  113. package/dist/collection/components/bn-ruleset/bn-ruleset.css +3 -0
  114. package/dist/collection/components/bn-ruleset/bn-ruleset.js +68 -0
  115. package/dist/collection/components/bn-scaling-group/bn-scaling-group.css +3 -0
  116. package/dist/collection/components/bn-scaling-group/bn-scaling-group.js +136 -0
  117. package/dist/collection/components/bn-table/bn-table.js +317 -61
  118. package/dist/collection/components/bn-table/ibcs-table.css +8 -0
  119. package/dist/collection/components/bn-table/ibcs-table.js +161 -32
  120. package/dist/collection/components/bn-table/utils/Table.js +72 -28
  121. package/dist/collection/components/bn-table/utils/elements/CellBarChart.js +13 -8
  122. package/dist/collection/components/bn-table/utils/elements/TableRow.js +3 -2
  123. package/dist/collection/components/bn-table/utils/elements/WaterfallBar.js +47 -0
  124. package/dist/collection/components/bn-table/utils/elements/index.js +1 -0
  125. package/dist/collection/components/bn-table/utils/factories/tableDataSetFactory.js +117 -22
  126. package/dist/collection/components/bn-table/utils/helper/DataQuery.js +380 -50
  127. package/dist/collection/components/bn-table/utils/helper/IntervalColumns.js +140 -0
  128. package/dist/collection/components/bn-table/utils/helper/QueryGroup.js +4 -9
  129. package/dist/collection/components/bn-table/utils/helper/WaterfallCalculator.js +166 -0
  130. package/dist/collection/components/bn-table/utils/helper/index.js +2 -0
  131. package/dist/collection/components/bn-table/utils/model/TableAttribute.js +46 -0
  132. package/dist/collection/components/bn-table/utils/model/TableComponentConfig.js +20 -4
  133. package/dist/collection/components/bn-template/bn-template.js +1 -1
  134. package/dist/collection/components/bn-text/bn-text.js +2 -75
  135. package/dist/collection/components/bn-title/bn-title.js +27 -3
  136. package/dist/collection/components/bn-title/ibcs-title/ibcs-title.css +4 -0
  137. package/dist/collection/components/bn-title/ibcs-title/ibcs-title.js +29 -6
  138. package/dist/collection/components/bn-title/ibcs-title/utils/Title.js +3 -0
  139. package/dist/collection/components/bn-tree/bn-tree.js +5 -1
  140. package/dist/collection/components/editor-companion/editor-companion.js +12 -5
  141. package/dist/collection/context/scopedDb.js +127 -0
  142. package/dist/collection/stores/componentStyles.js +67 -0
  143. package/dist/collection/stores/createScopedStores.js +11 -5
  144. package/dist/collection/stores/internationalization.js +68 -0
  145. package/dist/collection/stores/ruleSets.js +46 -0
  146. package/dist/collection/utils/constants.js +5 -0
  147. package/dist/collection/utils/dataAnalyzer.js +14 -8
  148. package/dist/collection/utils/ibcsRuleSet.js +14 -26
  149. package/dist/collection/utils/layoutObserver.js +88 -0
  150. package/dist/collection/utils/parentDimensions.js +71 -15
  151. package/dist/collection/utils/sanitizeHtml.js +81 -0
  152. package/dist/collection/utils/validate.js +47 -0
  153. package/dist/collection/utils/withBodyObserver.js +12 -7
  154. package/dist/collection/utils/withComponentStyle.js +3 -5
  155. package/dist/collection/utils/withDataset.js +43 -39
  156. package/dist/collection/utils/withDatasource.js +28 -18
  157. package/dist/collection/utils/withInheritedProps.js +26 -1
  158. package/dist/collection/utils/withRuleSet.js +105 -0
  159. package/dist/collection/utils/withScalingGroup.js +69 -0
  160. package/dist/collection/utils/withTranslation.js +50 -14
  161. package/dist/collection/utils/xy/FacetGrid.js +36 -0
  162. package/dist/collection/utils/xy/IsoCurves.js +156 -0
  163. package/dist/collection/utils/xy/NumericScale.js +103 -0
  164. package/dist/collection/utils/xy/PointLabeler.js +96 -0
  165. package/dist/collection/utils/xy/RadiusScale.js +42 -0
  166. package/dist/collection/utils/xy/SeriesPalette.js +80 -0
  167. package/dist/collection/utils/xy/VarianceMeasure.js +76 -0
  168. package/dist/collection/utils/xy/XYFrame.js +120 -0
  169. package/dist/collection/utils/xy/XYLegend.js +107 -0
  170. package/dist/collection/utils/xy/model/AxisConfig.js +221 -0
  171. package/dist/collection/utils/xy/model/ScaleFactorsXYChart.js +69 -0
  172. package/dist/collection/utils/xy/model/XYChartDataRow.js +0 -0
  173. package/dist/collection/utils/xy/model/XYChartStyle.js +52 -0
  174. package/dist/components/AxisConfig.js +1 -0
  175. package/dist/components/CompareUtil.js +1 -0
  176. package/dist/components/DataFormatDigits.js +1 -1
  177. package/dist/components/DateStringFactory.js +1 -1
  178. package/dist/components/LabelCollisionManager.js +1 -0
  179. package/dist/components/NumericScale.js +1 -0
  180. package/dist/components/Order.js +1 -1
  181. package/dist/components/SVGVariancesStyleGroup.js +1 -1
  182. package/dist/components/SiPrefix.js +1 -0
  183. package/dist/components/StringAdapter.js +1 -0
  184. package/dist/components/VarianceMeasure.js +1 -0
  185. package/dist/components/XYChartDataRow.js +1 -0
  186. package/dist/components/bn-body2.js +1 -1
  187. package/dist/components/bn-card2.js +1 -1
  188. package/dist/components/bn-chart-bubble.d.ts +11 -0
  189. package/dist/components/bn-chart-bubble.js +1 -0
  190. package/dist/components/bn-chart-bullet.d.ts +11 -0
  191. package/dist/components/bn-chart-bullet.js +1 -0
  192. package/dist/components/bn-chart-scatter.d.ts +11 -0
  193. package/dist/components/bn-chart-scatter.js +1 -0
  194. package/dist/components/bn-chart-structure.js +1 -1
  195. package/dist/components/bn-chart-time.js +1 -1
  196. package/dist/components/bn-component-style.js +1 -1
  197. package/dist/components/bn-context.js +1 -1
  198. package/dist/components/bn-dataset.js +1 -1
  199. package/dist/components/bn-datasource.js +1 -1
  200. package/dist/components/bn-footer2.js +1 -1
  201. package/dist/components/bn-grid.js +1 -1
  202. package/dist/components/bn-image.js +1 -1
  203. package/dist/components/bn-internationalization.js +1 -1
  204. package/dist/components/bn-layout-card.js +1 -1
  205. package/dist/components/bn-layout-page.js +1 -1
  206. package/dist/components/bn-message2.js +1 -1
  207. package/dist/components/bn-page2.js +1 -1
  208. package/dist/components/bn-ruleset.d.ts +11 -0
  209. package/dist/components/bn-ruleset.js +1 -0
  210. package/dist/components/bn-scaling-group.d.ts +11 -0
  211. package/dist/components/bn-scaling-group.js +1 -0
  212. package/dist/components/bn-table.js +1 -1
  213. package/dist/components/bn-template.js +1 -1
  214. package/dist/components/bn-text.js +1 -1
  215. package/dist/components/bn-title2.js +1 -1
  216. package/dist/components/bn-tree.js +1 -1
  217. package/dist/components/context-protocol.js +1 -1
  218. package/dist/components/editor-companion.js +1 -1
  219. package/dist/components/formatter.js +1 -0
  220. package/dist/components/ibcs-chart-bubble.d.ts +11 -0
  221. package/dist/components/ibcs-chart-bubble.js +1 -0
  222. package/dist/components/ibcs-chart-bubble2.js +1 -0
  223. package/dist/components/ibcs-chart-bullet.d.ts +11 -0
  224. package/dist/components/ibcs-chart-bullet.js +1 -0
  225. package/dist/components/ibcs-chart-bullet2.js +1 -0
  226. package/dist/components/ibcs-chart-scatter.d.ts +11 -0
  227. package/dist/components/ibcs-chart-scatter.js +1 -0
  228. package/dist/components/ibcs-chart-scatter2.js +1 -0
  229. package/dist/components/ibcs-chart-structure2.js +1 -1
  230. package/dist/components/ibcs-chart-time2.js +1 -1
  231. package/dist/components/ibcs-table2.js +1 -1
  232. package/dist/components/ibcs-title2.js +1 -1
  233. package/dist/components/layoutObserver.js +1 -0
  234. package/dist/components/luxon.js +1 -0
  235. package/dist/components/main.js +1 -0
  236. package/dist/components/merge.js +1 -0
  237. package/dist/components/sanitizeHtml.js +1 -0
  238. package/dist/components/stackColors.js +1 -0
  239. package/dist/components/validate.js +1 -1
  240. package/dist/components/withBodyObserver.js +1 -1
  241. package/dist/components/withComponentStyle.js +1 -1
  242. package/dist/components/withDataset.js +1 -0
  243. package/dist/components/withRuleSet.js +1 -0
  244. package/dist/components/withScalingGroup.js +1 -0
  245. package/dist/components/withStyled.js +1 -1
  246. package/dist/components/withTranslation.js +1 -1
  247. package/dist/esm/AxisConfig-C_zWCKlL.js +224 -0
  248. package/dist/esm/LabelCollisionManager-8swVQHKA.js +404 -0
  249. package/dist/esm/NumericScale-DsTzlzxQ.js +105 -0
  250. package/dist/esm/Order-BPeWfygb.js +83 -0
  251. package/dist/esm/SVGStyle-BxEDw9zh.js +8199 -0
  252. package/dist/esm/SVGVariancesStyleGroup-DRQYvSDD.js +48 -0
  253. package/dist/esm/VarianceMeasure-DnwNKspZ.js +364 -0
  254. package/dist/esm/XYChartDataRow-DeV4r-Wm.js +820 -0
  255. package/dist/esm/bn-asset_21.entry.js +16025 -0
  256. package/dist/esm/bn-chart-bubble.entry.js +760 -0
  257. package/dist/esm/bn-chart-bullet.entry.js +783 -0
  258. package/dist/esm/bn-chart-scatter.entry.js +656 -0
  259. package/dist/esm/bn-grid.entry.js +5 -3
  260. package/dist/esm/bn-image.entry.js +5 -3
  261. package/dist/esm/bn-internationalization.entry.js +10 -8
  262. package/dist/esm/bn-ruleset.entry.js +39 -0
  263. package/dist/esm/bn-template-engine.js +1 -1
  264. package/dist/esm/bn-template.entry.js +1 -1
  265. package/dist/esm/bn-text.entry.js +7 -78
  266. package/dist/esm/bn-tree.entry.js +9 -3
  267. package/dist/esm/context-protocol-1Yj1uKvh.js +9484 -0
  268. package/dist/esm/editor-companion.entry.js +13 -6
  269. package/dist/esm/ibcs-chart-bubble.entry.js +622 -0
  270. package/dist/esm/ibcs-chart-bullet.entry.js +671 -0
  271. package/dist/esm/ibcs-chart-scatter.entry.js +665 -0
  272. package/dist/esm/layoutObserver-BG5dOBYH.js +196 -0
  273. package/dist/esm/loader.js +1 -1
  274. package/dist/esm/sanitizeHtml-BA48JiHe.js +83 -0
  275. package/dist/esm/scaling-CeSRcRl1.js +579 -0
  276. package/dist/esm/{withBodyObserver-AFk2wwHT.js → withBodyObserver-IokS6fHD.js} +12 -7
  277. package/dist/esm/withScalingGroup-Br70pAv9.js +71 -0
  278. package/dist/esm/withStyled-Br2DGTPs.js +1104 -0
  279. package/dist/types/components/bn-chart-bubble/bn-chart-bubble.d.ts +193 -0
  280. package/dist/types/components/bn-chart-bubble/ibcs-chart-bubble.d.ts +58 -0
  281. package/dist/types/components/bn-chart-bubble/utils/BubbleChart.d.ts +91 -0
  282. package/dist/types/components/bn-chart-bullet/bn-chart-bullet.d.ts +172 -0
  283. package/dist/types/components/bn-chart-bullet/ibcs-chart-bullet.d.ts +52 -0
  284. package/dist/types/components/bn-chart-bullet/utils/BulletChart.d.ts +91 -0
  285. package/dist/types/components/bn-chart-bullet/utils/model/BulletChartStyle.d.ts +70 -0
  286. package/dist/types/components/bn-chart-bullet/utils/model/BulletConfig.d.ts +43 -0
  287. package/dist/types/components/bn-chart-bullet/utils/model/index.d.ts +2 -0
  288. package/dist/types/components/bn-chart-scatter/bn-chart-scatter.d.ts +172 -0
  289. package/dist/types/components/bn-chart-scatter/ibcs-chart-scatter.d.ts +53 -0
  290. package/dist/types/components/bn-chart-scatter/utils/ScatterChart.d.ts +66 -0
  291. package/dist/types/components/bn-chart-structure/bn-chart-structure.d.ts +19 -5
  292. package/dist/types/components/bn-chart-structure/ibcs-chart-structure.d.ts +13 -6
  293. package/dist/types/components/bn-chart-structure/utils/StructureChart.d.ts +16 -12
  294. package/dist/types/components/bn-chart-structure/utils/helper/ElementPositions.d.ts +16 -1
  295. package/dist/types/components/bn-chart-structure/utils/model/StructureChartComponentConfig.d.ts +5 -3
  296. package/dist/types/components/bn-chart-time/bn-chart-time.d.ts +53 -13
  297. package/dist/types/components/bn-chart-time/ibcs-chart-time.d.ts +13 -6
  298. package/dist/types/components/bn-chart-time/utils/TimeChart.d.ts +16 -12
  299. package/dist/types/components/bn-chart-time/utils/model/TimeChartComponentConfig.d.ts +5 -3
  300. package/dist/types/components/bn-dataset/bn-dataset.d.ts +47 -5
  301. package/dist/types/components/bn-datasource/bn-datasource.d.ts +53 -6
  302. package/dist/types/components/bn-layout-card/bn-layout-card.d.ts +35 -8
  303. package/dist/types/components/bn-layout-page/bn-layout-page.d.ts +32 -1
  304. package/dist/types/components/bn-message/bn-message.d.ts +5 -2
  305. package/dist/types/components/bn-ruleset/bn-ruleset.d.ts +8 -0
  306. package/dist/types/components/bn-scaling-group/bn-scaling-group.d.ts +37 -0
  307. package/dist/types/components/bn-table/bn-table.d.ts +74 -12
  308. package/dist/types/components/bn-table/ibcs-table.d.ts +27 -4
  309. package/dist/types/components/bn-table/utils/Table.d.ts +16 -6
  310. package/dist/types/components/bn-table/utils/elements/Cell.d.ts +2 -0
  311. package/dist/types/components/bn-table/utils/elements/CellBarChart.d.ts +33 -0
  312. package/dist/types/components/bn-table/utils/elements/TableRow.d.ts +2 -1
  313. package/dist/types/components/bn-table/utils/elements/WaterfallBar.d.ts +21 -0
  314. package/dist/types/components/bn-table/utils/elements/index.d.ts +1 -0
  315. package/dist/types/components/bn-table/utils/factories/tableDataSetFactory.d.ts +17 -9
  316. package/dist/types/components/bn-table/utils/helper/DataQuery.d.ts +35 -3
  317. package/dist/types/components/bn-table/utils/helper/IntervalColumns.d.ts +37 -0
  318. package/dist/types/components/bn-table/utils/helper/QueryGroup.d.ts +4 -5
  319. package/dist/types/components/bn-table/utils/helper/WaterfallCalculator.d.ts +55 -0
  320. package/dist/types/components/bn-table/utils/helper/index.d.ts +2 -0
  321. package/dist/types/components/bn-table/utils/model/TableAttribute.d.ts +22 -0
  322. package/dist/types/components/bn-table/utils/model/TableComponentConfig.d.ts +12 -3
  323. package/dist/types/components/bn-table/utils/model/index.d.ts +21 -0
  324. package/dist/types/components/bn-title/bn-title.d.ts +11 -1
  325. package/dist/types/components/bn-title/ibcs-title/ibcs-title.d.ts +2 -0
  326. package/dist/types/components/bn-title/ibcs-title/utils/Title.d.ts +1 -0
  327. package/dist/types/components/editor-companion/editor-companion.d.ts +2 -0
  328. package/dist/types/components.d.ts +1691 -120
  329. package/dist/types/context/context-protocol.d.ts +7 -3
  330. package/dist/types/context/scopedDb.d.ts +37 -0
  331. package/dist/types/stores/componentStyles.d.ts +41 -0
  332. package/dist/types/stores/createScopedStores.d.ts +4 -2
  333. package/dist/types/stores/ruleSets.d.ts +40 -0
  334. package/dist/types/utils/DateStringFactory.d.ts +1 -1
  335. package/dist/types/utils/constants.d.ts +5 -0
  336. package/dist/types/utils/dataAnalyzer.d.ts +2 -1
  337. package/dist/types/utils/ibcsRuleSet.d.ts +6 -1
  338. package/dist/types/utils/layoutObserver.d.ts +27 -0
  339. package/dist/types/utils/model/ChartStyles.d.ts +2 -1
  340. package/dist/types/utils/parentDimensions.d.ts +1 -1
  341. package/dist/types/utils/sanitizeHtml.d.ts +6 -0
  342. package/dist/types/utils/validate.d.ts +18 -0
  343. package/dist/types/utils/withDataset.d.ts +6 -2
  344. package/dist/types/utils/withDatasource.d.ts +3 -3
  345. package/dist/types/utils/withInheritedProps.d.ts +19 -0
  346. package/dist/types/utils/withRuleSet.d.ts +24 -0
  347. package/dist/types/utils/withScalingGroup.d.ts +14 -0
  348. package/dist/types/utils/withTranslation.d.ts +12 -4
  349. package/dist/types/utils/xy/FacetGrid.d.ts +27 -0
  350. package/dist/types/utils/xy/IsoCurves.d.ts +46 -0
  351. package/dist/types/utils/xy/NumericScale.d.ts +41 -0
  352. package/dist/types/utils/xy/PointLabeler.d.ts +58 -0
  353. package/dist/types/utils/xy/RadiusScale.d.ts +26 -0
  354. package/dist/types/utils/xy/SeriesPalette.d.ts +59 -0
  355. package/dist/types/utils/xy/VarianceMeasure.d.ts +37 -0
  356. package/dist/types/utils/xy/XYFrame.d.ts +44 -0
  357. package/dist/types/utils/xy/XYLegend.d.ts +43 -0
  358. package/dist/types/utils/xy/model/AxisConfig.d.ts +96 -0
  359. package/dist/types/utils/xy/model/ScaleFactorsXYChart.d.ts +36 -0
  360. package/dist/types/utils/xy/model/XYChartDataRow.d.ts +157 -0
  361. package/dist/types/utils/xy/model/XYChartStyle.d.ts +31 -0
  362. package/package.json +5 -4
  363. package/readme.md +9 -5
  364. package/dist/bn-template-engine/p-0d41c5d8.entry.js +0 -1
  365. package/dist/bn-template-engine/p-67538176.entry.js +0 -1
  366. package/dist/bn-template-engine/p-825a07a8.entry.js +0 -1
  367. package/dist/bn-template-engine/p-916296a5.entry.js +0 -1
  368. package/dist/bn-template-engine/p-96006b06.entry.js +0 -1
  369. package/dist/bn-template-engine/p-Ck-NYtot.js +0 -1
  370. package/dist/bn-template-engine/p-CnDq0oVa.js +0 -1
  371. package/dist/bn-template-engine/p-DSXNgKLa.js +0 -1
  372. package/dist/bn-template-engine/p-bc711fb0.entry.js +0 -1
  373. package/dist/bn-template-engine/p-e6f646b1.entry.js +0 -1
  374. package/dist/bn-template-engine/p-f41d9242.entry.js +0 -1
  375. package/dist/bn-template-engine/p-gFbbuhtl.js +0 -1
  376. package/dist/cjs/bn-asset_20.cjs.entry.js +0 -23541
  377. package/dist/cjs/context-protocol-ohYzcb5F.js +0 -663
  378. package/dist/cjs/scaling-CIAClQR5.js +0 -314
  379. package/dist/cjs/withStyled-qd94SSb4.js +0 -9535
  380. package/dist/collection/stores/datasets.js +0 -14
  381. package/dist/collection/stores/datasources.js +0 -14
  382. package/dist/components/_commonjsHelpers.js +0 -1
  383. package/dist/components/alasql.min.js +0 -1
  384. package/dist/components/ibcsRuleSet.js +0 -1
  385. package/dist/components/scaling.js +0 -1
  386. package/dist/components/withInheritedProps.js +0 -1
  387. package/dist/esm/bn-asset_20.entry.js +0 -23520
  388. package/dist/esm/context-protocol-DdbSplvE.js +0 -656
  389. package/dist/esm/scaling-DGKKkuL9.js +0 -309
  390. package/dist/esm/withStyled-BIkqU2w4.js +0 -9501
  391. package/dist/types/stores/datasets.d.ts +0 -14
  392. package/dist/types/stores/datasources.d.ts +0 -14
@@ -3,13 +3,16 @@ import { isBlankInput, isValidBoolean, isValidDirection, isValidInteger, isValid
3
3
  import withDataset from "../../utils/withDataset";
4
4
  import withComponentStatus from "../../utils/withComponentStatus";
5
5
  import withTranslation from "../../utils/withTranslation";
6
+ import withScalingGroup from "../../utils/withScalingGroup";
6
7
  import { globalLabelKeys } from "../../stores/internationalization";
7
8
  import { withStyled } from "../../utils/styled/withStyled";
8
9
  import withComponentStyle from "../../utils/withComponentStyle";
10
+ import withRuleSet from "../../utils/withRuleSet";
9
11
  import withHasError from "../../utils/withHasError";
10
12
  import withInheritedProps, { isInheritedValue } from "../../utils/withInheritedProps";
11
13
  import { getParentDimensions } from "../../utils/parentDimensions";
12
14
  import { parseScaling } from "../../utils/scaling";
15
+ import { observeParentResize } from "../../utils/layoutObserver";
13
16
  import { AggregationLevel, StackBy, StackMode, StackOrder } from "../../utils/constants";
14
17
  import { OrderColumn, OrderDirection } from "../../utils/model/Order";
15
18
  /**
@@ -61,7 +64,8 @@ export class Chart {
61
64
  }
62
65
  validateUnitScaling(newValue) {
63
66
  const errId = "ERR_unitScaling";
64
- if (!isValidNumber(newValue) && !this.pixelPerUnitGroupMap.has(newValue)) {
67
+ const isAuto = (newValue === null || newValue === void 0 ? void 0 : newValue.toString().trim().toLowerCase()) === "auto";
68
+ if (!isAuto && !isValidNumber(newValue) && !this.pixelPerUnitGroupMap.has(newValue)) {
65
69
  this.errors.addOrReplace({
66
70
  id: errId,
67
71
  type: "warning",
@@ -74,7 +78,8 @@ export class Chart {
74
78
  }
75
79
  validatePercentageScaling(newValue) {
76
80
  const errId = "ERR_percentageScaling";
77
- if (!isValidNumber(newValue) && !this.pixelPerUnitGroupMap.has(newValue)) {
81
+ const isAuto = (newValue === null || newValue === void 0 ? void 0 : newValue.toString().trim().toLowerCase()) === "auto";
82
+ if (!isAuto && !isValidNumber(newValue) && !this.pixelPerUnitGroupMap.has(newValue)) {
78
83
  this.errors.addOrReplace({
79
84
  id: errId,
80
85
  type: "warning",
@@ -217,9 +222,15 @@ export class Chart {
217
222
  }
218
223
  }
219
224
  constructor() {
220
- this.data = [];
225
+ /** Active dataset name (the last subscribed dataset to fire `onUpdate`). */
226
+ this.datasetName = "";
227
+ /** Bumped on every data update so Stencil re-renders even when the name is unchanged. */
228
+ this.dataVersion = 0;
221
229
  this.datasetMeta = null;
222
230
  this.appliedScaleFactor = 1;
231
+ this.layoutObserver = null;
232
+ /** Last parent height seen, used to suppress ResizeObserver noise. */
233
+ this._lastScaledParentHeight = 0;
223
234
  /**
224
235
  * Title displayed above the chart. When empty, the title is derived
225
236
  * from the variance scenario labels (if variances are configured).
@@ -313,19 +324,21 @@ export class Chart {
313
324
  * @example stack='{"by":"dimensions","mode":"relative"}'
314
325
  */
315
326
  this.stack = "";
316
- this.scenariosArray = [""];
317
327
  this.pixelPerUnitGroupMap = new Map();
318
328
  this._autoScaleGuard = false;
319
329
  withStyled(this);
320
330
  withComponentStatus(this);
321
- withDataset(this, (_name, data) => {
322
- this.data = (data || []);
331
+ withDataset(this, (name, _data) => {
332
+ this.datasetName = (name === null || name === void 0 ? void 0 : name.startsWith("$")) ? name.substring(1) : name || "";
333
+ this.dataVersion = this.dataVersion + 1;
323
334
  }, (_name, meta) => {
324
335
  this.datasetMeta = meta;
325
336
  });
326
337
  this.chartTemplate = this.chartTemplate.bind(this);
327
338
  this.errors = withHasError(this);
339
+ withScalingGroup(this);
328
340
  this.componentStyle = withComponentStyle(this);
341
+ this.ruleSetConfig = withRuleSet(this);
329
342
  this.t = withTranslation(this).t;
330
343
  this.resolveInherited = withInheritedProps(this, [
331
344
  { propName: "scenarios", ancestorAttr: "title-scenarios" },
@@ -349,7 +362,6 @@ export class Chart {
349
362
  this.validateScaling(this.scale);
350
363
  }
351
364
  componentDidRender() {
352
- var _a, _b;
353
365
  const { mode } = parseScaling(this.scale);
354
366
  if (mode !== "auto" && mode !== "empty") {
355
367
  this._autoScaleGuard = false;
@@ -367,24 +379,34 @@ export class Chart {
367
379
  this.checkWidthOverflow();
368
380
  return;
369
381
  }
370
- // Measure at base (unscaled) font size to get true content height
382
+ // Record height so the ResizeObserver callback can tell
383
+ // whether the container genuinely resized or just reflowed.
384
+ this._lastScaledParentHeight = parentHeight;
371
385
  const baseFontSize = this.componentStyle(($) => { var _a; return ((_a = $["global"]) === null || _a === void 0 ? void 0 : _a["fontSizePx"]) || 13.3333; });
372
- host.style.setProperty("--bn-font-size", `${baseFontSize}px`);
373
- // Reading scrollHeight forces a synchronous reflow at base size
374
- const div = (_a = host.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(".container");
375
- const unscaledHeight = (_b = div === null || div === void 0 ? void 0 : div.scrollHeight) !== null && _b !== void 0 ? _b : host.scrollHeight;
376
- if (unscaledHeight <= parentHeight + 1) {
386
+ // The chart host is display:inline-block — it sizes to its content.
387
+ // scrollHeight gives the actual rendered height at the current factor.
388
+ const currentHeight = host.scrollHeight;
389
+ const currentFactor = this.appliedScaleFactor;
390
+ // Primary check: does the content ACTUALLY fit at the current factor?
391
+ // This avoids oscillation from non-linear SVG scaling where the
392
+ // divide-by-factor estimate overshoots.
393
+ if (currentHeight <= parentHeight + 1) {
394
+ // Content fits. Don't reset to factor 1 — the content only fits
395
+ // BECAUSE of the current factor. Resetting would cause oscillation.
377
396
  this.errors.remove("AUTO_scale");
378
- if (this.appliedScaleFactor !== 1) {
379
- this._autoScaleGuard = true;
380
- writeTask(() => {
381
- this.appliedScaleFactor = 1;
382
- });
383
- }
384
397
  this.checkWidthOverflow();
385
398
  return;
386
399
  }
387
- const computedFactor = (parentHeight - 1) / unscaledHeight;
400
+ // Content overflows. Compute a new factor based on the ratio of
401
+ // parent to current content height, scaled by the current factor.
402
+ const computedFactor = Math.max(0.3, (currentFactor * (parentHeight - 1)) / currentHeight);
403
+ // Only apply if the change is significant (> 1% of current factor).
404
+ // SVG charts have non-linear scaling so we use a wider tolerance
405
+ // than tables to avoid oscillation from sub-pixel rounding.
406
+ if (Math.abs(computedFactor - currentFactor) < 0.01) {
407
+ this.checkWidthOverflow();
408
+ return;
409
+ }
388
410
  host.style.setProperty("--bn-font-size", `${baseFontSize * computedFactor}px`);
389
411
  if (mode === "empty") {
390
412
  this.errors.addOrReplace({
@@ -396,25 +418,46 @@ export class Chart {
396
418
  else {
397
419
  this.errors.remove("AUTO_scale");
398
420
  }
399
- if (Math.abs(computedFactor - this.appliedScaleFactor) > 0.001) {
400
- this._autoScaleGuard = true;
401
- writeTask(() => {
402
- this.appliedScaleFactor = computedFactor;
403
- });
404
- }
421
+ this._autoScaleGuard = true;
422
+ writeTask(() => {
423
+ this.appliedScaleFactor = computedFactor;
424
+ });
405
425
  this.checkWidthOverflow();
406
426
  }
407
427
  componentDidLoad() {
408
- // After the first render the DOM is committed and the browser has computed
409
- // layout. If the initial parentDimensions measurement returned 0 (common
410
- // inside cards/slots whose width isn't known before first paint), force a
411
- // re-render so the inner ibcs-chart-structure receives correct dimensions.
412
- if (this.canvasWidthSegmented <= 0) {
413
- const { width } = getParentDimensions(this.element);
414
- if (width > 0) {
428
+ // Observe the parent container for size changes so auto-scaling
429
+ // reacts to genuine container resizes (window resize, card relayout).
430
+ // Only trigger a re-render when the parent height actually changed
431
+ // compared to what auto-scaling last measured — this prevents the
432
+ // ResizeObserver's initial fire (and content-reflow noise) from
433
+ // creating an infinite auto-scale loop.
434
+ this.layoutObserver = observeParentResize(this.element, () => {
435
+ if (this._autoScaleGuard)
436
+ return;
437
+ const { height } = getParentDimensions(this.element);
438
+ // Only react to HEIGHT changes — structure chart scales by height.
439
+ // Width changes are handled separately via checkWidthOverflow.
440
+ if (height > 0 && Math.abs(height - this._lastScaledParentHeight) > 2) {
441
+ this._lastScaledParentHeight = height;
415
442
  forceUpdate(this);
416
443
  }
417
- }
444
+ });
445
+ // Double-rAF guarantees the browser has completed at least one full
446
+ // paint cycle so all nested shadow DOM layouts are finalized.
447
+ requestAnimationFrame(() => {
448
+ requestAnimationFrame(() => {
449
+ if (this._autoScaleGuard)
450
+ return;
451
+ const { height } = getParentDimensions(this.element);
452
+ this._lastScaledParentHeight = height;
453
+ forceUpdate(this);
454
+ });
455
+ });
456
+ }
457
+ disconnectedCallback() {
458
+ var _a;
459
+ (_a = this.layoutObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
460
+ this.layoutObserver = null;
418
461
  }
419
462
  /**
420
463
  * Emits an error when a custom unit-scaling value causes the chart to exceed its container width.
@@ -444,7 +487,9 @@ export class Chart {
444
487
  }
445
488
  prepareDimension() {
446
489
  const parent = getParentDimensions(this.element);
447
- this.canvasWidthSegmented = parent.width / this.scenariosArray.length;
490
+ const variancesList = this.prepareVariances();
491
+ const segmentCount = 1 + variancesList.length;
492
+ this.canvasWidthSegmented = parent.width / segmentCount;
448
493
  return { width: this.canvasWidthSegmented, height: parent.height };
449
494
  }
450
495
  prepareScenarios() {
@@ -520,10 +565,25 @@ export class Chart {
520
565
  return 0;
521
566
  }
522
567
  preparePixelPerPercentage() {
568
+ var _a;
523
569
  if (this.pixelPerUnitGroupMap.has(this.percentageScaling)) {
524
570
  return this.pixelPerUnitGroupMap.get(this.percentageScaling);
525
571
  }
526
- return Number(this.percentageScaling) * 100;
572
+ if (((_a = this.percentageScaling) === null || _a === void 0 ? void 0 : _a.toString().trim().toLowerCase()) === "auto") {
573
+ this.errors.remove("AUTO_percentageScaling");
574
+ return 0;
575
+ }
576
+ const numeric = Number(this.percentageScaling);
577
+ if (!isNaN(numeric) && numeric > 0) {
578
+ this.errors.remove("AUTO_percentageScaling");
579
+ return numeric * 100;
580
+ }
581
+ this.errors.addOrReplace({
582
+ id: "AUTO_percentageScaling",
583
+ type: "warning",
584
+ message: `percentage-scaling: not set, auto-calculated to fit available space.`,
585
+ });
586
+ return 0;
527
587
  }
528
588
  prepareLevel() {
529
589
  var _a, _b, _c;
@@ -737,7 +797,7 @@ export class Chart {
737
797
  const scenarios = this.prepareScenarios();
738
798
  // Dimension stacking uses only the first scenario
739
799
  const effectiveScenarios = (stackConfig === null || stackConfig === void 0 ? void 0 : stackConfig.by) === StackBy.DIMENSIONS ? scenarios.slice(0, 1) : scenarios;
740
- return (h("ibcs-chart-structure", { data: this.data, chartTitle: this.prepareChartTitle(idx), scenarios: effectiveScenarios, variances: [localScenarioString], hideCategories: this.prepareHideCategories(idx), pixelPerUnit: ppu > 0 ? ppu * effectiveFactor : 0, pixelPerPercentage: ppp > 0 ? ppp * effectiveFactor : 0, limit: this.prepareLimit(), styles: this.prepareStyle(), i18n: this.prepareI18n(), order: this.prepareOrder(), level: this.prepareLevel(), filter: this.prepareFilter(), "measure-scale": this.prepareMeasureScale(), "measure-unit": this.prepareMeasureUnit(), showMeasureScale: this.prepareShowMeasureScale(idx), stackConfig: stackConfig, parentDimensions: this.prepareDimension() }));
800
+ return (h("ibcs-chart-structure", { tableName: this.datasetName, dataVersion: this.dataVersion, chartTitle: this.prepareChartTitle(idx), scenarios: effectiveScenarios, variances: [localScenarioString], hideCategories: this.prepareHideCategories(idx), pixelPerUnit: ppu > 0 ? ppu * effectiveFactor : 0, pixelPerPercentage: ppp > 0 ? ppp * effectiveFactor : 0, limit: this.prepareLimit(), styles: this.prepareStyle(), i18n: this.prepareI18n(), order: this.prepareOrder(), level: this.prepareLevel(), filter: this.prepareFilter(), "measure-scale": this.prepareMeasureScale(), "measure-unit": this.prepareMeasureUnit(), showMeasureScale: this.prepareShowMeasureScale(idx), stackConfig: stackConfig, parentDimensions: this.prepareDimension(), ruleSetConfig: this.ruleSetConfig() }));
741
801
  }
742
802
  getEffectiveScaleFactor() {
743
803
  const { mode, factor } = parseScaling(this.scale);
@@ -767,7 +827,7 @@ export class Chart {
767
827
  scenariosArray = [...scenariosArray, ...variancesArray];
768
828
  }
769
829
  const fontStyles = this.getFontStyles();
770
- return (h(Host, { key: '9c71155a82140c2020a830247c62d668fb10959e', style: fontStyles }, h("div", { key: '5d9402429fd36aa3b9615f13a5038bc38d825173', class: "container" }, scenariosArray.map(this.chartTemplate))));
830
+ return (h(Host, { key: 'dd704d2ab46ee7a34213eab0188671e3df4ca592', style: fontStyles }, h("div", { key: '71c53b1dbd77e68a46e63fdf252cd11efb6a79a6', class: "container" }, scenariosArray.map(this.chartTemplate))));
771
831
  }
772
832
  static get is() { return "bn-chart-structure"; }
773
833
  static get encapsulation() { return "shadow"; }
@@ -806,6 +866,25 @@ export class Chart {
806
866
  "attribute": "chart-title",
807
867
  "defaultValue": "\"\""
808
868
  },
869
+ "ruleset": {
870
+ "type": "string",
871
+ "mutable": false,
872
+ "complexType": {
873
+ "original": "string",
874
+ "resolved": "string",
875
+ "references": {}
876
+ },
877
+ "required": false,
878
+ "optional": true,
879
+ "docs": {
880
+ "tags": [],
881
+ "text": "Name of a registered IBCS rule set (see `bn-ruleset`) used for scenario\nordering. Supports `\"inherited-closest\"` / `\"inherited-page\"` to take\nover the value from an ancestor `bn-layout-card` / `bn-layout-page`."
882
+ },
883
+ "getter": false,
884
+ "setter": false,
885
+ "reflect": true,
886
+ "attribute": "ruleset"
887
+ },
809
888
  "filter": {
810
889
  "type": "string",
811
890
  "mutable": false,
@@ -893,8 +972,11 @@ export class Chart {
893
972
  }, {
894
973
  "name": "example",
895
974
  "text": "unit-scaling=\"0.05\""
975
+ }, {
976
+ "name": "example",
977
+ "text": "unit-scaling=\"revenue-scale\""
896
978
  }],
897
- "text": "Controls horizontal bar scaling (pixels per data unit).\n\n| Value | Behavior |\n|----------------|-----------------------------------------------------------------|\n| `\"auto\"` | Auto-fit bars to fill the available container width (no warning) |\n| not set / `\"\"` | Same as auto, but emits `AUTO_unitScaling` warning |\n| `\"0.03\"`, `1` | Explicit pixels-per-unit value; bars scale proportionally |\n| group name | References a shared scaling group for synchronized charts |\n\nWhen using a custom value that causes the chart to exceed its container,\na `WARN_overflow` error is emitted."
979
+ "text": "Controls horizontal bar scaling (pixels per data unit).\n\n| Value | Behavior |\n|----------------|-----------------------------------------------------------------|\n| `\"auto\"` | Auto-fit bars to fill the available container width (no warning) |\n| not set / `\"\"` | Same as auto, but emits `AUTO_unitScaling` warning |\n| `\"0.03\"`, `1` | Explicit pixels-per-unit value; bars scale proportionally |\n| group name | References a `<bn-scaling-group>` for synchronized scaling |\n\nWhen using a custom value that causes the chart to exceed its container,\na `WARN_overflow` error is emitted."
898
980
  },
899
981
  "getter": false,
900
982
  "setter": false,
@@ -915,8 +997,11 @@ export class Chart {
915
997
  "tags": [{
916
998
  "name": "example",
917
999
  "text": "percentage-scaling=\"50\""
1000
+ }, {
1001
+ "name": "example",
1002
+ "text": "percentage-scaling=\"pct-scale\""
918
1003
  }],
919
- "text": "Controls scaling of relative variance bars (pixels per percentage point).\n\n| Value | Behavior |\n|----------------|---------------------------------------------------------------|\n| `\"auto\"` | Auto-fit to available width |\n| not set / `\"\"` | Same as auto with warning |\n| `\"50\"`, `1.5` | Explicit pixels-per-percentage-point value |\n| group name | References a shared scaling group for synchronized charts |"
1004
+ "text": "Controls scaling of relative variance bars (pixels per percentage point).\n\n| Value | Behavior |\n|----------------|---------------------------------------------------------------|\n| `\"auto\"` | Auto-fit to available width |\n| not set / `\"\"` | Same as auto with warning |\n| `\"50\"`, `1.5` | Explicit pixels-per-percentage-point value |\n| group name | References a `<bn-scaling-group>` for synchronized scaling |"
920
1005
  },
921
1006
  "getter": false,
922
1007
  "setter": false,
@@ -1174,7 +1259,8 @@ export class Chart {
1174
1259
  }
1175
1260
  static get states() {
1176
1261
  return {
1177
- "data": {},
1262
+ "datasetName": {},
1263
+ "dataVersion": {},
1178
1264
  "datasetMeta": {},
1179
1265
  "appliedScaleFactor": {}
1180
1266
  };
@@ -1,9 +1,11 @@
1
1
  import { h, Host } from "@stencil/core";
2
2
  import { StructureChart } from "./utils/StructureChart";
3
3
  import { CustomPattern } from "./utils/helper";
4
- import { StructureChartComponentConfigAdapter, } from "./utils/model";
4
+ import { StructureChartComponentConfigAdapter } from "./utils/model";
5
5
  import { StructureChartDataRowAdapter } from "./utils/model";
6
6
  import { ScaleFactorsStructureChartAdapter } from "./utils/model";
7
+ import { getStores } from "../../context/context-protocol";
8
+ import { buildFromExpr } from "../../context/scopedDb";
7
9
  //import { FontStyleAdapter } from "../../utils/model/styles/FontStyle";
8
10
  //import { SVGStyleGroupAdapter } from "../../utils/model/styles/SVGStyleGroup";
9
11
  //import { SVGVariancesStyleGroupAdapter } from "../../utils/model/styles/SVGVariancesStyleGroup";
@@ -24,7 +26,10 @@ import { SVGVariancesStyleGroupAdapter } from "../../utils/model/styles/SVGVaria
24
26
  //import { DataFormatDigitsAdapter } from "../../utils/model/DataFormatDigits";
25
27
  export class IbcsChartStructure {
26
28
  constructor() {
27
- this.data = [];
29
+ /** Name of the dataset (table or view in the shared alasql database). */
30
+ this.tableName = "";
31
+ /** Bumped by `bn-chart-structure` when the dataset changes; triggers re-render. */
32
+ this.dataVersion = 0;
28
33
  this.chartTitle = "";
29
34
  this.scenarios = [];
30
35
  this.variances = [];
@@ -46,6 +51,11 @@ export class IbcsChartStructure {
46
51
  this.stackConfig = null;
47
52
  this.parentDimensions = { width: 0, height: 0 };
48
53
  }
54
+ getDb() {
55
+ if (!this.stores)
56
+ this.stores = getStores(this.element);
57
+ return this.stores.db.db;
58
+ }
49
59
  render() {
50
60
  var _a, _b, _c;
51
61
  if (this.chart === undefined) {
@@ -59,9 +69,10 @@ export class IbcsChartStructure {
59
69
  }
60
70
  async componentWillLoad() {
61
71
  var _a;
72
+ const db = this.getDb();
62
73
  const config = this.prepareConfig();
63
74
  const styles = this.prepareStyle();
64
- this.chart = new StructureChart(new IBCSRuleSet(), config, styles);
75
+ this.chart = new StructureChart(new IBCSRuleSet(this.ruleSetConfig), db, this.tableName, config, styles);
65
76
  this.chart.setI18n(this.i18n);
66
77
  this.autoFitScaling(config, styles);
67
78
  this.chart.setAvailableWidth(((_a = this.parentDimensions) === null || _a === void 0 ? void 0 : _a.width) || 0);
@@ -77,6 +88,7 @@ export class IbcsChartStructure {
77
88
  const styles = this.prepareStyle();
78
89
  this.chart.setI18n(this.i18n);
79
90
  this.chart.setStyles(styles);
91
+ this.chart.setRuleSet(new IBCSRuleSet(this.ruleSetConfig));
80
92
  this.chart.setConfig(config);
81
93
  this.autoFitScaling(config, styles);
82
94
  this.chart.setAvailableWidth(((_a = this.parentDimensions) === null || _a === void 0 ? void 0 : _a.width) || 0);
@@ -84,26 +96,36 @@ export class IbcsChartStructure {
84
96
  this.chart.setPattern("fc", this.pattern.getFCPolygonPattern());
85
97
  }
86
98
  /**
87
- * Two-pass auto-fit: only when pixelPerUnit is 0 (auto mode).
88
- * Explicit values are never overridden — the outer component warns
89
- * about overflow via componentDidRender.
99
+ * Two-pass auto-fit for pixelPerUnit and/or pixelPerPercentage.
100
+ * When either is 0 (auto mode), renders a measurement pass at 1,
101
+ * computes the ratio to fit the available width, and rebuilds.
90
102
  * Structure charts grow horizontally, so we fit to width.
103
+ * Explicit (> 0) values are never overridden.
91
104
  */
92
105
  autoFitScaling(config, styles) {
93
106
  var _a;
94
- if (config.pixelPerUnit > 0) {
95
- return; // Explicit value — respect it, do not override
107
+ const autoUnit = config.pixelPerUnit <= 0;
108
+ const autoPercent = config.pixelPerPercentage <= 0;
109
+ if (!autoUnit && !autoPercent) {
110
+ return; // Both explicit — nothing to auto-fit
96
111
  }
97
112
  const targetWidth = (_a = this.parentDimensions) === null || _a === void 0 ? void 0 : _a.width;
113
+ const db = this.getDb();
98
114
  if (!targetWidth || targetWidth <= 0) {
99
- config.pixelPerUnit = 1;
100
- this.chart = new StructureChart(new IBCSRuleSet(), config, styles);
115
+ if (autoUnit)
116
+ config.pixelPerUnit = 1;
117
+ if (autoPercent)
118
+ config.pixelPerPercentage = 50;
119
+ this.chart = new StructureChart(new IBCSRuleSet(this.ruleSetConfig), db, this.tableName, config, styles);
101
120
  this.chart.setI18n(this.i18n);
102
121
  return;
103
122
  }
104
- // First pass with pixelPerUnit=1 to measure total width and bar extent
105
- config.pixelPerUnit = 1;
106
- this.chart = new StructureChart(new IBCSRuleSet(), config, styles);
123
+ // First pass: set auto values to 1 and measure total width + bar extent
124
+ if (autoUnit)
125
+ config.pixelPerUnit = 1;
126
+ if (autoPercent)
127
+ config.pixelPerPercentage = 1;
128
+ this.chart = new StructureChart(new IBCSRuleSet(this.ruleSetConfig), db, this.tableName, config, styles);
107
129
  this.chart.setI18n(this.i18n);
108
130
  this.chart.toString();
109
131
  const svgWidth = this.chart.getAllocatedCanvasWidth();
@@ -114,16 +136,21 @@ export class IbcsChartStructure {
114
136
  // totalWidth(ppu) = fixedWidth + maxBarValue * ppu
115
137
  // Solving for ppu: ppu = (targetWidth - fixedWidth) / maxBarValue
116
138
  const maxBarValue = this.chart.getMaxBarValue();
117
- if (maxBarValue > 0) {
118
- const fixedWidth = svgWidth - maxBarValue; // at ppu=1, barExtent = maxBarValue * 1
119
- config.pixelPerUnit = Math.max(0.001, (targetWidth - fixedWidth) / maxBarValue);
139
+ if (autoUnit) {
140
+ if (maxBarValue > 0) {
141
+ const fixedWidth = svgWidth - maxBarValue; // at ppu=1, barExtent = maxBarValue * 1
142
+ config.pixelPerUnit = Math.max(0.001, (targetWidth - fixedWidth) / maxBarValue);
143
+ }
144
+ else {
145
+ config.pixelPerUnit = (targetWidth * 0.9) / svgWidth;
146
+ }
120
147
  }
121
- else {
122
- // Fallback (e.g. relative variance charts)
123
- config.pixelPerUnit = (targetWidth * 0.9) / svgWidth;
148
+ if (autoPercent) {
149
+ // Same ratio approach: scale percentage bars to fill ~90% of width
150
+ config.pixelPerPercentage = (targetWidth * 0.9) / svgWidth;
124
151
  }
125
152
  // Second pass with the corrected scaling
126
- this.chart = new StructureChart(new IBCSRuleSet(), config, styles);
153
+ this.chart = new StructureChart(new IBCSRuleSet(this.ruleSetConfig), db, this.tableName, config, styles);
127
154
  this.chart.setI18n(this.i18n);
128
155
  }
129
156
  async componentWillRender() {
@@ -147,8 +174,9 @@ export class IbcsChartStructure {
147
174
  // }
148
175
  }
149
176
  prepareConfig() {
150
- return new StructureChartComponentConfigAdapter(new StructureChartDataRowAdapter(), new OrderAdapter(new StringAdapter()), new StringAdapter(), new DataFormatDigitsAdapter(), this.data).adapt({
151
- data: this.data,
177
+ const db = this.getDb();
178
+ const fromExpr = this.tableName ? buildFromExpr(this.tableName, this.filter) : "";
179
+ return new StructureChartComponentConfigAdapter(new StructureChartDataRowAdapter(), new OrderAdapter(new StringAdapter()), new StringAdapter(), new DataFormatDigitsAdapter(), db, fromExpr).adapt({
152
180
  scenarios: this.scenarios,
153
181
  variances: this.variances,
154
182
  title: this.chartTitle,
@@ -183,30 +211,45 @@ export class IbcsChartStructure {
183
211
  }
184
212
  static get properties() {
185
213
  return {
186
- "data": {
187
- "type": "unknown",
214
+ "tableName": {
215
+ "type": "string",
188
216
  "mutable": false,
189
217
  "complexType": {
190
- "original": "StructureChartDataRow[]",
191
- "resolved": "StructureChartDataRow[]",
192
- "references": {
193
- "StructureChartDataRow": {
194
- "location": "import",
195
- "path": "./utils/model",
196
- "id": "src/components/bn-chart-structure/utils/model/index.ts::StructureChartDataRow",
197
- "referenceLocation": "StructureChartDataRow"
198
- }
199
- }
218
+ "original": "string",
219
+ "resolved": "string",
220
+ "references": {}
200
221
  },
201
222
  "required": false,
202
223
  "optional": false,
203
224
  "docs": {
204
225
  "tags": [],
205
- "text": ""
226
+ "text": "Name of the dataset (table or view in the shared alasql database)."
206
227
  },
207
228
  "getter": false,
208
229
  "setter": false,
209
- "defaultValue": "[]"
230
+ "reflect": false,
231
+ "attribute": "table-name",
232
+ "defaultValue": "\"\""
233
+ },
234
+ "dataVersion": {
235
+ "type": "number",
236
+ "mutable": false,
237
+ "complexType": {
238
+ "original": "number",
239
+ "resolved": "number",
240
+ "references": {}
241
+ },
242
+ "required": false,
243
+ "optional": false,
244
+ "docs": {
245
+ "tags": [],
246
+ "text": "Bumped by `bn-chart-structure` when the dataset changes; triggers re-render."
247
+ },
248
+ "getter": false,
249
+ "setter": false,
250
+ "reflect": false,
251
+ "attribute": "data-version",
252
+ "defaultValue": "0"
210
253
  },
211
254
  "chartTitle": {
212
255
  "type": "string",
@@ -597,6 +640,30 @@ export class IbcsChartStructure {
597
640
  "getter": false,
598
641
  "setter": false,
599
642
  "defaultValue": "{ width: 0, height: 0 }"
643
+ },
644
+ "ruleSetConfig": {
645
+ "type": "unknown",
646
+ "mutable": false,
647
+ "complexType": {
648
+ "original": "RuleSetConfig",
649
+ "resolved": "RuleSetConfig",
650
+ "references": {
651
+ "RuleSetConfig": {
652
+ "location": "import",
653
+ "path": "../../stores/ruleSets",
654
+ "id": "src/stores/ruleSets.ts::RuleSetConfig",
655
+ "referenceLocation": "RuleSetConfig"
656
+ }
657
+ }
658
+ },
659
+ "required": false,
660
+ "optional": true,
661
+ "docs": {
662
+ "tags": [],
663
+ "text": ""
664
+ },
665
+ "getter": false,
666
+ "setter": false
600
667
  }
601
668
  };
602
669
  }