@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
@@ -2,7 +2,7 @@
2
2
  * Linear numeric scale with nice-tick generation for the XY charts.
3
3
  *
4
4
  * Domains default to the data extent padded 4% on each side; zero-inclusion
5
- * is NOT forced — points encode by position, not length, so IBCS's
5
+ * is NOT forced - points encode by position, not length, so IBCS's
6
6
  * zero-baseline rule for bars does not apply. Explicit `min`/`max`
7
7
  * overrides disable the padding on that side.
8
8
  */
@@ -30,12 +30,17 @@ export declare class NumericScale {
30
30
  static niceStep(span: number, targetCount: number): number;
31
31
  /**
32
32
  * Nice tick values inside the domain, aiming for `targetCount` ticks
33
- * (the renderer picks 4–8 depending on panel size).
33
+ * (the renderer picks 4-8 depending on panel size).
34
34
  */
35
35
  ticks(targetCount: number): number[];
36
36
  /**
37
- * Decimal places (0–2) needed to render the given ticks without
38
- * ambiguity between adjacent values.
37
+ * Decimal places needed to print multiples of `step` without rounding two of them
38
+ * to the same text: 0.025 needs 3, 2.5 needs 1, 10 needs 0.
39
+ */
40
+ static stepDecimals(step: number): number;
41
+ /**
42
+ * Decimal places needed to render the given ticks without ambiguity between
43
+ * adjacent values: the decimals of their distance, for one tick those of its value.
39
44
  */
40
45
  static tickDecimals(ticks: number[]): number;
41
46
  }
@@ -32,11 +32,11 @@ export interface LabelSelection<T> {
32
32
  * Selective point labeling with greedy collision-free placement for the XY
33
33
  * charts. Composes the existing {@link LabelCollisionManager} (AABB
34
34
  * register/hasCollision core); marks are pre-registered as bounding
35
- * squares — conservative for circles, acceptable for label proximity.
35
+ * squares - conservative for circles, acceptable for label proximity.
36
36
  *
37
37
  * Placement tries eight anchors clockwise from north and rejects positions
38
38
  * that leave the frame or collide with marks or other labels; unplaceable
39
- * labels are dropped (IBCS wants proximate labels — no leader lines).
39
+ * labels are dropped (IBCS wants proximate labels - no leader lines).
40
40
  */
41
41
  export declare class PointLabeler {
42
42
  private readonly frame;
@@ -4,11 +4,11 @@
4
4
  *
5
5
  * Two modes:
6
6
  * - **Local** (default): radii are normalized to the chart's own maximum
7
- * value — `r = rMax · √(v / vMax)` with a minimum visible radius.
7
+ * value - `r = rMax · √(v / vMax)` with a minimum visible radius.
8
8
  * `vMax` must be the max across all panels and both scenario sets of the
9
9
  * chart instance (shared size scale, mandatory for comparability).
10
10
  * - **Grouped** (`bn-scaling-group`): the group value is interpreted as
11
- * **area px² per data unit** — `r = √(area · v / π)` with no
11
+ * **area px² per data unit** - `r = √(area · v / π)` with no
12
12
  * normalization and no radius caps, so identical values render at
13
13
  * identical sizes across every chart referencing the group.
14
14
  */
@@ -5,7 +5,7 @@
5
5
  * XY charts compose two orthogonal encodings: the **series hue** (which
6
6
  * product line / group a point belongs to) and the **scenario treatment**
7
7
  * (solid / tinted / hatched / outlined, selected through the rule-set
8
- * `colorIndex`). Tints and shades are computed colors, never opacity —
8
+ * `colorIndex`). Tints and shades are computed colors, never opacity -
9
9
  * opacity creates blend artifacts where marks overlap.
10
10
  */
11
11
  /**
@@ -21,9 +21,9 @@ export declare const XY_SERIES_PALETTE: string[];
21
21
  * @param ratioOfB - Portion of `hexB` in the result, 0..1
22
22
  */
23
23
  export declare function mixHex(hexA: string, hexB: string, ratioOfB: number): string;
24
- /** Light variant of a series hue (60% white) — the PP/PY treatment. */
24
+ /** Light variant of a series hue (60% white) - the PP/PY treatment. */
25
25
  export declare function tint(hex: string): string;
26
- /** Dark variant of a series hue (25% black) — used for pie-share slices. */
26
+ /** Dark variant of a series hue (25% black) - used for pie-share slices. */
27
27
  export declare function shade(hex: string): string;
28
28
  /**
29
29
  * Resolves the color for a series by its order index. Indices beyond the
@@ -1,3 +1,4 @@
1
+ import { AxisConfig } from "./model/AxisConfig";
1
2
  export declare class VarianceMeasure {
2
3
  /** `"d"` = absolute, `"dr"` = relative (fraction of delta). */
3
4
  readonly type: "d" | "dr";
@@ -11,7 +12,7 @@ export declare class VarianceMeasure {
11
12
  /**
12
13
  * Computes the variance value, mirroring the null-safe math of the
13
14
  * existing charts: absolute = `base - delta`, relative =
14
- * `(base - delta) / delta`. Returns `null` when either operand is
15
+ * `(base - delta) / |delta|`. Returns `null` when either operand is
15
16
  * missing or a relative variance would divide by zero.
16
17
  */
17
18
  compute(base: number | null | undefined, delta: number | null | undefined): number | null;
@@ -33,5 +34,12 @@ export declare function resolveMeasure(token: string): MeasureRef | null;
33
34
  * Scenario family (`ac` | `pp` | `fc` | `pl`) of a plain scenario slot.
34
35
  */
35
36
  export declare function scenarioFamily(slot: string): string;
36
- /** Slot number (`1`–`4`) of a plain scenario slot. */
37
+ /** Slot number (`1`-`4`) of a plain scenario slot. */
37
38
  export declare function scenarioSlotNumber(slot: string): string;
39
+ /** True for a relative variance token (`dr…`): its values are fractions and are shown in percent. */
40
+ export declare function isRelativeMeasure(token: string): boolean;
41
+ /**
42
+ * The axis config in the unit of the axis values. A relative variance axis is written
43
+ * in percent (`min: -40`, `refLine: 20`), while its values are fractions (0.2 for 20 %).
44
+ */
45
+ export declare function axisInValueUnits(axis: AxisConfig): AxisConfig;
@@ -9,6 +9,9 @@ export interface TickRenderConfig {
9
9
  ticksY: number[];
10
10
  xDecimals: number;
11
11
  yDecimals: number;
12
+ /** The axis holds a relative variance: its ticks are fractions and print in percent. */
13
+ xPercent?: boolean;
14
+ yPercent?: boolean;
12
15
  /** Outer-edge panels only (facet grids label outer edges, 10F/10G style). */
13
16
  showXLabels: boolean;
14
17
  showYLabels: boolean;
@@ -37,7 +40,7 @@ export declare class XYFrame {
37
40
  drawRefLines(group: G, xRef?: number, yRef?: number): void;
38
41
  /** The four-sided thin plot frame (as in the IBCS template images). */
39
42
  drawFrame(group: G): void;
40
- /** Tick labels along the outer edges (no tick marks — template style). */
43
+ /** Tick labels along the outer edges (no tick marks - template style). */
41
44
  drawTickLabels(group: G, config: TickRenderConfig): void;
42
45
  /** Facet panel title, top-left inside the panel, bold (10F "Europe"/"RoW"). */
43
46
  drawPanelTitle(group: G, title: string): void;
@@ -5,6 +5,8 @@ import { XYChartStyle } from "./model/XYChartStyle";
5
5
  export interface LegendEntry {
6
6
  label: string;
7
7
  treatment: MarkTreatment;
8
+ /** Fill of the swatch when the chart draws this treatment with a pattern (hatched forecast bubbles). */
9
+ fill?: string;
8
10
  }
9
11
  /** The legend content of one chart (rendered once, chart-level). */
10
12
  export interface LegendModel {
@@ -24,7 +26,7 @@ export interface LegendSize {
24
26
  }
25
27
  /**
26
28
  * Series-color legend + bubble-size caption for the XY charts
27
- * (IBCS requires a legend explaining colors — and, for bubbles, size).
29
+ * (IBCS requires a legend explaining colors - and, for bubbles, size).
28
30
  * Positioned by the orchestrator: right column (default) or bottom row.
29
31
  */
30
32
  export declare class XYLegend {
@@ -0,0 +1,8 @@
1
+ import { ErrorDispatcher } from "../withHasError";
2
+ /**
3
+ * Sets or removes WARN_overflow on the facade of an XY chart. The chart takes the width
4
+ * of its parent and its height follows from `aspect`, so the height is what usually does
5
+ * not fit. It does not adapt to the height it has, so the height counts only when an
6
+ * ancestor really cuts the chart off: on a page that grows or scrolls nothing is lost.
7
+ */
8
+ export declare function checkXYOverflow(host: HTMLElement, innerTag: string, errors: ErrorDispatcher): void;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Prints a number of an XY chart (axis tick, iso line, bubble value) with a fixed number
3
+ * of decimals. `percent` is for relative variances: the value is a fraction and prints as 20%.
4
+ */
5
+ export declare function formatXYValue(value: number, decimals: number, locale: string, percent?: boolean): string;
6
+ /** Decimals for the ticks of an axis. The ticks of a percent axis are fractions and print times 100. */
7
+ export declare function xyTickDecimals(ticks: number[], percent: boolean): number;
@@ -70,7 +70,7 @@ export interface ParsedSpec {
70
70
  /** Result of converting an untyped record into a typed config. */
71
71
  export interface SpecResult<T> {
72
72
  config: T | null;
73
- /** Sub-fields present but not part of the spec (forward compat — warning, never error). */
73
+ /** Sub-fields present but not part of the spec (forward compat - warning, never error). */
74
74
  unknownKeys: string[];
75
75
  /** Sub-fields present with an unusable type/value. */
76
76
  invalidFields: string[];
@@ -17,6 +17,8 @@ export declare class XYChartStyle {
17
17
  axisStyles: SVGStyleGroup;
18
18
  padding: Padding;
19
19
  seriesColors: string[];
20
+ /** Locale for number labels. */
21
+ locale: string;
20
22
  constructor(scaleFactors: ScaleFactorsXYChart, fontStyles: FontStyle, axisStyles: SVGStyleGroup, padding: Padding);
21
23
  }
22
24
  /** Adapts raw componentStyle JSON into an XYChartStyle, falling back to defaults for missing properties. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bino-bi/bn-template-engine",
3
- "version": "1.0.0-next.26",
3
+ "version": "1.0.0-next.28",
4
4
  "description": "IBCS-compliant web components for business intelligence tables and charts",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
@@ -24,6 +24,8 @@
24
24
  "start": "stencil build --dev --watch --serve",
25
25
  "test": "stencil test --spec --e2e",
26
26
  "test.watch": "stencil test --spec --e2e --watchAll",
27
+ "test:dist": "node --test scripts/test-dist/security.mjs scripts/test-dist/report.mjs",
28
+ "test:tz": "TZ=America/New_York stencil test --spec -- .timezone.spec",
27
29
  "dependencies.update": "npx npm-upgrade check",
28
30
  "exportdoc": "node scripts/docExporter.js ../www/docs/product/components/",
29
31
  "lint": "eslint src/",
@@ -50,7 +52,7 @@
50
52
  "jest-cli": "^29.7.0",
51
53
  "lint-staged": "^17.0.8",
52
54
  "prettier": "^3.8.1",
53
- "puppeteer": "25.3.0",
55
+ "puppeteer": "25.4.0",
54
56
  "standard-version": "^9.5.0",
55
57
  "typescript": "^5.9.3",
56
58
  "typescript-eslint": "^8.56.1"
package/readme.md CHANGED
@@ -5,7 +5,7 @@ IBCS-compliant web components for business intelligence visualizations.
5
5
  [![License: Apache 2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE)
6
6
  [![npm version](https://img.shields.io/npm/v/@bino-bi/bn-template-engine)](https://www.npmjs.com/package/@bino-bi/bn-template-engine)
7
7
 
8
- **bn-template-engine** is a [Stencil.js](https://stenciljs.com/) web component library that renders tables and charts following [IBCS (International Business Communication Standards)](https://www.ibcs.com/). It supports multi-scenario comparisons (actual, forecast, plan, previous period), variance calculations, hierarchical data grouping, and more — all as standard Web Components that work in any HTML page or framework.
8
+ **bn-template-engine** is a [Stencil.js](https://stenciljs.com/) web component library that renders tables and charts following [IBCS (International Business Communication Standards)](https://www.ibcs.com/). It supports multi-scenario comparisons (actual, forecast, plan, previous period), variance calculations, hierarchical data grouping, and more - all as standard Web Components that work in any HTML page or framework.
9
9
 
10
10
  ## Installation
11
11
 
@@ -61,12 +61,12 @@ Data flows through three layers:
61
61
 
62
62
  ```
63
63
  bn-datasource → bn-dataset → Visualization (bn-table, bn-chart-time, bn-chart-structure,
64
- (raw JSON) (SQL query) bn-chart-scatter, bn-chart-bubble — renders IBCS output)
64
+ (raw JSON) (SQL query) bn-chart-scatter, bn-chart-bubble - renders IBCS output)
65
65
  ```
66
66
 
67
- 1. **`<bn-datasource>`** — Receives raw JSON data and stores it by name
68
- 2. **`<bn-dataset>`** — Queries datasources using [AlaSQL](https://alasql.org/) and stores results
69
- 3. **Visualization components** — Subscribe to datasets and render tables or charts
67
+ 1. **`<bn-datasource>`** - Receives raw JSON data and stores it by name
68
+ 2. **`<bn-dataset>`** - Queries datasources using [AlaSQL](https://alasql.org/) and stores results
69
+ 3. **Visualization components** - Subscribe to datasets and render tables or charts
70
70
 
71
71
  All components must be wrapped in a **`<bn-context>`** element, which provides scoped state management and locale configuration.
72
72
 
@@ -150,12 +150,12 @@ All components must be wrapped in a **`<bn-context>`** element, which provides s
150
150
 
151
151
  ## Concept Guides
152
152
 
153
- - [Data Model](doc/data-model.md) — Scenarios, variances, grouping fields, operations
154
- - [Scaling](doc/scaling.md) — Units-per-em bar scaling, scaling groups, `scale`, `measure-scale`
155
- - [Theming](doc/theming.md) — Colors, fonts, chart styles, style layers
156
- - [Internationalization](doc/internationalization.md) — Locale setup, translations, scenario labels
157
- - [Layout State](doc/layout-state.md) — `getLayoutState()`: machine-readable geometry, metadata and diagnostics of a rendered report
158
- - [Installation](doc/installation.md) — npm, CDN, framework integration
153
+ - [Data Model](doc/data-model.md) - Scenarios, variances, grouping fields, operations
154
+ - [Scaling](doc/scaling.md) - Units-per-em bar scaling, scaling groups, `scale`, `measure-scale`
155
+ - [Theming](doc/theming.md) - Colors, fonts, chart styles, style layers
156
+ - [Internationalization](doc/internationalization.md) - Locale setup, translations, scenario labels
157
+ - [Layout State](doc/layout-state.md) - `getLayoutState()`: machine-readable geometry, metadata and diagnostics of a rendered report
158
+ - [Installation](doc/installation.md) - npm, CDN, framework integration
159
159
 
160
160
  ## Browser Support
161
161
 
@@ -1 +0,0 @@
1
- import{r as t,h as i,H as s,g as h}from"./p-C5UYpZUU.js";import{r as n,m as o,g as e,d as r}from"./p-D5e8I9Qe.js";import{C as l,S as a,F as c,I as u,a as d,b as v,c as m,P as f}from"./p-TuLpbB5O.js";import{X as w,r as p,a as x,b as g,P as M,F as y,c as b,S as $}from"./p-qRZrT-U3.js";import{N as L}from"./p-DsTzlzxQ.js";import{r as T}from"./p-BbmobTg0.js";import"./p-DVrDYxlh.js";class k{constructor(t,i){this.xScale=t,this.yScale=i}isPositiveDomain(){return this.xScale.domainMin>0&&this.yScale.domainMin>0}static autoK(t){const i=t.filter((t=>t>0)).sort(((t,i)=>t-i));if(0===i.length)return[];const s=t=>i[Math.min(i.length-1,Math.floor(t*i.length))];let h=k.ladderValues(s(.25),s(.75));if(h.length<2&&(h=k.ladderValues(i[0],i[i.length-1])),0===h.length)return[];if(1===h.length)return h;if(h.length<=4)return h;const n=[];for(let t=0;t<4;t++)n.push(h[Math.round(t*(h.length-1)/3)]);return[...new Set(n)]}static ladderValues(t,i){if(t<=0||i<t)return[];const s=[];for(let h=Math.floor(Math.log10(t))-1;h<=Math.ceil(Math.log10(i));h++)for(const n of[1,2,5]){const o=n*Math.pow(10,h);o>=t&&o<=i&&s.push(o)}return s}visibleRange(t){if(!this.isPositiveDomain()||t<=0)return null;const i=Math.max(this.xScale.domainMin,t/this.yScale.domainMax),s=Math.min(this.xScale.domainMax,t/this.yScale.domainMin);return i>=s?null:[i,s]}samples(t){const i=this.visibleRange(t);if(null===i)return null;const[s,h]=i,n=[];for(let i=0;i<64;i++){const o=s*Math.pow(h/s,i/63);n.push({x:this.xScale.scale(o),y:this.yScale.scale(t/o)})}return n}path(t){const i=this.samples(t);return null===i?null:i.map(((t,i)=>`${0===i?"M":"L"} ${t.x} ${t.y}`)).join(" ")}exitPoint(t){const i=this.visibleRange(t);if(null===i)return null;const s=i[1],h=s>=this.xScale.domainMax-1e-9*Math.abs(this.xScale.domainMax);return{x:this.xScale.scale(s),y:this.yScale.scale(t/s),edge:h?"right":"bottom"}}regionPath(t){if(!this.isPositiveDomain()||t<=0)return null;const i=this.xScale.domainMin,s=this.xScale.domainMax,h=this.yScale.domainMin,n=this.yScale.domainMax,o=this.xScale.scale(i),e=this.xScale.scale(s),r=this.yScale.scale(n),l=this.yScale.scale(h);if(t>=s*n)return null;if(t<=i*h)return`M ${o} ${r} L ${e} ${r} L ${e} ${l} L ${o} ${l} Z`;const a=this.samples(t),[c,u]=this.visibleRange(t),d=c>i,v=u>=s-1e-9*Math.abs(s),m=a.map(((t,i)=>`${0===i?"M":"L"} ${t.x} ${t.y}`));return v||m.push(`L ${e} ${l}`),m.push(`L ${e} ${r}`),d||m.push(`L ${o} ${r}`),m.push("Z"),m.join(" ")}}class S{constructor(t,i,s,h,n,o){var e,r;this.ruleSet=t,this.config=h,this.styles=n,this.availableWidth=o,this.warnings=[],this.canvasHeight=0,this.i18nMap=new Map;const l=new w,a=""!==s?i.exec(`SELECT * FROM ${s}`):[],c=(null!=a?a:[]).map((t=>l.adapt(t)));this.data=p(c,{pointLevel:h.pointLevel,seriesLevel:h.seriesLevel,facetLevel:null!==h.facet?"rowgroup"===h.facet.level?"rowGroup":"category":null,measures:{x:null!==(e=T(h.x.measure))&&void 0!==e?e:{kind:"scenario",slot:"ac1"},y:null!==(r=T(h.y.measure))&&void 0!==r?r:{kind:"scenario",slot:"ac2"}},domains:{x:{min:h.x.min,max:h.x.max},y:{min:h.y.min,max:h.y.max}},limit:h.limit,limitBy:"order"}),this.warnings.push(...this.data.warnings)}get em(){return this.styles.fontStyles.size}fontFamily(){return this.styles.fontStyles.font.replace(/^[\d.]+px\s*/,"")}textWidth(t,i=!1){const s=l(t,{font:this.styles.fontStyles.font,fontSize:this.styles.fontStyles.size+"px",fontWeight:i?"bold":"normal"}).width;return Number.isFinite(s)&&s>0?s:.6*t.length*this.em}drawText(t,i,s,h,n={}){var o,e,r;t.text(i).font({size:null!==(o=n.size)&&void 0!==o?o:this.styles.fontStyles.size,weight:n.bold?"bold":"normal",anchor:null!==(e=n.anchor)&&void 0!==e?e:"start"}).fill(null!==(r=n.color)&&void 0!==r?r:this.styles.fontStyles.color).attr({x:s,y:h,"font-family":this.fontFamily()})}hasNoData(){return 0===this.data.totalPoints}getWarnings(){return this.warnings}getAllocatedCanvasWidth(){return this.availableWidth}getAllocatedCanvasHeight(){return this.canvasHeight}axisTitle(t,i){var s;const h=null!==(s=t.label)&&void 0!==s?s:"";return""===h?"":void 0===t.unit||""===t.unit?h:`${h} ${i} ${t.unit}`}setI18n(t){this.i18nMap=t}legendModel(){const t=this.data.series.map((t=>{var i;return{label:""===t.key?null!==(i=this.ruleSet.getScenario("").name)&&void 0!==i?i:"Series":t.key,treatment:this.seriesTreatment(t.index)}}));return{sizeCaption:[],title:this.i18nMap.get("legend.title")||null,compareEntries:[],entries:t}}primaryColorIndex(){const t=T(this.config.x.measure);return null===t||"variance"===t.kind?10:this.ruleSet.getScenarioColorIndex(t.slot)}seriesTreatment(t){const{color:i,overflowed:s}=n(t,this.styles.seriesColors);return s&&this.addWarningOnce("xy-series-overflow",{}),o(this.primaryColorIndex(),i,"dot")}addWarningOnce(t,i){this.warnings.some((i=>i.code===t))||this.warnings.push({code:t,data:i})}toString(){const t=new a;return this.draw(t),t.id("drawCanvas"),t.width(this.getAllocatedCanvasWidth()),t.height(this.getAllocatedCanvasHeight()),t.attr("overflow","visible"),t.svg()}draw(t){var i,s,h,n,o,e,r,l,a,c;this.warnings=this.data.warnings.slice();const u=this.em,d=this.styles.padding,v=this.i18nMap.get("axis.in")||"in",m=t.group(),f=new x(this.styles),w=this.legendModel(),p=this.config.legend.show&&w.entries.length>0,g=p?f.measure(w,this.config.legend.position):{width:0,height:0},M=null!==this.config.iso,b=M?Math.max(3*u,this.textWidth(null!==(i=this.config.iso.label)&&void 0!==i?i:"",!0)+u,this.textWidth(void 0!==this.config.iso.unit&&""!==this.config.iso.unit?`${v} ${this.config.iso.unit}`:"")+u):0,$="right"===this.config.legend.position?Math.max(p?g.width+u:0,b):b,T=""!==this.config.chartTitle?1.6*u:0,k=this.axisTitle(this.config.y,v),S=this.axisTitle(this.config.x,v),D=""!==k?1.4*u:.4*u,W=1.4*u+(""!==S?1.3*u:0);let C,N=3*u,P={x:0,y:0,width:0,height:0},j=[];const z=Math.max(1,this.data.facets.length),H=null===(s=this.config.facet)||void 0===s?void 0:s.columns,I=L.domain(null!==(n=null===(h=this.data.extents)||void 0===h?void 0:h.xMin)&&void 0!==n?n:0,null!==(e=null===(o=this.data.extents)||void 0===o?void 0:o.xMax)&&void 0!==e?e:1,{min:this.config.x.min,max:this.config.x.max}),U=L.domain(null!==(l=null===(r=this.data.extents)||void 0===r?void 0:r.yMin)&&void 0!==l?l:0,null!==(c=null===(a=this.data.extents)||void 0===a?void 0:a.yMax)&&void 0!==c?c:1,{min:this.config.y.min,max:this.config.y.max});for(let t=0;t<2;t++){const t=Math.max(10,this.availableWidth-d.left-d.right-N-$);P={x:d.left+N,y:d.top+T+D,width:t,height:t/this.config.aspect},C=new y(z,H,P,this.styles.scaleFactors.panelGap*u);const i=C.panelRect(0).height,s=Math.max(4,Math.min(8,Math.round(i/(4*u)))),h=new L(U[0],U[1],i,0);j=h.ticks(s);const n=L.tickDecimals(j);N=Math.max(...j.map((t=>this.textWidth(this.formatTick(t,n)))),u)+this.styles.scaleFactors.axisTickLength*u+.4*u}this.canvasHeight=P.y+P.height+W+("bottom"===this.config.legend.position&&p?g.height+u:0)+d.bottom,""!==this.config.chartTitle&&this.drawText(m,this.config.chartTitle,d.left,d.top+u,{bold:!0}),""!==k&&this.drawAxisTitleText(m,this.config.y,v,d.left,P.y-.6*u,"start");const A=this.buildPanels(C,I,U),F=A[0].xScale.ticks(Math.max(3,Math.min(8,Math.round(A[0].rect.width/(7*u))))),R=L.tickDecimals(F),Y=L.tickDecimals(j);let Z=!1;M&&(I[0]>0&&U[0]>0?Z=!0:this.addWarningOnce("xy-iso-domain",{})),0===this.data.facets.length?this.drawPanel(m,A[0],{key:"",points:[]},F,j,R,Y,!0,!0,Z):this.data.facets.forEach(((t,i)=>{this.drawPanel(m,A[i],t,F,j,R,Y,C.isOuterLeft(i),C.isOuterBottom(i),Z,this.data.facets.length>1?t.key:"")})),""!==S&&this.drawAxisTitleText(m,this.config.x,v,P.x+P.width,P.y+P.height+2.6*u,"end"),p&&("right"===this.config.legend.position?f.draw(m,w,P.x+P.width+u,P.y,"right"):f.draw(m,w,P.x,P.y+P.height+W,"bottom")),t.group().addClass("annotations")}drawAxisTitleText(t,i,s,h,n,o){var e;const r=null!==(e=i.label)&&void 0!==e?e:"",l=void 0!==i.unit&&""!==i.unit?`${s} ${i.unit}`:"",a=.3*this.em;"start"===o?(this.drawText(t,r,h,n,{bold:!0}),""!==l&&this.drawText(t,l,h+this.textWidth(r,!0)+a,n,{})):""!==l?(this.drawText(t,l,h,n,{anchor:"end"}),this.drawText(t,r,h-this.textWidth(l)-a,n,{anchor:"end",bold:!0})):this.drawText(t,r,h,n,{anchor:"end",bold:!0})}buildPanels(t,i,s){const h=[];for(let n=0;n<t.count;n++){const o=t.panelRect(n),e=new L(i[0],i[1],o.x,o.x+o.width),r=new L(s[0],s[1],o.y+o.height,o.y);h.push({rect:o,xScale:e,yScale:r,frame:new g(e,r,o,this.styles)})}return h}drawPanel(t,i,s,h,n,o,e,r,l,a,c=""){var u,d;const v=t.group(),m=this.em;i.frame.drawBands(v,this.config.x.highlight,this.config.y.highlight),i.frame.drawGrid(v,n,void 0===this.config.x.refLine&&void 0===this.config.y.refLine&&i.rect.width>30*m?h:void 0),a&&null!==this.config.iso&&this.drawIso(v,i),i.frame.drawRefLines(v,this.config.x.refLine,this.config.y.refLine),i.frame.drawFrame(v);const f=this.styles.scaleFactors.pointRadius*m,w=new M(i.rect,this.styles.scaleFactors.labelToMark*m),p=[];for(const t of s.points){const s=null!==(d=null===(u=this.data.series.find((i=>i.key===t.seriesKey)))||void 0===u?void 0:u.index)&&void 0!==d?d:0,h=this.seriesTreatment(s),n=i.xScale.scale(t.x),o=i.yScale.scale(t.y);p.push({point:t,cx:n,cy:o,treatment:h});const e=v.circle(2*f).center(n,o).fill(h.fill).stroke({color:h.stroke,width:h.strokeWidth});void 0!==h.dasharray&&e.attr("stroke-dasharray",h.dasharray),w.registerMark(n,o,f)}this.drawPointLabels(v,w,p,f),i.frame.drawTickLabels(v,{ticksX:h,ticksY:n,xDecimals:o,yDecimals:e,showXLabels:l,showYLabels:r}),""!==c&&i.frame.drawPanelTitle(v,c)}drawPointLabels(t,i,s,h){const n=s.reduce(((t,i)=>t+i.cx),0)/Math.max(1,s.length),o=s.reduce(((t,i)=>t+i.cy),0)/Math.max(1,s.length),e=[...s].sort(((t,i)=>Math.hypot(i.cx-n,i.cy-o)-Math.hypot(t.cx-n,t.cy-o))),{selected:r,unknownNames:l}=i.selectCandidates(e,this.config.labels.points,this.config.labels.max,(t=>t.point.name));l.length>0&&this.addWarningOnce("xy-label-unknown",{names:l.join(", ")});const a=r.map((t=>({name:t.point.name,cx:t.cx,cy:t.cy,r:h,width:this.textWidth(t.point.name),height:1.1*this.em})));for(const s of i.place(a))this.drawText(t,s.candidate.name,s.x,s.y+.9*s.candidate.height,{})}drawIso(t,i){const s=this.config.iso,h=new k(i.xScale,i.yScale),n=this.i18nMap.get("axis.in")||"in",o=this.data.facets.flatMap((t=>t.points.map((t=>t.x*t.y)))),e="auto"===s.values?k.autoK(o):s.values;if(void 0!==s.highlight){const i=h.regionPath(s.highlight.from);null!==i&&t.path(i).fill(this.styles.axisStyles.pl.fill).stroke("none")}const r={color:this.styles.axisStyles.fc.stroke,width:this.styles.scaleFactors.gridLineWidth};let l=null;for(const i of e){const s=h.path(i);if(null===s)continue;t.path(s).fill("none").stroke(r);const n=h.exitPoint(i);null!==n&&(this.drawText(t,this.formatTick(i,0),n.x+.4*this.em,"right"===n.edge?n.y+.35*this.em:n.y-.5*this.em,{}),(null===l||n.y<l.y)&&(l=n))}if(null!==l&&void 0!==s.label&&""!==s.label){const i=void 0!==s.unit&&""!==s.unit?`${n} ${s.unit}`:"";this.drawText(t,s.label,l.x+.4*this.em,l.y-1.6*this.em,{bold:!0}),""!==i&&this.drawText(t,i,l.x+.4*this.em,l.y-.5*this.em,{})}}formatTick(t,i){return c.number(t,"decimal",i,i)}}const D=["xy-duplicate-point","xy-point-clipped","xy-variance-nodata","xy-iso-domain","xy-label-unknown","xy-series-overflow","xy-point-budget"],W=class{constructor(i){t(this,i),this.tableName="",this.dataVersion=0,this.chartTitle="",this.iso=null,this.facet=null,this.pointLevel="category",this.seriesLevel=null,this.aspect=16/9,this.limit=0,this.filter="",this.i18n=new Map,this.containerWidth=0,this.svgMarkup=""}getDb(){return this.stores||(this.stores=e(this.element)),this.stores.db.db}componentWillLoad(){this.rebuild()}componentWillUpdate(){this.rebuild()}rebuild(){const t=this.prepareStyle(),i=this.tableName?r(this.tableName,this.filter):"";this.chart=new S(new u(this.ruleSetConfig),this.getDb(),i,{chartTitle:this.chartTitle,x:this.x,y:this.y,iso:this.iso,labels:this.labels,legend:this.legend,facet:this.facet,pointLevel:this.pointLevel,seriesLevel:this.seriesLevel,aspect:this.aspect,limit:this.limit},t,this.containerWidth||0),this.chart.setI18n(this.i18n),this.svgMarkup=this.chart.hasNoData()?"":this.chart.toString(),this.syncWarnings(this.chart.getWarnings())}syncWarnings(t){if(void 0===this.errors)return;const i=new Map(t.map((t=>[t.code,t.data])));for(const t of D){const s=`WARN_${t}`;if(i.has(t)){const h=void 0!==this.translate?this.translate(`.${t}`,i.get(t)):t;this.errors.addOrReplace({id:s,type:"warning",message:h})}else this.errors.remove(s)}}prepareStyle(){return new b(new $,new d,new v(new m),new f).adapt(this.styles)}render(){if(void 0===this.chart)return i(s,null);if(this.chart.hasNoData()){const t=this.i18n.get("no-data")||"==No Data==";return i(s,null,i("p",{class:"warning"},t))}return i(s,null,i("div",{innerHTML:this.svgMarkup}))}get element(){return h(this)}};W.style=':host{position:relative;display:inline-block}.warning{font-family:var(--bn-font-family, "Noto Sans", "Helvetica Neue", Helvetica, sans-serif);color:var(--bn-font-color, black)}';export{W as ibcs_chart_scatter}
@@ -1 +0,0 @@
1
- import{r as t,h as i,H as s,g as h}from"./p-C5UYpZUU.js";import{g as n,d as e}from"./p-D5e8I9Qe.js";import{A as r,s as o,C as a}from"./p-BbmobTg0.js";import{C as l,F as u,S as c,I as d,a as p,b as v,c as g,P as f}from"./p-TuLpbB5O.js";import{S as m}from"./p-CWWWM-XC.js";import{b as w}from"./p-B5Jd_eCX.js";import{N as b}from"./p-DsTzlzxQ.js";class ${constructor(t,i,s,h,n,e){this.ruleSet=t,this.config=h,this.styles=n,this.availableWidth=e,this.rows=[],this.warnings=[],this.i18nMap=new Map,this.populateModel(i,s),this.normalized="target"===this.config.normalize&&this.rows.some((t=>null!==t.fraction)),null!==this.config.target&&this.rows.length>0&&!this.rows.some((t=>null!==t.target))&&this.warnings.push({code:"bullet-target-none",data:{}})}populateModel(t,i){var s,h,n;if(""===i)return;const e=this.config.level,r=this.config.order,o=this.config.actual.measure,a=null!==(h=null===(s=this.config.target)||void 0===s?void 0:s.measure)&&void 0!==h?h:null,l=[o,...null!==a?[a]:[]].map((t=>`SUM(${t}) as ${t}, COUNT(ISNULL(${t})) as ${t}_cnt`)).join(", ");let u;try{u=t.exec(`SELECT ${this.createSelectString(e,r)}, ${l},\n MIN(transformOperator(operation)) as opMin, MAX(transformOperator(operation)) as opMax\n FROM ${i}\n GROUP BY ${this.createGroupByStr(e,r)}\n ORDER BY ${this.createOrderStr(e,r)}`)}catch(t){return void console.error("BulletChart: populateModel query failed",t)}let c=null!=u?u:[];this.config.limit>0&&(c=c.slice(0,this.config.limit));let d=0,p=0,v=0;for(const t of c){const i=this.readValue(t,o),s=null!==a?this.readValue(t,a):null,h="number"==typeof t.opMin?t.opMin:1,e="number"==typeof t.opMax?t.opMax:1;let r=-1===h&&-1===e?"-":"+";h!==e&&(r="+",d++);let l=null;"target"===this.config.normalize&&(null===s?null!==a&&p++:s<=0?v++:null!==i&&(i<0?v++:l=i/s)),this.rows.push({category:String(null!==(n=t.category)&&void 0!==n?n:""),actual:i,target:s,operation:r,sentiment:this.sentiment(i,s,r),fraction:l})}d>0&&this.warnings.push({code:"bullet-mixed-operation",data:{count:String(d)}}),p>0&&this.warnings.push({code:"bullet-target-missing",data:{count:String(p)}}),v>0&&this.warnings.push({code:"bullet-target-invalid",data:{count:String(v)}})}readValue(t,i){if(0===t[`${i}_cnt`])return null;const s=t[i];return"number"==typeof s&&isFinite(s)?s:null}sentiment(t,i,s){return null===t||null===i||t===i?"neu":t>i!=("-"===s)?"pos":"neg"}createSelectString(t,i){return t===r.CATEGORY&&i.hierarchy.includes(w.CATEGORYINDEX)?`${w.CATEGORYINDEX}, ${r.CATEGORY} as category`:t===r.ROWGROUP&&i.hierarchy.includes(w.ROWGROUPINDEX)?`${w.ROWGROUPINDEX}, ${r.ROWGROUP} as category`:t===r.SUBCATEGORY&&i.hierarchy.includes(w.SUBCATEGORYINDEX)?`${w.SUBCATEGORYINDEX}, ${r.SUBCATEGORY} as category`:`${t.toString()} as category`}createGroupByStr(t,i){return t===r.CATEGORY&&i.hierarchy.includes(w.CATEGORYINDEX)?`${w.CATEGORYINDEX}, ${r.CATEGORY}`:t===r.ROWGROUP&&i.hierarchy.includes(w.ROWGROUPINDEX)?`${w.ROWGROUPINDEX}, ${r.ROWGROUP}`:t===r.SUBCATEGORY&&i.hierarchy.includes(w.SUBCATEGORYINDEX)?`${w.SUBCATEGORYINDEX}, ${r.SUBCATEGORY}`:`${t.toString()}`}createOrderStr(t,i){let s=`${t.toLowerCase()}`;return i.hierarchy.length>=1&&(s=`${i.hierarchy.toString()} ${null==i?void 0:i.direction}`),s}get em(){return this.styles.fontStyles.size}fontFamily(){return this.styles.fontStyles.font.replace(/^[\d.]+px\s*/,"")}textWidth(t,i=!1){const s=l(t,{font:this.styles.fontStyles.font,fontSize:this.styles.fontStyles.size+"px",fontWeight:i?"bold":"normal"}).width;return Number.isFinite(s)&&s>0?s:.6*t.length*this.em}drawText(t,i,s,h,n={}){var e,r,o;t.text(i).font({size:null!==(e=n.size)&&void 0!==e?e:this.styles.fontStyles.size,weight:n.bold?"bold":"normal",anchor:null!==(r=n.anchor)&&void 0!==r?r:"start"}).fill(null!==(o=n.color)&&void 0!==o?o:this.styles.fontStyles.color).attr({x:s,y:h,"font-family":this.fontFamily()})}setI18n(t){this.i18nMap=t}hasNoData(){return 0===this.rows.length}getWarnings(){return this.warnings}getAllocatedCanvasWidth(){return this.availableWidth}getAllocatedCanvasHeight(){return this.styles.padding.top+this.titleHeight()+this.headerHeight()+this.rows.length*this.rowBlockHeight()+this.styles.padding.bottom}titleHeight(){return""!==this.config.chartTitle?1.6*this.em:0}headerHeight(){return this.rows.length>0?1.2*this.em:0}rowBlockHeight(){const t=this.em,i=this.styles.scaleFactors.rowHeight*t;return this.normalized?i:i+this.styles.scaleFactors.tickStripHeight*t}valueLabel(t){return null===t||"none"===this.config.labels.show?"":u.number(t,"decimal",this.config.labels.decimals,0)}targetFamily(){var t,i,s;const h=null!==(i=null===(t=this.config.target)||void 0===t?void 0:t.measure)&&void 0!==i?i:"pl1";return null!==(s={10:"ac",20:"pp",30:"fc",50:"pl"}[this.ruleSet.getScenarioColorIndex(h)])&&void 0!==s?s:o(h)}actualLabel(){var t;return null!==(t=this.config.actual.label)&&void 0!==t?t:u.translateScenarioLabel(this.config.actual.measure,this.i18nMap)}targetLabel(){return null===this.config.target?"":void 0!==this.config.target.label?this.config.target.label:this.normalized?this.i18nMap.get("target")||"Target":u.translateScenarioLabel(this.config.target.measure,this.i18nMap)}toString(){const t=new c;return this.draw(t),t.id("drawCanvas"),t.width(this.getAllocatedCanvasWidth()),t.height(this.getAllocatedCanvasHeight()),t.attr("overflow","visible"),t.svg()}draw(t){var i,s;const h=this.em,n=this.styles.scaleFactors,e=this.styles.padding,r=t.group();if(""!==this.config.chartTitle&&this.drawText(r,this.config.chartTitle,e.left,e.top+h,{bold:!0}),0===this.rows.length)return void t.group().addClass("annotations");const o=n.rowHeight*h,a=this.rowBlockHeight(),l=e.top+this.titleHeight()+this.headerHeight(),u=l+(this.rows.length-1)*a+o,c=Math.max(...this.rows.map((t=>this.textWidth(t.category,!0))),h),d=this.rows.map((t=>this.valueLabel(t.actual))),p="none"===this.config.labels.show?0:Math.max(...d.map((t=>this.textWidth(t))),0),v=e.left+c+n.labelToAxis*h,g=Math.max(10,this.availableWidth-v-e.right-p-(p>0?n.labelToBar*h:0)),f=null!==(i=this.config.actual.unit)&&void 0!==i?i:null===(s=this.config.target)||void 0===s?void 0:s.unit,m=this.i18nMap.get("axis.in")||"in",w=l-.35*h;void 0!==f&&""!==f&&this.drawText(r,`${m} ${f}`,e.left,w,{}),this.drawText(r,this.actualLabel(),v+.2*h,w,{}),this.normalized?this.drawNormalized(r,v,g,l,u,o,a,d):this.drawClassic(r,v,g,l,o,a,d),this.rows.forEach(((t,i)=>{this.drawText(r,t.category,v-n.labelToAxis*h,l+i*a+o/2+.35*h,{anchor:"end",bold:!0})})),r.line(v,l-.2*h,v,u+.2*h).stroke({color:this.styles.axisStyles.ac.stroke,width:n.axisLineWidth}),t.group().addClass("annotations")}drawNormalized(t,i,s,h,n,e,r,o){const a=this.em,l=this.styles.scaleFactors,u=1.05*Math.max(1,...this.rows.map((t=>{var i;return null!==(i=t.fraction)&&void 0!==i?i:0}))),c=t=>i+t/u*s,d=c(1),p=this.styles.barStyles.getSVGStyle(this.targetFamily()),v=t.line(d,h-.3*a,d,n+.3*a).stroke({color:p.stroke,width:l.targetLineWidth});void 0!==p.dasharray&&v.attr("stroke-dasharray",p.dasharray),this.drawText(t,this.targetLabel(),d,h-.35*a,{anchor:"middle",bold:!0}),this.rows.forEach(((s,n)=>{const u=h+n*r+e/2;if(null===s.fraction)return void this.drawValueText(t,o[n],i+l.labelToBar*a,u);const p=l.barHeight*a,v=c(s.fraction);if(t.rect(Math.max(0,v-i),p).move(i,u-p/2).fill(this.styles.barStyles.ac.fill).stroke({color:this.styles.barStyles.ac.stroke,width:this.styles.barStyles.ac.width}),this.config.showVariances&&"neu"!==s.sentiment){const i=l.varianceHeight*a,h=this.styles.varianceStyles.getSVGStyle(s.sentiment);t.rect(Math.abs(v-d),i).move(Math.min(v,d),u-i/2).fill(h.fill).stroke({color:h.stroke,width:h.width})}this.drawValueText(t,o[n],Math.max(v,d)+l.labelToBar*a,u)}))}drawClassic(t,i,s,h,n,e,r){const o=this.em,a=this.styles.scaleFactors,l=a.barHeight*o,c=this.config.ranges.length>0;this.rows.forEach(((d,p)=>{var v,g;const f=h+p*e,m=f+n/2,w=c&&null!==d.target?this.config.ranges.map((t=>t*d.target)):[],$=Math.max(null!==(v=d.actual)&&void 0!==v?v:0,null!==(g=d.target)&&void 0!==g?g:0,...w);if($<=0)return void this.drawValueText(t,r[p],i+a.labelToBar*o,m);const M=b.niceStep($,4),y=Math.ceil($/M-1e-9*M)*M,S=new b(0,y,i,i+s);let C=i;w.forEach(((i,s)=>{const h=.8*n;t.rect(Math.max(0,S.scale(i)-C),h).move(C,m-h/2).fill(this.styles.rangeColors[Math.min(s,this.styles.rangeColors.length-1)]).stroke("none"),C=S.scale(i)}));let x=i;if(null!==d.actual&&d.actual>0){const s=S.scale(d.actual);t.rect(s-i,l).move(i,m-l/2).fill(this.styles.barStyles.ac.fill).stroke({color:this.styles.barStyles.ac.stroke,width:this.styles.barStyles.ac.width}),x=s}if(null!==d.target&&d.target>0){const i=S.scale(d.target),s=a.targetTickHeight*o,n=this.styles.barStyles.getSVGStyle(this.targetFamily()),e=t.line(i,m-s/2,i,m+s/2).stroke({color:n.stroke,width:a.targetLineWidth});void 0!==n.dasharray&&e.attr("stroke-dasharray",n.dasharray),0===p&&this.drawText(t,this.targetLabel(),i,h-.35*o,{anchor:"middle"}),x=Math.max(x,i)}x=Math.max(x,C),this.drawValueText(t,r[p],x+a.labelToBar*o,m);const N=S.ticks(4),W=b.tickDecimals(N),T=f+n;for(const i of N){const s=S.scale(i);t.line(s,T,s,T+a.axisTickLength*o).stroke({color:this.styles.axisStyles.ac.stroke,width:a.axisLineWidth}),this.drawText(t,u.number(i,"decimal",W,W),s,T+a.tickStripHeight*o-.2*o,{anchor:"middle"})}}))}drawValueText(t,i,s,h){""!==i&&this.drawText(t,i,s,h+.35*this.em,{})}}class M{constructor(){this.rowHeight=1.9,this.barHeight=.66,this.varianceHeight=.4,this.targetTickHeight=1.1,this.targetLineWidth=2,this.axisLineWidth=1,this.labelToBar=.3,this.labelToAxis=.3,this.axisTickLength=.35,this.tickStripHeight=1.2}}class y{adapt(t){const i=new M;return a.isNumber(t.rowHeight)&&(i.rowHeight=t.rowHeight),a.isNumber(t.barHeight)&&(i.barHeight=t.barHeight),a.isNumber(t.varianceHeight)&&(i.varianceHeight=t.varianceHeight),a.isNumber(t.targetTickHeight)&&(i.targetTickHeight=t.targetTickHeight),a.isNumber(t.targetLineWidth)&&(i.targetLineWidth=t.targetLineWidth),a.isNumber(t.axisLineWidth)&&(i.axisLineWidth=t.axisLineWidth),a.isNumber(t.labelToBar)&&(i.labelToBar=t.labelToBar),a.isNumber(t.labelToAxis)&&(i.labelToAxis=t.labelToAxis),a.isNumber(t.axisTickLength)&&(i.axisTickLength=t.axisTickLength),a.isNumber(t.tickStripHeight)&&(i.tickStripHeight=t.tickStripHeight),i}default(){return new M}}class S{constructor(t,i,s,h,n,e){this.scaleFactors=t,this.fontStyles=i,this.axisStyles=s,this.barStyles=h,this.varianceStyles=n,this.padding=e,this.rangeColors=["#D9D9D9","#EFEFEF"]}}class C{constructor(t,i,s,h,n){this.scaleFactorsBulletChartAdapter=t,this.fontStyleAdapter=i,this.svgStyleGroupAdapter=s,this.svgVariancesStyleGroupAdapter=h,this.paddingAdapter=n}adapt(t){const i=this.default();return a.isExisting(t)&&(a.isExisting(t.scaleFactors)&&(i.scaleFactors=this.scaleFactorsBulletChartAdapter.adapt(t.scaleFactors)),a.isExisting(t.fontStyles)&&(i.fontStyles=this.fontStyleAdapter.adapt(t.fontStyles)),a.isExisting(t.axisStyles)&&(i.axisStyles=this.svgStyleGroupAdapter.adapt(t.axisStyles)),a.isExisting(t.barStyles)&&(i.barStyles=this.svgStyleGroupAdapter.adapt(t.barStyles)),a.isExisting(t.varianceStyles)&&(i.varianceStyles=this.svgVariancesStyleGroupAdapter.adapt(t.varianceStyles)),a.isExisting(t.padding)&&(i.padding=this.paddingAdapter.adapt(t.padding)),Array.isArray(t.rangeColors)&&t.rangeColors.length>0&&(i.rangeColors=t.rangeColors)),i}default(){return new S(this.scaleFactorsBulletChartAdapter.default(),this.fontStyleAdapter.default(),this.svgStyleGroupAdapter.default(),this.svgStyleGroupAdapter.default(),this.svgVariancesStyleGroupAdapter.default(),this.paddingAdapter.default())}}const x=["bullet-target-missing","bullet-target-invalid","bullet-mixed-operation","bullet-target-none"],N=class{constructor(i){t(this,i),this.tableName="",this.dataVersion=0,this.chartTitle="",this.target=null,this.ranges=[],this.normalize="target",this.showVariances=!0,this.level=r.CATEGORY,this.limit=0,this.filter="",this.i18n=new Map,this.containerWidth=0,this.svgMarkup=""}getDb(){return this.stores||(this.stores=n(this.element)),this.stores.db.db}componentWillLoad(){this.rebuild()}componentWillUpdate(){this.rebuild()}rebuild(){const t=this.prepareStyle(),i=this.tableName?e(this.tableName,this.filter):"";this.chart=new $(new d(this.ruleSetConfig),this.getDb(),i,{chartTitle:this.chartTitle,actual:this.actual,target:this.target,ranges:this.ranges,normalize:this.normalize,showVariances:this.showVariances,level:this.level,order:this.order,limit:this.limit,labels:this.labels},t,this.containerWidth||0),this.chart.setI18n(this.i18n),this.svgMarkup=this.chart.hasNoData()?"":this.chart.toString(),this.syncWarnings(this.chart.getWarnings())}syncWarnings(t){if(void 0===this.errors)return;const i=new Map(t.map((t=>[t.code,t.data])));for(const t of x){const s=`WARN_${t}`;if(i.has(t)){const h=void 0!==this.translate?this.translate(`.${t}`,i.get(t)):t;this.errors.addOrReplace({id:s,type:"warning",message:h})}else this.errors.remove(s)}}prepareStyle(){return new C(new y,new p,new v(new g),new m(new g),new f).adapt(this.styles)}render(){if(void 0===this.chart)return i(s,null);if(this.chart.hasNoData()){const t=this.i18n.get("no-data")||"==No Data==";return i(s,null,i("p",{class:"warning"},t))}return i(s,null,i("div",{innerHTML:this.svgMarkup}))}get element(){return h(this)}};N.style=':host{position:relative;display:inline-block}.warning{font-family:var(--bn-font-family, "Noto Sans", "Helvetica Neue", Helvetica, sans-serif);color:var(--bn-font-color, black)}';export{N as ibcs_chart_bullet}
@@ -1 +0,0 @@
1
- import{r as t,h as i,H as s,g as h}from"./p-C5UYpZUU.js";import{r as e,m as n,s as o,g as l,d as r}from"./p-D5e8I9Qe.js";import{C as a,S as d,F as c,I as u,a as v,b as m,c as b,P as f}from"./p-TuLpbB5O.js";import{X as w,r as p,a as g,b as x,P as y,F as M,c as $,S as L}from"./p-qRZrT-U3.js";import{g as S}from"./p-DVrDYxlh.js";import{N as k}from"./p-DsTzlzxQ.js";import{r as T}from"./p-BbmobTg0.js";class z{constructor(t,i,s,h,e){this.mode=t,this.vMax=i,this.rMaxPx=s,this.rMinPx=h,this.areaPerUnitPx2=e}static local(t,i,s){return new z("local",t,i,s,0)}static grouped(t){return new z("grouped",0,0,0,t)}radius(t){return"grouped"===this.mode?t<=0?0:Math.sqrt(this.areaPerUnitPx2*t/Math.PI):this.vMax<=0||t<=0?this.rMinPx:Math.max(this.rMinPx,this.rMaxPx*Math.sqrt(t/this.vMax))}}class D{constructor(t,i,s,h,e,n){var o,l,r,a;this.ruleSet=t,this.config=h,this.styles=e,this.availableWidth=n,this.warnings=[],this.canvasHeight=0,this.i18nMap=new Map,this.hatchPatterns=new Set,this.scaleOverflowCount=0,this.svgRoot=null;const d=new w,c=""!==s?i.exec(`SELECT * FROM ${s}`):[],u=(null!=c?c:[]).map((t=>d.adapt(t)));this.data=p(u,{pointLevel:h.pointLevel,seriesLevel:h.seriesLevel,facetLevel:null!==h.facet?"rowgroup"===h.facet.level?"rowGroup":"category":null,measures:{x:null!==(o=T(h.x.measure))&&void 0!==o?o:{kind:"scenario",slot:"ac1"},y:null!==(l=T(h.y.measure))&&void 0!==l?l:{kind:"scenario",slot:"ac2"},size:null!==(r=T(h.size.measure))&&void 0!==r?r:{kind:"scenario",slot:"ac3"},share:null!==h.share&&null!==(a=T(h.share.measure))&&void 0!==a?a:void 0},compareFamily:h.compareFamily,domains:{x:{min:h.x.min,max:h.x.max},y:{min:h.y.min,max:h.y.max}},limit:h.limit,limitBy:"size"}),this.warnings.push(...this.data.warnings)}get em(){return this.styles.fontStyles.size}fontFamily(){return this.styles.fontStyles.font.replace(/^[\d.]+px\s*/,"")}textWidth(t,i=!1){const s=a(t,{font:this.styles.fontStyles.font,fontSize:this.styles.fontStyles.size+"px",fontWeight:i?"bold":"normal"}).width;return Number.isFinite(s)&&s>0?s:.6*t.length*this.em}drawText(t,i,s,h,e={}){var n,o;t.text(i).font({size:this.styles.fontStyles.size,weight:e.bold?"bold":"normal",anchor:null!==(n=e.anchor)&&void 0!==n?n:"start"}).fill(null!==(o=e.color)&&void 0!==o?o:this.styles.fontStyles.color).attr({x:s,y:h,"font-family":this.fontFamily()})}hasNoData(){return 0===this.data.totalPoints}getWarnings(){return this.warnings}getAllocatedCanvasWidth(){return this.availableWidth}getAllocatedCanvasHeight(){return this.canvasHeight}setI18n(t){this.i18nMap=t}addWarningOnce(t,i){this.warnings.some((i=>i.code===t))||this.warnings.push({code:t,data:i})}primaryColorIndex(){const t=T(this.config.size.measure);return null===t||"variance"===t.kind?10:this.ruleSet.getScenarioColorIndex(t.slot)}compareColorIndex(){return this.ruleSet.getScenarioColorIndex(`${this.config.compareFamily}1`)}seriesHue(t){const{color:i,overflowed:s}=e(t,this.styles.seriesColors);return s&&this.addWarningOnce("xy-series-overflow",{}),i}familyDisplayName(t){return this.ruleSet.getScenario(`${t}1`).group}legendModel(){var t,i;const s=[],h=null!==(i=null!==(t=this.config.size.label)&&void 0!==t?t:this.i18nMap.get("legend.size"))&&void 0!==i?i:"";""!==h&&(s.push(h),void 0!==this.config.size.unit&&""!==this.config.size.unit&&s.push(`${this.i18nMap.get("axis.in")||"in"} ${this.config.size.unit}`));const e=this.seriesHue(0),o=[];if(null!==this.config.compareFamily){const t=T(this.config.size.measure),i=null!==t&&"scenario"===t.kind?t.slot.replace(/\d+$/,""):"ac";o.push({label:this.familyDisplayName(this.config.compareFamily),treatment:n(this.compareColorIndex(),e,"bubble")}),o.push({label:this.familyDisplayName(i),treatment:n(this.primaryColorIndex(),e,"bubble")})}const l=this.data.series.map((t=>{var i;return{label:""===t.key?null!==(i=this.ruleSet.getScenario("").name)&&void 0!==i?i:"Series":t.key,treatment:n(this.primaryColorIndex(),this.seriesHue(t.index),"bubble")}}));return{sizeCaption:s,title:this.i18nMap.get("legend.title")||null,compareEntries:o,entries:l}}toString(){const t=new d;return this.draw(t),t.id("drawCanvas"),t.width(this.getAllocatedCanvasWidth()),t.height(this.getAllocatedCanvasHeight()),t.attr("overflow","visible"),t.svg()}axisTitle(t,i){var s;const h=null!==(s=t.label)&&void 0!==s?s:"";return""===h?"":void 0===t.unit||""===t.unit?h:`${h} ${i} ${t.unit}`}draw(t){var i,s,h,e,n,o,l,r,a,d,c;this.warnings=this.data.warnings.slice(),this.hatchPatterns.clear(),this.scaleOverflowCount=0,this.svgRoot=t;const u=this.em,v=this.styles.padding,m=this.i18nMap.get("axis.in")||"in",b=t.group(),f=new g(this.styles),w=this.legendModel(),p=this.config.legend.show&&(w.entries.length>0||w.sizeCaption.length>0),x=p?f.measure(w,this.config.legend.position):{width:0,height:0},y="right"===this.config.legend.position&&p?x.width+u:0,$=""!==this.config.chartTitle?1.6*u:0,L=this.axisTitle(this.config.y,m),S=this.axisTitle(this.config.x,m),T=""!==L?1.4*u:.4*u,D=1.4*u+(""!==S?1.3*u:0);let N,C=3*u,W={x:0,y:0,width:0,height:0},j=[];const F=Math.max(1,this.data.facets.length),H=null===(i=this.config.facet)||void 0===i?void 0:i.columns,P=k.domain(null!==(h=null===(s=this.data.extents)||void 0===s?void 0:s.xMin)&&void 0!==h?h:0,null!==(n=null===(e=this.data.extents)||void 0===e?void 0:e.xMax)&&void 0!==n?n:1,{min:this.config.x.min,max:this.config.x.max}),A=k.domain(null!==(l=null===(o=this.data.extents)||void 0===o?void 0:o.yMin)&&void 0!==l?l:0,null!==(a=null===(r=this.data.extents)||void 0===r?void 0:r.yMax)&&void 0!==a?a:1,{min:this.config.y.min,max:this.config.y.max});for(let t=0;t<2;t++){const t=Math.max(10,this.availableWidth-v.left-v.right-C-y);W={x:v.left+C,y:v.top+$+T,width:t,height:t/this.config.aspect},N=new M(F,H,W,this.styles.scaleFactors.panelGap*u);const i=N.panelRect(0).height,s=Math.max(4,Math.min(8,Math.round(i/(4*u)))),h=new k(A[0],A[1],i,0);j=h.ticks(s);const e=k.tickDecimals(j);C=Math.max(...j.map((t=>this.textWidth(this.formatTick(t,e)))),u)+this.styles.scaleFactors.axisTickLength*u+.4*u}this.canvasHeight=W.y+W.height+D+("bottom"===this.config.legend.position&&p?x.height+u:0)+v.bottom,""!==this.config.chartTitle&&this.drawText(b,this.config.chartTitle,v.left,v.top+u,{bold:!0}),""!==L&&this.drawAxisTitleText(b,this.config.y,m,v.left,W.y-.6*u,"start");const I=this.buildPanels(N,P,A),U=I[0].xScale.ticks(Math.max(3,Math.min(8,Math.round(I[0].rect.width/(7*u))))),B=k.tickDecimals(U),E=k.tickDecimals(j),Y=this.config.sizeAreaPerUnit>0?z.grouped(this.config.sizeAreaPerUnit):z.local(null!==(c=null===(d=this.data.extents)||void 0===d?void 0:d.sizeMax)&&void 0!==c?c:0,this.styles.scaleFactors.bubbleMaxRadius*u,this.styles.scaleFactors.bubbleMinRadius*u);0===this.data.facets.length?this.drawPanel(b,I[0],{key:"",points:[]},Y,U,j,B,E,!0,!0):this.data.facets.forEach(((t,i)=>{this.drawPanel(b,I[i],t,Y,U,j,B,E,N.isOuterLeft(i),N.isOuterBottom(i),this.data.facets.length>1?t.key:"")})),""!==S&&this.drawAxisTitleText(b,this.config.x,m,W.x+W.width,W.y+W.height+2.6*u,"end"),p&&("right"===this.config.legend.position?f.draw(b,w,W.x+W.width+u,W.y,"right"):f.draw(b,w,W.x,W.y+W.height+D,"bottom")),this.scaleOverflowCount>0&&this.addWarningOnce("bubble-scale-overflow",{count:String(this.scaleOverflowCount)}),t.group().addClass("annotations")}drawAxisTitleText(t,i,s,h,e,n){var o;const l=null!==(o=i.label)&&void 0!==o?o:"",r=void 0!==i.unit&&""!==i.unit?`${s} ${i.unit}`:"",a=.3*this.em;"start"===n?(this.drawText(t,l,h,e,{bold:!0}),""!==r&&this.drawText(t,r,h+this.textWidth(l,!0)+a,e,{})):""!==r?(this.drawText(t,r,h,e,{anchor:"end"}),this.drawText(t,l,h-this.textWidth(r)-a,e,{anchor:"end",bold:!0})):this.drawText(t,l,h,e,{anchor:"end",bold:!0})}buildPanels(t,i,s){const h=[];for(let e=0;e<t.count;e++){const n=t.panelRect(e),o=new k(i[0],i[1],n.x,n.x+n.width),l=new k(s[0],s[1],n.y+n.height,n.y);h.push({rect:n,xScale:o,yScale:l,frame:new x(o,l,n,this.styles)})}return h}treatmentFill(t,i,s){return!0!==t.hatch?t.fill:(this.ensureHatchPattern(i,s),`url(#xy-fc-${i})`)}ensureHatchPattern(t,i){this.hatchPatterns.has(t)||null===this.svgRoot||(this.hatchPatterns.add(t),this.svgRoot.defs().pattern(10,10,(t=>{t.rect(10,10).fill("#ffffff"),t.line(0,10,10,0).stroke({color:i,width:2}),t.line(-2.5,2.5,2.5,-2.5).stroke({color:i,width:2}),t.line(7.5,12.5,12.5,7.5).stroke({color:i,width:2})})).id(`xy-fc-${t}`))}drawPanel(t,i,s,h,e,l,r,a,d,c,u=""){var v,m,b,f;const w=t.group(),p=this.em;i.frame.drawBands(w,this.config.x.highlight,this.config.y.highlight),i.frame.drawGrid(w,l,void 0===this.config.x.refLine&&void 0===this.config.y.refLine&&i.rect.width>30*p?e:void 0),i.frame.drawRefLines(w,this.config.x.refLine,this.config.y.refLine),i.frame.drawFrame(w);const g=w.group().id("compare"),x=w.group().id("primary"),M=new y(i.rect,this.styles.scaleFactors.labelToMark*p),$=[...s.points].sort(((t,i)=>{var s,h;return(null!==(s=i.size)&&void 0!==s?s:0)-(null!==(h=t.size)&&void 0!==h?h:0)})),L=[];for(const t of $){const s=null!==(m=null===(v=this.data.series.find((i=>i.key===t.seriesKey)))||void 0===v?void 0:v.index)&&void 0!==m?m:0,e=this.seriesHue(s),l=n(this.primaryColorIndex(),e,"bubble"),r=i.xScale.scale(t.x),a=i.yScale.scale(t.y),d=h.radius(null!==(b=t.size)&&void 0!==b?b:0);if(this.config.sizeAreaPerUnit>0&&this.bubbleExceedsPanel(i.rect,r,a,d)&&this.scaleOverflowCount++,null!=t.compare){const o=n(this.compareColorIndex(),e,"bubble"),l=i.xScale.scale(t.compare.x),r=i.yScale.scale(t.compare.y),a=h.radius(null!==(f=t.compare.size)&&void 0!==f?f:0);this.drawBubble(g,l,r,a,o,s,e),M.registerMark(l,r,a),this.config.labels.values&&void 0!==t.compare.size&&a>=1.2*p&&this.drawValueLabel(g,l,r,a,t.compare.size,o.fill)}this.drawBubble(x,r,a,d,l,s,e),M.registerMark(r,a,d),void 0!==t.share&&d>0&&this.drawShareSlice(x,r,a,d,t.share,o(e)),this.config.labels.values&&void 0!==t.size&&this.drawValueLabel(x,r,a,d,t.size,!0===l.hatch?"#ffffff":l.fill),L.push({point:t,cx:r,cy:a,r:d,seriesIndex:s,hue:e,treatment:l})}this.drawNameLabels(w,M,L),i.frame.drawTickLabels(w,{ticksX:e,ticksY:l,xDecimals:r,yDecimals:a,showXLabels:c,showYLabels:d}),""!==u&&i.frame.drawPanelTitle(w,u)}bubbleExceedsPanel(t,i,s,h){return i-h<t.x||i+h>t.x+t.width||s-h<t.y||s+h>t.y+t.height}drawBubble(t,i,s,h,e,n,o){h<=0||t.circle(2*h).center(i,s).fill(this.treatmentFill(e,n,o)).stroke({color:e.stroke,width:e.strokeWidth})}drawShareSlice(t,i,s,h,e,n){if(e<=0)return;if(e>=1)return void t.circle(2*h).center(i,s).fill(n);const o=2*e*Math.PI,l=i+h*Math.sin(o),r=s-h*Math.cos(o),a=o>Math.PI?1:0;t.path(`M ${i} ${s} L ${i} ${s-h} A ${h} ${h} 0 ${a} 1 ${l} ${r} Z`).fill(n).stroke("none")}drawValueLabel(t,i,s,h,e,n){const o=c.number(e,"decimal",1,1);this.textWidth(o)+.4*this.em>2*h||this.drawText(t,o,i,s+.35*this.em,{anchor:"middle",color:S(n.startsWith("#")?n:"#ffffff")})}drawNameLabels(t,i,s){const h=[...s].sort(((t,i)=>{var s,h;return(null!==(s=i.point.size)&&void 0!==s?s:0)-(null!==(h=t.point.size)&&void 0!==h?h:0)})),{selected:e,unknownNames:n}=i.selectCandidates(h,this.config.labels.points,this.config.labels.max,(t=>t.point.name));n.length>0&&this.addWarningOnce("xy-label-unknown",{names:n.join(", ")});const o=e.map((t=>({name:t.point.name,cx:t.cx,cy:t.cy,r:t.r,width:this.textWidth(t.point.name),height:1.1*this.em})));for(const s of i.place(o))this.drawText(t,s.candidate.name,s.x,s.y+.9*s.candidate.height,{})}formatTick(t,i){return c.number(t,"decimal",i,i)}}const N=["xy-duplicate-point","xy-point-clipped","xy-variance-nodata","xy-label-unknown","xy-series-overflow","xy-point-budget","bubble-size-negative","bubble-share-range","bubble-scale-overflow"],C=class{constructor(i){t(this,i),this.tableName="",this.dataVersion=0,this.chartTitle="",this.share=null,this.compareFamily=null,this.facet=null,this.pointLevel="category",this.seriesLevel=null,this.aspect=16/9,this.limit=0,this.filter="",this.sizeAreaPerUnit=0,this.i18n=new Map,this.containerWidth=0,this.svgMarkup=""}getDb(){return this.stores||(this.stores=l(this.element)),this.stores.db.db}componentWillLoad(){this.rebuild()}componentWillUpdate(){this.rebuild()}rebuild(){const t=this.prepareStyle(),i=this.tableName?r(this.tableName,this.filter):"";this.chart=new D(new u(this.ruleSetConfig),this.getDb(),i,{chartTitle:this.chartTitle,x:this.x,y:this.y,size:this.size,share:this.share,compareFamily:this.compareFamily,labels:this.labels,legend:this.legend,facet:this.facet,pointLevel:this.pointLevel,seriesLevel:this.seriesLevel,aspect:this.aspect,limit:this.limit,sizeAreaPerUnit:this.sizeAreaPerUnit},t,this.containerWidth||0),this.chart.setI18n(this.i18n),this.svgMarkup=this.chart.hasNoData()?"":this.chart.toString(),this.syncWarnings(this.chart.getWarnings())}syncWarnings(t){if(void 0===this.errors)return;const i=new Map(t.map((t=>[t.code,t.data])));for(const t of N){const s=`WARN_${t}`;if(i.has(t)){const h=void 0!==this.translate?this.translate(`.${t}`,i.get(t)):t;this.errors.addOrReplace({id:s,type:"warning",message:h})}else this.errors.remove(s)}}prepareStyle(){return new $(new L,new v,new m(new b),new f).adapt(this.styles)}render(){if(void 0===this.chart)return i(s,null);if(this.chart.hasNoData()){const t=this.i18n.get("no-data")||"==No Data==";return i(s,null,i("p",{class:"warning"},t))}return i(s,null,i("div",{innerHTML:this.svgMarkup}))}get element(){return h(this)}};C.style=':host{position:relative;display:inline-block}.warning{font-family:var(--bn-font-family, "Noto Sans", "Helvetica Neue", Helvetica, sans-serif);color:var(--bn-font-color, black)}';export{C as ibcs_chart_bubble}
@@ -1 +0,0 @@
1
- import{r as t,h as e,H as n,g as s}from"./p-C5UYpZUU.js";import{f as i,e as r,w as o,b as a}from"./p-CsJ84YRk.js";import{LAYOUT_STATE_VERSION as l}from"./index.esm.js";import{o as d,r as c,m as u,a as h}from"./p-BcLsoDrW.js";import{w as f,a as p}from"./p-DtLI_CzV.js";import"./p-D5e8I9Qe.js";import"./p-BbmobTg0.js";import"./p-B5Jd_eCX.js";const g=["*","/","+","-","x","÷","none"];function v(t){switch(t){case"*":case"x":return"×";case"/":case"÷":return"÷";case"+":return"+";case"-":return"−";default:return""}}function y(t,e,n){return t.find((t=>t.from===e&&t.to===n))}function m(t){return 2*(t-1)+1}function b(t){return 2*(t-1)+1}function $(t,e){const n=t.getBoundingClientRect(),s=n.left-e.left,i=n.top-e.top;return{left:s,top:i,width:n.width,height:n.height,centerX:s+n.width/2,centerY:i+n.height/2}}function x(t,e,n){switch(n){case"ltr":return e?{x:t.left+t.width,y:t.centerY}:{x:t.left,y:t.centerY};case"rtl":return e?{x:t.left,y:t.centerY}:{x:t.left+t.width,y:t.centerY};case"ttb":return e?{x:t.centerX,y:t.top+t.height}:{x:t.centerX,y:t.top};case"btt":return e?{x:t.centerX,y:t.top}:{x:t.centerX,y:t.top+t.height}}}function w(t,e,n,s,i=8){const r=-(s-1)*i/2+n*i;switch(e){case"ltr":return{x:t.left,y:t.centerY+r};case"rtl":return{x:t.left+t.width,y:t.centerY+r};case"ttb":return{x:t.centerX+r,y:t.top};case"btt":return{x:t.centerX+r,y:t.top+t.height}}}function S(t,e,n,s){switch(n){case"straight":return function(t,e){return{path:`M ${t.x} ${t.y} L ${e.x} ${e.y}`,midpoint:{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}}(t,e);case"curved":return function(t,e,n){let s,i;if("ltr"===n||"rtl"===n){const n=(t.x+e.x)/2;s={x:n,y:t.y},i={x:n,y:e.y}}else{const n=(t.y+e.y)/2;s={x:t.x,y:n},i={x:e.x,y:n}}return{path:`M ${t.x} ${t.y} C ${s.x} ${s.y}, ${i.x} ${i.y}, ${e.x} ${e.y}`,midpoint:{x:.125*t.x+.375*s.x+.375*i.x+.125*e.x,y:.125*t.y+.375*s.y+.375*i.y+.125*e.y}}}(t,e,s);default:return function(t,e,n){let s,i;if("ltr"===n||"rtl"===n){const n=t.x+.7*(e.x-t.x);s=`M ${t.x} ${t.y} L ${n} ${t.y} L ${n} ${e.y} L ${e.x} ${e.y}`,i={x:n,y:(t.y+e.y)/2}}else{const n=t.y+.7*(e.y-t.y);s=`M ${t.x} ${t.y} L ${t.x} ${n} L ${e.x} ${n} L ${e.x} ${e.y}`,i={x:(t.x+e.x)/2,y:n}}return{path:s,midpoint:i}}(t,e,s)}}function k(t,e,n,s){const i=.7;switch(s){case"ltr":{const s=t.left+t.width;return{x:s+(Math.min(e.left,n.left)-s)*i,y:t.centerY}}case"rtl":{const s=t.left,r=Math.max(e.left+e.width,n.left+n.width);return{x:r+(s-r)*i,y:t.centerY}}case"ttb":{const s=t.top+t.height,r=Math.min(e.top,n.top);return{x:t.centerX,y:s+(r-s)*i}}case"btt":{const s=t.top,r=Math.max(e.top+e.height,n.top+n.height);return{x:t.centerX,y:r+(s-r)*i}}}}function R(t,e,n){var s,i;return Object.assign({stroke:null!==(s=null==n?void 0:n.color)&&void 0!==s?s:t,strokeWidth:null!==(i=null==n?void 0:n.width)&&void 0!==i?i:e},(null==n?void 0:n.dasharray)?{strokeDasharray:n.dasharray}:{})}const M=class{validateEdgesProp(t){const e="ERR_edges",n=function(t){const e=[];if(!t||""===t.trim())return e.push("edges: value is required"),e;let n;try{n=JSON.parse(t)}catch(t){return e.push("edges: invalid JSON structure"),e}if(!Array.isArray(n))return e.push("edges: must be an array"),e;if(0===n.length)return e.push("edges: array must not be empty"),e;const s=new Set,i=new Set;n.forEach(((t,n)=>{if("object"!=typeof t||null===t)return void e.push(`edges[${n}]: must be an object`);const r=t;if("string"!=typeof r.from||""===r.from.trim()?e.push(`edges[${n}]: 'from' is required and must be a non-empty string`):s.add(r.from),"string"!=typeof r.to||""===r.to.trim()?e.push(`edges[${n}]: 'to' is required and must be a non-empty string`):(s.add(r.to),i.add(r.to)),void 0!==r.operator&&("string"==typeof r.operator&&g.includes(r.operator)||e.push(`edges[${n}]: 'operator' must be one of: ${g.join(", ")}`)),void 0!==r.label&&"string"!=typeof r.label&&e.push(`edges[${n}]: 'label' must be a string`),void 0!==r.style)if("object"!=typeof r.style||null===r.style)e.push(`edges[${n}]: 'style' must be an object`);else{const t=r.style;void 0!==t.color&&"string"!=typeof t.color&&e.push(`edges[${n}]: 'style.color' must be a string`),void 0!==t.width&&"number"!=typeof t.width&&e.push(`edges[${n}]: 'style.width' must be a number`),void 0!==t.dasharray&&"string"!=typeof t.dasharray&&e.push(`edges[${n}]: 'style.dasharray' must be a string`)}}));const r=Array.from(s).filter((t=>!i.has(t)));return 0===r.length?e.push("edges: tree has no root node (circular reference detected)"):r.length>1&&e.push(`edges: tree has multiple root nodes: ${r.join(", ")}`),e}(t);n.length>0?(this.errors.addOrReplace({id:e,type:"error",message:`edges: ${n.join("; ")}`}),this.treeConfig=null):(this.errors.remove(e),this.treeConfig=function(t){if(!t||""===t.trim())return null;try{const e=JSON.parse(t);if(!Array.isArray(e))return null;const n=e,s=function(t){const e=new Map;for(const n of t){const t=e.get(n.from)||[];t.push(n.to),e.set(n.from,t)}return e}(n),i=function(t){const e=new Set;for(const n of t)e.add(n.from),e.add(n.to);return e}(n),r=function(t,e){const n=new Set;for(const e of t)n.add(e.to);const s=Array.from(e).filter((t=>!n.has(t)));return 1===s.length?s[0]:null}(n,i);return{edges:n,adjacencyList:s,rootNode:r,allNodes:i}}catch(t){return console.error("parseTreeConfig: failed to parse tree configuration",t),null}}(t)),this.recalculateLayout()}validateDirection(t){const e="ERR_direction",n=["ltr","rtl","ttb","btt"];n.includes(t)?this.errors.remove(e):this.errors.addOrReplace({id:e,type:"warning",message:`direction: invalid value '${t}', must be one of: ${n.join(", ")}`}),this.recalculateLayout()}validateLevelSpacing(t){const e="ERR_levelSpacing";!i(t)||t<0?this.errors.addOrReplace({id:e,type:"warning",message:`level-spacing: invalid value '${t}', must be a non-negative number`}):this.errors.remove(e),this.recalculateLayout()}validateNodeSpacing(t){const e="ERR_nodeSpacing";!i(t)||t<0?this.errors.addOrReplace({id:e,type:"warning",message:`node-spacing: invalid value '${t}', must be a non-negative number`}):this.errors.remove(e),this.recalculateLayout()}validateEdgeStyle(t){const e="ERR_edgeStyle",n=["straight","orthogonal","curved"];n.includes(t)?this.errors.remove(e):this.errors.addOrReplace({id:e,type:"warning",message:`edge-style: invalid value '${t}', must be one of: ${n.join(", ")}`})}validateShowOperators(t){const e="ERR_showOperators";r(t)?this.errors.remove(e):this.errors.addOrReplace({id:e,type:"warning",message:`show-operators: invalid value '${t}', must be 'true' or 'false'`})}constructor(e){t(this,e),this.treeConfig=null,this.layout=null,this.nodeRects=new Map,this.svgWidth=0,this.svgHeight=0,this.resizeObserver=null,this.gridContainer=null,this.direction="ltr",this.levelSpacing=60,this.nodeSpacing=20,this.edgeStyle="orthogonal",this.showOperators="true",o(this),f(this),this.errors=p(this),this.componentStyle=a(this)}async getLayoutState(t){var e,n,s,i,r,o,a,f,p,g,v;const y=null!==(e=null==t?void 0:t.detail)&&void 0!==e?e:"summary",m=d(this.element),b=this.componentStyle((t=>{var e;return(null===(e=t.global)||void 0===e?void 0:e.fontSizePx)||13.3333})),$={version:l,tag:this.element.localName,id:h(this.element),slot:null!==(n=this.element.getAttribute("slot"))&&void 0!==n?n:void 0,rect:u(this.element,m),em:{fontSizePx:b,appliedScaleFactor:1},regions:[],metadata:{nodeCount:null!==(i=null===(s=this.treeConfig)||void 0===s?void 0:s.allNodes.size)&&void 0!==i?i:0,edgeCount:null!==(o=null===(r=this.treeConfig)||void 0===r?void 0:r.edges.length)&&void 0!==o?o:0},diagnostics:c(this.element)},x=null===(a=this.element.shadowRoot)||void 0===a?void 0:a.querySelector(".tree-grid");if(x&&$.regions.push({id:"grid",rect:u(x,m)}),"full"!==y||!this.treeConfig)return $;const w=[];for(const t of this.treeConfig.allNodes){const e=this.element.querySelector(`[slot="${t}"]`);if(!e)continue;const n={kind:"node",nodeId:t,rect:u(e,m)};w.push(n)}const S=Array.from(null!==(p=null===(f=this.element.shadowRoot)||void 0===f?void 0:f.querySelectorAll("svg.edge-layer path"))&&void 0!==p?p:[]);let k=0;for(const t of this.treeConfig.edges){if(!this.nodeRects.get(t.from)||!this.nodeRects.get(t.to))continue;const e=S[k++];if(!e)break;const n={kind:"edge",from:t.from,to:t.to,operator:t.operator,path:null!==(g=e.getAttribute("d"))&&void 0!==g?g:void 0,rect:u(e,m)};w.push(n)}return null===(v=this.element.shadowRoot)||void 0===v||v.querySelectorAll("svg.edge-layer g.operator-group").forEach((t=>{var e,n;const s=null!==(n=null===(e=t.textContent)||void 0===e?void 0:e.trim())&&void 0!==n?n:"";if(!s)return;const i={kind:"label",role:"operator",text:s,rect:u(t,m)};w.push(i)})),$.elements=w,$}getTreeStyle(){return this.componentStyle((t=>({edgeColor:t["bn-tree"].edgeColor,edgeWidth:t["bn-tree"].edgeWidth,operatorCircleRadius:t["bn-tree"].operatorCircleRadius,operatorFontSize:t.global.fontSizePx*t["bn-tree"].operatorFontSizeScale,operatorColor:t["bn-tree"].operatorColor})))}componentWillLoad(){this.validateEdgesProp(this.edges),this.validateDirection(this.direction),this.validateLevelSpacing(this.levelSpacing),this.validateNodeSpacing(this.nodeSpacing),this.validateEdgeStyle(this.edgeStyle),this.validateShowOperators(this.showOperators)}componentDidLoad(){this.setupResizeObserver(),requestAnimationFrame((()=>{this.updateNodeRects()}))}disconnectedCallback(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}setupResizeObserver(){var t;this.gridContainer=null===(t=this.element.shadowRoot)||void 0===t?void 0:t.querySelector(".tree-grid"),this.gridContainer&&(this.resizeObserver=new ResizeObserver((()=>{this.updateNodeRects()})),this.resizeObserver.observe(this.gridContainer),this.element.querySelectorAll("[slot]").forEach((t=>{this.resizeObserver.observe(t)})))}recalculateLayout(){this.layout=this.treeConfig?function(t,e,n,s){if(!t.rootNode)return{positions:new Map,gridTemplateColumns:"",gridTemplateRows:"",maxLevel:0,maxIndex:0};const i=function(t){const e=new Map;if(!t.rootNode)return e;const n=[{node:t.rootNode,level:0}],s=new Set;for(;n.length>0;){const{node:i,level:r}=n.shift();if(s.has(i))continue;s.add(i),e.set(i,r);const o=t.adjacencyList.get(i)||[];for(const t of o)s.has(t)||n.push({node:t,level:r+1})}return e}(t),r=function(t){const e=new Map;if(!t.rootNode)return e;let n=0;return function s(i){const r=e.get(i);if(r)return r;const o=t.adjacencyList.get(i)||[];if(0===o.length){const t={startIndex:n,endIndex:n};return e.set(i,t),n++,t}let a=1/0,l=-1/0;for(const t of o){const e=s(t);a=Math.min(a,e.startIndex),l=Math.max(l,e.endIndex)}const d={startIndex:a,endIndex:l};return e.set(i,d),d}(t.rootNode),e}(t),o=function(t,e,n,s){var i,r;const o=new Map,a=Math.max(...Array.from(e.values()));for(const l of t.allNodes){const t=null!==(i=e.get(l))&&void 0!==i?i:0,d=null!==(r=n.get(l))&&void 0!==r?r:{startIndex:0,endIndex:0};let c,u,h;switch(s){case"ltr":c=t+1,u=d.startIndex+1,h=d.endIndex-d.startIndex+1;break;case"rtl":c=a-t+1,u=d.startIndex+1,h=d.endIndex-d.startIndex+1;break;case"ttb":u=t+1,c=d.startIndex+1,h=1;break;case"btt":u=a-t+1,c=d.startIndex+1,h=1}o.set(l,{nodeId:l,level:t,index:d.startIndex,gridColumn:c,gridRow:u,gridRowSpan:h})}return o}(t,i,r,e),a=Math.max(...Array.from(i.values())),l=Math.max(...Array.from(r.values()).map((t=>t.endIndex))),{gridTemplateColumns:d,gridTemplateRows:c}=function(t,e,n,s,i){const r=t+1,o=e+1;if("ltr"===n||"rtl"===n){const t=[];for(let e=0;e<r;e++)t.push("auto"),e<r-1&&t.push(`${s}px`);const e=[];for(let t=0;t<o;t++)e.push("auto"),t<o-1&&e.push(`${i}px`);return{gridTemplateColumns:t.join(" "),gridTemplateRows:e.join(" ")}}{const t=[];for(let e=0;e<r;e++)t.push("auto"),e<r-1&&t.push(`${s}px`);const e=[];for(let t=0;t<o;t++)e.push("auto"),t<o-1&&e.push(`${i}px`);return{gridTemplateColumns:e.join(" "),gridTemplateRows:t.join(" ")}}}(a,l,e,n,s);return{positions:o,gridTemplateColumns:d,gridTemplateRows:c,maxLevel:a,maxIndex:l}}(this.treeConfig,this.direction,this.levelSpacing,this.nodeSpacing):null}updateNodeRects(){if(!this.treeConfig||!this.gridContainer)return;const t=this.gridContainer.getBoundingClientRect(),e=new Map;for(const n of this.treeConfig.allNodes){const s=this.element.querySelector(`[slot="${n}"]`);s&&e.set(n,$(s,t))}this.nodeRects=e,this.svgWidth=t.width,this.svgHeight=t.height}getSlotStyle(t){if(!this.layout)return{};const e=this.layout.positions.get(t);return e?"ltr"===this.direction||"rtl"===this.direction?{"grid-column":String(m(e.gridColumn)),"grid-row":`${b(e.gridRow)} / span ${n=e.gridRowSpan,n<=1?1:2*(n-1)+1}`,"align-self":"center"}:{"grid-row":String(b(e.gridRow)),"grid-column":String(m(e.gridColumn)),"justify-self":"center"}:{};var n}renderEdges(){var t;if(!this.treeConfig||0===this.nodeRects.size)return null;const n=this.getTreeStyle(),s=[],i=[],r=new Map;for(const t of this.treeConfig.edges){const e=r.get(t.to)||[];e.push(t.from),r.set(t.to,e)}for(const t of this.treeConfig.edges){const i=this.nodeRects.get(t.from),o=this.nodeRects.get(t.to);if(!i||!o)continue;const a=x(i,!0,this.direction),l=r.get(t.to)||[];let d;if(l.length>1){const e=l.indexOf(t.from);d=w(o,this.direction,e,l.length)}else d=x(o,!1,this.direction);const{path:c}=S(a,d,this.edgeStyle,this.direction),u=R(n.edgeColor,n.edgeWidth,t.style);s.push(e("path",{key:`edge-${t.from}-${t.to}`,d:c,fill:"none",stroke:u.stroke,"stroke-width":u.strokeWidth,"stroke-dasharray":u.strokeDasharray}))}if("true"===this.showOperators)for(const[s,r]of this.treeConfig.adjacencyList.entries()){const o=this.nodeRects.get(s);if(o)for(let a=0;a<r.length-1;a++){const l=r[a],d=r[a+1],c=y(this.treeConfig.edges,s,l);if(!(null==c?void 0:c.operator)||"none"===c.operator)continue;const u=this.nodeRects.get(l),h=this.nodeRects.get(d);if(!u||!h)continue;const f=null!==(t=c.label)&&void 0!==t?t:v(c.operator),p=k(o,u,h,this.direction);i.push(e("g",{key:`operator-${s}-${l}`,class:"operator-group"},e("circle",{cx:p.x,cy:p.y,r:n.operatorCircleRadius,fill:"white",stroke:n.edgeColor,"stroke-width":n.edgeWidth}),e("text",{x:p.x,y:p.y,"text-anchor":"middle","dominant-baseline":"central",style:{fontSize:`${n.operatorFontSize}px`,fill:n.operatorColor,fontWeight:"bold"}},f)))}}return e("svg",{class:"edge-layer",width:this.svgWidth,height:this.svgHeight,style:{position:"absolute",top:"0",left:"0",pointerEvents:"none"}},s,i)}renderSlots(){return this.treeConfig&&this.layout?Array.from(this.treeConfig.allNodes).map((t=>e("div",{key:t,class:"tree-node",style:this.getSlotStyle(t)},e("slot",{name:t})))):null}getFontStyles(){return this.componentStyle((t=>{var e,n,s,i;return{"--bn-font-family":(null===(e=t.global)||void 0===e?void 0:e.fontFamily)||"'Noto Sans', sans-serif","--bn-font-size":`${(null===(n=t.global)||void 0===n?void 0:n.fontSizePx)||13.3333}px`,"--bn-font-color":(null===(s=t.global)||void 0===s?void 0:s.fontColor)||"#000000","--bn-font-background":(null===(i=t.global)||void 0===i?void 0:i.fontBackgroundColor)||"#ffffff"}}))}render(){const t=this.getFontStyles();return e(n,{style:t},this.treeConfig&&this.layout?e("div",{class:"tree-container"},e("div",{class:"tree-grid",style:{display:"grid","grid-template-columns":this.layout.gridTemplateColumns,"grid-template-rows":this.layout.gridTemplateRows,position:"relative"}},this.renderEdges(),this.renderSlots())):e("div",{class:"tree-container tree-error"},e("slot",null)))}get element(){return s(this)}static get watchers(){return{edges:[{validateEdgesProp:0}],direction:[{validateDirection:0}],levelSpacing:[{validateLevelSpacing:0}],nodeSpacing:[{validateNodeSpacing:0}],edgeStyle:[{validateEdgeStyle:0}],showOperators:[{validateShowOperators:0}]}}};M.style=':host{display:inline-block;position:relative;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);color:var(--bn-font-color, #000000)}.tree-container{position:relative;display:inline-block}.tree-grid{position:relative;display:grid;align-items:center}.tree-node{position:relative;z-index:1;border:1px solid #404040;background:var(--bn-font-background, white)}.edge-layer{position:absolute;top:0;left:0;z-index:0;pointer-events:none;overflow:visible}.tree-error{display:flex;flex-wrap:wrap;gap:20px}';export{M as bn_tree}
@@ -1 +0,0 @@
1
- import{r as t,d as s,f as i,h as e,H as r,g as a}from"./p-C5UYpZUU.js";import{o as n}from"./p-BcLsoDrW.js";import{w as o,o as l,c as h}from"./p-DjPXefnq.js";import{a as u}from"./p-D5e8I9Qe.js";import{w as c,a as d,g as p,p as v}from"./p-EtT29btN.js";import{i as f,a as m,w as y,b as g,c as b}from"./p-CsJ84YRk.js";import{w as x,a as _}from"./p-DtLI_CzV.js";import{r as w,s as $}from"./p-BbmobTg0.js";import{f as R,c as L,d as S,e as E,p as j,t as A}from"./p-CG_Bcm6V.js";import"./index.esm.js";import"./p-B5Jd_eCX.js";const C={rowGroup:0,category:1,subCategory:2},N=class{validateX(t){this.validateAxisSpec("x",t)}validateY(t){this.validateAxisSpec("y",t)}validateIso(t){this.validateObjectSpec("iso",t,null,(t=>R(t)))}validateLevel(t){const s="ERR_level",i=["auto","category","subcategory"];f(t)||i.includes(t.trim().toLowerCase())?this.errors.remove(s):this.errors.addOrReplace({id:s,type:"warning",message:`level: invalid value '${t}' — expected ${i.join("/")}; using 'auto'.`})}validateSeriesLevel(t){const s="ERR_seriesLevel",i=["auto","rowgroup","category","none"];f(t)||i.includes(t.trim().toLowerCase())?this.errors.remove(s):this.errors.addOrReplace({id:s,type:"warning",message:`series-level: invalid value '${t}' — expected ${i.join("/")}; using 'auto'.`})}validateFacet(t){this.validateObjectSpec("facet",t,null,(t=>L(t)))}validateLabels(t){this.validateObjectSpec("labels",t,null,(t=>S(t,this.labelDefaults())))}validateLegend(t){this.validateObjectSpec("legend",t,null,(t=>E(t)))}validateAspect(t){const s="ERR_aspect";f(t)||null!==this.parseAspect(t)?this.errors.remove(s):this.errors.addOrReplace({id:s,type:"warning",message:`aspect: invalid value '${t}' — expected "w:h" (e.g. "16:9"); using the default.`})}validateLimit(t){const s="ERR_limit";m(t)&&Number(t)>=0?this.errors.remove(s):this.errors.addOrReplace({id:s,type:"warning",message:`limit: invalid value '${t}' — expected a non-negative integer; using 0.`})}validateScale(t){const s="ERR_scale";if(f(t))return void this.errors.remove(s);const{mode:i,factor:e}=v(t);"factor"===i&&(void 0===e||e<=0)?this.errors.addOrReplace({id:s,type:"warning",message:`scale: invalid value '${t}' — expected none/auto or a positive number.`}):this.errors.remove(s)}constructor(s){t(this,s),this.datasetName="",this.dataVersion=0,this.datasetMeta=null,this.appliedScaleFactor=1,this.layoutObserver=null,this.activeErrors=new Set,this.chartTitle="",this.filter="",this.iso="",this.level="auto",this.seriesLevel="auto",this.facet="",this.labels="",this.legend="",this.aspect="16:9",this.limit=0,this._autoScaleGuard=!1,this._lastObservedWidth=0,this.translateForInner=(t,s)=>this.t(t,s),y(this),x(this),c(this,(t=>{this.datasetName=(null==t?void 0:t.startsWith("$"))?t.substring(1):t||"",this.dataVersion=this.dataVersion+1}),((t,s)=>{this.datasetMeta=s})),this.errors=_(this),this.componentStyle=g(this),this.ruleSetConfig=o(this),this.t=d(this).t}componentWillLoad(){this.validateX(this.x),this.validateY(this.y),this.validateIso(this.iso),this.validateLevel(this.level),this.validateSeriesLevel(this.seriesLevel),this.validateFacet(this.facet),this.validateLabels(this.labels),this.validateLegend(this.legend),this.validateAspect(this.aspect),this.validateLimit(this.limit),this.validateScale(this.scale)}componentDidRender(){const{mode:t}=v(this.scale);if("auto"!==t&&"empty"!==t){this._autoScaleGuard=!1;const t=p(this.element),s="WARN_overflow";return void(t.width>0&&this.element.scrollWidth>t.width+1?this.errors.addOrReplace({id:s,type:"warning",message:"Chart exceeds available space and will be cut off. Check the scale value."}):this.errors.remove(s))}if(this._autoScaleGuard)return void(this._autoScaleGuard=!1);const i=this.element,{width:e}=p(i);if(e<=0)return;this._lastObservedWidth=e;const r=this.componentStyle((t=>{var s;return(null===(s=t.global)||void 0===s?void 0:s.fontSizePx)||13.3333})),a=i.scrollWidth,n=this.appliedScaleFactor;if(!Number.isFinite(a)||a<=e+1)return void this.errors.remove("AUTO_scale");const o=Math.max(.3,n*(e-1)/a);Math.abs(o-n)<.01||(i.style.setProperty("--bn-font-size",r*o+"px"),"empty"===t?this.errors.addOrReplace({id:"AUTO_scale",type:"warning",message:`Auto-scaled chart by factor ${o.toFixed(3)}`}):this.errors.remove("AUTO_scale"),this._autoScaleGuard=!0,s((()=>{this.appliedScaleFactor=o})))}componentDidLoad(){this.layoutObserver=l(this.element,(()=>{if(this._autoScaleGuard)return;const{width:t}=p(this.element);t>0&&Math.abs(t-this._lastObservedWidth)>2&&(this._lastObservedWidth=t,i(this))})),requestAnimationFrame((()=>{requestAnimationFrame((()=>{if(this._autoScaleGuard)return;const{width:t}=p(this.element);this._lastObservedWidth=t,i(this)}))}))}disconnectedCallback(){var t;null===(t=this.layoutObserver)||void 0===t||t.disconnect(),this.layoutObserver=null}labelDefaults(){return{points:"auto",values:!1,max:12}}setBlockingError(t,s){null===s?(this.errors.remove(t),this.activeErrors.delete(t)):(this.errors.addOrReplace({id:t,type:"error",message:s}),this.activeErrors.add(t))}hasBlockingErrors(){return this.activeErrors.size>0}validateAxisSpec(t,s){var i;const e=`ERR_xy_json_${t}`,r=`ERR_xy_measure_${t}`,a=`WARN_xy_fields_${t}`,n="x"===t||"y"===t||"size"===t,{data:o,parseError:l}=j(s,"measure");if(l)return this.setBlockingError(e,this.t(".xy-prop-json",{prop:t})),this.setBlockingError(r,null),void this.errors.remove(a);if(this.setBlockingError(e,null),null===o)return this.setBlockingError(r,n?this.t(".xy-measure-invalid",{prop:t,measure:""}):null),void this.errors.remove(a);const h="share"===t?null:A(o),u=null!==(i=o.measure)&&void 0!==i?i:"";b(u)?this.setBlockingError(r,null):this.setBlockingError(r,this.t(".xy-measure-invalid",{prop:t,measure:u})),this.reportSpecIssues(a,t,h)}validateObjectSpec(t,s,i,e){const r=`ERR_xy_json_${t}`,a=`WARN_xy_fields_${t}`,{data:n,parseError:o}=j(s,i);if(o)return this.setBlockingError(r,this.t(".xy-prop-json",{prop:t})),void this.errors.remove(a);this.setBlockingError(r,null),null!==n?this.reportSpecIssues(a,t,e(n)):this.errors.remove(a)}reportSpecIssues(t,s,i){const e=[];null!==i&&i.invalidFields.length>0&&e.push(`invalid: ${i.invalidFields.join(", ")}`),null!==i&&i.unknownKeys.length>0&&e.push(`unknown: ${i.unknownKeys.join(", ")}`),e.length>0?this.errors.addOrReplace({id:t,type:"warning",message:`${s}: ignored sub-fields (${e.join("; ")}).`}):this.errors.remove(t)}prepareAxis(t,s){const{data:i,parseError:e}=j(s,"measure");if(e||null===i)return null;const{config:r}=A(i);return null!==r&&b(r.measure)?(void 0!==r.min&&void 0!==r.max&&r.min>=r.max?(this.errors.addOrReplace({id:`WARN_xy_domain_${t}`,type:"warning",message:`${t}: min must be smaller than max; the override is ignored.`}),r.min=void 0,r.max=void 0):this.errors.remove(`WARN_xy_domain_${t}`),r):null}prepareIso(){const{data:t,parseError:s}=j(this.iso,null);return s||null===t?null:R(t).config}prepareLabels(){const t=this.labelDefaults(),{data:s,parseError:i}=j(this.labels,null);return i||null===s?{points:t.points,values:t.values,max:t.max}:S(s,t).config}prepareLegend(){const{data:t,parseError:s}=j(this.legend,null);return s||null===t?{show:!0,position:"right"}:E(t).config}prepareFacet(){const{data:t,parseError:s}=j(this.facet,null);return s||null===t?null:L(t).config}preparePointLevel(){var t,s;const i=null===(t=this.level)||void 0===t?void 0:t.trim().toLowerCase();if("category"===i)return"category";if("subcategory"===i)return"subCategory";const e=null===(s=this.datasetMeta)||void 0===s?void 0:s.suggestedLevel;return"rowGroup"===e||"category"===e||"subCategory"===e?e:"category"}prepareSeriesLevel(t){var s;const i=null===(s=this.seriesLevel)||void 0===s?void 0:s.trim().toLowerCase();return"none"===i?null:"rowgroup"===i?"rowGroup":"category"===i||"subCategory"===t?"category":"category"===t?"rowGroup":null}validateCrossProp(t,s){const i=new Set;for(const s of t){if(void 0===s)continue;const t=w(s);null!==t&&"scenario"===t.kind&&i.add($(t.slot))}this.setBlockingError("ERR_xy_family",i.size>1?this.t(".xy-family-mixed",{families:[...i].join(", ")}):null);const e=this.preparePointLevel(),r=this.prepareSeriesLevel(e),a=null!==s?"rowgroup"===s.level?"rowGroup":"category":null;let n=null;if(null!==r&&C[r]>=C[e]&&(n=`series '${r}' vs point '${e}'`),null!==a){const t=null!=r?r:e;C[a]>=C[t]&&(n=`facet '${a}' vs '${t}'`)}this.setBlockingError("ERR_xy_level_order",null!==n?this.t(".xy-level-order",{detail:n}):null)}parseAspect(t){const s=/^\s*(\d+(?:\.\d+)?)\s*:\s*(\d+(?:\.\d+)?)\s*$/.exec(null!=t?t:"");if(null===s)return null;const i=Number(s[1]),e=Number(s[2]);return i<=0||e<=0?null:i/e}prepareAspect(){var t;return null!==(t=this.parseAspect(this.aspect))&&void 0!==t?t:16/9}prepareLimit(){const t=Math.floor(Number(this.limit)||0);return t>0?t:0}i18nLocalKeys(){return["no-data","axis.in","legend.title"]}prepareI18n(){const t=new Map(this.i18nLocalKeys().map((t=>[t,this.t(".".concat(t))]))),s=new Map(u.map((t=>[t,this.t("global.".concat(t))])));return new Map([...s.entries(),...t.entries()])}prepareStyle(){const t=this.getEffectiveScaleFactor(),s=this.element.localName;return this.componentStyle((i=>{const e=i.global.fontSizePx*t;return{scaleFactors:i[s].scaleFactors,fontStyles:{font:`${e}px ${i.global.fontFamily}`,size:e,color:i.global.fontColor,background:i.global.fontBackgroundColor,leading:1.8},axisStyles:i[s].axisStyles,seriesColors:i[s].seriesColors,padding:i[s].padding}}))}async getLayoutState(t){var s;const i=null!==(s=null==t?void 0:t.detail)&&void 0!==s?s:"summary",e=n(this.element),r=this.getEffectiveScaleFactor(),a=Number.isFinite(r)&&r>0?r:1,o=this.componentStyle((t=>{var s;return(null===(s=t.global)||void 0===s?void 0:s.fontSizePx)||13.3333}))*a;return h(this.element,"ibcs-chart-scatter",this.chartTitle||void 0,{fontSizePx:o,appliedScaleFactor:a},e,i)}getEffectiveScaleFactor(){const{mode:t,factor:s}=v(this.scale);return"factor"===t?s:"auto"===t||"empty"===t?this.appliedScaleFactor:1}getFontStyles(){const t=this.getEffectiveScaleFactor();return this.componentStyle((s=>{var i,e,r,a;const n=(null===(i=s.global)||void 0===i?void 0:i.fontSizePx)||13.3333;return{"--bn-font-family":(null===(e=s.global)||void 0===e?void 0:e.fontFamily)||"'Noto Sans', sans-serif","--bn-font-size":n*t+"px","--bn-font-color":(null===(r=s.global)||void 0===r?void 0:r.fontColor)||"#000000","--bn-font-background":(null===(a=s.global)||void 0===a?void 0:a.fontBackgroundColor)||"#ffffff"}}))}getDataStructure(){const t={};for(const s of["ac","pp","fc","pl"])for(const i of[1,2,3,4])t[`${s}${i}`]={type:"number",isOptional:!0,description:""};for(const[s,i]of Object.entries(this.mappedAxes())){if(null===i)continue;const e=w(i.measure);null!==e&&("scenario"===e.kind?t[e.slot].description=`${s}: ${"label"in i&&void 0!==i.label?i.label:i.measure}`:(t[e.measure.base].description=`${s}: ${i.measure} (base)`,t[e.measure.delta].description=`${s}: ${i.measure} (delta)`))}return{[this.dataStructureName()]:Object.assign({operation:{type:"string",isOptional:!1,description:""},rowGroup:{type:"string",isOptional:!0,description:""},rowGroupIndex:{type:"number",isOptional:!0,description:""},category:{type:"string",isOptional:!1,description:""},categoryIndex:{type:"number",isOptional:!1,description:""},subCategory:{type:"string",isOptional:!0,description:""},subCategoryIndex:{type:"number",isOptional:!0,description:""}},t)}}mappedAxes(){return{x:this.prepareAxis("x",this.x),y:this.prepareAxis("y",this.y)}}dataStructureName(){return"IScatterChartDataRow"}chartTemplate(){const t=this.prepareAxis("x",this.x),s=this.prepareAxis("y",this.y),i=this.prepareFacet();if(this.validateCrossProp([null==t?void 0:t.measure,null==s?void 0:s.measure],i),this.hasBlockingErrors()||null===t||null===s)return null;const r=this.preparePointLevel(),a=this.prepareI18n(),n=this.prepareStyle(),o=p(this.element).width;return e("ibcs-chart-scatter",{tableName:this.datasetName,dataVersion:this.dataVersion,chartTitle:this.chartTitle,x:t,y:s,iso:this.prepareIso(),labels:this.prepareLabels(),legend:this.prepareLegend(),facet:i,pointLevel:r,seriesLevel:this.prepareSeriesLevel(r),aspect:this.prepareAspect(),limit:this.prepareLimit(),filter:this.filter,styles:n,i18n:a,containerWidth:o,ruleSetConfig:this.ruleSetConfig(),errors:this.errors,translate:this.translateForInner})}render(){return e(r,{key:"1e347d72935a145bb50bed0516c7aeda34014547",style:this.getFontStyles()},e("div",{key:"8fb0acb5218bb5dba7252eda639a60ff6384e744",class:"container"},this.chartTemplate()))}get element(){return a(this)}static get watchers(){return{x:[{validateX:0}],y:[{validateY:0}],iso:[{validateIso:0}],level:[{validateLevel:0}],seriesLevel:[{validateSeriesLevel:0}],facet:[{validateFacet:0}],labels:[{validateLabels:0}],legend:[{validateLegend:0}],aspect:[{validateAspect:0}],limit:[{validateLimit:0}],scale:[{validateScale:0}]}}};N.style=':host{display:inline-block;position:relative;overflow:hidden;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);color:var(--bn-font-color, #000000)}.container{display:flex;flex-direction:column}';export{N as bn_chart_scatter}
@@ -1 +0,0 @@
1
- import{r as t,h as e,H as i,g as r}from"./p-C5UYpZUU.js";import{e as s,w as o,b as n}from"./p-CsJ84YRk.js";import{LAYOUT_STATE_VERSION as d}from"./index.esm.js";import{o as a,r as l,m as h,a as u}from"./p-BcLsoDrW.js";import{w as c,a as g}from"./p-DtLI_CzV.js";import"./p-D5e8I9Qe.js";import"./p-BbmobTg0.js";import"./p-B5Jd_eCX.js";function v(t){if(!t||""===t.trim()||"[]"===t)return[];try{const e=JSON.parse(t);return Array.isArray(e)?e.map(((t,e)=>{var i,r,s;return"string"==typeof t?{label:t,id:String(e)}:"object"==typeof t&&null!==t?{label:null!==(r=null!==(i=t.label)&&void 0!==i?i:t.name)&&void 0!==r?r:String(e),id:null!==(s=t.id)&&void 0!==s?s:String(e)}:{label:String(t),id:String(e)}})):[]}catch(t){return console.error("parseHeaders: failed to parse JSON",t),[]}}function p(t){if(!t||""===t.trim()||"[]"===t)return[];try{const e=JSON.parse(t);if(!Array.isArray(e))return["Headers must be an array"];const i=[],r=new Set;return e.forEach(((t,e)=>{"object"==typeof t&&null!==t&&void 0!==t.id&&("string"!=typeof t.id?i.push(`Header[${e}]: 'id' must be a string`):r.has(t.id)?i.push(`Header[${e}]: duplicate id '${t.id}'`):r.add(t.id),void 0!==t.label&&"string"!=typeof t.label&&i.push(`Header[${e}]: 'label' must be a string`))})),i}catch(t){return console.error("validateHeadersJson: failed to parse JSON",t),["Invalid JSON structure"]}}const m=class{validateRowHeaders(t){const e="ERR_rowHeaders",i=p(t);i.length>0?this.errors.addOrReplace({id:e,type:"error",message:`row-headers: ${i.join("; ")}`}):this.errors.remove(e),this.updateGridConfig()}validateColumnHeaders(t){const e="ERR_columnHeaders",i=p(t);i.length>0?this.errors.addOrReplace({id:e,type:"error",message:`column-headers: ${i.join("; ")}`}):this.errors.remove(e),this.updateGridConfig()}validateShowRowHeaders(t){const e="ERR_showRowHeaders";s(t)?this.errors.remove(e):this.errors.addOrReplace({id:e,type:"warning",message:`show-row-headers: invalid value '${t}', must be 'true' or 'false'`})}validateShowColumnHeaders(t){const e="ERR_showColumnHeaders";s(t)?this.errors.remove(e):this.errors.addOrReplace({id:e,type:"warning",message:`show-column-headers: invalid value '${t}', must be 'true' or 'false'`})}validateShowBorders(t){const e="ERR_showBorders";s(t)?this.errors.remove(e):this.errors.addOrReplace({id:e,type:"warning",message:`show-borders: invalid value '${t}', must be 'true' or 'false'`})}constructor(e){t(this,e),this.gridConfig={rows:[],columns:[]},this.chartTitle="",this.rowHeaders="[]",this.columnHeaders="[]",this.showRowHeaders="true",this.showColumnHeaders="true",this.showBorders="true",this.rowHeaderWidth="auto",this.cellGap="0px",o(this),c(this),this.errors=g(this),this.componentStyle=n(this)}async getLayoutState(t){var e,i,r,s;const o=null!==(e=null==t?void 0:t.detail)&&void 0!==e?e:"summary",n=a(this.element),c=this.componentStyle((t=>{var e;return(null===(e=t.global)||void 0===e?void 0:e.fontSizePx)||13.3333})),{rows:g,columns:v}=this.gridConfig,p={version:d,tag:this.element.localName,id:u(this.element),slot:null!==(i=this.element.getAttribute("slot"))&&void 0!==i?i:void 0,rect:h(this.element,n),em:{fontSizePx:c,appliedScaleFactor:1},regions:[],metadata:{title:this.chartTitle||void 0,rowCount:g.length,columnCount:v.length,cellCount:g.length*v.length},diagnostics:l(this.element)},m=null===(r=this.element.shadowRoot)||void 0===r?void 0:r.querySelector(".grid-container");if(m&&p.regions.push({id:"grid",rect:h(m,n)}),"full"!==o||!m)return p;const f=[],w=t=>f.push(t),b=m.querySelector(".grid-title");return b&&w({kind:"gridTitle",label:(null===(s=b.textContent)||void 0===s?void 0:s.trim())||void 0,rect:h(b,n)}),m.querySelectorAll(".grid-header-col").forEach(((t,e)=>{var i,r;w({kind:"gridHeader",columnId:null===(i=v[e])||void 0===i?void 0:i.id,label:(null===(r=t.textContent)||void 0===r?void 0:r.trim())||void 0,rect:h(t,n)})})),m.querySelectorAll(".grid-header-row").forEach(((t,e)=>{var i,r;w({kind:"gridHeader",rowId:null===(i=g[e])||void 0===i?void 0:i.id,label:(null===(r=t.textContent)||void 0===r?void 0:r.trim())||void 0,rect:h(t,n)})})),m.querySelectorAll(".grid-cell").forEach(((t,e)=>{var i,r,s,o;w({kind:"gridCell",rowId:v.length>0?null===(i=g[Math.floor(e/v.length)])||void 0===i?void 0:i.id:void 0,columnId:v.length>0?null===(r=v[e%v.length])||void 0===r?void 0:r.id:void 0,slot:null!==(o=null===(s=t.querySelector("slot"))||void 0===s?void 0:s.getAttribute("name"))&&void 0!==o?o:void 0,rect:h(t,n)})})),p.elements=f,p}getGridStyle(){return this.componentStyle((t=>t["bn-grid"]))}componentWillLoad(){this.validateRowHeaders(this.rowHeaders),this.validateColumnHeaders(this.columnHeaders),this.validateShowRowHeaders(this.showRowHeaders),this.validateShowColumnHeaders(this.showColumnHeaders),this.validateShowBorders(this.showBorders)}updateGridConfig(){var t;this.gridConfig=(t=this.columnHeaders,{rows:v(this.rowHeaders),columns:v(t)})}shouldShowRowHeaders(){return"true"===this.showRowHeaders&&this.gridConfig.rows.length>0}shouldShowColumnHeaders(){return"true"===this.showColumnHeaders&&this.gridConfig.columns.length>0}shouldShowBorders(){return"true"===this.showBorders}getGridTemplateColumns(){const t=[];this.shouldShowRowHeaders()&&t.push(this.rowHeaderWidth);const e=this.gridConfig.columns.length||1;for(let i=0;i<e;i++)t.push("auto");return t.join(" ")}getGridTemplateRows(){const t=[];this.chartTitle&&t.push("auto"),this.shouldShowColumnHeaders()&&t.push("auto");const e=this.gridConfig.rows.length||1;for(let i=0;i<e;i++)t.push("auto");return t.join(" ")}renderTitle(){if(!this.chartTitle)return null;const t=(this.shouldShowRowHeaders()?1:0)+this.gridConfig.columns.length;return e("div",{class:"grid-title",style:{"grid-column":`1 / span ${t}`,"grid-row":"1"}},this.chartTitle)}renderColumnHeaders(){if(!this.shouldShowColumnHeaders())return null;const t=this.getGridStyle(),i=this.shouldShowBorders()?`${t.borderWidth}px solid ${t.borderColor}`:"none",r=this.shouldShowRowHeaders()?2:1,s=this.chartTitle?2:1;return this.gridConfig.columns.map(((o,n)=>{const d=n>0;return e("div",{key:`col-header-${o.id}`,class:"grid-header grid-header-col",style:{"grid-column":String(r+n),"grid-row":String(s),"border-left":d?i:"none",padding:`${t.cellPadding}px`,"padding-left":d?`${t.cellPadding+4}px`:`${t.cellPadding}px`}},o.label)}))}renderDataCells(){const t=this.getGridStyle(),i=this.shouldShowBorders()?`${t.borderWidth}px solid ${t.borderColor}`:"none",r=this.shouldShowRowHeaders()?2:1,s=(this.chartTitle?1:0)+(this.shouldShowColumnHeaders()?1:0)+1,o=[];return this.gridConfig.rows.length>0&&this.gridConfig.columns.length>0&&this.gridConfig.rows.forEach(((n,d)=>{if(this.shouldShowRowHeaders()){const r=d>0;o.push(e("div",{key:`row-header-${n.id}`,class:"grid-header grid-header-row",style:{"grid-column":"1","grid-row":String(s+d),"border-top":r?i:"none",padding:`${t.cellPadding}px`,"padding-top":r?`${t.cellPadding+4}px`:`${t.cellPadding}px`}},n.label))}this.gridConfig.columns.forEach(((a,l)=>{const h=function(t,e){return`${t.id}-${e.id}`}(n,a),u=l>0,c=d>0;o.push(e("div",{key:`cell-${h}`,class:"grid-cell",style:{"grid-column":String(r+l),"grid-row":String(s+d),"border-left":u?i:"none","border-top":c?i:"none","padding-left":u?`${t.cellPadding+4}px`:"0","padding-top":c?`${t.cellPadding+4}px`:"0"}},e("slot",{name:h})))}))})),o}getFontStyles(){return this.componentStyle((t=>{var e,i,r,s;return{"--bn-font-family":(null===(e=t.global)||void 0===e?void 0:e.fontFamily)||"'Noto Sans', sans-serif","--bn-font-size":`${(null===(i=t.global)||void 0===i?void 0:i.fontSizePx)||13.3333}px`,"--bn-font-color":(null===(r=t.global)||void 0===r?void 0:r.fontColor)||"#000000","--bn-font-background":(null===(s=t.global)||void 0===s?void 0:s.fontBackgroundColor)||"#ffffff"}}))}render(){const t={display:"inline-grid","grid-template-columns":this.getGridTemplateColumns(),"grid-template-rows":this.getGridTemplateRows(),gap:this.cellGap};return e(i,{key:"5d23af570a5b4640c4e6cf6bcb74bb67485b73ee",style:this.getFontStyles()},e("div",{key:"75bcd69b8dc77e5d8c0c44410c49fe7ea9f6b702",class:"grid-container",style:t},this.renderTitle(),this.renderColumnHeaders(),this.renderDataCells()),e("slot",{key:"3127e96c863a8e79af76b3ee16050cfcec5bee8d"}))}get element(){return r(this)}static get watchers(){return{rowHeaders:[{validateRowHeaders:0}],columnHeaders:[{validateColumnHeaders:0}],showRowHeaders:[{validateShowRowHeaders:0}],showColumnHeaders:[{validateShowColumnHeaders:0}],showBorders:[{validateShowBorders:0}]}}};m.style=':host{display:inline-block;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);color:var(--bn-font-color, #000000)}.grid-container{display:inline-grid;box-sizing:border-box}.grid-title{font-weight:normal;padding-bottom:8px}.grid-header{display:flex;align-items:flex-end;box-sizing:border-box}.grid-header-row{justify-content:flex-end;padding-right:8px}.grid-header-col{white-space:nowrap;justify-content:flex-start}.grid-cell{position:relative;box-sizing:border-box}';export{m as bn_grid}
@@ -1 +0,0 @@
1
- import{r as t,h as s,H as i,g as e}from"./p-C5UYpZUU.js";import{w as a}from"./p-CTrNbSXN.js";import{g as r,f as n}from"./p-D5e8I9Qe.js";import{w as o,a as h}from"./p-DtLI_CzV.js";const c=class{constructor(s){t(this,s),this.namespace="_system",o(this),this.errors=h(this),a(this,(t=>{this.stores||(this.stores=r(this.element));try{const s=n(JSON.parse(t)),i=this.namespace||"_system",e=Object.assign({},this.stores.internationalization.get(i));e[this.code]=Object.assign(Object.assign({},e[this.code]),s),this.stores.internationalization.set(i,e)}catch(t){console.error(t)}}))}render(){return s(i,{key:"1b5e46fd06494aada4db697402746be6bcf950db"})}get element(){return e(this)}};c.style="bn-internationalization{display:none}";export{c as bn_internationalization}
@@ -1 +0,0 @@
1
- import{r as t,h as e,H as s,g as r}from"./p-C5UYpZUU.js";import{w as a,a as b}from"./p-DtLI_CzV.js";const c=class{constructor(e){t(this,e),a(this),this.errors=b(this)}render(){return e(s,{key:"d8c7214c5beab0eb52999b596d241ac052bee543"},e("slot",{key:"41cc485bf9666117d449642d3e7948551b5b0701"}))}get element(){return r(this)}};export{c as bn_template}