@bino-bi/bn-template-engine 1.0.0-alpha.9 → 1.0.0-next.20

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 (400) hide show
  1. package/LICENSE +203 -21
  2. package/dist/bn-template-engine/bn-template-engine.esm.js +1 -1
  3. package/dist/bn-template-engine/p-28d5c266.entry.js +1 -0
  4. package/dist/bn-template-engine/p-2d3ea756.entry.js +1 -0
  5. package/dist/bn-template-engine/p-2fba7c99.entry.js +1 -0
  6. package/dist/bn-template-engine/p-6077155f.entry.js +1 -0
  7. package/dist/bn-template-engine/p-687032d5.entry.js +1 -0
  8. package/dist/bn-template-engine/p-6c7f0076.entry.js +1 -0
  9. package/dist/bn-template-engine/p-6lOdN-fB.js +1 -0
  10. package/dist/bn-template-engine/p-7e9dbc93.entry.js +1 -0
  11. package/dist/bn-template-engine/p-99477a27.entry.js +1 -0
  12. package/dist/bn-template-engine/p-A8xyE4b1.js +1 -0
  13. package/dist/bn-template-engine/p-BA48JiHe.js +1 -0
  14. package/dist/bn-template-engine/p-BgIpdpfH.js +1 -0
  15. package/dist/bn-template-engine/p-BjBz5cSL.js +1 -0
  16. package/dist/bn-template-engine/p-BpWWgN6k.js +1 -0
  17. package/dist/bn-template-engine/p-C5uvAEKI.js +1 -0
  18. package/dist/bn-template-engine/p-C8Q0lsaU.js +1 -0
  19. package/dist/bn-template-engine/p-C9i1Xsib.js +1 -0
  20. package/dist/bn-template-engine/p-CJThzFZm.js +1 -0
  21. package/dist/bn-template-engine/p-CYE0I1Mx.js +1 -0
  22. package/dist/bn-template-engine/p-DsTzlzxQ.js +1 -0
  23. package/dist/bn-template-engine/p-DwYUTvvI.js +1 -0
  24. package/dist/bn-template-engine/p-a1380d7c.entry.js +1 -0
  25. package/dist/bn-template-engine/p-a4ea9a79.entry.js +1 -0
  26. package/dist/bn-template-engine/p-a8291de2.entry.js +1 -0
  27. package/dist/bn-template-engine/p-b5274369.entry.js +1 -0
  28. package/dist/bn-template-engine/p-b9e94127.entry.js +1 -0
  29. package/dist/bn-template-engine/p-ba912130.entry.js +1 -0
  30. package/dist/bn-template-engine/p-de29986f.entry.js +1 -0
  31. package/dist/bn-template-engine/p-eEfqksk-.js +1 -0
  32. package/dist/bn-template-engine/p-fFtEvsY-.js +1 -0
  33. package/dist/cjs/AxisConfig-D7CAyPLO.js +233 -0
  34. package/dist/cjs/LabelCollisionManager-DkdQ9Xdg.js +412 -0
  35. package/dist/cjs/NumericScale-BAyYXpKL.js +107 -0
  36. package/dist/cjs/Order-IPfAP0q8.js +87 -0
  37. package/dist/cjs/SVGStyle-BD8jApd4.js +8209 -0
  38. package/dist/cjs/SVGVariancesStyleGroup-BaWzR951.js +50 -0
  39. package/dist/cjs/VarianceMeasure-BBWTgv2e.js +372 -0
  40. package/dist/cjs/XYChartDataRow-BoR0CTfl.js +829 -0
  41. package/dist/cjs/bn-asset_21.cjs.entry.js +16105 -0
  42. package/dist/cjs/bn-chart-bubble.cjs.entry.js +762 -0
  43. package/dist/cjs/bn-chart-bullet.cjs.entry.js +785 -0
  44. package/dist/cjs/bn-chart-scatter.cjs.entry.js +658 -0
  45. package/dist/cjs/bn-grid.cjs.entry.js +5 -3
  46. package/dist/cjs/bn-image.cjs.entry.js +5 -3
  47. package/dist/cjs/bn-internationalization.cjs.entry.js +10 -8
  48. package/dist/cjs/bn-ruleset.cjs.entry.js +41 -0
  49. package/dist/cjs/bn-template-engine.cjs.js +1 -1
  50. package/dist/cjs/bn-template.cjs.entry.js +1 -1
  51. package/dist/cjs/bn-text.cjs.entry.js +8 -79
  52. package/dist/cjs/bn-tree.cjs.entry.js +4 -2
  53. package/dist/cjs/context-protocol-BBhT9B52.js +9505 -0
  54. package/dist/cjs/editor-companion.cjs.entry.js +13 -6
  55. package/dist/cjs/ibcs-chart-bubble.cjs.entry.js +624 -0
  56. package/dist/cjs/ibcs-chart-bullet.cjs.entry.js +673 -0
  57. package/dist/cjs/ibcs-chart-scatter.cjs.entry.js +667 -0
  58. package/dist/cjs/layoutObserver-DUYYkDMQ.js +199 -0
  59. package/dist/cjs/loader.cjs.js +1 -1
  60. package/dist/cjs/sanitizeHtml-LuZr1IMd.js +85 -0
  61. package/dist/cjs/scaling-BIJQ2NV1.js +589 -0
  62. package/dist/cjs/{withBodyObserver-D7BKWN2N.js → withBodyObserver-BKUE_ypL.js} +12 -7
  63. package/dist/cjs/withScalingGroup-D5clRvRe.js +73 -0
  64. package/dist/cjs/withStyled-Cm9dWQhu.js +1168 -0
  65. package/dist/collection/collection-manifest.json +9 -1
  66. package/dist/collection/components/bn-body/bn-body.css +1 -0
  67. package/dist/collection/components/bn-card/bn-card.css +2 -0
  68. package/dist/collection/components/bn-chart-bubble/bn-chart-bubble.css +10 -0
  69. package/dist/collection/components/bn-chart-bubble/bn-chart-bubble.js +1110 -0
  70. package/dist/collection/components/bn-chart-bubble/ibcs-chart-bubble.css +9 -0
  71. package/dist/collection/components/bn-chart-bubble/ibcs-chart-bubble.js +653 -0
  72. package/dist/collection/components/bn-chart-bubble/utils/BubbleChart.js +472 -0
  73. package/dist/collection/components/bn-chart-bullet/bn-chart-bullet.css +10 -0
  74. package/dist/collection/components/bn-chart-bullet/bn-chart-bullet.js +1014 -0
  75. package/dist/collection/components/bn-chart-bullet/ibcs-chart-bullet.css +9 -0
  76. package/dist/collection/components/bn-chart-bullet/ibcs-chart-bullet.js +538 -0
  77. package/dist/collection/components/bn-chart-bullet/utils/BulletChart.js +440 -0
  78. package/dist/collection/components/bn-chart-bullet/utils/model/BulletChartStyle.js +132 -0
  79. package/dist/collection/components/bn-chart-bullet/utils/model/BulletConfig.js +89 -0
  80. package/dist/collection/components/bn-chart-bullet/utils/model/index.js +2 -0
  81. package/dist/collection/components/bn-chart-scatter/bn-chart-scatter.css +10 -0
  82. package/dist/collection/components/bn-chart-scatter/bn-chart-scatter.js +965 -0
  83. package/dist/collection/components/bn-chart-scatter/ibcs-chart-scatter.css +9 -0
  84. package/dist/collection/components/bn-chart-scatter/ibcs-chart-scatter.js +580 -0
  85. package/dist/collection/components/bn-chart-scatter/utils/ScatterChart.js +409 -0
  86. package/dist/collection/components/bn-chart-structure/bn-chart-structure.js +126 -43
  87. package/dist/collection/components/bn-chart-structure/ibcs-chart-structure.js +104 -37
  88. package/dist/collection/components/bn-chart-structure/utils/StructureChart.js +101 -60
  89. package/dist/collection/components/bn-chart-structure/utils/helper/ElementPositions.js +46 -4
  90. package/dist/collection/components/bn-chart-structure/utils/model/StructureChartComponentConfig.js +5 -4
  91. package/dist/collection/components/bn-chart-time/bn-chart-time.css +1 -1
  92. package/dist/collection/components/bn-chart-time/bn-chart-time.js +161 -44
  93. package/dist/collection/components/bn-chart-time/ibcs-chart-time.js +97 -32
  94. package/dist/collection/components/bn-chart-time/utils/TimeChart.js +151 -75
  95. package/dist/collection/components/bn-chart-time/utils/elements/StackedColumn.js +3 -3
  96. package/dist/collection/components/bn-chart-time/utils/model/TimeChartComponentConfig.js +10 -4
  97. package/dist/collection/components/bn-chart-time/utils/model/TimeChartDataRow.js +2 -0
  98. package/dist/collection/components/bn-component-style/bn-component-style.js +1 -1
  99. package/dist/collection/components/bn-context/bn-context.js +20 -1
  100. package/dist/collection/components/bn-dataset/bn-dataset.js +226 -23
  101. package/dist/collection/components/bn-datasource/bn-datasource.js +163 -12
  102. package/dist/collection/components/bn-footer/bn-footer.js +1 -1
  103. package/dist/collection/components/bn-grid/bn-grid.js +20 -1
  104. package/dist/collection/components/bn-image/bn-image.js +1 -1
  105. package/dist/collection/components/bn-internationalization/bn-internationalization.js +10 -7
  106. package/dist/collection/components/bn-layout-card/bn-layout-card.css +8 -3
  107. package/dist/collection/components/bn-layout-card/bn-layout-card.js +98 -35
  108. package/dist/collection/components/bn-layout-page/bn-layout-page.css +5 -3
  109. package/dist/collection/components/bn-layout-page/bn-layout-page.js +98 -25
  110. package/dist/collection/components/bn-message/bn-message.css +6 -2
  111. package/dist/collection/components/bn-message/bn-message.js +3 -2
  112. package/dist/collection/components/bn-page/bn-page.js +1 -1
  113. package/dist/collection/components/bn-ruleset/bn-ruleset.css +3 -0
  114. package/dist/collection/components/bn-ruleset/bn-ruleset.js +68 -0
  115. package/dist/collection/components/bn-scaling-group/bn-scaling-group.css +3 -0
  116. package/dist/collection/components/bn-scaling-group/bn-scaling-group.js +136 -0
  117. package/dist/collection/components/bn-table/bn-table.js +318 -62
  118. package/dist/collection/components/bn-table/ibcs-table.css +8 -0
  119. package/dist/collection/components/bn-table/ibcs-table.js +162 -33
  120. package/dist/collection/components/bn-table/utils/Table.js +72 -29
  121. package/dist/collection/components/bn-table/utils/elements/CellBarChart.js +13 -8
  122. package/dist/collection/components/bn-table/utils/elements/TableRow.js +3 -2
  123. package/dist/collection/components/bn-table/utils/elements/WaterfallBar.js +47 -0
  124. package/dist/collection/components/bn-table/utils/elements/index.js +1 -0
  125. package/dist/collection/components/bn-table/utils/factories/tableDataSetFactory.js +120 -23
  126. package/dist/collection/components/bn-table/utils/helper/DataQuery.js +380 -50
  127. package/dist/collection/components/bn-table/utils/helper/IntervalColumns.js +140 -0
  128. package/dist/collection/components/bn-table/utils/helper/QueryGroup.js +4 -9
  129. package/dist/collection/components/bn-table/utils/helper/WaterfallCalculator.js +166 -0
  130. package/dist/collection/components/bn-table/utils/helper/index.js +2 -0
  131. package/dist/collection/components/bn-table/utils/model/TableAttribute.js +46 -0
  132. package/dist/collection/components/bn-table/utils/model/TableComponentConfig.js +20 -4
  133. package/dist/collection/components/bn-template/bn-template.js +1 -1
  134. package/dist/collection/components/bn-text/bn-text.js +2 -75
  135. package/dist/collection/components/bn-title/bn-title.js +31 -3
  136. package/dist/collection/components/bn-title/ibcs-title/ibcs-title.css +4 -0
  137. package/dist/collection/components/bn-title/ibcs-title/ibcs-title.js +52 -6
  138. package/dist/collection/components/bn-title/ibcs-title/utils/Title.js +7 -4
  139. package/dist/collection/components/bn-title/ibcs-title/utils/factories/TitleDataSetFactory.js +6 -2
  140. package/dist/collection/components/bn-title/ibcs-title/utils/model/TitleConfig.js +5 -0
  141. package/dist/collection/components/bn-tree/bn-tree.js +19 -0
  142. package/dist/collection/components/editor-companion/editor-companion.js +12 -5
  143. package/dist/collection/context/scopedDb.js +127 -0
  144. package/dist/collection/stores/componentStyles.js +67 -0
  145. package/dist/collection/stores/createScopedStores.js +11 -5
  146. package/dist/collection/stores/internationalization.js +77 -3
  147. package/dist/collection/stores/ruleSets.js +46 -0
  148. package/dist/collection/utils/DateStringFactory.js +31 -0
  149. package/dist/collection/utils/constants.js +5 -0
  150. package/dist/collection/utils/dataAnalyzer.js +14 -8
  151. package/dist/collection/utils/ibcsRuleSet.js +14 -26
  152. package/dist/collection/utils/layoutObserver.js +88 -0
  153. package/dist/collection/utils/parentDimensions.js +71 -15
  154. package/dist/collection/utils/sanitizeHtml.js +81 -0
  155. package/dist/collection/utils/validate.js +47 -0
  156. package/dist/collection/utils/withBodyObserver.js +12 -7
  157. package/dist/collection/utils/withComponentStyle.js +3 -5
  158. package/dist/collection/utils/withDataset.js +43 -39
  159. package/dist/collection/utils/withDatasource.js +28 -18
  160. package/dist/collection/utils/withInheritedProps.js +26 -1
  161. package/dist/collection/utils/withRuleSet.js +105 -0
  162. package/dist/collection/utils/withScalingGroup.js +69 -0
  163. package/dist/collection/utils/withTranslation.js +53 -15
  164. package/dist/collection/utils/xy/FacetGrid.js +36 -0
  165. package/dist/collection/utils/xy/IsoCurves.js +156 -0
  166. package/dist/collection/utils/xy/NumericScale.js +103 -0
  167. package/dist/collection/utils/xy/PointLabeler.js +96 -0
  168. package/dist/collection/utils/xy/RadiusScale.js +42 -0
  169. package/dist/collection/utils/xy/SeriesPalette.js +80 -0
  170. package/dist/collection/utils/xy/VarianceMeasure.js +76 -0
  171. package/dist/collection/utils/xy/XYFrame.js +120 -0
  172. package/dist/collection/utils/xy/XYLegend.js +107 -0
  173. package/dist/collection/utils/xy/model/AxisConfig.js +221 -0
  174. package/dist/collection/utils/xy/model/ScaleFactorsXYChart.js +69 -0
  175. package/dist/collection/utils/xy/model/XYChartDataRow.js +0 -0
  176. package/dist/collection/utils/xy/model/XYChartStyle.js +52 -0
  177. package/dist/components/AxisConfig.js +1 -0
  178. package/dist/components/CompareUtil.js +1 -0
  179. package/dist/components/DataFormatDigits.js +1 -1
  180. package/dist/components/DateStringFactory.js +1 -1
  181. package/dist/components/LabelCollisionManager.js +1 -0
  182. package/dist/components/NumericScale.js +1 -0
  183. package/dist/components/Order.js +1 -1
  184. package/dist/components/SVGVariancesStyleGroup.js +1 -1
  185. package/dist/components/SiPrefix.js +1 -0
  186. package/dist/components/StringAdapter.js +1 -0
  187. package/dist/components/VarianceMeasure.js +1 -0
  188. package/dist/components/XYChartDataRow.js +1 -0
  189. package/dist/components/bn-body2.js +1 -1
  190. package/dist/components/bn-card2.js +1 -1
  191. package/dist/components/bn-chart-bubble.d.ts +11 -0
  192. package/dist/components/bn-chart-bubble.js +1 -0
  193. package/dist/components/bn-chart-bullet.d.ts +11 -0
  194. package/dist/components/bn-chart-bullet.js +1 -0
  195. package/dist/components/bn-chart-scatter.d.ts +11 -0
  196. package/dist/components/bn-chart-scatter.js +1 -0
  197. package/dist/components/bn-chart-structure.js +1 -1
  198. package/dist/components/bn-chart-time.js +1 -1
  199. package/dist/components/bn-component-style.js +1 -1
  200. package/dist/components/bn-context.js +1 -1
  201. package/dist/components/bn-dataset.js +1 -1
  202. package/dist/components/bn-datasource.js +1 -1
  203. package/dist/components/bn-footer2.js +1 -1
  204. package/dist/components/bn-grid.js +1 -1
  205. package/dist/components/bn-image.js +1 -1
  206. package/dist/components/bn-internationalization.js +1 -1
  207. package/dist/components/bn-layout-card.js +1 -1
  208. package/dist/components/bn-layout-page.js +1 -1
  209. package/dist/components/bn-message2.js +1 -1
  210. package/dist/components/bn-page2.js +1 -1
  211. package/dist/components/bn-ruleset.d.ts +11 -0
  212. package/dist/components/bn-ruleset.js +1 -0
  213. package/dist/components/bn-scaling-group.d.ts +11 -0
  214. package/dist/components/bn-scaling-group.js +1 -0
  215. package/dist/components/bn-table.js +1 -1
  216. package/dist/components/bn-template.js +1 -1
  217. package/dist/components/bn-text.js +1 -1
  218. package/dist/components/bn-title2.js +1 -1
  219. package/dist/components/bn-tree.js +1 -1
  220. package/dist/components/context-protocol.js +1 -1
  221. package/dist/components/editor-companion.js +1 -1
  222. package/dist/components/formatter.js +1 -0
  223. package/dist/components/ibcs-chart-bubble.d.ts +11 -0
  224. package/dist/components/ibcs-chart-bubble.js +1 -0
  225. package/dist/components/ibcs-chart-bubble2.js +1 -0
  226. package/dist/components/ibcs-chart-bullet.d.ts +11 -0
  227. package/dist/components/ibcs-chart-bullet.js +1 -0
  228. package/dist/components/ibcs-chart-bullet2.js +1 -0
  229. package/dist/components/ibcs-chart-scatter.d.ts +11 -0
  230. package/dist/components/ibcs-chart-scatter.js +1 -0
  231. package/dist/components/ibcs-chart-scatter2.js +1 -0
  232. package/dist/components/ibcs-chart-structure2.js +1 -1
  233. package/dist/components/ibcs-chart-time2.js +1 -1
  234. package/dist/components/ibcs-table2.js +1 -1
  235. package/dist/components/ibcs-title2.js +1 -1
  236. package/dist/components/layoutObserver.js +1 -0
  237. package/dist/components/luxon.js +1 -0
  238. package/dist/components/main.js +1 -0
  239. package/dist/components/merge.js +1 -0
  240. package/dist/components/sanitizeHtml.js +1 -0
  241. package/dist/components/stackColors.js +1 -0
  242. package/dist/components/validate.js +1 -1
  243. package/dist/components/withBodyObserver.js +1 -1
  244. package/dist/components/withComponentStyle.js +1 -1
  245. package/dist/components/withDataset.js +1 -0
  246. package/dist/components/withRuleSet.js +1 -0
  247. package/dist/components/withScalingGroup.js +1 -0
  248. package/dist/components/withStyled.js +1 -1
  249. package/dist/components/withTranslation.js +1 -1
  250. package/dist/esm/AxisConfig-ByIP5J-9.js +224 -0
  251. package/dist/esm/LabelCollisionManager-DaNiDiM9.js +404 -0
  252. package/dist/esm/NumericScale-DsTzlzxQ.js +105 -0
  253. package/dist/esm/Order-BQeJE_yi.js +83 -0
  254. package/dist/esm/SVGStyle-BwBlY3Km.js +8199 -0
  255. package/dist/esm/SVGVariancesStyleGroup-BpGW4CvN.js +48 -0
  256. package/dist/esm/VarianceMeasure-CE3N8Bea.js +364 -0
  257. package/dist/esm/XYChartDataRow-DeMI1JKU.js +820 -0
  258. package/dist/esm/bn-asset_21.entry.js +16083 -0
  259. package/dist/esm/bn-chart-bubble.entry.js +760 -0
  260. package/dist/esm/bn-chart-bullet.entry.js +783 -0
  261. package/dist/esm/bn-chart-scatter.entry.js +656 -0
  262. package/dist/esm/bn-grid.entry.js +5 -3
  263. package/dist/esm/bn-image.entry.js +5 -3
  264. package/dist/esm/bn-internationalization.entry.js +10 -8
  265. package/dist/esm/bn-ruleset.entry.js +39 -0
  266. package/dist/esm/bn-template-engine.js +1 -1
  267. package/dist/esm/bn-template.entry.js +1 -1
  268. package/dist/esm/bn-text.entry.js +7 -78
  269. package/dist/esm/bn-tree.entry.js +4 -2
  270. package/dist/esm/context-protocol-d8MHrEo8.js +9490 -0
  271. package/dist/esm/editor-companion.entry.js +13 -6
  272. package/dist/esm/ibcs-chart-bubble.entry.js +622 -0
  273. package/dist/esm/ibcs-chart-bullet.entry.js +671 -0
  274. package/dist/esm/ibcs-chart-scatter.entry.js +665 -0
  275. package/dist/esm/layoutObserver-BJBEyhNf.js +196 -0
  276. package/dist/esm/loader.js +1 -1
  277. package/dist/esm/sanitizeHtml-BA48JiHe.js +83 -0
  278. package/dist/esm/scaling-BGnpSN1j.js +581 -0
  279. package/dist/esm/{withBodyObserver-AFk2wwHT.js → withBodyObserver-IokS6fHD.js} +12 -7
  280. package/dist/esm/withScalingGroup-CC3UcvC5.js +71 -0
  281. package/dist/esm/withStyled-2l5Tx3cf.js +1135 -0
  282. package/dist/types/components/bn-chart-bubble/bn-chart-bubble.d.ts +193 -0
  283. package/dist/types/components/bn-chart-bubble/ibcs-chart-bubble.d.ts +58 -0
  284. package/dist/types/components/bn-chart-bubble/utils/BubbleChart.d.ts +91 -0
  285. package/dist/types/components/bn-chart-bullet/bn-chart-bullet.d.ts +172 -0
  286. package/dist/types/components/bn-chart-bullet/ibcs-chart-bullet.d.ts +52 -0
  287. package/dist/types/components/bn-chart-bullet/utils/BulletChart.d.ts +91 -0
  288. package/dist/types/components/bn-chart-bullet/utils/model/BulletChartStyle.d.ts +70 -0
  289. package/dist/types/components/bn-chart-bullet/utils/model/BulletConfig.d.ts +43 -0
  290. package/dist/types/components/bn-chart-bullet/utils/model/index.d.ts +2 -0
  291. package/dist/types/components/bn-chart-scatter/bn-chart-scatter.d.ts +172 -0
  292. package/dist/types/components/bn-chart-scatter/ibcs-chart-scatter.d.ts +53 -0
  293. package/dist/types/components/bn-chart-scatter/utils/ScatterChart.d.ts +66 -0
  294. package/dist/types/components/bn-chart-structure/bn-chart-structure.d.ts +19 -5
  295. package/dist/types/components/bn-chart-structure/ibcs-chart-structure.d.ts +13 -6
  296. package/dist/types/components/bn-chart-structure/utils/StructureChart.d.ts +21 -12
  297. package/dist/types/components/bn-chart-structure/utils/helper/ElementPositions.d.ts +16 -1
  298. package/dist/types/components/bn-chart-structure/utils/model/StructureChartComponentConfig.d.ts +5 -3
  299. package/dist/types/components/bn-chart-time/bn-chart-time.d.ts +53 -13
  300. package/dist/types/components/bn-chart-time/ibcs-chart-time.d.ts +13 -6
  301. package/dist/types/components/bn-chart-time/utils/TimeChart.d.ts +21 -12
  302. package/dist/types/components/bn-chart-time/utils/model/TimeChartComponentConfig.d.ts +7 -3
  303. package/dist/types/components/bn-context/bn-context.d.ts +8 -0
  304. package/dist/types/components/bn-dataset/bn-dataset.d.ts +47 -5
  305. package/dist/types/components/bn-datasource/bn-datasource.d.ts +53 -6
  306. package/dist/types/components/bn-grid/bn-grid.d.ts +8 -0
  307. package/dist/types/components/bn-layout-card/bn-layout-card.d.ts +39 -8
  308. package/dist/types/components/bn-layout-page/bn-layout-page.d.ts +36 -1
  309. package/dist/types/components/bn-message/bn-message.d.ts +5 -2
  310. package/dist/types/components/bn-ruleset/bn-ruleset.d.ts +8 -0
  311. package/dist/types/components/bn-scaling-group/bn-scaling-group.d.ts +37 -0
  312. package/dist/types/components/bn-table/bn-table.d.ts +74 -12
  313. package/dist/types/components/bn-table/ibcs-table.d.ts +27 -4
  314. package/dist/types/components/bn-table/utils/Table.d.ts +16 -6
  315. package/dist/types/components/bn-table/utils/elements/Cell.d.ts +2 -0
  316. package/dist/types/components/bn-table/utils/elements/CellBarChart.d.ts +33 -0
  317. package/dist/types/components/bn-table/utils/elements/TableRow.d.ts +2 -1
  318. package/dist/types/components/bn-table/utils/elements/WaterfallBar.d.ts +21 -0
  319. package/dist/types/components/bn-table/utils/elements/index.d.ts +1 -0
  320. package/dist/types/components/bn-table/utils/factories/tableDataSetFactory.d.ts +17 -9
  321. package/dist/types/components/bn-table/utils/helper/DataQuery.d.ts +35 -3
  322. package/dist/types/components/bn-table/utils/helper/IntervalColumns.d.ts +37 -0
  323. package/dist/types/components/bn-table/utils/helper/QueryGroup.d.ts +4 -5
  324. package/dist/types/components/bn-table/utils/helper/WaterfallCalculator.d.ts +55 -0
  325. package/dist/types/components/bn-table/utils/helper/index.d.ts +2 -0
  326. package/dist/types/components/bn-table/utils/model/TableAttribute.d.ts +22 -0
  327. package/dist/types/components/bn-table/utils/model/TableComponentConfig.d.ts +12 -3
  328. package/dist/types/components/bn-table/utils/model/index.d.ts +21 -0
  329. package/dist/types/components/bn-title/bn-title.d.ts +12 -1
  330. package/dist/types/components/bn-title/ibcs-title/ibcs-title.d.ts +4 -0
  331. package/dist/types/components/bn-title/ibcs-title/utils/Title.d.ts +1 -0
  332. package/dist/types/components/bn-title/ibcs-title/utils/factories/TitleDataSetFactory.d.ts +3 -1
  333. package/dist/types/components/bn-title/ibcs-title/utils/model/TitleConfig.d.ts +2 -0
  334. package/dist/types/components/bn-tree/bn-tree.d.ts +8 -0
  335. package/dist/types/components/editor-companion/editor-companion.d.ts +2 -0
  336. package/dist/types/components.d.ts +1725 -116
  337. package/dist/types/context/context-protocol.d.ts +7 -3
  338. package/dist/types/context/scopedDb.d.ts +37 -0
  339. package/dist/types/stores/componentStyles.d.ts +41 -0
  340. package/dist/types/stores/createScopedStores.d.ts +4 -2
  341. package/dist/types/stores/ruleSets.d.ts +40 -0
  342. package/dist/types/utils/DateStringFactory.d.ts +20 -1
  343. package/dist/types/utils/constants.d.ts +5 -0
  344. package/dist/types/utils/dataAnalyzer.d.ts +2 -1
  345. package/dist/types/utils/ibcsRuleSet.d.ts +6 -1
  346. package/dist/types/utils/layoutObserver.d.ts +27 -0
  347. package/dist/types/utils/model/ChartStyles.d.ts +2 -1
  348. package/dist/types/utils/parentDimensions.d.ts +1 -1
  349. package/dist/types/utils/sanitizeHtml.d.ts +6 -0
  350. package/dist/types/utils/validate.d.ts +18 -0
  351. package/dist/types/utils/withDataset.d.ts +6 -2
  352. package/dist/types/utils/withDatasource.d.ts +3 -3
  353. package/dist/types/utils/withInheritedProps.d.ts +19 -0
  354. package/dist/types/utils/withRuleSet.d.ts +24 -0
  355. package/dist/types/utils/withScalingGroup.d.ts +14 -0
  356. package/dist/types/utils/withTranslation.d.ts +15 -5
  357. package/dist/types/utils/xy/FacetGrid.d.ts +27 -0
  358. package/dist/types/utils/xy/IsoCurves.d.ts +46 -0
  359. package/dist/types/utils/xy/NumericScale.d.ts +41 -0
  360. package/dist/types/utils/xy/PointLabeler.d.ts +58 -0
  361. package/dist/types/utils/xy/RadiusScale.d.ts +26 -0
  362. package/dist/types/utils/xy/SeriesPalette.d.ts +59 -0
  363. package/dist/types/utils/xy/VarianceMeasure.d.ts +37 -0
  364. package/dist/types/utils/xy/XYFrame.d.ts +44 -0
  365. package/dist/types/utils/xy/XYLegend.d.ts +43 -0
  366. package/dist/types/utils/xy/model/AxisConfig.d.ts +96 -0
  367. package/dist/types/utils/xy/model/ScaleFactorsXYChart.d.ts +36 -0
  368. package/dist/types/utils/xy/model/XYChartDataRow.d.ts +157 -0
  369. package/dist/types/utils/xy/model/XYChartStyle.d.ts +31 -0
  370. package/package.json +5 -4
  371. package/readme.md +9 -5
  372. package/dist/bn-template-engine/p-3141c4a2.entry.js +0 -1
  373. package/dist/bn-template-engine/p-67538176.entry.js +0 -1
  374. package/dist/bn-template-engine/p-916296a5.entry.js +0 -1
  375. package/dist/bn-template-engine/p-96006b06.entry.js +0 -1
  376. package/dist/bn-template-engine/p-Ck-NYtot.js +0 -1
  377. package/dist/bn-template-engine/p-CnDq0oVa.js +0 -1
  378. package/dist/bn-template-engine/p-DSXNgKLa.js +0 -1
  379. package/dist/bn-template-engine/p-bc711fb0.entry.js +0 -1
  380. package/dist/bn-template-engine/p-c86395b8.entry.js +0 -1
  381. package/dist/bn-template-engine/p-e6f646b1.entry.js +0 -1
  382. package/dist/bn-template-engine/p-f41d9242.entry.js +0 -1
  383. package/dist/bn-template-engine/p-gFbbuhtl.js +0 -1
  384. package/dist/cjs/bn-asset_20.cjs.entry.js +0 -23547
  385. package/dist/cjs/context-protocol-ohYzcb5F.js +0 -663
  386. package/dist/cjs/scaling-CIAClQR5.js +0 -314
  387. package/dist/cjs/withStyled-qd94SSb4.js +0 -9535
  388. package/dist/collection/stores/datasets.js +0 -14
  389. package/dist/collection/stores/datasources.js +0 -14
  390. package/dist/components/_commonjsHelpers.js +0 -1
  391. package/dist/components/alasql.min.js +0 -1
  392. package/dist/components/ibcsRuleSet.js +0 -1
  393. package/dist/components/scaling.js +0 -1
  394. package/dist/components/withInheritedProps.js +0 -1
  395. package/dist/esm/bn-asset_20.entry.js +0 -23526
  396. package/dist/esm/context-protocol-DdbSplvE.js +0 -656
  397. package/dist/esm/scaling-DGKKkuL9.js +0 -309
  398. package/dist/esm/withStyled-BIkqU2w4.js +0 -9501
  399. package/dist/types/stores/datasets.d.ts +0 -14
  400. package/dist/types/stores/datasources.d.ts +0 -14
@@ -0,0 +1,107 @@
1
+ import CalculateSize from "calculate-size";
2
+ /**
3
+ * Series-color legend + bubble-size caption for the XY charts
4
+ * (IBCS requires a legend explaining colors — and, for bubbles, size).
5
+ * Positioned by the orchestrator: right column (default) or bottom row.
6
+ */
7
+ export class XYLegend {
8
+ constructor(styles) {
9
+ this.styles = styles;
10
+ }
11
+ get em() {
12
+ return this.styles.fontStyles.size;
13
+ }
14
+ get rowHeight() {
15
+ return this.em * 1.5;
16
+ }
17
+ get swatchSize() {
18
+ return this.styles.scaleFactors.legendSwatch * this.em;
19
+ }
20
+ textWidth(text, bold = false) {
21
+ const width = CalculateSize(text, {
22
+ font: this.styles.fontStyles.font,
23
+ fontSize: this.styles.fontStyles.size + "px",
24
+ fontWeight: bold ? "bold" : "normal",
25
+ }).width;
26
+ // calculate-size needs a live DOM; fall back to an estimate in test environments.
27
+ return Number.isFinite(width) && width > 0 ? width : text.length * 0.6 * this.em;
28
+ }
29
+ rows(model) {
30
+ const rows = [];
31
+ model.sizeCaption.forEach((line, index) => {
32
+ rows.push({ text: line, bold: index === 0, treatment: null });
33
+ });
34
+ if (model.title !== null && model.title !== "") {
35
+ rows.push({ text: model.title, bold: true, treatment: null });
36
+ }
37
+ for (const entry of model.compareEntries) {
38
+ rows.push({ text: entry.label, bold: false, treatment: entry.treatment });
39
+ }
40
+ for (const entry of model.entries) {
41
+ rows.push({ text: entry.label, bold: false, treatment: entry.treatment });
42
+ }
43
+ return rows;
44
+ }
45
+ /** Footprint of the legend for layout reservation. */
46
+ measure(model, position) {
47
+ const rows = this.rows(model);
48
+ if (rows.length === 0) {
49
+ return { width: 0, height: 0 };
50
+ }
51
+ const swatchSpan = this.swatchSize + 0.4 * this.em;
52
+ if (position === "bottom") {
53
+ let width = 0;
54
+ for (const row of rows) {
55
+ width += (row.treatment !== null ? swatchSpan : 0) + this.textWidth(row.text, row.bold) + 1.5 * this.em;
56
+ }
57
+ return { width, height: this.rowHeight };
58
+ }
59
+ let width = 0;
60
+ for (const row of rows) {
61
+ width = Math.max(width, (row.treatment !== null ? swatchSpan : 0) + this.textWidth(row.text, row.bold));
62
+ }
63
+ return { width, height: rows.length * this.rowHeight };
64
+ }
65
+ /** Draws the legend with its top-left corner at `x`/`y`. */
66
+ draw(group, model, x, y, position) {
67
+ const rows = this.rows(model);
68
+ const swatchSpan = this.swatchSize + 0.4 * this.em;
69
+ let cursorX = x;
70
+ let cursorY = y;
71
+ for (const row of rows) {
72
+ let textX = cursorX;
73
+ if (row.treatment !== null) {
74
+ const swatch = group
75
+ .circle(this.swatchSize)
76
+ .move(cursorX, cursorY + (this.rowHeight - this.swatchSize) / 2)
77
+ .fill(row.treatment.hatch ? "#ffffff" : row.treatment.fill)
78
+ .stroke({
79
+ color: row.treatment.stroke === "#ffffff" ? row.treatment.fill : row.treatment.stroke,
80
+ width: row.treatment.strokeWidth,
81
+ });
82
+ if (row.treatment.dasharray !== undefined) {
83
+ swatch.attr("stroke-dasharray", row.treatment.dasharray);
84
+ }
85
+ textX += swatchSpan;
86
+ }
87
+ group
88
+ .text(row.text)
89
+ .font({
90
+ size: this.styles.fontStyles.size,
91
+ weight: row.bold ? "bold" : "normal",
92
+ anchor: "start",
93
+ })
94
+ .fill(this.styles.fontStyles.color)
95
+ .attr({ x: textX, y: cursorY + this.rowHeight / 2 + this.em * 0.35, "font-family": this.fontFamily() });
96
+ if (position === "bottom") {
97
+ cursorX = textX + this.textWidth(row.text, row.bold) + 1.5 * this.em;
98
+ }
99
+ else {
100
+ cursorY += this.rowHeight;
101
+ }
102
+ }
103
+ }
104
+ fontFamily() {
105
+ return this.styles.fontStyles.font.replace(/^[\d.]+px\s*/, "");
106
+ }
107
+ }
@@ -0,0 +1,221 @@
1
+ import { CompareUtil } from "../../helper/CompareUtil";
2
+ /**
3
+ * Parses a raw object-prop attribute value. A blank value yields `data: null`
4
+ * without error. A value starting with `{` must be valid JSON describing an
5
+ * object. Any other bare string is treated as shorthand for
6
+ * `{ [shorthandKey]: value }` when a shorthand key is allowed, otherwise it
7
+ * is a parse error.
8
+ */
9
+ export function parseSpec(raw, shorthandKey) {
10
+ var _a;
11
+ const trimmed = (_a = raw === null || raw === void 0 ? void 0 : raw.trim()) !== null && _a !== void 0 ? _a : "";
12
+ if (trimmed === "" || trimmed === "null") {
13
+ return { data: null, parseError: false };
14
+ }
15
+ if (trimmed.startsWith("{") || trimmed.startsWith("[")) {
16
+ try {
17
+ const parsed = JSON.parse(trimmed);
18
+ if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
19
+ return { data: null, parseError: true };
20
+ }
21
+ return { data: parsed, parseError: false };
22
+ }
23
+ catch (_b) {
24
+ return { data: null, parseError: true };
25
+ }
26
+ }
27
+ if (shorthandKey !== null) {
28
+ return { data: { [shorthandKey]: trimmed }, parseError: false };
29
+ }
30
+ return { data: null, parseError: true };
31
+ }
32
+ function collectUnknownKeys(data, knownKeys) {
33
+ return Object.keys(data).filter((key) => !knownKeys.includes(key));
34
+ }
35
+ function readString(data, key, invalid) {
36
+ if (!CompareUtil.isExisting(data[key])) {
37
+ return undefined;
38
+ }
39
+ if (CompareUtil.isString(data[key])) {
40
+ return data[key];
41
+ }
42
+ invalid.push(key);
43
+ return undefined;
44
+ }
45
+ function readNumber(data, key, invalid) {
46
+ if (!CompareUtil.isExisting(data[key])) {
47
+ return undefined;
48
+ }
49
+ if (CompareUtil.isNumber(data[key])) {
50
+ return data[key];
51
+ }
52
+ invalid.push(key);
53
+ return undefined;
54
+ }
55
+ function readHighlight(data, invalid) {
56
+ if (!CompareUtil.isExisting(data.highlight)) {
57
+ return undefined;
58
+ }
59
+ if (!CompareUtil.isObject(data.highlight) || Array.isArray(data.highlight)) {
60
+ invalid.push("highlight");
61
+ return undefined;
62
+ }
63
+ const range = data.highlight;
64
+ const result = {};
65
+ const from = readNumber(range, "from", invalid);
66
+ const to = readNumber(range, "to", invalid);
67
+ if (from !== undefined) {
68
+ result.from = from;
69
+ }
70
+ if (to !== undefined) {
71
+ result.to = to;
72
+ }
73
+ return result;
74
+ }
75
+ const AXIS_KEYS = ["measure", "label", "unit", "min", "max", "refLine", "highlight"];
76
+ export function toAxisConfig(data) {
77
+ const invalidFields = [];
78
+ const measure = readString(data, "measure", invalidFields);
79
+ if (measure === undefined || measure.trim() === "") {
80
+ invalidFields.push("measure");
81
+ return { config: null, unknownKeys: collectUnknownKeys(data, AXIS_KEYS), invalidFields };
82
+ }
83
+ const config = { measure: measure.trim() };
84
+ config.label = readString(data, "label", invalidFields);
85
+ config.unit = readString(data, "unit", invalidFields);
86
+ config.min = readNumber(data, "min", invalidFields);
87
+ config.max = readNumber(data, "max", invalidFields);
88
+ config.refLine = readNumber(data, "refLine", invalidFields);
89
+ config.highlight = readHighlight(data, invalidFields);
90
+ return { config, unknownKeys: collectUnknownKeys(data, AXIS_KEYS), invalidFields };
91
+ }
92
+ const SIZE_KEYS = ["measure", "label", "unit", "group"];
93
+ export function toSizeConfig(data) {
94
+ const invalidFields = [];
95
+ const measure = readString(data, "measure", invalidFields);
96
+ if (measure === undefined || measure.trim() === "") {
97
+ invalidFields.push("measure");
98
+ return { config: null, unknownKeys: collectUnknownKeys(data, SIZE_KEYS), invalidFields };
99
+ }
100
+ const config = { measure: measure.trim() };
101
+ config.label = readString(data, "label", invalidFields);
102
+ config.unit = readString(data, "unit", invalidFields);
103
+ config.group = readString(data, "group", invalidFields);
104
+ return { config, unknownKeys: collectUnknownKeys(data, SIZE_KEYS), invalidFields };
105
+ }
106
+ const SHARE_KEYS = ["measure"];
107
+ export function toShareConfig(data) {
108
+ const invalidFields = [];
109
+ const measure = readString(data, "measure", invalidFields);
110
+ if (measure === undefined || measure.trim() === "") {
111
+ invalidFields.push("measure");
112
+ return { config: null, unknownKeys: collectUnknownKeys(data, SHARE_KEYS), invalidFields };
113
+ }
114
+ return { config: { measure: measure.trim() }, unknownKeys: collectUnknownKeys(data, SHARE_KEYS), invalidFields };
115
+ }
116
+ const ISO_KEYS = ["values", "label", "unit", "highlight"];
117
+ export function toIsoConfig(data) {
118
+ const invalidFields = [];
119
+ let values = null;
120
+ if (data.values === "auto") {
121
+ values = "auto";
122
+ }
123
+ else if (CompareUtil.isArray(data.values) && data.values.every((v) => CompareUtil.isNumber(v))) {
124
+ values = data.values;
125
+ }
126
+ else {
127
+ invalidFields.push("values");
128
+ }
129
+ if (values === null) {
130
+ return { config: null, unknownKeys: collectUnknownKeys(data, ISO_KEYS), invalidFields };
131
+ }
132
+ const config = { values };
133
+ config.label = readString(data, "label", invalidFields);
134
+ config.unit = readString(data, "unit", invalidFields);
135
+ if (CompareUtil.isExisting(data.highlight)) {
136
+ if (CompareUtil.isObject(data.highlight) && !Array.isArray(data.highlight)) {
137
+ const from = readNumber(data.highlight, "from", invalidFields);
138
+ if (from !== undefined) {
139
+ config.highlight = { from };
140
+ }
141
+ }
142
+ else {
143
+ invalidFields.push("highlight");
144
+ }
145
+ }
146
+ return { config, unknownKeys: collectUnknownKeys(data, ISO_KEYS), invalidFields };
147
+ }
148
+ const LABEL_KEYS = ["points", "values", "max"];
149
+ export function toLabelConfig(data, defaults) {
150
+ const invalidFields = [];
151
+ const config = { points: defaults.points, values: defaults.values, max: defaults.max };
152
+ if (CompareUtil.isExisting(data.points)) {
153
+ if (data.points === "auto" || data.points === "none" || data.points === "all") {
154
+ config.points = data.points;
155
+ }
156
+ else if (CompareUtil.isArray(data.points) && data.points.every((p) => CompareUtil.isString(p))) {
157
+ config.points = data.points;
158
+ }
159
+ else {
160
+ invalidFields.push("points");
161
+ }
162
+ }
163
+ if (CompareUtil.isExisting(data.values)) {
164
+ if (CompareUtil.isBoolean(data.values)) {
165
+ config.values = data.values;
166
+ }
167
+ else {
168
+ invalidFields.push("values");
169
+ }
170
+ }
171
+ if (CompareUtil.isExisting(data.max)) {
172
+ if (CompareUtil.isNumber(data.max) && data.max > 0) {
173
+ config.max = Math.floor(data.max);
174
+ }
175
+ else {
176
+ invalidFields.push("max");
177
+ }
178
+ }
179
+ return { config, unknownKeys: collectUnknownKeys(data, LABEL_KEYS), invalidFields };
180
+ }
181
+ const FACET_KEYS = ["level", "columns"];
182
+ export function toFacetConfig(data) {
183
+ const invalidFields = [];
184
+ const level = CompareUtil.isString(data.level) ? data.level.toLowerCase() : null;
185
+ if (level !== "rowgroup" && level !== "category") {
186
+ invalidFields.push("level");
187
+ return { config: null, unknownKeys: collectUnknownKeys(data, FACET_KEYS), invalidFields };
188
+ }
189
+ const config = { level };
190
+ if (CompareUtil.isExisting(data.columns)) {
191
+ if (CompareUtil.isNumber(data.columns) && data.columns >= 1) {
192
+ config.columns = Math.floor(data.columns);
193
+ }
194
+ else {
195
+ invalidFields.push("columns");
196
+ }
197
+ }
198
+ return { config, unknownKeys: collectUnknownKeys(data, FACET_KEYS), invalidFields };
199
+ }
200
+ const LEGEND_KEYS = ["show", "position"];
201
+ export function toLegendConfig(data) {
202
+ const invalidFields = [];
203
+ const config = { show: true, position: "right" };
204
+ if (CompareUtil.isExisting(data.show)) {
205
+ if (CompareUtil.isBoolean(data.show)) {
206
+ config.show = data.show;
207
+ }
208
+ else {
209
+ invalidFields.push("show");
210
+ }
211
+ }
212
+ if (CompareUtil.isExisting(data.position)) {
213
+ if (data.position === "right" || data.position === "bottom") {
214
+ config.position = data.position;
215
+ }
216
+ else {
217
+ invalidFields.push("position");
218
+ }
219
+ }
220
+ return { config, unknownKeys: collectUnknownKeys(data, LEGEND_KEYS), invalidFields };
221
+ }
@@ -0,0 +1,69 @@
1
+ import { CompareUtil } from "../../helper/CompareUtil";
2
+ /**
3
+ * Proportional scale factors for XY chart elements (scatter and bubble).
4
+ *
5
+ * All values except the `*LineWidth` entries are expressed in **font-size
6
+ * multiples** (em-like units), so the chart scales uniformly when the base
7
+ * font size changes. The chart renderer multiplies each factor by the
8
+ * computed font size to get pixel dimensions. Line widths are absolute
9
+ * pixel values (hairlines must not scale with the font).
10
+ */
11
+ export class ScaleFactorsXYChart {
12
+ constructor() {
13
+ /** Radius of a scatter point. */
14
+ this.pointRadius = 0.4;
15
+ /** Maximum bubble radius in local (vMax-normalized) sizing mode. */
16
+ this.bubbleMaxRadius = 3.2;
17
+ /** Minimum visible bubble radius in local sizing mode. */
18
+ this.bubbleMinRadius = 0.35;
19
+ /** Length of axis tick marks. */
20
+ this.axisTickLength = 0.35;
21
+ /** Gap between a mark (dot/bubble) and its name label. */
22
+ this.labelToMark = 0.3;
23
+ /** Diameter of a legend color swatch. */
24
+ this.legendSwatch = 0.9;
25
+ /** Gap between facet panels. */
26
+ this.panelGap = 1.6;
27
+ /** Stroke width of reference lines, in pixels. */
28
+ this.refLineWidth = 1;
29
+ /** Stroke width of gridlines and the plot frame, in pixels. */
30
+ this.gridLineWidth = 1;
31
+ }
32
+ }
33
+ /** Converts untyped JSON into a validated {@link ScaleFactorsXYChart}. */
34
+ export class ScaleFactorsXYChartAdapter {
35
+ adapt(data) {
36
+ const scaleFactors = new ScaleFactorsXYChart();
37
+ if (CompareUtil.isNumber(data.pointRadius)) {
38
+ scaleFactors.pointRadius = data.pointRadius;
39
+ }
40
+ if (CompareUtil.isNumber(data.bubbleMaxRadius)) {
41
+ scaleFactors.bubbleMaxRadius = data.bubbleMaxRadius;
42
+ }
43
+ if (CompareUtil.isNumber(data.bubbleMinRadius)) {
44
+ scaleFactors.bubbleMinRadius = data.bubbleMinRadius;
45
+ }
46
+ if (CompareUtil.isNumber(data.axisTickLength)) {
47
+ scaleFactors.axisTickLength = data.axisTickLength;
48
+ }
49
+ if (CompareUtil.isNumber(data.labelToMark)) {
50
+ scaleFactors.labelToMark = data.labelToMark;
51
+ }
52
+ if (CompareUtil.isNumber(data.legendSwatch)) {
53
+ scaleFactors.legendSwatch = data.legendSwatch;
54
+ }
55
+ if (CompareUtil.isNumber(data.panelGap)) {
56
+ scaleFactors.panelGap = data.panelGap;
57
+ }
58
+ if (CompareUtil.isNumber(data.refLineWidth)) {
59
+ scaleFactors.refLineWidth = data.refLineWidth;
60
+ }
61
+ if (CompareUtil.isNumber(data.gridLineWidth)) {
62
+ scaleFactors.gridLineWidth = data.gridLineWidth;
63
+ }
64
+ return scaleFactors;
65
+ }
66
+ default() {
67
+ return new ScaleFactorsXYChart();
68
+ }
69
+ }
@@ -0,0 +1,52 @@
1
+ import { CompareUtil } from "../../helper/CompareUtil";
2
+ import { XY_SERIES_PALETTE } from "../SeriesPalette";
3
+ /**
4
+ * Aggregates all style configuration for an XY chart (scatter/bubble):
5
+ * scale factors, fonts, axis styles, the series color palette, and padding.
6
+ *
7
+ * The analog of {@link TimeChartStyle} with `seriesColors` in place of
8
+ * `stackColors` and no variance styles (variance measures position points,
9
+ * they don't color them).
10
+ */
11
+ export class XYChartStyle {
12
+ constructor(scaleFactors, fontStyles, axisStyles, padding) {
13
+ this.scaleFactors = scaleFactors;
14
+ this.fontStyles = fontStyles;
15
+ this.axisStyles = axisStyles;
16
+ this.padding = padding;
17
+ this.seriesColors = [...XY_SERIES_PALETTE];
18
+ }
19
+ }
20
+ /** Adapts raw componentStyle JSON into an XYChartStyle, falling back to defaults for missing properties. */
21
+ export class XYChartStylesAdapter {
22
+ constructor(scaleFactorsXYChartAdapter, fontStyleAdapter, svgStyleGroupAdapter, paddingAdapter) {
23
+ this.scaleFactorsXYChartAdapter = scaleFactorsXYChartAdapter;
24
+ this.fontStyleAdapter = fontStyleAdapter;
25
+ this.svgStyleGroupAdapter = svgStyleGroupAdapter;
26
+ this.paddingAdapter = paddingAdapter;
27
+ }
28
+ adapt(data) {
29
+ const styles = this.default();
30
+ if (CompareUtil.isExisting(data)) {
31
+ if (CompareUtil.isExisting(data.scaleFactors)) {
32
+ styles.scaleFactors = this.scaleFactorsXYChartAdapter.adapt(data.scaleFactors);
33
+ }
34
+ if (CompareUtil.isExisting(data.fontStyles)) {
35
+ styles.fontStyles = this.fontStyleAdapter.adapt(data.fontStyles);
36
+ }
37
+ if (CompareUtil.isExisting(data.axisStyles)) {
38
+ styles.axisStyles = this.svgStyleGroupAdapter.adapt(data.axisStyles);
39
+ }
40
+ if (CompareUtil.isExisting(data.padding)) {
41
+ styles.padding = this.paddingAdapter.adapt(data.padding);
42
+ }
43
+ if (Array.isArray(data.seriesColors) && data.seriesColors.length > 0) {
44
+ styles.seriesColors = data.seriesColors;
45
+ }
46
+ }
47
+ return styles;
48
+ }
49
+ default() {
50
+ return new XYChartStyle(this.scaleFactorsXYChartAdapter.default(), this.fontStyleAdapter.default(), this.svgStyleGroupAdapter.default(), this.paddingAdapter.default());
51
+ }
52
+ }
@@ -0,0 +1 @@
1
+ import{C as n}from"./CompareUtil.js";function i(n,i){var o;const e=null!==(o=null==n?void 0:n.trim())&&void 0!==o?o:"";if(""===e||"null"===e)return{data:null,parseError:!1};if(e.startsWith("{")||e.startsWith("["))try{const n=JSON.parse(e);return"object"!=typeof n||null===n||Array.isArray(n)?{data:null,parseError:!0}:{data:n,parseError:!1}}catch(n){return{data:null,parseError:!0}}return null!==i?{data:{[i]:e},parseError:!1}:{data:null,parseError:!0}}function o(n,i){return Object.keys(n).filter((n=>!i.includes(n)))}function e(i,o,e){if(n.isExisting(i[o]))return n.isString(i[o])?i[o]:void e.push(o)}function r(i,o,e){if(n.isExisting(i[o]))return n.isNumber(i[o])?i[o]:void e.push(o)}const t=["measure","label","unit","min","max","refLine","highlight"];function u(i){const u=[],l=e(i,"measure",u);if(void 0===l||""===l.trim())return u.push("measure"),{config:null,unknownKeys:o(i,t),invalidFields:u};const s={measure:l.trim()};return s.label=e(i,"label",u),s.unit=e(i,"unit",u),s.min=r(i,"min",u),s.max=r(i,"max",u),s.refLine=r(i,"refLine",u),s.highlight=function(i,o){if(!n.isExisting(i.highlight))return;if(!n.isObject(i.highlight)||Array.isArray(i.highlight))return void o.push("highlight");const e=i.highlight,t={},u=r(e,"from",o),l=r(e,"to",o);return void 0!==u&&(t.from=u),void 0!==l&&(t.to=l),t}(i,u),{config:s,unknownKeys:o(i,t),invalidFields:u}}const l=["measure","label","unit","group"];function s(n){const i=[],r=e(n,"measure",i);if(void 0===r||""===r.trim())return i.push("measure"),{config:null,unknownKeys:o(n,l),invalidFields:i};const t={measure:r.trim()};return t.label=e(n,"label",i),t.unit=e(n,"unit",i),t.group=e(n,"group",i),{config:t,unknownKeys:o(n,l),invalidFields:i}}const a=["measure"];function c(n){const i=[],r=e(n,"measure",i);return void 0===r||""===r.trim()?(i.push("measure"),{config:null,unknownKeys:o(n,a),invalidFields:i}):{config:{measure:r.trim()},unknownKeys:o(n,a),invalidFields:i}}const f=["values","label","unit","highlight"];function d(i){const t=[];let u=null;if("auto"===i.values?u="auto":n.isArray(i.values)&&i.values.every((i=>n.isNumber(i)))?u=i.values:t.push("values"),null===u)return{config:null,unknownKeys:o(i,f),invalidFields:t};const l={values:u};if(l.label=e(i,"label",t),l.unit=e(i,"unit",t),n.isExisting(i.highlight))if(n.isObject(i.highlight)&&!Array.isArray(i.highlight)){const n=r(i.highlight,"from",t);void 0!==n&&(l.highlight={from:n})}else t.push("highlight");return{config:l,unknownKeys:o(i,f),invalidFields:t}}const v=["points","values","max"];function m(i,e){const r=[],t={points:e.points,values:e.values,max:e.max};return n.isExisting(i.points)&&("auto"===i.points||"none"===i.points||"all"===i.points||n.isArray(i.points)&&i.points.every((i=>n.isString(i)))?t.points=i.points:r.push("points")),n.isExisting(i.values)&&(n.isBoolean(i.values)?t.values=i.values:r.push("values")),n.isExisting(i.max)&&(n.isNumber(i.max)&&i.max>0?t.max=Math.floor(i.max):r.push("max")),{config:t,unknownKeys:o(i,v),invalidFields:r}}const g=["level","columns"];function h(i){const e=[],r=n.isString(i.level)?i.level.toLowerCase():null;if("rowgroup"!==r&&"category"!==r)return e.push("level"),{config:null,unknownKeys:o(i,g),invalidFields:e};const t={level:r};return n.isExisting(i.columns)&&(n.isNumber(i.columns)&&i.columns>=1?t.columns=Math.floor(i.columns):e.push("columns")),{config:t,unknownKeys:o(i,g),invalidFields:e}}const p=["show","position"];function y(i){const e=[],r={show:!0,position:"right"};return n.isExisting(i.show)&&(n.isBoolean(i.show)?r.show=i.show:e.push("show")),n.isExisting(i.position)&&("right"===i.position||"bottom"===i.position?r.position=i.position:e.push("position")),{config:r,unknownKeys:o(i,p),invalidFields:e}}export{s as a,c as b,h as c,m as d,y as e,d as f,i as p,u as t}
@@ -0,0 +1 @@
1
+ import{D as t}from"./luxon.js";var n,a,s,o,e,r,c,i;!function(t){t.ALL="all",t.META="meta"}(n||(n={})),function(t){t.CURRENCY="currency",t.VOLUME="volume"}(a||(a={})),function(t){t.AC1="ac1",t.AC2="ac2",t.AC3="ac3",t.AC4="ac4",t.PP1="pp1",t.PP2="pp2",t.PP3="pp3",t.PP4="pp4",t.FC1="fc1",t.FC2="fc2",t.FC3="fc3",t.FC4="fc4",t.PL1="pl1",t.PL2="pl2",t.PL3="pl3",t.PL4="pl4"}(s||(s={})),function(t){t.POS="pos",t.NEG="neg",t.NEU="neu"}(o||(o={})),function(t){t.DECIMAL="decimal",t.PERCENT="percent"}(e||(e={})),function(t){t.LIST="list",t.SUM="sum",t.SUMNOTOTAL="sumnototal",t.OPT="opt",t.OPTNOTOTAL="optnototal"}(r||(r={})),function(t){t.INF="inf",t.W100="w100",t.W50="w50",t.W25="w25",t.W20="w20",t.W15="w15",t.W10="w10",t.W5="w5"}(c||(c={})),function(t){t.W5="w5",t.W10="w10",t.W15="w15",t.W20="w20",t.W25="w25",t.W30="w30",t.W40="w40",t.W60="w60",t.W80="w80",t.W100="w100"}(i||(i={}));const u={[i.W5]:5,[i.W10]:10,[i.W15]:15,[i.W20]:20,[i.W25]:25,[i.W30]:30,[i.W40]:40,[i.W60]:60,[i.W80]:80,[i.W100]:100};var l,f,p,w,m,b;!function(t){t.ROWGROUP="rowGroup",t.ROWGROUPINDEX="rowGroupIndex",t.CATEGORY="category",t.CATEGORYINDEX="categoryIndex",t.SUBCATEGORY="subCategory",t.SUBCATEGORYINDEX="subCategoryIndex"}(l||(l={})),function(t){t.SMART="smart",t.LONG="long",t.SHORT="short"}(f||(f={})),function(t){t.COLUMN="column",t.LINE="line",t.WATERFALL="waterfall"}(p||(p={})),function(t){t.BAR="bar",t.LINE="line",t.AUTO="auto"}(w||(w={})),function(t){t.SCENARIOS="scenarios",t.DIMENSIONS="dimensions"}(m||(m={})),function(t){t.ABSOLUTE="absolute",t.RELATIVE="relative",t.ABSOLUTE_RELATIVE="absolute-relative"}(b||(b={}));const y=100;var g;!function(t){t.ASC="asc",t.DESC="desc",t.DATASET="dataset"}(g||(g={}));class d{static isExisting(t){return null!=t}static isString(t){return"string"==typeof t}static isNumber(t){return"number"==typeof t&&!Number.isNaN(t)}static isBoolean(t){return"boolean"==typeof t}static isArray(t){return Array.isArray(t)}static isObject(t){return"object"==typeof t&&null!==t}static isOperator(t){return"+"===t||"-"===t}static isDate(n){return n instanceof t&&n.isValid}}export{l as A,u as B,d as C,e as D,n as I,a as M,y as R,s as S,i as T,o as a,f as b,r as c,c as d,m as e,g as f,b as g,w as h}
@@ -1 +1 @@
1
- import{a as e}from"./alasql.min.js";import{j as t}from"./Order.js";class a{constructor(e="",t=1){this.prefix=e,this.value=t}}var s;!function(e){e[e.Y=1e24]="Y",e[e.Z=1e21]="Z",e[e.E=1e18]="E",e[e.P=1e15]="P",e[e.T=1e12]="T",e[e.G=1e9]="G",e[e.M=1e6]="M",e[e.k=1e3]="k",e[e.h=100]="h",e[e.da=10]="da",e[e.d=.1]="d",e[e.c=.01]="c",e[e.m=.001]="m",e[e.my=1e-6]="my",e[e.n=1e-9]="n",e[e.p=1e-12]="p",e[e.f=1e-15]="f",e[e.a=1e-18]="a",e[e.z=1e-21]="z",e[e.y=1e-24]="y"}(s||(s={}));class r{static calculateMeasureScale(t,s,r){var n;if("_"===r)return new a;if(null!=r&&[...this.unitsLeast,...this.unitsGreat].includes(r))return this.lookupPrefix(r);if(0===s.length)return new a;const i=`SELECT MAX(GREATEST(${s.filter((e=>3===e.length)).map((e=>"ABS("+e+")")).toString()})) as prefixvalue\n FROM ?`,u=`SELECT MIN(LEAST(${s.filter((e=>3===e.length)).map((e=>"ABS("+e+")")).toString()})) as prefixvalue\n FROM ?`;let c=i;"LEAST"===(null==r?void 0:r.toUpperCase())&&(c=u);const l=null===(n=e(c,[t])[0])||void 0===n?void 0:n.prefixvalue;return this.determinePrefix(Math.abs(l))}static determinePrefix(e){if(e>=1e3){const t=Math.floor(Math.floor(Math.abs(e)).toString().length/3),s=+Math.pow(1e3,t);return new a(this.unitsGreat[t-1],s)}if(e<=.001){const t=Math.floor(Math.abs(e).toString().length/3),s=1/Math.pow(1e3,t);return new a(this.unitsLeast[t-1],s)}return new a}static lookupPrefix(e){return new a(e,s[e])}}r.unitsGreat=["k","M","G","T","P","E","Z","Y"],r.unitsLeast=["m","my","n","p","P","f","a","z","y"];class n{constructor(e=2,t=1){this.percent=e,this.decimal=t}}class i{adapt(e){const a=new n;return t.isNumber(e.percent)&&(a.percent=e.percent),t.isNumber(e.decimal)&&(a.decimal=e.decimal),a}default(){return new n}}export{r as D,a as S,n as a,i as b}
1
+ import{S as e}from"./SiPrefix.js";import{C as t}from"./CompareUtil.js";var a;!function(e){e[e.Y=1e24]="Y",e[e.Z=1e21]="Z",e[e.E=1e18]="E",e[e.P=1e15]="P",e[e.T=1e12]="T",e[e.G=1e9]="G",e[e.M=1e6]="M",e[e.k=1e3]="k",e[e.h=100]="h",e[e.da=10]="da",e[e.d=.1]="d",e[e.c=.01]="c",e[e.m=.001]="m",e[e.my=1e-6]="my",e[e.n=1e-9]="n",e[e.p=1e-12]="p",e[e.f=1e-15]="f",e[e.a=1e-18]="a",e[e.z=1e-21]="z",e[e.y=1e-24]="y"}(a||(a={}));class r{static calculateMeasureScale(t,a,r,n){var s,i;if("_"===n)return new e;if(null!=n&&[...this.unitsLeast,...this.unitsGreat].includes(n))return this.lookupPrefix(n);if(0===r.length||!a)return new e;const u=`SELECT MAX(GREATEST(${r.filter((e=>3===e.length)).map((e=>"ABS("+e+")")).toString()})) as prefixvalue\n FROM ${a}`,l=`SELECT MIN(LEAST(${r.filter((e=>3===e.length)).map((e=>"ABS("+e+")")).toString()})) as prefixvalue\n FROM ${a}`;let c,o=u;"LEAST"===(null==n?void 0:n.toUpperCase())&&(o=l);try{c=null!==(i=null===(s=t.exec(o)[0])||void 0===s?void 0:s.prefixvalue)&&void 0!==i?i:0}catch(t){return console.error("DataAnalyzer: measure-scale query failed",o,t),new e}return this.determinePrefix(Math.abs(c))}static determinePrefix(t){if(t>=1e3){const a=Math.floor(Math.floor(Math.abs(t)).toString().length/3),r=+Math.pow(1e3,a);return new e(this.unitsGreat[a-1],r)}if(t<=.001){const a=Math.floor(Math.abs(t).toString().length/3),r=1/Math.pow(1e3,a);return new e(this.unitsLeast[a-1],r)}return new e}static lookupPrefix(t){return new e(t,a[t])}}r.unitsGreat=["k","M","G","T","P","E","Z","Y"],r.unitsLeast=["m","my","n","p","P","f","a","z","y"];class n{constructor(e=2,t=1){this.percent=e,this.decimal=t}}class s{adapt(e){const a=new n;return t.isNumber(e.percent)&&(a.percent=e.percent),t.isNumber(e.decimal)&&(a.decimal=e.decimal),a}default(){return new n}}export{r as D,n as a,s as b}
@@ -1 +1 @@
1
- import{f as t}from"./Order.js";var e,r;!function(t){t.YEAR="year",t.QUARTER="quarter",t.MONTH="month",t.WEEK="week",t.DAY="day",t.HOUR="hour",t.MINUTE="minute",t.SECOND="second",t.MILLISECOND="millisecond",t.NONE="fallback",t.AUTO="auto"}(e||(e={})),function(t){t.AVG="avg",t.INTERVAL="interval",t.START="start",t.END="end",t.YTD="ytd",t.YTG="ytg",t.CUM="cum",t.MAT="mat",t.NONE="none",t.AUTO="auto"}(r||(r={}));class s{constructor(){this._dateFormat={year:"yyyy",quarter:"q'Q' yyyy",month:"LLL yyyy",week:"'KW'WW yyyy",day:"dd.MM.yyyy",hour:"TT",minute:"TT",second:"TT",millisecond:"TT:SSS",fallback:"dd.MM.yyyy"},this._dateFormatShort={year:"yy",quarter:"q'Q'",month:"LLL",week:"'KW'WW",day:"dd",hour:"hh'h'",minute:"mm'm'",second:"ss's'",millisecond:"SSS'ms'",fallback:"dd.MM.yyyy"},this._dateLinkFormat={avg:"Ø[LINK]",interval:"[DATE]..[DATE2]",start:".[DATE]",end:"[DATE].",ytd:"_[DATE]",ytg:"[DATE]_",cum:"[DATE]_[DATE2]",mat:"~[DATE]",none:"[DATE]"},this.locale="de",this.dateFormat=this._dateFormat,this.dateLinkFormat=this._dateLinkFormat,this.dateFormatShort=this._dateFormatShort}setDateLinkFormat(t){this.dateLinkFormat=t}setDateFormat(t){this.dateFormat=t}setDateFormatShort(t){this.dateFormatShort=t}setLocale(t){this.locale=t}getDateString(t,e){return t.setLocale(this.locale).toFormat(this.dateFormat[e]||this.dateFormat.fallback)}getSmartDateString(t,r){switch(r){case e.DAY:return this.getFormatedDayDate(t);case e.MONTH:return this.getFormatedMonthDate(t);case e.QUARTER:return this.getFormatedQuarterDate(t);case e.WEEK:return this.getFormatedWeekDate(t);case e.HOUR:return this.getFormatedHourDate(t);case e.MINUTE:return this.getFormatedMinuteDate(t);case e.SECOND:return this.getFormatedSecondDate(t);case e.MILLISECOND:return this.getFormatedMilliSecondDate(t);default:return this.getDateString(t,r)}}calculateDistanceType(r,s,i=32){if(null==s)return e.DAY;const a="number"==typeof r?t.fromMillis(r):r,n="number"==typeof s?t.fromMillis(s):s;return 0===n.diff(a).as("milliseconds")?e.DAY:n.diff(a).as("milliseconds")<i?e.MILLISECOND:n.diff(a).as("seconds")<i?e.SECOND:n.diff(a).as("minutes")<i?e.MINUTE:n.diff(a).as("hours")<i?e.HOUR:n.diff(a).as("days")<i?e.DAY:n.diff(a).as("weeks")<i?e.WEEK:n.diff(a).as("months")<i?e.MONTH:n.diff(a).as("quarters")<i?e.QUARTER:e.YEAR}datesBetween(t,e,r,s){const i=this.convertDateDistanceToMomentunitOfTime(r),a=t.startOf(i),n=e.endOf(i);let h=n.diff(a).as(i);const u=[];h>=s&&(h=s);let o=a;do{u.push(o),o=o.plus(this.createDiratonLike(i,1))}while(o<=n&&u.length<h);return u}getDateLinkString(s,i,a,n,h){if(null==s&&null==i)return"";if(null==s&&a!==r.END&&a!==r.YTD)return"";if(null==i&&(r.INTERVAL===a||r.CUM===a||r.END===a||r.YTD===a))return"";const u=s||t.now(),o=i;n===e.AUTO&&(n=this.calculateDistanceType(u,o,h));let c=this.getDateString(u,n),l="",d=r.NONE;return null!=o&&(l=this.getDateString(o,n),d=r.INTERVAL,c===l&&a===r.INTERVAL&&(a=r.NONE),c===l&&a===r.AVG&&(d=r.NONE),r.END!==a&&r.YTD!==a||(c=l),(a===r.INTERVAL||a===r.CUM||r.AVG)&&(n===e.QUARTER?u.quarter===o.quarter&&u.year===o.year?l=l.replace(" "+o.year,""):u.year===o.year&&(c=c.replace(" "+u.year,"")):n===e.MONTH?u.month===o.month&&u.year===o.year?l=l.replace(" "+o.year,""):u.year===o.year&&(c=c.replace(" "+u.year,"")):n===e.WEEK&&(u.weekNumber===o.weekNumber&&u.year===o.year?l=l.replace(" "+o.year,""):u.year===o.year&&(c=c.replace(" "+u.year,""))))),this.dateLinkFormat[a].replace("[LINK]",this.dateLinkFormat[d]).replace("[DATE]",c).replace("[DATE2]",l)}getShortDateString(t,e){return t.setLocale(this.locale).toFormat(this.dateFormatShort[e]||this.dateFormatShort.fallback)}getFormatedDayDate(t){let e=this.dateFormatShort.day;return this.isFirstInMonth(t)&&(e+=" "+this.dateFormatShort.month),this.isJanuary(t)&&(e+=" "+this.dateFormatShort.year),t.setLocale(this.locale).toFormat(e)}getFormatedMonthDate(t){let e=this.dateFormatShort.month;return this.isJanuary(t)&&(e+=" "+this.dateFormatShort.year),t.setLocale(this.locale).toFormat(e)}getFormatedQuarterDate(t){let e=this.dateFormatShort.quarter;return this.isFirstQuarter(t)&&(e+=" "+this.dateFormatShort.year),t.setLocale(this.locale).toFormat(e)}getFormatedWeekDate(t){let e=this.dateFormatShort.week;return this.isFirstWeek(t)&&(e+=" "+this.dateFormatShort.year),t.setLocale(this.locale).toFormat(e)}getFormatedHourDate(t){let e=this.dateFormatShort.hour;return this.isFirstHour(t)&&(e+=" "+this.dateFormatShort.day),t.setLocale(this.locale).toFormat(e)}getFormatedMinuteDate(t){let e=this.dateFormatShort.minute;return this.isFirstMinute(t)&&(e=this.dateFormatShort.hour+":"+e),t.setLocale(this.locale).toFormat(e)}getFormatedSecondDate(t){let e=this.dateFormatShort.second;return this.isFirstSecond(t)&&(e=this.dateFormatShort.minute+":"+e),t.setLocale(this.locale).toFormat(e)}getFormatedMilliSecondDate(t){let e=this.dateFormatShort.millisecond;return this.isFirstMilliSecond(t)&&(e=this.dateFormatShort.second+":"+e),t.setLocale(this.locale).toFormat(e)}isFirstInMonth(t){return 1===t.day}isJanuary(t){return 1===t.month}isFirstQuarter(t){return 1===t.quarter}isFirstWeek(t){return 1===t.weekNumber}isFirstHour(t){return 0===t.hour}isFirstMinute(t){return 0===t.minute}isFirstSecond(t){return 0===t.second}isFirstMilliSecond(t){return 0===t.millisecond}convertDateDistanceToMomentunitOfTime(t){let r;switch(t){case e.YEAR:r="year";break;case e.MONTH:r="month";break;case e.QUARTER:r="quarter";break;case e.WEEK:r="week";break;case e.DAY:r="day";break;case e.HOUR:r="hour";break;case e.MINUTE:r="minute";break;case e.SECOND:r="second";break;case e.MILLISECOND:r="millisecond";break;default:r="day"}return r}createDiratonLike(t,e){switch(t){case"year":return{years:e};case"month":return{months:e};case"quarter":return{quarters:e};case"week":return{weeks:e};case"day":default:return{days:e};case"hour":return{hours:e};case"minute":return{minutes:e};case"second":return{seconds:e};case"millisecond":return{milliseconds:e}}}}export{e as D,r as a,s as b}
1
+ import{D as t}from"./luxon.js";var e,s;!function(t){t.YEAR="year",t.QUARTER="quarter",t.MONTH="month",t.WEEK="week",t.DAY="day",t.HOUR="hour",t.MINUTE="minute",t.SECOND="second",t.MILLISECOND="millisecond",t.NONE="fallback",t.AUTO="auto"}(e||(e={})),function(t){t.AVG="avg",t.INTERVAL="interval",t.START="start",t.END="end",t.YTD="ytd",t.YTG="ytg",t.CUM="cum",t.MAT="mat",t.NONE="none",t.AUTO="auto"}(s||(s={}));class r{constructor(){this._dateFormat={year:"yyyy",quarter:"q'Q' yyyy",month:"LLL yyyy",week:"'KW'WW yyyy",day:"dd.MM.yyyy",hour:"TT",minute:"TT",second:"TT",millisecond:"TT:SSS",fallback:"dd.MM.yyyy"},this._dateFormatShort={year:"yy",quarter:"q'Q'",month:"LLL",week:"'KW'WW",day:"dd",hour:"hh'h'",minute:"mm'm'",second:"ss's'",millisecond:"SSS'ms'",fallback:"dd.MM.yyyy"},this._dateLinkFormat={avg:"Ø[LINK]",interval:"[DATE]..[DATE2]",start:".[DATE]",end:"[DATE].",ytd:"_[DATE]",ytg:"[DATE]_",cum:"[DATE]_[DATE2]",mat:"~[DATE]",none:"[DATE]"},this.locale="de",this.dateFormatPinned=!1,this.dateFormatShortPinned=!1,this.dateFormat=this._dateFormat,this.dateLinkFormat=this._dateLinkFormat,this.dateFormatShort=this._dateFormatShort}setDateLinkFormat(t){this.dateLinkFormat=t}setDateFormat(t){this.dateFormat=t,this.dateFormatPinned=!0}setDateFormatShort(t){this.dateFormatShort=t,this.dateFormatShortPinned=!0}setLocale(t){this.locale=t,this.dateFormatPinned||(this.dateFormat=Object.assign(Object.assign({},this._dateFormat),r.LOCALE_DATE_FORMAT[t]||{})),this.dateFormatShortPinned||(this.dateFormatShort=Object.assign(Object.assign({},this._dateFormatShort),r.LOCALE_DATE_FORMAT_SHORT[t]||{}))}getDateString(t,e){return t.setLocale(this.locale).toFormat(this.dateFormat[e]||this.dateFormat.fallback)}getSmartDateString(t,s){switch(s){case e.DAY:return this.getFormatedDayDate(t);case e.MONTH:return this.getFormatedMonthDate(t);case e.QUARTER:return this.getFormatedQuarterDate(t);case e.WEEK:return this.getFormatedWeekDate(t);case e.HOUR:return this.getFormatedHourDate(t);case e.MINUTE:return this.getFormatedMinuteDate(t);case e.SECOND:return this.getFormatedSecondDate(t);case e.MILLISECOND:return this.getFormatedMilliSecondDate(t);default:return this.getDateString(t,s)}}calculateDistanceType(s,r,i=32){if(null==r)return e.DAY;const a="number"==typeof s?t.fromMillis(s):s,n="number"==typeof r?t.fromMillis(r):r;return 0===n.diff(a).as("milliseconds")?e.DAY:n.diff(a).as("milliseconds")<i?e.MILLISECOND:n.diff(a).as("seconds")<i?e.SECOND:n.diff(a).as("minutes")<i?e.MINUTE:n.diff(a).as("hours")<i?e.HOUR:n.diff(a).as("days")<i?e.DAY:n.diff(a).as("weeks")<i?e.WEEK:n.diff(a).as("months")<i?e.MONTH:n.diff(a).as("quarters")<i?e.QUARTER:e.YEAR}datesBetween(t,e,s,r){const i=this.convertDateDistanceToMomentunitOfTime(s),a=t.startOf(i),n=e.endOf(i);let h=n.diff(a).as(i);const u=[];h>=r&&(h=r);let c=a;do{u.push(c),c=c.plus(this.createDiratonLike(i,1))}while(c<=n&&u.length<h);return u}getDateLinkString(r,i,a,n,h){if(null==r&&null==i)return"";if(null==r&&a!==s.END&&a!==s.YTD)return"";if(null==i&&(s.INTERVAL===a||s.CUM===a||s.END===a||s.YTD===a))return"";const u=r||t.now(),c=i;n===e.AUTO&&(n=this.calculateDistanceType(u,c,h));let o=this.getDateString(u,n),y="",l=s.NONE;return null!=c&&(y=this.getDateString(c,n),l=s.INTERVAL,o===y&&a===s.INTERVAL&&(a=s.NONE),o===y&&a===s.AVG&&(l=s.NONE),s.END!==a&&s.YTD!==a||(o=y),(a===s.INTERVAL||a===s.CUM||s.AVG)&&(n===e.QUARTER?u.quarter===c.quarter&&u.year===c.year?y=y.replace(" "+c.year,""):u.year===c.year&&(o=o.replace(" "+u.year,"")):n===e.MONTH?u.month===c.month&&u.year===c.year?y=y.replace(" "+c.year,""):u.year===c.year&&(o=o.replace(" "+u.year,"")):n===e.WEEK&&(u.weekNumber===c.weekNumber&&u.year===c.year?y=y.replace(" "+c.year,""):u.year===c.year&&(o=o.replace(" "+u.year,""))))),this.dateLinkFormat[a].replace("[LINK]",this.dateLinkFormat[l]).replace("[DATE]",o).replace("[DATE2]",y)}getShortDateString(t,e){return t.setLocale(this.locale).toFormat(this.dateFormatShort[e]||this.dateFormatShort.fallback)}getFormatedDayDate(t){let e=this.dateFormatShort.day;return this.isFirstInMonth(t)&&(e+=" "+this.dateFormatShort.month),this.isJanuary(t)&&(e+=" "+this.dateFormatShort.year),t.setLocale(this.locale).toFormat(e)}getFormatedMonthDate(t){let e=this.dateFormatShort.month;return this.isJanuary(t)&&(e+=" "+this.dateFormatShort.year),t.setLocale(this.locale).toFormat(e)}getFormatedQuarterDate(t){let e=this.dateFormatShort.quarter;return this.isFirstQuarter(t)&&(e+=" "+this.dateFormatShort.year),t.setLocale(this.locale).toFormat(e)}getFormatedWeekDate(t){let e=this.dateFormatShort.week;return this.isFirstWeek(t)&&(e+=" "+this.dateFormatShort.year),t.setLocale(this.locale).toFormat(e)}getFormatedHourDate(t){let e=this.dateFormatShort.hour;return this.isFirstHour(t)&&(e+=" "+this.dateFormatShort.day),t.setLocale(this.locale).toFormat(e)}getFormatedMinuteDate(t){let e=this.dateFormatShort.minute;return this.isFirstMinute(t)&&(e=this.dateFormatShort.hour+":"+e),t.setLocale(this.locale).toFormat(e)}getFormatedSecondDate(t){let e=this.dateFormatShort.second;return this.isFirstSecond(t)&&(e=this.dateFormatShort.minute+":"+e),t.setLocale(this.locale).toFormat(e)}getFormatedMilliSecondDate(t){let e=this.dateFormatShort.millisecond;return this.isFirstMilliSecond(t)&&(e=this.dateFormatShort.second+":"+e),t.setLocale(this.locale).toFormat(e)}isFirstInMonth(t){return 1===t.day}isJanuary(t){return 1===t.month}isFirstQuarter(t){return 1===t.quarter}isFirstWeek(t){return 1===t.weekNumber}isFirstHour(t){return 0===t.hour}isFirstMinute(t){return 0===t.minute}isFirstSecond(t){return 0===t.second}isFirstMilliSecond(t){return 0===t.millisecond}convertDateDistanceToMomentunitOfTime(t){let s;switch(t){case e.YEAR:s="year";break;case e.MONTH:s="month";break;case e.QUARTER:s="quarter";break;case e.WEEK:s="week";break;case e.DAY:s="day";break;case e.HOUR:s="hour";break;case e.MINUTE:s="minute";break;case e.SECOND:s="second";break;case e.MILLISECOND:s="millisecond";break;default:s="day"}return s}createDiratonLike(t,e){switch(t){case"year":return{years:e};case"month":return{months:e};case"quarter":return{quarters:e};case"week":return{weeks:e};case"day":default:return{days:e};case"hour":return{hours:e};case"minute":return{minutes:e};case"second":return{seconds:e};case"millisecond":return{milliseconds:e}}}}r.LOCALE_DATE_FORMAT={en:{week:"'W'WW yyyy",day:"MM/dd/yyyy",fallback:"MM/dd/yyyy"}},r.LOCALE_DATE_FORMAT_SHORT={en:{week:"'W'WW",fallback:"MM/dd/yyyy"}};export{s as D,e as a,r as b}
@@ -0,0 +1 @@
1
+ import{S as t}from"./SiPrefix.js";import{F as s}from"./formatter.js";import"./CompareUtil.js";import{g as i}from"./stackColors.js";var e;!function(t){t[t.Left=0]="Left",t[t.Center=1]="Center",t[t.Right=2]="Right",t[t.Top=3]="Top",t[t.Bottom=4]="Bottom"}(e||(e={}));class r{constructor(t,s,i,r,h,n,o,a){this.ID_SCENARIOLABEL="Label",this.CSS_CATEGORIES="categories",this.isRelativeLabel=!1,this.segmentFillColor=null,this.x=s,this.y=i,this.value=h,this.group=t.group().id(this.createElementID(t.toString(),r)),this.styles=n,this.isVarianceLabel=!1,this.verticalHookLocation=o||e.Top,this.horizontalHookLocation=a||e.Left}setToVarianceLabel(){return this.isVarianceLabel=!0,this}setToRelativeVarianceLabel(){return this.isVarianceLabel=!0,this.isRelativeLabel=!0,this}setSegmentFill(t){return this.segmentFillColor=t,this}updateGroup(t){return this.group=t,this}draw(i=!0,e={percent:2,decimal:1},r=new t){if(this.isEmpty())return this;const h=this.group;let n,o="";if(!1===Number.isNaN(Number(this.value))){let t="percent",i=e.percent,h=e.percent,a=1;!1===this.isRelativeLabel&&(i=e.decimal,h=e.decimal,a=r.value,t="decimal"),n=s.number(Number(this.value),t,i,h,a),this.isVarianceLabel&&Number(this.value)>=0&&(o="+")}else n=""+this.value;const a=this.drawLabel(h,o+n);return!1===i&&(a.addClass("hide"),h.addClass("hide")),this}isEmpty(){return null==this.value||""===this.value}setPos(t,s){return this.x=t,this.y=s,this}forceStringTypeDraw(){return this.drawLabel(this.group,""+this.value),this}drawLabel(t,s){const r=this.styles.fontStyles.background||"#ffffff";let h="start";const n=t.text(s);n.move(this.x,this.y);const o=n.bbox().w,a=n.bbox().h;let l=0,c=0;const u=n.x();let f=n.y();return this.horizontalHookLocation===e.Left?(h="left",l=n.x()):this.horizontalHookLocation===e.Center?(h="middle",l=n.x()-(o+2)/2):this.horizontalHookLocation===e.Right&&(h="end",l=n.x()-o),this.verticalHookLocation===e.Center?(f=n.y()-1.2*a/2,c=f+.2*a):this.verticalHookLocation===e.Top?(f-=a/4,c=f+.2*a):this.verticalHookLocation===e.Bottom&&(f-=a,c=f+.2*a),n.move(u,f),n.font({anchor:h}),null!=this.segmentFillColor?n.fill(i(this.segmentFillColor)):t.rect(o+2,.8*a).stroke(r).fill(r).opacity(.9).move(l-1,c).insertBefore(n),n}createElementID(t,s){return t+"_"+s+"_"+this.ID_SCENARIOLABEL}}const h={ac:1,pp:2,fc:3,pl:4};var n;!function(t){t[t.Above=0]="Above",t[t.Below=1]="Below",t[t.Left=2]="Left",t[t.Right=3]="Right"}(n||(n={}));class o{constructor(){this.labels=[],this.scenarioLabels=[]}clear(){this.labels=[],this.scenarioLabels=[]}register(t){this.labels.push(t)}hasCollision(t){return this.labels.some((s=>this.intersects(t,s)))}getOptimalPlacement(t,s,i,e,r,n,o,a){const l=h[o]||99,c=n/2;for(const h of a){const n=this.calculatePlacementForDirection(t,s,i,e,r,c,8,h);if(!this.hasCollision(n.bounds))return n}for(const h of a){const n=this.calculatePlacementForDirection(t,s,i,e,r,c,8,h);if(!this.collidesWithHigherPriority(n.bounds,l))return n}return null}calculatePlacementForDirection(t,s,i,r,h,o,a,l){let c,u,f,m,p,b;switch(l){case n.Above:c=t,u=s-o-a,f=e.Bottom,m=e.Center,p=t-i/2,b=s-o-a-r;break;case n.Below:c=t,u=s+o+a,f=e.Top,m=e.Center,p=t-i/2,b=s+o+a-r/4;break;case n.Left:c=t-o-a,u=s,f=e.Center,m=e.Right,p=t-o-a-i,b=s-.6*r;break;case n.Right:c=t+o+a,u=s,f=e.Center,m=e.Left,p=t+o+a,b=s-.6*r}return{labelX:c,labelY:u,verticalHook:f,horizontalHook:m,bounds:{x:p,y:b,width:i,height:r,pointIndex:h,preferredHook:f}}}collidesWithHigherPriority(t,s){return this.labels.some((i=>!!i.scenarioType&&((h[i.scenarioType]||99)<s&&this.intersects(t,i))))}shouldHideScenarioLabel(t,s,i,e=20){const r=h[i]||99;return!(r<=1)&&this.scenarioLabels.some((i=>{if((h[i.scenarioType]||99)>=r)return!1;const n=Math.abs(s-i.y),o=Math.abs(t-i.x);return n<e&&o<e}))}registerScenarioLabel(t,s,i){this.scenarioLabels.push({x:t,y:s,scenarioType:i})}intersects(t,s){return!(t.x+t.width<s.x||s.x+s.width<t.x||t.y+t.height<s.y||s.y+s.height<t.y)}getLabelCount(){return this.labels.length}}export{e as H,o as L,h as S,r as a,n as b}
@@ -0,0 +1 @@
1
+ class t{constructor(t,s,i,h){this.domainMin=t,this.domainMax=s,this.rangeMin=i,this.rangeMax=h}scale(t){const s=this.domainMax-this.domainMin;return 0===s?(this.rangeMin+this.rangeMax)/2:this.rangeMin+(t-this.domainMin)/s*(this.rangeMax-this.rangeMin)}static domain(t,s,i,h=.04){let n=s-t;if(0===n){const i=0===t?1:.1*Math.abs(t);n=(s+=i)-(t-=i)}return[void 0!==(null==i?void 0:i.min)?i.min:t-n*h,void 0!==(null==i?void 0:i.max)?i.max:s+n*h]}static niceStep(t,s){if(t<=0||s<=0)return 1;const i=t/s,h=Math.pow(10,Math.floor(Math.log10(i))),n=i/h;let r;return r=n<=1?1:n<=2?2:n<=2.5?2.5:n<=5?5:10,r*h}ticks(s){const i=this.domainMax-this.domainMin;if(i<=0)return[this.domainMin];const h=t.niceStep(i,s),n=[];for(let t=Math.ceil(this.domainMin/h)*h;t<=this.domainMax+1e-9*h;t+=h)n.push(Math.abs(t)<1e-9*h?0:t);return n}static tickDecimals(t){let s=0;for(const i of t){const t=String(i),h=t.indexOf(".");h>=0&&(s=Math.max(s,Math.min(2,t.length-h-1)))}return s}}export{t as N}