@bino-bi/bn-template-engine 1.0.0-alpha.9 → 1.0.0-next.20

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 (400) 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-28d5c266.entry.js +1 -0
  4. package/dist/bn-template-engine/p-2d3ea756.entry.js +1 -0
  5. package/dist/bn-template-engine/p-2fba7c99.entry.js +1 -0
  6. package/dist/bn-template-engine/p-6077155f.entry.js +1 -0
  7. package/dist/bn-template-engine/p-687032d5.entry.js +1 -0
  8. package/dist/bn-template-engine/p-6c7f0076.entry.js +1 -0
  9. package/dist/bn-template-engine/p-6lOdN-fB.js +1 -0
  10. package/dist/bn-template-engine/p-7e9dbc93.entry.js +1 -0
  11. package/dist/bn-template-engine/p-99477a27.entry.js +1 -0
  12. package/dist/bn-template-engine/p-A8xyE4b1.js +1 -0
  13. package/dist/bn-template-engine/p-BA48JiHe.js +1 -0
  14. package/dist/bn-template-engine/p-BgIpdpfH.js +1 -0
  15. package/dist/bn-template-engine/p-BjBz5cSL.js +1 -0
  16. package/dist/bn-template-engine/p-BpWWgN6k.js +1 -0
  17. package/dist/bn-template-engine/p-C5uvAEKI.js +1 -0
  18. package/dist/bn-template-engine/p-C8Q0lsaU.js +1 -0
  19. package/dist/bn-template-engine/p-C9i1Xsib.js +1 -0
  20. package/dist/bn-template-engine/p-CJThzFZm.js +1 -0
  21. package/dist/bn-template-engine/p-CYE0I1Mx.js +1 -0
  22. package/dist/bn-template-engine/p-DsTzlzxQ.js +1 -0
  23. package/dist/bn-template-engine/p-DwYUTvvI.js +1 -0
  24. package/dist/bn-template-engine/p-a1380d7c.entry.js +1 -0
  25. package/dist/bn-template-engine/p-a4ea9a79.entry.js +1 -0
  26. package/dist/bn-template-engine/p-a8291de2.entry.js +1 -0
  27. package/dist/bn-template-engine/p-b5274369.entry.js +1 -0
  28. package/dist/bn-template-engine/p-b9e94127.entry.js +1 -0
  29. package/dist/bn-template-engine/p-ba912130.entry.js +1 -0
  30. package/dist/bn-template-engine/p-de29986f.entry.js +1 -0
  31. package/dist/bn-template-engine/p-eEfqksk-.js +1 -0
  32. package/dist/bn-template-engine/p-fFtEvsY-.js +1 -0
  33. package/dist/cjs/AxisConfig-D7CAyPLO.js +233 -0
  34. package/dist/cjs/LabelCollisionManager-DkdQ9Xdg.js +412 -0
  35. package/dist/cjs/NumericScale-BAyYXpKL.js +107 -0
  36. package/dist/cjs/Order-IPfAP0q8.js +87 -0
  37. package/dist/cjs/SVGStyle-BD8jApd4.js +8209 -0
  38. package/dist/cjs/SVGVariancesStyleGroup-BaWzR951.js +50 -0
  39. package/dist/cjs/VarianceMeasure-BBWTgv2e.js +372 -0
  40. package/dist/cjs/XYChartDataRow-BoR0CTfl.js +829 -0
  41. package/dist/cjs/bn-asset_21.cjs.entry.js +16105 -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-BBhT9B52.js +9505 -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-DUYYkDMQ.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-BIJQ2NV1.js +589 -0
  62. package/dist/cjs/{withBodyObserver-D7BKWN2N.js → withBodyObserver-BKUE_ypL.js} +12 -7
  63. package/dist/cjs/withScalingGroup-D5clRvRe.js +73 -0
  64. package/dist/cjs/withStyled-Cm9dWQhu.js +1168 -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 +126 -43
  87. package/dist/collection/components/bn-chart-structure/ibcs-chart-structure.js +104 -37
  88. package/dist/collection/components/bn-chart-structure/utils/StructureChart.js +101 -60
  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 +161 -44
  93. package/dist/collection/components/bn-chart-time/ibcs-chart-time.js +97 -32
  94. package/dist/collection/components/bn-chart-time/utils/TimeChart.js +151 -75
  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 +10 -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 +20 -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 +20 -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 +318 -62
  118. package/dist/collection/components/bn-table/ibcs-table.css +8 -0
  119. package/dist/collection/components/bn-table/ibcs-table.js +162 -33
  120. package/dist/collection/components/bn-table/utils/Table.js +72 -29
  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 +120 -23
  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 +31 -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 +52 -6
  138. package/dist/collection/components/bn-title/ibcs-title/utils/Title.js +7 -4
  139. package/dist/collection/components/bn-title/ibcs-title/utils/factories/TitleDataSetFactory.js +6 -2
  140. package/dist/collection/components/bn-title/ibcs-title/utils/model/TitleConfig.js +5 -0
  141. package/dist/collection/components/bn-tree/bn-tree.js +19 -0
  142. package/dist/collection/components/editor-companion/editor-companion.js +12 -5
  143. package/dist/collection/context/scopedDb.js +127 -0
  144. package/dist/collection/stores/componentStyles.js +67 -0
  145. package/dist/collection/stores/createScopedStores.js +11 -5
  146. package/dist/collection/stores/internationalization.js +77 -3
  147. package/dist/collection/stores/ruleSets.js +46 -0
  148. package/dist/collection/utils/DateStringFactory.js +31 -0
  149. package/dist/collection/utils/constants.js +5 -0
  150. package/dist/collection/utils/dataAnalyzer.js +14 -8
  151. package/dist/collection/utils/ibcsRuleSet.js +14 -26
  152. package/dist/collection/utils/layoutObserver.js +88 -0
  153. package/dist/collection/utils/parentDimensions.js +71 -15
  154. package/dist/collection/utils/sanitizeHtml.js +81 -0
  155. package/dist/collection/utils/validate.js +47 -0
  156. package/dist/collection/utils/withBodyObserver.js +12 -7
  157. package/dist/collection/utils/withComponentStyle.js +3 -5
  158. package/dist/collection/utils/withDataset.js +43 -39
  159. package/dist/collection/utils/withDatasource.js +28 -18
  160. package/dist/collection/utils/withInheritedProps.js +26 -1
  161. package/dist/collection/utils/withRuleSet.js +105 -0
  162. package/dist/collection/utils/withScalingGroup.js +69 -0
  163. package/dist/collection/utils/withTranslation.js +53 -15
  164. package/dist/collection/utils/xy/FacetGrid.js +36 -0
  165. package/dist/collection/utils/xy/IsoCurves.js +156 -0
  166. package/dist/collection/utils/xy/NumericScale.js +103 -0
  167. package/dist/collection/utils/xy/PointLabeler.js +96 -0
  168. package/dist/collection/utils/xy/RadiusScale.js +42 -0
  169. package/dist/collection/utils/xy/SeriesPalette.js +80 -0
  170. package/dist/collection/utils/xy/VarianceMeasure.js +76 -0
  171. package/dist/collection/utils/xy/XYFrame.js +120 -0
  172. package/dist/collection/utils/xy/XYLegend.js +107 -0
  173. package/dist/collection/utils/xy/model/AxisConfig.js +221 -0
  174. package/dist/collection/utils/xy/model/ScaleFactorsXYChart.js +69 -0
  175. package/dist/collection/utils/xy/model/XYChartDataRow.js +0 -0
  176. package/dist/collection/utils/xy/model/XYChartStyle.js +52 -0
  177. package/dist/components/AxisConfig.js +1 -0
  178. package/dist/components/CompareUtil.js +1 -0
  179. package/dist/components/DataFormatDigits.js +1 -1
  180. package/dist/components/DateStringFactory.js +1 -1
  181. package/dist/components/LabelCollisionManager.js +1 -0
  182. package/dist/components/NumericScale.js +1 -0
  183. package/dist/components/Order.js +1 -1
  184. package/dist/components/SVGVariancesStyleGroup.js +1 -1
  185. package/dist/components/SiPrefix.js +1 -0
  186. package/dist/components/StringAdapter.js +1 -0
  187. package/dist/components/VarianceMeasure.js +1 -0
  188. package/dist/components/XYChartDataRow.js +1 -0
  189. package/dist/components/bn-body2.js +1 -1
  190. package/dist/components/bn-card2.js +1 -1
  191. package/dist/components/bn-chart-bubble.d.ts +11 -0
  192. package/dist/components/bn-chart-bubble.js +1 -0
  193. package/dist/components/bn-chart-bullet.d.ts +11 -0
  194. package/dist/components/bn-chart-bullet.js +1 -0
  195. package/dist/components/bn-chart-scatter.d.ts +11 -0
  196. package/dist/components/bn-chart-scatter.js +1 -0
  197. package/dist/components/bn-chart-structure.js +1 -1
  198. package/dist/components/bn-chart-time.js +1 -1
  199. package/dist/components/bn-component-style.js +1 -1
  200. package/dist/components/bn-context.js +1 -1
  201. package/dist/components/bn-dataset.js +1 -1
  202. package/dist/components/bn-datasource.js +1 -1
  203. package/dist/components/bn-footer2.js +1 -1
  204. package/dist/components/bn-grid.js +1 -1
  205. package/dist/components/bn-image.js +1 -1
  206. package/dist/components/bn-internationalization.js +1 -1
  207. package/dist/components/bn-layout-card.js +1 -1
  208. package/dist/components/bn-layout-page.js +1 -1
  209. package/dist/components/bn-message2.js +1 -1
  210. package/dist/components/bn-page2.js +1 -1
  211. package/dist/components/bn-ruleset.d.ts +11 -0
  212. package/dist/components/bn-ruleset.js +1 -0
  213. package/dist/components/bn-scaling-group.d.ts +11 -0
  214. package/dist/components/bn-scaling-group.js +1 -0
  215. package/dist/components/bn-table.js +1 -1
  216. package/dist/components/bn-template.js +1 -1
  217. package/dist/components/bn-text.js +1 -1
  218. package/dist/components/bn-title2.js +1 -1
  219. package/dist/components/bn-tree.js +1 -1
  220. package/dist/components/context-protocol.js +1 -1
  221. package/dist/components/editor-companion.js +1 -1
  222. package/dist/components/formatter.js +1 -0
  223. package/dist/components/ibcs-chart-bubble.d.ts +11 -0
  224. package/dist/components/ibcs-chart-bubble.js +1 -0
  225. package/dist/components/ibcs-chart-bubble2.js +1 -0
  226. package/dist/components/ibcs-chart-bullet.d.ts +11 -0
  227. package/dist/components/ibcs-chart-bullet.js +1 -0
  228. package/dist/components/ibcs-chart-bullet2.js +1 -0
  229. package/dist/components/ibcs-chart-scatter.d.ts +11 -0
  230. package/dist/components/ibcs-chart-scatter.js +1 -0
  231. package/dist/components/ibcs-chart-scatter2.js +1 -0
  232. package/dist/components/ibcs-chart-structure2.js +1 -1
  233. package/dist/components/ibcs-chart-time2.js +1 -1
  234. package/dist/components/ibcs-table2.js +1 -1
  235. package/dist/components/ibcs-title2.js +1 -1
  236. package/dist/components/layoutObserver.js +1 -0
  237. package/dist/components/luxon.js +1 -0
  238. package/dist/components/main.js +1 -0
  239. package/dist/components/merge.js +1 -0
  240. package/dist/components/sanitizeHtml.js +1 -0
  241. package/dist/components/stackColors.js +1 -0
  242. package/dist/components/validate.js +1 -1
  243. package/dist/components/withBodyObserver.js +1 -1
  244. package/dist/components/withComponentStyle.js +1 -1
  245. package/dist/components/withDataset.js +1 -0
  246. package/dist/components/withRuleSet.js +1 -0
  247. package/dist/components/withScalingGroup.js +1 -0
  248. package/dist/components/withStyled.js +1 -1
  249. package/dist/components/withTranslation.js +1 -1
  250. package/dist/esm/AxisConfig-ByIP5J-9.js +224 -0
  251. package/dist/esm/LabelCollisionManager-DaNiDiM9.js +404 -0
  252. package/dist/esm/NumericScale-DsTzlzxQ.js +105 -0
  253. package/dist/esm/Order-BQeJE_yi.js +83 -0
  254. package/dist/esm/SVGStyle-BwBlY3Km.js +8199 -0
  255. package/dist/esm/SVGVariancesStyleGroup-BpGW4CvN.js +48 -0
  256. package/dist/esm/VarianceMeasure-CE3N8Bea.js +364 -0
  257. package/dist/esm/XYChartDataRow-DeMI1JKU.js +820 -0
  258. package/dist/esm/bn-asset_21.entry.js +16083 -0
  259. package/dist/esm/bn-chart-bubble.entry.js +760 -0
  260. package/dist/esm/bn-chart-bullet.entry.js +783 -0
  261. package/dist/esm/bn-chart-scatter.entry.js +656 -0
  262. package/dist/esm/bn-grid.entry.js +5 -3
  263. package/dist/esm/bn-image.entry.js +5 -3
  264. package/dist/esm/bn-internationalization.entry.js +10 -8
  265. package/dist/esm/bn-ruleset.entry.js +39 -0
  266. package/dist/esm/bn-template-engine.js +1 -1
  267. package/dist/esm/bn-template.entry.js +1 -1
  268. package/dist/esm/bn-text.entry.js +7 -78
  269. package/dist/esm/bn-tree.entry.js +4 -2
  270. package/dist/esm/context-protocol-d8MHrEo8.js +9490 -0
  271. package/dist/esm/editor-companion.entry.js +13 -6
  272. package/dist/esm/ibcs-chart-bubble.entry.js +622 -0
  273. package/dist/esm/ibcs-chart-bullet.entry.js +671 -0
  274. package/dist/esm/ibcs-chart-scatter.entry.js +665 -0
  275. package/dist/esm/layoutObserver-BJBEyhNf.js +196 -0
  276. package/dist/esm/loader.js +1 -1
  277. package/dist/esm/sanitizeHtml-BA48JiHe.js +83 -0
  278. package/dist/esm/scaling-BGnpSN1j.js +581 -0
  279. package/dist/esm/{withBodyObserver-AFk2wwHT.js → withBodyObserver-IokS6fHD.js} +12 -7
  280. package/dist/esm/withScalingGroup-CC3UcvC5.js +71 -0
  281. package/dist/esm/withStyled-2l5Tx3cf.js +1135 -0
  282. package/dist/types/components/bn-chart-bubble/bn-chart-bubble.d.ts +193 -0
  283. package/dist/types/components/bn-chart-bubble/ibcs-chart-bubble.d.ts +58 -0
  284. package/dist/types/components/bn-chart-bubble/utils/BubbleChart.d.ts +91 -0
  285. package/dist/types/components/bn-chart-bullet/bn-chart-bullet.d.ts +172 -0
  286. package/dist/types/components/bn-chart-bullet/ibcs-chart-bullet.d.ts +52 -0
  287. package/dist/types/components/bn-chart-bullet/utils/BulletChart.d.ts +91 -0
  288. package/dist/types/components/bn-chart-bullet/utils/model/BulletChartStyle.d.ts +70 -0
  289. package/dist/types/components/bn-chart-bullet/utils/model/BulletConfig.d.ts +43 -0
  290. package/dist/types/components/bn-chart-bullet/utils/model/index.d.ts +2 -0
  291. package/dist/types/components/bn-chart-scatter/bn-chart-scatter.d.ts +172 -0
  292. package/dist/types/components/bn-chart-scatter/ibcs-chart-scatter.d.ts +53 -0
  293. package/dist/types/components/bn-chart-scatter/utils/ScatterChart.d.ts +66 -0
  294. package/dist/types/components/bn-chart-structure/bn-chart-structure.d.ts +19 -5
  295. package/dist/types/components/bn-chart-structure/ibcs-chart-structure.d.ts +13 -6
  296. package/dist/types/components/bn-chart-structure/utils/StructureChart.d.ts +21 -12
  297. package/dist/types/components/bn-chart-structure/utils/helper/ElementPositions.d.ts +16 -1
  298. package/dist/types/components/bn-chart-structure/utils/model/StructureChartComponentConfig.d.ts +5 -3
  299. package/dist/types/components/bn-chart-time/bn-chart-time.d.ts +53 -13
  300. package/dist/types/components/bn-chart-time/ibcs-chart-time.d.ts +13 -6
  301. package/dist/types/components/bn-chart-time/utils/TimeChart.d.ts +21 -12
  302. package/dist/types/components/bn-chart-time/utils/model/TimeChartComponentConfig.d.ts +7 -3
  303. package/dist/types/components/bn-context/bn-context.d.ts +8 -0
  304. package/dist/types/components/bn-dataset/bn-dataset.d.ts +47 -5
  305. package/dist/types/components/bn-datasource/bn-datasource.d.ts +53 -6
  306. package/dist/types/components/bn-grid/bn-grid.d.ts +8 -0
  307. package/dist/types/components/bn-layout-card/bn-layout-card.d.ts +39 -8
  308. package/dist/types/components/bn-layout-page/bn-layout-page.d.ts +36 -1
  309. package/dist/types/components/bn-message/bn-message.d.ts +5 -2
  310. package/dist/types/components/bn-ruleset/bn-ruleset.d.ts +8 -0
  311. package/dist/types/components/bn-scaling-group/bn-scaling-group.d.ts +37 -0
  312. package/dist/types/components/bn-table/bn-table.d.ts +74 -12
  313. package/dist/types/components/bn-table/ibcs-table.d.ts +27 -4
  314. package/dist/types/components/bn-table/utils/Table.d.ts +16 -6
  315. package/dist/types/components/bn-table/utils/elements/Cell.d.ts +2 -0
  316. package/dist/types/components/bn-table/utils/elements/CellBarChart.d.ts +33 -0
  317. package/dist/types/components/bn-table/utils/elements/TableRow.d.ts +2 -1
  318. package/dist/types/components/bn-table/utils/elements/WaterfallBar.d.ts +21 -0
  319. package/dist/types/components/bn-table/utils/elements/index.d.ts +1 -0
  320. package/dist/types/components/bn-table/utils/factories/tableDataSetFactory.d.ts +17 -9
  321. package/dist/types/components/bn-table/utils/helper/DataQuery.d.ts +35 -3
  322. package/dist/types/components/bn-table/utils/helper/IntervalColumns.d.ts +37 -0
  323. package/dist/types/components/bn-table/utils/helper/QueryGroup.d.ts +4 -5
  324. package/dist/types/components/bn-table/utils/helper/WaterfallCalculator.d.ts +55 -0
  325. package/dist/types/components/bn-table/utils/helper/index.d.ts +2 -0
  326. package/dist/types/components/bn-table/utils/model/TableAttribute.d.ts +22 -0
  327. package/dist/types/components/bn-table/utils/model/TableComponentConfig.d.ts +12 -3
  328. package/dist/types/components/bn-table/utils/model/index.d.ts +21 -0
  329. package/dist/types/components/bn-title/bn-title.d.ts +12 -1
  330. package/dist/types/components/bn-title/ibcs-title/ibcs-title.d.ts +4 -0
  331. package/dist/types/components/bn-title/ibcs-title/utils/Title.d.ts +1 -0
  332. package/dist/types/components/bn-title/ibcs-title/utils/factories/TitleDataSetFactory.d.ts +3 -1
  333. package/dist/types/components/bn-title/ibcs-title/utils/model/TitleConfig.d.ts +2 -0
  334. package/dist/types/components/bn-tree/bn-tree.d.ts +8 -0
  335. package/dist/types/components/editor-companion/editor-companion.d.ts +2 -0
  336. package/dist/types/components.d.ts +1725 -116
  337. package/dist/types/context/context-protocol.d.ts +7 -3
  338. package/dist/types/context/scopedDb.d.ts +37 -0
  339. package/dist/types/stores/componentStyles.d.ts +41 -0
  340. package/dist/types/stores/createScopedStores.d.ts +4 -2
  341. package/dist/types/stores/ruleSets.d.ts +40 -0
  342. package/dist/types/utils/DateStringFactory.d.ts +20 -1
  343. package/dist/types/utils/constants.d.ts +5 -0
  344. package/dist/types/utils/dataAnalyzer.d.ts +2 -1
  345. package/dist/types/utils/ibcsRuleSet.d.ts +6 -1
  346. package/dist/types/utils/layoutObserver.d.ts +27 -0
  347. package/dist/types/utils/model/ChartStyles.d.ts +2 -1
  348. package/dist/types/utils/parentDimensions.d.ts +1 -1
  349. package/dist/types/utils/sanitizeHtml.d.ts +6 -0
  350. package/dist/types/utils/validate.d.ts +18 -0
  351. package/dist/types/utils/withDataset.d.ts +6 -2
  352. package/dist/types/utils/withDatasource.d.ts +3 -3
  353. package/dist/types/utils/withInheritedProps.d.ts +19 -0
  354. package/dist/types/utils/withRuleSet.d.ts +24 -0
  355. package/dist/types/utils/withScalingGroup.d.ts +14 -0
  356. package/dist/types/utils/withTranslation.d.ts +15 -5
  357. package/dist/types/utils/xy/FacetGrid.d.ts +27 -0
  358. package/dist/types/utils/xy/IsoCurves.d.ts +46 -0
  359. package/dist/types/utils/xy/NumericScale.d.ts +41 -0
  360. package/dist/types/utils/xy/PointLabeler.d.ts +58 -0
  361. package/dist/types/utils/xy/RadiusScale.d.ts +26 -0
  362. package/dist/types/utils/xy/SeriesPalette.d.ts +59 -0
  363. package/dist/types/utils/xy/VarianceMeasure.d.ts +37 -0
  364. package/dist/types/utils/xy/XYFrame.d.ts +44 -0
  365. package/dist/types/utils/xy/XYLegend.d.ts +43 -0
  366. package/dist/types/utils/xy/model/AxisConfig.d.ts +96 -0
  367. package/dist/types/utils/xy/model/ScaleFactorsXYChart.d.ts +36 -0
  368. package/dist/types/utils/xy/model/XYChartDataRow.d.ts +157 -0
  369. package/dist/types/utils/xy/model/XYChartStyle.d.ts +31 -0
  370. package/package.json +5 -4
  371. package/readme.md +9 -5
  372. package/dist/bn-template-engine/p-3141c4a2.entry.js +0 -1
  373. package/dist/bn-template-engine/p-67538176.entry.js +0 -1
  374. package/dist/bn-template-engine/p-916296a5.entry.js +0 -1
  375. package/dist/bn-template-engine/p-96006b06.entry.js +0 -1
  376. package/dist/bn-template-engine/p-Ck-NYtot.js +0 -1
  377. package/dist/bn-template-engine/p-CnDq0oVa.js +0 -1
  378. package/dist/bn-template-engine/p-DSXNgKLa.js +0 -1
  379. package/dist/bn-template-engine/p-bc711fb0.entry.js +0 -1
  380. package/dist/bn-template-engine/p-c86395b8.entry.js +0 -1
  381. package/dist/bn-template-engine/p-e6f646b1.entry.js +0 -1
  382. package/dist/bn-template-engine/p-f41d9242.entry.js +0 -1
  383. package/dist/bn-template-engine/p-gFbbuhtl.js +0 -1
  384. package/dist/cjs/bn-asset_20.cjs.entry.js +0 -23547
  385. package/dist/cjs/context-protocol-ohYzcb5F.js +0 -663
  386. package/dist/cjs/scaling-CIAClQR5.js +0 -314
  387. package/dist/cjs/withStyled-qd94SSb4.js +0 -9535
  388. package/dist/collection/stores/datasets.js +0 -14
  389. package/dist/collection/stores/datasources.js +0 -14
  390. package/dist/components/_commonjsHelpers.js +0 -1
  391. package/dist/components/alasql.min.js +0 -1
  392. package/dist/components/ibcsRuleSet.js +0 -1
  393. package/dist/components/scaling.js +0 -1
  394. package/dist/components/withInheritedProps.js +0 -1
  395. package/dist/esm/bn-asset_20.entry.js +0 -23526
  396. package/dist/esm/context-protocol-DdbSplvE.js +0 -656
  397. package/dist/esm/scaling-DGKKkuL9.js +0 -309
  398. package/dist/esm/withStyled-BIkqU2w4.js +0 -9501
  399. package/dist/types/stores/datasets.d.ts +0 -14
  400. package/dist/types/stores/datasources.d.ts +0 -14
@@ -4,12 +4,12 @@ import { DataPoint, Scenario } from "./model";
4
4
  import { AreaFill, Axis, HookLocation, Label, StackedColumn, } from "./elements";
5
5
  import { ScenarioFactory } from "./factories";
6
6
  import { LabelCollisionManager, SCENARIO_PRIORITY } from "./helper";
7
- import alasql from "alasql";
8
7
  import CalculateSize from "calculate-size";
9
8
  import { ScaleFactorsTimeChart } from "./model/styles/ScaleFactorsTimeChart";
10
9
  import { DateTime } from "luxon";
10
+ import { buildFromExpr } from "../../../context/scopedDb";
11
11
  import { DateDistance, DateStringFactory } from "../../../utils/DateStringFactory";
12
- import { AxisLabelsMode, ChartMode, StackBy, StackMode } from "../../../utils/constants";
12
+ import { AxisLabelsMode, ChartMode, RELATIVE_STACK_UNITS, StackBy, StackMode, } from "../../../utils/constants";
13
13
  import { getScenarioPrefix, IBCS_LAYER_ORDER } from "../../../utils/stackColors";
14
14
  import { Formatter } from "../../../utils";
15
15
  import { IBCSRuleSet } from "../../../utils/ibcsRuleSet";
@@ -50,11 +50,14 @@ var VarianceType;
50
50
  * Auto chart mode: when dataModel.length exceeds maxBars, switches from bar to line.
51
51
  */
52
52
  export class TimeChart {
53
- constructor(ruleSet, config, styles, availableWidth = 0) {
53
+ constructor(ruleSet, db, tableName, config, styles, availableWidth = 0) {
54
54
  this.CSS_CATEGORIES = "categories";
55
55
  this.dataModel = [];
56
56
  this.variancesDataModel = [];
57
57
  this.title = "";
58
+ /** Raw config inputs the title derives from; kept so setI18n can recompute it. */
59
+ this.configTitle = "";
60
+ this.configVariances = [];
58
61
  this.smallestDataPointValue = new DataPoint(0, Scenario.AC1, 1, Scenario.NEU);
59
62
  this.highestDataPointValue = new DataPoint(0, Scenario.AC1, 1, Scenario.NEU);
60
63
  this.smallestVarianceDataPointValue = new DataPoint(0, Scenario.AC1, 1, Scenario.NEU);
@@ -63,7 +66,8 @@ export class TimeChart {
63
66
  this.pixelPerPercentage = 1;
64
67
  this.hideAxisLabels = false;
65
68
  this.axisScenario = Scenario.AC1;
66
- this.preparedDataSet = [];
69
+ this.fromExpr = "";
70
+ this.rowCount = 0;
67
71
  this.axisCategoryArea = { width: 0, height: 0 };
68
72
  this.scenariosArea = { width: 0, height: 0 };
69
73
  this.state = FactoryState.DIRTY;
@@ -81,36 +85,29 @@ export class TimeChart {
81
85
  this.chartMode = ChartMode.BAR;
82
86
  this.maxBars = 28;
83
87
  this.stackConfig = null;
88
+ this.scenarioPropOrder = [];
84
89
  this.lineFullWidth = true;
85
90
  this.availableWidth = 0;
86
91
  this.overflowConfig = null;
87
92
  this.lastScenarios = [];
88
- this.initSQLFunctions();
93
+ this.db = db;
94
+ this.tableName = tableName;
89
95
  this.ruleSet = ruleSet || new IBCSRuleSet();
90
96
  this.i18n = this.createI18n(new Map());
91
97
  this.styles = styles;
92
98
  this.availableWidth = availableWidth;
93
99
  this.setConfig(config);
94
- this.position = this.createElementPosition(config.scenarios);
100
+ this.position = this.createElementPosition(this.lastScenarios);
95
101
  }
96
102
  updatePosition(scenarios) {
97
103
  this.position = this.createElementPosition(scenarios);
98
104
  }
99
- initSQLFunctions() {
100
- alasql.fn.transformOperator = function (a) {
101
- return a === "-" ? -1 : 1;
102
- };
103
- // @ts-ignore
104
- alasql.fn.normalizeDate = function (date, normalizationLevel, _locale) {
105
- if (date === undefined || !date.isValid) {
106
- return undefined;
107
- }
108
- return date.startOf(normalizationLevel);
109
- };
110
- }
111
105
  setStyles(newStyle) {
112
106
  this.styles = newStyle;
113
107
  }
108
+ setRuleSet(ruleSet) {
109
+ this.ruleSet = ruleSet || new IBCSRuleSet();
110
+ }
114
111
  setAvailableWidth(w) {
115
112
  this.availableWidth = w;
116
113
  }
@@ -173,17 +170,23 @@ export class TimeChart {
173
170
  setConfig(config) {
174
171
  var _a;
175
172
  this.state = FactoryState.DIRTY;
176
- this.sortScenariosbyVisualisationRules(config);
177
- this.setData([...config.data], config.filter);
173
+ // Must precede setSource/populateModel: the locale is baked into the
174
+ // normalizeDate() SQL as well as into the axis date labels.
175
+ this.locale = config.locale;
176
+ this.scenarioPropOrder = [...config.scenarios];
177
+ const scenarios = this.sortScenariosbyVisualisationRules(config.scenarios);
178
+ this.setSource(config.filter);
178
179
  this.hideAxisLabels = config.hideAxisLabels || false;
179
180
  this.pixelPerUnit = config.pixelPerUnit;
180
181
  this.pixelPerPercentage = config.pixelPerPercentage;
181
182
  this.axisLabelsMode = config.axisLabelsMode;
182
183
  this.intervalSpanLimit = config.intervalSpanLimit;
183
184
  this.dateInterval = this.findDateInterval(config.dateInterval);
184
- this.dataModel = this.populateModel(config.scenarios, this.dateInterval, config.level, config.sortOrder);
185
+ this.dataModel = this.populateModel(scenarios, this.dateInterval, config.level, config.sortOrder);
185
186
  this.variancesDataModel = this.populateVarianceModel(config.variances, this.dataModel);
186
- this.title = config.title || Formatter.translateScenarioLabel((_a = config === null || config === void 0 ? void 0 : config.variances) === null || _a === void 0 ? void 0 : _a.toString(), this.i18n);
187
+ this.configTitle = config.title;
188
+ this.configVariances = (_a = config === null || config === void 0 ? void 0 : config.variances) !== null && _a !== void 0 ? _a : [];
189
+ this.updateTitle();
187
190
  this.smallestDataPointValue = this.findSmallestDataPointValue(this.dataModel);
188
191
  this.smallestVarianceDataPointValue = this.findSmallestDataPointValue(this.variancesDataModel);
189
192
  this.highestDataPointValue = this.findHighestDataPointValue(this.dataModel);
@@ -199,8 +202,8 @@ export class TimeChart {
199
202
  this.maxBars = config.maxBars;
200
203
  this.stackConfig = config.stackConfig;
201
204
  this.lineFullWidth = config.lineFullWidth;
202
- this.lastScenarios = config.scenarios;
203
- this.updatePosition(config.scenarios);
205
+ this.lastScenarios = scenarios;
206
+ this.updatePosition(scenarios);
204
207
  }
205
208
  getFooter() {
206
209
  if (this.measureScale.value === 1 && this.measureUnit === "") {
@@ -208,9 +211,10 @@ export class TimeChart {
208
211
  }
209
212
  return Formatter.translateScenarioLabel("in", this.i18n) + " " + this.measureScale.prefix + this.measureUnit;
210
213
  }
211
- sortScenariosbyVisualisationRules(config) {
214
+ /** Returns a new array; the input keeps the `scenarios` prop order (the config is reused across rebuilds). */
215
+ sortScenariosbyVisualisationRules(scenarios) {
212
216
  const self = this;
213
- config.scenarios
217
+ return [...scenarios]
214
218
  .sort((n1, n2) => {
215
219
  return self.ruleSet.getScenarioSorIndex(n1) - self.ruleSet.getScenarioSorIndex(n2);
216
220
  })
@@ -231,33 +235,36 @@ export class TimeChart {
231
235
  */
232
236
  setI18n(i18n) {
233
237
  this.i18n = this.createI18n(i18n);
238
+ // The variance title bakes translated scenario labels in, and setI18n
239
+ // arrives after the constructor's setConfig — recompute it here so the
240
+ // first render doesn't keep the built-in labels (e.g. ΔPY vs ΔVorjahr).
241
+ this.updateTitle();
242
+ }
243
+ /** Derives the variance title from the stored config and the current i18n map. */
244
+ updateTitle() {
245
+ var _a;
246
+ this.title = this.configTitle || Formatter.translateScenarioLabel((_a = this.configVariances) === null || _a === void 0 ? void 0 : _a.toString(), this.i18n);
234
247
  }
235
248
  /**
236
- * Init load raw datasets the loaded dataset is
237
- * the base on which the filters defined in the config
238
- * are apllied on internaly it is called prepared DataSet
239
- *
240
- * @param data
241
- * @param filter - data filter
242
- * @param customColumnNameMap Custon ColumnNameMap can be used if data uses non standard columnames
249
+ * Resolves the dataset (a table or view in the shared alasql database) and
250
+ * caches its row count. Subsequent queries reference the source by name —
251
+ * alasql doesn't have to ingest a fresh array per call.
243
252
  */
244
- setData(data, filter) {
245
- if (data == null) {
253
+ setSource(filter) {
254
+ var _a, _b;
255
+ this.state = FactoryState.DIRTY;
256
+ if (!this.tableName) {
257
+ this.fromExpr = "";
258
+ this.rowCount = 0;
246
259
  return;
247
260
  }
248
- this.state = FactoryState.DIRTY; // mark dataSet for update
249
- this.preparedDataSet.length = 0; // cleans formerly loaded and prepared dataset
250
- if (filter != null && filter.length > 0) {
251
- try {
252
- this.preparedDataSet = alasql(`SELECT * FROM ? WHERE ${filter}`, [data]);
253
- }
254
- catch (e) {
255
- console.error("TimeChart: filter query failed, using unfiltered data", filter, e);
256
- this.preparedDataSet = data;
257
- }
261
+ this.fromExpr = buildFromExpr(this.tableName, filter);
262
+ try {
263
+ const r = this.db.exec(`SELECT COUNT(*) AS cnt FROM ${this.fromExpr}`);
264
+ this.rowCount = ((_b = (_a = r[0]) === null || _a === void 0 ? void 0 : _a.cnt) !== null && _b !== void 0 ? _b : 0);
258
265
  }
259
- else {
260
- this.preparedDataSet = data;
266
+ catch (_e) {
267
+ this.rowCount = 0;
261
268
  }
262
269
  }
263
270
  getAllocatedCanvasWidth() {
@@ -414,6 +421,7 @@ export class TimeChart {
414
421
  return new Map([...defaultI18n, ...i18n]);
415
422
  }
416
423
  createElementPosition(scenarios) {
424
+ var _a;
417
425
  let maxLabelLengthLeft;
418
426
  // only need scenarios written on the leftside of bar/ marker
419
427
  const scenarioLabelLeft = CalculateSize(scenarios
@@ -449,6 +457,12 @@ export class TimeChart {
449
457
  min = this.smallestDataPointValue;
450
458
  max = this.highestDataPointValue;
451
459
  }
460
+ // In relative (100%) stacking the vertical domain is 0..RELATIVE_STACK_UNITS percent,
461
+ // not the raw data values — use a virtual max so axis position, canvas height and
462
+ // auto-fit all agree on the percent domain.
463
+ if (((_a = this.stackConfig) === null || _a === void 0 ? void 0 : _a.mode) === StackMode.RELATIVE) {
464
+ max = new DataPoint(RELATIVE_STACK_UNITS, max.scenario, this.pixelPerUnit, max.variance);
465
+ }
452
466
  // When overflow config is active, create a virtual max so the coordinate system
453
467
  // allocates exactly cutHeight + breakGap + overdriveZoneHeight instead of the
454
468
  // full (clipped) bar height.
@@ -516,8 +530,7 @@ export class TimeChart {
516
530
  return result;
517
531
  }
518
532
  populateModel(selectedScenarios, dateInterval, _level, _sortOrder) {
519
- var _a;
520
- if (((_a = this.preparedDataSet) === null || _a === void 0 ? void 0 : _a.length) === 0) {
533
+ if (this.rowCount === 0 || !this.fromExpr) {
521
534
  return [];
522
535
  }
523
536
  const select = ``;
@@ -559,17 +572,41 @@ export class TimeChart {
559
572
  return localDateInterval;
560
573
  }
561
574
  queryMinMaxDates() {
562
- var _a, _b, _c, _d;
563
- //let result: any[] = [];
564
- const result = alasql(`SELECT MAX(${"date"}) as maxdate, MIN(${"date"}) as mindate FROM ?`, [this.preparedDataSet]);
575
+ var _a, _b;
576
+ let result;
577
+ try {
578
+ result = this.db.exec(`SELECT MAX(${"date"}) as maxdate, MIN(${"date"}) as mindate FROM ${this.fromExpr}`);
579
+ }
580
+ catch (e) {
581
+ console.error("TimeChart: min/max date query failed", e);
582
+ return [{}];
583
+ }
584
+ // `date` rows in the shared db are typically ISO strings (raw JSON) or millis;
585
+ // accept both so existing fixtures and live JSON data both work.
565
586
  if (((_a = result[0]) === null || _a === void 0 ? void 0 : _a.mindate) != null) {
566
- result[0].mindate = DateTime.fromMillis((_b = result[0]) === null || _b === void 0 ? void 0 : _b.mindate);
587
+ result[0].mindate = TimeChart.coerceDateTime(result[0].mindate);
567
588
  }
568
- if (((_c = result[0]) === null || _c === void 0 ? void 0 : _c.maxdate) != null) {
569
- result[0].maxdate = DateTime.fromMillis((_d = result[0]) === null || _d === void 0 ? void 0 : _d.maxdate);
589
+ if (((_b = result[0]) === null || _b === void 0 ? void 0 : _b.maxdate) != null) {
590
+ result[0].maxdate = TimeChart.coerceDateTime(result[0].maxdate);
570
591
  }
571
592
  return result;
572
593
  }
594
+ static coerceDateTime(v) {
595
+ if (v == null)
596
+ return undefined;
597
+ if (typeof v === "string") {
598
+ const dt = DateTime.fromISO(v);
599
+ return dt.isValid ? dt : undefined;
600
+ }
601
+ if (typeof v === "number") {
602
+ const dt = DateTime.fromMillis(v);
603
+ return dt.isValid ? dt : undefined;
604
+ }
605
+ if (typeof v.isValid === "boolean") {
606
+ return v;
607
+ }
608
+ return undefined;
609
+ }
573
610
  queryDataSet(dateInterval, select, order) {
574
611
  const scenarios = [
575
612
  "ac1",
@@ -590,13 +627,15 @@ export class TimeChart {
590
627
  "pl4",
591
628
  ];
592
629
  const dateSelect = `normalizeDate([date], '${dateInterval}' , '${this.locale}') as calcdate`;
593
- const result = alasql(`SELECT ${"p.calcdate"} ${select},
630
+ let result;
631
+ try {
632
+ result = this.db.exec(`SELECT ${"p.calcdate"} ${select},
594
633
  ${scenarios
595
- .map((scenario) => {
596
- return `SUM(${scenario} * transformOperator(operation)) as ${scenario}, COUNT(ISNULL(${scenario})) as ${scenario}_cnt`;
597
- })
598
- .join(",")}
599
-
634
+ .map((scenario) => {
635
+ return `SUM(${scenario} * transformOperator(operation)) as ${scenario}, COUNT(ISNULL(${scenario})) as ${scenario}_cnt`;
636
+ })
637
+ .join(",")}
638
+
600
639
  FROM (SELECT ${dateSelect} ${select},
601
640
  ac1,
602
641
  ac2,
@@ -614,9 +653,14 @@ export class TimeChart {
614
653
  pl2,
615
654
  pl3,
616
655
  pl4
617
- FROM ?) as p
656
+ FROM ${this.fromExpr}) as p
618
657
  GROUP BY ${"calcdate"} ${order}
619
- ORDER BY ${"calcdate asc"}`, [this.preparedDataSet]);
658
+ ORDER BY ${"calcdate asc"}`);
659
+ }
660
+ catch (e) {
661
+ console.error("TimeChart: queryDataSet failed", e);
662
+ return [];
663
+ }
620
664
  return result;
621
665
  }
622
666
  createDataRows(result, selectedScenarios) {
@@ -735,6 +779,7 @@ export class TimeChart {
735
779
  }
736
780
  createDateFactory() {
737
781
  const factory = new DateStringFactory();
782
+ factory.setLocale(this.locale);
738
783
  return factory;
739
784
  }
740
785
  drawAxisAndLabels(dataModel, svgContainer) {
@@ -990,6 +1035,17 @@ export class TimeChart {
990
1035
  };
991
1036
  return columnGroup;
992
1037
  }
1038
+ /** Restore the original `scenarios` prop order for stacked segments (IBCS sort reorders the slots). */
1039
+ sortSegmentsByPropOrder(segments) {
1040
+ if (this.scenarioPropOrder.length === 0)
1041
+ return;
1042
+ const order = this.scenarioPropOrder;
1043
+ segments.sort((a, b) => {
1044
+ const ia = order.indexOf(a.scenario);
1045
+ const ib = order.indexOf(b.scenario);
1046
+ return (ia === -1 ? order.length : ia) - (ib === -1 ? order.length : ib);
1047
+ });
1048
+ }
993
1049
  /**
994
1050
  * Draw stacked bar columns. Supports stacking by scenario or by data dimension.
995
1051
  * When stacking by scenario with multiple scenario types (e.g. ac+pl),
@@ -1011,6 +1067,7 @@ export class TimeChart {
1011
1067
  segments.push({ value: dp.value, scenario: dp.scenario, dataPoint: dp });
1012
1068
  }
1013
1069
  }
1070
+ this.sortSegmentsByPropOrder(segments);
1014
1071
  }
1015
1072
  else {
1016
1073
  const dp = elements["scenario1"];
@@ -1110,12 +1167,14 @@ export class TimeChart {
1110
1167
  }
1111
1168
  if (segments.length === 0)
1112
1169
  return;
1170
+ this.sortSegmentsByPropOrder(segments);
1113
1171
  const prefixes = new Set(segments.map((s) => getScenarioPrefix(s.scenario)));
1114
1172
  const axisY = this.position.getColumnPositionY();
1115
1173
  const xBase = this.position.getColumnCenterPositionX(0) - this.position.getColumnWidth() / 2;
1116
1174
  const labelX = xBase - this.position.spacings.labelToColumn;
1117
1175
  if (prefixes.size > 1) {
1118
- // Overlay mode: one header per group, centered vertically on group's column height
1176
+ // Overlay mode: one header per group — front group centered on its bar,
1177
+ // back groups aligned with their bar's top edge
1119
1178
  const groupMap = new Map();
1120
1179
  for (const seg of segments) {
1121
1180
  const prefix = getScenarioPrefix(seg.scenario);
@@ -1133,11 +1192,17 @@ export class TimeChart {
1133
1192
  for (const [prefix, segs] of groupMap) {
1134
1193
  groups.push({ prefix, segments: segs });
1135
1194
  }
1136
- groups.forEach((group) => {
1195
+ groups.forEach((group, groupIdx) => {
1137
1196
  const groupTotal = group.segments.reduce((sum, s) => sum + Math.abs(s.value), 0);
1138
1197
  const pixelPerUnit = group.segments[0].dataPoint.pixelPerUnit;
1139
- const groupPixelHeight = this.stackConfig.mode === StackMode.RELATIVE ? pixelPerUnit : groupTotal * pixelPerUnit;
1140
- const centerY = axisY - groupPixelHeight / 2;
1198
+ const groupPixelHeight = this.stackConfig.mode === StackMode.RELATIVE
1199
+ ? RELATIVE_STACK_UNITS * pixelPerUnit
1200
+ : groupTotal * pixelPerUnit;
1201
+ // The front-most group (drawn last, e.g. AC) is fully visible, so its
1202
+ // label is centered on the bar. Back groups are mostly hidden behind it
1203
+ // and only peek out at the top, so their labels align with the bar's top edge.
1204
+ const isFrontGroup = groupIdx === groups.length - 1;
1205
+ const centerY = isFrontGroup ? axisY - groupPixelHeight / 2 : axisY - groupPixelHeight;
1141
1206
  const labelText = this.i18n.get(group.prefix + "1") || group.prefix.toUpperCase();
1142
1207
  new Label(headerGroup, labelX, centerY, "STACK_HEADER", labelText, this.styles, HookLocation.Center, HookLocation.Right).forceStringTypeDraw();
1143
1208
  });
@@ -1155,7 +1220,7 @@ export class TimeChart {
1155
1220
  let segmentHeight;
1156
1221
  if (this.stackConfig.mode === StackMode.RELATIVE) {
1157
1222
  const proportion = total !== 0 ? Math.abs(seg.value) / total : 0;
1158
- segmentHeight = proportion * pixelPerUnit;
1223
+ segmentHeight = proportion * RELATIVE_STACK_UNITS * pixelPerUnit;
1159
1224
  }
1160
1225
  else {
1161
1226
  segmentHeight = Math.abs(seg.value * pixelPerUnit);
@@ -1196,6 +1261,15 @@ export class TimeChart {
1196
1261
  activeLayers.push(key);
1197
1262
  }
1198
1263
  }
1264
+ if (isScenarioStack && this.scenarioPropOrder.length > 0) {
1265
+ const order = this.scenarioPropOrder;
1266
+ activeLayers.sort((a, b) => {
1267
+ var _a, _b, _c, _d;
1268
+ const ia = order.indexOf((_b = (_a = dataModel[0][a]) === null || _a === void 0 ? void 0 : _a.scenario) !== null && _b !== void 0 ? _b : "");
1269
+ const ib = order.indexOf((_d = (_c = dataModel[0][b]) === null || _c === void 0 ? void 0 : _c.scenario) !== null && _d !== void 0 ? _d : "");
1270
+ return (ia === -1 ? order.length : ia) - (ib === -1 ? order.length : ib);
1271
+ });
1272
+ }
1199
1273
  // Compute cumulative values
1200
1274
  for (let layerIdx = 0; layerIdx < activeLayers.length; layerIdx++) {
1201
1275
  const key = activeLayers[layerIdx];
@@ -1229,7 +1303,7 @@ export class TimeChart {
1229
1303
  x: this.position.getColumnCenterPositionX(idx),
1230
1304
  y: axisY -
1231
1305
  (stackMode === StackMode.RELATIVE
1232
- ? val * pixelPerUnit // pixelPerUnit acts as "height for 100%"
1306
+ ? val * RELATIVE_STACK_UNITS * pixelPerUnit // val is a 0..1 cumulative proportion
1233
1307
  : val * pixelPerUnit),
1234
1308
  }));
1235
1309
  };
@@ -1281,12 +1355,14 @@ export class TimeChart {
1281
1355
  }
1282
1356
  }
1283
1357
  leftOuterJoinDates(result, dateInterval) {
1284
- const to = DateTime.max(...result.map(function (e) {
1285
- return e.calcdate;
1286
- }));
1287
- const from = DateTime.min(...result.map(function (e) {
1288
- return e.calcdate;
1289
- }));
1358
+ const validDates = result
1359
+ .map((e) => e.calcdate)
1360
+ .filter((d) => d != null && typeof d.isValid === "boolean" && d.isValid);
1361
+ if (validDates.length === 0) {
1362
+ return result;
1363
+ }
1364
+ const to = DateTime.max(...validDates);
1365
+ const from = DateTime.min(...validDates);
1290
1366
  const dateRange = new DateStringFactory().datesBetween(from, to, dateInterval, this.intervalSpanLimit);
1291
1367
  const dateRangeEntries = new Map();
1292
1368
  dateRange.forEach((element, idx) => {
@@ -1,6 +1,6 @@
1
1
  import { HookLocation, Label } from "./Label";
2
2
  import { SiPrefix } from "../../../../utils/model/SiPrefix";
3
- import { StackMode } from "../../../../utils/constants";
3
+ import { RELATIVE_STACK_UNITS, StackMode } from "../../../../utils/constants";
4
4
  /**
5
5
  * Renders a single segment within a stacked bar column in a time chart.
6
6
  *
@@ -44,8 +44,8 @@ export class StackedColumn {
44
44
  if (this.stackMode === StackMode.RELATIVE) {
45
45
  // 100% stacked: segment height is proportion of total
46
46
  const proportion = this.totalValue !== 0 ? Math.abs(value) / Math.abs(this.totalValue) : 0;
47
- // Use a fixed total height based on pixelPerUnit (total=1.0 for 100%)
48
- const totalPixelHeight = pixelPerUnit; // pixelPerUnit represents the height for 100%
47
+ // Full stack spans RELATIVE_STACK_UNITS percent; pixelPerUnit = pixels per percentage point
48
+ const totalPixelHeight = RELATIVE_STACK_UNITS * pixelPerUnit;
49
49
  segmentHeight = proportion * totalPixelHeight;
50
50
  const baselinePixels = (this.baselineValue / Math.abs(this.totalValue)) * totalPixelHeight;
51
51
  yPos = axisY - baselinePixels - segmentHeight;
@@ -54,20 +54,23 @@ export class TimeChartComponentConfig {
54
54
  this.stackConfig = null;
55
55
  /** When true, line charts extend to the full width of the chart area. */
56
56
  this.lineFullWidth = true;
57
+ /** Locale used for date-axis labels and SQL date normalization; set from the bn-context locale. */
58
+ this.locale = "de";
57
59
  }
58
60
  }
59
61
  /**
60
62
  * Converts untyped JSON into a validated {@link TimeChartComponentConfig}.
61
63
  *
62
- * Requires the raw dataset for measure scale auto-calculation.
64
+ * Reads from the shared alasql database for measure-scale auto-calculation.
63
65
  */
64
66
  export class TimeChartComponentConfigAdapter {
65
- constructor(dataRowAdapter, orderAdapter, stringAdapter, dataFormatDigitsAdapter, dataSet) {
67
+ constructor(dataRowAdapter, orderAdapter, stringAdapter, dataFormatDigitsAdapter, db, fromExpr) {
66
68
  this.dataRowAdapter = dataRowAdapter;
67
69
  this.orderAdapter = orderAdapter;
68
70
  this.stringAdapter = stringAdapter;
69
71
  this.dataFormatDigitsAdapter = dataFormatDigitsAdapter;
70
- this.dataSet = dataSet;
72
+ this.db = db;
73
+ this.fromExpr = fromExpr;
71
74
  }
72
75
  adapt(data) {
73
76
  const dataSet = AdapterUtils.adaptArray(data.data, this.dataRowAdapter);
@@ -113,7 +116,7 @@ export class TimeChartComponentConfigAdapter {
113
116
  config.filter = data.filter;
114
117
  }
115
118
  if (CompareUtil.isExisting(data.measureScale)) {
116
- config.measureScale = DataAnalyzer.calculateMeasureScale(this.dataSet, config.scenarios, data.measureScale);
119
+ config.measureScale = DataAnalyzer.calculateMeasureScale(this.db, this.fromExpr, config.scenarios, data.measureScale);
117
120
  }
118
121
  if (CompareUtil.isString(data.measureUnit)) {
119
122
  config.measureUnit = data.measureUnit;
@@ -142,6 +145,9 @@ export class TimeChartComponentConfigAdapter {
142
145
  if (CompareUtil.isBoolean(data.lineFullWidth)) {
143
146
  config.lineFullWidth = data.lineFullWidth;
144
147
  }
148
+ if (CompareUtil.isString(data.locale)) {
149
+ config.locale = data.locale;
150
+ }
145
151
  return config;
146
152
  }
147
153
  default() {
@@ -77,6 +77,8 @@ export class TimeChartDataRowAdapter {
77
77
  return dataRow;
78
78
  }
79
79
  parseDateString(date) {
80
+ if (typeof date !== "string")
81
+ return undefined;
80
82
  const timestamp = DateTime.fromISO(date);
81
83
  if (timestamp.isValid) {
82
84
  return timestamp;
@@ -28,7 +28,7 @@ export class ComponentStyle {
28
28
  });
29
29
  }
30
30
  render() {
31
- return h(Host, { key: 'e9298c6ce5b0b51260165e78dcf19efdef0646f9' });
31
+ return h(Host, { key: '9138ba4914f990823213f637bdc65274669bfe86' });
32
32
  }
33
33
  static get is() { return "bn-component-style"; }
34
34
  static get originalStyleUrls() {
@@ -49,7 +49,7 @@ export class Context {
49
49
  componentWillUpdate() { }
50
50
  componentDidUpdate() { }
51
51
  render() {
52
- return (h(Host, { key: 'b92019b909e271225baca2cf740c8301e324164e' }, h("slot", { key: '87bac4bb29bca32d961afe31355dc1bd48fff0f8' })));
52
+ return (h(Host, { key: '3c27b95cb769f4871f06453c73faa2a15dd04aa6' }, h("slot", { key: '4965ab0122454b1b84d463146e949e432adbd06c' })));
53
53
  }
54
54
  static get is() { return "bn-context"; }
55
55
  static get encapsulation() { return "shadow"; }
@@ -83,6 +83,25 @@ export class Context {
83
83
  "setter": false,
84
84
  "reflect": false,
85
85
  "attribute": "locale"
86
+ },
87
+ "i18nNamespace": {
88
+ "type": "string",
89
+ "mutable": false,
90
+ "complexType": {
91
+ "original": "string",
92
+ "resolved": "string",
93
+ "references": {}
94
+ },
95
+ "required": false,
96
+ "optional": false,
97
+ "docs": {
98
+ "tags": [],
99
+ "text": "Default i18n namespace for every component inside this context.\nResolved at runtime from the `i18n-namespace` attribute by the nearest\nancestor lookup in `withTranslation`; a namespace set on a page, card,\ntree, grid, or the component itself wins. Declared so the attribute is\npart of the typed public API rather than a bare DOM attribute."
100
+ },
101
+ "getter": false,
102
+ "setter": false,
103
+ "reflect": true,
104
+ "attribute": "i18n-namespace"
86
105
  }
87
106
  };
88
107
  }