@bino-bi/bn-template-engine 1.0.0-alpha.9 → 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 (391) 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 +4 -2
  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 +125 -42
  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 +160 -43
  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/editor-companion/editor-companion.js +12 -5
  140. package/dist/collection/context/scopedDb.js +127 -0
  141. package/dist/collection/stores/componentStyles.js +67 -0
  142. package/dist/collection/stores/createScopedStores.js +11 -5
  143. package/dist/collection/stores/internationalization.js +68 -0
  144. package/dist/collection/stores/ruleSets.js +46 -0
  145. package/dist/collection/utils/constants.js +5 -0
  146. package/dist/collection/utils/dataAnalyzer.js +14 -8
  147. package/dist/collection/utils/ibcsRuleSet.js +14 -26
  148. package/dist/collection/utils/layoutObserver.js +88 -0
  149. package/dist/collection/utils/parentDimensions.js +71 -15
  150. package/dist/collection/utils/sanitizeHtml.js +81 -0
  151. package/dist/collection/utils/validate.js +47 -0
  152. package/dist/collection/utils/withBodyObserver.js +12 -7
  153. package/dist/collection/utils/withComponentStyle.js +3 -5
  154. package/dist/collection/utils/withDataset.js +43 -39
  155. package/dist/collection/utils/withDatasource.js +28 -18
  156. package/dist/collection/utils/withInheritedProps.js +26 -1
  157. package/dist/collection/utils/withRuleSet.js +105 -0
  158. package/dist/collection/utils/withScalingGroup.js +69 -0
  159. package/dist/collection/utils/withTranslation.js +50 -14
  160. package/dist/collection/utils/xy/FacetGrid.js +36 -0
  161. package/dist/collection/utils/xy/IsoCurves.js +156 -0
  162. package/dist/collection/utils/xy/NumericScale.js +103 -0
  163. package/dist/collection/utils/xy/PointLabeler.js +96 -0
  164. package/dist/collection/utils/xy/RadiusScale.js +42 -0
  165. package/dist/collection/utils/xy/SeriesPalette.js +80 -0
  166. package/dist/collection/utils/xy/VarianceMeasure.js +76 -0
  167. package/dist/collection/utils/xy/XYFrame.js +120 -0
  168. package/dist/collection/utils/xy/XYLegend.js +107 -0
  169. package/dist/collection/utils/xy/model/AxisConfig.js +221 -0
  170. package/dist/collection/utils/xy/model/ScaleFactorsXYChart.js +69 -0
  171. package/dist/collection/utils/xy/model/XYChartDataRow.js +0 -0
  172. package/dist/collection/utils/xy/model/XYChartStyle.js +52 -0
  173. package/dist/components/AxisConfig.js +1 -0
  174. package/dist/components/CompareUtil.js +1 -0
  175. package/dist/components/DataFormatDigits.js +1 -1
  176. package/dist/components/DateStringFactory.js +1 -1
  177. package/dist/components/LabelCollisionManager.js +1 -0
  178. package/dist/components/NumericScale.js +1 -0
  179. package/dist/components/Order.js +1 -1
  180. package/dist/components/SVGVariancesStyleGroup.js +1 -1
  181. package/dist/components/SiPrefix.js +1 -0
  182. package/dist/components/StringAdapter.js +1 -0
  183. package/dist/components/VarianceMeasure.js +1 -0
  184. package/dist/components/XYChartDataRow.js +1 -0
  185. package/dist/components/bn-body2.js +1 -1
  186. package/dist/components/bn-card2.js +1 -1
  187. package/dist/components/bn-chart-bubble.d.ts +11 -0
  188. package/dist/components/bn-chart-bubble.js +1 -0
  189. package/dist/components/bn-chart-bullet.d.ts +11 -0
  190. package/dist/components/bn-chart-bullet.js +1 -0
  191. package/dist/components/bn-chart-scatter.d.ts +11 -0
  192. package/dist/components/bn-chart-scatter.js +1 -0
  193. package/dist/components/bn-chart-structure.js +1 -1
  194. package/dist/components/bn-chart-time.js +1 -1
  195. package/dist/components/bn-component-style.js +1 -1
  196. package/dist/components/bn-context.js +1 -1
  197. package/dist/components/bn-dataset.js +1 -1
  198. package/dist/components/bn-datasource.js +1 -1
  199. package/dist/components/bn-footer2.js +1 -1
  200. package/dist/components/bn-grid.js +1 -1
  201. package/dist/components/bn-image.js +1 -1
  202. package/dist/components/bn-internationalization.js +1 -1
  203. package/dist/components/bn-layout-card.js +1 -1
  204. package/dist/components/bn-layout-page.js +1 -1
  205. package/dist/components/bn-message2.js +1 -1
  206. package/dist/components/bn-page2.js +1 -1
  207. package/dist/components/bn-ruleset.d.ts +11 -0
  208. package/dist/components/bn-ruleset.js +1 -0
  209. package/dist/components/bn-scaling-group.d.ts +11 -0
  210. package/dist/components/bn-scaling-group.js +1 -0
  211. package/dist/components/bn-table.js +1 -1
  212. package/dist/components/bn-template.js +1 -1
  213. package/dist/components/bn-text.js +1 -1
  214. package/dist/components/bn-title2.js +1 -1
  215. package/dist/components/bn-tree.js +1 -1
  216. package/dist/components/context-protocol.js +1 -1
  217. package/dist/components/editor-companion.js +1 -1
  218. package/dist/components/formatter.js +1 -0
  219. package/dist/components/ibcs-chart-bubble.d.ts +11 -0
  220. package/dist/components/ibcs-chart-bubble.js +1 -0
  221. package/dist/components/ibcs-chart-bubble2.js +1 -0
  222. package/dist/components/ibcs-chart-bullet.d.ts +11 -0
  223. package/dist/components/ibcs-chart-bullet.js +1 -0
  224. package/dist/components/ibcs-chart-bullet2.js +1 -0
  225. package/dist/components/ibcs-chart-scatter.d.ts +11 -0
  226. package/dist/components/ibcs-chart-scatter.js +1 -0
  227. package/dist/components/ibcs-chart-scatter2.js +1 -0
  228. package/dist/components/ibcs-chart-structure2.js +1 -1
  229. package/dist/components/ibcs-chart-time2.js +1 -1
  230. package/dist/components/ibcs-table2.js +1 -1
  231. package/dist/components/ibcs-title2.js +1 -1
  232. package/dist/components/layoutObserver.js +1 -0
  233. package/dist/components/luxon.js +1 -0
  234. package/dist/components/main.js +1 -0
  235. package/dist/components/merge.js +1 -0
  236. package/dist/components/sanitizeHtml.js +1 -0
  237. package/dist/components/stackColors.js +1 -0
  238. package/dist/components/validate.js +1 -1
  239. package/dist/components/withBodyObserver.js +1 -1
  240. package/dist/components/withComponentStyle.js +1 -1
  241. package/dist/components/withDataset.js +1 -0
  242. package/dist/components/withRuleSet.js +1 -0
  243. package/dist/components/withScalingGroup.js +1 -0
  244. package/dist/components/withStyled.js +1 -1
  245. package/dist/components/withTranslation.js +1 -1
  246. package/dist/esm/AxisConfig-C_zWCKlL.js +224 -0
  247. package/dist/esm/LabelCollisionManager-8swVQHKA.js +404 -0
  248. package/dist/esm/NumericScale-DsTzlzxQ.js +105 -0
  249. package/dist/esm/Order-BPeWfygb.js +83 -0
  250. package/dist/esm/SVGStyle-BxEDw9zh.js +8199 -0
  251. package/dist/esm/SVGVariancesStyleGroup-DRQYvSDD.js +48 -0
  252. package/dist/esm/VarianceMeasure-DnwNKspZ.js +364 -0
  253. package/dist/esm/XYChartDataRow-DeV4r-Wm.js +820 -0
  254. package/dist/esm/bn-asset_21.entry.js +16025 -0
  255. package/dist/esm/bn-chart-bubble.entry.js +760 -0
  256. package/dist/esm/bn-chart-bullet.entry.js +783 -0
  257. package/dist/esm/bn-chart-scatter.entry.js +656 -0
  258. package/dist/esm/bn-grid.entry.js +5 -3
  259. package/dist/esm/bn-image.entry.js +5 -3
  260. package/dist/esm/bn-internationalization.entry.js +10 -8
  261. package/dist/esm/bn-ruleset.entry.js +39 -0
  262. package/dist/esm/bn-template-engine.js +1 -1
  263. package/dist/esm/bn-template.entry.js +1 -1
  264. package/dist/esm/bn-text.entry.js +7 -78
  265. package/dist/esm/bn-tree.entry.js +4 -2
  266. package/dist/esm/context-protocol-1Yj1uKvh.js +9484 -0
  267. package/dist/esm/editor-companion.entry.js +13 -6
  268. package/dist/esm/ibcs-chart-bubble.entry.js +622 -0
  269. package/dist/esm/ibcs-chart-bullet.entry.js +671 -0
  270. package/dist/esm/ibcs-chart-scatter.entry.js +665 -0
  271. package/dist/esm/layoutObserver-BG5dOBYH.js +196 -0
  272. package/dist/esm/loader.js +1 -1
  273. package/dist/esm/sanitizeHtml-BA48JiHe.js +83 -0
  274. package/dist/esm/scaling-CeSRcRl1.js +579 -0
  275. package/dist/esm/{withBodyObserver-AFk2wwHT.js → withBodyObserver-IokS6fHD.js} +12 -7
  276. package/dist/esm/withScalingGroup-Br70pAv9.js +71 -0
  277. package/dist/esm/withStyled-Br2DGTPs.js +1104 -0
  278. package/dist/types/components/bn-chart-bubble/bn-chart-bubble.d.ts +193 -0
  279. package/dist/types/components/bn-chart-bubble/ibcs-chart-bubble.d.ts +58 -0
  280. package/dist/types/components/bn-chart-bubble/utils/BubbleChart.d.ts +91 -0
  281. package/dist/types/components/bn-chart-bullet/bn-chart-bullet.d.ts +172 -0
  282. package/dist/types/components/bn-chart-bullet/ibcs-chart-bullet.d.ts +52 -0
  283. package/dist/types/components/bn-chart-bullet/utils/BulletChart.d.ts +91 -0
  284. package/dist/types/components/bn-chart-bullet/utils/model/BulletChartStyle.d.ts +70 -0
  285. package/dist/types/components/bn-chart-bullet/utils/model/BulletConfig.d.ts +43 -0
  286. package/dist/types/components/bn-chart-bullet/utils/model/index.d.ts +2 -0
  287. package/dist/types/components/bn-chart-scatter/bn-chart-scatter.d.ts +172 -0
  288. package/dist/types/components/bn-chart-scatter/ibcs-chart-scatter.d.ts +53 -0
  289. package/dist/types/components/bn-chart-scatter/utils/ScatterChart.d.ts +66 -0
  290. package/dist/types/components/bn-chart-structure/bn-chart-structure.d.ts +19 -5
  291. package/dist/types/components/bn-chart-structure/ibcs-chart-structure.d.ts +13 -6
  292. package/dist/types/components/bn-chart-structure/utils/StructureChart.d.ts +16 -12
  293. package/dist/types/components/bn-chart-structure/utils/helper/ElementPositions.d.ts +16 -1
  294. package/dist/types/components/bn-chart-structure/utils/model/StructureChartComponentConfig.d.ts +5 -3
  295. package/dist/types/components/bn-chart-time/bn-chart-time.d.ts +53 -13
  296. package/dist/types/components/bn-chart-time/ibcs-chart-time.d.ts +13 -6
  297. package/dist/types/components/bn-chart-time/utils/TimeChart.d.ts +16 -12
  298. package/dist/types/components/bn-chart-time/utils/model/TimeChartComponentConfig.d.ts +5 -3
  299. package/dist/types/components/bn-dataset/bn-dataset.d.ts +47 -5
  300. package/dist/types/components/bn-datasource/bn-datasource.d.ts +53 -6
  301. package/dist/types/components/bn-layout-card/bn-layout-card.d.ts +35 -8
  302. package/dist/types/components/bn-layout-page/bn-layout-page.d.ts +32 -1
  303. package/dist/types/components/bn-message/bn-message.d.ts +5 -2
  304. package/dist/types/components/bn-ruleset/bn-ruleset.d.ts +8 -0
  305. package/dist/types/components/bn-scaling-group/bn-scaling-group.d.ts +37 -0
  306. package/dist/types/components/bn-table/bn-table.d.ts +74 -12
  307. package/dist/types/components/bn-table/ibcs-table.d.ts +27 -4
  308. package/dist/types/components/bn-table/utils/Table.d.ts +16 -6
  309. package/dist/types/components/bn-table/utils/elements/Cell.d.ts +2 -0
  310. package/dist/types/components/bn-table/utils/elements/CellBarChart.d.ts +33 -0
  311. package/dist/types/components/bn-table/utils/elements/TableRow.d.ts +2 -1
  312. package/dist/types/components/bn-table/utils/elements/WaterfallBar.d.ts +21 -0
  313. package/dist/types/components/bn-table/utils/elements/index.d.ts +1 -0
  314. package/dist/types/components/bn-table/utils/factories/tableDataSetFactory.d.ts +17 -9
  315. package/dist/types/components/bn-table/utils/helper/DataQuery.d.ts +35 -3
  316. package/dist/types/components/bn-table/utils/helper/IntervalColumns.d.ts +37 -0
  317. package/dist/types/components/bn-table/utils/helper/QueryGroup.d.ts +4 -5
  318. package/dist/types/components/bn-table/utils/helper/WaterfallCalculator.d.ts +55 -0
  319. package/dist/types/components/bn-table/utils/helper/index.d.ts +2 -0
  320. package/dist/types/components/bn-table/utils/model/TableAttribute.d.ts +22 -0
  321. package/dist/types/components/bn-table/utils/model/TableComponentConfig.d.ts +12 -3
  322. package/dist/types/components/bn-table/utils/model/index.d.ts +21 -0
  323. package/dist/types/components/bn-title/bn-title.d.ts +11 -1
  324. package/dist/types/components/bn-title/ibcs-title/ibcs-title.d.ts +2 -0
  325. package/dist/types/components/bn-title/ibcs-title/utils/Title.d.ts +1 -0
  326. package/dist/types/components/editor-companion/editor-companion.d.ts +2 -0
  327. package/dist/types/components.d.ts +1691 -120
  328. package/dist/types/context/context-protocol.d.ts +7 -3
  329. package/dist/types/context/scopedDb.d.ts +37 -0
  330. package/dist/types/stores/componentStyles.d.ts +41 -0
  331. package/dist/types/stores/createScopedStores.d.ts +4 -2
  332. package/dist/types/stores/ruleSets.d.ts +40 -0
  333. package/dist/types/utils/DateStringFactory.d.ts +1 -1
  334. package/dist/types/utils/constants.d.ts +5 -0
  335. package/dist/types/utils/dataAnalyzer.d.ts +2 -1
  336. package/dist/types/utils/ibcsRuleSet.d.ts +6 -1
  337. package/dist/types/utils/layoutObserver.d.ts +27 -0
  338. package/dist/types/utils/model/ChartStyles.d.ts +2 -1
  339. package/dist/types/utils/parentDimensions.d.ts +1 -1
  340. package/dist/types/utils/sanitizeHtml.d.ts +6 -0
  341. package/dist/types/utils/validate.d.ts +18 -0
  342. package/dist/types/utils/withDataset.d.ts +6 -2
  343. package/dist/types/utils/withDatasource.d.ts +3 -3
  344. package/dist/types/utils/withInheritedProps.d.ts +19 -0
  345. package/dist/types/utils/withRuleSet.d.ts +24 -0
  346. package/dist/types/utils/withScalingGroup.d.ts +14 -0
  347. package/dist/types/utils/withTranslation.d.ts +12 -4
  348. package/dist/types/utils/xy/FacetGrid.d.ts +27 -0
  349. package/dist/types/utils/xy/IsoCurves.d.ts +46 -0
  350. package/dist/types/utils/xy/NumericScale.d.ts +41 -0
  351. package/dist/types/utils/xy/PointLabeler.d.ts +58 -0
  352. package/dist/types/utils/xy/RadiusScale.d.ts +26 -0
  353. package/dist/types/utils/xy/SeriesPalette.d.ts +59 -0
  354. package/dist/types/utils/xy/VarianceMeasure.d.ts +37 -0
  355. package/dist/types/utils/xy/XYFrame.d.ts +44 -0
  356. package/dist/types/utils/xy/XYLegend.d.ts +43 -0
  357. package/dist/types/utils/xy/model/AxisConfig.d.ts +96 -0
  358. package/dist/types/utils/xy/model/ScaleFactorsXYChart.d.ts +36 -0
  359. package/dist/types/utils/xy/model/XYChartDataRow.d.ts +157 -0
  360. package/dist/types/utils/xy/model/XYChartStyle.d.ts +31 -0
  361. package/package.json +5 -4
  362. package/readme.md +9 -5
  363. package/dist/bn-template-engine/p-3141c4a2.entry.js +0 -1
  364. package/dist/bn-template-engine/p-67538176.entry.js +0 -1
  365. package/dist/bn-template-engine/p-916296a5.entry.js +0 -1
  366. package/dist/bn-template-engine/p-96006b06.entry.js +0 -1
  367. package/dist/bn-template-engine/p-Ck-NYtot.js +0 -1
  368. package/dist/bn-template-engine/p-CnDq0oVa.js +0 -1
  369. package/dist/bn-template-engine/p-DSXNgKLa.js +0 -1
  370. package/dist/bn-template-engine/p-bc711fb0.entry.js +0 -1
  371. package/dist/bn-template-engine/p-c86395b8.entry.js +0 -1
  372. package/dist/bn-template-engine/p-e6f646b1.entry.js +0 -1
  373. package/dist/bn-template-engine/p-f41d9242.entry.js +0 -1
  374. package/dist/bn-template-engine/p-gFbbuhtl.js +0 -1
  375. package/dist/cjs/bn-asset_20.cjs.entry.js +0 -23547
  376. package/dist/cjs/context-protocol-ohYzcb5F.js +0 -663
  377. package/dist/cjs/scaling-CIAClQR5.js +0 -314
  378. package/dist/cjs/withStyled-qd94SSb4.js +0 -9535
  379. package/dist/collection/stores/datasets.js +0 -14
  380. package/dist/collection/stores/datasources.js +0 -14
  381. package/dist/components/_commonjsHelpers.js +0 -1
  382. package/dist/components/alasql.min.js +0 -1
  383. package/dist/components/ibcsRuleSet.js +0 -1
  384. package/dist/components/scaling.js +0 -1
  385. package/dist/components/withInheritedProps.js +0 -1
  386. package/dist/esm/bn-asset_20.entry.js +0 -23526
  387. package/dist/esm/context-protocol-DdbSplvE.js +0 -656
  388. package/dist/esm/scaling-DGKKkuL9.js +0 -309
  389. package/dist/esm/withStyled-BIkqU2w4.js +0 -9501
  390. package/dist/types/stores/datasets.d.ts +0 -14
  391. package/dist/types/stores/datasources.d.ts +0 -14
@@ -3,13 +3,16 @@ import { isBlankInput, isValidAxisLabelsMode, isValidBoolean, isValidDateFormat,
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 { OrderColumn, OrderDirection } from "../../utils/model/Order";
14
17
  import { Formatter } from "../../utils/formatter";
15
18
  import { AxisLabelsMode, ChartMode, StackBy, StackMode, StackOrder } from "../../utils/constants";
@@ -112,7 +115,8 @@ export class Chart {
112
115
  }
113
116
  validatePercentageScaling(newValue) {
114
117
  const errId = "ERR_percentageScaling";
115
- if (!isValidNumber(newValue) && !this.pixelPerUnitGroupMap.has(newValue)) {
118
+ const isAuto = (newValue === null || newValue === void 0 ? void 0 : newValue.toString().trim().toLowerCase()) === "auto";
119
+ if (!isAuto && !isValidNumber(newValue) && !this.pixelPerUnitGroupMap.has(newValue)) {
116
120
  this.errors.addOrReplace({
117
121
  id: errId,
118
122
  type: "warning",
@@ -336,9 +340,13 @@ export class Chart {
336
340
  }
337
341
  }
338
342
  constructor() {
339
- this.data = [];
343
+ /** Active dataset name (the last subscribed dataset to fire `onUpdate`). */
344
+ this.datasetName = "";
345
+ /** Bumped on every data update so Stencil re-renders even when the name is unchanged. */
346
+ this.dataVersion = 0;
340
347
  this.datasetMeta = null;
341
348
  this.appliedScaleFactor = 1;
349
+ this.layoutObserver = null;
342
350
  /**
343
351
  * Custom chart title
344
352
  */
@@ -394,7 +402,9 @@ export class Chart {
394
402
  * scenario by this data dimension. Must be finer than `level`.
395
403
  * - `mode` (optional, default `"absolute"`):
396
404
  * - `"absolute"` — additive stacking, axis shows absolute units.
397
- * - `"relative"` — 100% stacking, axis shows 0%–100%.
405
+ * - `"relative"` — 100% stacking, axis shows 0%–100%. `unit-scaling` is
406
+ * interpreted as pixels per percentage point (e.g. `0.4` → 40px full
407
+ * stack); `"auto"` fits the stack to the available height as usual.
398
408
  * - `"absolute-relative"` — bar height is absolute (real value), but
399
409
  * segment labels inside show percentages.
400
410
  * - `order` (optional, default `"dataset"`): Segment order within each stack.
@@ -475,16 +485,22 @@ export class Chart {
475
485
  this.measureUnit = "";
476
486
  this.pixelPerUnitGroupMap = new Map();
477
487
  this._autoScaleGuard = false;
488
+ this._lastObservedWidth = 0;
489
+ this._settleTimer = null;
490
+ this._lastAppliedHeight = 0;
478
491
  withStyled(this);
479
492
  withComponentStatus(this);
480
- withDataset(this, (_name, data) => {
481
- this.data = (data || []);
493
+ withDataset(this, (name, _data) => {
494
+ this.datasetName = (name === null || name === void 0 ? void 0 : name.startsWith("$")) ? name.substring(1) : name || "";
495
+ this.dataVersion = this.dataVersion + 1;
482
496
  }, (_name, meta) => {
483
497
  this.datasetMeta = meta;
484
498
  });
485
499
  this.chartTemplate = this.chartTemplate.bind(this);
486
500
  this.errors = withHasError(this);
501
+ withScalingGroup(this);
487
502
  this.componentStyle = withComponentStyle(this);
503
+ this.ruleSetConfig = withRuleSet(this);
488
504
  this.t = withTranslation(this).t;
489
505
  this.resolveInherited = withInheritedProps(this, [
490
506
  { propName: "scenarios", ancestorAttr: "title-scenarios" },
@@ -517,11 +533,9 @@ export class Chart {
517
533
  this.validateScaling(this.scale);
518
534
  }
519
535
  componentDidRender() {
520
- var _a, _b;
521
536
  const { mode } = parseScaling(this.scale);
522
537
  if (mode !== "auto" && mode !== "empty") {
523
538
  this._autoScaleGuard = false;
524
- // Keep existing width-based overflow warning for non-auto modes
525
539
  const parent = getParentDimensions(this.element);
526
540
  const errId = "WARN_overflow";
527
541
  if (parent.width > 0 && this.element.scrollWidth > parent.width + 1) {
@@ -544,23 +558,25 @@ export class Chart {
544
558
  const { width: parentWidth } = getParentDimensions(host);
545
559
  if (parentWidth <= 0)
546
560
  return;
547
- // Measure at base (unscaled) font size to get true content width
561
+ // Keep observer tracking in sync so the observer callback does not
562
+ // trigger spurious forceUpdate calls with stale threshold values.
563
+ this._lastObservedWidth = parentWidth;
548
564
  const baseFontSize = this.componentStyle(($) => { var _a; return ((_a = $["global"]) === null || _a === void 0 ? void 0 : _a["fontSizePx"]) || 13.3333; });
549
- host.style.setProperty("--bn-font-size", `${baseFontSize}px`);
550
- // Reading scrollWidth forces a synchronous reflow at base size
551
- const div = (_a = host.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(".container");
552
- const unscaledWidth = (_b = div === null || div === void 0 ? void 0 : div.scrollWidth) !== null && _b !== void 0 ? _b : host.scrollWidth;
553
- if (unscaledWidth <= parentWidth + 1) {
565
+ const currentWidth = host.scrollWidth;
566
+ const currentFactor = this.appliedScaleFactor;
567
+ // Content fits at current factor — done. Don't reset to factor 1;
568
+ // the content only fits BECAUSE of the current factor.
569
+ if (currentWidth <= parentWidth + 1) {
554
570
  this.errors.remove("AUTO_scale");
555
- if (this.appliedScaleFactor !== 1) {
556
- this._autoScaleGuard = true;
557
- writeTask(() => {
558
- this.appliedScaleFactor = 1;
559
- });
560
- }
561
571
  return;
562
572
  }
563
- const computedFactor = (parentWidth - 1) / unscaledWidth;
573
+ // Content overflows. Compute a new factor based on the ratio of
574
+ // parent to current content width, scaled by the current factor.
575
+ const computedFactor = Math.max(0.3, (currentFactor * (parentWidth - 1)) / currentWidth);
576
+ // Only apply if the change is significant (> 1% of current factor).
577
+ if (Math.abs(computedFactor - currentFactor) < 0.01) {
578
+ return;
579
+ }
564
580
  host.style.setProperty("--bn-font-size", `${baseFontSize * computedFactor}px`);
565
581
  if (mode === "empty") {
566
582
  this.errors.addOrReplace({
@@ -572,25 +588,75 @@ export class Chart {
572
588
  else {
573
589
  this.errors.remove("AUTO_scale");
574
590
  }
575
- if (Math.abs(computedFactor - this.appliedScaleFactor) > 0.001) {
576
- this._autoScaleGuard = true;
577
- writeTask(() => {
578
- this.appliedScaleFactor = computedFactor;
579
- });
580
- }
591
+ this._autoScaleGuard = true;
592
+ writeTask(() => {
593
+ this.appliedScaleFactor = computedFactor;
594
+ });
581
595
  }
582
596
  componentDidLoad() {
583
- // If the initial parentDimensions measurement returned 0 (common inside
584
- // cards/slots whose width isn't known before first paint), defer re-check
585
- // to a requestAnimationFrame so the browser has completed at least one
586
- // full layout pass before we re-measure.
587
- if (this.canvasWidthSegmented <= 0) {
597
+ // Watch for size changes (window resize, card relayout).
598
+ this.layoutObserver = observeParentResize(this.element, () => {
599
+ if (this._autoScaleGuard)
600
+ return;
601
+ const { width } = getParentDimensions(this.element);
602
+ // Only react to WIDTH changes — this chart scales by width.
603
+ // Height changes (e.g. from page-fit-to-content auto grid rows)
604
+ // are irrelevant and would cause an infinite render loop.
605
+ if (width > 0 && Math.abs(width - this._lastObservedWidth) > 2) {
606
+ this._lastObservedWidth = width;
607
+ forceUpdate(this);
608
+ }
609
+ });
610
+ // Double-rAF: guarantees the browser completed at least one full
611
+ // paint cycle so all nested card/body/grid layouts are finalized.
612
+ requestAnimationFrame(() => {
588
613
  requestAnimationFrame(() => {
614
+ if (this._autoScaleGuard)
615
+ return;
589
616
  const { width } = getParentDimensions(this.element);
590
- if (width > 0) {
591
- forceUpdate(this);
592
- }
617
+ this._lastObservedWidth = width;
618
+ forceUpdate(this);
593
619
  });
620
+ });
621
+ this.settleParentHeight();
622
+ }
623
+ /**
624
+ * The initial renders can measure mid-hydration, before ancestor CSS
625
+ * (fixed page height, overflow) is applied, so the height used for
626
+ * auto-fit may be a transient value — and the resize observer above
627
+ * deliberately ignores height changes. Re-measure on a short backoff
628
+ * schedule and re-render when the measurement no longer matches the
629
+ * height the last render actually used (_lastAppliedHeight, recorded
630
+ * in prepareDimension). The schedule is finite, so this cannot feed a
631
+ * render loop.
632
+ */
633
+ settleParentHeight() {
634
+ const delays = [150, 400, 1000, 2500];
635
+ const check = () => {
636
+ this._settleTimer = null;
637
+ if (!this.element.isConnected)
638
+ return;
639
+ const { height } = getParentDimensions(this.element);
640
+ // 8px threshold: hydration corrections are large (hundreds of px);
641
+ // small jitter must not cause re-renders, because every re-render
642
+ // gives the width-overflow font scaler a chance to ratchet down.
643
+ if (height > 0 && Math.abs(height - this._lastAppliedHeight) > 8 && !this._autoScaleGuard) {
644
+ forceUpdate(this);
645
+ }
646
+ const next = delays.shift();
647
+ if (next !== undefined) {
648
+ this._settleTimer = setTimeout(check, next);
649
+ }
650
+ };
651
+ this._settleTimer = setTimeout(check, delays.shift());
652
+ }
653
+ disconnectedCallback() {
654
+ var _a;
655
+ (_a = this.layoutObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
656
+ this.layoutObserver = null;
657
+ if (this._settleTimer != null) {
658
+ clearTimeout(this._settleTimer);
659
+ this._settleTimer = null;
594
660
  }
595
661
  }
596
662
  prepareDimension() {
@@ -598,6 +664,7 @@ export class Chart {
598
664
  const scenariosList = this.prepareScenarios();
599
665
  const variancesList = this.prepareVariances();
600
666
  this.canvasWidthSegmented = parent.width / (scenariosList.length + variancesList.length || 1);
667
+ this._lastAppliedHeight = parent.height;
601
668
  return { width: this.canvasWidthSegmented, height: parent.height };
602
669
  }
603
670
  prepareScenarios() {
@@ -679,10 +746,25 @@ export class Chart {
679
746
  return 0;
680
747
  }
681
748
  preparePixelPerPercentage() {
749
+ var _a;
682
750
  if (this.pixelPerUnitGroupMap.has(this.percentageScaling)) {
683
751
  return this.pixelPerUnitGroupMap.get(this.percentageScaling);
684
752
  }
685
- return Number(this.percentageScaling) * 100;
753
+ if (((_a = this.percentageScaling) === null || _a === void 0 ? void 0 : _a.toString().trim().toLowerCase()) === "auto") {
754
+ this.errors.remove("AUTO_percentageScaling");
755
+ return 0;
756
+ }
757
+ const numeric = Number(this.percentageScaling);
758
+ if (!isNaN(numeric) && numeric > 0) {
759
+ this.errors.remove("AUTO_percentageScaling");
760
+ return numeric * 100;
761
+ }
762
+ this.errors.addOrReplace({
763
+ id: "AUTO_percentageScaling",
764
+ type: "warning",
765
+ message: `percentage-scaling: not set, auto-calculated to fit available space.`,
766
+ });
767
+ return 0;
686
768
  }
687
769
  prepareLevel() {
688
770
  var _a, _b, _c;
@@ -956,7 +1038,7 @@ export class Chart {
956
1038
  const stackConfig = this.prepareStackConfig();
957
1039
  const scenarios = this.prepareScenarios();
958
1040
  const effectiveScenarios = (stackConfig === null || stackConfig === void 0 ? void 0 : stackConfig.by) === StackBy.DIMENSIONS ? scenarios.slice(0, 1) : scenarios;
959
- return (h("ibcs-chart-time", { data: this.data, chartTitle: this.prepareChartTitle(idx), scenarios: effectiveScenarios, variances: [localScenarioString], hideAxisLabels: this.prepareHideAxisLabels(idx), pixelPerUnit: ppu > 0 ? ppu * effectiveFactor : 0, pixelPerPercentage: ppp > 0 ? ppp * effectiveFactor : 0, limit: this.prepareLimit(), leftSideOffsetForHorizontalSync: this.prepareLeftSideOffset(preparedI18n, preparedStyle), styles: preparedStyle, i18n: preparedI18n, order: this.prepareOrder(), level: this.prepareLevel(), dateInterval: this.prepareDateInterval(), intervalSpanLimit: this.prepareIntervalSpanLimit(), axisLabelsMode: this.prepareAxisLabelsMode(), filter: this.prepareFilter(), "measure-scale": this.prepareMeasureScale(), "measure-unit": this.prepareMeasureUnit(), showOverlayAvg: this.prepareAvg(), showOverlayMedian: this.prepareMedian(), showMeasureScale: this.prepareShowMeasureScale(idx), chartMode: this.prepareChartMode(), maxBars: this.prepareMaxBars(), stackConfig: stackConfig, lineFullWidth: this.prepareLineFullWidth(), containerWidth: fullParentWidth, parentDimensions: this.prepareDimension() }));
1041
+ return (h("ibcs-chart-time", { tableName: this.datasetName, dataVersion: this.dataVersion, chartTitle: this.prepareChartTitle(idx), scenarios: effectiveScenarios, variances: [localScenarioString], hideAxisLabels: this.prepareHideAxisLabels(idx), pixelPerUnit: ppu > 0 ? ppu * effectiveFactor : 0, pixelPerPercentage: ppp > 0 ? ppp * effectiveFactor : 0, limit: this.prepareLimit(), leftSideOffsetForHorizontalSync: this.prepareLeftSideOffset(preparedI18n, preparedStyle), styles: preparedStyle, i18n: preparedI18n, order: this.prepareOrder(), level: this.prepareLevel(), dateInterval: this.prepareDateInterval(), intervalSpanLimit: this.prepareIntervalSpanLimit(), axisLabelsMode: this.prepareAxisLabelsMode(), filter: this.prepareFilter(), "measure-scale": this.prepareMeasureScale(), "measure-unit": this.prepareMeasureUnit(), showOverlayAvg: this.prepareAvg(), showOverlayMedian: this.prepareMedian(), showMeasureScale: this.prepareShowMeasureScale(idx), chartMode: this.prepareChartMode(), maxBars: this.prepareMaxBars(), stackConfig: stackConfig, lineFullWidth: this.prepareLineFullWidth(), containerWidth: fullParentWidth, parentDimensions: this.prepareDimension(), ruleSetConfig: this.ruleSetConfig() }));
960
1042
  }
961
1043
  getEffectiveScaleFactor() {
962
1044
  const { mode, factor } = parseScaling(this.scale);
@@ -986,7 +1068,7 @@ export class Chart {
986
1068
  scenariosArray = [...scenariosArray, ...variancesArray];
987
1069
  }
988
1070
  const fontStyles = this.getFontStyles();
989
- return (h(Host, { key: '7844e63a4b52baffd9d82cc5063df5623c7fd2ae', style: fontStyles }, h("div", { key: '5e1ac0a43a1e2176a122f1ac1211963a92b6e782', class: "container" }, scenariosArray.map(this.chartTemplate))));
1071
+ return (h(Host, { key: 'df8b91008f6f0d178bd3df91eb99a338f1734f27', style: fontStyles }, h("div", { key: '094f47f7f698b8cd87096066ae608b67c1258d71', class: "container" }, scenariosArray.map(this.chartTemplate))));
990
1072
  }
991
1073
  static get is() { return "bn-chart-time"; }
992
1074
  static get encapsulation() { return "shadow"; }
@@ -1002,6 +1084,25 @@ export class Chart {
1002
1084
  }
1003
1085
  static get properties() {
1004
1086
  return {
1087
+ "ruleset": {
1088
+ "type": "string",
1089
+ "mutable": false,
1090
+ "complexType": {
1091
+ "original": "string",
1092
+ "resolved": "string",
1093
+ "references": {}
1094
+ },
1095
+ "required": false,
1096
+ "optional": true,
1097
+ "docs": {
1098
+ "tags": [],
1099
+ "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`."
1100
+ },
1101
+ "getter": false,
1102
+ "setter": false,
1103
+ "reflect": true,
1104
+ "attribute": "ruleset"
1105
+ },
1005
1106
  "chartTitle": {
1006
1107
  "type": "string",
1007
1108
  "mutable": false,
@@ -1131,8 +1232,17 @@ export class Chart {
1131
1232
  "required": true,
1132
1233
  "optional": false,
1133
1234
  "docs": {
1134
- "tags": [],
1135
- "text": "Name of the 'scaling-group' which the chart uses\nscaling groups are maintained globally\n<br /> <br />\nalternatively a number which represent the\npixel per measure unit."
1235
+ "tags": [{
1236
+ "name": "example",
1237
+ "text": "unit-scaling=\"auto\""
1238
+ }, {
1239
+ "name": "example",
1240
+ "text": "unit-scaling=\"0.05\""
1241
+ }, {
1242
+ "name": "example",
1243
+ "text": "unit-scaling=\"revenue-scale\""
1244
+ }],
1245
+ "text": "Controls vertical bar scaling (pixels per data unit).\n\n| Value | Behavior |\n|----------------|-----------------------------------------------------------------|\n| `\"auto\"` | Auto-fit bars to fill the available container height |\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 |"
1136
1246
  },
1137
1247
  "getter": false,
1138
1248
  "setter": false,
@@ -1150,8 +1260,14 @@ export class Chart {
1150
1260
  "required": true,
1151
1261
  "optional": false,
1152
1262
  "docs": {
1153
- "tags": [],
1154
- "text": "Name of the 'scaling-group' which the chart uses\nscaling groups are maintained globally\n<br /> <br />\nalternatively a number which represent the\npixel per percentage."
1263
+ "tags": [{
1264
+ "name": "example",
1265
+ "text": "percentage-scaling=\"50\""
1266
+ }, {
1267
+ "name": "example",
1268
+ "text": "percentage-scaling=\"pct-scale\""
1269
+ }],
1270
+ "text": "Pixels per percentage point for relative variance bars/pins.\n\n| Value | Behavior |\n|----------------|---------------------------------------------------------------|\n| `\"auto\"` | Auto-fit to available height (same two-pass as unit-scaling) |\n| not set / `\"\"` | Same as auto with `AUTO_percentageScaling` warning |\n| `\"50\"`, `1.5` | Explicit pixels-per-percentage-point value |\n| group name | References a `<bn-scaling-group>` for synchronized scaling |"
1155
1271
  },
1156
1272
  "getter": false,
1157
1273
  "setter": false,
@@ -1295,7 +1411,7 @@ export class Chart {
1295
1411
  "name": "example",
1296
1412
  "text": "// Stack by category, relative mode\nstack='{\"by\":\"category\",\"mode\":\"relative\"}'"
1297
1413
  }],
1298
- "text": "Stacking configuration for the chart as a JSON string.\n\nWhen set, bars/columns are drawn stacked (additive layers) instead of\nside-by-side. In line mode (`chart-mode=\"line\"`), stacking produces a\nstacked area chart with filled regions between cumulative lines.\n\n**JSON schema:**\n```json\n{\n \"by\": \"scenario\" | \"category\" | \"subcategory\" | \"rowgroup\",\n \"mode\": \"absolute\" | \"relative\" | \"absolute-relative\",\n \"order\": \"asc\" | \"desc\" | \"dataset\"\n}\n```\n\n- `by` (required): The dimension to stack.\n - `\"scenario\"` \u2014 stack the scenarios from the `scenarios` prop as layers.\n - `\"category\"` / `\"subcategory\"` / `\"rowgroup\"` \u2014 decompose a single\n scenario by this data dimension. Must be finer than `level`.\n- `mode` (optional, default `\"absolute\"`):\n - `\"absolute\"` \u2014 additive stacking, axis shows absolute units.\n - `\"relative\"` \u2014 100% stacking, axis shows 0%\u2013100%.\n - `\"absolute-relative\"` \u2014 bar height is absolute (real value), but\n segment labels inside show percentages.\n- `order` (optional, default `\"dataset\"`): Segment order within each stack.\n `\"asc\"` / `\"desc\"` sort segments by value; `\"dataset\"` preserves the\n original data/scenario order."
1414
+ "text": "Stacking configuration for the chart as a JSON string.\n\nWhen set, bars/columns are drawn stacked (additive layers) instead of\nside-by-side. In line mode (`chart-mode=\"line\"`), stacking produces a\nstacked area chart with filled regions between cumulative lines.\n\n**JSON schema:**\n```json\n{\n \"by\": \"scenario\" | \"category\" | \"subcategory\" | \"rowgroup\",\n \"mode\": \"absolute\" | \"relative\" | \"absolute-relative\",\n \"order\": \"asc\" | \"desc\" | \"dataset\"\n}\n```\n\n- `by` (required): The dimension to stack.\n - `\"scenario\"` \u2014 stack the scenarios from the `scenarios` prop as layers.\n - `\"category\"` / `\"subcategory\"` / `\"rowgroup\"` \u2014 decompose a single\n scenario by this data dimension. Must be finer than `level`.\n- `mode` (optional, default `\"absolute\"`):\n - `\"absolute\"` \u2014 additive stacking, axis shows absolute units.\n - `\"relative\"` \u2014 100% stacking, axis shows 0%\u2013100%. `unit-scaling` is\n interpreted as pixels per percentage point (e.g. `0.4` \u2192 40px full\n stack); `\"auto\"` fits the stack to the available height as usual.\n - `\"absolute-relative\"` \u2014 bar height is absolute (real value), but\n segment labels inside show percentages.\n- `order` (optional, default `\"dataset\"`): Segment order within each stack.\n `\"asc\"` / `\"desc\"` sort segments by value; `\"dataset\"` preserves the\n original data/scenario order."
1299
1415
  },
1300
1416
  "getter": false,
1301
1417
  "setter": false,
@@ -1505,7 +1621,8 @@ export class Chart {
1505
1621
  }
1506
1622
  static get states() {
1507
1623
  return {
1508
- "data": {},
1624
+ "datasetName": {},
1625
+ "dataVersion": {},
1509
1626
  "datasetMeta": {},
1510
1627
  "appliedScaleFactor": {}
1511
1628
  };
@@ -3,6 +3,8 @@ import { TimeChart } from "./utils/TimeChart";
3
3
  import { CustomPattern } from "./utils/helper";
4
4
  import { TimeChartComponentConfigAdapter, } from "./utils/model/TimeChartComponentConfig";
5
5
  import { TimeChartDataRowAdapter } from "./utils/model/TimeChartDataRow";
6
+ import { getStores } from "../../context/context-protocol";
7
+ import { buildFromExpr } from "../../context/scopedDb";
6
8
  import { TimeChartStylesAdapter } from "./utils/model/styles/TimeChartStyle";
7
9
  import { ScaleFactorsTimeChartAdapter } from "./utils/model/styles/ScaleFactorsTimeChart";
8
10
  import { DateDistance } from "../../utils/DateStringFactory";
@@ -18,8 +20,10 @@ import { SVGStyleGroupAdapter } from "../../utils/model/styles/SVGStyleGroup";
18
20
  import { SVGVariancesStyleGroupAdapter } from "../../utils/model/styles/SVGVariancesStyleGroup";
19
21
  export class IbcsChartTime {
20
22
  constructor() {
21
- // @Prop() dimension: { height: number, width: number } = {height: 400, width: 450};
22
- this.data = [];
23
+ /** Name of the dataset (table or view in the shared alasql database). */
24
+ this.tableName = "";
25
+ /** Bumped by `bn-chart-time` when the dataset changes; triggers re-render. */
26
+ this.dataVersion = 0;
23
27
  this.scenarios = [];
24
28
  this.variances = []; //["dfc_ac_neg"]
25
29
  this.hideAxisLabels = false; //false
@@ -50,6 +54,11 @@ export class IbcsChartTime {
50
54
  this.dataFormatDigits = { percent: 2, decimal: 1 };
51
55
  this.parentDimensions = { width: 0, height: 0 };
52
56
  }
57
+ getDb() {
58
+ if (!this.stores)
59
+ this.stores = getStores(this.element);
60
+ return this.stores.db.db;
61
+ }
53
62
  render() {
54
63
  var _a, _b, _c;
55
64
  if (this.chart === undefined) {
@@ -66,7 +75,7 @@ export class IbcsChartTime {
66
75
  const config = this.prepareConfig();
67
76
  const styles = this.prepareStyle();
68
77
  const availableWidth = this.containerWidth || 0;
69
- this.chart = new TimeChart(new IBCSRuleSet(), config, styles, availableWidth);
78
+ this.chart = new TimeChart(new IBCSRuleSet(this.ruleSetConfig), this.getDb(), this.tableName, config, styles, availableWidth);
70
79
  this.chart.setI18n(this.i18n);
71
80
  this.autoFitScaling(config, styles);
72
81
  this.chart.setAvailableHeight(((_a = this.parentDimensions) === null || _a === void 0 ? void 0 : _a.height) || 0);
@@ -83,6 +92,7 @@ export class IbcsChartTime {
83
92
  this.chart.setI18n(this.i18n);
84
93
  this.chart.setStyles(styles);
85
94
  this.chart.setAvailableWidth(this.containerWidth || 0);
95
+ this.chart.setRuleSet(new IBCSRuleSet(this.ruleSetConfig));
86
96
  this.chart.setConfig(config);
87
97
  this.autoFitScaling(config, styles);
88
98
  this.chart.setAvailableHeight(((_a = this.parentDimensions) === null || _a === void 0 ? void 0 : _a.height) || 0);
@@ -90,26 +100,35 @@ export class IbcsChartTime {
90
100
  this.chart.setPattern("fc", this.pattern.getFCPolygonPattern());
91
101
  }
92
102
  /**
93
- * Two-pass auto-fit: only when pixelPerUnit is 0 (auto mode).
94
- * Explicit values are never overridden — the outer component warns
95
- * about overflow via componentDidRender.
103
+ * Two-pass auto-fit for pixelPerUnit and/or pixelPerPercentage.
104
+ * When either is 0 (auto mode), renders a measurement pass at 1,
105
+ * computes the ratio to fit ~90% of the available height, and rebuilds.
106
+ * Explicit (> 0) values are never overridden.
96
107
  */
97
108
  autoFitScaling(config, styles) {
98
109
  var _a;
99
- if (config.pixelPerUnit > 0) {
100
- return; // Explicit value — respect it, do not override
110
+ const autoUnit = config.pixelPerUnit <= 0;
111
+ const autoPercent = config.pixelPerPercentage <= 0;
112
+ if (!autoUnit && !autoPercent) {
113
+ return; // Both explicit — nothing to auto-fit
101
114
  }
102
115
  const targetHeight = (_a = this.parentDimensions) === null || _a === void 0 ? void 0 : _a.height;
103
116
  const availableWidth = this.containerWidth || 0;
104
117
  if (!targetHeight || targetHeight <= 0) {
105
- config.pixelPerUnit = 1; // No parent info — use fallback
106
- this.chart = new TimeChart(new IBCSRuleSet(), config, styles, availableWidth);
118
+ if (autoUnit)
119
+ config.pixelPerUnit = 1;
120
+ if (autoPercent)
121
+ config.pixelPerPercentage = 50;
122
+ this.chart = new TimeChart(new IBCSRuleSet(this.ruleSetConfig), this.getDb(), this.tableName, config, styles, availableWidth);
107
123
  this.chart.setI18n(this.i18n);
108
124
  return;
109
125
  }
110
- // First pass with pixelPerUnit=1 to measure the real SVG height
111
- config.pixelPerUnit = 1;
112
- this.chart = new TimeChart(new IBCSRuleSet(), config, styles, availableWidth);
126
+ // First pass: set auto values to 1 and measure SVG height
127
+ if (autoUnit)
128
+ config.pixelPerUnit = 1;
129
+ if (autoPercent)
130
+ config.pixelPerPercentage = 1;
131
+ this.chart = new TimeChart(new IBCSRuleSet(this.ruleSetConfig), this.getDb(), this.tableName, config, styles, availableWidth);
113
132
  this.chart.setI18n(this.i18n);
114
133
  this.chart.toString();
115
134
  const svgHeight = this.chart.getAllocatedCanvasHeight();
@@ -117,9 +136,13 @@ export class IbcsChartTime {
117
136
  return;
118
137
  }
119
138
  // Scale so the chart fits in ~90% of the available height
120
- config.pixelPerUnit = (targetHeight * 0.9) / svgHeight;
139
+ const ratio = (targetHeight * 0.9) / svgHeight;
140
+ if (autoUnit)
141
+ config.pixelPerUnit = ratio;
142
+ if (autoPercent)
143
+ config.pixelPerPercentage = ratio;
121
144
  // Second pass with the corrected scaling
122
- this.chart = new TimeChart(new IBCSRuleSet(), config, styles, availableWidth);
145
+ this.chart = new TimeChart(new IBCSRuleSet(this.ruleSetConfig), this.getDb(), this.tableName, config, styles, availableWidth);
123
146
  this.chart.setI18n(this.i18n);
124
147
  }
125
148
  async componentWillRender() {
@@ -143,8 +166,9 @@ export class IbcsChartTime {
143
166
  //}
144
167
  }
145
168
  prepareConfig() {
146
- return new TimeChartComponentConfigAdapter(new TimeChartDataRowAdapter(), new OrderAdapter(new StringAdapter()), new StringAdapter(), new DataFormatDigitsAdapter(), this.data).adapt({
147
- data: this.data,
169
+ const db = this.getDb();
170
+ const fromExpr = this.tableName ? buildFromExpr(this.tableName, this.filter) : "";
171
+ return new TimeChartComponentConfigAdapter(new TimeChartDataRowAdapter(), new OrderAdapter(new StringAdapter()), new StringAdapter(), new DataFormatDigitsAdapter(), db, fromExpr).adapt({
148
172
  scenarios: this.scenarios,
149
173
  variances: this.variances,
150
174
  title: this.chartTitle,
@@ -188,30 +212,45 @@ export class IbcsChartTime {
188
212
  }
189
213
  static get properties() {
190
214
  return {
191
- "data": {
192
- "type": "unknown",
215
+ "tableName": {
216
+ "type": "string",
193
217
  "mutable": false,
194
218
  "complexType": {
195
- "original": "TimeChartDataRow[]",
196
- "resolved": "TimeChartDataRow[]",
197
- "references": {
198
- "TimeChartDataRow": {
199
- "location": "import",
200
- "path": "./utils/model/TimeChartDataRow",
201
- "id": "src/components/bn-chart-time/utils/model/TimeChartDataRow.ts::TimeChartDataRow",
202
- "referenceLocation": "TimeChartDataRow"
203
- }
204
- }
219
+ "original": "string",
220
+ "resolved": "string",
221
+ "references": {}
205
222
  },
206
223
  "required": false,
207
224
  "optional": false,
208
225
  "docs": {
209
226
  "tags": [],
210
- "text": ""
227
+ "text": "Name of the dataset (table or view in the shared alasql database)."
211
228
  },
212
229
  "getter": false,
213
230
  "setter": false,
214
- "defaultValue": "[]"
231
+ "reflect": false,
232
+ "attribute": "table-name",
233
+ "defaultValue": "\"\""
234
+ },
235
+ "dataVersion": {
236
+ "type": "number",
237
+ "mutable": false,
238
+ "complexType": {
239
+ "original": "number",
240
+ "resolved": "number",
241
+ "references": {}
242
+ },
243
+ "required": false,
244
+ "optional": false,
245
+ "docs": {
246
+ "tags": [],
247
+ "text": "Bumped by `bn-chart-time` when the dataset changes; triggers re-render."
248
+ },
249
+ "getter": false,
250
+ "setter": false,
251
+ "reflect": false,
252
+ "attribute": "data-version",
253
+ "defaultValue": "0"
215
254
  },
216
255
  "chartTitle": {
217
256
  "type": "string",
@@ -822,6 +861,30 @@ export class IbcsChartTime {
822
861
  "getter": false,
823
862
  "setter": false,
824
863
  "defaultValue": "{ width: 0, height: 0 }"
864
+ },
865
+ "ruleSetConfig": {
866
+ "type": "unknown",
867
+ "mutable": false,
868
+ "complexType": {
869
+ "original": "RuleSetConfig",
870
+ "resolved": "RuleSetConfig",
871
+ "references": {
872
+ "RuleSetConfig": {
873
+ "location": "import",
874
+ "path": "../../stores/ruleSets",
875
+ "id": "src/stores/ruleSets.ts::RuleSetConfig",
876
+ "referenceLocation": "RuleSetConfig"
877
+ }
878
+ }
879
+ },
880
+ "required": false,
881
+ "optional": true,
882
+ "docs": {
883
+ "tags": [],
884
+ "text": ""
885
+ },
886
+ "getter": false,
887
+ "setter": false
825
888
  }
826
889
  };
827
890
  }