@bino-bi/bn-template-engine 1.0.0-alpha.0

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 (673) hide show
  1. package/LICENSE +21 -0
  2. package/dist/bn-template-engine/assets/bar.png +0 -0
  3. package/dist/bn-template-engine/assets/gpx/Chasing_Legends.gpx +195076 -0
  4. package/dist/bn-template-engine/assets/gpx/Fahrt_am_Nachmittag.gpx +142007 -0
  5. package/dist/bn-template-engine/assets/icons/gpx-finish.png +0 -0
  6. package/dist/bn-template-engine/assets/icons/gpx-shadow.png +0 -0
  7. package/dist/bn-template-engine/assets/icons/gpx-start.png +0 -0
  8. package/dist/bn-template-engine/assets/icons/marker-example.png +0 -0
  9. package/dist/bn-template-engine/assets/icons/pin-icon-end.png +0 -0
  10. package/dist/bn-template-engine/assets/icons/pin-icon-start.png +0 -0
  11. package/dist/bn-template-engine/assets/icons/pin-icon-wpt.png +0 -0
  12. package/dist/bn-template-engine/assets/icons/pin-shadow.png +0 -0
  13. package/dist/bn-template-engine/assets/icons/pin.png +0 -0
  14. package/dist/bn-template-engine/assets/matrix.png +0 -0
  15. package/dist/bn-template-engine/bn-template-engine.esm.js +1 -0
  16. package/dist/bn-template-engine/index.esm.js +0 -0
  17. package/dist/bn-template-engine/p--TeDldm8.js +1 -0
  18. package/dist/bn-template-engine/p-0e7dc113.entry.js +1 -0
  19. package/dist/bn-template-engine/p-1jFf17Vj.js +1 -0
  20. package/dist/bn-template-engine/p-264c6bad.entry.js +1 -0
  21. package/dist/bn-template-engine/p-326a0902.entry.js +1 -0
  22. package/dist/bn-template-engine/p-38a8bde3.entry.js +1 -0
  23. package/dist/bn-template-engine/p-577eafcd.entry.js +1 -0
  24. package/dist/bn-template-engine/p-5905cc43.entry.js +1 -0
  25. package/dist/bn-template-engine/p-5d155a72.entry.js +1 -0
  26. package/dist/bn-template-engine/p-65f8962a.entry.js +1 -0
  27. package/dist/bn-template-engine/p-6b8d1ebf.entry.js +1 -0
  28. package/dist/bn-template-engine/p-7995acb2.entry.js +1 -0
  29. package/dist/bn-template-engine/p-7afe431e.entry.js +1 -0
  30. package/dist/bn-template-engine/p-8014b1ac.entry.js +1 -0
  31. package/dist/bn-template-engine/p-80423fc8.entry.js +1 -0
  32. package/dist/bn-template-engine/p-91e74d42.entry.js +1 -0
  33. package/dist/bn-template-engine/p-930a9e29.entry.js +1 -0
  34. package/dist/bn-template-engine/p-93C9jL8R.js +1 -0
  35. package/dist/bn-template-engine/p-93ff8584.entry.js +1 -0
  36. package/dist/bn-template-engine/p-B0m0U4wJ.js +1 -0
  37. package/dist/bn-template-engine/p-B27Ax6P_.js +2 -0
  38. package/dist/bn-template-engine/p-B79VcHiT.js +1 -0
  39. package/dist/bn-template-engine/p-BBd0ZVLL.js +1 -0
  40. package/dist/bn-template-engine/p-BFTU3MAI.js +1 -0
  41. package/dist/bn-template-engine/p-BFatTBqh.js +1 -0
  42. package/dist/bn-template-engine/p-BQp6ZPYW.js +1 -0
  43. package/dist/bn-template-engine/p-BYmPQYxx.js +1 -0
  44. package/dist/bn-template-engine/p-BhEQy-2D.js +1 -0
  45. package/dist/bn-template-engine/p-BtVfu16B.js +1 -0
  46. package/dist/bn-template-engine/p-CY1RzLjU.js +1 -0
  47. package/dist/bn-template-engine/p-CfWnag33.js +1 -0
  48. package/dist/bn-template-engine/p-CnI71OA9.js +1 -0
  49. package/dist/bn-template-engine/p-Cp4MVxCu.js +1 -0
  50. package/dist/bn-template-engine/p-DQuL1Twl.js +1 -0
  51. package/dist/bn-template-engine/p-DbyXf6dF.js +1 -0
  52. package/dist/bn-template-engine/p-TdL-LRR9.js +1 -0
  53. package/dist/bn-template-engine/p-_LBTIfNN.js +1 -0
  54. package/dist/bn-template-engine/p-a342cd3c.entry.js +1 -0
  55. package/dist/bn-template-engine/p-ad94cf63.entry.js +1 -0
  56. package/dist/bn-template-engine/p-bc37d750.entry.js +1 -0
  57. package/dist/bn-template-engine/p-c9f050bf.entry.js +1 -0
  58. package/dist/bn-template-engine/p-d07a0ca3.entry.js +1 -0
  59. package/dist/bn-template-engine/p-e5f372af.entry.js +1 -0
  60. package/dist/bn-template-engine/p-e620028c.entry.js +1 -0
  61. package/dist/bn-template-engine/p-e81e116a.entry.js +1 -0
  62. package/dist/bn-template-engine/p-eca98070.entry.js +1 -0
  63. package/dist/bn-template-engine/p-ee6de950.entry.js +1 -0
  64. package/dist/bn-template-engine/p-efe0ef1e.entry.js +1 -0
  65. package/dist/bn-template-engine/p-f034f1b8.entry.js +1 -0
  66. package/dist/bn-template-engine/p-f1c1a8a3.entry.js +1 -0
  67. package/dist/bn-template-engine/p-fe573a1a.entry.js +1 -0
  68. package/dist/bn-template-engine/p-kMyLevYy.js +1 -0
  69. package/dist/cjs/DataFormatDigits-DmTbhF8q.js +142 -0
  70. package/dist/cjs/DateStringFactory-Dn0aRj2Y.js +453 -0
  71. package/dist/cjs/Order-B4NIqQWe.js +129 -0
  72. package/dist/cjs/SVGVariancesStyleGroup-Czizhngt.js +7973 -0
  73. package/dist/cjs/StringAdapter-0EbYMkR0.js +136 -0
  74. package/dist/cjs/_commonjsHelpers-BJu3ubxk.js +10 -0
  75. package/dist/cjs/alasql.min-C_nHTuEQ.js +306 -0
  76. package/dist/cjs/app-globals-V2Kpy_OQ.js +5 -0
  77. package/dist/cjs/bn-asset.cjs.entry.js +42 -0
  78. package/dist/cjs/bn-body_3.cjs.entry.js +413 -0
  79. package/dist/cjs/bn-card.cjs.entry.js +37 -0
  80. package/dist/cjs/bn-chart-structure.cjs.entry.js +705 -0
  81. package/dist/cjs/bn-chart-time.cjs.entry.js +987 -0
  82. package/dist/cjs/bn-component-style.cjs.entry.js +44 -0
  83. package/dist/cjs/bn-context_5.cjs.entry.js +3380 -0
  84. package/dist/cjs/bn-dataset.cjs.entry.js +278 -0
  85. package/dist/cjs/bn-grid.cjs.entry.js +407 -0
  86. package/dist/cjs/bn-image.cjs.entry.js +57 -0
  87. package/dist/cjs/bn-internationalization.cjs.entry.js +40 -0
  88. package/dist/cjs/bn-layout-card.cjs.entry.js +128 -0
  89. package/dist/cjs/bn-layout-page.cjs.entry.js +142 -0
  90. package/dist/cjs/bn-map.cjs.entry.js +425 -0
  91. package/dist/cjs/bn-message.cjs.entry.js +52 -0
  92. package/dist/cjs/bn-template-engine.cjs.js +52 -0
  93. package/dist/cjs/bn-template.cjs.entry.js +20 -0
  94. package/dist/cjs/bn-text.cjs.entry.js +286 -0
  95. package/dist/cjs/bn-tree.cjs.entry.js +969 -0
  96. package/dist/cjs/componentRegister-C17UFNPh.js +72 -0
  97. package/dist/cjs/constants-DHqQXSSd.js +158 -0
  98. package/dist/cjs/context-protocol-BkYHFkXE.js +661 -0
  99. package/dist/cjs/editor-companion.cjs.entry.js +49 -0
  100. package/dist/cjs/formatter-DIJL_crx.js +215 -0
  101. package/dist/cjs/ibcs-chart-structure.cjs.entry.js +2906 -0
  102. package/dist/cjs/ibcs-chart-time.cjs.entry.js +4140 -0
  103. package/dist/cjs/ibcs-map.cjs.entry.js +1075 -0
  104. package/dist/cjs/ibcs-title.cjs.entry.js +352 -0
  105. package/dist/cjs/index-CScBFiS1.js +4653 -0
  106. package/dist/cjs/index.cjs.js +2 -0
  107. package/dist/cjs/loader.cjs.js +13 -0
  108. package/dist/cjs/luxon-8hyy5YD7.js +8132 -0
  109. package/dist/cjs/scaling-B23eOtsC.js +67 -0
  110. package/dist/cjs/test-runner-card.cjs.entry.js +27 -0
  111. package/dist/cjs/test-runner-chart-time.cjs.entry.js +230 -0
  112. package/dist/cjs/test-runner-chart.cjs.entry.js +326 -0
  113. package/dist/cjs/test-runner-map.cjs.entry.js +1862 -0
  114. package/dist/cjs/test-runner-table.cjs.entry.js +477 -0
  115. package/dist/cjs/test-runner-time.cjs.entry.js +381 -0
  116. package/dist/cjs/test-runner-title.cjs.entry.js +115 -0
  117. package/dist/cjs/withBodyObserver-B0_W1VOf.js +39 -0
  118. package/dist/cjs/withComponentStatus-BrxL7usr.js +39 -0
  119. package/dist/cjs/withComponentStyle-C6KHnZHt.js +128 -0
  120. package/dist/cjs/withDataset-ZdN-RRTx.js +146 -0
  121. package/dist/cjs/withHasError-Dspb3lIV.js +154 -0
  122. package/dist/cjs/withStyled-Bf-stJTR.js +567 -0
  123. package/dist/cjs/withTranslation-Cz0M5maV.js +77 -0
  124. package/dist/collection/collection-manifest.json +48 -0
  125. package/dist/collection/components/bn-asset/bn-asset.css +3 -0
  126. package/dist/collection/components/bn-asset/bn-asset.js +67 -0
  127. package/dist/collection/components/bn-body/bn-body.css +9 -0
  128. package/dist/collection/components/bn-body/bn-body.js +38 -0
  129. package/dist/collection/components/bn-card/bn-card.css +21 -0
  130. package/dist/collection/components/bn-card/bn-card.js +38 -0
  131. package/dist/collection/components/bn-chart-structure/bn-chart-structure.css +105 -0
  132. package/dist/collection/components/bn-chart-structure/bn-chart-structure.js +1047 -0
  133. package/dist/collection/components/bn-chart-structure/ibcs-chart-structure.js +594 -0
  134. package/dist/collection/components/bn-chart-structure/utils/StructureChart.js +979 -0
  135. package/dist/collection/components/bn-chart-structure/utils/elements/Axis.js +39 -0
  136. package/dist/collection/components/bn-chart-structure/utils/elements/Bar.js +293 -0
  137. package/dist/collection/components/bn-chart-structure/utils/elements/Label.js +136 -0
  138. package/dist/collection/components/bn-chart-structure/utils/elements/Marker.js +118 -0
  139. package/dist/collection/components/bn-chart-structure/utils/elements/Needle.js +151 -0
  140. package/dist/collection/components/bn-chart-structure/utils/elements/StackedBar.js +83 -0
  141. package/dist/collection/components/bn-chart-structure/utils/elements/index.js +6 -0
  142. package/dist/collection/components/bn-chart-structure/utils/factories/ScenarioFactory.js +119 -0
  143. package/dist/collection/components/bn-chart-structure/utils/factories/index.js +1 -0
  144. package/dist/collection/components/bn-chart-structure/utils/helper/CustomPattern.js +45 -0
  145. package/dist/collection/components/bn-chart-structure/utils/helper/ElementPositions.js +210 -0
  146. package/dist/collection/components/bn-chart-structure/utils/helper/MarkerPattern.js +46 -0
  147. package/dist/collection/components/bn-chart-structure/utils/helper/Padding.js +13 -0
  148. package/dist/collection/components/bn-chart-structure/utils/helper/index.js +15 -0
  149. package/dist/collection/components/bn-chart-structure/utils/model/DataPoint.js +101 -0
  150. package/dist/collection/components/bn-chart-structure/utils/model/OverflowConfig.js +1 -0
  151. package/dist/collection/components/bn-chart-structure/utils/model/StructureChartComponentConfig.js +106 -0
  152. package/dist/collection/components/bn-chart-structure/utils/model/StructureChartDataRow.js +127 -0
  153. package/dist/collection/components/bn-chart-structure/utils/model/index.js +45 -0
  154. package/dist/collection/components/bn-chart-structure/utils/model/styles/ScaleFactorsStructureChart.js +99 -0
  155. package/dist/collection/components/bn-chart-structure/utils/model/styles/StructureChartStyle.js +58 -0
  156. package/dist/collection/components/bn-chart-time/bn-chart-time.css +17 -0
  157. package/dist/collection/components/bn-chart-time/bn-chart-time.js +1510 -0
  158. package/dist/collection/components/bn-chart-time/ibcs-chart-time.css +96 -0
  159. package/dist/collection/components/bn-chart-time/ibcs-chart-time.js +829 -0
  160. package/dist/collection/components/bn-chart-time/utils/TimeChart.js +1388 -0
  161. package/dist/collection/components/bn-chart-time/utils/elements/AreaFill.js +83 -0
  162. package/dist/collection/components/bn-chart-time/utils/elements/Axis.js +42 -0
  163. package/dist/collection/components/bn-chart-time/utils/elements/Column.js +266 -0
  164. package/dist/collection/components/bn-chart-time/utils/elements/Label.js +174 -0
  165. package/dist/collection/components/bn-chart-time/utils/elements/Line.js +150 -0
  166. package/dist/collection/components/bn-chart-time/utils/elements/LineSeries.js +267 -0
  167. package/dist/collection/components/bn-chart-time/utils/elements/Marker.js +121 -0
  168. package/dist/collection/components/bn-chart-time/utils/elements/Needle.js +148 -0
  169. package/dist/collection/components/bn-chart-time/utils/elements/StackedColumn.js +107 -0
  170. package/dist/collection/components/bn-chart-time/utils/elements/index.js +8 -0
  171. package/dist/collection/components/bn-chart-time/utils/factories/ScenarioFactory.js +146 -0
  172. package/dist/collection/components/bn-chart-time/utils/factories/index.js +1 -0
  173. package/dist/collection/components/bn-chart-time/utils/helper/CustomPattern.js +46 -0
  174. package/dist/collection/components/bn-chart-time/utils/helper/ElementPositions.js +178 -0
  175. package/dist/collection/components/bn-chart-time/utils/helper/LabelCollisionManager.js +199 -0
  176. package/dist/collection/components/bn-chart-time/utils/helper/MarkerPattern.js +84 -0
  177. package/dist/collection/components/bn-chart-time/utils/helper/Padding.js +13 -0
  178. package/dist/collection/components/bn-chart-time/utils/helper/index.js +5 -0
  179. package/dist/collection/components/bn-chart-time/utils/model/DataPoint.js +93 -0
  180. package/dist/collection/components/bn-chart-time/utils/model/OverflowConfig.js +1 -0
  181. package/dist/collection/components/bn-chart-time/utils/model/TimeChartComponentConfig.js +150 -0
  182. package/dist/collection/components/bn-chart-time/utils/model/TimeChartDataRow.js +146 -0
  183. package/dist/collection/components/bn-chart-time/utils/model/index.js +45 -0
  184. package/dist/collection/components/bn-chart-time/utils/model/styles/ScaleFactorsTimeChart.js +99 -0
  185. package/dist/collection/components/bn-chart-time/utils/model/styles/TimeChartStyle.js +54 -0
  186. package/dist/collection/components/bn-component-style/bn-component-style.css +3 -0
  187. package/dist/collection/components/bn-component-style/bn-component-style.js +69 -0
  188. package/dist/collection/components/bn-context/bn-context.css +3 -0
  189. package/dist/collection/components/bn-context/bn-context.js +96 -0
  190. package/dist/collection/components/bn-dataset/bn-dataset.css +3 -0
  191. package/dist/collection/components/bn-dataset/bn-dataset.js +159 -0
  192. package/dist/collection/components/bn-datasource/bn-datasource.css +3 -0
  193. package/dist/collection/components/bn-datasource/bn-datasource.js +70 -0
  194. package/dist/collection/components/bn-footer/assets/bar.png +0 -0
  195. package/dist/collection/components/bn-footer/assets/matrix.png +0 -0
  196. package/dist/collection/components/bn-footer/bn-footer.css +40 -0
  197. package/dist/collection/components/bn-footer/bn-footer.js +146 -0
  198. package/dist/collection/components/bn-grid/bn-grid.css +37 -0
  199. package/dist/collection/components/bn-grid/bn-grid.js +467 -0
  200. package/dist/collection/components/bn-grid/utils/GridConfig.js +114 -0
  201. package/dist/collection/components/bn-image/bn-image.css +10 -0
  202. package/dist/collection/components/bn-image/bn-image.js +78 -0
  203. package/dist/collection/components/bn-internationalization/bn-internationalization.css +3 -0
  204. package/dist/collection/components/bn-internationalization/bn-internationalization.js +84 -0
  205. package/dist/collection/components/bn-layout-card/bn-layout-card.css +25 -0
  206. package/dist/collection/components/bn-layout-card/bn-layout-card.js +534 -0
  207. package/dist/collection/components/bn-layout-page/bn-layout-page.css +10 -0
  208. package/dist/collection/components/bn-layout-page/bn-layout-page.js +624 -0
  209. package/dist/collection/components/bn-map/bn-map.css +4 -0
  210. package/dist/collection/components/bn-map/bn-map.js +725 -0
  211. package/dist/collection/components/bn-map/ibcs-map/assets/gpx/Chasing_Legends.gpx +195076 -0
  212. package/dist/collection/components/bn-map/ibcs-map/assets/gpx/Fahrt_am_Nachmittag.gpx +142007 -0
  213. package/dist/collection/components/bn-map/ibcs-map/assets/icons/gpx-finish.png +0 -0
  214. package/dist/collection/components/bn-map/ibcs-map/assets/icons/gpx-shadow.png +0 -0
  215. package/dist/collection/components/bn-map/ibcs-map/assets/icons/gpx-start.png +0 -0
  216. package/dist/collection/components/bn-map/ibcs-map/assets/icons/marker-example.png +0 -0
  217. package/dist/collection/components/bn-map/ibcs-map/assets/icons/pin-icon-end.png +0 -0
  218. package/dist/collection/components/bn-map/ibcs-map/assets/icons/pin-icon-start.png +0 -0
  219. package/dist/collection/components/bn-map/ibcs-map/assets/icons/pin-icon-wpt.png +0 -0
  220. package/dist/collection/components/bn-map/ibcs-map/assets/icons/pin-shadow.png +0 -0
  221. package/dist/collection/components/bn-map/ibcs-map/assets/icons/pin.png +0 -0
  222. package/dist/collection/components/bn-map/ibcs-map/ibcs-map.css +674 -0
  223. package/dist/collection/components/bn-map/ibcs-map/ibcs-map.js +744 -0
  224. package/dist/collection/components/bn-map/ibcs-map/utils/model/GeoJsonLayer.js +9 -0
  225. package/dist/collection/components/bn-map/ibcs-map/utils/model/GpxLayer.js +13 -0
  226. package/dist/collection/components/bn-map/ibcs-map/utils/model/Marker.js +11 -0
  227. package/dist/collection/components/bn-map/ibcs-map/utils/model/index.js +2 -0
  228. package/dist/collection/components/bn-message/assets/bar.png +0 -0
  229. package/dist/collection/components/bn-message/assets/matrix.png +0 -0
  230. package/dist/collection/components/bn-message/bn-message.css +31 -0
  231. package/dist/collection/components/bn-message/bn-message.js +96 -0
  232. package/dist/collection/components/bn-page/bn-page.css +252 -0
  233. package/dist/collection/components/bn-page/bn-page.js +118 -0
  234. package/dist/collection/components/bn-table/bn-table.css +5 -0
  235. package/dist/collection/components/bn-table/bn-table.js +1475 -0
  236. package/dist/collection/components/bn-table/ibcs-table.css +322 -0
  237. package/dist/collection/components/bn-table/ibcs-table.js +757 -0
  238. package/dist/collection/components/bn-table/utils/Table.js +182 -0
  239. package/dist/collection/components/bn-table/utils/elements/Cell.js +66 -0
  240. package/dist/collection/components/bn-table/utils/elements/CellBarChart.js +251 -0
  241. package/dist/collection/components/bn-table/utils/elements/TableRow.js +88 -0
  242. package/dist/collection/components/bn-table/utils/elements/index.js +3 -0
  243. package/dist/collection/components/bn-table/utils/factories/tableDataSetFactory.js +380 -0
  244. package/dist/collection/components/bn-table/utils/helper/ColumnStatistics.js +62 -0
  245. package/dist/collection/components/bn-table/utils/helper/DataQuery.js +750 -0
  246. package/dist/collection/components/bn-table/utils/helper/QueryGroup.js +38 -0
  247. package/dist/collection/components/bn-table/utils/helper/index.js +1 -0
  248. package/dist/collection/components/bn-table/utils/model/TableComponentConfig.js +136 -0
  249. package/dist/collection/components/bn-table/utils/model/TableDataRow.js +134 -0
  250. package/dist/collection/components/bn-table/utils/model/TableDrillGroup.js +42 -0
  251. package/dist/collection/components/bn-table/utils/model/index.js +63 -0
  252. package/dist/collection/components/bn-template/bn-template.js +38 -0
  253. package/dist/collection/components/bn-text/bn-text.css +14 -0
  254. package/dist/collection/components/bn-text/bn-text.js +343 -0
  255. package/dist/collection/components/bn-title/bn-title.css +11 -0
  256. package/dist/collection/components/bn-title/bn-title.js +541 -0
  257. package/dist/collection/components/bn-title/ibcs-title/ibcs-title.css +15 -0
  258. package/dist/collection/components/bn-title/ibcs-title/ibcs-title.js +321 -0
  259. package/dist/collection/components/bn-title/ibcs-title/utils/Title.js +91 -0
  260. package/dist/collection/components/bn-title/ibcs-title/utils/factories/TitleDataSetFactory.js +86 -0
  261. package/dist/collection/components/bn-title/ibcs-title/utils/factories/index.js +1 -0
  262. package/dist/collection/components/bn-title/ibcs-title/utils/model/MeasureEntriy.js +25 -0
  263. package/dist/collection/components/bn-title/ibcs-title/utils/model/TimePeriod.js +33 -0
  264. package/dist/collection/components/bn-title/ibcs-title/utils/model/TitleConfig.js +48 -0
  265. package/dist/collection/components/bn-title/ibcs-title/utils/model/index.js +6 -0
  266. package/dist/collection/components/bn-tree/bn-tree.css +40 -0
  267. package/dist/collection/components/bn-tree/bn-tree.js +520 -0
  268. package/dist/collection/components/bn-tree/utils/EdgeRenderer.js +196 -0
  269. package/dist/collection/components/bn-tree/utils/TreeLayout.js +225 -0
  270. package/dist/collection/components/bn-tree/utils/TreeParser.js +180 -0
  271. package/dist/collection/components/editor-companion/editor-companion.css +3 -0
  272. package/dist/collection/components/editor-companion/editor-companion.js +130 -0
  273. package/dist/collection/context/context-protocol.js +84 -0
  274. package/dist/collection/declarations.js +1 -0
  275. package/dist/collection/index.js +2 -0
  276. package/dist/collection/stores/assets.js +12 -0
  277. package/dist/collection/stores/componentStyles.js +106 -0
  278. package/dist/collection/stores/context.js +1 -0
  279. package/dist/collection/stores/createScopedStores.js +31 -0
  280. package/dist/collection/stores/datasets.js +14 -0
  281. package/dist/collection/stores/datasetsMeta.js +14 -0
  282. package/dist/collection/stores/datasources.js +14 -0
  283. package/dist/collection/stores/internationalization.js +128 -0
  284. package/dist/collection/test-runner/test-runner-card.js +36 -0
  285. package/dist/collection/test-runner/test-runner-chart-time.js +234 -0
  286. package/dist/collection/test-runner/test-runner-chart.js +364 -0
  287. package/dist/collection/test-runner/test-runner-map.js +1901 -0
  288. package/dist/collection/test-runner/test-runner-table.js +469 -0
  289. package/dist/collection/test-runner/test-runner-time.js +399 -0
  290. package/dist/collection/test-runner/test-runner-title.js +108 -0
  291. package/dist/collection/utils/DataUriUtil.js +19 -0
  292. package/dist/collection/utils/DateStringFactory.js +448 -0
  293. package/dist/collection/utils/componentRegister.js +70 -0
  294. package/dist/collection/utils/constants.js +156 -0
  295. package/dist/collection/utils/dataAnalyzer.js +103 -0
  296. package/dist/collection/utils/datasetMetaCalculator.js +137 -0
  297. package/dist/collection/utils/flattenObject.js +28 -0
  298. package/dist/collection/utils/formatter.js +86 -0
  299. package/dist/collection/utils/helper/AdapterUtils.js +24 -0
  300. package/dist/collection/utils/helper/CompareUtil.js +42 -0
  301. package/dist/collection/utils/helper/IAdapter.js +1 -0
  302. package/dist/collection/utils/helper/StringAdapter.js +9 -0
  303. package/dist/collection/utils/ibcsRuleSet.js +120 -0
  304. package/dist/collection/utils/index.js +2 -0
  305. package/dist/collection/utils/model/ChartStyles.js +1 -0
  306. package/dist/collection/utils/model/DataFormatDigits.js +23 -0
  307. package/dist/collection/utils/model/DataQueryResultRow.js +1 -0
  308. package/dist/collection/utils/model/DatasetMeta.js +1 -0
  309. package/dist/collection/utils/model/DateFormat.js +1 -0
  310. package/dist/collection/utils/model/Order.js +56 -0
  311. package/dist/collection/utils/model/SiPrefix.js +23 -0
  312. package/dist/collection/utils/model/TextStyles.js +1 -0
  313. package/dist/collection/utils/model/VarianceScenario.js +33 -0
  314. package/dist/collection/utils/model/index.js +38 -0
  315. package/dist/collection/utils/model/styles/FontStyle.js +34 -0
  316. package/dist/collection/utils/model/styles/Padding.js +30 -0
  317. package/dist/collection/utils/model/styles/SVGStyle.js +47 -0
  318. package/dist/collection/utils/model/styles/SVGStyleGroup.js +48 -0
  319. package/dist/collection/utils/model/styles/SVGVariancesStyleGroup.js +45 -0
  320. package/dist/collection/utils/parentDimensions.js +44 -0
  321. package/dist/collection/utils/scaling.js +17 -0
  322. package/dist/collection/utils/stackColors.js +31 -0
  323. package/dist/collection/utils/styled/attributes.js +110 -0
  324. package/dist/collection/utils/styled/style-sheet.js +21 -0
  325. package/dist/collection/utils/styled/withStyled.js +71 -0
  326. package/dist/collection/utils/templateId.js +12 -0
  327. package/dist/collection/utils/utils.js +83 -0
  328. package/dist/collection/utils/validate.js +372 -0
  329. package/dist/collection/utils/withBodyObserver.js +35 -0
  330. package/dist/collection/utils/withComponentStatus.js +35 -0
  331. package/dist/collection/utils/withComponentStyle.js +74 -0
  332. package/dist/collection/utils/withDataset.js +142 -0
  333. package/dist/collection/utils/withDatasource.js +59 -0
  334. package/dist/collection/utils/withHasError.js +56 -0
  335. package/dist/collection/utils/withTranslation.js +73 -0
  336. package/dist/components/DataFormatDigits.js +1 -0
  337. package/dist/components/DateStringFactory.js +1 -0
  338. package/dist/components/Order.js +1 -0
  339. package/dist/components/SVGVariancesStyleGroup.js +1 -0
  340. package/dist/components/_commonjsHelpers.js +1 -0
  341. package/dist/components/alasql.min.js +1 -0
  342. package/dist/components/bn-asset.d.ts +11 -0
  343. package/dist/components/bn-asset.js +1 -0
  344. package/dist/components/bn-body.d.ts +11 -0
  345. package/dist/components/bn-body.js +1 -0
  346. package/dist/components/bn-body2.js +1 -0
  347. package/dist/components/bn-card.d.ts +11 -0
  348. package/dist/components/bn-card.js +1 -0
  349. package/dist/components/bn-card2.js +1 -0
  350. package/dist/components/bn-chart-structure.d.ts +11 -0
  351. package/dist/components/bn-chart-structure.js +1 -0
  352. package/dist/components/bn-chart-time.d.ts +11 -0
  353. package/dist/components/bn-chart-time.js +1 -0
  354. package/dist/components/bn-component-style.d.ts +11 -0
  355. package/dist/components/bn-component-style.js +1 -0
  356. package/dist/components/bn-context.d.ts +11 -0
  357. package/dist/components/bn-context.js +1 -0
  358. package/dist/components/bn-dataset.d.ts +11 -0
  359. package/dist/components/bn-dataset.js +1 -0
  360. package/dist/components/bn-datasource.d.ts +11 -0
  361. package/dist/components/bn-datasource.js +1 -0
  362. package/dist/components/bn-footer.d.ts +11 -0
  363. package/dist/components/bn-footer.js +1 -0
  364. package/dist/components/bn-footer2.js +1 -0
  365. package/dist/components/bn-grid.d.ts +11 -0
  366. package/dist/components/bn-grid.js +1 -0
  367. package/dist/components/bn-image.d.ts +11 -0
  368. package/dist/components/bn-image.js +1 -0
  369. package/dist/components/bn-internationalization.d.ts +11 -0
  370. package/dist/components/bn-internationalization.js +1 -0
  371. package/dist/components/bn-layout-card.d.ts +11 -0
  372. package/dist/components/bn-layout-card.js +1 -0
  373. package/dist/components/bn-layout-page.d.ts +11 -0
  374. package/dist/components/bn-layout-page.js +1 -0
  375. package/dist/components/bn-map.d.ts +11 -0
  376. package/dist/components/bn-map.js +1 -0
  377. package/dist/components/bn-message.d.ts +11 -0
  378. package/dist/components/bn-message.js +1 -0
  379. package/dist/components/bn-message2.js +1 -0
  380. package/dist/components/bn-page.d.ts +11 -0
  381. package/dist/components/bn-page.js +1 -0
  382. package/dist/components/bn-page2.js +1 -0
  383. package/dist/components/bn-table.d.ts +11 -0
  384. package/dist/components/bn-table.js +1 -0
  385. package/dist/components/bn-template.d.ts +11 -0
  386. package/dist/components/bn-template.js +1 -0
  387. package/dist/components/bn-text.d.ts +11 -0
  388. package/dist/components/bn-text.js +1 -0
  389. package/dist/components/bn-title.d.ts +11 -0
  390. package/dist/components/bn-title.js +1 -0
  391. package/dist/components/bn-title2.js +1 -0
  392. package/dist/components/bn-tree.d.ts +11 -0
  393. package/dist/components/bn-tree.js +1 -0
  394. package/dist/components/componentRegister.js +1 -0
  395. package/dist/components/context-protocol.js +1 -0
  396. package/dist/components/editor-companion.d.ts +11 -0
  397. package/dist/components/editor-companion.js +1 -0
  398. package/dist/components/ibcs-chart-structure.d.ts +11 -0
  399. package/dist/components/ibcs-chart-structure.js +1 -0
  400. package/dist/components/ibcs-chart-structure2.js +1 -0
  401. package/dist/components/ibcs-chart-time.d.ts +11 -0
  402. package/dist/components/ibcs-chart-time.js +1 -0
  403. package/dist/components/ibcs-chart-time2.js +1 -0
  404. package/dist/components/ibcs-map.d.ts +11 -0
  405. package/dist/components/ibcs-map.js +1 -0
  406. package/dist/components/ibcs-map2.js +1 -0
  407. package/dist/components/ibcs-table.d.ts +11 -0
  408. package/dist/components/ibcs-table.js +1 -0
  409. package/dist/components/ibcs-table2.js +1 -0
  410. package/dist/components/ibcs-title.d.ts +11 -0
  411. package/dist/components/ibcs-title.js +1 -0
  412. package/dist/components/ibcs-title2.js +1 -0
  413. package/dist/components/ibcsRuleSet.js +1 -0
  414. package/dist/components/index.d.ts +35 -0
  415. package/dist/components/index.js +1 -0
  416. package/dist/components/scaling.js +1 -0
  417. package/dist/components/test-runner-card.d.ts +11 -0
  418. package/dist/components/test-runner-card.js +1 -0
  419. package/dist/components/test-runner-chart-time.d.ts +11 -0
  420. package/dist/components/test-runner-chart-time.js +1 -0
  421. package/dist/components/test-runner-chart.d.ts +11 -0
  422. package/dist/components/test-runner-chart.js +1 -0
  423. package/dist/components/test-runner-map.d.ts +11 -0
  424. package/dist/components/test-runner-map.js +1 -0
  425. package/dist/components/test-runner-table.d.ts +11 -0
  426. package/dist/components/test-runner-table.js +1 -0
  427. package/dist/components/test-runner-time.d.ts +11 -0
  428. package/dist/components/test-runner-time.js +1 -0
  429. package/dist/components/test-runner-title.d.ts +11 -0
  430. package/dist/components/test-runner-title.js +1 -0
  431. package/dist/components/utils.js +1 -0
  432. package/dist/components/validate.js +1 -0
  433. package/dist/components/withBodyObserver.js +1 -0
  434. package/dist/components/withComponentStyle.js +1 -0
  435. package/dist/components/withDataset.js +1 -0
  436. package/dist/components/withHasError.js +1 -0
  437. package/dist/components/withStyled.js +1 -0
  438. package/dist/components/withTranslation.js +1 -0
  439. package/dist/esm/DataFormatDigits-Dt6gpIiZ.js +137 -0
  440. package/dist/esm/DateStringFactory-_Qiv0IvF.js +451 -0
  441. package/dist/esm/Order-B4fpLe_f.js +125 -0
  442. package/dist/esm/SVGVariancesStyleGroup-DlWgvpzs.js +7961 -0
  443. package/dist/esm/StringAdapter-BLvo1Krl.js +133 -0
  444. package/dist/esm/_commonjsHelpers-BFTU3MAI.js +7 -0
  445. package/dist/esm/alasql.min-CWu4NkIt.js +304 -0
  446. package/dist/esm/app-globals-DQuL1Twl.js +3 -0
  447. package/dist/esm/bn-asset.entry.js +40 -0
  448. package/dist/esm/bn-body_3.entry.js +409 -0
  449. package/dist/esm/bn-card.entry.js +35 -0
  450. package/dist/esm/bn-chart-structure.entry.js +703 -0
  451. package/dist/esm/bn-chart-time.entry.js +985 -0
  452. package/dist/esm/bn-component-style.entry.js +42 -0
  453. package/dist/esm/bn-context_5.entry.js +3374 -0
  454. package/dist/esm/bn-dataset.entry.js +276 -0
  455. package/dist/esm/bn-grid.entry.js +405 -0
  456. package/dist/esm/bn-image.entry.js +55 -0
  457. package/dist/esm/bn-internationalization.entry.js +38 -0
  458. package/dist/esm/bn-layout-card.entry.js +126 -0
  459. package/dist/esm/bn-layout-page.entry.js +140 -0
  460. package/dist/esm/bn-map.entry.js +423 -0
  461. package/dist/esm/bn-message.entry.js +50 -0
  462. package/dist/esm/bn-template-engine.js +48 -0
  463. package/dist/esm/bn-template.entry.js +18 -0
  464. package/dist/esm/bn-text.entry.js +284 -0
  465. package/dist/esm/bn-tree.entry.js +967 -0
  466. package/dist/esm/componentRegister-BtVfu16B.js +72 -0
  467. package/dist/esm/constants-kMyLevYy.js +158 -0
  468. package/dist/esm/context-protocol-DzeqZxg6.js +654 -0
  469. package/dist/esm/editor-companion.entry.js +47 -0
  470. package/dist/esm/formatter-DTMEZ6d8.js +211 -0
  471. package/dist/esm/ibcs-chart-structure.entry.js +2904 -0
  472. package/dist/esm/ibcs-chart-time.entry.js +4138 -0
  473. package/dist/esm/ibcs-map.entry.js +1073 -0
  474. package/dist/esm/ibcs-title.entry.js +350 -0
  475. package/dist/esm/index-B27Ax6P_.js +4635 -0
  476. package/dist/esm/index.js +1 -0
  477. package/dist/esm/loader.js +11 -0
  478. package/dist/esm/luxon-DbyXf6dF.js +8130 -0
  479. package/dist/esm/scaling-BBd0ZVLL.js +64 -0
  480. package/dist/esm/test-runner-card.entry.js +25 -0
  481. package/dist/esm/test-runner-chart-time.entry.js +228 -0
  482. package/dist/esm/test-runner-chart.entry.js +324 -0
  483. package/dist/esm/test-runner-map.entry.js +1860 -0
  484. package/dist/esm/test-runner-table.entry.js +475 -0
  485. package/dist/esm/test-runner-time.entry.js +379 -0
  486. package/dist/esm/test-runner-title.entry.js +113 -0
  487. package/dist/esm/withBodyObserver-gZpZiEIK.js +37 -0
  488. package/dist/esm/withComponentStatus-elELReKt.js +37 -0
  489. package/dist/esm/withComponentStyle-NaxfakAG.js +126 -0
  490. package/dist/esm/withDataset-BT2VQCsG.js +144 -0
  491. package/dist/esm/withHasError-C48fTE2k.js +150 -0
  492. package/dist/esm/withStyled-CpUTv74m.js +539 -0
  493. package/dist/esm/withTranslation-Do4GhleK.js +75 -0
  494. package/dist/index.cjs.js +1 -0
  495. package/dist/index.js +1 -0
  496. package/dist/types/components/bn-asset/bn-asset.d.ts +11 -0
  497. package/dist/types/components/bn-body/bn-body.d.ts +8 -0
  498. package/dist/types/components/bn-card/bn-card.d.ts +8 -0
  499. package/dist/types/components/bn-chart-structure/bn-chart-structure.d.ts +234 -0
  500. package/dist/types/components/bn-chart-structure/ibcs-chart-structure.d.ts +47 -0
  501. package/dist/types/components/bn-chart-structure/utils/StructureChart.d.ts +137 -0
  502. package/dist/types/components/bn-chart-structure/utils/elements/Axis.d.ts +29 -0
  503. package/dist/types/components/bn-chart-structure/utils/elements/Bar.d.ts +58 -0
  504. package/dist/types/components/bn-chart-structure/utils/elements/Label.d.ts +47 -0
  505. package/dist/types/components/bn-chart-structure/utils/elements/Marker.d.ts +33 -0
  506. package/dist/types/components/bn-chart-structure/utils/elements/Needle.d.ts +37 -0
  507. package/dist/types/components/bn-chart-structure/utils/elements/StackedBar.d.ts +25 -0
  508. package/dist/types/components/bn-chart-structure/utils/elements/index.d.ts +6 -0
  509. package/dist/types/components/bn-chart-structure/utils/factories/ScenarioFactory.d.ts +46 -0
  510. package/dist/types/components/bn-chart-structure/utils/factories/index.d.ts +1 -0
  511. package/dist/types/components/bn-chart-structure/utils/helper/CustomPattern.d.ts +20 -0
  512. package/dist/types/components/bn-chart-structure/utils/helper/ElementPositions.d.ts +60 -0
  513. package/dist/types/components/bn-chart-structure/utils/helper/MarkerPattern.d.ts +28 -0
  514. package/dist/types/components/bn-chart-structure/utils/helper/Padding.d.ts +14 -0
  515. package/dist/types/components/bn-chart-structure/utils/helper/index.d.ts +13 -0
  516. package/dist/types/components/bn-chart-structure/utils/model/DataPoint.d.ts +44 -0
  517. package/dist/types/components/bn-chart-structure/utils/model/OverflowConfig.d.ts +7 -0
  518. package/dist/types/components/bn-chart-structure/utils/model/StructureChartComponentConfig.d.ts +60 -0
  519. package/dist/types/components/bn-chart-structure/utils/model/StructureChartDataRow.d.ts +61 -0
  520. package/dist/types/components/bn-chart-structure/utils/model/index.d.ts +108 -0
  521. package/dist/types/components/bn-chart-structure/utils/model/styles/ScaleFactorsStructureChart.d.ts +46 -0
  522. package/dist/types/components/bn-chart-structure/utils/model/styles/StructureChartStyle.d.ts +29 -0
  523. package/dist/types/components/bn-chart-time/bn-chart-time.d.ts +325 -0
  524. package/dist/types/components/bn-chart-time/ibcs-chart-time.d.ts +59 -0
  525. package/dist/types/components/bn-chart-time/utils/TimeChart.d.ts +154 -0
  526. package/dist/types/components/bn-chart-time/utils/elements/AreaFill.d.ts +23 -0
  527. package/dist/types/components/bn-chart-time/utils/elements/Axis.d.ts +28 -0
  528. package/dist/types/components/bn-chart-time/utils/elements/Column.d.ts +68 -0
  529. package/dist/types/components/bn-chart-time/utils/elements/Label.d.ts +55 -0
  530. package/dist/types/components/bn-chart-time/utils/elements/Line.d.ts +48 -0
  531. package/dist/types/components/bn-chart-time/utils/elements/LineSeries.d.ts +74 -0
  532. package/dist/types/components/bn-chart-time/utils/elements/Marker.d.ts +37 -0
  533. package/dist/types/components/bn-chart-time/utils/elements/Needle.d.ts +41 -0
  534. package/dist/types/components/bn-chart-time/utils/elements/StackedColumn.d.ts +40 -0
  535. package/dist/types/components/bn-chart-time/utils/elements/index.d.ts +8 -0
  536. package/dist/types/components/bn-chart-time/utils/factories/ScenarioFactory.d.ts +65 -0
  537. package/dist/types/components/bn-chart-time/utils/factories/index.d.ts +1 -0
  538. package/dist/types/components/bn-chart-time/utils/helper/CustomPattern.d.ts +22 -0
  539. package/dist/types/components/bn-chart-time/utils/helper/ElementPositions.d.ts +60 -0
  540. package/dist/types/components/bn-chart-time/utils/helper/LabelCollisionManager.d.ts +101 -0
  541. package/dist/types/components/bn-chart-time/utils/helper/MarkerPattern.d.ts +42 -0
  542. package/dist/types/components/bn-chart-time/utils/helper/Padding.d.ts +14 -0
  543. package/dist/types/components/bn-chart-time/utils/helper/index.d.ts +5 -0
  544. package/dist/types/components/bn-chart-time/utils/model/DataPoint.d.ts +44 -0
  545. package/dist/types/components/bn-chart-time/utils/model/OverflowConfig.d.ts +7 -0
  546. package/dist/types/components/bn-chart-time/utils/model/TimeChartComponentConfig.d.ts +73 -0
  547. package/dist/types/components/bn-chart-time/utils/model/TimeChartDataRow.d.ts +62 -0
  548. package/dist/types/components/bn-chart-time/utils/model/index.d.ts +109 -0
  549. package/dist/types/components/bn-chart-time/utils/model/styles/ScaleFactorsTimeChart.d.ts +46 -0
  550. package/dist/types/components/bn-chart-time/utils/model/styles/TimeChartStyle.d.ts +29 -0
  551. package/dist/types/components/bn-component-style/bn-component-style.d.ts +8 -0
  552. package/dist/types/components/bn-context/bn-context.d.ts +19 -0
  553. package/dist/types/components/bn-dataset/bn-dataset.d.ts +38 -0
  554. package/dist/types/components/bn-datasource/bn-datasource.d.ts +18 -0
  555. package/dist/types/components/bn-footer/bn-footer.d.ts +29 -0
  556. package/dist/types/components/bn-grid/bn-grid.d.ts +70 -0
  557. package/dist/types/components/bn-grid/utils/GridConfig.d.ts +47 -0
  558. package/dist/types/components/bn-image/bn-image.d.ts +22 -0
  559. package/dist/types/components/bn-internationalization/bn-internationalization.d.ts +9 -0
  560. package/dist/types/components/bn-layout-card/bn-layout-card.d.ts +38 -0
  561. package/dist/types/components/bn-layout-page/bn-layout-page.d.ts +40 -0
  562. package/dist/types/components/bn-map/bn-map.d.ts +122 -0
  563. package/dist/types/components/bn-map/ibcs-map/ibcs-map.d.ts +73 -0
  564. package/dist/types/components/bn-map/ibcs-map/utils/model/GeoJsonLayer.d.ts +8 -0
  565. package/dist/types/components/bn-map/ibcs-map/utils/model/GpxLayer.d.ts +11 -0
  566. package/dist/types/components/bn-map/ibcs-map/utils/model/Marker.d.ts +9 -0
  567. package/dist/types/components/bn-map/ibcs-map/utils/model/index.d.ts +2 -0
  568. package/dist/types/components/bn-message/bn-message.d.ts +27 -0
  569. package/dist/types/components/bn-page/bn-page.d.ts +29 -0
  570. package/dist/types/components/bn-table/bn-table.d.ts +373 -0
  571. package/dist/types/components/bn-table/ibcs-table.d.ts +59 -0
  572. package/dist/types/components/bn-table/utils/Table.d.ts +61 -0
  573. package/dist/types/components/bn-table/utils/elements/Cell.d.ts +36 -0
  574. package/dist/types/components/bn-table/utils/elements/CellBarChart.d.ts +45 -0
  575. package/dist/types/components/bn-table/utils/elements/TableRow.d.ts +30 -0
  576. package/dist/types/components/bn-table/utils/elements/index.d.ts +3 -0
  577. package/dist/types/components/bn-table/utils/factories/tableDataSetFactory.d.ts +114 -0
  578. package/dist/types/components/bn-table/utils/helper/ColumnStatistics.d.ts +21 -0
  579. package/dist/types/components/bn-table/utils/helper/DataQuery.d.ts +139 -0
  580. package/dist/types/components/bn-table/utils/helper/QueryGroup.d.ts +19 -0
  581. package/dist/types/components/bn-table/utils/helper/index.d.ts +1 -0
  582. package/dist/types/components/bn-table/utils/model/TableComponentConfig.d.ts +72 -0
  583. package/dist/types/components/bn-table/utils/model/TableDataRow.d.ts +70 -0
  584. package/dist/types/components/bn-table/utils/model/TableDrillGroup.d.ts +22 -0
  585. package/dist/types/components/bn-table/utils/model/index.d.ts +130 -0
  586. package/dist/types/components/bn-template/bn-template.d.ts +10 -0
  587. package/dist/types/components/bn-text/bn-text.d.ts +63 -0
  588. package/dist/types/components/bn-title/bn-title.d.ts +128 -0
  589. package/dist/types/components/bn-title/ibcs-title/ibcs-title.d.ts +23 -0
  590. package/dist/types/components/bn-title/ibcs-title/utils/Title.d.ts +28 -0
  591. package/dist/types/components/bn-title/ibcs-title/utils/factories/TitleDataSetFactory.d.ts +26 -0
  592. package/dist/types/components/bn-title/ibcs-title/utils/factories/index.d.ts +1 -0
  593. package/dist/types/components/bn-title/ibcs-title/utils/model/MeasureEntriy.d.ts +11 -0
  594. package/dist/types/components/bn-title/ibcs-title/utils/model/TimePeriod.d.ts +15 -0
  595. package/dist/types/components/bn-title/ibcs-title/utils/model/TitleConfig.d.ts +25 -0
  596. package/dist/types/components/bn-title/ibcs-title/utils/model/index.d.ts +35 -0
  597. package/dist/types/components/bn-tree/bn-tree.d.ts +84 -0
  598. package/dist/types/components/bn-tree/utils/EdgeRenderer.d.ts +57 -0
  599. package/dist/types/components/bn-tree/utils/TreeLayout.d.ts +37 -0
  600. package/dist/types/components/bn-tree/utils/TreeParser.d.ts +42 -0
  601. package/dist/types/components/editor-companion/editor-companion.d.ts +18 -0
  602. package/dist/types/components.d.ts +3311 -0
  603. package/dist/types/context/context-protocol.d.ts +53 -0
  604. package/dist/types/declarations.d.ts +1 -0
  605. package/dist/types/index.d.ts +2 -0
  606. package/dist/types/stencil-public-runtime.d.ts +1860 -0
  607. package/dist/types/stores/assets.d.ts +12 -0
  608. package/dist/types/stores/componentStyles.d.ts +82 -0
  609. package/dist/types/stores/context.d.ts +12 -0
  610. package/dist/types/stores/createScopedStores.d.ts +12 -0
  611. package/dist/types/stores/datasets.d.ts +14 -0
  612. package/dist/types/stores/datasetsMeta.d.ts +14 -0
  613. package/dist/types/stores/datasources.d.ts +14 -0
  614. package/dist/types/stores/internationalization.d.ts +9 -0
  615. package/dist/types/test-runner/test-runner-card.d.ts +3 -0
  616. package/dist/types/test-runner/test-runner-chart-time.d.ts +3 -0
  617. package/dist/types/test-runner/test-runner-chart.d.ts +3 -0
  618. package/dist/types/test-runner/test-runner-map.d.ts +3 -0
  619. package/dist/types/test-runner/test-runner-table.d.ts +3 -0
  620. package/dist/types/test-runner/test-runner-time.d.ts +3 -0
  621. package/dist/types/test-runner/test-runner-title.d.ts +3 -0
  622. package/dist/types/utils/DataUriUtil.d.ts +5 -0
  623. package/dist/types/utils/DateStringFactory.d.ts +123 -0
  624. package/dist/types/utils/componentRegister.d.ts +38 -0
  625. package/dist/types/utils/constants.d.ts +142 -0
  626. package/dist/types/utils/dataAnalyzer.d.ts +56 -0
  627. package/dist/types/utils/datasetMetaCalculator.d.ts +16 -0
  628. package/dist/types/utils/flattenObject.d.ts +13 -0
  629. package/dist/types/utils/formatter.d.ts +34 -0
  630. package/dist/types/utils/helper/AdapterUtils.d.ts +11 -0
  631. package/dist/types/utils/helper/CompareUtil.d.ts +26 -0
  632. package/dist/types/utils/helper/IAdapter.d.ts +16 -0
  633. package/dist/types/utils/helper/StringAdapter.d.ts +5 -0
  634. package/dist/types/utils/ibcsRuleSet.d.ts +47 -0
  635. package/dist/types/utils/index.d.ts +2 -0
  636. package/dist/types/utils/model/ChartStyles.d.ts +58 -0
  637. package/dist/types/utils/model/DataFormatDigits.d.ts +11 -0
  638. package/dist/types/utils/model/DataQueryResultRow.d.ts +29 -0
  639. package/dist/types/utils/model/DatasetMeta.d.ts +43 -0
  640. package/dist/types/utils/model/DateFormat.d.ts +38 -0
  641. package/dist/types/utils/model/Order.d.ts +46 -0
  642. package/dist/types/utils/model/SiPrefix.d.ts +11 -0
  643. package/dist/types/utils/model/TextStyles.d.ts +10 -0
  644. package/dist/types/utils/model/VarianceScenario.d.ts +20 -0
  645. package/dist/types/utils/model/index.d.ts +37 -0
  646. package/dist/types/utils/model/styles/FontStyle.d.ts +13 -0
  647. package/dist/types/utils/model/styles/Padding.d.ts +11 -0
  648. package/dist/types/utils/model/styles/SVGStyle.d.ts +20 -0
  649. package/dist/types/utils/model/styles/SVGStyleGroup.d.ts +16 -0
  650. package/dist/types/utils/model/styles/SVGVariancesStyleGroup.d.ts +16 -0
  651. package/dist/types/utils/parentDimensions.d.ts +13 -0
  652. package/dist/types/utils/scaling.d.ts +22 -0
  653. package/dist/types/utils/stackColors.d.ts +20 -0
  654. package/dist/types/utils/styled/attributes.d.ts +6 -0
  655. package/dist/types/utils/styled/style-sheet.d.ts +10 -0
  656. package/dist/types/utils/styled/withStyled.d.ts +12 -0
  657. package/dist/types/utils/templateId.d.ts +9 -0
  658. package/dist/types/utils/utils.d.ts +36 -0
  659. package/dist/types/utils/validate.d.ts +55 -0
  660. package/dist/types/utils/withBodyObserver.d.ts +14 -0
  661. package/dist/types/utils/withComponentStatus.d.ts +15 -0
  662. package/dist/types/utils/withComponentStyle.d.ts +20 -0
  663. package/dist/types/utils/withDataset.d.ts +18 -0
  664. package/dist/types/utils/withDatasource.d.ts +16 -0
  665. package/dist/types/utils/withHasError.d.ts +35 -0
  666. package/dist/types/utils/withTranslation.d.ts +24 -0
  667. package/loader/cdn.js +1 -0
  668. package/loader/index.cjs.js +1 -0
  669. package/loader/index.d.ts +24 -0
  670. package/loader/index.es2017.js +1 -0
  671. package/loader/index.js +2 -0
  672. package/package.json +68 -0
  673. package/readme.md +164 -0
@@ -0,0 +1,979 @@
1
+ import { Svg } from "@svgdotjs/svg.js";
2
+ import { ElementPositions, FactoryState, Padding, VarianceType } from "./helper";
3
+ import { DataPoint, Scenario, } from "./model";
4
+ // @ts-ignore
5
+ import { Axis, HookLocation, Label, StackedBar } from "./elements";
6
+ import { ScenarioFactory } from "./factories";
7
+ import alasql from "alasql";
8
+ import CalculateSize from "calculate-size";
9
+ import { Formatter } from "../../../utils";
10
+ import { AggregationLevel, StackBy, StackMode } from "../../../utils/constants";
11
+ import { getScenarioPrefix, IBCS_LAYER_ORDER } from "../../../utils/stackColors";
12
+ import { IBCSRuleSet } from "../../../utils/ibcsRuleSet";
13
+ import { VarianceScenario } from "../../../utils/model";
14
+ import { OrderColumn } from "../../../utils/model/Order";
15
+ import { SiPrefix } from "../../../utils/model/SiPrefix";
16
+ /**
17
+ * Orchestrates the full rendering pipeline for an IBCS structure (categorical) chart.
18
+ *
19
+ * Rendering pipeline (in draw()):
20
+ * 1. Clears the SVG container
21
+ * 2. Routes to the appropriate drawing method:
22
+ * - Variance chart: drawVarianceScenario() for absolute/relative variance bars
23
+ * - Stacked chart: drawStackedScenarios() + drawStackedHeaders()
24
+ * - Standard chart: drawScenarios() with primary/secondary bars and markers
25
+ * 3. Draws vertical axis + category labels via drawAxisAndLabels()
26
+ *
27
+ * Data pipeline (in setConfig()):
28
+ * 1. Raw data is filtered via AlaSQL
29
+ * 2. Categories are aggregated (GROUP BY) with operation-sign-aware SUM
30
+ * 3. Optional limit + REST row aggregation for top-N display
31
+ * 4. Variance model is computed from base/delta scenario pairs
32
+ * 5. Min/max DataPoints drive the coordinate system sizing
33
+ *
34
+ * Overflow handling: setAvailableWidth() can enable broken-bar rendering
35
+ * when bars exceed the container width.
36
+ */
37
+ export class StructureChart {
38
+ constructor(ruleSet, config, styles) {
39
+ this.dataModel = [];
40
+ this.variancesDataModel = [];
41
+ this.title = "";
42
+ this.smallestDataPointValue = new DataPoint(0, Scenario.AC1, 1, Scenario.NEU);
43
+ this.highestDataPointValue = new DataPoint(0, Scenario.AC1, 1, Scenario.NEU);
44
+ this.smallestVarianceDataPointValue = new DataPoint(0, Scenario.AC1, 1, Scenario.NEU);
45
+ this.highestVarianceDataPointValue = new DataPoint(0, Scenario.AC1, 1, Scenario.NEU);
46
+ this.pixelPerUnit = 1;
47
+ this.pixelPerPercentage = 1;
48
+ this.hideCategories = false;
49
+ this.axisScenario = Scenario.AC1;
50
+ this.CSS_CATEGORIES = "categories";
51
+ this.preparedDataSet = [];
52
+ this.state = FactoryState.DIRTY;
53
+ this.titleLength = 0;
54
+ this.leftSideOffsetForHorizontalSync = 0;
55
+ this.limit = 0;
56
+ this.measureScale = new SiPrefix();
57
+ this.measureUnit = "";
58
+ this.dataFormatDigits = { percent: 2, decimal: 1 };
59
+ this.stackConfig = null;
60
+ this.overflowConfig = null;
61
+ this.initSQLFunctions();
62
+ this.ruleSet = ruleSet || new IBCSRuleSet();
63
+ this.i18n = this.createI18n(new Map());
64
+ this.styles = styles;
65
+ this.setConfig(config);
66
+ this.position = this.createElementPosition();
67
+ }
68
+ updatePosition() {
69
+ this.position = this.createElementPosition();
70
+ }
71
+ createElementPosition() {
72
+ this.titleLength = this.calculateTitleLength(0);
73
+ let leftSideWidth = this.calculateLeftSideWidth(this.getVarianceType());
74
+ const categoryWidth = this.calculateCategoryWidth();
75
+ if (this.titleLength > leftSideWidth) {
76
+ leftSideWidth = this.titleLength;
77
+ }
78
+ return new ElementPositions(new Padding(this.styles.padding), this.styles.scaleFactors, this.styles.fontStyles.size, this.dataModel.length, this.leftSideOffsetForHorizontalSync, this.titleLength, leftSideWidth, categoryWidth);
79
+ }
80
+ initSQLFunctions() {
81
+ alasql.fn.transformOperator = function (a) {
82
+ return a === "-" ? -1 : 1;
83
+ };
84
+ }
85
+ setStyles(newStyle) {
86
+ this.styles = newStyle;
87
+ }
88
+ setConfig(config) {
89
+ var _a;
90
+ this.state = FactoryState.DIRTY;
91
+ this.sortScenariosbyVisualisationRules(config);
92
+ this.hideCategories = config.hideCategories || false;
93
+ this.limit = config.limit;
94
+ this.pixelPerUnit = config.pixelPerUnit || 1;
95
+ this.pixelPerPercentage = config.pixelPerPercentage || 100;
96
+ this.setData([...config.data], config.filter);
97
+ this.dataModel = this.populateModel(config.scenarios, config.level, config.sortOrder);
98
+ // Populate per-dimension stack segments when stacking by a data dimension
99
+ if (config.stackConfig && config.stackConfig.by !== StackBy.SCENARIO) {
100
+ this.populateDimensionStackSegments(config.scenarios, config.stackConfig, config.level);
101
+ }
102
+ this.variancesDataModel = this.populateVarianceModel(config.variances, this.dataModel);
103
+ 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);
104
+ this.smallestDataPointValue = this.findSmallestDataPointValue(this.dataModel);
105
+ this.smallestVarianceDataPointValue = this.findSmallestDataPointValue(this.variancesDataModel);
106
+ this.highestDataPointValue = this.findHighestDataPointValue(this.dataModel);
107
+ this.highestVarianceDataPointValue = this.findHighestDataPointValue(this.variancesDataModel);
108
+ this.axisScenario = this.setAxisScenario(config.variances);
109
+ this.measureScale = config.measureScale;
110
+ this.measureUnit = config.measureUnit;
111
+ this.dataFormatDigits = config.dataFormatDigits;
112
+ this.stackConfig = config.stackConfig;
113
+ this.updatePosition();
114
+ }
115
+ sortScenariosbyVisualisationRules(config) {
116
+ const self = this;
117
+ config.scenarios
118
+ .sort((n1, n2) => {
119
+ return self.ruleSet.getScenarioSorIndex(n1) - self.ruleSet.getScenarioSorIndex(n2);
120
+ })
121
+ .reverse();
122
+ }
123
+ /**
124
+ * Init load of translation dictionary map
125
+ * map is used to translate lables in the table
126
+ *
127
+ * example:
128
+ * ```
129
+ * let i18n: Map<string, string> = new Map();
130
+ * [{key: 'ac',value: 'AC'}].forEach(function(entry){
131
+ * i18n.set(entry.key, entry.value);
132
+ * })
133
+ * ```
134
+ * @param i18n
135
+ */
136
+ setI18n(i18n) {
137
+ this.i18n = this.createI18n(i18n);
138
+ }
139
+ createI18n(i18n) {
140
+ this.state = FactoryState.DIRTY;
141
+ const defaultI18n = new Map([
142
+ ["SEPERATOR_WS", ", "],
143
+ ["in", "in"],
144
+ ["ORDER_asc", "↑"],
145
+ ["ORDER_desc", "↓"],
146
+ ["ac1", "AC"],
147
+ ["pp1", "PY"],
148
+ ["fc1", "FC"],
149
+ ["pl1", "PL"],
150
+ ["ac2", "AC2"],
151
+ ["pp2", "PY2"],
152
+ ["fc2", "FC2"],
153
+ ["pl2", "PL2"],
154
+ ["ac3", "AC3"],
155
+ ["pp3", "PY3"],
156
+ ["fc3", "FC3"],
157
+ ["pl3", "PL3"],
158
+ ["ac4", "AC4"],
159
+ ["pp4", "PY4"],
160
+ ["fc4", "FC4"],
161
+ ["pl4", "PL4"],
162
+ ["category", " "],
163
+ ["operation", " "],
164
+ ["there_of", "davon"],
165
+ ["part_of", "in % von"],
166
+ ["ibcssymbol_delta_ac", "Δ{%}"],
167
+ ["ibcssymbol_delta_generic", "Δ({%})"],
168
+ ["ibcssymbol_delta_ac_relative", "Δ{%}%"],
169
+ ["ibcssymbol_delta_generic_relative", "Δ({%})%"],
170
+ ["SUM_TOTAL", "❖"],
171
+ ]);
172
+ return new Map([...defaultI18n, ...i18n]);
173
+ }
174
+ /**
175
+ * Init load raw datasets the loaded dataset is
176
+ * the base on which the filters defined in the config
177
+ * are apllied on internaly it is called prepared DataSet
178
+ *
179
+ * @param data
180
+ * @param filter - data filter
181
+ * @param customColumnNameMap Custon ColumnNameMap can be used if data uses non standard columnames
182
+ */
183
+ setData(data, filter) {
184
+ if (data == null) {
185
+ return;
186
+ }
187
+ this.state = FactoryState.DIRTY; // mark dataSet for update
188
+ this.preparedDataSet.length = 0; // cleans formerly loaded and prepared dataset
189
+ if (filter != null && filter.length > 0) {
190
+ try {
191
+ this.preparedDataSet = alasql(`SELECT * FROM ? WHERE ${filter}`, [data]);
192
+ }
193
+ catch (e) {
194
+ console.error("StructureChart: filter query failed, using unfiltered data", filter, e);
195
+ this.preparedDataSet = data;
196
+ }
197
+ }
198
+ else {
199
+ this.preparedDataSet = data;
200
+ }
201
+ }
202
+ getAllocatedCanvasWidth() {
203
+ //let columnLabelWidth = this.calculateCategoryWidth();
204
+ const leftSideWidth = this.position.getAxisPositionX(); //this.calculateLeftSideWidth(this.getVarianceType());
205
+ const rightSideWidth = this.calculateRightSideWidth(this.getVarianceType());
206
+ let width = leftSideWidth + rightSideWidth + +this.styles.padding.left + this.styles.padding.right;
207
+ if (rightSideWidth < this.titleLength / 2) {
208
+ width += this.titleLength / 2;
209
+ }
210
+ if (leftSideWidth < this.titleLength / 2) {
211
+ width += this.titleLength / 2;
212
+ }
213
+ return width;
214
+ }
215
+ getAllocatedCanvasHeight() {
216
+ return ((this.dataModel.length + 1) * this.position.spacings.categoryWidth +
217
+ this.styles.padding.top +
218
+ this.styles.padding.bottom);
219
+ }
220
+ patternToString() {
221
+ return "<svg></svg>";
222
+ }
223
+ toString() {
224
+ const container = new Svg();
225
+ this.draw(container);
226
+ container.id("drawCanvas");
227
+ container.width(this.getAllocatedCanvasWidth());
228
+ container.height(this.getAllocatedCanvasHeight());
229
+ return container.svg();
230
+ }
231
+ draw(svgContainer) {
232
+ this.cleanSVGforRedraw(svgContainer);
233
+ if (this.state === FactoryState.DIRTY) {
234
+ this.state = FactoryState.UP_TO_DATE;
235
+ }
236
+ if (this.variancesDataModel && this.variancesDataModel.length > 0) {
237
+ this.drawVarianceScenario(this.variancesDataModel, svgContainer);
238
+ this.drawAxisAndLabels(this.variancesDataModel, svgContainer);
239
+ }
240
+ else if (this.stackConfig != null) {
241
+ this.drawStackedScenarios(this.dataModel, svgContainer);
242
+ this.drawStackedHeaders(this.dataModel, svgContainer);
243
+ this.drawAxisAndLabels(this.dataModel, svgContainer);
244
+ }
245
+ else {
246
+ this.drawScenarios(this.dataModel, svgContainer);
247
+ this.drawAxisAndLabels(this.dataModel, svgContainer);
248
+ }
249
+ }
250
+ setPattern(fc, fcPolygonPattern) {
251
+ this.styles.pattern.set(fc, fcPolygonPattern);
252
+ }
253
+ calculateTitleLength(minWidth) {
254
+ const tmpTitle = "_______"; // default width if this.title is sorther
255
+ const width = CalculateSize(this.title.length > tmpTitle.length ? this.title : tmpTitle, {
256
+ font: this.styles.fontStyles.font,
257
+ fontSize: this.styles.fontStyles.size + "px",
258
+ }).width;
259
+ if (width < minWidth) {
260
+ return minWidth;
261
+ }
262
+ return width / 2;
263
+ }
264
+ getFooter() {
265
+ if (this.measureScale.value === 1 && this.measureUnit === "") {
266
+ return " ";
267
+ }
268
+ return Formatter.translateScenarioLabel("in", this.i18n) + " " + this.measureScale.prefix + this.measureUnit;
269
+ }
270
+ setAxisScenario(scenarios) {
271
+ let result = Scenario.AC1;
272
+ if (scenarios != null && scenarios.length > 0) {
273
+ const axis = new VarianceScenario(scenarios.toString());
274
+ if (axis.isValid) {
275
+ result = axis.delta;
276
+ }
277
+ }
278
+ if (result === null) {
279
+ // arrays with invalid scenarios are set to Senario.AC Fallback
280
+ result = Scenario.AC1;
281
+ }
282
+ return result;
283
+ }
284
+ populateModel(selectedScenarios, level, sortOrder) {
285
+ var _a;
286
+ if (((_a = this.preparedDataSet) === null || _a === void 0 ? void 0 : _a.length) === 0) {
287
+ return [];
288
+ }
289
+ const dataModel = [];
290
+ const orderStr = this.createOrderStr(level, sortOrder);
291
+ const select = this.createSelectString(level, sortOrder);
292
+ const groupByStr = this.createGroupByStr(level, sortOrder);
293
+ const result = alasql(`SELECT ${select} ${selectedScenarios.length > 0
294
+ ? "," +
295
+ selectedScenarios
296
+ .map((scenario) => {
297
+ return `SUM(${scenario} * transformOperator(operation)) as ${scenario}, COUNT(ISNULL(${scenario})) as ${scenario}_cnt`;
298
+ })
299
+ .join(",")
300
+ : ""}
301
+ FROM ?
302
+ GROUP BY ${groupByStr}
303
+ ORDER BY ${orderStr}`, [this.preparedDataSet]);
304
+ this.detectNaNCells(selectedScenarios, result);
305
+ this.createDataRows(result, dataModel, selectedScenarios);
306
+ this.crateRESTRow(result, selectedScenarios, dataModel);
307
+ return dataModel;
308
+ }
309
+ detectNaNCells(scenarios, res) {
310
+ res.forEach((row) => {
311
+ scenarios.forEach((scenario) => {
312
+ const varianceScenario = new VarianceScenario(scenario);
313
+ if (varianceScenario.isValid === true) {
314
+ if (row[varianceScenario.base + "_cnt"] === 0 || row[varianceScenario.delta + "_cnt"] === 0) {
315
+ row[scenario] = Number.NaN;
316
+ }
317
+ }
318
+ else {
319
+ if (row[scenario + "_cnt"] === 0) {
320
+ row[scenario] = Number.NaN;
321
+ }
322
+ }
323
+ });
324
+ return row;
325
+ });
326
+ }
327
+ crateRESTRow(result, selectedScenarios, dataModel) {
328
+ if (this.limit === 0 || this.limit > result.length) {
329
+ return;
330
+ }
331
+ const restDataModel = [];
332
+ const restResult = result.slice(this.limit, result.length);
333
+ this.createDataRows(restResult, restDataModel, selectedScenarios);
334
+ const reducedRestRow = restDataModel.reduce(function (sum, current) {
335
+ const obj = {
336
+ id: sum.id,
337
+ category: sum.category,
338
+ type: sum.type,
339
+ scenario1: new DataPoint(sum.scenario1.value + current.scenario1.value, selectedScenarios[0], sum.scenario1.pixelPerUnit, Scenario.NEU),
340
+ scenario2: new DataPoint(sum.scenario2.value + current.scenario2.value, selectedScenarios[1], sum.scenario2.pixelPerUnit, Scenario.NEU),
341
+ scenario3: new DataPoint(sum.scenario3.value + current.scenario3.value, selectedScenarios[2], sum.scenario3.pixelPerUnit, Scenario.NEU),
342
+ scenario4: new DataPoint(sum.scenario4.value + current.scenario4.value, selectedScenarios[3], sum.scenario4.pixelPerUnit, Scenario.NEU),
343
+ };
344
+ return obj;
345
+ }, {
346
+ id: 9999,
347
+ category: "REST",
348
+ type: VarianceType.NONE,
349
+ scenario1: new DataPoint(0, selectedScenarios[0], this.pixelPerUnit, Scenario.NEU),
350
+ scenario2: new DataPoint(0, selectedScenarios[1], this.pixelPerUnit, Scenario.NEU),
351
+ scenario3: new DataPoint(0, selectedScenarios[2], this.pixelPerUnit, Scenario.NEU),
352
+ scenario4: new DataPoint(0, selectedScenarios[3], this.pixelPerUnit, Scenario.NEU),
353
+ });
354
+ dataModel.push(reducedRestRow);
355
+ }
356
+ createDataRows(result, dataModel, selectedScenarios) {
357
+ let primaryResult = result;
358
+ if (this.limit > 0) {
359
+ primaryResult = result.slice(0, this.limit);
360
+ }
361
+ primaryResult.forEach((element, index) => {
362
+ dataModel.push({
363
+ id: index,
364
+ category: element.category,
365
+ type: VarianceType.NONE,
366
+ scenario1: new DataPoint(element[selectedScenarios[0]], selectedScenarios[0], this.pixelPerUnit, Scenario.NEU),
367
+ scenario2: new DataPoint(element[selectedScenarios[1]], selectedScenarios[1], this.pixelPerUnit, Scenario.NEU),
368
+ scenario3: new DataPoint(element[selectedScenarios[2]], selectedScenarios[2], this.pixelPerUnit, Scenario.NEU),
369
+ scenario4: new DataPoint(element[selectedScenarios[3]], selectedScenarios[3], this.pixelPerUnit, Scenario.NEU),
370
+ });
371
+ });
372
+ }
373
+ createOrderStr(level, sortOrder) {
374
+ let orderStr = `${level.toLowerCase()}`;
375
+ if (sortOrder.hierarchy.length >= 1) {
376
+ orderStr = `${sortOrder.hierarchy.toString()} ${sortOrder === null || sortOrder === void 0 ? void 0 : sortOrder.direction}`;
377
+ }
378
+ return orderStr;
379
+ }
380
+ createSelectString(level, sortOrder) {
381
+ if (level === AggregationLevel.CATEGORY && sortOrder.hierarchy.includes(OrderColumn.CATEGORYINDEX)) {
382
+ return `${OrderColumn.CATEGORYINDEX}, ${AggregationLevel.CATEGORY} as category`;
383
+ }
384
+ else if (level === AggregationLevel.ROWGROUP && sortOrder.hierarchy.includes(OrderColumn.ROWGROUPINDEX)) {
385
+ return `${OrderColumn.ROWGROUPINDEX}, ${AggregationLevel.ROWGROUP} as category`;
386
+ }
387
+ else if (level === AggregationLevel.SUBCATEGORY && sortOrder.hierarchy.includes(OrderColumn.SUBCATEGORYINDEX)) {
388
+ return `${OrderColumn.SUBCATEGORYINDEX}, ${AggregationLevel.SUBCATEGORY} as category`;
389
+ }
390
+ else {
391
+ return `${level.toString()} as category`;
392
+ }
393
+ }
394
+ createGroupByStr(level, sortOrder) {
395
+ if (level === AggregationLevel.CATEGORY && sortOrder.hierarchy.includes(OrderColumn.CATEGORYINDEX)) {
396
+ return `${OrderColumn.CATEGORYINDEX}, ${AggregationLevel.CATEGORY}`;
397
+ }
398
+ else if (level === AggregationLevel.ROWGROUP && sortOrder.hierarchy.includes(OrderColumn.ROWGROUPINDEX)) {
399
+ return `${OrderColumn.ROWGROUPINDEX}, ${AggregationLevel.ROWGROUP}`;
400
+ }
401
+ else if (level === AggregationLevel.SUBCATEGORY && sortOrder.hierarchy.includes(OrderColumn.SUBCATEGORYINDEX)) {
402
+ return `${OrderColumn.SUBCATEGORYINDEX}, ${AggregationLevel.SUBCATEGORY}`;
403
+ }
404
+ else {
405
+ return `${level.toString()}`;
406
+ }
407
+ }
408
+ calculateCategoryWidth() {
409
+ if (this.hideCategories) {
410
+ return 5;
411
+ }
412
+ let longestLength = 0;
413
+ for (const entry of this.dataModel) {
414
+ const columnLength = CalculateSize(entry.category, {
415
+ font: this.styles.fontStyles.font,
416
+ fontSize: this.styles.fontStyles.size + "px",
417
+ });
418
+ if (columnLength.width > longestLength) {
419
+ longestLength = columnLength.width;
420
+ }
421
+ }
422
+ // MagicNumber used to compensate differnet fontwidth rendered vs calculated
423
+ const magicNumber = 1.1125;
424
+ return longestLength * magicNumber;
425
+ }
426
+ findSmallestDataPointValue(dataModel) {
427
+ let smallestDataPoint = new DataPoint(0, "default", this.pixelPerUnit, null);
428
+ for (const entry of dataModel) {
429
+ for (const current of [entry.scenario1, entry.scenario2, entry.scenario3, entry.scenario4]) {
430
+ if (current != null && smallestDataPoint.value != null) {
431
+ if (current.value < smallestDataPoint.value) {
432
+ smallestDataPoint = current;
433
+ }
434
+ }
435
+ }
436
+ }
437
+ return smallestDataPoint;
438
+ }
439
+ findHighestDataPointValue(dataModel) {
440
+ let highestDataPoint = new DataPoint(0, "default", this.pixelPerUnit, null);
441
+ for (const entry of dataModel) {
442
+ for (const current of [entry.scenario1, entry.scenario2, entry.scenario3, entry.scenario4]) {
443
+ if (current != null && highestDataPoint.value != null) {
444
+ if (current.value > highestDataPoint.value) {
445
+ highestDataPoint = current;
446
+ }
447
+ }
448
+ }
449
+ }
450
+ return highestDataPoint;
451
+ }
452
+ populateVarianceModel(variancesConfig, dataModel) {
453
+ const varianceModel = [];
454
+ if (variancesConfig.length === 0) {
455
+ return varianceModel;
456
+ }
457
+ let firstRow = null;
458
+ if (dataModel != null && dataModel.length > 0) {
459
+ firstRow = dataModel[0];
460
+ }
461
+ for (const varianceScenario in variancesConfig) {
462
+ const scenarios = new VarianceScenario(variancesConfig[varianceScenario]);
463
+ if (scenarios.isValid) {
464
+ const scenariomap = this.mapScenarios(scenarios, firstRow);
465
+ const directon = scenarios.direction;
466
+ let pixelPerUnit = this.pixelPerUnit;
467
+ if (scenarios.type === "dr") {
468
+ pixelPerUnit = this.pixelPerPercentage;
469
+ }
470
+ for (const index in dataModel) {
471
+ varianceModel.push({
472
+ id: Number(index),
473
+ category: dataModel[index].category,
474
+ type: scenarios.type === "dr" ? VarianceType.RELATIVE : VarianceType.ABSOLUTE,
475
+ scenario1: new DataPoint(this.calculateVariance(scenarios, dataModel[index], scenariomap), scenarios.base, pixelPerUnit, directon),
476
+ scenario2: new DataPoint(null, null, null, null),
477
+ scenario3: new DataPoint(null, null, null, null),
478
+ scenario4: new DataPoint(null, null, null, null),
479
+ });
480
+ }
481
+ }
482
+ }
483
+ return varianceModel;
484
+ }
485
+ calculateVariance(scenarios, element, scenarioMap) {
486
+ const scenarioBase = scenarioMap.get(scenarios.base);
487
+ const scenarioDelta = scenarioMap.get(scenarios.delta);
488
+ if (scenarioBase == null || scenarioDelta == null) {
489
+ return null;
490
+ }
491
+ const isRelativeVarianze = scenarios.type === VarianceType.RELATIVE;
492
+ if (isRelativeVarianze) {
493
+ return (element[scenarioBase].value - element[scenarioDelta].value) / element[scenarioDelta].value;
494
+ }
495
+ else {
496
+ return element[scenarioBase].value - element[scenarioDelta].value;
497
+ }
498
+ }
499
+ mapScenarios(scenarios, firstRow) {
500
+ const varianceMap = new Map();
501
+ if (firstRow == null) {
502
+ return varianceMap;
503
+ }
504
+ ["scenario1", "scenario2", "scenario3", "scenario4"].forEach((scenarioKey) => {
505
+ if (firstRow[scenarioKey].scenario === scenarios.delta) {
506
+ varianceMap.set(scenarios.delta, scenarioKey);
507
+ }
508
+ else if (firstRow[scenarioKey].scenario === scenarios.base) {
509
+ varianceMap.set(scenarios.base, scenarioKey);
510
+ }
511
+ });
512
+ return varianceMap;
513
+ }
514
+ calculateTextBoxWidth(value) {
515
+ return CalculateSize(Formatter.number(value, "decimal", 1, 0), {
516
+ font: this.styles.fontStyles.font,
517
+ fontSize: this.styles.fontStyles.size + "px",
518
+ }).width;
519
+ }
520
+ calculatePercentageTextBoxWidth(value) {
521
+ let signWidth = 0;
522
+ if (value >= 0) {
523
+ signWidth += CalculateSize("+", {
524
+ font: this.styles.fontStyles.font,
525
+ fontSize: this.styles.fontStyles.size + "px",
526
+ }).width;
527
+ }
528
+ signWidth += CalculateSize(" %", {
529
+ font: this.styles.fontStyles.font,
530
+ fontSize: this.styles.fontStyles.size + "px",
531
+ }).width;
532
+ const labelWidth = CalculateSize(Formatter.number(value, "decimal", 1, 1), {
533
+ font: this.styles.fontStyles.font,
534
+ fontSize: this.styles.fontStyles.size + "px",
535
+ }).width + signWidth;
536
+ return labelWidth + signWidth;
537
+ }
538
+ cleanSVGforRedraw(svgContainer) {
539
+ svgContainer.clear();
540
+ }
541
+ drawAxisAndLabels(dataModel, svgContainer) {
542
+ const axisLabelGroup = svgContainer.group().id("AxisAndDateLables");
543
+ let isRelative = false;
544
+ if (!this.hideCategories) {
545
+ dataModel.forEach((elements, index) => {
546
+ if (elements["type"] === VarianceType.RELATIVE) {
547
+ isRelative = true;
548
+ }
549
+ let textHook = HookLocation.Right;
550
+ let isPositive = true;
551
+ if (elements["scenario1"].value < 0) {
552
+ textHook = HookLocation.Left;
553
+ isPositive = false;
554
+ }
555
+ new Label(axisLabelGroup, this.position.getCategoryPositionX(isPositive), this.position.getBarCenterPositionY(index), "", elements.category, this.styles, HookLocation.Center, textHook).draw();
556
+ });
557
+ }
558
+ new Axis({
559
+ scenarioType: this.axisScenario,
560
+ labelText: this.title,
561
+ isRelative: isRelative,
562
+ }, this.position, axisLabelGroup, this.styles).draw();
563
+ }
564
+ drawScenarios(dataModel, svgContainer) {
565
+ const barsGroup = svgContainer.group().id("Scenarios");
566
+ const scenarioFactory = new ScenarioFactory(this.position, barsGroup, this.styles, dataModel.length, this.i18n);
567
+ scenarioFactory.setOverflowConfig(this.overflowConfig);
568
+ dataModel.forEach((elements, index) => {
569
+ scenarioFactory.createPrimaryBar(elements["scenario1"], index).draw(this.dataFormatDigits, this.measureScale);
570
+ scenarioFactory.createSecondaryBar(elements["scenario2"], index).draw();
571
+ scenarioFactory.createPrimaryMarker(elements["scenario3"], index).draw();
572
+ scenarioFactory.createSecondaryMarker(elements["scenario4"], index).draw();
573
+ });
574
+ }
575
+ drawVarianceScenario(dataModel, svgContainer) {
576
+ const barsGroup = svgContainer.group().id("Scenarios");
577
+ const scenarioFactory = new ScenarioFactory(this.position, barsGroup, this.styles, dataModel.length, this.i18n);
578
+ scenarioFactory.setOverflowConfig(this.overflowConfig);
579
+ dataModel.forEach((elements, index) => {
580
+ if (elements["type"] === VarianceType.RELATIVE) {
581
+ scenarioFactory.createRelativeVarianceBar(elements["scenario1"], index).draw();
582
+ }
583
+ else {
584
+ scenarioFactory.createVarianceBar(elements["scenario1"], index).draw(this.dataFormatDigits, this.measureScale);
585
+ }
586
+ });
587
+ return barsGroup;
588
+ }
589
+ /**
590
+ * Draw stacked horizontal bars. Supports stacking by scenario or by data dimension.
591
+ * When stacking by scenario with multiple scenario types (e.g. ac+pl),
592
+ * uses overlay mode: each type group is drawn from the same baseline,
593
+ * back-to-front per IBCS convention (PL behind, AC on top).
594
+ */
595
+ drawStackedScenarios(dataModel, svgContainer) {
596
+ if (!this.stackConfig)
597
+ return;
598
+ const stackGroup = svgContainer.group().id("StackedScenarios");
599
+ const isScenarioStack = this.stackConfig.by === StackBy.SCENARIO;
600
+ dataModel.forEach((elements, index) => {
601
+ const scenarioKeys = ["scenario1", "scenario2", "scenario3", "scenario4"];
602
+ const segments = [];
603
+ if (isScenarioStack) {
604
+ for (const key of scenarioKeys) {
605
+ const dp = elements[key];
606
+ if (dp && !dp.isEmpty() && dp.value != null) {
607
+ segments.push({ value: dp.value, scenario: dp.scenario, dataPoint: dp });
608
+ }
609
+ }
610
+ }
611
+ else {
612
+ const dp = elements["scenario1"];
613
+ if (dp && !dp.isEmpty() && dp.value != null) {
614
+ segments.push({ value: dp.value, scenario: dp.scenario, dataPoint: dp });
615
+ }
616
+ }
617
+ if (segments.length === 0)
618
+ return;
619
+ // Check if we have multiple scenario type groups for overlay mode
620
+ const prefixes = isScenarioStack
621
+ ? new Set(segments.map((s) => getScenarioPrefix(s.scenario)))
622
+ : new Set();
623
+ if (prefixes.size > 1) {
624
+ // Overlay mode: group by scenario prefix, draw each group from same baseline
625
+ const groupMap = new Map();
626
+ for (const seg of segments) {
627
+ const prefix = getScenarioPrefix(seg.scenario);
628
+ if (!groupMap.has(prefix))
629
+ groupMap.set(prefix, []);
630
+ groupMap.get(prefix).push(seg);
631
+ }
632
+ // Sort groups by IBCS layer order (back-to-front: pl, fc, pp, ac)
633
+ const groups = [];
634
+ for (const prefix of IBCS_LAYER_ORDER) {
635
+ if (groupMap.has(prefix)) {
636
+ groups.push({ prefix, segments: groupMap.get(prefix) });
637
+ groupMap.delete(prefix);
638
+ }
639
+ }
640
+ for (const [prefix, segs] of groupMap) {
641
+ groups.push({ prefix, segments: segs });
642
+ }
643
+ // Draw each group from baseline=0 (overlapping)
644
+ groups.forEach((group, groupIdx) => {
645
+ const groupTotal = group.segments.reduce((sum, s) => sum + Math.abs(s.value), 0);
646
+ const colorIndex = groups.length - 1 - groupIdx; // back=lighter, front=darker
647
+ let cumulativeValue = 0;
648
+ let lastBar = null;
649
+ group.segments.forEach((seg) => {
650
+ const bar = new StackedBar(this.position, this.styles, seg.dataPoint, index, cumulativeValue, seg.scenario, colorIndex, this.stackConfig.mode, groupTotal, true, stackGroup);
651
+ bar.draw(this.dataFormatDigits, this.measureScale);
652
+ cumulativeValue += Math.abs(seg.value);
653
+ lastBar = bar;
654
+ });
655
+ if (lastBar) {
656
+ lastBar.drawTotalLabel(this.dataFormatDigits, this.measureScale);
657
+ }
658
+ });
659
+ }
660
+ else {
661
+ // Single group, scenario or dimension stacking
662
+ // For dimension stacking, use stackSegments if available
663
+ let finalSegments = segments;
664
+ if (!isScenarioStack && elements.stackSegments && elements.stackSegments.length > 0) {
665
+ finalSegments = elements.stackSegments.map((seg) => ({
666
+ value: seg.value,
667
+ scenario: seg.label,
668
+ dataPoint: seg.dataPoint,
669
+ }));
670
+ }
671
+ if (this.stackConfig.order === "asc") {
672
+ finalSegments.sort((a, b) => a.value - b.value);
673
+ }
674
+ else if (this.stackConfig.order === "desc") {
675
+ finalSegments.sort((a, b) => b.value - a.value);
676
+ }
677
+ const total = finalSegments.reduce((sum, s) => sum + Math.abs(s.value), 0);
678
+ let cumulativeValue = 0;
679
+ let lastBar = null;
680
+ finalSegments.forEach((seg, segIdx) => {
681
+ const bar = new StackedBar(this.position, this.styles, seg.dataPoint, index, cumulativeValue, seg.scenario, segIdx, this.stackConfig.mode, total, isScenarioStack, stackGroup);
682
+ bar.draw(this.dataFormatDigits, this.measureScale);
683
+ cumulativeValue += Math.abs(seg.value);
684
+ lastBar = bar;
685
+ });
686
+ if (lastBar) {
687
+ lastBar.drawTotalLabel(this.dataFormatDigits, this.measureScale);
688
+ }
689
+ }
690
+ });
691
+ }
692
+ /**
693
+ * Draw column headers above stacked bars showing what each segment/group represents.
694
+ * For overlay mode (multiple scenario types): shows one header per group.
695
+ * For single-group scenario stacking: shows individual segment headers.
696
+ */
697
+ drawStackedHeaders(dataModel, svgContainer) {
698
+ if (!this.stackConfig || dataModel.length === 0)
699
+ return;
700
+ const isScenarioStack = this.stackConfig.by === StackBy.SCENARIO;
701
+ const headerGroup = svgContainer.group().id("StackedHeaders");
702
+ const firstRow = dataModel[0];
703
+ // Dimension stacking: use stackSegments from first row for headers
704
+ if (!isScenarioStack) {
705
+ const stackSegs = firstRow.stackSegments;
706
+ if (!stackSegs || stackSegs.length === 0)
707
+ return;
708
+ const orderedSegs = [...stackSegs];
709
+ if (this.stackConfig.order === "asc")
710
+ orderedSegs.sort((a, b) => a.value - b.value);
711
+ else if (this.stackConfig.order === "desc")
712
+ orderedSegs.sort((a, b) => b.value - a.value);
713
+ const total = orderedSegs.reduce((sum, s) => sum + Math.abs(s.value), 0);
714
+ const axisX = this.position.getBarPositionX();
715
+ const headerY = this.position.getAxisTitlePositionY();
716
+ let cumulativePixels = 0;
717
+ orderedSegs.forEach((seg) => {
718
+ const pixelPerUnit = seg.dataPoint.pixelPerUnit;
719
+ let segmentLength;
720
+ if (this.stackConfig.mode === StackMode.RELATIVE) {
721
+ const proportion = total !== 0 ? Math.abs(seg.value) / total : 0;
722
+ segmentLength = proportion * pixelPerUnit;
723
+ }
724
+ else {
725
+ segmentLength = Math.abs(seg.value * pixelPerUnit);
726
+ }
727
+ const centerX = axisX + cumulativePixels + segmentLength / 2;
728
+ const labelText = this.i18n.get(seg.label) || seg.label;
729
+ new Label(headerGroup, centerX, headerY, "STACK_HEADER", labelText, this.styles, HookLocation.Bottom, HookLocation.Center).draw();
730
+ cumulativePixels += segmentLength;
731
+ });
732
+ return;
733
+ }
734
+ const scenarioKeys = ["scenario1", "scenario2", "scenario3", "scenario4"];
735
+ const segments = [];
736
+ for (const key of scenarioKeys) {
737
+ const dp = firstRow[key];
738
+ if (dp && !dp.isEmpty() && dp.value != null) {
739
+ segments.push({ value: dp.value, scenario: dp.scenario, dataPoint: dp });
740
+ }
741
+ }
742
+ if (segments.length === 0)
743
+ return;
744
+ const prefixes = new Set(segments.map((s) => getScenarioPrefix(s.scenario)));
745
+ const axisX = this.position.getBarPositionX();
746
+ const headerY = this.position.getAxisTitlePositionY();
747
+ if (prefixes.size > 1) {
748
+ // Overlay mode: one header per group, centered on group's bar extent
749
+ const groupMap = new Map();
750
+ for (const seg of segments) {
751
+ const prefix = getScenarioPrefix(seg.scenario);
752
+ if (!groupMap.has(prefix))
753
+ groupMap.set(prefix, []);
754
+ groupMap.get(prefix).push(seg);
755
+ }
756
+ const groups = [];
757
+ for (const prefix of IBCS_LAYER_ORDER) {
758
+ if (groupMap.has(prefix)) {
759
+ groups.push({ prefix, segments: groupMap.get(prefix) });
760
+ groupMap.delete(prefix);
761
+ }
762
+ }
763
+ for (const [prefix, segs] of groupMap) {
764
+ groups.push({ prefix, segments: segs });
765
+ }
766
+ groups.forEach((group) => {
767
+ const groupTotal = group.segments.reduce((sum, s) => sum + Math.abs(s.value), 0);
768
+ const pixelPerUnit = group.segments[0].dataPoint.pixelPerUnit;
769
+ const groupPixelLength = this.stackConfig.mode === StackMode.RELATIVE ? pixelPerUnit : groupTotal * pixelPerUnit;
770
+ const centerX = axisX + groupPixelLength / 2;
771
+ const labelText = this.i18n.get(group.prefix + "1") || group.prefix.toUpperCase();
772
+ new Label(headerGroup, centerX, headerY, "STACK_HEADER", labelText, this.styles, HookLocation.Bottom, HookLocation.Center).draw();
773
+ });
774
+ }
775
+ else {
776
+ // Single group: show individual segment headers
777
+ if (this.stackConfig.order === "asc")
778
+ segments.sort((a, b) => a.value - b.value);
779
+ else if (this.stackConfig.order === "desc")
780
+ segments.sort((a, b) => b.value - a.value);
781
+ const total = segments.reduce((sum, s) => sum + Math.abs(s.value), 0);
782
+ let cumulativePixels = 0;
783
+ segments.forEach((seg) => {
784
+ const pixelPerUnit = seg.dataPoint.pixelPerUnit;
785
+ let segmentLength;
786
+ if (this.stackConfig.mode === StackMode.RELATIVE) {
787
+ const proportion = total !== 0 ? Math.abs(seg.value) / total : 0;
788
+ segmentLength = proportion * pixelPerUnit;
789
+ }
790
+ else {
791
+ segmentLength = Math.abs(seg.value * pixelPerUnit);
792
+ }
793
+ const centerX = axisX + cumulativePixels + segmentLength / 2;
794
+ const labelText = this.i18n.get(seg.scenario) || seg.scenario;
795
+ new Label(headerGroup, centerX, headerY, "STACK_HEADER", labelText, this.styles, HookLocation.Bottom, HookLocation.Center).draw();
796
+ cumulativePixels += segmentLength;
797
+ });
798
+ }
799
+ }
800
+ getVarianceType() {
801
+ if (this.variancesDataModel.length > 0) {
802
+ return this.variancesDataModel[0].type;
803
+ }
804
+ return VarianceType.NONE;
805
+ }
806
+ calculateLeftSideWidth(varianceType) {
807
+ var _a, _b, _c;
808
+ let width = 0;
809
+ const labelToBar = this.styles.fontStyles.size * this.styles.scaleFactors.labelToBar;
810
+ if (VarianceType.NONE === varianceType &&
811
+ ((_a = this.smallestDataPointValue) === null || _a === void 0 ? void 0 : _a.value) != null &&
812
+ this.smallestDataPointValue.value < 0) {
813
+ const sizeLabelValue = this.calculateTextBoxWidth(this.smallestDataPointValue.value);
814
+ width = Math.abs(this.smallestDataPointValue.getScaledUnit()) + labelToBar + sizeLabelValue;
815
+ }
816
+ else if (VarianceType.RELATIVE === varianceType &&
817
+ ((_b = this.smallestVarianceDataPointValue) === null || _b === void 0 ? void 0 : _b.value) != null &&
818
+ this.smallestVarianceDataPointValue.value < 0) {
819
+ const sizeLabelValue = this.calculatePercentageTextBoxWidth(this.smallestVarianceDataPointValue.value);
820
+ width = Math.abs(this.smallestVarianceDataPointValue.getScaledPercentUnit()) + labelToBar + sizeLabelValue;
821
+ }
822
+ else if (VarianceType.ABSOLUTE === varianceType &&
823
+ ((_c = this.smallestVarianceDataPointValue) === null || _c === void 0 ? void 0 : _c.value) != null &&
824
+ this.smallestVarianceDataPointValue.value < 0) {
825
+ const sizeLabelValue = this.calculateTextBoxWidth(this.smallestVarianceDataPointValue.value);
826
+ width = Math.abs(this.smallestVarianceDataPointValue.getScaledUnit()) + labelToBar + sizeLabelValue;
827
+ }
828
+ if (width <= this.titleLength) {
829
+ return this.titleLength;
830
+ }
831
+ return width;
832
+ }
833
+ calculateRightSideWidth(varianceType) {
834
+ var _a, _b, _c;
835
+ let width = 0;
836
+ const labelToBar = this.styles.fontStyles.size * this.styles.scaleFactors.labelToBar;
837
+ if (VarianceType.NONE === varianceType &&
838
+ ((_a = this.highestDataPointValue) === null || _a === void 0 ? void 0 : _a.value) != null &&
839
+ this.highestDataPointValue.value >= 0) {
840
+ const sizeLabelValue = this.calculateTextBoxWidth(this.highestDataPointValue.value);
841
+ width = Math.abs(this.highestDataPointValue.getScaledUnit()) + labelToBar + sizeLabelValue;
842
+ }
843
+ else if (VarianceType.RELATIVE === varianceType &&
844
+ ((_b = this.highestVarianceDataPointValue) === null || _b === void 0 ? void 0 : _b.value) != null &&
845
+ this.highestVarianceDataPointValue.value >= 0) {
846
+ const sizeLabelValue = this.calculatePercentageTextBoxWidth(this.highestVarianceDataPointValue.value);
847
+ width = Math.abs(this.highestVarianceDataPointValue.getScaledPercentUnit()) + labelToBar + sizeLabelValue;
848
+ }
849
+ else if (VarianceType.ABSOLUTE === varianceType &&
850
+ ((_c = this.highestVarianceDataPointValue) === null || _c === void 0 ? void 0 : _c.value) != null &&
851
+ this.highestVarianceDataPointValue.value >= 0) {
852
+ const sizeLabelValue = this.calculateTextBoxWidth(this.highestVarianceDataPointValue.value);
853
+ width = Math.abs(this.highestVarianceDataPointValue.getScaledUnit()) + labelToBar + sizeLabelValue;
854
+ }
855
+ if (width <= this.titleLength) {
856
+ return this.titleLength;
857
+ }
858
+ return width;
859
+ }
860
+ /**
861
+ * For dimension stacking (by category, subcategory, or rowgroup), query the raw data
862
+ * at the stack dimension level and attach stackSegments to each dataModel row.
863
+ */
864
+ populateDimensionStackSegments(scenarios, stackConfig, level) {
865
+ var _a;
866
+ if (((_a = this.preparedDataSet) === null || _a === void 0 ? void 0 : _a.length) === 0 || scenarios.length === 0)
867
+ return;
868
+ // Map StackBy value to the actual data column name
869
+ const stackColumnMap = {
870
+ [StackBy.CATEGORY]: "category",
871
+ [StackBy.SUBCATEGORY]: "subCategory",
872
+ [StackBy.ROWGROUP]: "rowGroup",
873
+ };
874
+ const stackColumn = stackColumnMap[stackConfig.by];
875
+ if (!stackColumn)
876
+ return;
877
+ // The display level column (what each bar represents)
878
+ const displayColumn = level.toString(); // e.g. 'rowGroup', 'category', 'subCategory'
879
+ const scenario = scenarios[0]; // dimension stacking uses first scenario
880
+ const result = alasql(`SELECT [${displayColumn}] as displayGroup, [${stackColumn}] as stackLabel, ` +
881
+ `SUM([${scenario}] * transformOperator(operation)) as stackValue ` +
882
+ `FROM ? GROUP BY [${displayColumn}], [${stackColumn}]`, [this.preparedDataSet]);
883
+ // Group results by displayGroup
884
+ const groupMap = new Map();
885
+ for (const row of result) {
886
+ const key = row.displayGroup;
887
+ if (!groupMap.has(key))
888
+ groupMap.set(key, []);
889
+ if (row.stackValue != null && row.stackLabel != null) {
890
+ groupMap.get(key).push({ label: row.stackLabel, value: row.stackValue });
891
+ }
892
+ }
893
+ // Attach stackSegments to each dataModel row
894
+ for (const row of this.dataModel) {
895
+ const segments = groupMap.get(row.category);
896
+ if (segments && segments.length > 0) {
897
+ row.stackSegments = segments.map((seg) => ({
898
+ label: seg.label,
899
+ value: seg.value,
900
+ dataPoint: new DataPoint(seg.value, scenario, this.pixelPerUnit, Scenario.NEU),
901
+ }));
902
+ }
903
+ else {
904
+ row.stackSegments = [];
905
+ }
906
+ }
907
+ }
908
+ hasNoData() {
909
+ return this.dataModel.length === 0;
910
+ }
911
+ setAvailableWidth(availableWidth) {
912
+ if (this.pixelPerUnit <= 0 || availableWidth <= 0) {
913
+ this.overflowConfig = null;
914
+ return;
915
+ }
916
+ if (this.stackConfig != null) {
917
+ this.overflowConfig = null;
918
+ return;
919
+ }
920
+ this.overflowConfig = this.calculateOverflowConfig(availableWidth);
921
+ if (this.overflowConfig) {
922
+ const { cutWidth, overdriveZoneWidth, breakGap } = this.overflowConfig;
923
+ const virtualWidth = cutWidth + overdriveZoneWidth + breakGap;
924
+ const isVariance = this.variancesDataModel && this.variancesDataModel.length > 0;
925
+ if (isVariance) {
926
+ if (this.highestVarianceDataPointValue.getScaledUnit() > cutWidth) {
927
+ this.highestVarianceDataPointValue = new DataPoint(virtualWidth, this.highestVarianceDataPointValue.scenario, 1, this.highestVarianceDataPointValue.variance);
928
+ }
929
+ if (this.smallestVarianceDataPointValue.value != null &&
930
+ Math.abs(this.smallestVarianceDataPointValue.getScaledUnit()) > cutWidth) {
931
+ this.smallestVarianceDataPointValue = new DataPoint(-virtualWidth, this.smallestVarianceDataPointValue.scenario, 1, this.smallestVarianceDataPointValue.variance);
932
+ }
933
+ }
934
+ else {
935
+ if (this.highestDataPointValue.getScaledUnit() > cutWidth) {
936
+ this.highestDataPointValue = new DataPoint(virtualWidth, this.highestDataPointValue.scenario, 1, this.highestDataPointValue.variance);
937
+ }
938
+ if (this.smallestDataPointValue.value != null &&
939
+ Math.abs(this.smallestDataPointValue.getScaledUnit()) > cutWidth) {
940
+ this.smallestDataPointValue = new DataPoint(-virtualWidth, this.smallestDataPointValue.scenario, 1, this.smallestDataPointValue.variance);
941
+ }
942
+ }
943
+ this.updatePosition();
944
+ }
945
+ }
946
+ calculateOverflowConfig(availableWidth) {
947
+ const isVariance = this.variancesDataModel && this.variancesDataModel.length > 0;
948
+ const varianceType = this.getVarianceType();
949
+ // Don't apply to relative variance (Needle handles its own clipping at 145%)
950
+ if (varianceType === VarianceType.RELATIVE)
951
+ return null;
952
+ const highest = isVariance ? this.highestVarianceDataPointValue : this.highestDataPointValue;
953
+ const smallest = isVariance ? this.smallestVarianceDataPointValue : this.smallestDataPointValue;
954
+ const highestScaledUnit = highest.getScaledUnit();
955
+ const smallestAbsScaledUnit = smallest.value != null ? Math.abs(smallest.getScaledUnit()) : 0;
956
+ const maxAbsScaledUnit = Math.max(highestScaledUnit, smallestAbsScaledUnit);
957
+ if (maxAbsScaledUnit <= 0)
958
+ return null;
959
+ const fontSize = this.styles.fontStyles.size;
960
+ const labelToBar = fontSize * this.styles.scaleFactors.labelToBar;
961
+ // Available space on the right side of the axis
962
+ const axisX = this.position.getAxisPositionX();
963
+ // Match getAllocatedCanvasWidth() which adds padding.left + padding.right on top of axisX
964
+ const rightSideAvailable = availableWidth - axisX - this.styles.padding.left - this.styles.padding.right;
965
+ // Estimate the label width of the largest value
966
+ const maxLabelWidth = this.calculateTextBoxWidth(highest.value || 0);
967
+ const overdriveZoneWidth = fontSize * 1.5;
968
+ const breakGap = fontSize * 0.3;
969
+ const scenarioCutOffset = fontSize * 0.8;
970
+ const cutWidth = rightSideAvailable - labelToBar - maxLabelWidth - overdriveZoneWidth - breakGap;
971
+ if (cutWidth <= scenarioCutOffset)
972
+ return null;
973
+ const lowestCutWidth = cutWidth - scenarioCutOffset;
974
+ if (maxAbsScaledUnit <= lowestCutWidth)
975
+ return null;
976
+ const maxOverflow = maxAbsScaledUnit - lowestCutWidth;
977
+ return { cutWidth, overdriveZoneWidth, breakGap, maxOverflow, scenarioCutOffset };
978
+ }
979
+ }