@bino-bi/bn-template-engine 1.0.0-alpha.16 → 1.0.0-alpha.18

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 (326) hide show
  1. package/dist/bn-template-engine/bn-template-engine.esm.js +1 -1
  2. package/dist/bn-template-engine/p-0107f0cc.entry.js +1 -0
  3. package/dist/bn-template-engine/p-209351c9.entry.js +1 -0
  4. package/dist/bn-template-engine/p-22d0fb7a.entry.js +1 -0
  5. package/dist/bn-template-engine/p-2e6dc267.entry.js +1 -0
  6. package/dist/bn-template-engine/p-485d23d7.entry.js +1 -0
  7. package/dist/bn-template-engine/p-5651417d.entry.js +1 -0
  8. package/dist/bn-template-engine/p-5bfdc1e5.entry.js +1 -0
  9. package/dist/bn-template-engine/p-6b75762d.entry.js +1 -0
  10. package/dist/bn-template-engine/{p-ff659485.entry.js → p-7bdc0e28.entry.js} +1 -1
  11. package/dist/bn-template-engine/p-9879c9b2.entry.js +1 -0
  12. package/dist/bn-template-engine/p-BA48JiHe.js +1 -0
  13. package/dist/bn-template-engine/p-BWKdb9ym.js +1 -0
  14. package/dist/bn-template-engine/p-BZV1b5VH.js +1 -0
  15. package/dist/bn-template-engine/p-Bdfxd_Ke.js +1 -0
  16. package/dist/bn-template-engine/p-BqhIhYr1.js +1 -0
  17. package/dist/bn-template-engine/p-C0Pwqx-O.js +1 -0
  18. package/dist/bn-template-engine/p-CBqUr7I8.js +1 -0
  19. package/dist/bn-template-engine/{p-BPDZcex5.js → p-CPzF3Q2m.js} +1 -1
  20. package/dist/bn-template-engine/p-CiudZRQr.js +1 -0
  21. package/dist/bn-template-engine/p-Dg9OcXAO.js +1 -0
  22. package/dist/bn-template-engine/p-DsTzlzxQ.js +1 -0
  23. package/dist/bn-template-engine/p-X6CxL6W-.js +1 -0
  24. package/dist/bn-template-engine/p-a130cb43.entry.js +1 -0
  25. package/dist/bn-template-engine/p-aakBGfzL.js +1 -0
  26. package/dist/bn-template-engine/p-dc745c32.entry.js +1 -0
  27. package/dist/bn-template-engine/p-e96da91f.entry.js +1 -0
  28. package/dist/bn-template-engine/p-f3d1fa06.entry.js +1 -0
  29. package/dist/bn-template-engine/p-fcb43f2c.entry.js +1 -0
  30. package/dist/bn-template-engine/p-rdqTC0_5.js +1 -0
  31. package/dist/cjs/AxisConfig-VnVelfSV.js +233 -0
  32. package/dist/cjs/LabelCollisionManager-nfD5P__k.js +412 -0
  33. package/dist/cjs/NumericScale-BAyYXpKL.js +107 -0
  34. package/dist/cjs/Order-DobBozQC.js +87 -0
  35. package/dist/cjs/SVGStyle-BQOmGWLX.js +8209 -0
  36. package/dist/cjs/SVGVariancesStyleGroup-DCGfHrqh.js +50 -0
  37. package/dist/cjs/VarianceMeasure-NY9yhiNV.js +372 -0
  38. package/dist/cjs/XYChartDataRow-B7OKrAcC.js +829 -0
  39. package/dist/cjs/bn-asset_21.cjs.entry.js +1614 -9670
  40. package/dist/cjs/bn-chart-bubble.cjs.entry.js +762 -0
  41. package/dist/cjs/bn-chart-bullet.cjs.entry.js +785 -0
  42. package/dist/cjs/bn-chart-scatter.cjs.entry.js +658 -0
  43. package/dist/cjs/bn-grid.cjs.entry.js +5 -3
  44. package/dist/cjs/bn-image.cjs.entry.js +5 -3
  45. package/dist/cjs/bn-internationalization.cjs.entry.js +2 -2
  46. package/dist/cjs/bn-ruleset.cjs.entry.js +41 -0
  47. package/dist/cjs/bn-template-engine.cjs.js +1 -1
  48. package/dist/cjs/bn-template.cjs.entry.js +1 -1
  49. package/dist/cjs/bn-text.cjs.entry.js +8 -79
  50. package/dist/cjs/bn-tree.cjs.entry.js +4 -2
  51. package/dist/cjs/{context-protocol-Cn5PL928.js → context-protocol-BDrMkhc4.js} +272 -1
  52. package/dist/cjs/editor-companion.cjs.entry.js +2 -2
  53. package/dist/cjs/ibcs-chart-bubble.cjs.entry.js +624 -0
  54. package/dist/cjs/ibcs-chart-bullet.cjs.entry.js +673 -0
  55. package/dist/cjs/ibcs-chart-scatter.cjs.entry.js +667 -0
  56. package/dist/cjs/layoutObserver-p0wXIWFg.js +350 -0
  57. package/dist/cjs/loader.cjs.js +1 -1
  58. package/dist/cjs/sanitizeHtml-LuZr1IMd.js +85 -0
  59. package/dist/cjs/{scaling-DM2UILdF.js → scaling-BmqxcNOf.js} +1 -1
  60. package/dist/cjs/withScalingGroup-BmcRlWBs.js +73 -0
  61. package/dist/cjs/{withStyled-Dx3uRw9g.js → withStyled-CRiC9fzc.js} +44 -383
  62. package/dist/collection/collection-manifest.json +7 -0
  63. package/dist/collection/components/bn-chart-bubble/bn-chart-bubble.css +10 -0
  64. package/dist/collection/components/bn-chart-bubble/bn-chart-bubble.js +1110 -0
  65. package/dist/collection/components/bn-chart-bubble/ibcs-chart-bubble.css +9 -0
  66. package/dist/collection/components/bn-chart-bubble/ibcs-chart-bubble.js +653 -0
  67. package/dist/collection/components/bn-chart-bubble/utils/BubbleChart.js +472 -0
  68. package/dist/collection/components/bn-chart-bullet/bn-chart-bullet.css +10 -0
  69. package/dist/collection/components/bn-chart-bullet/bn-chart-bullet.js +1014 -0
  70. package/dist/collection/components/bn-chart-bullet/ibcs-chart-bullet.css +9 -0
  71. package/dist/collection/components/bn-chart-bullet/ibcs-chart-bullet.js +538 -0
  72. package/dist/collection/components/bn-chart-bullet/utils/BulletChart.js +440 -0
  73. package/dist/collection/components/bn-chart-bullet/utils/model/BulletChartStyle.js +132 -0
  74. package/dist/collection/components/bn-chart-bullet/utils/model/BulletConfig.js +89 -0
  75. package/dist/collection/components/bn-chart-bullet/utils/model/index.js +2 -0
  76. package/dist/collection/components/bn-chart-scatter/bn-chart-scatter.css +10 -0
  77. package/dist/collection/components/bn-chart-scatter/bn-chart-scatter.js +965 -0
  78. package/dist/collection/components/bn-chart-scatter/ibcs-chart-scatter.css +9 -0
  79. package/dist/collection/components/bn-chart-scatter/ibcs-chart-scatter.js +580 -0
  80. package/dist/collection/components/bn-chart-scatter/utils/ScatterChart.js +409 -0
  81. package/dist/collection/components/bn-chart-structure/bn-chart-structure.js +23 -2
  82. package/dist/collection/components/bn-chart-structure/ibcs-chart-structure.js +29 -4
  83. package/dist/collection/components/bn-chart-structure/utils/StructureChart.js +3 -0
  84. package/dist/collection/components/bn-chart-time/bn-chart-time.js +27 -4
  85. package/dist/collection/components/bn-chart-time/ibcs-chart-time.js +29 -4
  86. package/dist/collection/components/bn-chart-time/utils/TimeChart.js +16 -4
  87. package/dist/collection/components/bn-chart-time/utils/elements/StackedColumn.js +3 -3
  88. package/dist/collection/components/bn-component-style/bn-component-style.js +1 -1
  89. package/dist/collection/components/bn-context/bn-context.js +1 -1
  90. package/dist/collection/components/bn-dataset/bn-dataset.js +1 -1
  91. package/dist/collection/components/bn-datasource/bn-datasource.js +1 -1
  92. package/dist/collection/components/bn-footer/bn-footer.js +1 -1
  93. package/dist/collection/components/bn-grid/bn-grid.js +1 -1
  94. package/dist/collection/components/bn-image/bn-image.js +1 -1
  95. package/dist/collection/components/bn-internationalization/bn-internationalization.js +1 -1
  96. package/dist/collection/components/bn-layout-card/bn-layout-card.js +26 -3
  97. package/dist/collection/components/bn-layout-page/bn-layout-page.js +33 -4
  98. package/dist/collection/components/bn-message/bn-message.css +6 -2
  99. package/dist/collection/components/bn-message/bn-message.js +3 -2
  100. package/dist/collection/components/bn-page/bn-page.js +1 -1
  101. package/dist/collection/components/bn-ruleset/bn-ruleset.css +3 -0
  102. package/dist/collection/components/bn-ruleset/bn-ruleset.js +68 -0
  103. package/dist/collection/components/bn-scaling-group/bn-scaling-group.js +1 -1
  104. package/dist/collection/components/bn-table/bn-table.js +146 -14
  105. package/dist/collection/components/bn-table/ibcs-table.css +8 -0
  106. package/dist/collection/components/bn-table/ibcs-table.js +64 -8
  107. package/dist/collection/components/bn-table/utils/Table.js +43 -5
  108. package/dist/collection/components/bn-table/utils/elements/CellBarChart.js +13 -8
  109. package/dist/collection/components/bn-table/utils/elements/TableRow.js +3 -2
  110. package/dist/collection/components/bn-table/utils/elements/WaterfallBar.js +47 -0
  111. package/dist/collection/components/bn-table/utils/elements/index.js +1 -0
  112. package/dist/collection/components/bn-table/utils/factories/tableDataSetFactory.js +87 -15
  113. package/dist/collection/components/bn-table/utils/helper/DataQuery.js +284 -3
  114. package/dist/collection/components/bn-table/utils/helper/IntervalColumns.js +140 -0
  115. package/dist/collection/components/bn-table/utils/helper/WaterfallCalculator.js +166 -0
  116. package/dist/collection/components/bn-table/utils/helper/index.js +2 -0
  117. package/dist/collection/components/bn-table/utils/model/TableComponentConfig.js +10 -0
  118. package/dist/collection/components/bn-template/bn-template.js +1 -1
  119. package/dist/collection/components/bn-text/bn-text.js +2 -75
  120. package/dist/collection/components/bn-title/bn-title.js +27 -3
  121. package/dist/collection/components/bn-title/ibcs-title/ibcs-title.css +4 -0
  122. package/dist/collection/components/bn-title/ibcs-title/ibcs-title.js +29 -3
  123. package/dist/collection/components/bn-title/ibcs-title/utils/Title.js +3 -0
  124. package/dist/collection/components/editor-companion/editor-companion.js +1 -1
  125. package/dist/collection/stores/componentStyles.js +67 -0
  126. package/dist/collection/stores/createScopedStores.js +6 -1
  127. package/dist/collection/stores/internationalization.js +68 -0
  128. package/dist/collection/stores/ruleSets.js +46 -0
  129. package/dist/collection/utils/constants.js +5 -0
  130. package/dist/collection/utils/ibcsRuleSet.js +14 -26
  131. package/dist/collection/utils/sanitizeHtml.js +81 -0
  132. package/dist/collection/utils/validate.js +24 -0
  133. package/dist/collection/utils/withComponentStyle.js +3 -5
  134. package/dist/collection/utils/withInheritedProps.js +1 -1
  135. package/dist/collection/utils/withRuleSet.js +105 -0
  136. package/dist/collection/utils/withScalingGroup.js +3 -0
  137. package/dist/collection/utils/xy/FacetGrid.js +36 -0
  138. package/dist/collection/utils/xy/IsoCurves.js +156 -0
  139. package/dist/collection/utils/xy/NumericScale.js +103 -0
  140. package/dist/collection/utils/xy/PointLabeler.js +96 -0
  141. package/dist/collection/utils/xy/RadiusScale.js +42 -0
  142. package/dist/collection/utils/xy/SeriesPalette.js +80 -0
  143. package/dist/collection/utils/xy/VarianceMeasure.js +76 -0
  144. package/dist/collection/utils/xy/XYFrame.js +120 -0
  145. package/dist/collection/utils/xy/XYLegend.js +107 -0
  146. package/dist/collection/utils/xy/model/AxisConfig.js +221 -0
  147. package/dist/collection/utils/xy/model/ScaleFactorsXYChart.js +69 -0
  148. package/dist/collection/utils/xy/model/XYChartDataRow.js +0 -0
  149. package/dist/collection/utils/xy/model/XYChartStyle.js +52 -0
  150. package/dist/components/AxisConfig.js +1 -0
  151. package/dist/components/CompareUtil.js +1 -0
  152. package/dist/components/DataFormatDigits.js +1 -1
  153. package/dist/components/LabelCollisionManager.js +1 -0
  154. package/dist/components/NumericScale.js +1 -0
  155. package/dist/components/Order.js +1 -1
  156. package/dist/components/SVGVariancesStyleGroup.js +1 -1
  157. package/dist/components/SiPrefix.js +1 -0
  158. package/dist/components/StringAdapter.js +1 -0
  159. package/dist/components/VarianceMeasure.js +1 -0
  160. package/dist/components/XYChartDataRow.js +1 -0
  161. package/dist/components/bn-chart-bubble.d.ts +11 -0
  162. package/dist/components/bn-chart-bubble.js +1 -0
  163. package/dist/components/bn-chart-bullet.d.ts +11 -0
  164. package/dist/components/bn-chart-bullet.js +1 -0
  165. package/dist/components/bn-chart-scatter.d.ts +11 -0
  166. package/dist/components/bn-chart-scatter.js +1 -0
  167. package/dist/components/bn-chart-structure.js +1 -1
  168. package/dist/components/bn-chart-time.js +1 -1
  169. package/dist/components/bn-component-style.js +1 -1
  170. package/dist/components/bn-context.js +1 -1
  171. package/dist/components/bn-dataset.js +1 -1
  172. package/dist/components/bn-datasource.js +1 -1
  173. package/dist/components/bn-footer2.js +1 -1
  174. package/dist/components/bn-grid.js +1 -1
  175. package/dist/components/bn-image.js +1 -1
  176. package/dist/components/bn-internationalization.js +1 -1
  177. package/dist/components/bn-layout-card.js +1 -1
  178. package/dist/components/bn-layout-page.js +1 -1
  179. package/dist/components/bn-message2.js +1 -1
  180. package/dist/components/bn-page2.js +1 -1
  181. package/dist/components/bn-ruleset.d.ts +11 -0
  182. package/dist/components/bn-ruleset.js +1 -0
  183. package/dist/components/bn-scaling-group.js +1 -1
  184. package/dist/components/bn-table.js +1 -1
  185. package/dist/components/bn-template.js +1 -1
  186. package/dist/components/bn-text.js +1 -1
  187. package/dist/components/bn-title2.js +1 -1
  188. package/dist/components/bn-tree.js +1 -1
  189. package/dist/components/context-protocol.js +1 -1
  190. package/dist/components/editor-companion.js +1 -1
  191. package/dist/components/formatter.js +1 -0
  192. package/dist/components/ibcs-chart-bubble.d.ts +11 -0
  193. package/dist/components/ibcs-chart-bubble.js +1 -0
  194. package/dist/components/ibcs-chart-bubble2.js +1 -0
  195. package/dist/components/ibcs-chart-bullet.d.ts +11 -0
  196. package/dist/components/ibcs-chart-bullet.js +1 -0
  197. package/dist/components/ibcs-chart-bullet2.js +1 -0
  198. package/dist/components/ibcs-chart-scatter.d.ts +11 -0
  199. package/dist/components/ibcs-chart-scatter.js +1 -0
  200. package/dist/components/ibcs-chart-scatter2.js +1 -0
  201. package/dist/components/ibcs-chart-structure2.js +1 -1
  202. package/dist/components/ibcs-chart-time2.js +1 -1
  203. package/dist/components/ibcs-table2.js +1 -1
  204. package/dist/components/ibcs-title2.js +1 -1
  205. package/dist/components/layoutObserver.js +1 -1
  206. package/dist/components/luxon.js +1 -1
  207. package/dist/components/main.js +1 -0
  208. package/dist/components/merge.js +1 -0
  209. package/dist/components/sanitizeHtml.js +1 -0
  210. package/dist/components/stackColors.js +1 -0
  211. package/dist/components/validate.js +1 -1
  212. package/dist/components/withComponentStyle.js +1 -1
  213. package/dist/components/withDataset.js +1 -0
  214. package/dist/components/withRuleSet.js +1 -0
  215. package/dist/components/withScalingGroup.js +1 -0
  216. package/dist/components/withStyled.js +1 -1
  217. package/dist/esm/AxisConfig-C_zWCKlL.js +224 -0
  218. package/dist/esm/LabelCollisionManager-8swVQHKA.js +404 -0
  219. package/dist/esm/NumericScale-DsTzlzxQ.js +105 -0
  220. package/dist/esm/Order-BPeWfygb.js +83 -0
  221. package/dist/esm/SVGStyle-BxEDw9zh.js +8199 -0
  222. package/dist/esm/SVGVariancesStyleGroup-DRQYvSDD.js +48 -0
  223. package/dist/esm/VarianceMeasure-DnwNKspZ.js +364 -0
  224. package/dist/esm/XYChartDataRow-DeV4r-Wm.js +820 -0
  225. package/dist/esm/bn-asset_21.entry.js +1127 -9183
  226. package/dist/esm/bn-chart-bubble.entry.js +760 -0
  227. package/dist/esm/bn-chart-bullet.entry.js +783 -0
  228. package/dist/esm/bn-chart-scatter.entry.js +656 -0
  229. package/dist/esm/bn-grid.entry.js +5 -3
  230. package/dist/esm/bn-image.entry.js +5 -3
  231. package/dist/esm/bn-internationalization.entry.js +2 -2
  232. package/dist/esm/bn-ruleset.entry.js +39 -0
  233. package/dist/esm/bn-template-engine.js +1 -1
  234. package/dist/esm/bn-template.entry.js +1 -1
  235. package/dist/esm/bn-text.entry.js +7 -78
  236. package/dist/esm/bn-tree.entry.js +4 -2
  237. package/dist/esm/{context-protocol-BB-4Onmw.js → context-protocol-1Yj1uKvh.js} +268 -2
  238. package/dist/esm/editor-companion.entry.js +2 -2
  239. package/dist/esm/ibcs-chart-bubble.entry.js +622 -0
  240. package/dist/esm/ibcs-chart-bullet.entry.js +671 -0
  241. package/dist/esm/ibcs-chart-scatter.entry.js +665 -0
  242. package/dist/esm/layoutObserver-DCbmpGrz.js +345 -0
  243. package/dist/esm/loader.js +1 -1
  244. package/dist/esm/sanitizeHtml-BA48JiHe.js +83 -0
  245. package/dist/esm/{scaling-h4KcBet3.js → scaling-B_k50v9z.js} +2 -2
  246. package/dist/esm/withScalingGroup-Br70pAv9.js +71 -0
  247. package/dist/esm/{withStyled-BBvU2f-A.js → withStyled-Br2DGTPs.js} +30 -367
  248. package/dist/types/components/bn-chart-bubble/bn-chart-bubble.d.ts +193 -0
  249. package/dist/types/components/bn-chart-bubble/ibcs-chart-bubble.d.ts +58 -0
  250. package/dist/types/components/bn-chart-bubble/utils/BubbleChart.d.ts +91 -0
  251. package/dist/types/components/bn-chart-bullet/bn-chart-bullet.d.ts +172 -0
  252. package/dist/types/components/bn-chart-bullet/ibcs-chart-bullet.d.ts +52 -0
  253. package/dist/types/components/bn-chart-bullet/utils/BulletChart.d.ts +91 -0
  254. package/dist/types/components/bn-chart-bullet/utils/model/BulletChartStyle.d.ts +70 -0
  255. package/dist/types/components/bn-chart-bullet/utils/model/BulletConfig.d.ts +43 -0
  256. package/dist/types/components/bn-chart-bullet/utils/model/index.d.ts +2 -0
  257. package/dist/types/components/bn-chart-scatter/bn-chart-scatter.d.ts +172 -0
  258. package/dist/types/components/bn-chart-scatter/ibcs-chart-scatter.d.ts +53 -0
  259. package/dist/types/components/bn-chart-scatter/utils/ScatterChart.d.ts +66 -0
  260. package/dist/types/components/bn-chart-structure/bn-chart-structure.d.ts +7 -0
  261. package/dist/types/components/bn-chart-structure/ibcs-chart-structure.d.ts +2 -0
  262. package/dist/types/components/bn-chart-structure/utils/StructureChart.d.ts +1 -0
  263. package/dist/types/components/bn-chart-time/bn-chart-time.d.ts +10 -1
  264. package/dist/types/components/bn-chart-time/ibcs-chart-time.d.ts +2 -0
  265. package/dist/types/components/bn-chart-time/utils/TimeChart.d.ts +1 -0
  266. package/dist/types/components/bn-layout-card/bn-layout-card.d.ts +10 -0
  267. package/dist/types/components/bn-layout-page/bn-layout-page.d.ts +14 -0
  268. package/dist/types/components/bn-message/bn-message.d.ts +5 -2
  269. package/dist/types/components/bn-ruleset/bn-ruleset.d.ts +8 -0
  270. package/dist/types/components/bn-table/bn-table.d.ts +38 -5
  271. package/dist/types/components/bn-table/ibcs-table.d.ts +8 -1
  272. package/dist/types/components/bn-table/utils/Table.d.ts +8 -0
  273. package/dist/types/components/bn-table/utils/elements/Cell.d.ts +2 -0
  274. package/dist/types/components/bn-table/utils/elements/CellBarChart.d.ts +33 -0
  275. package/dist/types/components/bn-table/utils/elements/TableRow.d.ts +2 -1
  276. package/dist/types/components/bn-table/utils/elements/WaterfallBar.d.ts +21 -0
  277. package/dist/types/components/bn-table/utils/elements/index.d.ts +1 -0
  278. package/dist/types/components/bn-table/utils/factories/tableDataSetFactory.d.ts +13 -7
  279. package/dist/types/components/bn-table/utils/helper/DataQuery.d.ts +17 -0
  280. package/dist/types/components/bn-table/utils/helper/IntervalColumns.d.ts +37 -0
  281. package/dist/types/components/bn-table/utils/helper/WaterfallCalculator.d.ts +55 -0
  282. package/dist/types/components/bn-table/utils/helper/index.d.ts +2 -0
  283. package/dist/types/components/bn-table/utils/model/TableComponentConfig.d.ts +4 -0
  284. package/dist/types/components/bn-table/utils/model/index.d.ts +21 -0
  285. package/dist/types/components/bn-title/bn-title.d.ts +11 -1
  286. package/dist/types/components/bn-title/ibcs-title/ibcs-title.d.ts +2 -0
  287. package/dist/types/components/bn-title/ibcs-title/utils/Title.d.ts +1 -0
  288. package/dist/types/components.d.ts +1383 -82
  289. package/dist/types/context/context-protocol.d.ts +2 -0
  290. package/dist/types/stores/componentStyles.d.ts +41 -0
  291. package/dist/types/stores/createScopedStores.d.ts +2 -0
  292. package/dist/types/stores/ruleSets.d.ts +40 -0
  293. package/dist/types/utils/constants.d.ts +5 -0
  294. package/dist/types/utils/ibcsRuleSet.d.ts +6 -1
  295. package/dist/types/utils/model/ChartStyles.d.ts +2 -1
  296. package/dist/types/utils/sanitizeHtml.d.ts +6 -0
  297. package/dist/types/utils/validate.d.ts +12 -0
  298. package/dist/types/utils/withInheritedProps.d.ts +11 -0
  299. package/dist/types/utils/withRuleSet.d.ts +24 -0
  300. package/dist/types/utils/xy/FacetGrid.d.ts +27 -0
  301. package/dist/types/utils/xy/IsoCurves.d.ts +46 -0
  302. package/dist/types/utils/xy/NumericScale.d.ts +41 -0
  303. package/dist/types/utils/xy/PointLabeler.d.ts +58 -0
  304. package/dist/types/utils/xy/RadiusScale.d.ts +26 -0
  305. package/dist/types/utils/xy/SeriesPalette.d.ts +59 -0
  306. package/dist/types/utils/xy/VarianceMeasure.d.ts +37 -0
  307. package/dist/types/utils/xy/XYFrame.d.ts +44 -0
  308. package/dist/types/utils/xy/XYLegend.d.ts +43 -0
  309. package/dist/types/utils/xy/model/AxisConfig.d.ts +96 -0
  310. package/dist/types/utils/xy/model/ScaleFactorsXYChart.d.ts +36 -0
  311. package/dist/types/utils/xy/model/XYChartDataRow.d.ts +157 -0
  312. package/dist/types/utils/xy/model/XYChartStyle.d.ts +31 -0
  313. package/package.json +1 -1
  314. package/readme.md +7 -3
  315. package/dist/bn-template-engine/p-19f49fbc.entry.js +0 -1
  316. package/dist/bn-template-engine/p-3465fcdc.entry.js +0 -1
  317. package/dist/bn-template-engine/p-67746414.entry.js +0 -1
  318. package/dist/bn-template-engine/p-6b469808.entry.js +0 -1
  319. package/dist/bn-template-engine/p-86ca2d5e.entry.js +0 -1
  320. package/dist/bn-template-engine/p-Tx6omDWp.js +0 -1
  321. package/dist/bn-template-engine/p-d724ab88.entry.js +0 -1
  322. package/dist/bn-template-engine/p-efd3b67a.entry.js +0 -1
  323. package/dist/bn-template-engine/p-z9bPNFYF.js +0 -1
  324. package/dist/components/ibcsRuleSet.js +0 -1
  325. package/dist/components/scaling.js +0 -1
  326. package/dist/components/withInheritedProps.js +0 -1
@@ -0,0 +1 @@
1
+ import{C as t}from"./p-BZV1b5VH.js";class s{constructor(t,s,i){this.pos=t,this.neg=s,this.neu=i,this.needleHeadColour="#000000"}getSVGStyle(t){return"pos"===t?this.pos:"neg"===t?this.neg:this.neu}}class i{constructor(t){this.svgStyleAdapter=t}adapt(i){const h=new s(this.svgStyleAdapter.defaultPos(),this.svgStyleAdapter.defaultNeg(),this.svgStyleAdapter.defaultNeu());return t.isExisting(i.pos)&&(h.pos=this.svgStyleAdapter.adapt(i.pos)),t.isExisting(i.neg)&&(h.neg=this.svgStyleAdapter.adapt(i.neg)),t.isExisting(i.pp)&&(h.neu=this.svgStyleAdapter.adapt(i.neu)),t.isString(i.needleHeadColour)&&(h.needleHeadColour=i.needleHeadColour),h}default(){return new s(this.svgStyleAdapter.defaultPos(),this.svgStyleAdapter.defaultNeg(),this.svgStyleAdapter.defaultNeu())}}export{i as S}
@@ -0,0 +1 @@
1
+ import{r as t,h as s,H as i,g as r}from"./p-B_d-jp99.js";import{w as a}from"./p-BjBz5cSL.js";import{g as e,f as n}from"./p-BqhIhYr1.js";import{w as o,a as h}from"./p-B4JfKvVT.js";const c=class{constructor(s){t(this,s),o(this),this.errors=h(this),a(this,(t=>{this.stores||(this.stores=e(this.element));try{const s=n(JSON.parse(t)),i=Object.assign({},this.stores.internationalization.get(this.namespace));i[this.code]=s,this.stores.internationalization.set(this.namespace,i)}catch(t){console.error(t)}}))}render(){return s(i,{key:"be9f6b1dc6c60ef5559ad47228e612ee74b0c80c"})}get element(){return r(this)}};c.style="bn-internationalization{display:none}";export{c as bn_internationalization}
@@ -0,0 +1 @@
1
+ import{r as t,h as s,H as i,g as o}from"./p-B_d-jp99.js";import{w as r,b as e}from"./p-C0Pwqx-O.js";import{w as n,a}from"./p-B4JfKvVT.js";import{g as l}from"./p-BqhIhYr1.js";import"./p-BZV1b5VH.js";import"./p-Bdfxd_Ke.js";const f=class{constructor(s){t(this,s),r(this),n(this),this.errors=a(this),this.componentStyle=e(this)}connectedCallback(){this.stores=l(this.element)}getFontStyles(){return this.componentStyle((t=>{var s,i,o,r;return{"--bn-font-family":(null===(s=t.global)||void 0===s?void 0:s.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===(o=t.global)||void 0===o?void 0:o.fontColor)||"#000000","--bn-font-background":(null===(r=t.global)||void 0===r?void 0:r.fontBackgroundColor)||"#ffffff"}}))}prepareAssetUrl(t){if(null==t||""===t)return"";const s=this.stores.assets.state;return t.startsWith("asset:")?s[t.substring(6)]:s[t]||t}render(){return s(i,{key:"cfa7e1b2978773f449f6596174edf51e4a61d4d7",style:this.getFontStyles()},null!=this.source&&""!==this.source?s("img",{src:this.prepareAssetUrl(this.source)}):"")}get element(){return o(this)}};f.style=":host{display:inline-block;position:relative;overflow:hidden}img{max-width:100%;height:auto}";export{f as bn_image}
@@ -0,0 +1 @@
1
+ import{r as s,h as t,H as e,g as r}from"./p-B_d-jp99.js";import{w as i}from"./p-BjBz5cSL.js";import{g as a}from"./p-BqhIhYr1.js";import{w as o,a as h}from"./p-B4JfKvVT.js";const n=class{constructor(t){s(this,t),this.name="_default",o(this),this.errors=h(this),i(this,(s=>{this.stores||(this.stores=a(this.element));try{const t=JSON.parse(s);this.stores.ruleSets.set(this.name,t),this.errors.remove("JSON_PARSE")}catch(s){this.errors.addOrReplace({id:"JSON_PARSE",type:"error",message:`bn-ruleset: Failed to parse JSON body — ${s.message}`}),console.error(s)}}))}render(){return t(e,{key:"9049a4abd1e2b4ae4d28f56c4fe51919a89c0773"})}get element(){return r(this)}};n.style="bn-ruleset{display:none}";export{n as bn_ruleset}
@@ -0,0 +1 @@
1
+ import{r as t,d as i,f as e,h as s,H as a,g as r}from"./p-B_d-jp99.js";import{a as n}from"./p-BqhIhYr1.js";import{w as l,a as o,g as h,p as u}from"./p-CPzF3Q2m.js";import{w as c,o as d}from"./p-CBqUr7I8.js";import{i as p,a as v,w as m,b as f,c as g}from"./p-C0Pwqx-O.js";import{w as y,a as b}from"./p-B4JfKvVT.js";import{w as x}from"./p-CiudZRQr.js";import{r as _,s as w}from"./p-BZV1b5VH.js";import{t as $,a as R,b as S,c as E,d as L,e as C,p as j}from"./p-Dg9OcXAO.js";import"./p-Bdfxd_Ke.js";const A={rowGroup:0,category:1,subCategory:2},O=["ac","pp","fc","pl"],z=class{validateX(t){this.validateMeasureSpec("x",t,!0,(t=>$(t)))}validateY(t){this.validateMeasureSpec("y",t,!0,(t=>$(t)))}validateSize(t){this.validateMeasureSpec("size",t,!0,(t=>R(t))),this.validateSizeScaling()}validateShare(t){this.validateMeasureSpec("share",t,!1,(t=>S(t)))}validateCompareWith(t){const i="ERR_compareWith";p(t)||O.includes(t.trim().toLowerCase())?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:`compare-with: invalid value '${t}' — expected ${O.join("/")}; ignored.`})}validateLevel(t){const i="ERR_level",e=["auto","category","subcategory"];p(t)||e.includes(t.trim().toLowerCase())?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:`level: invalid value '${t}' — expected ${e.join("/")}; using 'auto'.`})}validateSeriesLevel(t){const i="ERR_seriesLevel",e=["auto","rowgroup","category","none"];p(t)||e.includes(t.trim().toLowerCase())?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:`series-level: invalid value '${t}' — expected ${e.join("/")}; using 'auto'.`})}validateFacet(t){this.validateObjectSpec("facet",t,(t=>E(t)))}validateLabels(t){this.validateObjectSpec("labels",t,(t=>L(t,this.labelDefaults())))}validateLegend(t){this.validateObjectSpec("legend",t,(t=>C(t)))}validateAspect(t){const i="ERR_aspect";p(t)||null!==this.parseAspect(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:`aspect: invalid value '${t}' — expected "w:h" (e.g. "16:9"); using the default.`})}validateLimit(t){const i="ERR_limit";v(t)&&Number(t)>=0?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:`limit: invalid value '${t}' — expected a non-negative integer; using 0.`})}validateScale(t){const i="ERR_scale";if(p(t))return void this.errors.remove(i);const{mode:e,factor:s}=u(t);"factor"===e&&(void 0===s||s<=0)?this.errors.addOrReplace({id:i,type:"warning",message:`scale: invalid value '${t}' — expected none/auto or a positive number.`}):this.errors.remove(i)}constructor(i){t(this,i),this.datasetName="",this.dataVersion=0,this.datasetMeta=null,this.appliedScaleFactor=1,this.layoutObserver=null,this.activeErrors=new Set,this.pixelPerUnitGroupMap=new Map,this.chartTitle="",this.filter="",this.share="",this.compareWith="",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,i)=>this.t(t,i),m(this),y(this),l(this,(t=>{this.datasetName=(null==t?void 0:t.startsWith("$"))?t.substring(1):t||"",this.dataVersion=this.dataVersion+1}),((t,i)=>{this.datasetMeta=i})),this.errors=b(this),x(this),this.componentStyle=f(this),this.ruleSetConfig=c(this),this.t=o(this).t}componentWillLoad(){this.validateX(this.x),this.validateY(this.y),this.validateSize(this.size),this.validateShare(this.share),this.validateCompareWith(this.compareWith),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}=u(this.scale);if("auto"!==t&&"empty"!==t){this._autoScaleGuard=!1;const t=h(this.element),i="WARN_overflow";return void(t.width>0&&this.element.scrollWidth>t.width+1?this.errors.addOrReplace({id:i,type:"warning",message:"Chart exceeds available space and will be cut off. Check the scale value."}):this.errors.remove(i))}if(this._autoScaleGuard)return void(this._autoScaleGuard=!1);const e=this.element,{width:s}=h(e);if(s<=0)return;this._lastObservedWidth=s;const a=this.componentStyle((t=>{var i;return(null===(i=t.global)||void 0===i?void 0:i.fontSizePx)||13.3333})),r=e.scrollWidth,n=this.appliedScaleFactor;if(!Number.isFinite(r)||r<=s+1)return void this.errors.remove("AUTO_scale");const l=Math.max(.3,n*(s-1)/r);Math.abs(l-n)<.01||(e.style.setProperty("--bn-font-size",a*l+"px"),"empty"===t?this.errors.addOrReplace({id:"AUTO_scale",type:"warning",message:`Auto-scaled chart by factor ${l.toFixed(3)}`}):this.errors.remove("AUTO_scale"),this._autoScaleGuard=!0,i((()=>{this.appliedScaleFactor=l})))}componentDidLoad(){this.layoutObserver=d(this.element,(()=>{if(this._autoScaleGuard)return;const{width:t}=h(this.element);t>0&&Math.abs(t-this._lastObservedWidth)>2&&(this._lastObservedWidth=t,e(this))})),requestAnimationFrame((()=>{requestAnimationFrame((()=>{if(this._autoScaleGuard)return;const{width:t}=h(this.element);this._lastObservedWidth=t,e(this)}))}))}disconnectedCallback(){var t;null===(t=this.layoutObserver)||void 0===t||t.disconnect(),this.layoutObserver=null}labelDefaults(){return{points:"all",values:!0,max:12}}setBlockingError(t,i){null===i?(this.errors.remove(t),this.activeErrors.delete(t)):(this.errors.addOrReplace({id:t,type:"error",message:i}),this.activeErrors.add(t))}hasBlockingErrors(){return this.activeErrors.size>0}validateSizeScaling(){var t;const i=null===(t=this.prepareSize())||void 0===t?void 0:t.group;this.setBlockingError("ERR_xy_scale_group",void 0===i||this.pixelPerUnitGroupMap.has(i)?null:this.t(".bubble-scale-group-unknown",{group:i}))}validateMeasureSpec(t,i,e,s){var a;const r=`ERR_xy_json_${t}`,n=`ERR_xy_measure_${t}`,l=`WARN_xy_fields_${t}`,{data:o,parseError:h}=j(i,"measure");if(h)return this.setBlockingError(r,this.t(".xy-prop-json",{prop:t})),this.setBlockingError(n,null),void this.errors.remove(l);if(this.setBlockingError(r,null),null===o)return this.setBlockingError(n,e?this.t(".xy-measure-invalid",{prop:t,measure:""}):null),void this.errors.remove(l);const u=null!==(a=o.measure)&&void 0!==a?a:"";g(u)?this.setBlockingError(n,null):this.setBlockingError(n,this.t(".xy-measure-invalid",{prop:t,measure:u})),this.reportSpecIssues(l,t,s(o))}validateObjectSpec(t,i,e){const s=`ERR_xy_json_${t}`,a=`WARN_xy_fields_${t}`,{data:r,parseError:n}=j(i,null);if(n)return this.setBlockingError(s,this.t(".xy-prop-json",{prop:t})),void this.errors.remove(a);this.setBlockingError(s,null),null!==r?this.reportSpecIssues(a,t,e(r)):this.errors.remove(a)}reportSpecIssues(t,i,e){const s=[];null!==e&&e.invalidFields.length>0&&s.push(`invalid: ${e.invalidFields.join(", ")}`),null!==e&&e.unknownKeys.length>0&&s.push(`unknown: ${e.unknownKeys.join(", ")}`),s.length>0?this.errors.addOrReplace({id:t,type:"warning",message:`${i}: ignored sub-fields (${s.join("; ")}).`}):this.errors.remove(t)}prepareAxis(t,i){const{data:e,parseError:s}=j(i,"measure");if(s||null===e)return null;const{config:a}=$(e);return null!==a&&g(a.measure)?(void 0!==a.min&&void 0!==a.max&&a.min>=a.max?(this.errors.addOrReplace({id:`WARN_xy_domain_${t}`,type:"warning",message:`${t}: min must be smaller than max; the override is ignored.`}),a.min=void 0,a.max=void 0):this.errors.remove(`WARN_xy_domain_${t}`),a):null}prepareSize(){const{data:t,parseError:i}=j(this.size,"measure");if(i||null===t)return null;const{config:e}=R(t);return null!==e&&g(e.measure)?e:null}prepareShare(){const{data:t,parseError:i}=j(this.share,"measure");if(i||null===t)return null;const{config:e}=S(t);return null!==e&&g(e.measure)?e:null}prepareCompareFamily(){var t;const i=null===(t=this.compareWith)||void 0===t?void 0:t.trim().toLowerCase();return O.includes(i)?i:null}prepareLabels(){const t=this.labelDefaults(),{data:i,parseError:e}=j(this.labels,null);return e||null===i?{points:t.points,values:t.values,max:t.max}:L(i,t).config}prepareLegend(){const{data:t,parseError:i}=j(this.legend,null);return i||null===t?{show:!0,position:"right"}:C(t).config}prepareFacet(){const{data:t,parseError:i}=j(this.facet,null);return i||null===t?null:E(t).config}preparePointLevel(){var t,i;const e=null===(t=this.level)||void 0===t?void 0:t.trim().toLowerCase();if("category"===e)return"category";if("subcategory"===e)return"subCategory";const s=null===(i=this.datasetMeta)||void 0===i?void 0:i.suggestedLevel;return"rowGroup"===s||"category"===s||"subCategory"===s?s:"category"}prepareSeriesLevel(t){var i;const e=null===(i=this.seriesLevel)||void 0===i?void 0:i.trim().toLowerCase();return"none"===e?null:"rowgroup"===e?"rowGroup":"category"===e||"subCategory"===t?"category":"category"===t?"rowGroup":null}validateCrossProp(t,i){const e=new Set;let s=!1;for(const i of t){if(void 0===i)continue;const t=_(i);null!==t&&("scenario"===t.kind?e.add(w(t.slot)):s=!0)}this.setBlockingError("ERR_xy_family",e.size>1?this.t(".xy-family-mixed",{families:[...e].join(", ")}):null);const a=this.prepareCompareFamily();this.setBlockingError("ERR_xy_compare_variance",null!==a&&s?this.t(".xy-compare-variance"):null),this.setBlockingError("ERR_xy_compare_family",null!==a&&1===e.size&&e.has(a)?`compare-with: '${a}' is already the primary scenario family.`:null);const r=this.preparePointLevel(),n=this.prepareSeriesLevel(r),l=null!==i?"rowgroup"===i.level?"rowGroup":"category":null;let o=null;if(null!==n&&A[n]>=A[r]&&(o=`series '${n}' vs point '${r}'`),null!==l){const t=null!=n?n:r;A[l]>=A[t]&&(o=`facet '${l}' vs '${t}'`)}this.setBlockingError("ERR_xy_level_order",null!==o?this.t(".xy-level-order",{detail:o}):null)}parseAspect(t){const i=/^\s*(\d+(?:\.\d+)?)\s*:\s*(\d+(?:\.\d+)?)\s*$/.exec(null!=t?t:"");if(null===i)return null;const e=Number(i[1]),s=Number(i[2]);return e<=0||s<=0?null:e/s}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}prepareSizeAreaPerUnit(){var t;const i=null===(t=this.prepareSize())||void 0===t?void 0:t.group;if(void 0===i||!this.pixelPerUnitGroupMap.has(i))return 0;const e=this.getEffectiveScaleFactor();return this.pixelPerUnitGroupMap.get(i)*e*e}i18nLocalKeys(){return["no-data","axis.in","legend.title","legend.size","legend.compare"]}prepareI18n(){const t=new Map(this.i18nLocalKeys().map((t=>[t,this.t(".".concat(t))]))),i=new Map(n.map((t=>[t,this.t("global.".concat(t))])));return new Map([...i.entries(),...t.entries()])}prepareStyle(){const t=this.getEffectiveScaleFactor();return this.componentStyle((i=>{const e=i.global.fontSizePx*t;return{scaleFactors:i["bn-chart-bubble"].scaleFactors,fontStyles:{font:`${e}px ${i.global.fontFamily}`,size:e,color:i.global.fontColor,background:i.global.fontBackgroundColor,leading:1.8},axisStyles:i["bn-chart-bubble"].axisStyles,seriesColors:i["bn-chart-bubble"].seriesColors,padding:i["bn-chart-bubble"].padding}}))}getEffectiveScaleFactor(){const{mode:t,factor:i}=u(this.scale);return"factor"===t?i:"auto"===t||"empty"===t?this.appliedScaleFactor:1}getFontStyles(){const t=this.getEffectiveScaleFactor();return this.componentStyle((i=>{var e,s,a,r;const n=(null===(e=i.global)||void 0===e?void 0:e.fontSizePx)||13.3333;return{"--bn-font-family":(null===(s=i.global)||void 0===s?void 0:s.fontFamily)||"'Noto Sans', sans-serif","--bn-font-size":n*t+"px","--bn-font-color":(null===(a=i.global)||void 0===a?void 0:a.fontColor)||"#000000","--bn-font-background":(null===(r=i.global)||void 0===r?void 0:r.fontBackgroundColor)||"#ffffff"}}))}getDataStructure(){const t={};for(const i of["ac","pp","fc","pl"])for(const e of[1,2,3,4])t[`${i}${e}`]={type:"number",isOptional:!0,description:""};const i={x:this.prepareAxis("x",this.x),y:this.prepareAxis("y",this.y),size:this.prepareSize(),share:this.prepareShare()};for(const[e,s]of Object.entries(i)){if(null===s)continue;const i=_(s.measure);null!==i&&("scenario"===i.kind?t[i.slot].description=`${e}: ${void 0!==s.label?s.label:s.measure}`:(t[i.measure.base].description=`${e}: ${s.measure} (base)`,t[i.measure.delta].description=`${e}: ${s.measure} (delta)`))}const e=this.prepareCompareFamily();if(null!==e)for(const[s,a]of Object.entries(i)){if(null===a||"share"===s)continue;const i=_(a.measure);if(null!==i&&"scenario"===i.kind){const a=e+i.slot.replace(/^[a-z]+/,"");""===t[a].description&&(t[a].description=`${s}: compareWith`)}}return{IBubbleChartDataRow: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)}}chartTemplate(){const t=this.prepareAxis("x",this.x),i=this.prepareAxis("y",this.y),e=this.prepareSize(),a=this.prepareShare(),r=this.prepareFacet();if(this.validateCrossProp([null==t?void 0:t.measure,null==i?void 0:i.measure,null==e?void 0:e.measure,null==a?void 0:a.measure],r),this.validateSizeScaling(),this.hasBlockingErrors()||null===t||null===i||null===e)return null;const n=this.preparePointLevel(),l=this.prepareI18n(),o=this.prepareStyle(),u=h(this.element).width;return s("ibcs-chart-bubble",{tableName:this.datasetName,dataVersion:this.dataVersion,chartTitle:this.chartTitle,x:t,y:i,size:e,share:a,compareFamily:this.prepareCompareFamily(),labels:this.prepareLabels(),legend:this.prepareLegend(),facet:r,pointLevel:n,seriesLevel:this.prepareSeriesLevel(n),aspect:this.prepareAspect(),limit:this.prepareLimit(),filter:this.filter,sizeAreaPerUnit:this.prepareSizeAreaPerUnit(),styles:o,i18n:l,containerWidth:u,ruleSetConfig:this.ruleSetConfig(),errors:this.errors,translate:this.translateForInner})}render(){return s(a,{key:"4191801f8d17e3241a9b681d9a7f0ab8a453bf64",style:this.getFontStyles()},s("div",{key:"a5284956b892a3647331532daae8d3251dbb6fad",class:"container"},this.chartTemplate()))}get element(){return r(this)}static get watchers(){return{x:[{validateX:0}],y:[{validateY:0}],size:[{validateSize:0}],share:[{validateShare:0}],compareWith:[{validateCompareWith: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}]}}};z.style=":host{display:inline-block;position:relative;overflow:hidden}.container{display:flex;flex-direction:column}";export{z as bn_chart_bubble}
@@ -0,0 +1 @@
1
+ import{C as t,a as s}from"./p-BZV1b5VH.js";import{X as i,D as n}from"./p-BqhIhYr1.js";import{L as o,H as e}from"./p-BWKdb9ym.js";import{F as r,C as h}from"./p-X6CxL6W-.js";class l{constructor(t,s,n,o){this.scaleFactors=t,this.fontStyles=s,this.axisStyles=n,this.padding=o,this.seriesColors=[...i]}}class a{constructor(t,s,i,n){this.scaleFactorsXYChartAdapter=t,this.fontStyleAdapter=s,this.svgStyleGroupAdapter=i,this.paddingAdapter=n}adapt(s){const i=this.default();return t.isExisting(s)&&(t.isExisting(s.scaleFactors)&&(i.scaleFactors=this.scaleFactorsXYChartAdapter.adapt(s.scaleFactors)),t.isExisting(s.fontStyles)&&(i.fontStyles=this.fontStyleAdapter.adapt(s.fontStyles)),t.isExisting(s.axisStyles)&&(i.axisStyles=this.svgStyleGroupAdapter.adapt(s.axisStyles)),t.isExisting(s.padding)&&(i.padding=this.paddingAdapter.adapt(s.padding)),Array.isArray(s.seriesColors)&&s.seriesColors.length>0&&(i.seriesColors=s.seriesColors)),i}default(){return new l(this.scaleFactorsXYChartAdapter.default(),this.fontStyleAdapter.default(),this.svgStyleGroupAdapter.default(),this.paddingAdapter.default())}}class c{constructor(){this.pointRadius=.4,this.bubbleMaxRadius=3.2,this.bubbleMinRadius=.35,this.axisTickLength=.35,this.labelToMark=.3,this.legendSwatch=.9,this.panelGap=1.6,this.refLineWidth=1,this.gridLineWidth=1}}class u{adapt(s){const i=new c;return t.isNumber(s.pointRadius)&&(i.pointRadius=s.pointRadius),t.isNumber(s.bubbleMaxRadius)&&(i.bubbleMaxRadius=s.bubbleMaxRadius),t.isNumber(s.bubbleMinRadius)&&(i.bubbleMinRadius=s.bubbleMinRadius),t.isNumber(s.axisTickLength)&&(i.axisTickLength=s.axisTickLength),t.isNumber(s.labelToMark)&&(i.labelToMark=s.labelToMark),t.isNumber(s.legendSwatch)&&(i.legendSwatch=s.legendSwatch),t.isNumber(s.panelGap)&&(i.panelGap=s.panelGap),t.isNumber(s.refLineWidth)&&(i.refLineWidth=s.refLineWidth),t.isNumber(s.gridLineWidth)&&(i.gridLineWidth=s.gridLineWidth),i}default(){return new c}}class f{constructor(t,s,i,n){this.count=t,this.drawingRect=i,this.panelGapPx=n,this.columns=Math.max(1,Math.min(null!=s?s:t,t)),this.rows=Math.max(1,Math.ceil(t/this.columns))}panelRect(t){const s=t%this.columns,i=Math.floor(t/this.columns),n=(this.drawingRect.width-(this.columns-1)*this.panelGapPx)/this.columns,o=(this.drawingRect.height-(this.rows-1)*this.panelGapPx)/this.rows;return{x:this.drawingRect.x+s*(n+this.panelGapPx),y:this.drawingRect.y+i*(o+this.panelGapPx),width:n,height:o}}isOuterLeft(t){return t%this.columns==0}isOuterBottom(t){return t+this.columns>=this.count}}const d=["n","ne","e","se","s","sw","w","nw"],v=Math.SQRT1_2;class w{constructor(t,s,i=new o){this.frame=t,this.gapPx=s,this.manager=i}registerMark(t,s,i){this.manager.register(this.bounds(t-i,s-i,2*i,2*i))}selectCandidates(t,s,i,n){if("none"===s)return{selected:[],unknownNames:[]};if("all"===s)return{selected:[...t],unknownNames:[]};if("auto"===s)return{selected:t.slice(0,i),unknownNames:[]};const o=new Set(s),e=t.filter((t=>o.has(n(t)))),r=new Set(e.map((t=>n(t))));return{selected:e,unknownNames:s.filter((t=>!r.has(t)))}}place(t){const s=[];for(const i of t)for(const t of d){const n=this.anchorBox(i,t);if(!this.insideFrame(n.x,n.y,i.width,i.height))continue;const o=this.bounds(n.x,n.y,i.width,i.height);if(!this.manager.hasCollision(o)){this.manager.register(o),s.push({candidate:i,x:n.x,y:n.y,anchor:t});break}}return s}anchorBox(t,s){const i=t.r+this.gapPx,n=t.r*v+.5*this.gapPx;switch(s){case"n":return{x:t.cx-t.width/2,y:t.cy-i-t.height};case"ne":return{x:t.cx+n,y:t.cy-n-t.height};case"e":return{x:t.cx+i,y:t.cy-t.height/2};case"se":return{x:t.cx+n,y:t.cy+n};case"s":return{x:t.cx-t.width/2,y:t.cy+i};case"sw":return{x:t.cx-n-t.width,y:t.cy+n};case"w":return{x:t.cx-i-t.width,y:t.cy-t.height/2};case"nw":return{x:t.cx-n-t.width,y:t.cy-n-t.height}}}insideFrame(t,s,i,n){return t>=this.frame.x&&s>=this.frame.y&&t+i<=this.frame.x+this.frame.width&&s+n<=this.frame.y+this.frame.height}bounds(t,s,i,n){return{x:t,y:s,width:i,height:n,pointIndex:0,preferredHook:e.Center}}}class m{constructor(t,s,i,n){this.xScale=t,this.yScale=s,this.rect=i,this.styles=n}get em(){return this.styles.fontStyles.size}fontFamily(){return this.styles.fontStyles.font.replace(/^[\d.]+px\s*/,"")}drawBands(t,s,i){var n,o,e,r;const h=this.styles.axisStyles.pl.fill;if(void 0!==s&&(void 0!==s.from||void 0!==s.to)){const i=this.xScale.scale(null!==(n=s.from)&&void 0!==n?n:this.xScale.domainMin),e=this.xScale.scale(null!==(o=s.to)&&void 0!==o?o:this.xScale.domainMax);t.rect(Math.abs(e-i),this.rect.height).move(Math.min(i,e),this.rect.y).fill(h)}if(void 0!==i&&(void 0!==i.from||void 0!==i.to)){const s=this.yScale.scale(null!==(e=i.from)&&void 0!==e?e:this.yScale.domainMin),n=this.yScale.scale(null!==(r=i.to)&&void 0!==r?r:this.yScale.domainMax);t.rect(this.rect.width,Math.abs(s-n)).move(this.rect.x,Math.min(s,n)).fill(h)}}drawGrid(t,s,i){const n={color:this.styles.axisStyles.pp.stroke,width:this.styles.scaleFactors.gridLineWidth};for(const i of s){const s=this.yScale.scale(i);t.line(this.rect.x,s,this.rect.x+this.rect.width,s).stroke(n)}if(void 0!==i)for(const s of i){const i=this.xScale.scale(s);t.line(i,this.rect.y,i,this.rect.y+this.rect.height).stroke(n)}}drawRefLines(t,s,i){const n={color:this.styles.axisStyles.fc.stroke,width:this.styles.scaleFactors.refLineWidth};if(void 0!==s){const i=this.xScale.scale(s);t.line(i,this.rect.y,i,this.rect.y+this.rect.height).stroke(n)}if(void 0!==i){const s=this.yScale.scale(i);t.line(this.rect.x,s,this.rect.x+this.rect.width,s).stroke(n)}}drawFrame(t){t.rect(this.rect.width,this.rect.height).move(this.rect.x,this.rect.y).fill("none").stroke({color:this.styles.axisStyles.ac.stroke,width:this.styles.scaleFactors.gridLineWidth})}drawTickLabels(t,s){const i=this.styles.scaleFactors.axisTickLength*this.em,n={size:this.styles.fontStyles.size,anchor:"start"},o=this.fontFamily(),e=this.styles.fontStyles.color;if(s.showXLabels)for(const h of s.ticksX){const l=this.xScale.scale(h);t.text(r.number(h,"decimal",s.xDecimals,s.xDecimals)).font(Object.assign(Object.assign({},n),{anchor:"middle"})).fill(e).attr({x:l,y:this.rect.y+this.rect.height+i+.8*this.em,"font-family":o})}if(s.showYLabels)for(const h of s.ticksY){const l=this.yScale.scale(h);t.text(r.number(h,"decimal",s.yDecimals,s.yDecimals)).font(Object.assign(Object.assign({},n),{anchor:"end"})).fill(e).attr({x:this.rect.x-i,y:l+.35*this.em,"font-family":o})}}drawPanelTitle(t,s){""!==s&&t.text(s).font({size:this.styles.fontStyles.size,weight:"bold",anchor:"start"}).fill(this.styles.fontStyles.color).attr({x:this.rect.x+.5*this.em,y:this.rect.y+1.2*this.em,"font-family":this.fontFamily()})}}class p{constructor(t){this.styles=t}get em(){return this.styles.fontStyles.size}get rowHeight(){return 1.5*this.em}get swatchSize(){return this.styles.scaleFactors.legendSwatch*this.em}textWidth(t,s=!1){const i=h(t,{font:this.styles.fontStyles.font,fontSize:this.styles.fontStyles.size+"px",fontWeight:s?"bold":"normal"}).width;return Number.isFinite(i)&&i>0?i:.6*t.length*this.em}rows(t){const s=[];t.sizeCaption.forEach(((t,i)=>{s.push({text:t,bold:0===i,treatment:null})})),null!==t.title&&""!==t.title&&s.push({text:t.title,bold:!0,treatment:null});for(const i of t.compareEntries)s.push({text:i.label,bold:!1,treatment:i.treatment});for(const i of t.entries)s.push({text:i.label,bold:!1,treatment:i.treatment});return s}measure(t,s){const i=this.rows(t);if(0===i.length)return{width:0,height:0};const n=this.swatchSize+.4*this.em;if("bottom"===s){let t=0;for(const s of i)t+=(null!==s.treatment?n:0)+this.textWidth(s.text,s.bold)+1.5*this.em;return{width:t,height:this.rowHeight}}let o=0;for(const t of i)o=Math.max(o,(null!==t.treatment?n:0)+this.textWidth(t.text,t.bold));return{width:o,height:i.length*this.rowHeight}}draw(t,s,i,n,o){const e=this.rows(s),r=this.swatchSize+.4*this.em;let h=i,l=n;for(const s of e){let i=h;if(null!==s.treatment){const n=t.circle(this.swatchSize).move(h,l+(this.rowHeight-this.swatchSize)/2).fill(s.treatment.hatch?"#ffffff":s.treatment.fill).stroke({color:"#ffffff"===s.treatment.stroke?s.treatment.fill:s.treatment.stroke,width:s.treatment.strokeWidth});void 0!==s.treatment.dasharray&&n.attr("stroke-dasharray",s.treatment.dasharray),i+=r}t.text(s.text).font({size:this.styles.fontStyles.size,weight:s.bold?"bold":"normal",anchor:"start"}).fill(this.styles.fontStyles.color).attr({x:i,y:l+this.rowHeight/2+.35*this.em,"font-family":this.fontFamily()}),"bottom"===o?h=i+this.textWidth(s.text,s.bold)+1.5*this.em:l+=this.rowHeight}}fontFamily(){return this.styles.fontStyles.font.replace(/^[\d.]+px\s*/,"")}}class x{constructor(){this.operation="+",this.custom={},this.counts={}}slotValue(s){const i=this[s];return t.isNumber(i)?i:null}slotHasNoData(t){return 0===this.counts[t]}}const y=["ac1","ac2","ac3","ac4","pp1","pp2","pp3","pp4","fc1","fc2","fc3","fc4","pl1","pl2","pl3","pl4"];class b{adapt(s){const i=new x;if(t.isOperator(s.operation)&&(i.operation=s.operation),t.isString(s.date)){const t=n.fromISO(s.date);i.date=t.isValid?t:void 0}t.isString(s.rowGroup)&&t.isNumber(s.rowGroupIndex)&&(i.rowGroup=s.rowGroup,i.rowGroupIndex=s.rowGroupIndex),t.isString(s.category)&&t.isNumber(s.categoryIndex)&&(i.category=s.category,i.categoryIndex=s.categoryIndex),t.isString(s.subCategory)&&t.isNumber(s.subCategoryIndex)&&(i.subCategory=s.subCategory,i.subCategoryIndex=s.subCategoryIndex),t.isString(s.columnGroup)&&t.isNumber(s.columnGroupIndex)&&(i.columnGroup=s.columnGroup,i.columnGroupIndex=s.columnGroupIndex),t.isString(s.columnSubGroup)&&t.isNumber(s.columnSubGroupIndex)&&(i.columnSubGroup=s.columnSubGroup,i.columnSubGroupIndex=s.columnSubGroupIndex);for(const n of y){t.isNumber(s[n])&&(i[n]=s[n]);const o=s[`${n}_cnt`];t.isNumber(o)&&(i.counts[n]=o)}for(const t of Object.keys(s))t.startsWith("_")&&(i.custom[t]=s[t]);return i}default(){return new x}}const g={rowGroup:"rowGroupIndex",category:"categoryIndex",subCategory:"subCategoryIndex"};function M(t,s){if("scenario"===s.kind)return{value:t.slotValue(s.slot),varianceNoData:!1};if(t.slotHasNoData(s.measure.base)||t.slotHasNoData(s.measure.delta))return{value:null,varianceNoData:!0};const i=s.measure.compute(t.slotValue(s.measure.base),t.slotValue(s.measure.delta));return{value:i,varianceNoData:null===i}}function N(t,s){return void 0!==s&&(void 0!==s.min&&t<s.min||void 0!==s.max&&t>s.max)}function S(t,i){return"scenario"!==t.kind?null:i+s(t.slot)}function k(t,s){var i,n,o,e,r,h,l,a,c;const u=[],f=new Set,d=[];let v=0,w=0,m=0,p=0,x=0;const y=new Map,b=new Map,k=new Map,j=null!==(i=s.compareFamily)&&void 0!==i?i:null,z=null!==j?S(s.measures.x,j):null,O=null!==j?S(s.measures.y,j):null,B=null!==j&&void 0!==s.measures.size?S(s.measures.size,j):null;for(const i of t){const t=i[s.pointLevel];if(null==t||""===t)continue;const u=null!==(n=null!==s.facetLevel?i[s.facetLevel]:"")&&void 0!==n?n:"",S=null!==(o=null!==s.seriesLevel?i[s.seriesLevel]:"")&&void 0!==o?o:"",j=`${u}\0${t}`;if(f.has(j)){v++,d.length<5&&!d.includes(t)&&d.push(t);continue}const C=M(i,s.measures.x),F=M(i,s.measures.y);if(null===C.value||null===F.value){(C.varianceNoData||F.varianceNoData)&&w++;continue}if(N(C.value,null===(e=s.domains)||void 0===e?void 0:e.x)||N(F.value,null===(r=s.domains)||void 0===r?void 0:r.y)){m++;continue}const D={name:t,seriesKey:S,facetKey:u,x:C.value,y:F.value,row:i};if(void 0!==s.measures.size){const t=M(i,s.measures.size).value;if(null===t)continue;if(t<0){p++;continue}D.size=t}if(void 0!==s.measures.share){const t=M(i,s.measures.share).value;null!==t&&(t<0||t>1?(x++,D.share=Math.min(1,Math.max(0,t))):D.share=t)}if(null!==z&&null!==O){const t=i.slotValue(z),n=i.slotValue(O),o=null!==B?i.slotValue(B):null;null===t||null===n||null!==B&&null===o?D.compare=null:N(t,null===(h=s.domains)||void 0===h?void 0:h.x)||N(n,null===(l=s.domains)||void 0===l?void 0:l.y)?(m++,D.compare=null):(D.compare={x:t,y:n},null!==o&&(D.compare.size=o))}if(f.add(j),k.has(u)||k.set(u,[]),k.get(u).push(D),null!==s.facetLevel){const t=i[g[s.facetLevel]];null!=t&&t<(null!==(a=y.get(u))&&void 0!==a?a:Number.POSITIVE_INFINITY)&&y.set(u,t)}if(null!==s.seriesLevel){const t=i[g[s.seriesLevel]];null!=t&&t<(null!==(c=b.get(S))&&void 0!==c?c:Number.POSITIVE_INFINITY)&&b.set(S,t)}}const C=[...k.keys()].sort(((t,s)=>{var i,n;return(null!==(i=y.get(t))&&void 0!==i?i:Number.MAX_SAFE_INTEGER)-(null!==(n=y.get(s))&&void 0!==n?n:Number.MAX_SAFE_INTEGER)})),F=C.map((t=>{let i=k.get(t);return s.limit>0&&i.length>s.limit&&(i="size"===s.limitBy?[...i].sort(((t,s)=>{var i,n;return(null!==(i=s.size)&&void 0!==i?i:0)-(null!==(n=t.size)&&void 0!==n?n:0)})).slice(0,s.limit):i.slice(0,s.limit)),{key:t,points:i}})),D=new Set;for(const t of F)for(const s of t.points)D.add(s.seriesKey);const H=[...D].sort(((t,s)=>{var i,n;return(null!==(i=b.get(t))&&void 0!==i?i:Number.MAX_SAFE_INTEGER)-(null!==(n=b.get(s))&&void 0!==n?n:Number.MAX_SAFE_INTEGER)})).map(((t,s)=>({key:t,index:s})));let I=null,L=0;for(const t of F)for(const s of t.points){L++;const t=[s.x],i=[s.y],n=void 0!==s.size?[s.size]:[];null!=s.compare&&(t.push(s.compare.x),i.push(s.compare.y),void 0!==s.compare.size&&n.push(s.compare.size)),null===I&&(I={xMin:t[0],xMax:t[0],yMin:i[0],yMax:i[0],sizeMax:0});for(const s of t)I.xMin=Math.min(I.xMin,s),I.xMax=Math.max(I.xMax,s);for(const t of i)I.yMin=Math.min(I.yMin,t),I.yMax=Math.max(I.yMax,t);for(const t of n)I.sizeMax=Math.max(I.sizeMax,t)}return v>0&&u.push({code:"xy-duplicate-point",data:{count:String(v),names:d.join(", ")}}),w>0&&u.push({code:"xy-variance-nodata",data:{count:String(w)}}),m>0&&u.push({code:"xy-point-clipped",data:{count:String(m)}}),p>0&&u.push({code:"bubble-size-negative",data:{count:String(p)}}),x>0&&u.push({code:"bubble-share-range",data:{count:String(x)}}),L>5e3&&u.push({code:"xy-point-budget",data:{count:String(L)}}),{facets:F,series:H,extents:I,warnings:u,totalPoints:L}}export{f as F,w as P,u as S,b as X,p as a,m as b,a as c,k as r}
@@ -0,0 +1,233 @@
1
+ 'use strict';
2
+
3
+ var VarianceMeasure = require('./VarianceMeasure-NY9yhiNV.js');
4
+
5
+ /**
6
+ * Parses a raw object-prop attribute value. A blank value yields `data: null`
7
+ * without error. A value starting with `{` must be valid JSON describing an
8
+ * object. Any other bare string is treated as shorthand for
9
+ * `{ [shorthandKey]: value }` when a shorthand key is allowed, otherwise it
10
+ * is a parse error.
11
+ */
12
+ function parseSpec(raw, shorthandKey) {
13
+ var _a;
14
+ const trimmed = (_a = raw === null || raw === void 0 ? void 0 : raw.trim()) !== null && _a !== void 0 ? _a : "";
15
+ if (trimmed === "" || trimmed === "null") {
16
+ return { data: null, parseError: false };
17
+ }
18
+ if (trimmed.startsWith("{") || trimmed.startsWith("[")) {
19
+ try {
20
+ const parsed = JSON.parse(trimmed);
21
+ if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
22
+ return { data: null, parseError: true };
23
+ }
24
+ return { data: parsed, parseError: false };
25
+ }
26
+ catch (_b) {
27
+ return { data: null, parseError: true };
28
+ }
29
+ }
30
+ if (shorthandKey !== null) {
31
+ return { data: { [shorthandKey]: trimmed }, parseError: false };
32
+ }
33
+ return { data: null, parseError: true };
34
+ }
35
+ function collectUnknownKeys(data, knownKeys) {
36
+ return Object.keys(data).filter((key) => !knownKeys.includes(key));
37
+ }
38
+ function readString(data, key, invalid) {
39
+ if (!VarianceMeasure.CompareUtil.isExisting(data[key])) {
40
+ return undefined;
41
+ }
42
+ if (VarianceMeasure.CompareUtil.isString(data[key])) {
43
+ return data[key];
44
+ }
45
+ invalid.push(key);
46
+ return undefined;
47
+ }
48
+ function readNumber(data, key, invalid) {
49
+ if (!VarianceMeasure.CompareUtil.isExisting(data[key])) {
50
+ return undefined;
51
+ }
52
+ if (VarianceMeasure.CompareUtil.isNumber(data[key])) {
53
+ return data[key];
54
+ }
55
+ invalid.push(key);
56
+ return undefined;
57
+ }
58
+ function readHighlight(data, invalid) {
59
+ if (!VarianceMeasure.CompareUtil.isExisting(data.highlight)) {
60
+ return undefined;
61
+ }
62
+ if (!VarianceMeasure.CompareUtil.isObject(data.highlight) || Array.isArray(data.highlight)) {
63
+ invalid.push("highlight");
64
+ return undefined;
65
+ }
66
+ const range = data.highlight;
67
+ const result = {};
68
+ const from = readNumber(range, "from", invalid);
69
+ const to = readNumber(range, "to", invalid);
70
+ if (from !== undefined) {
71
+ result.from = from;
72
+ }
73
+ if (to !== undefined) {
74
+ result.to = to;
75
+ }
76
+ return result;
77
+ }
78
+ const AXIS_KEYS = ["measure", "label", "unit", "min", "max", "refLine", "highlight"];
79
+ function toAxisConfig(data) {
80
+ const invalidFields = [];
81
+ const measure = readString(data, "measure", invalidFields);
82
+ if (measure === undefined || measure.trim() === "") {
83
+ invalidFields.push("measure");
84
+ return { config: null, unknownKeys: collectUnknownKeys(data, AXIS_KEYS), invalidFields };
85
+ }
86
+ const config = { measure: measure.trim() };
87
+ config.label = readString(data, "label", invalidFields);
88
+ config.unit = readString(data, "unit", invalidFields);
89
+ config.min = readNumber(data, "min", invalidFields);
90
+ config.max = readNumber(data, "max", invalidFields);
91
+ config.refLine = readNumber(data, "refLine", invalidFields);
92
+ config.highlight = readHighlight(data, invalidFields);
93
+ return { config, unknownKeys: collectUnknownKeys(data, AXIS_KEYS), invalidFields };
94
+ }
95
+ const SIZE_KEYS = ["measure", "label", "unit", "group"];
96
+ function toSizeConfig(data) {
97
+ const invalidFields = [];
98
+ const measure = readString(data, "measure", invalidFields);
99
+ if (measure === undefined || measure.trim() === "") {
100
+ invalidFields.push("measure");
101
+ return { config: null, unknownKeys: collectUnknownKeys(data, SIZE_KEYS), invalidFields };
102
+ }
103
+ const config = { measure: measure.trim() };
104
+ config.label = readString(data, "label", invalidFields);
105
+ config.unit = readString(data, "unit", invalidFields);
106
+ config.group = readString(data, "group", invalidFields);
107
+ return { config, unknownKeys: collectUnknownKeys(data, SIZE_KEYS), invalidFields };
108
+ }
109
+ const SHARE_KEYS = ["measure"];
110
+ function toShareConfig(data) {
111
+ const invalidFields = [];
112
+ const measure = readString(data, "measure", invalidFields);
113
+ if (measure === undefined || measure.trim() === "") {
114
+ invalidFields.push("measure");
115
+ return { config: null, unknownKeys: collectUnknownKeys(data, SHARE_KEYS), invalidFields };
116
+ }
117
+ return { config: { measure: measure.trim() }, unknownKeys: collectUnknownKeys(data, SHARE_KEYS), invalidFields };
118
+ }
119
+ const ISO_KEYS = ["values", "label", "unit", "highlight"];
120
+ function toIsoConfig(data) {
121
+ const invalidFields = [];
122
+ let values = null;
123
+ if (data.values === "auto") {
124
+ values = "auto";
125
+ }
126
+ else if (VarianceMeasure.CompareUtil.isArray(data.values) && data.values.every((v) => VarianceMeasure.CompareUtil.isNumber(v))) {
127
+ values = data.values;
128
+ }
129
+ else {
130
+ invalidFields.push("values");
131
+ }
132
+ if (values === null) {
133
+ return { config: null, unknownKeys: collectUnknownKeys(data, ISO_KEYS), invalidFields };
134
+ }
135
+ const config = { values };
136
+ config.label = readString(data, "label", invalidFields);
137
+ config.unit = readString(data, "unit", invalidFields);
138
+ if (VarianceMeasure.CompareUtil.isExisting(data.highlight)) {
139
+ if (VarianceMeasure.CompareUtil.isObject(data.highlight) && !Array.isArray(data.highlight)) {
140
+ const from = readNumber(data.highlight, "from", invalidFields);
141
+ if (from !== undefined) {
142
+ config.highlight = { from };
143
+ }
144
+ }
145
+ else {
146
+ invalidFields.push("highlight");
147
+ }
148
+ }
149
+ return { config, unknownKeys: collectUnknownKeys(data, ISO_KEYS), invalidFields };
150
+ }
151
+ const LABEL_KEYS = ["points", "values", "max"];
152
+ function toLabelConfig(data, defaults) {
153
+ const invalidFields = [];
154
+ const config = { points: defaults.points, values: defaults.values, max: defaults.max };
155
+ if (VarianceMeasure.CompareUtil.isExisting(data.points)) {
156
+ if (data.points === "auto" || data.points === "none" || data.points === "all") {
157
+ config.points = data.points;
158
+ }
159
+ else if (VarianceMeasure.CompareUtil.isArray(data.points) && data.points.every((p) => VarianceMeasure.CompareUtil.isString(p))) {
160
+ config.points = data.points;
161
+ }
162
+ else {
163
+ invalidFields.push("points");
164
+ }
165
+ }
166
+ if (VarianceMeasure.CompareUtil.isExisting(data.values)) {
167
+ if (VarianceMeasure.CompareUtil.isBoolean(data.values)) {
168
+ config.values = data.values;
169
+ }
170
+ else {
171
+ invalidFields.push("values");
172
+ }
173
+ }
174
+ if (VarianceMeasure.CompareUtil.isExisting(data.max)) {
175
+ if (VarianceMeasure.CompareUtil.isNumber(data.max) && data.max > 0) {
176
+ config.max = Math.floor(data.max);
177
+ }
178
+ else {
179
+ invalidFields.push("max");
180
+ }
181
+ }
182
+ return { config, unknownKeys: collectUnknownKeys(data, LABEL_KEYS), invalidFields };
183
+ }
184
+ const FACET_KEYS = ["level", "columns"];
185
+ function toFacetConfig(data) {
186
+ const invalidFields = [];
187
+ const level = VarianceMeasure.CompareUtil.isString(data.level) ? data.level.toLowerCase() : null;
188
+ if (level !== "rowgroup" && level !== "category") {
189
+ invalidFields.push("level");
190
+ return { config: null, unknownKeys: collectUnknownKeys(data, FACET_KEYS), invalidFields };
191
+ }
192
+ const config = { level };
193
+ if (VarianceMeasure.CompareUtil.isExisting(data.columns)) {
194
+ if (VarianceMeasure.CompareUtil.isNumber(data.columns) && data.columns >= 1) {
195
+ config.columns = Math.floor(data.columns);
196
+ }
197
+ else {
198
+ invalidFields.push("columns");
199
+ }
200
+ }
201
+ return { config, unknownKeys: collectUnknownKeys(data, FACET_KEYS), invalidFields };
202
+ }
203
+ const LEGEND_KEYS = ["show", "position"];
204
+ function toLegendConfig(data) {
205
+ const invalidFields = [];
206
+ const config = { show: true, position: "right" };
207
+ if (VarianceMeasure.CompareUtil.isExisting(data.show)) {
208
+ if (VarianceMeasure.CompareUtil.isBoolean(data.show)) {
209
+ config.show = data.show;
210
+ }
211
+ else {
212
+ invalidFields.push("show");
213
+ }
214
+ }
215
+ if (VarianceMeasure.CompareUtil.isExisting(data.position)) {
216
+ if (data.position === "right" || data.position === "bottom") {
217
+ config.position = data.position;
218
+ }
219
+ else {
220
+ invalidFields.push("position");
221
+ }
222
+ }
223
+ return { config, unknownKeys: collectUnknownKeys(data, LEGEND_KEYS), invalidFields };
224
+ }
225
+
226
+ exports.parseSpec = parseSpec;
227
+ exports.toAxisConfig = toAxisConfig;
228
+ exports.toFacetConfig = toFacetConfig;
229
+ exports.toIsoConfig = toIsoConfig;
230
+ exports.toLabelConfig = toLabelConfig;
231
+ exports.toLegendConfig = toLegendConfig;
232
+ exports.toShareConfig = toShareConfig;
233
+ exports.toSizeConfig = toSizeConfig;