@bino-bi/bn-template-engine 1.0.0-next.26 → 1.0.0-next.28

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 (420) hide show
  1. package/dist/bn-template-engine/bn-template-engine.esm.js +1 -1
  2. package/dist/bn-template-engine/p-5075771a.entry.js +1 -0
  3. package/dist/bn-template-engine/p-5d516435.entry.js +1 -0
  4. package/dist/bn-template-engine/p-5e90e728.entry.js +1 -0
  5. package/dist/bn-template-engine/p-9ef7e132.entry.js +1 -0
  6. package/dist/bn-template-engine/{p-f06c3703.entry.js → p-9f7a1980.entry.js} +1 -1
  7. package/dist/bn-template-engine/p-BeXgxHkW.js +1 -0
  8. package/dist/bn-template-engine/p-CH0bpt_k.js +1 -0
  9. package/dist/bn-template-engine/p-ClruFZD_.js +1 -0
  10. package/dist/bn-template-engine/{p-CTrNbSXN.js → p-DFmSrSnf.js} +1 -1
  11. package/dist/bn-template-engine/{p-BcLsoDrW.js → p-DI3efDSV.js} +1 -1
  12. package/dist/bn-template-engine/p-DXLTTILG.js +1 -0
  13. package/dist/bn-template-engine/p-DtP4jqG5.js +1 -0
  14. package/dist/bn-template-engine/p-a8281b71.entry.js +1 -0
  15. package/dist/bn-template-engine/p-b31277e7.entry.js +1 -0
  16. package/dist/bn-template-engine/p-b396ac84.entry.js +1 -0
  17. package/dist/cjs/{bn-asset_21.cjs.entry.js → bn-asset_28.cjs.entry.js} +21358 -6528
  18. package/dist/cjs/bn-grid.cjs.entry.js +4 -6
  19. package/dist/cjs/bn-image.cjs.entry.js +3 -5
  20. package/dist/cjs/bn-internationalization.cjs.entry.js +17 -6
  21. package/dist/cjs/bn-ruleset.cjs.entry.js +5 -5
  22. package/dist/cjs/bn-template-engine.cjs.js +1 -1
  23. package/dist/cjs/bn-template.cjs.entry.js +2 -2
  24. package/dist/cjs/bn-text.cjs.entry.js +115 -43
  25. package/dist/cjs/{context-protocol-DcTEh1rq.js → context-protocol-C0rKepqu.js} +108 -22
  26. package/dist/cjs/{diagnostics-CTgbq_Gc.js → diagnostics-Cq-qDtXq.js} +1 -1
  27. package/dist/cjs/editor-companion.cjs.entry.js +2 -2
  28. package/dist/cjs/loader.cjs.js +1 -1
  29. package/dist/cjs/queryError-BZjnIW_w.js +16 -0
  30. package/dist/cjs/{scaling-Dsb5_NXy.js → sanitizeHtml-Yx1xn6i_.js} +467 -287
  31. package/dist/cjs/{withBodyObserver-DJO98AJ-.js → withBodyObserver-CaPUjuC5.js} +1 -1
  32. package/dist/cjs/withHasError-qGW_yqIv.js +426 -0
  33. package/dist/cjs/{withStyled-D0jLwCib.js → withStyled-vSfogp9J.js} +543 -42
  34. package/dist/collection/components/bn-chart-bubble/bn-chart-bubble.css +37 -0
  35. package/dist/collection/components/bn-chart-bubble/bn-chart-bubble.js +53 -28
  36. package/dist/collection/components/bn-chart-bubble/ibcs-chart-bubble.css +37 -5
  37. package/dist/collection/components/bn-chart-bubble/ibcs-chart-bubble.js +16 -7
  38. package/dist/collection/components/bn-chart-bubble/utils/BubbleChart.js +67 -30
  39. package/dist/collection/components/bn-chart-bullet/bn-chart-bullet.css +37 -0
  40. package/dist/collection/components/bn-chart-bullet/bn-chart-bullet.js +49 -29
  41. package/dist/collection/components/bn-chart-bullet/ibcs-chart-bullet.css +37 -5
  42. package/dist/collection/components/bn-chart-bullet/ibcs-chart-bullet.js +17 -7
  43. package/dist/collection/components/bn-chart-bullet/utils/BulletChart.js +34 -18
  44. package/dist/collection/components/bn-chart-bullet/utils/model/BulletChartStyle.js +2 -0
  45. package/dist/collection/components/bn-chart-bullet/utils/model/BulletConfig.js +1 -1
  46. package/dist/collection/components/bn-chart-scatter/bn-chart-scatter.css +37 -0
  47. package/dist/collection/components/bn-chart-scatter/bn-chart-scatter.js +52 -27
  48. package/dist/collection/components/bn-chart-scatter/ibcs-chart-scatter.css +37 -5
  49. package/dist/collection/components/bn-chart-scatter/ibcs-chart-scatter.js +16 -7
  50. package/dist/collection/components/bn-chart-scatter/utils/ScatterChart.js +52 -18
  51. package/dist/collection/components/bn-chart-structure/bn-chart-structure.css +37 -5
  52. package/dist/collection/components/bn-chart-structure/bn-chart-structure.js +74 -44
  53. package/dist/collection/components/bn-chart-structure/ibcs-chart-structure.js +60 -19
  54. package/dist/collection/components/bn-chart-structure/utils/StructureChart.js +218 -262
  55. package/dist/collection/components/bn-chart-structure/utils/elements/Label.js +1 -1
  56. package/dist/collection/components/bn-chart-structure/utils/elements/Needle.js +11 -4
  57. package/dist/collection/components/bn-chart-structure/utils/elements/StackedBar.js +16 -25
  58. package/dist/collection/components/bn-chart-structure/utils/model/StructureChartComponentConfig.js +3 -2
  59. package/dist/collection/components/bn-chart-structure/utils/model/styles/StructureChartStyle.js +2 -0
  60. package/dist/collection/components/bn-chart-time/bn-chart-time.css +37 -0
  61. package/dist/collection/components/bn-chart-time/bn-chart-time.js +122 -52
  62. package/dist/collection/components/bn-chart-time/ibcs-chart-time.css +37 -0
  63. package/dist/collection/components/bn-chart-time/ibcs-chart-time.js +60 -19
  64. package/dist/collection/components/bn-chart-time/utils/TimeChart.js +245 -250
  65. package/dist/collection/components/bn-chart-time/utils/elements/AreaFill.js +1 -1
  66. package/dist/collection/components/bn-chart-time/utils/elements/Label.js +1 -1
  67. package/dist/collection/components/bn-chart-time/utils/elements/LineSeries.js +1 -1
  68. package/dist/collection/components/bn-chart-time/utils/elements/Needle.js +11 -4
  69. package/dist/collection/components/bn-chart-time/utils/elements/StackedColumn.js +22 -34
  70. package/dist/collection/components/bn-chart-time/utils/helper/LabelCollisionManager.js +3 -3
  71. package/dist/collection/components/bn-chart-time/utils/model/TimeChartComponentConfig.js +4 -3
  72. package/dist/collection/components/bn-chart-time/utils/model/TimeChartDataRow.js +2 -2
  73. package/dist/collection/components/bn-chart-time/utils/model/styles/TimeChartStyle.js +2 -0
  74. package/dist/collection/components/bn-component-style/bn-component-style.js +14 -2
  75. package/dist/collection/components/bn-context/bn-context.js +92 -22
  76. package/dist/collection/components/bn-dataset/bn-dataset.js +246 -90
  77. package/dist/collection/components/bn-datasource/bn-datasource.js +169 -77
  78. package/dist/collection/components/bn-footer/bn-footer.js +6 -6
  79. package/dist/collection/components/bn-internationalization/bn-internationalization.js +14 -3
  80. package/dist/collection/components/bn-layout-card/bn-layout-card.js +25 -74
  81. package/dist/collection/components/bn-layout-page/bn-layout-page.js +59 -71
  82. package/dist/collection/components/bn-message/bn-message.js +2 -2
  83. package/dist/collection/components/bn-page/bn-page.css +0 -240
  84. package/dist/collection/components/bn-page/bn-page.js +14 -4
  85. package/dist/collection/components/bn-page/pageFormats.js +69 -0
  86. package/dist/collection/components/bn-ruleset/bn-ruleset.js +2 -2
  87. package/dist/collection/components/bn-scaling-group/bn-scaling-group.js +7 -7
  88. package/dist/collection/components/bn-table/bn-table.css +38 -1
  89. package/dist/collection/components/bn-table/bn-table.js +96 -59
  90. package/dist/collection/components/bn-table/ibcs-table.css +39 -1
  91. package/dist/collection/components/bn-table/ibcs-table.js +89 -30
  92. package/dist/collection/components/bn-table/utils/Table.js +12 -13
  93. package/dist/collection/components/bn-table/utils/elements/Cell.js +9 -3
  94. package/dist/collection/components/bn-table/utils/elements/CellBarChart.js +38 -34
  95. package/dist/collection/components/bn-table/utils/elements/TableRow.js +2 -1
  96. package/dist/collection/components/bn-table/utils/elements/WaterfallBar.js +4 -4
  97. package/dist/collection/components/bn-table/utils/factories/tableDataSetFactory.js +17 -4
  98. package/dist/collection/components/bn-table/utils/helper/DataQuery.js +128 -98
  99. package/dist/collection/components/bn-table/utils/helper/IntervalColumns.js +6 -20
  100. package/dist/collection/components/bn-table/utils/helper/QueryGroup.js +9 -2
  101. package/dist/collection/components/bn-table/utils/helper/barColumnGeometry.js +2 -2
  102. package/dist/collection/components/bn-table/utils/model/TableAttribute.js +2 -2
  103. package/dist/collection/components/bn-table/utils/model/TableComponentConfig.js +3 -2
  104. package/dist/collection/components/bn-template/bn-template.js +1 -1
  105. package/dist/collection/components/bn-text/bn-text.js +36 -39
  106. package/dist/collection/components/bn-text/utils/template.js +79 -0
  107. package/dist/collection/components/bn-title/bn-title.js +10 -4
  108. package/dist/collection/components/bn-title/ibcs-title/ibcs-title.js +3 -1
  109. package/dist/collection/components/bn-tree/bn-tree.js +119 -23
  110. package/dist/collection/components/bn-tree/utils/EdgeRenderer.js +59 -51
  111. package/dist/collection/components/bn-tree/utils/TreeLayout.js +30 -5
  112. package/dist/collection/components/bn-tree/utils/TreeParser.js +35 -0
  113. package/dist/collection/components/editor-companion/editor-companion.js +1 -1
  114. package/dist/collection/context/context-protocol.js +1 -1
  115. package/dist/collection/context/scopedDb.js +47 -4
  116. package/dist/collection/stores/componentStyles.js +39 -0
  117. package/dist/collection/stores/internationalization.js +15 -13
  118. package/dist/collection/utils/DateStringFactory.js +17 -15
  119. package/dist/collection/utils/autoFit.js +2 -2
  120. package/dist/collection/utils/componentRegister.js +60 -16
  121. package/dist/collection/utils/constants.js +2 -2
  122. package/dist/collection/utils/dataAnalyzer.js +9 -12
  123. package/dist/collection/utils/emptyState.js +21 -0
  124. package/dist/collection/utils/formatter.js +29 -20
  125. package/dist/collection/utils/layoutObserver.js +1 -1
  126. package/dist/collection/utils/layoutState/generic.js +1 -1
  127. package/dist/collection/utils/layoutState/svgChartElements.js +2 -2
  128. package/dist/collection/utils/layoutTemplate.js +81 -0
  129. package/dist/collection/utils/measurementHost.js +2 -2
  130. package/dist/collection/utils/model/Order.js +1 -1
  131. package/dist/collection/utils/model/styles/SVGStyle.js +12 -4
  132. package/dist/collection/utils/parentDimensions.js +35 -3
  133. package/dist/collection/utils/queryError.js +11 -0
  134. package/dist/collection/utils/relativeVariance.js +14 -0
  135. package/dist/collection/utils/sanitizeHtml.js +30 -16
  136. package/dist/collection/utils/scaling.js +2 -2
  137. package/dist/collection/utils/stackColors.js +27 -5
  138. package/dist/collection/utils/stackLayout.js +71 -0
  139. package/dist/collection/utils/styled/attributes.js +16 -3
  140. package/dist/collection/utils/styled/style-sheet.js +1 -1
  141. package/dist/collection/utils/styled/withStyled.js +1 -1
  142. package/dist/collection/utils/testing/fakeGroup.js +21 -0
  143. package/dist/collection/utils/testing/mutationObserver.js +44 -0
  144. package/dist/collection/utils/testing/structureChart.js +26 -0
  145. package/dist/collection/utils/testing/timeChart.js +28 -0
  146. package/dist/collection/utils/validate.js +1 -1
  147. package/dist/collection/utils/withComponentStatus.js +137 -12
  148. package/dist/collection/utils/withInheritedProps.js +113 -64
  149. package/dist/collection/utils/withRuleSet.js +10 -7
  150. package/dist/collection/utils/withTranslation.js +3 -3
  151. package/dist/collection/utils/xy/FacetGrid.js +1 -1
  152. package/dist/collection/utils/xy/IsoCurves.js +1 -1
  153. package/dist/collection/utils/xy/NumericScale.js +46 -15
  154. package/dist/collection/utils/xy/PointLabeler.js +2 -2
  155. package/dist/collection/utils/xy/RadiusScale.js +2 -2
  156. package/dist/collection/utils/xy/SeriesPalette.js +3 -3
  157. package/dist/collection/utils/xy/VarianceMeasure.js +22 -4
  158. package/dist/collection/utils/xy/XYFrame.js +4 -4
  159. package/dist/collection/utils/xy/XYLegend.js +5 -7
  160. package/dist/collection/utils/xy/checkXYOverflow.js +32 -0
  161. package/dist/collection/utils/xy/formatXYValue.js +13 -0
  162. package/dist/collection/utils/xy/model/XYChartDataRow.js +0 -0
  163. package/dist/collection/utils/xy/model/XYChartStyle.js +2 -0
  164. package/dist/components/DataFormatDigits.js +1 -1
  165. package/dist/components/DateStringFactory.js +1 -1
  166. package/dist/components/LabelCollisionManager.js +1 -1
  167. package/dist/components/NumericScale.js +1 -1
  168. package/dist/components/Order.js +1 -1
  169. package/dist/components/SVGStyle.js +1 -0
  170. package/dist/components/TableAttribute.js +1 -0
  171. package/dist/components/VarianceMeasure.js +1 -1
  172. package/dist/components/XYChartDataRow.js +1 -1
  173. package/dist/components/bn-asset.js +1 -1
  174. package/dist/components/bn-body2.js +1 -1
  175. package/dist/components/bn-card2.js +1 -1
  176. package/dist/components/bn-chart-bubble.js +1 -1
  177. package/dist/components/bn-chart-bullet.js +1 -1
  178. package/dist/components/bn-chart-scatter.js +1 -1
  179. package/dist/components/bn-chart-structure.js +1 -1
  180. package/dist/components/bn-chart-time.js +1 -1
  181. package/dist/components/bn-component-style.js +1 -1
  182. package/dist/components/bn-context.js +1 -1
  183. package/dist/components/bn-dataset.js +1 -1
  184. package/dist/components/bn-datasource.js +1 -1
  185. package/dist/components/bn-footer2.js +1 -1
  186. package/dist/components/bn-grid.js +1 -1
  187. package/dist/components/bn-image.js +1 -1
  188. package/dist/components/bn-internationalization.js +1 -1
  189. package/dist/components/bn-layout-card.js +1 -1
  190. package/dist/components/bn-layout-page.js +1 -1
  191. package/dist/components/bn-message2.js +1 -1
  192. package/dist/components/bn-page2.js +1 -1
  193. package/dist/components/bn-ruleset.js +1 -1
  194. package/dist/components/bn-scaling-group.js +1 -1
  195. package/dist/components/bn-table.js +1 -1
  196. package/dist/components/bn-template.js +1 -1
  197. package/dist/components/bn-text.js +1 -1
  198. package/dist/components/bn-title2.js +1 -1
  199. package/dist/components/bn-tree.js +1 -1
  200. package/dist/components/checkXYOverflow.js +1 -0
  201. package/dist/components/context-protocol.js +1 -1
  202. package/dist/components/editor-companion.js +1 -1
  203. package/dist/components/emptyState.js +1 -0
  204. package/dist/components/formatter.js +1 -1
  205. package/dist/components/ibcs-chart-bubble2.js +1 -1
  206. package/dist/components/ibcs-chart-bullet2.js +1 -1
  207. package/dist/components/ibcs-chart-scatter2.js +1 -1
  208. package/dist/components/ibcs-chart-structure2.js +1 -1
  209. package/dist/components/ibcs-chart-time2.js +1 -1
  210. package/dist/components/ibcs-table2.js +1 -1
  211. package/dist/components/ibcs-title2.js +1 -1
  212. package/dist/components/layoutTemplate.js +1 -0
  213. package/dist/components/pageFormats.js +1 -0
  214. package/dist/components/parentDimensions.js +1 -0
  215. package/dist/components/queryError.js +1 -0
  216. package/dist/components/relativeVariance.js +1 -0
  217. package/dist/components/sanitizeHtml.js +1 -1
  218. package/dist/components/stackColors.js +1 -1
  219. package/dist/components/stackLayout.js +1 -0
  220. package/dist/components/svg.esm.js +1 -0
  221. package/dist/components/validate.js +1 -1
  222. package/dist/components/withBodyObserver.js +1 -1
  223. package/dist/components/withComponentStatus.js +1 -0
  224. package/dist/components/withComponentStyle.js +1 -1
  225. package/dist/components/withDataset.js +1 -1
  226. package/dist/components/withHasError.js +1 -1
  227. package/dist/components/withRuleSet.js +1 -1
  228. package/dist/components/withScalingGroup.js +1 -1
  229. package/dist/components/withStyled.js +1 -1
  230. package/dist/components/withTranslation.js +1 -1
  231. package/dist/esm/{bn-asset_21.entry.js → bn-asset_28.entry.js} +20948 -6125
  232. package/dist/esm/bn-grid.entry.js +4 -6
  233. package/dist/esm/bn-image.entry.js +3 -5
  234. package/dist/esm/bn-internationalization.entry.js +17 -6
  235. package/dist/esm/bn-ruleset.entry.js +5 -5
  236. package/dist/esm/bn-template-engine.js +1 -1
  237. package/dist/esm/bn-template.entry.js +2 -2
  238. package/dist/esm/bn-text.entry.js +111 -39
  239. package/dist/esm/{context-protocol-B-vdGKeG.js → context-protocol-CdTp19uA.js} +106 -22
  240. package/dist/esm/{diagnostics-CiquIw8B.js → diagnostics-vw6TKMiT.js} +1 -1
  241. package/dist/esm/editor-companion.entry.js +2 -2
  242. package/dist/esm/loader.js +1 -1
  243. package/dist/esm/queryError-ClruFZD_.js +13 -0
  244. package/dist/esm/{scaling-Dggyeqts.js → sanitizeHtml-C5bFtARM.js} +464 -287
  245. package/dist/esm/{withBodyObserver-Cb9ZC5_J.js → withBodyObserver-DD_-r04o.js} +1 -1
  246. package/dist/esm/withHasError-73WV2SP5.js +422 -0
  247. package/dist/esm/{withStyled-DoNsbwS3.js → withStyled-BDEyKd_H.js} +513 -27
  248. package/dist/types/components/bn-chart-bubble/bn-chart-bubble.d.ts +8 -4
  249. package/dist/types/components/bn-chart-bubble/ibcs-chart-bubble.d.ts +2 -1
  250. package/dist/types/components/bn-chart-bubble/utils/BubbleChart.d.ts +14 -2
  251. package/dist/types/components/bn-chart-bullet/bn-chart-bullet.d.ts +12 -11
  252. package/dist/types/components/bn-chart-bullet/ibcs-chart-bullet.d.ts +2 -1
  253. package/dist/types/components/bn-chart-bullet/utils/BulletChart.d.ts +8 -5
  254. package/dist/types/components/bn-chart-bullet/utils/model/BulletChartStyle.d.ts +2 -0
  255. package/dist/types/components/bn-chart-bullet/utils/model/BulletConfig.d.ts +1 -1
  256. package/dist/types/components/bn-chart-scatter/bn-chart-scatter.d.ts +8 -4
  257. package/dist/types/components/bn-chart-scatter/ibcs-chart-scatter.d.ts +2 -1
  258. package/dist/types/components/bn-chart-scatter/utils/ScatterChart.d.ts +11 -1
  259. package/dist/types/components/bn-chart-structure/bn-chart-structure.d.ts +13 -12
  260. package/dist/types/components/bn-chart-structure/ibcs-chart-structure.d.ts +8 -1
  261. package/dist/types/components/bn-chart-structure/utils/StructureChart.d.ts +29 -6
  262. package/dist/types/components/bn-chart-structure/utils/elements/StackedBar.d.ts +4 -3
  263. package/dist/types/components/bn-chart-structure/utils/model/DataPoint.d.ts +3 -2
  264. package/dist/types/components/bn-chart-structure/utils/model/StructureChartComponentConfig.d.ts +2 -1
  265. package/dist/types/components/bn-chart-structure/utils/model/styles/StructureChartStyle.d.ts +2 -0
  266. package/dist/types/components/bn-chart-time/bn-chart-time.d.ts +19 -15
  267. package/dist/types/components/bn-chart-time/ibcs-chart-time.d.ts +8 -1
  268. package/dist/types/components/bn-chart-time/utils/TimeChart.d.ts +63 -5
  269. package/dist/types/components/bn-chart-time/utils/elements/AreaFill.d.ts +1 -1
  270. package/dist/types/components/bn-chart-time/utils/elements/StackedColumn.d.ts +9 -8
  271. package/dist/types/components/bn-chart-time/utils/model/DataPoint.d.ts +3 -2
  272. package/dist/types/components/bn-chart-time/utils/model/TimeChartComponentConfig.d.ts +3 -2
  273. package/dist/types/components/bn-chart-time/utils/model/styles/TimeChartStyle.d.ts +2 -0
  274. package/dist/types/components/bn-context/bn-context.d.ts +15 -3
  275. package/dist/types/components/bn-dataset/bn-dataset.d.ts +41 -20
  276. package/dist/types/components/bn-datasource/bn-datasource.d.ts +34 -18
  277. package/dist/types/components/bn-footer/bn-footer.d.ts +2 -2
  278. package/dist/types/components/bn-layout-card/bn-layout-card.d.ts +3 -10
  279. package/dist/types/components/bn-layout-page/bn-layout-page.d.ts +13 -6
  280. package/dist/types/components/bn-message/bn-message.d.ts +2 -1
  281. package/dist/types/components/bn-page/bn-page.d.ts +2 -1
  282. package/dist/types/components/bn-page/pageFormats.d.ts +40 -0
  283. package/dist/types/components/bn-scaling-group/bn-scaling-group.d.ts +2 -2
  284. package/dist/types/components/bn-table/bn-table.d.ts +11 -10
  285. package/dist/types/components/bn-table/ibcs-table.d.ts +8 -5
  286. package/dist/types/components/bn-table/utils/Table.d.ts +3 -1
  287. package/dist/types/components/bn-table/utils/elements/Cell.d.ts +2 -2
  288. package/dist/types/components/bn-table/utils/elements/CellBarChart.d.ts +6 -4
  289. package/dist/types/components/bn-table/utils/elements/WaterfallBar.d.ts +1 -1
  290. package/dist/types/components/bn-table/utils/factories/tableDataSetFactory.d.ts +2 -0
  291. package/dist/types/components/bn-table/utils/helper/DataQuery.d.ts +14 -5
  292. package/dist/types/components/bn-table/utils/helper/IntervalColumns.d.ts +2 -2
  293. package/dist/types/components/bn-table/utils/helper/QueryGroup.d.ts +6 -1
  294. package/dist/types/components/bn-table/utils/helper/barColumnGeometry.d.ts +2 -2
  295. package/dist/types/components/bn-table/utils/model/TableAttribute.d.ts +2 -0
  296. package/dist/types/components/bn-table/utils/model/TableComponentConfig.d.ts +2 -1
  297. package/dist/types/components/bn-text/bn-text.d.ts +20 -13
  298. package/dist/types/components/bn-text/utils/template.d.ts +10 -0
  299. package/dist/types/components/bn-title/ibcs-title/ibcs-title.d.ts +1 -0
  300. package/dist/types/components/bn-tree/bn-tree.d.ts +8 -1
  301. package/dist/types/components/bn-tree/utils/EdgeRenderer.d.ts +18 -5
  302. package/dist/types/components/bn-tree/utils/TreeLayout.d.ts +5 -0
  303. package/dist/types/components.d.ts +226 -184
  304. package/dist/types/context/scopedDb.d.ts +20 -0
  305. package/dist/types/stores/componentStyles.d.ts +6 -0
  306. package/dist/types/utils/DateStringFactory.d.ts +3 -2
  307. package/dist/types/utils/autoFit.d.ts +2 -2
  308. package/dist/types/utils/componentRegister.d.ts +21 -5
  309. package/dist/types/utils/constants.d.ts +2 -2
  310. package/dist/types/utils/dataAnalyzer.d.ts +1 -1
  311. package/dist/types/utils/emptyState.d.ts +10 -0
  312. package/dist/types/utils/formatter.d.ts +7 -9
  313. package/dist/types/utils/layoutState/generic.d.ts +1 -1
  314. package/dist/types/utils/layoutState/svgChartElements.d.ts +2 -2
  315. package/dist/types/utils/layoutTemplate.d.ts +16 -0
  316. package/dist/types/utils/model/ChartStyles.d.ts +1 -1
  317. package/dist/types/utils/model/DataQueryResultRow.d.ts +2 -2
  318. package/dist/types/utils/model/Order.d.ts +1 -1
  319. package/dist/types/utils/model/styles/SVGStyle.d.ts +5 -1
  320. package/dist/types/utils/parentDimensions.d.ts +9 -0
  321. package/dist/types/utils/queryError.d.ts +5 -0
  322. package/dist/types/utils/relativeVariance.d.ts +9 -0
  323. package/dist/types/utils/sanitizeHtml.d.ts +2 -2
  324. package/dist/types/utils/scaling.d.ts +1 -1
  325. package/dist/types/utils/stackColors.d.ts +3 -2
  326. package/dist/types/utils/stackLayout.d.ts +49 -0
  327. package/dist/types/utils/testing/fakeGroup.d.ts +8 -0
  328. package/dist/types/utils/testing/mutationObserver.d.ts +5 -0
  329. package/dist/types/utils/testing/structureChart.d.ts +5 -0
  330. package/dist/types/utils/testing/timeChart.d.ts +5 -0
  331. package/dist/types/utils/validate.d.ts +1 -1
  332. package/dist/types/utils/withComponentStatus.d.ts +11 -3
  333. package/dist/types/utils/withInheritedProps.d.ts +42 -15
  334. package/dist/types/utils/withRuleSet.d.ts +2 -1
  335. package/dist/types/utils/withTranslation.d.ts +2 -2
  336. package/dist/types/utils/xy/FacetGrid.d.ts +1 -1
  337. package/dist/types/utils/xy/IsoCurves.d.ts +1 -1
  338. package/dist/types/utils/xy/NumericScale.d.ts +9 -4
  339. package/dist/types/utils/xy/PointLabeler.d.ts +2 -2
  340. package/dist/types/utils/xy/RadiusScale.d.ts +2 -2
  341. package/dist/types/utils/xy/SeriesPalette.d.ts +3 -3
  342. package/dist/types/utils/xy/VarianceMeasure.d.ts +10 -2
  343. package/dist/types/utils/xy/XYFrame.d.ts +4 -1
  344. package/dist/types/utils/xy/XYLegend.d.ts +3 -1
  345. package/dist/types/utils/xy/checkXYOverflow.d.ts +8 -0
  346. package/dist/types/utils/xy/formatXYValue.d.ts +7 -0
  347. package/dist/types/utils/xy/model/AxisConfig.d.ts +1 -1
  348. package/dist/types/utils/xy/model/XYChartStyle.d.ts +2 -0
  349. package/package.json +4 -2
  350. package/readme.md +11 -11
  351. package/dist/bn-template-engine/p-03304284.entry.js +0 -1
  352. package/dist/bn-template-engine/p-0fb02c57.entry.js +0 -1
  353. package/dist/bn-template-engine/p-4419db8f.entry.js +0 -1
  354. package/dist/bn-template-engine/p-45508f1b.entry.js +0 -1
  355. package/dist/bn-template-engine/p-461fdffa.entry.js +0 -1
  356. package/dist/bn-template-engine/p-5d7a3a77.entry.js +0 -1
  357. package/dist/bn-template-engine/p-62cc95b7.entry.js +0 -1
  358. package/dist/bn-template-engine/p-686d8e44.entry.js +0 -1
  359. package/dist/bn-template-engine/p-829212c3.entry.js +0 -1
  360. package/dist/bn-template-engine/p-B5Jd_eCX.js +0 -1
  361. package/dist/bn-template-engine/p-BA48JiHe.js +0 -1
  362. package/dist/bn-template-engine/p-BbmobTg0.js +0 -1
  363. package/dist/bn-template-engine/p-BcaI745G.js +0 -1
  364. package/dist/bn-template-engine/p-CG_Bcm6V.js +0 -1
  365. package/dist/bn-template-engine/p-CWWWM-XC.js +0 -1
  366. package/dist/bn-template-engine/p-CsJ84YRk.js +0 -1
  367. package/dist/bn-template-engine/p-D5e8I9Qe.js +0 -1
  368. package/dist/bn-template-engine/p-DVrDYxlh.js +0 -1
  369. package/dist/bn-template-engine/p-DjPXefnq.js +0 -1
  370. package/dist/bn-template-engine/p-DsTzlzxQ.js +0 -1
  371. package/dist/bn-template-engine/p-DtLI_CzV.js +0 -1
  372. package/dist/bn-template-engine/p-EtT29btN.js +0 -1
  373. package/dist/bn-template-engine/p-TuLpbB5O.js +0 -1
  374. package/dist/bn-template-engine/p-a5867a4c.entry.js +0 -1
  375. package/dist/bn-template-engine/p-b27009eb.entry.js +0 -1
  376. package/dist/bn-template-engine/p-bfa87b07.entry.js +0 -1
  377. package/dist/bn-template-engine/p-ceb80db3.entry.js +0 -1
  378. package/dist/bn-template-engine/p-fcfbb329.entry.js +0 -1
  379. package/dist/bn-template-engine/p-qRZrT-U3.js +0 -1
  380. package/dist/cjs/AxisConfig-DwiNUyYG.js +0 -233
  381. package/dist/cjs/LabelCollisionManager-Bv-xkeXw.js +0 -415
  382. package/dist/cjs/NumericScale-BAyYXpKL.js +0 -107
  383. package/dist/cjs/Order-2wRydarc.js +0 -87
  384. package/dist/cjs/SVGStyle-DoxylrEQ.js +0 -8219
  385. package/dist/cjs/SVGVariancesStyleGroup-CiI4GeWe.js +0 -50
  386. package/dist/cjs/VarianceMeasure-CQlSRzlp.js +0 -372
  387. package/dist/cjs/XYChartDataRow-C2FdL58s.js +0 -829
  388. package/dist/cjs/bn-chart-bubble.cjs.entry.js +0 -792
  389. package/dist/cjs/bn-chart-bullet.cjs.entry.js +0 -805
  390. package/dist/cjs/bn-chart-scatter.cjs.entry.js +0 -678
  391. package/dist/cjs/bn-tree.cjs.entry.js +0 -1042
  392. package/dist/cjs/ibcs-chart-bubble.cjs.entry.js +0 -624
  393. package/dist/cjs/ibcs-chart-bullet.cjs.entry.js +0 -673
  394. package/dist/cjs/ibcs-chart-scatter.cjs.entry.js +0 -667
  395. package/dist/cjs/sanitizeHtml-LuZr1IMd.js +0 -85
  396. package/dist/cjs/svgChartElements-tDA43aYj.js +0 -400
  397. package/dist/cjs/withHasError-BdDmiOXM.js +0 -258
  398. package/dist/cjs/withScalingGroup-CFIc5-6s.js +0 -73
  399. package/dist/components/autoFit.js +0 -1
  400. package/dist/components/main.js +0 -1
  401. package/dist/components/utils.js +0 -1
  402. package/dist/esm/AxisConfig-KqzWQbML.js +0 -224
  403. package/dist/esm/LabelCollisionManager-585bQMtP.js +0 -407
  404. package/dist/esm/NumericScale-DsTzlzxQ.js +0 -105
  405. package/dist/esm/Order-DZVWjEL_.js +0 -83
  406. package/dist/esm/SVGStyle-OrPkzjcb.js +0 -8209
  407. package/dist/esm/SVGVariancesStyleGroup-DO5QJfRQ.js +0 -48
  408. package/dist/esm/VarianceMeasure-DDjChp8C.js +0 -364
  409. package/dist/esm/XYChartDataRow-Dn83Tqh9.js +0 -820
  410. package/dist/esm/bn-chart-bubble.entry.js +0 -790
  411. package/dist/esm/bn-chart-bullet.entry.js +0 -803
  412. package/dist/esm/bn-chart-scatter.entry.js +0 -676
  413. package/dist/esm/bn-tree.entry.js +0 -1040
  414. package/dist/esm/ibcs-chart-bubble.entry.js +0 -622
  415. package/dist/esm/ibcs-chart-bullet.entry.js +0 -671
  416. package/dist/esm/ibcs-chart-scatter.entry.js +0 -665
  417. package/dist/esm/sanitizeHtml-BA48JiHe.js +0 -83
  418. package/dist/esm/svgChartElements-B3YClivG.js +0 -395
  419. package/dist/esm/withHasError-Bh1Viz52.js +0 -254
  420. package/dist/esm/withScalingGroup-DNBSqRC0.js +0 -71
@@ -1,829 +0,0 @@
1
- 'use strict';
2
-
3
- var VarianceMeasure = require('./VarianceMeasure-CQlSRzlp.js');
4
- var contextProtocol = require('./context-protocol-DcTEh1rq.js');
5
- var LabelCollisionManager = require('./LabelCollisionManager-Bv-xkeXw.js');
6
- var SVGStyle = require('./SVGStyle-DoxylrEQ.js');
7
-
8
- /**
9
- * Aggregates all style configuration for an XY chart (scatter/bubble):
10
- * scale factors, fonts, axis styles, the series color palette, and padding.
11
- *
12
- * The analog of {@link TimeChartStyle} with `seriesColors` in place of
13
- * `stackColors` and no variance styles (variance measures position points,
14
- * they don't color them).
15
- */
16
- class XYChartStyle {
17
- constructor(scaleFactors, fontStyles, axisStyles, padding) {
18
- this.scaleFactors = scaleFactors;
19
- this.fontStyles = fontStyles;
20
- this.axisStyles = axisStyles;
21
- this.padding = padding;
22
- this.seriesColors = [...contextProtocol.XY_SERIES_PALETTE];
23
- }
24
- }
25
- /** Adapts raw componentStyle JSON into an XYChartStyle, falling back to defaults for missing properties. */
26
- class XYChartStylesAdapter {
27
- constructor(scaleFactorsXYChartAdapter, fontStyleAdapter, svgStyleGroupAdapter, paddingAdapter) {
28
- this.scaleFactorsXYChartAdapter = scaleFactorsXYChartAdapter;
29
- this.fontStyleAdapter = fontStyleAdapter;
30
- this.svgStyleGroupAdapter = svgStyleGroupAdapter;
31
- this.paddingAdapter = paddingAdapter;
32
- }
33
- adapt(data) {
34
- const styles = this.default();
35
- if (VarianceMeasure.CompareUtil.isExisting(data)) {
36
- if (VarianceMeasure.CompareUtil.isExisting(data.scaleFactors)) {
37
- styles.scaleFactors = this.scaleFactorsXYChartAdapter.adapt(data.scaleFactors);
38
- }
39
- if (VarianceMeasure.CompareUtil.isExisting(data.fontStyles)) {
40
- styles.fontStyles = this.fontStyleAdapter.adapt(data.fontStyles);
41
- }
42
- if (VarianceMeasure.CompareUtil.isExisting(data.axisStyles)) {
43
- styles.axisStyles = this.svgStyleGroupAdapter.adapt(data.axisStyles);
44
- }
45
- if (VarianceMeasure.CompareUtil.isExisting(data.padding)) {
46
- styles.padding = this.paddingAdapter.adapt(data.padding);
47
- }
48
- if (Array.isArray(data.seriesColors) && data.seriesColors.length > 0) {
49
- styles.seriesColors = data.seriesColors;
50
- }
51
- }
52
- return styles;
53
- }
54
- default() {
55
- return new XYChartStyle(this.scaleFactorsXYChartAdapter.default(), this.fontStyleAdapter.default(), this.svgStyleGroupAdapter.default(), this.paddingAdapter.default());
56
- }
57
- }
58
-
59
- /**
60
- * Proportional scale factors for XY chart elements (scatter and bubble).
61
- *
62
- * All values except the `*LineWidth` entries are expressed in **font-size
63
- * multiples** (em-like units), so the chart scales uniformly when the base
64
- * font size changes. The chart renderer multiplies each factor by the
65
- * computed font size to get pixel dimensions. Line widths are absolute
66
- * pixel values (hairlines must not scale with the font).
67
- */
68
- class ScaleFactorsXYChart {
69
- constructor() {
70
- /** Radius of a scatter point. */
71
- this.pointRadius = 0.4;
72
- /** Maximum bubble radius in local (vMax-normalized) sizing mode. */
73
- this.bubbleMaxRadius = 3.2;
74
- /** Minimum visible bubble radius in local sizing mode. */
75
- this.bubbleMinRadius = 0.35;
76
- /** Length of axis tick marks. */
77
- this.axisTickLength = 0.35;
78
- /** Gap between a mark (dot/bubble) and its name label. */
79
- this.labelToMark = 0.3;
80
- /** Diameter of a legend color swatch. */
81
- this.legendSwatch = 0.9;
82
- /** Gap between facet panels. */
83
- this.panelGap = 1.6;
84
- /** Stroke width of reference lines, in pixels. */
85
- this.refLineWidth = 1;
86
- /** Stroke width of gridlines and the plot frame, in pixels. */
87
- this.gridLineWidth = 1;
88
- }
89
- }
90
- /** Converts untyped JSON into a validated {@link ScaleFactorsXYChart}. */
91
- class ScaleFactorsXYChartAdapter {
92
- adapt(data) {
93
- const scaleFactors = new ScaleFactorsXYChart();
94
- if (VarianceMeasure.CompareUtil.isNumber(data.pointRadius)) {
95
- scaleFactors.pointRadius = data.pointRadius;
96
- }
97
- if (VarianceMeasure.CompareUtil.isNumber(data.bubbleMaxRadius)) {
98
- scaleFactors.bubbleMaxRadius = data.bubbleMaxRadius;
99
- }
100
- if (VarianceMeasure.CompareUtil.isNumber(data.bubbleMinRadius)) {
101
- scaleFactors.bubbleMinRadius = data.bubbleMinRadius;
102
- }
103
- if (VarianceMeasure.CompareUtil.isNumber(data.axisTickLength)) {
104
- scaleFactors.axisTickLength = data.axisTickLength;
105
- }
106
- if (VarianceMeasure.CompareUtil.isNumber(data.labelToMark)) {
107
- scaleFactors.labelToMark = data.labelToMark;
108
- }
109
- if (VarianceMeasure.CompareUtil.isNumber(data.legendSwatch)) {
110
- scaleFactors.legendSwatch = data.legendSwatch;
111
- }
112
- if (VarianceMeasure.CompareUtil.isNumber(data.panelGap)) {
113
- scaleFactors.panelGap = data.panelGap;
114
- }
115
- if (VarianceMeasure.CompareUtil.isNumber(data.refLineWidth)) {
116
- scaleFactors.refLineWidth = data.refLineWidth;
117
- }
118
- if (VarianceMeasure.CompareUtil.isNumber(data.gridLineWidth)) {
119
- scaleFactors.gridLineWidth = data.gridLineWidth;
120
- }
121
- return scaleFactors;
122
- }
123
- default() {
124
- return new ScaleFactorsXYChart();
125
- }
126
- }
127
-
128
- /**
129
- * Small-multiple panel layout: divides a drawing area into equal panels,
130
- * wrapping row-major at `columns`. Axis tick labels render on the outer
131
- * edges only (IBCS 10F/10G style) — the `isOuterLeft`/`isOuterBottom`
132
- * flags tell the renderer which panels carry them.
133
- */
134
- class FacetGrid {
135
- constructor(count, columns, drawingRect, panelGapPx) {
136
- this.count = count;
137
- this.drawingRect = drawingRect;
138
- this.panelGapPx = panelGapPx;
139
- this.columns = Math.max(1, Math.min(columns !== null && columns !== void 0 ? columns : count, count));
140
- this.rows = Math.max(1, Math.ceil(count / this.columns));
141
- }
142
- /** Rectangle of the i-th panel (row-major order). */
143
- panelRect(index) {
144
- const col = index % this.columns;
145
- const row = Math.floor(index / this.columns);
146
- const width = (this.drawingRect.width - (this.columns - 1) * this.panelGapPx) / this.columns;
147
- const height = (this.drawingRect.height - (this.rows - 1) * this.panelGapPx) / this.rows;
148
- return {
149
- x: this.drawingRect.x + col * (width + this.panelGapPx),
150
- y: this.drawingRect.y + row * (height + this.panelGapPx),
151
- width,
152
- height,
153
- };
154
- }
155
- /** True when the panel sits in the leftmost column (carries y tick labels). */
156
- isOuterLeft(index) {
157
- return index % this.columns === 0;
158
- }
159
- /** True when no panel renders below this one (carries x tick labels). */
160
- isOuterBottom(index) {
161
- return index + this.columns >= this.count;
162
- }
163
- }
164
-
165
- const ANCHORS = ["n", "ne", "e", "se", "s", "sw", "w", "nw"];
166
- const DIAGONAL = Math.SQRT1_2;
167
- /**
168
- * Selective point labeling with greedy collision-free placement for the XY
169
- * charts. Composes the existing {@link LabelCollisionManager} (AABB
170
- * register/hasCollision core); marks are pre-registered as bounding
171
- * squares — conservative for circles, acceptable for label proximity.
172
- *
173
- * Placement tries eight anchors clockwise from north and rejects positions
174
- * that leave the frame or collide with marks or other labels; unplaceable
175
- * labels are dropped (IBCS wants proximate labels — no leader lines).
176
- */
177
- class PointLabeler {
178
- constructor(frame, gapPx, manager = new LabelCollisionManager.LabelCollisionManager()) {
179
- this.frame = frame;
180
- this.gapPx = gapPx;
181
- this.manager = manager;
182
- }
183
- /** Registers a mark so labels avoid it (bounding-square approximation). */
184
- registerMark(cx, cy, r) {
185
- this.manager.register(this.bounds(cx - r, cy - r, 2 * r, 2 * r));
186
- }
187
- /**
188
- * Selects which points receive labels. `items` must be pre-ranked for
189
- * `"auto"` mode (extremity for scatter, size descending for bubble).
190
- */
191
- selectCandidates(items, mode, max, nameOf) {
192
- if (mode === "none") {
193
- return { selected: [], unknownNames: [] };
194
- }
195
- if (mode === "all") {
196
- return { selected: [...items], unknownNames: [] };
197
- }
198
- if (mode === "auto") {
199
- return { selected: items.slice(0, max), unknownNames: [] };
200
- }
201
- const wanted = new Set(mode);
202
- const selected = items.filter((item) => wanted.has(nameOf(item)));
203
- const found = new Set(selected.map((item) => nameOf(item)));
204
- const unknownNames = mode.filter((name) => !found.has(name));
205
- return { selected, unknownNames };
206
- }
207
- /** Greedy placement in candidate order; returns only the labels that fit. */
208
- place(candidates) {
209
- const placed = [];
210
- for (const candidate of candidates) {
211
- for (const anchor of ANCHORS) {
212
- const box = this.anchorBox(candidate, anchor);
213
- if (!this.insideFrame(box.x, box.y, candidate.width, candidate.height)) {
214
- continue;
215
- }
216
- const bounds = this.bounds(box.x, box.y, candidate.width, candidate.height);
217
- if (this.manager.hasCollision(bounds)) {
218
- continue;
219
- }
220
- this.manager.register(bounds);
221
- placed.push({ candidate, x: box.x, y: box.y, anchor });
222
- break;
223
- }
224
- }
225
- return placed;
226
- }
227
- anchorBox(c, anchor) {
228
- const offset = c.r + this.gapPx;
229
- const diagonal = c.r * DIAGONAL + this.gapPx * 0.5;
230
- switch (anchor) {
231
- case "n":
232
- return { x: c.cx - c.width / 2, y: c.cy - offset - c.height };
233
- case "ne":
234
- return { x: c.cx + diagonal, y: c.cy - diagonal - c.height };
235
- case "e":
236
- return { x: c.cx + offset, y: c.cy - c.height / 2 };
237
- case "se":
238
- return { x: c.cx + diagonal, y: c.cy + diagonal };
239
- case "s":
240
- return { x: c.cx - c.width / 2, y: c.cy + offset };
241
- case "sw":
242
- return { x: c.cx - diagonal - c.width, y: c.cy + diagonal };
243
- case "w":
244
- return { x: c.cx - offset - c.width, y: c.cy - c.height / 2 };
245
- case "nw":
246
- return { x: c.cx - diagonal - c.width, y: c.cy - diagonal - c.height };
247
- }
248
- }
249
- insideFrame(x, y, width, height) {
250
- return (x >= this.frame.x &&
251
- y >= this.frame.y &&
252
- x + width <= this.frame.x + this.frame.width &&
253
- y + height <= this.frame.y + this.frame.height);
254
- }
255
- bounds(x, y, width, height) {
256
- return { x, y, width, height, pointIndex: 0, preferredHook: LabelCollisionManager.HookLocation.Center };
257
- }
258
- }
259
-
260
- /**
261
- * Per-panel plot frame for the XY charts: highlight bands, gridlines,
262
- * reference lines, the frame rectangle, tick labels, and the panel title.
263
- *
264
- * Style roles are taken from the `axisStyles` scenario group:
265
- * `ac` = frame + tick labels, `pp` = gridlines, `fc` = reference lines
266
- * and iso-curves, `pl` = highlight band fill.
267
- */
268
- class XYFrame {
269
- constructor(xScale, yScale, rect, styles) {
270
- this.xScale = xScale;
271
- this.yScale = yScale;
272
- this.rect = rect;
273
- this.styles = styles;
274
- }
275
- get em() {
276
- return this.styles.fontStyles.size;
277
- }
278
- fontFamily() {
279
- return this.styles.fontStyles.font.replace(/^[\d.]+px\s*/, "");
280
- }
281
- /** Shaded bands behind everything; open ends run to the domain edge. */
282
- drawBands(group, xHighlight, yHighlight) {
283
- var _a, _b, _c, _d;
284
- const fill = this.styles.axisStyles.pl.fill;
285
- if (xHighlight !== undefined && (xHighlight.from !== undefined || xHighlight.to !== undefined)) {
286
- const from = this.xScale.scale((_a = xHighlight.from) !== null && _a !== void 0 ? _a : this.xScale.domainMin);
287
- const to = this.xScale.scale((_b = xHighlight.to) !== null && _b !== void 0 ? _b : this.xScale.domainMax);
288
- group
289
- .rect(Math.abs(to - from), this.rect.height)
290
- .move(Math.min(from, to), this.rect.y)
291
- .fill(fill);
292
- }
293
- if (yHighlight !== undefined && (yHighlight.from !== undefined || yHighlight.to !== undefined)) {
294
- const from = this.yScale.scale((_c = yHighlight.from) !== null && _c !== void 0 ? _c : this.yScale.domainMin);
295
- const to = this.yScale.scale((_d = yHighlight.to) !== null && _d !== void 0 ? _d : this.yScale.domainMax);
296
- group
297
- .rect(this.rect.width, Math.abs(from - to))
298
- .move(this.rect.x, Math.min(from, to))
299
- .fill(fill);
300
- }
301
- }
302
- /** Horizontal gridlines at the y ticks; vertical ones only when `ticksX` is given. */
303
- drawGrid(group, ticksY, ticksX) {
304
- const stroke = { color: this.styles.axisStyles.pp.stroke, width: this.styles.scaleFactors.gridLineWidth };
305
- for (const tick of ticksY) {
306
- const y = this.yScale.scale(tick);
307
- group.line(this.rect.x, y, this.rect.x + this.rect.width, y).stroke(stroke);
308
- }
309
- if (ticksX !== undefined) {
310
- for (const tick of ticksX) {
311
- const x = this.xScale.scale(tick);
312
- group.line(x, this.rect.y, x, this.rect.y + this.rect.height).stroke(stroke);
313
- }
314
- }
315
- }
316
- /** Thin reference lines at the given axis values (10A quadrant crosshair). */
317
- drawRefLines(group, xRef, yRef) {
318
- const stroke = { color: this.styles.axisStyles.fc.stroke, width: this.styles.scaleFactors.refLineWidth };
319
- if (xRef !== undefined) {
320
- const x = this.xScale.scale(xRef);
321
- group.line(x, this.rect.y, x, this.rect.y + this.rect.height).stroke(stroke);
322
- }
323
- if (yRef !== undefined) {
324
- const y = this.yScale.scale(yRef);
325
- group.line(this.rect.x, y, this.rect.x + this.rect.width, y).stroke(stroke);
326
- }
327
- }
328
- /** The four-sided thin plot frame (as in the IBCS template images). */
329
- drawFrame(group) {
330
- group
331
- .rect(this.rect.width, this.rect.height)
332
- .move(this.rect.x, this.rect.y)
333
- .fill("none")
334
- .stroke({ color: this.styles.axisStyles.ac.stroke, width: this.styles.scaleFactors.gridLineWidth });
335
- }
336
- /** Tick labels along the outer edges (no tick marks — template style). */
337
- drawTickLabels(group, config) {
338
- const gap = this.styles.scaleFactors.axisTickLength * this.em;
339
- const font = { size: this.styles.fontStyles.size, anchor: "start" };
340
- const family = this.fontFamily();
341
- const color = this.styles.fontStyles.color;
342
- if (config.showXLabels) {
343
- for (const tick of config.ticksX) {
344
- const x = this.xScale.scale(tick);
345
- group
346
- .text(SVGStyle.Formatter.number(tick, "decimal", config.xDecimals, config.xDecimals))
347
- .font(Object.assign(Object.assign({}, font), { anchor: "middle" }))
348
- .fill(color)
349
- .attr({ x, y: this.rect.y + this.rect.height + gap + this.em * 0.8, "font-family": family });
350
- }
351
- }
352
- if (config.showYLabels) {
353
- for (const tick of config.ticksY) {
354
- const y = this.yScale.scale(tick);
355
- group
356
- .text(SVGStyle.Formatter.number(tick, "decimal", config.yDecimals, config.yDecimals))
357
- .font(Object.assign(Object.assign({}, font), { anchor: "end" }))
358
- .fill(color)
359
- .attr({ x: this.rect.x - gap, y: y + this.em * 0.35, "font-family": family });
360
- }
361
- }
362
- }
363
- /** Facet panel title, top-left inside the panel, bold (10F "Europe"/"RoW"). */
364
- drawPanelTitle(group, title) {
365
- if (title === "") {
366
- return;
367
- }
368
- group
369
- .text(title)
370
- .font({ size: this.styles.fontStyles.size, weight: "bold", anchor: "start" })
371
- .fill(this.styles.fontStyles.color)
372
- .attr({
373
- x: this.rect.x + 0.5 * this.em,
374
- y: this.rect.y + 1.2 * this.em,
375
- "font-family": this.fontFamily(),
376
- });
377
- }
378
- }
379
-
380
- /**
381
- * Series-color legend + bubble-size caption for the XY charts
382
- * (IBCS requires a legend explaining colors — and, for bubbles, size).
383
- * Positioned by the orchestrator: right column (default) or bottom row.
384
- */
385
- class XYLegend {
386
- constructor(styles) {
387
- this.styles = styles;
388
- }
389
- get em() {
390
- return this.styles.fontStyles.size;
391
- }
392
- get rowHeight() {
393
- return this.em * 1.5;
394
- }
395
- get swatchSize() {
396
- return this.styles.scaleFactors.legendSwatch * this.em;
397
- }
398
- textWidth(text, bold = false) {
399
- const width = SVGStyle.CalculateSize(text, {
400
- font: this.styles.fontStyles.font,
401
- fontSize: this.styles.fontStyles.size + "px",
402
- fontWeight: bold ? "bold" : "normal",
403
- }).width;
404
- // calculate-size needs a live DOM; fall back to an estimate in test environments.
405
- return Number.isFinite(width) && width > 0 ? width : text.length * 0.6 * this.em;
406
- }
407
- rows(model) {
408
- const rows = [];
409
- model.sizeCaption.forEach((line, index) => {
410
- rows.push({ text: line, bold: index === 0, treatment: null });
411
- });
412
- if (model.title !== null && model.title !== "") {
413
- rows.push({ text: model.title, bold: true, treatment: null });
414
- }
415
- for (const entry of model.compareEntries) {
416
- rows.push({ text: entry.label, bold: false, treatment: entry.treatment });
417
- }
418
- for (const entry of model.entries) {
419
- rows.push({ text: entry.label, bold: false, treatment: entry.treatment });
420
- }
421
- return rows;
422
- }
423
- /** Footprint of the legend for layout reservation. */
424
- measure(model, position) {
425
- const rows = this.rows(model);
426
- if (rows.length === 0) {
427
- return { width: 0, height: 0 };
428
- }
429
- const swatchSpan = this.swatchSize + 0.4 * this.em;
430
- if (position === "bottom") {
431
- let width = 0;
432
- for (const row of rows) {
433
- width += (row.treatment !== null ? swatchSpan : 0) + this.textWidth(row.text, row.bold) + 1.5 * this.em;
434
- }
435
- return { width, height: this.rowHeight };
436
- }
437
- let width = 0;
438
- for (const row of rows) {
439
- width = Math.max(width, (row.treatment !== null ? swatchSpan : 0) + this.textWidth(row.text, row.bold));
440
- }
441
- return { width, height: rows.length * this.rowHeight };
442
- }
443
- /** Draws the legend with its top-left corner at `x`/`y`. */
444
- draw(group, model, x, y, position) {
445
- const rows = this.rows(model);
446
- const swatchSpan = this.swatchSize + 0.4 * this.em;
447
- let cursorX = x;
448
- let cursorY = y;
449
- for (const row of rows) {
450
- let textX = cursorX;
451
- if (row.treatment !== null) {
452
- const swatch = group
453
- .circle(this.swatchSize)
454
- .move(cursorX, cursorY + (this.rowHeight - this.swatchSize) / 2)
455
- .fill(row.treatment.hatch ? "#ffffff" : row.treatment.fill)
456
- .stroke({
457
- color: row.treatment.stroke === "#ffffff" ? row.treatment.fill : row.treatment.stroke,
458
- width: row.treatment.strokeWidth,
459
- });
460
- if (row.treatment.dasharray !== undefined) {
461
- swatch.attr("stroke-dasharray", row.treatment.dasharray);
462
- }
463
- textX += swatchSpan;
464
- }
465
- group
466
- .text(row.text)
467
- .font({
468
- size: this.styles.fontStyles.size,
469
- weight: row.bold ? "bold" : "normal",
470
- anchor: "start",
471
- })
472
- .fill(this.styles.fontStyles.color)
473
- .attr({ x: textX, y: cursorY + this.rowHeight / 2 + this.em * 0.35, "font-family": this.fontFamily() });
474
- if (position === "bottom") {
475
- cursorX = textX + this.textWidth(row.text, row.bold) + 1.5 * this.em;
476
- }
477
- else {
478
- cursorY += this.rowHeight;
479
- }
480
- }
481
- }
482
- fontFamily() {
483
- return this.styles.fontStyles.font.replace(/^[\d.]+px\s*/, "");
484
- }
485
- }
486
-
487
- /**
488
- * IBCS-compliant data row for XY (scatter/bubble) chart visualizations.
489
- *
490
- * Same schema as {@link StructureChartDataRow}: the full dimension hierarchy
491
- * plus the 16 scenario value slots. `date` is parsed but unused (reserved),
492
- * there are no `setName` semantics. `_`-prefixed passthrough columns are
493
- * retained on the row (engine convention) but unused by v1 rendering;
494
- * `<slot>_cnt` columns feed the variance no-data rule.
495
- */
496
- class XYChartDataRow {
497
- constructor() {
498
- this.operation = "+";
499
- /** `_`-prefixed passthrough columns, retained but unused by v1 rendering. */
500
- this.custom = {};
501
- /** `<slot>_cnt` columns: non-null value counts used by the variance no-data rule. */
502
- this.counts = {};
503
- }
504
- /** Value of a scenario slot, `null`-normalized. */
505
- slotValue(slot) {
506
- const value = this[slot];
507
- return VarianceMeasure.CompareUtil.isNumber(value) ? value : null;
508
- }
509
- /** True when the slot's `_cnt` column reports zero non-null source values. */
510
- slotHasNoData(slot) {
511
- return this.counts[slot] === 0;
512
- }
513
- }
514
- const SCENARIO_SLOTS = [
515
- "ac1",
516
- "ac2",
517
- "ac3",
518
- "ac4",
519
- "pp1",
520
- "pp2",
521
- "pp3",
522
- "pp4",
523
- "fc1",
524
- "fc2",
525
- "fc3",
526
- "fc4",
527
- "pl1",
528
- "pl2",
529
- "pl3",
530
- "pl4",
531
- ];
532
- /**
533
- * Converts untyped JSON records into validated {@link XYChartDataRow}
534
- * instances. Only assigns fields that pass {@link CompareUtil} type guards,
535
- * so malformed input data is silently dropped and defaults are preserved.
536
- */
537
- class XYChartDataRowAdapter {
538
- adapt(data) {
539
- const row = new XYChartDataRow();
540
- if (VarianceMeasure.CompareUtil.isOperator(data.operation)) {
541
- row.operation = data.operation;
542
- }
543
- if (VarianceMeasure.CompareUtil.isString(data.date)) {
544
- const parsed = contextProtocol.DateTime.fromISO(data.date);
545
- row.date = parsed.isValid ? parsed : undefined;
546
- }
547
- if (VarianceMeasure.CompareUtil.isString(data.rowGroup) && VarianceMeasure.CompareUtil.isNumber(data.rowGroupIndex)) {
548
- row.rowGroup = data.rowGroup;
549
- row.rowGroupIndex = data.rowGroupIndex;
550
- }
551
- if (VarianceMeasure.CompareUtil.isString(data.category) && VarianceMeasure.CompareUtil.isNumber(data.categoryIndex)) {
552
- row.category = data.category;
553
- row.categoryIndex = data.categoryIndex;
554
- }
555
- if (VarianceMeasure.CompareUtil.isString(data.subCategory) && VarianceMeasure.CompareUtil.isNumber(data.subCategoryIndex)) {
556
- row.subCategory = data.subCategory;
557
- row.subCategoryIndex = data.subCategoryIndex;
558
- }
559
- if (VarianceMeasure.CompareUtil.isString(data.columnGroup) && VarianceMeasure.CompareUtil.isNumber(data.columnGroupIndex)) {
560
- row.columnGroup = data.columnGroup;
561
- row.columnGroupIndex = data.columnGroupIndex;
562
- }
563
- if (VarianceMeasure.CompareUtil.isString(data.columnSubGroup) && VarianceMeasure.CompareUtil.isNumber(data.columnSubGroupIndex)) {
564
- row.columnSubGroup = data.columnSubGroup;
565
- row.columnSubGroupIndex = data.columnSubGroupIndex;
566
- }
567
- for (const slot of SCENARIO_SLOTS) {
568
- if (VarianceMeasure.CompareUtil.isNumber(data[slot])) {
569
- row[slot] = data[slot];
570
- }
571
- const cnt = data[`${slot}_cnt`];
572
- if (VarianceMeasure.CompareUtil.isNumber(cnt)) {
573
- row.counts[slot] = cnt;
574
- }
575
- }
576
- for (const key of Object.keys(data)) {
577
- if (key.startsWith("_")) {
578
- row.custom[key] = data[key];
579
- }
580
- }
581
- return row;
582
- }
583
- default() {
584
- return new XYChartDataRow();
585
- }
586
- }
587
- /** Points above this budget raise the `xy-point-budget` warning (spec §10). */
588
- const XY_POINT_BUDGET = 5000;
589
- const INDEX_FIELD = {
590
- rowGroup: "rowGroupIndex",
591
- category: "categoryIndex",
592
- subCategory: "subCategoryIndex",
593
- };
594
- function evaluateMeasure(row, ref) {
595
- if (ref.kind === "scenario") {
596
- return { value: row.slotValue(ref.slot), varianceNoData: false };
597
- }
598
- if (row.slotHasNoData(ref.measure.base) || row.slotHasNoData(ref.measure.delta)) {
599
- return { value: null, varianceNoData: true };
600
- }
601
- const value = ref.measure.compute(row.slotValue(ref.measure.base), row.slotValue(ref.measure.delta));
602
- return { value, varianceNoData: value === null };
603
- }
604
- function outsideDomain(value, domain) {
605
- if (domain === undefined) {
606
- return false;
607
- }
608
- if (domain.min !== undefined && value < domain.min) {
609
- return true;
610
- }
611
- if (domain.max !== undefined && value > domain.max) {
612
- return true;
613
- }
614
- return false;
615
- }
616
- function compareSlot(ref, family) {
617
- if (ref.kind !== "scenario") {
618
- return null;
619
- }
620
- return family + VarianceMeasure.scenarioSlotNumber(ref.slot);
621
- }
622
- /**
623
- * Resolves adapted rows into facets, series, and renderable points —
624
- * the shared data pipeline of both XY orchestrators.
625
- *
626
- * One row = one point. Duplicate identities (same facet + point name) keep
627
- * the first row (deterministic) and raise `xy-duplicate-point`. There is no
628
- * implicit aggregation — axes are frequently ratios where SUM is wrong; the
629
- * DataSet SQL is the aggregation surface.
630
- */
631
- function resolveXYData(rows, opts) {
632
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
633
- const warnings = [];
634
- const seenKeys = new Set();
635
- const duplicateNames = [];
636
- let duplicateCount = 0;
637
- let varianceNoDataCount = 0;
638
- let clippedCount = 0;
639
- let sizeNegativeCount = 0;
640
- let shareClampCount = 0;
641
- const facetOrder = new Map();
642
- const seriesOrder = new Map();
643
- const facetPoints = new Map();
644
- const compareFamily = (_a = opts.compareFamily) !== null && _a !== void 0 ? _a : null;
645
- const compareX = compareFamily !== null ? compareSlot(opts.measures.x, compareFamily) : null;
646
- const compareY = compareFamily !== null ? compareSlot(opts.measures.y, compareFamily) : null;
647
- const compareSize = compareFamily !== null && opts.measures.size !== undefined ? compareSlot(opts.measures.size, compareFamily) : null;
648
- for (const row of rows) {
649
- const name = row[opts.pointLevel];
650
- if (name == null || name === "") {
651
- continue;
652
- }
653
- const facetKey = (_b = (opts.facetLevel !== null ? row[opts.facetLevel] : "")) !== null && _b !== void 0 ? _b : "";
654
- const seriesKey = (_c = (opts.seriesLevel !== null ? row[opts.seriesLevel] : "")) !== null && _c !== void 0 ? _c : "";
655
- const identity = `${facetKey}${name}`;
656
- if (seenKeys.has(identity)) {
657
- duplicateCount++;
658
- if (duplicateNames.length < 5 && !duplicateNames.includes(name)) {
659
- duplicateNames.push(name);
660
- }
661
- continue;
662
- }
663
- const xEval = evaluateMeasure(row, opts.measures.x);
664
- const yEval = evaluateMeasure(row, opts.measures.y);
665
- if (xEval.value === null || yEval.value === null) {
666
- if (xEval.varianceNoData || yEval.varianceNoData) {
667
- varianceNoDataCount++;
668
- }
669
- continue;
670
- }
671
- if (outsideDomain(xEval.value, (_d = opts.domains) === null || _d === void 0 ? void 0 : _d.x) || outsideDomain(yEval.value, (_e = opts.domains) === null || _e === void 0 ? void 0 : _e.y)) {
672
- clippedCount++;
673
- continue;
674
- }
675
- const point = {
676
- name,
677
- seriesKey,
678
- facetKey,
679
- x: xEval.value,
680
- y: yEval.value,
681
- row,
682
- };
683
- if (opts.measures.size !== undefined) {
684
- const sizeValue = evaluateMeasure(row, opts.measures.size).value;
685
- if (sizeValue === null) {
686
- continue;
687
- }
688
- if (sizeValue < 0) {
689
- sizeNegativeCount++;
690
- continue;
691
- }
692
- point.size = sizeValue;
693
- }
694
- if (opts.measures.share !== undefined) {
695
- const shareValue = evaluateMeasure(row, opts.measures.share).value;
696
- if (shareValue !== null) {
697
- if (shareValue < 0 || shareValue > 1) {
698
- shareClampCount++;
699
- point.share = Math.min(1, Math.max(0, shareValue));
700
- }
701
- else {
702
- point.share = shareValue;
703
- }
704
- }
705
- }
706
- if (compareX !== null && compareY !== null) {
707
- const cx = row.slotValue(compareX);
708
- const cy = row.slotValue(compareY);
709
- const cSize = compareSize !== null ? row.slotValue(compareSize) : null;
710
- const sizeMissing = compareSize !== null && cSize === null;
711
- if (cx !== null && cy !== null && !sizeMissing) {
712
- if (outsideDomain(cx, (_f = opts.domains) === null || _f === void 0 ? void 0 : _f.x) || outsideDomain(cy, (_g = opts.domains) === null || _g === void 0 ? void 0 : _g.y)) {
713
- clippedCount++;
714
- point.compare = null;
715
- }
716
- else {
717
- point.compare = { x: cx, y: cy };
718
- if (cSize !== null) {
719
- point.compare.size = cSize;
720
- }
721
- }
722
- }
723
- else {
724
- point.compare = null;
725
- }
726
- }
727
- seenKeys.add(identity);
728
- if (!facetPoints.has(facetKey)) {
729
- facetPoints.set(facetKey, []);
730
- }
731
- facetPoints.get(facetKey).push(point);
732
- if (opts.facetLevel !== null) {
733
- const facetIndex = row[INDEX_FIELD[opts.facetLevel]];
734
- if (facetIndex != null && facetIndex < ((_h = facetOrder.get(facetKey)) !== null && _h !== void 0 ? _h : Number.POSITIVE_INFINITY)) {
735
- facetOrder.set(facetKey, facetIndex);
736
- }
737
- }
738
- if (opts.seriesLevel !== null) {
739
- const seriesIndex = row[INDEX_FIELD[opts.seriesLevel]];
740
- if (seriesIndex != null && seriesIndex < ((_j = seriesOrder.get(seriesKey)) !== null && _j !== void 0 ? _j : Number.POSITIVE_INFINITY)) {
741
- seriesOrder.set(seriesKey, seriesIndex);
742
- }
743
- }
744
- }
745
- const facetKeys = [...facetPoints.keys()].sort((a, b) => { var _a, _b; return ((_a = facetOrder.get(a)) !== null && _a !== void 0 ? _a : Number.MAX_SAFE_INTEGER) - ((_b = facetOrder.get(b)) !== null && _b !== void 0 ? _b : Number.MAX_SAFE_INTEGER); });
746
- const facets = facetKeys.map((key) => {
747
- let points = facetPoints.get(key);
748
- if (opts.limit > 0 && points.length > opts.limit) {
749
- if (opts.limitBy === "size") {
750
- points = [...points].sort((a, b) => { var _a, _b; return ((_a = b.size) !== null && _a !== void 0 ? _a : 0) - ((_b = a.size) !== null && _b !== void 0 ? _b : 0); }).slice(0, opts.limit);
751
- }
752
- else {
753
- points = points.slice(0, opts.limit);
754
- }
755
- }
756
- return { key, points };
757
- });
758
- const seriesKeys = new Set();
759
- for (const facet of facets) {
760
- for (const point of facet.points) {
761
- seriesKeys.add(point.seriesKey);
762
- }
763
- }
764
- const series = [...seriesKeys]
765
- .sort((a, b) => { var _a, _b; return ((_a = seriesOrder.get(a)) !== null && _a !== void 0 ? _a : Number.MAX_SAFE_INTEGER) - ((_b = seriesOrder.get(b)) !== null && _b !== void 0 ? _b : Number.MAX_SAFE_INTEGER); })
766
- .map((key, index) => ({ key, index }));
767
- let extents = null;
768
- let totalPoints = 0;
769
- for (const facet of facets) {
770
- for (const point of facet.points) {
771
- totalPoints++;
772
- const xs = [point.x];
773
- const ys = [point.y];
774
- const sizes = point.size !== undefined ? [point.size] : [];
775
- if (point.compare != null) {
776
- xs.push(point.compare.x);
777
- ys.push(point.compare.y);
778
- if (point.compare.size !== undefined) {
779
- sizes.push(point.compare.size);
780
- }
781
- }
782
- if (extents === null) {
783
- extents = { xMin: xs[0], xMax: xs[0], yMin: ys[0], yMax: ys[0], sizeMax: 0 };
784
- }
785
- for (const x of xs) {
786
- extents.xMin = Math.min(extents.xMin, x);
787
- extents.xMax = Math.max(extents.xMax, x);
788
- }
789
- for (const y of ys) {
790
- extents.yMin = Math.min(extents.yMin, y);
791
- extents.yMax = Math.max(extents.yMax, y);
792
- }
793
- for (const size of sizes) {
794
- extents.sizeMax = Math.max(extents.sizeMax, size);
795
- }
796
- }
797
- }
798
- if (duplicateCount > 0) {
799
- warnings.push({
800
- code: "xy-duplicate-point",
801
- data: { count: String(duplicateCount), names: duplicateNames.join(", ") },
802
- });
803
- }
804
- if (varianceNoDataCount > 0) {
805
- warnings.push({ code: "xy-variance-nodata", data: { count: String(varianceNoDataCount) } });
806
- }
807
- if (clippedCount > 0) {
808
- warnings.push({ code: "xy-point-clipped", data: { count: String(clippedCount) } });
809
- }
810
- if (sizeNegativeCount > 0) {
811
- warnings.push({ code: "bubble-size-negative", data: { count: String(sizeNegativeCount) } });
812
- }
813
- if (shareClampCount > 0) {
814
- warnings.push({ code: "bubble-share-range", data: { count: String(shareClampCount) } });
815
- }
816
- if (totalPoints > XY_POINT_BUDGET) {
817
- warnings.push({ code: "xy-point-budget", data: { count: String(totalPoints) } });
818
- }
819
- return { facets, series, extents, warnings, totalPoints };
820
- }
821
-
822
- exports.FacetGrid = FacetGrid;
823
- exports.PointLabeler = PointLabeler;
824
- exports.ScaleFactorsXYChartAdapter = ScaleFactorsXYChartAdapter;
825
- exports.XYChartDataRowAdapter = XYChartDataRowAdapter;
826
- exports.XYChartStylesAdapter = XYChartStylesAdapter;
827
- exports.XYFrame = XYFrame;
828
- exports.XYLegend = XYLegend;
829
- exports.resolveXYData = resolveXYData;