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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (392) hide show
  1. package/LICENSE +203 -21
  2. package/dist/bn-template-engine/bn-template-engine.esm.js +1 -1
  3. package/dist/bn-template-engine/p-19bbac66.entry.js +1 -0
  4. package/dist/bn-template-engine/p-209351c9.entry.js +1 -0
  5. package/dist/bn-template-engine/p-22d0fb7a.entry.js +1 -0
  6. package/dist/bn-template-engine/p-2e6dc267.entry.js +1 -0
  7. package/dist/bn-template-engine/p-485d23d7.entry.js +1 -0
  8. package/dist/bn-template-engine/p-74c5a95d.entry.js +1 -0
  9. package/dist/bn-template-engine/p-7bdc0e28.entry.js +1 -0
  10. package/dist/bn-template-engine/p-83c71b16.entry.js +1 -0
  11. package/dist/bn-template-engine/p-90806e7a.entry.js +1 -0
  12. package/dist/bn-template-engine/p-9879c9b2.entry.js +1 -0
  13. package/dist/bn-template-engine/p-BA48JiHe.js +1 -0
  14. package/dist/bn-template-engine/p-BWKdb9ym.js +1 -0
  15. package/dist/bn-template-engine/p-BZV1b5VH.js +1 -0
  16. package/dist/bn-template-engine/p-Bdfxd_Ke.js +1 -0
  17. package/dist/bn-template-engine/p-BjBz5cSL.js +1 -0
  18. package/dist/bn-template-engine/p-BqhIhYr1.js +1 -0
  19. package/dist/bn-template-engine/p-C0Pwqx-O.js +1 -0
  20. package/dist/bn-template-engine/p-CiudZRQr.js +1 -0
  21. package/dist/bn-template-engine/p-DTuaq8Pj.js +1 -0
  22. package/dist/bn-template-engine/p-DY7YYmpa.js +1 -0
  23. package/dist/bn-template-engine/p-Dg9OcXAO.js +1 -0
  24. package/dist/bn-template-engine/p-DsTzlzxQ.js +1 -0
  25. package/dist/bn-template-engine/p-X6CxL6W-.js +1 -0
  26. package/dist/bn-template-engine/p-a8291de2.entry.js +1 -0
  27. package/dist/bn-template-engine/p-aakBGfzL.js +1 -0
  28. package/dist/bn-template-engine/p-b25455a7.entry.js +1 -0
  29. package/dist/bn-template-engine/p-e96da91f.entry.js +1 -0
  30. package/dist/bn-template-engine/p-eca8e2e2.entry.js +1 -0
  31. package/dist/bn-template-engine/p-f9dfd120.entry.js +1 -0
  32. package/dist/bn-template-engine/p-rdqTC0_5.js +1 -0
  33. package/dist/cjs/AxisConfig-VnVelfSV.js +233 -0
  34. package/dist/cjs/LabelCollisionManager-nfD5P__k.js +412 -0
  35. package/dist/cjs/NumericScale-BAyYXpKL.js +107 -0
  36. package/dist/cjs/Order-DobBozQC.js +87 -0
  37. package/dist/cjs/SVGStyle-BQOmGWLX.js +8209 -0
  38. package/dist/cjs/SVGVariancesStyleGroup-DCGfHrqh.js +50 -0
  39. package/dist/cjs/VarianceMeasure-NY9yhiNV.js +372 -0
  40. package/dist/cjs/XYChartDataRow-B7OKrAcC.js +829 -0
  41. package/dist/cjs/bn-asset_21.cjs.entry.js +16047 -0
  42. package/dist/cjs/bn-chart-bubble.cjs.entry.js +762 -0
  43. package/dist/cjs/bn-chart-bullet.cjs.entry.js +785 -0
  44. package/dist/cjs/bn-chart-scatter.cjs.entry.js +658 -0
  45. package/dist/cjs/bn-grid.cjs.entry.js +5 -3
  46. package/dist/cjs/bn-image.cjs.entry.js +5 -3
  47. package/dist/cjs/bn-internationalization.cjs.entry.js +10 -8
  48. package/dist/cjs/bn-ruleset.cjs.entry.js +41 -0
  49. package/dist/cjs/bn-template-engine.cjs.js +1 -1
  50. package/dist/cjs/bn-template.cjs.entry.js +1 -1
  51. package/dist/cjs/bn-text.cjs.entry.js +8 -79
  52. package/dist/cjs/bn-tree.cjs.entry.js +9 -3
  53. package/dist/cjs/context-protocol-BDrMkhc4.js +9499 -0
  54. package/dist/cjs/editor-companion.cjs.entry.js +13 -6
  55. package/dist/cjs/ibcs-chart-bubble.cjs.entry.js +624 -0
  56. package/dist/cjs/ibcs-chart-bullet.cjs.entry.js +673 -0
  57. package/dist/cjs/ibcs-chart-scatter.cjs.entry.js +667 -0
  58. package/dist/cjs/layoutObserver-o03YUfn_.js +199 -0
  59. package/dist/cjs/loader.cjs.js +1 -1
  60. package/dist/cjs/sanitizeHtml-LuZr1IMd.js +85 -0
  61. package/dist/cjs/scaling-DKZyjWj5.js +587 -0
  62. package/dist/cjs/{withBodyObserver-D7BKWN2N.js → withBodyObserver-BKUE_ypL.js} +12 -7
  63. package/dist/cjs/withScalingGroup-BmcRlWBs.js +73 -0
  64. package/dist/cjs/withStyled-CRiC9fzc.js +1137 -0
  65. package/dist/collection/collection-manifest.json +9 -1
  66. package/dist/collection/components/bn-body/bn-body.css +1 -0
  67. package/dist/collection/components/bn-card/bn-card.css +2 -0
  68. package/dist/collection/components/bn-chart-bubble/bn-chart-bubble.css +10 -0
  69. package/dist/collection/components/bn-chart-bubble/bn-chart-bubble.js +1110 -0
  70. package/dist/collection/components/bn-chart-bubble/ibcs-chart-bubble.css +9 -0
  71. package/dist/collection/components/bn-chart-bubble/ibcs-chart-bubble.js +653 -0
  72. package/dist/collection/components/bn-chart-bubble/utils/BubbleChart.js +472 -0
  73. package/dist/collection/components/bn-chart-bullet/bn-chart-bullet.css +10 -0
  74. package/dist/collection/components/bn-chart-bullet/bn-chart-bullet.js +1014 -0
  75. package/dist/collection/components/bn-chart-bullet/ibcs-chart-bullet.css +9 -0
  76. package/dist/collection/components/bn-chart-bullet/ibcs-chart-bullet.js +538 -0
  77. package/dist/collection/components/bn-chart-bullet/utils/BulletChart.js +440 -0
  78. package/dist/collection/components/bn-chart-bullet/utils/model/BulletChartStyle.js +132 -0
  79. package/dist/collection/components/bn-chart-bullet/utils/model/BulletConfig.js +89 -0
  80. package/dist/collection/components/bn-chart-bullet/utils/model/index.js +2 -0
  81. package/dist/collection/components/bn-chart-scatter/bn-chart-scatter.css +10 -0
  82. package/dist/collection/components/bn-chart-scatter/bn-chart-scatter.js +965 -0
  83. package/dist/collection/components/bn-chart-scatter/ibcs-chart-scatter.css +9 -0
  84. package/dist/collection/components/bn-chart-scatter/ibcs-chart-scatter.js +580 -0
  85. package/dist/collection/components/bn-chart-scatter/utils/ScatterChart.js +409 -0
  86. package/dist/collection/components/bn-chart-structure/bn-chart-structure.js +127 -41
  87. package/dist/collection/components/bn-chart-structure/ibcs-chart-structure.js +103 -36
  88. package/dist/collection/components/bn-chart-structure/utils/StructureChart.js +82 -58
  89. package/dist/collection/components/bn-chart-structure/utils/helper/ElementPositions.js +46 -4
  90. package/dist/collection/components/bn-chart-structure/utils/model/StructureChartComponentConfig.js +5 -4
  91. package/dist/collection/components/bn-chart-time/bn-chart-time.css +1 -1
  92. package/dist/collection/components/bn-chart-time/bn-chart-time.js +162 -42
  93. package/dist/collection/components/bn-chart-time/ibcs-chart-time.js +94 -31
  94. package/dist/collection/components/bn-chart-time/utils/TimeChart.js +132 -74
  95. package/dist/collection/components/bn-chart-time/utils/elements/StackedColumn.js +3 -3
  96. package/dist/collection/components/bn-chart-time/utils/model/TimeChartComponentConfig.js +5 -4
  97. package/dist/collection/components/bn-chart-time/utils/model/TimeChartDataRow.js +2 -0
  98. package/dist/collection/components/bn-component-style/bn-component-style.js +1 -1
  99. package/dist/collection/components/bn-context/bn-context.js +1 -1
  100. package/dist/collection/components/bn-dataset/bn-dataset.js +226 -23
  101. package/dist/collection/components/bn-datasource/bn-datasource.js +163 -12
  102. package/dist/collection/components/bn-footer/bn-footer.js +1 -1
  103. package/dist/collection/components/bn-grid/bn-grid.js +1 -1
  104. package/dist/collection/components/bn-image/bn-image.js +1 -1
  105. package/dist/collection/components/bn-internationalization/bn-internationalization.js +10 -7
  106. package/dist/collection/components/bn-layout-card/bn-layout-card.css +8 -3
  107. package/dist/collection/components/bn-layout-card/bn-layout-card.js +98 -35
  108. package/dist/collection/components/bn-layout-page/bn-layout-page.css +5 -3
  109. package/dist/collection/components/bn-layout-page/bn-layout-page.js +98 -25
  110. package/dist/collection/components/bn-message/bn-message.css +6 -2
  111. package/dist/collection/components/bn-message/bn-message.js +3 -2
  112. package/dist/collection/components/bn-page/bn-page.js +1 -1
  113. package/dist/collection/components/bn-ruleset/bn-ruleset.css +3 -0
  114. package/dist/collection/components/bn-ruleset/bn-ruleset.js +68 -0
  115. package/dist/collection/components/bn-scaling-group/bn-scaling-group.css +3 -0
  116. package/dist/collection/components/bn-scaling-group/bn-scaling-group.js +136 -0
  117. package/dist/collection/components/bn-table/bn-table.js +317 -61
  118. package/dist/collection/components/bn-table/ibcs-table.css +8 -0
  119. package/dist/collection/components/bn-table/ibcs-table.js +161 -32
  120. package/dist/collection/components/bn-table/utils/Table.js +72 -28
  121. package/dist/collection/components/bn-table/utils/elements/CellBarChart.js +13 -8
  122. package/dist/collection/components/bn-table/utils/elements/TableRow.js +3 -2
  123. package/dist/collection/components/bn-table/utils/elements/WaterfallBar.js +47 -0
  124. package/dist/collection/components/bn-table/utils/elements/index.js +1 -0
  125. package/dist/collection/components/bn-table/utils/factories/tableDataSetFactory.js +117 -22
  126. package/dist/collection/components/bn-table/utils/helper/DataQuery.js +380 -50
  127. package/dist/collection/components/bn-table/utils/helper/IntervalColumns.js +140 -0
  128. package/dist/collection/components/bn-table/utils/helper/QueryGroup.js +4 -9
  129. package/dist/collection/components/bn-table/utils/helper/WaterfallCalculator.js +166 -0
  130. package/dist/collection/components/bn-table/utils/helper/index.js +2 -0
  131. package/dist/collection/components/bn-table/utils/model/TableAttribute.js +46 -0
  132. package/dist/collection/components/bn-table/utils/model/TableComponentConfig.js +20 -4
  133. package/dist/collection/components/bn-template/bn-template.js +1 -1
  134. package/dist/collection/components/bn-text/bn-text.js +2 -75
  135. package/dist/collection/components/bn-title/bn-title.js +27 -3
  136. package/dist/collection/components/bn-title/ibcs-title/ibcs-title.css +4 -0
  137. package/dist/collection/components/bn-title/ibcs-title/ibcs-title.js +29 -6
  138. package/dist/collection/components/bn-title/ibcs-title/utils/Title.js +3 -0
  139. package/dist/collection/components/bn-tree/bn-tree.js +5 -1
  140. package/dist/collection/components/editor-companion/editor-companion.js +12 -5
  141. package/dist/collection/context/scopedDb.js +127 -0
  142. package/dist/collection/stores/componentStyles.js +67 -0
  143. package/dist/collection/stores/createScopedStores.js +11 -5
  144. package/dist/collection/stores/internationalization.js +68 -0
  145. package/dist/collection/stores/ruleSets.js +46 -0
  146. package/dist/collection/utils/constants.js +5 -0
  147. package/dist/collection/utils/dataAnalyzer.js +14 -8
  148. package/dist/collection/utils/ibcsRuleSet.js +14 -26
  149. package/dist/collection/utils/layoutObserver.js +88 -0
  150. package/dist/collection/utils/parentDimensions.js +71 -15
  151. package/dist/collection/utils/sanitizeHtml.js +81 -0
  152. package/dist/collection/utils/validate.js +47 -0
  153. package/dist/collection/utils/withBodyObserver.js +12 -7
  154. package/dist/collection/utils/withComponentStyle.js +3 -5
  155. package/dist/collection/utils/withDataset.js +43 -39
  156. package/dist/collection/utils/withDatasource.js +28 -18
  157. package/dist/collection/utils/withInheritedProps.js +26 -1
  158. package/dist/collection/utils/withRuleSet.js +105 -0
  159. package/dist/collection/utils/withScalingGroup.js +69 -0
  160. package/dist/collection/utils/withTranslation.js +50 -14
  161. package/dist/collection/utils/xy/FacetGrid.js +36 -0
  162. package/dist/collection/utils/xy/IsoCurves.js +156 -0
  163. package/dist/collection/utils/xy/NumericScale.js +103 -0
  164. package/dist/collection/utils/xy/PointLabeler.js +96 -0
  165. package/dist/collection/utils/xy/RadiusScale.js +42 -0
  166. package/dist/collection/utils/xy/SeriesPalette.js +80 -0
  167. package/dist/collection/utils/xy/VarianceMeasure.js +76 -0
  168. package/dist/collection/utils/xy/XYFrame.js +120 -0
  169. package/dist/collection/utils/xy/XYLegend.js +107 -0
  170. package/dist/collection/utils/xy/model/AxisConfig.js +221 -0
  171. package/dist/collection/utils/xy/model/ScaleFactorsXYChart.js +69 -0
  172. package/dist/collection/utils/xy/model/XYChartDataRow.js +0 -0
  173. package/dist/collection/utils/xy/model/XYChartStyle.js +52 -0
  174. package/dist/components/AxisConfig.js +1 -0
  175. package/dist/components/CompareUtil.js +1 -0
  176. package/dist/components/DataFormatDigits.js +1 -1
  177. package/dist/components/DateStringFactory.js +1 -1
  178. package/dist/components/LabelCollisionManager.js +1 -0
  179. package/dist/components/NumericScale.js +1 -0
  180. package/dist/components/Order.js +1 -1
  181. package/dist/components/SVGVariancesStyleGroup.js +1 -1
  182. package/dist/components/SiPrefix.js +1 -0
  183. package/dist/components/StringAdapter.js +1 -0
  184. package/dist/components/VarianceMeasure.js +1 -0
  185. package/dist/components/XYChartDataRow.js +1 -0
  186. package/dist/components/bn-body2.js +1 -1
  187. package/dist/components/bn-card2.js +1 -1
  188. package/dist/components/bn-chart-bubble.d.ts +11 -0
  189. package/dist/components/bn-chart-bubble.js +1 -0
  190. package/dist/components/bn-chart-bullet.d.ts +11 -0
  191. package/dist/components/bn-chart-bullet.js +1 -0
  192. package/dist/components/bn-chart-scatter.d.ts +11 -0
  193. package/dist/components/bn-chart-scatter.js +1 -0
  194. package/dist/components/bn-chart-structure.js +1 -1
  195. package/dist/components/bn-chart-time.js +1 -1
  196. package/dist/components/bn-component-style.js +1 -1
  197. package/dist/components/bn-context.js +1 -1
  198. package/dist/components/bn-dataset.js +1 -1
  199. package/dist/components/bn-datasource.js +1 -1
  200. package/dist/components/bn-footer2.js +1 -1
  201. package/dist/components/bn-grid.js +1 -1
  202. package/dist/components/bn-image.js +1 -1
  203. package/dist/components/bn-internationalization.js +1 -1
  204. package/dist/components/bn-layout-card.js +1 -1
  205. package/dist/components/bn-layout-page.js +1 -1
  206. package/dist/components/bn-message2.js +1 -1
  207. package/dist/components/bn-page2.js +1 -1
  208. package/dist/components/bn-ruleset.d.ts +11 -0
  209. package/dist/components/bn-ruleset.js +1 -0
  210. package/dist/components/bn-scaling-group.d.ts +11 -0
  211. package/dist/components/bn-scaling-group.js +1 -0
  212. package/dist/components/bn-table.js +1 -1
  213. package/dist/components/bn-template.js +1 -1
  214. package/dist/components/bn-text.js +1 -1
  215. package/dist/components/bn-title2.js +1 -1
  216. package/dist/components/bn-tree.js +1 -1
  217. package/dist/components/context-protocol.js +1 -1
  218. package/dist/components/editor-companion.js +1 -1
  219. package/dist/components/formatter.js +1 -0
  220. package/dist/components/ibcs-chart-bubble.d.ts +11 -0
  221. package/dist/components/ibcs-chart-bubble.js +1 -0
  222. package/dist/components/ibcs-chart-bubble2.js +1 -0
  223. package/dist/components/ibcs-chart-bullet.d.ts +11 -0
  224. package/dist/components/ibcs-chart-bullet.js +1 -0
  225. package/dist/components/ibcs-chart-bullet2.js +1 -0
  226. package/dist/components/ibcs-chart-scatter.d.ts +11 -0
  227. package/dist/components/ibcs-chart-scatter.js +1 -0
  228. package/dist/components/ibcs-chart-scatter2.js +1 -0
  229. package/dist/components/ibcs-chart-structure2.js +1 -1
  230. package/dist/components/ibcs-chart-time2.js +1 -1
  231. package/dist/components/ibcs-table2.js +1 -1
  232. package/dist/components/ibcs-title2.js +1 -1
  233. package/dist/components/layoutObserver.js +1 -0
  234. package/dist/components/luxon.js +1 -0
  235. package/dist/components/main.js +1 -0
  236. package/dist/components/merge.js +1 -0
  237. package/dist/components/sanitizeHtml.js +1 -0
  238. package/dist/components/stackColors.js +1 -0
  239. package/dist/components/validate.js +1 -1
  240. package/dist/components/withBodyObserver.js +1 -1
  241. package/dist/components/withComponentStyle.js +1 -1
  242. package/dist/components/withDataset.js +1 -0
  243. package/dist/components/withRuleSet.js +1 -0
  244. package/dist/components/withScalingGroup.js +1 -0
  245. package/dist/components/withStyled.js +1 -1
  246. package/dist/components/withTranslation.js +1 -1
  247. package/dist/esm/AxisConfig-C_zWCKlL.js +224 -0
  248. package/dist/esm/LabelCollisionManager-8swVQHKA.js +404 -0
  249. package/dist/esm/NumericScale-DsTzlzxQ.js +105 -0
  250. package/dist/esm/Order-BPeWfygb.js +83 -0
  251. package/dist/esm/SVGStyle-BxEDw9zh.js +8199 -0
  252. package/dist/esm/SVGVariancesStyleGroup-DRQYvSDD.js +48 -0
  253. package/dist/esm/VarianceMeasure-DnwNKspZ.js +364 -0
  254. package/dist/esm/XYChartDataRow-DeV4r-Wm.js +820 -0
  255. package/dist/esm/bn-asset_21.entry.js +16025 -0
  256. package/dist/esm/bn-chart-bubble.entry.js +760 -0
  257. package/dist/esm/bn-chart-bullet.entry.js +783 -0
  258. package/dist/esm/bn-chart-scatter.entry.js +656 -0
  259. package/dist/esm/bn-grid.entry.js +5 -3
  260. package/dist/esm/bn-image.entry.js +5 -3
  261. package/dist/esm/bn-internationalization.entry.js +10 -8
  262. package/dist/esm/bn-ruleset.entry.js +39 -0
  263. package/dist/esm/bn-template-engine.js +1 -1
  264. package/dist/esm/bn-template.entry.js +1 -1
  265. package/dist/esm/bn-text.entry.js +7 -78
  266. package/dist/esm/bn-tree.entry.js +9 -3
  267. package/dist/esm/context-protocol-1Yj1uKvh.js +9484 -0
  268. package/dist/esm/editor-companion.entry.js +13 -6
  269. package/dist/esm/ibcs-chart-bubble.entry.js +622 -0
  270. package/dist/esm/ibcs-chart-bullet.entry.js +671 -0
  271. package/dist/esm/ibcs-chart-scatter.entry.js +665 -0
  272. package/dist/esm/layoutObserver-BG5dOBYH.js +196 -0
  273. package/dist/esm/loader.js +1 -1
  274. package/dist/esm/sanitizeHtml-BA48JiHe.js +83 -0
  275. package/dist/esm/scaling-CeSRcRl1.js +579 -0
  276. package/dist/esm/{withBodyObserver-AFk2wwHT.js → withBodyObserver-IokS6fHD.js} +12 -7
  277. package/dist/esm/withScalingGroup-Br70pAv9.js +71 -0
  278. package/dist/esm/withStyled-Br2DGTPs.js +1104 -0
  279. package/dist/types/components/bn-chart-bubble/bn-chart-bubble.d.ts +193 -0
  280. package/dist/types/components/bn-chart-bubble/ibcs-chart-bubble.d.ts +58 -0
  281. package/dist/types/components/bn-chart-bubble/utils/BubbleChart.d.ts +91 -0
  282. package/dist/types/components/bn-chart-bullet/bn-chart-bullet.d.ts +172 -0
  283. package/dist/types/components/bn-chart-bullet/ibcs-chart-bullet.d.ts +52 -0
  284. package/dist/types/components/bn-chart-bullet/utils/BulletChart.d.ts +91 -0
  285. package/dist/types/components/bn-chart-bullet/utils/model/BulletChartStyle.d.ts +70 -0
  286. package/dist/types/components/bn-chart-bullet/utils/model/BulletConfig.d.ts +43 -0
  287. package/dist/types/components/bn-chart-bullet/utils/model/index.d.ts +2 -0
  288. package/dist/types/components/bn-chart-scatter/bn-chart-scatter.d.ts +172 -0
  289. package/dist/types/components/bn-chart-scatter/ibcs-chart-scatter.d.ts +53 -0
  290. package/dist/types/components/bn-chart-scatter/utils/ScatterChart.d.ts +66 -0
  291. package/dist/types/components/bn-chart-structure/bn-chart-structure.d.ts +19 -5
  292. package/dist/types/components/bn-chart-structure/ibcs-chart-structure.d.ts +13 -6
  293. package/dist/types/components/bn-chart-structure/utils/StructureChart.d.ts +16 -12
  294. package/dist/types/components/bn-chart-structure/utils/helper/ElementPositions.d.ts +16 -1
  295. package/dist/types/components/bn-chart-structure/utils/model/StructureChartComponentConfig.d.ts +5 -3
  296. package/dist/types/components/bn-chart-time/bn-chart-time.d.ts +53 -13
  297. package/dist/types/components/bn-chart-time/ibcs-chart-time.d.ts +13 -6
  298. package/dist/types/components/bn-chart-time/utils/TimeChart.d.ts +16 -12
  299. package/dist/types/components/bn-chart-time/utils/model/TimeChartComponentConfig.d.ts +5 -3
  300. package/dist/types/components/bn-dataset/bn-dataset.d.ts +47 -5
  301. package/dist/types/components/bn-datasource/bn-datasource.d.ts +53 -6
  302. package/dist/types/components/bn-layout-card/bn-layout-card.d.ts +35 -8
  303. package/dist/types/components/bn-layout-page/bn-layout-page.d.ts +32 -1
  304. package/dist/types/components/bn-message/bn-message.d.ts +5 -2
  305. package/dist/types/components/bn-ruleset/bn-ruleset.d.ts +8 -0
  306. package/dist/types/components/bn-scaling-group/bn-scaling-group.d.ts +37 -0
  307. package/dist/types/components/bn-table/bn-table.d.ts +74 -12
  308. package/dist/types/components/bn-table/ibcs-table.d.ts +27 -4
  309. package/dist/types/components/bn-table/utils/Table.d.ts +16 -6
  310. package/dist/types/components/bn-table/utils/elements/Cell.d.ts +2 -0
  311. package/dist/types/components/bn-table/utils/elements/CellBarChart.d.ts +33 -0
  312. package/dist/types/components/bn-table/utils/elements/TableRow.d.ts +2 -1
  313. package/dist/types/components/bn-table/utils/elements/WaterfallBar.d.ts +21 -0
  314. package/dist/types/components/bn-table/utils/elements/index.d.ts +1 -0
  315. package/dist/types/components/bn-table/utils/factories/tableDataSetFactory.d.ts +17 -9
  316. package/dist/types/components/bn-table/utils/helper/DataQuery.d.ts +35 -3
  317. package/dist/types/components/bn-table/utils/helper/IntervalColumns.d.ts +37 -0
  318. package/dist/types/components/bn-table/utils/helper/QueryGroup.d.ts +4 -5
  319. package/dist/types/components/bn-table/utils/helper/WaterfallCalculator.d.ts +55 -0
  320. package/dist/types/components/bn-table/utils/helper/index.d.ts +2 -0
  321. package/dist/types/components/bn-table/utils/model/TableAttribute.d.ts +22 -0
  322. package/dist/types/components/bn-table/utils/model/TableComponentConfig.d.ts +12 -3
  323. package/dist/types/components/bn-table/utils/model/index.d.ts +21 -0
  324. package/dist/types/components/bn-title/bn-title.d.ts +11 -1
  325. package/dist/types/components/bn-title/ibcs-title/ibcs-title.d.ts +2 -0
  326. package/dist/types/components/bn-title/ibcs-title/utils/Title.d.ts +1 -0
  327. package/dist/types/components/editor-companion/editor-companion.d.ts +2 -0
  328. package/dist/types/components.d.ts +1691 -120
  329. package/dist/types/context/context-protocol.d.ts +7 -3
  330. package/dist/types/context/scopedDb.d.ts +37 -0
  331. package/dist/types/stores/componentStyles.d.ts +41 -0
  332. package/dist/types/stores/createScopedStores.d.ts +4 -2
  333. package/dist/types/stores/ruleSets.d.ts +40 -0
  334. package/dist/types/utils/DateStringFactory.d.ts +1 -1
  335. package/dist/types/utils/constants.d.ts +5 -0
  336. package/dist/types/utils/dataAnalyzer.d.ts +2 -1
  337. package/dist/types/utils/ibcsRuleSet.d.ts +6 -1
  338. package/dist/types/utils/layoutObserver.d.ts +27 -0
  339. package/dist/types/utils/model/ChartStyles.d.ts +2 -1
  340. package/dist/types/utils/parentDimensions.d.ts +1 -1
  341. package/dist/types/utils/sanitizeHtml.d.ts +6 -0
  342. package/dist/types/utils/validate.d.ts +18 -0
  343. package/dist/types/utils/withDataset.d.ts +6 -2
  344. package/dist/types/utils/withDatasource.d.ts +3 -3
  345. package/dist/types/utils/withInheritedProps.d.ts +19 -0
  346. package/dist/types/utils/withRuleSet.d.ts +24 -0
  347. package/dist/types/utils/withScalingGroup.d.ts +14 -0
  348. package/dist/types/utils/withTranslation.d.ts +12 -4
  349. package/dist/types/utils/xy/FacetGrid.d.ts +27 -0
  350. package/dist/types/utils/xy/IsoCurves.d.ts +46 -0
  351. package/dist/types/utils/xy/NumericScale.d.ts +41 -0
  352. package/dist/types/utils/xy/PointLabeler.d.ts +58 -0
  353. package/dist/types/utils/xy/RadiusScale.d.ts +26 -0
  354. package/dist/types/utils/xy/SeriesPalette.d.ts +59 -0
  355. package/dist/types/utils/xy/VarianceMeasure.d.ts +37 -0
  356. package/dist/types/utils/xy/XYFrame.d.ts +44 -0
  357. package/dist/types/utils/xy/XYLegend.d.ts +43 -0
  358. package/dist/types/utils/xy/model/AxisConfig.d.ts +96 -0
  359. package/dist/types/utils/xy/model/ScaleFactorsXYChart.d.ts +36 -0
  360. package/dist/types/utils/xy/model/XYChartDataRow.d.ts +157 -0
  361. package/dist/types/utils/xy/model/XYChartStyle.d.ts +31 -0
  362. package/package.json +5 -4
  363. package/readme.md +9 -5
  364. package/dist/bn-template-engine/p-0d41c5d8.entry.js +0 -1
  365. package/dist/bn-template-engine/p-67538176.entry.js +0 -1
  366. package/dist/bn-template-engine/p-825a07a8.entry.js +0 -1
  367. package/dist/bn-template-engine/p-916296a5.entry.js +0 -1
  368. package/dist/bn-template-engine/p-96006b06.entry.js +0 -1
  369. package/dist/bn-template-engine/p-Ck-NYtot.js +0 -1
  370. package/dist/bn-template-engine/p-CnDq0oVa.js +0 -1
  371. package/dist/bn-template-engine/p-DSXNgKLa.js +0 -1
  372. package/dist/bn-template-engine/p-bc711fb0.entry.js +0 -1
  373. package/dist/bn-template-engine/p-e6f646b1.entry.js +0 -1
  374. package/dist/bn-template-engine/p-f41d9242.entry.js +0 -1
  375. package/dist/bn-template-engine/p-gFbbuhtl.js +0 -1
  376. package/dist/cjs/bn-asset_20.cjs.entry.js +0 -23541
  377. package/dist/cjs/context-protocol-ohYzcb5F.js +0 -663
  378. package/dist/cjs/scaling-CIAClQR5.js +0 -314
  379. package/dist/cjs/withStyled-qd94SSb4.js +0 -9535
  380. package/dist/collection/stores/datasets.js +0 -14
  381. package/dist/collection/stores/datasources.js +0 -14
  382. package/dist/components/_commonjsHelpers.js +0 -1
  383. package/dist/components/alasql.min.js +0 -1
  384. package/dist/components/ibcsRuleSet.js +0 -1
  385. package/dist/components/scaling.js +0 -1
  386. package/dist/components/withInheritedProps.js +0 -1
  387. package/dist/esm/bn-asset_20.entry.js +0 -23520
  388. package/dist/esm/context-protocol-DdbSplvE.js +0 -656
  389. package/dist/esm/scaling-DGKKkuL9.js +0 -309
  390. package/dist/esm/withStyled-BIkqU2w4.js +0 -9501
  391. package/dist/types/stores/datasets.d.ts +0 -14
  392. package/dist/types/stores/datasources.d.ts +0 -14
@@ -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,7 +50,7 @@ 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 = [];
@@ -63,7 +63,8 @@ export class TimeChart {
63
63
  this.pixelPerPercentage = 1;
64
64
  this.hideAxisLabels = false;
65
65
  this.axisScenario = Scenario.AC1;
66
- this.preparedDataSet = [];
66
+ this.fromExpr = "";
67
+ this.rowCount = 0;
67
68
  this.axisCategoryArea = { width: 0, height: 0 };
68
69
  this.scenariosArea = { width: 0, height: 0 };
69
70
  this.state = FactoryState.DIRTY;
@@ -81,36 +82,29 @@ export class TimeChart {
81
82
  this.chartMode = ChartMode.BAR;
82
83
  this.maxBars = 28;
83
84
  this.stackConfig = null;
85
+ this.scenarioPropOrder = [];
84
86
  this.lineFullWidth = true;
85
87
  this.availableWidth = 0;
86
88
  this.overflowConfig = null;
87
89
  this.lastScenarios = [];
88
- this.initSQLFunctions();
90
+ this.db = db;
91
+ this.tableName = tableName;
89
92
  this.ruleSet = ruleSet || new IBCSRuleSet();
90
93
  this.i18n = this.createI18n(new Map());
91
94
  this.styles = styles;
92
95
  this.availableWidth = availableWidth;
93
96
  this.setConfig(config);
94
- this.position = this.createElementPosition(config.scenarios);
97
+ this.position = this.createElementPosition(this.lastScenarios);
95
98
  }
96
99
  updatePosition(scenarios) {
97
100
  this.position = this.createElementPosition(scenarios);
98
101
  }
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
102
  setStyles(newStyle) {
112
103
  this.styles = newStyle;
113
104
  }
105
+ setRuleSet(ruleSet) {
106
+ this.ruleSet = ruleSet || new IBCSRuleSet();
107
+ }
114
108
  setAvailableWidth(w) {
115
109
  this.availableWidth = w;
116
110
  }
@@ -173,15 +167,16 @@ export class TimeChart {
173
167
  setConfig(config) {
174
168
  var _a;
175
169
  this.state = FactoryState.DIRTY;
176
- this.sortScenariosbyVisualisationRules(config);
177
- this.setData([...config.data], config.filter);
170
+ this.scenarioPropOrder = [...config.scenarios];
171
+ const scenarios = this.sortScenariosbyVisualisationRules(config.scenarios);
172
+ this.setSource(config.filter);
178
173
  this.hideAxisLabels = config.hideAxisLabels || false;
179
174
  this.pixelPerUnit = config.pixelPerUnit;
180
175
  this.pixelPerPercentage = config.pixelPerPercentage;
181
176
  this.axisLabelsMode = config.axisLabelsMode;
182
177
  this.intervalSpanLimit = config.intervalSpanLimit;
183
178
  this.dateInterval = this.findDateInterval(config.dateInterval);
184
- this.dataModel = this.populateModel(config.scenarios, this.dateInterval, config.level, config.sortOrder);
179
+ this.dataModel = this.populateModel(scenarios, this.dateInterval, config.level, config.sortOrder);
185
180
  this.variancesDataModel = this.populateVarianceModel(config.variances, this.dataModel);
186
181
  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
182
  this.smallestDataPointValue = this.findSmallestDataPointValue(this.dataModel);
@@ -199,8 +194,8 @@ export class TimeChart {
199
194
  this.maxBars = config.maxBars;
200
195
  this.stackConfig = config.stackConfig;
201
196
  this.lineFullWidth = config.lineFullWidth;
202
- this.lastScenarios = config.scenarios;
203
- this.updatePosition(config.scenarios);
197
+ this.lastScenarios = scenarios;
198
+ this.updatePosition(scenarios);
204
199
  }
205
200
  getFooter() {
206
201
  if (this.measureScale.value === 1 && this.measureUnit === "") {
@@ -208,9 +203,10 @@ export class TimeChart {
208
203
  }
209
204
  return Formatter.translateScenarioLabel("in", this.i18n) + " " + this.measureScale.prefix + this.measureUnit;
210
205
  }
211
- sortScenariosbyVisualisationRules(config) {
206
+ /** Returns a new array; the input keeps the `scenarios` prop order (the config is reused across rebuilds). */
207
+ sortScenariosbyVisualisationRules(scenarios) {
212
208
  const self = this;
213
- config.scenarios
209
+ return [...scenarios]
214
210
  .sort((n1, n2) => {
215
211
  return self.ruleSet.getScenarioSorIndex(n1) - self.ruleSet.getScenarioSorIndex(n2);
216
212
  })
@@ -233,31 +229,25 @@ export class TimeChart {
233
229
  this.i18n = this.createI18n(i18n);
234
230
  }
235
231
  /**
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
232
+ * Resolves the dataset (a table or view in the shared alasql database) and
233
+ * caches its row count. Subsequent queries reference the source by name —
234
+ * alasql doesn't have to ingest a fresh array per call.
243
235
  */
244
- setData(data, filter) {
245
- if (data == null) {
236
+ setSource(filter) {
237
+ var _a, _b;
238
+ this.state = FactoryState.DIRTY;
239
+ if (!this.tableName) {
240
+ this.fromExpr = "";
241
+ this.rowCount = 0;
246
242
  return;
247
243
  }
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
- }
244
+ this.fromExpr = buildFromExpr(this.tableName, filter);
245
+ try {
246
+ const r = this.db.exec(`SELECT COUNT(*) AS cnt FROM ${this.fromExpr}`);
247
+ this.rowCount = ((_b = (_a = r[0]) === null || _a === void 0 ? void 0 : _a.cnt) !== null && _b !== void 0 ? _b : 0);
258
248
  }
259
- else {
260
- this.preparedDataSet = data;
249
+ catch (_e) {
250
+ this.rowCount = 0;
261
251
  }
262
252
  }
263
253
  getAllocatedCanvasWidth() {
@@ -414,6 +404,7 @@ export class TimeChart {
414
404
  return new Map([...defaultI18n, ...i18n]);
415
405
  }
416
406
  createElementPosition(scenarios) {
407
+ var _a;
417
408
  let maxLabelLengthLeft;
418
409
  // only need scenarios written on the leftside of bar/ marker
419
410
  const scenarioLabelLeft = CalculateSize(scenarios
@@ -449,6 +440,12 @@ export class TimeChart {
449
440
  min = this.smallestDataPointValue;
450
441
  max = this.highestDataPointValue;
451
442
  }
443
+ // In relative (100%) stacking the vertical domain is 0..RELATIVE_STACK_UNITS percent,
444
+ // not the raw data values — use a virtual max so axis position, canvas height and
445
+ // auto-fit all agree on the percent domain.
446
+ if (((_a = this.stackConfig) === null || _a === void 0 ? void 0 : _a.mode) === StackMode.RELATIVE) {
447
+ max = new DataPoint(RELATIVE_STACK_UNITS, max.scenario, this.pixelPerUnit, max.variance);
448
+ }
452
449
  // When overflow config is active, create a virtual max so the coordinate system
453
450
  // allocates exactly cutHeight + breakGap + overdriveZoneHeight instead of the
454
451
  // full (clipped) bar height.
@@ -516,8 +513,7 @@ export class TimeChart {
516
513
  return result;
517
514
  }
518
515
  populateModel(selectedScenarios, dateInterval, _level, _sortOrder) {
519
- var _a;
520
- if (((_a = this.preparedDataSet) === null || _a === void 0 ? void 0 : _a.length) === 0) {
516
+ if (this.rowCount === 0 || !this.fromExpr) {
521
517
  return [];
522
518
  }
523
519
  const select = ``;
@@ -559,17 +555,41 @@ export class TimeChart {
559
555
  return localDateInterval;
560
556
  }
561
557
  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]);
558
+ var _a, _b;
559
+ let result;
560
+ try {
561
+ result = this.db.exec(`SELECT MAX(${"date"}) as maxdate, MIN(${"date"}) as mindate FROM ${this.fromExpr}`);
562
+ }
563
+ catch (e) {
564
+ console.error("TimeChart: min/max date query failed", e);
565
+ return [{}];
566
+ }
567
+ // `date` rows in the shared db are typically ISO strings (raw JSON) or millis;
568
+ // accept both so existing fixtures and live JSON data both work.
565
569
  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);
570
+ result[0].mindate = TimeChart.coerceDateTime(result[0].mindate);
567
571
  }
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);
572
+ if (((_b = result[0]) === null || _b === void 0 ? void 0 : _b.maxdate) != null) {
573
+ result[0].maxdate = TimeChart.coerceDateTime(result[0].maxdate);
570
574
  }
571
575
  return result;
572
576
  }
577
+ static coerceDateTime(v) {
578
+ if (v == null)
579
+ return undefined;
580
+ if (typeof v === "string") {
581
+ const dt = DateTime.fromISO(v);
582
+ return dt.isValid ? dt : undefined;
583
+ }
584
+ if (typeof v === "number") {
585
+ const dt = DateTime.fromMillis(v);
586
+ return dt.isValid ? dt : undefined;
587
+ }
588
+ if (typeof v.isValid === "boolean") {
589
+ return v;
590
+ }
591
+ return undefined;
592
+ }
573
593
  queryDataSet(dateInterval, select, order) {
574
594
  const scenarios = [
575
595
  "ac1",
@@ -590,13 +610,15 @@ export class TimeChart {
590
610
  "pl4",
591
611
  ];
592
612
  const dateSelect = `normalizeDate([date], '${dateInterval}' , '${this.locale}') as calcdate`;
593
- const result = alasql(`SELECT ${"p.calcdate"} ${select},
613
+ let result;
614
+ try {
615
+ result = this.db.exec(`SELECT ${"p.calcdate"} ${select},
594
616
  ${scenarios
595
- .map((scenario) => {
596
- return `SUM(${scenario} * transformOperator(operation)) as ${scenario}, COUNT(ISNULL(${scenario})) as ${scenario}_cnt`;
597
- })
598
- .join(",")}
599
-
617
+ .map((scenario) => {
618
+ return `SUM(${scenario} * transformOperator(operation)) as ${scenario}, COUNT(ISNULL(${scenario})) as ${scenario}_cnt`;
619
+ })
620
+ .join(",")}
621
+
600
622
  FROM (SELECT ${dateSelect} ${select},
601
623
  ac1,
602
624
  ac2,
@@ -614,9 +636,14 @@ export class TimeChart {
614
636
  pl2,
615
637
  pl3,
616
638
  pl4
617
- FROM ?) as p
639
+ FROM ${this.fromExpr}) as p
618
640
  GROUP BY ${"calcdate"} ${order}
619
- ORDER BY ${"calcdate asc"}`, [this.preparedDataSet]);
641
+ ORDER BY ${"calcdate asc"}`);
642
+ }
643
+ catch (e) {
644
+ console.error("TimeChart: queryDataSet failed", e);
645
+ return [];
646
+ }
620
647
  return result;
621
648
  }
622
649
  createDataRows(result, selectedScenarios) {
@@ -990,6 +1017,17 @@ export class TimeChart {
990
1017
  };
991
1018
  return columnGroup;
992
1019
  }
1020
+ /** Restore the original `scenarios` prop order for stacked segments (IBCS sort reorders the slots). */
1021
+ sortSegmentsByPropOrder(segments) {
1022
+ if (this.scenarioPropOrder.length === 0)
1023
+ return;
1024
+ const order = this.scenarioPropOrder;
1025
+ segments.sort((a, b) => {
1026
+ const ia = order.indexOf(a.scenario);
1027
+ const ib = order.indexOf(b.scenario);
1028
+ return (ia === -1 ? order.length : ia) - (ib === -1 ? order.length : ib);
1029
+ });
1030
+ }
993
1031
  /**
994
1032
  * Draw stacked bar columns. Supports stacking by scenario or by data dimension.
995
1033
  * When stacking by scenario with multiple scenario types (e.g. ac+pl),
@@ -1011,6 +1049,7 @@ export class TimeChart {
1011
1049
  segments.push({ value: dp.value, scenario: dp.scenario, dataPoint: dp });
1012
1050
  }
1013
1051
  }
1052
+ this.sortSegmentsByPropOrder(segments);
1014
1053
  }
1015
1054
  else {
1016
1055
  const dp = elements["scenario1"];
@@ -1110,12 +1149,14 @@ export class TimeChart {
1110
1149
  }
1111
1150
  if (segments.length === 0)
1112
1151
  return;
1152
+ this.sortSegmentsByPropOrder(segments);
1113
1153
  const prefixes = new Set(segments.map((s) => getScenarioPrefix(s.scenario)));
1114
1154
  const axisY = this.position.getColumnPositionY();
1115
1155
  const xBase = this.position.getColumnCenterPositionX(0) - this.position.getColumnWidth() / 2;
1116
1156
  const labelX = xBase - this.position.spacings.labelToColumn;
1117
1157
  if (prefixes.size > 1) {
1118
- // Overlay mode: one header per group, centered vertically on group's column height
1158
+ // Overlay mode: one header per group — front group centered on its bar,
1159
+ // back groups aligned with their bar's top edge
1119
1160
  const groupMap = new Map();
1120
1161
  for (const seg of segments) {
1121
1162
  const prefix = getScenarioPrefix(seg.scenario);
@@ -1133,11 +1174,17 @@ export class TimeChart {
1133
1174
  for (const [prefix, segs] of groupMap) {
1134
1175
  groups.push({ prefix, segments: segs });
1135
1176
  }
1136
- groups.forEach((group) => {
1177
+ groups.forEach((group, groupIdx) => {
1137
1178
  const groupTotal = group.segments.reduce((sum, s) => sum + Math.abs(s.value), 0);
1138
1179
  const pixelPerUnit = group.segments[0].dataPoint.pixelPerUnit;
1139
- const groupPixelHeight = this.stackConfig.mode === StackMode.RELATIVE ? pixelPerUnit : groupTotal * pixelPerUnit;
1140
- const centerY = axisY - groupPixelHeight / 2;
1180
+ const groupPixelHeight = this.stackConfig.mode === StackMode.RELATIVE
1181
+ ? RELATIVE_STACK_UNITS * pixelPerUnit
1182
+ : groupTotal * pixelPerUnit;
1183
+ // The front-most group (drawn last, e.g. AC) is fully visible, so its
1184
+ // label is centered on the bar. Back groups are mostly hidden behind it
1185
+ // and only peek out at the top, so their labels align with the bar's top edge.
1186
+ const isFrontGroup = groupIdx === groups.length - 1;
1187
+ const centerY = isFrontGroup ? axisY - groupPixelHeight / 2 : axisY - groupPixelHeight;
1141
1188
  const labelText = this.i18n.get(group.prefix + "1") || group.prefix.toUpperCase();
1142
1189
  new Label(headerGroup, labelX, centerY, "STACK_HEADER", labelText, this.styles, HookLocation.Center, HookLocation.Right).forceStringTypeDraw();
1143
1190
  });
@@ -1155,7 +1202,7 @@ export class TimeChart {
1155
1202
  let segmentHeight;
1156
1203
  if (this.stackConfig.mode === StackMode.RELATIVE) {
1157
1204
  const proportion = total !== 0 ? Math.abs(seg.value) / total : 0;
1158
- segmentHeight = proportion * pixelPerUnit;
1205
+ segmentHeight = proportion * RELATIVE_STACK_UNITS * pixelPerUnit;
1159
1206
  }
1160
1207
  else {
1161
1208
  segmentHeight = Math.abs(seg.value * pixelPerUnit);
@@ -1196,6 +1243,15 @@ export class TimeChart {
1196
1243
  activeLayers.push(key);
1197
1244
  }
1198
1245
  }
1246
+ if (isScenarioStack && this.scenarioPropOrder.length > 0) {
1247
+ const order = this.scenarioPropOrder;
1248
+ activeLayers.sort((a, b) => {
1249
+ var _a, _b, _c, _d;
1250
+ const ia = order.indexOf((_b = (_a = dataModel[0][a]) === null || _a === void 0 ? void 0 : _a.scenario) !== null && _b !== void 0 ? _b : "");
1251
+ const ib = order.indexOf((_d = (_c = dataModel[0][b]) === null || _c === void 0 ? void 0 : _c.scenario) !== null && _d !== void 0 ? _d : "");
1252
+ return (ia === -1 ? order.length : ia) - (ib === -1 ? order.length : ib);
1253
+ });
1254
+ }
1199
1255
  // Compute cumulative values
1200
1256
  for (let layerIdx = 0; layerIdx < activeLayers.length; layerIdx++) {
1201
1257
  const key = activeLayers[layerIdx];
@@ -1229,7 +1285,7 @@ export class TimeChart {
1229
1285
  x: this.position.getColumnCenterPositionX(idx),
1230
1286
  y: axisY -
1231
1287
  (stackMode === StackMode.RELATIVE
1232
- ? val * pixelPerUnit // pixelPerUnit acts as "height for 100%"
1288
+ ? val * RELATIVE_STACK_UNITS * pixelPerUnit // val is a 0..1 cumulative proportion
1233
1289
  : val * pixelPerUnit),
1234
1290
  }));
1235
1291
  };
@@ -1281,12 +1337,14 @@ export class TimeChart {
1281
1337
  }
1282
1338
  }
1283
1339
  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
- }));
1340
+ const validDates = result
1341
+ .map((e) => e.calcdate)
1342
+ .filter((d) => d != null && typeof d.isValid === "boolean" && d.isValid);
1343
+ if (validDates.length === 0) {
1344
+ return result;
1345
+ }
1346
+ const to = DateTime.max(...validDates);
1347
+ const from = DateTime.min(...validDates);
1290
1348
  const dateRange = new DateStringFactory().datesBetween(from, to, dateInterval, this.intervalSpanLimit);
1291
1349
  const dateRangeEntries = new Map();
1292
1350
  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;
@@ -59,15 +59,16 @@ export class TimeChartComponentConfig {
59
59
  /**
60
60
  * Converts untyped JSON into a validated {@link TimeChartComponentConfig}.
61
61
  *
62
- * Requires the raw dataset for measure scale auto-calculation.
62
+ * Reads from the shared alasql database for measure-scale auto-calculation.
63
63
  */
64
64
  export class TimeChartComponentConfigAdapter {
65
- constructor(dataRowAdapter, orderAdapter, stringAdapter, dataFormatDigitsAdapter, dataSet) {
65
+ constructor(dataRowAdapter, orderAdapter, stringAdapter, dataFormatDigitsAdapter, db, fromExpr) {
66
66
  this.dataRowAdapter = dataRowAdapter;
67
67
  this.orderAdapter = orderAdapter;
68
68
  this.stringAdapter = stringAdapter;
69
69
  this.dataFormatDigitsAdapter = dataFormatDigitsAdapter;
70
- this.dataSet = dataSet;
70
+ this.db = db;
71
+ this.fromExpr = fromExpr;
71
72
  }
72
73
  adapt(data) {
73
74
  const dataSet = AdapterUtils.adaptArray(data.data, this.dataRowAdapter);
@@ -113,7 +114,7 @@ export class TimeChartComponentConfigAdapter {
113
114
  config.filter = data.filter;
114
115
  }
115
116
  if (CompareUtil.isExisting(data.measureScale)) {
116
- config.measureScale = DataAnalyzer.calculateMeasureScale(this.dataSet, config.scenarios, data.measureScale);
117
+ config.measureScale = DataAnalyzer.calculateMeasureScale(this.db, this.fromExpr, config.scenarios, data.measureScale);
117
118
  }
118
119
  if (CompareUtil.isString(data.measureUnit)) {
119
120
  config.measureUnit = data.measureUnit;
@@ -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: 'f4f3a64c06e0cd8fa4863007ba25cacc74194e45' }, h("slot", { key: 'ee5dd7d7065107f657f1d92cdf91eedbd94f8f81' })));
53
53
  }
54
54
  static get is() { return "bn-context"; }
55
55
  static get encapsulation() { return "shadow"; }